:root {
    --navy-950: #06163b;
    --navy-900: #071b48;
    --navy-800: #0b285f;
    --navy-700: #123875;
    --blue-600: #245ac4;
    --red-700: #a91725;
    --red-600: #bf1e2e;
    --red-500: #d32f3f;
    --amber-500: #e89b23;
    --green-600: #15805f;
    --cyan-600: #1784a7;
    --ink-950: #111827;
    --ink-800: #25314a;
    --ink-700: #3d4a61;
    --ink-600: #5b6679;
    --ink-500: #788397;
    --line-300: #d7dce5;
    --line-200: #e5e8ee;
    --line-100: #eef0f4;
    --surface: #ffffff;
    --canvas: #f3f5f8;
    --canvas-deep: #e9edf3;
    --success-bg: #eaf8f2;
    --danger-bg: #fff0f1;
    --warning-bg: #fff7e8;
    --info-bg: #edf4ff;
    --sidebar-width: 286px;
    --topbar-height: 76px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 4px rgba(16, 24, 40, .04);
    --shadow-md: 0 12px 32px rgba(15, 30, 65, .08);
    --focus-ring: 0 0 0 3px rgba(36, 90, 196, .24);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink-950);
    background: var(--canvas);
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--canvas);
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    color: var(--ink-950);
    background: var(--canvas);
    font-size: 14px;
    line-height: 1.5;
}

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

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
}

:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.skip-link {
    position: fixed;
    z-index: 1000;
    top: 12px;
    left: 12px;
    padding: 10px 14px;
    transform: translateY(-180%);
    border-radius: var(--radius-sm);
    color: #fff;
    background: var(--navy-900);
    font-weight: 700;
    text-decoration: none;
}

.skip-link:focus {
    transform: translateY(0);
}

.admin-shell {
    min-height: 100vh;
}

.admin-sidebar {
    position: fixed;
    z-index: 50;
    inset: 0 auto 0 0;
    display: flex;
    width: var(--sidebar-width);
    flex-direction: column;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 8% 84%, rgba(52, 91, 171, .28), transparent 32%),
        linear-gradient(165deg, var(--navy-900), var(--navy-950));
    box-shadow: 8px 0 28px rgba(5, 18, 49, .14);
}

.admin-sidebar::after {
    position: absolute;
    right: -90px;
    bottom: 40px;
    width: 210px;
    height: 210px;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 50%;
    content: "";
    pointer-events: none;
}

.sidebar-brand {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    min-height: var(--topbar-height);
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .09);
}

.brand-lockup,
.login-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    place-items: center;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, .88);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .16);
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.brand-mark--large {
    width: 64px;
    height: 64px;
    border-radius: 18px;
}

.brand-copy,
.login-logo > span:last-child {
    display: flex;
    min-width: 0;
    flex-direction: column;
    line-height: 1.15;
}

.brand-copy strong,
.login-logo strong {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: .07em;
}

.brand-copy small,
.login-logo small {
    margin-top: 5px;
    color: rgba(255, 255, 255, .66);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.sidebar-close {
    display: none;
    margin-left: auto;
    border: 0;
    color: #fff;
    background: transparent;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.sidebar-context {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 18px 18px 4px;
    padding: 12px 13px;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, .05);
}

.context-dot {
    width: 9px;
    height: 9px;
    flex: 0 0 auto;
    border: 2px solid rgba(106, 242, 190, .36);
    border-radius: 50%;
    background: #4cdda7;
    box-shadow: 0 0 0 4px rgba(76, 221, 167, .09);
}

.sidebar-context span:last-child {
    display: flex;
    flex-direction: column;
}

.sidebar-context strong {
    font-size: 12px;
    font-weight: 700;
}

.sidebar-context small {
    margin-top: 2px;
    color: rgba(255, 255, 255, .56);
    font-size: 10px;
}

.sidebar-nav {
    position: relative;
    z-index: 1;
    flex: 1;
    overflow: auto;
    padding: 12px 12px 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .18) transparent;
}

.sidebar-label {
    margin: 10px 12px 8px;
    color: rgba(255, 255, 255, .42);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.sidebar-nav ul {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sidebar-link {
    position: relative;
    display: flex;
    min-height: 52px;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 10px;
    color: rgba(255, 255, 255, .72);
    text-decoration: none;
    transition: color .18s ease, background .18s ease, transform .18s ease;
}

.sidebar-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, .065);
    transform: translateX(2px);
}

