:root {
    --navy: #172a4d;
    --navy-2: #263b64;
    --gold: #c8a12b;
    --bg: #f3f5f8;
    --card: #ffffff;
    --text: #1c2536;
    --muted: #687386;
    --line: #dfe4eb;
    --good: #157347;
    --bad: #b42318;
    --warn: #b76e00;
    --shadow: 0 8px 28px rgba(24, 42, 77, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    font-family: "Segoe UI", Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
}

body {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
}

a {
    color: inherit;
}

input,
select,
textarea,
button {
    font: inherit;
}

/* Header */

.site-header {
    min-height: 88px;
    padding: 14px clamp(18px, 4vw, 52px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: linear-gradient( 135deg, var(--navy), var(--navy-2) );
    border-bottom: 4px solid var(--gold);
    color: #ffffff;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}

    .brand strong {
        display: block;
        font-size: 19px;
    }

    .brand small {
        display: block;
        margin-top: 2px;
        color: #cdd5e3;
    }

.brand-mark {
    width: 56px;
    height: 56px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid var(--gold);
    border-radius: 50%;
    color: var(--gold);
    font-weight: 800;
    letter-spacing: 0.04em;
}

    .brand-mark img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .brand-mark.large {
        width: 94px;
        height: 94px;
        margin: 0 auto 18px;
        padding: 6px;
        background: #f7f8fb;
        font-size: 23px;
    }

.signed-in {
    display: flex;
    flex-direction: column;
    text-align: right;
}

    .signed-in span {
        color: #cdd5e3;
        font-size: 12px;
    }

.signout {
    margin-top: 3px;
    color: #f4dc94;
    font-size: 12px;
}

/* Navigation */

.main-nav {
    display: flex;
    gap: 8px;
    padding: 10px clamp(18px, 4vw, 52px);
    background: #ffffff;
    border-bottom: 1px solid var(--line);
}

    .main-nav a {
        padding: 8px 14px;
        color: var(--navy);
        font-weight: 650;
        text-decoration: none;
        white-space: nowrap;
        border-radius: 6px;
    }

        .main-nav a:hover {
            background: #eef1f6;
        }

/* Page layout */

.page-wrap {
    max-width: 1480px;
    margin: 24px auto 60px;
    padding: 0 20px;
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px;
}

    .page-heading h1 {
        margin: 3px 0;
        color: var(--navy);
        font-size: 27px;
    }

    .page-heading p {
        margin: 0;
        color: var(--muted);
    }

.eyebrow {
    color: #8a6b0a;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.identity-card {
    min-width: 280px;
    padding: 10px 15px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-left: 4px solid var(--gold);
    border-radius: 9px;
}

    .identity-card span,
    .identity-card small {
        display: block;
        color: var(--muted);
        font-size: 11px;
    }

    .identity-card strong {
        display: block;
        color: var(--navy);
    }

/* Cards */

.card {
    margin-bottom: 20px;
    padding: 22px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 11px;
    box-shadow: var(--shadow);
}

.section-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
    padding-bottom: 13px;
    border-bottom: 2px solid #eadb9d;
}

    .section-title h2 {
        margin: 0;
        color: var(--navy);
        font-size: 18px;
    }

    .section-title p {
        margin: 4px 0 0;
        color: var(--muted);
        font-size: 13px;
    }

/* Forms */

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.span-2 {
    grid-column: span 2;
}

.span-3 {
    grid-column: span 3;
}

.field {
    display: flex;
    flex-direction: column;
}

    .field label {
        margin-bottom: 5px;
        font-size: 12.5px;
        font-weight: 700;
    }

        .field label small {
            color: var(--muted);
            font-weight: 400;
        }

    .field input,
    .field select,
    .field textarea,
    .compact-select,
    .compact-input,
    .compact-note {
        width: 100%;
        padding: 9px 11px;
        background: #ffffff;
        color: var(--text);
        border: 1px solid #cfd6e1;
        border-radius: 7px;
        transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
    }

        .field input:focus,
        .field select:focus,
        .field textarea:focus,
        .compact-select:focus,
        .compact-input:focus,
        .compact-note:focus {
            outline: 2px solid rgba(200, 161, 43, 0.3);
            border-color: var(--gold);
        }

        .field input:disabled,
        .field select:disabled,
        .field textarea:disabled {
            cursor: not-allowed;
            background: #f3f5f8;
            color: #687386;
        }

    .field textarea {
        resize: vertical;
    }

.required,
.field-error {
    color: var(--bad);
}

.field-error {
    margin-top: 3px;
    font-size: 11px;
}

.field-hint {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

    .field-hint.ok {
        color: var(--good);
    }

    .field-hint.error {
        color: var(--bad);
    }

.actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Buttons */

.btn {
    display: inline-block;
    padding: 9px 18px;
    cursor: pointer;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 7px;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}

    .btn:hover {
        text-decoration: none;
    }

    .btn:active {
        transform: translateY(1px);
    }

.btn-primary {
    background: var(--navy);
    color: #ffffff;
}

    .btn-primary:hover {
        background: var(--navy-2);
    }

.btn-secondary {
    background: #ffffff;
    color: var(--navy);
    border-color: var(--line);
}

    .btn-secondary:hover {
        background: #eef1f6;
        border-color: #c8d0dc;
    }

.btn-danger {
    background: var(--bad);
    color: #ffffff;
    border-color: var(--bad);
}

    .btn-danger:hover {
        background: #8f1d15;
        border-color: #8f1d15;
    }

.btn-email {
    background: #0f766e;
    color: #ffffff;
    border-color: #0f766e;
}

    .btn-email:hover {
        background: #115e59;
        border-color: #115e59;
    }

.btn-small {
    padding: 6px 11px;
    font-size: 12px;
}

.full {
    width: 100%;
}

/* Alerts */

.alert {
    display: block;
    margin-bottom: 16px;
    padding: 11px 14px;
    border-radius: 8px;
}

    .alert.error {
        background: #fef0ef;
        color: #8f1d15;
        border: 1px solid #f1b9b4;
    }

    .alert.success {
        background: #eaf7f0;
        color: #11633c;
        border: 1px solid #abd9c0;
    }

/* Counters */

.count-badge {
    padding: 5px 12px;
    white-space: nowrap;
    background: #eef1f6;
    color: var(--navy);
    font-weight: 700;
    border-radius: 30px;
}

    .count-badge.large {
        padding: 8px 17px;
        font-size: 16px;
    }

/* Tables */

.table-scroll {
    max-width: 100%;
    overflow: auto;
}

.data-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
}

    .data-table th {
        padding: 10px;
        background: var(--navy);
        color: #ffffff;
        font-size: 12px;
        text-align: left;
        white-space: nowrap;
    }

    .data-table td {
        padding: 10px;
        vertical-align: top;
        font-size: 12.5px;
        border-bottom: 1px solid var(--line);
    }

    .data-table tr:nth-child(even) td {
        background: #fafbfd;
    }

    .data-table tr:hover td {
        background: #f4f6f9;
    }

    .data-table td small {
        display: block;
        margin-top: 2px;
        color: var(--muted);
    }

.admin-table {
    min-width: 1400px;
}

    .admin-table .compact-select {
        min-width: 165px;
        padding: 6px;
    }

    .admin-table .compact-input {
        min-width: 135px;
        padding: 6px;
    }

    .admin-table .compact-note {
        min-width: 190px;
        padding: 6px;
        resize: vertical;
    }

.table-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 105px;
}

    .table-actions .btn {
        display: block;
        text-align: center;
        white-space: nowrap;
    }
.departments-kpi {
    position: relative;
    min-height: 92px;
    margin-bottom: 20px;
    padding: 18px 22px 18px 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    overflow: hidden;
    background: linear-gradient( 135deg, #ffffff 0%, #f7f8fb 100% );
    border: 1px solid var(--line);
    border-left: 5px solid var(--gold);
    border-radius: 11px;
    box-shadow: var(--shadow);
}

    .departments-kpi::after {
        content: "";
        position: absolute;
        top: -55px;
        right: -45px;
        width: 150px;
        height: 150px;
        pointer-events: none;
        background: rgba(200, 161, 43, 0.08);
        border-radius: 50%;
    }

    .departments-kpi span {
        position: relative;
        z-index: 1;
        display: flex;
        align-items: center;
        gap: 10px;
        color: var(--navy);
        font-size: 15px;
        font-weight: 700;
    }

        .departments-kpi span::before {
            content: "";
            width: 11px;
            height: 11px;
            flex: 0 0 auto;
            background: var(--gold);
            border: 3px solid #f6edce;
            border-radius: 50%;
            box-shadow: 0 0 0 1px var(--gold);
        }

    .departments-kpi strong {
        position: relative;
        z-index: 1;
        min-width: 72px;
        min-height: 58px;
        padding: 8px 16px;
        display: grid;
        place-items: center;
        background: var(--navy);
        color: #ffffff;
        font-size: 28px;
        font-weight: 800;
        line-height: 1;
        border: 1px solid var(--navy-2);
        border-bottom: 4px solid var(--gold);
        border-radius: 11px;
        box-shadow: 0 8px 20px rgba(23, 42, 77, 0.18);
    }
/* Entry Guide */

.entry-guide {
    border-left: 5px solid var(--gold);
}

    .entry-guide .section-title h2 small {
        margin-left: 7px;
        color: var(--muted);
        font-size: 12px;
        font-weight: 500;
    }

.guide {
    margin: 0;
    padding-left: 23px;
    display: grid;
    gap: 12px;
}

    .guide li {
        padding-left: 5px;
        color: var(--text);
        line-height: 1.65;
    }

        .guide li::marker {
            color: var(--gold);
            font-weight: 800;
        }

    .guide b {
        color: var(--navy);
    }
@media (max-width: 620px) {
    .departments-kpi {
        min-height: 82px;
        padding: 15px 17px;
    }

        .departments-kpi span {
            font-size: 13px;
        }

        .departments-kpi strong {
            min-width: 62px;
            min-height: 52px;
            padding: 7px 13px;
            font-size: 24px;
        }
}
/* KPI */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

    .kpi-grid article {
        padding: 13px 16px;
        background: #ffffff;
        border: 1px solid var(--line);
        border-left: 4px solid var(--navy);
        border-radius: 9px;
        box-shadow: var(--shadow);
    }

        .kpi-grid article.good {
            border-left-color: var(--good);
        }

        .kpi-grid article.warning {
            border-left-color: var(--gold);
        }

    .kpi-grid span {
        display: block;
        color: var(--muted);
        font-size: 12px;
    }

    .kpi-grid strong {
        display: block;
        color: var(--navy);
        font-size: 27px;
    }

/* Filters */

.filter-grid {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 13px;
}

    .filter-grid .field {
        min-width: 200px;
    }

    .filter-grid .grow {
        flex: 1 1 320px;
    }

.filter-action {
    padding-bottom: 0;
}

/* Footer */

footer {
    padding: 24px;
    color: var(--muted);
    font-size: 11px;
    text-align: center;
}

/* Login Page */

.login-body {
    min-height: 100vh;
    margin: 0;
    padding: 32px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient( circle at top right, rgba(200, 161, 43, 0.16), transparent 34% ), linear-gradient(135deg, #142441, #2d436d);
}

    .login-body > form {
        width: 100%;
        margin: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

.login-card {
    position: relative;
    width: min(540px, 100%);
    margin: 0 auto;
    padding: 44px 48px 38px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid rgba(223, 228, 235, 0.9);
    border-top: 5px solid var(--gold);
    border-radius: 16px;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
    text-align: center;
}

    .login-card::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 110px;
        pointer-events: none;
        background: linear-gradient( 180deg, rgba(200, 161, 43, 0.08), transparent );
    }

    .login-card .brand-mark.large {
        position: relative;
        z-index: 1;
        width: 112px;
        height: 112px;
        margin: 0 auto 22px;
        padding: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        background: #ffffff;
        border: 2px solid var(--gold);
        border-radius: 50%;
        box-shadow: 0 8px 25px rgba(23, 42, 77, 0.12);
    }

        .login-card .brand-mark.large img,
        .login-card #logo2 {
            display: block;
            width: 92px;
            height: 92px;
            max-width: 100%;
            object-fit: contain;
        }

    .login-card h1 {
        position: relative;
        z-index: 1;
        max-width: 430px;
        margin: 0 auto 8px;
        color: var(--navy);
        font-size: 26px;
        font-weight: 750;
        line-height: 1.3;
    }

    .login-card .muted {
        max-width: 410px;
        margin: 0 auto 27px;
        color: var(--muted);
        font-size: 14px;
        line-height: 1.6;
    }

    .login-card .field {
        margin-bottom: 17px;
        text-align: left;
    }

        .login-card .field label {
            margin-bottom: 7px;
            color: var(--text);
            font-size: 13px;
            font-weight: 700;
        }

        .login-card .field input {
            width: 100%;
            min-height: 49px;
            padding: 11px 13px;
            background: #ffffff;
            color: var(--text);
            font-size: 15px;
            border: 1px solid #cfd6e1;
            border-radius: 8px;
        }

            .login-card .field input:focus {
                outline: 3px solid rgba(200, 161, 43, 0.22);
                border-color: var(--gold);
            }

    .login-card .btn.full {
        width: 100%;
        min-height: 49px;
        margin-top: 5px;
        font-size: 15px;
        border-radius: 8px;
    }

    .login-card .login-note {
        margin: 24px 0 0;
        padding-top: 17px;
        color: var(--muted);
        font-size: 11.5px;
        line-height: 1.6;
        border-top: 1px solid var(--line);
    }

    .login-card .alert {
        text-align: left;
    }

/* Utilities */

.is-hidden {
    display: none !important;
}
.kpi-grid article.declined {
    border-left-color: var(--bad);
}

/* Responsive */

@media (max-width: 900px) {
    .site-header {
        align-items: flex-start;
    }

    .brand small {
        max-width: 390px;
    }

    .form-grid {
        grid-template-columns: 1fr 1fr;
    }

    .span-3 {
        grid-column: span 2;
    }

    .kpi-grid {
        grid-template-columns: 1fr 1fr;
    }

    .page-heading {
        align-items: stretch;
    }

    .identity-card {
        min-width: 240px;
    }
}

@media (max-width: 620px) {
    .site-header,
    .page-heading {
        flex-direction: column;
    }

    .signed-in {
        text-align: left;
    }

    .main-nav {
        overflow-x: auto;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .span-2,
    .span-3 {
        grid-column: span 1;
    }

    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .identity-card {
        width: 100%;
    }

    .card {
        padding: 16px;
    }

    .brand strong {
        font-size: 16px;
    }

    .brand small {
        font-size: 10px;
    }

    .login-body {
        padding: 18px 14px;
    }

    .login-card {
        width: 100%;
        padding: 32px 22px 28px;
        border-radius: 13px;
    }

        .login-card .brand-mark.large {
            width: 94px;
            height: 94px;
            margin-bottom: 18px;
        }

            .login-card .brand-mark.large img,
            .login-card #logo2 {
                width: 78px;
                height: 78px;
            }

        .login-card h1 {
            font-size: 21px;
        }

    .actions {
        flex-direction: column;
    }

        .actions .btn {
            width: 100%;
        }
}
