/* ============================================================
   APPNET — Template Preview  ·  "Nusantara" theme
   Light / Dark via CSS custom properties.
   Toggle: <html data-theme="dark"> (JS) — default follows OS.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  color-scheme: light;

  /* Brand */
  --brand:          #2a78d6;
  --brand-strong:   #1c5cab;
  --brand-soft:     #e3eefb;
  --brand-contrast: #ffffff;

  /* Surfaces */
  --page:      #f4f6f9;
  --surface:   #ffffff;
  --surface-2: #f8f9fb;
  --sidebar:   #ffffff;
  --topbar:    rgba(255, 255, 255, .85);

  /* Ink */
  --ink:       #10151b;
  --ink-2:     #4c5560;
  --muted:     #8a929e;

  /* Lines & shadows */
  --border:      #e5e8ee;
  --border-soft: #eef0f4;
  --ring:        rgba(42, 120, 214, .25);
  --shadow-sm: 0 1px 2px rgba(16, 21, 27, .05);
  --shadow-md: 0 6px 24px -8px rgba(16, 21, 27, .12);

  /* Status (fixed — icon + label always accompany color) */
  --st-good:       #0ca30c;
  --st-good-soft:  #e2f5e2;
  --st-warn:       #b97800;
  --st-warn-soft:  #fdf0d3;
  --st-serious:      #cf5426;
  --st-serious-soft: #fcebe3;
  --st-crit:       #d03b3b;
  --st-crit-soft:  #fbe6e6;
  --st-off:        #667085;
  --st-off-soft:   #eceef2;

  /* Chart ink (dataviz tokens) */
  --viz-series-1: #2a78d6;
  --viz-grid:     #e1e0d9;
  --viz-axis:     #c3c2b7;
  --viz-label:    #898781;

  /* Metrics */
  --radius:    14px;
  --radius-sm: 9px;
  --sidebar-w: 264px;
  --topbar-h:  64px;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

/* Dark tokens — one block, applied two ways (OS preference + manual toggle) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --brand:          #3987e5;
    --brand-strong:   #6da7ec;
    --brand-soft:     #1a2c42;
    --brand-contrast: #ffffff;

    --page:      #0c0f13;
    --surface:   #14181e;
    --surface-2: #1a1f26;
    --sidebar:   #101419;
    --topbar:    rgba(16, 20, 25, .85);

    --ink:   #eef1f5;
    --ink-2: #aeb6c0;
    --muted: #7d8590;

    --border:      #262c35;
    --border-soft: #1f242c;
    --ring:        rgba(57, 135, 229, .35);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 8px 28px -10px rgba(0, 0, 0, .55);

    --st-good-soft:  rgba(12, 163, 12, .16);
    --st-warn:       #fab219;
    --st-warn-soft:  rgba(250, 178, 25, .14);
    --st-serious:      #ec835a;
    --st-serious-soft: rgba(236, 131, 90, .14);
    --st-crit-soft:  rgba(208, 59, 59, .16);
    --st-off:        #98a2b3;
    --st-off-soft:   rgba(152, 162, 179, .14);

    --viz-series-1: #3987e5;
    --viz-grid:     #2c2c2a;
    --viz-axis:     #383835;
    --viz-label:    #898781;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --brand:          #3987e5;
  --brand-strong:   #6da7ec;
  --brand-soft:     #1a2c42;
  --brand-contrast: #ffffff;

  --page:      #0c0f13;
  --surface:   #14181e;
  --surface-2: #1a1f26;
  --sidebar:   #101419;
  --topbar:    rgba(16, 20, 25, .85);

  --ink:   #eef1f5;
  --ink-2: #aeb6c0;
  --muted: #7d8590;

  --border:      #262c35;
  --border-soft: #1f242c;
  --ring:        rgba(57, 135, 229, .35);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 8px 28px -10px rgba(0, 0, 0, .55);

  --st-good-soft:  rgba(12, 163, 12, .16);
  --st-warn:       #fab219;
  --st-warn-soft:  rgba(250, 178, 25, .14);
  --st-serious:      #ec835a;
  --st-serious-soft: rgba(236, 131, 90, .14);
  --st-crit-soft:  rgba(208, 59, 59, .16);
  --st-off:        #98a2b3;
  --st-off-soft:   rgba(152, 162, 179, .14);

  --viz-series-1: #3987e5;
  --viz-grid:     #2c2c2a;
  --viz-axis:     #383835;
  --viz-label:    #898781;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--page);
  transition: background-color .25s ease, color .25s ease;
  /* cegah overflow horizontal konten menyeret topbar sticky yang di-tengah
     (mis. grid kolom yang tak bisa menyusut) — 'clip' tak membuat scroll
     container sehingga position:sticky topbar tetap berfungsi */
  overflow-x: clip;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-strong); }
img { max-width: 100%; }
h1, h2, h3, h4, h5 { margin: 0; font-weight: 650; letter-spacing: -.01em; }

::selection { background: var(--ring); }

