/* ============================================================
   OBS ERP — Design Foundation
   Glass language (Dhany Indraswara DS) re-skinned for B2B.
   Brand: indigo #1e3a8a · accents: royal blue / cyan
   Font: Plus Jakarta Sans
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,500;0,600;0,700;0,800;1,500&display=swap');

:root {
  /* ---------- Brand (indigo navy) ---------- */
  --brand:            #1e3a8a;   /* primary */
  --brand-hover:      #1e40af;
  --brand-press:      #172a63;
  --brand-700:        #1e3a8a;
  --brand-600:        #2563eb;
  --brand-light:      #dbeafe;   /* soft fill */
  --brand-soft:       #eff6ff;   /* softest fill */
  --brand-tint:       #e7edfb;

  /* accents borrowed from DS for data-viz / highlights */
  --accent-blue:      #3581E1;
  --accent-cyan:      #02A0C1;

  /* ---------- Semantic ---------- */
  --success:          #059669;  --success-bg:#d1fae5;  --success-soft:#ecfdf5;
  --warning:          #d97706;  --warning-bg:#fef3c7;  --warning-soft:#fffbeb;
  --danger:           #e11d48;  --danger-bg:#ffe4e6;   --danger-soft:#fff1f3;
  --info:             #2563eb;  --info-bg:#dbeafe;     --info-soft:#eff6ff;

  /* ---------- Neutrals ---------- */
  --page:             #f4f5f8;
  --white:            #ffffff;
  --line:             #e6e8ec;
  --line-soft:        #eef0f3;
  --neutral-100:      #f3f4f6;
  --neutral-200:      #e9eaee;

  /* ---------- Text ---------- */
  --t-primary:        #1b1f27;
  --t-secondary:      #4a4f5a;
  --t-muted:          #818793;
  --t-faint:          #a6abb5;
  --t-on-brand:       #ffffff;

  /* ---------- Glass ---------- */
  --glass-bg:         rgba(255,255,255,0.62);
  --glass-bg-strong:  rgba(255,255,255,0.78);
  --glass-border:     rgba(255,255,255,0.7);
  --glass-blur:       blur(26px) saturate(140%);

  /* ---------- Halos ---------- */
  --halo-indigo:      rgba(30,58,138,0.18);
  --halo-blue:        rgba(53,129,225,0.20);
  --halo-cyan:        rgba(2,160,193,0.16);

  /* ---------- Radii ---------- */
  --r-xs: 8px; --r-sm: 12px; --r-md: 16px; --r-lg: 22px; --r-xl: 28px; --r-pill: 999px;

  /* ---------- Shadows ---------- */
  --sh-xs: 0 1px 2px rgba(15,23,42,0.04);
  --sh-sm: 0 2px 8px rgba(15,23,42,0.06);
  --sh-md: 0 8px 24px rgba(15,23,42,0.08);
  --sh-lg: 0 20px 48px rgba(15,23,42,0.12);
  --sh-glow: 0 14px 32px rgba(30,58,138,0.26);
  --sh-inner: inset 0 1px 0 rgba(255,255,255,0.7);

  /* ---------- Spacing scale ---------- */
  --s1:4px; --s2:8px; --s3:12px; --s4:16px; --s5:20px; --s6:24px; --s8:32px; --s10:40px; --s12:48px; --s16:64px;

  /* ---------- Type ---------- */
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --fs-h1:24px; --fs-h2:20px; --fs-h3:16px; --fs-body:14px; --fs-sm:13px; --fs-xs:12px; --fs-eyebrow:11px;

  --sidebar-w: 264px;
  --topbar-h: 64px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-body);
  font-weight: 500;
  color: var(--t-primary);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
}

