:root {
    --bg: #f8f9ff;
    --ink: #0b1c30;
    --muted: #71787b;
    --line: #e2e8f0;
    --card: #ffffff;
    --sidebar: #ffffff;
    --nav: #334155;
    --mint: #85f8cb;
    --sky: #0ea5e9;
    --sky-deep: #0284c7;
    --teal: #0f766e;
    --amber: #d97706;
    --coral: #dc2626;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    --radius: 12px;
    --side: 260px;
    --font: Inter, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--bg);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.05rem; }

.shell { min-height: 100vh; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--side);
    background: var(--sidebar);
    color: var(--nav);
    padding: 16px 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    z-index: 20;
    border-right: 1px solid var(--line);
}
.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    text-decoration: none;
    min-height: 64px;
}
.brand img { width: 168px; height: auto; }
.nav-label {
    margin: 8px 10px 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.side-nav .nav-label:not(:first-child) { margin-top: 16px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--nav);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}
.side-nav a:hover { background: #f1f5f9; }
.side-nav a.is-active {
    background: #e0f2fe;
    color: var(--sky-deep);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--sky);
}
.side-nav .count {
    margin-left: auto;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}
.side-nav a.is-active .count { color: var(--sky-deep); }
.side-nav .ms {
    font-size: 20px;
    width: 20px;
    flex: none;
    text-transform: none;
    letter-spacing: normal;
    color: #64748b;
}
.side-nav a.is-active .ms { color: var(--sky-deep); }
.fee-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fee-input {
    width: 150px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
    font: inherit;
    color: var(--ink);
    background: #fff;
}
.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.photo-slot {
    margin: 0;
    border: 1px dashed var(--line);
    border-radius: 12px;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--muted);
    background: #f8fafc;
    text-align: center;
    padding: 12px;
}
.photo-slot img { width: 100%; height: 160px; object-fit: cover; border-radius: 8px; }
.photo-slot figcaption { font-size: 12px; font-weight: 600; }
.photo-slot p { margin: 0; font-size: 12px; }
@media (max-width: 860px) {
    .photo-grid { grid-template-columns: 1fr; }
}

.main { margin-left: var(--side); min-height: 100vh; transition: margin-left 0.2s ease; }
.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 64px;
    padding: 0 28px;
    background: #fff;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 10;
}
.topbar-title { font-size: 18px; white-space: nowrap; }
.search-form { flex: 1; display: flex; justify-content: flex-end; }
.search-form input {
    width: min(420px, 100%);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 9px 16px;
    outline: none;
    font-size: 13px;
}
.search-form input:focus { border-color: var(--sky); box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15); }
.sidebar { transition: transform 0.2s ease; }
.burger {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 8px;
    padding: 0;
    cursor: pointer;
    flex: none;
}
.burger span { display: block; width: 16px; height: 2px; margin: 0 auto; background: var(--ink); border-radius: 2px; }
@media (min-width: 861px) {
    html.sidebar-collapsed .sidebar { transform: translateX(-105%); }
    html.sidebar-collapsed .main { margin-left: 0; }
}
.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #e0f2fe;
    color: var(--sky-deep);
    font-weight: 700;
}
.user-menu { position: relative; }
.user-menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu small { display: block; color: var(--muted); font-size: 12px; }
.menu-pop {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 200px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(11, 28, 48, 0.08);
    padding: 6px;
    z-index: 20;
}
.menu-pop a, .menu-pop button {
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    border-radius: 8px;
    padding: 9px 10px;
    text-decoration: none;
    cursor: pointer;
}
.menu-pop a:hover, .menu-pop button:hover { background: #f8fafc; }

.content { padding: 28px 32px 48px; }
.page-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; margin-bottom: 16px; }
.kicker {
    margin: 0 0 4px;
    color: var(--sky-deep);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 11px;
}
.lede { margin: 6px 0 0; color: var(--muted); max-width: 68ch; }

