/* ============================================
   Digital Library SaaS — Custom Styles
   Premium design system with CSS variables
   ============================================ */

/* ─── Google Fonts ─── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ─── CSS Custom Properties (Theme System) ─── */
:root, [data-theme="light"] {
    --primary: var(--school-primary, #6366f1);
    --primary-hover: #4f46e5;
    --primary-light: #eef2ff;
    --primary-glow: rgba(99, 102, 241, 0.2);
    --secondary: var(--school-secondary, #1e1b4b);
    
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --bg-sidebar: #ffffff;
    --bg-topbar: #ffffff;
    --bg-input: #ffffff;
    --bg-surface: rgba(0,0,0,0.02);
    --bg-hover-sidebar: rgba(0,0,0,0.03);
    --bg-hover-table: rgba(0,0,0,0.02);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-accent: var(--primary);
    
    --border-color: #e2e8f0;
    --border-active: rgba(99,102,241,0.3);
    
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    
    --gradient-primary: linear-gradient(135deg, var(--primary), #8b5cf6);
    --gradient-card: linear-gradient(145deg, #ffffff, #f8fafc);
    --gradient-glass: linear-gradient(135deg, rgba(255,255,255,0.8), rgba(255,255,255,0.4));
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-glow: 0 0 15px var(--primary-glow);
}

[data-theme="dark"] {
    --bg-body: #0f0f1a;
    --bg-card: #1a1a2e;
    --bg-card-hover: #222240;
    --bg-sidebar: #12121f;
    --bg-topbar: rgba(15,15,26,0.85);
    --bg-input: #16162a;
    --bg-surface: rgba(255,255,255,0.03);
    --bg-hover-sidebar: rgba(255,255,255,0.04);
    --bg-hover-table: rgba(255,255,255,0.03);
    
    --text-primary: #f0f0f5;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --border-color: rgba(255,255,255,0.08);
    
    --gradient-card: linear-gradient(145deg, rgba(26,26,46,0.95), rgba(18,18,31,0.98));
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
}

:root {
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --sidebar-width: 260px;
    --topbar-height: 64px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Visibility Utilities for Theme ─── */
[data-theme="dark"] .d-none-dark { display: none !important; }
[data-theme="light"] .d-none-light { display: none !important; }
html:not([data-theme="dark"]) .d-none-light { display: none !important; }

/* ─── Impersonation Banner ─── */
.impersonation-banner {
    background: var(--gradient-primary);
    color: white;
    padding: 8px 20px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 500;
    position: sticky;
    top: 0;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

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

body {
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}
a:hover {
    color: var(--primary-hover);
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.25);
}

/* ─── Layout: Sidebar + Content ─── */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand img {
    height: 36px;
    width: 36px;
    border-radius: var(--radius-sm);
    object-fit: contain;
}

.sidebar-brand-text {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-brand-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
}

.sidebar-section {
    padding: 8px 16px 4px;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.sidebar-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: var(--primary);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.sidebar-link:hover {
    color: var(--text-primary);
    background: var(--bg-hover-sidebar);
}

.sidebar-link.active {
    color: var(--primary);
    background: var(--primary-light);
}

.sidebar-link.active::before {
    transform: scaleY(1);
}

.sidebar-link i {
    width: 20px;
    font-size: 1rem;
    text-align: center;
    opacity: 0.8;
}

.sidebar-link.active i {
    opacity: 1;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: white;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ─── Main Content ─── */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ─── Top Bar ─── */
.topbar {
    height: var(--topbar-height);
    background: var(--bg-topbar);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Specific theme overrides to ensure visibility in white mode */
[data-theme="light"] .topbar {
    background: #ffffff !important;
    background-color: #ffffff !important;
}

[data-theme="dark"] .topbar {
    background: rgba(15,15,26,0.85) !important;
}

.topbar-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-actions .btn {
    font-size: 0.8rem;
}

/* ─── Page Content ─── */
.page-content {
    flex: 1;
    padding: 28px;
}

/* ─── Cards ─── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    border-color: var(--border-active);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
}

.card-header h5, .card-header h6 {
    font-weight: 600;
    margin: 0;
}

.card-body {
    padding: 20px;
}

/* ─── Stat Cards ─── */
.stat-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: var(--gradient-primary);
    opacity: 0.06;
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
    border-color: var(--border-active);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 16px;
    background: var(--primary-light);
    color: var(--primary);
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ─── Tables ─── */
.table {
    color: var(--text-primary);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--border-color);
    --bs-table-hover-bg: var(--bg-hover-table);
}

.table thead th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 16px;
    white-space: nowrap;
}

.table td {
    padding: 14px 16px;
    vertical-align: middle;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 0.875rem;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background: var(--bg-hover-table);
}

/* ─── Buttons ─── */
.btn {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    border-radius: var(--radius-sm);
    padding: 8px 18px;
    font-size: 0.85rem;
    transition: var(--transition);
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    border: none;
    box-shadow: 0 2px 8px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--primary-glow);
    color: white;
}

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

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

.btn-danger {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.btn-danger:hover {
    background: color-mix(in srgb, var(--danger) 85%, black);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.btn-warning {
    background: var(--warning);
    color: #1a1a2e;
    border-color: var(--warning);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-ghost:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
    border-color: var(--border-active);
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.78rem;
}

.btn-xs {
    padding: 3px 8px;
    font-size: 0.7rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

/* ─── Forms ─── */
.form-control, .form-select {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 0.875rem;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}

.form-control:focus, .form-select:focus {
    background-color: var(--bg-input);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    color: var(--text-primary);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.form-check-input {
    background-color: var(--bg-input);
    border-color: var(--border-color);
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* ─── Badges ─── */
.badge {
    font-weight: 600;
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.3px;
}

.badge-active, .badge.bg-success {
    background: rgba(16,185,129,0.15) !important;
    color: #10b981 !important;
    border: 1px solid rgba(16,185,129,0.25);
}

.badge-suspended, .badge.bg-danger {
    background: rgba(239,68,68,0.15) !important;
    color: #ef4444 !important;
    border: 1px solid rgba(239,68,68,0.25);
}

.badge-expired, .badge.bg-warning {
    background: rgba(245,158,11,0.15) !important;
    color: #f59e0b !important;
    border: 1px solid rgba(245,158,11,0.25);
}

.badge-role {
    background: rgba(99,102,241,0.15);
    color: var(--primary);
    border: 1px solid rgba(99,102,241,0.25);
}

/* ─── Alerts ─── */
.alert {
    border-radius: var(--radius-md);
    border: 1px solid;
    padding: 14px 18px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: rgba(16,185,129,0.1);
    border-color: rgba(16,185,129,0.2);
    color: #10b981;
}

.alert-danger, .alert-error {
    background: rgba(239,68,68,0.1);
    border-color: rgba(239,68,68,0.2);
    color: #ef4444;
}

.alert-warning {
    background: rgba(245,158,11,0.1);
    border-color: rgba(245,158,11,0.2);
    color: #f59e0b;
}

.alert-info {
    background: rgba(59,130,246,0.1);
    border-color: rgba(59,130,246,0.2);
    color: #3b82f6;
}

/* ─── Course/Subject Cards ─── */
.content-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    height: 100%;
}

.content-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-active);
}

.content-card-thumb {
    width: 100%;
    height: 160px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: rgba(255,255,255,0.3);
    position: relative;
    overflow: hidden;
}

.content-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.content-card-thumb .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.6));
    padding: 16px;
}

.content-card-body {
    padding: 16px;
}

.content-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.content-card-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 12px;
}

.content-card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ─── Media Player ─── */
.player-container {
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    max-width: 100%;
}

.player-container video {
    width: 100%;
    max-height: 70vh;
    display: block;
}

.player-container iframe {
    width: 100%;
    height: 75vh;
    border: none;
}

.player-container audio {
    width: 100%;
    margin: 40px 0;
}

.player-info {
    padding: 20px 0;
}

.player-info h3 {
    font-weight: 700;
    margin-bottom: 8px;
}

/* ─── Login Page ─── */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-body);
    position: relative;
    overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: var(--gradient-primary);
    opacity: 0.08;
    border-radius: 50%;
    top: -200px;
    right: -200px;
    filter: blur(100px);
}

.login-wrapper::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: #8b5cf6;
    opacity: 0.06;
    border-radius: 50%;
    bottom: -150px;
    left: -150px;
    filter: blur(80px);
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 40px 36px;
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo img {
    height: 50px;
    margin-bottom: 12px;
}

.login-logo h2 {
    font-size: 1.4rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-logo p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ─── Empty State ─── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h5 {
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* ─── Pagination ─── */
.pagination .page-link {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding: 8px 14px;
}

.pagination .page-link:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
    border-color: var(--border-active);
}

.pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* ─── License Expired Page ─── */
.license-expired-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-body);
    text-align: center;
    padding: 20px;
}

