/* =============================================================
   VICIdial Screen Recorder — "Mission Control" Design System
   ============================================================= */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;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;600;700&display=swap');

/* --- CSS Variables --- */
:root {
    color-scheme: dark;

    /* Backgrounds */
    --bg-deep:        #0B0E14;
    --bg-base:        #101420;
    --bg-surface:     #141821;
    --bg-elevated:    #1C2130;
    --bg-hover:       #232839;
    --bg-glass:       rgba(20, 24, 33, 0.72);

    /* Borders */
    --border-subtle:  rgba(255, 255, 255, 0.04);
    --border-default: rgba(255, 255, 255, 0.07);
    --border-strong:  rgba(255, 255, 255, 0.12);

    /* Primary — Electric Teal */
    --primary:        #00D4AA;
    --primary-hover:  #00E5BB;
    --primary-muted:  rgba(0, 212, 170, 0.12);
    --primary-glow:   rgba(0, 212, 170, 0.25);

    /* Accent — Amber */
    --accent:         #FFB547;
    --accent-muted:   rgba(255, 181, 71, 0.12);

    /* Danger */
    --danger:         #FF5A5A;
    --danger-muted:   rgba(255, 90, 90, 0.12);
    --danger-hover:   #FF7070;

    /* Success */
    --success:        #00D68F;
    --success-muted:  rgba(0, 214, 143, 0.12);

    /* Info */
    --info:           #5B8DEF;
    --info-muted:     rgba(91, 141, 239, 0.12);

    /* Text */
    --text-primary:   #E8ECF1;
    --text-secondary: #7B8599;
    --text-muted:     #4A5168;
    --text-inverse:   #0B0E14;

    /* Typography */
    --font-body:      'DM Sans', -apple-system, sans-serif;
    --font-mono:      'JetBrains Mono', 'Fira Code', monospace;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.15);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.35), 0 2px 4px rgba(0,0,0,0.2);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.45), 0 4px 8px rgba(0,0,0,0.25);
    --shadow-glow: 0 0 20px var(--primary-glow);

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: 150ms var(--ease-out);
    --transition-base: 250ms var(--ease-out);
    --transition-slow: 400ms var(--ease-out);
}

/* --- Light Mode ("Daylight Operations") --- */
[data-theme="light"] {
    color-scheme: light;

    /* Backgrounds — cool blue-gray paper */
    --bg-deep:        #EDF0F5;
    --bg-base:        #F3F5F9;
    --bg-surface:     #FFFFFF;
    --bg-elevated:    #F0F2F7;
    --bg-hover:       #E4E7EF;
    --bg-glass:       rgba(255, 255, 255, 0.82);

    /* Borders — dark-based alphas */
    --border-subtle:  rgba(0, 0, 0, 0.04);
    --border-default: rgba(0, 0, 0, 0.09);
    --border-strong:  rgba(0, 0, 0, 0.15);

    /* Primary — deeper teal for light surface contrast */
    --primary:        #009B82;
    --primary-hover:  #00B394;
    --primary-muted:  rgba(0, 155, 130, 0.09);
    --primary-glow:   rgba(0, 155, 130, 0.15);

    /* Accent */
    --accent:         #C47D08;
    --accent-muted:   rgba(196, 125, 8, 0.09);

    /* Danger */
    --danger:         #DC3545;
    --danger-muted:   rgba(220, 53, 69, 0.08);
    --danger-hover:   #E84C5C;

    /* Success */
    --success:        #059669;
    --success-muted:  rgba(5, 150, 105, 0.08);

    /* Info */
    --info:           #4B6FD1;
    --info-muted:     rgba(75, 111, 209, 0.08);

    /* Text — navy darks */
    --text-primary:   #151B28;
    --text-secondary: #596578;
    --text-muted:     #9BA5B7;
    --text-inverse:   #FFFFFF;

    /* Shadows — softer for light backgrounds */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.03);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.03);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.08), 0 4px 8px rgba(0,0,0,0.04);
    --shadow-glow: 0 0 20px var(--primary-glow);
}

