/* YPR Marketing: follows the YPR design concept (Apple-style tokens, Space Grotesk + Inter, CSS-only motion). */
@font-face { font-family: "Inter"; src: url(/fonts/inter.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url(/fonts/space-grotesk.woff2) format("woff2"); font-weight: 300 700; font-display: swap; }

:root {
  --bg: #f5f5f7; --surface: #ffffff; --surface-2: #f2f2f7; --border: #e5e5ea; --text: #1d1d1f; --text-2: #6e6e73;
  --accent: #0066cc; --accent-strong: #0066cc; --grad: linear-gradient(180deg, #0071e3, #0066cc);
  --ok: #1a6e2e; --warn: #9a4400; --bad: #b8000f;
  --ok-bg: color-mix(in srgb, var(--ok) 10%, var(--surface)); --warn-bg: color-mix(in srgb, var(--warn) 10%, var(--surface)); --bad-bg: color-mix(in srgb, var(--bad) 9%, var(--surface));
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 1px 1px rgba(0,0,0,.02); --shadow-deep: 0 8px 24px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.04);
  --dur: 200ms; --ease: cubic-bezier(0.25, 0.1, 0.25, 1); --radius: 12px;
  /* Older names used across the pages */
  --muted: var(--text-2); --line: var(--border); --brand: var(--accent); --brand-ink: #fff;
  color-scheme: light; font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--bg);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --surface: #1c1c1e; --surface-2: #2c2c2e; --border: #38383a; --text: #f5f5f7; --text-2: #98989d;
    --accent: #409cff; --accent-strong: #0071e3; --ok: #30d158; --warn: #ff9f0a; --bad: #ff6961;
    --ok-bg: color-mix(in srgb, var(--ok) 14%, var(--surface)); --warn-bg: color-mix(in srgb, var(--warn) 14%, var(--surface)); --bad-bg: color-mix(in srgb, var(--bad) 14%, var(--surface));
    --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-deep: 0 10px 30px rgba(0,0,0,.55); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --surface: #1c1c1e; --surface-2: #2c2c2e; --border: #38383a; --text: #f5f5f7; --text-2: #98989d;
  --accent: #409cff; --accent-strong: #0071e3; --ok: #30d158; --warn: #ff9f0a; --bad: #ff6961;
  --ok-bg: color-mix(in srgb, var(--ok) 14%, var(--surface)); --warn-bg: color-mix(in srgb, var(--warn) 14%, var(--surface)); --bad-bg: color-mix(in srgb, var(--bad) 14%, var(--surface));
  --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-deep: 0 10px 30px rgba(0,0,0,.55); color-scheme: dark;
}
@media (prefers-reduced-motion: reduce) {
  :root { --dur: 0ms; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

* { box-sizing: border-box; }
body { margin: 0; line-height: 1.45; font-size: 15px; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, .font-display, .kpi-value, .verdict-title, .card-title { font-family: "Space Grotesk", "Inter", system-ui, sans-serif; letter-spacing: -0.02em; }
h1 { font-size: 1.5rem; font-weight: 700; margin: .2rem 0 .6rem; }
h2 { font-size: 1.05rem; font-weight: 600; margin: 0 0 .75rem; }
h3 { font-weight: 600; }
small, .muted { color: var(--text-2); }
button, summary, label[for], .btn, select { cursor: pointer; }

/* ---------- Shell: floating sidebar + top bar ---------- */
.with-nav { display: grid; grid-template-columns: 248px minmax(0, 1fr); grid-template-rows: auto 1fr; min-height: 100vh; }
.sidebar { grid-column: 1; grid-row: 1 / span 2; position: sticky; top: 12px; align-self: start; margin: 12px 0 12px 12px; height: calc(100vh - 24px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); padding: 14px 10px; }
.brand { display: flex; flex-direction: column; gap: 6px; padding: 4px 8px 14px; margin-bottom: 6px; border-bottom: 1px solid var(--border); color: var(--text-2); font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.brand:hover { text-decoration: none; }
.brand img, .brand-sm img, .auth-logo img { display: block; height: auto; }
.brand img { width: 180px; max-width: 100%; }
.sidebar nav details { margin: 8px 0; }
.sidebar nav summary { list-style: none; display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); border-radius: 8px; }
.sidebar nav summary::-webkit-details-marker { display: none; }
.sidebar nav summary:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); font-size: .7rem; line-height: 1; letter-spacing: 0; }
.sidebar nav a { display: flex; align-items: center; padding: 7px 10px; margin: 1px 0; border-radius: 8px; color: var(--text); font-size: .92rem; font-weight: 500;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.sidebar nav a:hover { background: color-mix(in srgb, var(--text) 5%, transparent); text-decoration: none; }
.sidebar nav a.on { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); font-weight: 600; }
.sidebar nav details[open] > a { animation: open-in 180ms var(--ease) backwards; }

.topbar { grid-column: 2; display: flex; align-items: center; gap: 1rem; margin: 12px 12px 0; padding: 8px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); position: sticky; top: 12px; z-index: 5; }
.topbar-title { flex: 1; font-family: "Space Grotesk", "Inter", sans-serif; font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .brand-sm, .topbar .nav-open, .side-theme { display: none; }
.theme { display: inline-flex; padding: 2px; background: var(--surface-2); border-radius: 9px; }
.theme button { font: inherit; font-size: .78rem; font-weight: 500; border: 0; background: transparent; color: var(--text-2); padding: 4px 10px; border-radius: 7px; transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.theme button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); animation: tab-on 220ms var(--ease); }
.me { display: flex; align-items: center; gap: .6rem; font-size: .88rem; white-space: nowrap; }
.me form { margin: 0; display: flex; }
.me-name small { display: block; font-size: .72rem; }
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent); font-weight: 700; line-height: 1; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--text); transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.icon-btn:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); }
.nav-scrim { display: none; }

