/* Design tokens diambil dari dev-order.gps.id */
:root {
  --navy: #114A9F;          /* biru utama GPS.id (tombol, aksen) */
  --navy-2: #1448A0;
  --navy-deep: #0D3D87;
  --sky: #44A3DB;           /* biru muda GPS.id (gradien, highlight) */
  --ink: #0B1426;           /* teks utama / section gelap */
  --ink-2: #1E3A5F;
  --muted: #64748B;
  --muted-2: #94A3B8;
  --bg: #F4F5F7;
  --bg-soft: #F4F6FA;
  --card: #FFFFFF;
  --border: #E5E7EB;
  --border-soft: #EEF0F4;
  --tint: #EEF3FC;
  --success: #15803D;
  --success-bg: #DCFCE7;
  --warning: #B45309;
  --warning-bg: #FEF3C7;
  --danger: #DC2626;
  --danger-bg: #FEE2E2;
  --info-bg: #EEF3FC;
  --c-google: #1A5EC7;
  --c-meta: #8B5CF6;
  --c-shopee: #EE4D2D;
  --c-tiktok: #00AA5B;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-btn: 0 10px 30px -10px rgba(20, 72, 160, .7);
  --shadow-card: 0 1px 2px rgba(11, 20, 38, .04), 0 8px 24px -12px rgba(11, 20, 38, .12);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Inter Tight", "Inter", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; font-size: 15px; line-height: 1.5; }
img { max-width: 100%; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* Header (sticky, blur, seperti dev-order.gps.id) */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.82); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border-bottom: 1px solid var(--border-soft); }
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 64px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand-logo { height: 40px; width: auto; max-width: 100%; object-fit: contain; display: block; }
.brand-divider { width: 1px; height: 24px; background: var(--border); }
.brand-title { font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; justify-content: center; }
.tab { border: 0; background: transparent; color: #475569; font: 500 14px var(--font); padding: 8px 12px; border-radius: 999px; cursor: pointer; transition: background .15s, color .15s; white-space: nowrap; }
.tab:hover { background: #F1F5F9; color: var(--ink); }
.tab.active { background: #EEF0F4; color: var(--ink); font-weight: 600; }
.tab .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.header-meta { display: table; margin: 14px auto 0; font-size: 12px; color: var(--muted); background: #fff; border: 1px solid var(--border-soft); border-radius: 999px; padding: 5px 12px; }
.header-meta b { color: var(--navy); }

/* Hero */
.hero { position: relative; overflow: hidden; padding: 40px 0 28px; text-align: center; background: radial-gradient(60% 120% at 50% 0%, #E3ECFB 0%, rgba(244,245,247,0) 70%); }
.eyebrow { margin: 0 0 8px; color: var(--navy); font: 600 12px var(--font); letter-spacing: .1em; text-transform: uppercase; }
.hero-title { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: clamp(30px, 5vw, 52px); letter-spacing: -.035em; line-height: 1.05; color: var(--ink); }
.grad { background: linear-gradient(90deg, var(--navy) 0%, var(--sky) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { margin: 12px auto 0; max-width: 720px; color: var(--muted); font-size: 16px; }

/* Section & card */
main { padding-bottom: 48px; }
.section { background: var(--card); border: 1px solid var(--border-soft); border-radius: var(--radius-xl); padding: 24px; margin-top: 20px; box-shadow: var(--shadow-card); }
.section.tinted { background: linear-gradient(160deg, #E9F0FC, #F7F9FD 60%); }
.section.dark { background: radial-gradient(80% 120% at 80% 100%, #1A4E9A 0%, var(--ink) 60%); color: #fff; border-color: transparent; }
.section.dark .sec-caption, .section.dark p { color: #CBD5E1; }
.sec-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.sec-title { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -.02em; line-height: 1.2; }
.sec-title .soft { color: var(--muted-2); }
.sec-caption { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.sub-title { margin: 0 0 12px; font: 600 15px var(--font-display); }
details.section > summary { cursor: pointer; list-style: none; }
details.section > summary::-webkit-details-marker { display: none; }
details.section > summary .sec-title::after { content: "  ▾"; color: var(--muted-2); font-size: 16px; }
details.section:not([open]) > summary .sec-head { margin-bottom: 0; }
p { margin: 12px 0 0; }
.lead { margin: 0 0 16px; font-size: 15px; color: #334155; }

/* Grid */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.panel { border: 1px solid var(--border-soft); border-radius: var(--radius-lg); padding: 18px; background: #fff; min-width: 0; }
.mt { margin-top: 16px; }

/* KPI cards */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.kpi { border: 1px solid var(--border-soft); border-radius: var(--radius-lg); padding: 16px 18px; background: linear-gradient(180deg, #fff, var(--bg-soft)); position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent, var(--navy)); }
.kpi.hero-kpi { background: linear-gradient(135deg, var(--navy) 0%, #1A5EC7 60%, var(--sky) 140%); color: #fff; border-color: transparent; box-shadow: var(--shadow-btn); }
.kpi.hero-kpi::before { display: none; }
.kpi.hero-kpi .kpi-label, .kpi.hero-kpi .kpi-detail { color: rgba(255,255,255,.82); }
.kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi-value { font-family: var(--font-display); font-weight: 800; font-size: 26px; letter-spacing: -.02em; margin-top: 4px; line-height: 1.15; word-break: break-word; }
.kpi-detail { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.kpi-detail.success, .tone-success { color: var(--success); font-weight: 600; }
.kpi-detail.danger, .tone-danger { color: var(--danger); font-weight: 600; }
.kpi-detail.warning, .tone-warning { color: var(--warning); font-weight: 600; }

/* Pills / status */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.success { background: var(--success-bg); color: var(--success); }
.pill.warning { background: var(--warning-bg); color: var(--warning); }
.pill.danger { background: var(--danger-bg); color: var(--danger); }
.pill.neutral { background: #EEF0F4; color: #475569; }
.pill.info { background: var(--tint); color: var(--navy); }

/* Controls */
.controls { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; }
.ctl { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ctl label, .ctl .ctl-label { font-size: 12px; color: var(--muted); font-weight: 500; }
select, input[type=date], input[type=text] { font: 500 14px var(--font); color: var(--ink); padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; min-width: 180px; max-width: 100%; }
select:focus, input:focus { outline: 2px solid rgba(68,163,219,.45); outline-offset: 1px; }
.seg { display: inline-flex; background: #EEF0F4; border-radius: 999px; padding: 4px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; font: 500 13px var(--font); padding: 7px 14px; border-radius: 999px; cursor: pointer; color: #475569; }
.seg button.on { background: var(--navy); color: #fff; box-shadow: var(--shadow-btn); }
.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; font-weight: 500; padding: 8px 0; }
.toggle input { display: none; }
.toggle .track { width: 40px; height: 22px; border-radius: 999px; background: #CBD5E1; position: relative; transition: background .15s; flex-shrink: 0; }
.toggle .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.toggle input:checked + .track { background: var(--navy); }
.toggle input:checked + .track::after { left: 21px; }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--navy); color: #fff; font: 600 14px var(--font); padding: 10px 18px; border-radius: 999px; cursor: pointer; box-shadow: var(--shadow-btn); text-decoration: none; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 10px 14px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--border-soft); }
th:first-child, td:first-child { text-align: left; white-space: normal; min-width: 160px; }
th { background: var(--bg-soft); color: var(--muted); font-weight: 600; font-size: 12px; text-transform: none; position: sticky; top: 0; }
tbody tr:hover { background: #FAFBFD; }
tbody tr:last-child td { border-bottom: 0; }
tr.total td { font-weight: 700; background: var(--bg-soft); }
td.left { text-align: left; white-space: normal; }

/* Charts */
.chart { position: relative; height: 260px; }
.chart.tall { height: 320px; }
.chart.short { height: 220px; }

/* Rows / insights */
.rows { display: flex; flex-direction: column; gap: 10px; }
.row-item { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); background: #fff; }
.row-lead { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--tint); color: var(--navy); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.row-body { flex: 1; min-width: 0; }
.row-title { font-weight: 600; }
.row-detail { color: #475569; font-size: 14px; margin-top: 2px; }
.row-meta { color: var(--muted-2); font-size: 12px; margin-top: 4px; }
.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius-lg); background: var(--info-bg); color: var(--ink-2); font-size: 14px; margin-top: 16px; border: 1px solid #DFE9FB; }
.callout.warning { background: #FFFBEB; border-color: #FDE68A; color: #78350F; }
.callout b { font-weight: 700; }
ol.actions { margin: 0; padding-left: 20px; }
ol.actions li { margin: 0 0 8px; }
.props { display: grid; grid-template-columns: minmax(160px, 1fr) 2fr; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); overflow: hidden; }
.props div { padding: 10px 14px; border-bottom: 1px solid var(--border-soft); font-size: 14px; }
.props div:nth-child(odd) { color: var(--muted); background: var(--bg-soft); }
.props div:nth-last-child(-n+2) { border-bottom: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12.5px; color: #475569; margin-bottom: 8px; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); margin-right: 6px; vertical-align: -1px; }

.site-footer { background: var(--ink); color: #CBD5E1; padding: 28px 0; margin-top: 24px; font-size: 13px; }
.footer-inner { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.footer-logo-chip { display: inline-flex; align-items: center; background: #fff; border-radius: 14px; padding: 10px 16px; flex-shrink: 0; max-width: 100%; }
.footer-logo { height: 36px; width: auto; max-width: 100%; object-fit: contain; display: block; }
.footer-inner p { margin: 0; flex: 1; min-width: 240px; }

/* Insights & Data Status */
.link-btn { background: none; border: 0; padding: 0; color: var(--navy); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.ins-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin-top: 14px; }
.ins-card { border: 1px solid var(--border-soft); border-left: 5px solid #94A3B8; border-radius: var(--radius-lg); background: #fff; padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ins-card.danger { border-left-color: var(--danger); }
.ins-card.warning { border-left-color: #F59E0B; }
.ins-card.success { border-left-color: #10B981; }
.ins-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ins-plat { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.ins-title { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.ins-finding { margin: 0; color: #334155; font-size: 14px; }
.ins-ev { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; }
.ins-ev div { background: var(--bg-soft); border-radius: 10px; padding: 7px 10px; min-width: 0; }
.ins-ev dt { font-size: 11.5px; color: var(--muted); }
.ins-ev dd { margin: 2px 0 0; font-weight: 700; font-size: 14px; overflow-wrap: anywhere; }
.ins-rec { margin: 0; font-size: 14px; background: var(--tint); border-radius: 10px; padding: 9px 12px; color: var(--ink-2); }
.ins-src { margin: 0; font-size: 11.5px; color: var(--muted-2); }
.file { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; white-space: normal; overflow-wrap: anywhere; display: inline-block; min-width: 240px; max-width: 360px; text-align: left; }
ol.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; counter-reset: f; }
ol.flow li { counter-increment: f; border: 1px solid var(--border-soft); border-radius: 14px; padding: 12px 14px; background: var(--bg-soft); display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); min-width: 0; overflow-wrap: anywhere; }
ol.flow li b { color: var(--ink); font-size: 14px; }
ol.flow li b::before { content: counter(f) ". "; color: var(--navy); }

/* Responsive */
@media (max-width: 1600px) {
  .tabs { flex: 0 0 100%; order: 3; justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
}
@media (max-width: 1024px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  ol.flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .container { padding: 0 14px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .header-inner { gap: 8px; }
  .brand-logo { height: 32px; }
  .brand { min-width: 0; }
  .footer-logo { height: 30px; }
  .brand-title { font-size: 13px; }
  .tabs { flex: 0 0 100%; order: 3; justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 4px; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .hero { padding: 20px 0 8px; }
  .hero-sub { font-size: 14px; }
  .section { padding: 16px; border-radius: 18px; margin-top: 14px; }
  .sec-title { font-size: 19px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px 14px; }
  .kpi-value { font-size: 19px; }
  select, input[type=text] { min-width: 0; width: 100%; }
  .controls .ctl { width: 100%; }
  .chart { height: 230px; }
  .props { grid-template-columns: 1fr; }
  .props div:nth-child(odd) { border-bottom: 0; padding-bottom: 2px; }
  .ins-grid { grid-template-columns: 1fr; }
  ol.flow { grid-template-columns: 1fr; }
}

@media (max-width: 440px) {
  .brand-divider, .brand-title { display: none; }
  .brand-logo { height: 34px; }
}

/* Menu user di header (hanya tampil lewat server login; lihat server/) */
.user-menu { display: flex; align-items: center; gap: 10px; font-size: 13px; flex-shrink: 0; margin-left: auto; }
.user-menu[hidden] { display: none; }
.user-menu .inline-form { display: inline; margin: 0; }
.user-name { font-weight: 600; color: var(--ink); display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.user-name small { font-weight: 500; color: var(--muted); }
.user-link { color: var(--navy); font-weight: 600; text-decoration: none; white-space: nowrap; }
.user-link:hover { text-decoration: underline; }
.user-logout { border: 1px solid var(--border); background: #fff; color: var(--ink); font: 600 13px var(--font); padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.user-logout:hover { background: #F1F5F9; }
@media (max-width: 760px) { .user-menu { gap: 8px; font-size: 12px; } .user-menu .user-name small, .user-menu a[href="/account/password"] { display: none; } .user-logout { padding: 5px 10px; font-size: 12px; } }