.sidebar-link.is-active {
    color: #fff;
    background: linear-gradient(100deg, rgba(191, 30, 46, .98), rgba(164, 22, 38, .92));
    box-shadow: 0 8px 20px rgba(120, 14, 28, .25);
}

.sidebar-link.is-active::after {
    position: absolute;
    right: 7px;
    width: 3px;
    height: 22px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .75);
    content: "";
}

.sidebar-icon {
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 9px;
    background: rgba(255, 255, 255, .055);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .04em;
}

.sidebar-link.is-active .sidebar-icon {
    border-color: rgba(255, 255, 255, .25);
    background: rgba(255, 255, 255, .13);
}

.sidebar-link-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.sidebar-link-copy strong {
    overflow: hidden;
    font-size: 12px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-link-copy small {
    margin-top: 1px;
    color: rgba(255, 255, 255, .38);
    font-size: 9px;
    letter-spacing: .02em;
}

.sidebar-link.is-active small {
    color: rgba(255, 255, 255, .65);
}

.sidebar-footer {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px 18px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    color: rgba(255, 255, 255, .7);
}

.sidebar-footer__mark {
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 8px;
    color: #fff;
    background: var(--red-600);
    font-size: 12px;
    font-weight: 800;
}

.sidebar-footer > span:last-child {
    display: flex;
    flex-direction: column;
}

.sidebar-footer strong {
    font-size: 10px;
}

.sidebar-footer small {
    color: rgba(255, 255, 255, .38);
    font-size: 9px;
}

.admin-workspace {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    margin-left: var(--sidebar-width);
}

.admin-topbar {
    position: sticky;
    z-index: 40;
    top: 0;
    display: flex;
    height: var(--topbar-height);
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(18px, 3vw, 38px);
    border-bottom: 1px solid var(--line-200);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(14px);
}

.topbar-start,
.topbar-actions,
.admin-identity {
    display: flex;
    align-items: center;
}

.topbar-actions {
    gap: 12px;
    margin-left: auto;
}

.sidebar-toggle {
    display: none;
    width: 42px;
    height: 42px;
    padding: 11px;
    border: 1px solid var(--line-200);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
}

.sidebar-toggle > span:not(.sr-only) {
    display: block;
    width: 100%;
    height: 2px;
    margin: 4px 0;
    border-radius: 2px;
    background: var(--navy-900);
}

.topbar-mobile-brand {
    display: none;
    align-items: center;
    gap: 9px;
    color: var(--navy-900);
    font-size: 13px;
    letter-spacing: .06em;
}

.topbar-mobile-brand img {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    object-fit: cover;
}

.topbar-help {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--ink-600);
    font-size: 12px;
    font-weight: 650;
    text-decoration: none;
}

.topbar-help > span:first-child {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 1px solid var(--line-300);
    border-radius: 50%;
    font-weight: 800;
}

.topbar-divider {
    width: 1px;
    height: 30px;
    background: var(--line-200);
}

.admin-identity {
    gap: 9px;
}

.admin-avatar {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 11px;
    color: #fff;
    background: linear-gradient(145deg, var(--navy-700), var(--navy-900));
    box-shadow: 0 0 0 1px var(--line-200);
    font-size: 13px;
    font-weight: 800;
}

.admin-identity__copy {
    display: flex;
    max-width: 170px;
    flex-direction: column;
}

.admin-identity__copy strong,
.admin-identity__copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-identity__copy strong {
    color: var(--ink-800);
    font-size: 12px;
}

.admin-identity__copy small {
    color: var(--ink-500);
    font-size: 10px;
}

.logout-form {
    margin: 0;
}

.icon-button {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid var(--line-200);
    border-radius: 10px;
    color: var(--ink-600);
    background: #fff;
    cursor: pointer;
}

.icon-button:hover {
    border-color: #efb6bc;
    color: var(--red-600);
    background: var(--danger-bg);
}

.sidebar-backdrop {
    display: none;
}

.admin-main {
    width: 100%;
    max-width: 1640px;
    flex: 1;
    margin: 0 auto;
    padding: 30px clamp(18px, 3vw, 40px) 48px;
}

