:root {
    --bg: #f3f6fb;
    --surface: #ffffff;
    --surface-soft: #f8fbff;
    --line: #d9e1ec;
    --line-strong: #c5d2e3;
    --text: #1f2a37;
    --muted: #64748b;
    --brand: #1f4f91;
    --brand-dark: #163b6d;
    --brand-soft: #eaf2ff;
    --success: #18834d;
    --success-soft: #e7f8ef;
    --warning: #b7791f;
    --warning-soft: #fff5df;
    --error: #b33a3a;
    --error-soft: #fdeaea;
    --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

/* ===== Commercial technology theme ===== */
:root {
    --bg: #eef3f8;
    --surface: #ffffff;
    --surface-soft: #f6f9fc;
    --line: #d8e1ea;
    --line-strong: #b7c4d4;
    --text: #101828;
    --muted: #667085;
    --brand: #0f66e8;
    --brand-dark: #0b3f8a;
    --brand-soft: #eaf3ff;
    --accent: #00a6a6;
    --accent-soft: #e5fbf8;
    --success: #087443;
    --success-soft: #e7f8ef;
    --warning: #b54708;
    --warning-soft: #fff4e5;
    --error: #b42318;
    --error-soft: #ffebe9;
    --shadow: 0 18px 50px rgba(16, 24, 40, 0.08);
}

body {
    font-family: Inter, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
    letter-spacing: 0;
}

.app-body {
    background:
        linear-gradient(rgba(15, 102, 232, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 166, 166, 0.035) 1px, transparent 1px),
        radial-gradient(circle at 18% 0%, rgba(0, 166, 166, 0.18), transparent 30%),
        radial-gradient(circle at 82% 0%, rgba(15, 102, 232, 0.14), transparent 28%),
        linear-gradient(180deg, #f7fafd 0%, #edf3f8 100%);
    background-size: 32px 32px, 32px 32px, auto, auto, auto;
}

.app-shell {
    background: transparent;
}

.sidebar {
    width: 268px;
    background:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(180deg, #08111f 0%, #0d1b2f 58%, #07111f 100%);
    background-size: 28px 28px, 28px 28px, auto;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 16px 0 40px rgba(16, 24, 40, 0.08);
}

.sidebar-header {
    padding: 24px 22px 18px;
}

.sidebar-logo {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: linear-gradient(135deg, #00a6a6 0%, #0f66e8 100%);
    box-shadow: 0 12px 28px rgba(15, 102, 232, 0.28);
    font-size: 13px;
}

.sidebar-title {
    font-size: 17px;
    letter-spacing: 0;
}

.sidebar-brand__text {
    color: #9fb0c5;
}

.sidebar-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 14px 18px;
    padding: 12px;
    border: 1px solid rgba(159, 176, 197, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
}

.sidebar-status__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #12b76a;
    box-shadow: 0 0 0 5px rgba(18, 183, 106, 0.14);
    flex: 0 0 auto;
}

.sidebar-status strong,
.sidebar-status span {
    display: block;
}

.sidebar-status strong {
    color: #ffffff;
    font-size: 13px;
}

.sidebar-status span {
    color: #8ea1b8;
    font-size: 12px;
    margin-top: 3px;
}

.sidebar-section-label {
    color: #6f829a;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sidebar-item {
    border-radius: 8px;
    padding: 13px 12px 13px 14px;
    border: 1px solid transparent;
    position: relative;
}

.sidebar-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: transparent;
}

.sidebar-item:hover,
.sidebar-item.is-active {
    background: rgba(15, 102, 232, 0.16);
    border-color: rgba(0, 166, 166, 0.18);
}

.sidebar-item.is-active::before {
    background: #00a6a6;
}

.sidebar-nav__label {
    font-size: 14px;
    color: #f6f9fc;
}

.sidebar-nav__meta {
    color: #8496ad;
}

.sidebar-footer {
    padding: 18px 22px 24px;
    color: #9fb0c5;
}

.sidebar-footer__title {
    color: #ffffff;
}

.admin-main {
    background: rgba(247, 250, 253, 0.72);
}

.topbar {
    margin: 18px 24px 0;
    padding: 18px 20px;
    border: 1px solid rgba(216, 225, 234, 0.88);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 12px 32px rgba(16, 24, 40, 0.06);
    backdrop-filter: blur(18px);
}

.admin-topbar__eyebrow {
    color: var(--accent);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.topbar-title {
    font-size: 22px;
    font-weight: 800;
    color: #0b1220;
}

.admin-topbar p {
    color: #5f6f82;
}

.topbar-user {
    min-height: 42px;
    padding: 7px 12px;
    border: 1px solid #d9e4ee;
    border-radius: 8px;
    background: #f8fbfd;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.topbar-user__label {
    color: #7a8ba0;
    font-size: 11px;
    line-height: 1.1;
}

.topbar-user strong {
    color: #122033;
    font-size: 13px;
    margin-top: 3px;
}

.app-content {
    padding: 22px 24px 36px;
    gap: 18px;
}

.surface-card,
.public-panel,
.result-summary__card,
.reference-card {
    border-radius: 8px;
    border: 1px solid rgba(214, 225, 236, 0.92);
    box-shadow: var(--shadow);
}

.surface-card {
    padding: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(250, 253, 255, 0.96) 100%);
}

.section-card__header {
    align-items: center;
    margin-bottom: 18px;
}

.section-card__header h2 {
    font-size: 18px;
    font-weight: 800;
    color: #111827;
}

.section-card__header p {
    color: #667085;
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.stat-card {
    border-radius: 8px;
    padding: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
    border: 1px solid rgba(214, 225, 236, 0.9);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--brand) 100%);
}

.stat-card__label {
    font-size: 12px;
    font-weight: 700;
    color: #667085;
}

.stat-card__value {
    font-size: 30px;
    color: #0b1220;
    letter-spacing: 0;
}

.stat-card__hint {
    color: #7a8ba0;
}

.quick-action {
    border-radius: 8px;
    background: #ffffff;
    border-color: #dbe5ef;
    box-shadow: 0 8px 20px rgba(16, 24, 40, 0.035);
}

.quick-action:hover {
    border-color: rgba(15, 102, 232, 0.35);
    box-shadow: 0 16px 32px rgba(15, 102, 232, 0.10);
}

.quick-action--primary {
    background: linear-gradient(135deg, #f0fbfa 0%, #f2f7ff 100%);
    border-color: rgba(0, 166, 166, 0.26);
}

.quick-action__title {
    color: #101828;
}

.button {
    min-height: 40px;
    border-radius: 8px;
    font-weight: 800;
    box-shadow: none;
}

.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(16, 24, 40, 0.08);
}

.button-primary {
    background: linear-gradient(135deg, #00a6a6 0%, #0f66e8 100%);
}

.button-secondary {
    color: #1d2939;
    background: #ffffff;
    border-color: #cdd8e3;
}

.button-ghost {
    color: #42526a;
    background: #f4f7fa;
    border-color: #dbe5ef;
}

.button-danger {
    background: linear-gradient(135deg, #b42318 0%, #d92d20 100%);
}

input,
select,
textarea,
.inline-check {
    border-radius: 8px;
    border-color: #cfd9e5;
    background: #ffffff;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(0, 166, 166, 0.72);
    box-shadow: 0 0 0 4px rgba(0, 166, 166, 0.12);
}

.field span,
.file-toolbar-tag {
    color: #344054;
}

.info-strip,
.upload-results,
.file-workbench--inline,
.detail-item {
    border-radius: 8px;
    background: #f8fbfd;
    border-color: #dbe5ef;
}

.table-card {
    padding: 22px;
}

.table-wrap {
    border: 1px solid #dbe5ef;
    border-radius: 8px;
    background: #ffffff;
}

.data-table {
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th,
.data-table td {
    border-bottom: 1px solid #edf1f5;
}

.data-table thead th {
    background: #f4f7fa;
    color: #667085;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.data-table tbody tr {
    transition: background 0.15s ease;
}

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

.table-link {
    color: var(--brand);
}

.pagination__link,
.pagination-jump input,
.status-badge {
    border-radius: 8px;
}

.pagination__link.is-active {
    background: linear-gradient(135deg, #00a6a6 0%, #0f66e8 100%);
}

.status-badge.success {
    color: #067647;
    background: #ecfdf3;
}

.status-badge.warning {
    color: #b54708;
    background: #fff7ed;
}

.status-badge.neutral {
    color: #344054;
    background: #eef2f6;
}

.bulk-action-bar {
    left: 292px;
    border-radius: 8px;
    background: rgba(7, 17, 31, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.alert {
    border-radius: 8px;
}

.app-body--reference {
    background:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        radial-gradient(circle at 18% 10%, rgba(0, 166, 166, 0.26), transparent 32%),
        radial-gradient(circle at 82% 12%, rgba(15, 102, 232, 0.24), transparent 30%),
        linear-gradient(180deg, #07111f 0%, #0d1b2f 100%);
    background-size: 34px 34px, 34px 34px, auto, auto, auto;
}

.reference-card {
    background: rgba(11, 24, 42, 0.84);
    border-color: rgba(201, 214, 229, 0.16);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(18px);
}

.reference-card__brand,
.public-hero__eyebrow {
    color: #5eead4;
}

.auth-brand__logo {
    border-radius: 8px;
    background: linear-gradient(135deg, #00a6a6 0%, #0f66e8 100%);
}

.app-body--reference .button-primary {
    background: linear-gradient(135deg, #00a6a6 0%, #0f66e8 100%);
}

.app-body--reference input,
.app-body--reference select,
.app-body--reference textarea {
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.065);
    border-color: rgba(201, 214, 229, 0.16);
}

.app-body--reference input:focus,
.app-body--reference select:focus,
.app-body--reference textarea:focus {
    border-color: rgba(94, 234, 212, 0.58);
    box-shadow: 0 0 0 4px rgba(94, 234, 212, 0.12);
}

.table-card--public {
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(201, 214, 229, 0.14);
}

.table-card--public .table-wrap {
    background: rgba(255, 255, 255, 0.035);
    border-color: rgba(201, 214, 229, 0.14);
}

.result-summary__card {
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(201, 214, 229, 0.14);
}

@media (max-width: 900px) {
    .topbar {
        margin: 0;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }

    .sidebar {
        width: 100%;
    }

    .sidebar-status {
        margin-bottom: 14px;
    }

    .bulk-action-bar {
        left: 16px;
    }
}

/* ===== Final commercial technology overrides ===== */
.app-body {
    background:
        linear-gradient(rgba(15, 102, 232, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 166, 166, 0.035) 1px, transparent 1px),
        radial-gradient(circle at 18% 0%, rgba(0, 166, 166, 0.18), transparent 30%),
        radial-gradient(circle at 82% 0%, rgba(15, 102, 232, 0.14), transparent 28%),
        linear-gradient(180deg, #f7fafd 0%, #edf3f8 100%);
    background-size: 32px 32px, 32px 32px, auto, auto, auto;
}

.sidebar {
    width: 268px;
    background:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(180deg, #08111f 0%, #0d1b2f 58%, #07111f 100%);
    background-size: 28px 28px, 28px 28px, auto;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 16px 0 40px rgba(16, 24, 40, 0.08);
}

.sidebar-logo,
.auth-brand__logo {
    border-radius: 8px;
    background: linear-gradient(135deg, #00a6a6 0%, #0f66e8 100%);
}

.sidebar-logo {
    width: 42px;
    height: 42px;
    box-shadow: 0 12px 28px rgba(15, 102, 232, 0.28);
}

.sidebar-title {
    font-size: 17px;
}

.sidebar-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 14px 18px;
    padding: 12px;
    border: 1px solid rgba(159, 176, 197, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
}

.sidebar-status__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #12b76a;
    box-shadow: 0 0 0 5px rgba(18, 183, 106, 0.14);
    flex: 0 0 auto;
}

.sidebar-status strong,
.sidebar-status span {
    display: block;
}

.sidebar-status strong {
    color: #ffffff;
    font-size: 13px;
}

.sidebar-status span {
    color: #8ea1b8;
    font-size: 12px;
    margin-top: 3px;
}

.sidebar-section-label {
    color: #6f829a;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sidebar-item {
    border-radius: 8px;
    padding: 13px 12px 13px 14px;
    position: relative;
}

.sidebar-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: transparent;
}

.sidebar-item:hover,
.sidebar-item.is-active {
    background: rgba(15, 102, 232, 0.16);
    border-color: rgba(0, 166, 166, 0.18);
}

.sidebar-item.is-active::before {
    background: #00a6a6;
}

.admin-main {
    background: rgba(247, 250, 253, 0.72);
}

.topbar {
    margin: 18px 24px 0;
    padding: 18px 20px;
    border: 1px solid rgba(216, 225, 234, 0.88);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 12px 32px rgba(16, 24, 40, 0.06);
    backdrop-filter: blur(18px);
}

.topbar-title {
    font-size: 22px;
    font-weight: 800;
    color: #0b1220;
}

.admin-topbar__eyebrow {
    color: #00a6a6;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.topbar-user {
    min-height: 42px;
    padding: 7px 12px;
    border: 1px solid #d9e4ee;
    border-radius: 8px;
    background: #f8fbfd;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.topbar-user__label {
    color: #7a8ba0;
    font-size: 11px;
    line-height: 1.1;
}

.topbar-user strong {
    color: #122033;
    font-size: 13px;
    margin-top: 3px;
}

.app-content {
    padding: 22px 24px 36px;
}

.surface-card,
.public-panel,
.result-summary__card,
.reference-card,
.stat-card,
.quick-action,
.table-wrap,
.info-strip,
.upload-results,
.file-workbench--inline,
.detail-item {
    border-radius: 8px;
}

.surface-card,
.stat-card {
    border: 1px solid rgba(214, 225, 236, 0.92);
    box-shadow: 0 18px 50px rgba(16, 24, 40, 0.08);
}

.surface-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(250, 253, 255, 0.96) 100%);
}

.stat-card {
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, #00a6a6 0%, #0f66e8 100%);
}

.stat-card__value {
    color: #0b1220;
}

.quick-action {
    background: #ffffff;
    border-color: #dbe5ef;
}

.quick-action--primary {
    background: linear-gradient(135deg, #f0fbfa 0%, #f2f7ff 100%);
    border-color: rgba(0, 166, 166, 0.26);
}

.button,
input,
select,
textarea,
.inline-check,
.pagination__link,
.pagination-jump input,
.status-badge,
.alert {
    border-radius: 8px;
}

.button {
    font-weight: 800;
}

.button-primary,
.app-body--reference .button-primary,
.pagination__link.is-active {
    background: linear-gradient(135deg, #00a6a6 0%, #0f66e8 100%);
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(0, 166, 166, 0.72);
    box-shadow: 0 0 0 4px rgba(0, 166, 166, 0.12);
}

.table-wrap {
    border: 1px solid #dbe5ef;
    background: #ffffff;
}

.data-table {
    border-collapse: separate;
    border-spacing: 0;
}

.data-table thead th {
    background: #f4f7fa;
    color: #667085;
    font-weight: 800;
}

.bulk-action-bar {
    left: 292px;
    border-radius: 8px;
    background: rgba(7, 17, 31, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.app-body--reference {
    background:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        radial-gradient(circle at 18% 10%, rgba(0, 166, 166, 0.26), transparent 32%),
        radial-gradient(circle at 82% 12%, rgba(15, 102, 232, 0.24), transparent 30%),
        linear-gradient(180deg, #07111f 0%, #0d1b2f 100%);
    background-size: 34px 34px, 34px 34px, auto, auto, auto;
}

.reference-card {
    background: rgba(11, 24, 42, 0.84);
    border-color: rgba(201, 214, 229, 0.16);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(18px);
}

.reference-card__brand {
    color: #5eead4;
}

.app-body--reference input,
.app-body--reference select,
.app-body--reference textarea {
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.065);
    border-color: rgba(201, 214, 229, 0.16);
}

.table-card--public .table-wrap,
.result-summary__card {
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(201, 214, 229, 0.14);
}

@media (max-width: 900px) {
    .topbar {
        margin: 0;
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }

    .bulk-action-bar {
        left: 16px;
    }
}

* {
    box-sizing: border-box;
}

html {
    font-size: 14px;
}

body {
    margin: 0;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    color: var(--text);
    background: var(--bg);
}

a {
    color: inherit;
    text-decoration: none;
}

.app-body {
    min-height: 100vh;
    background: linear-gradient(180deg, #f7f9fd 0%, #eef3f9 100%);
}

.app-body--public {
    background: linear-gradient(135deg, #eff4fb 0%, #f7f9fc 55%, #eef2f8 100%);
}

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

.admin-sidebar {
    width: 276px;
    padding: 28px 20px;
    background: linear-gradient(180deg, #16335f 0%, #112847 100%);
    color: #e6edf7;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-brand__badge {
    font-size: 12px;
    letter-spacing: 0.14em;
    color: #a9c2ea;
}

.sidebar-brand__title {
    font-size: 26px;
    font-weight: 700;
    color: #ffffff;
}

.sidebar-brand__text {
    line-height: 1.7;
    color: #c4d4eb;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-nav__link {
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: 0.2s ease;
}

.sidebar-nav__link:hover,
.sidebar-nav__link.is-active {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(180, 204, 237, 0.25);
    transform: translateY(-1px);
}

.sidebar-nav__label {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
}

.sidebar-nav__meta {
    color: #c4d4eb;
    font-size: 12px;
}

.sidebar-footer {
    margin-top: auto;
    padding: 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(185, 206, 236, 0.15);
}

.sidebar-footer__title {
    font-weight: 700;
    margin-bottom: 10px;
}

.sidebar-footer__list {
    margin: 0;
    padding-left: 18px;
    color: #d2deef;
    line-height: 1.8;
}

.admin-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    padding: 28px 36px 22px;
    background: rgba(255, 255, 255, 0.86);
    border-bottom: 1px solid rgba(209, 218, 232, 0.9);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.admin-topbar__eyebrow,
.public-panel__eyebrow,
.public-hero__eyebrow {
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--brand);
    font-weight: 700;
    margin-bottom: 8px;
}

.admin-topbar h1,
.public-panel h2,
.public-hero h1 {
    margin: 0;
}

.admin-topbar p,
.public-panel__header p,
.public-hero__description {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.7;
}

.admin-topbar__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
}

.content-shell {
    padding: 28px 36px 36px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.surface-card,
.public-panel,
.result-summary__card {
    background: var(--surface);
    border-radius: 20px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(214, 223, 235, 0.8);
}

.surface-card {
    padding: 24px;
}

.section-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.section-card__header h2 {
    margin: 0;
    font-size: 20px;
}

.section-card__header p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.7;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 18px;
}

.dashboard-stats {
    display: grid;
    gap: 18px;
}

.dashboard-stats__row {
    display: grid;
    gap: 18px;
}

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

.dashboard-stats__row--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-metrics {
    display: grid;
    gap: 16px;
}

.metric-panel {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: 22px;
    padding: 22px;
    background: #ffffff;
    border: 1px solid #dfe7f1;
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.045);
}

.metric-panel__summary {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
}

.metric-panel__eyebrow {
    width: fit-content;
    padding: 5px 10px;
    border-radius: 999px;
    background: #eef6ff;
    color: #175cd3;
    font-size: 12px;
    font-weight: 800;
}

.metric-panel__headline {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.metric-panel__headline strong {
    color: #0f172a;
    font-size: 42px;
    line-height: 1;
    letter-spacing: 0;
}

.metric-panel__headline span {
    color: #64748b;
    font-size: 14px;
    font-weight: 700;
}

.metric-panel__summary p {
    margin: 0;
    color: #64748b;
    line-height: 1.6;
}

.metric-panel__body {
    display: grid;
    align-content: center;
    gap: 12px;
}

.metric-panel__body--pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    min-height: 46px;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f8fafc;
}

.metric-row span {
    color: #475569;
    font-size: 13px;
    font-weight: 700;
}

.metric-row strong {
    color: #111827;
    font-size: 18px;
    font-weight: 800;
    text-align: right;
}

.metric-progress {
    padding-top: 4px;
}

.metric-progress__track {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #e5e7eb;
}

.metric-progress__fill {
    display: block;
    min-width: 0;
    max-width: 100%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #0f66e8 0%, #06a6a6 100%);
}

.metric-progress--success .metric-progress__fill {
    background: linear-gradient(90deg, #16a34a 0%, #0f66e8 100%);
}

.metric-progress__caption {
    margin-top: 8px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.stats-grid--compact {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.stat-card {
    padding: 22px;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f6f9fd 100%);
    border: 1px solid rgba(210, 221, 236, 0.95);
    box-shadow: 0 10px 28px rgba(31, 79, 145, 0.05);
}

.stat-card__label {
    color: var(--muted);
    margin-bottom: 12px;
}

.stat-card__value {
    font-size: 32px;
    font-weight: 800;
    color: var(--brand-dark);
}

.stat-card__value--small {
    font-size: 20px;
    line-height: 1.4;
    word-break: break-word;
}

.stat-card__hint {
    margin-top: 10px;
    color: #7a8aa0;
    line-height: 1.6;
}

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

.bullet-list {
    margin: 0;
    padding-left: 18px;
    line-height: 1.9;
    color: #334155;
}

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

.quick-action {
    padding: 18px;
    border-radius: 18px;
    border: 1px solid rgba(209, 219, 232, 0.95);
    background: var(--surface-soft);
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: 0.2s ease;
}

.quick-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(31, 79, 145, 0.09);
}

.quick-action--primary {
    background: linear-gradient(135deg, #eff5ff 0%, #ffffff 100%);
    border-color: rgba(138, 169, 219, 0.6);
}

.quick-action__title {
    font-size: 16px;
    font-weight: 700;
}

.quick-action__desc {
    color: var(--muted);
    line-height: 1.7;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    transition: 0.2s ease;
}

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

.button-primary {
    color: #ffffff;
    background: linear-gradient(135deg, var(--brand) 0%, #275da9 100%);
}

.button-secondary {
    color: var(--brand);
    background: #ffffff;
    border-color: rgba(161, 181, 210, 0.9);
}

.button-ghost {
    color: #42556f;
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(203, 213, 226, 0.9);
}

.button-danger {
    color: #ffffff;
    background: linear-gradient(135deg, #b33a3a 0%, #d14c4c 100%);
}

.button-small {
    min-height: 34px;
    padding: 0 12px;
    font-size: 12px;
}

.copy-button.is-copied {
    border-color: rgba(24, 131, 77, 0.28);
    color: var(--success);
    background: var(--success-soft);
}

.button-block {
    width: 100%;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-bar,
.form-grid,
.stack-form,
.action-row {
    display: flex;
    gap: 16px;
}

.filter-bar {
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-bar__actions {
    display: flex;
    align-items: flex-end;
}

.stack-form {
    flex-direction: column;
}

.form-grid {
    flex-wrap: wrap;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 180px;
    flex: 1 1 220px;
}

.field--grow {
    flex: 2 1 320px;
}

.field--full {
    flex-basis: 100%;
}

.field--inline {
    min-width: 220px;
    flex: 0 1 220px;
}

.field span {
    font-weight: 700;
    color: #344256;
}

.inline-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #ffffff;
}

.inline-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--text);
    font: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(31, 79, 145, 0.55);
    box-shadow: 0 0 0 4px rgba(31, 79, 145, 0.12);
}

input[type="file"] {
    padding: 9px 12px;
}

.info-strip {
    padding: 14px 16px;
    border-radius: 14px;
    background: #f6f9fd;
    border: 1px solid rgba(211, 221, 235, 0.9);
    color: #405166;
    line-height: 1.7;
}

.action-row {
    justify-content: flex-end;
    flex-wrap: wrap;
}

.upload-results {
    margin-top: 16px;
    padding: 16px;
    border-radius: 16px;
    background: #f9fbff;
    border: 1px solid rgba(215, 223, 236, 0.9);
}

.upload-results__title {
    font-weight: 700;
    margin-bottom: 12px;
}

.upload-results__list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.upload-results__list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.upload-results__summary {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.upload-results__failures {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.upload-results__failure-title {
    margin-bottom: 8px;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
}

.upload-results__reason-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.upload-results__reason-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid #f1d4d4;
    border-radius: 8px;
    background: #fff8f8;
    color: #7f1d1d;
    font-size: 12px;
    line-height: 1.45;
}

.upload-results__reason-list span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.upload-results__reason-list strong {
    flex: 0 0 auto;
    color: #991b1b;
}

.file-workbench {
    margin-bottom: 20px;
}

.file-workbench--inline {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    background: linear-gradient(180deg, #fbfdff 0%, #f8fafc 100%);
}

.file-toolbar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0;
}

.file-workbench__filters {
    flex: 1 1 720px;
}

.file-workbench__upload-inline {
    flex: 0 1 380px;
    justify-content: flex-end;
}

.file-workbench__danger {
    flex: 0 0 auto;
    margin-left: auto;
}

.file-toolbar-tag {
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    white-space: nowrap;
}

.file-toolbar-field,
.file-toolbar-file {
    display: flex;
    align-items: center;
    margin: 0;
}

.file-toolbar-field {
    flex: 1 1 180px;
    min-width: 140px;
}

.file-toolbar-field--wide {
    flex-basis: 220px;
}

.file-toolbar-field--status {
    flex: 0 1 140px;
    min-width: 120px;
}

.file-toolbar-field input,
.file-toolbar-field select,
.file-toolbar-file input[type="file"] {
    min-height: 40px;
}

.file-toolbar-file {
    flex: 1 1 220px;
    min-width: 180px;
}

.file-toolbar-file input[type="file"] {
    width: 100%;
    padding: 8px 10px;
}

.file-toolbar-row .button {
    min-height: 40px;
    white-space: nowrap;
}

.upload-results--embedded {
    margin-top: 14px;
    margin-bottom: 0;
    flex-basis: 100%;
}

.table-card {
    padding: 24px;
}

.table-wrap {
    overflow-x: auto;
    scrollbar-gutter: stable both-edges;
}

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

.data-table th,
.data-table td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid #e8eef6;
    vertical-align: middle;
}

.data-table thead th {
    color: #56657b;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: #f8fbff;
}

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

.table-link {
    color: var(--brand);
    font-weight: 700;
}

.data-table--files {
    min-width: 1060px;
}

.select-cell {
    width: 52px;
    text-align: center;
}

.select-cell input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.table-empty {
    text-align: center;
    color: var(--muted);
    padding: 24px 12px;
}

.pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.pagination-bar__summary {
    color: var(--muted);
    font-size: 13px;
}

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

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

.pagination-jump label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.pagination-jump input {
    width: 76px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid #dbe3ee;
    border-radius: 10px;
    font: inherit;
}

.pagination__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid #dbe3ee;
    background: #ffffff;
    color: #334155;
    font-weight: 700;
}

.pagination__link.is-active {
    background: linear-gradient(135deg, var(--brand) 0%, #275da9 100%);
    border-color: transparent;
    color: #ffffff;
}

.pagination__link.is-disabled {
    background: #f8fafc;
    color: #94a3b8;
    cursor: not-allowed;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid transparent;
}

.status-badge.success {
    color: var(--success);
    background: var(--success-soft);
    border-color: rgba(24, 131, 77, 0.15);
}

.status-badge.warning {
    color: var(--warning);
    background: var(--warning-soft);
    border-color: rgba(183, 121, 31, 0.18);
}

.status-badge.error {
    color: var(--error);
    background: var(--error-soft);
    border-color: rgba(179, 58, 58, 0.15);
}

.status-badge.neutral {
    color: #556479;
    background: #f0f4f8;
    border-color: rgba(156, 170, 189, 0.2);
}

.bulk-action-bar {
    position: fixed;
    left: 272px;
    right: 32px;
    bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.94);
    color: #f8fafc;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.22);
    z-index: 40;
}

.bulk-action-bar.is-hidden {
    display: none;
}

.bulk-action-bar__summary {
    font-size: 14px;
    color: #cbd5e1;
}

.bulk-action-bar__summary strong {
    color: #ffffff;
    font-size: 18px;
}

.bulk-action-bar__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bulk-action-bar .button[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

.detail-card {
    padding: 28px;
}

.detail-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.detail-card__header h2 {
    margin: 0;
    font-size: 18px;
}

.detail-card__header p {
    margin: 6px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.detail-grid,
.result-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.detail-item {
    padding: 18px;
    border-radius: 16px;
    background: #f8fbff;
    border: 1px solid rgba(216, 225, 236, 0.95);
}

.detail-item--full {
    grid-column: 1 / -1;
}

.detail-item__label,
.result-summary__label {
    display: block;
    color: var(--muted);
    margin-bottom: 10px;
}

.detail-item__value,
.result-summary__value {
    font-size: 18px;
    line-height: 1.5;
}

.public-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(420px, 560px);
}

.public-shell--result {
    grid-template-columns: minmax(320px, 420px) minmax(520px, 1fr);
}

.public-hero {
    padding: 56px 48px;
    background: linear-gradient(160deg, #173764 0%, #1f4f91 55%, #2667b4 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
}

.public-hero__badge {
    display: inline-flex;
    width: fit-content;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #dbe8fb;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 700;
}

.public-hero__eyebrow {
    color: #c9daf4;
    margin: 0;
}

.public-hero__description {
    color: #e7effb;
    max-width: 520px;
}

.public-hero__highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-top: 10px;
}

.highlight-card {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.14);
    display: flex;
    flex-direction: column;
    gap: 8px;
    line-height: 1.7;
}

.public-panel-wrap {
    padding: 40px 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.public-panel {
    width: min(100%, 520px);
    padding: 32px;
}

.public-panel--wide {
    width: min(100%, 860px);
}

.public-panel__header {
    margin-bottom: 22px;
}

.result-summary {
    margin-bottom: 20px;
}

.result-summary__card {
    padding: 20px;
}

.alert-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.alert {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid transparent;
    line-height: 1.6;
}

.alert.error {
    color: var(--error);
    background: var(--error-soft);
    border-color: rgba(179, 58, 58, 0.12);
}

.alert.success {
    color: var(--success);
    background: var(--success-soft);
    border-color: rgba(24, 131, 77, 0.12);
}

.alert.warning {
    color: #92400e;
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
}

@media (max-width: 1180px) {
    .admin-topbar {
        flex-direction: column;
    }

    .panel-grid,
    .public-shell,
    .public-shell--result {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .admin-shell {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
    }

    .file-workbench--inline {
        align-items: stretch;
    }

    .file-workbench__filters,
    .file-workbench__upload-inline,
    .file-workbench__danger,
    .file-workbench__actions {
        flex-basis: 100%;
        justify-content: flex-start;
        margin-left: 0;
    }

    .content-shell,
    .admin-topbar,
    .public-panel-wrap,
    .public-hero {
        padding: 24px 20px;
    }
}

@media (max-width: 640px) {
    .stats-grid,
    .dashboard-stats__row,
    .detail-grid,
    .result-summary,
    .quick-actions {
        grid-template-columns: 1fr;
    }

    .data-table {
        min-width: 620px;
    }

    .admin-topbar__actions,
    .action-row,
    .filter-bar {
        width: 100%;
        justify-content: stretch;
    }

    .file-toolbar-row {
        width: 100%;
    }

    .file-toolbar-field,
    .file-toolbar-file {
        flex-basis: 100%;
    }

    .admin-topbar__actions .button,
    .admin-topbar__actions form,
    .admin-topbar__actions form .button,
    .action-row .button,
    .filter-bar__actions,
    .filter-bar__actions .button,
    .file-toolbar-row .button {
        width: 100%;
    }
}

/* ===== Reference-inspired UI overrides ===== */
.app-shell {
    min-height: 100vh;
    background: #f8fafc;
}

.sidebar {
    width: 240px;
    padding: 0;
    background: #0f172a;
    color: #cbd5e1;
    gap: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px 20px;
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
}

.sidebar-header__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-title {
    color: #f8fafc;
    font-size: 16px;
    font-weight: 700;
}

.sidebar-brand__text {
    color: #94a3b8;
    font-size: 12px;
    line-height: 1.5;
}

.sidebar-nav {
    gap: 6px;
    padding: 0 12px;
}

.sidebar-section-label {
    padding: 8px 8px 6px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.sidebar-item {
    border: 0;
    border-radius: 12px;
    background: transparent;
    padding: 11px 12px;
    gap: 2px;
}

.sidebar-item:hover,
.sidebar-item.is-active {
    background: rgba(59, 130, 246, 0.14);
    border-color: transparent;
    transform: none;
}

.sidebar-nav__label {
    font-size: 14px;
}

.sidebar-nav__meta {
    color: #64748b;
}

.sidebar-footer {
    margin-top: auto;
    background: transparent;
    border: 0;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 0;
    padding: 18px 20px 24px;
}

.topbar {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: none;
    backdrop-filter: none;
    align-items: center;
}

.admin-topbar__eyebrow {
    color: #94a3b8;
    letter-spacing: 0;
    text-transform: none;
    font-size: 12px;
    margin-bottom: 4px;
}

.topbar-title {
    font-size: 16px;
    font-weight: 600;
}

.admin-topbar p {
    margin-top: 6px;
    font-size: 13px;
}

.app-content {
    gap: 18px;
}

.surface-card,
.stat-card {
    border-radius: 18px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.stat-card {
    background: #ffffff;
    padding: 20px;
}

.stat-card__value {
    font-size: 28px;
    color: #0f172a;
}

.section-card__header h2 {
    font-size: 18px;
}

.table-card,
.section-card {
    background: #ffffff;
}

.data-table thead th {
    background: #f8fafc;
    color: #64748b;
}

.button-secondary {
    border-color: #d1d5db;
    color: #334155;
}

.button-ghost {
    background: #f8fafc;
}

.app-body--reference {
    background:
        radial-gradient(circle at top, rgba(99, 102, 241, 0.12), transparent 28%),
        linear-gradient(180deg, #020617 0%, #0f172a 100%);
}

.reference-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}

.reference-card {
    width: min(100%, 460px);
    background: #111827;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.38);
    padding: 28px;
    color: #e2e8f0;
}

.reference-card h1,
.reference-card h2 {
    margin: 0;
    color: #f8fafc;
}

.reference-card__header {
    margin-bottom: 22px;
}

.reference-card__header--center {
    text-align: center;
}

.reference-card__brand {
    margin-bottom: 10px;
    color: #a5b4fc;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
}

.reference-card__header p {
    margin: 8px 0 0;
    color: #94a3b8;
    line-height: 1.7;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.auth-brand__logo {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    color: #ffffff;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.auth-brand__text h1 {
    font-size: 18px;
}

.auth-brand__text p {
    margin: 4px 0 0;
    color: #94a3b8;
}

.field--compact {
    gap: 6px;
}

.field--compact span {
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 600;
}

.app-body--reference input,
.app-body--reference select,
.app-body--reference textarea {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    min-height: 45px;
    border-radius: 10px;
}

.app-body--reference input::placeholder,
.app-body--reference textarea::placeholder {
    color: #64748b;
}

.app-body--reference input:focus,
.app-body--reference select:focus,
.app-body--reference textarea:focus {
    border-color: rgba(99, 102, 241, 0.45);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16);
}

.segment-switch {
    display: inline-flex;
    gap: 8px;
    margin-bottom: 18px;
    padding: 4px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
}

.segment-switch__item {
    min-height: 36px;
    padding: 0 14px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #94a3b8;
    font: inherit;
    cursor: default;
}

.segment-switch__item.is-active {
    background: rgba(99, 102, 241, 0.16);
    color: #ffffff;
}

.segment-switch__item[disabled] {
    opacity: 1;
}

.app-body--reference .button-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #2563eb 100%);
}

.button-link {
    min-height: auto;
    padding: 10px 0 0;
    border: 0;
    background: transparent;
    color: #a5b4fc;
    font-weight: 500;
}

.button-link[disabled] {
    color: #94a3b8;
    opacity: 0.9;
}

.extract-card .button-link {
    padding-top: 2px;
}

.result-card {
    width: min(100%, 980px);
}

.table-card--public {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}

.table-card--public .section-card__header h2,
.table-card--public .section-card__header p,
.table-card--public .data-table td,
.table-card--public .data-table th {
    color: #e2e8f0;
}

.table-card--public .data-table thead th {
    background: rgba(255, 255, 255, 0.04);
    color: #94a3b8;
}

.table-card--public .data-table td {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.table-card--public .table-link {
    color: #a5b4fc;
}

.table-card--public .table-empty {
    color: #94a3b8;
}

.app-body--reference .alert {
    border-color: transparent;
}

.app-body--reference .alert.warning {
    color: #facc15;
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.45);
}

@media (max-width: 900px) {
    .reference-card,
    .result-card {
        width: 100%;
    }

    .detail-card__header {
        flex-direction: column;
        align-items: stretch;
    }

    .sidebar {
        width: 100%;
    }

    .bulk-action-bar {
        left: 16px;
        right: 16px;
        bottom: 16px;
        flex-direction: column;
        align-items: stretch;
    }

    .bulk-action-bar__actions {
        width: 100%;
        flex-direction: column;
    }
}

/* Final admin alignment pass */
.admin-shell .admin-topbar {
    align-items: center;
    padding: 22px 32px;
    gap: 20px;
}

.admin-topbar__intro {
    min-width: 0;
}

.admin-topbar__actions {
    flex: 0 0 auto;
    align-items: center;
    margin-left: auto;
}

.admin-topbar__actions form {
    margin: 0;
}

.topbar-logout {
    min-width: 96px;
}

.content-shell {
    gap: 22px;
}

.surface-card,
.table-card,
.section-card {
    border-radius: 12px;
}

.section-card__header {
    align-items: flex-start;
    margin-bottom: 18px;
}

.section-card__header > div {
    min-width: 0;
}

.section-card__header h2 {
    line-height: 1.35;
}

.section-card__header p {
    max-width: 760px;
}

.button,
input,
select,
textarea,
.inline-check,
.status-badge,
.pagination__link,
.pagination-jump input {
    border-radius: 8px;
}

.button {
    min-height: 40px;
    white-space: nowrap;
}

.button-small {
    min-height: 32px;
    padding: 0 10px;
}

.form-grid {
    align-items: flex-end;
}

.field {
    min-width: 210px;
}

.field--inline {
    justify-content: flex-end;
}

.table-wrap {
    border: 1px solid #e8eef6;
    border-radius: 10px;
    background: #ffffff;
}

.data-table {
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th,
.data-table td {
    line-height: 1.5;
}

.data-table td:last-child,
.data-table th:last-child {
    min-width: 220px;
}

.table-actions,
.user-row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.user-row-actions {
    flex-direction: column;
    align-items: flex-start;
    min-width: 280px;
}

.password-inline-form {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) max-content;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 360px;
    margin: 0;
}

.password-inline-form input {
    min-height: 32px;
    padding: 6px 10px;
}

.file-workbench--inline {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.1fr) max-content;
    align-items: stretch;
    gap: 12px;
    padding: 16px;
}

.data-table--files {
    min-width: 1180px;
}

.file-toolbar-row {
    min-width: 0;
}

.file-workbench__filters {
    display: grid;
    grid-template-columns: max-content minmax(160px, 1fr) minmax(130px, 160px) max-content;
    align-items: center;
    flex: initial;
}

.file-workbench__danger,
.file-workbench__actions {
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    flex: initial;
    margin-left: 0;
}

.file-workbench__actions {
    flex-direction: column;
    gap: 10px;
}

.file-workbench__actions form {
    margin: 0;
}

.file-workbench__danger .button,
.file-workbench__actions .button {
    height: 100%;
    width: 100%;
}

.file-upload-panel {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 10px;
    min-width: 0;
    padding: 12px;
    border: 1px solid #dbe5ef;
    border-radius: 10px;
    background: #ffffff;
}

.file-upload-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.file-upload-panel__hint {
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
    text-align: right;
}

.file-upload-panel__body {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) max-content;
    gap: 10px;
    align-items: stretch;
}

.upload-picker {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-height: 58px;
    padding: 10px 12px;
    border: 1px dashed #9fb1c8;
    border-radius: 8px;
    background: #f8fbff;
    cursor: pointer;
}

.upload-picker:hover,
.upload-picker:focus-within {
    border-color: #2563eb;
    background: #eef6ff;
}

.upload-picker input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-picker__title {
    color: #0f172a;
    font-size: 13px;
    font-weight: 700;
}

.upload-picker__meta {
    color: #64748b;
    font-size: 12px;
    line-height: 1.4;
}

.upload-results--embedded {
    grid-column: 1 / -1;
    margin-top: 0;
}

.upload-progress {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #c7d7eb;
    border-radius: 8px;
    background: #f8fbff;
}

.upload-progress.is-hidden {
    display: none;
}

.upload-progress__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
}

.upload-progress__track {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #dbe7f5;
}

.upload-progress__fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(135deg, #0f766e 0%, #2563eb 100%);
    transition: width 0.18s ease;
}

.upload-progress.is-error {
    border-color: #fecaca;
    background: #fff5f5;
}

.upload-progress.is-error .upload-progress__fill {
    background: #dc2626;
}

.pagination-bar {
    align-items: flex-start;
}

.pagination {
    justify-content: center;
}

.pagination-jump {
    flex: 0 0 auto;
}

.capacity-panel {
    display: grid;
    grid-template-columns: minmax(220px, 0.8fr) minmax(260px, 1.2fr);
    gap: 14px;
    align-items: stretch;
    padding: 16px;
    border: 1px solid #dbe5ef;
    border-radius: 10px;
    background: linear-gradient(135deg, #f8fbff 0%, #eef7ff 100%);
}

.capacity-panel__primary,
.capacity-panel__meta {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.capacity-panel__primary {
    gap: 6px;
}

.capacity-panel__primary span,
.capacity-panel__meta span {
    color: #64748b;
    font-size: 13px;
}

.capacity-panel__primary strong {
    color: #0f172a;
    font-size: 28px;
    line-height: 1.2;
}

.capacity-panel__meta {
    gap: 8px;
}

@media (max-width: 1280px) {
    .file-workbench--inline {
        grid-template-columns: 1fr;
    }

    .file-workbench__filters,
    .file-workbench__danger,
    .file-workbench__actions {
        justify-content: stretch;
    }

    .file-workbench__danger .button,
    .file-workbench__actions .button {
        width: 100%;
    }
}

@media (max-width: 900px) {
    .dashboard-stats__row,
    .dashboard-stats__row--three,
    .dashboard-stats__row--two {
        grid-template-columns: 1fr;
    }

    .metric-panel,
    .metric-panel__body--pair {
        grid-template-columns: 1fr;
    }

    .admin-shell .admin-topbar {
        align-items: stretch;
        padding: 20px;
    }

    .admin-topbar__actions,
    .admin-topbar__actions form,
    .topbar-logout {
        width: 100%;
    }

    .file-workbench__filters,
    .file-upload-panel__body,
    .password-inline-form {
        grid-template-columns: 1fr;
    }

    .file-upload-panel__header {
        align-items: flex-start;
        flex-direction: column;
    }

    .file-upload-panel__hint {
        text-align: left;
    }

    .pagination-bar,
    .pagination-jump,
    .capacity-panel {
        width: 100%;
    }

    .capacity-panel {
        grid-template-columns: 1fr;
    }
}
