/* ==========================================================================
   GCO — GapaiCita Commerce OS
   Palet diekstrak dari referensi desain: navy #002a54 · putih · cyan #88d8e7
   ========================================================================== */

:root {
  --navy:        #002a54;
  --navy-900:    #011c3a;
  --navy-800:    #012243;
  --navy-700:    #01254b;
  --navy-600:    #033358;
  --teal:        #237699;
  --cyan:        #88d8e7;
  --cyan-soft:   #d9f2f7;
  --gold:        #ffcf50;
  --gold-soft:   #f0e0be;
  --white:       #ffffff;
  --bg:          #f6f7f8;
  --line:        #e6eaee;
  --ink:         #0d1b2a;
  --ink-2:       #4a5b6d;
  --ink-3:       #8595a6;
  --ok:          #12805c;
  --ok-soft:     #dcf5ec;
  --warn:        #b26a00;
  --warn-soft:   #fff2d6;
  --bad:         #b42318;
  --bad-soft:    #fde8e6;
  --radius:      14px;
  --radius-sm:   10px;
  --shadow:      0 1px 2px rgba(0,42,84,.06), 0 8px 24px -12px rgba(0,42,84,.18);
  --font:        'Plus Jakarta Sans', 'Inter', -apple-system, 'Segoe UI', Roboto,
                 'Liberation Sans', sans-serif;
  --mono:        'JetBrains Mono', ui-monospace, 'DejaVu Sans Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ── Kerangka ───────────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }

/* ── Sidebar ────────────────────────────────────────────────────────────── */
.sidebar {
  background: var(--navy);
  color: #cfe0ee;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 0 6px 22px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(140deg, var(--cyan), var(--teal));
  display: grid; place-items: center;
  color: var(--navy); font-weight: 800; font-size: 16px;
  box-shadow: 0 4px 14px -4px rgba(136,216,231,.6);
  flex-shrink: 0;
}
.brand-text strong { color: #fff; font-size: 15px; display: block; letter-spacing: -.2px; }
.brand-text span { font-size: 10.5px; color: #7fa3c0; letter-spacing: .5px; text-transform: uppercase; }

.nav-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .9px;
  color: #6b8dad; padding: 16px 10px 7px; font-weight: 700;
}

.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: var(--radius-sm);
  color: #b9cfe2; text-decoration: none; font-size: 13.5px;
  transition: background .16s, color .16s;
}
.nav a svg { width: 17px; height: 17px; stroke-width: 1.8; flex-shrink: 0; opacity: .85; }
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.active {
  background: rgba(136,216,231,.15);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--cyan);
}
.nav a.active svg { opacity: 1; color: var(--cyan); }
.nav .badge-count {
  margin-left: auto; background: var(--gold); color: var(--navy);
  font-size: 10.5px; font-weight: 800; padding: 1px 7px; border-radius: 20px;
}

.sidebar-foot {
  margin-top: auto; padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.09);
  display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--gold); color: var(--navy);
  display: grid; place-items: center; font-weight: 800; font-size: 13px;
  flex-shrink: 0;
}
.sidebar-foot small { display: block; color: #7fa3c0; font-size: 10.5px; }
.sidebar-foot b { color: #fff; font-size: 12.5px; font-weight: 600; }

/* ── Area utama ─────────────────────────────────────────────────────────── */
.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  padding: 0 26px;
  height: 62px;
  display: flex; align-items: center; gap: 16px;
  position: sticky; top: 0; z-index: 20;
}
.crumb { font-size: 12px; color: var(--ink-3); }
.crumb b { color: var(--ink); font-weight: 600; }
.crumb i { font-style: normal; margin: 0 6px; opacity: .5; }

.topbar-spacer { flex: 1; }

.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 9px; padding: 7px 12px; width: 260px;
}
.search svg { width: 15px; height: 15px; color: var(--ink-3); }
.search input { border: 0; background: none; outline: none; font: inherit; font-size: 13px; width: 100%; color: var(--ink); }
.search input::placeholder { color: var(--ink-3); }