.page-heading {
    display: flex;
    min-height: 72px;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.page-eyebrow {
    margin: 0 0 7px;
    color: var(--red-600);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.page-heading h1,
.login-card__header h2 {
    margin: 0;
    color: var(--ink-950);
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 780;
    letter-spacing: -.035em;
    line-height: 1.2;
}

.page-description {
    max-width: 700px;
    margin: 8px 0 0;
    color: var(--ink-600);
    font-size: 13px;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 9px;
}

.admin-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 clamp(18px, 3vw, 40px);
    padding: 18px 0 22px;
    border-top: 1px solid var(--line-200);
    color: var(--ink-500);
    font-size: 10px;
}

.flash-message {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 20px;
    padding: 12px 14px;
    border: 1px solid;
    border-radius: var(--radius-md);
    font-size: 12px;
}

.flash-message p {
    flex: 1;
    margin: 0;
}

.flash-message button {
    border: 0;
    color: inherit;
    background: transparent;
    font-size: 22px;
    cursor: pointer;
}

.flash-message__icon {
    display: grid;
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
}

.flash-message--success { border-color: #b5e4d2; color: #0b654a; background: var(--success-bg); }
.flash-message--success .flash-message__icon { background: var(--green-600); }
.flash-message--error { border-color: #f2c1c6; color: #8d1421; background: var(--danger-bg); }
.flash-message--error .flash-message__icon { background: var(--red-600); }
.flash-message--warning { border-color: #f0d59c; color: #825710; background: var(--warning-bg); }
.flash-message--warning .flash-message__icon { background: var(--amber-500); }
.flash-message--info { border-color: #bfd3f6; color: #174890; background: var(--info-bg); }
.flash-message--info .flash-message__icon { background: var(--blue-600); }

.button {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 15px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 750;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button--primary {
    color: #fff;
    background: linear-gradient(135deg, var(--red-600), #a51322);
    box-shadow: 0 8px 16px rgba(169, 23, 37, .16);
}

.button--primary:hover {
    background: linear-gradient(135deg, #c72536, #92101d);
}

.button--secondary {
    border-color: var(--line-300);
    color: var(--ink-700);
    background: #fff;
}

.button--secondary:hover {
    border-color: #b8c0cc;
    color: var(--navy-800);
    background: #fafbfc;
}

.button--quiet {
    color: var(--navy-700);
    background: #edf2fb;
}

.button--danger {
    border-color: #f0c2c7;
    color: var(--red-700);
    background: var(--danger-bg);
}

.button--small {
    min-height: 32px;
    padding: 7px 10px;
    border-radius: 7px;
    font-size: 10px;
}

.button--block {
    width: 100%;
}

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

.kpi-card {
    position: relative;
    min-height: 145px;
    overflow: hidden;
    padding: 20px;
    border: 1px solid var(--line-200);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.kpi-card::after {
    position: absolute;
    right: -24px;
    bottom: -30px;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: var(--kpi-tint, #eef3fb);
    content: "";
}

.kpi-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.kpi-card__icon {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 11px;
    color: var(--kpi-color, var(--navy-700));
    background: var(--kpi-tint, #eef3fb);
    font-size: 11px;
    font-weight: 850;
}

.kpi-card--red { --kpi-color: #a91725; --kpi-tint: #fff0f1; }
.kpi-card--blue { --kpi-color: #245ac4; --kpi-tint: #edf4ff; }
.kpi-card--green { --kpi-color: #15805f; --kpi-tint: #eaf8f2; }
.kpi-card--gold { --kpi-color: #8c5b0a; --kpi-tint: #fff7e8; }
.kpi-card--purple { --kpi-color: #6e43a2; --kpi-tint: #f1eafb; }

.kpi-card__change {
    padding: 4px 7px;
    border-radius: 99px;
    color: var(--green-600);
    background: var(--success-bg);
    font-size: 9px;
    font-weight: 800;
}

.kpi-card__change.is-down {
    color: var(--red-700);
    background: var(--danger-bg);
}

.kpi-card__value {
    position: relative;
    z-index: 1;
    margin: 16px 0 2px;
    color: var(--ink-950);
    font-size: 27px;
    font-weight: 800;
    letter-spacing: -.04em;
    line-height: 1;
}

.kpi-card__label {
    position: relative;
    z-index: 1;
    margin: 0;
    color: var(--ink-600);
    font-size: 11px;
    font-weight: 650;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(300px, .85fr);
    gap: 18px;
}

.content-grid + .content-grid,
.panel + .panel {
    margin-top: 18px;
}

.panel {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line-200);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.panel--padded {
    padding: 20px;
}

.panel-header {
    display: flex;
    min-height: 66px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--line-100);
}

.panel-title {
    margin: 0;
    color: var(--ink-800);
    font-size: 14px;
    font-weight: 780;
    letter-spacing: -.01em;
}

.panel-subtitle {
    margin: 3px 0 0;
    color: var(--ink-500);
    font-size: 10px;
}

.panel-header__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.panel-body {
    padding: 18px;
}

.filter-panel {
    margin-bottom: 16px;
    padding: 16px;
    border: 1px solid var(--line-200);
    border-radius: var(--radius-md);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.filter-form {
    display: grid;
    grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(145px, .75fr)) auto;
    align-items: end;
    gap: 10px;
}

.filter-form--wide {
    grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(135px, .7fr)) auto;
}

.filter-actions {
    display: flex;
    gap: 7px;
}

.form-field {
    min-width: 0;
}

.form-field label,
.field-label,
.label-row label {
    display: block;
    margin: 0 0 6px;
    color: var(--ink-700);
    font-size: 10px;
    font-weight: 750;
}

.form-field input,
.form-field select,
.form-field textarea,
.filter-form input,
.filter-form select,
.form-control {
    width: 100%;
    min-height: 40px;
    padding: 9px 11px;
    border: 1px solid var(--line-300);
    border-radius: 9px;
    color: var(--ink-800);
    background: #fff;
    box-shadow: inset 0 1px 1px rgba(16, 24, 40, .02);
    font-size: 12px;
    transition: border-color .16s ease, box-shadow .16s ease;
}

.form-field textarea,
textarea.form-control {
    min-height: 112px;
    resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus,
.filter-form input:focus,
.filter-form select:focus,
.form-control:focus {
    border-color: var(--blue-600);
    outline: 0;
    box-shadow: var(--focus-ring);
}

.form-field input:disabled,
.form-field select:disabled,
.form-field textarea:disabled,
.form-control:disabled,
.form-control[readonly] {
    color: var(--ink-600);
    background: #f5f6f8;
    cursor: not-allowed;
}

.field-help,
.field-error {
    display: block;
    margin-top: 5px;
    color: var(--ink-500);
    font-size: 9px;
}

.field-error {
    color: var(--red-700);
}

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

.form-grid--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-field--full {
    grid-column: 1 / -1;
}

.form-section {
    padding: 20px;
    border: 1px solid var(--line-200);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.form-section + .form-section {
    margin-top: 16px;
}

.form-section__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line-100);
}

.form-section__header h2,
.form-section__header h3 {
    margin: 0;
    color: var(--ink-800);
    font-size: 14px;
}

.form-section__header p {
    margin: 4px 0 0;
    color: var(--ink-500);
    font-size: 10px;
}

.form-actions-bar {
    position: sticky;
    z-index: 10;
    bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 18px;
    padding: 13px 15px;
    border: 1px solid var(--line-200);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, .96);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(12px);
}

.check-control,
.radio-control {
    display: inline-flex;
    align-items: flex-start;
    gap: 9px;
    color: var(--ink-700);
    font-size: 11px;
    cursor: pointer;
}

.check-control input,
.radio-control input {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    margin: 1px 0 0;
    accent-color: var(--red-600);
}

.switch-control {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
}

.switch-control input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.switch-control__track {
    position: relative;
    width: 38px;
    height: 22px;
    border-radius: 99px;
    background: #c8ced8;
    transition: background .18s ease;
}

.switch-control__track::after {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(16, 24, 40, .22);
    content: "";
    transition: transform .18s ease;
}

.switch-control input:checked + .switch-control__track {
    background: var(--green-600);
}

.switch-control input:checked + .switch-control__track::after {
    transform: translateX(16px);
}

.switch-control input:focus-visible + .switch-control__track {
    box-shadow: var(--focus-ring);
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
}

.data-table {
    width: 100%;
    min-width: 820px;
    border-collapse: collapse;
    background: #fff;
}

.data-table th,
.data-table td {
    padding: 13px 15px;
    border-bottom: 1px solid var(--line-100);
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    color: var(--ink-500);
    background: #fafbfc;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .055em;
    text-transform: uppercase;
    white-space: nowrap;
}

.data-table td {
    color: var(--ink-700);
    font-size: 11px;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

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

.table-primary {
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-avatar {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 9px;
    color: var(--navy-700);
    background: #eaf0fa;
    font-size: 10px;
    font-weight: 800;
}

.table-primary__copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.table-primary__copy strong {
    max-width: 230px;
    overflow: hidden;
    color: var(--ink-800);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-primary__copy small {
    margin-top: 2px;
    color: var(--ink-500);
    font-size: 9px;
}

.table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    white-space: nowrap;
}

.table-link {
    color: var(--blue-600);
    font-size: 10px;
    font-weight: 750;
    text-decoration: none;
}

.table-link:hover {
    text-decoration: underline;
}

.status-pill {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 99px;
    font-size: 9px;
    font-weight: 750;
    white-space: nowrap;
}

.status-pill::before {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    content: "";
}

.status-pill--green { color: #0c7252; background: #e5f7f0; }
.status-pill--red { color: #9d1725; background: #feecee; }
.status-pill--amber { color: #93610d; background: #fff4da; }
.status-pill--blue { color: #1d55a6; background: #eaf1fd; }
.status-pill--purple { color: #6e43a2; background: #f1eafb; }
.status-pill--neutral { color: #596376; background: #eef0f3; }

.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 5px;
    padding: 15px 18px;
    border-top: 1px solid var(--line-100);
}

.pagination__item {
    display: grid;
    min-width: 32px;
    height: 32px;
    place-items: center;
    padding: 0 9px;
    border: 1px solid var(--line-200);
    border-radius: 8px;
    color: var(--ink-600);
    background: #fff;
    font-size: 10px;
    font-weight: 700;
    text-decoration: none;
}

.pagination__item:hover {
    border-color: #b9c4d6;
    color: var(--navy-700);
}

.pagination__item.is-current {
    border-color: var(--navy-800);
    color: #fff;
    background: var(--navy-800);
}

.pagination__item.is-disabled {
    opacity: .46;
}

.empty-state {
    display: flex;
    min-height: 260px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 38px 20px;
    text-align: center;
}

.empty-state__icon {
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    margin-bottom: 14px;
    border: 1px dashed #bdc6d4;
    border-radius: 17px;
    color: var(--ink-500);
    background: #f6f7f9;
    font-size: 25px;
}

.empty-state h3 {
    margin: 0;
    color: var(--ink-800);
    font-size: 14px;
}

.empty-state p {
    max-width: 440px;
    margin: 7px 0 16px;
    color: var(--ink-500);
    font-size: 11px;
}

.activity-list,
.metric-list,
.quick-links {
    display: grid;
    margin: 0;
    padding: 0;
    list-style: none;
}

.activity-list {
    gap: 1px;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line-100);
}

.activity-item:last-child {
    border-bottom: 0;
}

.activity-dot {
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 9px;
    color: var(--navy-700);
    background: #edf2fa;
    font-size: 9px;
    font-weight: 800;
}

.activity-dot--red { color: var(--red-700); background: var(--danger-bg); }
.activity-dot--green { color: var(--green-600); background: var(--success-bg); }
.activity-dot--amber { color: #8f5d0b; background: var(--warning-bg); }

.activity-copy {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
}

.activity-copy strong {
    color: var(--ink-800);
    font-size: 11px;
}

.activity-copy small {
    margin-top: 3px;
    color: var(--ink-500);
    font-size: 9px;
}

.activity-time {
    color: var(--ink-500);
    font-size: 9px;
    white-space: nowrap;
}

.metric-list {
    gap: 15px;
}

.metric-row__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 7px;
    color: var(--ink-700);
    font-size: 10px;
    font-weight: 650;
}

.metric-row__header strong {
    color: var(--ink-800);
}

.metric-progress {
    display: block;
    width: 100%;
    height: 7px;
    overflow: hidden;
    border: 0;
    border-radius: 99px;
    background: #edf0f4;
    appearance: none;
}

.metric-progress::-webkit-progress-bar { border-radius: 99px; background: #edf0f4; }
.metric-progress::-webkit-progress-value { border-radius: 99px; background: var(--progress-color, var(--navy-700)); }
.metric-progress::-moz-progress-bar { border-radius: 99px; background: var(--progress-color, var(--navy-700)); }
.metric-progress--blue { --progress-color: #245ac4; }
.metric-progress--green { --progress-color: #15805f; }
.metric-progress--red { --progress-color: #a91725; }
.metric-progress--gold { --progress-color: #8c5b0a; }
.metric-progress--purple { --progress-color: #6e43a2; }

.quick-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.quick-link {
    display: flex;
    min-height: 74px;
    align-items: center;
    gap: 11px;
    padding: 13px;
    border: 1px solid var(--line-200);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.quick-link:hover {
    border-color: #c4ccda;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.quick-link__icon {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 9px;
    color: var(--navy-700);
    background: #edf2fb;
    font-size: 9px;
    font-weight: 800;
}

.quick-link span:last-child {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.quick-link strong {
    color: var(--ink-800);
    font-size: 10px;
}

.quick-link small {
    margin-top: 2px;
    color: var(--ink-500);
    font-size: 9px;
}

.detail-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    margin: 0;
    border: 1px solid var(--line-200);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.detail-list > div {
    padding: 13px 15px;
    border-right: 1px solid var(--line-100);
    border-bottom: 1px solid var(--line-100);
}

.detail-list > div:nth-child(2n) {
    border-right: 0;
}

.detail-list dt {
    margin: 0 0 3px;
    color: var(--ink-500);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}

.detail-list dd {
    margin: 0;
    color: var(--ink-800);
    font-size: 11px;
    font-weight: 600;
    word-break: break-word;
}

.code-block {
    max-height: 460px;
    overflow: auto;
    margin: 0;
    padding: 15px;
    border: 1px solid #202e4b;
    border-radius: var(--radius-md);
    color: #d6e1f7;
    background: #0d1931;
    font: 11px/1.65 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    white-space: pre-wrap;
    word-break: break-word;
}

.question-card {
    padding: 17px;
    border: 1px solid var(--line-200);
    border-radius: var(--radius-md);
    background: #fafbfc;
}

.question-card + .question-card {
    margin-top: 12px;
}

.question-card__header,
.option-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.question-card__header {
    justify-content: space-between;
    margin-bottom: 12px;
}

.question-card__header strong {
    color: var(--ink-800);
    font-size: 11px;
}

.option-list {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.option-row input:first-of-type {
    flex: 0 0 105px;
}

.option-row input:last-of-type {
    flex: 1;
}

.muted-note {
    padding: 11px 13px;
    border-left: 3px solid var(--blue-600);
    border-radius: 0 8px 8px 0;
    color: var(--ink-600);
    background: #f2f6fd;
    font-size: 10px;
}

.danger-note {
    border-left-color: var(--red-600);
    color: #801521;
    background: var(--danger-bg);
}

.login-body {
    overflow-x: hidden;
    background: #fff;
}

.login-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(420px, .92fr) minmax(480px, 1.08fr);
}

.login-brand-panel {
    position: relative;
    display: flex;
    min-height: 100vh;
    overflow: hidden;
    padding: clamp(38px, 6vw, 78px);
    color: #fff;
    background:
        radial-gradient(circle at 86% 18%, rgba(57, 101, 185, .34), transparent 29%),
        linear-gradient(145deg, #0a2a66, var(--navy-950) 75%);
}

.login-brand-panel::after {
    position: absolute;
    right: -120px;
    bottom: -140px;
    width: 420px;
    height: 420px;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 50%;
    content: "";
}

.login-brand-content {
    position: relative;
    z-index: 2;
    display: flex;
    max-width: 570px;
    flex: 1;
    flex-direction: column;
}

.login-intro {
    margin: auto 0 46px;
}

.login-kicker {
    margin: 0 0 12px;
    color: #ef9ba4;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.login-intro h1 {
    margin: 0;
    font-size: clamp(34px, 4vw, 55px);
    font-weight: 780;
    letter-spacing: -.045em;
    line-height: 1.08;
}

.login-intro > p:last-child {
    max-width: 500px;
    margin: 20px 0 0;
    color: rgba(255, 255, 255, .66);
    font-size: 13px;
    line-height: 1.75;
}

.login-benefits {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
    color: rgba(255, 255, 255, .72);
    font-size: 11px;
}

.login-benefits span {
    display: inline-grid;
    width: 22px;
    height: 22px;
    place-items: center;
    margin-right: 8px;
    border-radius: 50%;
    color: #fff;
    background: rgba(76, 221, 167, .2);
    font-size: 9px;
}

.login-orbit {
    position: absolute;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 50%;
}

.login-orbit--one {
    top: -100px;
    right: -140px;
    width: 360px;
    height: 360px;
}

.login-orbit--two {
    right: 100px;
    bottom: 120px;
    width: 150px;
    height: 150px;
}

.login-form-panel {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: clamp(28px, 6vw, 80px);
    background:
        linear-gradient(rgba(244, 246, 249, .84) 1px, transparent 1px),
        linear-gradient(90deg, rgba(244, 246, 249, .84) 1px, transparent 1px),
        #fff;
    background-size: 34px 34px;
}

.login-card {
    width: min(100%, 430px);
    padding: 36px;
    border: 1px solid var(--line-200);
    border-radius: 22px;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 28px 70px rgba(18, 39, 79, .12);
}

.login-card__header {
    margin-bottom: 24px;
}

.login-card__header > p:last-child {
    margin: 8px 0 0;
    color: var(--ink-500);
    font-size: 11px;
}

.stacked-form {
    display: grid;
    gap: 16px;
}

.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.input-with-icon {
    position: relative;
}

.input-with-icon > span:first-child {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 12px;
    color: var(--ink-500);
    font-size: 11px;
    transform: translateY(-50%);
    pointer-events: none;
}

.input-with-icon input {
    min-height: 46px;
    padding-left: 35px;
}

.input-with-action input {
    padding-right: 58px;
}

.input-with-action button {
    position: absolute;
    top: 50%;
    right: 7px;
    padding: 5px 7px;
    border: 0;
    border-radius: 6px;
    color: var(--navy-700);
    background: #eef2f8;
    font-size: 9px;
    font-weight: 750;
    transform: translateY(-50%);
    cursor: pointer;
}

.login-security-note {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 24px 0 0;
    padding-top: 18px;
    border-top: 1px solid var(--line-100);
    color: var(--ink-500);
    font-size: 9px;
    text-align: center;
}

.rich-editor {
    overflow: hidden;
    border: 1px solid var(--line-300);
    border-radius: var(--radius-md);
    background: #fff;
    transition: border-color .16s ease, box-shadow .16s ease;
}

.rich-editor:focus-within {
    border-color: var(--blue-600);
    box-shadow: var(--focus-ring);
}

.rich-editor__toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 9px;
    border-bottom: 1px solid var(--line-200);
    background: #f8fafc;
}

.rich-editor__toolbar .button {
    min-height: 32px;
    padding: 6px 9px;
    font-size: 10px;
}

.rich-editor__surface {
    min-height: 260px;
    max-height: 640px;
    overflow-y: auto;
    padding: 18px;
    color: var(--ink-800);
    background: #fff;
    font-size: 14px;
    line-height: 1.7;
    outline: 0;
    overflow-wrap: anywhere;
}

.rich-editor__surface:empty::before {
    color: var(--ink-500);
    content: attr(data-placeholder);
    pointer-events: none;
}

.rich-editor__surface h2,
.rich-editor__surface h3,
.rich-editor__surface h4 {
    margin: 1.1em 0 .55em;
    color: var(--navy-900);
    line-height: 1.35;
}

.rich-editor__surface h2 { font-size: 20px; }
.rich-editor__surface h3 { font-size: 17px; }
.rich-editor__surface h4 { font-size: 15px; }

.rich-editor__surface p,
.rich-editor__surface ul,
.rich-editor__surface ol,
.rich-editor__surface blockquote,
.rich-editor__surface figure {
    margin: 0 0 1em;
}

.rich-editor__surface blockquote {
    padding: 10px 14px;
    border-left: 4px solid var(--red-600);
    color: var(--ink-600);
    background: #f8fafc;
}

.rich-editor__surface a {
    color: var(--blue-600);
    text-decoration: underline;
}

.rich-editor__surface img {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 520px;
    margin: 12px auto;
    border-radius: var(--radius-sm);
    object-fit: contain;
}

.rich-editor > [data-rich-status] {
    min-height: 26px;
    margin: 0;
    padding: 6px 10px;
    border-top: 1px solid var(--line-100);
    background: #fbfcfe;
}

.media-upload__preview {
    display: block;
    width: min(100%, 360px);
    max-height: 260px;
    margin-top: 10px;
    border: 1px solid var(--line-200);
    border-radius: var(--radius-md);
    background: #f8fafc;
    object-fit: contain;
}

.media-upload__preview[hidden],
.category-media-preview__image[hidden],
[data-media-clear][hidden] {
    display: none !important;
}

.media-status--success {
    color: var(--green-600);
}

.form-field details {
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid var(--line-200);
    border-radius: var(--radius-sm);
    background: #fafbfc;
}

.form-field details summary {
    color: var(--ink-700);
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
}

.form-field details[open] summary {
    margin-bottom: 10px;
}

.category-media-preview {
    display: flex;
    min-height: 100px;
    align-items: center;
    gap: 16px;
    padding: 14px;
    border: 1px dashed #c5ccda;
    border-radius: var(--radius-md);
    background: #fafbfc;
}

.category-media-preview__fallback,
.category-media-preview__image {
    width: 72px;
    height: 72px;
    flex: 0 0 72px;
    border: 1px solid var(--line-200);
    border-radius: 16px;
    background: #fff;
}

.category-media-preview__fallback {
    display: grid;
    place-items: center;
    font-size: 34px;
}

.category-media-preview__image {
    display: block;
    margin-left: -88px;
    object-fit: cover;
}

.category-media-preview > div:last-child {
    min-width: 0;
}

.category-media-preview .field-help {
    margin: 0 0 8px;
}

@media (max-width: 1280px) {
    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-form,
    .filter-form--wide {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .filter-actions {
        grid-column: span 3;
        justify-content: flex-end;
    }
}

@media (max-width: 1024px) {
    body.is-sidebar-open {
        overflow: hidden;
    }

    .admin-sidebar {
        transform: translateX(-104%);
        transition: transform .22s ease;
    }

    .is-sidebar-open .admin-sidebar {
        transform: translateX(0);
    }

    .sidebar-close,
    .sidebar-toggle,
    .topbar-mobile-brand {
        display: flex;
    }

    .sidebar-toggle {
        display: block;
    }

    .sidebar-backdrop {
        position: fixed;
        z-index: 45;
        inset: 0;
        display: block;
        visibility: hidden;
        border: 0;
        opacity: 0;
        background: rgba(4, 12, 30, .48);
        transition: opacity .22s ease, visibility .22s ease;
    }

    .is-sidebar-open .sidebar-backdrop {
        visibility: visible;
        opacity: 1;
    }

    .admin-workspace {
        margin-left: 0;
    }

    .topbar-start {
        gap: 12px;
    }

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

    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-brand-panel {
        min-height: auto;
        padding: 30px clamp(24px, 7vw, 70px);
    }

    .login-intro,
    .login-benefits,
    .login-orbit {
        display: none;
    }

    .login-form-panel {
        min-height: calc(100vh - 124px);
    }
}

@media (max-width: 720px) {
    .admin-topbar {
        height: 64px;
        padding: 0 14px;
    }

    .topbar-help,
    .topbar-divider,
    .admin-identity__copy {
        display: none;
    }

    .topbar-actions {
        gap: 8px;
    }

    .admin-main {
        padding: 22px 14px 36px;
    }

    .page-heading {
        min-height: 0;
        flex-direction: column;
        gap: 14px;
        margin-bottom: 18px;
    }

    .page-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .page-actions .button {
        flex: 1;
    }

    .kpi-grid,
    .form-grid,
    .form-grid--three,
    .detail-list,
    .quick-links {
        grid-template-columns: 1fr;
    }

    .detail-list > div {
        border-right: 0;
    }

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

    .filter-actions {
        grid-column: auto;
    }

    .filter-actions .button {
        flex: 1;
    }

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

    .panel-header__actions {
        width: 100%;
        justify-content: flex-start;
    }

    .form-actions-bar {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .form-actions-bar .button {
        width: 100%;
    }

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

    .login-form-panel {
        padding: 22px 14px 34px;
    }

    .login-card {
        padding: 25px 20px;
        border-radius: 16px;
    }

    .login-brand-panel {
        padding: 22px;
    }

    .login-logo strong {
        font-size: 17px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
