:root {
    color-scheme: dark;
    --bg: #0f1720;
    --panel: #162233;
    --panel-alt: #101923;
    --border: rgba(255, 255, 255, 0.08);
    --text: #f8fafc;
    --muted: #94a3b8;
    --primary: #2b8cee;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, Segoe UI, sans-serif;
    background: radial-gradient(circle at top, #13233a, var(--bg) 48%);
    color: var(--text);
}

.page-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 32px 20px 48px;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.auth-card,
.panel,
.stat-card {
    background: rgba(22, 34, 51, 0.94);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.auth-card {
    width: min(460px, 100%);
    padding: 28px;
}

.brand-block h1,
.topbar h1,
.panel-header h2 {
    margin: 0;
}

.brand-block p,
.topbar p,
.panel-header p,
.panel-note,
.auth-note {
    color: var(--muted);
}

.brand-kicker {
    display: inline-flex;
    margin-bottom: 8px;
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--primary);
    font-weight: 700;
}

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

.topbar-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(43, 140, 238, 0.12);
    color: #bfdbfe;
    font-size: 13px;
}

.stats-grid,
.panel-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 20px;
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.stat-card,
.panel {
    padding: 20px;
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.stat-card strong {
    display: block;
    margin-top: 8px;
    font-size: 28px;
}

.stack-lg > * + * {
    margin-top: 16px;
}

.field {
    display: grid;
    gap: 8px;
}

.field span {
    color: #dbeafe;
    font-size: 14px;
    font-weight: 600;
}

input,
textarea,
button {
    font: inherit;
}

input,
textarea {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(16, 25, 35, 0.95);
    color: var(--text);
}

input:focus,
textarea:focus {
    outline: 2px solid rgba(43, 140, 238, 0.45);
    border-color: rgba(43, 140, 238, 0.45);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid transparent;
    text-decoration: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-secondary,
.btn-copy {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    border-color: var(--border);
}

.btn-block {
    width: 100%;
}

.alert {
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
}

.alert-success {
    background: rgba(34, 197, 94, 0.12);
    color: #bbf7d0;
}

.alert-error {
    background: rgba(239, 68, 68, 0.12);
    color: #fecaca;
}

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

.search-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-form input {
    min-width: 240px;
}

.endpoint-box,
.code-block {
    background: rgba(16, 25, 35, 0.95);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 16px;
}

.code-block {
    white-space: pre-wrap;
    color: #bfdbfe;
}

.table-wrap {
    overflow-x: auto;
}

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

th,
 td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

code {
    font-family: Consolas, monospace;
    color: #e2e8f0;
}

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

.status-issued {
    background: rgba(43, 140, 238, 0.14);
    color: #bfdbfe;
}

.status-active {
    background: rgba(34, 197, 94, 0.14);
    color: #bbf7d0;
}

.status-superseded,
.status-expired {
    background: rgba(245, 158, 11, 0.14);
    color: #fde68a;
}

.status-revoked {
    background: rgba(239, 68, 68, 0.14);
    color: #fecaca;
}

.empty-row {
    text-align: center;
    color: var(--muted);
}

@media (max-width: 900px) {
    .stats-grid,
    .panel-grid,
    .row-between,
    .topbar {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .search-form {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .search-form input {
        min-width: 0;
    }
}