*{box-sizing:border-box;margin:0;padding:0;}
:root{
  --blue:#4C7EFF;--blue-d:#3A6AE8;
  --green:#22C55E;--red:#EF4444;--orange:#F97316;--gold:#F59E0B;
  --sidebar-bg:#0F172A;--sidebar-w:240px;
  --text:#111827;--sub:#6B7280;--border:#E5E7EB;
  --bg:#F8FAFC;--white:#fff;
  --shadow:0 1px 4px rgba(0,0,0,.08);
  --radius:10px;
}
html,body{height:100%;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;background:var(--bg);color:var(--text);}

/* ── LAYOUT ── */
.admin-wrap{display:flex;height:100vh;overflow:hidden;}

/* ── SIDEBAR ── */
#sidebar{
  width:var(--sidebar-w);flex-shrink:0;
  background:var(--sidebar-bg);
  display:flex;flex-direction:column;
  overflow-y:auto;overflow-x:hidden;
  transition:transform .25s ease;z-index:200;
}
#sidebar::-webkit-scrollbar{width:0;}
.sb-logo{
  display:flex;align-items:center;gap:10px;
  padding:20px 16px 18px;border-bottom:1px solid rgba(255,255,255,.07);
  flex-shrink:0;
}
.sb-logo img{width:38px;height:38px;border-radius:10px;object-fit:contain;background:rgba(255,255,255,.15);padding:2px;}
.sb-logo-img{width:38px;height:38px;border-radius:10px;object-fit:contain;background:rgba(255,255,255,.15);padding:2px;}
.sb-logo-text{font-size:14px;font-weight:700;color:#fff;line-height:1.2;}
.sb-logo-sub{font-size:10px;color:rgba(255,255,255,.45);font-weight:400;}
.sb-nav{flex:1;padding:10px 8px;}
.sb-section{font-size:10px;font-weight:700;color:rgba(255,255,255,.3);
  letter-spacing:.08em;padding:14px 8px 6px;text-transform:uppercase;}
.nav-item{
  display:flex;align-items:center;gap:10px;
  padding:10px 10px;border-radius:8px;cursor:pointer;
  font-size:13px;font-weight:500;color:rgba(255,255,255,.65);
  transition:all .15s;margin-bottom:2px;text-decoration:none;
}
.nav-item:hover{background:rgba(255,255,255,.07);color:#fff;}
.nav-item.active{background:var(--blue);color:#fff;}
.nav-item svg{width:18px;height:18px;flex-shrink:0;}
.nav-badge{margin-left:auto;background:var(--red);color:#fff;
  font-size:10px;font-weight:700;border-radius:50px;padding:1px 6px;min-width:18px;text-align:center;}
.sb-footer{padding:12px 8px 16px;border-top:1px solid rgba(255,255,255,.07);}
.sb-admin-info{display:flex;align-items:center;gap:8px;padding:8px 10px;}
.sb-admin-avatar{width:32px;height:32px;border-radius:50%;background:var(--blue);
  display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:700;color:#fff;flex-shrink:0;}
.sb-admin-name{font-size:12px;font-weight:600;color:rgba(255,255,255,.8);}
.sb-admin-role{font-size:10px;color:rgba(255,255,255,.4);}

/* ── OVERLAY ── */
#sb-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:150;}

/* ── MAIN ── */
#main{flex:1;display:flex;flex-direction:column;overflow:hidden;}

/* ── TOPBAR ── */
#topbar{
  display:flex;align-items:center;gap:12px;
  padding:0 20px;height:58px;flex-shrink:0;
  background:var(--white);border-bottom:1px solid var(--border);
}
#menu-btn{
  display:none;background:none;border:none;cursor:pointer;
  padding:6px;border-radius:6px;color:var(--text);
}
#menu-btn svg{width:22px;height:22px;}
#page-title{font-size:16px;font-weight:700;flex:1;}
.topbar-right{display:flex;align-items:center;gap:10px;}
.topbar-right span{font-size:12px;color:var(--sub);}
.btn-logout{
  font-size:12px;font-weight:600;color:var(--red);background:none;
  border:1px solid var(--red);border-radius:6px;padding:5px 12px;cursor:pointer;
}
.btn-logout:hover{background:var(--red);color:#fff;}

/* ── CONTENT ── */
#content{flex:1;overflow-y:auto;padding:20px;}
#content::-webkit-scrollbar{width:6px;}
#content::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px;}

/* ── SECTION ── */
.section{display:none;}
.section.active{display:block;}

/* ── STAT CARDS ── */
.stat-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:20px;}
.stat-card{
  background:var(--white);border-radius:var(--radius);
  padding:16px 18px;box-shadow:var(--shadow);
  display:flex;align-items:center;gap:14px;
}
.stat-icon{
  width:44px;height:44px;border-radius:10px;
  display:flex;align-items:center;justify-content:center;flex-shrink:0;
}
.stat-icon svg{width:22px;height:22px;}
.si-blue{background:#EEF2FF;} .si-blue svg{stroke:var(--blue);}
.si-green{background:#F0FDF4;} .si-green svg{stroke:var(--green);}
.si-orange{background:#FFF7ED;} .si-orange svg{stroke:var(--orange);}
.si-red{background:#FEF2F2;} .si-red svg{stroke:var(--red);}
.si-gold{background:#FFFBEB;} .si-gold svg{stroke:var(--gold);}
.si-purple{background:#F5F3FF;} .si-purple svg{stroke:#8B5CF6;}
.stat-body{}
.stat-val{font-size:22px;font-weight:800;color:var(--text);}
.stat-label{font-size:11px;color:var(--sub);margin-top:2px;font-weight:500;}
.stat-sub{font-size:11px;color:var(--green);font-weight:600;margin-top:1px;}

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

/* ── TABLE ── */
.tbl-wrap{overflow-x:auto;}
table{width:100%;border-collapse:collapse;}
th{
  font-size:11px;font-weight:700;color:var(--sub);text-align:left;
  padding:10px 16px;background:#F9FAFB;border-bottom:1px solid var(--border);
  white-space:nowrap;text-transform:uppercase;letter-spacing:.04em;
}
td{font-size:13px;padding:11px 16px;border-bottom:1px solid #F3F4F6;vertical-align:middle;}
tr:last-child td{border-bottom:none;}
tr:hover td{background:#FAFAFA;}

/* ── BADGES ── */
.badge{display:inline-flex;align-items:center;font-size:11px;font-weight:700;
  border-radius:50px;padding:2px 9px;}
.badge-green{background:#DCFCE7;color:#15803D;}
.badge-blue{background:#DBEAFE;color:#1D4ED8;}
.badge-orange{background:#FFEDD5;color:#C2410C;}
.badge-red{background:#FEE2E2;color:#B91C1C;}
.badge-gray{background:#F3F4F6;color:var(--sub);}
.badge-purple{background:#EDE9FE;color:#6D28D9;}
.badge-gold{background:#FEF3C7;color:#B45309;}

/* ── BUTTONS ── */
.btn{display:inline-flex;align-items:center;gap:5px;
  font-size:12px;font-weight:600;padding:6px 12px;
  border-radius:6px;cursor:pointer;border:none;transition:.15s;}
.btn-primary{background:var(--blue);color:#fff;}
.btn-primary:hover{background:var(--blue-d);}
.btn-danger{background:var(--red);color:#fff;}
.btn-danger:hover{background:#DC2626;}
.btn-success{background:var(--green);color:#fff;}
.btn-success:hover{background:#16A34A;}
.btn-ghost{background:var(--light,#F3F4F6);color:var(--text);border:1px solid var(--border);}
.btn-ghost:hover{background:var(--border);}
.btn-sm{font-size:11px;padding:4px 9px;}
.btn-icon{width:30px;height:30px;padding:0;justify-content:center;}
.btn-icon svg{width:15px;height:15px;}

/* ── TOOLBAR ── */
.toolbar{display:flex;align-items:center;gap:10px;padding:12px 16px;border-bottom:1px solid var(--border);flex-wrap:wrap;}
.search-box{
  display:flex;align-items:center;gap:6px;
  background:#F9FAFB;border:1px solid var(--border);border-radius:8px;
  padding:7px 12px;flex:1;min-width:160px;
}
.search-box svg{width:16px;height:16px;stroke:var(--sub);flex-shrink:0;}
.search-box input{border:none;background:none;outline:none;font-size:13px;width:100%;color:var(--text);}
.filter-select{
  border:1px solid var(--border);border-radius:8px;padding:7px 10px;
  font-size:12px;background:var(--white);color:var(--text);cursor:pointer;outline:none;
}
.tab-bar{
  display:flex;gap:4px;padding:10px 16px;border-bottom:1px solid var(--border);
  overflow-x:auto;flex-wrap:nowrap;-webkit-overflow-scrolling:touch;
}
.tab-bar::-webkit-scrollbar{height:0;}
.tab-btn{
  font-size:12px;font-weight:600;padding:5px 14px;border-radius:6px;cursor:pointer;
  border:none;background:none;color:var(--sub);transition:.15s;white-space:nowrap;flex-shrink:0;
}
.tab-btn.active{background:var(--blue);color:#fff;}
.tab-btn:hover:not(.active){background:#F3F4F6;}

/* ── PAGINATION ── */
.pagination{display:flex;align-items:center;justify-content:center;gap:6px;padding:14px;border-top:1px solid var(--border);}
.pg-btn{
  min-width:34px;height:34px;padding:0 10px;border-radius:6px;cursor:pointer;
  border:1px solid var(--border);background:var(--white);font-size:12px;font-weight:600;
  display:flex;align-items:center;justify-content:center;
}
.pg-btn.active{background:var(--blue);color:#fff;border-color:var(--blue);}
.pg-btn:disabled{opacity:.4;cursor:not-allowed;}
.pg-info{font-size:12px;color:var(--sub);}

/* ── AVATAR ── */
.av{
  width:28px;height:28px;border-radius:50%;
  display:inline-flex;align-items:center;justify-content:center;
  font-size:10px;font-weight:700;color:#fff;flex-shrink:0;
}

/* ── FORM ── */
.form-group{margin-bottom:14px;}
.form-label{font-size:12px;font-weight:600;color:var(--sub);margin-bottom:5px;display:block;}
.form-input{
  width:100%;padding:9px 12px;border:1px solid var(--border);border-radius:8px;
  font-size:13px;outline:none;background:var(--white);color:var(--text);
}
.form-input:focus{border-color:var(--blue);box-shadow:0 0 0 3px rgba(76,126,255,.12);}
textarea.form-input{resize:vertical;min-height:80px;}
select.form-input{cursor:pointer;}
.form-row{display:grid;grid-template-columns:1fr 1fr;gap:12px;}
.form-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:16px;}

/* ── MODAL ── */
#modal-overlay{
  display:none;position:fixed;inset:0;
  background:rgba(0,0,0,.5);z-index:500;
  align-items:center;justify-content:center;padding:20px;
}
#modal-overlay.open{display:flex;}
.modal{
  background:var(--white);border-radius:14px;width:100%;max-width:500px;
  max-height:90vh;display:flex;flex-direction:column;overflow:hidden;
  box-shadow:0 20px 60px rgba(0,0,0,.2);
}
.modal-lg{max-width:700px;}
.modal-xl{max-width:960px;width:95vw;}

/* ── USER DETAIL STYLES ── */
.ud-header{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:16px;padding-bottom:16px;border-bottom:1px solid var(--border);flex-wrap:wrap;}
.ud-profile{display:flex;align-items:center;gap:12px;}
.ud-avatar{width:44px;height:44px;border-radius:50%;background:linear-gradient(135deg,var(--blue),#6366F1);color:#fff;display:flex;align-items:center;justify-content:center;font-size:18px;font-weight:700;flex-shrink:0;}
.ud-name{font-size:15px;font-weight:700;color:var(--text);}
.ud-email{font-size:12px;color:var(--sub);word-break:break-all;}
.ud-badges{display:flex;gap:6px;flex-wrap:wrap;align-items:center;}

.ud-alert{border-radius:8px;padding:12px 16px;margin-bottom:16px;display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:12px;flex-wrap:wrap;}
.ud-alert.anomaly{background:#FEF2F2;border:1px solid #FCA5A5;color:#991B1B;}
.ud-alert.valid{background:#F0FDF4;border:1px solid #86EFAC;color:#166534;}
.ud-alert-left{display:flex;align-items:center;gap:8px;font-weight:500;}
.ud-alert-btn{font-size:11px;padding:5px 12px;border-radius:6px;border:none;font-weight:700;cursor:pointer;background:#DC2626;color:#fff;display:inline-flex;align-items:center;gap:4px;transition:0.15s;}
.ud-alert-btn:hover{background:#B91C1C;}

.ud-stat-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-bottom:16px;}
.ud-stat-card{background:#F9FAFB;border:1px solid var(--border);border-radius:8px;padding:12px;}
.ud-stat-label{font-size:10px;font-weight:700;color:var(--sub);text-transform:uppercase;letter-spacing:.05em;margin-bottom:4px;}
.ud-stat-val{font-size:16px;font-weight:800;color:var(--text);}
.ud-stat-sub{font-size:11px;color:var(--sub);margin-top:3px;}

.ud-breakdown-bar{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin-bottom:16px;}
.ud-breakdown-item{display:flex;flex-direction:column;align-items:center;gap:2px;padding:6px 4px;background:#F9FAFB;border-radius:6px;text-align:center;}
.ud-breakdown-dot{width:7px;height:7px;border-radius:50%;}
.ud-breakdown-lbl{font-size:10px;color:var(--sub);font-weight:600;text-transform:uppercase;}
.ud-breakdown-val{font-size:14px;font-weight:800;color:var(--text);}

.ud-tabs{display:flex;gap:4px;border-bottom:1px solid var(--border);margin-bottom:14px;overflow-x:auto;}
.ud-tab-btn{background:none;border:none;border-bottom:2px solid transparent;padding:8px 14px;font-size:12px;font-weight:600;color:var(--sub);cursor:pointer;transition:0.15s;white-space:nowrap;}
.ud-tab-btn:hover{color:var(--text);}
.ud-tab-btn.active{color:var(--blue);border-bottom-color:var(--blue);font-weight:700;}

.ud-table{width:100%;font-size:12px;border-collapse:collapse;}
.ud-table th{text-align:left;padding:8px 10px;background:#F9FAFB;color:var(--sub);font-weight:600;font-size:11px;text-transform:uppercase;border-bottom:1px solid var(--border);}
.ud-table td{padding:8px 10px;border-bottom:1px solid var(--border);color:var(--text);}
.ud-table tr:last-child td{border-bottom:none;}

.audit-table{width:100%;border:1px solid var(--border);border-radius:8px;overflow:hidden;font-size:12px;margin-top:10px;border-collapse:collapse;}
.audit-table td{padding:8px 12px;border-bottom:1px solid var(--border);}
.audit-table tr:last-child td{border-bottom:none;}
.audit-table .audit-highlight{background:#F9FAFB;font-weight:700;}

.modal-header{
  display:flex;align-items:center;justify-content:space-between;
  padding:16px 20px;border-bottom:1px solid var(--border);flex-shrink:0;
}
.modal-title{font-size:15px;font-weight:700;}
.modal-close{background:none;border:none;cursor:pointer;color:var(--sub);
  font-size:20px;line-height:1;padding:2px 6px;border-radius:4px;}
.modal-close:hover{background:#F3F4F6;color:var(--text);}
.modal-body{padding:20px;overflow-y:auto;flex:1;}
.modal-footer{padding:14px 20px;border-top:1px solid var(--border);display:flex;gap:8px;justify-content:flex-end;}

/* ── TOAST ── */
#toast-wrap{position:fixed;bottom:20px;right:20px;z-index:9999;display:flex;flex-direction:column;gap:8px;}
.toast{
  background:var(--text);color:#fff;padding:10px 16px;
  border-radius:8px;font-size:13px;font-weight:500;
  box-shadow:0 4px 12px rgba(0,0,0,.2);
  animation:slideUp .3s ease;max-width:320px;
}
.toast.success{background:#15803D;}
.toast.error{background:#B91C1C;}
.toast.warn{background:#B45309;}
@keyframes slideUp{from{opacity:0;transform:translateY(12px);}to{opacity:1;transform:translateY(0);}}

/* ── EMPTY ── */
.empty{text-align:center;padding:40px 20px;color:var(--sub);}
.empty svg{width:40px;height:40px;stroke:var(--border);margin-bottom:10px;}
.empty p{font-size:13px;}

/* ── DETAIL ROW ── */
.detail-row{display:flex;padding:10px 0;border-bottom:1px solid var(--border);}
.detail-row:last-child{border-bottom:none;}
.detail-key{font-size:12px;color:var(--sub);font-weight:600;width:140px;flex-shrink:0;}
.detail-val{font-size:13px;color:var(--text);font-weight:500;flex:1;word-break:break-all;}

/* ── DASHBOARD GRID ── */
.dash-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;}

/* ── FINANCIAL HEADER ── */
.fin-card-header{flex-wrap:wrap;gap:8px;}
.fin-tabs{display:flex;gap:3px;flex-shrink:0;}
.fin-tabs .tab-btn{font-size:11px;padding:4px 10px;}

/* ── FINANCIAL SUMMARY GRID ── */
.fin-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  border-top:1px solid var(--border);
}
.fin-card{
  padding:16px 18px;
  border-right:1px solid var(--border);
  min-width:0;
}
.fin-card:last-child{border-right:none;}
.fin-label{font-size:10px;font-weight:700;color:var(--sub);text-transform:uppercase;letter-spacing:.06em;margin-bottom:6px;}
.fin-val{font-size:17px;font-weight:800;color:var(--text);letter-spacing:-.3px;word-break:break-word;}
.fin-sub{font-size:11px;color:var(--sub);margin-top:4px;}
.fin-highlight{background:linear-gradient(135deg,#F0FDF4,#DCFCE7);}
.fin-highlight .fin-label{color:#15803D;}
.fin-highlight .fin-val{color:#15803D;}
.fin-highlight .fin-sub{color:#16A34A;font-weight:600;}
.fin-c-blue{} .fin-c-purple{} .fin-c-orange{}

/* ── ASET ROWS ── */
.asset-list{padding:4px 0;}
.asset-row{
  display:flex;align-items:center;justify-content:space-between;
  padding:12px 18px;border-bottom:1px solid var(--border);gap:10px;
}
.asset-row:last-child{border-bottom:none;}
.asset-row-left{display:flex;align-items:center;gap:10px;flex:1;min-width:0;}
.asset-dot{width:10px;height:10px;border-radius:50%;flex-shrink:0;}
.asset-row-label{font-size:13px;font-weight:600;color:var(--text);}
.asset-row-sub{font-size:11px;color:var(--sub);margin-top:1px;}
.asset-row-val{font-size:15px;font-weight:800;color:var(--text);flex-shrink:0;text-align:right;}

/* ── ORDER STATUS GRID ── */
.os-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;}
.os-item{display:flex;flex-direction:column;align-items:center;gap:3px;padding:8px 4px;background:#F9FAFB;border-radius:8px;text-align:center;}
.os-dot{width:7px;height:7px;border-radius:50%;}
.os-label{font-size:10px;color:var(--sub);font-weight:600;text-transform:uppercase;letter-spacing:.02em;}
.os-val{font-size:16px;font-weight:800;color:var(--text);}

/* ── REKAP USER ROWS ── */
.rekap-section-label{font-size:10px;font-weight:700;color:var(--sub);text-transform:uppercase;letter-spacing:.06em;margin-bottom:8px;}
.rekap-user-rows{margin-top:14px;padding-top:12px;border-top:1px solid var(--border);display:flex;flex-direction:column;gap:6px;}
.rekap-user-row{display:flex;justify-content:space-between;align-items:center;font-size:12px;color:var(--sub);}
.rekap-user-val{font-size:13px;font-weight:700;color:var(--blue);}

/* ── CONFIG SECTION ── */
.config-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;}

/* ── OTP REVEAL ── */
.otp-code{
  font-family:'Courier New',monospace;font-size:22px;font-weight:800;
  letter-spacing:6px;color:var(--blue);background:#EEF2FF;
  padding:10px 20px;border-radius:8px;text-align:center;margin:10px 0;
}

/* ── PREMIUM ── */
.premium-card{
  background:linear-gradient(135deg,#667eea,#764ba2);
  border-radius:var(--radius);padding:30px;color:#fff;text-align:center;margin-bottom:16px;
}
.premium-card h2{font-size:22px;font-weight:800;margin-bottom:8px;}
.premium-card p{font-size:13px;opacity:.85;}

/* ── RESTOCK GRID ── */
.restock-cols{display:grid;grid-template-columns:1fr 1fr;gap:16px;align-items:start;}

/* ── RESTOCK INFO BAR ── */
.sg-info-bar{
  display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-bottom:16px;
}
.sg-info-card{
  background:var(--white);border-radius:var(--radius);box-shadow:var(--shadow);
  padding:14px 16px;display:flex;align-items:center;gap:12px;
}
.sg-refresh-card{
  background:var(--white);border-radius:var(--radius);box-shadow:var(--shadow);
  padding:14px 16px;display:flex;align-items:center;gap:12px;
  border:none;cursor:pointer;text-align:left;transition:.15s;
}
.sg-refresh-card:hover{background:#F9FAFB;}

/* ── CARD TITLE ICON ── */
.card-title-icon{
  width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;
  background:#EEF2FF;border-radius:6px;flex-shrink:0;
}
.card-title-icon svg{width:15px;height:15px;stroke:var(--blue);}

/* ── QUICK AMOUNT GRID ── */
.sg-quick-grid{
  display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin-bottom:14px;
}
.sg-quick{width:100%;justify-content:center;font-size:11px;padding:5px 0;}

/* ── FEE BOX ── */
.sg-fee-box{
  background:#F9FAFB;border:1px solid var(--border);border-radius:8px;
  padding:10px 14px;margin-bottom:14px;
}
.sg-fee-row{
  display:flex;justify-content:space-between;align-items:center;
  font-size:12px;padding:4px 0;border-bottom:1px solid var(--border);
}
.sg-fee-row:last-child{border-bottom:none;padding-bottom:0;}
.sg-fee-total{font-weight:700;font-size:13px;color:var(--blue);}

/* ── SUBMIT BUTTON ── */
.sg-submit-btn{width:100%;justify-content:center;}

/* ── QR SECTION ── */
.sg-qr-body{display:flex;flex-direction:column;align-items:center;}
.sg-qr-empty{
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  padding:40px 20px;color:var(--sub);text-align:center;
}
.sg-qr-empty svg{width:72px;height:72px;stroke:var(--border);margin-bottom:12px;}
.sg-qr-empty p{font-size:13px;line-height:1.6;}
.sg-qr-img{
  max-width:220px;width:100%;border-radius:10px;
  border:2px solid var(--border);display:block;margin:0 auto 16px;
}

/* ── DEPOSIT META ── */
.sg-dep-meta{
  width:100%;background:#F9FAFB;border:1px solid var(--border);border-radius:8px;
  padding:10px 14px;margin-bottom:14px;
}
.sg-dep-row{
  display:flex;justify-content:space-between;align-items:center;
  font-size:12px;padding:4px 0;border-bottom:1px solid var(--border);
}
.sg-dep-row:last-child{border-bottom:none;}
.sg-dep-row span:first-child{color:var(--sub);}
.sg-dep-row b{color:var(--text);}

/* ── QR ACTIONS ── */
.sg-qr-actions{display:flex;gap:8px;width:100%;justify-content:center;flex-wrap:wrap;}
.sg-qr-actions .btn{flex:1;justify-content:center;min-width:0;}

/* ── CHECK CARD ── */
.sg-check-card{}
.sg-check-row{display:flex;gap:8px;align-items:center;}
.sg-check-row .form-input{flex:1;}
.sg-check-row .btn{flex-shrink:0;white-space:nowrap;}

/* ── RESPONSIVE ── */
@media(max-width:1100px){
  .fin-grid{grid-template-columns:repeat(2,1fr);}
  .fin-card{border-right:none;border-bottom:1px solid var(--border);}
  .fin-card:nth-child(odd){border-right:1px solid var(--border);}
  .fin-card:nth-child(3),.fin-card:nth-child(4){border-bottom:none;}
}
@media(max-width:1024px){
  .stat-grid{grid-template-columns:repeat(2,1fr);}
  .dash-grid{grid-template-columns:1fr;}
  .config-grid{grid-template-columns:1fr;}
  .restock-cols{grid-template-columns:1fr;}
  .sg-info-bar{grid-template-columns:1fr 1fr;}
}
@media(max-width:768px){
  #sidebar{
    position:fixed;left:0;top:0;height:100%;
    transform:translateX(-100%);
  }
  #sidebar.open{transform:translateX(0);}
  #sb-overlay.open{display:block;}
  #menu-btn{display:flex;}
  #main{width:100%;}
  #content{padding:10px;}
  .stat-grid{grid-template-columns:repeat(2,1fr);gap:8px;margin-bottom:12px;}
  .stat-card{padding:10px 12px;gap:10px;}
  .stat-icon{width:36px;height:36px;border-radius:8px;}
  .stat-icon svg{width:18px;height:18px;}
  .stat-val{font-size:17px;}
  .stat-label{font-size:10px;}
  .stat-sub{font-size:10px;}
  .form-row{grid-template-columns:1fr;}
  th,td{padding:8px 10px;font-size:12px;}
  .hide-mobile{display:none;}
  /* card header: allow wrapping on small screens */
  .card-header{flex-wrap:wrap;gap:8px;padding:12px 14px;}
  .card-title{font-size:13px;}
  /* toolbar: tighter */
  .toolbar{padding:10px 12px;gap:8px;}
  .tab-bar{padding:8px 12px;}
  /* pagination: tighter */
  .pagination{padding:10px;}
  .pg-btn{min-width:30px;height:30px;}
  /* modal: full screen on mobile */
  #modal-overlay{padding:0;}
  .modal{border-radius:0;max-height:100vh;height:100%;}
  .modal-lg{max-width:100%;}
  /* dash grid gap */
  .dash-grid{gap:10px;}
  /* card margin */
  .card{margin-bottom:10px;}

  /* ── FIN GRID MOBILE: 1 kolom, semua border-bottom kecuali terakhir ── */
  .fin-grid{grid-template-columns:1fr;}
  .fin-card{border-right:none;border-bottom:1px solid var(--border);}
  .fin-card:nth-child(odd){border-right:none;}
  .fin-card:nth-child(3),.fin-card:nth-child(4){border-bottom:1px solid var(--border);}
  .fin-card:last-child{border-bottom:none;}
  /* asset row value: smaller on mobile */
  .asset-row-val{font-size:13px;}
  /* os-grid: tetap 4 kolom di mobile */
  .os-grid{grid-template-columns:repeat(4,1fr);gap:5px;}
  .os-val{font-size:14px;}
  .os-label{font-size:9px;}
  /* rekap user rows */
  .rekap-user-row{font-size:11px;}

  /* ── RESTOCK MOBILE ── */
  .sg-info-bar{grid-template-columns:1fr;gap:8px;margin-bottom:12px;}
  .sg-info-card,.sg-refresh-card{padding:12px 14px;gap:10px;}
  .sg-quick-grid{grid-template-columns:repeat(4,1fr);gap:5px;}
  .sg-quick{font-size:11px;padding:6px 0;}
  .sg-qr-img{max-width:180px;}
  .sg-check-row{flex-direction:column;align-items:stretch;}
  .sg-check-row .btn{width:100%;justify-content:center;}
  .sg-qr-actions{flex-direction:column;}
  .sg-qr-actions .btn{width:100%;}

  /* ── Dashboard card-tables: transform rows into stacked cards ── */
  .dash-card-tbl thead{display:none;}
  .dash-card-tbl tbody tr{
    display:block;
    border:1px solid var(--border);border-radius:8px;
    margin:8px 12px;padding:8px 12px;
    background:var(--white);
  }
  .dash-card-tbl tbody tr:hover{background:var(--white);}
  .dash-card-tbl td{
    display:flex;align-items:center;justify-content:space-between;
    padding:5px 0;border-bottom:1px solid #F3F4F6;
    font-size:12px;
  }
  .dash-card-tbl td:last-child{border-bottom:none;padding-bottom:0;}
  .dash-card-tbl td::before{
    content:attr(data-label);
    font-size:10px;font-weight:700;color:var(--sub);
    text-transform:uppercase;letter-spacing:.04em;
    flex-shrink:0;margin-right:8px;
  }
  /* truncate long emails in card layout */
  .dash-card-tbl .td-truncate span{
    max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block;
  }
}
@media(max-width:480px){
  .stat-grid{grid-template-columns:1fr 1fr;}
  .topbar-right span{display:none;}
  #page-title{font-size:14px;}
  .stat-val{font-size:16px;}
  /* table: minimal padding */
  th,td{padding:6px 8px;}
  /* toolbar: stack search full-width */
  .toolbar{flex-direction:column;align-items:stretch;}
  .search-box{min-width:unset;}
  .filter-select{width:100%;}
  /* buttons in action column: smaller */
  .btn-sm{font-size:10px;padding:3px 7px;}
}

/* ═══════════════════════════════════════════════════════════════
   DATABASE MANAGEMENT & STORAGE MONITORING (MODERN UI)
   ═══════════════════════════════════════════════════════════════ */
.db-header-row{
  display:flex;align-items:center;justify-content:space-between;
  gap:16px;margin-bottom:18px;flex-wrap:wrap;
}
.db-header-title{font-size:18px;font-weight:700;color:var(--text);letter-spacing:-0.01em;}
.db-header-sub{font-size:12px;color:var(--sub);margin-top:3px;}
.db-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}

/* Hero Storage Card */
.db-storage-card{
  background:linear-gradient(135deg,#0F172A 0%,#1E293B 100%);
  border:1px solid rgba(255,255,255,0.08);
  border-radius:14px;padding:24px;color:#fff;
  box-shadow:0 10px 25px -5px rgba(15,23,42,0.15),0 8px 10px -6px rgba(15,23,42,0.1);
  margin-bottom:20px;position:relative;overflow:hidden;
}
.db-storage-card::before{
  content:'';position:absolute;top:0;right:0;width:240px;height:240px;
  background:radial-gradient(circle,rgba(59,130,246,0.15) 0%,rgba(59,130,246,0) 70%);
  pointer-events:none;
}
.db-card-top{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:20px;flex-wrap:wrap;}
.db-tag{
  display:inline-flex;align-items:center;gap:6px;
  font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:0.08em;
  color:#94A3B8;margin-bottom:8px;
}
.db-capacity-title{font-size:24px;font-weight:800;letter-spacing:-0.02em;color:#fff;line-height:1.2;}
.db-capacity-sub{font-size:13px;color:#94A3B8;margin-top:4px;}
.db-status-badge{
  display:inline-flex;align-items:center;gap:6px;
  font-size:11px;font-weight:700;padding:6px 12px;border-radius:50px;
  background:rgba(34,197,94,0.15);color:#4ADE80;border:1px solid rgba(34,197,94,0.3);
}
.db-status-badge.warning{background:rgba(245,158,11,0.15);color:#FBBF24;border-color:rgba(245,158,11,0.3);}
.db-status-badge.critical{background:rgba(239,68,68,0.15);color:#F87171;border-color:rgba(239,68,68,0.3);}
.db-server-chips{display:flex;align-items:center;gap:8px;margin-top:10px;flex-wrap:wrap;}
.db-chip{
  font-size:11px;padding:3px 9px;border-radius:6px;
  background:rgba(255,255,255,0.06);color:#CBD5E1;
  border:1px solid rgba(255,255,255,0.08);display:inline-flex;align-items:center;gap:5px;
}
.db-chip b{color:#fff;font-weight:600;}

/* Storage Progress Bar */
.db-progress-box{margin-bottom:20px;}
.db-progress-labels{display:flex;justify-content:space-between;font-size:12px;margin-bottom:8px;color:#94A3B8;}
.db-progress-labels b{color:#fff;}
.db-progress-track{
  height:12px;background:rgba(255,255,255,0.1);border-radius:6px;
  overflow:hidden;position:relative;display:flex;
}
.db-progress-fill{
  height:100%;border-radius:6px;transition:width 0.6s cubic-bezier(0.4,0,0.2,1);
  background:linear-gradient(90deg,#3B82F6 0%,#6366F1 100%);
}
.db-progress-fill.warning{background:linear-gradient(90deg,#F59E0B 0%,#D97706 100%);}
.db-progress-fill.critical{background:linear-gradient(90deg,#EF4444 0%,#B91C1C 100%);}
.db-progress-markers{
  display:flex;justify-content:space-between;font-size:10px;color:#64748B;margin-top:5px;padding:0 2px;
}

/* Hero Stats Row */
.db-stats-row{
  display:grid;grid-template-columns:repeat(4,1fr);gap:12px;
  border-top:1px solid rgba(255,255,255,0.08);padding-top:18px;
}
.db-hero-stat{padding:4px 0;}
.db-hero-stat-label{font-size:11px;color:#94A3B8;text-transform:uppercase;letter-spacing:0.04em;}
.db-hero-stat-val{font-size:15px;font-weight:700;color:#fff;margin-top:3px;}

/* Overview KPIs */
.db-kpi-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:20px;}

/* Collection breakdown table */
.db-col-name{display:flex;flex-direction:column;gap:2px;}
.db-col-title{font-weight:700;font-size:13px;color:var(--text);display:flex;align-items:center;gap:6px;}
.db-col-sub{font-size:11px;color:var(--sub);}
.db-col-tag{
  font-family:monospace;font-size:10px;padding:1px 6px;border-radius:4px;
  background:#F1F5F9;color:#475569;font-weight:600;
}
.db-mini-bar-wrap{display:flex;align-items:center;gap:8px;min-width:110px;}
.db-mini-bar{flex:1;height:6px;background:#F1F5F9;border-radius:3px;overflow:hidden;}
.db-mini-fill{height:100%;background:var(--blue);border-radius:3px;}
.db-mini-pct{font-size:11px;font-weight:700;color:var(--sub);width:36px;text-align:right;}

/* Maintenance Cards Grid */
.db-maint-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-top:14px;}
.db-maint-card{
  background:#F8FAFC;border:1px solid var(--border);border-radius:10px;
  padding:16px;display:flex;flex-direction:column;justify-content:space-between;
}
.db-maint-title{font-size:13px;font-weight:700;color:var(--text);margin-bottom:4px;}
.db-maint-desc{font-size:11px;color:var(--sub);line-height:1.5;margin-bottom:14px;flex:1;}

@media(max-width:1024px){
  .db-stats-row{grid-template-columns:repeat(2,1fr);gap:14px;}
  .db-kpi-grid{grid-template-columns:repeat(2,1fr);}
  .db-maint-grid{grid-template-columns:repeat(2,1fr);}
}
@media(max-width:640px){
  .db-stats-row{grid-template-columns:1fr 1fr;}
  .db-kpi-grid{grid-template-columns:1fr 1fr;}
  .db-maint-grid{grid-template-columns:1fr;}
  .db-capacity-title{font-size:19px;}
}

