﻿/* LevyCAP — aligned to the Victorian Government (DTP) planning palette.
   Australian/British English. The whole product is driven by a single --accent token;
   swap it and sidebar, CTAs, active items and headline stats recolour together.

   Palette taken from planning.vic.gov.au: teal #017D7D, navy #011A3C, ink #1F1F1F,
   tints #CCECF0 / #EFF9F9, action blue #0052C2, neutral surface #F6F6F9. */

:root {
    /* Core */
    --ink: #011A3C; /* Vic navy */
    --accent: #017D7D; /* DTP teal — the one brand accent */
    --accent-hover: #015E5E;
    --charcoal: #1F1F1F; /* Vic body ink */
    --slate: #53647A;
    /* Neutrals */
    --white: #FFFFFF;
    --paper: #F6F6F9;
    --stone: #E8EBEE;
    --line: #D6DCE3;
    --accent-tint: #EFF9F9;
    --accent-tint-strong: #CCECF0;
    --accent-mid: #93D4D4;
    /* Semantic */
    --success: #0D7A4C;
    --warning: #A15C00;
    --danger: #B3241C;
    --info: #0052C2; /* Vic action blue */
    /* Elevation — navy-tinted, never pure black */
    --shadow-card: 0 1px 3px rgba(1, 26, 60, 0.08);
    --shadow-raised: 0 6px 24px rgba(1, 26, 60, 0.12);
    /* Radii */
    --r-card: 8px;
    --r-input: 4px;
    --r-pill: 999px;
    --sidebar-w: 264px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: "Archivo", system-ui, sans-serif;
    font-weight: 300;
    font-size: 17px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
    font-family: "Spectral", Georgia, serif;
    color: var(--ink);
    margin: 0 0 0.4em;
    line-height: 1.1;
}

h1 {
    font-weight: 800;
    letter-spacing: -0.02em;
    font-size: 40px;
}

h2 {
    font-weight: 700;
    letter-spacing: -0.015em;
    font-size: 30px;
}

h3 {
    font-weight: 600;
    font-size: 22px;
}

a {
    color: var(--accent);
    text-decoration: none;
}

    a:hover {
        color: var(--accent-hover);
    }

.overline {
    font-family: "Archivo", sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 12px;
    color: var(--slate);
}

/* ---------- Layout ---------- */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-main {
    flex: 1;
    padding: 40px 48px;
    max-width: 1180px;
}

.page-head {
    margin-bottom: 28px;
}

    .page-head .overline {
        display: block;
        margin-bottom: 6px;
    }

/* ---------- Sidebar ---------- */
.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--ink);
    color: var(--paper);
    padding: 26px 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

    .sidebar .wordmark {
        font-family: "Spectral", serif;
        font-weight: 800;
        letter-spacing: -0.02em;
        font-size: 24px;
        color: var(--white);
        padding: 0 10px 4px;
    }

        .sidebar .wordmark span {
            color: var(--accent);
        }

    .sidebar .tagline {
        font-size: 11px;
        letter-spacing: 0.14em;
        text-transform: uppercase;
        color: rgba(246, 246, 249, 0.5);
        padding: 0 10px 22px;
    }

.nav-group-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(246, 246, 249, 0.45);
    padding: 18px 10px 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    color: rgba(246, 246, 249, 0.82);
    font-weight: 400;
    font-size: 15px;
    transition: background 160ms ease-out, color 160ms ease-out;
}

    .nav-link:hover {
        background: rgba(255, 255, 255, 0.06);
        color: var(--white);
    }

    .nav-link.active {
        background: var(--accent);
        color: var(--white);
    }

        .nav-link.active:hover {
            background: var(--accent-hover);
            color: var(--white);
        }

.sidebar-spacer {
    flex: 1;
}

.sidebar-foot {
    padding: 10px;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: 12px;
}

    .sidebar-foot .who {
        font-size: 13px;
        color: rgba(246,246,249,0.6);
        padding: 0 2px 8px;
    }

