/* ============================================================
   Vynex — Modern dark design system (Linear / Vercel-inspired)
   Dark by default, light mode via :root (no [data-theme])
   Toggle: html[data-theme="light"] flips to light palette
   ============================================================ */

:root {
    color-scheme: dark;

    /* Surfaces */
    --bg: #0a0a0b;
    --bg-elevated: #121214;
    --surface: #161619;
    --surface-2: #1c1c20;
    --surface-hover: #232328;

    /* Borders */
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);
    --border-focus: rgba(255, 45, 85, 0.5);

    /* Text */
    --text: #f5f5f7;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --text-subtle: #52525b;

    /* Accent (YouTube identity) */
    --accent: #ff2d55;
    --accent-hover: #ff4569;
    --accent-active: #e02448;
    --accent-soft: rgba(255, 45, 85, 0.12);
    --accent-glow: rgba(255, 45, 85, 0.35);
    --accent-gradient: linear-gradient(135deg, #ff2d55 0%, #ff6b9d 100%);

    /* Semantic */
    --success: #10b981;
    --success-soft: rgba(16, 185, 129, 0.12);
    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.12);
    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, 0.12);
    --info: #3b82f6;
    --info-soft: rgba(59, 130, 246, 0.12);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 32px var(--accent-glow);

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Transitions */
    --t-fast: 120ms cubic-bezier(0.4, 0, 0.2, 1);
    --t: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --t-slow: 320ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Layout */
    --navbar-h: 64px;
    --container-max: 1240px;

    /* Legacy aliases — kept for views not yet migrated */
    --bg-primary: var(--bg);
    --bg-secondary: var(--surface);
    --bg-tertiary: var(--surface-2);
    --bg-card: var(--surface);
    --bg-card-hover: var(--surface-hover);
    --bg-glass: rgba(255, 255, 255, 0.04);
    --bg-glass-strong: rgba(255, 255, 255, 0.08);
    --accent-light: var(--accent-hover);
    --text-primary: var(--text);
    --border-hover: var(--border-strong);
    --navbar-bg: rgba(10, 10, 11, 0.72);
    --dropdown-bg: var(--surface-2);
    --scrollbar-thumb: rgba(255, 255, 255, 0.12);
    --scrollbar-thumb-hover: rgba(255, 255, 255, 0.24);
    --auth-bg: var(--bg);
}

[data-theme="light"] {
    color-scheme: light;

    --bg: #fafafa;
    --bg-elevated: #ffffff;
    --surface: #ffffff;
    --surface-2: #f4f4f5;
    --surface-hover: #e4e4e7;

    --border: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.16);

    --text: #18181b;
    --text-secondary: #52525b;
    --text-muted: #71717a;
    --text-subtle: #a1a1aa;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 32px rgba(0, 0, 0, 0.12);

    --navbar-bg: rgba(250, 250, 250, 0.85);
    --dropdown-bg: #ffffff;
    --scrollbar-thumb: rgba(0, 0, 0, 0.16);
    --scrollbar-thumb-hover: rgba(0, 0, 0, 0.32);
    --auth-bg: var(--bg);
}

/* ===== Reset / Base ===== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* Ambient radial glow in background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(60% 60% at 10% 0%, rgba(255, 45, 85, 0.06) 0%, transparent 60%),
        radial-gradient(50% 50% at 90% 100%, rgba(99, 102, 241, 0.05) 0%, transparent 60%);
}

a { color: var(--text); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--accent); }

h1, h2, h3, h4, h5, h6 { font-weight: 600; letter-spacing: -0.02em; color: var(--text); line-height: 1.2; }
h1 { font-size: 2rem; letter-spacing: -0.03em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; }

p { color: var(--text-secondary); }
small { color: var(--text-muted); font-size: 0.8125rem; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: var(--radius-full); border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }

/* Selection */
::selection { background: var(--accent-soft); color: var(--accent); }

/* ===== Layout ===== */
.app-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
}

.app-main {
    padding: 1.5rem;
    max-width: var(--container-max);
    margin: 0 auto;
}

@media (max-width: 768px) {
    .app-main { padding: 1rem; }
}

.container, .container-fluid {
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: 0;
    padding-right: 0;
}

