/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  --primary:        #e30613;
  --primary-hover:  #c10510;
  --primary-soft:   #ff2a36;
  --primary-tint:   #fff1f1;
  --ring:           rgba(227, 6, 19, .16);

  --sk-green:       #2d9b3f;
  --sk-blue:        #1e6bb8;
  --sk-orange:      #f5a623;
  --sk-purple:      #4b4ebb;
  --sk-cyan:        #00aeef;
  --sk-yellow:      #f7d117;

  --bg:             #f7f6f4;
  --surface:        #ffffff;
  --surface-2:      #fafbfc;
  --sidebar-bg:     #ffffff;
  --sidebar-border: #f0e4e4;

  --border:         #e8eaee;
  --border-strong:  #d9dde4;

  --text:           #131a24;
  --text-2:         #5a6474;
  --text-3:         #8d96a5;

  --success:        #16a34a;
  --success-tint:   #e8f8ee;
  --warn:           #d97706;
  --warn-tint:      #fdf3e2;
  --danger:         #dc2626;
  --danger-tint:    #fdeaea;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-md: 0 1px 2px rgba(16, 24, 40, .04), 0 10px 26px -14px rgba(16, 24, 40, .18);
  --shadow-lg: 0 18px 48px -20px rgba(16, 24, 40, .28);

  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 12px;
  --r-xl: 14px;

  --sidebar-w: 268px;
  --topbar-h: 58px;
  --foot-h: 42px;
  --ease: cubic-bezier(.4, 0, .2, 1);

  color-scheme: light;
}

html[data-theme="dark"] {
  --primary:        #ff3b47;
  --primary-hover:  #ff5a64;
  --primary-soft:   #e30613;
  --primary-tint:   rgba(227, 6, 19, .16);
  --ring:           rgba(255, 59, 71, .22);

  --bg:             #0c0e13;
  --surface:        #141821;
  --surface-2:      #191e28;
  --sidebar-bg:     #161014;
  --sidebar-border: #2c1a1d;

  --border:         #232935;
  --border-strong:  #303845;

  --text:           #eef1f6;
  --text-2:         #a2abbb;
  --text-3:         #6e7788;

  --success:        #4ade80;
  --success-tint:   rgba(74, 222, 128, .13);
  --warn:           #fbbf24;
  --warn-tint:      rgba(251, 191, 36, .13);
  --danger:         #f87171;
  --danger-tint:    rgba(248, 113, 113, .13);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 26px -14px rgba(0, 0, 0, .7);
  --shadow-lg: 0 18px 48px -20px rgba(0, 0, 0, .8);

  color-scheme: dark;
}

/* ============================================================
   BASE
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-weight: 500;
  font-size: 14.5px;
  line-height: 1.55;
  letter-spacing: .01em;
  word-spacing: .04em;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background .25s var(--ease), color .25s var(--ease);
}

h1, h2, h3, h4 { font-weight: 800; letter-spacing: 0; line-height: 1.25; }

a { color: inherit; text-decoration: none; }

button, input, select, textarea { font: inherit; color: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 20px;
  border: 3px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ============================================================
   LAYOUT
   ============================================================ */
.layout { display: flex; min-height: 100vh; }

