/* ============================================================
   WhyERP — LUXE UI OVERRIDE
   Tema mewah: ink charcoal + emerald sage.
   SEMUA class/ID dipertahankan agar JS tetap berfungsi.
   ============================================================ */

:root {
  --mod-primary: #1976D2;
  --mod-primary-2: #42A5F5;
  --mod-accent: #1976D2;
  --mod-green: #1976D2;
  --mod-teal: #14b8a6;
  --mod-red: #ef4444;
  --mod-ink: rgba(30, 30, 30, 0.45);
  --mod-radius: 18px;
  --mod-shadow: 0 10px 36px rgba(30, 30, 30, 0.14);
  --mod-shadow-lg: 0 28px 70px rgba(30, 30, 30, 0.32);
  --mod-font: 'Sora', system-ui, -apple-system, sans-serif;
  --mod-display: 'Cormorant Garamond', Georgia, serif;
}

:root[data-theme="dark"] {
  --bg-main: #1E1E1E;
  --bg-panel: #252525;
  --bg-panel-light: #2D2D2D;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.12);
  --input-bg: rgba(255, 255, 255, 0.05);
  --accent: #1976D2;
  --accent2: #42A5F5;
  --teal: #14b8a6;
  --mod-bg-glow:
    radial-gradient(900px 520px at 8% -8%, rgba(25, 118, 210, 0.08), transparent 55%),
    radial-gradient(700px 480px at 95% 0%, rgba(20, 184, 166, 0.05), transparent 50%),
    radial-gradient(800px 560px at 70% 110%, rgba(25, 118, 210, 0.04), transparent 55%);
  --mod-surface: #252525;
  --mod-surface-2: #2A2A2A;
  --mod-border: rgba(255, 255, 255, 0.10);
  --mod-soft: rgba(255, 255, 255, 0.05);
  --mod-soft-2: rgba(255, 255, 255, 0.10);
}

:root[data-theme="light"] {
  --bg-main: #fafafa;
  --bg-panel: #ffffff;
  --bg-panel-light: #f4f4f5;
  --border-color: rgba(0, 0, 0, 0.06);
  --border-light: rgba(0, 0, 0, 0.10);
  --input-bg: rgba(0, 0, 0, 0.03);
  --accent: #1976D2;
  --accent2: #42A5F5;
  --teal: #14b8a6;
  --mod-bg-glow:
    radial-gradient(900px 480px at 5% -10%, rgba(25, 118, 210, 0.06), transparent 55%),
    radial-gradient(700px 420px at 100% 0%, rgba(20, 184, 166, 0.04), transparent 50%);
  --mod-surface: #ffffff;
  --mod-surface-2: #f4f4f5;
  --mod-border: rgba(0, 0, 0, 0.08);
  --mod-soft: rgba(0, 0, 0, 0.035);
  --mod-soft-2: rgba(255, 255, 255, 0.10);
}

/* ---------- BASE ---------- */
body {
  font-family: var(--mod-font);
  background: var(--bg-main);
  background-image: var(--mod-bg-glow);
  background-attachment: fixed;
  background-size: cover;
}

/* Ensure Bootstrap Icons render at the right size/alignment in any context */
:where(button, .btn, a, h1, h2, h3, h4, h5, .stat-label, .card-header, .badge) .bi,
.bi.bi-arrow-right {
  font-size: 0.9em;
  line-height: 1;
  vertical-align: -0.15em;
  display: inline-block;
}

.login-logo h1,
.sidebar-brand h2,
.topbar h3 {
  font-family: var(--mod-display);
}

.stat-value,
.mistine-stat-value {
  font-family: var(--mod-font);
  font-weight: 800;
  letter-spacing: -0.5px;
}

/* ---------- LOGIN ---------- */
#loginPage {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 80% 60% at 20% 15%, rgba(255, 255, 255, 0.22), transparent 55%),
    radial-gradient(ellipse 70% 50% at 85% 85%, rgba(100, 116, 139, 0.08), transparent 50%),
    #1E1E1E;
  overflow: auto;
}

