@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap");

/* ============================================================
   NEXUS ADMIN — DESIGN SYSTEM
   Utility-First CSS Framework
   ============================================================ */

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Design Tokens (CSS Variables) ──────────────────────── */
:root {
  /* Brand Colors */
  --primary:       oklch(56% 0.16 143);
  --primary-soft:  oklch(56% 0.16 143 / 0.12);
  --primary-hover: oklch(50% 0.15 143);
  --primary-bright: #5ac625;   /* exact logo green — logo mark, highlights */
  --amber:         oklch(64% 0.165 50);
  --amber-soft:    oklch(64% 0.165 50 / 0.12);
  --green:         oklch(66% 0.17 150);
  --green-soft:    oklch(66% 0.17 150 / 0.12);
  --red:           oklch(60% 0.2 25);
  --red-soft:      oklch(60% 0.2 25 / 0.12);
  --purple:        oklch(70% 0.15 300);
  --purple-soft:   oklch(70% 0.15 300 / 0.12);

  /* Surface */
  --canvas:  #f7f8fa;
  --card:    #ffffff;
  --sidebar-bg: #0f1b12;
  --sidebar-accent: #18271c;

  /* Borders */
  --border:  #e8eaed;
  --border-focus: var(--primary);

  /* Text */
  --text:    #111827;
  --muted:   #6b7280;
  --text-inv: #e2e8f0;

  /* Typography */
  --font:    'Plus Jakarta Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Spacing scale */
  --s1: 4px;  --s2: 8px;  --s3: 12px;  --s4: 16px;
  --s5: 20px; --s6: 24px; --s7: 28px;  --s8: 32px;

  /* Border Radius */
  --radius-sm: 6px;
  --radius:    12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.04);
  --shadow:    0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.04);
  --shadow-md: 0 4px 24px rgba(0,0,0,.10);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.14);

  /* Sidebar */
  --sidebar-w: 260px;
  --sidebar-w-collapsed: 68px;
  --topbar-h: 64px;
  --doc-sidebar-w: 260px;
}

/* ── Base ─────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--canvas); color: var(--text); overflow-x: hidden; line-height: 1.6; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--font-mono); }

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */

/* ── Display ─────────────────────────────────────────────── */
.d-none      { display: none !important; }
.d-block     { display: block !important; }
.d-inline    { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-flex      { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }
.d-grid      { display: grid !important; }

/* ── Flex Utilities ──────────────────────────────────────── */
.flex-row     { flex-direction: row !important; }
.flex-col     { flex-direction: column !important; }
.flex-wrap    { flex-wrap: wrap !important; }
.flex-nowrap  { flex-wrap: nowrap !important; }
.flex-1       { flex: 1 !important; }
.flex-shrink-0 { flex-shrink: 0 !important; }
.flex-grow-1  { flex-grow: 1 !important; }

.items-start   { align-items: flex-start !important; }
.items-center  { align-items: center !important; }
.items-end     { align-items: flex-end !important; }
.items-stretch { align-items: stretch !important; }
.self-center   { align-self: center !important; }

.justify-start   { justify-content: flex-start !important; }
.justify-center  { justify-content: center !important; }
.justify-end     { justify-content: flex-end !important; }
.justify-between { justify-content: space-between !important; }
.justify-around  { justify-content: space-around !important; }

/* ── Gap Utilities ───────────────────────────────────────── */
.gap-1 { gap: var(--s1) !important; }
.gap-2 { gap: var(--s2) !important; }
.gap-3 { gap: var(--s3) !important; }
.gap-4 { gap: var(--s4) !important; }
.gap-5 { gap: var(--s5) !important; }
.gap-6 { gap: var(--s6) !important; }
.gap-x-2 { column-gap: var(--s2) !important; }
.gap-x-3 { column-gap: var(--s3) !important; }
.gap-y-2 { row-gap: var(--s2) !important; }
.gap-y-4 { row-gap: var(--s4) !important; }

/* ── Grid Utilities ──────────────────────────────────────── */
.grid-cols-1  { grid-template-columns: repeat(1, 1fr) !important; }
.grid-cols-2  { grid-template-columns: repeat(2, 1fr) !important; }
.grid-cols-3  { grid-template-columns: repeat(3, 1fr) !important; }
.grid-cols-4  { grid-template-columns: repeat(4, 1fr) !important; }
.grid-cols-2fr-1fr { grid-template-columns: 2fr 1fr !important; }
.grid-cols-1fr-2fr { grid-template-columns: 1fr 2fr !important; }
.grid-cols-3fr-2fr { grid-template-columns: 3fr 2fr !important; }
.col-span-2 { grid-column: span 2 !important; }
.col-span-full { grid-column: 1 / -1 !important; }

/* ── Margin ──────────────────────────────────────────────── */
.m-0  { margin: 0 !important; }
.m-auto { margin: auto !important; }
.ml-auto { margin-left: auto !important; }
.mr-auto { margin-right: auto !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: var(--s1) !important; }
.mt-2 { margin-top: var(--s2) !important; }
.mt-3 { margin-top: var(--s3) !important; }
.mt-4 { margin-top: var(--s4) !important; }
.mt-5 { margin-top: var(--s5) !important; }
.mt-6 { margin-top: var(--s6) !important; }
.mt-8 { margin-top: var(--s8) !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: var(--s1) !important; }
.mb-2 { margin-bottom: var(--s2) !important; }
.mb-3 { margin-bottom: var(--s3) !important; }
.mb-4 { margin-bottom: var(--s4) !important; }
.mb-5 { margin-bottom: var(--s5) !important; }
.mb-6 { margin-bottom: var(--s6) !important; }

.ml-1 { margin-left: var(--s1) !important; }
.ml-2 { margin-left: var(--s2) !important; }
.ml-3 { margin-left: var(--s3) !important; }
.ml-6 { margin-left: var(--s3) !important; }
.mr-2 { margin-right: var(--s2) !important; }

/* ── Padding ─────────────────────────────────────────────── */
.p-0  { padding: 0 !important; }
.p-3  { padding: var(--s3) !important; }
.p-4  { padding: var(--s4) !important; }
.p-5  { padding: var(--s5) !important; }
.p-6  { padding: var(--s6) !important; }
.p-8  { padding: var(--s8) !important; }

.px-3 { padding-left: var(--s3) !important; padding-right: var(--s3) !important; }
.px-4 { padding-left: var(--s4) !important; padding-right: var(--s4) !important; }
.px-5 { padding-left: var(--s5) !important; padding-right: var(--s5) !important; }
.px-6 { padding-left: var(--s6) !important; padding-right: var(--s6) !important; }

.py-2 { padding-top: var(--s2) !important; padding-bottom: var(--s2) !important; }
.py-3 { padding-top: var(--s3) !important; padding-bottom: var(--s3) !important; }
.py-4 { padding-top: var(--s4) !important; padding-bottom: var(--s4) !important; }
.py-5 { padding-top: var(--s5) !important; padding-bottom: var(--s5) !important; }
.py-6 { padding-top: var(--s6) !important; padding-bottom: var(--s6) !important; }

.pt-0 { padding-top: 0 !important; }
.pt-4 { padding-top: var(--s4) !important; }
.pb-0 { padding-bottom: 0 !important; }
.pb-4 { padding-bottom: var(--s4) !important; }

/* ── Positioning ─────────────────────────────────────────── */
.relative { position: relative !important; }
.absolute { position: absolute !important; }
.fixed    { position: fixed !important; }
.sticky   { position: sticky !important; }
.inset-0  { top: 0; right: 0; bottom: 0; left: 0; }
.top-0    { top: 0 !important; }
.z-10     { z-index: 10 !important; }
.z-50     { z-index: 50 !important; }
.z-100    { z-index: 100 !important; }
.z-200    { z-index: 200 !important; }
.z-300    { z-index: 300 !important; }
.z-400    { z-index: 400 !important; }

/* ── Size Utilities ──────────────────────────────────────── */
.w-full   { width: 100% !important; }
.w-auto   { width: auto !important; }
.h-full   { height: 100% !important; }
.min-h-screen { min-height: 100vh !important; }
.overflow-hidden { overflow: hidden !important; }
.overflow-x-auto { overflow-x: auto !important; }
.overflow-y-auto { overflow-y: auto !important; }

/* ============================================================
   TYPOGRAPHY UTILITIES
   ============================================================ */
.text-xs   { font-size: 11px !important; }
.text-sm   { font-size: 12px !important; }
.text-base { font-size: 13px !important; }
.text-md   { font-size: 13.5px !important; }
.text-lg   { font-size: 15px !important; }
.text-xl   { font-size: 18px !important; }
.text-2xl  { font-size: 20px !important; }
.text-3xl  { font-size: 22px !important; }
.text-4xl  { font-size: 26px !important; }

.font-light  { font-weight: 300 !important; }
.font-normal { font-weight: 400 !important; }
.font-medium { font-weight: 500 !important; }
.font-semibold { font-weight: 600 !important; }
.font-bold   { font-weight: 700 !important; }
.font-extrabold { font-weight: 800 !important; }

.font-mono   { font-family: var(--font-mono) !important; }

.leading-none   { line-height: 1 !important; }
.leading-tight  { line-height: 1.25 !important; }
.leading-normal { line-height: 1.5 !important; }
.leading-loose  { line-height: 1.75 !important; }

.tracking-tight  { letter-spacing: -0.5px !important; }
.tracking-wide   { letter-spacing: 0.6px !important; }
.tracking-wider  { letter-spacing: 1px !important; }
.uppercase   { text-transform: uppercase !important; }
.capitalize  { text-transform: capitalize !important; }

.text-left   { text-align: left !important; }
.text-center { text-align: center !important; }
.text-right  { text-align: right !important; }

.truncate    { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whitespace-nowrap { white-space: nowrap !important; }

/* ── Color Utilities ─────────────────────────────────────── */
.text-primary { color: var(--primary) !important; }
.text-amber   { color: var(--amber) !important; }
.text-green   { color: var(--green) !important; }
.text-red     { color: var(--red) !important; }
.text-purple  { color: var(--purple) !important; }
.text-muted   { color: var(--muted) !important; }
.text-white   { color: #fff !important; }
.text-inv     { color: var(--text-inv) !important; }
.text-default { color: var(--text) !important; }

/* ── Background Utilities ────────────────────────────────── */
.bg-primary      { background: var(--primary) !important; }
.bg-primary-soft { background: var(--primary-soft) !important; }
.bg-amber        { background: var(--amber) !important; }
.bg-amber-soft   { background: var(--amber-soft) !important; }
.bg-green        { background: var(--green) !important; }
.bg-green-soft   { background: var(--green-soft) !important; }
.bg-red          { background: var(--red) !important; }
.bg-red-soft     { background: var(--red-soft) !important; }
.bg-purple       { background: var(--purple) !important; }
.bg-purple-soft  { background: var(--purple-soft) !important; }
.bg-card         { background: var(--card) !important; }
.bg-canvas       { background: var(--canvas) !important; }
.bg-sidebar      { background: var(--sidebar-bg) !important; }
.bg-transparent  { background: transparent !important; }
.bg-none         { background: none !important; }

/* ── Border Utilities ────────────────────────────────────── */
.border          { border: 1px solid var(--border) !important; }
.border-0        { border: none !important; }
.border-t        { border-top: 1px solid var(--border) !important; }
.border-b        { border-bottom: 1px solid var(--border) !important; }
.border-transparent { border-color: transparent !important; }
.border-primary  { border-color: var(--primary) !important; }

/* ── Border Radius Utilities ─────────────────────────────── */
.rounded-sm   { border-radius: var(--radius-sm) !important; }
.rounded      { border-radius: var(--radius) !important; }
.rounded-lg   { border-radius: var(--radius-lg) !important; }
.rounded-xl   { border-radius: var(--radius-xl) !important; }
.rounded-full { border-radius: var(--radius-full) !important; }

/* ── Shadow Utilities ────────────────────────────────────── */
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow    { box-shadow: var(--shadow) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }
.shadow-none { box-shadow: none !important; }

/* ── Cursor ──────────────────────────────────────────────── */
.cursor-pointer { cursor: pointer !important; }
.cursor-default { cursor: default !important; }
.select-none    { user-select: none !important; }

/* ── Opacity ─────────────────────────────────────────────── */
.opacity-0   { opacity: 0 !important; }
.opacity-50  { opacity: 0.5 !important; }
.opacity-100 { opacity: 1 !important; }

/* ── Transition ──────────────────────────────────────────── */
.transition      { transition: all 0.15s !important; }
.transition-bg   { transition: background 0.15s !important; }
.transition-transform { transition: transform 0.2s !important; }

/* ============================================================
   COMPONENT CLASSES
   ============================================================ */

/* ── Layout: Dashboard Shell ─────────────────────────────── */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: var(--text-inv);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  transition: transform .28s cubic-bezier(.4,0,.2,1), width .28s cubic-bezier(.4,0,.2,1);
  z-index: 100;
  overflow: hidden;
}
.sidebar.collapsed       { width: var(--sidebar-w-collapsed); }
.sidebar.mobile-hidden   { transform: translateX(-100%); }

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  min-height: var(--topbar-h);
}

.sidebar-nav {
  flex: 1;
  padding: 14px 10px;
  overflow-y: auto;
}

/* sidebar-footer dihapus — logout dipindah ke topbar */

/* Sembunyikan scrollbar sidebar (tetap bisa scroll) */
.sidebar-nav::-webkit-scrollbar { display: none; }
.sidebar-nav { -ms-overflow-style: none; scrollbar-width: none; }

/* ── Logo ─────────────────────────────────────────────────── */
.logo-icon {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--amber) 0%, var(--primary-bright) 55%, var(--primary) 100%);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-weight: 700; font-size: 15px;
  color: #fff; letter-spacing: -0.5px;
}
.logo-text {
  font-weight: 700; font-size: 15px;
  white-space: nowrap; overflow: hidden;
  color: #fff;
}