/* Ikon Lucide (SVG stroke): ukuran ikut font-size elemen, warna ikut currentColor */
svg.lucide {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  vertical-align: -0.125em;
  /* Beberapa stylesheet vendor halaman gateway menimpa presentation
     attribute SVG. Paksa kembali stroke Lucide agar ikon shell dan konten
     tidak berubah menjadi ruang kosong. */
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
svg.lucide * { stroke: currentColor !important; }

/* ---------- App shell ---------- */
.app { min-height: 100vh; }

.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left .25s ease;
}
.content { padding: 24px 28px 48px; flex: 1; width: 100%; max-width: 1440px; margin-inline: auto; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--sidebar);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  z-index: 50;
  transition: transform .25s ease, width .25s ease;
  /* Shell harus menjadi stacking context mandiri. Konten gateway memuat
     widget/plugin dengan z-index dan utility CSS sendiri; isolasi ini menjaga
     menu tetap terlihat serta bisa diklik pada semua halaman. */
  isolation: isolate;
}
.sidebar-brand {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
}
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}
.brand-mark.has-logo {
  background: #fff;
  border: 1px solid var(--border);
  overflow: hidden;
}
.brand-mark.has-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 3px;
}
.brand-name {
  min-width: 0;
  max-width: 150px;
  font-weight: 700;
  font-size: 16.5px;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.brand-name > span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-name small { display: block; font-size: 10.5px; font-weight: 500; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }

.sidebar-nav {
  display: block;
  visibility: visible;
  opacity: 1;
  overflow-y: auto;
  padding: 14px 12px 24px;
  flex: 1 1 0;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.nav-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 18px 12px 7px;
}
.nav-item { list-style: none; }
.sidebar-nav ul { margin: 0; padding: 0; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  margin: 1px 0;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-weight: 500;
  position: relative;
  transition: background-color .15s, color .15s;
}
.nav-link .lucide { font-size: 18px; width: 20px; text-align: center; flex-shrink: 0; color: var(--muted); transition: color .15s; }
.nav-link:hover { background: var(--surface-2); color: var(--ink); }
.nav-link:hover .lucide { color: var(--ink-2); }
.nav-link.active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}
.nav-link.active .lucide { color: var(--brand); }
.nav-link.active::before {
  content: "";
  position: absolute;
  left: -12px; top: 8px; bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--brand);
}
.nav-link .nav-badge {
  margin-left: auto;
  background: var(--st-crit);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  border-radius: 99px;
  padding: 1px 7px;
}
.nav-link .nav-caret { margin-left: auto; font-size: 15px; color: var(--muted); transition: transform .2s; }
.nav-item.open > .nav-link .nav-caret { transform: rotate(90deg); }

.nav-sub { display: none; padding-left: 30px !important; }
.nav-item.open > .nav-sub { display: block; }
.nav-sub .nav-link { padding: 7px 12px; font-size: 13.5px; }
.nav-sub .nav-link::after {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--border);
  position: absolute;
  left: -14px; top: 50%;
  transform: translateY(-50%);
}
.nav-sub .nav-link.active::after { background: var(--brand); }
.nav-sub .nav-link.active::before { display: none; }

/* ---------- Topbar (gaya "detached" ala Materialize) ----------
   Default: transparan, menyatu dengan latar halaman.
   Saat digulir (body.win-scrolled): jadi kartu melayang dengan
   sudut bawah membulat + bayangan, selebar area konten. */
.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 8px;
  width: calc(100% - 56px);
  max-width: calc(1440px - 56px);
  margin-inline: auto;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0 0 14px 14px;
  z-index: 40;
  /* padding ikut dianimasikan → isi navbar "geser dari pinggir ke tengah"
     saat digulir, sama seperti .window-scrolled milik Materialize */
  transition: background-color .25s ease, box-shadow .25s ease, padding .25s ease;
}
body.win-scrolled .topbar {
  background: var(--surface);
  box-shadow: var(--shadow-md);
  padding-inline: 24px;
}
.icon-btn {
  width: 40px; height: 40px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-2);
  font-size: 19px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

.topbar-search, .search-box {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 99px;
  padding: 8px 16px;
  width: min(340px, 100%);
  color: var(--muted);
  transition: border-color .15s, box-shadow .15s;
}
.topbar-search:focus-within, .search-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.topbar-search input, .search-box input {
  border: none; outline: none; background: transparent;
  color: var(--ink); font: inherit; width: 100%;
}
/* search di area konten (filter tabel) — kotak, bukan pill */
.search-box {
  border-radius: var(--radius-sm);
  background: var(--surface);
  border-color: var(--border);
  padding: 8.5px 14px;
  width: min(280px, 100%);
}
.topbar-search kbd {
  font: 600 10.5px/1 var(--font);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 3px 6px;
  color: var(--muted);
}
/* search di topbar: minimalis ala Materialize — ikon + teks tanpa kotak,
   kotaknya baru muncul saat fokus */
.topbar .topbar-search { background: transparent; border-color: transparent; padding: 8px 10px; }
.topbar .topbar-search:focus-within { background: var(--surface-2); border-color: var(--brand); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 4px; }

