/* ============================================================
   Lindas Operations Console — Design System
   ============================================================
   Satu-satunya stylesheet untuk aplikasi admin Billing Lindas.
   Light mode adalah default; dark mode tersedia via
   [data-theme="dark"] di <html>.

   Susunan:
     1.  Tokens
     2.  Reset & base
     3.  Shell (topbar, ops-bar, sidebar, content)
     4.  Navigasi sidebar
     5.  Breadcrumb & page header
     6.  Buttons
     7.  Badges & status
     8.  Forms
     9.  Search & filter toolbar
     10. Tables
     11. Cards, widgets & stat
     12. Dashboard (hero, KPI, ops-grid, billing, activity)
     13. Modal & drawer
     14. Alerts & toast
     15. Pagination & empty state
     16. Combobox & misc
     17. Utilities
     18. Responsive
     19. Reduced motion
     20. Compatibility aliases
   ============================================================ */

/* ============================================================
   1. TOKENS
   ============================================================ */
:root {
  color-scheme: light;

  /* Brand & canvas */
  --bg:          #F6F8FB;   /* kanvas utama, abu-biru sangat ringan */
  --surface:     #FFFFFF;   /* kartu / panel */
  --surface-2:   #F1F4F9;   /* panel bersarang / hover */
  --surface-3:   #E8EDF4;   /* header tabel / strip */
  --sidebar-bg:  #0B1220;   /* navy pekat */
  --sidebar-fg:  #C9D4E3;
  --sidebar-fg-active: #FFFFFF;
  --sidebar-accent: #F97316;

  /* Text */
  --label:       #152235;
  --label-2:     #5B6B82;
  --label-3:     #8A97A9;

  /* Lines */
  --separator:       #DCE3EC;
  --separator-opaque:#C3CDDB;

  /* Brand action */
  --brand:      #F97316;   /* oranye — aksi utama / CTA */
  --brand-dark: #D95F0B;
  --brand-dim:  #FFF0E6;
  --tint:       #2563EB;   /* biru — info / link */
  --tint-dim:   #E7EFFF;

  /* Status */
  --green:       #16A36A;
  --green-dim:   #E3F6EC;
  --amber:       #D99000;
  --amber-dim:   #FBF1DC;
  --red:         #D64545;
  --red-dim:     #FCEBEB;
  --purple:      #6D4FD1;
  --purple-dim:  #EFEAFC;
  --cyan:        #0E9BB5;
  --cyan-dim:    #E2F5F8;

  --fill: rgba(21,34,53,.05);

  /* Elevation & shape */
  --shadow-sm: 0 1px 2px rgba(21,34,53,.06), 0 2px 8px rgba(21,34,53,.04);
  --shadow-md: 0 2px 6px rgba(21,34,53,.06), 0 12px 28px rgba(21,34,53,.08);
  --shadow-lg: 0 12px 40px rgba(21,34,53,.16);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* Layout */
  --sidebar-w: 240px;
  --content-max: 1440px;
  --ui-control-height: 44px;
  --ui-gutter: clamp(16px, 3vw, 32px);
  --ui-gap: clamp(14px, 2vw, 22px);

  /* Alias kompatibilitas */
  --primary: var(--brand);
  --primary-dark: var(--brand-dark);
  --gray-bg: var(--bg);
  --border: var(--separator-opaque);
  --text: var(--label);
  --text-muted: var(--label-2);
  --text-dim: var(--label-3);
}

[data-theme="dark"] {
  color-scheme: dark;

  --bg:        #0A101C;
  --surface:   #111A2A;
  --surface-2: #182338;
  --surface-3: #1E2B44;
  --sidebar-bg: #070D18;

  --label:      #EDF2F8;
  --label-2:    #9DACC0;
  --label-3:    #6C7C93;

  --separator:        #22314B;
  --separator-opaque: #32445F;

  --brand:      #FF8A3C;
  --brand-dark: #E06E1F;
  --brand-dim:  #3A2412;
  --tint:       #5B9BFF;
  --tint-dim:   #14294D;

  --green:      #2FD98C;
  --green-dim:  #0F3322;
  --amber:      #FFB84D;
  --amber-dim:  #3A2C10;
  --red:        #FF6B6B;
  --red-dim:    #431A1A;
  --purple:     #B49BFF;
  --purple-dim: #2A2148;
  --cyan:       #4CC8DE;
  --cyan-dim:   #10323A;

  --fill: rgba(148,178,214,.08);

  --shadow-sm: 0 1px 2px rgba(0,0,0,.35), 0 2px 8px rgba(0,0,0,.2);
  --shadow-md: 0 2px 6px rgba(0,0,0,.4), 0 12px 28px rgba(0,0,0,.3);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.5);
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; -webkit-font-smoothing: antialiased; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--label);
  font-family: Inter, "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -.003em;
  transition: background .2s ease, color .2s ease;
}
img { max-width: 100%; }
a { color: var(--tint); }
h1, h2, h3, h4 { margin: 0; font-weight: 700; }
.num, .mono, .stat-value, .badge, .data-table td.num,
input[type="number"], input[type="date"], .widget-meta,
.pop-status-ip, .ops-clock, .money {
  font-family: ui-monospace, "SF Mono", "IBM Plex Mono", Menlo, Consolas, monospace;
  font-feature-settings: "tnum" 1;
}
:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--tint) 45%, transparent);
  outline-offset: 2px;
}

/* ============================================================
   3. SHELL
   ============================================================ */
.layout { display: flex; flex: 1; min-height: 0; position: relative; }

/* Topbar — tampil di mobile, disembunyikan di desktop */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--sidebar-bg);
  color: var(--sidebar-fg-active);
  border-bottom: 1px solid var(--separator);
  padding: 10px 12px 10px 16px;
  flex-shrink: 0;
}
.topbar .sidebar-brand { padding: 0; color: #fff; }

.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--sidebar-fg-active);
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.menu-toggle:hover, .menu-toggle:active { background: rgba(255,255,255,.12); }

.sidebar-overlay { display: none; }
.sidebar-overlay.open {
  display: block;
  position: fixed;
  inset: 0;
  background: rgba(4,8,16,.5);
  z-index: 30;
}

/* Sidebar — 240px tetap di desktop, drawer di mobile */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: min(var(--sidebar-w), 84vw);
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--separator);
  transform: translateX(-100%);
  transition: transform .22s ease;
  z-index: 40;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.2) transparent;
}
.sidebar.open { transform: translateX(0); }
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 3px; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 16px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--sidebar-fg-active);
}
.brand-logo {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  padding: 3px;
}
.brand-logo-topbar { width: 30px; height: 30px; border-radius: 8px; }

.sidebar-identity {
  padding: 0 18px 14px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.sidebar-identity-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--sidebar-fg-active);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}
.role-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
}
.role-badge.role-super { background: var(--purple-dim); color: var(--purple); }
.role-badge.role-pop { background: var(--brand-dim); color: var(--brand); }

