:root {
    --ink: #183047;
    --muted: #697987;
    --blue: #126baf;
    --blue-light: #e9f3fb;
    --border: #dce5ec;
    --paper: #fff;
    --bg: #f3f6f9;
    --green: #187b58;
    --orange: #a46012;
    --radius: 12px;
    font-family: Inter,Segoe UI,system-ui,sans-serif;
    color: var(--ink);
    background: var(--bg);
    font-synthesis: none
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    font-size: 14px;
    line-height: 1.55
}

a {
    color: var(--blue);
    text-decoration: none
}

a:hover {
    text-decoration: underline
}

button,input,select {
    font: inherit
}

button,a,input,select {
    outline-offset: 4px
}

button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible {
    outline: 3px solid #42a4e5
}

h1,h2,h3,p {
    margin-top: 0
}

h1 {
    font-size: 30px;
    letter-spacing: -.7px;
    line-height: 1.25;
    margin-bottom: 8px
}

h2 {
    font-size: 18px;
    margin-bottom: 6px
}

h3 {
    font-size: 15px
}

p {
    margin-bottom: 16px
}

.page-width {
    max-width: 1180px;
    margin: 0 auto;
    padding-left: 28px;
    padding-right: 28px
}

.site-header {
    background: #fff;
    border-bottom: 1px solid var(--border)
}

.header-inner {
    max-width: 1180px;
    padding: 22px 28px;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    font-size: 25px;
    font-weight: 700;
    letter-spacing: -1px;
    line-height: 1.1
}

.brand:hover {
    text-decoration: none
}

.brand-light {
    font-weight: 400
}

.brand small {
    display: block;
    font-size: 9px;
    letter-spacing: 2.6px;
    font-weight: 600;
    color: var(--muted);
    margin-top: 6px
}

.brand-mark {
    width: 42px;
    height: 42px;
    background: var(--blue);
    border-radius: 11px;
    color: #fff;
    display: grid;
    place-content: center;
    font-size: 25px;
    position: relative;
    line-height: 1
}

.brand-mark span {
    font-size: 18px;
    position: absolute;
    bottom: 5px;
    right: 7px
}

.header-right {
    display: flex;
    gap: 28px;
    align-items: center
}

.help-link {
    color: var(--muted);
    font-size: 12px
}

.help-link strong {
    display: block;
    color: var(--ink)
}

.text-link {
    font-weight: 600;
    font-size: 13px
}

.account-bar {
    background: #fff
}

.account-bar .page-width {
    display: flex;
    gap: 24px;
    align-items: center;
    padding-top: 15px;
    padding-bottom: 15px;
    font-size: 12px
}

.account-bar a:first-child {
    color: var(--ink);
    font-weight: 600
}

.account-name {
    color: var(--muted);
    margin-left: auto
}

.admin-link {
    font-weight: 600
}

.tabs {
    display: flex;
    gap: 25px;
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
    background: var(--bg)
}

.tabs a {
    padding: 18px 0 14px;
    color: var(--muted);
    white-space: nowrap;
    font-size: 13px;
    border-bottom: 3px solid transparent
}

.tabs a.active {
    color: var(--blue);
    border-color: var(--blue);
    font-weight: 600
}

.tabs a:hover {
    text-decoration: none;
    color: var(--blue)
}

.main-content {
    padding-top: 38px;
    padding-bottom: 64px;
    min-height: 65vh
}

.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px
}

.eyebrow {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 9px
}

.subtle {
    color: var(--muted)
}

.page-heading p {
    margin-bottom: 0
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--blue);
    color: #fff;
    border: 1px solid var(--blue);
    padding: 10px 18px;
    min-height: 42px;
    border-radius: 7px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer
}

.button:hover {
    background: #095b9a;
    text-decoration: none
}

.button.secondary {
    color: var(--ink);
    background: #fff;
    border-color: var(--border)
}

.button.secondary:hover {
    background: var(--blue-light)
}

.button:disabled {
    opacity: .5;
    cursor: default
}

.stats {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 18px;
    margin-bottom: 26px
}