/* Light mode — element-specific overrides */
[data-theme="light"] body::before {
    background-image:
        radial-gradient(circle at 25% 25%, rgba(0, 155, 130, 0.025) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(75, 111, 209, 0.025) 0%, transparent 50%);
}

[data-theme="light"] .sr-filter-group input[type="date"],
[data-theme="light"] .sr-input[type="date"],
[data-theme="light"] .sr-input[type="number"],
[data-theme="light"] .sr-select {
    color-scheme: light;
}

[data-theme="light"] .sr-modal-overlay {
    background: rgba(0, 0, 0, 0.35);
}

[data-theme="light"] .sr-badge-neutral {
    background: rgba(89, 101, 120, 0.10);
}

[data-theme="light"] .sr-topbar-brand .brand-icon svg {
    fill: var(--text-inverse);
}

/* --- Theme Toggle --- */
.sr-theme-toggle {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
    padding: 0;
}

.sr-theme-toggle:hover {
    border-color: var(--border-strong);
    color: var(--text-primary);
    background: var(--bg-hover);
}

.sr-theme-toggle svg {
    width: 16px;
    height: 16px;
    transition: transform 0.35s var(--ease-out);
}

.sr-theme-toggle:hover svg {
    transform: rotate(15deg);
}

/* Default (dark mode): show sun icon (click to go light) */
.sr-theme-toggle .icon-sun  { display: flex; }
.sr-theme-toggle .icon-moon { display: none; }

/* Light mode: show moon icon (click to go dark) */
[data-theme="light"] .sr-theme-toggle .icon-sun  { display: none; }
[data-theme="light"] .sr-theme-toggle .icon-moon { display: flex; }

/* Smooth theme transition (applied momentarily during toggle) */
html.sr-theme-transition,
html.sr-theme-transition *,
html.sr-theme-transition *::before,
html.sr-theme-transition *::after {
    transition: background-color 0.4s ease, color 0.3s ease, border-color 0.4s ease, box-shadow 0.4s ease, fill 0.3s ease !important;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Subtle grid noise background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(0,212,170,0.015) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(91,141,239,0.015) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

body > * {
    position: relative;
    z-index: 1;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
}

::selection {
    background: var(--primary-muted);
    color: var(--text-primary);
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* =============================================================
   LAYOUT
   ============================================================= */

.sr-app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Top Navigation Bar --- */
.sr-topbar {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-default);
    padding: 0 var(--space-lg);
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.sr-topbar-left {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.sr-topbar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.sr-topbar-brand .brand-icon {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--primary), var(--info));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sr-topbar-brand .brand-icon svg {
    width: 16px;
    height: 16px;
    fill: var(--bg-deep);
}

.sr-topbar-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 100%;
}

.sr-topbar-nav a {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0 var(--space-md);
    height: 56px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.sr-topbar-nav a:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.sr-topbar-nav a.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.sr-topbar-nav a svg {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

.sr-topbar-nav a.active svg {
    opacity: 1;
}

.sr-topbar-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.sr-topbar-user {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 13px;
    color: var(--text-secondary);
}

.sr-topbar-user strong {
    color: var(--text-primary);
    font-weight: 500;
}

.sr-topbar-user .user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary-muted);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    font-family: var(--font-mono);
}

/* Logout button */
.sr-logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    transition: all var(--transition-fast);
    text-decoration: none;
    cursor: pointer;
}

