/* Dashboard Owner JFR STUDIO — token warna mengikuti aplikasi kasir. */
@font-face {
  font-family: "Inter";
  src: local("Inter Variable"), local("Inter"), url("fonts/InterVariable.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap;
}

:root {
  color-scheme: light;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #F4F5F7;
  --surface: #FFFFFF;
  --line: #E3E6EA;
  --grid: #ECEEF1;
  --text: #14171C;
  --text-2: #4A5361;
  --muted: #6B7483;
  --accent: #FFC20E;
  --accent-soft: rgba(255, 194, 14, 0.18);
  --ink-on-accent: #1A1400;
  --bar: #1F242C;
  --bar-hover: #E0A800;
  --ok: #1A7F4B;
  --ok-soft: rgba(26, 127, 75, 0.12);
  --danger: #C62D1F;
  --danger-soft: rgba(198, 45, 31, 0.10);
  --warn: #8A5A00;
  --warn-soft: rgba(154, 100, 0, 0.12);
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0E1014;
    --surface: #171A20;
    --line: #262B33;
    --grid: #22262D;
    --text: #F1F3F6;
    --text-2: #B9C0CB;
    --muted: #8C95A3;
    --bar: #D5DAE1;
    --bar-hover: #FFC20E;
    --accent-soft: rgba(255, 194, 14, 0.14);
    --ok: #2BD46F;
    --ok-soft: rgba(43, 212, 111, 0.12);
    --danger: #FF6B5E;
    --danger-soft: rgba(255, 107, 94, 0.12);
    --warn: #F5B83D;
    --warn-soft: rgba(245, 184, 61, 0.12);
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 15px; line-height: 1.45;
  font-feature-settings: "cv05" 1, "cv08" 1;
}
h2 { font-size: 15px; font-weight: 600; margin: 0; }
button, input { font: inherit; color: inherit; }

.atas {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; background: var(--accent); color: var(--ink-on-accent);
}
.merek { display: flex; align-items: center; gap: 10px; }
.merek img { border-radius: 8px; background: #fff; padding: 3px; }
.merek-nama { font-weight: 700; letter-spacing: 0.06em; }
.merek-sub { font-size: 12px; opacity: 0.8; }
.sinkron {
  font-size: 12px; text-align: right; max-width: 52%;
  padding: 6px 10px; border-radius: 999px; background: rgba(0, 0, 0, 0.08);
}
.sinkron.basi { background: #1A1400; color: var(--accent); }

.filter {
  position: sticky; top: 0; z-index: 5;
  display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.chips::-webkit-scrollbar { display: none; }
.chips button {
  flex: none; border: 1px solid var(--line); background: var(--surface);
  padding: 6px 12px; border-radius: 999px; font-size: 13px; cursor: pointer;
}
.chips button[aria-pressed="true"] { background: var(--text); color: var(--surface); border-color: var(--text); }
.rentang { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
.rentang label { display: flex; gap: 6px; align-items: center; }
.rentang input {
  border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; background: var(--surface);
  font-size: 13px; min-width: 0;
}
.tombol-muat {
  border: 1px solid var(--line); background: var(--surface); border-radius: 8px;
  width: 34px; height: 32px; cursor: pointer; font-size: 16px;
}

main { max-width: 1100px; margin: 0 auto; padding: 16px; display: grid; gap: 14px; }
main[aria-busy="true"] .kartu, main[aria-busy="true"] .tiles { opacity: 0.55; transition: opacity .2s; }

.kartu {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); min-width: 0;
}
.kepala-kartu { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.kecil { font-size: 12px; color: var(--muted); }

.galat {
  background: var(--danger-soft); color: var(--danger); border-radius: var(--radius);
  padding: 12px 16px; font-weight: 600;
}

.hero-label { color: var(--text-2); font-size: 14px; }
.hero-angka { font-size: clamp(36px, 9vw, 52px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; margin: 4px 0 6px; }
.delta { font-size: 13px; color: var(--muted); }
.delta b { font-weight: 600; padding: 1px 6px; border-radius: 6px; margin-right: 4px; }
.delta .naik { color: var(--ok); background: var(--ok-soft); }
.delta .turun { color: var(--danger); background: var(--danger-soft); }
.delta .datar { color: var(--text-2); background: var(--grid); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.tile-label { font-size: 12px; color: var(--text-2); }
.tile-angka { font-size: 22px; font-weight: 600; margin-top: 2px; }
.tile .delta { margin-top: 4px; font-size: 12px; }

.grafik { position: relative; width: 100%; }
.grafik svg { display: block; width: 100%; height: auto; overflow: visible; }
.grafik .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.grafik .gridline { stroke: var(--grid); stroke-width: 1; }
.grafik .baseline { stroke: var(--line); stroke-width: 1; }
.grafik .bar { fill: var(--bar); }
.grafik .kena:hover + .bar, .grafik .kena:focus + .bar, .grafik .bar.aktif { fill: var(--bar-hover); }
.grafik .kena { fill: transparent; cursor: default; outline: none; }
.kosong { color: var(--muted); font-size: 14px; padding: 24px 0; text-align: center; }

.tabel-lipat { margin-top: 10px; font-size: 13px; }
.tabel-lipat summary { cursor: pointer; color: var(--text-2); }

.dua-kolom { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }

.batang-daftar { display: grid; gap: 12px; }
.bd-baris { display: grid; gap: 4px; }
.bd-atas { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.bd-atas span:last-child { font-variant-numeric: tabular-nums; color: var(--text-2); }
.bd-trek { height: 8px; border-radius: 999px; background: var(--grid); overflow: hidden; }
.bd-isi { height: 100%; border-radius: 999px; background: var(--bar); }

.gulung { overflow-x: auto; margin: 0 -4px; }
.tabel { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabel th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); padding: 6px 4px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tabel td { padding: 9px 4px; border-bottom: 1px solid var(--grid); vertical-align: top; }
.tabel tr:last-child td { border-bottom: 0; }
.tabel .ang { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabel .redup { color: var(--muted); font-size: 12px; }
.tabel tr.void td { color: var(--muted); }
.tabel tr.void .ang { text-decoration: line-through; }
.lencana { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 6px; }
.lencana.void { color: var(--danger); background: var(--danger-soft); }
.lencana.pas { color: var(--ok); background: var(--ok-soft); }
.lencana.lebih { color: var(--warn); background: var(--warn-soft); }
.lencana.kurang { color: var(--danger); background: var(--danger-soft); }

.kaki { font-size: 12px; color: var(--muted); text-align: center; padding: 8px 0 24px; }

.tip {
  position: fixed; z-index: 20; pointer-events: none;
  background: var(--text); color: var(--surface); border-radius: 8px; padding: 8px 10px;
  font-size: 12px; line-height: 1.4; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18); white-space: nowrap;
}
.tip b { font-size: 14px; }

@media (max-width: 560px) {
  .atas { padding: 12px 16px; }
  .rentang { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; }
  .rentang label { flex-direction: column; align-items: stretch; gap: 2px; font-size: 11px; min-width: 0; }
  .rentang input { width: 100%; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .tile-angka { font-size: 19px; }
  .sembunyi-hp { display: none; }
}