.btn, button.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 8px;
    border: 1px solid transparent;
    padding: 8px 16px;
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    background: #fff;
}
button.btn-primary, a.btn-primary, .btn-primary,
button.btn-lime, a.btn-lime, .btn-lime { background: var(--sky); color: #fff; }
button.btn-primary:hover, a.btn-primary:hover, .btn-primary:hover,
button.btn-lime:hover, a.btn-lime:hover, .btn-lime:hover { background: var(--sky-deep); }
button.btn-ghost, a.btn-ghost, .btn-ghost { border-color: var(--line); background: #fff; color: var(--ink); }
button.btn-danger, a.btn-danger, .btn-danger { background: #fef2f2; color: var(--coral); }
.btn-small { padding: 6px 12px; font-size: 12px; }
button.btn:disabled { opacity: 0.45; cursor: not-allowed; }
button.btn-primary:disabled:hover, button.btn-lime:disabled:hover { background: var(--sky); }
.bulk-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.bulk-bar .help { margin: 0; }
.dt-check { width: 42px; text-align: center; }
.dt-check input { width: 16px; height: 16px; accent-color: #0284c7; }

.alert { border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; }
.alert-success { background: #ecfdf5; color: #065f46; }
.alert-error { background: #fef2f2; color: #991b1b; }

.grid-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat, .card {
    background: var(--card);
    border: 1px solid #eef2f6;
    border-radius: 16px;
    box-shadow: var(--shadow);
}
.stat { padding: 16px; }
.stat .label { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.stat strong { display: block; font-size: 1.7rem; margin-top: 6px; letter-spacing: -0.03em; }
.stat em { font-style: normal; color: var(--muted); font-size: 12px; }
.layout-2 { display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 14px; margin-top: 14px; }
.map-stack { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.layout-3 { display: grid; grid-template-columns: 1.1fr 0.9fr 0.9fr; gap: 14px; margin-top: 14px; }
.card { padding: 16px 18px 18px; }
.card h2 { margin-bottom: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.help, .field small { color: var(--muted); font-size: 12px; }

.meter { display: grid; grid-template-columns: 150px 1fr auto; gap: 10px; align-items: center; margin: 8px 0; font-size: 13px; }
.meter span { color: var(--muted); }
.track { height: 8px; background: #e8eef5; border-radius: 999px; position: relative; overflow: hidden; }
.track i { position: absolute; left: 0; top: 0; height: 100%; background: #7dd3fc; }
.track i.issued { background: var(--teal); }
.donut-row { display: flex; gap: 16px; align-items: center; }
.donut {
    width: 120px; height: 120px; border-radius: 50%; flex: none;
    background: conic-gradient(#0f766e 0 var(--a), #0ea5e9 var(--a) var(--b), #e2e8f0 var(--b) 100%);
    display: grid; place-items: center;
}
.donut::after { content: ""; width: 72px; height: 72px; border-radius: 50%; background: #fff; }
.legend, .list-reset { list-style: none; padding: 0; margin: 0; }
.legend { display: flex; flex-direction: column; gap: 8px; }
.legend li, .list-reset a, .list-reset li { display: flex; justify-content: space-between; gap: 12px; }
.list-reset a { text-decoration: none; padding: 8px 0; border-bottom: 1px solid #f1f5f9; }
.list-reset a:hover { color: var(--sky-deep); }
.swatch { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.unit-filters { margin: 2px 0 12px; }
.filters .filter-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.filter-group {
    flex: 1 1 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
    margin-top: 4px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fafc;
}
.filter-group-title {
    flex: 1 1 100%;
    margin: 0;
    color: var(--ink);
    font-size: 12px;
    font-weight: 700;
}
.filter-card { margin-bottom: 14px; }
.modal {
    width: min(640px, calc(100vw - 32px));
    border: 0;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 24px 60px rgba(11, 28, 48, 0.18);
}
.modal::backdrop { background: rgba(11, 28, 48, 0.45); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.modal-head h2 { margin: 0; }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-grid .span-2 { grid-column: span 2; }
@media (max-width: 640px) {
    .modal-grid { grid-template-columns: 1fr; }
    .modal-grid .span-2 { grid-column: auto; }
}
.point-card { margin-bottom: 14px; }
.point-card h2 { margin-bottom: 4px; }
.point-card .help { margin: 0 0 12px; }
.point-recap { display: flex; flex-wrap: wrap; gap: 8px; }
.point-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px 6px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    text-decoration: none;
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
}
.point-chip strong {
    min-width: 1.5rem;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eef6ff;
    color: #0369a1;
    font-size: 12px;
    text-align: center;
}
.point-chip.is-active { border-color: #7dd3fc; background: #f0f9ff; }
.point-chip:hover { border-color: #93c5fd; }
.filter-card h2 { margin-bottom: 12px; }
.filters label, .field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.filters input, .filters select, .field input, .field select, .field textarea {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 9px 12px;
    outline: none;
    color: var(--ink);
    font-weight: 500;
    min-width: 0;
}
.field textarea { min-height: 88px; resize: vertical; }
.filters input:focus, .filters select:focus, .field input:focus, .field select:focus, .field textarea:focus {
    border-color: var(--sky);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}
.combo { position: relative; min-width: 180px; }
.combo-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
.combo-button {
    width: 100%;
    display: flex;
    align-items: center;
    text-align: left;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 9px 32px 9px 12px;
    color: var(--ink);
    font-weight: 500;
    cursor: pointer;
    position: relative;
}
.combo-button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-button::after {
    content: "";
    position: absolute;
    right: 12px;
    top: 50%;
    width: 7px;
    height: 7px;
    border-right: 2px solid #64748b;
    border-bottom: 2px solid #64748b;
    transform: translateY(-70%) rotate(45deg);
}
.combo-button:focus, .combo-panel input:focus {
    border-color: var(--sky);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
    outline: none;
}
.combo-panel {
    position: absolute;
    z-index: 40;
    top: calc(100% + 4px);
    left: 0;
    min-width: 100%;
    width: max-content;
    max-width: 320px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(11, 28, 48, 0.12);
    padding: 8px;
}
.combo-panel input { width: 100%; }
.combo-list { list-style: none; margin: 8px 0 0; padding: 0; max-height: 240px; overflow: auto; }
.combo-list button {
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    font-weight: 600;
    color: var(--ink);
}
.combo-list button[aria-selected="true"], .combo-list button.is-active, .combo-list button:hover {
    background: #e0f2fe;
    color: #0284c7;
}
.combo-empty { padding: 8px 10px; color: var(--muted); font-weight: 600; }
.table-wrap { overflow: auto; border: 1px solid #eef2f6; border-radius: 16px; background: #fff; padding: 8px 12px 12px; }
.dt-container { color: var(--ink); }
.dt-container .dt-layout-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 8px 4px; width: 100%; }
.dt-container .dt-layout-end { margin-left: auto; display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.dt-container .dt-search { margin-left: 0; }
.dt-container .dt-length, .dt-container .dt-info, .dt-container .dt-search { color: var(--muted); font-size: 13px; }
.dt-container .dt-search input {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 8px;
    padding: 8px 12px;
    min-width: 220px;
    color: var(--ink);
    font: inherit;
}
.dt-container th.dt-num, .dt-container td.dt-num { width: 56px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.dt-container .dt-length select {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 6px 8px;
    background: #fff;
    margin: 0 6px;
}
.dt-container table.dataTable { width: 100% !important; margin: 0; }
.dt-container table.dataTable thead th { border-bottom: 1px solid #f1f5f9; }
.dt-paging .dt-paging-button {
    border: 1px solid var(--line) !important;
    border-radius: 8px !important;
    background: #fff !important;
    color: var(--ink) !important;
    margin: 0 2px !important;
}
.dt-paging .dt-paging-button.current,
.dt-paging .dt-paging-button:hover {
    background: #e0f2fe !important;
    color: #0284c7 !important;
    border-color: #bae6fd !important;
}
.dt-processing { font-weight: 700; color: var(--sky-deep); }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
th {
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    background: #f8fafc;
    font-weight: 600;
}
tr:last-child td { border-bottom: 0; }
td { color: #3d4a57; font-size: 13px; }
td a.row-link, td button.row-link { color: var(--sky-deep); font-weight: 700; text-decoration: none; }
td button.row-link { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; cursor: pointer; text-align: left; }
.sub { display: block; color: var(--muted); font-size: 12px; font-weight: 500; }
.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: #f1f5f9;
    color: #475569;
}
.badge-ok { background: var(--teal); color: #fff; }
.badge-warn { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #e0f2fe; color: #0369a1; }
.badge-lime { background: #ccfbf1; color: #115e59; }
.badge-neutral { background: #f1f5f9; color: #475569; }
.doc-checks { display: grid; grid-template-columns: auto auto; gap: 2px 14px; justify-content: start; }
.doc-checks span { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: #94a3b8; white-space: nowrap; }
.doc-checks span.is-done { color: var(--ink); font-weight: 600; }
.doc-checks .ms { font-size: 16px; color: #cbd5e1; }
.doc-checks span.is-done .ms { color: #0f766e; }

.pager { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-top: 14px; }
.pager-actions { display: flex; gap: 8px; }
.pager-btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 7px 12px; text-decoration: none; font-size: 13px; }
.pager-btn.is-disabled { opacity: 0.45; }
.pager-meta { color: var(--muted); font-size: 13px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.account-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; align-items: start; }
.field small { text-transform: none; letter-spacing: 0; font-weight: 500; line-height: 1.4; }
.field.span-2, .span-2 { grid-column: span 2; }
.field span { font-weight: 600; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.field-error { color: var(--coral); margin: 0; font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: 0; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--ink); }
.section-title { grid-column: 1 / -1; margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
.form-actions { display: flex; gap: 10px; margin-top: 16px; }
details.fold summary { cursor: pointer; font-weight: 700; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.def { display: grid; grid-template-columns: 180px 1fr; gap: 8px 12px; }
.def dt { color: var(--muted); }
.def dd { margin: 0; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.split > * { min-width: 0; }

.hero { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 16px; align-items: stretch; margin-bottom: 16px; }
.hero-copy h1 { font-size: 1.7rem; }
.hero-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hero-panel div { background: #fff; border: 1px solid #eef2f6; border-radius: 16px; padding: 14px; box-shadow: var(--shadow); }
.hero-panel strong { display: block; font-size: 1.45rem; }
.hero-panel span { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
#map, #province-map, #location-map, #application-map { height: 520px; border-radius: 16px; border: 1px solid var(--line); background: #e7f3fb; }
#location-map, #application-map { height: 420px; }
.icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--ink);
}
.icon-btn .ms { font-size: 20px; transition: transform 0.15s ease; }
tr.group-start td { border-top: 1px solid #e2e8f0; }
.loc-span { background: #f8fafc; }
.group-note { background: #f8fafc; color: var(--muted); font-size: 12px; font-weight: 600; }
.file-link {
    background: none;
    border: 0;
    padding: 0;
    color: var(--sky-deep);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.file-miss { color: var(--muted); }
.file-code { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); word-break: break-all; }
.doc-modal { width: min(560px, calc(100vw - 32px)); }
.machine-modal { width: min(880px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; }
.machine-modal h3 { margin: 0 0 10px; font-size: 1rem; }
.machine-modal .help { margin: 4px 0 0; }
.doc-sheet { border: 1px solid var(--line); border-radius: 12px; background: #f8fafc; padding: 18px; }
.doc-sheet .label { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.doc-sheet .file-code { display: block; margin: 6px 0 10px; font-size: 1.15rem; }
.doc-sheet p { margin: 0 0 8px; }
.file-photos { display: flex; flex-wrap: wrap; gap: 8px; }
.file-photos a { display: flex; flex-direction: column; gap: 4px; width: 88px; color: var(--sky-deep); font-size: 11px; font-weight: 600; text-decoration: none; }
.file-photos img { width: 88px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
#province-map { height: 640px; background: #d6e6f2; overflow: hidden; }
.leaflet-control-attribution { font-size: 10px; background: rgba(255, 255, 255, 0.85); }
.map-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.map-legend-points { margin-top: -2px; }
.legend-label { font-weight: 700; color: #334155; }
.map-legend .swatch { width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(11, 28, 48, 0.16); vertical-align: -2px; }
.map-legend .swatch-dot { border-radius: 50%; }
.city-summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 4px; }
.province-filter { margin: 0; align-items: center; }
.province-filter > span { font-size: 13px; font-weight: 650; }
.province-filter .combo { min-width: 220px; }
.city-summary strong { font-variant-numeric: tabular-nums; }
.lookup { position: relative; }
.lookup-results {
    position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px);
    background: #fff; border: 1px solid var(--line); border-radius: 12px;
    box-shadow: 0 12px 30px rgba(11, 28, 48, 0.08); max-height: 260px; overflow: auto;
}
.lookup-results button { width: 100%; text-align: left; background: none; border: 0; padding: 10px 12px; cursor: pointer; }
.lookup-results button:hover { background: #f8fafc; }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 0.95fr; }
.login-art {
    color: #fff;
    padding: 56px 64px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 22px;
    background-color: #062f3c;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(165deg, #0c4c46 0%, #083844 42%, #062433 100%);
    background-size: 56px 56px, 56px 56px, auto;
}
.login-art .logo-card {
    width: fit-content;
    background: #fff;
    border-radius: 16px;
    padding: 16px 22px;
    margin-bottom: 12px;
}
.login-art .logo-card img { width: 210px; }
.login-art .kicker { color: #7ddec0; }
.login-art h1 { font-size: 2.6rem; line-height: 1.15; max-width: 16ch; color: #fff; }
.login-art p { margin: 0; color: rgba(255, 255, 255, 0.82); max-width: 42ch; font-size: 15px; }
.login-points { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 10px; }
.login-points li { display: flex; gap: 10px; align-items: center; color: rgba(255, 255, 255, 0.9); }
.login-card { display: grid; place-items: center; padding: 40px 28px; background: #f7f9fc; }
.login-box { width: min(420px, 100%); }
.login-box h2 { font-size: 1.7rem; margin-bottom: 6px; }
.login-box .btn-primary { width: 100%; min-height: 46px; border-radius: 10px; font-size: 15px; margin-top: 6px; }
.login-foot { margin-top: 22px; text-align: center; color: var(--muted); font-size: 12px; }

@media (max-width: 1100px) {
    .grid-stats, .layout-3, .hero { grid-template-columns: 1fr; }
    .layout-2, .split, .form-grid, .account-fields { grid-template-columns: 1fr; }
    .field.span-2, .span-2 { grid-column: auto; }
    .login-art { min-height: 320px; padding: 32px; }
    .login-art h1 { font-size: 2rem; }
}
@media (max-width: 860px) {
    .login-shell { grid-template-columns: 1fr; }
    .sidebar { transform: translateX(-105%); }
    html.sidebar-open .sidebar { transform: none; }
    .main { margin-left: 0; }
    .content { padding: 18px 16px 40px; }
    .topbar { padding: 0 16px; }
    .topbar-title { display: none; }
    .page-head { flex-direction: column; align-items: flex-start; }
    .meter { grid-template-columns: 1fr; }
    .user-chip small, .user-menu small { display: none; }
}
:focus-visible { outline: 3px solid rgba(14, 165, 233, 0.45); outline-offset: 2px; }

.ms {
    font-family: "Material Symbols Outlined";
    font-weight: normal;
    font-style: normal;
    font-size: 22px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
}
.card h2 .ms, .card h3 .ms { font-size: 20px; vertical-align: -4px; margin-right: 6px; color: var(--sky-deep); }
.card h3 { display: flex; align-items: center; gap: 8px; margin: 4px 0 10px; font-size: 14px; }
.card h3 + .metric-list { margin-bottom: 16px; }

.kpi-grid, .shortcut-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.hierarchy { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: stretch; }
.hierarchy-join { display: flex; align-items: center; color: #94a3b8; }
.hierarchy-join .ms { font-size: 22px; }
a.kpi { display: block; text-decoration: none; color: inherit; }
a.kpi:hover { border-color: #cbd5e1; }
.kpi-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-right: 6px;
    border-radius: 999px;
    background: #e2e8f0;
    color: var(--ink);
    font-size: 11px;
    letter-spacing: 0;
    text-transform: none;
}
.shortcut-grid { margin: 14px 0; }
.kpi, .shortcut {
    position: relative;
    background: #fff;
    border: 1px solid #e8eef5;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(11, 28, 48, 0.06);
    overflow: hidden;
}
.kpi::before, .shortcut::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 4px;
}
.tone-sky::before { background: #0284c7; }
.tone-green::before { background: #22c55e; }
.tone-violet::before { background: #7c3aed; }
.tone-amber::before { background: #d97706; }
.tone-rose::before { background: #ef4444; }
.tone-sky .kpi-value strong, .tone-sky .kpi-note { color: #0284c7; }
.tone-green .kpi-value strong, .tone-green .kpi-note { color: #16a34a; }
.tone-violet .kpi-value strong, .tone-violet .kpi-note { color: #7c3aed; }
.tone-amber .kpi-value strong, .tone-amber .kpi-note { color: #b45309; }
.kpi { padding: 18px 16px 16px; }
.kpi-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.kpi-label { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.kpi-value { display: flex; align-items: baseline; gap: 6px; margin: 12px 0 0; }
.kpi-value strong { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.kpi-value span { color: var(--muted); font-size: 13px; font-weight: 600; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
}
.pill-sky { background: #e0f2fe; color: #0369a1; }
.pill-teal { background: #ccfbf1; color: #0f766e; }
.pill-violet { background: #f3e8ff; color: #7e22ce; }
.pill-amber { background: #fef3c7; color: #b45309; }
.pill-rose { background: #fee2e2; color: #b91c1c; }
.pill-green { background: #dcfce7; color: #15803d; }
.kpi-note { display: flex; align-items: center; gap: 6px; margin: 12px 0 0; font-size: 12px; font-weight: 600; }
.kpi-note i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.kpi-icon {
    width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none;
}
.kpi-icon.sky { background: #eff6ff; color: #0369a1; }
.kpi-icon.teal, .kpi-icon.green { background: rgba(34, 197, 94, 0.12); color: #16a34a; }
.kpi-icon.violet { background: #f3e8ff; color: #7e22ce; }
.kpi-icon.amber { background: #ffedd5; color: #c2410c; }
.kpi-icon.rose { background: rgba(239, 68, 68, 0.1); color: #dc2626; }
.shortcut { display: flex; align-items: center; gap: 12px; padding: 16px; text-decoration: none; }
.shortcut:hover { border-color: #bae6fd; }
.shortcut-copy { min-width: 0; }
.shortcut strong { display: block; font-size: 14px; }
.shortcut .pill { margin-left: auto; }
.shortcut .meta, .rank-list .meta { color: var(--muted); font-size: 12px; font-weight: 500; }
.rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rank-list li { display: flex; align-items: center; gap: 10px; }
.rank-list a { display: flex; flex-direction: column; text-decoration: none; min-width: 0; }
.rank-list a:hover strong { color: var(--sky-deep); }
.rank-list b { margin-left: auto; font-size: 15px; }
.rank { width: 24px; height: 24px; border-radius: 999px; background: #f1f5f9; color: #475569; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.rank-wide { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 28px; }
.metric-list { list-style: none; margin: 0; padding: 0; }
.metric-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid #f1f5f9; }
.metric-list li:last-child { border-bottom: 0; }
.metric-list span { color: var(--muted); }
.permit-split { align-items: start; }
.map-credit { margin-top: 8px; }
.recap-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.recap-head h2 { margin-bottom: 0; }
.recap-tools { display: flex; align-items: center; gap: 8px; }
.recap-tools .btn { white-space: nowrap; }
.recap-head input {
    width: min(260px, 100%);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 14px;
    background: #fff;
    outline: none;
}
.recap-head input:focus { border-color: var(--sky); box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15); }
.recap-scroll { max-height: 520px; overflow: auto; }
.recap-tall { max-height: 560px; }
.recap { width: 100%; min-width: 0; border-collapse: collapse; }
.recap th { position: sticky; top: 0; z-index: 1; }
.recap td a { color: var(--sky-deep); font-weight: 700; text-decoration: none; }
.recap td a:hover { text-decoration: underline; }
.recap-num { text-align: right; font-weight: 700; white-space: nowrap; }
.muted-cell { color: var(--muted); }
.mini-track { height: 7px; background: #e8eef5; border-radius: 999px; overflow: hidden; min-width: 72px; }
.mini-track i { display: block; height: 100%; background: #0ea5e9; border-radius: inherit; }
.province-count-wrap { background: none !important; border: 0 !important; }
.province-count {
    position: absolute;
    left: 0;
    top: 0;
    transform: translate(-50%, -50%);
    background: #0b1220;
    color: #ffffff;
    font-family: Inter, sans-serif;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    padding: 3px 6px;
    border-radius: 999px;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px #0b1220, 0 1px 3px rgba(0, 0, 0, 0.45);
    white-space: nowrap;
}
@media (max-width: 1100px) {
    .kpi-grid, .shortcut-grid { grid-template-columns: 1fr 1fr; }
    .hierarchy { grid-template-columns: 1fr; }
    .hierarchy-join { display: none; }
    .rank-wide { grid-template-columns: 1fr; }
    #map { height: 420px; }
    #province-map { height: 520px; }
}
@media (max-width: 860px) {
    .kpi-grid, .shortcut-grid { grid-template-columns: 1fr; }
    .recap-head { flex-direction: column; }
    .recap-head input { width: 100%; }
}
