@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=DM+Mono:wght@400;500&display=swap');

:root {
  --blue-950: #0A1628;
  --blue-900: #0D1E3A;
  --blue-800: #1A3A6B;
  --blue-700: #1D4ED8;
  --blue-600: #2563EB;
  --blue-500: #3B82F6;
  --blue-400: #60A5FA;
  --blue-300: #93C5FD;
  --blue-200: #BFDBFE;
  --blue-100: #DBEAFE;
  --blue-50:  #EFF6FF;
  --gray-50:  #F8FAFC;
  --gray-100: #F1F5F9;
  --gray-200: #E2E8F0;
  --gray-300: #CBD5E1;
  --gray-400: #94A3B8;
  --gray-500: #64748B;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1E293B;
  --gray-900: #0F172A;
  --green-500: #10B981;
  --green-100: #D1FAE5;
  --red-500: #EF4444;
  --red-100: #FEE2E2;
  --orange-500: #F59E0B;
  --orange-100: #FEF3C7;
  --purple-500: #8B5CF6;
  --purple-100: #EDE9FE;
  --teal-500: #14B8A6;
  --teal-100: #CCFBF1;
  --font: 'Plus Jakarta Sans', sans-serif;
  --mono: 'DM Mono', monospace;
  --sidebar-w: 220px;
  --topbar-h: 60px;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
}

* { margin:0; padding:0; box-sizing:border-box; }
body { font-family: var(--font); background: #E8EDF5; color: var(--gray-800); }

/* ===================== APP SHELL ===================== */
.app-shell {
  display: flex;
  height: 100vh;
  min-height: 700px;
}
.sidebar {
  width: var(--sidebar-w);
  background: var(--blue-950);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 50;
}
.sb-header {
  padding: 18px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sb-logo {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: var(--blue-600);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.sb-brand .name { font-size: 13px; font-weight: 700; color: #fff; line-height: 1; }
.sb-brand .role { font-size: 10px; color: var(--blue-400); margin-top: 2px; }
.sb-nav { flex: 1; padding: 10px 0; overflow-y: auto; }
.sb-section {
  font-size: 9px; font-weight: 700;
  color: rgba(148,163,184,0.4);
  letter-spacing: 0.08em;
  padding: 10px 16px 4px;
  text-transform: uppercase;
}
.sb-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 12px; color: rgba(255,255,255,0.55);
  font-weight: 500;
  transition: all 0.12s;
  border-left: 3px solid transparent;
  text-decoration: none;
}
.sb-item:hover { color: rgba(255,255,255,0.85); background: rgba(255,255,255,0.04); }
.sb-item.active { color: #fff; background: rgba(59,130,246,0.15); border-left-color: var(--blue-500); }
.sb-item .icon { font-size: 15px; width: 20px; text-align: center; }
.sb-item .badge {
  margin-left: auto;
  background: var(--red-500); color: #fff;
  font-size: 9px; font-weight: 700;
  padding: 2px 6px; border-radius: 10px;
}
.sb-footer {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.sb-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  background: rgba(255,255,255,0.05);
  cursor: pointer;
}
.sb-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--blue-600);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.sb-user-info .n { font-size: 12px; font-weight: 600; color: #fff; line-height: 1; }
.sb-user-info .e { font-size: 10px; color: var(--blue-400); margin-top: 2px; }

/* MAIN */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; margin-left: var(--sidebar-w); }
.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center;
  padding: 0 24px; gap: 16px;
  flex-shrink: 0;
  position: sticky; top: 0; z-index: 40;
}
.topbar .title { font-size: 17px; font-weight: 800; color: var(--gray-900); letter-spacing: -0.02em; }
.topbar .breadcrumb { font-size: 11px; color: var(--gray-400); margin-top: 1px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--gray-50);
  border: 1.5px solid var(--gray-100);
  border-radius: 8px;
  font-size: 12px; color: var(--gray-400);
  cursor: text;
}
.icon-btn {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--gray-50);
  border: 1.5px solid var(--gray-100);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 16px; position: relative;
}
.icon-btn .notif-dot {
  position: absolute; top: 4px; right: 4px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--red-500);
  border: 2px solid #fff;
}
.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 8px;
  background: var(--gray-50);
  border: 1.5px solid var(--gray-100);
  cursor: pointer;
}
.user-chip .av {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: var(--blue-600);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
}
.user-chip .un { font-size: 12px; font-weight: 600; color: var(--gray-700); }
.content { flex: 1; overflow-y: auto; padding: 24px; }