/* ---------- SIDEBAR ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  padding: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  transition: background .25s var(--ease), border-color .25s var(--ease), width .28s var(--ease), padding .28s var(--ease), opacity .2s var(--ease);
}

.layout.sidebar-closed .sidebar {
  width: 0;
  min-width: 0;
  padding: 0;
  border-right: none;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.sidebar-backdrop {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  padding: 0 14px;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.sidebar-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand-img {
  height: calc(var(--topbar-h) - 14px);
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
  display: block;
}
html[data-theme="dark"] .brand-img {
  background: #fff;
  border-radius: 8px;
  padding: 4px 8px;
}

.nav-group { display: flex; flex-direction: column; gap: 3px; }

.nav-label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0 12px;
  margin-bottom: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-2);
  cursor: pointer;
  transition: all .18s var(--ease);
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.nav-item svg { width: 19px; height: 19px; flex-shrink: 0; }

.nav-item:hover { background: var(--primary-tint); color: var(--primary); }

.nav-item.active {
  background: linear-gradient(135deg, var(--primary-soft), var(--primary));
  color: #fff;
  box-shadow: 0 10px 22px -10px rgba(227, 6, 19, .75);
}

.nav-tree > .nav-item.active {
  background: var(--primary-tint);
  color: var(--primary);
  box-shadow: none;
}

.sidebar-foot {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  height: var(--foot-h);
  min-height: var(--foot-h);
  padding: 0 14px;
  background: var(--sidebar-bg);
  border-top: 1px solid var(--sidebar-border);
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  transition: all .18s var(--ease);
}
.btn-logout-ico {
  width: 24px; height: 24px;
  border-radius: 7px;
  background: rgba(220, 38, 38, .1);
  color: #dc2626;
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: all .18s var(--ease);
}
.btn-logout-ico svg { width: 13px; height: 13px; }
.btn-logout:hover { color: #dc2626; }
.btn-logout:hover .btn-logout-ico { color: #b91c1c; }

.avatar {
  width: 36px; height: 36px;
  border-radius: 6px;
  background: linear-gradient(140deg, #ff8a90, #e30613);
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 13px;
  flex-shrink: 0;
}

.user-meta { min-width: 0; }
.user-meta strong { display: block; font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta span { font-size: 11.5px; color: var(--text-3); font-weight: 600; }

/* ---------- MAIN ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  transition: background .25s var(--ease), border-color .25s var(--ease);
}

.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-title h1 { font-size: 15px; font-weight: 800; }

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 36px; height: 36px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  display: grid; place-items: center;
  cursor: pointer;
  transition: all .18s var(--ease);
  position: relative;
}

.icon-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-tint); }
.icon-btn svg { width: 17px; height: 17px; pointer-events: none; }
.ico-sun { display: block; }
.ico-moon { display: none; }
html[data-theme="dark"] .ico-sun { display: none; }
html[data-theme="dark"] .ico-moon { display: block; }

.icon-btn .dot {
  position: absolute; top: 8px; right: 8px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--surface);
}

.user-menu { position: relative; }
.user-menu .icon-btn.avatar-btn {
  background: linear-gradient(140deg, #ff8a90, #e30613);
  color: #fff;
  border-color: transparent;
  font-size: 12px;
  font-weight: 800;
}
.user-menu .icon-btn.avatar-btn:hover { filter: brightness(1.06); color: #fff; background: linear-gradient(140deg, #ff8a90, #e30613); }

.user-dd {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 80;
  min-width: 228px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: all .18s var(--ease);
}
.user-menu.open .user-dd { opacity: 1; transform: translateY(0); pointer-events: auto; }

.user-dd-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 12px;
}
.user-dd-head .avatar { width: 36px; height: 36px; font-size: 12px; }
.user-dd-head strong { display: block; font-size: 13px; font-weight: 800; }
.user-dd-head span { font-size: 11.5px; color: var(--text-3); font-weight: 600; }

.user-dd button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: none;
  background: transparent;
  border-radius: 8px;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  transition: all .13s var(--ease);
}
.user-dd button svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--text-2); }
.user-dd button:hover { background: var(--primary-tint); color: var(--primary); }
.user-dd button:hover svg { color: var(--primary); }
.user-dd button.danger {
  color: #dc2626;
  background: rgba(220, 38, 38, .07);
  margin-top: 2px;
  padding: 7px 10px;
  font-size: 13px;
}
.user-dd button.danger svg { color: #dc2626; }
.user-dd button.danger:hover { background: transparent; color: #b91c1c; }
.user-dd button.danger:hover svg { color: #b91c1c; }
.user-dd-sep { height: 1px; background: var(--border); margin: 4px 4px 6px; }

.content { padding: 20px 28px 24px; flex: 1; display: flex; flex-direction: column; gap: 16px; }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 46px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.card-head .btn { height: 34px; padding: 0 12px; gap: 4px; }
.card-head h2 {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
  padding: 12px 0;
}

.page-foot {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: var(--foot-h);
  min-height: var(--foot-h);
  padding: 0 20px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
}
.page-foot b { color: var(--text-2); font-weight: 700; }

/* ---------- PAGES ---------- */
.page { display: none; }
.page.active { display: block; animation: fadeUp .35s var(--ease); }

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

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .18s var(--ease);
  white-space: nowrap;
  letter-spacing: -.01em;
}

.btn svg { width: 17px; height: 17px; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary-soft), var(--primary));
  color: #fff;
  box-shadow: 0 10px 22px -12px rgba(227, 6, 19, .9);
}
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 14px 26px -12px rgba(227, 6, 19, .95); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-2);
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-tint); }