.sr-logout-btn:hover {
    color: var(--danger, #dc3545);
    border-color: var(--danger, #dc3545);
    background: var(--bg-hover);
}

.sr-logout-btn svg {
    width: 14px;
    height: 14px;
}

/* Language selector */
.sr-lang-selector {
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    padding: 2px;
}

.sr-lang-selector a {
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    color: var(--text-muted);
    transition: all var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sr-lang-selector a:hover {
    color: var(--text-secondary);
}

.sr-lang-selector a.active {
    background: var(--primary-muted);
    color: var(--primary);
}

/* --- Main Content --- */
.sr-content {
    flex: 1;
    padding: var(--space-xl);
    max-width: 1500px;
    margin: 0 auto;
    width: 100%;
}

/* --- Page Header --- */
.sr-page-header {
    margin-bottom: var(--space-xl);
    animation: fadeSlideIn 0.5s var(--ease-out) both;
}

.sr-page-header h1 {
    font-family: var(--font-mono);
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.sr-page-header p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: var(--space-xs);
}

/* =============================================================
   COMPONENTS
   ============================================================= */

/* --- Cards --- */
.sr-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.sr-card:hover {
    border-color: var(--border-strong);
}

.sr-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
}

.sr-card-header h2,
.sr-card-header h3 {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

.sr-card-body {
    padding: var(--space-lg);
}

/* --- Stat Cards --- */
.sr-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.sr-stat {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-fast);
}

.sr-stat:hover {
    border-color: var(--border-strong);
    transform: translateY(-1px);
}

.sr-stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.sr-stat:hover::before {
    opacity: 1;
}

.sr-stat .stat-value {
    font-family: var(--font-mono);
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.sr-stat .stat-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: var(--space-sm);
}

.sr-stat.stat-primary .stat-value { color: var(--primary); }
.sr-stat.stat-danger .stat-value  { color: var(--danger); }
.sr-stat.stat-success .stat-value { color: var(--success); }
.sr-stat.stat-info .stat-value    { color: var(--info); }
.sr-stat.stat-accent .stat-value  { color: var(--accent); }

.sr-stat.stat-primary::before { background: var(--primary); }
.sr-stat.stat-danger::before  { background: var(--danger); }
.sr-stat.stat-success::before { background: var(--success); }
.sr-stat.stat-info::before    { background: var(--info); }
.sr-stat.stat-accent::before  { background: var(--accent); }

/* --- Buttons --- */
.sr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 9px 18px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    line-height: 1.4;
}

.sr-btn:active {
    transform: scale(0.97);
}

.sr-btn-primary {
    background: var(--primary);
    color: var(--text-inverse);
    border-color: var(--primary);
}

.sr-btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: var(--shadow-glow);
    color: var(--text-inverse);
}

.sr-btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.sr-btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

.sr-btn-danger {
    background: var(--danger-muted);
    color: var(--danger);
    border-color: rgba(255, 90, 90, 0.2);
}

.sr-btn-danger:hover {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

.sr-btn-success {
    background: var(--success-muted);
    color: var(--success);
    border-color: rgba(0, 214, 143, 0.2);
}

.sr-btn-success:hover {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}

.sr-btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}

.sr-btn-ghost:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.sr-btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

.sr-btn-xs {
    padding: 3px 8px;
    font-size: 11px;
}

/* --- Forms --- */
.sr-form-group {
    margin-bottom: var(--space-lg);
}

.sr-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sr-input,
.sr-select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-deep);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    transition: all var(--transition-fast);
    outline: none;
}

.sr-input:focus,
.sr-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-muted);
}

.sr-input::placeholder {
    color: var(--text-muted);
}

.sr-help-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

.sr-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-lg);
}

.sr-checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
}

.sr-checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-strong);
    border-radius: 4px;
    background: var(--bg-deep);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sr-checkbox input[type="checkbox"]:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.sr-checkbox input[type="checkbox"]:checked::after {
    content: '✓';
    color: var(--text-inverse);
    font-size: 12px;
    font-weight: 700;
}

.sr-checkbox span {
    font-size: 14px;
    color: var(--text-primary);
}

/* --- Tables --- */
.sr-table-wrap {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.sr-table {
    width: 100%;
    border-collapse: collapse;
}

.sr-table thead {
    background: var(--bg-elevated);
}

.sr-table th {
    padding: 11px var(--space-md);
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border-default);
    white-space: nowrap;
}

