/* ==========================================================================
   Import & Preview Rekap Nilai — STIKes AKBID Wijaya Husada
   Gaya: editorial admin, tenang & presisi. Satu warna aksen (teal tua).
   ========================================================================== */

/* ---------- 1. Token warna & ukuran ---------- */
:root {
  /* Kanvas & panel */
  --canvas:        #f7f6f3;
  --surface:       #ffffff;
  --surface-sunk:  #fbfaf8;
  --surface-alt:   #f1efea;
  --line:          #e0ddd5;
  --line-strong:   #cfcabd;

  /* Teks */
  --ink:           #1d1c1a;
  --ink-soft:      #55524c;
  --ink-faint:     #7d7972;

  /* Aksen tunggal: teal tua */
  --accent:        #0f5f5c;
  --accent-hover:  #0b4a48;
  --accent-ink:    #ffffff;
  --accent-wash:   #e6f0ef;

  /* Status */
  --err-bg:        #fdeceb;
  --err-ink:       #a01d16;
  --err-line:      #e2a9a4;
  --warn-bg:       #fdf5e3;
  --warn-ink:      #7a5407;
  --warn-line:     #e3cd93;

  /* Bentuk */
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;

  /* Tipografi */
  --font-ui: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas:        #16171a;
    --surface:       #1e2023;
    --surface-sunk:  #1a1c1f;
    --surface-alt:   #26292d;
    --line:          #33373c;
    --line-strong:   #454a50;

    --ink:           #ecebe8;
    --ink-soft:      #b3b1ab;
    --ink-faint:     #8d8b85;

    --accent:        #4fb3ab;
    --accent-hover:  #6cc6bf;
    --accent-ink:    #0d1614;
    --accent-wash:   #17302f;

    --err-bg:        #3a1d1b;
    --err-ink:       #ff9d92;
    --err-line:      #6d3531;
    --warn-bg:       #33290f;
    --warn-ink:      #f0cd76;
    --warn-line:     #5d4a1c;
  }
}

/* ---------- 2. Dasar ---------- */
*, *::before, *::after { box-sizing: border-box; }

/* Beberapa komponen memakai `display` eksplisit (grid/flex) yang menimpa
 * `[hidden]` bawaan peramban. Aturan ini mengembalikan perilaku hidden. */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .92em;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: .05em .35em;
}

.wrap {
  width: 100%;
  max-width: 1320px;
  margin-inline: auto;
  padding-inline: 20px;
}

main.wrap { min-width: 0; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 16px;
  border-radius: 0 0 var(--r-md) 0;
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* ---------- 3. Masthead ---------- */
.masthead {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}

.masthead-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 32px;
  padding-block: 22px 20px;
}

.brand { display: flex; align-items: center; gap: 14px; }

.brand-mark {
  flex: none;
  width: 42px; height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .04em;
}

.brand-eyebrow {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--ink-faint);
}

h1 {
  font-size: clamp(24px, 3.4vw, 32px);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
}

.masthead-note {
  max-width: 46ch;
  font-size: 13px;
  color: var(--ink-soft);
}

/* ---------- 4. Panel & label section ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  min-width: 0;
}

.section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-faint);
  margin-bottom: 14px;
}

.panel-head { margin-bottom: 14px; }
.panel-title { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.panel-note { font-size: 12.5px; color: var(--ink-soft); margin-top: 3px; }

/* ---------- 5. Tombol ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  padding: 10px 16px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color .14s ease, border-color .14s ease, color .14s ease;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--line-strong);
}
.btn-ghost:hover { background: var(--surface-alt); color: var(--ink); }

.btn[disabled], .btn[aria-disabled="true"] {
  opacity: .5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ---------- 6. Dual inputs layout ---------- */
.dual-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 14px;
}

@media (max-width: 799px) {
  .dual-inputs { grid-template-columns: 1fr; }
}

.input-col { min-width: 0; }

.input-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-soft);
  margin-bottom: 10px;
}