.icon-btn {
  width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--white); display: grid; place-items: center;
  cursor: pointer; color: var(--ink-2); position: relative;
}
.icon-btn:hover { background: var(--bg); }
.icon-btn .dot {
  position: absolute; top: 7px; right: 8px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--bad); border: 1.5px solid #fff;
}

.content { padding: 24px 26px 48px; }

/* ── Kepala halaman ─────────────────────────────────────────────────────── */
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.page-head h1 { font-size: 21px; font-weight: 700; letter-spacing: -.4px; }
.page-head p { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.page-head .actions { margin-left: auto; display: flex; gap: 9px; }

/* ── Tombol ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px; border-radius: 9px; border: 1px solid transparent;
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  text-decoration: none; white-space: nowrap; transition: filter .15s, background .15s;
}
.btn svg { width: 15px; height: 15px; stroke-width: 2; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { filter: brightness(1.18); }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { filter: brightness(1.06); }
.btn-ghost { background: var(--white); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--bg); }
.btn-sm { padding: 6px 11px; font-size: 12px; }

/* ── Kartu statistik ────────────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }

.stat {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 17px 18px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat::after {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: var(--cyan); opacity: 0;
}
.stat.is-gold::after  { background: var(--gold);  opacity: 1; }
.stat.is-cyan::after  { background: var(--cyan);  opacity: 1; }
.stat.is-ok::after    { background: var(--ok);    opacity: 1; }
.stat.is-warn::after  { background: var(--warn);  opacity: 1; }

.stat-top { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.stat-ico {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--cyan-soft); color: var(--teal); flex-shrink: 0;
}
.stat-ico svg { width: 16px; height: 16px; stroke-width: 2; }
.stat.is-gold .stat-ico { background: #fff4d6; color: #a97a00; }
.stat.is-ok   .stat-ico { background: var(--ok-soft); color: var(--ok); }
.stat.is-warn .stat-ico { background: var(--warn-soft); color: var(--warn); }
.stat-label { font-size: 12px; color: var(--ink-2); font-weight: 500; }
.stat-value { font-size: 22px; font-weight: 700; letter-spacing: -.7px; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }

/* ── Kartu panel ────────────────────────────────────────────────────────── */
.panel {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; margin-bottom: 16px;
}
.panel-head {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 18px; border-bottom: 1px solid var(--line);
}
.panel-head h2 { font-size: 14.5px; font-weight: 700; letter-spacing: -.2px; }
.panel-head p { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.panel-head .actions { margin-left: auto; display: flex; gap: 8px; }
.panel-body { padding: 18px; }
.panel-body.flush { padding: 0; }

/* ── Tabel ──────────────────────────────────────────────────────────────── */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl thead th {
  text-align: left; padding: 11px 18px; background: #fafbfc;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .7px;
  color: var(--ink-3); font-weight: 700; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.tbl tbody td { padding: 12px 18px; border-bottom: 1px solid #f0f3f5; vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: #fbfcfd; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .mono { font-family: var(--mono); font-size: 12.5px; }
.tbl .strong { font-weight: 600; }

.kode-pill {
  display: inline-block; font-family: var(--mono); font-size: 12px; font-weight: 700;
  background: #fff4d6; color: #8a6200; padding: 2px 8px; border-radius: 6px;
  border: 1px solid #f3dfa8;
}

/* ── Lencana status ─────────────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 20px;
  white-space: nowrap;
}
.pill::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill-ok   { background: var(--ok-soft);   color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-bad  { background: var(--bad-soft);  color: var(--bad); }
.pill-info { background: var(--cyan-soft); color: var(--teal); }
.pill-mute { background: #eef1f4; color: var(--ink-2); }

/* ── Kotak info ─────────────────────────────────────────────────────────── */
.note {
  display: flex; gap: 11px; padding: 13px 15px; border-radius: var(--radius-sm);
  background: var(--cyan-soft); border: 1px solid #bfe6ef; color: #0d4d5e;
  font-size: 12.5px; line-height: 1.6;
}
.note svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 1px; stroke-width: 2; }
.note.is-warn { background: var(--warn-soft); border-color: #f3dfa8; color: #7a4a00; }
.note b { font-weight: 700; }

/* ── Kotak rekening transfer ────────────────────────────────────────────── */
.rek {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-600) 100%);
  border-radius: var(--radius); padding: 20px; color: #fff;
  position: relative; overflow: hidden;
}
.rek::after {
  content: ''; position: absolute; width: 190px; height: 190px; border-radius: 50%;
  background: radial-gradient(circle, rgba(136,216,231,.28), transparent 68%);
  top: -70px; right: -50px;
}
.rek-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--cyan); font-weight: 700; }
.rek-bank { font-size: 13px; color: #b9cfe2; margin-top: 9px; }
.rek-nomor { font-family: var(--mono); font-size: 23px; font-weight: 700; letter-spacing: 1.2px; margin: 3px 0 2px; }
.rek-atas { font-size: 12.5px; color: #b9cfe2; }
.rek-total {
  margin-top: 16px; padding-top: 15px; border-top: 1px solid rgba(255,255,255,.16);
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
}
.rek-total small { font-size: 11px; color: #9dbdd8; display: block; }
.rek-total strong { font-size: 26px; font-weight: 800; letter-spacing: -.8px; color: var(--gold); }
.rek-total .kode { text-align: right; }
.rek-total .kode b {
  display: block; font-family: var(--mono); font-size: 19px; color: var(--cyan); font-weight: 700;
}

/* ── Dua kolom ──────────────────────────────────────────────────────────── */
.cols { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; align-items: start; }

/* ── Baris rincian ──────────────────────────────────────────────────────── */
.rows { font-size: 13px; }
.rows > div {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 9px 0; border-bottom: 1px dashed #eef1f4;
}
.rows > div:last-child { border-bottom: 0; }
.rows span { color: var(--ink-2); }
.rows b { font-variant-numeric: tabular-nums; font-weight: 600; }
.rows .total { border-top: 2px solid var(--navy); border-bottom: 0; margin-top: 5px; padding-top: 11px; font-size: 15px; }
.rows .total b { font-weight: 800; color: var(--navy); }

/* ── Kosong ─────────────────────────────────────────────────────────────── */
.empty { text-align: center; padding: 46px 20px; color: var(--ink-3); }
.empty svg { width: 38px; height: 38px; stroke-width: 1.4; margin-bottom: 10px; opacity: .45; }
.empty b { display: block; color: var(--ink-2); font-size: 13.5px; margin-bottom: 3px; }
.empty span { font-size: 12.5px; }

/* ── Formulir ───────────────────────────────────────────────────────────── */
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.field input, .field select {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px;
  font: inherit; font-size: 13px; background: var(--white); color: var(--ink); outline: none;
}
.field input:focus, .field select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(35,118,153,.12); }

/* ── Responsif ──────────────────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .cols  { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static; height: auto; flex-direction: row; align-items: center;
    padding: 12px 14px; gap: 14px; overflow-x: auto;
  }
  .brand { padding: 0; }
  .brand-text { display: none; }
  .nav { display: flex; gap: 4px; }
  .nav-label, .sidebar-foot { display: none; }
  .nav a span { display: none; }
  .nav a { padding: 9px; }
  .topbar { padding: 0 16px; height: 56px; }
  .search { display: none; }
  .content { padding: 16px; min-width: 0; }
  .page-head { flex-wrap: wrap; }
  .page-head .actions { margin-left: 0; width: 100%; flex-wrap: wrap; }
  .page-head .actions > * { min-width: 0; }
  .page-head .actions form { flex-wrap: wrap; }
  .panel-head { flex-wrap: wrap; }
  .panel-head .actions { margin-left: 0; width: 100%; flex-wrap: wrap; }
  .tbl { font-size: 12px; }
  .tbl thead th, .tbl tbody td { padding: 9px 12px; }
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-scroll .tbl { min-width: 620px; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr; }
  .stat-value { font-size: 20px; }
}
