:root {
    --bg-0: #05070b;
    --bg-1: #0b111b;
    --bg-2: #101722;
    --bg-3: #161f2d;
    --panel: rgba(15, 23, 34, 0.86);
    --panel-strong: rgba(19, 28, 41, 0.96);
    --panel-border: rgba(124, 144, 172, 0.18);
    --panel-highlight: rgba(255, 255, 255, 0.06);
    --text-strong: #f3f6fb;
    --text-main: #d4deea;
    --text-soft: #8b9ab0;
    --text-faint: #6d798b;
    --accent-orange: #ff8f3d;
    --accent-orange-soft: rgba(255, 143, 61, 0.18);
    --accent-green: #73bf69;
    --accent-blue: #4ea1ff;
    --accent-red: #f26d6d;
    --accent-yellow: #f2cc60;
    --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 18px 40px rgba(0, 0, 0, 0.28);
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 14px;
}

* {
    box-sizing: border-box;
}

body.admin-body {
    min-height: 100vh;
    margin: 0;
    font-family: "IBM Plex Sans", sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(circle at top left, rgba(255, 143, 61, 0.16), transparent 28%),
        radial-gradient(circle at top right, rgba(78, 161, 255, 0.12), transparent 24%),
        linear-gradient(180deg, #06090f 0%, #090d14 32%, #05070b 100%);
}

code,
pre,
.font-monospace {
    font-family: "IBM Plex Mono", monospace !important;
}

a {
    color: #8cc4ff;
    text-decoration: none;
}

a:hover {
    color: #bddcff;
}

.admin-shell,
.auth-shell {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.admin-shell-glow,
.auth-shell-glow {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 0%, rgba(255, 143, 61, 0.18), transparent 22%),
        radial-gradient(circle at 88% 16%, rgba(78, 161, 255, 0.16), transparent 20%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.03), transparent 40%);
    pointer-events: none;
}

.floating-flash {
    position: fixed;
    top: 1.2rem;
    right: 1.2rem;
    z-index: 1040;
    width: min(22rem, calc(100vw - 2.4rem));
    max-width: min(22rem, calc(100vw - 2.4rem));
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(16, 23, 34, 0.92);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow-md);
    padding: 0.7rem 0.95rem;
    font-size: 0.92rem;
    line-height: 1.35;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

.admin-shell {
    display: block;
}

.admin-header-nav {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.3rem;
    border-bottom: 1px solid var(--panel-border);
    background:
        linear-gradient(180deg, rgba(10, 15, 23, 0.96), rgba(7, 10, 15, 0.96)),
        rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(18px);
}

.brand-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-strong);
    letter-spacing: 0.02em;
}

.brand-subtitle,
.sidebar-section-label,
.admin-nav-caption,
.metric-note,
.panel-kicker,
.eyebrow,
.table-note,
.page-subtitle,
.summary-label {
    color: var(--text-soft);
}

.sidebar-section-label {
    padding: 0 0.8rem;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.admin-nav {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.admin-nav-top {
    flex: 1;
}

.admin-nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.55rem 0.85rem;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    transition: 180ms ease;
}

.admin-nav-link:hover {
    border-color: rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.04);
}

.admin-nav-link.is-active {
    border-color: rgba(255, 143, 61, 0.22);
    background:
        linear-gradient(180deg, rgba(255, 143, 61, 0.16), rgba(255, 143, 61, 0.04)),
        rgba(255, 255, 255, 0.03);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.admin-nav-title {
    display: inline-block;
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--text-strong);
}

.admin-workspace {
    position: relative;
    z-index: 1;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.admin-topbar {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    align-items: flex-start;
    padding: 1.75rem 1.9rem 1.2rem;
}

.page-kicker,
.topbar-chip,
.status-pill,
.metric-label,
.panel-label {
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.page-kicker {
    margin-bottom: 0.55rem;
    color: #ffb580;
}

.page-title {
    margin: 0;
    color: var(--text-strong);
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    line-height: 1.04;
    font-weight: 700;
}

.page-subtitle {
    margin-top: 0.8rem;
    max-width: 64rem;
    font-size: 0.98rem;
    line-height: 1.7;
}

.topbar-rail {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.9rem;
}

.topbar-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
}

.topbar-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.65rem;
}