/* ---------- 7. Dropzone ---------- */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 32px 16px 28px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--surface-sunk);
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
  min-width: 0;
}
.dropzone:hover { border-color: var(--accent); }
.dropzone.is-over {
  border-color: var(--accent);
  border-style: solid;
  background: var(--accent-wash);
}

.dz-icon { width: 28px; height: 28px; color: var(--ink-faint); flex-shrink: 0; }
.dropzone.is-over .dz-icon { color: var(--accent); }

.dz-title { font-size: 14px; font-weight: 600; }
.dz-hint { font-size: 12px; color: var(--ink-soft); }
.dropzone .btn { margin-top: 6px; }

/* ---------- 7. Baris file & status ---------- */
.file-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-sunk);
}

.file-badge {
  flex: none;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  padding: 5px 7px;
  border-radius: var(--r-sm);
  background: var(--accent-wash);
  color: var(--accent);
  border: 1px solid var(--accent);
}

.file-bar-info { flex: 1; min-width: 0; }
.file-name {
  display: block;
  font-weight: 600;
  font-size: 13.5px;
  overflow-wrap: anywhere;
}
.file-size { font-size: 12px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }

/* Penanda halus: berkas dipulihkan dari sesi sebelumnya (bukan impor baru). */
.file-restored {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--ink-soft);
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-alt);
  white-space: nowrap;
}
.file-restored::before {
  content: "";
  flex: none;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--ink-soft);
}

.spinner {
  flex: none;
  width: 15px; height: 15px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2.4s; }
}

.alert {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink-faint);
  border-radius: var(--r-md);
  font-size: 13px;
  background: var(--surface-alt);
  color: var(--ink);
}
.alert-warn { background: var(--warn-bg); border-color: var(--warn-line); border-left-color: var(--warn-ink); color: var(--warn-ink); }
.alert-error { background: var(--err-bg); border-color: var(--err-line); border-left-color: var(--err-ink); color: var(--err-ink); }
.alert strong { display: block; margin-bottom: 3px; }
.alert .btn { margin-top: 10px; }

/* ---------- 8. Hasil ---------- */
.results { margin-top: 26px; display: grid; gap: 18px; }

/* Grid item default `min-width: auto` — tanpa ini tabel lebar memaksa seluruh
 * halaman ikut melebar, bukan hanya wrapper tabel yang scroll. */
.results > * { min-width: 0; }

.results-head .section-label { margin-bottom: 8px; }
.preview-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.015em;
  overflow-wrap: anywhere;
}
.preview-subtitle { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }

/* ---------- 9. Kartu ringkasan (stat tiles) ---------- */
/* Flexbox (bukan grid) supaya baris terakhir ikut mengisi lebar penuh —
 * jumlah kartu tidak pernah membagi rata kolom, grid akan menyisakan lubang. */
.tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.tile {
  flex: 1 1 150px;
  background: var(--surface);
  padding: 14px 16px;
  min-width: 0;
}
.tile-wide { flex: 2 1 300px; }

.tile-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--ink-faint);
  margin-bottom: 6px;
}

.tile-value {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.tile-value.is-text { font-size: 15px; font-weight: 600; }
.tile-value .unit { font-size: 12px; font-weight: 500; color: var(--ink-faint); margin-left: 3px; }

/* ---------- 10. Tab sheet ---------- */
.tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
  scrollbar-width: thin;
}

.tab {
  flex: none;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: var(--r-md) var(--r-md) 0 0;
  padding: 9px 14px;
  cursor: pointer;
  white-space: nowrap;
  margin-bottom: -1px;
}
.tab:hover { background: var(--surface-alt); color: var(--ink); }
.tab[aria-selected="true"] {
  background: var(--surface);
  border-color: var(--line);
  border-bottom: 1px solid var(--surface);
  color: var(--accent);
  box-shadow: inset 0 2px 0 var(--accent);
}
.tab-meta { font-weight: 500; color: var(--ink-faint); font-variant-numeric: tabular-nums; }