.stat,.card {
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--radius)
}

.stat {
    padding: 22px 24px
}

.stat-label {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between
}

.stat-value {
    font-size: 29px;
    font-weight: 650;
    letter-spacing: -.6px
}

.stat-caption {
    font-size: 11px;
    color: var(--muted);
    margin-top: 4px
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 23px 24px;
    border-bottom: 1px solid var(--border)
}

.card-header p {
    margin: 0;
    font-size: 12px;
    color: var(--muted)
}

.card-body {
    padding: 24px
}

.card+.card {
    margin-top: 24px
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eaf6ef;
    color: var(--green);
    border-radius: 100px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap
}

.badge:before {
    content: '';
    height: 5px;
    width: 5px;
    border-radius: 50%;
    background: currentColor
}

.badge.warning {
    background: #fff4de;
    color: var(--orange)
}

.badge.neutral {
    background: var(--blue-light);
    color: var(--blue)
}

.table-wrap {
    overflow: auto
}

table {
    border-collapse: collapse;
    width: 100%;
    font-size: 13px
}

th {
    text-align: left;
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .9px;
    font-weight: 600;
    background: #fbfcfd;
    padding: 13px 24px;
    white-space: nowrap
}

td {
    border-top: 1px solid #edf1f5;
    padding: 20px 24px;
    vertical-align: middle
}

td strong {
    font-weight: 600
}

td small {
    display: block;
    color: var(--muted);
    font-size: 11px;
    margin-top: 4px
}

.number {
    text-align: right;
    font-variant-numeric: tabular-nums
}

.actions {
    text-align: right;
    white-space: nowrap
}

.actions a {
    font-size: 12px;
    font-weight: 600
}

.two-column {
    display: grid;
    grid-template-columns: 1.65fr 1fr;
    gap: 24px;
    margin-top: 24px
}

.two-column .card+.card {
    margin-top: 0
}

.notice {
    padding: 15px 18px;
    border: 1px solid #c7dff0;
    border-radius: 8px;
    background: var(--blue-light);
    color: #315d7f;
    font-size: 12px;
    margin-bottom: 24px
}

.notice.error,.validation-summary-errors {
    background: #fff0f0;
    border: 1px solid #edc7c7;
    color: #aa3434;
    padding: 14px;
    border-radius: 8px;
    margin-bottom: 16px
}

.notice.success {
    background: #ecf7f0;
    border-color: #c9e7d5;
    color: var(--green)
}

.validation-summary-valid {
    display: none
}

.support-card {
    background: #eef5fb
}

.support-card p {
    font-size: 13px;
    color: var(--muted)
}

.chart {
    display: flex;
    align-items: flex-end;
    gap: 9px;
    height: 150px;
    padding-top: 20px
}

.chart-col {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center
}

.chart-bar {
    width: 100%;
    max-width: 35px;
    min-height: 2px;
    background: #5b9ccd;
    border-radius: 4px 4px 0 0
}

.chart-col span {
    font-size: 9px;
    color: var(--muted);
    margin-top: 8px
}

.chart-col:nth-child(3n) .chart-bar {
    background: #176fab
}

.field {
    margin-bottom: 18px
}

.field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px
}

.field input,.field select {
    width: 100%;
    border: 1px solid #cbd7e0;
    border-radius: 7px;
    padding: 11px 12px;
    background: #fff;
    color: var(--ink)
}

.field span {
    display: block;
    font-size: 11px;
    color: var(--muted);
    margin-top: 6px
}

.auth-wrap {
    max-width: 940px;
    margin: 18px auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center
}
.password-recovery-page { max-width:560px; margin:32px auto; }

.auth-intro h1 {
    font-size: 39px;
    line-height: 1.15
}

.auth-intro p {
    font-size: 16px;
    color: var(--muted)
}

.auth-card {
    padding: 32px
}

.auth-card h2 {
    font-size: 24px;
    margin-bottom: 8px
}

.auth-card form {
    margin-top: 24px
}

