/* Minimalism institusional — tinta navy, garis rambut 1px, satu aksen emas untuk tenggat.
   Dial: ENERGY 1 / RHYTHM 2 / MOTION 1. Tanpa banner, tanpa bayangan offset, tanpa dekorasi. */
:root {
  --page: #f5f6f8;
  --surface: #ffffff;
  --ink: #1a2034;
  --muted: #5b6273;
  --line: #e2e5ec;
  --line-strong: #c9cdd8;
  --hover: #f3f4f7;
  --band: #f7f8fa;
  --track: #e9ebf1;
  --navy: #0b1566;
  --navy-deep: #0a1156;
  --navy-soft: #eef0fb;
  --gold: #b8863b;
  --ok: #1b7a3d;
  --ok-soft: #e8f5ec;
  --ok-line: #c3e3cd;
  --warn: #a34a06;
  --warn-soft: #fdf0e3;
  --err: #b3261e;
  --err-soft: #fdeceb;
  --err-line: #f3c6c3;
  --radius: 8px;
  --radius-lg: 12px;
  --space: clamp(1rem, 3vw, 2rem);
}

* { box-sizing: border-box; }

html { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

::selection { background: var(--navy); color: #ffffff; }
#view-archive table { min-width: 760px; }
#view-archive th:last-child { width: 48%; }
input, textarea { caret-color: var(--navy); }

button, input, select, textarea { font: inherit; color: inherit; }

button, .button {
  cursor: pointer;
  min-height: 44px;
  padding: .6rem 1.15rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

button:hover:not(:disabled), .button:hover { background: var(--hover); border-color: var(--line-strong); }
button:active:not(:disabled), .button:active { background: var(--track); }
button:disabled { cursor: not-allowed; opacity: .5; }

.primary { background: var(--navy); border-color: var(--navy); color: #ffffff; }
.primary:hover:not(:disabled) { background: var(--navy-deep); border-color: var(--navy-deep); color: #ffffff; }
.secondary { background: var(--surface); color: var(--ink); }

:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

input:not([type="checkbox"]), select, textarea {
  display: block;
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: .65rem .9rem;
  background: var(--surface);
  color: var(--ink);
  font-weight: 400;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px var(--navy-soft);
}

input::placeholder, textarea::placeholder { color: var(--muted); font-weight: 400; opacity: 1; }

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--navy);
  flex-shrink: 0;
  cursor: pointer;
}

input[readonly] { background: var(--hover); }

label {
  display: block;
  font-weight: 600;
  font-size: .95rem;
  color: var(--ink);
}

label > input, label > select, label > textarea { margin-top: .4rem; }

h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.2; text-wrap: balance; color: var(--ink); font-weight: 700; }

h1 { font-size: clamp(2.1rem, 4vw, 2.9rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.25rem, 2.2vw, 1.5rem); }
h3 { font-size: 1.05rem; font-weight: 600; }

a { color: var(--navy); text-underline-offset: 3px; font-weight: 500; }

[hidden] { display: none !important; }

.skip {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 30;
  padding: .75rem 1.25rem;
  background: var(--navy);
  color: #ffffff;
  border-radius: var(--radius);
  font-weight: 600;
}

.skip:focus { top: 1rem; }

.wrap { width: min(1240px, calc(100% - var(--space) * 2)); margin-inline: auto; }

/* Shell: kolom sidebar di desktop, bilah bawah di mobile */
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); }

.shell-main { min-width: 0; }