.page { grid-column: 2; width: 100%; max-width: 1200px; margin: 0 auto; padding: 1.25rem 1.25rem 3rem; animation: page-in 260ms var(--ease) backwards; min-width: 0; }
.page.narrow { max-width: 420px; padding-top: 10vh; }
.auth-logo { display: flex; justify-content: center; margin-bottom: 1.25rem; }
.auth-logo img { width: 200px; }
.auth { border-radius: 16px; box-shadow: var(--shadow-deep); padding: 1.5rem; }

@media (max-width: 960px) {
  .with-nav { display: block; }
  .topbar { margin: 8px 8px 0; top: 8px; gap: .6rem; }
  .topbar .nav-open, .topbar .brand-sm { display: inline-grid; }
  .topbar .theme { display: none; }
  .side-theme { display: block; padding: 12px 8px 4px; border-top: 1px solid var(--border); margin-top: 8px; }
  .topbar .me { margin-left: auto; }
  .brand-sm img { width: 98px; }
  .topbar-title, .me-name { display: none; }
  .sidebar { position: fixed; z-index: 20; inset: 8px auto 8px 8px; margin: 0; width: min(280px, 85vw); height: auto; transform: translateX(calc(-100% - 16px)); opacity: 0;
    box-shadow: var(--shadow-deep); }
  .nav-toggle:checked ~ .sidebar { transform: none; opacity: 1; transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease); }
  .nav-toggle:checked ~ .nav-scrim { display: block; position: fixed; inset: 0; z-index: 15; background: rgba(0,0,0,.3); animation: fade-in 120ms var(--ease); }
  .page { padding: 1rem .75rem 2.5rem; }
}
@media (max-width: 520px) { .theme button { padding: 4px 7px; } }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.card, .panel, .auth { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.panel { margin-bottom: 1rem; }
.card-head { display: flex; flex-direction: column; gap: .4rem; align-items: flex-start; }
.card-title { font-weight: 650; font-size: 1.05rem; color: var(--text); }
.card-foot { margin-top: .75rem; padding-top: .6rem; border-top: 1px solid var(--line); font-size: .9rem; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin-top: .9rem; }
.kpi-label { font-size: .75rem; color: var(--muted); }
.kpi-value { font-weight: 650; font-variant-numeric: tabular-nums; }
.kpi.bad .kpi-value, .bad { color: var(--bad); }
.kpi.warn .kpi-value, .warn { color: var(--warn); }
.kpi.ok .kpi-value, .ok { color: var(--ok); }
.table tr.bad td { color: var(--bad); }
.table tr.warn td { color: var(--warn); }
.table tr.ok td:nth-child(2) { color: var(--ok); }
.small-note { font-size: .85rem; margin: .6rem 0 0; }
.card-note { margin-top: .6rem; font-size: .85rem; }
.badge { display: inline-block; font-size: .78rem; padding: .2rem .55rem; border-radius: 999px; background: var(--bg); white-space: nowrap; font-weight: 600; }
.badge small { font-weight: 400; }
.badge.campaign { background: var(--ok-bg); color: var(--ok); }
.badge.closing { background: var(--warn-bg); color: var(--warn); }
.badge.waiting { background: var(--warn-bg); color: var(--warn); }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .78rem; color: var(--muted); font-weight: 600; }
.table .r { text-align: right; font-variant-numeric: tabular-nums; }
.table tr.hl td { background: var(--warn-bg); }
.table tr.dim td { opacity: .55; }
.timeline { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.timeline li { border-top: 3px solid var(--line); padding-top: .5rem; }
.timeline li.past { border-color: var(--muted); }
.timeline li.now { border-color: var(--brand); }
.tl-date { font-weight: 650; }
.tl-label { font-size: .85rem; color: var(--muted); }
.form label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; font-weight: 550; margin-bottom: .75rem; }
.form fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem .2rem; margin: 0 0 1rem; background: var(--surface); }
.form legend { font-weight: 650; padding: 0 .35rem; }
input, select, textarea { font: inherit; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--text); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
input.small { width: 10rem; padding: .3rem .45rem; font-size: .85rem; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 1rem; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 1rem; }
.btn { display: inline-block; font: inherit; font-weight: 600; padding: .5rem .9rem; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.btn:hover { text-decoration: none; filter: brightness(.97); }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.wide { width: 100%; }
button.link { background: none; border: 0; color: var(--brand); cursor: pointer; font: inherit; padding: 0; }
form.inline { display: inline-flex; gap: .4rem; align-items: center; margin-left: .5rem; }
form.inline select { width: auto; padding: .25rem .4rem; }
.actions { display: flex; gap: .5rem; margin: .5rem 0 1rem; }
.danger-zone { border-top: 1px solid var(--line); padding-top: 1rem; }
.alert { padding: .65rem .85rem; border-radius: 8px; background: var(--bad-bg); color: var(--bad); margin: .5rem 0 1rem; font-size: .9rem; }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.warn { background: var(--warn-bg); color: var(--warn); }
.preview { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; padding: .6rem 0 .9rem; font-size: .85rem; }
.preview div b { display: block; font-size: 1rem; font-variant-numeric: tabular-nums; }
.empty { padding: 2.5rem; text-align: center; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.pre { white-space: pre-wrap; margin: 0; }
@media (max-width: 720px) {
  .table.targets th:nth-child(4), .table.targets td:nth-child(4) { display: none; }
  .page { padding: 1rem; }
  .cards { grid-template-columns: 1fr; }
  .grid3, .grid4, .timeline, .preview { grid-template-columns: 1fr 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }

  .badge { white-space: normal; }
  .table { font-size: .85rem; }
}
.kpis-6 { grid-template-columns: repeat(6, 1fr); margin-top: 0; }
.small-note { font-size: .85rem; margin: .6rem 0 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.two-col .panel { margin-bottom: 0; }
.mt { margin-top: 1.2rem; }
.picker select { width: auto; min-width: 14rem; }
.filters { display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin-bottom: .75rem; flex-wrap: wrap; }
.tabs { display: flex; gap: .25rem; flex-wrap: wrap; }
.tabs a { padding: .3rem .7rem; border-radius: 6px; color: var(--muted); font-size: .9rem; }
.tabs a.on, .tabs a:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.search input { width: 16rem; }
.scroll { overflow-x: auto; }
.nowrap { white-space: nowrap; }
.badge.st-layak { background: var(--ok-bg); color: var(--ok); }
.badge.st-tidak_layak { background: var(--bad-bg); color: var(--bad); }
.badge.st-semak { background: var(--warn-bg); color: var(--warn); }
@media (max-width: 720px) {
  .kpis-6 { grid-template-columns: 1fr 1fr 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .search, .search input { width: 100%; }
}
.section-title { display: flex; justify-content: space-between; align-items: baseline; margin-top: .5rem; }
.small-link { font-size: .85rem; font-weight: 500; }
.table td.bad { color: var(--bad); }
.table td.warn { color: var(--warn); }
.table td.ok { color: var(--ok); }
.verdict { border-left: 4px solid var(--line); }
.verdict.ok { border-left-color: var(--ok); background: var(--ok-bg); }
.verdict.warn { border-left-color: var(--warn); background: var(--warn-bg); }
.verdict.bad { border-left-color: var(--bad); background: var(--bad-bg); }
.verdict-title { font-weight: 700; font-size: 1.1rem; margin: .15rem 0; }
.verdict.ok .verdict-title { color: var(--ok); }
.verdict.warn .verdict-title { color: var(--warn); }
.verdict.bad .verdict-title { color: var(--bad); }
.badge.closed { background: var(--brand); color: var(--brand-ink); margin-left: .3rem; }
.badge.lv-ok { background: var(--ok-bg); color: var(--ok); }
.badge.lv-warn { background: var(--warn-bg); color: var(--warn); }
.badge.lv-bad { background: var(--bad-bg); color: var(--bad); }
.table.report td, .table.report th { white-space: nowrap; }
.table tfoot th { color: var(--text); font-size: .9rem; border-top: 2px solid var(--line); }
.table.report .badge { white-space: nowrap; }
.table.report td:first-child { position: sticky; left: 0; background: var(--surface); }
.cards.creatives { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card.creative { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.creative-body { padding: .8rem 1rem 1rem; display: flex; flex-direction: column; gap: .35rem; }
.thumb { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; background: var(--bg); }
.thumb.big { aspect-ratio: auto; max-height: 360px; object-fit: contain; border-radius: 8px; margin-bottom: .75rem; }
.empty-thumb { display: flex; align-items: center; justify-content: center; color: var(--muted); font-weight: 600; aspect-ratio: 16 / 9; }
.mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: .3rem .6rem; font-size: .8rem; color: var(--muted); margin-top: .25rem; }
.mini b { display: block; color: var(--text); font-size: .92rem; font-variant-numeric: tabular-nums; }
.mini b.ok { color: var(--ok); } .mini b.warn { color: var(--warn); } .mini b.bad { color: var(--bad); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; background: var(--bg); padding: .05rem .3rem; border-radius: 4px; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0; font-size: .92rem; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }
.copy-row { display: flex; gap: .5rem; margin-top: .35rem; }
.copy-row input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; }
.url-cell input { font-size: .8rem; min-width: 22rem; }
.funnel { display: grid; grid-template-columns: repeat(5, 1fr); gap: .5rem; }
.funnel .step { padding: .5rem .7rem; background: var(--bg); border-radius: 8px; }
.funnel .kpi-value { font-size: 1.3rem; }
.checks { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin-bottom: .75rem; }
.form label.check { flex-direction: row; align-items: center; gap: .4rem; font-weight: 500; margin: 0; }
.check input { width: auto; }
.table.pipe select, .table.pipe input[type=date] { padding: .3rem .4rem; font-size: .85rem; min-width: 8rem; }
.btn.small { padding: .3rem .55rem; font-size: .82rem; }
.row-actions { display: flex; gap: .3rem; margin: 0; }
.small { font-size: .8rem; }
tr.closed-row td { background: var(--ok-bg); }
@media (max-width: 720px) { .funnel { grid-template-columns: repeat(3, 1fr); } }
.issue-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.issue-head h2 { margin: 0; }
.panel.issue.no-action { border-color: var(--bad); }
.suggest { margin: .3rem 0 .6rem; padding-left: 1.2rem; font-size: .92rem; }
.actions-list { list-style: none; padding: 0; margin: .5rem 0; display: flex; flex-direction: column; gap: .4rem; }
.actions-list li { padding: .45rem .6rem; background: var(--bg); border-radius: 8px; font-size: .92rem; }
.actions-list li.selesai span:nth-child(2) { text-decoration: line-through; color: var(--muted); }
.add-action { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; margin-top: .5rem; }
.add-action input[name=title] { flex: 1; min-width: 14rem; }
.add-action input[type=date] { width: auto; }
.reason-group { margin-top: 1rem; }
.reason-group h3 { font-size: .98rem; margin: 0 0 .2rem; }
.alert.banner { display: block; font-weight: 600; text-decoration: none; }
textarea#daily-text { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; }

/* Function 11: AI Creative Engine */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: .45rem 0; border-bottom: 1px solid var(--line, #e5e7eb); }
ul.plain li:last-child { border-bottom: 0; }
.variants .card h3 { margin: .25rem 0 .5rem; }
.variants .copy { white-space: pre-wrap; line-height: 1.5; }
@media (max-width: 720px) { .grid2 { grid-template-columns: 1fr; } }

/* Function 12: Integrasi */
ol.steps { margin: .25rem 0 .75rem; padding-left: 1.25rem; line-height: 1.6; }
ol.steps code, .panel p code { font-size: .85em; background: var(--bg); padding: .05rem .3rem; border-radius: 4px; word-break: break-all; }
.panel h3 { margin: 1.1rem 0 .25rem; font-size: 1rem; }
.panel details summary { cursor: pointer; margin: .5rem 0; }
p.bad { color: var(--bad, #b42318); }
.panel { min-width: 0; }

/* ---------- Design layer: components ---------- */
.card, .panel, .auth, .form fieldset, .empty { border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); }
.card, .panel { padding: 1rem 1.15rem; }
.card { transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
a.card:hover, .card:hover { transform: translateY(-2px); box-shadow: var(--shadow-deep); text-decoration: none; }
.cards, .two-col, .grid2 { gap: 1rem; }
.kpi-value { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi-label { font-size: .75rem; color: var(--text-2); }
.funnel .step, .actions-list li { background: var(--surface-2); border-radius: 10px; }

/* Buttons: primary solid blue, secondary white, ghost text */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; font: inherit; font-weight: 600; font-size: .9rem; padding: .5rem .95rem; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); line-height: 1.2;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform 120ms var(--ease); }
.btn:hover { text-decoration: none; filter: none; border-color: var(--accent); color: var(--accent); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.btn.primary:hover { background: var(--grad); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--accent-strong) 35%, transparent); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--accent); }
.btn.ghost:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--border)); }
.btn.danger:hover { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .4; cursor: not-allowed; }
.btn.small { padding: .3rem .6rem; font-size: .8rem; border-radius: 7px; }
button.link { color: var(--accent); }

/* Inputs */
input, select, textarea { border: 0; box-shadow: inset 0 0 0 1px var(--border); border-radius: 12px; padding: .55rem .7rem; background: var(--surface); color: var(--text);
  transition: box-shadow var(--dur) var(--ease); }
input:hover, select:hover, textarea:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, var(--border)); }
input:focus, select:focus, textarea:focus { outline: none; box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); }
input[type=checkbox], input[type=radio] { box-shadow: none; accent-color: var(--accent); width: auto; }
input.small, .table.pipe select, .table.pipe input[type=date], form.inline select { border-radius: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }

/* Tables: scroll inside their card, soft hover tint */
.table th { font-size: .74rem; font-weight: 600; color: var(--text-2); text-transform: none; }
.table th, .table td { border-bottom: 1px solid var(--border); }
.table tbody tr { transition: background-color var(--dur) var(--ease); }
.table tbody tr:hover td { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.table.report td:first-child { background: var(--surface); }
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Badges and pills */
.badge { display: inline-flex; align-items: center; justify-content: center; gap: .25rem; line-height: 1; border-radius: 999px; padding: .28rem .6rem; font-size: .75rem; font-weight: 600;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); color: var(--text-2); }
.badge.campaign, .badge.st-layak, .badge.lv-ok { background: var(--ok-bg); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ok) 30%, transparent); color: var(--ok); }
.badge.closing, .badge.waiting, .badge.st-semak, .badge.lv-warn { background: var(--warn-bg); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 30%, transparent); color: var(--warn); }
.badge.st-tidak_layak, .badge.lv-bad { background: var(--bad-bg); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 30%, transparent); color: var(--bad); }
.badge.closed { background: var(--accent-strong); color: #fff; box-shadow: none; }
code { background: var(--surface-2); border-radius: 6px; }

/* Tabs as a segmented control */
.tabs { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--surface-2); border-radius: 10px; }
.tabs a { padding: .3rem .75rem; border-radius: 8px; color: var(--text-2); font-weight: 500; transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.tabs a:hover { background: transparent; color: var(--text); text-decoration: none; }
.tabs a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); animation: tab-on 220ms var(--ease); }