/* ---------- Buttons (pills) ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: "Archivo", sans-serif;
    font-weight: 600;
    font-size: 15px;
    border-radius: var(--r-pill);
    padding: 13px 26px;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: background 160ms ease-out, color 160ms ease-out, border-color 160ms ease-out, transform 120ms ease-out;
}

    .btn:active {
        transform: scale(0.98);
    }

.btn-sm {
    padding: 9px 18px;
    font-size: 14px;
}

.btn-primary {
    background: var(--accent);
    color: var(--white);
}

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

.btn-dark {
    background: var(--ink);
    color: var(--paper);
}

    .btn-dark:hover {
        background: var(--charcoal);
        color: var(--paper);
    }

.btn-ghost {
    background: transparent;
    border-color: var(--line);
    color: var(--ink);
}

    .btn-ghost:hover {
        border-color: var(--accent);
        color: var(--accent);
    }

.btn-link {
    background: none;
    border: none;
    color: var(--accent);
    padding: 0;
    font-weight: 600;
    cursor: pointer;
}

    .btn-link:hover {
        color: var(--accent-hover);
    }

.nav-form {
    margin: 0;
}

    .nav-form button {
        width: 100%;
        text-align: left;
        background: none;
        border: none;
        cursor: pointer;
        font-family: "Archivo", sans-serif;
        font-size: 15px;
        color: rgba(246,246,249,0.82);
        padding: 9px 12px;
        border-radius: 10px;
    }

        .nav-form button:hover {
            background: rgba(255,255,255,0.06);
            color: var(--white);
        }

/* ---------- Forms ---------- */
label.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

    label.field > span {
        font-size: 14px;
        font-weight: 500;
        color: var(--charcoal);
    }

input, select, textarea {
    font-family: "Archivo", sans-serif;
    font-size: 16px;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--r-input);
    padding: 11px 13px;
}

    input:focus, select:focus, textarea:focus {
        outline: none;
        border-color: var(--accent);
        background: var(--white);
        box-shadow: 0 0 0 3px var(--accent-tint);
    }

/* ---------- Cards ---------- */
.card {
    background: var(--white);
    border-radius: var(--r-card);
    box-shadow: var(--shadow-card);
    padding: 24px 26px;
}

    .card + .card {
        margin-top: 18px;
    }

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}

/* ---------- Callout ---------- */
.callout {
    background: var(--accent-tint);
    border-left: 4px solid var(--accent);
    border-radius: 0 10px 10px 0;
    padding: 16px 20px;
    color: var(--ink);
}

    .callout.info {
        background: #E5EDF4;
        border-color: var(--info);
    }

    .callout.success {
        background: #E6F2EC;
        border-color: var(--success);
    }

    .callout.danger {
        background: #FBEAE9;
        border-color: var(--danger);
    }

/* ---------- Tags / status ---------- */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 11px;
    border-radius: var(--r-pill);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

/* ---------- Metric ---------- */
.metric .value {
    font-family: "Spectral", serif;
    font-weight: 800;
    font-size: 38px;
    color: var(--ink);
    line-height: 1.05;
    word-break: break-word;
}

.metric .label {
    font-family: "Archivo", sans-serif;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--slate);
}

/* ---------- Tables ---------- */
table.ue {
    width: 100%;
    border-collapse: collapse;
}

    table.ue thead th {
        background: var(--paper);
        text-align: left;
        font-family: "Archivo", sans-serif;
        font-weight: 600;
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: var(--slate);
        padding: 12px 14px;
    }

    table.ue tbody td {
        padding: 13px 14px;
        border-top: 1px solid var(--stone);
        font-size: 15px;
    }

/* Stub notice for unbuilt pages */
.stub {
    border: 1px dashed var(--line);
    border-radius: var(--r-card);
    padding: 28px;
    background: var(--white);
    color: var(--slate);
}

    .stub h3 {
        color: var(--ink);
    }