:root[data-theme="light"] #loginPage {
  background:
    radial-gradient(ellipse 80% 60% at 15% 10%, rgba(255, 255, 255, 0.18), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 90%, rgba(100, 116, 139, 0.06), transparent 50%),
    #fafafa;
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  max-width: 95vw;
  margin: 0 auto;
  padding: 40px 32px 36px;
  border-radius: 24px;
  background: rgba(30, 30, 30, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  animation: loginReveal 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes loginReveal {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

:root[data-theme="light"] .login-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(30, 30, 30, 0.08);
  box-shadow: 0 24px 60px rgba(30, 30, 30, 0.12);
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo .icon {
  width: 96px !important;
  max-width: 40% !important;
  max-height: 72px !important;
  height: auto !important;
  margin: 0 auto 14px !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-logo .icon img {
  width: 100%;
  height: auto;
  max-height: 72px !important;
  object-fit: contain;
}

.login-logo h1 {
  font-family: var(--mod-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.3px;
  margin: 0;
  color: #E0E0E0;
  background: none;
  -webkit-text-fill-color: #E0E0E0;
}

:root[data-theme="light"] .login-logo h1 {
  color: #1E1E1E;
  -webkit-text-fill-color: #1E1E1E;
  background: none;
}

.login-logo p {
  color: rgba(224, 224, 224, 0.55);
  font-size: 13.5px;
  margin-top: 6px;
}

:root[data-theme="light"] .login-logo p {
  color: var(--text-muted);
}

#loginPage .form-group label {
  color: rgba(224, 224, 224, 0.55);
  font-family: var(--mod-font);
  font-size: 11px;
  letter-spacing: 1.2px;
}

:root[data-theme="light"] #loginPage .form-group label {
  color: var(--text-muted);
}

#loginPage .form-control {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #E0E0E0;
  border-radius: 12px;
  padding: 14px 16px;
  font-family: var(--mod-font);
}

#loginPage .form-control::placeholder {
  color: rgba(224, 224, 224, 0.32);
}

#loginPage .form-control:focus {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.40);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.14);
}

:root[data-theme="light"] #loginPage .form-control {
  background: #fff;
  border: 1px solid rgba(30, 30, 30, 0.12);
  color: #1E1E1E;
}

:root[data-theme="light"] #loginPage .form-control::placeholder {
  color: rgba(30, 30, 30, 0.35);
}

:root[data-theme="light"] #loginPage .form-control:focus {
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}

.btn-login {
  background: linear-gradient(135deg, #1976D2, #42A5F5);
  color: #ffffff !important;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(255, 255, 255, 0.28);
  letter-spacing: 0.6px;
  font-size: 15px;
  font-weight: 700;
  padding: 15px;
  margin-top: 6px;
}

.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(25, 118, 210, 0.30);
  background: linear-gradient(135deg, #1976D2, #1976D2);
}

:root[data-theme="light"] .btn-login {
  background: linear-gradient(135deg, #1976D2, #42A5F5);
  color: #ffffff !important;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.18);
}

:root[data-theme="light"] .login-divider {
  color: rgba(30, 30, 30, 0.4);
}

:root[data-theme="light"] .login-divider::before,
:root[data-theme="light"] .login-divider::after {
  background: rgba(30, 30, 30, 0.12);
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px;
  background: #ffffff;
  color: #1E1E1E !important;
  border: 1px solid rgba(255, 255, 255, 0.20);
  border-radius: 12px;
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.btn-google:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.26);
  border-color: rgba(255, 255, 255, 0.5);
}

.btn-google .g-svg {
  flex-shrink: 0;
}

:root[data-theme="light"] .btn-google {
  background: #ffffff;
  border: 1px solid rgba(30, 30, 30, 0.15);
  box-shadow: 0 6px 18px rgba(30, 30, 30, 0.08);
}

.login-google-link {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed rgba(255, 255, 255, 0.20);
}

:root[data-theme="light"] .login-google-link {
  border-top-color: rgba(30, 30, 30, 0.15);
}

.google-link-info {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text, #E0E0E0);
}

:root[data-theme="light"] .google-link-info {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(30, 30, 30, 0.8);
}

.btn-link-cancel {
  width: 100%;
  padding: 12px;
  margin-top: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-link-cancel:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.08);
}

