/* ═══════════════════════════════════════════
   ANPR System - Premium Dashboard Styles
   Tecti - Infraestructura Tecnológica
   ═══════════════════════════════════════════ */

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

/* ── CSS Variables ── */
:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #0f1923;
    --bg-card: rgba(15, 25, 40, 0.85);
    --bg-card-hover: rgba(20, 32, 50, 0.9);
    --bg-input: rgba(15, 23, 42, 0.8);
    --border-color: rgba(100, 116, 139, 0.15);
    --border-accent: rgba(2, 119, 189, 0.3);
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-blue: #0277bd;
    --accent-blue-light: #039be5;
    --accent-green: #43a047;
    --accent-green-dark: #1b5e20;
    --accent-red: #ef4444;
    --accent-orange: #f59e0b;
    --accent-purple: #8b5cf6;
    --sidebar-width: 260px;
    --header-height: 64px;
    --radius: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(100, 116, 139, 0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(100, 116, 139, 0.5); }

/* ── Layout ── */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
}

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

.sidebar-brand .brand-icon {
    height: 38px;
    width: 38px;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(2, 119, 189, 0.3));
}

.sidebar-brand img:not(.brand-icon) {
    height: 32px;
    width: auto;
}

.sidebar-brand .brand-text {
    display: flex;
    flex-direction: column;
}

.sidebar-brand .brand-name {
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
    letter-spacing: 2px;
}

.sidebar-brand .brand-sub {
    font-size: 10px;
    color: var(--accent-blue-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
    user-select: none;
}

.nav-item:hover {
    background: rgba(2, 119, 189, 0.08);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(2, 119, 189, 0.15);
    color: var(--accent-blue-light);
}

.nav-item .nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.nav-item .nav-badge {
    margin-left: auto;
    background: var(--accent-blue);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

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

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

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

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

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: capitalize;
}

.logout-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    border-radius: 6px;
    transition: var(--transition);
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.logout-btn-full {
    width: 100%;
    margin-top: 12px;
    padding: 9px 14px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: 10px;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.logout-btn-full:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: var(--accent-red);
}

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

.page-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(10, 14, 23, 0.95);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.page-header p {
    font-size: 13px;
    color: var(--text-muted);
}

.page-body {
    padding: 24px 32px;
}

/* ── Section Pages ── */
.section-page {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.section-page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Stats Cards ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-2px);
}

.stat-card .stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-card .stat-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.stat-card.blue .stat-value { color: var(--accent-blue-light); }
.stat-card.green .stat-value { color: var(--accent-green); }
.stat-card.orange .stat-value { color: var(--accent-orange); }
.stat-card.purple .stat-value { color: var(--accent-purple); }

/* ── Live Feed ── */
.live-feed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.live-feed-header h3 {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(67, 160, 71, 0.15);
    border: 1px solid rgba(67, 160, 71, 0.3);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-green);
}

.live-indicator .live-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-green);
    border-radius: 50%;
    animation: livePulse 1.5s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(67, 160, 71, 0.5); }
    50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(67, 160, 71, 0); }
}

.live-feed-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

/* ── Detection Card ── */
.detection-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    animation: slideInUp 0.5s ease-out;
}

.detection-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.detection-card.new-detection {
    animation: newDetection 1s ease-out;
}

@keyframes newDetection {
    0% { transform: scale(0.95); opacity: 0; border-color: var(--accent-blue); box-shadow: 0 0 30px rgba(2, 119, 189, 0.3); }
    50% { border-color: var(--accent-blue); box-shadow: 0 0 20px rgba(2, 119, 189, 0.2); }
    100% { transform: scale(1); opacity: 1; border-color: var(--border-color); box-shadow: none; }
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.detection-card .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
}

.detection-card .card-type {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.detection-card .card-type.entrada {
    color: var(--accent-blue-light);
}

.detection-card .card-type.salida {
    color: var(--accent-green);
}

.type-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.type-dot.entrada { background: var(--accent-blue); }
.type-dot.salida { background: var(--accent-green); }

.detection-card .card-time {
    font-size: 11px;
    color: var(--text-muted);
}

.detection-card .card-body {
    padding: 18px;
}

.detection-card .plate-display {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
    letter-spacing: 2px;
    font-family: 'Inter', monospace;
}

.detection-card .card-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detection-card .meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.detection-card .meta-item .meta-icon {
    width: 16px;
    text-align: center;
    font-size: 13px;
}

.detection-card .card-image {
    padding: 0 18px 18px;
}

.detection-card .card-image img {
    width: 100%;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.detection-card .card-image img:hover {
    border-color: var(--accent-blue);
    transform: scale(1.02);
}

/* ── Camera Cards ── */
.cameras-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 16px;
}

.camera-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition);
}

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

