:root {
    --bg: #f3f6fb;
    --panel: rgba(255, 255, 255, 0.84);
    --panel-strong: #ffffff;
    --text: #152033;
    --muted: #607089;
    --line: rgba(148, 163, 184, 0.22);
    --blue: #2457f5;
    --cyan: #0891b2;
    --orange: #ea580c;
    --green: #0f9b6f;
    --red: #dc2626;
    --shadow: 0 18px 40px rgba(17, 24, 39, 0.10);
    --shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    position: relative;
    overflow-x: hidden;
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(36, 87, 245, 0.10), transparent 28%),
        radial-gradient(circle at top right, rgba(234, 88, 12, 0.10), transparent 24%),
        linear-gradient(180deg, #f7f9fc 0%, #eef3f8 100%);
}

.ambient {
    position: fixed;
    border-radius: 999px;
    filter: blur(90px);
    opacity: 0.45;
    pointer-events: none;
    z-index: 0;
}

.ambient-a {
    width: 340px;
    height: 340px;
    background: rgba(36, 87, 245, 0.20);
    top: -100px;
    left: -80px;
}

.ambient-b {
    width: 320px;
    height: 320px;
    background: rgba(8, 145, 178, 0.16);
    right: -90px;
    bottom: 40px;
}

.page-shell {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 320px 1fr;
    min-height: 100vh;
}

.sidebar {
    padding: 28px 22px;
    background: linear-gradient(180deg, rgba(13, 25, 46, 0.96), rgba(27, 44, 72, 0.94));
    color: #f8fbff;
    border-right: 1px solid rgba(148, 163, 184, 0.12);
}

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

.brand-mark {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #fff;
    background: linear-gradient(135deg, #2457f5, #0891b2);
    box-shadow: 0 18px 36px rgba(36, 87, 245, 0.28);
}

.brand {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.sub {
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 14px;
}

.sidebar-card {
    margin-top: 16px;
    padding: 16px 16px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.10);
}

.sidebar-card.subtle {
    background: rgba(8, 145, 178, 0.10);
}

.workspace-tabs {
    margin-top: 18px;
    display: grid;
    gap: 10px;
}

.theme-switch-row {
    display: flex;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    justify-content: center;
}

.workspace-tab {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

.workspace-tab i {
    width: 18px;
    text-align: center;
}

.workspace-tab.active {
    background: linear-gradient(135deg, rgba(36, 87, 245, 0.9), rgba(8, 145, 178, 0.9));
    border-color: rgba(255, 255, 255, 0.18);
}

.workspace-tab.danger-tab {
    background: rgba(220, 38, 38, 0.12);
}

.sidebar-card-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.66);
    margin-bottom: 10px;
}

.sidebar-card p {
    margin: 0;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.84);
    font-size: 14px;
}

.meta-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

.main {
    padding: 28px;
}

.hero-card,
.panel,
.stat {
    border: 1px solid rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(18px);
}

.hero-card {
    padding: 24px 26px;
    border-radius: 28px;
    background:
        radial-gradient(circle at top right, rgba(36, 87, 245, 0.14), transparent 30%),
        linear-gradient(135deg, rgba(255,255,255,0.84), rgba(248,250,252,0.92));
    box-shadow: var(--shadow);
}

.dashboard-hero {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 18px;
}

.hero-kicker,
.panel-eyebrow {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--cyan);
    font-weight: 700;
}

.hero-card h1,
.panel h2 {
    margin: 8px 0 0;
    font-size: 30px;
    line-height: 1.12;
    letter-spacing: -0.03em;
}

.hero-card p {
    margin: 12px 0 0;
    max-width: 680px;
    color: var(--muted);
    line-height: 1.7;
}

.login-shell {
    max-width: 960px;
    margin: 34px auto 0;
    display: grid;
    gap: 18px;
}

.dashboard {
    display: grid;
    gap: 20px;
}

.workspace-panel {
    display: none;
    gap: 20px;
}

.workspace-panel.active {
    display: grid;
}

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

.stat {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    padding: 18px 20px;
    background: linear-gradient(180deg, rgba(255,255,255,0.86), rgba(255,255,255,0.94));
    box-shadow: var(--shadow-soft);
}

.stat::after {
    content: "";
    position: absolute;
    inset: auto -30px -36px auto;
    width: 120px;
    height: 120px;
    border-radius: 999px;
    background: rgba(36, 87, 245, 0.08);
}

.stat.theme-dark {
    background: linear-gradient(180deg, rgba(11, 18, 32, 0.96), rgba(15, 23, 42, 0.99)) !important;
    color: #e5eefc !important;
}

