/* AUDIT TECH — RED FLAG SCANNER v0.1
   Tanpa font atau sumber daya eksternal. Font merek dipakai bila terpasang di perangkat;
   bila tidak, font sistem dipakai. (Untuk memakai font merek, letakkan berkas font di folder fonts/ dan tambahkan @font-face di sini.) */

:root {
  --navy: #1B2A4A;
  --navy-2: #26396A;
  --gold: #C9A24B;
  --gold-dark: #8A6A1F;
  --teal: #2E7D77;
  --teal-bg: #E4F2F0;
  --ink: #18203A;
  --muted: #566074;
  --line: #D9DEE8;
  --bg: #F3F4F8;
  --card: #FFFFFF;
  --red: #A7231B;
  --red-bg: #FDECEA;
  --amber: #6E4A00;
  --amber-bg: #FFF3D1;
  --info-bg: #E9EEF8;
  --radius: 10px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: "Space Grotesk", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.55; color: var(--ink); background: var(--bg); padding-bottom: 80px; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 .6em; color: var(--navy); }
h2 { font-size: 1.35rem; display: flex; align-items: center; gap: .6rem; }
h3 { font-size: 1.05rem; margin-top: 1.6rem; }
p { margin: 0 0 .8em; }
code { font-family: var(--font-mono); font-size: .9em; background: #EEF0F6; padding: .05em .35em; border-radius: 4px; }
a { color: var(--navy-2); }
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); font-weight: 400; }
.hint { color: var(--muted); font-size: .9rem; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- topbar & hero ---------- */
.topbar { background: var(--navy); color: #fff; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; min-height: 56px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; font-family: var(--font-head); font-weight: 700; letter-spacing: .14em; }
.brand-mark { width: 14px; height: 14px; background: var(--gold); display: inline-block; transform: rotate(45deg); }
.topbar-link { color: #C9D2E8; font-size: .9rem; text-decoration: none; }
.topbar-link:hover { color: #fff; text-decoration: underline; }

.hero { background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%); color: #fff; padding: 44px 0 52px; border-bottom: 4px solid var(--gold); }
.eyebrow { color: var(--gold); text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: 600; margin-bottom: .6rem; }
.hero h1 { color: #fff; font-size: clamp(2rem, 6vw, 3.1rem); letter-spacing: .04em; margin-bottom: .4em; }
.lead { max-width: 62ch; color: #DCE3F3; font-size: 1.08rem; }
.badges { list-style: none; padding: 0; margin: 1.1rem 0 1.4rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.badge { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); color: #fff; padding: .25rem .7rem; border-radius: 999px; font-size: .85rem; }
.badge-gold { background: var(--gold); border-color: var(--gold); color: #1B2A4A; font-weight: 700; letter-spacing: .06em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; }

/* ---------- tombol ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-weight: 600; padding: .65rem 1.1rem; min-height: 44px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--navy-2); }
.btn-secondary { background: #fff; color: var(--navy); border-color: var(--navy); }
.btn-secondary:hover:not(:disabled) { background: var(--info-bg); }
.btn-gold { background: var(--gold); color: #1B2A4A; }
.btn-gold:hover { background: #D8B25C; }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.btn-ghost:hover { background: rgba(255,255,255,.12); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #8A1C16; }
.btn-lg { padding: .8rem 1.6rem; font-size: 1.05rem; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0 .4rem; }

/* ---------- kartu & pemberitahuan ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px; margin: 20px 0; box-shadow: 0 1px 2px rgba(24,32,58,.04); }
.step-num { display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--gold); color: var(--navy); font-size: 1rem; flex: none; }
.notice { border-radius: 8px; padding: .8rem 1rem; margin: 1rem 0; border: 1px solid transparent; font-size: .95rem; }
.notice-error { background: var(--red-bg); border-color: #F2B8B3; color: var(--red); }
.notice-warn { background: var(--amber-bg); border-color: #EBCF8A; color: var(--amber); }
.notice-info { background: var(--info-bg); border-color: #C6D2EC; color: var(--navy); }
.notice-ok { background: var(--teal-bg); border-color: #A9D3CE; color: #1E5A55; }
.noscript { margin: 0; border-radius: 0; }
.steps { padding-left: 1.2rem; margin: 0 0 1rem; }
.steps li { margin-bottom: .4rem; }
.format { border: 1px solid var(--line); border-radius: 8px; padding: .6rem .9rem; background: #FAFBFD; }
.format summary { cursor: pointer; font-weight: 600; color: var(--navy); }
.tips { padding-left: 1.2rem; }
.tips li { margin-bottom: .45rem; }

/* ---------- unggah ---------- */
.dropzone { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .35rem; padding: 30px 16px; border: 2px dashed #A9B3CB; border-radius: var(--radius); background: #FAFBFE; cursor: pointer; color: var(--navy); transition: background .15s, border-color .15s; }
.dropzone:hover, .dropzone.drag { background: var(--info-bg); border-color: var(--navy-2); }
.dz-title { font-weight: 600; font-size: 1.05rem; }
.dz-sub { color: var(--muted); font-size: .9rem; }

/* ---------- info, opsi ---------- */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 0 0 1rem; }
.info-grid > div { background: #F6F8FC; border: 1px solid var(--line); border-radius: 8px; padding: .55rem .8rem; min-width: 0; }
.info-grid dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.info-grid dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: .8rem 1rem 1rem; margin: 0 0 1rem; min-width: 0; }
legend { font-weight: 600; color: var(--navy); padding: 0 .4rem; }
.options, .period { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px 18px; }
.period .hint, .options .hint { grid-column: 1 / -1; margin: 0; }
.field { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.field > label, .field > .label { font-size: .88rem; font-weight: 600; color: var(--navy); }
.req { color: var(--red); font-weight: 600; }
select, input[type=number], input[type=date], input[type=search] { font: inherit; padding: .5rem .6rem; min-height: 42px; border: 1px solid #9AA5BD; border-radius: 6px; background: #fff; color: var(--ink); width: 100%; }
.radios { display: flex; flex-direction: column; gap: .35rem; font-size: .95rem; }
.radios label { display: flex; gap: .5rem; align-items: center; }
input[type=radio], input[type=checkbox] { width: 1.15rem; height: 1.15rem; accent-color: var(--navy); flex: none; }

.colmap { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px; }
.colmap li { display: flex; justify-content: space-between; gap: .6rem; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: .45rem .7rem; background: #FAFBFD; font-size: .93rem; }
.tag { font-size: .75rem; font-weight: 600; padding: .12rem .5rem; border-radius: 999px; white-space: nowrap; }
.tag-ok { background: var(--teal-bg); color: #1E5A55; }
.tag-off { background: #ECEEF3; color: var(--muted); }
.tag-bad { background: var(--red-bg); color: var(--red); }
.warn-list { background: var(--amber-bg); border: 1px solid #EBCF8A; color: var(--amber); border-radius: 8px; padding: .7rem 1rem .7rem 2rem; margin: 1rem 0; font-size: .93rem; }
.err-list { padding-left: 1.2rem; }

/* ---------- pemeriksaan ---------- */
.checks { display: grid; gap: 12px; padding: 0; border: 0; }
.check { border: 1px solid var(--line); border-radius: 8px; padding: .8rem 1rem; background: #fff; }
.check p { margin: .3rem 0 .5rem 1.75rem; color: var(--muted); font-size: .92rem; }
.check-head { display: flex; gap: .6rem; align-items: center; cursor: pointer; }
.check-off { background: #F6F7FA; color: var(--muted); }
.check-off .check-head { cursor: not-allowed; }
.param { margin-left: 1.75rem; max-width: 280px; display: flex; flex-direction: column; gap: .25rem; }
.param label { font-size: .88rem; font-weight: 600; }

/* ---------- hasil ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 1rem 0 .4rem; }
.stat { border: 1px solid var(--line); border-radius: 8px; padding: .7rem .9rem; background: #FAFBFD; }
.stat-n { font-family: var(--font-head); font-size: 1.7rem; font-weight: 700; color: var(--navy); line-height: 1.1; }
.stat-l { font-size: .82rem; color: var(--muted); }
.stat-flag { border-color: var(--gold); background: #FFFAEB; }
.rule-box { border: 1px solid var(--line); border-radius: 8px; padding: .55rem .9rem; margin: .5rem 0; background: #FAFBFD; }
.rule-box summary { cursor: pointer; font-weight: 600; color: var(--navy); }
.rule-box ul { padding-left: 1.2rem; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 2px solid var(--line); margin: 1.4rem 0 .8rem; }
.tabs button { font: inherit; font-weight: 600; background: none; border: 0; border-bottom: 3px solid transparent; padding: .6rem .9rem; margin-bottom: -2px; cursor: pointer; color: var(--muted); min-height: 44px; }
.tabs button[aria-selected=true] { color: var(--navy); border-bottom-color: var(--gold); }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filters .field { min-width: 160px; }
.filters .grow { flex: 1 1 240px; }
.chip { font: inherit; font-size: .88rem; background: var(--info-bg); color: var(--navy); border: 1px solid #B4C2E3; border-radius: 999px; padding: .4rem .8rem; cursor: pointer; min-height: 42px; font-family: var(--font-mono); }

/* ---------- tabel ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { padding: .5rem .7rem; text-align: left; vertical-align: top; border-bottom: 1px solid #E8EBF2; }
th { background: #EEF1F8; color: var(--navy); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
table.plain td, table.plain th { font-size: .93rem; }
table.plain th { text-transform: none; letter-spacing: 0; font-size: .9rem; position: static; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.mono { font-family: var(--font-mono); font-size: .85rem; white-space: nowrap; }
td.reason { min-width: 260px; max-width: 420px; font-size: .85rem; color: var(--muted); }
td.wide { min-width: 200px; max-width: 360px; white-space: normal; overflow-wrap: anywhere; font-size: .85rem; }
tr.is-header td { background: #F0F2F7; color: var(--muted); font-style: italic; }
.row-tag { display: inline-block; font-size: .7rem; padding: .05rem .4rem; border-radius: 4px; background: var(--gold); color: var(--navy); font-weight: 700; margin-right: .25rem; }
.row-tag-2 { background: var(--teal); color: #fff; }
.btn-link { font: inherit; background: none; border: 0; color: var(--navy-2); text-decoration: underline; cursor: pointer; padding: .2rem; min-height: 32px; }
.pager { display: flex; align-items: center; gap: .6rem; margin: .7rem 0 0; flex-wrap: wrap; font-size: .9rem; color: var(--muted); }
.pager .btn { min-height: 38px; padding: .3rem .8rem; }

/* ---------- bilah proses ---------- */
.busy { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 3px solid var(--gold); box-shadow: 0 -4px 16px rgba(24,32,58,.15); z-index: 50; padding: .7rem 0; }
.busy-inner { display: flex; align-items: center; gap: 1rem; }
.busy-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .3rem; font-weight: 600; color: var(--navy); }
progress { width: 100%; height: 10px; accent-color: var(--teal); }

.footer { border-top: 1px solid var(--line); background: #fff; padding: 22px 0 28px; font-size: .9rem; color: var(--muted); }

@media (max-width: 560px) {
  .card { padding: 18px 14px; }
  .hero { padding: 32px 0 38px; }
  h2 { font-size: 1.2rem; }
  .hero-actions .btn, .actions .btn { flex: 1 1 100%; }
  .busy-inner { flex-direction: column; align-items: stretch; gap: .5rem; }
  .check p, .param { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
