/*
 * Dialtone Technologies design system.
 * Palette: Deep Navy #0F172A, Signal Blue #3B82F6, Quantum Cyan #06B6D4,
 * Cloud White #F8FAFC, Slate Ink #1E293B. Type: Manrope headings, Inter body,
 * 1.25 scale from 16px. Radius: 12px controls, 18px cards, pill badges. 4px grid.
 */
:root {
    color-scheme: light;

    /* Brand palette */
    --dt-navy: #0f172a;
    --dt-signal-blue: #3b82f6;
    --dt-cyan: #06b6d4;
    --dt-cloud-white: #f8fafc;
    --dt-slate-ink: #1e293b;

    /* Semantic tokens (light) */
    --dt-bg: #f8fafc;
    --dt-surface: #ffffff;
    --dt-surface-soft: #f7f7f8;
    --dt-surface-muted: #ebecef;
    --dt-border: #e2e8f0;
    --dt-border-soft: #edf1f6;
    --dt-border-strong: #cbd5e1;
    --dt-text: #1e293b;
    --dt-heading: #0f172a;
    --dt-muted: #64748b;
    --dt-muted-2: #94a3b8;
    --dt-primary: #0f172a;
    --dt-primary-hover: #1e293b;
    --dt-on-primary: #f8fafc;
    --dt-link: #2563eb;
    --dt-interactive: #3b82f6;
    --dt-interactive-soft: #eff6ff;
    --dt-interactive-border: #bfdbfe;
    --dt-accent: #06b6d4;
    --dt-focus-ring: 0 0 0 3px rgba(59, 130, 246, 0.35);

    --dt-info: #0284c7;
    --dt-info-text: #0369a1;
    --dt-info-soft: #f0f9ff;
    --dt-info-border: #bae6fd;
    --dt-success: #16a34a;
    --dt-success-text: #15803d;
    --dt-success-soft: #f0fdf4;
    --dt-success-border: #bbf7d0;
    --dt-warning: #d97706;
    --dt-warning-text: #b45309;
    --dt-warning-soft: #fffbeb;
    --dt-warning-border: #fde68a;
    --dt-danger: #dc2626;
    --dt-danger-text: #b91c1c;
    --dt-danger-soft: #fef2f2;
    --dt-danger-border: #fecaca;
    --dt-neutral-text: #475569;
    --dt-neutral-soft: #f1f5f9;

    /* Structural navy sidebar (same in both modes) */
    --dt-sidebar: #0f172a;
    --dt-sidebar-raised: rgba(248, 250, 252, 0.06);
    --dt-sidebar-active: rgba(248, 250, 252, 0.1);
    --dt-sidebar-border: rgba(248, 250, 252, 0.1);
    --dt-sidebar-text: #f8fafc;
    --dt-sidebar-muted: #94a3b8;

    --dt-code-bg: #0f172a;
    --dt-code-text: #e2e8f0;

    /* Shape, depth, type */
    --dt-radius-control: 12px;
    --dt-radius-card: 18px;
    --dt-radius-inset: 12px;
    --dt-radius-pill: 999px;
    --dt-shadow-soft: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.06);
    --dt-shadow-hover: 0 2px 4px rgba(15, 23, 42, 0.05), 0 8px 24px rgba(15, 23, 42, 0.08);
    --dt-font-heading: Manrope, Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --dt-font-body: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --dt-mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
    --dt-text-xs: 10.24px;
    --dt-text-sm: 12.8px;
    --dt-text-base: 16px;
    --dt-text-lg: 20px;
    --dt-text-xl: 25px;
    --dt-text-2xl: 31.25px;
    --dt-text-3xl: 39.06px;
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;

        --dt-bg: #1e2025;
        --dt-surface: #262a33;
        --dt-surface-soft: #1e293b;
        --dt-surface-muted: #414653;
        --dt-border: #414653;
        --dt-border-soft: #343945;
        --dt-border-strong: #535a6a;
        --dt-text: #f7f7f8;
        --dt-heading: #f7f7f8;
        --dt-muted: #94a3b8;
        --dt-muted-2: #7c8598;
        --dt-primary: #7992ce;
        --dt-primary-hover: #93a7d9;
        --dt-on-primary: #0f172a;
        --dt-link: #93c5fd;
        --dt-interactive: #60a5fa;
        --dt-interactive-soft: rgba(59, 130, 246, 0.14);
        --dt-interactive-border: rgba(96, 165, 250, 0.4);
        --dt-focus-ring: 0 0 0 3px rgba(96, 165, 250, 0.4);

        --dt-info: #38bdf8;
        --dt-info-text: #7dd3fc;
        --dt-info-soft: rgba(56, 189, 248, 0.12);
        --dt-info-border: rgba(56, 189, 248, 0.35);
        --dt-success-text: #4ade80;
        --dt-success-soft: rgba(22, 163, 74, 0.14);
        --dt-success-border: rgba(74, 222, 128, 0.35);
        --dt-warning-text: #fbbf24;
        --dt-warning-soft: rgba(217, 119, 6, 0.14);
        --dt-warning-border: rgba(251, 191, 36, 0.35);
        --dt-danger-text: #f87171;
        --dt-danger-soft: rgba(220, 38, 38, 0.14);
        --dt-danger-border: rgba(248, 113, 113, 0.35);
        --dt-neutral-text: #cbd5e1;
        --dt-neutral-soft: #343945;

        --dt-sidebar: #0f172a;
        --dt-code-bg: #0f172a;

        --dt-shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.2), 0 4px 16px rgba(0, 0, 0, 0.18);
        --dt-shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.24), 0 8px 24px rgba(0, 0, 0, 0.24);
    }
}