/* Ops bar — strip status operasional */
.ops-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border-bottom: 1px solid var(--separator);
  color: var(--label-2);
  padding: 8px 16px;
  font-size: 13px;
  flex-shrink: 0;
  gap: 12px;
}
.ops-bar-left { display: flex; align-items: center; gap: 14px; }
.ops-bar-item { display: flex; align-items: center; gap: 7px; }
.ops-bar-sep { color: var(--separator-opaque); }

/* Content */
.content {
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: clamp(18px, 3vw, 30px) var(--ui-gutter) clamp(28px, 5vw, 44px);
}

@media (min-width: 860px) {
  .topbar, .menu-toggle { display: none; }
  .sidebar-overlay { display: none !important; }
  .sidebar {
    position: static;
    width: var(--sidebar-w);
    transform: none;
    transition: none;
  }
}

/* ============================================================
   4. NAVIGASI SIDEBAR
   ============================================================ */
.sidebar nav { display: flex; flex-direction: column; padding: 4px 10px; flex: 1; }
.nav-group { margin-bottom: 2px; }

.nav-section-label {
  all: unset;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(201,212,227,.6);
  min-height: 40px;
  padding: 10px 12px 6px;
  border-radius: var(--radius-sm);
  -webkit-tap-highlight-color: transparent;
}
.nav-section-label:hover { color: var(--sidebar-fg-active); }
.nav-chevron {
  width: 14px; height: 14px;
  color: rgba(201,212,227,.5);
  transition: transform .18s ease;
  flex-shrink: 0;
}
.nav-group.open .nav-chevron { transform: rotate(180deg); }
.nav-group-items {
  display: flex;
  flex-direction: column;
  max-height: 0;
  overflow: hidden;
  transition: max-height .22s ease;
}
.nav-group.open .nav-group-items { max-height: 340px; }
.nav-group-items a { margin-top: 2px; }

.sidebar nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--sidebar-fg);
  text-decoration: none;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  margin-bottom: 1px;
}
.sidebar nav a:hover { background: rgba(255,255,255,.08); color: var(--sidebar-fg-active); }
.sidebar nav a.active {
  background: var(--sidebar-accent);
  color: #fff;
  font-weight: 600;
}
.sidebar nav a.active .icon { color: #fff; }
.sidebar nav a.logout { margin-top: auto; color: #FF9B9B; }
.sidebar nav a.logout:hover { background: rgba(255,107,107,.16); color: #fff; }

.sidebar nav a .icon { margin-right: 10px; opacity: .85; color: rgba(201,212,227,.75); }
.sidebar nav a:hover .icon { color: #fff; }

.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* Theme switch row */
.theme-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px 16px;
  border-top: 1px solid rgba(255,255,255,.12);
  font-size: 14px;
  font-weight: 500;
  color: var(--sidebar-fg);
  min-height: 44px;
}
.theme-row-label { display: flex; align-items: center; gap: 8px; }
.theme-row-label .icon { color: var(--sidebar-fg); }

.ios-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 27px;
  flex-shrink: 0;
}
.ios-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.ios-switch-track {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.25);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background .2s ease;
}
.ios-switch-track::before {
  content: "";
  position: absolute;
  width: 23px; height: 23px;
  left: 2px; top: 2px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,.25);
  transition: transform .2s ease;
}
.ios-switch input:checked + .ios-switch-track { background: var(--green); }
.ios-switch input:checked + .ios-switch-track::before { transform: translateX(19px); }

/* ============================================================
   5. BREADCRUMB & PAGE HEADER
   ============================================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  color: var(--label-3);
  margin-bottom: 12px;
}
.breadcrumb a { color: var(--label-3); text-decoration: none; }
.breadcrumb a:hover { color: var(--tint); }
.breadcrumb span:last-child { color: var(--label); font-weight: 600; }
.breadcrumb-sep { color: var(--separator-opaque); }

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 22px;
}
.page-header h1 { font-size: clamp(24px, 3vw, 32px); letter-spacing: -.02em; line-height: 1.15; }
.subtitle { color: var(--label-2); margin: 6px 0 0; font-size: 15px; }
.note { color: var(--label-3); font-size: 13.5px; margin-top: 22px; }

.quick-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: center; flex-wrap: wrap; }

/* ============================================================
   6. BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--ui-control-height);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: background .12s ease, box-shadow .12s ease, transform .1s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 30%, transparent); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { background: var(--surface-2); color: var(--label); border-color: var(--separator); }
.btn-secondary:hover { background: var(--surface-3); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(1.06); }
.btn-accent { background: var(--tint); color: #fff; }
.btn-accent:hover { filter: brightness(1.06); }
.btn-sm { min-height: 38px; padding: 7px 14px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-reset-filter { font-size: 14px; color: var(--label-2); text-decoration: underline; padding: 10px 4px; }
.btn-reset-filter:hover { color: var(--label); }
.btn-toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 10px 14px; border: 1px solid var(--separator-opaque); border-radius: var(--radius-md); background: var(--surface-2); color: var(--label); font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }

.btn-loading {
  color: transparent !important;
  position: relative;
  pointer-events: none;
  opacity: .8;
}
.btn-loading::after {
  content: "";
  position: absolute;
  width: 15px; height: 15px;
  top: 50%; left: 50%;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(255,255,255,.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spin .6s linear infinite;
}
.btn-secondary.btn-loading::after { border-color: rgba(0,0,0,.25); border-top-color: var(--label); }
@keyframes btn-spin { to { transform: rotate(360deg); } }

.text-danger { color: var(--red); }
.text-muted { color: var(--label-2); }
.required { color: var(--red); }

/* ============================================================
   7. BADGES & STATUS
   ============================================================ */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.5;
}
.badge-aktif, .badge-lunas, .badge-selesai { background: var(--green-dim); color: var(--green); }
.badge-suspend, .badge-baru, .badge-batal { background: var(--red-dim); color: var(--red); }
.badge-nonaktif { background: var(--fill); color: var(--label-2); }
.badge-belum_bayar, .badge-diteruskan { background: var(--amber-dim); color: var(--amber); }
.badge-dikerjakan { background: var(--purple-dim); color: var(--purple); }

.pulse-dot {
  position: relative;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  display: inline-block;
}
.pulse-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid var(--green);
  animation: pulse-ring 2.2s cubic-bezier(.3,.6,.4,1) infinite;
}
.pulse-dot.dot-danger { background: var(--red); }
.pulse-dot.dot-danger::after { border-color: var(--red); }
.pulse-dot.dot-amber { background: var(--amber); }
.pulse-dot.dot-amber::after { border-color: var(--amber); }
.pulse-dot.dot-off { background: var(--label-3); }
.pulse-dot.dot-off::after { display: none; }
@keyframes pulse-ring {
  0% { transform: scale(.5); opacity: .7; }
  100% { transform: scale(1.9); opacity: 0; }
}

/* ============================================================
   8. FORMS
   ============================================================ */