/* ===================== CARDS ===================== */
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 14px; font-weight: 700; color: var(--gray-800); }
.card-sub { font-size: 11px; color: var(--gray-400); margin-top: 2px; }
.card-body { padding: 20px; }

/* STAT CARDS */
.stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 20px; }
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  position: relative; overflow: hidden;
}
.stat-card .accent-bar { position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.stat-card .stat-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin-bottom: 12px;
}
.stat-card .stat-label {
  font-size: 11px; font-weight: 600;
  color: var(--gray-400);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.stat-card .stat-val { font-size: 20px; font-weight: 800; color: var(--gray-900); letter-spacing: -0.02em; margin-bottom: 6px; }
.stat-card .stat-change { font-size: 11px; font-weight: 600; }
.stat-card .stat-change.up { color: var(--green-500); }
.stat-card .stat-change.down { color: var(--red-500); }

/* GRID */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.grid-3 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 20px; }

/* TABLE */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  font-size: 10px; font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 10px 16px; text-align: left;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
}
.data-table td {
  font-size: 13px; color: var(--gray-700);
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-50);
}
.data-table tr:hover td { background: var(--blue-50); }

/* BADGES */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.02em;
}
.badge.green { background: var(--green-100); color: #059669; }
.badge.red { background: var(--red-100); color: var(--red-500); }
.badge.orange { background: var(--orange-100); color: #D97706; }
.badge.blue { background: var(--blue-100); color: var(--blue-700); }
.badge.purple { background: var(--purple-100); color: var(--purple-500); }
.badge.teal { background: var(--teal-100); color: var(--teal-500); }
.badge.gray { background: var(--gray-100); color: var(--gray-500); }

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px;
  font-family: var(--font); font-size: 12px; font-weight: 600;
  border: none; cursor: pointer; transition: all 0.15s;
  text-decoration: none;
}
.btn-primary { background: var(--blue-600); color: #fff; }
.btn-primary:hover { background: var(--blue-700); color: #fff; }
.btn-ghost { background: transparent; color: var(--gray-600); border: 1.5px solid var(--gray-200); }
.btn-ghost:hover { background: var(--gray-50); }
.btn-danger { background: var(--red-100); color: var(--red-500); }
.btn-danger:hover { background: var(--red-500); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 11px; }

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

/* CHART BAR */
.chart-bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding: 10px 0; }
.bar-group { display: flex; gap: 2px; align-items: flex-end; flex: 1; }
.bar { border-radius: 4px 4px 0 0; width: 16px; transition: opacity 0.2s; }
.bar:hover { opacity: 0.75; }
.chart-labels { display: flex; gap: 6px; margin-top: 6px; }
.chart-label { flex: 1; text-align: center; font-size: 10px; color: var(--gray-400); }

/* FORM FIELDS */
.form-field { margin-bottom: 16px; }
.form-field label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--gray-600); margin-bottom: 6px; letter-spacing: 0.02em;
}
.form-field input,
.form-field select,
.form-control {
  width: 100%; padding: 10px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  font-family: var(--font); font-size: 13px;
  color: var(--gray-700); background: var(--gray-50);
  outline: none; transition: border-color 0.15s;
}
.form-field input:focus,
.form-field select:focus,
.form-control:focus {
  border-color: var(--blue-500);
  background: #fff;
}
.nominal-presets { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.preset-btn {
  padding: 6px 14px; border-radius: 6px;
  font-size: 12px; font-weight: 600;
  background: var(--blue-50); color: var(--blue-700);
  border: 1.5px solid var(--blue-100); cursor: pointer;
}
.preset-btn:hover { background: var(--blue-100); }

/* REPORT */
.report-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-bottom: 20px; }
.report-sum-card {
  background: #fff; border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); text-align: center;
}
.report-sum-card .label { font-size: 11px; color: var(--gray-400); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.report-sum-card .val { font-size: 24px; font-weight: 800; color: var(--gray-900); margin: 6px 0; }
.report-filter { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
.select-sm {
  padding: 8px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  font-size: 12px; font-family: var(--font);
  color: var(--gray-600); background: #fff; outline: none;
}

/* PROGRESS */
.progress { background: var(--gray-100); border-radius: 4px; height: 6px; overflow: hidden; }
.progress-bar { height: 6px; border-radius: 4px; background: var(--blue-600); }

/* NOTIF */
.notif-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--gray-100); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 6px; }
.notif-item .msg { font-size: 13px; color: var(--gray-700); line-height: 1.5; }
.notif-item .time { font-size: 11px; color: var(--gray-400); margin-top: 4px; }