.camera-card .camera-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.camera-card .camera-name {
    font-size: 16px;
    font-weight: 700;
}

.camera-card .camera-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 8px;
}

.camera-status.active {
    background: rgba(67, 160, 71, 0.15);
    color: var(--accent-green);
}

.camera-status.inactive {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.camera-status .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.camera-status.active .status-dot { background: var(--accent-green); }
.camera-status.inactive .status-dot { background: var(--accent-red); }

.camera-card .camera-type-badge {
    display: inline-flex;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 14px;
}

.camera-type-badge.entrada {
    background: rgba(2, 119, 189, 0.15);
    color: var(--accent-blue-light);
}

.camera-type-badge.salida {
    background: rgba(67, 160, 71, 0.15);
    color: var(--accent-green);
}

.camera-card .camera-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 18px;
}

.camera-detail {
    font-size: 12px;
}

.camera-detail .detail-label {
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 2px;
}

.camera-detail .detail-value {
    color: var(--text-secondary);
    font-weight: 600;
}

.camera-card .camera-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-blue-light));
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(2, 119, 189, 0.35);
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-green-dark), var(--accent-green));
    color: #fff;
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(67, 160, 71, 0.35);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

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

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

.btn-sm {
    padding: 7px 14px;
    font-size: 12px;
    border-radius: 8px;
}

.btn-icon {
    padding: 8px;
    min-width: 36px;
    justify-content: center;
}

/* ── Modal ── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from { transform: translateY(-20px) scale(0.98); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 22px;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: var(--transition);
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

/* ── Forms ── */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    margin-bottom: 18px;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(2, 119, 189, 0.1);
}

.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 36px;
}

.form-group select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.form-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-blue-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 14px;
    margin-top: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

/* ── Table ── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.data-table thead {
    background: rgba(2, 119, 189, 0.08);
}

.data-table th {
    padding: 14px 18px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 14px 18px;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.data-table tr:hover td {
    background: rgba(2, 119, 189, 0.04);
}

.data-table .plate-cell {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
    letter-spacing: 1px;
    font-family: 'Inter', monospace;
}

.data-table .type-badge {
    display: inline-flex;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.type-badge.entrada {
    background: rgba(2, 119, 189, 0.15);
    color: var(--accent-blue-light);
}

.type-badge.salida {
    background: rgba(67, 160, 71, 0.15);
    color: var(--accent-green);
}

.data-table .thumb-cell img {
    width: 60px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.data-table .thumb-cell img:hover {
    transform: scale(1.1);
    border-color: var(--accent-blue);
}

/* ── Filters ── */
.filters-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.filters-bar input,
.filters-bar select {
    padding: 9px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: var(--transition);
}

.filters-bar input:focus,
.filters-bar select:focus {
    border-color: var(--accent-blue);
}

.filters-bar select {
    appearance: none;
    padding-right: 30px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px;
}

.filters-bar select option {
    background: var(--bg-secondary);
}

/* ── Pagination ── */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
}

.pagination button {
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: var(--transition);
}

.pagination button:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue-light);
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination .page-info {
    font-size: 13px;
    color: var(--text-muted);
    padding: 0 12px;
}

/* ── Image Modal ── */
.image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.image-viewer.show {
    display: flex;
}

.image-viewer img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* ── Settings Section ── */
.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 20px;
}

.settings-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ── Toggle Switch ── */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.toggle-switch input {
    display: none;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(100, 116, 139, 0.3);
    border-radius: 24px;
    transition: var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: var(--transition);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--accent-blue);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* ── Toast Notifications ── */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 20px;
    min-width: 300px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastSlideIn 0.4s ease-out;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

@keyframes toastSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast.success { border-left: 3px solid var(--accent-green); }
.toast.error { border-left: 3px solid var(--accent-red); }
.toast.info { border-left: 3px solid var(--accent-blue); }

.toast .toast-icon { font-size: 20px; }
.toast .toast-text { font-size: 13px; color: var(--text-secondary); flex: 1; }

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

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .page-body {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .live-feed-container {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .cameras-grid {
        grid-template-columns: 1fr;
    }

    .filters-bar {
        flex-direction: column;
    }

    .filters-bar input,
    .filters-bar select {
        width: 100%;
    }

    .data-table {
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 10px 12px;
    }
}

/* ── Users Table ── */
.users-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

/* ── WS Status ── */
.ws-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
}

.ws-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-red);
    transition: var(--transition);
}

.ws-dot.connected {
    background: var(--accent-green);
    box-shadow: 0 0 6px rgba(67, 160, 71, 0.5);
}

/* ── Loading Spinner ── */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