.form-box {
  background: var(--surface);
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--separator);
  border-radius: var(--radius-lg);
  max-width: 680px;
  box-shadow: var(--shadow-sm);
}
.form-box label { display: block; font-size: 14px; font-weight: 600; margin: 16px 0 6px; color: var(--label); }
.form-box label:first-child { margin-top: 0; }
.form-box input, .form-box select, .form-box textarea {
  width: 100%;
  min-height: var(--ui-control-height);
  padding: 10px 12px;
  border: 1px solid var(--separator-opaque);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-family: inherit;
  background: var(--surface-2);
  color: var(--label);
  transition: border-color .12s ease, background .12s ease;
}
.form-box input:focus, .form-box select:focus, .form-box textarea:focus {
  border-color: var(--tint);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tint) 18%, transparent);
  background: var(--surface);
}
.form-box small { display: block; color: var(--label-3); font-size: 13px; margin-top: 4px; }
.form-box textarea { min-height: 80px; resize: vertical; }
.form-actions { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }
.form-box .checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--label);
  margin: 14px 0 6px;
  cursor: pointer;
  user-select: none;
}
.form-box .checkbox-row input[type="checkbox"] { width: auto; margin: 0; cursor: pointer; flex-shrink: 0; }

.code-box {
  display: block;
  width: 100%;
  font-family: ui-monospace, "SF Mono", "IBM Plex Mono", Menlo, Consolas, monospace;
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid var(--separator-opaque);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--label);
  resize: vertical;
}

.rupiah-wrap { position: relative; display: block; width: 100%; }
.rupiah-wrap .rupiah-prefix {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  font-weight: 700;
  color: var(--label-2);
  pointer-events: none;
  z-index: 1;
  font-family: ui-monospace, "SF Mono", "IBM Plex Mono", Menlo, Consolas, monospace;
}
.rupiah-wrap input.input-rupiah { padding-left: 38px; }

.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }

/* ============================================================
   9. SEARCH & FILTER TOOLBAR
   ============================================================ */
.search-box {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  width: 100%;
  max-width: none;
  margin-bottom: 16px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.search-box input {
  flex: 1 1 240px;
  min-width: 160px;
  min-height: var(--ui-control-height);
  padding: 10px 14px;
  border: 1px solid var(--separator-opaque);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  font-family: inherit;
  font-size: 15px;
  color: var(--label);
}
.search-box select {
  flex: 0 1 180px;
  min-height: var(--ui-control-height);
  padding: 10px 12px;
  border: 1px solid var(--separator-opaque);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  background: var(--surface-2);
  color: var(--label);
}
.search-box button {
  min-height: var(--ui-control-height);
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  font-family: inherit;
}
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.filter-row .search-box { margin-bottom: 0; flex: 1; min-width: 260px; }
.filter-row .tab-switch { margin-bottom: 0; }
.filter-count {
  background: var(--tint);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.filter-panel {
  display: none;
  flex-basis: 100%;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px dashed var(--separator-opaque);
}
.filter-panel.open { display: flex; }

.tab-switch {
  display: inline-flex;
  gap: 2px;
  background: var(--surface-2);
  padding: 3px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}
.tab-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--label-2);
  text-decoration: none;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
.tab-switch a.active { background: var(--surface); color: var(--label); box-shadow: var(--shadow-sm); }

.pop-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--separator-opaque);
  border-radius: var(--radius-md);
  padding: 0 12px;
  min-height: var(--ui-control-height);
}
.pop-filter select {
  border: none;
  background: transparent;
  min-height: 40px;
  padding: 9px 4px;
  font-size: 14px;
  font-family: inherit;
  color: var(--label);
  cursor: pointer;
}
.pop-filter select:focus { outline: none; }

.bulk-action-bar {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 10px 14px;
  background: var(--red-dim);
  border: 1px solid var(--red);
  border-radius: var(--radius-md);
  color: var(--label);
  flex-wrap: wrap;
}

/* ============================================================
   10. TABLES
   ============================================================ */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--separator);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.table-scroll .data-table { min-width: 680px; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}
.data-table th, .data-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--separator);
  font-size: 14px;
}
.data-table th {
  background: var(--surface-2);
  font-weight: 600;
  color: var(--label-2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
  height: 44px;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--fill); }
.data-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--fill) 45%, transparent); }
.data-table .empty { text-align: center; color: var(--label-3); padding: 30px; }
.data-table th.money, .data-table td.money { text-align: right; white-space: nowrap; }
.data-table td.num { text-align: right; font-variant-numeric: tabular-nums; }

.row-actions { display: inline-flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.row-actions a {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  background: var(--surface-2);
  color: var(--label);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
}
.row-actions a:hover { background: var(--tint-dim); color: var(--tint); }
.row-actions a.danger { color: var(--red); }
.row-actions a.danger:hover { background: var(--red-dim); color: var(--red); }

.row-empty-state td { padding: 0; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px 8px; }
.empty-state svg { width: 30px; height: 30px; opacity: .35; }
.empty-state p { margin: 0; font-size: 15px; color: var(--label-3); }

.pop-status-name { font-weight: 600; color: var(--label); font-size: 14px; }
.pop-status-ip { color: var(--label-2); font-size: 12.5px; }
.pop-status-cell { display: flex; align-items: center; gap: 8px; }
.pop-progress { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.pop-progress-track { flex: 1; height: 6px; border-radius: var(--radius-pill); background: var(--fill); overflow: hidden; }
.pop-progress-bar { height: 100%; border-radius: var(--radius-pill); background: var(--green); transition: width .2s ease; }
.pop-progress-bar.progress-warn { background: var(--amber); }
.pop-progress-bar.progress-danger { background: var(--red); }
.pop-progress-pct { font-size: 12px; font-weight: 700; color: var(--label-2); min-width: 32px; text-align: right; }

.total-row td { font-weight: 700; background: var(--surface-2); }
.detail-table { width: 100%; border-collapse: collapse; }
.detail-table td { padding: 8px 10px; border-bottom: 1px solid var(--separator); font-size: 14px; vertical-align: top; }
.detail-table td:first-child { color: var(--label-2); width: 42%; }

/* Tombol toggle baris detail (mis. tabel Router/POP) */
.btn-toggle {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--separator-opaque);
  background: transparent;
  cursor: pointer;
  font-size: 19px;
  line-height: 1;
  color: var(--label);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .12s ease, color .12s ease;
}
.btn-toggle:hover { background: var(--surface-2); color: var(--brand); }

/* ============================================================
   11. CARDS, WIDGETS & STAT
   ============================================================ */
.dash-card, .widget {
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: var(--radius-lg);
  padding: clamp(14px, 2vw, 20px);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}
.dash-card h2, .widget h2 { margin-bottom: 14px; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--label-2); }
.dash-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.dash-card-head h2 { margin: 0; }

.dash-grid { display: grid; grid-template-columns: 1fr; gap: var(--ui-gap); align-items: start; margin-top: 4px; }
.dash-widgets { display: flex; flex-direction: column; gap: var(--ui-gap); }
@media (min-width: 1024px) {
  .dash-grid { grid-template-columns: 1.6fr .9fr; }
}