.topbar-user {
  display: flex;
  align-items: center;
  padding: 0;
  margin-left: 8px;
  border: none;
  background: none;
  cursor: pointer;
}
.topbar-user .avatar { position: relative; width: 38px; height: 38px; }
.topbar-user .avatar::after {
  content: "";
  position: absolute;
  right: 0; bottom: 0;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--st-good);
  border: 2px solid var(--page);
}
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), #7c5cd6);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.topbar-user .u-name { font-weight: 600; font-size: 13.5px; line-height: 1.2; }
.topbar-user .u-role { font-size: 11.5px; color: var(--muted); line-height: 1.2; }

/* theme toggle shows one icon per mode */
.icon-btn .ic-sun   { display: none; }
:root[data-theme="dark"] .icon-btn .ic-sun  { display: block; }
:root[data-theme="dark"] .icon-btn .ic-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-btn .ic-sun  { display: block; }
  :root:not([data-theme="light"]) .icon-btn .ic-moon { display: none; }
}

/* ---------- Page head / breadcrumb ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.page-head h1 { font-size: 21px; }
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 3px;
}
.breadcrumb .lucide { font-size: 13px; }
.breadcrumb .sep { opacity: .55; }
.breadcrumb .current { color: var(--ink-2); font-weight: 500; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-soft);
}
.card-head h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.card-head h3 .lucide { color: var(--muted); font-size: 17px; }
.card-body { padding: 20px; }

/* ---------- Grid helpers ---------- */
.grid { display: grid; gap: 18px; }
.grid-tiles { grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-2-1 { grid-template-columns: 2fr 1fr; }
@media (max-width: 1100px) { .grid-2, .grid-2-1 { grid-template-columns: 1fr; } }

/* Detail pelanggan: isi panjang dan tabel tidak boleh memperlebar viewport. */
.customer-detail-layout,
.customer-detail-layout > *,
.customer-detail-side,
.customer-detail-side > * {
  min-width: 0;
}
.customer-detail-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.customer-detail-layout .field .fw-600 {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ---------- Stat tiles ---------- */
.tile { padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden; }
.tile-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tile-label {
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}
.tile-icon {
  width: 42px; height: 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}
.tile-value { font-size: 27px; font-weight: 700; letter-spacing: -.02em; margin-top: 5px; }
.tile-value small { font-size: 15px; font-weight: 600; color: var(--ink-2); }
.tile-foot { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.tile-foot a { font-weight: 500; }

.ti-brand   { background: var(--brand-soft);      color: var(--brand); }
.ti-good    { background: var(--st-good-soft);    color: var(--st-good); }
.ti-warn    { background: var(--st-warn-soft);    color: var(--st-warn); }
.ti-serious { background: var(--st-serious-soft); color: var(--st-serious); }
.ti-crit    { background: var(--st-crit-soft);    color: var(--st-crit); }
.ti-off     { background: var(--st-off-soft);     color: var(--st-off); }

.delta { font-size: 12px; font-weight: 650; display: inline-flex; align-items: center; gap: 2px; }
.delta.up   { color: var(--st-good); }
.delta.down { color: var(--st-crit); }

/* ---------- Badges (status = icon + label, never color alone) ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 3.5px 10px;
  border-radius: 99px;
  white-space: nowrap;
}
.badge .lucide { font-size: 13px; }
.badge-good    { background: var(--st-good-soft);    color: var(--st-good); }
.badge-warn    { background: var(--st-warn-soft);    color: var(--st-warn); }
.badge-serious { background: var(--st-serious-soft); color: var(--st-serious); }
.badge-crit    { background: var(--st-crit-soft);    color: var(--st-crit); }
.badge-off     { background: var(--st-off-soft);     color: var(--st-off); }
.badge-brand   { background: var(--brand-soft);      color: var(--brand); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font: 600 13.5px/1 var(--font);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
  text-decoration: none;
}
.btn .lucide { font-size: 16px; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }

.btn-primary { background: var(--brand); color: var(--brand-contrast); }
.btn-primary:hover { background: var(--brand-strong); color: var(--brand-contrast); }
.btn-soft { background: var(--brand-soft); color: var(--brand); }
.btn-soft:hover { background: var(--brand); color: var(--brand-contrast); }
.btn-outline { background: var(--surface); border-color: var(--border); color: var(--ink-2); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-danger { background: var(--st-crit); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }
.btn-icon-sm {
  width: 30px; height: 30px; padding: 0;
  border-radius: 8px;
  font-size: 15px;
}
.btn-block { width: 100%; }

/* ---------- Tables ---------- */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  -webkit-overflow-scrolling: touch;
}
.table-wrap::-webkit-scrollbar { height: 7px; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
table.table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 13.5px;
  color: var(--ink-2);
}
.table thead th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
  padding: 11px 16px;
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
}
.table thead th:first-child, .table tbody td:first-child { padding-left: 20px; }
.table thead th:last-child, .table tbody td:last-child { padding-right: 20px; }
.table tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background-color .12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table code {
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}
.cell-main { font-weight: 600; color: var(--ink); }
.cell-sub { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.table td:has(> .row-actions) { text-align: right; }
.table .row-actions .btn { flex-shrink: 0; }
.table-foot {
  min-height: 58px;
  background: var(--surface);
}
.table-foot:has(.pagination) { justify-content: space-between; }
.action-cell { width: 58px; text-align: right; overflow: visible !important; }
.action-menu-wrap { position: relative; display: inline-block; }
.action-menu {
  position: fixed; z-index: 80;
  width: 220px; padding: 6px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft); background: var(--surface);
  box-shadow: var(--shadow-md); text-align: left;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(-5px);
  transition: opacity .14s, transform .14s, visibility .14s;
}
.action-menu-wrap.open .action-menu {
  opacity: 1; visibility: visible; pointer-events: auto; transform: none;
}
.action-menu a, .action-menu button {
  display: flex; width: 100%; align-items: center; gap: 10px;
  padding: 9px 10px; border: 0; border-radius: 7px;
  background: transparent; color: var(--ink-2);
  font: 500 13px/1.25 var(--font); text-decoration: none;
  cursor: pointer; white-space: nowrap;
}
.action-menu a:hover, .action-menu button:hover { background: var(--surface-2); color: var(--ink); }
/* Ikon aksi selalu netral — warna dibawa oleh teksnya saja, supaya deretan
   ikon tetap tenang dan label yang membedakan tiap aksi. */
.action-menu .lucide { width: 16px; height: 16px; flex-shrink: 0; color: var(--muted); }
.action-menu a:hover .lucide, .action-menu button:hover .lucide { color: var(--muted); }
.action-menu .act-off    span { color: var(--st-off); }
.action-menu .act-brand  span { color: var(--brand); }
.action-menu .act-good   span { color: var(--st-good); }
.action-menu .act-warn   span { color: var(--st-warn); }
.action-menu .act-serious span { color: var(--st-serious); }
.action-menu .act-crit   span,
.action-menu .danger     span { color: var(--st-crit); }
.action-menu button:disabled { opacity: .5; cursor: not-allowed; }
.action-menu button:disabled span { color: var(--muted); }
.action-menu-sep { height: 1px; margin: 5px 8px; background: var(--border-soft); }
.ont-result {
  padding: 14px; border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); background: var(--surface-2);
}
.ont-result p { margin: 10px 0; }
.global-action-list { display: grid; gap: 10px; }
.global-action-list form {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); background: var(--surface-2);
}
.global-action-list form > div { flex: 1; min-width: 0; }
.global-action-list form b { display: block; font-size: 13.5px; color: var(--ink); }
.global-action-list form span:not(.btn span) { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); }
.global-action-list .input { width: 145px; flex-shrink: 0; }
.live-traffic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.live-stat {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 5px 9px;
  padding: 16px; border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); background: var(--surface-2);
}
.live-stat .lucide { grid-row: 1 / 3; width: 28px; height: 28px; }
.live-stat span { color: var(--muted); font-size: 12px; }
.live-stat strong { color: var(--ink); font-size: 20px; }
.live-download .lucide { color: var(--brand); }
.live-upload .lucide { color: var(--st-good); }
.live-chart-wrap {
  position: relative; height: 260px; padding: 12px;
  border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
  background: var(--surface);
}
.mrtg-chart { position: relative; height: 320px; }
@media (max-width: 640px) {
  .global-action-list form { align-items: stretch; flex-direction: column; }
  .global-action-list .input, .global-action-list .btn { width: 100%; }
  .live-traffic-grid { grid-template-columns: 1fr; }
}

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.form-grid .span-2 { grid-column: span 2; }
@media (max-width: 760px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
}
.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.field label .req { color: var(--st-crit); }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.field .hint strong { color: var(--ink-2); font-weight: 650; }
/* Contoh nilai isian (mis. 2M/2M, 1d) agar terbaca sebagai literal, bukan kalimat. */
.hint code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .95em;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  padding: 1px 5px;
}
.input, .select, .textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9.5px 13px;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--muted); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--ring);
}
.textarea { resize: vertical; min-height: 84px; }
.input-group { display: flex; }
.input-group .input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-icon { position: relative; }
.input-icon > .lucide {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 16px;
}
.input-icon .input { padding-left: 38px; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; color: var(--ink-2); }
.switch input { position: absolute; opacity: 0; }
.switch .track {
  width: 40px; height: 22px;
  background: var(--border);
  border-radius: 99px;
  position: relative;
  transition: background-color .2s;
  flex-shrink: 0;
}
.switch .track::after {
  content: "";
  position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(18px); }