:root[data-theme="light"] .btn-link-cancel {
  color: rgba(30, 30, 30, 0.6);
  border-color: rgba(30, 30, 30, 0.18);
}

:root[data-theme="light"] .btn-link-cancel:hover {
  color: rgba(30, 30, 30, 0.9);
  border-color: rgba(30, 30, 30, 0.4);
  background: rgba(30, 30, 30, 0.05);
}

/* ============================================================
   Halaman Login Split: kiri = perkenalan sistem, kanan = form
   ============================================================ */
#loginPage {
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
}

.login-shell {
  display: flex;
  width: 100%;
  min-height: 100vh;
  align-items: stretch;
}

.login-intro {
  flex: 1 1 52%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px clamp(28px, 5vw, 72px);
  position: relative;
  overflow: hidden;
  background: #1E1E1E;
  border-right: none;
}

.login-intro::before {
  content: none;
}

.login-intro > * {
  position: relative;
  z-index: 1;
}

.intro-brand {
  margin-bottom: 34px;
}

.intro-logo {
  width: min(320px, 80%);
  height: auto;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.20);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 20px;
  margin-bottom: 22px;
  box-shadow: 0 12px 34px rgba(255, 255, 255, 0.22);
}

.intro-logo img {
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.25));
  border-radius: 12px;
}

.login-intro h1 {
  font-family: var(--mod-font);
  font-size: clamp(30px, 3.2vw, 46px);
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.15;
  color: #E0E0E0;
  margin: 0 0 10px;
}

.intro-subtitle {
  color: rgba(255, 255, 255, 0.85);
  font-family: var(--mod-font);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  margin: 0;
}

.intro-body {
  max-width: 520px;
}

.intro-desc {
  color: rgba(224, 224, 224, 0.72);
  font-family: var(--mod-font);
  font-size: 16px;
  line-height: 1.7;
  margin: 0 0 26px;
}

.intro-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  align-items: start;
}

.intro-feature {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 16px 16px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: transform 0.2s, background 0.2s, border-color 0.2s;
}

.intro-feature:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.25);
}

.intro-feature i {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.12));
  color: #E0E0E0;
  font-size: 15px;
}

.intro-feature .feat-txt {
  color: rgba(224, 224, 224, 0.8);
  font-family: var(--mod-font);
  font-size: 13.5px;
  line-height: 1.55;
}

.intro-foot {
  margin-top: 40px;
}

.intro-foot p {
  color: rgba(255, 255, 255, 0.45);
  font-family: var(--mod-font);
  font-size: 12px;
  letter-spacing: 0.4px;
  margin: 0;
}

.login-panel {
  flex: 1 1 48%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: #1E1E1E;
}

:root[data-theme="light"] .login-panel {
  background: #fafafa;
}

.login-welcome {
  text-align: center;
  margin-bottom: 22px;
}

.login-welcome h2 {
  font-family: var(--mod-font);
  font-size: 26px;
  font-weight: 800;
  color: #E0E0E0;
  margin: 0 0 6px;
  letter-spacing: -0.3px;
}

.login-welcome p {
  color: rgba(224, 224, 224, 0.55);
  font-family: var(--mod-font);
  font-size: 13px;
  margin: 0;
}

:root[data-theme="light"] .login-welcome h2 {
  color: #1E1E1E;
}

:root[data-theme="light"] .login-welcome p {
  color: rgba(30, 30, 30, 0.55);
}

:root[data-theme="light"] .login-intro {
  background: #fafafa;
  border-right: none;
}

:root[data-theme="light"] .login-intro h1 {
  color: #1E1E1E;
}

:root[data-theme="light"] .intro-subtitle {
  color: rgba(255, 255, 255, 0.9);
}

