@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --font-sans: 'DM Sans', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;

    --bg-app: #eef1f6;
    --bg-surface: #ffffff;
    --bg-elevated: #ffffff;
    --bg-muted: #f8fafc;
    --bg-sidebar: #0c1222;
    --bg-sidebar-hover: #151d32;
    --bg-sidebar-active: #1a2540;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #f1f5f9;
    --text-sidebar: #94a3b8;
    --text-sidebar-active: #ffffff;

    --accent: #5b6cff;
    --accent-hover: #4a59e6;
    --accent-soft: rgba(91, 108, 255, 0.12);
    --accent-glow: rgba(91, 108, 255, 0.25);

    --success: #10b981;
    --success-soft: rgba(16, 185, 129, 0.12);
    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.14);
    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, 0.12);
    --info: #3b82f6;
    --info-soft: rgba(59, 130, 246, 0.12);

    --border: #e2e8f0;
    --border-strong: #cbd5e1;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow: 0 4px 16px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.1);

    --sidebar-width: 260px;
    --header-height: 64px;
    --transition: 180ms ease;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-app);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ── App shell ── */

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: var(--text-inverse);
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 100;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand {
    padding: 1.5rem 1.25rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand .logo-mark {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-brand .logo-icon-img {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    box-shadow: 0 4px 12px var(--accent-glow);
    flex-shrink: 0;
}

.sidebar-brand .logo-text {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.03em;
}

.sidebar-brand .logo-sub {
    font-size: 0.72rem;
    color: var(--text-sidebar);
    margin-top: 0.15rem;
    margin-left: 2.85rem;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.nav-section-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(148, 163, 184, 0.7);
    padding: 0.75rem 0.75rem 0.35rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-sidebar);
    font-size: 0.9rem;
    font-weight: 500;
    transition: background var(--transition), color var(--transition);
    text-decoration: none;
}

.sidebar-nav a:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-sidebar-active);
}

.sidebar-nav a.active {
    background: var(--bg-sidebar-active);
    color: var(--text-sidebar-active);
    box-shadow: inset 3px 0 0 var(--accent);
}

.sidebar-nav a svg {
    width: 18px;
    height: 18px;
    opacity: 0.75;
    flex-shrink: 0;
}

.sidebar-nav a.active svg,
.sidebar-nav a:hover svg { opacity: 1; }

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.75rem;
    color: var(--text-sidebar);
}

.sidebar-footer a {
    color: var(--text-sidebar);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-footer a:hover { color: #fff; }

.content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content-inner {
    flex: 1;
    padding: 2rem 2.5rem 3rem;
    max-width: 1280px;
    width: 100%;
}

/* ── Page header ── */

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.page-header-text .page-title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.page-header-text .page-subtitle {
    margin-top: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* ── Cards ── */

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.card-body { padding: 1.5rem; }

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.95rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), transform var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.stat-card .stat-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.04em;
    margin-top: 0.25rem;
    line-height: 1;
}

.stat-card .stat-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.stat-card.accent { border-left: 3px solid var(--accent); }
.stat-card.success { border-left: 3px solid var(--success); }
.stat-card.warning { border-left: 3px solid var(--warning); }
.stat-card.danger { border-left: 3px solid var(--danger); }

.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.quick-link {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: inherit;
    text-decoration: none;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.quick-link:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
    color: inherit;
}

.quick-link-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.quick-link h3 {
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.quick-link p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.info-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--accent-soft);
    border: 1px solid rgba(91, 108, 255, 0.2);
    border-radius: var(--radius);
    margin-top: 1.5rem;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.info-banner strong { color: var(--accent); }

/* ── Tables ── */

.table-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: left;
    padding: 0.85rem 1.25rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    background: var(--bg-muted);
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: none; }

.table tbody tr {
    transition: background var(--transition);
}

.table-hover tbody tr:hover {
    background: var(--bg-muted);
}

.table .actions {
    display: flex;
    gap: 0.4rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.queue-row-error { background: rgba(239, 68, 68, 0.04); }

.queue-table-card {
    overflow-x: auto;
}

.queue-actions-col {
    white-space: nowrap;
    min-width: 11rem;
}

.queue-actions-col .actions {
    justify-content: flex-start;
}

.queue-error-col {
    max-width: 280px;
}

.queue-error-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 260px;
}

/* ── Pipeline progress (Queue) ── */

.queue-progress-col {
    min-width: 200px;
    max-width: 280px;
}

/* ── Pagination ── */

.pagination-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}

.pagination-bar + .queue-table-card {
    margin-bottom: 0.75rem;
}

