/* ═══════════════════════════════════════════════════════════════════
   SIMPEG IUP UNPAD — Design System v3
   Dual Theme: Dark Navy  ↔  Light Slate
   Author: UNPAD FEB IT
   ═══════════════════════════════════════════════════════════════════ */

/* ── Layout constants (theme-independent) ─────────────────────── */
:root {
  --sidebar-w:           260px;
  --sidebar-w-col:        72px;
  --topbar-h:             64px;
  --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-xl: 20px;
  --font-body:    'DM Sans', system-ui, sans-serif;
  --font-display: 'DM Serif Display', Georgia, serif;
}

/* ══ DARK THEME ═══════════════════════════════════════════════════ */
:root, html[data-theme="dark"] {
  --accent:        #3b82f6;
  --accent-bright: #60a5fa;
  --accent-dim:    rgba(59,130,246,0.13);
  --violet:        #8b5cf6;
  --emerald:       #10b981;
  --gold:          #f59e0b;
  --rose:          #ef4444;
  --cyan:          #06b6d4;

  --bg:            #060d1a;
  --bg-grad:
    radial-gradient(ellipse 80% 60% at 10% 0%,  rgba(30,74,140,0.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 100%, rgba(59,130,246,0.08) 0%, transparent 50%);

  --s1: #0d1b33;   /* sidebar, cards */
  --s2: #112240;   /* main cards */
  --s3: #162e54;   /* table head, hover */
  --s4: #1d3a68;   /* deep accents */

  --bd:     rgba(59,130,246,0.14);
  --bd-h:   rgba(59,130,246,0.34);
  --bd-f:   rgba(59,130,246,0.60);

  --tx1: #e8edf4;   /* primary */
  --tx2: #94a3b8;   /* secondary */
  --tx3: #64748b;   /* muted */
  --tx4: #334155;   /* disabled */

  --sidebar-bg:     var(--s1);
  --sidebar-bd:     rgba(59,130,246,0.12);
  --nav-active-bg:  rgba(59,130,246,0.15);
  --nav-active-tx:  #60a5fa;
  --nav-hover-bg:   rgba(59,130,246,0.07);
  --nav-label-tx:   #2d4470;

  --topbar-bg:      rgba(13,27,51,0.90);
  --topbar-bd:      rgba(59,130,246,0.12);

  --card-bg:        var(--s2);
  --card-hd:        rgba(20,45,88,0.5);
  --card-bd:        rgba(59,130,246,0.14);

  --th-bg:    var(--s3);  --th-tx: #94a3b8;
  --tr-hover: rgba(59,130,246,0.06);
  --tr-bd:    rgba(59,130,246,0.07);

  --inp:       rgba(15,32,64,0.85);
  --inp-focus: rgba(15,32,64,0.98);
  --inp-tx:    #e8edf4;
  --inp-ph:    #64748b;
  --lbl-tx:    #94a3b8;

  --sh-sm: 0 2px  8px rgba(0,0,0,0.35);
  --sh-md: 0 4px 20px rgba(0,0,0,0.45);
  --sh-lg: 0 8px 40px rgba(0,0,0,0.55);
  --glow:  0 0   20px rgba(59,130,246,0.22);

  --modal-bg: var(--s2); --modal-hd: rgba(20,45,88,0.6); --modal-bd: rgba(59,130,246,0.14);

  --sc-track: #0d1b33; --sc-thumb: #1d3a68;
  --sk-a: #112240; --sk-b: #162e54;
  --upzone-bg: rgba(59,130,246,0.03); --upzone-bd: rgba(59,130,246,0.18); --upzone-hv: rgba(59,130,246,0.08);
  --pg-bg: var(--s2); --pg-tx: #94a3b8;
  --prog-track: var(--s3);

  --toggle-orb: #a5b4fc;
  --toggle-moon-bg: rgba(165,180,252,0.12);

  color-scheme: dark;
}

/* ══ LIGHT THEME ══════════════════════════════════════════════════ */
html[data-theme="light"] {
  --accent:        #2563eb;
  --accent-bright: #3b82f6;
  --accent-dim:    rgba(37,99,235,0.09);
  --violet:        #7c3aed;
  --emerald:       #059669;
  --gold:          #d97706;
  --rose:          #dc2626;
  --cyan:          #0891b2;

  --bg:   #f0f4f8;
  --bg-grad:
    radial-gradient(ellipse 80% 60% at 10% 0%,  rgba(37,99,235,0.05) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 100%, rgba(124,58,237,0.04) 0%, transparent 50%);

  --s1: #ffffff;
  --s2: #ffffff;
  --s3: #f8fafc;
  --s4: #f1f5f9;

  --bd:   rgba(15,23,42,0.09);
  --bd-h: rgba(37,99,235,0.30);
  --bd-f: rgba(37,99,235,0.55);

  --tx1: #0f172a;
  --tx2: #475569;
  --tx3: #94a3b8;
  --tx4: #cbd5e1;

  --sidebar-bg:    #ffffff;
  --sidebar-bd:    rgba(15,23,42,0.08);
  --nav-active-bg: rgba(37,99,235,0.08);
  --nav-active-tx: #2563eb;
  --nav-hover-bg:  rgba(37,99,235,0.05);
  --nav-label-tx:  #cbd5e1;

  --topbar-bg:     rgba(255,255,255,0.92);
  --topbar-bd:     rgba(15,23,42,0.08);

  --card-bg:  #ffffff;
  --card-hd:  #f8fafc;
  --card-bd:  rgba(15,23,42,0.08);

  --th-bg:    #f8fafc; --th-tx: #64748b;
  --tr-hover: rgba(37,99,235,0.04);
  --tr-bd:    rgba(15,23,42,0.07);

  --inp:       #ffffff;
  --inp-focus: #ffffff;
  --inp-tx:    #0f172a;
  --inp-ph:    #94a3b8;
  --lbl-tx:    #475569;

  --sh-sm: 0 1px  4px rgba(15,23,42,0.07);
  --sh-md: 0 4px 14px rgba(15,23,42,0.09);
  --sh-lg: 0 8px 30px rgba(15,23,42,0.12);
  --glow:  0 0   16px rgba(37,99,235,0.12);

  --modal-bg: #ffffff; --modal-hd: #f8fafc; --modal-bd: rgba(15,23,42,0.08);

  --sc-track: #f1f5f9; --sc-thumb: #cbd5e1;
  --sk-a: #f1f5f9; --sk-b: #e2e8f0;
  --upzone-bg: rgba(37,99,235,0.02); --upzone-bd: rgba(37,99,235,0.2); --upzone-hv: rgba(37,99,235,0.06);
  --pg-bg: #ffffff; --pg-tx: #475569;
  --prog-track: #e2e8f0;

  --toggle-orb: #d97706;
  --toggle-moon-bg: rgba(217,119,6,0.10);

  color-scheme: light;
}

/* ══ THEME TRANSITION ═════════════════════════════════════════════ */
/* Applied via JS class to avoid transition on first load */
html.theme-transition,
html.theme-transition *,
html.theme-transition *::before,
html.theme-transition *::after {
  transition:
    background-color 0.30s ease,
    border-color     0.30s ease,
    color            0.30s ease,
    box-shadow       0.30s ease,
    fill             0.30s ease !important;
}

/* ══ BASE ═════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 15px; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background-color: var(--bg);
  background-image: var(--bg-grad);
  color: var(--tx1);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ══ THEME TOGGLE BUTTON ══════════════════════════════════════════ */
.btn-theme {
  position: relative;
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  border: 1px solid var(--bd);
  background: var(--s3);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  padding: 0;
  transition: border-color 0.2s, background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.btn-theme:hover {
  border-color: var(--bd-h);
  background: var(--s4);
  transform: translateY(-1px);
  box-shadow: var(--sh-sm);
}

.btn-theme:active { transform: scale(0.92); }

/* Two icons stacked — CSS transitions handle show/hide */
.btn-theme .t-icon {
  position: absolute;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Dark mode state: moon shown, sun hidden ── */
html[data-theme="dark"]  .t-sun  { opacity: 0; transform: rotate(45deg)  translateY(20px); }
html[data-theme="dark"]  .t-moon { opacity: 1; transform: rotate(0deg)   translateY(0);    color: #a5b4fc; }

/* ── Light mode state: sun shown, moon hidden ── */
html[data-theme="light"] .t-sun  { opacity: 1; transform: rotate(0deg)   translateY(0);    color: #d97706; }
html[data-theme="light"] .t-moon { opacity: 0; transform: rotate(-45deg) translateY(-20px); }

/* Pulse ring on click */
.btn-theme::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: var(--r-md);
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s;
}

.btn-theme.clicked::after { opacity: 0.20; }

/* Tooltip */
.btn-theme[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%; transform: translateX(-50%);
  background: var(--s4);
  border: 1px solid var(--bd);
  color: var(--tx2);
  font-family: var(--font-body);
  font-size: 11px;
  white-space: nowrap;
  padding: 4px 9px;
  border-radius: var(--r-sm);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  box-shadow: var(--sh-sm);
}

.btn-theme:hover::before { opacity: 1; }

/* ══ LAYOUT ═══════════════════════════════════════════════════════ */
.app-wrapper { display: flex; min-height: 100vh; }

/* ── Sidebar ────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-bd);
  display: flex; flex-direction: column;
  position: fixed; left: 0; top: 0; bottom: 0;
  z-index: 1000;
  overflow: hidden;
  box-shadow: 4px 0 20px rgba(0,0,0,0.06);
  transition: width 0.28s cubic-bezier(0.4,0,0.2,1),
              transform 0.28s cubic-bezier(0.4,0,0.2,1);
}

.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--sidebar-bd);
  flex-shrink: 0;
}

.brand-icon {
  width: 38px; height: 38px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; color: #fff;
  box-shadow: 0 4px 12px rgba(59,130,246,0.35);
}

.brand-title {
  font-family: var(--font-display);
  font-size: 17px; color: var(--tx1); line-height: 1;
  display: block; white-space: nowrap;
}

.brand-sub {
  font-size: 10px; color: var(--tx3);
  letter-spacing: 0.12em; text-transform: uppercase;
  display: block; margin-top: 2px; white-space: nowrap;
}

.sidebar-divider { height: 1px; background: var(--sidebar-bd); margin: 0 14px; flex-shrink: 0; }

.sidebar-nav {
  list-style: none; padding: 12px 10px; margin: 0;
  flex: 1; overflow-y: auto; overflow-x: hidden;
}

.nav-label {
  font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--nav-label-tx);
  padding: 8px 10px 4px;
  white-space: nowrap; overflow: hidden;
}

.nav-item { margin-bottom: 2px; }

.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 11px; border-radius: var(--r-md);
  color: var(--tx2); text-decoration: none;
  font-size: 13.5px; font-weight: 450;
  position: relative; white-space: nowrap; overflow: hidden;
}

.nav-link:hover { background: var(--nav-hover-bg); color: var(--tx1); }

.nav-item .active {
  background: var(--nav-active-bg);
  color: var(--nav-active-tx);
  /* background: var(--nav-hover-bg); 
  color: var(--tx1); */
  font-weight: 550;
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav-icon { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.nav-text { overflow: hidden; text-overflow: ellipsis; }

.nav-indicator {
  width: 5px; height: 5px;
  background: var(--accent); border-radius: 50%;
  margin-left: auto; flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(59,130,246,0.4);
  animation: nav-ping 2.4s ease infinite;
}

@keyframes nav-ping {
  0%,100% { box-shadow: 0 0 0 0   rgba(59,130,246,0.4); }
  60%      { box-shadow: 0 0 0 5px rgba(59,130,246,0); }
}

.sidebar-footer { padding: 12px; border-top: 1px solid var(--sidebar-bd); flex-shrink: 0; }

.user-card {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px;
  background: var(--s3); border-radius: var(--r-md); border: 1px solid var(--bd);
}

.user-avatar {
  width: 32px; height: 32px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--s4), var(--s3));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--tx3);
  border: 1.5px solid var(--bd-h);
}

.user-name { font-size: 13px; font-weight: 600; color: var(--tx1); display: block; white-space: nowrap; }
.user-role { font-size: 11px; color: var(--tx3); display: block; white-space: nowrap; }

/* ── Main Content ───────────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; min-height: 100vh;
  transition: margin-left 0.28s cubic-bezier(0.4,0,0.2,1);
}

/* ── Topbar ─────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--topbar-bg);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--topbar-bd);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--sh-sm);
}

.topbar-left  { display: flex; align-items: center; gap: 6px; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.btn-sidebar-toggle {
  background: transparent; border: 1px solid var(--bd);
  color: var(--tx2); width: 36px; height: 36px;
  border-radius: var(--r-sm); cursor: pointer;
  font-size: 18px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; padding: 0;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-sidebar-toggle:hover { background: var(--s3); color: var(--tx1); border-color: var(--bd-h); }

.topbar-divider { width: 1px; height: 22px; background: var(--bd); }

.topbar-user {
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--tx2);
  background: var(--s3); padding: 5px 12px;
  border-radius: 20px; border: 1px solid var(--bd);
}

.breadcrumb-item + .breadcrumb-item::before { color: var(--tx3); }
.breadcrumb-item a { 
  color: var(--tx2); 
  font-size: 12.5px; 
  text-decoration: none; 
}
.breadcrumb-item a:hover { color: var(--accent); }
.breadcrumb-item.active { 
  font-size: 12.5px; 
  color: var(--tx3); 
}

/* ── Page Content ───────────────────────────────────────────────── */
.page-content { padding: 26px; flex: 1; }
.page-title { font-family: var(--font-display); font-size: 26px; color: var(--tx1); margin: 0 0 4px; letter-spacing: -0.01em; }
.page-subtitle { font-size: 13.5px; color: var(--tx3); margin: 0; }

/* ══ COMPONENTS ═══════════════════════════════════════════════════ */

/* ── Stat Cards ─────────────────────────────────────────────────── */
.stat-card {
  background: var(--card-bg); border: 1px solid var(--card-bd);
  border-radius: var(--r-lg); padding: 18px;
  position: relative; overflow: hidden;
  box-shadow: var(--sh-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--violet));
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}

.stat-card:hover { transform: translateY(-3px); box-shadow: var(--sh-md), var(--glow); }

.stat-icon { width: 40px; height: 40px; border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; font-size: 18px; margin-bottom: 10px; }
.stat-value { font-family: var(--font-display); font-size: 30px; color: var(--tx1); line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 11px; color: var(--tx3); text-transform: uppercase; letter-spacing: 0.07em; }

/* ── Cards ──────────────────────────────────────────────────────── */
.card { background: var(--card-bg) !important; border: 1px solid var(--card-bd) !important; border-radius: var(--r-lg) !important; box-shadow: var(--sh-sm) !important; }
.card-header { background: var(--card-hd) !important; border-bottom: 1px solid var(--card-bd) !important; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-title { font-size: 13.5px; font-weight: 600; color: var(--tx1); margin: 0; display: flex; align-items: center; gap: 7px; }
.card-body { padding: 18px; }

/* ── Buttons ────────────────────────────────────────────────────── */
.btn { font-family: var(--font-body); font-weight: 500; font-size: 13.5px; border-radius: var(--r-sm); display: inline-flex; align-items: center; gap: 6px; }
.btn-primary { background: linear-gradient(135deg, var(--accent), #1d4ed8); border: none; color: #fff; box-shadow: 0 2px 8px rgba(37,99,235,0.30); }
.btn-primary:hover { background: linear-gradient(135deg, var(--accent-bright), var(--accent)); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(37,99,235,0.40); color: #fff; }
.btn-success { background: linear-gradient(135deg, var(--emerald), #047857); border: none; color: #fff; }
.btn-danger  { background: linear-gradient(135deg, var(--rose), #b91c1c);    border: none; color: #fff; }
.btn-warning { background: linear-gradient(135deg, var(--gold), #b45309);    border: none; color: #fff; }
.btn-outline-secondary { background: transparent; border: 1px solid var(--bd); color: var(--tx2); }
.btn-outline-secondary:hover { background: var(--s3); color: var(--tx1); border-color: var(--bd-h); }
.btn-ghost { background: transparent; border: 1px solid transparent; color: var(--tx2); padding: 4px 8px; border-radius: var(--r-sm); }
.btn-ghost:hover { background: var(--s3); color: var(--tx1); }

/* ── Forms ──────────────────────────────────────────────────────── */
.form-control, .form-select {
  background: var(--inp) !important; border: 1px solid var(--bd) !important;
  color: var(--inp-tx) !important; border-radius: var(--r-sm);
  font-family: var(--font-body); font-size: 13.5px;
}
.form-control:focus, .form-select:focus {
  background: var(--inp-focus) !important; border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.14) !important; color: var(--inp-tx) !important;
}
.form-control::placeholder { color: var(--inp-ph) !important; }
html[data-theme="dark"]  .form-select option { background: #112240; color: #e8edf4; }
html[data-theme="light"] .form-select option { background: #ffffff; color: #0f172a; }
.form-label { font-size: 13px; font-weight: 500; color: var(--lbl-tx); margin-bottom: 5px; }
.form-check-input { background-color: var(--s3) !important; border-color: var(--bd-h) !important; cursor: pointer; }
.form-check-input:checked { background-color: var(--accent) !important; border-color: var(--accent) !important; }
.is-invalid { border-color: var(--rose) !important; }
.is-valid   { border-color: var(--emerald) !important; }

/* ── Table ──────────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--card-bd); }
.table { color: var(--tx1); font-size: 13.5px; margin: 0; background: transparent; }
.table thead th {
  background: var(--th-bg) !important; color: var(--th-tx);
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  padding: 11px 13px;
  border-bottom: 1px solid var(--card-bd) !important; border-top: none !important;
  white-space: nowrap; cursor: pointer; user-select: none;
}
.table thead th:hover { color: var(--accent); }
.table thead th.sort-asc::after  { content: ' ↑'; color: var(--accent); }
.table thead th.sort-desc::after { content: ' ↓'; color: var(--accent); }
.table tbody tr { border-bottom: 1px solid var(--tr-bd) !important; }
.table tbody tr:hover { background: var(--tr-hover) !important; }
.table tbody tr:last-child { border-bottom: none !important; }
.table tbody td { padding: 11px 13px; vertical-align: middle; border: none !important; background: transparent !important; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table tbody tr.row-selected { background: var(--accent-dim) !important; }

/* ── Badges ─────────────────────────────────────────────────────── */
.badge { font-size: 10.5px; font-weight: 550; padding: 3px 8px; border-radius: 20px; }
.badge-status-lulus { background: rgba(16,185,129,0.12); color: #059669; border: 1px solid rgba(5,150,105,0.25); }
.badge-status-aktif { background: var(--accent-dim);     color: var(--accent); border: 1px solid var(--bd-h); }
.badge-status-cuti  { background: rgba(217,119,6,0.12);  color: var(--gold); border: 1px solid rgba(217,119,6,0.25); }
.badge-status-do    { background: rgba(220,38,38,0.12);  color: var(--rose); border: 1px solid rgba(220,38,38,0.25); }
.badge-status-other { background: var(--s3); color: var(--tx3); border: 1px solid var(--bd); }
.badge-lk { background: rgba(8,145,178,0.12); color: var(--cyan); }
.badge-pr { background: rgba(219,39,119,0.12); color: #db2777; }

/* ── Alert ──────────────────────────────────────────────────────── */
.alert { border-radius: var(--r-md); border: 1px solid; font-size: 13.5px; }

/* ── Pagination ─────────────────────────────────────────────────── */
.pagination { gap: 4px; }
.page-link { background: var(--pg-bg) !important; border: 1px solid var(--bd) !important; color: var(--pg-tx) !important; border-radius: var(--r-sm) !important; font-size: 13px; padding: 5px 11px; }
.page-link:hover { background: var(--s3) !important; color: var(--accent) !important; border-color: var(--bd-h) !important; }
.page-item.active .page-link { background: var(--accent) !important; border-color: var(--accent) !important; color: #fff !important; }
.page-item.disabled .page-link { color: var(--tx4) !important; }

/* ── Modal ──────────────────────────────────────────────────────── */
.modal-content { background: var(--modal-bg) !important; border: 1px solid var(--modal-bd) !important; border-radius: var(--r-xl); box-shadow: var(--sh-lg); }
.modal-header  { background: var(--modal-hd) !important; border-bottom: 1px solid var(--modal-bd) !important; border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 15px 18px; }
.modal-title   { font-family: var(--font-display); font-size: 17px; color: var(--tx1); }
.modal-footer  { border-top: 1px solid var(--modal-bd) !important; padding: 13px 18px; }
html[data-theme="dark"]  .btn-close { filter: invert(1); opacity: 0.5; }
html[data-theme="light"] .btn-close { filter: none; opacity: 0.55; }
.btn-close:hover { opacity: 0.95 !important; }

/* ── Upload Zone ────────────────────────────────────────────────── */
.upload-zone { border: 2px dashed var(--upzone-bd); border-radius: var(--r-xl); padding: 46px 24px; text-align: center; cursor: pointer; background: var(--upzone-bg); }
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--accent); background: var(--upzone-hv); }
.upload-icon  { font-size: 50px; color: var(--accent); margin-bottom: 14px; display: block; }
.upload-title { font-family: var(--font-display); font-size: 19px; color: var(--tx1); margin-bottom: 7px; }
.upload-sub   { font-size: 13px; color: var(--tx3); }

/* ── Progress ───────────────────────────────────────────────────── */
.progress { height: 6px; border-radius: 3px; background: var(--prog-track); }
.progress-bar { background: linear-gradient(90deg, var(--accent), var(--violet)); border-radius: 3px; }

/* ── Toolbar ────────────────────────────────────────────────────── */
.table-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 14px; background: var(--card-hd); border-bottom: 1px solid var(--card-bd); }
.search-box { position: relative; flex: 1; min-width: 200px; max-width: 320px; }
.search-box .bi-search { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--tx3); font-size: 13px; }
.search-box .form-control { padding-left: 34px; }

/* ── Inline Edit ────────────────────────────────────────────────── */
.inline-edit-cell { position: relative; cursor: pointer; }
.inline-edit-cell .edit-hint { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); opacity: 0; color: var(--accent); font-size: 11px; pointer-events: none; transition: opacity 0.15s; }
.inline-edit-cell:hover .edit-hint { opacity: 1; }
.inline-input { background: var(--s4) !important; border: 1.5px solid var(--accent) !important; color: var(--inp-tx) !important; border-radius: var(--r-sm); padding: 4px 8px; font-size: 13px; width: 100%; min-width: 120px; box-shadow: 0 0 0 3px rgba(37,99,235,0.14) !important; }

/* ── Import Steps ───────────────────────────────────────────────── */
.import-steps { display: flex; align-items: center; margin-bottom: 28px; }
.step-item { display: flex; align-items: center; gap: 9px; flex: 1; }
.step-num { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--bd); color: var(--tx3); display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 600; flex-shrink: 0; }
.step-num.active   { border-color: var(--accent);  color: var(--accent);  background: var(--accent-dim); }
.step-num.complete { border-color: var(--emerald); color: #fff;          background: var(--emerald); }
.step-label { font-size: 12.5px; color: var(--tx3); }
.step-item.active .step-label   { color: var(--tx1); font-weight: 500; }
.step-item.complete .step-label { color: var(--emerald); }
.step-connector { flex: 0 0 28px; height: 2px; background: var(--bd); margin: 0 6px; }
.step-connector.done { background: var(--emerald); }

/* ── Loading ────────────────────────────────────────────────────── */
.loading-overlay { position: fixed; inset: 0; background: rgba(6,13,26,0.65); backdrop-filter: blur(4px); z-index: 9999; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 14px; }
html[data-theme="light"] .loading-overlay { background: rgba(240,244,248,0.78); }
.loading-spinner { width: 44px; height: 44px; border: 3px solid var(--bd); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Empty State ────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 56px 20px; color: var(--tx3); }
.empty-state-icon  { font-size: 44px; color: var(--tx4); display: block; margin-bottom: 10px; }
.empty-state-title { font-size: 15px; color: var(--tx2); margin-bottom: 4px; }

/* ── Detail View ────────────────────────────────────────────────── */
.detail-tabs .nav-link { background: transparent; border: none; border-bottom: 2px solid transparent; color: var(--tx2); padding: 7px 14px; font-size: 12.5px; border-radius: 0; }
.detail-tabs .nav-link.active { color: var(--accent); border-bottom-color: var(--accent); }
.detail-field { display: flex; flex-direction: column; padding: 9px 0; border-bottom: 1px solid var(--bd); }
.detail-field:last-child { border-bottom: none; }
.detail-field-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--tx3); margin-bottom: 2px; }
.detail-field-value { font-size: 13.5px; color: var(--tx1); }

/* ── Skeleton ───────────────────────────────────────────────────── */
.skeleton { background: linear-gradient(90deg, var(--sk-a), var(--sk-b), var(--sk-a)); background-size: 200% 100%; animation: sk-shimmer 1.4s ease infinite; border-radius: var(--r-sm); height: 15px; }
@keyframes sk-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Fade In ────────────────────────────────────────────────────── */
.fade-in { animation: fadeIn 0.4s ease forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ══ SIDEBAR COLLAPSED ════════════════════════════════════════════ */
body.sidebar-collapsed .sidebar         { width: var(--sidebar-w-col); }
body.sidebar-collapsed .main-content    { margin-left: var(--sidebar-w-col); }
body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .nav-text,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .user-info,
body.sidebar-collapsed .brand-sub       { opacity: 0; pointer-events: none; width: 0; overflow: hidden; }
body.sidebar-collapsed .sidebar-brand   { padding: 18px 14px; justify-content: center; }
body.sidebar-collapsed .nav-link        { justify-content: center; padding: 10px; }
body.sidebar-collapsed .user-card       { justify-content: center; }
body.sidebar-collapsed .nav-indicator   { display: none; }
body.sidebar-collapsed .sidebar-divider { margin: 0 10px; }

/* ══ UTILITIES ════════════════════════════════════════════════════ */
.text-accent  { color: var(--accent)  !important; }
.text-gold    { color: var(--gold)    !important; }
.text-emerald { color: var(--emerald) !important; }
.text-rose    { color: var(--rose)    !important; }
.text-cyan    { color: var(--cyan)    !important; }
.bg-s2        { background: var(--s2) !important; }
.bg-s3        { background: var(--s3) !important; }
.font-display { font-family: var(--font-display); }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }

/* ══ SCROLLBAR ════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--sc-track); }
::-webkit-scrollbar-thumb { background: var(--sc-thumb); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ══ RESPONSIVE ═══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); width: 260px !important; box-shadow: var(--sh-lg); }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-content { margin-left: 0 !important; }
  .page-content { padding: 14px; }
  .table-toolbar { flex-direction: column; align-items: stretch; }
  .search-box { max-width: 100%; }
}

/* ══ THEME TRANSITION CLASS (added/removed by JS during switch) ═══ */
html.theme-transition *,
html.theme-transition *::before,
html.theme-transition *::after {
  transition:
    background-color 0.30s ease,
    border-color     0.30s ease,
    color            0.30s ease,
    box-shadow       0.30s ease !important;
}

.panel-footer-left {
    text-align: center;
    border-top: 1px solid rgba(120, 130, 140, 0.13);
    color: #8fa3ba;
    font-size: .8rem;
    padding: 10px 0;
}
