/* ===========================================================
    1. SYSTEM TEMA & DESIGN TOKENS (DARK & LIGHT MODE)
=========================================================== */

/* Default: DARK MODE */
:root,
[data-theme="dark"] {
  --bg-app: #08080D;
  --bg-panel: #101018;
  --bg-panel-2: #14141E;
  --bg-elevated: #1A1A26;
  --bg-input: #1c1c2b;
  --border: #26263A;
  --border-soft: #1D1D2B;

  --text-primary: #F3F3F7;
  --text-secondary: #9A9AB0;
  --text-muted: #66667E;

  --violet-500: #8B5CF6;
  --violet-400: #A78BFA;
  --violet-600: #7C3AED;
  --violet-glow: rgba(139, 92, 246, .35);
  --gradient-violet: linear-gradient(135deg, #8B5CF6 0%, #C084FC 100%);

  --green: #34D399;
  --green-bg: rgba(52, 211, 153, .12);
  --red: #F87171;
  --red-bg: rgba(248, 113, 113, .12);
  --amber: #FBBF24;
  --amber-bg: rgba(251, 191, 36, .12);
  --blue: #60A5FA;
  --blue-bg: rgba(96, 165, 250, .12);

  --shadow-panel: 0 20px 60px -20px rgba(0,0,0,.6);
  --bg-topbar: rgba(16, 16, 24, 0.6);
  --bg-topbar-mobile: rgba(16, 16, 24, 0.95);
  --bg-sidebar: linear-gradient(180deg, #101018 0%, #0B0B12 100%);
  --bg-body-radial-1: rgba(139, 92, 246, .10);
  --bg-body-radial-2: rgba(139, 92, 246, .06);
}

/* Override: LIGHT MODE */
[data-theme="light"] {
  --bg-app: #f3f4f8;
  --bg-panel: #ffffff;
  --bg-panel-2: #f8f9fc;
  --bg-elevated: #edf0f7;
  --bg-input: #eef1f6;
  --border: #e2e8f0;
  --border-soft: #e5e7eb;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --violet-500: #7c3aed;
  --violet-400: #6d28d9;
  --violet-600: #5b21b6;
  --violet-glow: rgba(124, 58, 237, .2);
  --gradient-violet: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);

  --green: #059669;
  --green-bg: rgba(5, 150, 105, .12);
  --red: #dc2626;
  --red-bg: rgba(220, 38, 38, .12);
  --amber: #d97706;
  --amber-bg: rgba(217, 119, 6, .12);
  --blue: #2563eb;
  --blue-bg: rgba(37, 99, 235, .12);

  --shadow-panel: 0 10px 30px -10px rgba(0,0,0,.08);
  --bg-topbar: rgba(255, 255, 255, 0.85);
  --bg-topbar-mobile: rgba(255, 255, 255, 0.95);
  --bg-sidebar: #ffffff;
  --bg-body-radial-1: rgba(124, 58, 237, .05);
  --bg-body-radial-2: rgba(124, 58, 237, .03);
}

/* Global Tokens */
:root {
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --font-display: 'Plus Jakarta Sans', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* ===========================================================
    2. BASE & RESET STYLES
=========================================================== */
*{box-sizing:border-box; margin:0; padding:0;}
html,body{height:100%;}
body{
  background-color: var(--bg-app);
  background-image:
    radial-gradient(circle at 15% 0%, var(--bg-body-radial-1), transparent 40%),
    radial-gradient(circle at 100% 20%, var(--bg-body-radial-2), transparent 45%);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow-x:hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}
button{font-family:inherit; cursor:pointer; border:none; background:none; color:inherit;}
input, select, textarea{font-family:inherit; color:inherit;}
::selection{background: var(--violet-glow);}
::-webkit-scrollbar{width:8px; height:8px;}
::-webkit-scrollbar-thumb{background:var(--border); border-radius:10px;}
::-webkit-scrollbar-track{background:transparent;}

a{color:inherit;}
svg{width:18px; height:18px; stroke-width:1.8;}

/* ===========================================================
    3. LAYOUT (SIDEBAR & MAIN AREA)
=========================================================== */
.app{
  display:grid;
  grid-template-columns: 264px 1fr;
  height:100vh;
}

/* ---------- SIDEBAR ---------- */
.sidebar{
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-soft);
  display:flex;
  flex-direction:column;
  padding: 22px 16px;
  transition: background 0.25s ease, border-color 0.25s ease;
}
.brand{
  display:flex; align-items:center; gap:12px;
  padding: 4px 8px 26px;
}
.brand-mark{
  width:38px; height:38px; border-radius:11px;
  background: var(--gradient-violet);
  display:flex; align-items:center; justify-content:center;
  box-shadow: 0 6px 18px -4px var(--violet-glow);
  color:#fff;
  flex-shrink:0;
}
.brand-mark svg{width:20px; height:20px;}
.brand-text{display:flex; flex-direction:column; line-height:1.25;}
.brand-name{font-family:var(--font-display); font-weight:800; font-size:15px; letter-spacing:-.2px; color: var(--text-primary);}
.brand-sub{font-size:11.5px; color:var(--text-muted);}

.nav{flex:1; display:flex; flex-direction:column; gap:2px; overflow-y:auto;}
.nav-group-label{
  font-size:10.5px; text-transform:uppercase; letter-spacing:.08em;
  color: var(--text-muted); font-weight:700;
  padding: 16px 12px 6px;
}
.nav-item{
  display:flex; align-items:center; gap:11px;
  padding:10px 12px;
  border-radius: var(--radius-sm);
  font-size:13.5px; font-weight:500;
  color: var(--text-secondary);
  transition: all .15s ease;
  position:relative;
}
.nav-item svg{width:17px; height:17px; opacity:.85; flex-shrink:0;}
.nav-item:hover{background: var(--bg-elevated); color: var(--text-primary);}
.nav-item.active{
  background: linear-gradient(90deg, rgba(139,92,246,.20), rgba(139,92,246,.05));
  color: var(--text-primary);
  box-shadow: inset 0 0 0 1px var(--violet-glow);
}
.nav-item.active svg{color: var(--violet-400); opacity:1;}
.nav-item.active::before{
  content:"";
  position:absolute; left:-16px; top:50%; transform:translateY(-50%);
  width:3px; height:60%; border-radius:2px;
  background: var(--gradient-violet);
}
.nav-badge{
  margin-left:auto;
  background: var(--red-bg); color: var(--red);
  font-size:10.5px; font-weight:700;
  padding: 1px 7px; border-radius:20px;
}
.sidebar-footer{border-top:1px solid var(--border-soft); padding-top:12px; margin-top:8px;}

/* ---------- MAIN CONTENT ---------- */
.main{display:flex; flex-direction:column; min-width:0; height:100vh;}
.topbar{
  height:64px; flex-shrink:0;
  display:flex; align-items:center; justify-content:space-between;
  padding: 0 26px;
  border-bottom:1px solid var(--border-soft);
  background: var(--bg-topbar);
  backdrop-filter: blur(12px);
  transition: background 0.25s ease, border-color 0.25s ease;
}
.search-box{
  display:flex; align-items:center; gap:10px;
  background: var(--bg-panel-2);
  border:1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 9px 14px;
  width: 360px;
  transition: border-color .15s;
}
.search-box:focus-within{border-color: var(--violet-600);}
.search-box svg{color:var(--text-muted); width:16px; height:16px;}
.search-box input{background:none; border:none; outline:none; font-size:13px; width:100%; color:var(--text-primary);}
.search-box input::placeholder{color:var(--text-muted);}

.topbar-right{display:flex; align-items:center; gap:12px;}
.today-pill{
  display:flex; align-items:center; gap:8px;
  font-size:12.5px; color:var(--text-secondary);
  background:var(--bg-panel-2); border:1px solid var(--border-soft);
  padding:7px 12px; border-radius:20px;
}
.today-pill svg{width:14px; height:14px;}
.icon-btn{
  width:36px; height:36px; border-radius:10px;
  display:flex; align-items:center; justify-content:center;
  background: var(--bg-panel-2); border:1px solid var(--border-soft);
  color: var(--text-secondary);
  transition:.15s;
}
.icon-btn:hover{color:var(--text-primary); border-color:var(--violet-600);}
.icon-btn svg{width:16px; height:16px;}
.avatar{
  width:36px; height:36px; border-radius:10px;
  background: var(--gradient-violet);
  display:flex; align-items:center; justify-content:center;
  font-family:var(--font-display); font-weight:700; font-size:12px; color:#fff;
}

.content{flex:1; overflow-y:auto; padding: 26px;}

/* ===========================================================
    4. PAGE HEADER & BUTTONS
=========================================================== */
.page-head{display:flex; align-items:flex-end; justify-content:space-between; margin-bottom:22px; flex-wrap:wrap; gap:14px;}
.page-title{font-family:var(--font-display); font-size:23px; font-weight:800; letter-spacing:-.3px; color: var(--text-primary);}
.page-desc{color:var(--text-secondary); font-size:13px; margin-top:4px;}
.btn{
  display:inline-flex; align-items:center; gap:8px;
  padding: 10px 16px; border-radius: var(--radius-sm);
  font-size:13px; font-weight:600;
  transition:.15s;
}
.btn svg{width:15px; height:15px;}
.btn-primary{
  background: var(--gradient-violet); color:#fff;
  box-shadow: 0 8px 20px -6px var(--violet-glow);
}
.btn-primary:hover{filter:brightness(1.08); transform:translateY(-1px);}
.btn-ghost{
  background: var(--bg-panel-2); color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-ghost:hover{border-color:var(--violet-600);}
.btn-danger-ghost{background:var(--red-bg); color:var(--red); border:1px solid transparent;}
.btn-sm{padding:7px 11px; font-size:12px;}

/* ===========================================================
    5. STAT CARDS & PANELS
=========================================================== */
.stat-grid{
  display:grid; 
  grid-template-columns:repeat(4,1fr); 
  gap:16px; 
  margin-bottom:22px;
  width:100%;
  box-sizing:border-box;
}
.stat-card{
  background: var(--bg-panel);
  border:1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding:18px;
  position:relative; overflow:hidden;
  transition: background 0.25s ease, border-color 0.25s ease;
  width:100%;
  min-width:0;
  box-sizing:border-box;
}
.stat-card::after{
  content:""; position:absolute; top:-40%; right:-20%; width:140px; height:140px;
  background: radial-gradient(circle, var(--violet-glow), transparent 70%);
  opacity:.5; pointer-events:none;
}
.stat-top{display:flex; align-items:center; justify-content:space-between; margin-bottom:14px;}
.stat-icon{
  width:36px; height:36px; border-radius:10px;
  display:flex; align-items:center; justify-content:center;
}
.stat-icon svg{width:17px; height:17px;}
.stat-icon.violet{background:rgba(139,92,246,.15); color:var(--violet-400);}
.stat-icon.green{background:var(--green-bg); color:var(--green);}
.stat-icon.red{background:var(--red-bg); color:var(--red);}
.stat-icon.amber{background:var(--amber-bg); color:var(--amber);}
.stat-trend{font-size:11.5px; font-weight:700; padding:3px 8px; border-radius:20px; display:flex; align-items:center; gap:3px;}
.stat-trend svg{width:11px; height:11px;}
.stat-trend.up{background:var(--green-bg); color:var(--green);}
.stat-trend.down{background:var(--red-bg); color:var(--red);}
.stat-label{color:var(--text-secondary); font-size:12.5px; margin-bottom:6px;}
.stat-value{font-family:var(--font-mono); font-size:22px; font-weight:600; letter-spacing:-.5px; color: var(--text-primary);}

.grid-2{display:grid; grid-template-columns: 1.6fr 1fr; gap:16px; align-items:start;}
.panel{
  background: var(--bg-panel);
  border:1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding:20px;
  transition: background 0.25s ease, border-color 0.25s ease;
}
.panel-head{display:flex; align-items:center; justify-content:space-between; margin-bottom:16px;}
.panel-title{font-family:var(--font-display); font-weight:700; font-size:14.5px; color: var(--text-primary);}
.panel-sub{color:var(--text-muted); font-size:11.5px; margin-top:2px;}
.chip-tabs{display:flex; gap:4px; background:var(--bg-panel-2); padding:3px; border-radius:20px; border:1px solid var(--border-soft);}
.chip-tab{padding:5px 12px; font-size:11.5px; border-radius:16px; color:var(--text-secondary); font-weight:600;}
.chip-tab.active{background:var(--gradient-violet); color:#fff;}

.mini-row{
  display:flex; align-items:center; justify-content:space-between;
  padding:11px 4px; border-bottom:1px solid var(--border-soft);
}
.mini-row:last-child{border-bottom:none;}
.mini-left{display:flex; align-items:center; gap:11px;}
.mini-icon{
  width:32px; height:32px; border-radius:9px; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  background:var(--bg-elevated); color:var(--text-secondary);
}
.mini-icon svg{width:15px; height:15px;}
.mini-name{font-size:13px; font-weight:600; color: var(--text-primary);}
.mini-sub{font-size:11px; color:var(--text-muted); margin-top:1px;}
.mini-val{font-family:var(--font-mono); font-size:13px; font-weight:600;}

/* ===========================================================
    6. TABLES & BADGES
=========================================================== */
.table-wrap{overflow-x:auto;}
table{width:100%; border-collapse:collapse; font-size:13px;}
thead th{
  text-align:left; font-size:11px; text-transform:uppercase; letter-spacing:.05em;
  color:var(--text-muted); font-weight:700;
  padding:10px 12px; border-bottom:1px solid var(--border-soft);
  white-space:nowrap;
}
tbody td{padding:13px 12px; border-bottom:1px solid var(--border-soft); vertical-align:middle; color: var(--text-primary);}
tbody tr{transition:background .12s;}
tbody tr:hover{background: var(--bg-panel-2);}
tbody tr:last-child td{border-bottom:none;}
.cell-strong{font-weight:600; color: var(--text-primary);}
.cell-mono{font-family:var(--font-mono);}
.cell-sub{color:var(--text-muted); font-size:11.5px; margin-top:2px;}

.badge{
  display:inline-flex; align-items:center; gap:5px;
  padding:4px 10px; border-radius:20px; font-size:11px; font-weight:700;
}
.badge svg{width:11px; height:11px;}
.badge.green{background:var(--green-bg); color:var(--green);}
.badge.red{background:var(--red-bg); color:var(--red);}
.badge.amber{background:var(--amber-bg); color:var(--amber);}
.badge.violet{background:rgba(139,92,246,.15); color:var(--violet-400);}
.badge.blue{background:var(--blue-bg); color:var(--blue);}
.badge.gray{background:var(--bg-elevated); color:var(--text-secondary);}

/* FIX TOMBOL AKSI EDIT & HAPUS (POINTER EVENTS & VISIBILITY) */
.row-actions {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  position: relative !important;
  z-index: 10 !important;
}

.mini-row .row-actions{opacity:1;}

.icon-btn-sm {
  width: 32px !important;
  height: 32px !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: var(--bg-elevated) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-soft) !important;
  cursor: pointer !important;
  position: relative !important;
  z-index: 11 !important;
}

/* Mencegah SVG di dalam tombol mengambil event klik */
.icon-btn-sm *, 
.btn-edit-prod *, 
.btn-del-prod *, 
.kat-edit *, 
.kat-delete * {
  pointer-events: none !important;
}

.icon-btn-sm:hover {
  background: var(--violet-600) !important;
  color: #ffffff !important;
}
.icon-btn-sm svg{width:14px; height:14px;}

.stock-bar{width:70px; height:5px; border-radius:4px; background:var(--bg-elevated); overflow:hidden;}
.stock-bar-fill{height:100%; border-radius:4px; background: var(--gradient-violet);}

/* ===========================================================
    7. FILTER BAR & INPUTS
=========================================================== */
.filter-bar{display:flex; align-items:center; gap:10px; margin-bottom:16px; flex-wrap:wrap;}
.select{
  background:var(--bg-panel-2); border:1px solid var(--border-soft);
  padding:8px 12px; border-radius:var(--radius-sm); font-size:12.5px; color:var(--text-secondary);
  outline:none;
}
.search-inline{
  display:flex; align-items:center; gap:8px;
  background:var(--bg-panel-2); border:1px solid var(--border-soft);
  padding:8px 12px; border-radius:var(--radius-sm);
}
.search-inline input{background:none; border:none; outline:none; font-size:12.5px; color:var(--text-primary); width:180px;}
.search-inline svg{width:14px; height:14px; color:var(--text-muted);}

/* ===========================================================
    8. MODALS & TOASTS
=========================================================== */
.modal-overlay{
  position:fixed; inset:0; background:rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  display:none; align-items:center; justify-content:center; z-index:100;
}
.modal-overlay.show{display:flex;}
.modal{
  background: var(--bg-panel);
  border:1px solid var(--border);
  border-radius: var(--radius-lg);
  width:460px; max-width:92vw;
  max-height:88vh; overflow-y:auto;
  padding:22px;
  box-shadow: var(--shadow-panel);
  animation: modalIn .18s ease;
  color: var(--text-primary);
}
@keyframes modalIn{from{opacity:0; transform:translateY(8px) scale(.98);} to{opacity:1; transform:none;}}
.modal-head{display:flex; align-items:center; justify-content:space-between; margin-bottom:18px;}
.modal-title{font-family:var(--font-display); font-weight:700; font-size:16px; color: var(--text-primary);}
.modal-close{width:28px; height:28px; border-radius:8px; display:flex; align-items:center; justify-content:center; background:var(--bg-elevated); color:var(--text-secondary);}
.field{margin-bottom:14px;}
.field label{display:block; font-size:12px; font-weight:600; color:var(--text-secondary); margin-bottom:6px;}
.field input, .field select, .field textarea{
  width:100%; background:var(--bg-input); border:1px solid var(--border-soft);
  padding:10px 12px; border-radius:var(--radius-sm); font-size:13px; color:var(--text-primary); outline:none;
}
.field input:focus, .field select:focus, .field textarea:focus{border-color:var(--violet-600);}
.field-row{display:grid; grid-template-columns:1fr 1fr; gap:12px;}
.modal-foot{display:flex; justify-content:flex-end; gap:10px; margin-top:18px;}

.toast{
  position:fixed; bottom:24px; left:50%; transform:translateX(-50%) translateY(20px);
  background: var(--bg-panel); border:1px solid var(--border);
  color: var(--text-primary);
  padding:12px 20px; border-radius: 12px;
  font-size:13px; font-weight:600;
  display:flex; align-items:center; gap:10px;
  opacity:0; pointer-events:none; transition:.25s;
  z-index:200;
  box-shadow: var(--shadow-panel);
}
.toast.show{opacity:1; transform:translateX(-50%) translateY(0);}
.toast svg{width:16px; height:16px; color:var(--green);}

.empty{text-align:center; padding:40px 20px; color:var(--text-muted);}
.empty svg{width:34px; height:34px; margin-bottom:10px; opacity:.5;}
.empty-title{font-size:13px; font-weight:600; color:var(--text-secondary); margin-bottom:4px;}

/* Utilities */
.mt-4{margin-top:16px;}
.mb-4{margin-bottom:16px;}
.flex{display:flex; align-items:center;}
.gap-8{gap:8px;}
.text-green{color:var(--green);}
.text-red{color:var(--red);}
.text-muted{color:var(--text-muted);}
.w-full{width:100%;}
.hidden{display:none !important;}

/* ===========================================================
    9. AUTH PAGE (LOGIN & REGISTER)
=========================================================== */
.auth-body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 24px 16px;
  background-color: var(--bg-app);
}

.auth-wrap {
  width: 100%;
  max-width: 420px;
  margin: auto;
}

.auth-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-panel);
  padding: 32px 28px;
  width: 100%;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-submit {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
  padding: 12px;
}