.pagination-info {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.pagination-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.pagination-page {
    font-size: 0.85rem;
    padding: 0 0.5rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.pagination-size {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-right: 0.35rem;
}

.pagination-size-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.pagination-size .form-select {
    width: auto;
    min-width: 4.5rem;
}

.pipeline-progress {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.pipeline-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
}

.pipeline-progress-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pipeline-progress-pct {
    font-size: 0.72rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    flex-shrink: 0;
}

.pipeline-progress-track {
    height: 6px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
}

.pipeline-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 999px;
    transition: width 0.4s ease;
}

.pipeline-progress-fill.is-active {
    background: linear-gradient(90deg, var(--accent), #8b5cf6);
}

.pipeline-progress-fill.is-done {
    background: var(--success);
}

.pipeline-progress-fill.is-error {
    background: var(--danger);
}

.pipeline-progress-message {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Buttons ── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition);
    white-space: nowrap;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 8px var(--accent-glow);
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: #fff;
    box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-secondary {
    background: var(--bg-muted);
    color: var(--text-primary);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: var(--border);
    color: var(--text-primary);
}

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; color: #fff; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }

.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #d97706; color: #fff; }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}

.btn-ghost:hover {
    background: var(--bg-muted);
    color: var(--text-primary);
}

.btn-sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
}

.btn-icon {
    padding: 0.45rem;
    min-width: 32px;
}

/* ── Forms ── */

.form-group { margin-bottom: 1.1rem; }

.form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.form-control, .form-select {
    width: 100%;
    padding: 0.6rem 0.85rem;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-primary);
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-control::placeholder { color: var(--text-muted); }

.form-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.form-error {
    font-size: 0.78rem;
    color: var(--danger);
    margin-top: 0.35rem;
}

.vault-dir-switch {
    margin-top: 0.5rem;
}

.vault-dir-quickpick {
    margin-top: 0.65rem;
}

.vault-dir-quickpick-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

/* ── Status pills ── */

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 999px;
    letter-spacing: 0.01em;
}

.pill::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.8;
}

.pill-discovered, .pill-downloading, .pill-transcribing, .pill-processing, .pill-linking, .pill-filing, .pill-committed {
    background: var(--info-soft);
    color: #2563eb;
}

.pill-awaitingreview {
    background: var(--warning-soft);
    color: #b45309;
}

.pill-done {
    background: var(--success-soft);
    color: #047857;
}

.pill-failed {
    background: var(--danger-soft);
    color: #b91c1c;
}

.type-pill {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 6px;
    background: var(--bg-muted);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.active-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.active-dot.on { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.active-dot.off { background: var(--text-muted); }

/* ── Modal ── */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 3rem 1rem;
    animation: fadeIn 200ms ease;
}

.modal-panel {
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 520px;
    animation: slideUp 250ms ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 1.1rem;
}

.modal-body { padding: 1.5rem; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--bg-muted);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.btn-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
}

.btn-close:hover { background: var(--border); }

/* ── Review ── */

.review-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.review-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 400px;
}

.review-panel-header {
    padding: 0.85rem 1.25rem;
    background: var(--bg-muted);
    border-bottom: 1px solid var(--border);
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.review-pane {
    flex: 1;
    margin: 0;
    padding: 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.65;
    color: var(--text-primary);
    background: var(--bg-surface);
    overflow: auto;
    max-height: 60vh;
    white-space: pre-wrap;
    word-break: break-word;
}

.review-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

/* ── Empty & loading ── */

.empty-state {
    text-align: center;
    padding: 3.5rem 2rem;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin: 0 0 1.25rem;
    font-size: 0.9rem;
}

.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 3rem;
    color: var(--text-secondary);
}

.spinner {
    width: 22px;
    height: 22px;
    border: 2.5px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.alert {
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    margin-bottom: 1rem;
}

.alert-danger {
    background: var(--danger-soft);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

/* ── Utilities ── */

.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-danger { color: var(--danger); }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px; }
.text-mono { font-family: var(--font-mono); font-size: 0.85em; }
.small { font-size: 0.82rem; }
.mt-3 { margin-top: 1rem; }
.mb-3 { margin-bottom: 1rem; }
.gap-2 { gap: 0.5rem; }
.d-flex { display: flex; }
.align-items-center { align-items: center; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
    .sidebar { width: 72px; }
    .sidebar-brand .logo-text, .sidebar-brand .logo-sub, .nav-section-label, .sidebar-nav a span, .sidebar-footer span { display: none; }
    .sidebar-nav a { justify-content: center; padding: 0.75rem; }
    .content { margin-left: 72px; }
    .content-inner { padding: 1.25rem; }
    .review-grid { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; }
}

/* ── Pipeline log ── */

.log-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.log-filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.log-filter-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.log-filter-btn {
    border: 1px solid var(--border);
    background: var(--bg-muted);
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    font-size: 0.82rem;
    cursor: pointer;
    transition: var(--transition);
}

.log-filter-btn.active,
.log-filter-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}

.log-item-filter {
    width: 280px;
    max-width: 100%;
}

.log-auto-refresh {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-left: auto;
}

.log-table-wrap { overflow-x: auto; }

.log-table .log-time {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    white-space: nowrap;
    color: var(--text-secondary);
}

.log-level {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}

.log-level-info { background: var(--info-soft); color: var(--info); }
.log-level-warning { background: var(--warning-soft); color: var(--warning); }
.log-level-error { background: var(--danger-soft); color: var(--danger); }

.log-message {
    font-size: 0.9rem;
    line-height: 1.45;
}

.log-exception {
    margin: 0.5rem 0 0;
    padding: 0.75rem;
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 240px;
    overflow: auto;
}

.log-row-error { background: rgba(239, 68, 68, 0.03); }

.log-clear-confirm {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.log-clear-actions {
    display: flex;
    gap: 0.5rem;
}

/* Blazor validation */
h1:focus { outline: none; }
.valid.modified:not([type=checkbox]) { outline: 1px solid var(--success); }
.invalid { outline: 1px solid var(--danger); }
.validation-message { color: var(--danger); font-size: 0.82rem; }

#blazor-error-ui {
    background: var(--danger);
    color: #fff;
    padding: 0.75rem 1.25rem;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    display: none;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    margin-left: 1rem;
}

/* Login: wwwroot/css/login.css */

.sidebar-logout-form {
    margin: 0 0 0.5rem;
    padding: 0;
}

.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-sidebar);
    font: inherit;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.sidebar-logout:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-sidebar-active);
}