.topbar-chip {
    padding: 0.55rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-soft);
}

.admin-main {
    padding: 0 1.9rem 2rem;
    max-width: 100%;
    overflow-x: clip;
}

.hero-panel,
.panel-card,
.metric-card,
.surface-card,
.auth-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)),
        var(--panel);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(22px);
}

.hero-panel::before,
.panel-card::before,
.metric-card::before,
.surface-card::before,
.auth-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03), transparent 36%);
    pointer-events: none;
}

.hero-panel {
    margin-bottom: 1.35rem;
    padding: 1.5rem;
}

.hero-grid,
.metric-grid,
.summary-grid,
.dashboard-grid {
    display: grid;
    gap: 1rem;
}

.hero-grid {
    grid-template-columns: minmax(0, 1.8fr) minmax(16rem, 1fr);
    align-items: stretch;
}

.hero-copy h2,
.panel-title,
.metric-value,
.summary-value,
.auth-title {
    color: var(--text-strong);
}

.hero-copy h2 {
    margin: 0 0 0.85rem;
    font-size: clamp(1.35rem, 2vw, 2rem);
    line-height: 1.15;
}

.hero-copy p {
    margin: 0;
    max-width: 42rem;
    color: var(--text-soft);
    line-height: 1.72;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.summary-tile,
.metric-card {
    padding: 1.15rem 1.2rem;
}

.summary-tile {
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
}

.summary-label,
.metric-label {
    margin-bottom: 0.6rem;
    color: var(--text-faint);
}

.summary-value,
.metric-value {
    font-size: clamp(1.35rem, 2.2vw, 2rem);
    line-height: 1.1;
    font-weight: 700;
}

.summary-meta,
.metric-note {
    margin-top: 0.45rem;
    font-size: 0.88rem;
    line-height: 1.55;
}

.metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 1.35rem;
}

.metric-value code,
.summary-value code {
    color: inherit;
}

.metric-card.is-highlight {
    border-color: rgba(255, 143, 61, 0.2);
    box-shadow: 0 24px 60px rgba(255, 143, 61, 0.12);
}

.dashboard-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    margin-bottom: 1.35rem;
}

.dashboard-grid > * {
    min-width: 0;
}

.span-4 {
    grid-column: span 4;
}

.span-5 {
    grid-column: span 5;
}

.span-6 {
    grid-column: span 6;
}

.span-7 {
    grid-column: span 7;
}

.span-8 {
    grid-column: span 8;
}

.span-12 {
    grid-column: 1 / -1;
}

.panel-card {
    padding: 1.25rem 1.3rem;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.panel-label {
    margin-bottom: 0.45rem;
    color: #ffb580;
}

.panel-title {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 600;
}

.panel-kicker {
    margin: 0.35rem 0 0;
    font-size: 0.9rem;
    line-height: 1.6;
}

.panel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.kv-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem 1rem;
}

.kv-grid-single-column {
    grid-template-columns: 1fr;
}

.kv-item {
    padding: 0.95rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
}

.kv-key {
    margin-bottom: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.kv-value {
    color: var(--text-main);
    line-height: 1.55;
}

.chart-panel {
    min-height: 22rem;
}

.chart-wrap {
    position: relative;
    height: 290px;
}

.chart-wrap.chart-wrap-sm {
    height: 240px;
}

.json-console,
.code-console {
    padding: 1rem 1.05rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 18px;
    background: rgba(2, 6, 13, 0.88);
    color: #a9bad4;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.json-console {
    min-height: 18rem;
    max-height: 24rem;
    overflow: auto;
}

.code-console {
    white-space: pre-wrap;
}

.surface-card {
    padding: 1.2rem 1.3rem;
    margin-bottom: 1.35rem;
}

.surface-card:last-child {
    margin-bottom: 0;
}

.table-shell {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.02);
}

