:root {
    --ink: #172033;
    --muted: #667085;
    --line: #dbe3ee;
    --brand: #b9142b;
    --brand-dark: #8f1022;
    --navy: #13294b;
    --gold: #d99a22;
    --surface: #f5f7fb;
    --panel: #ffffff;
    --success: #13795b;
    --warning: #b7791f;
    --shadow: 0 16px 40px rgba(19, 41, 75, .08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    background:
        linear-gradient(180deg, rgba(19, 41, 75, .06), rgba(255, 255, 255, 0) 260px),
        var(--surface);
}

.admin-topbar {
    min-height: 68px;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0 24px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .96);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.admin-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--navy);
    text-decoration: none;
    font-weight: 900;
    min-width: 116px;
}

.admin-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
    background: white;
    border: 1px solid var(--line);
}

.admin-topbar nav {
    display: flex;
    gap: 6px;
    flex: 1;
    flex-wrap: wrap;
}

.admin-topbar a {
    color: var(--navy);
    text-decoration: none;
    font-weight: 800;
    font-size: 14px;
}

.admin-topbar nav a {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
}

.admin-topbar nav a:hover,
.admin-topbar nav a:focus {
    background: #eef2f7;
}

.role-pill {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    background: #eef2f7;
    color: var(--navy);
    font-size: 12px;
    font-weight: 900;
    text-transform: capitalize;
}

button,
.button {
    border: 0;
    background: var(--brand);
    color: white;
    min-height: 40px;
    padding: 0 16px;
    text-decoration: none;
    font-weight: 900;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

button:hover,
.button:hover {
    background: var(--brand-dark);
}

.admin-main {
    width: min(1220px, 100%);
    margin: 0 auto;
    padding: 30px 20px 70px;
}

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

.dashboard-hero {
    background: var(--panel);
    border: 1px solid var(--line);
    padding: 24px;
    box-shadow: var(--shadow);
}

h1,
h2,
h3 {
    margin: 0;
    letter-spacing: 0;
}

h1 {
    font-size: clamp(28px, 4vw, 42px);
}

h2 {
    font-size: 21px;
}

.page-subtitle,
.muted {
    color: var(--muted);
}

.page-subtitle {
    max-width: 760px;
    margin: 10px 0 0;
    line-height: 1.55;
}

.eyebrow {
    margin: 0 0 7px;
    color: var(--gold);
    font-weight: 900;
    text-transform: uppercase;
    font-size: 12px;
}

.action-grid,
.stat-grid,
.shortcut-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.action-card,
.shortcut-grid a,
.link-grid a {
    display: grid;
    gap: 7px;
    border: 1px solid var(--line);
    background: var(--panel);
    padding: 18px;
    color: var(--ink);
    text-decoration: none;
    box-shadow: 0 8px 22px rgba(19, 41, 75, .04);
}

.action-card:hover,
.shortcut-grid a:hover,
.link-grid a:hover {
    border-color: rgba(185, 20, 43, .35);
    box-shadow: var(--shadow);
}

.action-card span {
    color: var(--gold);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.action-card strong {
    font-size: 19px;
}

.action-card small {
    color: var(--muted);
    line-height: 1.45;
}

.primary-action {
    background: var(--navy);
    color: white;
}

.primary-action small {
    color: #d7e2f0;
}

.stat,
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    padding: 18px;
    box-shadow: 0 8px 22px rgba(19, 41, 75, .035);
}

.stat span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 10px;
}

.stat strong {
    font-size: 32px;
}

.dashboard-grid,
.two-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.panel-head a {
    color: var(--brand);
    font-weight: 900;
    text-decoration: none;
}

.queue-list,
.compact-list {
    display: grid;
    gap: 10px;
}

.queue-list a,
.compact-list div {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: center;
    border: 1px solid var(--line);
    padding: 12px;
    text-decoration: none;
    color: var(--ink);
    background: #fbfcfe;
}

.queue-list strong {
    min-width: 44px;
    min-height: 36px;
    display: inline-grid;
    place-items: center;
    background: #eef2f7;
    color: var(--navy);
}

.queue-list span,
.compact-list span {
    color: var(--muted);
    font-size: 13px;
}

.compact-list div {
    grid-template-columns: 1fr;
}

form {
    display: grid;
    gap: 12px;
}

form.panel h2 {
    padding-bottom: 4px;
}

input,
select,
textarea {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--line);
    padding: 9px 11px;
    font: inherit;
    background: white;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(185, 20, 43, .14);
    border-color: rgba(185, 20, 43, .45);
}

textarea {
    min-height: 96px;
    resize: vertical;
}

.check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.check input {
    width: auto;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--navy), var(--brand));
}

.login-panel {
    width: min(420px, calc(100% - 32px));
    background: white;
    padding: 28px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.alert {
    background: #fff2f2;
    border: 1px solid #f1b7b7;
    color: #9f1f1f;
    padding: 10px;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 10px;
    background: var(--navy);
    color: white;
    font-size: 12px;
    font-weight: 900;
}

.output {
    background: #101828;
    color: #d1fadf;
    padding: 14px;
    overflow: auto;
    min-height: 80px;
    border: 0;
}

.status-output {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.notice-card {
    border: 1px solid #b7e4cf;
    background: #f0fdf7;
    color: #0f5132;
    padding: 14px;
    display: grid;
    gap: 4px;
}

.notice-card span {
    color: #1f6f4a;
    font-size: 13px;
}

.report-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.report-summary div {
    border: 1px solid var(--line);
    background: white;
    padding: 14px;
}

.report-summary span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    text-transform: capitalize;
    margin-bottom: 8px;
}

.report-summary strong {
    font-size: 24px;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 8px;
    background: #eef2f7;
    color: var(--navy);
    font-size: 12px;
    font-weight: 900;
}

.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.inline {
    display: flex;
    gap: 10px;
    margin: 10px 0 16px;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
    background: white;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 11px 12px;
    text-align: left;
    font-size: 14px;
}

th {
    background: #eef2f7;
    color: var(--navy);
}

@media (max-width: 900px) {
    .admin-topbar,
    .page-head {
        align-items: stretch;
        flex-direction: column;
        padding-top: 14px;
        padding-bottom: 14px;
    }

    .dashboard-grid,
    .two-col {
        grid-template-columns: 1fr;
    }

    .admin-topbar nav a {
        background: #f4f6f9;
    }
}