.sr-table td {
    padding: 12px var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
    font-size: 13px;
    color: var(--text-primary);
    vertical-align: middle;
}

.sr-table tbody tr {
    transition: background var(--transition-fast);
}

.sr-table tbody tr:hover {
    background: var(--bg-hover);
}

.sr-table tbody tr:last-child td {
    border-bottom: none;
}

.sr-table .mono {
    font-family: var(--font-mono);
    font-size: 12px;
}

/* --- Badges --- */
.sr-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sr-badge-success {
    background: var(--success-muted);
    color: var(--success);
}

.sr-badge-danger {
    background: var(--danger-muted);
    color: var(--danger);
}

.sr-badge-info {
    background: var(--info-muted);
    color: var(--info);
}

.sr-badge-accent {
    background: var(--accent-muted);
    color: var(--accent);
}

.sr-badge-neutral {
    background: rgba(123, 133, 153, 0.12);
    color: var(--text-secondary);
}

/* --- Status Dots --- */
.sr-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.sr-dot-success { background: var(--success); box-shadow: 0 0 6px var(--success-muted); }
.sr-dot-danger  { background: var(--danger); box-shadow: 0 0 6px var(--danger-muted); }
.sr-dot-accent  { background: var(--accent); box-shadow: 0 0 6px var(--accent-muted); }
.sr-dot-info    { background: var(--info); box-shadow: 0 0 6px var(--info-muted); }

/* --- Tabs --- */
.sr-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: var(--space-xl);
    border-bottom: 1px solid var(--border-default);
    overflow-x: auto;
}

.sr-tab {
    padding: var(--space-sm) var(--space-lg);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    margin-bottom: -1px;
}

.sr-tab:hover {
    color: var(--text-secondary);
}

.sr-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.sr-tab-content {
    display: none;
}

.sr-tab-content.active {
    display: block;
    animation: fadeIn 0.3s var(--ease-out);
}

/* --- Modal --- */
.sr-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: var(--space-xl);
}

.sr-modal-overlay.active {
    display: flex;
    animation: fadeIn 0.2s var(--ease-out);
}

.sr-modal {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.35s var(--ease-out);
}

.sr-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
}

.sr-modal-header h3 {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.sr-modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.sr-modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sr-modal-body {
    padding: 0;
}

.sr-modal-body video {
    width: 100%;
    max-height: 65vh;
    display: block;
    background: #000;
}

.sr-modal-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-elevated);
    border-top: 1px solid var(--border-subtle);
}

.sr-modal-info-item .label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 2px;
}

.sr-modal-info-item .value {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-primary);
}

/* Audio section in modal */
.sr-modal-audio {
    display: none;
    padding: var(--space-sm) var(--space-lg);
    background: var(--bg-deep);
    border-top: 1px solid var(--border-subtle);
}

.sr-modal-audio.active {
    display: block;
}

.sr-modal-audio-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.sr-modal-audio-label strong {
    font-size: 12px;
    color: var(--success);
    font-weight: 600;
}

.sr-modal-audio-label span {
    font-size: 11px;
    color: var(--text-muted);
}

.sr-modal-audio audio {
    width: 100%;
    height: 32px;
}

/* --- Pagination --- */
.sr-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-lg);
}

.sr-pagination button {
    padding: 7px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sr-pagination button:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.sr-pagination button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.sr-pagination .page-info {
    font-size: 13px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    padding: 0 var(--space-sm);
}

/* --- Filters --- */
.sr-filters {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.sr-filters-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: var(--space-md);
}

.sr-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    align-items: flex-end;
}

.sr-filter-group {
    display: flex;
    flex-direction: column;
    min-width: 150px;
    flex: 1;
}

.sr-filter-group label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sr-filter-group input,
.sr-filter-group select {
    padding: 9px 12px;
    background: var(--bg-deep);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 13px;
    transition: all var(--transition-fast);
    outline: none;
}