/* ---------- Layered light background with halos ---------- */
.bg-stage {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background:
    radial-gradient(120% 90% at 8% -5%, #eaf0fb 0%, #f4f5f8 46%, #fbfbfc 100%);
}
.bg-stage::before, .bg-stage::after {
  content: ""; position: absolute; border-radius: 50%;
  filter: blur(60px); opacity: .9;
}
.bg-stage::before {
  width: 560px; height: 560px; top: -160px; left: -80px;
  background: radial-gradient(circle, var(--halo-indigo), transparent 70%);
}
.bg-stage::after {
  width: 480px; height: 480px; top: 30%; right: -120px;
  background: radial-gradient(circle, var(--halo-blue), transparent 70%);
}

/* ============================================================
   App layout
   ============================================================ */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  background: linear-gradient(180deg, #1e3a8a 0%, #182f6f 100%);
  color: #fff;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  z-index: 40;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 20px 20px 16px; }
.sidebar-logo {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  background: linear-gradient(135deg, #ffffff 0%, #dbe4fb 100%);
  color: var(--brand); display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; letter-spacing: -0.02em;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}
.sidebar-brand .name { font-weight: 800; font-size: 15px; line-height: 1.1; letter-spacing: -0.01em; }
.sidebar-brand .tag { font-size: 10.5px; font-weight: 600; color: rgba(255,255,255,0.62); margin-top: 2px; }

.sidebar-scroll { flex: 1; overflow-y: auto; padding: 6px 12px 12px; }
.sidebar-scroll::-webkit-scrollbar { width: 6px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.16); border-radius: 99px; }

.nav-group-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em;
  color: rgba(255,255,255,0.42); padding: 16px 12px 7px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 11px;
  color: rgba(255,255,255,0.78); text-decoration: none; font-weight: 600; font-size: 13.5px;
  margin-bottom: 2px; transition: background .15s, color .15s; position: relative; cursor: pointer;
}
.nav-item svg { width: 18px; height: 18px; stroke-width: 2; flex: none; }
.nav-item:hover { background: rgba(255,255,255,0.09); color: #fff; }
.nav-item.active { background: rgba(255,255,255,0.14); color: #fff; }
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: #fff;
}
.nav-badge {
  margin-left: auto; background: rgba(255,255,255,0.16); color: #fff;
  font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 99px; min-width: 20px; text-align: center;
}
.nav-badge.amber { background: #d97706; }
.nav-badge.rose { background: #e11d48; }

.sidebar-user {
  border-top: 1px solid rgba(255,255,255,0.12); padding: 12px; margin-top: auto;
  display: flex; align-items: center; gap: 11px; cursor: pointer; transition: background .15s;
}
.sidebar-user:hover { background: rgba(255,255,255,0.06); }
.sidebar-user .meta { line-height: 1.2; min-width: 0; }
.sidebar-user .meta .n { font-size: 13px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .meta .r { font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.55); }

/* ---------- Topbar ---------- */
.main-col { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: var(--topbar-h); position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px; padding: 0 28px;
  background: rgba(248,249,251,0.72);
  -webkit-backdrop-filter: blur(20px) saturate(140%); backdrop-filter: blur(20px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.topbar-search {
  display: flex; align-items: center; gap: 9px; flex: 1; max-width: 420px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: 9px 16px; color: var(--t-muted); transition: border-color .15s, box-shadow .15s;
}
.topbar-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(30,58,138,0.12); }
.topbar-search input { border: 0; outline: 0; background: transparent; font-family: inherit; font-size: 13px; font-weight: 500; color: var(--t-primary); width: 100%; }
.topbar-search svg { width: 17px; height: 17px; flex: none; }
.topbar-spacer { flex: 1; }
.icon-btn {
  width: 40px; height: 40px; border-radius: var(--r-pill); border: 1px solid var(--line);
  background: #fff; color: var(--t-secondary); display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative; transition: all .15s; flex: none;
}
.icon-btn:hover { color: var(--brand); border-color: #cdd5e4; box-shadow: var(--sh-sm); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); border: 2px solid #fff; }

.page { padding: 28px; max-width: 1480px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.breadcrumb { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--t-muted); margin-bottom: 8px; }
.breadcrumb a { color: var(--t-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb svg { width: 13px; height: 13px; }
h1.page-title { font-size: var(--fs-h1); font-weight: 700; letter-spacing: -0.02em; margin: 0; color: var(--t-primary); }
.page-sub { font-size: 13.5px; color: var(--t-muted); margin-top: 4px; font-weight: 500; }

/* ============================================================
   Cards & glass
   ============================================================ */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--sh-sm);
}
.card-pad { padding: 20px 22px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 22px; border-bottom: 1px solid var(--line-soft);
}
.card-head h3 { margin: 0; font-size: var(--fs-h3); font-weight: 700; letter-spacing: -0.01em; }
.card-head .sub { font-size: 12px; color: var(--t-muted); font-weight: 500; margin-top: 2px; }

.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border); border-radius: var(--r-lg);
  box-shadow: var(--sh-md), var(--sh-inner);
}

/* ---------- KPI card ---------- */
.kpi {
  position: relative; padding: 20px; border-radius: var(--r-lg); overflow: hidden;
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--sh-md), var(--sh-inner);
  transition: transform .18s, box-shadow .18s;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--sh-lg), var(--sh-inner); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.kpi-ico { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.kpi-ico svg { width: 20px; height: 20px; }
.kpi-label { font-size: 12px; font-weight: 600; color: var(--t-muted); }
.kpi-value { font-size: 27px; font-weight: 800; letter-spacing: -0.02em; color: var(--t-primary); font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi-meta { display: flex; align-items: center; gap: 6px; margin-top: 9px; font-size: 12px; font-weight: 600; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.delta svg { width: 12px; height: 12px; }
.delta.up { background: var(--success-bg); color: var(--success); }
.delta.down { background: var(--danger-bg); color: var(--danger); }
.delta.flat { background: var(--neutral-100); color: var(--t-muted); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: inherit; font-size: 13.5px; font-weight: 700; letter-spacing: -0.005em;
  padding: 10px 18px; border-radius: var(--r-pill); border: 1px solid transparent;
  cursor: pointer; transition: all .16s ease-out; white-space: nowrap; text-decoration: none;
}
.btn svg { width: 16px; height: 16px; stroke-width: 2.2; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--sh-glow); }
.btn-primary:hover { background: var(--brand-hover); transform: translateY(-1px); box-shadow: 0 18px 38px rgba(30,58,138,0.32); }
.btn-primary:active { transform: translateY(0); background: var(--brand-press); box-shadow: var(--sh-sm); }
.btn-secondary { background: #fff; color: var(--t-primary); border-color: var(--line); box-shadow: var(--sh-xs); }
.btn-secondary:hover { border-color: #cdd5e4; box-shadow: var(--sh-sm); transform: translateY(-1px); }
.btn-secondary:active { transform: translateY(0); box-shadow: none; }
.btn-ghost { background: transparent; color: var(--t-secondary); }
.btn-ghost:hover { background: var(--neutral-100); color: var(--t-primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #be123c; transform: translateY(-1px); }
.btn-sm { padding: 7px 13px; font-size: 12.5px; }
.btn-lg { padding: 13px 24px; font-size: 15px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ============================================================
   Badges / status
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700;
  padding: 3px 10px; border-radius: var(--r-pill); letter-spacing: -0.005em; white-space: nowrap;
}
.badge .bdot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-neutral { background: var(--neutral-100); color: #6b7280; }
.badge-blue    { background: var(--info-bg); color: #1d4ed8; }
.badge-indigo  { background: var(--brand-light); color: var(--brand); }
.badge-amber   { background: var(--warning-bg); color: #b45309; }
.badge-emerald { background: var(--success-bg); color: #047857; }
.badge-rose    { background: var(--danger-bg); color: #be123c; }
.badge-cancel  { background: var(--neutral-100); color: #9ca3af; text-decoration: line-through; }

/* ============================================================
   Forms
   ============================================================ */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 11.5px; font-weight: 700; color: var(--t-secondary); letter-spacing: 0.01em; }
.label .req { color: var(--danger); }
.input, .select, .textarea {
  font-family: inherit; font-size: 13.5px; font-weight: 500; color: var(--t-primary);
  padding: 10px 13px; border-radius: var(--r-sm); background: #fff; border: 1px solid var(--line);
  outline: none; transition: border-color .15s, box-shadow .15s; width: 100%;
}
.input::placeholder, .textarea::placeholder { color: var(--t-faint); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(30,58,138,0.12); }
.textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23818793' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; cursor: pointer; }
.input-group { position: relative; display: flex; align-items: center; }
.input-prefix { position: absolute; left: 13px; font-size: 13px; font-weight: 700; color: var(--t-muted); pointer-events: none; }
.input-group .input { padding-left: 38px; }
.help { font-size: 11.5px; font-weight: 500; color: var(--t-muted); }
.help.err { color: var(--danger); }

/* toggle */
.toggle { position: relative; width: 40px; height: 23px; flex: none; cursor: pointer; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle .track { position: absolute; inset: 0; background: #cdd2dc; border-radius: 99px; transition: background .18s; }
.toggle .track::before { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: var(--sh-xs); transition: transform .18s; }
.toggle input:checked + .track { background: var(--brand); }
.toggle input:checked + .track::before { transform: translateX(17px); }

/* ============================================================
   Tabs / pills
   ============================================================ */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tab {
  padding: 11px 16px; font-size: 13.5px; font-weight: 600; color: var(--t-muted);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s; white-space: nowrap;
}
.tab:hover { color: var(--t-primary); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }

.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 600; color: var(--t-secondary); background: #fff; border: 1px solid var(--line);
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.pill:hover { border-color: #cdd5e4; }
.pill.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.pill .pcount { font-size: 11.5px; font-weight: 700; padding: 0 7px; border-radius: 99px; background: var(--neutral-100); color: var(--t-muted); }
.pill.active .pcount { background: rgba(255,255,255,0.22); color: #fff; }

/* ============================================================
   Tables
   ============================================================ */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data thead th {
  position: sticky; top: 0; text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--t-muted); padding: 12px 16px; background: #fbfbfc;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data thead th.sortable { cursor: pointer; user-select: none; }
table.data thead th.num, table.data tbody td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tbody td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); color: var(--t-secondary); vertical-align: middle; }
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover { background: var(--brand-soft); }
table.data tbody tr.clickable { cursor: pointer; }
table.data tbody tr:last-child td { border-bottom: 0; }
td .primary-cell { font-weight: 700; color: var(--t-primary); }
td .muted { color: var(--t-muted); font-size: 12.5px; }
.row-accent { border-left: 3px solid transparent; }
.row-accent.green { border-left-color: var(--success); }
.row-accent.amber { border-left-color: var(--warning); }
.row-accent.rose  { border-left-color: var(--danger); }

/* pagination */
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-top: 1px solid var(--line-soft); gap: 12px; flex-wrap: wrap; }
.pagination .info { font-size: 12.5px; color: var(--t-muted); font-weight: 500; }
.page-btns { display: flex; gap: 4px; }
.page-btns button { min-width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line); background: #fff; font-family: inherit; font-size: 12.5px; font-weight: 600; color: var(--t-secondary); cursor: pointer; transition: all .15s; }
.page-btns button:hover:not(:disabled) { border-color: #cdd5e4; }
.page-btns button.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.page-btns button:disabled { opacity: .4; cursor: not-allowed; }

/* ============================================================
   Avatar
   ============================================================ */
.avatar { border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; flex: none; letter-spacing: -0.01em; }
.avatar.sm { width: 30px; height: 30px; font-size: 12px; }
.avatar.md { width: 38px; height: 38px; font-size: 13px; }
.avatar.lg { width: 52px; height: 52px; font-size: 17px; }

/* ============================================================
   Misc: dropdown, menu, divider, empty, skeleton, stepper
   ============================================================ */
.menu {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm);
  box-shadow: var(--sh-lg); padding: 6px; min-width: 180px; z-index: 60;
}
.menu-item { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--t-secondary); cursor: pointer; transition: background .12s; white-space: nowrap; }
.menu-item:hover { background: var(--neutral-100); color: var(--t-primary); }
.menu-item svg { width: 16px; height: 16px; }
.menu-item.danger { color: var(--danger); }
.menu-item.danger:hover { background: var(--danger-soft); }
.menu-sep { height: 1px; background: var(--line-soft); margin: 6px 4px; }

.divider { height: 1px; background: var(--line-soft); }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 56px 24px; }
.empty-ico { width: 72px; height: 72px; border-radius: 20px; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; margin-bottom: 18px; }
.empty-ico svg { width: 32px; height: 32px; stroke-width: 1.7; }
.empty h4 { margin: 0 0 6px; font-size: 16px; font-weight: 700; color: var(--t-primary); }
.empty p { margin: 0 0 18px; font-size: 13.5px; color: var(--t-muted); max-width: 340px; }

.skel { background: linear-gradient(100deg, #eef0f3 30%, #f6f7f9 50%, #eef0f3 70%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 7px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* stepper */
.stepper { display: flex; align-items: center; gap: 0; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 10px; }
.step-dot { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex: none; border: 2px solid var(--line); background: #fff; color: var(--t-faint); }
.step-dot svg { width: 15px; height: 15px; }
.step.done .step-dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.step.current .step-dot { background: #fff; border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 4px rgba(30,58,138,0.12); }
.step .step-label { font-size: 12.5px; font-weight: 600; color: var(--t-muted); }
.step.done .step-label, .step.current .step-label { color: var(--t-primary); }
.step-line { width: 36px; height: 2px; background: var(--line); margin: 0 6px; flex: none; }
.step.done + .step-line, .step-line.done { background: var(--brand); }

/* progress bar */
.progress { height: 7px; border-radius: 99px; background: var(--neutral-100); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: var(--brand); transition: width .3s; }
.progress.full > span { background: var(--success); }

/* ============================================================
   Modal / drawer / toast
   ============================================================ */
.overlay { position: fixed; inset: 0; background: rgba(20,25,40,0.42); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); z-index: 80; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal { background: #fff; border-radius: var(--r-lg); box-shadow: var(--sh-lg); width: 100%; max-width: 520px; max-height: 88vh; display: flex; flex-direction: column; overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--line-soft); }
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 700; }
.modal-body { padding: 22px 24px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--line-soft); background: #fbfbfc; }

.drawer-overlay { position: fixed; inset: 0; background: rgba(20,25,40,0.42); z-index: 80; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 440px; max-width: 92vw; background: #fff; box-shadow: var(--sh-lg); z-index: 81; display: flex; flex-direction: column; }

.toast-wrap { position: fixed; bottom: 24px; right: 24px; z-index: 100; display: flex; flex-direction: column; gap: 10px; }
.toast { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--r-sm); box-shadow: var(--sh-lg); padding: 13px 16px; min-width: 280px; max-width: 380px; }
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--info); }
.toast-ico { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex: none; }
.toast-ico svg { width: 17px; height: 17px; }
.toast .msg { font-size: 13px; font-weight: 600; color: var(--t-primary); }
.toast .sub { font-size: 12px; font-weight: 500; color: var(--t-muted); margin-top: 1px; }

/* ============================================================
   Utilities
   ============================================================ */
.eyebrow { font-size: var(--fs-eyebrow); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--brand); }
.muted { color: var(--t-muted); }
.tnum { font-variant-numeric: tabular-nums; }
.scroll-y { overflow-y: auto; }
.grid-kpi { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-1{gap:4px}.gap-2{gap:8px}.gap-3{gap:12px}.gap-4{gap:16px}
.mobile-only { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid-kpi { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1024px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%);
    transition: transform .25s ease-out; box-shadow: var(--sh-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .scrim { position: fixed; inset: 0; background: rgba(20,25,40,0.4); z-index: 39; }
  .mobile-only { display: inline-flex; }
}
@media (max-width: 760px) {
  .page { padding: 18px 16px; }
  .topbar { padding: 0 16px; }
  .topbar-search { display: none; }
  .grid-kpi { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; }
}