/* ---------- Filter bar ---------- */
.filter-head { flex-wrap: wrap; gap: 10px; }

/* Bar pemilih router modul Hotspot. Isinya dikelompokkan kiri (label, pemilih,
   status koneksi) supaya space-between milik .card-head hanya memisahkan
   kelompok itu dari tombol aksi di kanan, bukan menyebar setiap elemen. */
.router-bar-kiri { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.router-bar-kiri .select { flex: 0 1 260px; }
@media (max-width: 992px) {
  .router-bar-kiri { width: 100%; }
  .router-bar-kiri .select { flex: 1 1 100%; }
}
.chip-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}
.chip-row .chip { flex-shrink: 0; }
.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
  font: 600 12.5px/1 var(--font);
  padding: 8.5px 14px;
  border-radius: 99px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .15s;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip .cnt { font-weight: 700; opacity: .75; }

/* ---------- Pagination ---------- */
.pagination { display: flex; align-items: center; gap: 5px; }
.page-btn {
  min-width: 34px; height: 34px;
  padding: 0 8px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
  font: 600 13px/1 var(--font);
  cursor: pointer;
  transition: all .15s;
}
.page-btn:hover { border-color: var(--brand); color: var(--brand); }
.page-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.page-btn:disabled { opacity: .45; cursor: default; }

