/* ══════════════════════════════════════════════════════════
   Intercept — Dashboard Stylesheet
   Design tokens from logo-palette.txt and brand assets.
   ══════════════════════════════════════════════════════════ */

/* ── CSS Custom Properties (Dark Theme — Default) ─────── */
:root {
    /* Brand palette */
    --color-deep-slate: #1e293b;
    --color-charcoal: #111827;
    --color-navy: #1f2a44;
    --color-accent-cyan: #0e7490;
    --color-accent-blue: #2563eb;
    --color-soft-gray: #9ca3af;
    --color-dark-surface: #0b1220;
    --color-light-surface: #f8fafc;
    --color-off-white: #e5e7eb;

    /* Semantic tokens — dark theme */
    --bg-primary: var(--color-dark-surface);
    --bg-secondary: var(--color-charcoal);
    --bg-surface: var(--color-deep-slate);
    --bg-elevated: #1e293b;
    --bg-hover: #293245;
    --bg-input: #0f172a;

    --text-primary: var(--color-off-white);
    --text-secondary: var(--color-soft-gray);
    --text-muted: #6b7280;
    --text-accent: var(--color-accent-cyan);

    --border-color: #374151;
    --border-subtle: #1f2937;

    --accent: var(--color-accent-cyan);
    --accent-hover: #0891b2;
    --accent-blue: var(--color-accent-blue);

    /* Status colors */
    --status-recording: #ef4444;
    --status-pending: #f59e0b;
    --status-transcribed: #10b981;
    --status-error: #ef4444;
    --status-stopped: var(--color-soft-gray);

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Typography */
    --font-family:
        "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue",
        sans-serif;
    --font-mono: "Cascadia Code", "Fira Code", "Consolas", monospace;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.8125rem;
    --font-size-base: 0.875rem;
    --font-size-md: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.5rem;

    /* Borders & Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.5);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;

    /* Layout */
    --nav-height: 56px;
    --sidebar-width: 220px;
    --content-max-width: 1200px;
}

/* ── Light Theme ──────────────────────────────────────── */
[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-surface: #f1f5f9;
    --bg-elevated: #ffffff;
    --bg-hover: #e2e8f0;
    --bg-input: #ffffff;

    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --text-accent: #0e7490;

    --border-color: #d1d5db;
    --border-subtle: #e5e7eb;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* ── Reset & Base ─────────────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--text-primary);
    background: var(--bg-primary);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--text-accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover {
    color: var(--accent-hover);
}

code,
pre {
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
}

img {
    display: block;
    max-width: 100%;
}

/* ── Layout ───────────────────────────────────────────── */
.app-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: var(--space-md);
    height: var(--nav-height);
    padding: 0 var(--space-lg);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.app-nav__logo {
    height: 28px;
    width: auto;
}

.app-nav__links {
    display: flex;
    gap: var(--space-xs);
    list-style: none;
    margin-left: var(--space-lg);
}

.app-nav__link {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.app-nav__link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.app-nav__link.active {
    background: var(--bg-hover);
    color: var(--text-accent);
}

.app-nav__spacer {
    flex: 1;
}

.app-nav__status {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.app-nav__status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--status-stopped);
}

.app-nav__status-dot.recording {
    background: var(--status-recording);
    animation: pulse 1.5s ease-in-out infinite;
}

.app-nav__status-dot.authenticated {
    background: var(--status-transcribed);
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}

.app-main {
    flex: 1;
    padding: var(--space-xl) var(--space-lg);
    max-width: var(--content-max-width);
    width: 100%;
    margin: 0 auto;
}

/* ── Page Header ──────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
}

.page-header__title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--text-primary);
}

.page-header__subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-top: var(--space-xs);
}

.page-header__actions {
    display: flex;
    gap: var(--space-sm);
}

/* ── Cards & Panels ───────────────────────────────────── */
.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: box-shadow var(--transition-fast);
}