:root[data-theme="light"] .intro-desc {
  color: rgba(30, 30, 30, 0.7);
}

:root[data-theme="light"] .intro-feature {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.14);
}

:root[data-theme="light"] .intro-feature:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.28);
}

:root[data-theme="light"] .intro-feature i {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.08));
  color: #BDBDBD;
}

:root[data-theme="light"] .intro-feature .feat-txt {
  color: rgba(30, 30, 30, 0.78);
}

:root[data-theme="light"] .intro-foot p {
  color: rgba(30, 30, 30, 0.4);
}

:root[data-theme="light"] .intro-logo {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04));
  border-color: rgba(255, 255, 255, 0.2);
}

/* Responsif: mobile → intro di atas, form di bawah */
@media (max-width: 860px) {
  #loginPage {
    padding: 0;
  }

  .login-shell {
    flex-direction: column;
    min-height: 100vh;
  }

  .login-intro {
    flex: none;
    padding: 28px 24px 18px;
    justify-content: flex-start;
    text-align: center;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  .login-intro::before {
    content: none;
  }

  .intro-brand {
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .intro-logo {
    width: min(250px, 78%);
    height: auto;
    padding: 12px 14px;
    margin-bottom: 14px;
    border-radius: 16px;
  }

  .login-intro h1 {
    font-size: 26px;
    margin-bottom: 6px;
  }

  .intro-subtitle {
    font-size: 12px;
    letter-spacing: 1.8px;
  }

  .intro-body {
    max-width: 100%;
  }

  .intro-desc {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
    text-align: center;
  }

  .intro-features {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .intro-feature {
    padding: 12px 14px;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
  }

  .intro-feature i {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }

  .intro-feature .feat-txt {
    font-size: 13px;
  }

  .intro-foot {
    margin-top: 20px;
  }

  .login-panel {
    flex: none;
    padding: 20px 16px 36px;
  }

  .login-card {
    width: 100%;
  }
}

.login-error {
  color: #E0E0E0;
  font-size: 13px;
  text-align: center;
  margin-top: 14px;
  font-weight: 600;
}

@media (max-width: 640px) {
  .login-card {
    padding: 28px 20px 24px;
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
  }
}

/* ---------- SIDEBAR ---------- */
.sidebar {
  background: linear-gradient(180deg, var(--mod-surface), var(--mod-surface-2));
  border-right: 1px solid var(--mod-border);
  box-shadow: 12px 0 40px rgba(30, 30, 30, 0.08);
}

.sidebar-brand h2 {
  background: linear-gradient(120deg, var(--mod-accent), var(--mod-primary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.sidebar-user {
  margin: 4px 12px 10px;
  padding: 12px 14px;
  background: var(--mod-soft);
  border: 1px solid var(--mod-border);
  border-radius: 14px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--mod-primary), var(--mod-primary-2));
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(255, 255, 255, 0.28);
}

.nav-section {
  font-size: 10.5px;
  letter-spacing: 1.4px;
  opacity: 0.7;
  margin-top: 6px;
}

.nav-group {
  margin: 4px 8px;
  border-radius: 12px;
  overflow: hidden;
}

.nav-group-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  margin: 2px 0;
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted, #9aa3b2);
  cursor: pointer;
  user-select: none;
  transition: background 0.18s, color 0.18s;
}

.nav-group-header:hover {
  background: var(--mod-soft-2, rgba(255, 255, 255, 0.10));
  color: var(--text-main, #E0E0E0);
}

.nav-group-header .nav-group-label {
  flex: 1;
}

.nav-group-header .nav-chevron {
  font-size: 10px;
  opacity: 0.6;
  transition: transform 0.2s;
}

.nav-group.open > .nav-group-header .nav-chevron {
  transform: rotate(180deg);
}

.nav-group-body {
  display: none;
}

    .nav-group.open > .nav-group-body {
      display: block;
      animation: navGroupIn 0.2s ease;
    }

@keyframes navGroupIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.nav-group-body .nav-item {
  padding-left: 28px;
}

.nav-item {
  margin: 2px 10px;
  padding: 10px 14px;
  border-radius: 12px;
  border-left: none;
  gap: 12px;
  transition: background 0.18s, color 0.18s, transform 0.18s, box-shadow 0.18s;
}

.nav-item:hover {
  background: var(--mod-soft-2);
  transform: translateX(3px);
}

.nav-item.active {
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.08));
  border-left: none;
  color: var(--mod-primary);
  box-shadow: inset 3px 0 0 var(--mod-primary), 0 4px 18px rgba(255, 255, 255, 0.12);
}

:root[data-theme="dark"] .nav-item.active {
  color: #E0E0E0;
}

.nav-item .icon {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--mod-soft);
  border-radius: 8px;
  font-size: 15px;
  flex-shrink: 0;
}

