:root {
  --ink: #17252a;
  --muted: #66777b;
  --line: #dce5e3;
  --paper: #f5f8f6;
  --card: #ffffff;
  --teal: #0b766e;
  --teal-dark: #075a55;
  --teal-soft: #dff2ee;
  --lime: #d6ee88;
  --amber: #b86b08;
  --amber-soft: #fff1cf;
  --red: #b8473f;
  --red-soft: #ffe9e6;
  --blue-soft: #e7f0fa;
  --shadow: 0 16px 45px rgba(32, 69, 65, .09);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif; font-size: 15px; line-height: 1.55; }
a { color: inherit; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
code { font-family: "SFMono-Regular", Consolas, ui-monospace, monospace; }

.topbar { height: 78px; padding: 0 max(24px, calc((100vw - 1240px) / 2)); display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; background: var(--teal); color: white; border-radius: 12px; transform: rotate(-2deg); }
.brand-mark svg { width: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1.2; }
.brand strong { font-size: 16px; letter-spacing: -.02em; }
.brand small { color: var(--muted); font-size: 11px; margin-top: 3px; }
.topbar nav { display: flex; align-items: center; gap: 7px; }
.topbar nav a { text-decoration: none; color: var(--muted); font-weight: 700; font-size: 13px; padding: 10px 14px; border-radius: 10px; }
.topbar nav a:hover, .topbar nav a.active { color: var(--teal-dark); background: var(--teal-soft); }
.topbar-actions { display: flex; align-items: center; gap: 13px; }
.logout-form { padding-left: 13px; display: flex; align-items: center; gap: 8px; border-left: 1px solid var(--line); }
.logout-form > span { max-width: 120px; overflow: hidden; color: var(--muted); font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.logout-form button { width: 35px; height: 35px; padding: 0; display: grid; place-items: center; color: var(--teal-dark); background: var(--teal-soft); border: 0; border-radius: 9px; cursor: pointer; }
.logout-form button:hover { color: white; background: var(--teal); }
.logout-form svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.security-banner { padding: 8px 24px; text-align: center; background: var(--amber-soft); color: #714406; font-size: 12px; border-bottom: 1px solid #ead59b; }

.page-shell { width: min(1240px, calc(100% - 40px)); min-height: calc(100vh - 160px); margin: 0 auto; padding: 42px 0 72px; }
footer { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 24px 0 40px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 14px; font-size: clamp(38px, 5vw, 68px); line-height: 1.02; letter-spacing: -.055em; }
h1 em { color: var(--teal); font-style: normal; }
h2 { margin-bottom: 6px; font-size: 25px; line-height: 1.2; letter-spacing: -.035em; }
.eyebrow { display: block; margin-bottom: 11px; color: var(--teal); font-size: 11px; line-height: 1; letter-spacing: .15em; text-transform: uppercase; font-weight: 800; }
.subtle { color: var(--muted); font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.two-column { display: grid; grid-template-columns: 1.08fr .92fr; gap: 70px; align-items: center; }
.hero { min-height: 470px; padding: 18px 0 50px; }
.hero-copy > p { max-width: 650px; color: var(--muted); font-size: 17px; }
.mini-stats { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 24px; }
.mini-stats span { display: flex; flex-direction: column; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.mini-stats strong { color: var(--ink); font-size: 21px; letter-spacing: -.03em; }

.upload-card { padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.drop-zone { min-height: 235px; padding: 28px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; border: 1.5px dashed #9fc4be; border-radius: 16px; background: linear-gradient(145deg, #f2fbf8, #fbfdfc); cursor: pointer; transition: .2s ease; }
.drop-zone:hover, .drop-zone.dragover { border-color: var(--teal); background: var(--teal-soft); transform: translateY(-1px); }
.drop-zone input { position: absolute; opacity: 0; pointer-events: none; }
.drop-zone strong { margin: 11px 0 2px; font-size: 17px; }
.drop-zone > span:not(.upload-icon) { color: var(--muted); font-size: 13px; }
.drop-zone small { margin-top: 14px; color: var(--teal-dark); font-weight: 700; }
.upload-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; color: var(--teal); background: white; box-shadow: 0 8px 20px rgba(11,118,110,.12); }
.upload-icon svg { width: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field > span, label > span { color: var(--muted); font-size: 11px; font-weight: 700; }
.field.compact { margin: 15px 0; }
.upload-fields { margin: 15px 0 8px; display: grid; grid-template-columns: minmax(0, 1fr) 125px; gap: 10px; }
.form-hint { margin: 0 0 15px; color: var(--muted); font-size: 10px; line-height: 1.4; }
input, select { width: 100%; min-height: 42px; padding: 9px 12px; color: var(--ink); background: white; border: 1px solid #ccd9d6; border-radius: 9px; outline: none; transition: border .15s, box-shadow .15s; }
input:focus, select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(11,118,110,.12); }

.button { min-height: 42px; padding: 9px 16px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; border: 1px solid transparent; border-radius: 10px; text-decoration: none; font-weight: 800; font-size: 13px; cursor: pointer; transition: .15s ease; white-space: nowrap; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: white; background: var(--teal); box-shadow: 0 8px 18px rgba(11,118,110,.16); }
.button.primary:hover { background: var(--teal-dark); }
.button.secondary { color: var(--teal-dark); background: var(--teal-soft); border-color: #c1e2dc; }
.button.ghost { color: var(--ink); background: white; border-color: var(--line); }
.button.destructive { color: white; background: var(--red); box-shadow: 0 8px 18px rgba(184,71,63,.16); }
.button.destructive:hover { background: #933b35; }
.button.wide { width: 100%; }
.button.tiny { min-height: 34px; padding: 6px 11px; font-size: 11px; background: var(--teal-soft); color: var(--teal-dark); border-color: #c5e4df; }

.workflow-strip { margin: 15px 0 64px; padding: 20px 28px; display: flex; align-items: center; justify-content: center; gap: 25px; background: #eaf2ee; border-radius: var(--radius); }
.workflow-strip div { min-width: 180px; display: grid; grid-template-columns: 34px 1fr; column-gap: 11px; }
.workflow-strip div > span { grid-row: span 2; width: 34px; height: 34px; display: grid; place-items: center; color: var(--teal-dark); background: var(--lime); border-radius: 50%; font-weight: 800; }
.workflow-strip strong { font-size: 13px; }
.workflow-strip small { color: var(--muted); font-size: 11px; }
.workflow-strip i { width: 50px; height: 1px; background: #bdccc8; }

.section-block { margin-top: 26px; padding: 28px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 9px 28px rgba(32,69,65,.045); }
.compact-section { padding-bottom: 18px; }
.section-heading { margin-bottom: 22px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.section-heading p { margin: 5px 0 0; color: var(--muted); }
.create-panel { margin-top: 0; overflow: hidden; }
.create-panel-heading { margin-bottom: 20px; display: flex; align-items: flex-start; gap: 15px; }
.create-panel-heading > div { min-width: 0; }
.create-panel-heading .eyebrow { margin-bottom: 7px; }
.create-panel-heading h2 { margin: 0; }
.create-panel-heading p { max-width: 780px; margin: 5px 0 0; color: var(--muted); }
.create-panel-icon { width: 48px; height: 48px; flex: 0 0 48px; display: grid; place-items: center; color: white; background: var(--teal); border-radius: 50%; }
.create-panel-icon svg { width: 25px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.create-panel .create-form { padding: 18px; }
.create-submit { min-width: 148px; }
.batch-list { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.batch-row { min-height: 74px; display: flex; align-items: stretch; background: white; border-bottom: 1px solid var(--line); transition: background .15s ease; }
.batch-row:last-child { border-bottom: 0; }
.batch-row:hover, .batch-row:focus-within { background: #f8fbfa; }
.batch-row-link { min-width: 0; min-height: 73px; padding: 13px 8px 13px 18px; flex: 1; display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; }
.batch-state-form { margin: 0; padding: 0 12px 0 6px; display: flex; align-items: center; border-left: 1px solid var(--line); }
.batch-state-button { min-height: 38px; padding: 7px 11px; display: inline-flex; align-items: center; gap: 7px; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 999px; font: inherit; font-size: 11px; font-weight: 800; cursor: pointer; transition: color .15s ease, background .15s ease, border-color .15s ease; }
.batch-state-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.batch-state-button.remove:hover, .batch-state-button.remove:focus-visible { color: var(--red); background: var(--red-soft); border-color: #efc4c0; }
.batch-state-button.restore { color: var(--teal-dark); background: var(--teal-soft); border-color: #c5e4df; }
.batch-state-button.restore:hover { color: white; background: var(--teal); border-color: var(--teal); }
.batch-row.is-removed .batch-row-link { color: var(--muted); }
.batch-row.is-removed .file-badge { opacity: .58; filter: grayscale(1); }
.file-badge { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; color: var(--teal-dark); background: var(--teal-soft); border-radius: 9px; font-size: 10px; font-weight: 800; }
.batch-main { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.batch-main strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.batch-main small { color: var(--muted); }
.row-arrow { color: var(--teal); font-size: 19px; }
.batch-overview-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.batch-status-tabs { margin-bottom: 18px; padding: 4px; display: inline-flex; gap: 4px; background: #e9efed; border: 1px solid var(--line); border-radius: 999px; }
.batch-status-tabs a { min-height: 38px; padding: 7px 15px; display: inline-flex; align-items: center; gap: 8px; color: var(--muted); border-radius: 999px; text-decoration: none; font-size: 12px; font-weight: 800; }
.batch-status-tabs a:hover { color: var(--teal-dark); background: rgba(255,255,255,.65); }
.batch-status-tabs a.active { color: white; background: var(--teal); box-shadow: 0 5px 13px rgba(11,118,110,.16); }
.batch-status-tabs a span { min-width: 22px; padding: 2px 6px; color: inherit; background: rgba(255,255,255,.18); border-radius: 999px; text-align: center; font-size: 10px; }
.batch-history-note { margin-bottom: 20px; }
.batch-history-section { margin-top: 0; }
.batch-pagination { flex-wrap: wrap; gap: 10px 18px; }
.batch-pagination .is-disabled { color: var(--muted); opacity: .45; }
.batch-hidden-notice { margin: -8px 0 22px; }
.batch-hidden-notice > div:not(.callout-icon) { min-width: 0; flex: 1; }
.batch-detail-remove { color: var(--red); border-color: #e4b8b3; }

.status { width: fit-content; padding: 4px 9px; display: inline-flex; border-radius: 99px; font-size: 10px; line-height: 1.3; font-weight: 800; white-space: nowrap; }
.status.success { color: #176046; background: #dff3e8; }
.status.warning { color: #8a5208; background: var(--amber-soft); }
.status.danger { color: #933b35; background: var(--red-soft); }
.status.neutral { color: #506267; background: #eaf0ef; }
.status.info { color: #315f8b; background: var(--blue-soft); }
.status.large { padding: 7px 12px; font-size: 11px; }
.empty-state { padding: 48px; display: flex; flex-direction: column; align-items: center; color: var(--muted); background: white; border: 1px dashed #becdca; border-radius: var(--radius); }
.empty-state strong { color: var(--ink); }

.flash-stack { position: fixed; right: 24px; top: 108px; z-index: 50; width: min(450px, calc(100% - 48px)); display: grid; gap: 9px; pointer-events: none; }
.flash { padding: 14px 12px 14px 14px; display: grid; grid-template-columns: 38px minmax(0, 1fr) 34px; align-items: center; gap: 12px; color: var(--ink); background: white; border: 1px solid var(--line); border-left: 5px solid; border-radius: 11px; box-shadow: var(--shadow); font-size: 13px; pointer-events: auto; animation: slide-in .25s ease; transition: opacity .25s ease, transform .25s ease; }
.flash.success { border-left-color: #2e8b5c; }
.flash.error { border-left-color: var(--red); }
.flash-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; }
.flash.success .flash-icon { color: #23734c; background: #e3f4ea; }
.flash.error .flash-icon { color: #a42f36; background: var(--red-soft); }
.flash-icon svg, .flash-close svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.flash-copy { min-width: 0; display: flex; flex-direction: column; }
.flash-copy strong { color: var(--ink); font-size: 13px; }
.flash-copy > span { color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.4; }
.flash-close { width: 34px; height: 34px; padding: 0; display: grid; place-items: center; color: var(--muted); background: transparent; border: 0; border-radius: 50%; cursor: pointer; }
.flash-close:hover { color: var(--ink); background: var(--paper); }
.flash.is-leaving { opacity: 0; transform: translateY(-8px); pointer-events: none; }
@keyframes slide-in { from { opacity: 0; transform: translateY(-8px); } }

.dialog-open { overflow: hidden; }
.confirm-dialog { width: min(520px, calc(100% - 32px)); max-width: none; padding: 30px; color: var(--ink); background: var(--card); border: 0; border-top: 6px solid var(--teal); border-radius: 12px; box-shadow: 0 28px 80px rgba(0, 0, 0, .28); }
.confirm-dialog[data-variant="danger"] { border-top-color: var(--red); }
.confirm-dialog[open] { animation: dialog-in .18s ease-out; }
.confirm-dialog::backdrop { background: rgba(18, 20, 21, .68); backdrop-filter: blur(4px); }
.confirm-dialog-close { position: absolute; right: 13px; top: 13px; width: 36px; height: 36px; padding: 0; display: grid; place-items: center; color: var(--muted); background: transparent; border: 0; border-radius: 50%; cursor: pointer; }
.confirm-dialog-close:hover { color: var(--ink); background: var(--paper); }
.confirm-dialog-close svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.confirm-dialog-heading { padding-right: 28px; display: flex; align-items: center; gap: 15px; }
.confirm-dialog-heading .eyebrow { margin-bottom: 7px; }
.confirm-dialog-heading h2 { margin: 0; font-size: 28px; }
.confirm-dialog-icon { width: 50px; height: 50px; flex: 0 0 50px; display: grid; place-items: center; color: var(--teal-dark); background: var(--teal-soft); border-radius: 50%; }
.confirm-dialog[data-variant="danger"] .confirm-dialog-icon { color: var(--red); background: var(--red-soft); }
.confirm-dialog-icon svg { width: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.confirm-dialog-message { margin: 22px 0 26px; color: var(--muted); font-size: 15px; line-height: 1.55; }
.confirm-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(10px) scale(.985); } }

.field-error { display: block; margin-top: 2px; color: #a4212f; font-size: 11px; font-weight: 700; line-height: 1.35; }
.field-error-block { margin: -5px 0 14px; }
.field-invalid > span:first-child { color: #a4212f; }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: #c82939; box-shadow: 0 0 0 3px rgba(200, 41, 57, .12); }
.drop-zone.field-invalid { border-color: #c82939; background: var(--red-soft); }

.error-page { min-height: min(610px, calc(100vh - 260px)); padding: clamp(42px, 8vw, 100px); display: grid; place-items: center; text-align: center; background: var(--card); border-top: 6px solid var(--red); border-radius: var(--radius); box-shadow: var(--shadow); }
.error-page-inner { max-width: 620px; }
.error-code { margin-bottom: 10px; color: var(--red); font-size: clamp(64px, 10vw, 120px); line-height: .9; font-weight: 800; letter-spacing: -.06em; }
.error-page h1 { margin-bottom: 14px; font-size: clamp(36px, 5vw, 58px); }
.error-page p { margin: 0 auto 26px; color: var(--muted); font-size: 17px; }

.page-heading { margin-bottom: 32px; }
.page-heading h1 { margin-bottom: 8px; font-size: clamp(38px, 4vw, 54px); }
.page-heading > p, .page-heading > div > p { color: var(--muted); }
.split-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; }
.back-link { margin-bottom: 20px; display: block; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 700; }
.heading-actions { display: flex; align-items: center; gap: 9px; padding-bottom: 8px; }

.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; }
.summary-grid article { min-height: 130px; padding: 22px; display: flex; flex-direction: column; background: white; border: 1px solid var(--line); border-top: 3px solid #bbc9c6; border-radius: 13px; }
.summary-grid article.positive { border-top-color: #4eae84; }
.summary-grid article.caution { border-top-color: #dda441; }
.summary-grid article.negative { border-top-color: #d97870; }
.summary-grid span { color: var(--muted); font-size: 11px; font-weight: 700; }
.summary-grid strong { margin: auto 0 0; font-size: 33px; letter-spacing: -.04em; }
.summary-grid small { color: var(--muted); font-size: 10px; }

.review-panel { margin-top: 18px; padding: 23px 26px; display: flex; align-items: center; justify-content: space-between; gap: 28px; background: linear-gradient(105deg, #fff6de, #fffaf0); border: 1px solid #eed79e; border-radius: var(--radius); }
.review-copy h2 { margin-bottom: 5px; }
.review-copy p { max-width: 750px; margin: 0; color: #77613d; font-size: 13px; }
.review-copy .critical-note { margin-top: 9px; padding: 9px 11px; color: #853d35; background: #ffe8e4; border-radius: 8px; }
.confirm-all-form { min-width: 270px; display: flex; flex-direction: column; align-items: stretch; gap: 9px; }
.confirm-all-form label { display: flex; align-items: center; justify-content: flex-end; gap: 7px; color: #765323; font-size: 11px; }
.destination-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; }
.destination-grid article { min-width: 0; padding: 16px; display: flex; align-items: center; gap: 12px; background: #f7faf8; border: 1px solid var(--line); border-radius: 12px; }
.destination-letter { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; color: var(--teal-dark); background: var(--teal-soft); border-radius: 10px; font-size: 12px; font-weight: 800; }
.destination-grid article > div:nth-child(2) { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.destination-grid article small { color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.destination-count { text-align: right; display: flex; flex-direction: column; }
.destination-count strong { font-size: 20px; }

.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 11px 13px; color: var(--muted); background: #f0f5f3; text-align: left; text-transform: uppercase; letter-spacing: .05em; font-size: 9px; }
td { padding: 11px 13px; border-top: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover { background: #fbfdfc; }
.check-cell { width: 42px; }
input[type="checkbox"] { width: 16px; min-height: 16px; accent-color: var(--teal); }
.code-chip { display: block; width: fit-content; padding: 3px 7px; color: var(--teal-dark); background: var(--teal-soft); border-radius: 5px; font-size: 11px; font-weight: 500; }
td .subtle { display: block; margin-top: 3px; }
.truncate { max-width: 250px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.check-all { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.bulk-bar { position: sticky; bottom: 12px; z-index: 5; margin-top: 12px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; background: rgba(237,244,241,.96); border: 1px solid #d2dfdc; border-radius: 11px; box-shadow: 0 10px 28px rgba(32,69,65,.13); backdrop-filter: blur(10px); }
.bulk-bar > span:first-child { margin-right: auto; font-size: 12px; }
.bulk-bar select { width: auto; min-width: 160px; }
.separator { color: var(--muted); font-size: 11px; }
.danger-block { border-color: #efcbc7; }
.file-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.file-grid article { padding: 12px 14px; display: flex; align-items: center; gap: 12px; background: #f8faf9; border: 1px solid var(--line); border-radius: 11px; }
.file-grid article > div { min-width: 0; display: flex; flex-direction: column; }
.file-grid strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-grid small { color: var(--muted); font-size: 10px; }

.info-callout { margin-bottom: 24px; padding: 18px 22px; display: flex; align-items: center; gap: 13px; background: #eaf2ee; border-radius: var(--radius); }
.info-callout > div:not(.callout-icon) { display: flex; flex-direction: column; }
.info-callout span { color: var(--muted); font-size: 11px; }
.info-callout i { width: 1px; height: 38px; margin: 0 18px; background: #bfcec9; }
.callout-icon { width: 32px; height: 32px; display: grid; place-items: center; color: var(--teal-dark); background: var(--lime); border-radius: 50%; font-weight: 800; }
.inline-editor { margin-bottom: 22px; padding: 16px; display: flex; align-items: flex-end; gap: 10px; background: #f5f9f7; border-radius: 12px; }
.inline-editor label { min-width: 180px; display: flex; flex-direction: column; gap: 5px; }
.inline-editor .grow { flex: 1; }
.search-bar { margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.search-bar label { max-width: 420px; flex: 1; }
.text-link { color: var(--teal); font-size: 12px; font-weight: 700; }
.row-edit { display: flex; gap: 6px; }
.row-edit select { min-width: 130px; min-height: 34px; padding: 5px 8px; font-size: 11px; }
.empty-cell { padding: 30px; text-align: center; color: var(--muted); }
.pagination { margin-top: 16px; display: flex; align-items: center; justify-content: center; gap: 24px; font-size: 12px; }
.pagination a { color: var(--teal); font-weight: 800; }
.rule-grid { display: grid; gap: 9px; }
.rule-card { padding: 11px 13px; display: grid; grid-template-columns: 140px 26px minmax(150px, 1fr) minmax(170px, 240px) minmax(205px, 260px) auto auto; align-items: end; gap: 10px; background: #f8faf9; border: 1px solid var(--line); border-radius: 11px; }
.rule-card.disabled { opacity: .55; }
.rule-card label:not(.toggle) { min-width: 0; width: 100%; display: flex; flex-direction: column; gap: 4px; }
.rule-card input, .rule-card select { min-width: 0; min-height: 36px; padding: 6px 9px; }
.recalculation-field > span { color: var(--teal-dark); }
.rule-arrow { padding: 0 3px 9px; color: var(--teal); font-size: 20px; }
.toggle { padding: 0 7px 9px; display: flex; align-items: center; gap: 6px; }
.toggle span { color: var(--ink); }
.timeline > div { display: flex; gap: 12px; }
.timeline > div > span { width: 8px; height: 8px; margin-top: 8px; flex: 0 0 8px; background: var(--teal); border-radius: 50%; }
.timeline p { margin: 0 0 13px; font-size: 12px; }
.timeline small { display: block; color: var(--muted); }

.municipality-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.municipality-card { padding: 17px; display: grid; grid-template-columns: 42px repeat(3, minmax(0, 1fr)); align-items: end; gap: 12px; background: #f8faf9; border: 1px solid var(--line); border-radius: 13px; }
.municipality-card label { display: flex; flex-direction: column; gap: 4px; }
.municipality-card > div:last-child { grid-column: 2 / -1; display: flex; align-items: center; justify-content: space-between; color: var(--muted); }
.create-panel .municipality-card.create-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.create-panel .municipality-card.create-form > div:last-child { grid-column: 1 / -1; }
.municipality-meta { gap: 18px; }
.format-preview { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; font-size: 11px; }
.format-preview > span { color: var(--muted); }
.format-preview code, .month-chip { padding: 3px 7px; color: var(--teal-dark); background: var(--teal-soft); border-radius: 5px; font-size: 11px; font-weight: 700; }

.duplicate-block { border-left: 6px solid var(--amber); }
.file-grid article.file-warning { align-items: flex-start; border-color: #e7c980; background: var(--amber-soft); }
.file-warning-text { margin-top: 5px; color: #765323; font-size: 10px; line-height: 1.4; }

.archive-list { display: grid; gap: 8px; }
.archive-month { overflow: hidden; background: white; border: 1px solid var(--line); border-left: 4px solid var(--teal); border-radius: 7px; box-shadow: 0 4px 14px rgba(32,69,65,.04); transition: border-color .15s ease, box-shadow .15s ease; }
.archive-summary { min-height: 58px; padding: 10px 12px 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 14px; list-style: none; cursor: pointer; transition: background .15s ease; }
.archive-summary::marker { content: ""; }
.archive-summary::-webkit-details-marker { display: none; }
.archive-summary:hover { background: #fbfdfc; }
.archive-summary:focus-visible { outline: 3px solid rgba(11,118,110,.24); outline-offset: -3px; }
.archive-summary-main { min-width: 0; flex: 1; display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 18px; }
.archive-month-label { color: var(--ink); font-size: 20px; line-height: 1; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.archive-summary-meta { color: var(--muted); font-size: 11px; }
.archive-toggle { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; color: var(--teal-dark); background: var(--teal-soft); border: 1px solid #c7e2dd; border-radius: 50%; transition: color .18s ease, background .18s ease, border-color .18s ease; }
.archive-chevron { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .18s ease; }
.archive-month[open] { box-shadow: 0 8px 22px rgba(32,69,65,.065); }
.archive-month[open] .archive-summary { background: #f8fbfa; }
.archive-month[open] .archive-toggle { color: white; background: var(--teal); border-color: var(--teal); }
.archive-month[open] .archive-chevron { transform: rotate(180deg); }
.archive-month-body { padding: 16px 18px 18px; border-top: 1px solid var(--line); }
.archive-month-actions { margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 18px; color: var(--muted); font-size: 11px; }
.archive-month-controls { display: flex; align-items: center; gap: 8px; }
.archive-month-controls form { margin: 0; }
.archive-files article { position: relative; padding-right: 72px; }
.archive-download { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--teal-dark); font-size: 11px; font-weight: 800; text-decoration: none; }
.archive-download:hover { text-decoration: underline; }
.empty-state .button { margin-top: 18px; }

.login-body { min-height: 100vh; background: #e9f1ee; }
.login-shell { width: min(1160px, calc(100% - 48px)); min-height: 100vh; margin: 0 auto; padding: 42px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 22px; }
.login-intro { position: relative; min-height: 650px; padding: 48px; display: flex; flex-direction: column; justify-content: flex-start; overflow: hidden; color: white; background: linear-gradient(145deg, #064d49 0%, #0b766e 72%, #14877e 100%); border-radius: 28px; box-shadow: 0 24px 65px rgba(6,77,73,.2); }
.login-intro::before, .login-intro::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.login-intro::before { width: 330px; height: 330px; right: -145px; top: -115px; border: 70px solid rgba(214,238,136,.12); }
.login-intro::after { width: 210px; height: 210px; left: -115px; bottom: -120px; background: rgba(214,238,136,.11); }
.login-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; }
.login-brand .brand-mark { color: var(--teal-dark); background: var(--lime); }
.login-brand > span:last-child { display: flex; flex-direction: column; line-height: 1.2; }
.login-brand strong { font-size: 17px; }
.login-brand small { margin-top: 3px; color: rgba(255,255,255,.68); font-size: 11px; }
.login-intro-copy { position: relative; z-index: 1; max-width: 600px; margin: auto 0; }
.login-intro h1 { margin: 0; font-size: clamp(44px, 5vw, 66px); }
.login-intro h1 em { color: var(--lime); }
.login-card { align-self: stretch; padding: clamp(28px, 5vw, 54px); display: flex; flex-direction: column; justify-content: center; background: white; border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.login-card-heading { display: flex; align-items: center; gap: 14px; }
.login-card-heading .eyebrow { margin-bottom: 7px; }
.login-card-heading h2 { margin: 0; font-size: 31px; }
.login-lock { width: 48px; height: 48px; flex: 0 0 48px; display: grid; place-items: center; color: var(--teal); background: var(--teal-soft); border-radius: 14px; }
.login-lock svg { width: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.login-help { margin: 21px 0 25px; color: var(--muted); font-size: 13px; }
.login-error { margin-bottom: 18px; padding: 11px 13px; display: flex; align-items: center; gap: 9px; color: #913d37; background: var(--red-soft); border: 1px solid #efc4c0; border-radius: 9px; font-size: 12px; font-weight: 700; }
.login-error svg { width: 21px; flex: 0 0 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.login-form { display: grid; gap: 17px; }
.login-form > label { display: grid; gap: 7px; }
.login-form > label > span:first-child { color: var(--ink); font-size: 11px; font-weight: 800; }
.input-with-icon { position: relative; display: block; }
.input-with-icon svg { position: absolute; z-index: 1; left: 13px; top: 50%; width: 19px; transform: translateY(-50%); fill: none; stroke: #78908b; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.input-with-icon input { min-height: 48px; padding-left: 43px; }
.login-submit { min-height: 48px; margin-top: 3px; }
.login-footnote { margin-top: 20px; display: block; color: var(--muted); text-align: center; font-size: 10px; }

@media (max-width: 1250px) {
  .rule-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rule-card .rule-arrow { display: none; }
  .rule-card .button { width: 100%; }
}

@media (max-width: 950px) {
  .two-column { grid-template-columns: 1fr; gap: 25px; }
  .hero { padding-top: 0; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .destination-grid { grid-template-columns: repeat(2, 1fr); }
  .municipality-grid { grid-template-columns: 1fr; }
  .workflow-strip i { display: none; }
  .workflow-strip { justify-content: space-between; gap: 10px; }
  .workflow-strip div { min-width: 0; }
  .topbar nav a { padding: 9px; }
  .login-shell { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login-intro { padding: 34px; }
}

@media (max-width: 700px) {
  .page-shell { width: min(100% - 24px, 1240px); padding-top: 28px; }
  .topbar { height: auto; padding: 12px; flex-direction: column; gap: 9px; }
  .topbar-actions { width: 100%; }
  .topbar nav { min-width: 0; flex: 1; overflow-x: auto; justify-content: flex-start; }
  .topbar nav a { flex: 0 0 auto; font-size: 11px; }
  .logout-form { padding-left: 8px; }
  .logout-form > span { display: none; }
  .brand small { display: none; }
  .flash-stack { inset: auto 12px 12px; width: auto; }
  .flash { padding: 12px 9px 12px 12px; grid-template-columns: 34px minmax(0, 1fr) 32px; gap: 9px; }
  .flash-icon { width: 34px; height: 34px; }
  .confirm-dialog { padding: 25px 18px 18px; border-radius: 9px; }
  .confirm-dialog-heading { padding-right: 30px; align-items: flex-start; gap: 11px; }
  .confirm-dialog-icon { width: 42px; height: 42px; flex-basis: 42px; }
  .confirm-dialog-heading h2 { font-size: 24px; }
  .confirm-dialog-message { margin: 18px 0 21px; font-size: 14px; }
  .confirm-dialog-actions { align-items: stretch; flex-direction: column; }
  .confirm-dialog-actions .button { width: 100%; }
  .error-page { min-height: 480px; padding: 44px 22px; }
  h1 { font-size: 42px; }
  .workflow-strip { padding: 15px; flex-direction: column; align-items: stretch; }
  .workflow-strip div { grid-template-columns: 31px 1fr; }
  .section-block { padding: 18px 14px; }
  .split-heading, .review-panel, .section-heading { align-items: flex-start; flex-direction: column; }
  .heading-actions { width: 100%; flex-wrap: wrap; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .summary-grid article { min-height: 110px; padding: 15px; }
  .destination-grid, .file-grid { grid-template-columns: 1fr; }
  .batch-row .status { display: none; }
  .batch-row-link { padding-left: 12px; gap: 10px; }
  .batch-state-form { padding-right: 8px; padding-left: 4px; }
  .batch-state-button { width: 38px; padding: 0; justify-content: center; border-radius: 50%; }
  .batch-state-button span { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
  .batch-overview-actions { width: 100%; align-items: stretch; flex-direction: column; }
  .batch-overview-actions .button { width: 100%; }
  .batch-status-tabs { width: 100%; }
  .batch-status-tabs a { flex: 1; justify-content: center; }
  .batch-hidden-notice { margin-top: 0; }
  .bulk-bar { align-items: stretch; flex-direction: column; }
  .bulk-bar > span:first-child { margin: 0; }
  .bulk-bar select { width: 100%; }
  .inline-editor { align-items: stretch; flex-direction: column; }
  .rule-card { grid-template-columns: 1fr; align-items: stretch; }
  .inline-editor label, .rule-card label:not(.toggle) { width: 100%; }
  .rule-arrow { display: none; }
  .info-callout { align-items: flex-start; flex-wrap: wrap; }
  .info-callout i { width: 100%; height: 1px; margin: 4px 0; }
  .upload-fields { grid-template-columns: 1fr; }
  .municipality-card { grid-template-columns: 42px 1fr; }
  .municipality-card label { grid-column: 2; }
  .create-panel-heading { gap: 12px; }
  .create-panel-icon { width: 42px; height: 42px; flex-basis: 42px; }
  .create-panel .create-form { padding: 14px; }
  .create-panel .municipality-card.create-form { grid-template-columns: 1fr; }
  .create-panel .municipality-card.create-form label,
  .create-panel .municipality-card.create-form > div:last-child { grid-column: 1; }
  .create-panel .create-submit { width: 100%; }
  .municipality-meta { align-items: flex-start !important; flex-direction: column; }
  .format-preview { margin-left: 0; }
  .archive-summary { min-height: 58px; padding: 9px 10px 9px 12px; align-items: center; gap: 10px; }
  .archive-summary-main { align-items: baseline; flex-direction: row; gap: 2px 12px; }
  .archive-month-label { font-size: 18px; }
  .archive-summary-meta { font-size: 10px; }
  .archive-toggle { width: 32px; height: 32px; flex-basis: 32px; }
  .archive-month-body { padding: 16px; }
  .archive-month-actions { align-items: stretch; flex-direction: column; }
  .archive-month-controls { align-items: stretch; flex-direction: column; }
  .archive-month-controls .button { width: 100%; }
  .archive-files article { padding-right: 68px; }
  footer { flex-direction: column; gap: 5px; }
  .login-shell { width: min(100% - 24px, 560px); padding: 12px 0; grid-template-columns: 1fr; gap: 12px; }
  .login-intro { min-height: 270px; padding: 25px; border-radius: 21px; }
  .login-intro h1 { font-size: 39px; }
  .login-card { padding: 27px 22px; border-radius: 21px; }
}