.auth-error {
  color: var(--red);
  font-size: 12.5px;
  min-height: 20px;
}

.auth-foot {
  margin-top: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

/* ===========================================================
    10. EXTRA COMPONENTS & SYNC
=========================================================== */
.sync-pill{
  display:flex; align-items:center; gap:6px;
  padding:6px 12px;
  border-radius:999px;
  font-size:12px;
  border:1px solid var(--border-soft);
  color: var(--text-muted);
  white-space:nowrap;
  background: var(--bg-panel-2);
}
.sync-pill svg{ width:14px; height:14px; }
.sync-pill.syncing{ color: var(--amber); border-color: rgba(251,191,36,.25); }
.sync-pill.syncing svg{ animation: spin 0.8s linear infinite; }
.sync-pill.synced{ color: var(--green); border-color: rgba(52,211,153,.2); }
.sync-pill.sync-error{ color: var(--red); border-color: rgba(248,113,113,.25); }

.loading-screen{
  position:fixed; inset:0;
  background: var(--bg-app);
  display:flex; align-items:center; justify-content:center;
  flex-direction:column; gap:12px;
  color: var(--text-muted);
  font-size:13px;
  z-index:999;
}
.loading-screen svg{ width:26px; height:26px; color: var(--violet-400); animation: spin 0.8s linear infinite; }
.spin{ animation: spin 0.8s linear infinite; }
@keyframes spin{ to{ transform: rotate(360deg); } }

/* ===========================================================
    11. DESAIN KARTU PAKET LANGGANAN (PRO / GRATIS)
=========================================================== */
.plan-current {
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.plan-current.is-pro {
  border-color: rgba(139, 92, 246, 0.4);
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.08) 0%, var(--bg-panel) 100%);
}