.nav-item.active .icon {
  background: linear-gradient(135deg, var(--mod-primary), var(--mod-primary-2));
  color: #ffffff;
}

.btn-logout {
  margin: 0 10px 14px;
  width: auto;
  border-radius: 12px;
  padding: 11px;
}

/* ---------- TOPBAR ---------- */
.topbar {
  background: color-mix(in srgb, var(--mod-surface) 88%, transparent);
  border-bottom: 1px solid var(--mod-border) !important;
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: 0 4px 24px rgba(30, 30, 30, 0.05) !important;
}

.topbar h3 {
  font-weight: 600;
  letter-spacing: -0.3px;
}

.btn-toggle {
  border-radius: 10px;
  box-shadow: none;
}

/* ---------- CARDS ---------- */
.card {
  background: var(--mod-surface);
  border: 1px solid var(--mod-border);
  border-radius: var(--mod-radius);
  box-shadow: var(--mod-shadow);
  padding: 22px;
  transition: transform 0.2s, box-shadow 0.25s, border-color 0.2s;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.30);
  box-shadow: 0 14px 40px rgba(30, 30, 30, 0.14);
}

.card-header h4 {
  font-weight: 600;
  letter-spacing: -0.3px;
}

/* ---------- STAT CARDS ---------- */
.stat-card {
  position: relative;
  background: var(--mod-surface);
  border: 1px solid var(--mod-border);
  border-radius: var(--mod-radius);
  padding: 22px 24px 20px;
  overflow: hidden;
  box-shadow: var(--mod-shadow);
  transition: transform 0.22s, box-shadow 0.25s, border-color 0.2s;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, var(--mod-primary), var(--mod-primary-2));
}