.auth-card .button {
    width: 100%;
    margin-top: 6px
}

.auth-foot {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    font-size: 12px;
    margin-top: 18px
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 24px
}

.detail-list {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 16px;
    margin: 0
}

.detail-list dt {
    color: var(--muted)
}

.detail-list dd {
    margin: 0
}

.key-value {
    font-family: Consolas,monospace;
    overflow-wrap: anywhere
}

.site-footer {
    padding-top: 22px;
    padding-bottom: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 16px;
    justify-content: space-between;
    color: var(--muted);
    font-size: 11px
}

.site-footer div {
    display: flex;
    gap: 24px
}

.empty {
    text-align: center;
    padding: 42px;
    color: var(--muted)
}

.skip-link {
    position: absolute;
    top: -80px;
    left: 20px;
    z-index: 100;
    padding: 10px;
    background: #fff
}

.skip-link:focus {
    top: 10px
}

.search-form {
    display: flex;
    gap: 12px;
    width: 100%;
    max-width: 650px
}

.search-form input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 10px
}

.section-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px
}

.preview-banner {
    padding: 10px 16px;
    background: #fff4de;
    border-radius: 7px;
    color: #80551b;
    font-size: 12px;
    margin-bottom: 24px
}

.code-box {
    font-size: 23px;
    letter-spacing: 8px
}

.spaced {
    margin-top: 24px
}

.checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 18px
}

.checkboxes label {
    display: flex;
    gap: 8px;
    align-items: center
}

.checkboxes input {
    width: auto
}

.text-right {
    text-align: right
}

@media(max-width:800px) {
    .page-width {
        padding-left: 18px;
        padding-right: 18px
    }
    .header-inner {
        padding: 20px 18px
    }
    .header-right {
        gap: 12px
    }
    .help-link {
        display: none
    }
    .brand {
        font-size: 21px
    }
    .main-content {
        padding-top: 26px
    }
    .stats {
        gap: 10px
    }
    .stat {
        padding: 17px
    }
    .stat-value {
        font-size: 23px
    }
    .two-column {
        grid-template-columns: 1fr
    }
    .auth-wrap {
        grid-template-columns: 1fr;
        gap: 24px;
        max-width: 440px
    }
    .auth-intro h1 {
        font-size: 30px
    }
    .auth-intro p {
        font-size: 14px
    }
    .auth-card {
        padding: 24px
    }
    .tabs {
        gap: 22px
    }
    .page-heading {
        align-items: flex-start
    }
    .form-grid {
        grid-template-columns: 1fr
    }
    .site-footer {
        flex-direction: column
    }
    .account-bar .page-width {
        gap: 12px
    }
    .account-name {
        font-size: 11px
    }
    td,th {
        padding: 15px 18px
    }
}

@media(max-width:500px) {
    .stats {
        grid-template-columns: 1fr
    }
    .stat {
        display: grid;
        grid-template-columns: 1fr auto
    }
    .stat-label {
        margin: 0
    }
    .stat-caption {
        grid-column: 1/-1
    }
    .page-heading {
        flex-direction: column
    }
    .detail-list {
        grid-template-columns: 1fr;
        gap: 5px
    }
    .detail-list dd {
        margin-bottom: 14px
    }
}