.side {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.masthead { border-bottom: 1px solid var(--line); }

.identity { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; padding: 1.3rem 1.25rem 1.15rem; }

.wordmark {
  color: var(--navy);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.school { font-size: .85rem; font-weight: 500; line-height: 1.35; color: var(--muted); }

.nav-list {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  padding: 1rem .8rem 1.25rem;
  overflow-y: auto;
}

.nav-list button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: .7rem;
  width: 100%;
  min-height: 44px;
  padding: .65rem .85rem;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: .93rem;
  text-align: left;
}

.nav-list button:hover:not([aria-current="page"]) { background: var(--band); color: var(--ink); }

.nav-list button[aria-current="page"] { background: var(--navy-soft); color: var(--navy); }

.nav-list svg { flex-shrink: 0; }

.label-short { display: none; }

.header-actions {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-wrap: wrap;
  justify-content: end;
}

/* Hero: judul di kiri, tenggat di kanan, tanpa banner */
.hero {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 2rem;
  margin-block: 2rem 1.5rem;
}

.hero-title { min-width: 0; }

.kicker { font-size: .78rem; font-weight: 600; color: var(--muted); }

.deadline {
  padding: 1.1rem 1.35rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: .45rem;
  min-width: 270px;
  flex-shrink: 0;
}

.deadline .kicker { color: var(--muted); }

.date-day {
  display: inline;
  font-size: 2.4rem;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-right: .4rem;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.date-month { font-weight: 600; font-size: 1.05rem; color: var(--ink); }

.deadline-caption { font-size: .85rem; font-weight: 400; color: var(--muted); margin-top: .1rem; }

.countdown {
  background: var(--navy);
  color: #ffffff;
  border-radius: 999px;
  padding: .35rem .8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-size: .85rem;
  text-align: center;
  align-self: flex-start;
}

.countdown.warning { background: var(--warn); }
.countdown.urgent { background: var(--err); }

/* Workspace dan panel */
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.75rem;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  min-width: 0;
  overflow: hidden;
}

.panel-heading {
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.panel-body { padding: 1.5rem; }

.form-section + .form-section {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.fields { display: grid; gap: 1rem; }
.two-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }

fieldset { border: 0; padding: 0; margin: .85rem 0 0; min-width: 0; }

legend { font-weight: 600; margin-bottom: .5rem; color: var(--ink); }

.fieldset-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: .5rem;
}

.class-toggles { display: flex; align-items: center; gap: .5rem; font-size: .85rem; }

.text-btn {
  background: transparent;
  border: 0;
  padding: .25rem .35rem;
  min-height: 36px;
  color: var(--navy);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
}

.text-btn:hover { background: transparent; color: var(--navy-deep); text-decoration: underline; }

.classes { display: flex; gap: .6rem; flex-wrap: wrap; }

.class-option {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-height: 44px;
  padding: .5rem .95rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 500;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}

.class-option:hover { border-color: var(--navy); }

.class-option:has(input:checked) {
  background: var(--navy-soft);
  border-color: var(--navy);
  color: var(--navy);
  font-weight: 600;
}

.file-zone {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  background: var(--surface);
  transition: background 150ms ease, border-color 150ms ease;
}

.file-zone.dragging { background: var(--navy-soft); border-color: var(--navy); }

.file-zone input { background: var(--surface); padding: .4rem; border-radius: var(--radius); }

input::file-selector-button {
  background: var(--navy);
  color: #ffffff;
  padding: .55rem 1rem;
  border: 0;
  border-radius: 6px;
  margin-right: .75rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

input::file-selector-button:hover { background: var(--navy-deep); }

.file-limit { margin-top: .75rem; font-size: .85rem; font-weight: 400; color: var(--muted); }

.file-total { margin: .5rem 0 0; font-size: .85rem; font-weight: 600; }
.file-total.over { color: var(--warn); }

.file-list {
  padding-left: 1.25rem;
  margin: .75rem 0 0;
  overflow-wrap: anywhere;
  font-size: .85rem;
}

.form-actions {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 1.75rem;
}

.form-actions .primary { min-width: 220px; }

/* Panel samping: tanggungan */
.summary-list { padding: 0; margin: 0; list-style: none; }

.summary-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  gap: 1rem;
  font-weight: 500;
  color: var(--muted);
}

.summary-list li + li { border-top: 1px solid var(--line); }

.summary-list strong {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.summary-progress { padding: .9rem 1.5rem 1.15rem; }

.teacher-receipt-history { padding: 1rem 1.5rem; border-top: 1px solid var(--line); }

.teacher-history-title {
  margin-top: .25rem;
  margin-bottom: .6rem;
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.receipt-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.receipt-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  font-size: .85rem;
  padding: .5rem .75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.receipt-history-item button { font-size: .78rem; padding: .3rem .6rem; min-height: 34px; }

/* Status dan utilitas */
.status {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-block: 1rem;
  background: var(--navy-soft);
  color: var(--ink);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.status.error { background: var(--err-soft); color: var(--err); border-color: var(--err-line); }

.status.success { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }

.status p + p { margin-top: .5rem; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* Toolbar filter */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: .85rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--line);
}

.toolbar label { flex: 1 1 160px; font-size: .85rem; font-weight: 600; color: var(--muted); }
.toolbar .search { flex-grow: 2; }
.toolbar input, .toolbar select { min-height: 46px; }

/* Tabel */
.table-scroll { width: 100%; overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }

/* Petunjuk geser: tepi kanan memudar hanya saat konten meluber dan belum mencapai ujung. */
.table-scroll.is-scrollable:not(.at-end) {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
}

table { border-collapse: collapse; width: 100%; font-size: .9rem; text-align: left; }

th {
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--line-strong);
  text-transform: uppercase;
  font-size: .78rem;
  letter-spacing: .04em;
}

th, td { padding: .8rem 1rem; vertical-align: top; }

td { border-bottom: 1px solid var(--line); overflow-wrap: anywhere; min-width: 100px; }

td:first-child:has(input) { min-width: 44px; }
td .sub { display: block; margin-top: .2rem; color: var(--muted); font-size: .8rem; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: var(--band); }

.table-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.table-actions button, .table-actions a { font-size: .8rem; padding: .4rem .75rem; min-height: 38px; }

.status-label {
  display: inline-block;
  padding: .2rem .7rem;
  font-weight: 600;
  font-size: .78rem;
  border-radius: 999px;
  white-space: nowrap;
}

.status-label.done { background: var(--ok-soft); color: var(--ok); }
.status-label.missing { background: var(--warn-soft); color: var(--warn); }

.empty { padding: 3rem 1.5rem; text-align: center; color: var(--muted); }

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  padding: 1.1rem 1.5rem;
  border-top: 1px solid var(--line);
  font-size: .85rem;
  color: var(--muted);
}

.load-state {
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .75rem;
}

.load-state button { margin-top: 0; }
.reference-state { padding: 1rem 1.25rem; }
.reference-state .status { margin-top: 0; }
.references-search .search { flex-basis: 400px; }

/* Dialog */
dialog {
  width: min(660px, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  color: var(--ink);
  box-shadow: 0 16px 48px rgba(18, 22, 45, 0.16);
}

dialog::backdrop { background: rgba(15, 18, 32, 0.45); }

.dialog-heading {
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.dialog-heading h2 { font-size: 1.2rem; }

.dialog-heading button {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 1.3rem;
  font-weight: 600;
}

.dialog-heading button:hover { background: var(--hover); color: var(--ink); }

.dialog-body { padding: 1.5rem; overflow-y: auto; }

.dialog-actions {
  padding: 1.15rem 1.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: end;
  flex-wrap: wrap;
  gap: .85rem;
}

.dialog-details { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .6rem 1.25rem; }

.dialog-details dt { color: var(--muted); font-weight: 500; }

.dialog-details dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

.dialog-details .warn-text { color: var(--warn); font-weight: 600; }

#preview-dialog { width: min(1100px, calc(100% - 2rem)); }
#preview-frame { width: 100%; height: 65dvh; border: 1px solid var(--line); border-radius: var(--radius); background: #ffffff; display: block; }
#notice { scroll-margin-top: 1rem; }

/* Wizard referensi */
.wizard-stepper {
  display: flex;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.wizard-step {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  padding: .9rem 1.1rem;
  border: 0;
  background: transparent;
  font-weight: 600;
  font-size: .92rem;
  color: var(--muted);
  text-align: left;
  white-space: nowrap;
  border-radius: 0;
  min-height: 52px;
  cursor: pointer;
  position: relative;
  transition: color 150ms ease;
}

.wizard-step:last-child { justify-content: flex-start; }
.wizard-step:hover:not([aria-current="step"]) { background: transparent; color: var(--ink); }

.wizard-step .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 600;
  flex-shrink: 0;
}

.wizard-step[aria-current="step"] { color: var(--navy); }

.wizard-step[aria-current="step"] .step-num { background: var(--navy); border-color: var(--navy); color: #ffffff; }

.wizard-step[aria-current="step"]::after {
  content: "";
  position: absolute;
  left: 1.1rem;
  right: 1.1rem;
  bottom: -1px;
  height: 2px;
  background: var(--navy);
}

.wizard-step.is-done .step-num { background: var(--ok-soft); border-color: transparent; color: var(--ok); }

.wizard-pane { min-width: 0; }

.wizard-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--band);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.wizard-summary-content { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }

.wizard-summary-label { font-weight: 600; font-size: .85rem; color: var(--muted); }

.wizard-badges { display: inline-flex; gap: .5rem; flex-wrap: wrap; }

.wizard-badge {
  display: inline-block;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: .2rem .7rem;
  background: var(--surface);
  font-size: .8rem;
  font-weight: 500;
  color: var(--ink);
}

.wizard-footer-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.15rem 1.5rem;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
  gap: .85rem;
}

/* Kemajuan */
.progress-container { margin-bottom: 1.5rem; }

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-size: .9rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: .5rem;
}

.progress-header strong, .upload-progress-info strong {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.progress-bar-track {
  width: 100%;
  height: 8px;
  background: var(--track);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 100%;
  background: var(--navy);
  border-radius: 999px;
  transform-origin: left center;
  transform: scaleX(var(--progress, 0));
  transition: transform 200ms ease;
  will-change: transform;
}

.small-track { height: 6px; }

.upload-progress-wrap {
  flex: 1 1 240px;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.upload-progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .85rem;
  color: var(--muted);
}

/* Metrik pemantauan */
.metrics-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }

.metric-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .2rem;
  padding: 1.1rem 1.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
  min-height: 52px;
}