.card:hover {
    box-shadow: var(--shadow-sm);
}

.card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.card__title {
    font-size: var(--font-size-md);
    font-weight: 600;
    color: var(--text-primary);
}

.card__subtitle {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--space-md);
}

/* ── Stat Cards ───────────────────────────────────────── */
.stat-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    padding: var(--space-lg);
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.stat-card__label {
    font-size: var(--font-size-xs);
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card__value {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text-primary);
}

.stat-card__detail {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

/* ── Tables ───────────────────────────────────────────── */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-elevated);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

thead th {
    text-align: left;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-color);
}

tbody tr {
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--transition-fast);
}

tbody tr:last-child {
    border-bottom: none;
}

tbody tr:hover {
    background: var(--bg-hover);
}

tbody td {
    padding: var(--space-sm) var(--space-md);
    color: var(--text-primary);
    vertical-align: middle;
}

.table-empty {
    padding: var(--space-2xl);
    text-align: center;
    color: var(--text-muted);
}

/* ── Status Badges ────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: var(--font-size-xs);
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
}

.badge--recording {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}
[data-theme="light"] .badge--recording {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.badge--pending {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
}
[data-theme="light"] .badge--pending {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.badge--transcribed {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
}
[data-theme="light"] .badge--transcribed {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.badge--error {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}
[data-theme="light"] .badge--error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.badge--stopped,
.badge--default {
    background: rgba(156, 163, 175, 0.15);
    color: var(--text-secondary);
}

/* ── Sync Status Badges ───────────────────────────────── */
.badge--sync-pending {
    background: rgba(156, 163, 175, 0.1);
    color: var(--text-secondary);
    opacity: 0.7;
    font-size: 10px;
    padding: 1px 5px;
}

.badge--sync-synced {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    font-size: 10px;
    padding: 1px 5px;
}
[data-theme="light"] .badge--sync-synced {
    color: #059669;
}

.badge--sync-error {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    font-size: 10px;
    padding: 1px 5px;
}
[data-theme="light"] .badge--sync-error {
    color: #dc2626;
}

/* ── Machine Badges ───────────────────────────────────── */
.machine-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 9999px;
    font-size: 10px;
    font-weight: 500;
    background: rgba(156, 163, 175, 0.12);
    color: var(--text-secondary);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.machine-badge--current {
    background: rgba(14, 116, 144, 0.18);
    color: var(--accent);
    border: 1px solid rgba(14, 116, 144, 0.3);
}
[data-theme="light"] .machine-badge--current {
    color: #0e7490;
    border-color: rgba(14, 116, 144, 0.4);
}

/* ── Buttons ──────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    line-height: 1.4;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}
.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border-color);
}
.btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover);
}

.btn-danger {
    background: transparent;
    color: var(--status-error);
    border-color: var(--status-error);
}
.btn-danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.1);
}

.btn-sm {
    padding: 2px var(--space-sm);
    font-size: var(--font-size-xs);
}

.btn-icon {
    padding: var(--space-sm);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}
.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ── Forms & Inputs ───────────────────────────────────── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
}

.form-label {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
}

.form-hint {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.form-input,
.form-select {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    transition: border-color var(--transition-fast);
    width: 100%;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(14, 116, 144, 0.2);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
}

/* ── Search ───────────────────────────────────────────── */
.search-bar {
    position: relative;
    max-width: 480px;
    width: 100%;
}

.search-bar__icon {
    position: absolute;
    left: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    font-size: var(--font-size-md);
}

.search-bar__input {
    width: 100%;
    padding: var(--space-sm) var(--space-md) var(--space-sm) 2.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    transition: border-color var(--transition-fast);
}

.search-bar__input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(14, 116, 144, 0.2);
}

.search-bar__clear {
    position: absolute;
    right: var(--space-sm);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
    display: none;
}
.search-bar__clear.visible {
    display: block;
}

.search-results {
    margin-top: var(--space-md);
}