.plan-current-top {
  display: flex !important;
  justify-content: space-between !important;
  align-items: flex-start !important;
  margin-bottom: 16px !important;
}

.plan-current-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.plan-current-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--violet-400);
}

.plan-current-sub {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.plan-icon-big {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(139, 92, 246, 0.15);
  color: var(--violet-400);
  display: flex;
  align-items: center;
  justify-content: center;
}

.plan-icon-big svg {
  width: 22px;
  height: 22px;
}

.plan-usage {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
}

.plan-usage-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.plan-usage-label {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  font-size: 12.5px;
  color: var(--text-secondary);
  font-weight: 500;
}

.plan-usage-label span:last-child {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-primary);
}

.plan-usage-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-elevated);
  border-radius: 10px;
  overflow: hidden;
}

.plan-usage-fill {
  height: 100%;
  background: var(--gradient-violet);
  border-radius: 10px;
  transition: width 0.3s ease;
}

.plan-usage-fill.full {
  background: var(--red) !important;
}

.plan-price {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.plan-price span {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: normal;
}

.plan-features {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 0 18px 0 !important;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.plan-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

.plan-features li svg {
  width: 16px;
  height: 16px;
  color: var(--green);
  flex-shrink: 0;
}

.transfer-info {
  background: var(--bg-panel-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: 14px;
}

.transfer-info-title {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.transfer-bank {
  font-weight: 700;
  color: var(--violet-400);
  font-size: 14px;
}

.transfer-norek {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 16px;
  color: var(--text-primary);
  letter-spacing: 0.5px;
  margin: 2px 0;
}

.transfer-atasnama {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ===========================================================
    12. RESPONSIVE MOBILE UI (MODE APLIKASI HP / WEBVIEW)
=========================================================== */
.bottom-nav {
  display: none;
}

@media (max-width: 1100px){
  .stat-grid{ grid-template-columns: repeat(2, 1fr) !important; }
  .grid-2{ grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  html, body {
    height: 100%;
    overflow-y: auto;
    position: relative;
    width: 100%;
    -webkit-overflow-scrolling: touch;
  }

  body.auth-body {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px 14px !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
  }

  .auth-wrap {
    max-width: 100% !important;
  }

  .auth-card {
    padding: 24px 18px !important;
  }

  .app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    grid-template-columns: none !important;
  }

  .sidebar, aside.sidebar {
    display: none !important;
  }

  .main {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100% !important;
    max-width: 100vw !important;
    height: auto !important;
    overflow: visible !important;
  }

  .topbar {
    height: 60px;
    padding: 0 16px;
    background: var(--bg-topbar-mobile);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .search-box {
    width: 100%;
    max-width: 180px;
    padding: 6px 10px;
  }

  .today-pill {
    display: none !important;
  }

  .content {
    padding: 16px 16px 80px 16px !important;
    overflow: visible !important;
    width: 100% !important;
    max-width: 100vw !important;
  }

  .stat-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .stat-card {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .stat-value {
    font-size: 17px;
  }

  .stat-label {
    font-size: 11px;
  }

  .grid-2 {
    grid-template-columns: 1fr !important;
    gap: 14px;
    width: 100% !important;
  }

  .panel {
    padding: 16px;
    border-radius: var(--radius-md);
    width: 100% !important;
  }

  .bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 68px !important;
    background: var(--bg-panel);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-soft);
    justify-content: space-around;
    align-items: center;
    z-index: 999;
    padding-bottom: max(4px, env(safe-area-inset-bottom));
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
  }

  .bottom-nav-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    color: var(--text-muted);
    font-size: 11px !important;
    font-weight: 600;
    flex: 1;
    height: 100%;
    transition: color 0.15s ease;
    padding: 6px 0;
  }

  .bottom-nav-item svg {
    width: 24px !important;
    height: 24px !important;
  }

  .bottom-nav-item.active {
    color: var(--violet-400) !important;
  }

  .table-wrap {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .chart-container {
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 180px !important;
    margin: 0 auto !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
  }

  .chart-container canvas {
    max-width: 100% !important;
    max-height: 100% !important;
  }
}

/* ===========================================================
    13. PERBAIKAN SPECIFIC TABEL LAPORAN (HP / MOBILE)
=========================================================== */
@media (max-width: 640px) {
  .page-head .flex.gap-8 {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
  }

  .page-head .flex.gap-8 .btn {
    width: 100% !important;
    padding: 8px 4px !important;
    font-size: 11px !important;
    justify-content: center !important;
    white-space: nowrap !important;
  }

  .table-wrap table th,
  .table-wrap table td {
    padding: 8px 6px !important;
    font-size: 11.5px !important;
    word-break: normal !important;
  }

  /* TABEL 1: PERHITUNGAN LABA RUGI (2 Kolom) */
  .panel .table-wrap table:has(th:nth-child(2):last-child) {
    width: 100% !important;
    table-layout: auto !important;
  }

  .panel .table-wrap table:has(th:nth-child(2):last-child) td:first-child,
  .panel .table-wrap table:has(th:nth-child(2):last-child) th:first-child {
    white-space: normal !important;
  }

  .panel .table-wrap table:has(th:nth-child(2):last-child) td:last-child,
  .panel .table-wrap table:has(th:nth-child(2):last-child) th:last-child {
    white-space: nowrap !important;
    text-align: right !important;
  }

  /* TABEL 2: RIWAYAT TUTUP BUKU (5 Kolom) */
  .panel .table-wrap table:has(th:nth-child(5)) {
    min-width: 520px !important;
  }

  .panel .table-wrap table:has(th:nth-child(5)) th,
  .panel .table-wrap table:has(th:nth-child(5)) td {
    white-space: nowrap !important;
  }

  .panel .table-wrap table:has(th:nth-child(5)) td:first-child {
    white-space: normal !important;
    min-width: 130px !important;
  }

  /* TABEL 3: RINCIAN PENGELUARAN BEBAN (4 Kolom) */
  .panel .table-wrap table:has(th:nth-child(4)) {
    min-width: 380px !important;
  }

  .table-wrap table td[style*="padding-left"] {
    padding-left: 10px !important;
  }
}