.btn-soft {
  background: var(--primary-tint);
  color: var(--primary);
}
.btn-soft:hover { background: var(--primary); color: #fff; }

.btn-sm { padding: 8px 14px; font-size: 12.5px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn:disabled, .btn.is-loading { opacity: .75; pointer-events: none; transform: none !important; filter: none; }
.btn-spin {
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .55s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   CARDS & GRID
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: background .25s var(--ease), border-color .25s var(--ease);
}

.card-pad { padding: 22px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 0;
}

.stat {
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.stat::after {
  content: '';
  position: absolute;
  right: -32px; top: -32px;
  width: 110px; height: 110px;
  border-radius: 50%;
  background: var(--primary-tint);
  transition: transform .4s var(--ease);
}

.stat:hover::after { transform: scale(1.35); }

.stat-ico {
  width: 44px; height: 44px;
  border-radius: 13px;
  background: var(--primary-tint);
  color: var(--primary);
  display: grid; place-items: center;
  margin-bottom: 14px;
  position: relative; z-index: 1;
}
.stat-ico svg { width: 21px; height: 21px; }

.stat:nth-child(1) .stat-ico { background: #fff1f1; color: var(--primary); }
.stat:nth-child(1)::after { background: #fff1f1; }
.stat:nth-child(2) .stat-ico { background: #e8f6ec; color: var(--sk-green); }
.stat:nth-child(2)::after { background: #e8f6ec; }
.stat:nth-child(3) .stat-ico { background: #e8f1fb; color: var(--sk-blue); }
.stat:nth-child(3)::after { background: #e8f1fb; }
.stat:nth-child(4) .stat-ico { background: #fff6e8; color: var(--sk-orange); }
.stat:nth-child(4)::after { background: #fff6e8; }

html[data-theme="dark"] .stat:nth-child(1) .stat-ico,
html[data-theme="dark"] .stat:nth-child(1)::after { background: rgba(227, 6, 19, .16); }
html[data-theme="dark"] .stat:nth-child(1) .stat-ico { color: #ff5a64; }
html[data-theme="dark"] .stat:nth-child(2) .stat-ico,
html[data-theme="dark"] .stat:nth-child(2)::after { background: rgba(45, 155, 63, .16); }
html[data-theme="dark"] .stat:nth-child(2) .stat-ico { color: #4ade80; }
html[data-theme="dark"] .stat:nth-child(3) .stat-ico,
html[data-theme="dark"] .stat:nth-child(3)::after { background: rgba(30, 107, 184, .16); }
html[data-theme="dark"] .stat:nth-child(3) .stat-ico { color: #60a5fa; }
html[data-theme="dark"] .stat:nth-child(4) .stat-ico,
html[data-theme="dark"] .stat:nth-child(4)::after { background: rgba(245, 166, 35, .16); }
html[data-theme="dark"] .stat:nth-child(4) .stat-ico { color: #fbbf24; }

.stat-label { font-size: 12.5px; font-weight: 700; color: var(--text-3); position: relative; z-index: 1; letter-spacing: .02em; }
.stat-value { font-size: 27px; font-weight: 800; letter-spacing: -.01em; margin: 2px 0 8px; position: relative; z-index: 1; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  position: relative; z-index: 1;
}
.pill svg { width: 12px; height: 12px; }
.pill-up { background: var(--success-tint); color: var(--success); }
.pill-warn { background: var(--warn-tint); color: var(--warn); }

.two-col {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 18px;
  align-items: start;
}

/* ---------- CHART ---------- */
.chart {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 210px;
  padding-top: 12px;
}

.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 9px; height: 100%; justify-content: flex-end; }

.bar-track { width: 100%; flex: 1; display: flex; align-items: flex-end; }

.bar {
  width: 100%;
  border-radius: 9px 9px 5px 5px;
  background: linear-gradient(180deg, var(--primary-soft), var(--primary));
  opacity: .9;
  transition: opacity .18s var(--ease), transform .18s var(--ease);
  animation: grow .7s var(--ease) backwards;
  min-height: 6px;
}

.bar-col:hover .bar { opacity: 1; transform: scaleY(1.02); }

.bar-col:nth-child(1) .bar { background: linear-gradient(180deg, #3cb54a, var(--sk-green)); }
.bar-col:nth-child(2) .bar { background: linear-gradient(180deg, #3d8bd4, var(--sk-blue)); }
.bar-col:nth-child(3) .bar { background: linear-gradient(180deg, #ffb84d, var(--sk-orange)); }
.bar-col:nth-child(4) .bar { background: linear-gradient(180deg, #6b6fd4, var(--sk-purple)); }
.bar-col:nth-child(5) .bar { background: linear-gradient(180deg, #ff4d4d, var(--primary)); }
.bar-col:nth-child(6) .bar { background: linear-gradient(180deg, #5ec8ef, var(--sk-cyan)); }
.bar-col:nth-child(7) .bar { background: linear-gradient(180deg, #ffe14d, var(--sk-yellow)); }

@keyframes grow { from { height: 0 !important; } }

.bar-col span { font-size: 11px; font-weight: 700; color: var(--text-3); }

/* ---------- ACTIVITY ---------- */
.act-list { display: flex; flex-direction: column; }

.act {
  display: flex;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px dashed var(--border);
}
.act:last-child { border-bottom: none; padding-bottom: 0; }
.act:first-child { padding-top: 4px; }

.act-dot {
  width: 34px; height: 34px;
  border-radius: 11px;
  display: grid; place-items: center;
  background: var(--primary-tint);
  color: var(--primary);
  flex-shrink: 0;
}
.act-dot svg { width: 16px; height: 16px; }
.act:nth-child(1) .act-dot { background: #fff1f1; color: var(--primary); }
.act:nth-child(2) .act-dot { background: #e8f6ec; color: var(--sk-green); }
.act:nth-child(3) .act-dot { background: #e8f1fb; color: var(--sk-blue); }
.act:nth-child(4) .act-dot { background: #fff6e8; color: var(--sk-orange); }
html[data-theme="dark"] .act:nth-child(1) .act-dot { background: rgba(227, 6, 19, .16); color: #ff5a64; }
html[data-theme="dark"] .act:nth-child(2) .act-dot { background: rgba(45, 155, 63, .16); color: #4ade80; }
html[data-theme="dark"] .act:nth-child(3) .act-dot { background: rgba(30, 107, 184, .16); color: #60a5fa; }
html[data-theme="dark"] .act:nth-child(4) .act-dot { background: rgba(245, 166, 35, .16); color: #fbbf24; }

.act-body { min-width: 0; }
.act-body strong { display: block; font-size: 13.5px; font-weight: 700; }
.act-body span { font-size: 12px; color: var(--text-3); font-weight: 600; }

/* ============================================================
   TABLE
   ============================================================ */
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
}

.tt-left, .tt-right { display: flex; align-items: center; gap: 10px; }

.search-box { position: relative; }

.search-box svg {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--text-3);
  pointer-events: none;
}

.search-box input {
  width: 360px;
  max-width: 100%;
  padding: 7px 14px 7px 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 13.5px;
  font-weight: 600;
  outline: none;
  transition: all .18s var(--ease);
}
.search-box input::placeholder { color: var(--text-3); font-weight: 600; }
.search-box input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring); background: var(--surface); }

.mini-select {
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  outline: none;
  cursor: pointer;
  transition: all .18s var(--ease);
}
.mini-select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring); }

.table-toolbar .btn {
  height: 34px;
  padding: 0 12px;
  gap: 4px;
}

.table-scroll { overflow-x: auto; }

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 780px; }

.data-table thead th {
  background: var(--surface-2);
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text);
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
  user-select: none;
}

.data-table th.sortable { cursor: pointer; transition: color .15s var(--ease); }
.data-table th.sortable:hover { color: var(--primary); }

.th-inner { display: inline-flex; align-items: center; gap: 6px; }
.sort-ico { width: 13px; height: 13px; opacity: .35; transition: opacity .15s var(--ease), transform .15s var(--ease); }
th.sorted .sort-ico { opacity: 1; color: var(--primary); }
th.sorted.desc .sort-ico { transform: rotate(180deg); }

.data-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
  vertical-align: middle;
}

.data-table tbody tr { transition: background .15s var(--ease); }
.data-table tbody tr:nth-child(even) { background: var(--surface-2); }
.data-table tbody tr:hover { background: var(--primary-tint); }
.data-table tbody tr:last-child td { border-bottom: none; }

.col-check { width: 40px; text-align: center !important; padding-left: 14px !important; padding-right: 0 !important; }
.col-check input[type=checkbox] {
  width: 16px; height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
  vertical-align: middle;
}
.col-no { width: 62px; text-align: center !important; }
.col-no.cell { text-align: center; color: var(--text); font-weight: 700; }
.col-aksi { width: 1%; white-space: nowrap; text-align: right !important; }

.cell-name { display: flex; align-items: center; gap: 9px; }
.cell-name .avatar { width: 30px; height: 30px; border-radius: 6px; font-size: 11px; }
.cell-name strong { color: var(--text); font-weight: 700; font-size: 13px; display: block; }
.cell-name small { color: var(--text-3); font-size: 11.5px; font-weight: 600; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-aktif   { background: var(--success-tint); color: var(--success); }
.badge-pending { background: var(--warn-tint); color: var(--warn); }
.badge-nonaktif{ background: var(--danger-tint); color: var(--danger); }

.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

.act-btn {
  width: 30px; height: 30px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--text-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .16s var(--ease);
  overflow: hidden;
  flex-shrink: 0;
  font-size: 0;
  line-height: 0;
}
.act-btn svg { width: 15px; height: 15px; }
.act-btn.view { color: #2563eb; background: rgba(37, 99, 235, .1); border-color: rgba(37, 99, 235, .18); }
.act-btn.view:hover { color: #fff; background: #3b82f6; border-color: #3b82f6; }
.act-btn.edit { color: #ca8a04; background: rgba(234, 179, 8, .14); border-color: rgba(202, 138, 4, .22); }
.act-btn.edit:hover { color: #fff; background: #eab308; border-color: #eab308; }
.act-btn.del { color: #dc2626; background: rgba(220, 38, 38, .1); border-color: rgba(220, 38, 38, .2); }
.act-btn.del:hover { color: #fff; background: #ef4444; border-color: #ef4444; }
.act-btn.approve { color: #16a34a; background: rgba(22, 163, 74, .1); border-color: rgba(22, 163, 74, .2); }
.act-btn.approve:hover { color: #fff; background: #22c55e; border-color: #22c55e; }
.act-btn.reject { color: #dc2626; background: rgba(220, 38, 38, .1); border-color: rgba(220, 38, 38, .2); }
.act-btn.reject:hover { color: #fff; background: #ef4444; border-color: #ef4444; }
.act-btn.history { color: #2563eb; background: rgba(37, 99, 235, .1); border-color: rgba(37, 99, 235, .18); }
.act-btn.history:hover { color: #fff; background: #3b82f6; border-color: #3b82f6; }
.act-btn.preview { color: #2563eb; background: rgba(37, 99, 235, .1); border-color: rgba(37, 99, 235, .18); }
.act-btn.preview:hover { color: #fff; background: #3b82f6; border-color: #3b82f6; }
.table-bulk { display: inline-flex; margin: 0; padding: 0; }

/* ---------- TABLE FOOTER ---------- */
.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  flex-wrap: wrap;
}

.dt-info { font-size: 12.5px; font-weight: 600; color: var(--text-3); }
.dt-info b { color: var(--text); font-weight: 800; }

.pagination { display: flex; align-items: center; gap: 5px; }

.page-btn {
  min-width: 30px; height: 30px;
  padding: 0 9px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: grid; place-items: center;
  transition: all .16s var(--ease);
}
.page-btn:hover:not(:disabled):not(.active) { border-color: var(--primary); color: var(--primary); background: var(--primary-tint); }
.page-btn.active {
  background: linear-gradient(135deg, var(--primary-soft), var(--primary));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 18px -9px rgba(227, 6, 19, .9);
}
.page-btn:disabled { opacity: .4; cursor: not-allowed; }
.page-btn svg { width: 15px; height: 15px; }
.page-dots { padding: 0 3px; color: var(--text-3); font-weight: 800; }

/* ---------- SKELETON ---------- */
.sk {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--border) 25%, var(--surface-2) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.empty-state { text-align: center; padding: 56px 20px; }
.empty-state svg { width: 46px; height: 46px; color: var(--text-3); margin-bottom: 12px; opacity: .6; }
.empty-state p { font-weight: 700; color: var(--text-2); }
.empty-state span { font-size: 13px; color: var(--text-3); font-weight: 600; }

/* ============================================================
   FORM
   ============================================================ */
.form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.form-head h3 { font-size: 16px; }
.form-head p { font-size: 12.5px; color: var(--text-3); font-weight: 600; margin-top: 2px; }

.form-body { padding: 24px; }

.form-section + .form-section { margin-top: 28px; padding-top: 26px; border-top: 1px dashed var(--border); }

.form-section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 18px;
}
.form-section-title::before {
  content: '';
  width: 4px; height: 15px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--primary-soft), var(--primary));
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.check-grid { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.check-item { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.pick-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pick-box {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.pick-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pick-head label { margin: 0; }
.pick-count {
  font-size: 11px;
  font-weight: 800;
  color: var(--primary);
  background: var(--primary-tint);
  padding: 3px 8px;
  border-radius: 99px;
}
.pick-box .search-box,
.pick-box .search-box input { width: 100%; }
.pick-list { max-height: 220px; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.pick-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-2);
}
.pick-item.is-hide,
.pick-item[hidden] { display: none !important; }
.pick-item:hover { background: var(--surface); color: var(--primary); }
.pick-item:has(input:checked) { background: var(--primary-tint); color: var(--primary); }
.pick-item input { margin-top: 2px; accent-color: var(--primary); }
.pick-item span { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pick-item b { font-size: 13px; font-weight: 700; line-height: 1.3; }
.pick-item small { font-size: 11px; font-weight: 600; color: var(--text-3); }
.pick-empty { padding: 16px 8px; text-align: center; font-size: 12.5px; color: var(--text-3); font-weight: 600; }
@media (max-width: 720px) { .pick-row { grid-template-columns: 1fr; } }
.form-actions { display: flex; justify-content: center; align-items: center; gap: 10px; }
.form-actions .btn { height: 34px; padding: 0 12px; gap: 4px; }

.field label { font-size: 12.5px; font-weight: 800; color: var(--text); letter-spacing: -.01em; }
.field label .req { color: var(--primary); margin-left: 2px; }
.field .hint, .hint { font-size: 11.5px; color: var(--text-3); font-weight: 600; }

.input, .textarea {
  width: 100%;
  padding: 9px 13px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 14px;
  font-weight: 600;
  outline: none;
  transition: all .18s var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); font-weight: 500; }
.input:focus, .textarea:focus {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--ring);
}
.textarea { resize: vertical; min-height: 96px; line-height: 1.6; }

.input-group { position: relative; display: flex; align-items: center; }
.input-group .ig-ico {
  position: absolute; left: 14px;
  width: 17px; height: 17px;
  color: var(--text-3);
  pointer-events: none;
}
.input-group .input { padding-left: 42px; }
.input-group .ig-prefix {
  position: absolute; left: 14px;
  font-size: 13.5px; font-weight: 800; color: var(--text-3);
  pointer-events: none;
}
.input-group .ig-prefix ~ .input { padding-left: 44px; }

/* ---------- RADIO PILLS ---------- */
.pill-group { display: flex; gap: 8px; flex-wrap: wrap; }
.pill-group input { position: absolute; opacity: 0; pointer-events: none; }
.pill-group label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  cursor: pointer;
  transition: all .18s var(--ease);
}
.pill-group label:hover { border-color: var(--primary); color: var(--primary); }
.pill-group input:checked + label {
  background: var(--primary-tint);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 0 4px var(--ring);
}

/* ---------- SWITCH ---------- */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.switch-row strong { display: block; font-size: 13.5px; font-weight: 700; }
.switch-row small { font-size: 11.5px; color: var(--text-3); font-weight: 600; }

.switch { position: relative; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0;
  background: var(--border-strong);
  border-radius: 999px;
  cursor: pointer;
  transition: .22s var(--ease);
}
.switch .slider::before {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  left: 3px; top: 3px;
  border-radius: 50%;
  background: #fff;
  transition: .22s var(--ease);
  box-shadow: 0 2px 5px rgba(0,0,0,.2);
}
.switch input:checked + .slider { background: linear-gradient(135deg, var(--primary-soft), var(--primary)); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* ---------- FILE DROP ---------- */
.file-drop {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface-2);
  cursor: pointer;
  transition: all .18s var(--ease);
}
.file-drop:hover { border-color: var(--primary); background: var(--primary-tint); }
.file-drop input { display: none; }
.file-ico {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--primary-tint);
  color: var(--primary);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.file-ico svg { width: 20px; height: 20px; }
.file-drop strong { display: block; font-size: 13.5px; font-weight: 700; }
.file-drop small { font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.file-drop.has-file { border-color: var(--primary); background: var(--primary-tint); }

/* ---------- FORM ACTIONS ---------- */
.form-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 18px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  flex-wrap: wrap;
  margin: 18px -18px -18px;
}
.form-actions .btn { height: 34px; padding: 0 12px; gap: 4px; }

/* ============================================================
   CUSTOM SELECT (select2 style)
   ============================================================ */
.ns { position: relative; width: 100%; }
.ns-native { display: none !important; }

.ns-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 13px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: all .18s var(--ease);
}
.ns-trigger:hover { border-color: var(--border-strong); }
.ns.open .ns-trigger { border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 4px var(--ring); }
.ns-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ns-label.placeholder { color: var(--text-3); font-weight: 500; }
.ns-caret { width: 16px; height: 16px; color: var(--text-3); flex-shrink: 0; transition: transform .22s var(--ease); }
.ns.open .ns-caret { transform: rotate(180deg); color: var(--primary); }

.ns-panel {
  position: absolute;
  top: calc(100% + 7px);
  left: 0; right: 0;
  z-index: 60;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px) scale(.985);
  pointer-events: none;
  transition: all .18s var(--ease);
}
.ns.open .ns-panel { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

.ns-search { padding: 10px; border-bottom: 1px solid var(--border); }
.ns-search input {
  width: 100%;
  padding: 9px 13px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 600;
  outline: none;
  transition: all .18s var(--ease);
}
.ns-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }

.ns-list { list-style: none; max-height: 224px; overflow-y: auto; padding: 6px; }

.ns-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: all .13s var(--ease);
}
.ns-opt:hover { background: var(--primary-tint); color: var(--primary); }
.ns-opt.selected { background: var(--primary-tint); color: var(--primary); font-weight: 800; }
.ns-opt.selected::after { content: '✓'; font-weight: 800; font-size: 13px; }
.ns-empty { padding: 18px; text-align: center; font-size: 13px; color: var(--text-3); font-weight: 600; }

/* ============================================================
   BOTTOM NAV (MOBILE)
   ============================================================ */
.bottom-nav {
  display: none;
  position: fixed;
  left: 12px; right: 12px; bottom: 12px;
  z-index: 90;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px;
  box-shadow: var(--shadow-lg);
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
}

.bottom-nav-inner { display: flex; align-items: center; justify-content: space-around; gap: 4px; }

.bnav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: 15px;
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
  transition: all .18s var(--ease);
}
.bnav-item svg { width: 20px; height: 20px; }
.bnav-item.active { color: var(--primary); background: var(--primary-tint); }

/* ============================================================
   MODAL & TOAST
   ============================================================ */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(12, 14, 19, .55);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s var(--ease);
}
.backdrop.show { opacity: 1; pointer-events: auto; }

.modal {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 26px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  transform: scale(.94);
  transition: transform .22s var(--ease);
}
.backdrop.show .modal { transform: scale(1); }

.modal-ico {
  width: 54px; height: 54px;
  border-radius: 17px;
  display: grid; place-items: center;
  background: var(--danger-tint);
  color: var(--danger);
  margin: 0 auto 16px;
}
.modal-ico svg { width: 25px; height: 25px; }
.modal h3 { font-size: 17px; margin-bottom: 6px; }
.modal p { font-size: 13.5px; color: var(--text-3); font-weight: 600; margin-bottom: 22px; }
.modal p strong { color: var(--text); font-weight: 800; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions .btn { flex: 1; }

.toast-wrap {
  position: fixed;
  top: 18px; right: 18px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 18px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  font-weight: 700;
  min-width: 240px;
  animation: toastIn .3s var(--ease);
}
.toast.out { animation: toastOut .25s var(--ease) forwards; }
.toast svg { width: 18px; height: 18px; flex-shrink: 0; }
.toast.ok { background: var(--success-tint); border-color: var(--success); color: var(--success); }
.toast.ok svg { color: var(--success); }
.toast.info { background: var(--primary-tint); border-color: var(--primary); color: var(--primary); }
.toast.info svg { color: var(--primary); }
.toast.warn { background: var(--warn-tint); border-color: var(--warn); color: var(--warn); }
.toast.warn svg { color: var(--warn); }

@keyframes toastIn  { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(24px); } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1080px) {
  .two-col { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 80;
    transform: translateX(-100%);
    opacity: 1;
    width: var(--sidebar-w);
    padding: 0;
    border-right: 1px solid var(--sidebar-border);
    box-shadow: var(--shadow-lg);
    transition: transform .28s var(--ease);
    pointer-events: auto;
  }
  .layout.sidebar-closed .sidebar {
    width: var(--sidebar-w);
    padding: 0;
    border-right: 1px solid var(--sidebar-border);
    overflow: hidden;
    opacity: 1;
    transform: translateX(-100%);
  }
  .layout.sidebar-open .sidebar {
    transform: translateX(0);
  }
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(12, 14, 19, .45);
    backdrop-filter: blur(3px);
  }
  .layout.sidebar-open .sidebar-backdrop { display: block; }
  .bottom-nav { display: block; }

  .content { padding: 12px 0 20px; }
  #page-dashboard,
  #page-form { padding-left: 16px; padding-right: 16px; }
  #page-data .card {
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  #page-data .card-head { border-radius: 0; }
  .page-foot { height: auto; min-height: var(--foot-h); padding: 8px 14px 90px; }
  .topbar { padding: 0 14px; }
  .topbar-title h1 { font-size: 15px; }

  .form-grid { grid-template-columns: 1fr; }
  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 14px;
  }
  .tt-left,
  .tt-right { width: 100%; }
  .search-box,
  .search-box input { width: 100%; }
  .table-footer { padding: 12px 14px; justify-content: center; }
  .dt-info { width: 100%; text-align: center; }
  .form-body { padding: 18px 16px; }
  .form-head { padding: 16px; }
  .form-actions { padding: 16px; }
  .form-actions .btn { flex: 1; }
  .toast-wrap { left: 16px; right: 16px; top: 12px; }
  .toast { min-width: 0; }
}

@media (max-width: 560px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stat { padding: 15px; }
  .stat-value { font-size: 21px; }
  .stat-ico { width: 38px; height: 38px; margin-bottom: 10px; }
  .stat-ico svg { width: 18px; height: 18px; }
  .card-pad { padding: 16px; }
  .table-toolbar .btn span { display: none; }
  .table-toolbar .btn { padding: 0 12px; }
  .chart { height: 170px; gap: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@keyframes spin { to { transform: rotate(360deg); } }


/* ============================================================
   AUTH / LOGIN
   ============================================================ */
.auth-body { min-height: 100vh; display:flex; align-items:center; justify-content:center; padding:24px; background: var(--bg); }
.auth-card { width:100%; max-width:420px; background:var(--surface); border:1px solid var(--border); border-radius:var(--r-xl); box-shadow:var(--shadow-lg); padding:32px; }
.auth-brand { display:flex; flex-direction:column; align-items:center; gap:10px; margin-bottom:24px; }
.auth-brand img { height:42px; }
.auth-brand h1 { font-size:20px; }
.auth-brand .mod-badge { font-size:11px; font-weight:700; letter-spacing:.06em; color:var(--primary); background:var(--primary-tint); padding:4px 10px; border-radius:99px; }
.auth-error { background:var(--danger-tint); color:var(--danger); padding:10px 12px; border-radius:var(--r-sm); margin-bottom:14px; font-size:13px; }

/* tabs */
.wk-tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  margin-bottom: 16px;
  background: #eef1f5;
  border: none;
  border-radius: 8px;
  flex-wrap: nowrap;
}
.wk-tab {
  border: 0;
  background: transparent;
  padding: 4px 12px;
  color: var(--text-2);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: background .16s var(--ease), color .16s var(--ease), box-shadow .16s var(--ease);
}
.wk-tab:hover { color: var(--primary); }
.wk-tab.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 12px -6px rgba(16, 24, 40, .18);
}
.wk-tab-panel { display:none; }
.wk-tab-panel.active { display:block; }
.tab-count {
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 99px;
  background: #e4e7ee;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.wk-tab.active .tab-count { background: var(--primary-tint); color: var(--primary); }
.card-head .wk-tabs { margin: 0 0 0 auto; }
.card-head .wk-tab { min-height: 0; padding: 4px 12px; }
html[data-theme="dark"] .wk-tabs { background: rgba(255,255,255,.06); }
html[data-theme="dark"] .wk-tab.active { background: var(--surface); }
html[data-theme="dark"] .tab-count { background: rgba(255,255,255,.08); }

.page-title { font-size: 15px; font-weight: 800; letter-spacing: 0; }
.card-body { padding: 16px 18px 18px; }
.card.card-head-only .card-body { display: none; padding: 0; }

.brand-row { display: flex; align-items: center; gap: 10px; width: 100%; }
.brand-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mod-badge {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-tint);
  padding: 3px 8px;
  border-radius: 99px;
  width: fit-content;
  margin-left: 0;
}

.nav-tree { display: flex; flex-direction: column; }
.nav-tree > .nav-item .nav-caret { margin-left: auto; width: 14px; height: 14px; transition: transform .18s var(--ease); }
.nav-tree.open > .nav-item .nav-caret { transform: rotate(180deg); }
.nav-children { display: none; padding: 2px 0 4px 16px; flex-direction: column; gap: 2px; }
.nav-tree.open > .nav-children { display: flex; }
.nav-children .nav-item { padding: 8px 12px; font-size: 13px; font-weight: 600; }
.nav-children .nav-item svg { width: 16px; height: 16px; }

.dt-toolbar { display:flex; justify-content:space-between; gap:10px; padding:12px 16px; align-items:center; flex-wrap:wrap; border-bottom: 1px solid var(--border); }
.dt-toolbar .input { max-width: 240px; }
.dt-foot { display:flex; justify-content:space-between; align-items:center; padding:12px 16px; gap:10px; flex-wrap:wrap; }
.dt-pager { display:flex; gap:4px; align-items:center; }
.user-dd a, .user-dd form button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: none;
  background: transparent;
  border-radius: 8px;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}
.user-dd a:hover, .user-dd form button:hover { background: var(--primary-tint); color: var(--primary); }
.user-dd form button.danger { color: #dc2626; background: rgba(220, 38, 38, .07); }
.pills { display:flex; gap:8px; flex-wrap:wrap; }
.pills label { display:flex; align-items:center; gap:6px; padding:6px 10px; border:1px solid var(--border); border-radius:99px; cursor:pointer; }
.branch-switch { min-width: 180px; height: 36px; }
.branch-switch .ns { width: 100%; height: 36px; }
.topbar-actions .branch-switch .ns-trigger {
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  padding: 0 12px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1;
  background: var(--surface);
}
.form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.form-grid .span-2 { grid-column:span 2; }
@media (max-width:720px) { .form-grid { grid-template-columns:1fr; } .form-grid .span-2 { grid-column:span 1; } }
.field { display:flex; flex-direction:column; gap:6px; }
.field label { font-size:12px; font-weight:700; color:var(--text-2); }
.field .req { color:var(--primary); }
.field-error { color:var(--danger); font-size:12px; }
.cal-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:6px; }
.cal-day { border:1px solid var(--border); border-radius:8px; padding:8px 4px; text-align:center; font-size:12px; background:var(--surface); }
.cal-day.present { background:var(--success-tint); }
.cal-day.late { background:var(--warn-tint); }
.cal-day.absent { background:var(--danger-tint); }
.cal-day.holiday { background:var(--primary-tint); }
.progress-steps { display:flex; gap:10px; flex-wrap:wrap; margin:16px 0 0; }
.progress-step { flex:1; min-width:120px; padding:12px 14px; border:1px solid var(--border); border-radius:10px; background:var(--surface-2); font-size:13px; font-weight:700; color:var(--text-2); }
.progress-step.done { border-color:var(--success); background:var(--success-tint); color:var(--success); }
.result-box { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.kv-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.kv-item { padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.kv-item span { display:block; font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.04em; color:var(--text-3); }
.kv-item b { font-size:14px; font-weight:800; }
.cal-grid { margin-top: 16px; }
.check-item { padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.check-item .mini-select { height: 28px; padding: 0 8px; }
@media (max-width:720px) { .kv-list { grid-template-columns: 1fr; } }
.nested-table { width:100%; border-collapse:collapse; font-size:13px; }
.nested-table th, .nested-table td { border:1px solid var(--border); padding:6px 8px; }
.chart-wrap { height:220px; }