/* SETTINGS */
.settings-grid { display: grid; grid-template-columns: 240px 1fr; gap: 20px; }
.settings-nav { background: #fff; border-radius: var(--radius); padding: 8px; box-shadow: var(--shadow); }
.settings-nav-item { padding: 10px 14px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--gray-600); cursor: pointer; }
.settings-nav-item.active { background: var(--blue-50); color: var(--blue-700); font-weight: 700; }
.settings-section { background: #fff; border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.settings-section h3 { font-size: 15px; font-weight: 700; color: var(--gray-800); margin-bottom: 4px; }
.settings-section .desc { font-size: 13px; color: var(--gray-400); margin-bottom: 24px; }
.setting-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0; border-bottom: 1px solid var(--gray-100);
}
.toggle {
  width: 40px; height: 22px;
  border-radius: 11px;
  background: var(--blue-600);
  position: relative; cursor: pointer; flex-shrink: 0;
}
.toggle::after {
  content: ''; position: absolute;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; top: 3px; right: 3px;
  transition: right 0.2s;
}
.toggle.off { background: var(--gray-200); }
.toggle.off::after { right: 21px; }

/* LOGIN */
.login-wrap { min-height: 100vh; display: flex; }
.login-left {
  width: 480px; min-height: 100%;
  background: linear-gradient(160deg, var(--blue-800) 0%, var(--blue-950) 100%);
  display: flex; flex-direction: column;
  justify-content: center; padding: 60px 56px;
  position: relative; overflow: hidden;
}
.login-left::before {
  content: ''; position: absolute;
  width: 400px; height: 400px; border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,0.25) 0%, transparent 70%);
  top: -120px; left: -100px;
}
.login-left::after {
  content: ''; position: absolute;
  width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, rgba(37,99,235,0.20) 0%, transparent 70%);
  bottom: -100px; right: -60px;
}
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 48px; position: relative; z-index: 1; }
.login-logo .icon { width: 44px; height: 44px; background: var(--blue-600); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.login-logo .name { font-size: 18px; font-weight: 800; color: #fff; letter-spacing: -0.02em; }
.login-left h1 { font-size: 30px; font-weight: 800; color: #fff; line-height: 1.2; margin-bottom: 14px; position: relative; z-index: 1; }
.login-left p { font-size: 14px; color: var(--blue-300); line-height: 1.7; margin-bottom: 40px; position: relative; z-index: 1; }
.feat-list { list-style: none; display: flex; flex-direction: column; gap: 12px; position: relative; z-index: 1; }
.feat-list li { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--blue-200); }
.feat-list li::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--blue-400); flex-shrink: 0; }
.login-right {
  flex: 1; background: #fff;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 60px 72px;
}
.login-right h2 { font-size: 26px; font-weight: 800; color: var(--gray-900); margin-bottom: 6px; letter-spacing: -0.02em; }
.login-right .sub { font-size: 14px; color: var(--gray-400); margin-bottom: 32px; }
.role-tabs { display: flex; gap: 6px; margin-bottom: 28px; }
.role-tab {
  padding: 8px 16px; border-radius: 8px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  border: 1.5px solid var(--gray-200);
  background: #fff; color: var(--gray-500);
  font-family: var(--font); transition: all 0.15s;
}
.role-tab.active { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }
.form-group { width: 100%; margin-bottom: 18px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--gray-600); margin-bottom: 6px; letter-spacing: 0.02em; }
.form-group input {
  width: 100%; padding: 12px 14px; border-radius: 9px;
  border: 1.5px solid var(--gray-200);
  font-family: var(--font); font-size: 14px; color: var(--gray-700);
  background: var(--gray-50); outline: none; transition: border-color 0.15s;
}
.form-group input:focus { border-color: var(--blue-500); background: #fff; }
.login-btn {
  width: 100%; padding: 14px; border-radius: 10px;
  background: var(--blue-600); color: #fff;
  font-family: var(--font); font-size: 15px; font-weight: 700;
  border: none; cursor: pointer; letter-spacing: -0.01em;
  transition: background 0.15s;
}
.login-btn:hover { background: var(--blue-700); }
.login-form { width: 100%; max-width: 400px; }

/* TOPUP GRID */
.topup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* SCROLLBAR */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 2px; }

/* ALERTS */
.alert { padding: 12px 16px; border-radius: 10px; font-size: 13px; margin-bottom: 16px; }
.alert-success { background: var(--green-100); color: #059669; }
.alert-error { background: var(--red-100); color: var(--red-500); }
.alert-warning { background: var(--orange-100); color: #D97706; }
