:root {
    --rks-navy: #111827;
    --rks-blue: #153b64;
    --rks-blue-light: #1f578d;
    --rks-gold: #f5a623;
    --rks-border: #d7e0eb;
    --rks-muted: #627089;
}

html, body { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; }
body { background: #f4f6fb; color: #17202f; margin: 0; }
a { color: #1d4f86; }
h1:focus { outline: none; }

.admin-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
}

.admin-sidebar {
    background: var(--rks-navy);
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 28px;
    height: 100vh;
    min-height: 0;
    padding: 28px 20px;
    position: sticky;
    top: 0;
}

.admin-brand {
    align-items: center;
    color: inherit;
    display: grid;
    gap: 14px;
    grid-template-columns: 86px minmax(0, 1fr);
    text-decoration: none;
}

.admin-brand img { height: auto; object-fit: contain; width: 100%; }
.admin-brand strong, .admin-brand span { display: block; }
.admin-brand strong { font-size: 1.1rem; }
.admin-brand span { color: rgba(248, 250, 252, .7); font-size: .92rem; }

.admin-nav { display: grid; gap: 8px; min-height: 0; overflow-y: auto; padding-right: 4px; }
.admin-nav a {
    align-items: center;
    border-radius: 12px;
    color: #e5edf8;
    display: flex;
    font-weight: 600;
    gap: 12px;
    padding: 12px 14px;
    text-decoration: none;
    transition: background-color .2s ease, color .2s ease;
}
.admin-nav a:hover, .admin-nav a.active { background: rgba(255, 255, 255, .12); color: #fff; }
.admin-sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, .12);
    margin-top: auto;
    padding: 14px 14px 0;
}
.admin-sidebar-footer form { margin: 0 0 14px; }
.admin-logout {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: #e5edf8;
    cursor: pointer;
    display: flex;
    font-weight: 650;
    gap: 12px;
    padding: 10px 12px;
    width: 100%;
}
.admin-logout:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.admin-copyright { color: rgba(248, 250, 252, .68); display: grid; gap: 3px; line-height: 1.3; }
.admin-copyright strong { color: #fff; font-size: .86rem; }
.admin-copyright span, .admin-copyright small { font-size: .72rem; }

.admin-mobile-header { display: none; }
.admin-main { display: grid; gap: 24px; padding: 28px; align-content: start; min-width: 0; }

.admin-hero {
    align-items: flex-end;
    background: linear-gradient(135deg, var(--rks-blue) 0%, var(--rks-blue-light) 45%, var(--rks-gold) 100%);
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(21, 59, 100, .18);
    color: #fff;
    display: flex;
    gap: 28px;
    justify-content: space-between;
    padding: 30px 32px;
}
.admin-hero--compact { padding: 24px 28px; }
.admin-hero h1 { font-size: clamp(2rem, 3vw, 2.8rem); line-height: 1.08; margin: 8px 0 10px; }
.admin-hero p { color: rgba(255, 255, 255, .88); font-size: 1.02rem; margin: 0; max-width: 760px; }
.eyebrow { font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.admin-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.admin-stat-grid { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.admin-stat-card, .admin-panel, .card {
    background: #fff;
    border: 1px solid var(--rks-border);
    border-radius: 8px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, .05);
}
.admin-stat-card { padding: 20px 22px; }
.admin-stat-card span, .admin-stat-card small { display: block; }
.admin-stat-card span { color: #5a6881; font-size: .92rem; font-weight: 700; }
.admin-stat-card strong { color: #122033; display: block; font-size: 2rem; line-height: 1; margin: 10px 0 8px; }
.admin-stat-card small { color: #6f7c92; font-size: .92rem; }
.admin-panel { padding: 22px; }
.admin-panel-header { align-items: flex-start; display: flex; gap: 18px; justify-content: space-between; margin-bottom: 18px; }
.admin-panel-header h2 { font-size: 1.35rem; margin: 0 0 6px; }
.admin-panel-header p { color: var(--rks-muted); margin: 0; }

.response-meta { align-items: center; border-bottom: 1px solid #e7edf4; display: flex; justify-content: space-between; margin-bottom: 18px; padding-bottom: 12px; }
.admin-status-chip {
    background: #edf3f9;
    border: 1px solid #cbd8e6;
    border-radius: 999px;
    color: #244565;
    display: inline-flex;
    font-size: .8rem;
    font-weight: 800;
    padding: 5px 10px;
}
.admin-status-chip--warning { background: #fff4dc; border-color: #f3cf84; color: #855409; }
.admin-status-chip--muted { background: #f1f3f5; border-color: #d8dde3; color: #667085; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.btn { border-radius: 6px; font-weight: 650; }
.btn-primary { background: #1d4f86; border-color: #1d4f86; }
.btn-primary:hover { background: #153b64; border-color: #153b64; }
.btn-warning { background: var(--rks-gold); border-color: var(--rks-gold); color: #17202f; }
.form-control, .form-select { border-color: #cbd6e3; border-radius: 6px; }
.form-control:focus, .form-select:focus { border-color: #6f93b7; box-shadow: 0 0 0 .2rem rgba(29, 79, 134, .12); }
.table { --bs-table-bg: transparent; }
.table thead th { color: #53627a; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }
.table > :not(caption) > * > * { border-color: #e2e8f0; padding: .85rem .75rem; }

.alert { border-radius: 8px; }
.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid #e50000; }
.validation-message { color: #e50000; }

.admin-auth-shell {
    align-items: center;
    background: linear-gradient(135deg, var(--rks-blue) 0%, var(--rks-blue-light) 45%, var(--rks-gold) 100%);
    display: grid;
    min-height: 100vh;
    padding: 28px;
}
.admin-auth-card {
    align-items: center;
    display: grid;
    gap: 26px;
    grid-template-columns: minmax(0, 1.2fr) minmax(360px, 440px);
    margin: auto;
    max-width: 1120px;
    padding: 28px;
    width: 100%;
}
.admin-auth-card--compact { grid-template-columns: minmax(0, 1fr); max-width: 760px; }
.admin-auth-copy { color: #fff; padding: 18px 10px; }
.admin-auth-logo { display: block; margin-bottom: 24px; max-width: 160px; width: 42%; }
.admin-auth-copy h1 { font-size: clamp(2.2rem, 3vw, 3.2rem); line-height: 1.05; margin: 10px 0 14px; max-width: 15ch; }
.admin-auth-copy p, .admin-auth-copy li { color: rgba(255, 255, 255, .88); font-size: 1rem; }
.admin-auth-copy ul { display: grid; gap: 10px; margin: 20px 0 0; padding-left: 18px; }
.admin-auth-form-panel {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, .12);
    padding: 28px;
}
.admin-auth-form-header h2 { font-size: 1.6rem; margin: 0 0 8px; }
.admin-auth-form-header p { color: #64748b; margin-bottom: 24px; }
.admin-auth-form .form-control { border-radius: 8px; }

.session-timeout-banner {
    align-items: center;
    background: #fff8e8;
    border: 1px solid #e5ad35;
    border-radius: 10px;
    bottom: 1rem;
    box-shadow: 0 18px 42px rgba(23, 32, 51, .18);
    color: #172033;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    max-width: min(440px, calc(100vw - 2rem));
    padding: 14px 16px;
    position: fixed;
    right: 1rem;
    z-index: 1080;
}
.session-timeout-banner[hidden] { display: none; }
.session-timeout-banner strong, .session-timeout-banner span { display: block; }
.session-timeout-banner span { color: #526173; font-size: .88rem; }

@media (max-width: 1120px) {
    .admin-shell { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
    .admin-mobile-header {
        align-items: center;
        background: var(--rks-navy);
        box-shadow: 0 10px 26px rgba(15, 23, 42, .18);
        color: #f8fafc;
        display: flex;
        gap: 14px;
        justify-content: space-between;
        padding: 12px 16px;
        position: sticky;
        top: 0;
        z-index: 1030;
    }
    .admin-mobile-brand { align-items: center; color: inherit; display: inline-flex; font-weight: 800; gap: 10px; text-decoration: none; }
    .admin-mobile-brand img { height: auto; width: 54px; }
    .admin-mobile-menu-button {
        align-items: center;
        background: rgba(255, 255, 255, .08);
        border: 1px solid rgba(248, 250, 252, .26);
        border-radius: 8px;
        color: #f8fafc;
        cursor: pointer;
        display: inline-flex;
        font-weight: 700;
        gap: 8px;
        padding: 9px 12px;
    }
    .admin-sidebar { display: none; }
    .admin-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-auth-card { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .admin-main { padding: 18px; }
    .admin-hero, .admin-panel { padding: 20px; }
    .admin-hero, .admin-panel-header { align-items: stretch; flex-direction: column; }
    .admin-stat-grid { grid-template-columns: 1fr; }
    .admin-auth-shell, .admin-auth-card, .admin-auth-form-panel { padding: 20px; }
}