.stat.theme-dark .value {
    color: #f8fbff !important;
}

.stat.theme-dark .label {
    color: #a8bad2 !important;
}

.stat.theme-dark .stat-icon {
    background: rgba(36, 87, 245, 0.16);
    color: #8fb3ff;
}

.stat.theme-dark::after {
    background: rgba(36, 87, 245, 0.14);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(36, 87, 245, 0.10);
    color: var(--blue);
}

.stat .value {
    margin-top: 20px;
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.stat .label {
    margin-top: 8px;
    color: var(--muted);
    font-size: 14px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
    gap: 20px;
}

.panel {
    border-radius: 24px;
    padding: 24px;
    background: var(--panel);
    box-shadow: var(--shadow-soft);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
    margin-bottom: 18px;
}

.panel-header h2 {
    font-size: 24px;
}

.side-panel {
    background:
        radial-gradient(circle at top right, rgba(8,145,178,0.10), transparent 30%),
        linear-gradient(180deg, rgba(255,255,255,0.88), rgba(248,250,252,0.94));
}

.info-stack {
    display: grid;
    gap: 14px;
}

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

.overview-strip-card {
    padding: 18px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: linear-gradient(135deg, rgba(255,255,255,0.82), rgba(245,248,252,0.92));
}

.overview-strip-label {
    display: inline-block;
    margin-bottom: 10px;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cyan);
    font-weight: 700;
}

.overview-strip-card strong {
    display: block;
    line-height: 1.7;
}

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

.info-card {
    padding: 16px;
    border-radius: 18px;
    background: rgba(245, 248, 252, 0.86);
    border: 1px solid var(--line);
}

.info-card strong {
    display: block;
    margin-bottom: 8px;
}

.info-card span {
    display: block;
    color: var(--muted);
    line-height: 1.65;
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

button {
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--blue), #4b74ff);
    color: #fff;
    padding: 11px 18px;
    cursor: pointer;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 12px 24px rgba(36, 87, 245, 0.20);
}

button.secondary {
    background: linear-gradient(135deg, #4b5563, #64748b);
    box-shadow: none;
}

button.danger {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    box-shadow: none;
}

button.tiny {
    padding: 7px 12px;
    font-size: 12px;
    border-radius: 10px;
}

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

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

label span {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    color: #425266;
    font-weight: 600;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid #dbe4ef;
    border-radius: 16px;
    padding: 12px 14px;
    font: inherit;
    background: rgba(248, 251, 255, 0.9);
    color: var(--text);
    outline: none;
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(36, 87, 245, 0.42);
    box-shadow: 0 0 0 4px rgba(36, 87, 245, 0.10);
}

.toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px;
    gap: 12px;
    margin-bottom: 14px;
}

.table-wrap {
    overflow: auto;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.58);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 14px 12px;
    border-bottom: 1px solid #e8eef6;
    vertical-align: top;
    white-space: nowrap;
}

th {
    color: #516173;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: rgba(248, 250, 252, 0.92);
}

td {
    white-space: normal;
}

.mono,
code {
    font-family: Consolas, "Courier New", monospace;
    word-break: break-all;
}

code {
    padding: 2px 6px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.status-badge.ok {
    color: #0f9b6f;
    background: rgba(15, 155, 111, 0.12);
}

.status-badge.bad {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.12);
}

.status-badge.muted {
    color: #64748b;
    background: rgba(100, 116, 139, 0.12);
}

.table-subtext {
    margin-top: 4px;
    font-size: 12px;
    color: var(--muted);
}

.table-inline-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.icon-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 10px;
    display: inline-grid;
    place-items: center;
    background: rgba(36, 87, 245, 0.10);
    color: var(--blue);
    box-shadow: none;
}

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

.pagination-summary {
    color: var(--muted);
    font-size: 14px;
    margin-right: 8px;
}

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

.security-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
    gap: 20px;
}

.security-note {
    border-left: 4px solid var(--orange);
}

.security-note ul {
    margin: 10px 0 0;
    padding-left: 18px;
    color: var(--muted);
}

.fingerprint-action-panel {
    background:
        radial-gradient(circle at top right, rgba(36, 87, 245, 0.12), transparent 34%),
        linear-gradient(135deg, rgba(255,255,255,0.92), rgba(248,250,252,0.96));
}

.page-btn {
    min-width: 38px;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(71, 85, 105, 0.10);
    color: var(--text);
    box-shadow: none;
}