.widget-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.widget-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--separator);
  font-size: 14px;
}
.widget-list li:last-child { border-bottom: none; }
.widget-title { font-weight: 600; font-size: 14px; }
.widget-meta { color: var(--label-2); font-size: 13px; white-space: nowrap; }
.widget-empty { color: var(--label-3); font-size: 14px; margin: 0; }
.widget-link { display: inline-block; margin-top: 12px; font-size: 14px; color: var(--tint); text-decoration: none; font-weight: 600; }
.widget-link:hover { text-decoration: underline; }

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: clamp(14px, 3vw, 20px) 0; }
@media (min-width: 560px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1180px) { .stat-grid { grid-template-columns: repeat(6, 1fr); gap: 12px; } }
.stat-grid-3 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: clamp(14px, 3vw, 20px) 0; }
@media (min-width: 560px) { .stat-grid-3 { grid-template-columns: repeat(3, 1fr); } }

.stat-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  min-height: 108px;
  padding: 15px 16px;
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: var(--radius-lg);
  border-left: 4px solid transparent;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card-link { cursor: pointer; }
.stat-card.stat-green { border-left-color: var(--green); }
.stat-card.stat-red { border-left-color: var(--red); }
.stat-card.stat-blue { border-left-color: var(--tint); }
.stat-card.stat-orange { border-left-color: var(--brand); }
.stat-card.stat-purple { border-left-color: var(--purple); }
.stat-icon {
  width: 34px; height: 34px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  background: var(--fill);
  color: var(--label-2);
}
.stat-icon svg { width: 18px; height: 18px; }
.stat-card.stat-green .stat-icon { color: var(--green); background: var(--green-dim); }
.stat-card.stat-red .stat-icon { color: var(--red); background: var(--red-dim); }
.stat-card.stat-blue .stat-icon { color: var(--tint); background: var(--tint-dim); }
.stat-card.stat-orange .stat-icon { color: var(--brand); background: var(--brand-dim); }
.stat-card.stat-purple .stat-icon { color: var(--purple); background: var(--purple-dim); }
.stat-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.stat-label { font-size: 13.5px; color: var(--label-2); font-weight: 600; }
.stat-value { font-size: clamp(19px, 2.2vw, 24px); font-weight: 700; line-height: 1.2; color: var(--label); }
.stat-card-highlight .stat-value { color: var(--tint); }

.delta { font-size: 12.5px; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-pill); margin-left: 6px; }
.delta-up { background: var(--green-dim); color: var(--green); }
.delta-down { background: var(--red-dim); color: var(--red); }

/* Compare (PPPoE vs Hotspot) */
.compare-grid { display: grid; grid-template-columns: 1fr; gap: var(--ui-gap); margin: clamp(14px, 3vw, 20px) 0; }
@media (min-width: 720px) { .compare-grid { grid-template-columns: 1fr 1fr; } }
.compare-head { display: flex; align-items: center; gap: 10px; margin-bottom: 2px; }
.compare-icon {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.compare-card.compare-pppoe .compare-icon { background: var(--tint-dim); color: var(--tint); }
.compare-card.compare-hotspot .compare-icon { background: var(--cyan-dim); color: var(--cyan); }
.compare-label { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--label-2); }
.compare-total { font-size: clamp(24px, 3vw, 30px); font-weight: 700; color: var(--label); line-height: 1.15; margin: 2px 0 14px; }
.compare-bars { display: flex; flex-direction: column; gap: 12px; }
.compare-bar-row { display: block; text-decoration: none; color: inherit; }
.compare-bar-row .row-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; font-size: 14px; }
.compare-bar-row .row-label { font-weight: 600; color: var(--label); }
.compare-bar-row .row-value { font-weight: 700; color: var(--label-2); }
.compare-bar-track { height: 7px; border-radius: var(--radius-pill); background: var(--fill); overflow: hidden; }
.compare-bar-fill { height: 100%; border-radius: var(--radius-pill); transition: width .2s ease; }
.compare-bar-fill.c-green { background: var(--green); }
.compare-bar-fill.c-red { background: var(--red); }
.compare-bar-fill.c-blue { background: var(--tint); }
a.compare-bar-row:hover .row-label { color: var(--tint); }

/* ============================================================
   12. DASHBOARD
   ============================================================ */
.dash-section { margin-top: 30px; }
.dash-section:first-of-type { margin-top: 4px; }
.dash-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.dash-section-head::-webkit-details-marker { display: none; }
.dash-section-head h2 { margin: 0; font-size: 15px; text-transform: none; letter-spacing: normal; color: var(--label); }
.dash-section-head .eyebrow-icon { display: inline-flex; opacity: .55; }
.dash-section-head .eyebrow-icon svg { width: 16px; height: 16px; }
.dash-section-head::after {
  content: "";
  width: 8px; height: 8px;
  margin-left: auto;
  border-right: 2px solid var(--label-3);
  border-bottom: 2px solid var(--label-3);
  transform: rotate(45deg);
  transition: transform .15s ease;
  flex-shrink: 0;
}
details[open] > .dash-section-head::after { transform: rotate(-135deg); }

.dashboard-hero { margin-bottom: 26px; }
.dashboard-hero h1 { font-size: clamp(24px, 3vw, 32px); letter-spacing: -.02em; }
.dashboard-hero .subtitle { margin-top: 6px; }

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--ui-gap);
  margin-bottom: 26px;
}
@media (min-width: 1024px) { .dashboard-kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Dashboard action/alert visual: tiket aktif harus terlihat sebelum user scroll */
.dashboard-ticket-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -8px 0 18px;
  padding: 10px 14px;
  border: 1px solid var(--red);
  border-radius: var(--radius-md);
  background: var(--red);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}
.dashboard-ticket-alert a {
  color: #fff;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: var(--radius-pill);
  padding: 3px 11px;
  text-decoration: none;
  white-space: nowrap;
  font-size: 12px;
}
.dashboard-ticket-alert a:hover { background: rgba(255,255,255,.15); }
.dashboard-invoice-search-input {
  position: relative;
  flex: 1;
  min-width: 0;
}
.dashboard-invoice-search-input > input { width: 100%; }
.dashboard-invoice-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 80;
  max-height: 360px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--separator-opaque);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.dashboard-invoice-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-sm);
}
.dashboard-invoice-result:hover { background: var(--surface-2); }
.dashboard-invoice-result-info,
.dashboard-invoice-result-amount {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}
.dashboard-invoice-result-info strong,
.dashboard-invoice-result-info small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dashboard-invoice-result-info small,
.dashboard-invoice-result-amount small,
.dashboard-invoice-result-empty {
  color: var(--label-2);
  font-size: 12px;
}
.dashboard-invoice-result-amount { text-align: right; }
.dashboard-invoice-result-empty { padding: 14px 10px; text-align: center; }
.dashboard-ticket-card { 
  border: 1px solid var(--amber);
}
.dashboard-ticket-card-prominent {
  margin: -4px 0 18px;
  box-shadow: var(--shadow-sm);
}
.dashboard-ticket-card-prominent .widget-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
}
.dashboard-ticket-card .widget-list li {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  margin-bottom: 6px;
}
.dashboard-ticket-card .widget-title { min-width: 0; }
.dashboard-ticket-card .widget-title:hover { color: var(--tint); }
@media (max-width: 560px) {
  .dashboard-ticket-alert { align-items: flex-start; flex-direction: column; }
  .dashboard-ticket-alert a { align-self: flex-end; }
  .dashboard-invoice-result { grid-template-columns: minmax(0, 1fr) auto; }
  .dashboard-invoice-result-amount { text-align: left; }
  .dashboard-invoice-result > .btn { grid-column: 2; grid-row: 1 / span 2; }
}