/* ── Nav Items ───────────────────────────────────────────── */
.nav-section-label {
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1px;
  color: rgba(255,255,255,.3);
  padding: 8px 10px 6px;
  white-space: nowrap; overflow: hidden;
}
.nav-item {
  display: flex; align-items: center;
  gap: 11px; padding: 10px;
  border-radius: 8px; cursor: pointer;
  transition: background .15s;
  color: rgba(255,255,255,.6);
  font-size: 14px; font-weight: 500;
  white-space: nowrap; overflow: hidden;
  position: relative;
}
.nav-item:hover               { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active              { background: var(--primary-soft); color: var(--primary); }
.nav-item svg                 { flex-shrink: 0; width: 18px; height: 18px; }

.nav-badge {
  margin-left: auto;
  background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: var(--radius-full);
  flex-shrink: 0;
}

/* Collapsed sidebar */
.sidebar.collapsed .nav-item         { justify-content: center; }
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .logo-text        { opacity: 0; width: 0; overflow: hidden; }

/* ── Sidebar Overlay (Mobile) ────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 90;
}
.sidebar-overlay.show { display: block; }

/* ── Main Area ───────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1; display: flex; flex-direction: column;
  transition: margin-left .28s cubic-bezier(.4,0,.2,1);
  min-width: 0;
}
.main.expanded  { margin-left: var(--sidebar-w-collapsed); }
.main.no-margin { margin-left: 0; }

/* ── Topbar ──────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px; gap: 16px;
  position: sticky; top: 0;
  z-index: 50;
  box-shadow: var(--shadow);
}

.topbar-toggle {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  transition: background .15s, color .15s;
}
.topbar-toggle:hover { background: var(--canvas); color: var(--text); }

.topbar-breadcrumb {
  font-size: 15px; font-weight: 600;
  color: var(--text); flex: 1;
}
.topbar-breadcrumb span { color: var(--muted); font-weight: 400; font-size: 13px; }

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

.topbar-btn {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  position: relative;
  transition: background .15s, color .15s;
}
.topbar-btn:hover { background: var(--canvas); color: var(--text); }

/* ── Content Area ────────────────────────────────────────── */
.content { padding: 28px; flex: 1; overflow-y: auto; }

/* ── Avatar ──────────────────────────────────────────────── */
.avatar {
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 13px;
  cursor: pointer; flex-shrink: 0;
}
.avatar-lg {
  width: 72px; height: 72px;
  font-size: 28px;
}
.avatar-sm {
  width: 30px; height: 30px;
  font-size: 11px;
}

/* ── Avatar Group ────────────────────────────────────────── */
.avatar-group { display: flex; }
.avatar-group .av {
  width: 26px; height: 26px;
  border-radius: var(--radius-full);
  border: 2px solid white;
  margin-left: -6px;
  font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: white;
}
.avatar-group .av:first-child { margin-left: 0; }

/* ── Notification Dot ────────────────────────────────────── */
.notif-dot {
  width: 8px; height: 8px;
  border-radius: var(--radius-full);
  background: var(--red);
  position: absolute;
  top: 6px; right: 6px;
  border: 2px solid white;
}

/* ── Card ────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.card-header {
  padding: 18px 20px 0;
  display: flex; align-items: center;
  justify-content: space-between;
}
.card-title  { font-size: 14px; font-weight: 600; color: var(--text); }
.card-body   { padding: 16px 20px 20px; }

/* ── Stat Card ───────────────────────────────────────────── */
.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: var(--shadow);
}
.stat-top   { display: flex; align-items: flex-start; justify-content: space-between; }
.stat-icon  { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.stat-value { font-size: 26px; font-weight: 700; line-height: 1; }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.stat-change { font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 3px; }
.stat-change.up   { color: var(--green); }
.stat-change.down { color: var(--red); }

/* ── Grid: Stats ─────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

/* ── Grid: Charts ────────────────────────────────────────── */
.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

/* ── Chart Wrap ──────────────────────────────────────────── */
.chart-wrap {
  position: relative;
  height: 240px;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px; font-weight: 600; font-family: var(--font);
  cursor: pointer; border: none;
  transition: filter .15s, transform .1s;
}
.btn:hover  { filter: brightness(1.06); }
.btn:active { transform: scale(.97); }

.btn-primary { background: var(--primary); color: #fff; }
.btn-outline { background: none; border: 1px solid var(--border); color: var(--text); }
.btn-danger  { background: var(--red-soft); color: var(--red); border: 1px solid transparent; }
.btn-success { background: var(--green-soft); color: var(--green); border: 1px solid transparent; }
.btn-warning { background: var(--amber-soft); color: var(--amber); border: 1px solid transparent; }
.btn-ghost   { background: transparent; border: none; color: var(--muted); }
.btn-icon    { padding: 8px; }

.btn-sm  { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-lg  { padding: 11px 20px; font-size: 15px; border-radius: 10px; }
.btn-w-full { width: 100%; justify-content: center; }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: var(--radius-full);
  font-size: 11px; font-weight: 600;
}
.badge-green  { background: var(--green-soft); color: var(--green); }
.badge-red    { background: var(--red-soft);   color: var(--red); }
.badge-amber  { background: var(--amber-soft); color: var(--amber); }
.badge-blue   { background: var(--primary-soft); color: var(--primary); }
.badge-purple { background: var(--purple-soft); color: var(--purple); }

/* ── Table ───────────────────────────────────────────────── */
.data-table {
  width: 100%; border-collapse: collapse; font-size: 13.5px;
}
.data-table th {
  padding: 10px 14px;
  text-align: left; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .6px;
  color: var(--muted); border-bottom: 1px solid var(--border);
  background: var(--canvas); cursor: pointer; user-select: none;
}
.data-table th:hover        { color: var(--text); }
.data-table td              { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td     { background: var(--canvas); }
.data-table th[data-sort]   { cursor: pointer; }
.data-table th.no-sort      { cursor: default; }
.data-table th.no-sort:hover { color: var(--muted); }
.th-inner   { display: inline-flex; align-items: center; gap: 5px; }
.sort-caret { opacity: .35; transition: opacity .15s, transform .15s; }
th.sort-asc  .sort-caret { opacity: 1; transform: rotate(180deg); }
th.sort-desc .sort-caret { opacity: 1; }

/* ── Table Controls ──────────────────────────────────────── */
.table-controls {
  display: flex; align-items: center;
  gap: 12px; margin-bottom: 14px;
}
.table-actions { margin-left: auto; display: flex; gap: 8px; }

/* ── Search Box ──────────────────────────────────────────── */
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  flex: 1; max-width: 280px;
}
.search-box input {
  border: none; background: none; outline: none;
  font-size: 13px; font-family: var(--font); width: 100%;
  color: var(--text);
}
.search-box svg { color: var(--muted); flex-shrink: 0; width: 15px; height: 15px; }

/* ── Pagination ──────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.pagination-info { color: var(--muted); }
.pagination-btns { display: flex; gap: 4px; }
.pg-btn {
  width: 30px; height: 30px;
  border-radius: 6px; border: 1px solid var(--border);
  background: none; cursor: pointer;
  font-size: 12px; font-weight: 600; font-family: var(--font);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.pg-btn:hover          { background: var(--canvas); }
.pg-btn.active         { background: var(--primary); color: #fff; border-color: var(--primary); }
.pg-btn:disabled       { opacity: 0.4; cursor: not-allowed; }

/* ── Forms ───────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }

.form-label    { font-size: 12px; font-weight: 600; color: var(--text); }
.form-input, .form-select, .form-textarea {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13.5px; font-family: var(--font);
  background: var(--canvas); outline: none;
  transition: border-color .15s, box-shadow .15s;
  color: var(--text);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.form-textarea    { resize: vertical; min-height: 90px; }
.form-hint        { font-size: 11px; color: var(--muted); }
.form-error       { font-size: 11px; color: var(--red); }
.form-section-title {
  font-size: 13px; font-weight: 700; color: var(--text);
  margin-bottom: 2px; grid-column: 1/-1;
  padding-top: 4px; border-top: 1px solid var(--border);
}

/* ── Toggle Switch ───────────────────────────────────────── */
.toggle-switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background .2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 3px; top: 3px;
  background: white; border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle-switch input:checked + .toggle-slider          { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before  { transform: translateX(18px); }

/* ── Progress Bar ────────────────────────────────────────── */
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width .6s ease;
}

/* ── Activity Feed ───────────────────────────────────────── */
.activity-item {
  display: flex; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot    { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.activity-content { flex: 1; }
.activity-text   { font-size: 13px; line-height: 1.5; }
.activity-text strong { font-weight: 600; }
.activity-time   { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ── Notification Panel ──────────────────────────────────── */
.notif-panel {
  position: fixed; top: 68px; right: 16px; width: 340px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  z-index: 200; overflow: hidden;
  animation: slideDown .2s ease;
}
.notif-header {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.notif-title  { font-size: 14px; font-weight: 700; }
.notif-clear  { font-size: 12px; color: var(--primary); cursor: pointer; font-weight: 600; background: none; border: none; font-family: var(--font); }
.notif-list   { max-height: 360px; overflow-y: auto; }
.notif-item   { padding: 13px 16px; display: flex; gap: 11px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .12s; }
.notif-item:hover   { background: var(--canvas); }
.notif-item.unread  { background: oklch(98% 0.012 143); }
.notif-item:last-child { border-bottom: none; }
.notif-icon   { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 16px; }
.notif-body   { flex: 1; min-width: 0; }
.notif-msg    { font-size: 13px; font-weight: 500; line-height: 1.4; }
.notif-time   { font-size: 11px; color: var(--muted); margin-top: 3px; }
.notif-unread-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); margin-top: 6px; flex-shrink: 0; }

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 300;
  display: none; align-items: center; justify-content: center;
}
.modal-overlay.show {
  display: flex;
  animation: fadeIn .18s ease;
}
.modal {
  background: var(--card);
  border-radius: 14px;
  width: 540px; max-width: calc(100vw - 40px);
  max-height: 90vh; overflow-y: auto;
  animation: scaleIn .2s ease;
}
.modal-header {
  padding: 22px 24px 0;
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title  { font-size: 16px; font-weight: 700; }
.modal-close  {
  width: 30px; height: 30px;
  border-radius: 7px; border: 1px solid var(--border);
  background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
}
.modal-close:hover { background: var(--canvas); }
.modal-body   { padding: 20px 24px; }
.modal-footer {
  padding: 0 24px 22px;
  display: flex; gap: 10px; justify-content: flex-end;
}

/* ── Delete Confirm ──────────────────────────────────────── */
.delete-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 400;
  display: none; align-items: center; justify-content: center;
}
.delete-overlay.show { display: flex; animation: fadeIn .18s ease; }
.delete-box {
  background: var(--card); border-radius: 14px;
  padding: 28px; max-width: 380px; width: calc(100vw - 40px);
  text-align: center;
  animation: scaleIn .2s ease;
}
.delete-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--red-soft);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
}
.delete-title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.delete-desc  { font-size: 13px; color: var(--muted); margin-bottom: 20px; line-height: 1.5; }
.delete-btns  { display: flex; gap: 10px; justify-content: center; }

/* ── Table Card ──────────────────────────────────────────── */
.table-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.table-card .table-controls { padding: 14px 16px 2px; }
.table-wrap { overflow-x: auto; }

/* ── Page Header ─────────────────────────────────────────── */
.page-header  { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; }
.page-title   { font-size: 22px; font-weight: 700; }
.page-subtitle { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ── Action Group (tabel aksi) ───────────────────────────── */
.action-group { display: flex; gap: 6px; }

/* ── User Menu ───────────────────────────────────────────── */
.user-menu {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 4px 8px 4px 4px;
  border-radius: var(--radius-full); cursor: pointer;
  transition: background .15s; border: 1px solid transparent;
}
.user-menu:hover { background: var(--canvas); }
.user-menu.open  { background: var(--canvas); border-color: var(--border); }
.user-menu-info  { display: flex; flex-direction: column; line-height: 1.2; }
.user-menu-name  { font-size: 13px; font-weight: 700; color: var(--text); }
.user-menu-role  { font-size: 11px; color: var(--muted); }

/* ── Dropdown ────────────────────────────────────────────── */
.dropdown-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 180px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-md); z-index: 250;
  padding: 6px; display: none;
  animation: slideDown .18s ease;
}
.dropdown-menu.show { display: block; }
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  font-size: 13px; font-weight: 500; color: var(--text);
  cursor: pointer; text-decoration: none; transition: background .12s;
}
.dropdown-item:hover               { background: var(--canvas); color: var(--text); text-decoration: none; }
.dropdown-item svg                 { flex-shrink: 0; width: 16px; height: 16px; color: var(--muted); }
.dropdown-item.danger              { color: var(--red); }
.dropdown-item.danger svg          { color: var(--red); }
.dropdown-item.danger:hover        { background: var(--red-soft); }
.dropdown-divider                  { height: 1px; background: var(--border); margin: 4px 6px; }