.table-shell.table-shell-scroll {
    max-width: 100%;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.surface-card > .table-shell-scroll {
    max-width: 100%;
}

.admin-table-coverage {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.admin-table-coverage th,
.admin-table-coverage td {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.admin-table-coverage thead th {
    font-size: 0.68rem;
    padding: 0.62rem 0.65rem;
}

.admin-table-coverage tbody td {
    font-size: 0.78rem;
    padding: 0.62rem 0.65rem;
}

.admin-table-coverage .btn {
    font-size: 0.72rem;
    padding: 0.28rem 0.5rem;
}

.admin-table-binlog-inventory {
    min-width: 960px;
}

.admin-table {
    margin-bottom: 0;
    color: var(--text-main);
    --bs-table-bg: transparent;
    --bs-table-border-color: rgba(255, 255, 255, 0.06);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.02);
    --bs-table-hover-bg: rgba(78, 161, 255, 0.06);
}

.admin-table thead th {
    padding: 0.95rem 1rem;
    border-bottom-width: 1px;
    font-size: 0.76rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-faint);
    background: rgba(255, 255, 255, 0.03);
}

.admin-table tbody td {
    padding: 0.95rem 1rem;
    vertical-align: middle;
}

.admin-table-compact thead th {
    padding: 0.78rem 0.9rem;
    font-size: 0.72rem;
}

.admin-table-compact tbody td {
    padding: 0.78rem 0.9rem;
}

.admin-table-cadence {
    min-width: 860px;
}

.admin-table-cadence .cell-code code {
    display: inline-block;
    max-width: 18rem;
    overflow-wrap: anywhere;
}

.cell-stack {
    display: grid;
    gap: 0.28rem;
}

.cell-main {
    color: var(--text-strong);
    font-weight: 600;
    line-height: 1.3;
}

.cell-sub {
    color: var(--text-soft);
    font-size: 0.82rem;
    line-height: 1.35;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 6.8rem;
    padding: 0.48rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
}

.status-pill.is-success {
    color: #c8f5bc;
    background: rgba(115, 191, 105, 0.14);
    border-color: rgba(115, 191, 105, 0.28);
}

.status-pill.is-failed {
    color: #ffc0c0;
    background: rgba(242, 109, 109, 0.14);
    border-color: rgba(242, 109, 109, 0.28);
}

.status-pill.is-running,
.status-pill.is-warning {
    color: #ffe4a1;
    background: rgba(242, 204, 96, 0.14);
    border-color: rgba(242, 204, 96, 0.28);
}

.status-pill.is-neutral {
    color: var(--text-soft);
}

.status-pill-compact {
    min-width: 0;
    padding: 0.3rem 0.55rem;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
}

.btn {
    border-radius: 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.btn-primary {
    --bs-btn-bg: linear-gradient(135deg, #ff9447, #f06a2e);
    --bs-btn-border-color: rgba(255, 143, 61, 0.65);
    --bs-btn-color: #fff8f2;
    --bs-btn-hover-border-color: rgba(255, 143, 61, 0.78);
    --bs-btn-hover-color: #fff;
    --bs-btn-active-border-color: rgba(255, 143, 61, 0.9);
    background-image: linear-gradient(135deg, #ff9447, #f06a2e);
    box-shadow: 0 12px 30px rgba(255, 143, 61, 0.24);
}

.btn-outline-light,
.btn-outline-secondary,
.btn-outline-primary {
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
}

.btn-outline-light:hover,
.btn-outline-secondary:hover,
.btn-outline-primary:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-strong);
    border-color: rgba(255, 255, 255, 0.18);
}

.pagination-dark {
    gap: 0.45rem;
}

.pagination-dark .page-link {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    padding: 0.48rem 0.8rem;
    min-width: 2.6rem;
    text-align: center;
}

.pagination-dark .page-link:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
    color: var(--text-strong);
}

.pagination-dark .page-item.active .page-link {
    background: linear-gradient(135deg, rgba(255, 143, 61, 0.22), rgba(240, 106, 46, 0.24));
    border-color: rgba(255, 143, 61, 0.38);
    color: #fff4ec;
    box-shadow: 0 10px 24px rgba(255, 143, 61, 0.16);
}

.pagination-dark .page-item.disabled .page-link {
    opacity: 0.42;
    pointer-events: none;
}

.form-control,
.form-select,
.form-check-input {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    border-radius: 14px;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    color: var(--text-strong);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 143, 61, 0.45);
    box-shadow: 0 0 0 0.25rem rgba(255, 143, 61, 0.14);
}