/* Alerts and verdicts on tinted panels keep status-coloured text */
.alert { border-radius: 10px; box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 20%, transparent); }
.verdict { border-left-width: 4px; }
.timeline li.now { border-color: var(--accent); }
.menu-list, details[open] > .menu-list { animation: pop-in 160ms var(--ease) backwards; }

/* ---------- Motion (CSS only, enter animations, no exit) ---------- */
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes rise-in { from { opacity: 0; transform: translateY(10px) scale(.99); } }
@keyframes line-in { from { opacity: 0; transform: translateY(4px); } }
@keyframes tab-on { 0% { transform: scale(.96); } 60% { transform: scale(1.02); } 100% { transform: scale(1); } }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
@keyframes open-in { from { opacity: 0; transform: translateY(-3px); } }
@keyframes fade-in { from { opacity: 0; } }
.cards > *, .panel, .two-col > *, .grid2 > *, .kpis > * { animation: rise-in 320ms var(--ease) backwards; }
.cards > :nth-child(2), .kpis > :nth-child(2) { animation-delay: 40ms; }
.cards > :nth-child(3), .kpis > :nth-child(3) { animation-delay: 80ms; }
.cards > :nth-child(4), .kpis > :nth-child(4) { animation-delay: 120ms; }
.cards > :nth-child(5), .kpis > :nth-child(5) { animation-delay: 160ms; }
.cards > :nth-child(n+6), .kpis > :nth-child(n+6) { animation-delay: 200ms; }
.table tbody tr:nth-child(-n+12) { animation: line-in 280ms var(--ease) backwards; }
.table tbody tr:nth-child(2) { animation-delay: 30ms; } .table tbody tr:nth-child(3) { animation-delay: 60ms; }
.table tbody tr:nth-child(4) { animation-delay: 90ms; } .table tbody tr:nth-child(5) { animation-delay: 120ms; }
.table tbody tr:nth-child(6) { animation-delay: 150ms; } .table tbody tr:nth-child(7) { animation-delay: 180ms; }
.table tbody tr:nth-child(8) { animation-delay: 210ms; } .table tbody tr:nth-child(9) { animation-delay: 240ms; }
.table tbody tr:nth-child(10) { animation-delay: 270ms; } .table tbody tr:nth-child(11) { animation-delay: 300ms; }
.table tbody tr:nth-child(12) { animation-delay: 330ms; }
.panel details[open] > :not(summary) { animation: open-in 180ms var(--ease) backwards; }
.alert { animation: fade-in 120ms var(--ease) backwards; }