/* ---------- 11. Tabel preview ---------- */
.table-host {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow: auto;
  max-width: 100%;
  max-height: min(72vh, 720px);
  overscroll-behavior-x: contain;
}

.tbl {
  border-collapse: separate;
  border-spacing: 0;
   table-layout: auto;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

 .tbl th, .tbl td {
   border-right: 1px solid var(--line);
   border-bottom: 1px solid var(--line);
   padding: 5px 8px;
   text-align: left;
   vertical-align: top;
   white-space: nowrap;
   overflow-wrap: anywhere;
   background: var(--surface);
 }

/* Nomor kolom Excel (baris penanda) */
.tbl td.cell-rownum,
.tbl th.cell-rownum {
  text-align: right;
  color: var(--ink-faint);
  font-size: 10.5px;
  background: var(--surface-alt);
  padding-inline: 6px;
  user-select: none;
}

/* --- Header bertingkat ---
   --st diisi oleh JS (offset kumulatif tinggi baris header) supaya tiap
   baris header bertingkat menempel tepat di bawah baris di atasnya. */
.tbl thead th {
  position: sticky;
  top: var(--st, 0px);
  z-index: 3;
  background: var(--surface-alt);
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  text-align: center;
  vertical-align: middle;
  line-height: 1.3;
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}

/* Baris judul (R1) & subjudul (R2) */
.tbl thead tr.row-title th {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
  text-transform: none;
  text-align: left;
  color: var(--ink);
  background: var(--surface);
  padding: 10px 12px;
}
.tbl thead tr.row-title-sub th {
  font-size: 12.5px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  text-align: left;
  color: var(--ink-soft);
  background: var(--surface);
  padding: 7px 12px;
}

.tbl th.cell-banner {
  text-align: left;
  /* Tanpa batas lebar, sel colspan penuh melebar mengikuti seluruh tabel
   * sehingga teks judul ikut hilang saat digeser. Batasi ke lebar area
   * pandang lalu tempelkan teksnya ke kiri. */
  max-width: 100cqw;
}

.tbl th.cell-banner .banner-text {
  position: sticky;
  left: 0;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tbl thead tr.row-colnum th {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--ink-faint);
  background: var(--surface-sunk);
  padding: 2px 6px;
}

/* --- Kolom identitas sticky (NO / NAMA / NIM) --- */
.tbl th.is-sticky, .tbl td.is-sticky {
  position: sticky;
  left: var(--sl, 0);
  z-index: 2;
  background: var(--surface);
  border-right: 1px solid var(--line-strong);
}
.tbl thead th.is-sticky { z-index: 4; }

.tbl td.col-nama { font-weight: 500; }

/* --- Sel angka --- */
.tbl td.is-num { text-align: right; }

/* --- Sel error Excel --- */
.tbl td.is-error {
  background: var(--err-bg);
  color: var(--err-ink);
  font-weight: 600;
  text-align: right;
  cursor: help;
  box-shadow: inset 0 0 0 1px var(--err-line);
}

/* --- Baris agregat MIN / MAX / AVERAGE --- */
.tbl tr.row-agg td,
.tbl tr.row-agg th {
  background: var(--surface-alt);
  font-weight: 700;
  color: var(--ink);
  border-top: 1px solid var(--line-strong);
}
.tbl tr.row-agg th.cell-rownum,
.tbl tr.row-agg td.cell-rownum { font-weight: 600; }

.tbl tr.row-agg td.col-agg,
.tbl tr.row-agg th.col-agg {
  text-align: left;
  vertical-align: middle;
}

.agg-label {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  padding: 2px 6px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
}

/* --- Baris bertanda error --- */
.tbl tr.row-error td { background: color-mix(in srgb, var(--err-bg) 42%, var(--surface)); }
.tbl tr.row-error th.cell-rownum,
.tbl tr.row-error td.cell-rownum {
  border-left: 3px solid var(--err-ink);
  color: var(--err-ink);
  font-weight: 700;
}
.tbl tr.row-error td.is-sticky,
.tbl tr.row-error th.is-sticky { background: color-mix(in srgb, var(--err-bg) 42%, var(--surface)); }

/* --- Sel kosong --- */
.tbl td.is-blank { background: var(--surface); }

.empty-note {
  padding: 22px 16px;
  font-size: 13px;
  color: var(--ink-faint);
  text-align: center;
}

/* --- Keterangan --- */.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--ink-soft);
}
.legend-item { display: inline-flex; align-items: center; gap: 7px; }
.swatch {
  width: 13px; height: 13px;
  border-radius: 3px;
  border: 1px solid var(--line-strong);
  flex: none;
}
.swatch-err { background: var(--err-bg); border-color: var(--err-line); }
.swatch-agg { background: var(--surface-alt); }
.swatch-sticky {
  background: var(--surface);
  border-left: 3px solid var(--err-ink);
}