.sr-filter-group input:focus,
.sr-filter-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-muted);
}

.sr-filter-group input::placeholder {
    color: var(--text-muted);
}

/* Date inputs need color-scheme for dark mode */
.sr-filter-group input[type="date"] {
    color-scheme: dark;
}

.sr-input[type="date"],
.sr-input[type="number"] {
    color-scheme: dark;
}

.sr-select {
    color-scheme: dark;
}

.sr-filter-actions {
    display: flex;
    gap: var(--space-sm);
    padding-bottom: 1px; /* align with inputs */
}

/* --- Loading --- */
.sr-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-2xl);
    color: var(--text-muted);
    font-size: 13px;
}

.sr-loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-strong);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* --- Messages --- */
.sr-message {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    animation: fadeSlideIn 0.4s var(--ease-out);
}

.sr-message-success {
    background: var(--success-muted);
    color: var(--success);
    border: 1px solid rgba(0, 214, 143, 0.2);
}

.sr-message-error {
    background: var(--danger-muted);
    color: var(--danger);
    border: 1px solid rgba(255, 90, 90, 0.2);
}

/* --- Storage Bar --- */
.sr-storage-bar {
    background: var(--bg-deep);
    border-radius: var(--radius-sm);
    height: 8px;
    overflow: hidden;
    margin: var(--space-md) 0;
}

.sr-storage-bar-fill {
    height: 100%;
    border-radius: var(--radius-sm);
    background: linear-gradient(90deg, var(--success), var(--accent), var(--danger));
    background-size: 300% 100%;
    transition: width 0.6s var(--ease-out);
}

.sr-storage-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* --- Agent Items (Monitor) --- */
.sr-agent-list {
    list-style: none;
}

.sr-agent-item {
    display: flex;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--transition-fast);
}

.sr-agent-item:hover {
    background: var(--bg-hover);
}

.sr-agent-item:last-child {
    border-bottom: none;
}

.sr-agent-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary-muted);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    font-family: var(--font-mono);
    margin-right: var(--space-md);
    flex-shrink: 0;
}

.sr-agent-info {
    flex: 1;
    min-width: 0;
}

.sr-agent-name {
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.sr-agent-details {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.sr-agent-status {
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sr-agent-status.status-incall {
    background: var(--danger-muted);
    color: var(--danger);
}

.sr-agent-status.status-ready {
    background: var(--success-muted);
    color: var(--success);
}

.sr-agent-status.status-paused {
    background: var(--accent-muted);
    color: var(--accent);
}

.sr-campaign-badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--info-muted);
    color: var(--info);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
}

.sr-rec-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: var(--space-sm);
    font-size: 11px;
    font-weight: 700;
    color: var(--danger);
    font-family: var(--font-mono);
    letter-spacing: 0.04em;
}

.sr-rec-dot {
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    animation: pulse 1.2s ease-in-out infinite;
    box-shadow: 0 0 6px var(--danger-muted);
}

/* --- Activity Items (Monitor) --- */
.sr-activity-list {
    list-style: none;
}

.sr-activity-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
}

.sr-activity-item:last-child {
    border-bottom: none;
}

.sr-activity-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}

.sr-activity-icon.upload { background: var(--info-muted); color: var(--info); }
.sr-activity-icon.start  { background: var(--success-muted); color: var(--success); }
.sr-activity-icon.error  { background: var(--danger-muted); color: var(--danger); }

.sr-activity-content {
    flex: 1;
    min-width: 0;
}

.sr-activity-title {
    font-weight: 500;
    font-size: 13px;
}

.sr-activity-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.sr-activity-time {
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    white-space: nowrap;
}

/* --- Grid Layouts --- */
.sr-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
}

.sr-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
}

/* --- Info Rows (Recording detail) --- */
.sr-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.sr-info-row:last-child {
    border-bottom: none;
}

