/* Spektroom ads dashboard. Rules (docs/dashboard-ux.md): 18 px text, controls at least 48 px tall,
   labels above fields, hints below, high contrast, single column on phones, no hover-only UI. */

:root {
  --brand: #1F349E;
  --brand-dark: #16257A;
  --brand-soft: #E8ECFA;
  --ink: #161A23;
  --ink-2: #3D4452;
  --muted: #555D6E;
  --line: #C4CAD6;
  --line-soft: #E2E6EE;
  --bg: #F4F6FA;
  --surface: #FFFFFF;
  --ok: #11612F;
  --ok-bg: #E2F3E8;
  --warn: #6E4300;
  --warn-bg: #FFF1CC;
  --bad: #A61B12;
  --bad-bg: #FDEBEA;
  --radius: 12px;
  --focus: 0 0 0 3px #FFFFFF, 0 0 0 6px #F0A500;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 30px; }
h2 { font-size: 24px; }
h3 { font-size: 20px; }
p { margin: 0 0 .75em; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-dark); }
img { max-width: 100%; height: auto; }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }

.wrap { max-width: 1000px; margin: 0 auto; padding: 0 16px; }
.main { padding-top: 24px; padding-bottom: 48px; min-height: 60vh; }
.narrow { max-width: 520px; margin: 0 auto; }
.lead { font-size: 20px; color: var(--ink-2); }
.muted { color: var(--muted); }
.eyebrow { font-weight: 600; color: var(--muted); margin-bottom: .25em; }
.spaced { margin-top: 1.5em; }
.small-link { margin-top: 2em; }
.nowrap { white-space: nowrap; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: #fff; padding: 8px 12px; z-index: 10; }

/* Top bar and menu */
.topbar { background: var(--brand); color: #fff; }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; min-height: 64px; padding-top: 8px; padding-bottom: 8px; }
.brand { color: #fff; text-decoration: none; font-size: 22px; display: inline-flex; align-items: baseline; gap: 8px; }
.brand:hover { color: #fff; }
.brand-mark { font-weight: 800; letter-spacing: .08em; }
.brand-sub { font-weight: 400; opacity: .95; }
.who { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.who form { margin: 0; }
.who-name { font-weight: 600; }
.mainnav { background: var(--brand-dark); }
.mainnav .wrap { display: flex; flex-wrap: wrap; gap: 4px 8px; padding-top: 6px; padding-bottom: 6px; }
.mainnav a { color: #fff; text-decoration: none; padding: 10px 12px; border-radius: 8px; min-height: 48px; display: inline-flex; align-items: center; font-weight: 600; }
.mainnav a:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.mainnav a[aria-current="page"] { background: #fff; color: var(--brand-dark); }

.footer { border-top: 1px solid var(--line); background: var(--surface); padding: 24px 0 32px; }
.footer-in { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.footer-link { font-weight: 600; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 10px 22px;
  font: inherit; font-size: 19px; font-weight: 600; line-height: 1.2; text-align: center; text-decoration: none;
  border-radius: 10px; border: 2px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--brand); border-color: var(--brand); }
.btn-secondary:hover { background: var(--brand-soft); color: var(--brand-dark); }
.btn-danger { background: var(--surface); color: var(--bad); border-color: var(--bad); }
.btn-danger:hover { background: var(--bad-bg); color: var(--bad); }
.btn-danger-solid { background: var(--bad); color: #fff; }
.btn-danger-solid:hover { background: #861510; color: #fff; }
.btn-small { min-height: 48px; padding: 8px 16px; font-size: 17px; }
.btn-onbrand { background: transparent; color: #fff; border-color: #fff; }
.btn-onbrand:hover { background: #fff; color: var(--brand); }
.btn-wa { background: #0B7A3E; color: #fff; }
.btn-wa:hover { background: #075F30; color: #fff; }
.btn-big { min-height: 64px; font-size: 22px; padding: 14px 32px; }
.btn-block { display: flex; width: 100%; }
.btn-link { background: none; border: 0; padding: 12px 0; min-height: 48px; font: inherit; color: var(--brand); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.default-action { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); border: 0; padding: 0; margin: -1px; }

/* Messages */
.flash { background: var(--ok-bg); color: var(--ok); border: 2px solid #7CC496; border-radius: var(--radius); padding: 14px 18px; margin-bottom: 24px; font-weight: 600; }
.alert { background: var(--bad-bg); color: var(--bad); border: 2px solid #E5A29C; border-radius: var(--radius); padding: 14px 18px; margin-bottom: 20px; font-weight: 600; }
.error { color: var(--bad); font-weight: 600; margin: 6px 0 0; }
.error::before { content: "✗ "; }
.ok-text { color: var(--ok); font-weight: 600; }

/* Panels and lists */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 0 0 20px; }
.empty { text-align: center; color: var(--ink-2); }
.title-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.title-row h1 { margin: 0; }

/* Forms */
.form { margin: 0 0 24px; }
.field { margin: 0 0 24px; border: 0; padding: 0; min-width: 0; }
label, .label, legend { display: block; font-weight: 700; margin-bottom: 6px; padding: 0; }
.big-label { font-size: 22px; }
.hint { color: var(--muted); font-size: 17px; margin: 6px 0 0; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="date"], input[type="url"], input:not([type]) {
  display: block; width: 100%; max-width: 560px;
  min-height: 52px; padding: 10px 14px;
  font: inherit; font-size: 19px; color: var(--ink);
  background: var(--surface); border: 2px solid #7A8294; border-radius: 10px;
}
input[type="date"] { max-width: 280px; }
input:focus { border-color: var(--brand); }
input[type="file"] { display: block; width: 100%; max-width: 560px; min-height: 52px; padding: 10px; font: inherit; font-size: 17px; background: var(--surface); border: 2px dashed #7A8294; border-radius: 10px; }
input[type="file"]::file-selector-button { font: inherit; font-weight: 600; min-height: 44px; padding: 6px 16px; margin-right: 12px; border-radius: 8px; border: 2px solid var(--brand); background: var(--surface); color: var(--brand); cursor: pointer; }
.file-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 8px; }
.file-btn, .file-name { display: none; }
/* with app.js the browser's own (English-speaking) file control is replaced by our button */
.js .file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.js .file-btn { display: inline-flex; }
.js .file-name { display: inline; }
.file-pick:focus-within .file-btn { box-shadow: var(--focus); }
.file-btn { margin: 0; font-weight: 600; }
.file-name { color: var(--ink-2); word-break: break-all; }
.file-name.chosen { color: var(--ok); font-weight: 700; }
.check { display: flex; align-items: flex-start; gap: 12px; font-weight: 400; min-height: 48px; padding: 8px 0; cursor: pointer; }
.check input { width: 26px; height: 26px; margin: 2px 0 0; flex: none; accent-color: var(--brand); }
.code-input { font-size: 28px !important; letter-spacing: .3em; max-width: 240px !important; text-align: center; }
.date-row { display: flex; flex-wrap: wrap; gap: 0 32px; }
.search { margin-bottom: 24px; }
.search-row { display: flex; gap: 12px; flex-wrap: wrap; }
.search-row input { flex: 1 1 260px; }
.stack { display: grid; gap: 12px; }
details.advanced { border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 0 20px; margin: 24px 0; }
details.advanced[open] { padding-bottom: 8px; }
details > summary { cursor: pointer; font-weight: 700; min-height: 52px; display: flex; align-items: center; color: var(--brand); }
details.advanced > summary { padding: 12px 0; }

/* Beranda */
.big-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 24px 0 32px; }
.big-btn {
  display: flex; flex-direction: column; justify-content: center; gap: 6px;
  min-height: 140px; padding: 24px; border-radius: 16px;
  background: var(--surface); border: 2px solid var(--brand); color: var(--brand-dark); text-decoration: none;
}
.big-btn:hover { background: var(--brand-soft); color: var(--brand-dark); }
.big-primary { background: var(--brand); color: #fff; }
.big-primary:hover { background: var(--brand-dark); color: #fff; }
.big-title { font-size: 26px; font-weight: 800; }
.big-sub { font-size: 18px; }
.soon-list { list-style: none; margin: 0; padding: 0; }
.soon-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.soon-list li:first-child { border-top: 0; }
.soon-list li > div { display: flex; flex-direction: column; }

/* Status badges: words + colour */
.badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 16px; font-weight: 700; border: 2px solid transparent; white-space: nowrap; }
.badge-live { background: var(--ok-bg); color: var(--ok); border-color: #7CC496; }
.badge-scheduled { background: var(--brand-soft); color: var(--brand); border-color: #9DAAE3; }
.badge-paused { background: var(--warn-bg); color: var(--warn); border-color: #E2B54C; }
.badge-ended { background: #ECEEF2; color: #3F4654; border-color: #C4CAD6; }
.badge-draft { background: transparent; color: #3F4654; border-color: #6B7385; border-style: dashed; }
.badge-archived { background: transparent; color: var(--bad); border-color: var(--bad); }

/* Ad cards */
.ad-card { display: grid; grid-template-columns: 200px 1fr; gap: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.thumb { display: flex; align-items: center; justify-content: center; background: var(--bg); border: 1px solid var(--line-soft); border-radius: 8px; min-height: 110px; padding: 8px; overflow: hidden; }
.thumb img { max-height: 160px; width: auto; }
.no-thumb { color: var(--muted); font-size: 16px; text-align: center; }
.ad-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 8px; }
.ad-head h2 { font-size: 22px; margin: 0; }
.facts { margin: 0 0 12px; display: grid; gap: 4px; }
.facts > div { display: flex; flex-wrap: wrap; gap: 0 8px; }
.facts dt { font-weight: 700; }
.facts dt::after { content: ":"; }
.facts dd { margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.actions form { margin: 0; }
.confirm .big-question { font-size: 24px; }

/* Wizard */
.steps { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 24px; padding: 0; }
.steps li { font-size: 16px; }
.steps li > * { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 12px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); color: var(--muted); }
.steps li.done > * { border-color: var(--brand); color: var(--brand); }
.steps li.now > * { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.wiz-nav { display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: flex-start; gap: 16px; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.wiz-nav > .btn-primary { min-width: 200px; }
.finish { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.restart { margin-top: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.chip { min-height: 48px; padding: 8px 18px; font: inherit; font-weight: 600; border-radius: 999px; border: 2px solid var(--brand); background: var(--surface); color: var(--brand); cursor: pointer; }
.chip:hover { background: var(--brand-soft); }
.group-title { margin-top: 28px; }

.slot-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.slot-card { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 16px; font-weight: 400; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.slot-card:hover { border-color: var(--brand); }
.slot-card:has(input:checked) { border: 3px solid var(--brand); background: var(--brand-soft); padding: 15px; }
.slot-pick { display: flex; align-items: center; gap: 12px; font-size: 20px; }
.slot-pick input { width: 28px; height: 28px; flex: none; accent-color: var(--brand); }
.slot-pic { display: block; background: #EEF1F6; border-radius: 8px; padding: 10px; }
.slot-pic img, .slot-pic svg { display: block; width: 100%; height: auto; max-height: 220px; }
.slot-desc { color: var(--ink-2); }
.slot-size { font-weight: 700; color: var(--brand-dark); }

.quick { display: flex; flex-wrap: wrap; gap: 10px; }
.avail { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 14px 18px; min-height: 56px; }
.avail p:last-child { margin-bottom: 0; }
.avail-line { font-weight: 600; }
.avail-line.ok { color: var(--ok); }
.avail-line.taken { color: var(--bad); }
.avail-line.shared { color: var(--ink-2); font-weight: 400; }

.upload { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.current { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 12px 0; }
.current img { max-height: 120px; width: auto; border: 1px solid var(--line); }

.summary p { font-size: 20px; }
.summary p:first-child { font-size: 22px; }

/* Step 5 mock pages */
.preview { margin: 0 0 28px; }
.mock-pair { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 24px; }
.mock { margin: 0; }
.mock figcaption { text-align: center; font-weight: 700; margin-top: 8px; }
.mock-pc { width: 492px; max-width: 100%; border: 2px solid #5B6474; border-radius: 10px; overflow: hidden; background: #fff; }
.mock-bar { display: flex; align-items: center; gap: 6px; padding: 8px 10px; background: #E3E6EC; border-bottom: 1px solid #C4CAD6; }
.mock-dot { width: 10px; height: 10px; border-radius: 50%; background: #9AA2B1; }
.mock-url { margin-left: 8px; font-size: 14px; color: var(--ink-2); background: #fff; border-radius: 6px; padding: 2px 10px; }
.mock-page { position: relative; padding: 0 0 12px; background: #fff; }
.mock-head { height: 28px; background: var(--brand); display: flex; align-items: center; padding: 0 12px; margin-bottom: 12px; }
.mock-logo { width: 70px; height: 10px; border-radius: 5px; background: #fff; }
.mock-text { display: grid; gap: 7px; padding: 4px 16px 10px; }
.mock-text span { height: 8px; border-radius: 4px; background: #D3D8E1; }
.mock-text span.short { width: 60%; }
.mock-ad { display: flex; justify-content: center; padding: 4px 12px 12px; }
.mock-ad img, .mock-side img, .mock-sticky img { display: block; outline: 2px solid #F0A500; outline-offset: 2px; }
.mock-cols { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding-right: 12px; }
.mock-hp { width: 222px; border: 8px solid #2A2F3A; border-radius: 26px; overflow: hidden; background: #fff; }
.mock-hp .mock-page { min-height: 320px; padding-bottom: 72px; }
.mock-hp .mock-text { padding: 4px 10px 10px; }
.mock-hp figcaption { background: #2A2F3A; color: #fff; margin: 0; padding: 4px 0 2px; }
.mock-sticky { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; padding: 6px 0; background: #fff; border-top: 1px solid var(--line); }

/* Laporan */
.pick-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.pick-list a { display: grid; gap: 4px; padding: 16px 20px; min-height: 64px; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.pick-list a:hover { border-color: var(--brand); }
.pick-list .badge { justify-self: start; }
.pick-name { font-weight: 700; font-size: 20px; color: var(--brand); }
.range-form .date-row .field { margin-bottom: 12px; }
.totals { text-align: center; }
.big-numbers { font-size: 24px; margin: 8px 0; }
.big-numbers strong { font-size: 40px; color: var(--brand-dark); }
.big-numbers .sep { margin: 0 12px; color: var(--muted); }
.period { font-weight: 600; color: var(--ink-2); }
.chart-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 20px; }
.chart { display: block; width: 100%; min-width: 540px; height: auto; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; background: var(--surface); }
.table th, .table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.table thead th { border-bottom: 2px solid var(--line); }
.table tfoot th, .table tfoot td { font-weight: 700; border-top: 2px solid var(--line); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* Sign-in security code */
.big-steps { padding-left: 1.4em; }
.big-steps li { margin-bottom: 14px; }
.qr-box { width: 240px; max-width: 100%; margin: 12px 0; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.qr { display: block; width: 100%; height: auto; }
.secret { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 22px; font-weight: 700; letter-spacing: .05em; word-break: break-all; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; }

/* Panduan */
.toc ol { padding-left: 1.4em; }
.toc li { margin-bottom: 6px; }
.help-section { scroll-margin-top: 16px; }
.shot-placeholder { margin: 16px 0 0; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--bg); min-height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); text-align: center; padding: 16px; }
.shot-placeholder figcaption { font-weight: 700; }

/* Settings */
.user-card.inactive { opacity: .85; background: #F7F8FA; }

/* Phones: one column, primary buttons full width */
@media (max-width: 640px) {
  body { font-size: 18px; }
  h1 { font-size: 26px; }
  h2 { font-size: 22px; }
  .big-actions, .slot-cards { grid-template-columns: 1fr; }
  .big-btn { min-height: 110px; }
  .ad-card { grid-template-columns: 1fr; }
  .btn-primary, .btn-big, .wiz-nav .btn, .finish, .finish .btn { width: 100%; }
  .wiz-nav { flex-direction: column; align-items: stretch; }
  .finish { align-items: stretch; }
  .actions .btn, .actions form { flex: 1 1 140px; }
  .actions form .btn { width: 100%; }
  .date-row { display: block; }
  input[type="date"] { max-width: none; }
  .big-numbers strong { font-size: 34px; }
  .big-numbers .sep { display: block; height: 0; overflow: hidden; }
  .brand { font-size: 20px; }
}

/* Printable client report (A4) */
.print-body { background: #DDE1E8; }
.print-actions { max-width: 210mm; margin: 16px auto; padding: 0 16px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.print-actions .hint { flex-basis: 100%; }
.sheet { width: 210mm; max-width: 100%; min-height: 297mm; margin: 0 auto 32px; padding: 16mm 15mm; background: #fff; color: #000; font-size: 11pt; line-height: 1.45; }
.sheet h1 { font-size: 20pt; margin: 6mm 0 4mm; }
.sheet h2 { font-size: 13pt; margin: 7mm 0 3mm; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 3px solid var(--brand); padding-bottom: 4mm; }
.wordmark { font-size: 24pt; font-weight: 800; letter-spacing: .1em; color: var(--brand); }
.sheet-site { text-align: right; font-weight: 700; }
.sheet-site span { font-weight: 400; color: #333; }
.details { border-collapse: collapse; width: 100%; }
.details th, .details td { text-align: left; padding: 2mm 3mm; border-bottom: 1px solid #DDD; vertical-align: top; }
.details th { width: 38%; font-weight: 600; }
.sheet-totals { display: grid; grid-template-columns: 1fr 1fr; gap: 5mm; margin: 6mm 0 2mm; }
.sheet-totals > div { border: 2px solid var(--brand); border-radius: 3mm; padding: 4mm; text-align: center; display: flex; flex-direction: column; }
.sheet-totals .label { font-weight: 700; }
.sheet-totals strong { font-size: 26pt; color: var(--brand); }
.sheet .chart-wrap { border: 1px solid #DDD; padding: 2mm; overflow: visible; }
.sheet .chart { min-width: 0; }
.sheet .table th, .sheet .table td { padding: 1.5mm 3mm; }
.sheet .note { margin-top: 6mm; font-size: 9.5pt; color: #333; }
.sheet-foot { margin-top: 6mm; font-size: 9pt; color: #555; border-top: 1px solid #DDD; padding-top: 2mm; }

@page { size: A4; margin: 0; }
@media print {
  .no-print { display: none !important; }
  .print-body { background: #fff; }
  .sheet { margin: 0; width: auto; min-height: 0; box-shadow: none; }
  .sheet .table tr, .sheet-totals, .sheet .chart-wrap { break-inside: avoid; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