/* Hero (public front page) */
.hero {
    padding: 80px 48px 56px;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

    .hero h1 {
        font-size: 60px;
    }

    .hero .subtitle {
        font-size: 20px;
        color: var(--slate);
        max-width: 620px;
        margin-left: auto;
        margin-right: auto;
    }

    .hero .cta-row {
        margin-top: 28px;
        display: flex;
        gap: 14px;
        justify-content: center;
    }

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    padding: 0 48px 48px;
}

.site-footer {
    padding: 28px 48px;
    color: var(--slate);
    font-size: 14px;
    border-top: 1px solid var(--line);
}

.public-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 48px;
}

    .public-top .wordmark {
        font-family: "Spectral", serif;
        font-weight: 800;
        font-size: 22px;
        color: var(--ink);
    }

        .public-top .wordmark span {
            color: var(--accent);
        }

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}

@media (max-width: 820px) {
    .app-shell {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 4px;
    }

        .sidebar .tagline, .nav-group-label, .sidebar-spacer {
            display: none;
        }

    .app-main {
        padding: 24px 20px;
    }

    .hero {
        padding: 48px 20px 32px;
    }

        .hero h1 {
            font-size: 40px;
        }

    .features, .site-footer, .public-top {
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* App body column (header + main) beside the sidebar */
.app-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

    .app-body .app-main {
        flex: 1;
    }

/* ICP header — one button per ICP, click to switch */
.icp-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 48px;
    background: var(--white);
    border-bottom: 1px solid var(--line);
}

.icp-header-label {
    flex-shrink: 0;
}

.icp-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.icp-tab-form {
    margin: 0;
}

.icp-tab {
    font-family: "Archivo", sans-serif;
    font-weight: 500;
    font-size: 14px;
    padding: 7px 16px;
    border-radius: var(--r-pill);
    cursor: pointer;
    background: var(--stone);
    color: var(--ink);
    border: 1.5px solid transparent;
    transition: background 160ms ease-out, color 160ms ease-out, border-color 160ms ease-out;
}

    .icp-tab:hover {
        border-color: var(--accent);
        color: var(--accent);
    }

    .icp-tab.active {
        background: var(--accent);
        color: var(--white);
    }

        .icp-tab.active:hover {
            background: var(--accent-hover);
            color: var(--white);
            border-color: transparent;
        }

.icp-header-empty {
    color: var(--slate);
    font-size: 14px;
}

@media (max-width: 820px) {
    .icp-header {
        padding: 12px 20px;
    }
}

/* ---------- Dashboard ---------- */
.dash-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 4px;
}

    .dash-hero h1 {
        font-size: 40px;
        margin: 2px 0 6px;
    }

.dash-sub {
    color: var(--slate);
    font-size: 16px;
    margin: 0;
    max-width: 640px;
}

.dash-role-chip {
    flex-shrink: 0;
    font-family: "Archivo", sans-serif;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--accent);
    background: var(--accent-tint);
    border-radius: var(--r-pill);
    padding: 7px 14px;
    white-space: nowrap;
}

.dash-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 18px;
    margin-top: 22px;
}

.metric.accent-top {
    position: relative;
    overflow: hidden;
}

    .metric.accent-top::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: var(--accent);
    }

.dash-split {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 18px;
    margin-top: 18px;
}

@media (max-width: 900px) {
    .dash-split {
        grid-template-columns: 1fr;
    }
}

.dash-pct {
    font-family: "Spectral", serif;
    font-weight: 800;
    font-size: 30px;
    color: var(--accent);
    line-height: 1;
}

.dash-bar {
    height: 12px;
    border-radius: var(--r-pill);
    background: var(--stone);
    overflow: hidden;
    margin: 14px 0 10px;
}