/* ---------- 12. Tabel ringkasan mahasiswa ---------- */
.summary-panel { margin-top: 0; }

details.summary-box > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
  list-style: none;
  padding: 2px 0;
}
details.summary-box > summary::-webkit-details-marker { display: none; }
details.summary-box > summary::before {
  content: "";
  width: 7px; height: 7px;
  border-right: 1.6px solid var(--ink-faint);
  border-bottom: 1.6px solid var(--ink-faint);
  transform: rotate(-45deg);
  transition: transform .15s ease;
  flex: none;
  margin-left: 2px;
}
details.summary-box[open] > summary::before { transform: rotate(45deg); }

.summary-note { font-size: 12.5px; color: var(--ink-soft); margin: 8px 0 14px; }

.table-host.is-short { max-height: none; }

.tbl-2 thead th { top: 0; }

.tbl-2 td.col-mk { text-align: center; white-space: nowrap; }
.mk-letter {
  display: inline-block;
  min-width: 26px;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: var(--r-sm);
}
.mk-letter.is-fail { background: var(--err-bg); color: var(--err-ink); }
.mk-mutu {
  display: block;
  font-size: 10px;
  color: var(--ink-faint);
  font-weight: 500;
}
.tbl-2 td.col-ip { text-align: right; font-weight: 600; }
.tbl-2 td.col-ip .est {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: var(--warn-ink);
}

/* ---------- 13. Tabel nilai remedial mahasiswa ---------- */
/* Memakai palet error yang sudah ada (--err-bg / --err-ink) sebagai penanda
 * "di bawah KKM" — tidak ada warna baru. */
.remedial-stats {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin: 0 0 10px;
  font-variant-numeric: tabular-nums;
}

.remedial-key {
  display: inline-block;
  padding: 1px 6px;
  border-radius: var(--r-sm);
  background: var(--err-bg);
  border: 1px solid var(--err-line);
  color: var(--err-ink);
  font-weight: 600;
  font-size: 11.5px;
}

.remedial-tbl thead th[colspan] { white-space: normal; }

.tbl td.is-remedial {
  background: color-mix(in srgb, var(--err-bg) 62%, var(--surface));
  color: var(--err-ink);
  font-weight: 700;
  cursor: help;
}

.tbl td.remedial-dash { color: var(--ink-faint); text-align: right; }

.tbl td.col-need { text-align: right; font-weight: 600; color: var(--ink-soft); }
.tbl td.col-need.is-low { color: var(--err-ink); font-weight: 700; }

/* --- Baris bobot + kolom input Remedial / hasil hitung --- */
.rem-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.btn-sm { padding: 7px 12px; font-size: 12px; min-height: 30px; }
.rem-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Baris bobot: satu baris di bawah header, input number kecil per kolom. */
.tbl tr.row-weight th { background: var(--surface-sunk); font-size: 10.5px; }
.tbl tr.row-weight th.w-dash { color: var(--ink-faint); font-weight: 400; }
.w-note { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--ink-faint); }