/* The foundation logo keeps its own colours; on dark it sits on a white plate so the grey wordmark stays readable. */
:root[data-theme="dark"] .brand img, :root[data-theme="dark"] .brand-sm img, :root[data-theme="dark"] .auth-logo img { background: #fff; padding: 6px 8px; border-radius: 10px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand img, :root:not([data-theme="light"]) .brand-sm img, :root:not([data-theme="light"]) .auth-logo img { background: #fff; padding: 6px 8px; border-radius: 10px; }
}

/* Wide tables scroll inside their own card on phones, never the whole page. */
.panel, .card, .form fieldset { overflow-x: auto; }

/* Three-dot menu */
.more { position: relative; display: inline-block; }
.more summary { list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.btn.icon { width: 36px; padding: .5rem 0; font-size: 1.1rem; line-height: 1; }
.more .menu-list { position: absolute; right: 0; top: calc(100% + 6px); left: auto; z-index: 10; min-width: 15rem; display: flex; flex-direction: column; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-deep); }
.more .menu-list a { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 8px; color: var(--text); font-weight: 500; }
.more .menu-list a:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); text-decoration: none; }
.more .menu-list small { font-weight: 400; font-size: .78rem; }
.page-head .actions { align-items: center; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 720px) { .page-head { flex-wrap: wrap; } }