.dashboard-kpi {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 104px;
  padding: 16px;
  color: var(--label);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.dashboard-kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.dashboard-kpi-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 12px;
}
.dashboard-kpi-icon .icon { width: 20px; height: 20px; margin: 0; }
.dashboard-kpi-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dashboard-kpi-copy strong { font-size: clamp(19px, 2.2vw, 25px); line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dashboard-kpi-copy small { color: var(--label-3); font-size: 12.5px; }
.dashboard-kpi-trend {
  position: absolute;
  right: 12px;
  top: 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--label-3);
}
.kpi-blue .dashboard-kpi-icon { background: var(--tint-dim); color: var(--tint); }
.kpi-green .dashboard-kpi-icon { background: var(--green-dim); color: var(--green); }
.kpi-orange .dashboard-kpi-icon { background: var(--brand-dim); color: var(--brand); }
.kpi-red .dashboard-kpi-icon { background: var(--red-dim); color: var(--red); }
.kpi-cyan .dashboard-kpi-icon { background: var(--cyan-dim); color: var(--cyan); }
.kpi-purple .dashboard-kpi-icon { background: var(--purple-dim); color: var(--purple); }
.kpi-red .dashboard-kpi-trend { color: var(--red); }

.ops-grid { display: grid; grid-template-columns: 1fr; gap: var(--ui-gap); margin-top: 4px; }
@media (min-width: 1024px) { .ops-grid { grid-template-columns: 1.6fr .9fr; } }

.billing-panel { display: flex; flex-direction: column; gap: var(--ui-gap); }

/* Fin main card */
.fin-main-card { padding: clamp(16px, 2.5vw, 24px); }
.fin-main-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fin-main-head .stat-icon { width: 40px; height: 40px; border-radius: var(--radius-lg); background: var(--tint-dim); color: var(--tint); }
.fin-main-heading { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fin-main-title { font-size: 14px; font-weight: 600; color: var(--label-2); }
.fin-main-heading .stat-value { font-size: clamp(24px, 3vw, 30px); }
.fin-main-head .delta { align-self: flex-start; margin-top: 6px; }
.fin-main-breakdown {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 16px;
}
@media (min-width: 1024px) { .fin-main-breakdown { grid-template-columns: repeat(4, 1fr); } }
.fin-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  text-decoration: none;
  color: inherit;
  min-width: 0;
  transition: background .12s ease, transform .12s ease;
}
.fin-item:hover { background: var(--surface-3); transform: translateY(-1px); }
.fin-item-link { cursor: pointer; }
.fin-item-icon {
  width: 30px; height: 30px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tint-dim);
  color: var(--tint);
}
.fin-item-icon svg { width: 15px; height: 15px; }
.fin-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.fin-item-label { font-size: 13px; font-weight: 600; color: var(--label-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin-item-value { font-size: 16px; font-weight: 700; color: var(--label); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin-item-arrow { color: var(--label-3); font-size: 16px; flex-shrink: 0; }

.fin-main-chart { margin-top: 16px; }
.fin-main-chart-title { font-size: 13px; font-weight: 600; color: var(--label-3); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.fin-minichart { display: flex; align-items: flex-end; gap: 6px; height: 64px; margin-top: 8px; padding-top: 4px; }
.fin-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  height: 100%;
  min-width: 0;
}
.fin-bar-fill {
  width: 100%;
  max-width: 22px;
  border-radius: 4px 4px 0 0;
  background: var(--tint);
  opacity: .85;
  transition: opacity .15s ease;
  min-height: 3px;
}
.fin-chart-card:hover .fin-bar-fill { opacity: 1; }
.fin-bar-label { font-size: 11.5px; font-weight: 600; color: var(--label-3); white-space: nowrap; }
.fin-sub { font-size: 13px; color: var(--label-3); font-weight: 500; margin-top: 6px; }

/* Duitku card */
.duitku-card { display: flex; flex-direction: column; gap: 8px; }
.duitku-card .duitku-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--label-2);
}
.duitku-card .duitku-sub { font-size: 13.5px; color: var(--label-3); font-weight: 500; }
.duitku-breakdown { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.duitku-breakdown .b-item {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--label-2);
}
.duitku-breakdown .b-item b { font-size: 14.5px; font-weight: 700; color: var(--label); }
.duitku-breakdown .b-ok { background: var(--green-dim); color: var(--green); }
.duitku-breakdown .b-ok b { color: var(--green); }
.duitku-breakdown .b-wait { background: var(--amber-dim); color: var(--amber); }
.duitku-breakdown .b-wait b { color: var(--amber); }
.duitku-breakdown .b-fail { background: var(--red-dim); color: var(--red); }
.duitku-breakdown .b-fail b { color: var(--red); }
.duitku-breakdown .b-dim { opacity: .55; }

.fin-main-duitku {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--separator);
  background: var(--surface-2);
  text-decoration: none;
  color: inherit;
  transition: border-color .12s ease, background .12s ease;
}
a.fin-main-duitku:hover { border-color: var(--tint); background: var(--tint-dim); }
.fin-main-duitku .duitku-title { width: 100%; }

/* ============================================================
   13. MODAL & DRAWER
   ============================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8,14,26,.55);
  z-index: 200;
  align-items: flex-start;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  backdrop-filter: blur(3px);
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--separator);
  box-shadow: var(--shadow-lg);
  max-width: 500px;
  width: 100%;
  margin: 40px 0;
  padding: 20px 22px;
  position: relative;
  animation: ux-modal-in .2s ease;
}
.modal-box h2 { margin: 0 0 4px; text-transform: none; font-size: 19px; color: var(--label); }
.modal-box .form-box { box-shadow: none; padding: 0; max-width: none; margin-top: 10px; }
.modal-box-sm { max-width: 360px; margin: 90px 0 0; }
.confirm-modal-msg { margin: 0; font-size: 15.5px; color: var(--label); line-height: 1.5; }
.modal-box-sm .form-actions { justify-content: flex-end; }
.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--surface-2);
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--label-2);
  font-size: 18px;
}
.modal-close:hover { background: var(--surface-3); }
@keyframes ux-modal-in {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

/* Drawer (detail) */
.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8,14,26,.45);
  z-index: 180;
}
.drawer-overlay.open { display: block; }
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(420px, 92vw);
  background: var(--surface);
  border-left: 1px solid var(--separator);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform .22s ease;
  z-index: 190;
  display: flex;
  flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--separator);
}
.drawer-head h3 { font-size: 17px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 18px; }