/* ── Row Actions (icon-only button group) ────────────────── */
.row-actions { display: flex; gap: 4px; }
.row-actions .ico-btn {
  width: 30px; height: 30px; border-radius: 7px;
  border: 1px solid var(--border); background: var(--card);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.row-actions .ico-btn:hover        { background: var(--canvas); color: var(--text); }
.row-actions .ico-btn.danger       { color: var(--red); }
.row-actions .ico-btn.danger:hover { background: var(--red-soft); border-color: transparent; }

/* ── Toast ───────────────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 400;
}
.toast {
  background: var(--sidebar-bg); color: var(--text-inv);
  padding: 12px 16px; border-radius: 10px;
  font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  min-width: 260px;
  box-shadow: var(--shadow-md);
  animation: slideUp .25s ease;
}
.toast-icon {
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.toast.success .toast-icon { background: var(--green); }
.toast.error   .toast-icon { background: var(--red); }
.toast.info    .toast-icon { background: var(--primary); }

/* ── Settings ────────────────────────────────────────────── */
.settings-tabs {
  display: flex; gap: 4px;
  background: var(--canvas); border-radius: 10px;
  padding: 4px; margin-bottom: 24px; width: fit-content;
}
.settings-tab {
  padding: 7px 16px; border-radius: 7px;
  font-size: 13px; font-weight: 500; cursor: pointer;
  border: none; background: none; font-family: var(--font);
  color: var(--muted);
}
.settings-tab.active {
  background: var(--card); color: var(--text);
  font-weight: 600; box-shadow: var(--shadow);
}
.setting-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.setting-row:last-child       { border-bottom: none; }
.setting-info .setting-name   { font-size: 13.5px; font-weight: 500; }
.setting-info .setting-desc   { font-size: 12px; color: var(--muted); margin-top: 1px; }

/* ── Gallery ─────────────────────────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.gallery-item {
  background: var(--card);
  border-radius: var(--radius); border: 1px solid var(--border);
  overflow: hidden; box-shadow: var(--shadow);
  cursor: pointer;
  transition: box-shadow .2s, transform .2s;
}
.gallery-item:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.gallery-thumb {
  width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block;
  background: var(--canvas); position: relative; overflow: hidden;
}
.gallery-thumb-inner {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; position: relative;
}
.gallery-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .2s;
}
.gallery-item:hover .gallery-overlay { opacity: 1; }
.gallery-info    { padding: 12px 14px; }
.gallery-title   { font-size: 13px; font-weight: 600; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gallery-meta    { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.gallery-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }

/* ── Lightbox ────────────────────────────────────────────── */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.88);
  z-index: 600;
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .2s ease;
}
.lightbox-close {
  position: absolute; top: 16px; right: 16px;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.12); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.lightbox-close:hover  { background: rgba(255,255,255,.2); }
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.12); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.lightbox-nav:hover    { background: rgba(255,255,255,.22); }
.lightbox-nav.prev     { left: 20px; }
.lightbox-nav.next     { right: 20px; }
.lightbox-content      { max-width: 800px; width: 100%; padding: 20px; text-align: center; }
.lightbox-img          { width: 100%; max-height: 520px; border-radius: 12px; }
.lightbox-info         { margin-top: 14px; color: #fff; }
.lightbox-title        { font-size: 16px; font-weight: 700; }
.lightbox-sub          { font-size: 12px; color: rgba(255,255,255,.55); margin-top: 4px; }
.lightbox-dots         { display: flex; gap: 6px; justify-content: center; margin-top: 14px; }
.lightbox-dot          { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.3); cursor: pointer; }
.lightbox-dot.active   { background: #fff; }

/* ── Divider ─────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); }
.divider-v { width: 1px; height: 24px; background: var(--border); }

/* ── Legend ──────────────────────────────────────────────── */
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.legend-dot  { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ── Upload Drop Zone ────────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: var(--canvas);
}
.drop-zone:hover { border-color: var(--primary); background: var(--primary-soft); }

/* ── Alert / Info Box ────────────────────────────────────── */
.alert {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border-radius: 10px;
  font-size: 13px; border: 1px solid transparent;
}
.alert-info    { background: var(--primary-soft); color: var(--primary); border-color: oklch(56% 0.16 143 / 0.3); }
.alert-success { background: var(--green-soft);   color: var(--green);   border-color: oklch(66% 0.17 150 / 0.3); }
.alert-warning { background: var(--amber-soft);   color: var(--amber);   border-color: oklch(64% 0.165 50 / 0.3); }
.alert-error   { background: var(--red-soft);     color: var(--red);     border-color: oklch(60% 0.2 25 / 0.3); }

/* ── Tooltip ─────────────────────────────────────────────── */
.tooltip-wrap { position: relative; display: inline-flex; }
.tooltip-wrap .tooltip {
  position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%);
  background: var(--sidebar-bg); color: #fff;
  font-size: 11px; font-weight: 500;
  padding: 4px 8px; border-radius: 6px;
  white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity .15s;
}
.tooltip-wrap:hover .tooltip { opacity: 1; }