/* Input number rapi: jelas bisa diisi, fokus ring terlihat. */
.rem-in {
  width: 100%;
  min-width: 0;
  font: inherit;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 3px 6px;
}
.rem-in:hover { border-color: var(--accent); }
.rem-in:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
  background: var(--surface);
}
.tbl tr.row-weight .rem-in { text-align: center; }

/* Komponen di atas KKM: input tetap tampil (jaga alignment kolom) tapi tidak
 * bisa diketik. Redup dan teksnya tetap terbaca. */
.rem-in:disabled {
  cursor: not-allowed;
  opacity: .55;
  background: var(--surface-alt);
  color: var(--ink-soft);
  border-color: var(--line);
}
.rem-in:disabled:hover { border-color: var(--line); }

/* Isian di luar rentang 0–100 ditandai, tidak diterima diam-diam. */
.rem-in.is-invalid {
  border-color: var(--err-line);
  background: var(--err-bg);
  color: var(--err-ink);
}

/* Sel hasil hitung */
.tbl td.is-rem-cell { padding: 4px 5px; }
/* HASIL komponen: hasil campuran asli & remedial — penekanan ringan. */
.tbl td.is-hasil {
  text-align: right;
  font-weight: 600;
  color: var(--ink);
  background: color-mix(in srgb, var(--accent-wash) 55%, var(--surface));
}
.tbl td.is-final { text-align: right; font-weight: 700; color: var(--ink); }
.tbl td.is-mutu { text-align: center; }
.tbl td.is-huruf { text-align: center; font-weight: 700; }

/* ---------- 13b. Rekonsiliasi ---------- */
 .reconcile-tbl { table-layout: auto; }
 .reconcile-tbl th, .reconcile-tbl td { white-space: nowrap; vertical-align: middle; }
 .reconcile-tbl td.recon-cell { text-align: center; white-space: nowrap; }
 .reconcile-tbl td.recon-status { text-align: center; font-size: 11.5px; font-weight: 600; }
.recon-ok { color: var(--accent); }
.recon-bad { color: var(--err-ink); }
.recon-warn { color: var(--warn-ink); }
.recon-muted { color: var(--ink-faint); }
.recon-bad-bg { background: color-mix(in srgb, var(--err-bg) 42%, var(--surface)); }

.page-foot {
  margin-top: 34px;
  padding-block: 18px 26px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-faint);
}
.page-foot .wrap { display: grid; gap: 3px; }
.foot-note { color: var(--ink-faint); }

/* ---------- 15. Responsif ---------- */
@media (max-width: 720px) {
  .wrap { padding-inline: 14px; }
  .panel { padding: 16px 14px; }
  .rem-head { flex-direction: column; align-items: stretch; }
  .rem-actions { justify-content: stretch; }
  .masthead-inner { padding-block: 16px 14px; }
  .dropzone { padding: 26px 14px 24px; }
  /* Layar sempit: dua kartu per baris, kartu lebar memakan satu baris penuh. */
  .tile { flex: 1 1 40%; padding: 12px 13px; }
  .tile-wide { flex: 1 1 100%; }
  .tile-value { font-size: 19px; }
  .tile-value.is-text { font-size: 13px; }
  .table-host { max-height: 66vh; }
  .masthead-note { max-width: none; }
}

@media (max-width: 420px) {
  .tile-value { font-size: 17px; }
  .tile-label { font-size: 10px; letter-spacing: .06em; }
  .file-bar { flex-wrap: wrap; }
  .file-bar .btn { width: 100%; }
}
/* Identitas tidak sticky: semua kolom ikut bergeser saat scroll horizontal.
 * Hanya untuk layar sempit — di atasnya kolom identitas memang harus menempel. */
@media (max-width: 420px) {
  .tbl th.is-sticky, .tbl td.is-sticky { position: static !important; left: auto !important; }
}

/* ---------- 16. Cetak ---------- */
@media print {
 /* placeholder */
  .tbl thead th, .tbl td.is-sticky { position: static; }
}