.form-label,
.form-check-label {
    color: var(--text-main);
    font-weight: 500;
}

.alert {
    border-radius: 18px;
    border-width: 1px;
    box-shadow: var(--shadow-md);
}

.alert-info,
.alert-secondary,
.alert-warning,
.alert-danger {
    background: rgba(15, 23, 34, 0.92);
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.08);
}

.details-stack {
    display: grid;
    gap: 0.9rem;
}

.details-stack details {
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

.details-stack summary {
    padding: 1rem 1.15rem;
    cursor: pointer;
    list-style: none;
}

.details-stack summary::-webkit-details-marker {
    display: none;
}

.details-stack details[open] summary {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.details-body {
    padding: 0;
}

.stack-list,
.pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-soft);
}

.empty-state {
    padding: 1.2rem;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    color: var(--text-soft);
    text-align: center;
}

.form-shell {
    max-width: 42rem;
}

.auth-shell {
    display: grid;
    place-items: center;
    padding: 2rem;
}

.auth-main {
    position: relative;
    z-index: 1;
    width: min(1080px, 100%);
}

.auth-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 440px);
    gap: 1.5rem;
    align-items: stretch;
}

.auth-hero,
.auth-card {
    padding: 1.8rem;
}

.auth-hero {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.eyebrow {
    margin-bottom: 0.75rem;
    font-size: 0.76rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.auth-title {
    margin: 0 0 1rem;
    font-size: clamp(2rem, 4vw, 3.25rem);
    line-height: 1.02;
}

.auth-copy {
    max-width: 34rem;
    color: var(--text-soft);
    line-height: 1.8;
}

.auth-feature-list {
    display: grid;
    gap: 0.9rem;
    margin-top: 1.5rem;
}

.auth-feature {
    padding: 1rem 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
}

.auth-card .cardless {
    position: relative;
    z-index: 1;
}

.auth-card .form-control {
    height: 3.2rem;
}

.auth-card .btn-primary {
    height: 3.1rem;
}

.text-soft {
    color: var(--text-soft) !important;
}

.text-faint {
    color: var(--text-faint) !important;
}

.text-strong {
    color: var(--text-strong) !important;
}

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

    .span-4,
    .span-5,
    .span-6,
    .span-7,
    .span-8 {
        grid-column: span 6;
    }
}

@media (max-width: 991px) {
    .admin-header-nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .admin-topbar {
        flex-direction: column;
    }

    .topbar-rail,
    .topbar-actions,
    .topbar-chips {
        align-items: flex-start;
        justify-content: flex-start;
    }

    .hero-grid,
    .auth-layout,
    .kv-grid {
        grid-template-columns: 1fr;
    }

    .span-4,
    .span-5,
    .span-6,
    .span-7,
    .span-8,
    .span-12 {
        grid-column: 1 / -1;
    }
}

@media (max-width: 767px) {
    .admin-topbar,
    .admin-main {
        padding-left: 1rem;
        padding-right: 1rem;
    }

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

    .hero-stats {
        grid-template-columns: 1fr;
    }

    .auth-shell {
        padding: 1rem;
    }

    .auth-hero,
    .auth-card,
    .hero-panel,
    .panel-card,
    .surface-card,
    .metric-card {
        padding: 1.2rem;
    }
}