/* ============================================================
   14. ALERTS & TOAST
   ============================================================ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 14.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.45;
  border: 1px solid transparent;
}
.alert-error { background: var(--red-dim); color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.alert-success { background: var(--green-dim); color: var(--green); border-color: color-mix(in srgb, var(--green) 35%, transparent); }
.alert-info { background: var(--tint-dim); color: var(--tint); border-color: color-mix(in srgb, var(--tint) 35%, transparent); }
.alert-block { display: block; padding: 16px 18px; }
.alert-block p { margin: 10px 0; }
.alert-block p:first-child { margin-top: 0; }
.alert-block ul { margin: 8px 0 14px; padding-left: 20px; }
.alert-block li { margin: 4px 0; }
.alert-block .code-box { margin: 10px 0; }

.toast {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1000;
  max-width: min(360px, calc(100vw - 36px));
  box-shadow: var(--shadow-md);
  animation: toast-in .25s ease;
  border: 1px solid transparent;
}
.toast.toast-out { animation: toast-out .2s ease forwards; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-10px); }
}

/* Toast mandiri (BillingToast) — tanpa .alert, dipakai untuk feedback
   validasi ringan pengganti alert() bawaan browser. Konsisten dengan
   gaya toast global (.toast) + token status. */
.toast-stack {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, calc(100vw - 36px));
}
.toast-stack .toast {
  position: static;
  background: var(--surface);
  color: var(--label);
  border: 1px solid var(--separator-opaque);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  width: 100%;
}
.toast-stack .toast.toast-error {
  border-color: var(--red);
  background: var(--red-dim);
  color: var(--label);
}

/* ============================================================
   15. PAGINATION & EMPTY STATE
   ============================================================ */
.pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.pagination span { font-size: 14px; color: var(--label-2); }

/* ============================================================
   16. COMBOBOX & MISC
   ============================================================ */
.combobox { position: relative; }
.combobox-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--separator-opaque);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 20;
}
.combobox-item {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 9px 12px;
  font-size: 15px;
  color: var(--label);
  cursor: pointer;
}
.combobox-item:hover { background: var(--fill); }
.combobox-empty { padding: 9px 12px; font-size: 14px; color: var(--label-3); }

.acc-section { margin-top: 26px; }
.acc-section:first-of-type { margin-top: 4px; }
.acc-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.acc-section-head::-webkit-details-marker { display: none; }
.acc-section-head h2, .acc-section-head h3 { margin: 0; font-size: 15px; text-transform: none; letter-spacing: normal; color: var(--label); }
.acc-section-head .eyebrow-icon { display: inline-flex; opacity: .55; }
.acc-section-head .eyebrow-icon svg { width: 16px; height: 16px; }
.acc-section-head::after {
  content: "";
  width: 8px; height: 8px;
  margin-left: auto;
  border-right: 2px solid var(--label-3);
  border-bottom: 2px solid var(--label-3);
  transform: rotate(45deg);
  transition: transform .15s ease;
  flex-shrink: 0;
}
details[open] > .acc-section-head::after { transform: rotate(-135deg); }

.status-box { display: inline-flex; align-items: center; gap: 8px; }
.status-line { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.pill { display: inline-block; padding: 2px 10px; border-radius: var(--radius-pill); font-size: 12.5px; font-weight: 600; background: var(--surface-2); color: var(--label-2); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.card { background: var(--surface); border: 1px solid var(--separator); border-radius: var(--radius-lg); padding: 16px; }
.icon { width: 20px; height: 20px; flex-shrink: 0; vertical-align: -4px; }
.sub { color: var(--label-3); font-size: 13px; }
.meta { color: var(--label-3); font-size: 12.5px; }
.primary { color: var(--brand); }
.info { color: var(--tint); }
.no { color: var(--label-3); }
.val { font-weight: 700; color: var(--label); }
.judul { font-weight: 600; color: var(--label); }
.ket { color: var(--label-2); font-size: 13px; }
.kode { font-family: ui-monospace, monospace; font-size: 13px; color: var(--label-2); }

/* ============================================================
   17. UTILITIES
   ============================================================ */
.danger { color: var(--red); }
.hidden { display: none !important; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }

/* ============================================================
   18. RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
  .page-header { flex-direction: column; align-items: stretch; }
  .page-header > div { display: flex; flex-wrap: wrap; gap: 8px; }
  .quick-actions { width: 100%; }
  .quick-actions > * { flex: 1 1 150px; }
  .quick-actions .pop-filter { min-width: 100%; }
  .search-box input, .search-box select { flex-basis: 100%; }
  .ops-bar { font-size: 12.5px; overflow-x: auto; white-space: nowrap; }
  .dash-grid, .ops-grid { grid-template-columns: 1fr; }
  .table-scroll .data-table { min-width: 720px; }
}

@media (max-width: 480px) {
  .content { padding-inline: 12px; }
  .page-header { margin-bottom: 16px; }
  .page-header h1 { font-size: 24px; }
  .dashboard-kpi-grid { gap: 10px; margin-bottom: 18px; }
  .dashboard-kpi { min-height: 92px; padding: 13px; gap: 10px; }
  .dashboard-kpi-icon { width: 34px; height: 34px; border-radius: 10px; }
  .dashboard-kpi-copy strong { font-size: 17px; }
  .dashboard-kpi-trend { font-size: 8.5px; right: 9px; top: 9px; }
  .stat-grid, .stat-grid-3 { grid-template-columns: 1fr; gap: 10px; }
  .form-box { padding: 16px; }
  .form-actions .btn { flex: 1 1 140px; }
  .modal-box { margin: 16px 0; padding: 18px; border-radius: 16px; }
  .toast { left: 18px; right: 18px; max-width: none; top: 60px; }
  .search-box { padding: 10px; }
  .search-box button { flex-basis: 100%; }
}

/* ============================================================
   19. REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
  .pulse-dot::after { animation: none; opacity: .3; }
}

/* ============================================================
   20. COMPATIBILITY ALIASES
   (kelas lama yang masih dipakai halaman PHP, dipetakan ke
   komponen baru agar tidak ada halaman yang kehilangan gaya)
   ============================================================ */
.alert-error.alert, .alert-success.alert { /* sudah ditangani di atas */ }
.pop-filter select:focus-visible { outline: 2px solid var(--tint); outline-offset: 1px; }
.sidebar nav a .icon { vertical-align: -4px; }
.menu-toggle .icon { width: 25px; height: 25px; }
.stat-icon svg { vertical-align: -5px; }
.pop-filter .icon { width: 15px; height: 15px; color: var(--label-2); }
.alert-icon { width: 16px; height: 16px; }
.eyebrow-icon { display: inline-flex; opacity: .55; }
.eyebrow-icon svg { width: 16px; height: 16px; }
.row-actions small { color: var(--label-3); font-size: 12.5px; white-space: nowrap; }
.table-scroll + .pagination { margin-top: 16px; }
.chk-pelanggan, .chk-voucher { width: 17px; height: 17px; accent-color: var(--tint); cursor: pointer; }
.btn-filter-toggle svg { width: 14px; height: 14px; }
.result-item, .hasil-cari-item, .hasil-lokasi-item, .lokasi-item {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--separator);
  background: var(--surface-2);
  margin-bottom: 6px;
}
.voucher-card {
  background: var(--surface);
  border: 1px dashed var(--separator-opaque);
  border-radius: var(--radius-md);
  padding: 12px;
}
.inv-head, .inv-foot { color: var(--label-2); }
.inv-title { font-weight: 700; color: var(--label); }
.a4-voucher-title { font-weight: 800; }
.a4-voucher-code, .a4-voucher-meta { font-family: ui-monospace, monospace; }
.toolbar-a4 { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }

/* Alias tambahan dari audit halaman */
.detail-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--separator); font-size: 14px; }
.combobox-input { min-height: var(--ui-control-height); padding: 10px 12px; border: 1px solid var(--separator-opaque); border-radius: var(--radius-md); background: var(--surface-2); color: var(--label); font-family: inherit; font-size: 15px; width: 100%; }
.btn-edit-paket { min-height: 36px; padding: 6px 10px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--label); font-size: 13px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; }
.bulk-action-bar select { min-height: 42px; padding: 8px 10px; border: 1px solid var(--separator-opaque); border-radius: var(--radius-md); background: var(--surface); color: var(--label); font-family: inherit; font-size: 14px; }