/* ===== Navbar ===== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--navbar-h);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: var(--navbar-bg);
    border-bottom: 1px solid var(--border);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.0625rem;
    letter-spacing: -0.02em;
    color: var(--text);
}

.navbar-brand:hover { color: var(--text); }

.brand-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--t-fast);
}

.nav-link:hover { color: var(--text); background: var(--surface-hover); }
.nav-link.active { color: var(--text); background: var(--surface-2); }
.nav-link i { font-size: 0.95rem; }

.nav-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--t-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover { background: var(--surface-hover); color: var(--text); }
.theme-toggle .bi-sun-fill { display: none; }
.theme-toggle .bi-moon-fill { display: inline-block; }
[data-theme="light"] .theme-toggle .bi-sun-fill { display: inline-block; }
[data-theme="light"] .theme-toggle .bi-moon-fill { display: none; }

/* Avatar / Dropdown */
.dropdown { position: relative; }
.avatar-circle {
    width: 36px; height: 36px;
    border-radius: var(--radius-full);
    background: var(--accent-gradient);
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform var(--t-fast);
    border: 1px solid var(--border);
}
.avatar-circle:hover { transform: scale(1.05); }

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 240px;
    padding: 0.4rem;
    background: var(--dropdown-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all var(--t-fast);
}

.dropdown.open > .dropdown-menu,
.dropdown:hover > .dropdown-menu,
.dropdown.show > .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }

.dropdown-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.875rem;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    transition: background var(--t-fast);
}
.dropdown-item:hover { background: var(--surface-hover); color: var(--text); }
.dropdown-item i { font-size: 1rem; color: var(--text-muted); }
.dropdown-divider { height: 1px; background: var(--border); margin: 0.4rem 0; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: all var(--t-fast);
    border: 1px solid transparent;
    white-space: nowrap;
    user-select: none;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn i { font-size: 1rem; }

.btn-primary {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); color: white; box-shadow: 0 0 0 4px var(--accent-soft); }
.btn-primary:active { background: var(--accent-active); }

.btn-secondary, .btn-outline, .btn-outline-secondary, .btn-light {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}
.btn-secondary:hover, .btn-outline:hover, .btn-outline-secondary:hover, .btn-light:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
    color: var(--text);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); }

.btn-danger, .btn-outline-danger {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: transparent;
}
.btn-danger:hover, .btn-outline-danger:hover { background: var(--danger); color: white; }

.btn-success {
    background: var(--success);
    color: white;
    border-color: var(--success);
}
.btn-success:hover:not(:disabled) { filter: brightness(1.1); color: white; }

.btn-warning, .btn-outline-warning {
    background: var(--warning-soft);
    color: var(--warning);
    border-color: transparent;
}
.btn-warning:hover, .btn-outline-warning:hover { background: var(--warning); color: white; }

.btn-outline-primary {
    background: transparent;
    color: var(--accent);
    border-color: var(--accent);
}
.btn-outline-primary:hover { background: var(--accent); color: white; }

.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.75rem 1.25rem; font-size: 0.95rem; }
.btn.w-100 { width: 100%; }

/* ===== Forms ===== */
.form-label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control, .form-select, input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="datetime-local"], input[type="date"], input[type="url"],
textarea, select {
    width: 100%;
    padding: 0.6rem 0.85rem;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-family: inherit;
    transition: all var(--t-fast);
}

.form-control:focus, .form-select:focus, input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-control::placeholder, input::placeholder, textarea::placeholder { color: var(--text-subtle); }

.form-select, select { cursor: pointer; appearance: none; padding-right: 2.25rem;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23a1a1aa'><path d='M8 11L3 6h10z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px;
}

textarea { resize: vertical; min-height: 90px; }

.form-check {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.form-check-input {
    width: 16px; height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}
.form-check-label { font-size: 0.875rem; color: var(--text-secondary); cursor: pointer; }

.form-text { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.3rem; }
.input-error { border-color: var(--danger) !important; }

/* ===== Cards ===== */
.card, .glass-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color var(--t);
}
.card:hover, .glass-card:hover { border-color: var(--border-strong); }

.card-header, .gradient-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.gradient-header h3 {
    margin: 0;
    font-size: 1.0625rem;
    color: var(--text);
}

.gradient-header i { color: var(--accent) !important; }

.card-body { padding: 1.25rem; }
.card-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--border); background: var(--surface-2); }

/* ===== Stats grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    padding: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
    transition: all var(--t);
}
.stat-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }

.stat-card::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 100px; height: 100px;
    background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%);
    opacity: 0.6;
    pointer-events: none;
}

.stat-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

/* ===== Channel cards ===== */
.channels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.25rem;
}

.channels-grid.list-view {
    grid-template-columns: 1fr;
}