.dash-bar-fill {
    height: 100%;
    border-radius: var(--r-pill);
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    transition: width 400ms ease-out;
    min-width: 2px;
}

.dash-note {
    color: var(--slate);
    font-size: 13px;
    margin: 0;
}

.dash-status {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 16px;
    font-size: 13px;
    color: var(--charcoal);
    font-weight: 500;
}

.dash-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--d);
    display: inline-block;
    margin-left: 8px;
}

.dash-status > .dash-dot:first-child {
    margin-left: 0;
}

.dash-facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 20px;
    margin-top: 6px;
}

    .dash-facts > div {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

.dash-fact-n {
    font-family: "Spectral", serif;
    font-weight: 800;
    font-size: 26px;
    color: var(--ink);
    line-height: 1.1;
}

.dash-fact-l {
    font-family: "Archivo", sans-serif;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--slate);
    font-weight: 600;
}

.dash-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 6px;
}

.dash-action {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--paper);
    transition: border-color 160ms ease-out, transform 160ms ease-out, box-shadow 160ms ease-out;
}

    .dash-action:hover {
        border-color: var(--accent);
        transform: translateY(-2px);
        box-shadow: var(--shadow-card);
    }

.dash-action-t {
    font-family: "Archivo", sans-serif;
    font-weight: 600;
    font-size: 15px;
    color: var(--ink);
}

.dash-action:hover .dash-action-t {
    color: var(--accent);
}

.dash-action-d {
    font-size: 13px;
    color: var(--slate);
}

/* ---------- ICP helpers ---------- */

/* Inline help under a form field or section heading. */
.field-help {
    font-size: 13px;
    font-weight: 400;
    color: var(--slate);
    line-height: 1.5;
}

label.field > .field-help {
    margin-top: -2px;
}

/* Assessment breakdown nested under a permit row. */
tr.breakdown > td {
    background: var(--accent-tint);
    padding: 0 0 0 24px;
}

table.ue.nested {
    background: transparent;
    font-size: 14px;
}

    table.ue.nested thead th {
        background: transparent;
        font-size: 11px;
        color: var(--slate);
    }

    table.ue.nested td {
        padding-top: 6px;
        padding-bottom: 6px;
    }

/* A warning line spanning a table row. */
.row-warning {
    color: var(--warning);
    font-size: 13px;
    padding-top: 0;
}

/* Rate provenance and confirmation tags. */
.tag-gazetted {
    background: var(--accent-tint-strong);
    color: var(--ink);
}

.tag-local {
    background: var(--stone);
    color: var(--charcoal);
}

.tag-ok {
    background: var(--success);
    color: var(--white);
}

/* A note line spanning a table row — exemptions, thresholds. */
.row-note {
    color: var(--slate);
    font-size: 13px;
    padding-top: 0;
}

/* An inline edit or confirm form inside a table row. */
td.inline-form {
    background: var(--paper);
    padding: 16px 18px;
}

/* A card heading with an action on the right. */
.table-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 6px;
}

    .table-head h3 {
        margin: 0;
    }

/* Wide report tables scroll inside the card rather than the page. */
.table-scroll {
    overflow-x: auto;
}

    .table-scroll table.ue {
        min-width: 100%;
        white-space: nowrap;
    }

/* ---------- Unit toggle (hectares / square metres) ---------- */
.unit-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 14px;
}

.unit-toggle-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--charcoal);
    margin-right: 2px;
}

.unit-btn {
    font-family: "Archivo", sans-serif;
    font-size: 14px;
    font-weight: 600;
    min-width: 46px;
    padding: 7px 14px;
    border: 1.5px solid var(--line);
    border-radius: var(--r-pill);
    background: var(--white);
    color: var(--slate);
    cursor: pointer;
    transition: background 160ms ease-out, color 160ms ease-out, border-color 160ms ease-out;
}

    .unit-btn:hover {
        border-color: var(--accent);
        color: var(--accent);
    }

    .unit-btn.on {
        background: var(--accent);
        border-color: var(--accent);
        color: var(--white);
    }

    .unit-toggle .field-help {
        flex: 1;
        min-width: 220px;
    }