.search-result {
    padding: var(--space-md);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    background: var(--bg-elevated);
    transition: border-color var(--transition-fast);
}

.search-result:hover {
    border-color: var(--border-color);
}

.search-result__header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xs);
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.search-result__text {
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    line-height: 1.6;
}

.search-result__text mark {
    background: rgba(14, 116, 144, 0.25);
    color: var(--text-accent);
    padding: 0 2px;
    border-radius: 2px;
}

[data-theme="light"] .search-result__text mark {
    background: rgba(14, 116, 144, 0.15);
}

/* ── Audio Player ─────────────────────────────────────── */
.audio-player {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.audio-player__controls {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.audio-player__play-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: #ffffff;
    cursor: pointer;
    transition: background var(--transition-fast);
    flex-shrink: 0;
}
.audio-player__play-btn:hover {
    background: var(--accent-hover);
}

.audio-player__progress-wrap {
    flex: 1;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
}

.audio-player__progress {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    width: 0%;
    transition: width 100ms linear;
    position: relative;
}

.audio-player__progress::after {
    content: "";
    position: absolute;
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
    border: 2px solid var(--bg-surface);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.audio-player:hover .audio-player__progress::after {
    opacity: 1;
}

.audio-player__time {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    min-width: 80px;
    text-align: right;
}

.audio-player__extras {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.audio-player__speed {
    display: flex;
    gap: 2px;
}

.audio-player__speed-btn {
    padding: 2px 6px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-size: var(--font-size-xs);
    cursor: pointer;
    transition: all var(--transition-fast);
}
.audio-player__speed-btn.active,
.audio-player__speed-btn:hover {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

.audio-player__channel-toggle {
    display: flex;
    gap: 2px;
}

.audio-player__channel-btn {
    padding: 2px 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-size: var(--font-size-xs);
    cursor: pointer;
    transition: all var(--transition-fast);
}
.audio-player__channel-btn.active {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

/* ── Transcript Segments ──────────────────────────────── */
.transcript-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.transcript-segment {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    transition:
        background var(--transition-fast),
        border-color var(--transition-fast);
    cursor: pointer;
    position: relative;
}

.transcript-segment--pending {
    cursor: default;
    border: 1px dashed var(--border-color);
    background: color-mix(in srgb, var(--bg-elevated) 88%, var(--status-pending) 12%);
}

.transcript-segment__text--pending {
    color: var(--text-secondary);
    font-style: italic;
}

.transcript-segment:hover {
    background: var(--bg-hover);
}

.transcript-segment--pending:hover {
    background: color-mix(in srgb, var(--bg-elevated) 85%, var(--status-pending) 15%);
}

.transcript-segment.active {
    background: rgba(14, 116, 144, 0.15);
    border-left: 4px solid var(--accent);
    padding-left: calc(var(--space-md) - 4px);
    box-shadow: inset 0 0 0 1px rgba(14, 116, 144, 0.2);
}

@keyframes playingPulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

.transcript-segment.active .transcript-segment__time::before {
    content: "\25B6\00a0";
    color: var(--accent);
    font-size: 9px;
    animation: playingPulse 1.2s ease-in-out infinite;
    display: inline;
}

/* Channel distinction */
.transcript-segment--mic {
    border-left: 2px solid rgba(37, 99, 235, 0.35);
    padding-left: calc(var(--space-md) - 2px);
}

.transcript-segment--loopback {
    border-left: 2px solid rgba(14, 116, 144, 0.35);
    padding-left: calc(var(--space-md) - 2px);
}

.transcript-segment--mic.active {
    border-left-color: var(--accent-blue);
}

.transcript-segment--loopback.active {
    border-left-color: var(--accent);
}

.transcript-segment__body {
    min-width: 0;
}

.transcript-segment__channel-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 9999px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.transcript-segment__channel-tag--mic {
    background: rgba(37, 99, 235, 0.12);
    color: #93c5fd;
}

.transcript-segment__channel-tag--loopback {
    background: rgba(14, 116, 144, 0.12);
    color: #67e8f9;
}

/* Channel filter tabs */
.channel-filter {
    display: flex;
    gap: var(--space-xs);
    margin-left: auto;
}

.channel-filter__btn {
    font-size: var(--font-size-xs);
    padding: 3px 10px;
    border-radius: 9999px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition:
        background var(--transition-fast),
        color var(--transition-fast);
}

.channel-filter__btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.channel-filter__btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.transcript-segment__time {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    min-width: 60px;
    padding-top: 2px;
    user-select: none;
}

.transcript-segment__text {
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    line-height: 1.6;
}

.transcript-segment__meta {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── Filters Bar ──────────────────────────────────────── */
.filters-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.filters-bar .form-input,
.filters-bar .form-select {
    width: auto;
    min-width: 140px;
}

/* ── Settings Form ────────────────────────────────────── */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-lg);
}

.settings-section {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.settings-section__title {
    font-size: var(--font-size-md);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-subtle);
}

.settings-subtitle {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-secondary);
    margin: var(--space-md) 0 var(--space-sm);
}

.model-mgmt-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-sm);
}

.model-mgmt-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.model-mgmt-item__label {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.model-mgmt-item__value {
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    font-weight: 600;
}

.model-download-progress {
    width: 100%;
    height: 12px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.model-download-progress::-webkit-progress-bar {
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
}

.model-download-progress::-webkit-progress-value {
    background: var(--accent);
    border-radius: var(--radius-sm);
}

.model-download-progress::-moz-progress-bar {
    background: var(--accent);
    border-radius: var(--radius-sm);
}

/* ── Status Dashboard ─────────────────────────────────── */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

/* ── Toast Notifications ──────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    animation: slideIn 250ms ease;
    max-width: 360px;
}

.toast--success {
    border-left: 3px solid var(--status-transcribed);
}
.toast--error {
    border-left: 3px solid var(--status-error);
}
.toast--info {
    border-left: 3px solid var(--accent);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast__close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    margin-left: auto;
    padding: 2px;
}

/* ── Loading States ───────────────────────────────────── */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: var(--space-sm);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Pagination ───────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-md) 0;
}

.pagination__btn {
    padding: var(--space-xs) var(--space-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pagination__btn:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.pagination__btn.active {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

.pagination__btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ── Misc Utilities ───────────────────────────────────── */
.text-muted {
    color: var(--text-muted);
}
.text-accent {
    color: var(--text-accent);
}
.text-sm {
    font-size: var(--font-size-sm);
}
.text-xs {
    font-size: var(--font-size-xs);
}
.text-right {
    text-align: right;
}
.text-center {
    text-align: center;
}
.font-mono {
    font-family: var(--font-mono);
}
.font-bold {
    font-weight: 600;
}
.mt-sm {
    margin-top: var(--space-sm);
}
.mt-md {
    margin-top: var(--space-md);
}
.mt-lg {
    margin-top: var(--space-lg);
}
.mb-md {
    margin-bottom: var(--space-md);
}
.mb-lg {
    margin-bottom: var(--space-lg);
}
.gap-sm {
    gap: var(--space-sm);
}
.flex {
    display: flex;
}
.flex-col {
    flex-direction: column;
}
.items-center {
    align-items: center;
}
.justify-between {
    justify-content: space-between;
}
.hidden {
    display: none !important;
}
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 768px) {
    .app-nav__links {
        display: none;
    }
    .app-main {
        padding: var(--space-md);
    }
    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .filters-bar .form-input,
    .filters-bar .form-select {
        width: 100%;
    }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }
    .settings-grid {
        grid-template-columns: 1fr;
    }
    .status-grid {
        grid-template-columns: 1fr;
    }
    .card-grid {
        grid-template-columns: 1fr;
    }
}