.channel-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--t);
    display: flex;
    flex-direction: column;
}
.channel-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.channel-header {
    padding: 1.25rem;
    display: flex;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.channel-avatar { position: relative; flex-shrink: 0; }
.channel-avatar img {
    width: 56px; height: 56px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 1px solid var(--border);
}

.status-indicator {
    position: absolute;
    bottom: 0; right: 0;
    width: 12px; height: 12px;
    border-radius: var(--radius-full);
    border: 2px solid var(--surface);
}
.status-indicator.active { background: var(--success); box-shadow: 0 0 8px var(--success); }
.status-indicator.inactive { background: var(--text-muted); }

.channel-meta { flex: 1; min-width: 0; }
.channel-meta h3 {
    font-size: 1rem;
    margin: 0 0 0.15rem 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.channel-meta h3 a { color: var(--text); }
.channel-meta h3 a:hover { color: var(--accent); }

.channel-meta h4 {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0 0 0.5rem 0;
    font-weight: 400;
}

.channel-stats {
    display: flex;
    gap: 0.85rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}
.channel-stats span { display: inline-flex; align-items: center; gap: 0.3rem; }
.channel-stats i { color: var(--text-subtle); }

/* Actions dropdown on channel card */
.channel-actions { position: relative; }
.more-actions {
    width: 32px; height: 32px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--t-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.more-actions:hover { background: var(--surface-hover); color: var(--text); }

.actions-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 220px;
    padding: 0.4rem;
    background: var(--dropdown-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all var(--t-fast);
    z-index: 10;
}
.channel-actions:hover .actions-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }

.action-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.85rem;
    width: 100%;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    transition: background var(--t-fast);
}
.action-item:hover { background: var(--surface-hover); color: var(--text); }
.action-item.text-danger { color: var(--danger); }
.action-item.text-danger:hover { background: var(--danger-soft); }
.action-item i { font-size: 0.95rem; color: var(--text-muted); }
.action-item.text-danger i { color: var(--danger); }

.channel-content { padding: 1rem 1.25rem; flex: 1; }

.recent-activity h4 {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.video-list { display: flex; flex-direction: column; gap: 0.4rem; }
.video-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    color: var(--text);
    transition: background var(--t-fast);
}
.video-item:hover { background: var(--surface-hover); color: var(--text); }
.video-thumbnail {
    width: 60px; height: 34px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--surface-2);
}
.video-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.video-info { flex: 1; min-width: 0; }
.video-info strong { font-size: 0.8rem; font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-stats { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.15rem; display: flex; gap: 0.5rem; }

.empty-videos {
    text-align: center;
    padding: 1.5rem 0;
    color: var(--text-muted);
}
.empty-videos i { font-size: 1.5rem; opacity: 0.5; }

.channel-footer {
    padding: 0.85rem 1.25rem;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* ===== Badge ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.55rem;
    font-size: 0.7rem;
    font-weight: 500;
    border-radius: var(--radius-full);
    line-height: 1;
}
.badge.bg-success { background: var(--success-soft); color: var(--success); }
.badge.bg-danger { background: var(--danger-soft); color: var(--danger); }
.badge.bg-warning { background: var(--warning-soft); color: var(--warning); }
.badge.bg-info { background: var(--info-soft); color: var(--info); }
.badge.bg-secondary { background: var(--surface-hover); color: var(--text-secondary); }
.badge.bg-primary { background: var(--accent-soft); color: var(--accent); }

/* ===== Tables ===== */
.table, table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.table thead, table thead {
    background: var(--surface-2);
}
.table thead th, table thead th {
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.table tbody td, table tbody td {
    padding: 0.85rem 1rem;
    font-size: 0.875rem;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}
.table tbody tr:hover, table tbody tr:hover { background: var(--surface-hover); }

/* ===== Alerts ===== */
.alert {
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.alert-success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.alert-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.alert-warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.alert-info { background: var(--info-soft); color: var(--info); border-color: transparent; }

/* ===== Progress ===== */
.progress {
    width: 100%;
    height: 8px;
    background: var(--surface-2);
    border-radius: var(--radius-full);
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background: var(--accent);
    transition: width var(--t);
    color: white;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.progress-bar.bg-success { background: var(--success); }
.progress-bar-striped {
    background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%,
        transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%,
        transparent 75%, transparent);
    background-size: 1rem 1rem;
}
.progress-bar-animated { animation: progress-stripes 1s linear infinite; }
@keyframes progress-stripes { 0% { background-position: 1rem 0; } 100% { background-position: 0 0; } }

/* ===== Auth pages ===== */
.auth-bg {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: var(--bg);
    position: relative;
    overflow: hidden;
}
.auth-bg::before {
    content: '';
    position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(40% 60% at 20% 30%, rgba(255, 45, 85, 0.10) 0%, transparent 60%),
        radial-gradient(50% 50% at 80% 70%, rgba(99, 102, 241, 0.08) 0%, transparent 60%);
}

.auth-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    padding: 2.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.auth-header { text-align: center; margin-bottom: 1.75rem; }
.auth-title { font-size: 1.5rem; margin-bottom: 0.4rem; letter-spacing: -0.02em; }
.auth-subtitle { color: var(--text-muted); font-size: 0.875rem; }

.auth-footer {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}
.auth-footer a { color: var(--accent); font-weight: 500; }

.remember-forgot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

/* ===== Empty state ===== */
.empty-state {
    grid-column: 1 / -1;
    padding: 4rem 2rem;
    text-align: center;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    background: var(--surface);
}
.empty-state .empty-content { max-width: 360px; margin: 0 auto; }
.empty-state i { font-size: 4rem; opacity: 0.4; color: var(--text-muted); }
.empty-state h3 { margin: 1rem 0 0.4rem 0; }
.empty-state p { color: var(--text-muted); margin-bottom: 1.25rem; }

.no-results-message {
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-muted);
}

/* ===== Search ===== */
.search-box { position: relative; }
.search-box i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.95rem;
    pointer-events: none;
}

/* ===== View toggle ===== */
.view-toggle {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--surface);
}
.view-option {
    width: 36px; height: 36px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--t-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.view-option:hover { background: var(--surface-hover); color: var(--text); }
.view-option.active { background: var(--accent-soft); color: var(--accent); }

/* ===== Pagination ===== */
.pagination {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0;
    list-style: none;
}
.pagination li a, .pagination li span, .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text);
    font-size: 0.85rem;
    transition: all var(--t-fast);
}
.pagination li a:hover, .page-link:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.pagination .active a, .pagination .active span, .page-item.active .page-link {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}
.pagination .disabled a, .pagination .disabled span, .page-item.disabled .page-link {
    opacity: 0.4;
    pointer-events: none;
}