.sr-info-row .label {
    font-size: 12px;
    color: var(--text-muted);
}

.sr-info-row .value {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

/* --- Video Player (Recording detail) --- */
.sr-video-section {
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--space-xl);
    border: 1px solid var(--border-default);
}

.sr-video-section video {
    width: 100%;
    max-height: 70vh;
    display: block;
}

/* --- No data --- */
.sr-no-data {
    padding: var(--space-2xl);
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* --- Refresh indicator --- */
.sr-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.sr-refresh.active {
    color: var(--primary);
}

.sr-refresh-icon {
    display: inline-block;
    transition: transform 0.4s var(--ease-out);
}

.sr-refresh.active .sr-refresh-icon {
    transform: rotate(180deg);
}

/* --- Pre/Code --- */
pre.sr-code {
    background: var(--bg-deep);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    overflow-x: auto;
    line-height: 1.7;
}

/* --- Status indicator (system checks) --- */
.sr-status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.sr-status-dot.ok      { background: var(--success); }
.sr-status-dot.warning  { background: var(--accent); }
.sr-status-dot.error    { background: var(--danger); }

/* --- Divider --- */
.sr-divider {
    border: none;
    border-top: 1px solid var(--border-default);
    margin: var(--space-xl) 0;
}

/* --- Guide Steps (Downloads) --- */
.sr-guide {
    line-height: 1.7;
}

.sr-step {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border-subtle);
}

.sr-step:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.sr-step:first-child {
    padding-top: 0;
}

.sr-step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-muted);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    font-family: var(--font-mono);
    flex-shrink: 0;
}

.sr-step-content h3 {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.sr-step-content p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.sr-guide-note {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--accent-muted);
    color: var(--accent);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
}

.sr-faq {
    border-bottom: 1px solid var(--border-subtle);
    padding: var(--space-md) 0;
}

.sr-faq:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.sr-faq:first-child {
    padding-top: 0;
}

.sr-faq summary {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.sr-faq summary::before {
    content: '\25B6';
    font-size: 10px;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.sr-faq[open] summary::before {
    transform: rotate(90deg);
}

.sr-faq summary::-webkit-details-marker {
    display: none;
}

.sr-faq p {
    margin: var(--space-sm) 0 0 20px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* =============================================================
   ANIMATIONS
   ============================================================= */

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(0.85); }
}

/* Stagger animation helper */
.sr-stagger > * {
    animation: fadeSlideIn 0.5s var(--ease-out) both;
}

.sr-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.sr-stagger > *:nth-child(2) { animation-delay: 0.1s; }
.sr-stagger > *:nth-child(3) { animation-delay: 0.15s; }
.sr-stagger > *:nth-child(4) { animation-delay: 0.2s; }
.sr-stagger > *:nth-child(5) { animation-delay: 0.25s; }
.sr-stagger > *:nth-child(6) { animation-delay: 0.3s; }

/* =============================================================
   RESPONSIVE
   ============================================================= */

@media (max-width: 1200px) {
    .sr-grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sr-topbar {
        padding: 0 var(--space-md);
        height: 48px;
    }

    .sr-topbar-nav a {
        padding: 0 var(--space-sm);
        font-size: 12px;
        height: 48px;
    }

    .sr-topbar-nav a span.nav-label {
        display: none;
    }

    .sr-content {
        padding: var(--space-md);
    }

    .sr-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .sr-stat .stat-value {
        font-size: 22px;
    }

    .sr-filter-row {
        flex-direction: column;
    }

    .sr-filter-group {
        min-width: 100%;
    }

    .sr-table {
        font-size: 12px;
    }

    .sr-table th,
    .sr-table td {
        padding: 8px 10px;
    }

    .sr-modal {
        border-radius: var(--radius-md);
        max-width: 100%;
    }

    .sr-grid-3 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .sr-topbar-brand .brand-text {
        display: none;
    }

    .sr-stats {
        grid-template-columns: 1fr;
    }
}