/* ============================================================
   NOTIFIKASI (panel bell di ops-bar)
   ============================================================ */
.notif-wrap { position: relative; display: inline-flex; }
.notif-bell {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border: none; background: transparent; color: var(--label-2);
  cursor: pointer; padding: 0; border-radius: 50%;
}
.notif-bell:hover { color: var(--label); background: var(--fill); }
.notif-bell .icon { width: 16px; height: 16px; }
.notif-badge {
  position: absolute; top: -3px; right: -3px; min-width: 15px; height: 15px; padding: 0 3px;
  background: var(--red); color: #fff; border-radius: var(--radius-pill); font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; line-height: 1;
  border: 1.5px solid var(--surface);
}
.notif-panel {
  position: absolute; top: calc(100% + 8px); right: 0; width: min(380px, 92vw); max-width: 92vw;
  background: var(--surface); border: 1px solid var(--separator); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); z-index: 60; overflow: hidden;
}
.notif-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid var(--separator); font-size: 14px; font-weight: 700; color: var(--label);
}
.notif-panel-head button {
  border: none; background: transparent; color: var(--tint); font-size: 13.5px; font-weight: 600; cursor: pointer; padding: 0;
}
.notif-panel-list { max-height: 360px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--separator-opaque) transparent; }
.notif-empty { padding: 24px 14px; text-align: center; color: var(--label-2); font-size: 14.5px; }
.notif-item {
  display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--separator);
  text-decoration: none; color: inherit; cursor: pointer; align-items: flex-start;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--fill); }
.notif-item.belum-dibaca { background: var(--tint-dim); }
.notif-item-icon {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.notif-item-icon .icon { width: 15px; height: 15px; }
.notif-item-icon.stat-red { background: var(--red-dim); color: var(--red); }
.notif-item-icon.stat-green { background: var(--green-dim); color: var(--green); }
.notif-item-icon.stat-purple { background: var(--purple-dim); color: var(--purple); }
.notif-item-icon.stat-orange { background: var(--amber-dim); color: var(--amber); }
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-judul { font-size: 14.5px; font-weight: 600; color: var(--label); }
.notif-item-pesan { font-size: 13.5px; color: var(--label-2); margin-top: 1px; }
.notif-item-waktu { font-size: 12.5px; color: var(--label-3); margin-top: 3px; }
@media (max-width: 720px) {
  .notif-panel { position: fixed; top: calc(58px + env(safe-area-inset-top, 0px)); right: 8px; left: 8px; width: auto; }
}

/* ============================================================
   ALIAS MISC
   ============================================================ */
.field-durasi-hotspot { margin: 14px 0; }
.field-durasi-hotspot label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--label); }
.field-durasi-hotspot input, .field-durasi-hotspot select { min-height: var(--ui-control-height); padding: 10px 12px; border: 1px solid var(--separator-opaque); border-radius: var(--radius-md); background: var(--surface-2); color: var(--label); font-family: inherit; font-size: 15px; }
.inv-brand { font-weight: 700; }
.inv-meta { color: var(--label-2); font-size: 13px; }

/* ============================================================
   SUMMARY STRIP — baris ringkasan di halaman modul
   ============================================================ */
