/* ==========================================================================
   Department of Social Welfare — Daycare Licensing and Management System
   Design system: official, calm, high-contrast, print-aware
   ========================================================================== */

:root {
  --red: #b8122f;
  --red-dark: #8e0d24;
  --gold: #f2c200;
  --gold-soft: #fff6d6;
  --green: #0b6842;
  --green-dark: #084a2f;
  --green-soft: #e8f2ec;
  --ink: #16211b;
  --ink-soft: #34443b;
  --muted: #65736b;
  --line: #dbe3dd;
  --line-strong: #b9c6be;
  --bg: #f3f5f2;
  --card: #ffffff;
  --paper: #fffef9;
  --blue: #1f5f8b;
  --amber: #9a6200;
  --danger: #a3172c;
  --shadow-sm: 0 1px 2px rgba(17, 32, 24, .06), 0 1px 3px rgba(17, 32, 24, .05);
  --shadow-md: 0 8px 24px rgba(17, 32, 24, .08);
  --radius: 10px;
  --serif: Georgia, "Times New Roman", "Noto Serif", serif;
  --sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html { font-size: 15.5px; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-dark); text-decoration: underline; }
a.btn:hover { text-decoration: none; }

h1, h2, h3, h4, h5 { font-family: var(--serif); color: var(--ink); font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.5rem); line-height: 1.15; margin: 0 0 .45rem; }
h2 { font-size: 1.45rem; margin: 0 0 .5rem; }
h3 { font-size: 1.14rem; margin: 0 0 .5rem; }
p { margin: 0 0 .9rem; }
small, .small { font-size: .82rem; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: .86em; letter-spacing: .01em; }
.break-any { overflow-wrap: anywhere; word-break: break-word; }
.nowrap { white-space: nowrap; }
.text-end { text-align: right; }
.text-center { text-align: center; }
.w-100 { width: 100%; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .4rem; } .mt-2 { margin-top: .9rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2.2rem; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: .4rem; } .mb-2 { margin-bottom: .9rem; } .mb-3 { margin-bottom: 1.5rem; }
.hide { display: none !important; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link { position: fixed; top: -60px; left: 12px; z-index: 3000; background: #fff; color: var(--ink); padding: .7rem 1rem; border-radius: 6px; box-shadow: var(--shadow-md); }
.skip-link:focus { top: 10px; }

/* ---------- Government header ---------- */
.govbar {
  background: #0d1f17;
  color: #eaf1ed;
  font-size: .76rem;
  letter-spacing: .02em;
}
.govbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 34px; }
.govbar span { opacity: .86; }
.govbar a { color: #fff; }
.govbar .flag { display: inline-flex; height: 10px; width: 26px; margin-right: .5rem; border-radius: 2px; overflow: hidden; vertical-align: middle; }
.govbar .flag i { flex: 1; }
.govbar .flag i:nth-child(1) { background: #ce1126; }
.govbar .flag i:nth-child(2) { background: #fcd116; }
.govbar .flag i:nth-child(3) { background: #006b3f; }

.masthead {
  background: var(--card);
  border-bottom: 3px solid var(--green);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .02);
}
.masthead .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; padding: .8rem 0; }
.brand { display: flex; align-items: center; gap: .85rem; color: var(--ink); min-width: 0; }
.brand:hover { text-decoration: none; color: var(--ink); }
.brand img { height: 52px; width: auto; flex: none; }
.brand-text { min-width: 0; }
.brand-text .republic { display: block; font-family: var(--serif); font-weight: 700; font-size: 1rem; letter-spacing: .06em; text-transform: uppercase; line-height: 1.15; }
.brand-text .dept { display: block; font-size: .78rem; color: var(--muted); letter-spacing: .02em; }
.brand-text .system { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .16em; color: var(--green); font-weight: 600; margin-top: .18rem; }

.header-tools { display: flex; align-items: center; gap: .8rem; }
.header-tools .link-quiet { font-size: .84rem; color: var(--muted); }
.user-chip { display: flex; align-items: center; gap: .65rem; padding: .3rem .3rem .3rem .75rem; border: 1px solid var(--line); border-radius: 999px; background: #fbfcfb; }
.user-chip .who { line-height: 1.15; text-align: right; }
.user-chip .who strong { display: block; font-size: .82rem; font-weight: 650; }
.user-chip .who span { display: block; font-size: .7rem; color: var(--muted); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--green); color: #fff; font-weight: 700; font-size: .8rem; letter-spacing: .02em; }

/* ---------- Primary navigation ---------- */
.mainnav { background: var(--green-dark); color: #fff; position: sticky; top: 0; z-index: 900; }
.mainnav .wrap { display: flex; align-items: center; gap: .2rem; min-height: 48px; overflow-x: auto; scrollbar-width: none; }
.mainnav .wrap::-webkit-scrollbar { display: none; }
.mainnav .mobilebar { display: none; }
.mainnav a.navlink, .mainnav .drop > button {
  appearance: none; background: none; border: 0; cursor: pointer;
  color: rgba(255,255,255,.82); font: inherit; font-size: .86rem; font-weight: 550;
  padding: .78rem .82rem; white-space: nowrap; display: inline-flex; align-items: center; gap: .4rem;
  border-bottom: 3px solid transparent;
}
.mainnav a.navlink:hover, .mainnav .drop > button:hover { color: #fff; background: rgba(255,255,255,.07); text-decoration: none; }
.mainnav a.navlink.active, .mainnav .drop > button.active { color: #fff; border-bottom-color: var(--gold); background: rgba(255,255,255,.05); }
.mainnav .spacer { flex: 1; }
.mainnav .navlink.portal { color: var(--gold); font-weight: 650; }
.drop { position: relative; }
.drop-menu {
  position: absolute; top: calc(100% + 2px); left: 0; min-width: 230px; background: #fff; color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-md); padding: .4rem; display: none; z-index: 1000;
}
.drop.open .drop-menu { display: block; }
.drop-menu a { display: flex; gap: .6rem; align-items: center; padding: .5rem .65rem; border-radius: 7px; color: var(--ink); font-size: .86rem; }
.drop-menu a:hover { background: var(--green-soft); text-decoration: none; }
.drop-menu .sep { height: 1px; background: var(--line); margin: .35rem .4rem; }
.drop-menu .label { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: .45rem .65rem .2rem; }

.mobile-toggle {
  display: none; background: none; border: 1px solid rgba(255,255,255,.25); color: #fff; border-radius: 6px;
  padding: .38rem .55rem; font-size: 1.05rem; line-height: 1;
}

/* ---------- Layout ---------- */
.wrap { width: min(1240px, calc(100% - 2.5rem)); margin-inline: auto; }
.wrap-narrow { width: min(880px, calc(100% - 2.5rem)); margin-inline: auto; }
main.page { padding: 1.6rem 0 3.4rem; min-height: 60vh; }

.breadcrumb { display: flex; flex-wrap: wrap; gap: .35rem; font-size: .78rem; color: var(--muted); margin-bottom: .9rem; }
.breadcrumb a { color: var(--muted); }
.breadcrumb .sep { opacity: .5; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.25rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.page-head .eyebrow { font-size: .7rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--green); margin-bottom: .3rem; }
.page-head h1 { margin-bottom: .25rem; }
.page-head .lede { color: var(--muted); font-size: .95rem; max-width: 62ch; margin: 0; }
.page-actions { display: flex; gap: .55rem; flex-wrap: wrap; align-items: center; }

/* ---------- Cards & panels ---------- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); min-width: 0; max-width: 100%; }
.panel + .panel { margin-top: 1.1rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.2rem .85rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-head h2, .panel-head h3 { margin: 0; font-size: 1.08rem; }
.panel-head .sub { font-size: .8rem; color: var(--muted); margin-top: .1rem; }
.panel-body { padding: 1.2rem; }
.panel-body.tight { padding: .9rem 1.2rem; }
.panel-foot { padding: .8rem 1.2rem; border-top: 1px solid var(--line); background: #fafbfa; border-radius: 0 0 var(--radius) var(--radius); font-size: .82rem; color: var(--muted); }
.panel-foot.pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

.grid { display: grid; gap: 1.1rem; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.side { grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr); align-items: start; }
.grid.side-left { grid-template-columns: minmax(280px, .85fr) minmax(0, 1.9fr); align-items: start; }

/* ---------- Stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .9rem; margin-bottom: 1.2rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.05rem; position: relative; overflow: hidden; box-shadow: var(--shadow-sm); }
.stat::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--green); opacity: .85; }
.stat.gold::after { background: var(--gold); }
.stat.red::after { background: var(--red); }
.stat.blue::after { background: var(--blue); }
.stat .label { font-size: .72rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 600; }
.stat .value { font-family: var(--serif); font-size: 2rem; line-height: 1.1; margin: .35rem 0 .15rem; letter-spacing: -.02em; }
.stat .hint { font-size: .76rem; color: var(--muted); }
/* .k/.v/.d are the short-hand labels used by the administration and finance stat
   cards; they must stack and read like .label/.value/.hint, which only work because
   .label and .hint are display:block globally. Set the same here explicitly. */
.stat .k, .stat .v, .stat .d { display: block; }
.stat .k { font-size: .72rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 600; }
.stat .v { font-family: var(--serif); font-size: 2rem; line-height: 1.1; margin: .35rem 0 .15rem; letter-spacing: -.02em; }
.stat .d { font-size: .76rem; color: var(--muted); }
.stat a { font-size: .76rem; font-weight: 600; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--green); --btn-fg: #fff; --btn-bd: var(--green);
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .58rem 1rem; border-radius: 7px; border: 1px solid var(--btn-bd); background: var(--btn-bg); color: var(--btn-fg);
  font-size: .86rem; font-weight: 650; line-height: 1.2; cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--green-dark); border-color: var(--green-dark); color: #fff; text-decoration: none; }
.btn:focus-visible { outline: 3px solid rgba(11,104,66,.3); outline-offset: 2px; }
.btn[disabled], .btn.disabled { opacity: .55; pointer-events: none; }
.btn.gold { --btn-bg: var(--gold); --btn-fg: #241d00; --btn-bd: var(--gold); }
.btn.gold:hover { background: #dcb000; border-color: #dcb000; color: #241d00; }
.btn.danger { --btn-bg: #fff; --btn-fg: var(--danger); --btn-bd: #e6b7bf; }
.btn.danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { --btn-bg: #fff; --btn-fg: var(--ink-soft); --btn-bd: var(--line-strong); }
.btn.ghost:hover { background: #f3f6f4; color: var(--ink); border-color: #93a59a; }
.btn.quiet { --btn-bg: transparent; --btn-fg: var(--green); --btn-bd: transparent; padding-inline: .55rem; }
.btn.quiet:hover { background: var(--green-soft); color: var(--green-dark); text-decoration: none; }
.btn.sm { padding: .4rem .7rem; font-size: .78rem; border-radius: 6px; }
.btn.lg { padding: .8rem 1.35rem; font-size: .95rem; }
.btn.block { width: 100%; }
.btn-group { display: inline-flex; gap: .45rem; flex-wrap: wrap; align-items: center; }
.btn-group form { display: inline; margin: 0; }

.link-arrow { font-size: .82rem; font-weight: 650; display: inline-flex; align-items: center; gap: .3rem; }

/* ---------- Badges & chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .3rem; padding: .22rem .55rem; border-radius: 999px;
  font-size: .7rem; font-weight: 650; letter-spacing: .015em; line-height: 1.3;
  background: #eef1ef; color: var(--ink-soft); border: 1px solid transparent; white-space: nowrap;
}
.badge.green { background: var(--green-soft); color: var(--green-dark); }
.badge.gold { background: var(--gold-soft); color: #6b4c00; }
.badge.red { background: #fae9ec; color: var(--danger); }
.badge.blue { background: #e9f1f7; color: var(--blue); }
.badge.amber { background: #fbf1de; color: var(--amber); }
.badge.grey { background: #eef0ef; color: #55635b; }
.badge.outline { background: #fff; border-color: var(--line-strong); color: var(--ink-soft); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .32rem .65rem; border-radius: 7px; background: #f4f6f4; border: 1px solid var(--line); font-size: .76rem; color: var(--ink-soft); }

/* ---------- Alerts ---------- */
.alert { border-radius: var(--radius); border: 1px solid var(--line); background: #fff; padding: .85rem 1rem; font-size: .88rem; display: flex; gap: .7rem; align-items: flex-start; margin-bottom: 1rem; }
.alert .ico { font-size: 1rem; line-height: 1.4; }
.alert.success { border-color: #b9dbc8; background: #f1f8f3; color: #14532d; }
.alert.error { border-color: #e8bdc5; background: #fdf2f4; color: #7f1224; }
.alert.warn { border-color: #ecd9a8; background: #fffaf0; color: #6b4c00; }
.alert.info { border-color: #c4d8e6; background: #f3f8fb; color: #1c4f6f; }
.alert strong { display: block; margin-bottom: .15rem; }
.alert ul { margin: .25rem 0 0; padding-left: 1.1rem; }

/* ---------- Tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .84rem; }
table.data th {
  text-align: left; font-size: .68rem; letter-spacing: .09em; text-transform: uppercase; color: var(--muted);
  font-weight: 650; padding: .7rem .9rem; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fafbfa;
}
table.data td { padding: .72rem .9rem; border-bottom: 1px solid #edf1ee; vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: #fbfcfb; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .primary { font-weight: 650; color: var(--ink); }
table.data .sub { display: block; font-size: .75rem; color: var(--muted); }
table.data.compact td, table.data.compact th { padding: .5rem .65rem; }
table.data tfoot td { font-weight: 700; border-top: 2px solid var(--line); background: #fafbfa; }
.table-empty { padding: 2.2rem 1rem; text-align: center; color: var(--muted); font-size: .88rem; }
.table-empty strong { display: block; color: var(--ink-soft); margin-bottom: .2rem; }

/* ---------- Filters ---------- */
.filters { display: flex; gap: .65rem; flex-wrap: wrap; align-items: flex-end; }
.filters .field { min-width: 150px; margin: 0; }
.filters .grow { flex: 1; min-width: 220px; }
.segmented { display: inline-flex; background: #eef1ef; border: 1px solid var(--line); padding: 3px; border-radius: 8px; gap: 2px; flex-wrap: wrap; }
.segmented a { padding: .32rem .65rem; border-radius: 6px; font-size: .78rem; color: var(--muted); font-weight: 600; }
.segmented a:hover { text-decoration: none; color: var(--ink); }
.segmented a.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- Forms ---------- */
.field { margin-bottom: 1rem; }
.field > label, .label { display: block; font-size: .8rem; font-weight: 650; color: var(--ink-soft); margin-bottom: .32rem; }
.field .req { color: var(--red); margin-left: .15rem; }
.hint { font-size: .74rem; color: var(--muted); display: block; }
.hint.error { color: var(--danger); font-weight: 650; }
.field .hint { font-size: .74rem; color: var(--muted); margin-top: .28rem; }
.field .error, .text-danger { color: var(--danger); font-size: .76rem; margin-top: .25rem; display: block; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date],
input[type=datetime-local], input[type=search], input[type=url], input[type=time], select, textarea {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; color: var(--ink);
  padding: .58rem .7rem; font: inherit; font-size: .88rem; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(11,104,66,.12); }
input[readonly], input[disabled], select[disabled], textarea[readonly] { background: #f6f8f6; color: #53625a; }
textarea { min-height: 100px; resize: vertical; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #6a786f 50%), linear-gradient(135deg, #6a786f 50%, transparent 50%); background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 2rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.1rem; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-3 { grid-column: span 3; }
.checkline { display: flex; gap: .55rem; align-items: flex-start; font-size: .86rem; color: var(--ink-soft); }
.checkline input[type=checkbox], .checkline input[type=radio] { margin-top: .2rem; width: 16px; height: 16px; accent-color: var(--green); flex: none; }
.radio-row { display: flex; gap: 1.1rem; flex-wrap: wrap; }
.radio-row label { display: inline-flex; align-items: center; gap: .4rem; font-weight: 500; font-size: .86rem; margin: 0; }
.radio-row input { width: 16px; height: 16px; accent-color: var(--green); }
.form-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; justify-content: flex-end; padding-top: 1rem; border-top: 1px solid var(--line); margin-top: .5rem; }
.inline-form { display: inline-block; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-family: var(--serif); font-size: 1.06rem; font-weight: 700; padding: 0; margin-bottom: .6rem; }
.form-section { padding: 1.35rem 1.35rem .4rem; border-bottom: 1px solid var(--line); }
.form-section:last-of-type { border-bottom: 0; }
.form-section .section-head { display: flex; gap: .7rem; align-items: flex-start; margin-bottom: 1rem; }
.form-section .section-head .num { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--green-soft); color: var(--green-dark); display: grid; place-items: center; font-size: .78rem; font-weight: 700; }
.form-section .section-head h3 { margin: 0; font-size: 1.04rem; }
.form-section .section-head p { margin: .15rem 0 0; font-size: .8rem; color: var(--muted); }
.inline-note { font-size: .76rem; color: var(--muted); }
input[type=file] { font-size: .82rem; color: var(--ink-soft); }
input[type=file]::file-selector-button { border: 1px solid var(--line-strong); background: #f6f8f6; border-radius: 6px; padding: .4rem .7rem; font: inherit; font-size: .8rem; margin-right: .6rem; cursor: pointer; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--line); overflow-x: auto; margin-bottom: 1.1rem; }
.tabs a, .tabs button {
  appearance: none; border: 0; background: none; font: inherit; font-size: .84rem; font-weight: 600; color: var(--muted);
  padding: .65rem .85rem; border-bottom: 2px solid transparent; white-space: nowrap; cursor: pointer;
}
.tabs a:hover, .tabs button:hover { color: var(--ink); text-decoration: none; }
.tabs a.active, .tabs button.active { color: var(--green-dark); border-bottom-color: var(--green); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 8px; width: 1px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 1.05rem 2rem; }
.timeline li:last-child { padding-bottom: 0; }
.timeline .marker { position: absolute; left: 3px; top: 4px; width: 11px; height: 11px; border-radius: 50%; background: #fff; border: 2px solid var(--green); }
.timeline li.warn .marker { border-color: var(--gold); }
.timeline li.bad .marker { border-color: var(--danger); }
.timeline .when { font-size: .7rem; letter-spacing: .04em; color: var(--muted); text-transform: uppercase; }
.timeline .what { font-weight: 650; font-size: .88rem; margin: .1rem 0 .12rem; }
.timeline .who { font-size: .76rem; color: var(--muted); }
.timeline .note { font-size: .8rem; color: var(--ink-soft); margin-top: .25rem; background: #f8faf8; border-left: 2px solid var(--line); padding: .35rem .55rem; border-radius: 0 5px 5px 0; }

/* ---------- Progress steps ---------- */
.steps { display: flex; gap: 0; counter-reset: step; margin: .4rem 0 1.2rem; overflow-x: auto; padding-bottom: .25rem; }
.steps .step { flex: 1; min-width: 118px; position: relative; padding: .55rem .7rem .55rem 2.1rem; font-size: .74rem; color: var(--muted); border-top: 3px solid var(--line); }
.steps .step::before { counter-increment: step; content: counter(step); position: absolute; left: .55rem; top: .5rem; width: 19px; height: 19px; border-radius: 50%; background: #eef1ef; color: var(--muted); font-size: .66rem; display: grid; place-items: center; font-weight: 700; }
.steps .step.done { border-top-color: var(--green); color: var(--ink-soft); }
.steps .step.done::before { background: var(--green); color: #fff; }
.steps .step.current { border-top-color: var(--gold); color: var(--ink); font-weight: 650; }
.steps .step.current::before { background: var(--gold); color: #2b2200; }
/* Some panels use <ol class="steps"> for numbered explanatory points rather than a journey. Those
   items have no .step, and left in the flex row above they would run together as one line. */
.steps:has(> li:not(.step)) { display: block; overflow: visible; margin: .45rem 0 1.1rem; }
.steps:has(> li:not(.step)) > li { display: block; position: relative; padding: .34rem 0 .34rem 2rem; font-size: .85rem; color: var(--ink-soft); border-top: 0; }
.steps:has(> li:not(.step)) > li::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: .38rem; width: 1.22rem; height: 1.22rem; border-radius: 50%; background: #eef1ef; color: var(--green); font-size: .68rem; font-weight: 700; display: grid; place-items: center; }
.steps:has(> li:not(.step)) > li + li { margin-top: .1rem; }

/* ---------- Definition lists ---------- */
.dl { display: grid; grid-template-columns: minmax(140px, .7fr) minmax(0, 1.3fr); gap: .5rem 1.2rem; margin: 0; font-size: .86rem; }
.dl dt { color: var(--muted); font-weight: 500; }
.dl dd { margin: 0; color: var(--ink); font-weight: 550; }
.dl.tight { gap: .35rem 1rem; font-size: .82rem; }

/* ---------- Empty states ---------- */
.empty { text-align: center; padding: 2.6rem 1.2rem; color: var(--muted); }
.empty .glyph { width: 46px; height: 46px; margin: 0 auto .7rem; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; font-size: 1.2rem; }
.empty h3 { color: var(--ink); margin-bottom: .25rem; }
.empty p { font-size: .86rem; max-width: 46ch; margin-inline: auto; }

/* ---------- Landing ---------- */
.hero { background: linear-gradient(160deg, #0b3d29 0%, #0b6842 58%, #0e7a4e 100%); color: #fff; padding: 3.2rem 0 3.6rem; position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 80% 20%, rgba(242,194,0,.16), transparent 55%), radial-gradient(ellipse at 10% 90%, rgba(255,255,255,.07), transparent 45%); }
.hero .wrap { position: relative; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 2.4rem; align-items: center; }
.hero .eyebrow { color: var(--gold); font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 700; margin-bottom: .7rem; }
.hero h1 { color: #fff; font-size: clamp(2rem, 1.2rem + 2.6vw, 3.2rem); line-height: 1.08; max-width: 18ch; }
.hero p.lede { color: rgba(255,255,255,.82); font-size: 1.02rem; max-width: 55ch; margin: 1rem 0 1.5rem; }
.hero .actions { display: flex; gap: .65rem; flex-wrap: wrap; }
.hero .btn.ghost { --btn-bg: transparent; --btn-fg: #fff; --btn-bd: rgba(255,255,255,.4); }
.hero .btn.ghost:hover { background: rgba(255,255,255,.12); border-color: #fff; }
.hero-card { background: rgba(255,255,255,.97); color: var(--ink); border-radius: 14px; padding: 1.35rem; box-shadow: 0 24px 60px rgba(0,0,0,.22); }
.hero-card h2 { font-size: 1.15rem; margin-bottom: .25rem; }
.hero-card p { font-size: .82rem; color: var(--muted); }
.hero-card .field { margin-bottom: .75rem; }
.hero-facts { display: flex; gap: 1.6rem; flex-wrap: wrap; margin-top: 2.2rem; }
.hero-facts .fact strong { display: block; font-family: var(--serif); font-size: 1.6rem; color: #fff; line-height: 1.1; }
.hero-facts .fact span { font-size: .74rem; color: rgba(255,255,255,.66); letter-spacing: .04em; text-transform: uppercase; }
.home-section { padding: 3rem 0 1rem; }
.home-section .section-intro { max-width: 60ch; margin-bottom: 1.6rem; }
.home-section .section-intro h2 { font-size: 1.7rem; }
.service-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.service { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow-sm); }
.service .ico { width: 38px; height: 38px; border-radius: 9px; background: var(--green-soft); color: var(--green); display: grid; place-items: center; font-size: 1.1rem; margin-bottom: .8rem; }
.service h3 { font-size: 1rem; margin-bottom: .3rem; }
.service p { font-size: .83rem; color: var(--muted); margin-bottom: .8rem; }
.verify-strip { background: var(--gold-soft); border-block: 1px solid #eedca6; padding: 1.8rem 0; }
.verify-strip .wrap { display: flex; gap: 1.5rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.verify-strip h2 { font-size: 1.25rem; margin: 0; }
.verify-strip p { margin: .2rem 0 0; font-size: .85rem; color: #5b4500; }
.verify-strip form { display: flex; gap: .5rem; flex-wrap: wrap; min-width: min(100%, 430px); }
.verify-strip input { flex: 1; min-width: 200px; }

/* ---------- Home dashboard ---------- */
.scope-banner { background: linear-gradient(120deg, #0c2f20, #14563a); color: #fff; border-radius: 12px; padding: 1.35rem 1.5rem; margin-bottom: 1.2rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.scope-banner .eyebrow { font-size: .68rem; letter-spacing: .15em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.scope-banner h2 { color: #fff; margin: .2rem 0 .15rem; font-size: 1.35rem; }
.scope-banner p { margin: 0; color: rgba(255,255,255,.75); font-size: .83rem; }
.scope-banner .datebox { text-align: right; font-size: .78rem; color: rgba(255,255,255,.72); }
.scope-banner .datebox strong { display: block; font-family: var(--serif); color: #fff; font-size: 1.05rem; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 1.1rem; align-items: start; }
.stage-list { display: flex; flex-direction: column; gap: .55rem; }
.stage-row { display: grid; grid-template-columns: minmax(0, 1fr) 46px; gap: .6rem; align-items: center; font-size: .81rem; }
.stage-row .bar { height: 7px; border-radius: 6px; background: #eef1ef; grid-column: 1 / -1; overflow: hidden; }
.stage-row .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), #2f9b6b); border-radius: 6px; }
.stage-row .count { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.quick { display: flex; gap: .6rem; align-items: center; padding: .65rem .7rem; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfb; color: var(--ink-soft); font-size: .81rem; font-weight: 550; }
.quick:hover { border-color: var(--green); color: var(--green-dark); background: var(--green-soft); text-decoration: none; }
.quick .ico { color: var(--green); font-size: 1rem; }
.chart-box { position: relative; height: 220px; }

/* ---------- Official paper form ---------- */
.paper-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.paper-toolbar .note { font-size: .8rem; color: var(--muted); }
.paper {
  background: var(--paper); color: #111; width: min(820px, 100%); margin: 0 auto 1.5rem;
  padding: 2.1rem 2.4rem 2.4rem; border: 1px solid #d8d2c2; box-shadow: 0 10px 34px rgba(40, 34, 18, .12);
  font-family: var(--serif); font-size: .92rem; line-height: 1.5;
}
.paper + .paper { margin-top: 1.6rem; }
.paper-head { display: flex; gap: 1rem; align-items: center; justify-content: center; text-align: center; position: relative; padding-bottom: .9rem; border-bottom: 1px solid #b9b1a0; margin-bottom: 1rem; }
.paper-head .crest { position: absolute; left: 0; top: 0; width: 72px; height: auto; }
.paper-head .titles { padding-left: 70px; padding-right: 70px; }
.paper-head .republic { font-size: .8rem; letter-spacing: .22em; font-weight: 700; text-transform: uppercase; }
.paper-head .regs { font-size: .78rem; margin-top: .15rem; }
.paper-head .formno { font-size: .78rem; margin-top: .1rem; }
.paper-head .formtitle { font-size: 1.02rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; margin-top: .45rem; line-height: 1.35; }
.paper-head .formreg { font-size: .72rem; letter-spacing: .1em; margin-top: .2rem; }
.paper .section-title { text-align: center; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; margin: 1.2rem 0 .9rem; }
.paper .form-item { display: flex; gap: .5rem; align-items: baseline; margin-bottom: .55rem; break-inside: avoid; }
.paper .form-item > .no { flex: none; min-width: 1.5rem; font-weight: 700; }
.paper .form-item > .q { flex: none; }
.paper .form-item .answer { flex: 1; border-bottom: 1px dotted #5f5a4e; min-height: 1.15rem; padding: 0 .25rem; font-family: var(--sans); font-size: .84rem; }
.paper .form-item .answer.inline { flex: 0 1 auto; min-width: 5rem; }
.paper .form-item .answer.grow { flex: 1; }
.paper .sub { margin-left: 2rem; }
.paper .indent { margin-left: 2rem; }
.paper .item-label { display: block; font-weight: 700; margin-bottom: .2rem; }
.paper .mini { font-size: .72rem; }
.paper .checkbox { font-family: var(--sans); font-size: .8rem; white-space: nowrap; margin-left: .4rem; }
.paper .tick { display: inline-block; min-width: 16px; height: 16px; border: 1px solid #6b6557; margin-left: .3rem; text-align: center; line-height: 14px; font-family: var(--sans); font-size: .7rem; vertical-align: -2px; }
.paper table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.paper table th, .paper table td { border: 1px solid #6e685a; padding: .35rem .45rem; vertical-align: middle; font-family: var(--sans); }
.paper table th { background: #f3efe2; font-weight: 650; text-align: left; font-size: .74rem; }
.paper table td.num { text-align: center; width: 34px; }
.paper .official-box { border: 2px solid #222; padding: .9rem; margin-top: 1.2rem; font-family: var(--sans); }
.paper .official-box .box-title { font-family: var(--serif); font-weight: 700; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; border-bottom: 1px solid #999; padding-bottom: .3rem; margin-bottom: .5rem; }
.paper .answer-lines { border-bottom: 1px dotted #5f5a4e; min-height: 1.2rem; margin-bottom: .35rem; }
.paper .signature-row { display: flex; gap: 1.5rem; margin-top: 1.4rem; flex-wrap: wrap; }
.paper .sig { flex: 1; min-width: 150px; }
.paper .sig .line { border-bottom: 1px solid #222; min-height: 1.6rem; font-family: var(--sans); font-size: .8rem; }
.paper .sig .line.signed { font-family: var(--serif); font-style: italic; font-size: 1.02rem; color: #1c3a2b; padding-left: .2rem; }
.paper .sig .cap { font-size: .72rem; margin-top: .15rem; }
.paper .form-note { font-family: var(--sans); font-size: .72rem; color: #555; margin-top: .8rem; }
.paper .barcode { text-align: right; font-size: .68rem; font-family: var(--mono); color: #444; }
.paper .page-break { break-after: page; }

/* Editable copies of the statutory forms: inputs sit on the dotted rule of the paper document. */
.paper input.plain, .paper select.plain, .paper textarea.plain {
  width: 100%; border: 0; border-bottom: 1px dotted #5f5a4e; background: transparent;
  font-family: var(--sans); font-size: .84rem; padding: .1rem .2rem .2rem; border-radius: 0; color: #141310;
}
.paper input.plain:focus, .paper select.plain:focus, .paper textarea.plain:focus {
  outline: 2px solid var(--gold); outline-offset: 1px; background: #fffdf2; border-bottom-color: #5f5a4e;
}
.paper input.plain.short { max-width: 7rem; }
.paper input.plain.mid { max-width: 13rem; }
.paper textarea.plain { min-height: 3.2rem; resize: vertical; }
.paper .field-error { display: block; color: var(--red); font-family: var(--sans); font-size: .72rem; margin-top: .1rem; }
.paper .req-mark { color: var(--red); font-weight: 700; }
.paper .tick-box { display: inline-flex; align-items: center; gap: .35rem; font-family: var(--sans); font-size: .78rem; margin-right: 1rem; }
.paper .tick-box input { width: 15px; height: 15px; accent-color: var(--green-dark); }
.paper .row-remove { border: 0; background: none; color: var(--red); font-size: .72rem; text-decoration: underline; cursor: pointer; font-family: var(--sans); }
.paper .staff-rows td { height: 1.9rem; }

/* ---------- Certificate ---------- */
.certificate-stage { overflow-x: auto; padding-bottom: .5rem; }
.certificate {
  width: 1120px; min-height: 760px; margin: 0 auto; background: #fffdf4; color: #152219; position: relative;
  padding: 58px 76px; border: 14px solid transparent;
  border-image: linear-gradient(135deg, #0b6842 0 33%, #f2c200 33% 66%, #b8122f 66% 100%) 1;
  box-shadow: 0 14px 46px rgba(20, 35, 25, .18); font-family: var(--serif);
}
.certificate::before { content: ""; position: absolute; inset: 14px; border: 2px solid #0b6842; pointer-events: none; }
.certificate::after { content: ""; position: absolute; inset: 22px; border: 1px solid rgba(11,104,66,.35); pointer-events: none; }
.cert-inner { position: relative; text-align: center; }
.cert-crest { height: 86px; margin-bottom: .6rem; }
.cert-republic { font-size: .8rem; letter-spacing: .3em; text-transform: uppercase; font-weight: 700; }
.cert-dept { font-size: .92rem; margin-top: .25rem; }
.cert-rule { width: 130px; height: 3px; margin: .9rem auto; background: linear-gradient(90deg, var(--red) 0 33%, var(--gold) 33% 66%, var(--green) 66% 100%); }
.cert-title { font-size: 2.15rem; letter-spacing: .16em; text-transform: uppercase; margin: .4rem 0 .2rem; color: #0b4a2c; }
.cert-subtitle { font-size: .86rem; letter-spacing: .18em; text-transform: uppercase; color: #5a6358; }
.cert-intro { font-size: .95rem; margin: 1.2rem auto .35rem; max-width: 70ch; color: #35453a; }
.cert-centre { font-size: 1.95rem; color: #0b4a2c; margin: 1.1rem 0 .2rem; }
.cert-meta { display: flex; justify-content: center; gap: 2.6rem; flex-wrap: wrap; margin: 1.4rem 0 1rem; font-family: var(--sans); font-size: .8rem; }
.cert-meta .item .k { font-size: .64rem; letter-spacing: .12em; text-transform: uppercase; color: #6a766c; }
.cert-meta .item .v { font-weight: 700; font-size: .92rem; color: #17241b; }
.cert-body { font-size: .88rem; line-height: 1.7; max-width: 78ch; margin: .8rem auto; color: #35453a; }
.cert-bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.6rem; margin-top: 1.8rem; text-align: left; }
.cert-sign { min-width: 280px; }
/* The uploaded drawing sits on the rule, in the space a hand-signed copy would use. Its own paper
   is transparent by the time it is stored, so there is no pale rectangle on the certificate. */
.cert-signature { display: block; width: auto; height: auto; max-width: 264px; max-height: 68px; margin: 0 0 3px .4rem; }
.cert-sign .line { border-bottom: 1px solid #26332a; width: 280px; height: 0; }
.cert-sign .name { font-weight: 700; font-size: .9rem; margin-top: .35rem; }
.cert-sign .role { font-size: .72rem; color: #5a655d; }
.cert-qr { text-align: center; font-family: var(--sans); font-size: .62rem; color: #5a655d; }
.cert-qr img { width: 104px; height: 104px; display: block; margin: 0 auto .3rem; background: #fff; padding: 4px; border: 1px solid #d5d2c4; }
.cert-seal { width: 128px; height: 128px; flex: 0 0 auto; }
.cert-seal img { display: block; width: 100%; height: 100%; object-fit: contain; }

/* The signature page in Administration shows the block on the certificate's own paper. */
.signature-preview {
  background: #fffdf4; border: 1px solid #e2ddca; border-radius: 10px;
  padding: 1.5rem 1.7rem 1.3rem; box-shadow: inset 0 0 0 6px rgba(11, 104, 66, .04);
}
.signature-preview img { display: block; width: auto; height: auto; max-width: 264px; max-height: 90px; margin: 0 0 3px .4rem; }
.signature-preview .line { border-bottom: 1px solid #26332a; width: 280px; max-width: 100%; }
.signature-preview .name { font-family: var(--serif); font-weight: 700; font-size: .92rem; margin-top: .35rem; color: #152219; }
.signature-preview .role { font-size: .72rem; color: #5a655d; }
.seal-preview { display: flex; align-items: center; gap: 1rem; margin-top: 1.3rem; }
.seal-preview img { width: 92px; height: 92px; flex: 0 0 auto; }

/* ---------- Login ---------- */
.auth-shell { min-height: calc(100vh - 36px); display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); }
.auth-aside { background: linear-gradient(155deg, #0a2c1d, #0b6842 70%, #127a4f); color: #fff; padding: 2.8rem 3rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-aside::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 75% 15%, rgba(242,194,0,.14), transparent 50%); }
.auth-aside > * { position: relative; }
.auth-aside .brand { color: #fff; }
.auth-aside .brand-text .republic { color: #fff; }
.auth-aside .brand-text .dept { color: rgba(255,255,255,.7); }
.auth-aside .brand img { height: 58px; }
.auth-aside h2 { color: #fff; font-size: 2.1rem; line-height: 1.16; max-width: 18ch; margin-top: 2.6rem; }
.auth-aside p { color: rgba(255,255,255,.75); font-size: .9rem; max-width: 44ch; }
.auth-aside .foot { font-size: .74rem; color: rgba(255,255,255,.55); }
.auth-main { background: #f7f8f6; display: flex; align-items: center; justify-content: center; padding: 2.4rem 1.5rem; }
.auth-card { width: min(420px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1.9rem; box-shadow: var(--shadow-md); }
.auth-card h1 { font-size: 1.65rem; margin-bottom: .25rem; }
.auth-card .lede { font-size: .86rem; color: var(--muted); margin-bottom: 1.3rem; }
.auth-card .field { margin-bottom: .95rem; }
.auth-card .form-actions { border: 0; padding-top: .2rem; margin-top: .4rem; justify-content: stretch; }
/* The main action on an auth page fills the card. Small quiet controls — such as the "Show" toggle
   beside a password field — keep their natural width, or they stretch and squeeze the label beside
   them into a second line. */
.auth-card .btn:not(.quiet) { width: 100%; }
button.link-quiet {
  background: none; border: 0; padding: .2rem .1rem; color: var(--green-dark);
  font: inherit; font-size: .84rem; cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px;
}
button.link-quiet:hover { color: var(--green); }
.auth-links { display: flex; justify-content: space-between; gap: .75rem; font-size: .78rem; margin-top: 1rem; flex-wrap: wrap; }
.auth-note { margin-top: 1.2rem; padding: .7rem .8rem; border-radius: 8px; background: #f6f8f6; border: 1px solid var(--line); font-size: .74rem; color: var(--muted); }
.auth-note code { background: #fff; padding: .1rem .3rem; border-radius: 3px; border: 1px solid var(--line); font-size: .72rem; }

/* ---------- Public register / verification ---------- */
.public-hero { background: linear-gradient(160deg, #0c3524, #0b6842); color: #fff; padding: 2.6rem 0; }
.public-hero h1 { color: #fff; }
.public-hero p { color: rgba(255,255,255,.78); max-width: 62ch; }
.public-hero .btn.ghost { --btn-bg: transparent; --btn-fg: #fff; --btn-bd: rgba(255,255,255,.4); }
.register-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 1.1rem; align-items: start; }
#registerMap { height: 460px; border-radius: var(--radius); border: 1px solid var(--line); background: #e9eee9; }
.leaflet-container { font-family: var(--sans); }
/* The text equivalent of the map: the same centres, in the same order, with the same links. */
.map-points { list-style: none; margin: .4rem 0 0; padding: 0; }
.map-points li { display: flex; flex-wrap: wrap; gap: .1rem .8rem; align-items: baseline; padding: .55rem .2rem; border-bottom: 1px solid var(--line); }
.map-points li:last-child { border-bottom: 0; }
.map-points li > a { font-weight: 650; font-size: .88rem; }
.map-pop .name { display: block; font-size: .88rem; margin-bottom: .15rem; }
.map-pop .where, .map-pop .licence { font-size: .76rem; color: var(--muted); }
.map-pop .licence { font-family: var(--mono); }
.map-pop a { display: inline-block; margin-top: .35rem; font-size: .78rem; font-weight: 650; color: var(--green-dark); }
@media (max-width: 820px) { #registerMap { height: 330px; } }
.verify-card { max-width: 760px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-md); overflow: hidden; }
.verify-card .head { padding: 1.4rem 1.5rem; background: var(--green-soft); border-bottom: 1px solid #cfe3d7; display: flex; gap: .9rem; align-items: center; }
.verify-card .head .seal { width: 48px; height: 48px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-size: 1.3rem; flex: none; }
.verify-card .head h1 { font-size: 1.3rem; margin: 0; }
.verify-card .head p { margin: .15rem 0 0; font-size: .8rem; color: #3b5c49; }
.verify-card .body { padding: 1.5rem; }
.verify-status { display: flex; gap: .8rem; align-items: center; padding: .9rem 1rem; border-radius: 9px; margin-bottom: 1.2rem; }
.verify-status.valid { background: #eef8f1; border: 1px solid #b9dbc8; color: #14532d; }
.verify-status.invalid { background: #fdf2f4; border: 1px solid #e8bdc5; color: #7f1224; }
.verify-status .glyph { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.8); display: grid; place-items: center; font-size: 1.1rem; flex: none; }
.verify-status h3 { margin: 0; font-size: 1rem; }
.verify-status p { margin: .1rem 0 0; font-size: .78rem; opacity: .85; }
.verify-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem 1.4rem; }
.verify-grid .k { font-size: .67rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
.verify-grid .v { font-weight: 650; font-size: .9rem; }
.verify-foot { padding: .9rem 1.5rem; border-top: 1px solid var(--line); font-size: .72rem; color: var(--muted); background: #fafbfa; }

/* ---------- Footer ---------- */
.site-footer { background: #0f1f18; color: rgba(255,255,255,.62); padding: 2.4rem 0 1.4rem; font-size: .8rem; }
.site-footer .cols { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); gap: 2rem; }
.site-footer h4 { color: #fff; font-family: var(--sans); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: .7rem; }
.site-footer a { color: rgba(255,255,255,.72); display: block; padding: .15rem 0; }
.site-footer a:hover { color: #fff; }
.site-footer .brandline { display: flex; gap: .7rem; align-items: center; margin-bottom: .7rem; color: #fff; }
.site-footer .brandline img { height: 40px; }
.site-footer .bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 1.8rem; padding-top: 1rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .72rem; }
.site-footer .flagline { display: flex; height: 4px; border-radius: 2px; overflow: hidden; margin-top: 1rem; max-width: 180px; }
.site-footer .flagline i { flex: 1; }
.site-footer .flagline i:nth-child(1) { background: #ce1126; }
.site-footer .flagline i:nth-child(2) { background: #fcd116; }
.site-footer .flagline i:nth-child(3) { background: #006b3f; }

.tag-dept { font-size: .62rem; text-transform: uppercase; letter-spacing: .08em; background: var(--gold-soft); color: #6b4c00; border-radius: 4px; padding: .12rem .4rem; vertical-align: 1px; font-weight: 700; }

/* Filed copy of a statutory form shown read-only. */
.form-item-static { display: flex; gap: .6rem; align-items: baseline; padding: .34rem 0; border-bottom: 1px dotted var(--line); font-size: .88rem; }
.form-item-static .no { flex: none; width: 1.7rem; font-weight: 700; color: var(--green-dark); }
.form-item-static .q { flex: 0 1 17rem; min-width: 0; color: var(--muted); font-size: .8rem; }
.form-item-static .a { flex: 1 1 8rem; min-width: 0; overflow-wrap: anywhere; }
.form-item-static.head { background: #f6f8f6; font-weight: 700; border-bottom: 1px solid var(--line); margin-top: .6rem; padding: .35rem .45rem; }
.form-item-static.sub-item { padding-left: 2.3rem; }
.form-item-static.sub-item .q { flex-basis: 15rem; }

/* ---------- Misc ---------- */
.pill-row { display: flex; gap: .4rem; flex-wrap: wrap; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .95rem 1.4rem; }
.facts > div { border-left: 2px solid var(--line); padding-left: .7rem; }
.facts .k { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 700; }
.facts .v { display: block; font-size: .92rem; margin-top: .15rem; }
.facts .v.empty { color: var(--muted); font-style: italic; }
.kv-inline { display: flex; gap: .4rem; align-items: baseline; flex-wrap: wrap; }
.divider { height: 1px; background: var(--line); margin: 1rem 0; }
.progress { height: 6px; border-radius: 6px; background: #edf1ee; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--green); }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }

.code-block { font-family: var(--mono); font-size: .78rem; background: #0f1f18; color: #d8e8de; border-radius: 8px; padding: .9rem 1rem; overflow-x: auto; }
.two-col-note { columns: 2; column-gap: 2rem; font-size: .84rem; }

/* ---------- Responsive ---------- */
/* A collapsed column is written as minmax(0, 1fr), never bare 1fr. The auto minimum of a 1fr track is
   the widest unbreakable thing inside it — a money figure, a stepper, a long reference — and the track
   then grows past the phone instead of letting the panel scroll. minmax(0, …) caps the track and hands
   the overflow to the .table-wrap / .steps scrollers that are there for exactly that. */
@media (max-width: 1080px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid, .grid.side, .grid.side-left, .register-grid { grid-template-columns: minmax(0, 1fr); }
  .hero .wrap { grid-template-columns: minmax(0, 1fr); }
  .hero-card { max-width: 520px; }
  .auth-shell { grid-template-columns: minmax(0, 1fr); }
  .auth-aside { min-height: 280px; padding: 2rem; }
  .auth-aside h2 { font-size: 1.5rem; margin-top: 1.2rem; }
  .site-footer .cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .wrap { width: calc(100% - 1.6rem); }
  .masthead .wrap { padding: .65rem 0; }
  .brand img { height: 42px; }
  .brand-text .system { display: none; }
  .header-tools .link-quiet { display: none; }
  .user-chip .who { display: none; }
  .mobile-toggle { display: inline-block; }
  .mainnav .mobilebar { display: flex; justify-content: flex-end; min-height: 0; padding: .4rem 0; overflow: visible; }
  .mainnav [data-nav-panel] { display: none; flex-direction: column; align-items: stretch; padding: .4rem 0; }
  .mainnav [data-nav-panel].open { display: flex; }
  .mainnav a.navlink, .mainnav .drop > button { width: 100%; text-align: left; padding: .65rem .75rem; border-bottom: 1px solid rgba(255,255,255,.08); }
  .mainnav .spacer { display: none; }
  .drop-menu { position: static; box-shadow: none; border: 0; border-radius: 0; background: rgba(255,255,255,.06); margin: 0 .4rem .4rem; }
  .drop-menu a { color: rgba(255,255,255,.85); }
  .drop-menu a:hover { background: rgba(255,255,255,.1); color: #fff; }
  .drop-menu .label { color: rgba(255,255,255,.5); }
  .drop-menu .sep { background: rgba(255,255,255,.12); }
  .page-head { align-items: flex-start; }
  /* On a phone a data table keeps its columns readable and scrolls sideways inside its wrapper,
     rather than squeezing a charge's name into one word per line. */
  .table-wrap table.data { min-width: 34rem; }
  .form-grid, .form-grid.three, .grid.two, .grid.three { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2, .form-grid .span-3 { grid-column: auto; }
  .service-grid { grid-template-columns: minmax(0, 1fr); }
  .hero { padding: 2.2rem 0 2.6rem; }
  .hero-facts { gap: 1.1rem; }
  .paper { padding: 1.2rem 1rem; font-size: .86rem; }
  .paper-head .crest { position: static; width: 54px; }
  .paper-head .titles { padding: 0; }
  .paper-head { flex-wrap: wrap; text-align: center; }
  .paper .form-item { flex-wrap: wrap; }
  .paper .form-item .answer { flex-basis: 100%; }
  .paper .form-item > .q { flex-basis: calc(100% - 1.7rem); }
  .site-footer .cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem; }
}
@media (max-width: 560px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
  .stat { padding: .8rem; }
  .stat .value, .stat .v { font-size: 1.55rem; }
  .user-chip { border: 0; background: none; padding: 0; }
  .avatar { width: 32px; height: 32px; }
  .quick-grid { grid-template-columns: minmax(0, 1fr); }
  .verify-grid { grid-template-columns: minmax(0, 1fr); }
  .site-footer .cols { grid-template-columns: minmax(0, 1fr); }
  .form-actions { justify-content: stretch; }
  .form-actions .btn { flex: 1; }
  .hero-card { padding: 1rem; }
  .panel-body { padding: .9rem; }
  .paper .sub, .paper .indent { margin-left: .8rem; }
  .form-item-static { flex-wrap: wrap; }
  /* .sub-item .q is more specific than a plain .q rule, so the stacked form must name it too,
     otherwise a filed form keeps its fixed-width question column and pushes the page sideways. */
  .form-item-static .q, .form-item-static.sub-item .q { flex: 1 0 100%; padding-left: 2.3rem; }
  .form-item-static .a { flex-basis: 100%; padding-left: 2.3rem; }
}

/* ---------- Print ---------- */
.print-only { display: none; }
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff !important; color: #000; font-size: 11pt; }
  .govbar, .masthead, .mainnav, .site-footer, .paper-toolbar,
  .breadcrumb, .page-actions, .no-print, .alert { display: none !important; }
  main.page { padding: 0; }
  .wrap, .wrap-narrow { width: 100%; }
  .paper { width: 100%; border: 0; box-shadow: none; padding: 0; margin: 0; background: #fff; page-break-after: always; }
  .paper:last-of-type { page-break-after: auto; }
  .paper .form-item { margin-bottom: .45rem; }
  a { color: #000; text-decoration: none; }
  .certificate-stage { overflow: visible; }
  .certificate { width: 100%; min-height: auto; border-width: 10px; border-image: none; border-color: #0b6842; padding: 20px 32px; box-shadow: none; page-break-inside: avoid; }
  /* The four-colour gradient frame does not survive the print rasteriser — Chrome splits the
     bottom band away from the sheet. On paper the certificate takes a solid green frame; the
     tricolour stripe above the title still carries the national colours. */
  /* One landscape sheet. The drawing is fixed at 1120x760 on screen; on paper the type and the
     side ornaments step down together so the whole block — crest, body, signature, seal and
     verification code — stays inside a single A4 sheet without clipping or a second page. */
  .cert-crest { height: 62px; margin-bottom: .3rem; }
  .cert-republic { font-size: .72rem; }
  .cert-dept { font-size: .8rem; margin-top: .15rem; }
  .cert-rule { margin: .55rem auto; }
  .cert-title { font-size: 1.75rem; margin: .25rem 0 .1rem; }
  .cert-subtitle { font-size: .78rem; }
  .cert-intro { font-size: .82rem; line-height: 1.5; margin: .75rem auto .25rem; }
  .cert-centre { font-size: 1.6rem; margin: .7rem 0 .1rem; }
  .cert-meta { margin: .8rem 0 .5rem; font-size: .74rem; }
  .cert-meta .item .v { font-size: .84rem; }
  .cert-body { font-size: .78rem; line-height: 1.5; max-width: 92ch; margin: .55rem auto; }
  .cert-bottom { margin-top: .9rem; gap: 1.2rem; }
  .cert-sign { min-width: 250px; }
  .cert-signature { max-height: 48px; max-width: 210px; }
  .cert-sign .line { width: 250px; }
  .cert-sign .name { font-size: .82rem; margin-top: .25rem; }
  .cert-sign .role { font-size: .65rem; }
  .cert-seal { width: 96px; height: 96px; }
  .cert-qr { font-size: .56rem; }
  .cert-qr img { width: 88px; height: 88px; padding: 3px; }
}

/* Print-only pages (a filed copy of a statutory form) */
body.print-only { display: block; background: #f2f1ea; padding: 0 0 3rem; }
.print-toolbar { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; background: #fff; border-bottom: 1px solid var(--line); padding: .7rem 1.25rem; }
.print-toolbar span { display: block; color: var(--muted); font-size: .78rem; }
.print-toolbar > div:last-child { display: flex; gap: .5rem; }
body.print-only main, body.print-only .paper { padding-top: 1.5rem; }
body.print-only .paper { max-width: 210mm; margin: 0 auto; padding: 1.6rem 1.8rem 2rem; }
.paper .filed-bar { display: flex; flex-wrap: wrap; gap: .3rem 1.6rem; border: 1px solid #b9b1a0; background: #faf7ee; padding: .5rem .75rem; font-size: .74rem; font-family: var(--sans); margin-bottom: 1rem; }
.paper .print-meta { font-family: var(--sans); font-size: .68rem; color: #555; border-top: 1px solid #b9b1a0; margin-top: 1.2rem; padding-top: .5rem; }