* {
    box-sizing: border-box;
}

html,
body {
    background: var(--dt-bg);
    color: var(--dt-text);
    font-family: var(--dt-font-body);
    font-size: var(--dt-text-base);
    line-height: 1.5;
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--dt-link);
    text-underline-offset: 2px;
}

h1,
h2,
h3,
p {
    letter-spacing: 0;
}

h1,
h2,
h3 {
    color: var(--dt-heading);
    font-family: var(--dt-font-heading);
    font-weight: 700;
    margin: 0;
}

h1 {
    font-size: var(--dt-text-2xl);
    letter-spacing: -0.01em;
    line-height: 1.2;
}

h2 {
    font-size: var(--dt-text-lg);
    font-weight: 600;
    line-height: 1.3;
}

h3 {
    font-size: var(--dt-text-base);
    font-weight: 600;
    line-height: 1.4;
}

h1:focus,
h2:focus,
h3:focus {
    box-shadow: none;
    outline: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

:focus-visible {
    outline: none;
}

.btn {
    align-items: center;
    background: var(--dt-surface);
    border: 1px solid var(--dt-border-strong);
    border-radius: var(--dt-radius-control);
    color: var(--dt-heading);
    cursor: pointer;
    display: inline-flex;
    font-size: var(--dt-text-sm);
    font-weight: 600;
    gap: 8px;
    justify-content: center;
    line-height: 1.2;
    min-height: 40px;
    padding: 8px 16px;
    text-decoration: none;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.btn:hover {
    background: var(--dt-surface-soft);
    border-color: var(--dt-muted-2);
    color: var(--dt-heading);
}

.btn-sm {
    min-height: 32px;
    padding: 4px 12px;
}

.btn-primary {
    background: var(--dt-primary);
    border-color: var(--dt-primary);
    color: var(--dt-on-primary);
}

.btn-primary:hover {
    background: var(--dt-primary-hover);
    border-color: var(--dt-primary-hover);
    color: var(--dt-on-primary);
}

.btn-outline-secondary {
    background: var(--dt-surface);
    border-color: var(--dt-border-strong);
    color: var(--dt-heading);
}

.btn-outline-primary {
    background: var(--dt-surface);
    border-color: var(--dt-interactive-border);
    color: var(--dt-link);
}

.btn-outline-primary:hover {
    background: var(--dt-interactive-soft);
    border-color: var(--dt-interactive);
    color: var(--dt-link);
}

.btn-outline-warning {
    background: var(--dt-surface);
    border-color: var(--dt-warning-border);
    color: var(--dt-warning-text);
}

.btn-outline-warning:hover {
    background: var(--dt-warning-soft);
    border-color: var(--dt-warning);
    color: var(--dt-warning-text);
}

.btn-outline-danger {
    background: var(--dt-surface);
    border-color: var(--dt-danger-border);
    color: var(--dt-danger-text);
}

.btn-outline-danger:hover {
    background: var(--dt-danger-soft);
    border-color: var(--dt-danger);
    color: var(--dt-danger-text);
}

.btn:focus-visible,
.btn:active:focus,
.form-control:focus,
.form-check-input:focus-visible {
    border-color: var(--dt-interactive);
    box-shadow: var(--dt-focus-ring);
    outline: none;
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.form-control {
    background: var(--dt-surface);
    border: 1px solid var(--dt-border-strong);
    border-radius: var(--dt-radius-control);
    color: var(--dt-text);
    display: block;
    font-size: var(--dt-text-base);
    min-height: 40px;
    padding: 8px 12px;
    transition: border-color 120ms ease, box-shadow 120ms ease;
    width: 100%;
}

.form-control:hover {
    border-color: var(--dt-muted-2);
}

.form-control::placeholder {
    color: var(--dt-muted-2);
}

textarea.form-control {
    min-height: 96px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
}

.form-check-input {
    accent-color: var(--dt-interactive);
    height: 16px;
    width: 16px;
}

.page-header {
    align-items: flex-end;
    display: flex;
    gap: 20px;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-header p,
.panel-heading p {
    color: var(--dt-muted);
    font-size: var(--dt-text-sm);
    margin: 4px 0 0;
    max-width: 72ch;
}

.page-header p {
    font-size: var(--dt-text-base);
    margin-top: 8px;
}

.page-header-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.btn-icon {
    align-items: center;
    background: rgba(248, 250, 252, 0.16);
    border-radius: 4px;
    display: inline-flex;
    font-size: var(--dt-text-sm);
    font-weight: 700;
    height: 20px;
    justify-content: center;
    line-height: 1;
    width: 20px;
}

.dt-page-kicker,
.eyebrow {
    color: var(--dt-link);
    font-size: var(--dt-text-xs);
    font-weight: 700;
    letter-spacing: 0.1em;
    margin: 0 0 8px;
    text-transform: uppercase;
}

.dt-live-dot {
    background: var(--dt-success);
    border-radius: var(--dt-radius-pill);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18);
    display: inline-block;
    height: 8px;
    width: 8px;
}

.dashboard-metrics,
.metrics-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    margin-bottom: 24px;
}

.dashboard-metric,
.metric-card {
    align-items: flex-start;
    background: var(--dt-surface);
    border: 1px solid var(--dt-border);
    border-radius: var(--dt-radius-card);
    box-shadow: var(--dt-shadow-soft);
    display: grid;
    gap: 16px;
    grid-template-columns: 44px 1fr;
    padding: 20px;
}

.dashboard-metric.metric-accent,
.metric-card.metric-accent {
    border-color: var(--dt-interactive-border);
}

.metric-icon {
    align-items: center;
    background: var(--dt-interactive-soft);
    border: 1px solid var(--dt-interactive-border);
    border-radius: var(--dt-radius-control);
    color: var(--dt-link);
    display: inline-flex;
    font-size: var(--dt-text-xs);
    font-weight: 700;
    height: 44px;
    justify-content: center;
    letter-spacing: 0.04em;
    width: 44px;
}

.metric-accent .metric-icon {
    background: var(--dt-primary);
    border-color: var(--dt-primary);
    color: var(--dt-on-primary);
}

.dashboard-metric span:not(.metric-icon),
.metric-card span:not(.metric-icon) {
    color: var(--dt-muted);
    display: block;
    font-size: var(--dt-text-sm);
    font-weight: 600;
}

.dashboard-metric strong,
.metric-card strong {
    color: var(--dt-heading);
    display: block;
    font-family: var(--dt-font-heading);
    font-size: var(--dt-text-xl);
    font-weight: 700;
    line-height: 1.2;
    margin-top: 4px;
}

.metric-note {
    color: var(--dt-link);
    font-size: var(--dt-text-sm);
    font-weight: 600;
    margin-top: 4px;
}

.action-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    margin-bottom: 24px;
}

.action-card {
    align-items: center;
    background: var(--dt-surface);
    border: 1px solid var(--dt-border);
    border-radius: var(--dt-radius-card);
    box-shadow: var(--dt-shadow-soft);
    color: var(--dt-text);
    display: grid;
    gap: 16px;
    grid-template-columns: 44px 1fr;
    min-height: 96px;
    padding: 20px;
    text-decoration: none;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.action-card:hover {
    border-color: var(--dt-interactive-border);
    box-shadow: var(--dt-shadow-hover);
    color: var(--dt-text);
}

.action-card:focus-visible {
    border-color: var(--dt-interactive);
    box-shadow: var(--dt-focus-ring);
    outline: none;
}

.action-card-primary {
    border-color: var(--dt-interactive-border);
}

.action-card-icon {
    align-items: center;
    background: var(--dt-interactive-soft);
    border: 1px solid var(--dt-interactive-border);
    border-radius: var(--dt-radius-control);
    color: var(--dt-link);
    display: inline-flex;
    font-size: var(--dt-text-sm);
    font-weight: 700;
    height: 44px;
    justify-content: center;
    width: 44px;
}

.action-card-primary .action-card-icon {
    background: var(--dt-primary);
    border-color: var(--dt-primary);
    color: var(--dt-on-primary);
}

.action-card strong,
.action-card span span {
    display: block;
}

.action-card strong {
    color: var(--dt-heading);
    font-family: var(--dt-font-heading);
    font-size: var(--dt-text-base);
    font-weight: 700;
}

.action-card span span {
    color: var(--dt-muted);
    font-size: var(--dt-text-sm);
    margin-top: 4px;
}

.ops-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    margin-bottom: 24px;
}

.ops-card {
    background: var(--dt-surface);
    border: 1px solid var(--dt-border);
    border-radius: var(--dt-radius-card);
    display: grid;
    gap: 8px;
    padding: 20px;
}

.ops-card strong {
    color: var(--dt-heading);
    font-family: var(--dt-font-heading);
    font-size: var(--dt-text-base);
    font-weight: 700;
}

.ops-card p {
    color: var(--dt-muted);
    font-size: var(--dt-text-sm);
    margin: 0;
}

.ops-card > .status-badge {
    justify-self: start;
}

.dashboard-panel,
.panel,
.login-card,
.login-preview {
    background: var(--dt-surface);
    border: 1px solid var(--dt-border);
    border-radius: var(--dt-radius-card);
    box-shadow: var(--dt-shadow-soft);
}

.dashboard-panel,
.panel {
    margin-bottom: 24px;
    padding: 20px;
}

.panel-heading {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 16px;
}

.filter-bar {
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(260px, 1fr) 220px 180px;
    margin-bottom: 16px;
}

.dashboard-table-shell,
.table-shell {
    border: 1px solid var(--dt-border);
    border-radius: var(--dt-radius-inset);
    overflow-x: auto;
}

.dashboard-table,
.table {
    border-collapse: collapse;
    margin: 0;
    min-width: 760px;
    width: 100%;
}

.dashboard-table th,
.table thead th {
    background: var(--dt-surface-soft);
    border-bottom: 1px solid var(--dt-border);
    color: var(--dt-muted);
    font-size: var(--dt-text-xs);
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 12px 16px;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.dashboard-table td,
.table tbody td {
    border-bottom: 1px solid var(--dt-border-soft);
    color: var(--dt-text);
    font-size: var(--dt-text-sm);
    padding: 12px 16px;
    vertical-align: middle;
}

.dashboard-table tbody tr:last-child td,
.table tbody tr:last-child td {
    border-bottom: 0;
}

.dashboard-table tbody tr:hover td,
.table tbody tr:hover td {
    background: var(--dt-surface-soft);
}

.status-badge {
    align-items: center;
    border: 1px solid transparent;
    border-radius: var(--dt-radius-pill);
    display: inline-flex;
    font-size: var(--dt-text-xs);
    font-weight: 700;
    gap: 8px;
    letter-spacing: 0.02em;
    padding: 4px 12px;
    white-space: nowrap;
}

.status-badge::before {
    border-radius: var(--dt-radius-pill);
    content: "";
    height: 6px;
    width: 6px;
}

.status-enabled {
    background: var(--dt-success-soft);
    border-color: var(--dt-success-border);
    color: var(--dt-success-text);
}

.status-enabled::before {
    background: var(--dt-success);
}

.status-disabled {
    background: var(--dt-neutral-soft);
    border-color: var(--dt-border);
    color: var(--dt-neutral-text);
}

.status-disabled::before {
    background: var(--dt-muted-2);
}

.status-latest {
    background: var(--dt-interactive-soft);
    border-color: var(--dt-interactive-border);
    color: var(--dt-link);
}

.status-latest::before {
    background: var(--dt-accent);
}

.status-warning {
    background: var(--dt-warning-soft);
    border-color: var(--dt-warning-border);
    color: var(--dt-warning-text);
}

.status-warning::before {
    background: var(--dt-warning);
}

.status-danger {
    background: var(--dt-danger-soft);
    border-color: var(--dt-danger-border);
    color: var(--dt-danger-text);
}

.status-danger::before {
    background: var(--dt-danger);
}

.inline-gap {
    margin-left: 4px;
}

.mt-3 {
    margin-top: 12px;
}

.stack-gap-sm {
    margin-top: 8px;
}

.full-width {
    width: 100%;
}

.muted-copy {
    color: var(--dt-muted);
}

.error-heading {
    color: var(--dt-danger-text);
}

.inline-check {
    align-items: center;
    display: inline-flex;
    gap: 8px;
    margin: 0;
}

.no-margin {
    margin: 0;
}

.form-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.form-grid label {
    color: var(--dt-text);
    font-size: var(--dt-text-sm);
    font-weight: 600;
}

.form-grid .form-control,
.form-grid input[type="file"] {
    margin-top: 8px;
}

.span-2 {
    grid-column: 1 / -1;
}

.check-row {
    align-items: center;
    background: var(--dt-surface-soft);
    border: 1px solid var(--dt-border);
    border-radius: var(--dt-radius-control);
    display: flex;
    gap: 12px;
    min-height: 40px;
    padding: 8px 12px;
}

.source-advanced {
    background: var(--dt-surface-soft);
    border: 1px solid var(--dt-border);
    border-radius: var(--dt-radius-inset);
    padding: 12px 16px;
}

.source-advanced summary {
    color: var(--dt-text);
    cursor: pointer;
    font-size: var(--dt-text-sm);
    font-weight: 600;
}

.nested-form-grid {
    margin-top: 12px;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.upload-zone {
    background: var(--dt-surface-soft);
    border: 1px dashed var(--dt-border-strong);
    border-radius: var(--dt-radius-inset);
    padding: 16px;
}

.upload-zone span,
.upload-zone small {
    display: block;
}

.upload-zone small {
    color: var(--dt-muted);
    font-weight: 400;
    margin-top: 8px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    white-space: nowrap;
}

.hash,
.mono {
    font-family: var(--dt-mono);
}

.hash {
    font-size: var(--dt-text-sm);
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.release-notes {
    display: block;
    white-space: pre-line;
}

.empty-state {
    display: grid;
    gap: 4px;
    padding: 16px 4px;
}

.empty-state strong {
    color: var(--dt-heading);
    font-weight: 600;
}

.empty-state span {
    color: var(--dt-muted);
}

.command-block {
    background: var(--dt-code-bg);
    border: 1px solid var(--dt-code-bg);
    border-radius: var(--dt-radius-inset);
    color: var(--dt-code-text);
    margin: 0;
    overflow-x: auto;
    padding: 16px 20px;
}

.command-block code {
    color: inherit;
    font-family: var(--dt-mono);
    font-size: var(--dt-text-sm);
}

.metadata-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.metadata-grid > div {
    background: var(--dt-surface-soft);
    border: 1px solid var(--dt-border);
    border-radius: var(--dt-radius-inset);
    padding: 12px 16px;
}

.metadata-grid span {
    color: var(--dt-muted);
    display: block;
    font-size: var(--dt-text-xs);
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.metadata-grid strong {
    color: var(--dt-heading);
    display: block;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.metadata-grid .span-2 {
    grid-column: span 2;
}

.install-steps {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.install-steps > div {
    background: var(--dt-surface-soft);
    border: 1px solid var(--dt-border);
    border-radius: var(--dt-radius-inset);
    display: grid;
    gap: 8px;
    padding: 16px;
}

.install-steps strong {
    color: var(--dt-heading);
    font-family: var(--dt-font-heading);
    font-weight: 700;
}

.install-steps p {
    color: var(--dt-muted);
    font-size: var(--dt-text-sm);
    margin: 0;
}

/* Brand lockup shared by sidebar and login */
.dt-brand-lockup {
    color: inherit;
    display: grid;
    gap: 8px;
    text-decoration: none;
}

.dt-brand-logo {
    display: block;
    height: auto;
    width: 128px;
}

.dt-product-name {
    align-items: center;
    display: flex;
    font-family: var(--dt-font-heading);
    font-size: var(--dt-text-base);
    font-weight: 700;
    gap: 8px;
}

.dt-product-name img {
    height: 20px;
    width: 20px;
}

.login-shell {
    background: var(--dt-bg);
    display: grid;
    grid-template-columns: minmax(360px, 0.9fr) minmax(0, 1.1fr);
    min-height: 100vh;
}

.login-aside {
    background: var(--dt-sidebar);
    color: var(--dt-sidebar-text);
    display: flex;
    flex-direction: column;
    gap: 40px;
    justify-content: space-between;
    padding: 40px 48px;
}

.login-aside .dt-brand-logo {
    width: 160px;
}

.login-aside .dt-product-name {
    color: var(--dt-sidebar-text);
}

.login-copy .eyebrow {
    color: var(--dt-accent);
}

.login-copy h1 {
    color: var(--dt-sidebar-text);
    font-size: var(--dt-text-3xl);
    line-height: 1.15;
    max-width: 16ch;
}

.login-copy p {
    color: var(--dt-sidebar-muted);
    font-size: var(--dt-text-base);
    line-height: 1.7;
    margin: 16px 0 0;
    max-width: 60ch;
}

.trust-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 24px;
}

.trust-chips span {
    background: var(--dt-sidebar-raised);
    border: 1px solid var(--dt-sidebar-border);
    border-radius: var(--dt-radius-pill);
    color: var(--dt-sidebar-text);
    font-size: var(--dt-text-sm);
    font-weight: 600;
    padding: 4px 12px;
}

.login-preview {
    background: var(--dt-sidebar-raised);
    border-color: var(--dt-sidebar-border);
    box-shadow: none;
    display: grid;
    gap: 12px;
    max-width: 560px;
    padding: 20px;
}

.login-preview strong {
    color: var(--dt-sidebar-text);
}

.login-preview-row {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.login-preview-row span {
    color: var(--dt-sidebar-muted);
    font-size: var(--dt-text-sm);
}

.login-main {
    align-items: center;
    display: flex;
    justify-content: center;
    padding: 40px 24px;
}

.login-card {
    max-width: 440px;
    padding: 32px;
    width: 100%;
}

.login-card h2 {
    font-size: var(--dt-text-xl);
    font-weight: 700;
}

.login-card p,
.dev-note,
.login-tools {
    color: var(--dt-muted);
}

.login-card p {
    margin: 8px 0 0;
}

.login-card label {
    color: var(--dt-text);
    display: block;
    font-size: var(--dt-text-sm);
    font-weight: 600;
    margin-top: 16px;
}

.login-card .form-control {
    margin-top: 8px;
}

.login-tools {
    align-items: center;
    display: flex;
    font-size: var(--dt-text-sm);
    justify-content: space-between;
    margin: 16px 0 20px;
}

.dev-note {
    font-size: var(--dt-text-sm);
    margin: 16px 0 0;
}

.validation-message {
    color: var(--dt-danger-text);
    font-size: var(--dt-text-sm);
}

.alert {
    border: 1px solid var(--dt-border);
    border-radius: var(--dt-radius-control);
    font-size: var(--dt-text-sm);
    padding: 12px 16px;
}

.alert-info {
    background: var(--dt-info-soft);
    border-color: var(--dt-info-border);
    color: var(--dt-info-text);
}

.alert-warning {
    background: var(--dt-warning-soft);
    border-color: var(--dt-warning-border);
    color: var(--dt-warning-text);
}

.alert-danger {
    background: var(--dt-danger-soft);
    border-color: var(--dt-danger-border);
    color: var(--dt-danger-text);
}

.blazor-error-boundary {
    background: var(--dt-danger-soft);
    border: 1px solid var(--dt-danger-border);
    border-radius: var(--dt-radius-control);
    color: var(--dt-danger-text);
    padding: 16px;
}

.blazor-error-boundary::after {
    content: "Something went wrong while rendering this section. Reload the page to try again.";
}

#blazor-error-ui {
    background: var(--dt-surface);
    border-top: 1px solid var(--dt-border);
    bottom: 0;
    box-shadow: var(--dt-shadow-hover);
    color: var(--dt-text);
    display: none;
    left: 0;
    padding: 12px 16px;
    position: fixed;
    right: 0;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 16px;
}

/* Build-from-source helpers */
.segmented {
    background: var(--dt-surface-soft);
    border: 1px solid var(--dt-border);
    border-radius: var(--dt-radius-control);
    display: inline-flex;
    gap: 4px;
    margin-bottom: 16px;
    padding: 4px;
}

.segment {
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: var(--dt-muted);
    cursor: pointer;
    font-size: var(--dt-text-sm);
    font-weight: 600;
    padding: 8px 16px;
}

.segment:hover {
    color: var(--dt-heading);
}

.segment.active {
    background: var(--dt-surface);
    box-shadow: var(--dt-shadow-soft);
    color: var(--dt-heading);
}

.segment:focus-visible,
.chip:focus-visible {
    box-shadow: var(--dt-focus-ring);
    outline: none;
}

.input-with-action {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.form-grid .input-with-action .form-control {
    flex: 1;
    margin-top: 0;
}

.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    background: var(--dt-surface);
    border: 1px solid var(--dt-border-strong);
    border-radius: var(--dt-radius-pill);
    color: var(--dt-text);
    cursor: pointer;
    font-family: var(--dt-mono);
    font-size: var(--dt-text-sm);
    padding: 4px 12px;
}

.chip:hover {
    border-color: var(--dt-interactive);
}

.chip.active {
    background: var(--dt-interactive-soft);
    border-color: var(--dt-interactive);
    color: var(--dt-link);
}

.command-preview {
    display: grid;
    gap: 8px;
}

.field-label {
    color: var(--dt-text);
    font-size: var(--dt-text-sm);
    font-weight: 600;
}

.command-preview .command-block {
    white-space: pre-wrap;
    word-break: break-all;
}

/* Page building blocks */
.inline-form {
    display: inline-flex;
    margin: 0;
}


.breadcrumb {
    align-items: center;
    color: var(--dt-muted);
    display: flex;
    font-size: var(--dt-text-sm);
    gap: 8px;
    margin-bottom: 8px;
}

.breadcrumb a {
    color: var(--dt-link);
    font-weight: 600;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.metric-link {
    color: inherit;
    text-decoration: none;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.metric-link:hover {
    border-color: var(--dt-interactive-border);
    box-shadow: var(--dt-shadow-hover);
}

.metric-link:focus-visible {
    box-shadow: var(--dt-focus-ring);
    outline: none;
}

.summary-strip {
    background: var(--dt-surface);
    border: 1px solid var(--dt-border);
    border-radius: var(--dt-radius-card);
    box-shadow: var(--dt-shadow-soft);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 24px;
}

.summary-strip > div {
    border-left: 1px solid var(--dt-border-soft);
    display: grid;
    gap: 4px;
    padding: 16px 20px;
}

.summary-strip > div:first-child {
    border-left: 0;
}

.summary-strip span {
    color: var(--dt-muted);
    font-size: var(--dt-text-sm);
    font-weight: 600;
}

.summary-strip strong {
    color: var(--dt-heading);
    font-family: var(--dt-font-heading);
    font-size: var(--dt-text-lg);
    font-weight: 700;
}

.tabs {
    border-bottom: 1px solid var(--dt-border);
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
}

.tab {
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    color: var(--dt-muted);
    cursor: pointer;
    font-size: var(--dt-text-sm);
    font-weight: 600;
    margin-bottom: -1px;
    padding: 12px 16px;
}

.tab:hover {
    color: var(--dt-heading);
}

.tab.active {
    border-bottom-color: var(--dt-interactive);
    color: var(--dt-heading);
}

.tab:focus-visible {
    border-radius: 8px 8px 0 0;
    box-shadow: var(--dt-focus-ring);
    outline: none;
}

.form-panel {
    border-color: var(--dt-interactive-border);
}

.form-section-title {
    border-top: 1px solid var(--dt-border-soft);
    color: var(--dt-muted);
    font-family: var(--dt-font-body);
    font-size: var(--dt-text-xs);
    font-weight: 700;
    letter-spacing: 0.1em;
    margin: 20px 0 12px;
    padding-top: 16px;
    text-transform: uppercase;
}

form > .form-section-title:first-child {
    border-top: 0;
    margin-top: 0;
    padding-top: 0;
}

.field-hint {
    color: var(--dt-muted);
    display: block;
    font-size: var(--dt-text-sm);
    font-weight: 400;
    margin-top: 4px;
}

.check-stack {
    align-content: end;
    display: grid;
    gap: 8px;
}

.check-row span {
    font-size: var(--dt-text-sm);
    font-weight: 600;
}

.form-control:disabled {
    background: var(--dt-surface-soft);
    color: var(--dt-muted);
    cursor: not-allowed;
}

.form-control-inline {
    display: inline-block;
    min-height: 32px;
    padding: 4px 12px;
    width: 180px;
}

.table-link {
    color: var(--dt-heading);
    font-weight: 600;
    text-decoration: none;
}

.table-link:hover {
    color: var(--dt-link);
    text-decoration: underline;
}

.cell-meta {
    color: var(--dt-muted);
    font-size: var(--dt-text-xs);
    margin-top: 4px;
}

.table-footnote {
    color: var(--dt-muted);
    font-size: var(--dt-text-sm);
    margin: 12px 0 0;
}

.table tbody tr.row-expanded td {
    background: var(--dt-surface-soft);
    border-bottom: 0;
}

.table tbody tr.details-row td {
    background: var(--dt-surface-soft);
    padding: 4px 16px 16px;
}

.table tbody tr.details-row:hover td {
    background: var(--dt-surface-soft);
}

.details-row .metadata-grid > div {
    background: var(--dt-surface);
}

.confirm-text {
    align-self: center;
    color: var(--dt-danger-text);
    font-size: var(--dt-text-sm);
    font-weight: 600;
}

.btn-danger {
    background: var(--dt-danger);
    border-color: var(--dt-danger);
    color: #ffffff;
}

.btn-danger:hover {
    background: var(--dt-danger-text);
    border-color: var(--dt-danger-text);
    color: #ffffff;
}

.alert-success {
    background: var(--dt-success-soft);
    border-color: var(--dt-success-border);
    color: var(--dt-success-text);
}

.attention-list {
    display: grid;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.attention-item {
    align-items: center;
    background: var(--dt-surface-soft);
    border: 1px solid var(--dt-border);
    border-radius: var(--dt-radius-inset);
    display: grid;
    gap: 12px;
    grid-template-columns: 12px 1fr auto;
    padding: 12px 16px;
}

.attention-item strong {
    color: var(--dt-heading);
    display: block;
    font-weight: 600;
}

.attention-item span:not(.attention-dot) {
    color: var(--dt-muted);
    display: block;
    font-size: var(--dt-text-sm);
}

.attention-dot {
    border-radius: 999px;
    height: 10px;
    width: 10px;
}

.attention-warning .attention-dot {
    background: var(--dt-warning);
}

.attention-danger .attention-dot {
    background: var(--dt-danger);
}

.empty-state-ok strong::before {
    background: var(--dt-success);
    border-radius: 999px;
    content: "";
    display: inline-block;
    height: 8px;
    margin-right: 8px;
    vertical-align: middle;
    width: 8px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}

@media (max-width: 900px) {
    .page-header {
        display: block;
    }

    .page-header-actions {
        justify-content: flex-start;
        margin-top: 16px;
    }

    .filter-bar,
    .login-shell {
        grid-template-columns: 1fr;
    }

    .summary-strip > div {
        border-left: 0;
        border-top: 1px solid var(--dt-border-soft);
    }

    .attention-item {
        grid-template-columns: 12px 1fr;
    }

    .attention-item .btn {
        grid-column: 2;
        justify-self: start;
    }

    .login-aside {
        gap: 24px;
        padding: 24px 20px;
    }

    .login-copy h1 {
        font-size: var(--dt-text-2xl);
    }

    .login-preview {
        display: none;
    }

    .metadata-grid .span-2 {
        grid-column: span 1;
    }
}

@media (max-width: 720px) {
    .dashboard-metrics,
    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-panel,
    .panel {
        padding: 16px;
    }

    .login-card {
        padding: 24px;
    }
}