.page-btn.active {
    background: linear-gradient(135deg, var(--blue), #4b74ff);
    color: #fff;
}

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

@media (max-width: 1100px) {
    .page-shell {
        grid-template-columns: 1fr;
    }

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

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

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

@media (max-width: 720px) {
    .main,
    .sidebar {
        padding: 18px;
    }

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

    .hero-card h1,
    .panel h2 {
        font-size: 24px;
    }
}

[data-theme="dark"] {
    --bg: #0f172a;
    --panel: rgba(15, 23, 42, 0.82);
    --panel-strong: #111827;
    --text: #e5eefc;
    --muted: #94a3b8;
    --line: rgba(148, 163, 184, 0.18);
    --shadow: 0 18px 40px rgba(2, 6, 23, 0.45);
    --shadow-soft: 0 10px 24px rgba(2, 6, 23, 0.28);
}

[data-theme="dark"] body {
    background:
        radial-gradient(circle at top left, rgba(36, 87, 245, 0.18), transparent 28%),
        radial-gradient(circle at top right, rgba(234, 88, 12, 0.16), transparent 24%),
        linear-gradient(180deg, #08111f 0%, #0f172a 100%);
}

[data-theme="dark"] .sidebar {
    background: linear-gradient(180deg, rgba(8, 17, 31, 0.98), rgba(15, 23, 42, 0.96));
}

[data-theme="dark"] .hero-card,
[data-theme="dark"] .panel,
[data-theme="dark"] .stat {
    border-color: rgba(148, 163, 184, 0.12);
}

[data-theme="dark"] .hero-card,
[data-theme="dark"] .panel,
[data-theme="dark"] .stat,
[data-theme="dark"] .info-card,
[data-theme="dark"] .overview-strip-card,
[data-theme="dark"] .table-wrap,
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background-color: rgba(15, 23, 42, 0.86);
    color: var(--text);
}

[data-theme="dark"] .hero-card {
    background:
        radial-gradient(circle at top right, rgba(36, 87, 245, 0.18), transparent 30%),
        linear-gradient(135deg, rgba(15,23,42,0.92), rgba(17,24,39,0.96));
}

html[data-theme="dark"] .stats .stat,
html[data-theme="dark"] .stat,
body[data-theme="dark"] .stats .stat,
body[data-theme="dark"] .stat {
    background:
        linear-gradient(180deg, rgba(11, 18, 32, 0.96), rgba(15, 23, 42, 0.99)) !important;
    box-shadow: var(--shadow-soft);
    color: #e5eefc !important;
}

html[data-theme="dark"] .stats .stat::after,
html[data-theme="dark"] .stat::after,
body[data-theme="dark"] .stats .stat::after,
body[data-theme="dark"] .stat::after {
    background: rgba(36, 87, 245, 0.14);
}

html[data-theme="dark"] .stats .stat-icon,
html[data-theme="dark"] .stat-icon,
body[data-theme="dark"] .stats .stat-icon,
body[data-theme="dark"] .stat-icon {
    background: rgba(36, 87, 245, 0.16);
    color: #8fb3ff;
}

html[data-theme="dark"] .stats .stat .value,
html[data-theme="dark"] .stat .value,
body[data-theme="dark"] .stats .stat .value,
body[data-theme="dark"] .stat .value {
    color: #f8fbff !important;
}

html[data-theme="dark"] .stats .stat .label,
html[data-theme="dark"] .stat .label,
body[data-theme="dark"] .stats .stat .label,
body[data-theme="dark"] .stat .label {
    color: #a8bad2 !important;
}

[data-theme="dark"] .side-panel,
[data-theme="dark"] .fingerprint-action-panel,
[data-theme="dark"] .overview-strip-card {
    background:
        radial-gradient(circle at top right, rgba(36, 87, 245, 0.16), transparent 34%),
        linear-gradient(135deg, rgba(15,23,42,0.94), rgba(17,24,39,0.96));
}

[data-theme="dark"] th {
    background: rgba(15, 23, 42, 0.96);
    color: #cbd5e1;
}

[data-theme="dark"] td,
[data-theme="dark"] th {
    border-bottom-color: rgba(148, 163, 184, 0.12);
}

[data-theme="dark"] label span,
[data-theme="dark"] .info-card span,
[data-theme="dark"] .pagination-summary,
[data-theme="dark"] .hero-card p,
[data-theme="dark"] .stat .label,
[data-theme="dark"] .hint,
[data-theme="dark"] .table-subtext {
    color: var(--muted);
}

[data-theme="dark"] code {
    background: rgba(148, 163, 184, 0.12);
}