.license-expired-card {
    max-width: 500px;
    padding: 50px 40px;
}

.license-expired-card .icon {
    font-size: 4rem;
    color: var(--danger);
    margin-bottom: 20px;
}

.license-expired-card h2 {
    font-weight: 700;
    margin-bottom: 12px;
}

.license-expired-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* ─── Responsive ─── */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .sidebar-toggle {
        display: block !important;
    }
}

@media (min-width: 992px) {
    .sidebar-toggle {
        display: none !important;
    }
}

@media (max-width: 575.98px) {
    .page-content {
        padding: 16px;
    }
    .stat-card {
        padding: 18px;
    }
    .stat-card-value {
        font-size: 1.5rem;
    }
    .login-card {
        padding: 28px 24px;
        margin: 12px;
    }
}

/* ─── Animations ─── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeInUp 0.4s ease-out forwards;
}

.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }

/* ─── Upload Progress ─── */
.upload-progress {
    margin-top: 16px;
    display: none;
}

.upload-progress.active {
    display: block;
}

.progress {
    height: 6px;
    background: var(--bg-input);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

/* ─── Media Grid ─── */
.media-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: var(--transition);
}

.media-item:hover {
    border-color: var(--border-active);
    background: var(--bg-card-hover);
}

.media-item-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.media-item-icon.video {
    background: rgba(239,68,68,0.15);
    color: #ef4444;
}

.media-item-icon.audio {
    background: rgba(59,130,246,0.15);
    color: #3b82f6;
}

.media-item-icon.pdf {
    background: rgba(245,158,11,0.15);
    color: #f59e0b;
}

.media-item-info {
    flex: 1;
    min-width: 0;
}

.media-item-title {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.media-item-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ─── Color Picker ─── */
.color-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-input-wrapper input[type="color"] {
    width: 44px;
    height: 44px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 2px;
    background: transparent;
}

/* ─── Sidebar Mobile Overlay ─── */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.sidebar-overlay.show {
    display: block;
}

/* ─── Tooltip custom ─── */
.tooltip-inner {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.78rem;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
}

/* ─── Kill Switch Button ─── */
.btn-kill {
    background: linear-gradient(135deg, #dc2626, #991b1b);
    color: white;
    font-weight: 600;
    border: none;
}

.btn-kill:hover {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(239,68,68,0.3);
}

.btn-activate {
    background: linear-gradient(135deg, #059669, #047857);
    color: white;
    font-weight: 600;
    border: none;
}

.btn-activate:hover {
    background: linear-gradient(135deg, #10b981, #059669);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(16,185,129,0.3);
}