/* ---------- Explanatory markers ---------- */
/* ? explains why something is the way it is; ! flags something that bites if missed. */

.explain {
    display: inline-block;
    position: relative;
    vertical-align: baseline;
    margin-left: 5px;
}

    .explain > summary {
        list-style: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 17px;
        height: 17px;
        border-radius: 50%;
        font-family: "Archivo", sans-serif;
        font-size: 11px;
        font-weight: 700;
        line-height: 1;
        cursor: pointer;
        user-select: none;
        transition: background 140ms ease-out, color 140ms ease-out;
    }

        .explain > summary::-webkit-details-marker {
            display: none;
        }

        .explain > summary:focus-visible {
            outline: 2px solid var(--accent);
            outline-offset: 2px;
        }

.explain-note > summary {
    background: var(--accent-tint-strong);
    color: var(--accent-hover);
}

    .explain-note > summary:hover,
    .explain-note[open] > summary {
        background: var(--accent);
        color: var(--white);
    }

.explain-important > summary {
    background: #FBE9D6;
    color: var(--warning);
}

    .explain-important > summary:hover,
    .explain-important[open] > summary {
        background: var(--warning);
        color: var(--white);
    }

.explain-body {
    position: absolute;
    z-index: 40;
    top: calc(100% + 8px);
    left: -6px;
    width: 330px;
    max-width: min(330px, calc(100vw - 48px));
    padding: 14px 16px;
    background: var(--white);
    border-radius: var(--r-card);
    border-left: 3px solid var(--accent);
    box-shadow: var(--shadow-raised);
    font-family: "Archivo", sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.55;
    letter-spacing: 0;
    text-transform: none;
    color: var(--charcoal);
    white-space: normal;
    cursor: auto;
}

.explain-important .explain-body {
    border-left-color: var(--warning);
}

.explain-heading {
    display: block;
    font-size: 13px;
    color: var(--ink);
    margin-bottom: 4px;
}

.explain-src {
    display: block;
    margin-top: 8px;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--slate);
}

.explain-close {
    display: block;
    margin: 10px 0 0 auto;
    padding: 2px 0 0;
    border: none;
    background: none;
    font-family: "Archivo", sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    cursor: pointer;
}

    .explain-close:hover {
        color: var(--accent-hover);
        text-decoration: underline;
    }

    .explain-close:focus-visible {
        outline: 2px solid var(--accent);
        outline-offset: 2px;
        border-radius: 3px;
    }

.explain-important .explain-close {
    color: var(--warning);
}

    .explain-important .explain-close:hover {
        color: var(--ink);
    }

/* Near the right edge of a table, flip the panel so it stays on screen. */
td:last-child .explain-body,
th:last-child .explain-body {
    left: auto;
    right: -6px;
}

/* The legend in the sidebar. */
.explain-legend {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 12px 4px;
    font-size: 12px;
    color: rgba(246, 246, 249, 0.6);
    line-height: 1.4;
}

    .explain-legend .k {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 16px;
        height: 16px;
        border-radius: 50%;
        font-weight: 700;
        font-size: 11px;
        margin-right: 7px;
    }

    .explain-legend .k-note {
        background: var(--accent);
        color: var(--white);
    }

    .explain-legend .k-important {
        background: var(--warning);
        color: var(--white);
    }

/* The reason beside an Exempt / Not levied tag. */
.state-reason {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--slate);
    line-height: 1.35;
}

/* The " ICP" half of the DevCAP ICP wordmark — lighter, so "DevCAP" still reads as the name. */
.wordmark em {
    font-style: normal;
    font-weight: 400;
    letter-spacing: 0.02em;
    opacity: 0.75;
}