.stat-card.green::before { background: linear-gradient(90deg, var(--green), #9E9E9E); }
.stat-card.amber::before { background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.stat-card.teal::before { background: linear-gradient(90deg, var(--teal), #9E9E9E); }
.stat-card.red::before { background: linear-gradient(90deg, var(--red), #9E9E9E); }

.stat-card:hover {
  transform: translateY(-6px) scale(1.01);
  border-color: var(--mod-primary);
  box-shadow: var(--mod-shadow-lg);
}

.stat-card::after {
  top: -24px;
  right: -24px;
  width: 110px;
  height: 110px;
  opacity: 0.14;
  background: var(--mod-primary);
}

.stat-card.green::after { background: var(--green); }
.stat-card.amber::after { background: var(--accent); }
.stat-card.teal::after { background: var(--teal); }
.stat-card.red::after { background: var(--red); }

.stat-label {
  font-weight: 700;
  letter-spacing: 0.9px;
}

.stat-value {
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -1px;
}

.stat-icon {
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  font-size: 20px;
  opacity: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--mod-soft-2);
  border-radius: 14px;
}

/* ---------- TABLES ---------- */
.table-wrap {
  border-radius: var(--mod-radius);
  border: 1px solid var(--mod-border);
  box-shadow: var(--mod-shadow);
  background: var(--mod-surface);
}

table {
  font-size: 13.5px;
}

thead tr {
  background: var(--mod-soft) !important;
}

th {
  padding: 15px 16px;
  font-weight: 700;
  letter-spacing: 0.9px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--mod-border) !important;
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--mod-border);
}

tr:nth-child(even) {
  background: var(--mod-soft);
}

tr:hover td {
  background: rgba(255, 255, 255, 0.06) !important;
}

/* ---------- FORMS ---------- */
.form-control,
.form-select {
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid var(--mod-border);
  background-color: var(--mod-soft);
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--mod-primary);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.16);
  background-color: var(--mod-surface);
}

.form-label {
  font-weight: 700;
  letter-spacing: 0.4px;
  margin-bottom: 8px;
}

.form-group {
  margin-bottom: 20px;
}

.form-check-input:checked {
  background-color: var(--mod-primary);
  border-color: var(--mod-primary);
}

/* ---------- BUTTONS ---------- */
.btn {
  border-radius: 12px;
  font-weight: 700;
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.btn-primary {
  background: linear-gradient(135deg, var(--mod-primary), var(--mod-primary-2));
  border: none;
  color: #ffffff;
  box-shadow: 0 8px 22px rgba(25, 118, 210, 0.28);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--mod-accent), var(--mod-primary));
  box-shadow: 0 10px 28px rgba(25, 118, 210, 0.32);
  color: #ffffff;
}

.btn-teal {
  background: linear-gradient(135deg, var(--teal), #9E9E9E);
  border: none;
  color: #fff;
}

.btn-success {
  background: linear-gradient(135deg, var(--green), #9E9E9E);
  border: none;
}

.btn-danger {
  background: linear-gradient(135deg, var(--red), #9E9E9E);
  border: none;
}

.btn-ghost {
  background: var(--mod-soft);
  border: 1px solid var(--mod-border);
  color: var(--text-main);
  border-radius: 12px;
}

.btn-ghost:hover {
  background: var(--mod-soft-2);
  border-color: var(--mod-primary);
  color: var(--mod-primary);
}

.btn-sm {
  border-radius: 8px;
}

/* ---------- MODALS ---------- */
.modal-overlay {
  background: rgba(30, 30, 30, 0.62);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: opacity 0.25s;
}

.custom-modal {
  background: var(--mod-surface);
  border: 1px solid var(--mod-border);
  border-radius: 22px;
  padding: 30px;
  box-shadow: var(--mod-shadow-lg);
  animation: modIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
}

 .custom-modal h3 {
   font-weight: 600;
   letter-spacing: -0.3px;
 }

 .lk-checklist {
   max-height: 170px;
   overflow-y: auto;
   border: 1px solid var(--mod-border, #E0E0E0);
   border-radius: 10px;
   padding: 8px 10px;
   display: grid;
   grid-template-columns: 1fr 1fr;
   gap: 4px 14px;
   background: var(--mod-soft, #E0E0E0);
 }
 .lk-checklist label {
   display: flex;
   align-items: center;
   gap: 6px;
   font-size: 13px;
   font-weight: 400;
   margin: 0;
   cursor: pointer;
 }

.modal-close {
  background: var(--mod-soft);
  border-radius: 50%;
  transition: background 0.2s, transform 0.2s;
}

.modal-close:hover {
  background: var(--mod-soft-2);
  transform: rotate(90deg);
}

@keyframes modIn {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-footer {
  border-top: 1px solid var(--mod-border);
  padding-top: 18px;
  margin-top: 22px;
}

/* ---------- BADGES ---------- */
.badge {
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 4px 10px;
  border-radius: 20px;
}

/* ---------- TABS ---------- */
.kar-tabs,
.order-tab-panel .sub-tabs,
.sub-tabs {
  background: var(--mod-soft);
  border: 1px solid var(--mod-border);
  border-radius: 14px;
}

.kar-tab.active {
  background: linear-gradient(135deg, var(--mod-primary), var(--mod-primary-2));
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(255, 255, 255, 0.28);
}

.kar-tab.active .tab-count {
  background: rgba(30, 30, 30, 0.18);
  color: #ffffff;
}

.kar-tab.tab-danger.active {
  background: linear-gradient(135deg, var(--red), #9E9E9E);
  color: #fff;
}

.kar-tab.tab-blue.active {
  background: linear-gradient(135deg, var(--teal), #9E9E9E);
  color: #fff;
}

/* ---------- SIDEBAR ATTENDANCE CARD ---------- */
.sidebar-attendance-card {
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05));
  border: 1px solid rgba(255, 255, 255, 0.20);
  border-radius: 16px;
  margin: 6px 12px 14px;
  padding: 14px;
}

/* ---------- MISC ---------- */
.sub-tab.active::after {
  background: linear-gradient(90deg, var(--mod-primary), var(--mod-primary-2));
  border-radius: 10px;
}

.search-box i {
  color: var(--text-muted);
}

.content ::-webkit-scrollbar,
.table-wrap ::-webkit-scrollbar,
.custom-modal ::-webkit-scrollbar {
  display: block;
  width: 8px;
  height: 8px;
}

.content ::-webkit-scrollbar-thumb,
.table-wrap ::-webkit-scrollbar-thumb,
.custom-modal ::-webkit-scrollbar-thumb {
  background: var(--mod-soft-2);
  border-radius: 8px;
}

.content ::-webkit-scrollbar-thumb:hover,
.table-wrap ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.30);
}

/* ---------- RESPONSIVE ---------- */


@media (max-width: 640px) {
  .stat-card { padding: 20px; }
  .stat-value { font-size: 26px; }
  .card { padding: 18px; }
}

/* ===== CLEAN COLOR OVERRIDES ===== */
.btn-warning, .bg-warning { background: #f59e0b !important; color: #fff !important; border-color: #f59e0b !important; }
.btn-success, .bg-success { background: #1976D2 !important; color: #fff !important; border-color: #1976D2 !important; }
.btn-danger, .bg-danger { background: #ef4444 !important; color: #fff !important; border-color: #ef4444 !important; }
.btn-info, .bg-info { background: #0ea5e9 !important; color: #fff !important; border-color: #0ea5e9 !important; }
.btn-primary, .bg-primary { background: #1976D2 !important; color: #fff !important; border-color: #1976D2 !important; }
.btn-secondary, .bg-secondary { background: #64748b !important; color: #fff !important; border-color: #64748b !important; }
.btn-outline-success { color: #1976D2 !important; border-color: #1976D2 !important; background: transparent !important; }
.btn-outline-danger { color: #ef4444 !important; border-color: #ef4444 !important; background: transparent !important; }
.btn-outline-info { color: #0ea5e9 !important; border-color: #0ea5e9 !important; background: transparent !important; }
.btn-outline-warning { color: #f59e0b !important; border-color: #f59e0b !important; background: transparent !important; }
.btn-outline-primary { color: #1976D2 !important; border-color: #1976D2 !important; background: transparent !important; }
.btn-outline-secondary { color: #64748b !important; border-color: #64748b !important; background: transparent !important; }
.btn-outline-teal { color: #14b8a6 !important; border-color: #14b8a6 !important; background: transparent !important; }
.text-success { color: #1976D2 !important; }
.text-danger { color: #ef4444 !important; }
.text-warning { color: #f59e0b !important; }
.text-info { color: #0ea5e9 !important; }
.text-primary { color: #1976D2 !important; }
.bg-gradient-success { background: #1976D2 !important; }
.bg-gradient-danger { background: #ef4444 !important; }
.bg-gradient-warning { background: #f59e0b !important; }
.bg-gradient-info { background: #0ea5e9 !important; }
.bg-success-subtle { background: rgba(13, 86, 165,0.12) !important; color: #1976D2 !important; }
.bg-danger-subtle { background: rgba(239,68,68,0.12) !important; color: #ef4444 !important; }
.bg-warning-subtle { background: rgba(245,158,11,0.12) !important; color: #f59e0b !important; }
.bg-info-subtle { background: rgba(14,165,233,0.12) !important; color: #0ea5e9 !important; }
.bg-primary-subtle { background: rgba(25, 118, 210,0.12) !important; color: #1976D2 !important; }
