:root {
    --navy: #123a2b;
    --red: #a87817;
    --bg: #f4f7f2;
    --line: #d8e1d5;
    --muted: #647568;
    --green: #123a2b;
    --green-2: #1e5a40;
    --gold: #c99a2e;
    --gold-soft: #f3e5b8;
    --ink: #183126
}

body {
    color: var(--ink);
    background:
        radial-gradient(circle at 8% 8%, #dceadd 0, transparent 22rem),
        linear-gradient(180deg, #f7faf5, #eef4ed);
    min-height: 100vh
}

body:before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: .035;
    background-image:
        linear-gradient(
            30deg,
            #123a2b 12%,
            transparent 12.5%,
            transparent 87%,
            #123a2b 87.5%,
            #123a2b
        ),
        linear-gradient(
            150deg,
            #123a2b 12%,
            transparent 12.5%,
            transparent 87%,
            #123a2b 87.5%,
            #123a2b
        );
    background-size: 48px 84px
}

header {
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: 78px;
    padding: 0 max(24px, 4vw);
    gap: 24px;
    background: linear-gradient(115deg, #0c2c20, #174a35 62%, #113425);
    border-bottom: 3px solid var(--gold);
    box-shadow: 0 8px 28px #0b281b30
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    line-height: 1.1;
    letter-spacing: .02em
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 48px;
    color: #183126;
    background: linear-gradient(145deg, #f4d67b, #b77c13);
    clip-path: polygon(50% 0, 95% 18%, 87% 76%, 50% 100%, 13% 76%, 5% 18%);
    font: 900 14px/1 system-ui;
    filter: drop-shadow(0 3px 4px #0005)
}

.brand-copy {
    display: grid
}

.brand-copy strong {
    color: #fff;
    font-size: 16px
}

.brand-copy small {
    color: #e8cf8b;
    font-size: 11px;
    letter-spacing: .12em;
    text-transform: uppercase
}

nav {
    align-items: center;
    gap: 5px
}

nav a {
    padding: 9px 11px;
    border-radius: 8px;
    color: #dceade;
    font-size: 13px;
    font-weight: 650;
    transition: background .15s, color .15s
}

nav a:hover,
nav a.active {
    color: #193323;
    background: linear-gradient(135deg, #f4d67b, #c79425)
}

header button {
    background: #ffffff18;
    border: 1px solid #ffffff2b
}

main {
    max-width: 1280px;
    margin: 34px auto;
    padding: 0 28px 50px
}

.heading {
    position: relative;
    padding: 8px 0 16px;
    border-bottom: 1px solid #cddbcf
}

.heading:after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 110px;
    height: 3px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--gold), #e4c469)
}

h1 {
    margin: .2em 0;
    color: #153b2b;
    font-size: clamp(26px, 3vw, 36px);
    letter-spacing: -.025em
}

h2 {
    color: #173c2d
}

a {
    color: #176342
}

.panel,
.login,
.metrics article {
    border: 1px solid #d5e0d3;
    border-radius: 16px;
    background: #ffffffed;
    box-shadow: 0 10px 28px #163c2710, 0 2px 5px #163c270b;
    backdrop-filter: blur(5px)
}

.panel {
    transition: box-shadow .18s, transform .18s
}

.panel:hover {
    box-shadow: 0 14px 34px #163c2718, 0 3px 7px #163c2710
}

.filter-panel {
    border-top: 4px solid var(--gold)
}

button {
    background: linear-gradient(135deg, #1e6547, #123d2c);
    box-shadow: 0 4px 10px #123d2c25;
    font-weight: 750
}

button:hover {
    filter: brightness(1.08)
}

input,
select,
textarea {
    border-color: #bdcebf;
    background: #fbfdfb;
    color: #193428
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid #c99a2e35;
    border-color: var(--gold)
}

fieldset {
    border-color: #cad8ca !important;
    background: #f8fbf7
}

legend {
    color: #184a35 !important
}

table {
    border-radius: 10px;
    overflow: hidden
}

th {
    background: #edf4ed;
    color: #234f3b;
    border-bottom: 2px solid #d2dfd2
}

tr:hover td {
    background: #fafcf8
}

.status {
    font-weight: 750
}

.status.final,
.status.completed {
    background: #d9efde;
    color: #176035
}

.status.ready {
    background: #fff1c7;
    color: #7b5610
}

.status.cancel_requested {
    background: #fff1c7;
    color: #7b5610
}

.status.cancelled {
    background: #e5e7eb;
    color: #4b5563
}

.status.needs_review,
.status.failed {
    background: #fde3df;
    color: #9b2c22
}

#thematic-map {
    border: 1px solid #ccdbce;
    background: radial-gradient(circle, #f8fbf5, #e3eee4)
}

#thematic-map path {
    stroke: #f8fff8;
    filter: drop-shadow(0 1px 1px #163c2720)
}

.map-panel {
    border-top: 4px solid var(--green-2)
}

.legend i {
    border-radius: 2px
}

.chart-line {
    stroke: var(--green-2)
}

.chart-points circle {
    stroke: var(--gold);
    fill: #fff
}

.trend-row i {
    background: linear-gradient(90deg, #2b7354, #c99a2e)
}

.qc-summary a {
    position: relative;
    overflow: hidden;
    border-top: 4px solid var(--gold)
}

.qc-summary a:after {
    content: "";
    position: absolute;
    right: -22px;
    bottom: -28px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: #1d5b4010
}

.qc-summary b {
    color: var(--green-2)
}

.review-link {
    background: linear-gradient(135deg, #1e6547, #123d2c)
}

.case-review {
    border-top: 4px solid var(--gold)
}

.candidate-code {
    color: #99690d
}

.mapping-reason,
.legal-raw {
    border-left-color: var(--gold)
}

.site-footer {
    max-width: 1280px;
    margin: 0 auto;
    padding: 18px 28px 30px;
    color: #647568;
    font-size: 12px;
    border-top: 1px solid #d4dfd3
}

.site-footer b {
    color: #25523e
}

.institution-tag {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px;
    border: 1px solid #d5c183;
    border-radius: 999px;
    color: #75530c;
    background: #fff8df;
    font-size: 11px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: .08em
}

@media(max-width:980px) {
    header {
        position: relative
    }

    nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px
    }

    nav a {
        white-space: nowrap
    }

    .brand {
        flex: 1
    }
}

@media(max-width:600px) {
    main {
        padding: 0 14px 35px
    }

    .brand-copy small {
        display: none
    }

    .panel {
        padding: 17px
    }

    .heading {
        align-items: flex-start;
        flex-direction: column
    }
}