.system-data-page { padding: 24px; min-width: 0; }
.admin-access-grid th { white-space: nowrap; }
.admin-access-grid td { vertical-align: top; overflow-wrap: anywhere; }
.admin-access-enabled { color: #176337; }
.admin-access-accounts { margin: 0; padding-left: 18px; }
.admin-access-accounts li + li { margin-top: 10px; }
.system-data-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.system-data-actions .button { white-space: nowrap; }
.system-data-grid td { max-width: 300px; overflow-wrap: anywhere; vertical-align: top; }
.system-data-grid th { white-space: nowrap; }
.system-data-grid .button { padding: 7px 11px; font-size: .85rem; }
.system-data-menu .admin-command-grid { max-width: none; }
.system-data-form { max-width: 1100px; }
.system-data-field { margin: 22px 0; }
.system-data-field > label:not(.system-data-check) { display: block; font-weight: bold; margin-bottom: 6px; }
.system-data-field > input, .system-data-field > textarea, .system-data-field > select { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid #b8c9d7; border-radius: 5px; background: white; color: inherit; }
.system-data-field > textarea { min-height: 120px; }
.system-data-field textarea { font-family: monospace; }
.system-data-check { display: inline-flex; align-items: center; gap: 7px; padding: 5px 0; }
.system-data-check input { width: auto; }
.system-data-values { display: grid; grid-template-columns: minmax(150px, 250px) minmax(0, 1fr); gap: 12px; }
.system-data-values dt { font-weight: bold; overflow-wrap: anywhere; }
.system-data-values dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.button.danger { background: #b82d27; border-color: #b82d27; color: white; }
.button.danger:hover { background: #91231e; }
@media(max-width: 600px) {
    .system-data-page { padding: 12px; }
    .system-data-values { grid-template-columns: 1fr; gap: 5px; }
    .system-data-values dd { margin-bottom: 12px; }
}
@media(prefers-reduced-motion:reduce) {
    * {
        scroll-behavior: auto!important
    }
}

/* PAF review keeps the official 21-column export, grouping its screen fields to fit. */
.paf-return-details > summary { font-size:1.2rem; font-weight:700; cursor:pointer; padding:12px 0; }
.paf-table-controls { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:12px 0; }
.paf-table-controls input { min-width:0; width:280px; max-width:100%; padding:8px; font:inherit; }
.paf-table-controls [aria-pressed="true"] { background:#174e2c; color:white; outline:2px solid #174e2c; outline-offset:2px; }
.paf-process-feedback { margin:12px 0; padding:12px; border:1px solid #b8c9d7; border-radius:5px; background:white; }
.paf-process-feedback progress { width:min(100%,480px); }
.paf-action-card { margin:16px 0; padding:16px; border:1px solid #b8c9d7; border-left:5px solid #246c3c; border-radius:5px; background:white; }
.paf-action-card h3 { margin:0 0 8px; }
.paf-restore-card { border-left-color:#b82d27; }
.paf-grid tr[hidden] { display:none; }
.paf-return-page { min-width:0; }
.paf-grid-scroll { max-height:75vh; overflow-y:auto; overflow-x:hidden; border:1px solid #cfdae2; }
.paf-return-page .paf-grid, .paf-return-page .table-wrap .portal-grid { width:100%; min-width:0; table-layout:fixed; }
.paf-return-page .portal-grid th, .paf-return-page .portal-grid td { white-space:normal; overflow-wrap:anywhere; padding:8px; vertical-align:top; }
.paf-grid thead th { position:sticky; top:0; z-index:1; }
.paf-grid { font-size:.84rem; }
.paf-cell-line { display:block; margin-top:4px; }
.paf-return-note { color:#c62828; font-weight:600; white-space:pre-line; margin:8px 0 0; }
.paf-return-reference { margin:8px 0; padding-top:6px; border-top:1px solid #d9e2e8; }
.paf-return-page .table-wrap { overflow-x:hidden; }
@media(max-width:650px) {
 .paf-grid colgroup,.paf-grid thead { display:none; }
 .paf-grid,.paf-grid tbody,.paf-grid tr { display:block; }
 .paf-grid tr { padding:8px 0; border-bottom:2px solid #b8c9d7; }
 .paf-grid td { display:block; width:auto; border:0; }
 .paf-grid td::before { content:attr(data-label); display:block; font-weight:700; margin-bottom:4px; }
}

.paf-more-info { margin:16px 0; padding:12px 16px; border:1px solid #cfdae2; background:white; }
.paf-more-info > summary, .paf-restore-card > summary { font-weight:700; cursor:pointer; }
.paf-pool-email textarea { display:block; width:100%; box-sizing:border-box; margin:8px 0; padding:10px; font:inherit; font-family:monospace; resize:vertical; }
.paf-pool-email td { background:#edf4f8; }
.paf-import-action { margin-top:24px; }