/* ---------- Chart ---------- */
.viz { position: relative; }
.viz svg { display: block; width: 100%; height: auto; }
.viz .bar { fill: var(--viz-series-1); rx: 4; cursor: pointer; transition: opacity .12s; }
.viz .bar.dim { opacity: .35; }
.viz .gridline { stroke: var(--viz-grid); stroke-width: 1; }
.viz .baseline { stroke: var(--viz-axis); stroke-width: 1; }
.viz .tick { font: 500 11px var(--font); fill: var(--viz-label); }
.viz-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  box-shadow: var(--shadow-md);
  padding: 8px 12px;
  font-size: 12.5px;
  opacity: 0;
  transform: translate(-50%, -8px);
  transition: opacity .12s;
  white-space: nowrap;
  z-index: 10;
}
.viz-tooltip .t-label { color: var(--muted); font-size: 11.5px; }
.viz-tooltip .t-value { font-weight: 700; font-variant-numeric: tabular-nums; }

/* status composition bar */
.compo { display: flex; height: 14px; border-radius: 7px; overflow: hidden; gap: 2px; background: var(--page); }
.compo > span { display: block; }
.compo-legend { display: flex; flex-wrap: wrap; gap: 14px 20px; margin-top: 14px; }
.compo-legend .lg { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); }
.compo-legend .sw { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.compo-legend b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- Progress ---------- */
.progress { height: 7px; background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: var(--brand); }

/* ---------- Alert ---------- */
.alert {
  display: flex;
  gap: 11px;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  align-items: flex-start;
}
.alert .lucide { font-size: 18px; margin-top: 1px; }
.alert-info { background: var(--brand-soft); color: var(--brand); }
.alert-warn { background: var(--st-warn-soft); color: var(--st-warn); }
.alert-good { background: var(--st-good-soft); color: var(--st-good); }
.alert-crit { background: var(--st-crit-soft); color: var(--st-crit); }

/* ---------- Login page ---------- */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}
.auth-hero {
  background:
    radial-gradient(1000px 600px at 15% 10%, rgba(255,255,255,.14), transparent 55%),
    linear-gradient(150deg, #1c5cab, #103a6e 55%, #0c2b52);
  color: #fff;
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.auth-hero::after {
  content: "";
  position: absolute;
  inset: auto -120px -180px auto;
  width: 420px; height: 420px;
  border-radius: 50%;
  border: 60px solid rgba(255,255,255,.06);
}
.auth-hero .brand-row { display: flex; align-items: center; gap: 12px; }
.auth-hero .brand-mark { background: rgba(255,255,255,.15); backdrop-filter: blur(4px); }
.auth-hero h2 { font-size: clamp(24px, 3vw, 34px); line-height: 1.25; max-width: 420px; }
.auth-hero p { color: rgba(255,255,255,.72); max-width: 400px; }
.auth-hero .points { display: grid; gap: 12px; margin-top: 22px; }
.auth-hero .points li { list-style: none; display: flex; gap: 10px; align-items: center; color: rgba(255,255,255,.85); font-size: 14px; }
.auth-hero .points .lucide { color: #8fd18f; font-size: 17px; }
.auth-form-side {
  display: grid;
  place-items: center;
  padding: 40px 24px;
  background: var(--page);
}
.auth-card { width: min(400px, 100%); }
.auth-card .card-body { padding: 30px 28px; }
@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
}

/* ---------- Map placeholder ---------- */
.map-ph {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(var(--border-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
  background-size: 28px 28px;
  background-color: var(--surface-2);
  height: 230px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}
.map-ph .lucide { font-size: 30px; display: block; margin: 0 auto 6px; color: var(--brand); }

/* ---------- Footer ---------- */
.footer {
  padding: 16px 28px;
  border-top: 1px solid var(--border-soft);
  color: var(--muted);
  font-size: 12.5px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- Sidebar collapse (desktop) & drawer (mobile) ---------- */
body.sb-collapsed .sidebar { width: 78px; }
body.sb-collapsed .main { margin-left: 78px; }
body.sb-collapsed .brand-name,
body.sb-collapsed .nav-link span,
body.sb-collapsed .nav-title,
body.sb-collapsed .nav-badge,
body.sb-collapsed .nav-caret,
body.sb-collapsed .nav-sub { display: none; }
body.sb-collapsed .nav-link { justify-content: center; padding: 11px; }
body.sb-collapsed .sidebar-brand { justify-content: center; padding: 0; }

.scrim {
  position: fixed; inset: 0;
  background: rgba(8, 10, 14, .5);
  z-index: 45;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
@media (max-width: 992px) {
  .sidebar { transform: translateX(-100%); }
  .main, body.sb-collapsed .main { margin-left: 0; }
  body.sb-open .sidebar { transform: translateX(0); width: var(--sidebar-w); }
  body.sb-open .scrim { opacity: 1; pointer-events: auto; }
  body.sb-open.sb-collapsed .brand-name,
  body.sb-open.sb-collapsed .nav-link span,
  body.sb-open.sb-collapsed .nav-title { display: block; }
  /* sejajarkan tepi navbar dengan tepi konten (padding .content = 16px) */
  .topbar { width: calc(100% - 32px); padding: 0; }
  body.win-scrolled .topbar { padding-inline: 12px; }
  .content { padding: 18px 16px 40px; }
  .topbar .topbar-search { display: none; } /* hanya search di topbar; search filter konten tetap tampil */

  /* Filter tabel: search penuh, chip digeser horizontal, dropdown penuh */
  .filter-head { flex-direction: column; align-items: stretch; flex-wrap: nowrap; }
  .filter-head .search-box { width: 100%; }
  .chip-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .chip-row::-webkit-scrollbar { display: none; }
  .filter-head .select { width: 100% !important; }

  /* Tabel: paksa lebar minimum supaya scroll ke samping, bukan kolom remuk */
  .table-wrap .table { min-width: 860px; }
  .table-wrap .table th, .table-wrap .table td { white-space: nowrap; }

  /* Footer tabel (info + pagination) bertumpuk rapi */
  .table-foot { flex-direction: column; align-items: center; gap: 10px; text-align: center; }
  .table-foot .pagination { justify-content: center; flex-wrap: wrap; }

  .page-head { align-items: stretch; flex-direction: column; }
  .page-head > .d-flex { flex-wrap: wrap; }

  .customer-detail-layout .card-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .customer-detail-layout .card-body { padding: 16px; }
  .customer-detail-layout .customer-payment-table .table {
    min-width: 100% !important;
  }
  .customer-detail-layout .customer-payment-table .table th,
  .customer-detail-layout .customer-payment-table .table td {
    padding-inline: 8px;
    font-size: 12px;
  }
  .customer-detail-layout .customer-payment-table .table th:first-child,
  .customer-detail-layout .customer-payment-table .table td:first-child {
    padding-left: 12px;
  }
  .customer-detail-layout .customer-payment-table .table th:last-child,
  .customer-detail-layout .customer-payment-table .table td:last-child {
    padding-right: 12px;
  }
}

/* ---------- Icon animations (gaya "animated icons") ----------
   Ikon hidup seperti animated icons Flaticon/Lordicon, tapi murni CSS
   pada ikon Remix yang sudah ada — tanpa aset eksternal.
   - Loop terus-menerus: ikon stat tile, brand, lonceng notifikasi, badge kritis
   - Saat hover: ikon menu sidebar, tombol, chip, aksi tabel
   Semua dimatikan otomatis jika user memilih "reduce motion". */

@keyframes ic-bob     { 0%,100% { transform: translateY(0) }   50% { transform: translateY(-3px) } }
@keyframes ic-pulse   { 0%,100% { transform: scale(1) }        50% { transform: scale(1.18) } }
@keyframes ic-wiggle  { 0%,100% { transform: rotate(0) } 25% { transform: rotate(-12deg) } 75% { transform: rotate(12deg) } }
@keyframes ic-ring    { 0%,100% { transform: rotate(0) } 10% { transform: rotate(14deg) } 20% { transform: rotate(-12deg) }
                        30% { transform: rotate(9deg) } 40% { transform: rotate(-6deg) } 50% { transform: rotate(0) } }
@keyframes ic-spin    { to { transform: rotate(360deg) } }
@keyframes ic-radar   { 0% { box-shadow: 0 0 0 0 var(--ring) } 100% { box-shadow: 0 0 0 12px transparent } }
@keyframes ic-blink   { 0%,100% { opacity: 1 } 50% { opacity: .35 } }
@keyframes ic-beat    { 0%,20%,100% { transform: scale(1) } 10% { transform: scale(1.22) } 15% { transform: scale(1.08) } }

/* Loop kontinu */
.brand-mark { animation: ic-radar 2.8s ease-out infinite; }
.brand-mark .lucide { display: inline-block; animation: ic-pulse 2.8s ease-in-out infinite; }

.tile-icon .lucide { display: inline-block; animation: ic-bob 2.6s ease-in-out infinite; }
.tile:nth-child(2) .tile-icon .lucide { animation-delay: .3s; }
.tile:nth-child(3) .tile-icon .lucide { animation-name: ic-blink; animation-delay: .1s; }
.tile:nth-child(4) .tile-icon .lucide { animation-name: ic-wiggle; animation-duration: 3s; }
.tile:nth-child(5) .tile-icon .lucide { animation-name: ic-blink; animation-delay: .5s; }
.tile:nth-child(6) .tile-icon .lucide { animation-delay: .6s; }
.tile:nth-child(7) .tile-icon .lucide { animation-delay: .9s; }
.tile:nth-child(8) .tile-icon .lucide { animation-name: ic-beat; animation-duration: 2.2s; }

.ic-bell { display: inline-block; transform-origin: top center; animation: ic-ring 3.5s ease-in-out infinite; }
.badge-crit .lucide, .badge-warn .lucide { display: inline-block; animation: ic-blink 1.8s ease-in-out infinite; }
.alert .lucide { animation: ic-pulse 2.4s ease-in-out infinite; }

/* Saat hover / aktif */
.nav-link .lucide { transition: transform .2s; }
.nav-link:hover .lucide { animation: ic-wiggle .5s ease-in-out; }
.nav-link.active .lucide { animation: ic-bob 2.2s ease-in-out infinite; }

.btn .lucide, .chip .lucide, .page-btn .lucide { display: inline-block; }
.btn:hover .lucide { animation: ic-wiggle .45s ease-in-out; }
.btn:hover .ic-refresh,
.btn-soft:hover .ic-refresh { animation: ic-spin .7s linear; }
.chip:hover .lucide { animation: ic-pulse .4s ease-in-out; }
.btn-icon-sm:hover .lucide { animation: ic-pulse .35s ease-in-out; }

/* Micro-interaction ikon navbar (ala Materialize):
   ikon "pop" membal saat hover, hamburger berputar, globe berputar penuh,
   ikon tema berputar masuk saat mode diganti, avatar membesar halus. */
@keyframes ic-theme-in { from { transform: rotate(-100deg) scale(.4); opacity: 0 } to { transform: rotate(0) scale(1); opacity: 1 } }

.icon-btn .lucide { transition: transform .25s cubic-bezier(.34, 1.56, .64, 1); }
.icon-btn:hover .lucide { transform: scale(1.22); }
.icon-btn:hover .ic-menu { transform: scale(1.1) rotate(90deg); }
.icon-btn:hover .ic-globe { animation: ic-spin .6s ease-in-out; }
.icon-btn:hover .ic-bell { animation-duration: 1.2s; }
.icon-btn .ic-sun, .icon-btn .ic-moon { animation: ic-theme-in .45s cubic-bezier(.34, 1.56, .64, 1); }
.topbar-user .avatar { transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), box-shadow .2s; }
.topbar-user:hover .avatar { transform: scale(1.1); box-shadow: 0 0 0 3px var(--ring); }
.topbar-search:focus-within .lucide { animation: ic-pulse .4s ease-in-out; }

/* Hormati preferensi aksesibilitas */
@media (prefers-reduced-motion: reduce) {
  .brand-mark, .brand-mark .lucide, .tile-icon .lucide, .icon-btn .lucide, .badge .lucide, .alert .lucide,
  .nav-link .lucide, .btn .lucide, .chip .lucide { animation: none !important; }
}

/* ---------- Utilities ---------- */
.mt-1 { margin-top: 6px; }  .mt-2 { margin-top: 12px; }  .mt-3 { margin-top: 18px; }  .mt-4 { margin-top: 24px; }
.mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 18px; }
.text-muted { color: var(--muted); }
.text-2 { color: var(--ink-2); }
.fw-600 { font-weight: 600; }
.fs-12 { font-size: 12px; }
.d-flex { display: flex; }
.ai-center { align-items: center; }
.jc-between { justify-content: space-between; }
.gap-2 { gap: 10px; }
.w-100 { width: 100%; }

/* ---------- Modal (pengganti Bootstrap modal, dipakai aksi bayar/isolir) ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(8, 10, 14, .55);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 16px 16px;
  z-index: 100;
  overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  width: min(520px, 100%);
  animation: modal-in .22s cubic-bezier(.34,1.4,.64,1);
}
@keyframes modal-in { from { transform: translateY(14px) scale(.97); opacity: 0 } to { transform: none; opacity: 1 } }
.modal-box .card-head h3 { font-size: 15.5px; }
.modal-box .card-body { max-height: 68vh; overflow-y: auto; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border-soft);
}
.bayar-info {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 13px;
}
.bayar-info b { font-size: 14px; }
.btn-bulan { padding: 6px 10px; font-size: 12px; }
body.modal-open { overflow: hidden; }

/* ============================================================
   Panel Superadmin (SaaS) — layout khusus terpisah dari panel tenant.
   Aksen ungu-magenta agar jelas beda dari panel utama (ala TOPKOS SaaS).
   ============================================================ */
:root { --sa: #a03bd0; --sa-strong: #7b2fd0; --sa-soft: rgba(160, 59, 208, .12); }
:root[data-theme="dark"] { --sa-soft: rgba(160, 59, 208, .2); }

/* Tombol "Panel Superadmin" di topbar panel tenant */
.btn-sa-enter {
  display: inline-flex; align-items: center; gap: 7px;
  font: 600 13px/1 var(--font);
  padding: 8px 13px; border-radius: 99px;
  color: var(--sa); background: var(--sa-soft); border: 1px solid transparent;
  text-decoration: none; transition: background-color .15s, color .15s;
}
.btn-sa-enter:hover { background: var(--sa); color: #fff; }
.btn-sa-enter .lucide { width: 16px; height: 16px; }
@media (max-width: 640px) { .btn-sa-enter .sa-enter-txt { display: none; } .btn-sa-enter { padding: 8px; border-radius: 50%; } }

/* Brand & menu aktif di sidebar panel SA memakai aksen SA */
.sa-panel .sidebar-brand .brand-mark { background: linear-gradient(135deg, var(--sa), var(--sa-strong)); }
.sa-panel .nav-link.active { background: var(--sa-soft); color: var(--sa); }
.sa-panel .nav-link.active .lucide { color: var(--sa); }
.sa-panel .nav-link.active::before { background: var(--sa); }

/* Badge "Superadmin Mode" di topbar panel SA */
.sa-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 99px;
  color: #fff; background: linear-gradient(135deg, var(--sa), var(--sa-strong));
}
.sa-badge .lucide { width: 14px; height: 14px; }
.btn-sa-back {
  display: inline-flex; align-items: center; gap: 6px;
  font: 600 13px/1 var(--font); padding: 8px 13px; border-radius: var(--radius-sm);
  color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--border-soft);
  text-decoration: none; transition: background-color .15s, color .15s;
}
.btn-sa-back:hover { color: var(--ink); border-color: var(--border); }

/* ---------- Dropdown Akun (topbar) — memuat menu akun + Keluar ---------- */
.acct-wrap { position: relative; flex-shrink: 0; }
.acct-wrap .topbar-user {
  border: none; background: transparent; cursor: pointer; padding: 0;
  display: block; border-radius: 50%;
}
.acct-wrap .topbar-user:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}
.acct-menu {
  position: absolute; right: 0; top: calc(100% + 10px);
  width: min(240px, calc(100vw - 24px)); background: var(--surface);
  border: 1px solid var(--border-soft); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 8px; z-index: 60;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  pointer-events: none;
  transition: opacity .15s, transform .15s, visibility .15s;
}
.acct-menu::before {
  content: ""; position: absolute; top: -5px; right: 14px;
  width: 9px; height: 9px; background: var(--surface);
  border-left: 1px solid var(--border-soft);
  border-top: 1px solid var(--border-soft);
  transform: rotate(45deg);
}
.acct-wrap.open .acct-menu {
  opacity: 1; visibility: visible; transform: none; pointer-events: auto;
}
.acct-wrap.open .topbar-user .avatar {
  box-shadow: 0 0 0 3px var(--ring);
}
.acct-head {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 10px 12px; margin-bottom: 6px;
  border-bottom: 1px solid var(--border-soft);
}
.acct-head .avatar { flex-shrink: 0; }
.acct-info { min-width: 0; }
.acct-head .acct-name { font-weight: 700; font-size: 14px; line-height: 1.2; }
.acct-head .acct-role { font-size: 12px; color: var(--muted); }
.acct-head .acct-name, .acct-head .acct-role {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.acct-actions { display: grid; gap: 2px; }
.acct-menu a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  color: var(--ink-2); font-size: 13.5px; font-weight: 500; text-decoration: none;
  transition: background-color .13s, color .13s;
}
.acct-menu a:hover { background: var(--surface-2); color: var(--ink); }
.acct-menu a:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.acct-menu a.acct-logout:hover { background: var(--st-crit-soft); color: var(--st-crit); }
.acct-menu a .lucide { width: 17px; height: 17px; color: var(--muted); flex-shrink: 0; }
.acct-menu a.acct-logout .lucide { color: var(--st-crit); }

/* ---- Notifikasi gangguan di topbar (memakai kerangka .acct-wrap) ---- */
.notif-menu { width: min(330px, calc(100vw - 24px)); padding: 0; }
.notif-dot {
  position: absolute; top: 3px; right: 2px; min-width: 16px; height: 16px;
  padding: 0 4px; border-radius: 999px; background: var(--st-crit);
  color: #fff; font-size: 10px; font-weight: 700; line-height: 16px;
}
.notif-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 11px 13px; border-bottom: 1px solid var(--border-soft);
}
.notif-kosong, .notif-sisa {
  padding: 14px 13px; color: var(--muted); font-size: 12px; text-align: center;
}
.notif-sisa { padding: 8px 13px; border-top: 1px solid var(--border-soft); }
.notif-item {
  display: block; padding: 10px 13px; color: var(--ink);
  border-bottom: 1px solid var(--border-soft); text-decoration: none;
}
.notif-item:hover { background: var(--brand-soft); }
.notif-item-top {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.notif-item-top b {
  font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.notif-item small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.notif-menu .acct-actions { padding: 6px; }