/* ── Empty State ─────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--muted);
}
.empty-state-icon  { font-size: 48px; margin-bottom: 16px; }
.empty-state-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.empty-state-desc  { font-size: 13px; }

/* ── Skeleton Loader ─────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, #eef0f3 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}
.skeleton-text  { height: 14px; width: 100%; }
.skeleton-title { height: 20px; width: 60%; }
.skeleton-box   { height: 80px; width: 100%; }

/* ── Chip / Tag ──────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--radius-full);
  font-size: 11px; font-weight: 500;
  background: var(--canvas); border: 1px solid var(--border);
  color: var(--muted); cursor: pointer;
}
.chip.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }

/* ── Mini Stat Block ─────────────────────────────────────── */
.mini-stat {
  border-radius: 10px;
  padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
}

/* ── Kbd ─────────────────────────────────────────────────── */
.kbd {
  display: inline-flex; align-items: center;
  padding: 2px 7px; border-radius: 5px;
  background: var(--canvas); border: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  color: var(--text);
}

/* ── Animations ──────────────────────────────────────────── */
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp   { from { opacity: 0; transform: translateY(20px);  } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn    { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn   { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: scale(1); } }
@keyframes shimmer   { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ── Responsive (Dashboard Components) ──────────────────── */
@media (max-width: 900px) {
  .stats-grid  { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .stats-grid      { grid-template-columns: 1fr 1fr; }
  .content         { padding: 16px; }
  .form-grid       { grid-template-columns: 1fr; }
  .form-group.full { grid-column: 1; }
  .d-none-mobile   { display: none !important; }
  .user-menu-info  { display: none; }
}

/* ============================================================
   NEXUS STEPPER — Wizard & Stage Tracker (v1.0)
   ============================================================ */

/* ── Rel bersama ─────────────────────────────────────────── */
.stepper { display: flex; align-items: center; width: 100%; margin-bottom: 4px; overflow-x: auto; }
.step { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.step .dot {
  width: 30px; height: 30px; border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
  border: 2px solid var(--border); background: var(--surface); color: var(--text-muted);
  transition: background .2s, border-color .2s, color .2s;
}
.step .lbl { font-size: 12px; font-weight: 600; color: var(--text-muted); white-space: nowrap; transition: color .2s; }
.step-line { flex: 1 1 auto; height: 2px; background: var(--border); margin: 0 12px; min-width: 18px; transition: background .2s; }
.step.is-active .dot  { border-color: var(--primary); background: var(--primary); color: #fff; }
.step.is-active .lbl  { color: var(--text); }
.step.is-done .dot    { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.step.is-done .lbl    { color: var(--text); }
.step.is-done + .step-line { background: var(--primary); }

/* ── Wizard shell ────────────────────────────────────────── */
.wiz { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.wiz-head { padding: 18px 22px 16px; border-bottom: 1px solid var(--border); }
.wiz-body { padding: 22px; }
.wiz-panel { display: none; animation: fadeIn .2s; }
.wiz-panel.on { display: block; }
.wiz-panel h3 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.wiz-panel .ph { font-size: 12.5px; color: var(--text-muted); margin-bottom: 18px; }
.wiz-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-top: 1px solid var(--border); background: var(--bg);
}
.wiz-foot .spacer { margin-left: auto; }

/* ── Review list ────────────────────────────────────────── */
.rev-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.rev-row:last-child { border-bottom: none; }
.rev-row .k { color: var(--text-muted); }
.rev-row .v { font-weight: 600; }
.id-preview { font-family: var(--font-mono); font-size: 12px; color: var(--primary); background: var(--primary-light); padding: 2px 8px; border-radius: 6px; }

/* ── Stage tracker ───────────────────────────────────────── */
.stage-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.stage-head { padding: 16px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.stage-head .id { font-family: var(--font-mono); font-size: 13px; font-weight: 700; }
.stage-rail { padding: 20px 22px 12px; overflow-x: auto; }
.stage-body { padding: 0 22px 16px; display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-end; }
.stage-metric .v { font-size: 20px; font-weight: 700; line-height: 1; }
.stage-metric .l { font-size: 11px; color: var(--text-muted); font-weight: 500; margin-top: 3px; }
.stage-foot {
  padding: 12px 22px; border-top: 1px solid var(--border); background: var(--bg);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.stage-hist { padding: 12px 22px; border-top: 1px solid var(--border); }
.stage-hist .hd { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted); margin-bottom: 10px; }
.hist-item { display: flex; align-items: center; gap: 10px; font-size: 12.5px; padding: 5px 0; border-bottom: 1px solid var(--border); }
.hist-item:last-child { border-bottom: none; }
.hist-item .ic { width: 18px; height: 18px; border-radius: 50%; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; flex-shrink: 0; }
.hist-item .t  { color: var(--text-muted); font-family: var(--font-mono); font-size: 11px; margin-left: auto; }

/* ── Advance inline form ─────────────────────────────────── */
.advance-box { display: none; width: 100%; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.advance-box.on { display: flex; }
.advance-box .form-group { margin-bottom: 0; flex: 1; min-width: 140px; }

/* ── hint warn ───────────────────────────────────────────── */
.hint-warn { font-size: 11.5px; color: var(--danger); margin-top: 4px; }

/* ═══════════════════════════════════════════════════════════════
   NEXUS ALIAS & UTILITY — F3 additions
   Alias badge, btn, ico, layout helpers dipakai modul-modul F3.
   ═══════════════════════════════════════════════════════════════ */

/* ── Badge aliases ─────────────────────────────────────────── */
.badge-success   { background: var(--green-soft);    color: var(--green);   }
.badge-danger    { background: var(--red-soft);      color: var(--red);     }
.badge-warning   { background: var(--amber-soft);    color: var(--amber);   }
.badge-info      { background: var(--primary-soft);  color: var(--primary); }
.badge-secondary { background: var(--canvas);        color: var(--muted);   border:1px solid var(--border); }

/* ── Button aliases ────────────────────────────────────────── */
.btn-secondary { background: none; border: 1px solid var(--border); color: var(--text); }
.btn-secondary:hover { background: var(--canvas); }
.btn-xs { padding: 3px 8px; font-size: 11px; border-radius: 5px; font-weight: 500; cursor: pointer; display:inline-flex; align-items:center; gap:3px; }

/* ── ico-btn danger alias ──────────────────────────────────── */
.row-actions .ico-btn.ico-danger       { color: var(--red); }
.row-actions .ico-btn.ico-danger:hover { background: var(--red-soft); border-color: transparent; }

/* ── 2-column form grid ─────────────────────────────────────── */
.row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}
@media (max-width: 480px) { .row-2col { grid-template-columns: 1fr; } }

/* ── Detail key-value table ────────────────────────────────── */
.detail-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.detail-table th {
  text-align: left; padding: 6px 10px; font-weight: 500;
  color: var(--muted); white-space: nowrap; width: 40%;
}
.detail-table td { padding: 6px 10px; }
.detail-table tr + tr th,
.detail-table tr + tr td { border-top: 1px solid var(--border); }

/* ── Pagination bar ─────────────────────────────────────────── */
.pagination-bar {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  font-size: .85rem;
}

/* ── Toast notifications ────────────────────────────────────── */
.nexus-notif {
  position: fixed; bottom: 1.25rem; right: 1.25rem; z-index: 9999;
  padding: .6rem 1.1rem; border-radius: 8px; font-size: .875rem;
  font-weight: 500; box-shadow: 0 4px 12px rgba(0,0,0,.12);
  animation: notifIn .2s ease;
  max-width: 22rem;
}
@keyframes notifIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
.nexus-notif-success { background: var(--green-soft); color: var(--green); }
.nexus-notif-danger  { background: var(--red-soft);   color: var(--red);   }
.nexus-notif-warning { background: var(--amber-soft); color: var(--amber); }
.nexus-notif-info    { background: var(--primary-soft); color: var(--primary); }

/* ── Tab bar ─────────────────────────────────────────────────── */
.nexus-tabs {
  display: flex; gap: 4px; border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}
.tab-btn {
  padding: 7px 16px; font-size: .875rem; font-weight: 500;
  background: none; border: none; border-bottom: 2px solid transparent;
  margin-bottom: -2px; cursor: pointer; color: var(--muted);
  border-radius: 6px 6px 0 0; transition: color .15s, border-color .15s;
}
.tab-btn:hover    { color: var(--text); background: var(--canvas); }
.tab-btn.is-active { color: var(--primary); border-bottom-color: var(--primary); background: none; }

/* ── Color vars fallback (jika belum ada di root) ──────────── */
:root {
  --color-success: var(--green,  #22c55e);
  --color-danger:  var(--red,    #ef4444);
  --color-warning: var(--amber,  #f59e0b);
}

/* tab-btn.active alias — masterdata pakai class ini (penjualan pakai .is-active) */
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); background: none; }

/* ═══════════════════════════════════════════════════════════════
   MODAL — alias & pola F3
   Dua pola yang dipakai:
   A) produksi (F2-style): .modal-overlay + JS classList.add('active')
   B) F3 baru: .nexus-modal-overlay + JS classList.add('is-open')
   ═══════════════════════════════════════════════════════════════ */

/* Pattern A — active alias (produksi wizard & tracker) */
.modal-overlay.active {
  display: flex;
  animation: fadeIn .18s ease;
}

/* Pattern B — nexus-modal-overlay / nexus-modal */
.nexus-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.nexus-modal-overlay.is-open {
  display: flex;
  animation: fadeIn .18s ease;
}
.nexus-modal {
  background: var(--card);
  border-radius: 14px;
  width: 100%;
  max-width: calc(100vw - 2rem);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 40px rgba(0,0,0,.18);
  animation: scaleIn .2s ease;
}
.nexus-modal .modal-header {
  padding: 20px 24px 0;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
}
.nexus-modal .modal-title { font-size: 15px; font-weight: 700; }
.nexus-modal .modal-body  { padding: 20px 24px; }
.nexus-modal .modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  display: flex; gap: 8px; justify-content: flex-end;
}

/* Klik backdrop = tutup */
.nexus-modal-overlay > .nexus-modal { pointer-events: auto; }

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD COMPONENTS
   stat-card · list-card · chart-card · quick-action-bar
   ═══════════════════════════════════════════════════════════════ */

/* ── Stat card (KPI) ────────────────────────────────────────── */
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
  display: flex; flex-direction: column; gap: 6px;
  transition: box-shadow .15s;
}
.stat-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.stat-card .sc-label {
  font-size: .78rem; font-weight: 500; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
}
.stat-card .sc-value {
  font-size: 2rem; font-weight: 700; line-height: 1.15;
  color: var(--text);
}
.stat-card .sc-value.lg { font-size: 1.5rem; }
.stat-card .sc-sub  { font-size: .8rem; color: var(--muted); }
.stat-card .sc-delta {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: .78rem; font-weight: 600; padding: 2px 7px;
  border-radius: 20px;
}
.stat-card .sc-delta.up   { background: var(--green-soft);  color: var(--green);  }
.stat-card .sc-delta.down { background: var(--red-soft);    color: var(--red);    }
.stat-card .sc-delta.flat { background: var(--canvas);      color: var(--muted);  }
.stat-card .sc-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* Warna accent per KPI */
.stat-card.accent-green  { border-left: 4px solid var(--green);   }
.stat-card.accent-blue   { border-left: 4px solid var(--primary); }
.stat-card.accent-amber  { border-left: 4px solid var(--amber);   }
.stat-card.accent-red    { border-left: 4px solid var(--red);     }
.stat-card.accent-purple { border-left: 4px solid #a78bfa;        }

/* ── KPI grid (auto responsive) ────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

/* ── List card ──────────────────────────────────────────────── */
.list-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.list-card .lc-header {
  padding: 14px 18px 10px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.list-card .lc-title {
  font-size: .875rem; font-weight: 700; color: var(--text);
}
.list-card .lc-link {
  font-size: .78rem; color: var(--primary); text-decoration: none; font-weight: 500;
}
.list-card .lc-link:hover { text-decoration: underline; }
.list-card .lc-body  { padding: 4px 0; }
.list-card .lc-empty {
  padding: 20px 18px; text-align: center; color: var(--muted);
  font-size: .85rem;
}
.list-card .lc-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 18px; font-size: .85rem;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.list-card .lc-row:last-child { border-bottom: none; }
.list-card .lc-row:hover { background: var(--canvas); }
.list-card .lc-row a { color: var(--text); text-decoration: none; }
.list-card .lc-row a:hover { color: var(--primary); }
.list-card .lc-row .lc-name { flex: 1; min-width: 0; }
.list-card .lc-row .lc-name span { display: block; }
.list-card .lc-row .lc-name .sub { color: var(--muted); font-size: .78rem; }
.list-card .lc-row .lc-num  { color: var(--muted); white-space: nowrap; font-size: .8rem; }

/* ── Chart card ─────────────────────────────────────────────── */
.chart-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
}
.chart-card .cc-title {
  font-size: .875rem; font-weight: 700; color: var(--text);
  margin-bottom: 14px;
}
.chart-card canvas { width: 100% !important; }

/* ── Dashboard grid layouts ─────────────────────────────────── */
.dash-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.dash-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}
@media (max-width: 900px) {
  .dash-grid-2, .dash-grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Quick action bar ───────────────────────────────────────── */
.quick-action-bar {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 20px;
}
.quick-action-bar .qa-label {
  font-size: .78rem; font-weight: 500; color: var(--muted);
  margin-right: 4px; white-space: nowrap;
}
.quick-action-bar .btn { font-size: .82rem; }

/* ── Role section divider ───────────────────────────────────── */
.role-section { margin-bottom: 28px; }
.role-section-title {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px; margin-bottom: 14px;
}

/* ── Alert strip (bahan rendah) ─────────────────────────────── */
.alert-strip {
  background: var(--amber-soft); color: var(--amber);
  border-radius: 8px; padding: 10px 14px;
  font-size: .85rem; font-weight: 500;
  display: flex; align-items: center; gap: 8px;
}

/* ── RBAC: Role-based button visibility (F4) ─────────────────── */
/* action-admin  : hanya Admin yang bisa lihat (Delete di semua modul,
                   semua CUD di modul restricted) */
/* action-write  : Admin + Karyawan bisa lihat (Create/Edit di modul
                   yang Karyawan boleh C/U) */
body[data-role="Owner"] .action-admin,
body[data-role="Owner"] .action-write { display: none !important; }
body[data-role="Karyawan"] .action-admin { display: none !important; }