.summary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 0 0 16px;
}
.summary-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.summary-item b { font-size: clamp(17px, 2vw, 21px); line-height: 1.15; color: var(--label); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.summary-item span { font-size: 12.5px; color: var(--label-3); }
.summary-item.ok b { color: var(--green); }
.summary-item.warn b { color: var(--amber); }
.summary-item.bad b { color: var(--red); }
.summary-item.info b { color: var(--tint); }
.summary-item.neutral b { color: var(--label-2); }
@media (max-width: 480px) {
  .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .summary-item { padding: 10px 12px; }
  .summary-item b { font-size: 16px; }
}

/* Drawer close button */
.drawer-close {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: none;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--label-2);
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.drawer-close:hover { background: var(--surface-3); color: var(--label); }
.drawer-body .detail-table { margin-bottom: 12px; }
.drawer-body .detail-table td { padding: 9px 10px; }
.drawer-body .badge { margin-top: 2px; }

/* ============================================================
   LOGIN PAGE — brand navy + oranye (dipindah dari login.php)
   ============================================================ */
.login-page {
  margin: 0;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow-x: hidden;
  background: radial-gradient(circle at 18% 18%, #14305A 0%, #0A1B36 45%, #050D1C 100%);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.login-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 82% 12%, rgba(255, 158, 51, .12) 0%, transparent 38%);
}
.login-box {
  position: relative;
  z-index: 1;
  width: min(400px, calc(100vw - 40px));
  max-width: none;
  margin: 20px auto;
  padding: clamp(24px, 5vw, 34px);
  border-radius: 22px;
  background: rgba(11, 24, 46, .78);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 26px 70px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 158, 51, .07);
}
.login-logo-wrap { display: flex; justify-content: center; margin-bottom: 16px; }
.login-logo-plate {
  width: clamp(84px, 22vw, 104px);
  height: clamp(84px, 22vw, 104px);
  border-radius: 24px;
  background: linear-gradient(160deg, #ffffff 0%, #eef2fb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .35), 0 0 0 1px rgba(255, 255, 255, .06);
}
.login-logo { width: 78%; height: 78%; object-fit: contain; }
.login-header-text { display: flex; flex-direction: column; align-items: center; width: 100%; }
.login-box h1.login-title {
  margin: 0 0 4px;
  text-align: center;
  display: block;
  width: 100%;
  font-size: clamp(1.3rem, 5.5vw, 1.6rem);
  font-weight: 800;
  letter-spacing: 0.005em;
  text-transform: none;
  white-space: normal;
  color: #ffffff;
}
.login-tagline { margin: 0 0 22px; text-align: center; font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: none; }
.login-tagline .tagline-connect { color: #4D9FFF; }
.login-tagline .tagline-sep { color: #3D4F73; margin: 0 4px; }
.login-tagline .tagline-protect { color: #FF9E33; }
.login-sub {
  margin: 0 0 26px;
  text-align: center;
  font-size: .85rem;
  font-weight: 600;
  color: #CDD9EE;
  line-height: 1.5;
}
.login-box label {
  display: block;
  margin: 0 0 6px;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: #B9C8E0;
}
.login-box input {
  width: 100%;
  padding: 13px 14px;
  margin-bottom: 18px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .06);
  color: #F2F6FC;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color .15s ease, background .15s ease;
}
.login-box input::placeholder { color: #5B6E8C; }
.login-box input:focus {
  outline: none;
  border-color: #FF9E33;
  background: rgba(255, 158, 51, .10);
  box-shadow: 0 0 0 3px rgba(255, 158, 51, .18);
}
.login-box button {
  width: 100%;
  padding: 13px 18px;
  margin-top: 0;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #FF9E33 0%, #F07800 100%);
  color: #ffffff;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .02em;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(255, 158, 51, .35);
  transition: transform .12s ease, box-shadow .12s ease;
  -webkit-tap-highlight-color: transparent;
}
.login-box button:hover { transform: translateY(-1px); box-shadow: 0 16px 36px rgba(255, 158, 51, .45); }
.login-box button:active { transform: translateY(0); }
.login-page .alert-error {
  margin-bottom: 18px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(220, 53, 69, .14);
  border: 1px solid rgba(220, 53, 69, .35);
  color: #ff8f9b;
  font-size: .85rem;
  text-align: center;
}
.login-footer { margin-top: 16px; text-align: center; font-size: .72rem; color: #5B6E8C; letter-spacing: .02em; }

/* ============================================================
   MOBILE REFINEMENT — pas di semua ukuran layar HP
   ============================================================ */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* Safe area untuk HP ber-notch / gesture bar */
.topbar { padding-top: calc(10px + env(safe-area-inset-top)); padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
.ops-bar { padding-left: calc(16px + env(safe-area-inset-left, 0px)); padding-right: calc(16px + env(safe-area-inset-right, 0px)); }
.content { padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px)); }
.modal-overlay, .drawer-overlay { padding-top: env(safe-area-inset-top, 0px); }
.sidebar { padding-bottom: env(safe-area-inset-bottom, 0px); }

/* Target sentuh lebih besar di layar kecil */
@media (max-width: 860px) {
  .row-actions a { min-height: 40px; }
  .btn-sm { min-height: 40px; }
  .btn { min-height: 46px; }
  .nav-section-label, .sidebar nav a { min-height: 48px; }
  .menu-toggle { min-width: 48px; min-height: 48px; }
  .search-box input, .search-box select, .search-box button, .form-box input, .form-box select { min-height: 48px; }
}

/* Layar sangat kecil (<=360px, mis. iPhone SE / Android 320-360) */
@media (max-width: 360px) {
  .content { padding-inline: 10px; }
  .page-header h1 { font-size: 22px; }
  .subtitle { font-size: 13.5px; }
  .dashboard-kpi-grid { gap: 8px; }
  .dashboard-kpi { min-height: 86px; padding: 11px; gap: 8px; }
  .dashboard-kpi-icon { width: 30px; height: 30px; border-radius: 9px; }
  .dashboard-kpi-icon .icon { width: 16px; height: 16px; }
  .dashboard-kpi-copy strong { font-size: 15px; }
  .dashboard-kpi-copy small { font-size: 10px; }
  .dashboard-kpi-trend { display: none; }
  .summary-strip { grid-template-columns: 1fr 1fr; gap: 6px; }
  .summary-item { padding: 9px 11px; }
  .summary-item b { font-size: 15px; }
  .ops-date { display: none; } /* sembunyikan tanggal di layar sangat sempit */
  .quick-actions > * { flex-basis: 100%; }
  .form-box { padding: 14px; }
  .form-actions .btn { flex: 1 1 100%; }
  .search-box { padding: 9px; }
  .table-scroll .data-table { min-width: 640px; }
}

/* Landscape HP pendek: pastikan konten tetap terlihat */
@media (max-height: 480px) and (orientation: landscape) {
  .page-header { margin-bottom: 12px; }
  .dashboard-kpi-grid { margin-bottom: 14px; }
  .dashboard-kpi { min-height: 78px; }
  .content { padding-top: 14px; }
}

/* Tabel di luar .table-scroll tidak boleh mendorong halaman melebar */
.table-scroll { max-width: 100%; }
.data-table { table-layout: auto; }
td, th { overflow-wrap: break-word; }

/* Tabel di dalam kartu: hilangkan border ganda wrapper */
.dash-card .table-scroll, .widget .table-scroll { border: 0; box-shadow: none; background: transparent; border-radius: 0; }
.dash-card .table-scroll .data-table, .widget .table-scroll .data-table { min-width: 0; }

/* Dashboard link standalone (di luar grup menu) */
.sidebar nav a.dashboard-link {
  font-weight: 700;
  color: var(--sidebar-fg-active);
  border-bottom: 1px solid rgba(255,255,255,.12);
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
}
.sidebar nav a.dashboard-link .icon { color: var(--sidebar-accent); }
.sidebar nav a.dashboard-link:hover .icon { color: #fff; }

.widget-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.widget-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--green); }
.widget-status.status-off { color: var(--label-3); }
.widget-list li .widget-meta { white-space: nowrap; }
.widget-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 420px) {
  .widget-list li { grid-template-columns: 1fr; gap: 3px; }
  .widget-side { flex-direction: row; align-items: center; gap: 8px; text-align: left; }
}

/* Brand text + tagline di sidebar & topbar */
.sidebar-brand .brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}
.sidebar-brand .brand-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--sidebar-fg-active);
  white-space: nowrap;
}
.sidebar-brand .brand-tagline {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .05em;
  white-space: nowrap;
}
.sidebar-brand .brand-tagline .tagline-connect { color: #5B9BFF; }
.sidebar-brand .brand-tagline .tagline-sep { color: rgba(255,255,255,.35); margin: 0 3px; }
.sidebar-brand .brand-tagline .tagline-protect { color: #FF9E33; }