.metric-card:hover { border-color: var(--line-strong); background: var(--band); }

.metric-card.active { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); background: var(--band); }

.metric-num {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.metric-label { font-size: .85rem; font-weight: 500; color: var(--muted); }

.text-done { color: var(--ok); }
.text-missing { color: var(--warn); }

/* Pilihan massal arsip */
.bulk-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .85rem 1.5rem;
  background: var(--navy-soft);
  border-bottom: 1px solid var(--line);
  gap: 1rem;
  flex-wrap: wrap;
}

.bulk-info { font-weight: 600; font-size: .9rem; color: var(--navy); }

.bulk-actions { display: flex; gap: .65rem; align-items: center; }

.archive-file-entry { padding-block: .35rem; }
.archive-file-entry + .archive-file-entry { margin-top: .5rem; border-top: 1px dashed var(--line); padding-top: .5rem; }

/* Tanda terima */
#receipt-dialog { width: min(680px, calc(100% - 2rem)); }

.receipt-header {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--line);
}

.receipt-header h3 { font-size: 1.1rem; margin-bottom: .15rem; }

.receipt-status-wrap { margin-bottom: 1.25rem; }

.receipt-details {
  border: 1px solid var(--line);
  background: var(--band);
  padding: 1.25rem;
  border-radius: var(--radius);
}

