/* ===== GDS Billing — tema indigo/cyan ===== */
:root {
  --bg: #0d1017;
  --panel: #151925;
  --panel-2: #1c2130;
  --line: #29303f;
  --ink: #e8eaf0;
  --ink-dim: #9aa2b4;
  --ink-mute: #6b7280;
  --accent: #4f46e5;
  --accent-2: #6366f1;
  --cyan: #06b6d4;
  --ok: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 6px 24px rgba(0,0,0,.4);
  --sidebar-w: 236px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2c3342; border-radius: 20px; }

/* LOGIN */
.login-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(900px 520px at 50% -10%, rgba(99,102,241,.30), transparent 60%),
    radial-gradient(760px 520px at 88% 112%, rgba(6,182,212,.20), transparent 55%),
    var(--bg); }
.login-card { position: relative; overflow: hidden; width: 100%; max-width: 400px;
  background: linear-gradient(180deg, #171c2b, var(--panel));
  border: 1px solid var(--line); border-radius: 18px; padding: 36px 32px 30px;
  box-shadow: 0 24px 64px rgba(0,0,0,.55); }
.login-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-2), var(--cyan), transparent); }
.login-head { text-align: center; margin-bottom: 26px; }
.login-head .logo-tile { width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 15px;
  background: linear-gradient(135deg, var(--accent-2), var(--cyan)); display: grid; place-items: center;
  box-shadow: 0 10px 26px rgba(79,70,229,.5), 0 0 0 6px rgba(99,102,241,.10); }
.login-head .logo-tile img { width: 28px; height: 28px; display: block; }
.login-head .title { font-size: 25px; font-weight: 800; letter-spacing: -.3px; }
.login-head .title .gds { background: linear-gradient(120deg, var(--accent-2), var(--cyan));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.login-head .sub { color: var(--ink-dim); font-size: 13px; margin-top: 8px; }

/* .brand — dipakai sidebar */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 22px; }
.brand .dot { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), var(--cyan)); display: grid; place-items: center; color: #fff; font-size: 16px; }
.brand .gds { color: var(--accent-2); }

/* SHELL */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100dvh; }
.sidebar { background: #10131c; border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; }
.sidebar .brand { padding: 20px 18px 14px; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 8px; overflow-y: auto; flex: 1; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--radius-sm); color: var(--ink-dim); text-decoration: none; font-weight: 600; font-size: 14px; }
.nav a .ic { width: 20px; text-align: center; font-size: 16px; }
.nav a:hover { background: var(--panel-2); color: var(--ink); }
.nav a.active { background: linear-gradient(90deg, rgba(79,70,229,.22), transparent); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.sidebar .foot { padding: 12px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-mute); }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 20; }
.topbar h1 { font-size: 17px; font-weight: 700; }
.topbar .spacer { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--panel-2); border: 1px solid var(--line); color: var(--ink-dim); }
.content { padding: 20px; flex: 1; }
.hamb { display: none; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; width: 38px; height: 38px; font-size: 18px; cursor: pointer; }

/* COMPONENTS */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card h2 { font-size: 15px; margin-bottom: 12px; }
.grid { display: grid; gap: 16px; }
.grid.kpi { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.kpi-tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.kpi-tile .lbl { color: var(--ink-dim); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.kpi-tile .val { font-size: 24px; font-weight: 800; margin-top: 6px; }
.kpi-tile .val.accent { color: var(--accent-2); }
.kpi-tile .val.warn { color: var(--warn); }
.kpi-tile .val.danger { color: var(--danger); }
.kpi-tile .val.ok { color: var(--ok); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); border-radius: var(--radius-sm); padding: 10px 16px; font-weight: 700; font-size: 14px; transition: .12s; user-select: none; }
.btn:hover { border-color: #3a4258; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, var(--accent-2), var(--accent)); border-color: transparent; color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.ok { background: var(--ok); border-color: transparent; color: #06210f; }
.btn.danger { background: var(--danger); border-color: transparent; color: #fff; }
.btn.sm { padding: 6px 11px; font-size: 13px; }
.btn.block { width: 100%; }
.btn.lg { padding: 15px 20px; font-size: 16px; }

label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 12px; color: var(--ink-dim); font-weight: 600; margin-bottom: 6px; }
.input { width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px; transition: border-color .12s, box-shadow .12s; }
.input::placeholder { color: var(--ink-mute); }
.input:focus { outline: none; border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(99,102,241,.18); }
/* Cegah autofill Chrome menimpa field jadi putih */
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus, input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--ink); caret-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px var(--panel-2) inset;
  transition: background-color 9999s ease-in-out 0s; }
select.input { cursor: pointer; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* preset item (chip) */
.preset-group { margin-bottom: 12px; }
.preset-group .lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-mute); font-weight: 700; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-add { display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; transition: .12s; }
.chip-add:hover { border-color: var(--accent-2); background: #212a3d; transform: translateY(-1px); }
.chip-add .d { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.chip-add .d.sekali { background: var(--danger); box-shadow: 0 0 0 3px rgba(239,68,68,.15); }
.chip-add .d.tahunan { background: var(--cyan); box-shadow: 0 0 0 3px rgba(6,182,212,.15); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { color: var(--ink-dim); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; font-weight: 700; }
td.r, th.r { text-align: right; }
.table-wrap { overflow-x: auto; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--panel-2); }

.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.b-aktif, .b-lunas { background: rgba(34,197,94,.16); color: var(--ok); }
.b-suspend, .b-jatuh_tempo, .b-overdue { background: rgba(239,68,68,.16); color: var(--danger); }
.b-draft, .b-nonaktif, .b-destroyed, .b-batal { background: rgba(107,114,128,.2); color: var(--ink-mute); }
.b-terkirim { background: rgba(79,70,229,.18); color: var(--accent-2); }
.b-pengajuan { background: rgba(245,158,11,.16); color: var(--warn); }
.b-disetujui { background: rgba(79,70,229,.18); color: var(--accent-2); }
.b-warn { background: rgba(245,158,11,.16); color: var(--warn); }

.muted { color: var(--ink-dim); }
.section-title { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; flex-wrap: wrap; }
.section-title h2 { font-size: 18px; }
.section-title .spacer { flex: 1; }
.empty { text-align: center; color: var(--ink-mute); padding: 40px 20px; }
.total-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 14px; }
.total-row.big { font-size: 18px; font-weight: 800; }
.total-row.big .amt { color: var(--accent-2); }

/* MODAL */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; z-index: 100; padding: 20px; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; width: 100%; max-width: 460px; box-shadow: var(--shadow); max-height: 90dvh; overflow-y: auto; }
.modal .mhd { padding: 18px 20px; border-bottom: 1px solid var(--line); font-weight: 800; font-size: 17px; }
.modal .mbd { padding: 20px; }
.modal .mft { padding: 16px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* TOAST */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 200; background: #222836; color: #fff; padding: 12px 20px; border-radius: 10px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow); max-width: 90vw; }
.toast.err { background: var(--danger); }
.toast.ok { background: var(--ok); color: #06210f; }

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 50; width: 260px; left: -280px; transition: left .2s; box-shadow: var(--shadow); }
  .sidebar.open { left: 0; }
  .hamb { display: inline-flex; align-items: center; justify-content: center; }
  .row2 { grid-template-columns: 1fr; }
}