/* ===== Utility classes ===== */
.text-muted, .text-secondary { color: var(--text-muted) !important; }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-info { color: var(--info) !important; }
.text-accent, .text-primary { color: var(--accent) !important; }
.text-white { color: white !important; }

.bg-surface { background: var(--surface) !important; }
.bg-surface-2 { background: var(--surface-2) !important; }

.border-light { border-color: var(--border) !important; }

/* Bootstrap-compatible spacing utilities — only the ones used in views */
.d-none { display: none !important; }
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }
.d-block { display: block !important; }
.d-grid { display: grid !important; }

.align-items-center { align-items: center !important; }
.align-items-start { align-items: flex-start !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-end { justify-content: flex-end !important; }
.flex-grow-1 { flex-grow: 1 !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-column { flex-direction: column !important; }

.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }

.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }
.mw-100 { max-width: 100% !important; }

.m-0 { margin: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.ms-1 { margin-left: 0.25rem !important; }
.ms-2 { margin-left: 0.5rem !important; }

.p-0 { padding: 0 !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.px-3 { padding-left: 1rem !important; padding-right: 1rem !important; }

/* Bootstrap grid emulation (12-col) */
.row { display: flex; flex-wrap: wrap; margin-left: -0.5rem; margin-right: -0.5rem; }
.row > [class*="col-"] { padding-left: 0.5rem; padding-right: 0.5rem; }
.col-12 { flex: 0 0 100%; max-width: 100%; }
.col-md-3 { flex: 0 0 100%; max-width: 100%; }
.col-md-4 { flex: 0 0 100%; max-width: 100%; }
.col-md-6 { flex: 0 0 100%; max-width: 100%; }
.col-md-8 { flex: 0 0 100%; max-width: 100%; }
.col-md-9 { flex: 0 0 100%; max-width: 100%; }

@media (min-width: 768px) {
    .col-md-3 { flex: 0 0 25%; max-width: 25%; }
    .col-md-4 { flex: 0 0 33.333%; max-width: 33.333%; }
    .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .col-md-8 { flex: 0 0 66.666%; max-width: 66.666%; }
    .col-md-9 { flex: 0 0 75%; max-width: 75%; }
}

/* Spinner */
.spinner-border {
    display: inline-block;
    width: 1rem; height: 1rem;
    border: 2px solid var(--border);
    border-right-color: var(--accent);
    border-radius: var(--radius-full);
    animation: spinner 0.7s linear infinite;
}
.spinner-border-sm { width: 0.85rem; height: 0.85rem; border-width: 1.5px; }
@keyframes spinner { to { transform: rotate(360deg); } }

/* Dropzone (used by upload page) */
#dropZone { transition: all var(--t-fast); }
#dropZone:hover { border-color: var(--accent) !important; background: var(--surface-2); }
#dropZone i { color: var(--text-muted); }

/* Hover lift utility */
.lift { transition: transform var(--t), box-shadow var(--t); }
.lift:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* Page header pattern */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.page-header h1 { margin: 0; }
.page-header .subtitle { color: var(--text-muted); font-size: 0.875rem; margin-top: 0.2rem; }