.receipt-note {
  margin-top: 1.25rem;
  padding: .9rem 1.1rem;
  background: var(--band);
  border-radius: var(--radius);
  color: var(--muted);
  font-style: italic;
}

/* WhatsApp */
.btn-whatsapp { background: #0e7a43; border-color: #0e7a43; color: #ffffff; }
.btn-whatsapp:hover:not(:disabled) { background: #0b6337; border-color: #0b6337; color: #ffffff; }

/* Media queries */
@media (max-width: 950px) {
  .shell { display: block; }
  .side { position: static; height: auto; display: block; border-right: 0; }
  .masthead { position: sticky; top: 0; z-index: 30; background: var(--surface); }
  .identity { flex-direction: row; align-items: center; gap: .85rem; padding: .85rem 1rem; }
  .nav-list {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 40;
    flex-direction: row;
    align-items: stretch;
    gap: .15rem;
    padding: .4rem .5rem calc(.4rem + env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--line);
    overflow: visible;
  }
  .nav-list button {
    flex: 1 1 0;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    gap: .3rem;
    min-height: 54px;
    padding: .45rem .2rem;
    font-size: .68rem;
    text-align: center;
  }
  .nav-list button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-list button:hover:not([aria-current="page"]) { background: transparent; color: var(--ink); }
  .nav-list button[aria-current="page"] { background: transparent; color: var(--navy); }
  .label-full { display: none; }
  .label-short { display: inline; }
  .shell-main { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  .workspace { grid-template-columns: minmax(0, 1fr) 280px; }
  .hero { flex-direction: column; align-items: stretch; }
  .deadline { min-width: auto; }
  .panel-body { padding: 1.25rem; }
}

@media (max-width: 740px) {
  .workspace { grid-template-columns: 1fr; }
  .hero { flex-direction: column; align-items: stretch; gap: 1.25rem; }
  .deadline { padding: 1rem; }
  .school { max-width: 170px; }
  .table-actions button, .table-actions a { min-height: 44px; padding: .5rem .85rem; }
  .summary-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .summary-list li { flex-direction: column; align-items: flex-start; gap: .35rem; padding: .85rem 1rem; }
  .summary-list li + li { border-top: 0; border-left: 1px solid var(--line); }
}

@media (max-width: 520px) {
  .metrics-grid { grid-template-columns: 1fr; gap: .75rem; }
  .metric-card { padding: 1rem 1.25rem; }
  .metric-num { font-size: 1.7rem; }
  .wizard-step { padding: .75rem .85rem; font-size: .85rem; gap: .4rem; }
  .wizard-step .step-num { width: 24px; height: 24px; font-size: .78rem; }
  .wizard-summary { padding: .85rem 1rem; }
  .identity { gap: .6rem; padding: .75rem .85rem; }
  .wordmark { font-size: 1.25rem; }
  .school { font-size: .8rem; line-height: 1.35; }
  .hero { margin-top: 1.25rem; }
  .date-day { font-size: 2.1rem; }
  .date-month { font-size: 1rem; }
  .countdown { font-size: .8rem; }
  .two-fields { grid-template-columns: 1fr; }
  .panel-heading { padding: 1rem; }
  .panel-body { padding: 1rem; }
  .summary-list li { font-size: .8rem; padding: .75rem .5rem; }
  .summary-list strong { font-size: 1.3rem; }
  .form-actions .primary { width: 100%; }
  .toolbar { padding: 1rem; }
  .toolbar label { flex-basis: 100%; }
  .toolbar > button { flex: 1 1 auto; }
  .dialog-body { padding: 1.15rem; }
  .dialog-details { grid-template-columns: 1fr; gap: .35rem; }
  .dialog-details dd { margin-bottom: .6rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
    transform: none !important;
  }
}

/* SweetAlert2 GESIT Theme & Real-time Progress Bar */
.swal2-popup.gesit-swal {
  font-family: inherit;
  border-radius: 14px;
  border: 1px solid rgba(11, 21, 102, 0.12);
  box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
  padding: 1.5rem;
}

.swal2-title.gesit-swal-title {
  color: #0F172A;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.gesit-swal-confirm-btn {
  background-color: #0B1566 !important;
  color: #FFFFFF !important;
  border: none !important;
  border-radius: 6px !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
  padding: 0.65rem 1.25rem !important;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
  cursor: pointer;
}
.gesit-swal-confirm-btn:hover {
  background-color: #152288 !important;
}

.gesit-swal-cancel-btn {
  background-color: #F8FAFC !important;
  color: #334155 !important;
  border: 1px solid #CBD5E1 !important;
  border-radius: 6px !important;
  font-weight: 500 !important;
  font-size: 0.9rem !important;
  padding: 0.65rem 1.25rem !important;
  cursor: pointer;
}
.gesit-swal-cancel-btn:hover {
  background-color: #E2E8F0 !important;
}

.gesit-swal-deny-btn {
  background-color: #F1F5F9 !important;
  color: #475569 !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: 6px !important;
  font-weight: 500 !important;
  font-size: 0.9rem !important;
  padding: 0.65rem 1.25rem !important;
  cursor: pointer;
}
.gesit-swal-deny-btn:hover {
  background-color: #E2E8F0 !important;
  color: #1E293B !important;
}

/* Real-Time Upload Progress Container */
.swal-upload-box {
  background-color: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 1rem 1.15rem;
  margin-top: 1rem;
  text-align: left;
}

.swal-file-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1E293B;
  margin-bottom: 0.625rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.swal-progress-track {
  width: 100%;
  height: 14px;
  background-color: #E2E8F0;
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.swal-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0B1566 0%, #1D4ED8 100%);
  border-radius: 9999px;
  transition: width 0.15s ease-out;
}

.swal-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: #1E293B;
  font-variant-numeric: tabular-nums;
}

.swal-progress-meta strong {
  color: #0B1566;
  font-weight: 700;
}

.swal-status-note {
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  color: #64748B;
  text-align: center;
  min-height: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.swal-status-note.processing {
  color: #B8863B;
  font-weight: 600;
}

.swal-confirm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin-top: 0.75rem;
  text-align: left;
}

.swal-confirm-table th {
  padding: 0.4rem 0.5rem;
  color: #64748B;
  font-weight: 500;
  width: 38%;
  vertical-align: top;
  border-bottom: 1px solid #F1F5F9;
}

.swal-confirm-table td {
  padding: 0.4rem 0.5rem;
  color: #0F172A;
  font-weight: 600;
  border-bottom: 1px solid #F1F5F9;
}

.swal-warn-box {
  background-color: #FFFBEB;
  border: 1px solid #FDE68A;
  color: #92400E;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8125rem;
  margin-top: 0.75rem;
  text-align: left;
}

@media print {
  .side, .hero, .toolbar, button, #preview-dialog, #confirm-dialog { display: none !important; }
  dialog::backdrop { background: none !important; }
  body { background: white; color: black; font-size: 11pt; }
  .wrap { width: 100%; }
  dialog[open]#receipt-dialog {
    display: block !important;
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 1.5rem !important;
    border: 2px solid #000 !important;
    box-shadow: none !important;
  }
  #receipt-dialog .dialog-heading button,
  #receipt-dialog .dialog-actions { display: none !important; }
  #receipt-dialog .dialog-heading { padding: 0 0 1rem !important; border-bottom: 2px solid #000 !important; }
  #receipt-dialog .dialog-heading h2 { color: #000 !important; font-size: 1.4rem !important; }
  .receipt-header .wordmark { color: #000 !important; }
  .receipt-details { border: 1px solid #000; background: #fff; }
  .receipt-note { background: #fff; color: #000; }
  .panel { border: 0; }
  table { font-size: 10pt; }
}
