:root {
    --primary: #F59E0B;
    --primary-dark: #D97706;
    --primary-light: rgba(245, 158, 11, 0.1);
    --secondary: #B45309;
    --accent: #FBBF24;
    --success: #10b981;
    --success-dark: #059669;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --warning: #f59e0b;
    --bg-dark: #0A0A0B;
    --bg-darker: #050506;
    --bg-surface: #101012;
    --bg-light: #161618;
    --bg-lighter: #2A2A2E;
    --text-light: #EDEDED;
    --text-muted: #9CA3AF;
    --text-dim: #6B7280;
    --border: #2A2A2E;
    --sidebar-width: 240px;
    --shadow-sm: inset 0 1px 3px rgba(0,0,0,0.4), inset 0 0 1px rgba(0,0,0,0.2);
    --shadow-md: 0 2px 6px rgba(0,0,0,0.35), 0 1px 2px rgba(0,0,0,0.25);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.45), 0 2px 8px rgba(0,0,0,0.3);
    --highlight-top: inset 0 1px 0 rgba(255,255,255,0.04);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.6;
    font-size: 14px;
}

.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-darker);
    position: relative;
    overflow: hidden;
}

.login-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.12;
    background-image:
        linear-gradient(rgba(245,158,11,0.3) 1px, transparent 1px),
        linear-gradient(90deg, rgba(245,158,11,0.3) 1px, transparent 1px),
        linear-gradient(rgba(245,158,11,0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(245,158,11,0.08) 1px, transparent 1px),
        radial-gradient(circle 2px at center, rgba(245,158,11,0.5) 0%, transparent 3px),
        radial-gradient(circle 1px at center, rgba(245,158,11,0.3) 0%, transparent 2px);
    background-size:
        200px 200px,
        200px 200px,
        40px 40px,
        40px 40px,
        200px 200px,
        40px 40px;
    background-position:
        0 0, 0 0,
        0 0, 0 0,
        100px 100px,
        20px 20px;
    pointer-events: none;
}

.login-screen::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.06;
    background:
        radial-gradient(circle 180px at 12% 18%, rgba(245,158,11,0.6), transparent),
        radial-gradient(circle 120px at 88% 75%, rgba(245,158,11,0.4), transparent),
        radial-gradient(circle 280px at 50% 50%, rgba(245,158,11,0.15), transparent),
        radial-gradient(ellipse 60px 400px at 30% 50%, rgba(245,158,11,0.2), transparent),
        radial-gradient(ellipse 400px 60px at 70% 40%, rgba(245,158,11,0.15), transparent);
}

.login-tac-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.login-tac-overlay svg {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0.55;
}

.login-screen .login-glow {
    position: absolute;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245,158,11,0.22) 0%, rgba(245,158,11,0.08) 35%, transparent 65%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: 0;
    transform: translate(-50%, -50%);
    filter: blur(8px);
}

.login-screen .login-glow-trail {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245,158,11,0.12) 0%, rgba(245,158,11,0.04) 40%, transparent 65%);
    opacity: 0;
    pointer-events: none;
    z-index: 0;
    transform: translate(-50%, -50%);
    filter: blur(12px);
}

.login-screen .login-drone {
    position: absolute;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.5s ease;
    filter: drop-shadow(0 0 10px rgba(245,158,11,0.6)) drop-shadow(0 0 25px rgba(245,158,11,0.2));
}

.login-screen .login-drone-shadow {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245,158,11,0.18) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.drone-rotor-1 { animation: rotor-spin 0.12s linear infinite; transform-origin: 12.8px 12.8px; }
.drone-rotor-2 { animation: rotor-spin 0.12s linear infinite reverse; transform-origin: 51.2px 12.8px; }
.drone-rotor-3 { animation: rotor-spin 0.12s linear infinite reverse; transform-origin: 12.8px 51.2px; }
.drone-rotor-4 { animation: rotor-spin 0.12s linear infinite; transform-origin: 51.2px 51.2px; }

@keyframes rotor-spin {
    0% { opacity: 0.7; }
    50% { opacity: 0.2; }
    100% { opacity: 0.7; }
}

.drone-led { animation: led-pulse 1.5s ease-in-out infinite; }
.drone-led-front { animation: led-blink 0.8s ease-in-out infinite; }

@keyframes led-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

@keyframes led-blink {
    0%, 45% { opacity: 0.9; }
    50%, 95% { opacity: 0.2; }
    100% { opacity: 0.9; }
}

.login-container {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 40px;
    width: 90%;
    max-width: 400px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg), var(--highlight-top);
    position: relative;
    z-index: 1;
}

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

.login-logo-img {
    width: 160px;
    height: 160px;
    object-fit: contain;
    border-radius: 50%;
    border: 2px solid var(--primary);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.2);
    filter: drop-shadow(0 0 12px rgba(245, 158, 11, 0.3));
}

.login-logo img:not(.login-logo-img) {
    max-height: 80px;
    max-width: 260px;
    object-fit: contain;
}

.login-logo svg {
    color: var(--primary);
}

.login-container h1 {
    font-size: 26px;
    text-align: center;
    margin-bottom: 4px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 28px;
    font-size: 13px;
}

.login-form .form-group {
    margin-bottom: 16px;
}

.login-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

.login-form input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px;
    color: var(--text-light);
    font-size: 14px;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-form input:focus {
    outline: none;
    border-color: rgba(245,158,11,0.4);
    box-shadow: 0 0 0 2px rgba(245,158,11,0.12), var(--shadow-sm);
}

.btn-login {
    width: 100%;
    padding: 11px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.btn-login:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.error-message {
    margin-top: 12px;
    padding: 10px 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    color: var(--danger);
    font-size: 13px;
}

.totp-prompt {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 16px;
}

.totp-input-group {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.totp-input-group input {
    width: 180px;
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 8px;
    padding: 12px;
    background: var(--bg-dark);
    border: 2px solid var(--border);
    border-radius: 8px;
    color: var(--text-light);
    font-family: monospace;
}

.totp-input-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-link {
    display: block;
    width: 100%;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    padding: 8px;
    margin-top: 8px;
    text-decoration: underline;
}

.btn-link:hover {
    color: var(--text-light);
}

.btn-2fa {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    padding: 6px 14px;
    transition: all 0.2s;
    flex: 1;
    white-space: nowrap;
}

.btn-2fa:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.sidebar-footer-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.acct-security-section {
    margin-bottom: 0;
}

.acct-security-heading {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px 0;
}

.acct-security-divider {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin: 20px 0;
}

.tfa-status-card {
    text-align: center;
    padding: 16px;
    margin-bottom: 12px;
}

.tfa-status-icon {
    margin-bottom: 8px;
}

.tfa-status-card p {
    color: var(--text-muted);
    font-size: 14px;
}

.tfa-instruction {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 16px;
}

.tfa-qr-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.tfa-qr-container img {
    width: 256px;
    height: 256px;
    border-radius: 12px;
    border: 2px solid var(--border);
}

.tfa-secret-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
}

.tfa-secret-row label {
    color: var(--text-muted);
    font-size: 12px;
}

.tfa-secret-row code {
    background: var(--bg-dark);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-family: monospace;
    letter-spacing: 2px;
    color: var(--primary);
    border: 1px solid var(--border);
    user-select: all;
    word-break: break-all;
}

#tfa-setup-view .btn-primary,
#tfa-setup-view .btn-secondary,
#tfa-disable-view .btn-danger,
#tfa-disable-view .btn-secondary {
    width: 100%;
    margin-bottom: 8px;
}

.dashboard {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-light);
    border-right: 1px solid var(--border);
    box-shadow: 4px 0 12px rgba(0,0,0,0.3), 1px 0 4px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    background-image:
        linear-gradient(rgba(245,158,11,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(245,158,11,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}

.sidebar-header {
    padding: 28px 20px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.sidebar-logo {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    filter: drop-shadow(0 0 12px rgba(245, 158, 11, 0.3));
}

.sidebar-logo-img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 50%;
    border: 2px solid var(--primary);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.2);
}

.sidebar-logo img:not(.sidebar-logo-img) {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 50%;
    border: 2px solid var(--primary);
}

.sidebar-logo svg {
    color: var(--primary);
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.5px;
    line-height: 1.3;
    color: var(--primary);
}

.sidebar-nav {
    flex: 1;
    padding: 8px 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.15s;
    font-size: 13px;
    font-weight: 500;
    border-left: 2px solid transparent;
}

.nav-item:hover {
    background: rgba(255,255,255,0.03);
    color: var(--text-light);
}

.nav-item.active {
    background: rgba(245, 158, 11, 0.08);
    color: var(--primary);
    border-left-color: var(--primary);
    box-shadow: inset 0 1px 0 rgba(245,158,11,0.06), inset 0 -1px 0 rgba(0,0,0,0.15);
}

.nav-section-label {
    padding: 16px 20px 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
}

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

.sidebar-user-info {
    padding: 8px 12px;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.sidebar-user-info strong {
    color: var(--text-light);
}

.btn-logout {
    width: 100%;
    padding: 8px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 13px;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
    color: var(--danger);
}

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 24px 32px;
    min-height: 100vh;
    background: var(--bg-dark);
    position: relative;
}

.main-content::before {
    content: '';
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    bottom: 0;
    opacity: 0.04;
    background-image:
        linear-gradient(rgba(245,158,11,0.25) 1px, transparent 1px),
        linear-gradient(90deg, rgba(245,158,11,0.25) 1px, transparent 1px),
        linear-gradient(rgba(245,158,11,0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(245,158,11,0.08) 1px, transparent 1px);
    background-size:
        200px 200px,
        200px 200px,
        40px 40px,
        40px 40px;
    pointer-events: none;
    z-index: 0;
}

.main-content > * {
    position: relative;
    z-index: 1;
}

.view { display: none; }
.view.active { display: block; }

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.view-header h1 {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.view-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-primary, .btn-secondary, .btn-success, .btn-danger, .btn-warning, .btn-outline {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    min-height: 34px;
    line-height: 1;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3); }

.btn-secondary { background: var(--bg-lighter); color: var(--text-light); }
.btn-secondary:hover { background: #3A3A3F; transform: translateY(-1px); }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: var(--success-dark); transform: translateY(-1px); box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3); }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: var(--danger-dark); transform: translateY(-1px); box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3); }

.btn-outline { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--bg-lighter); color: var(--text-light); transform: translateY(-1px); }
.btn-outline.active { background: var(--primary); color: white; border-color: var(--primary); }

.btn-sm { padding: 6px 12px; font-size: 12px; min-height: 28px; }

.replay-speed-btn { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12); color: var(--text-dim); cursor: pointer; transition: all 0.2s; }
.replay-speed-btn:hover { background: rgba(255,255,255,0.15); color: var(--text-light); }
.replay-speed-btn.active { background: var(--warning); color: #000; border-color: var(--warning); font-weight: 600; }

.btn-copy {
    background: var(--bg-lighter);
    border: 1px solid var(--border);
    color: var(--text-light);
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-copy:hover { background: var(--primary); border-color: var(--primary); }

.grid-selector {
    display: flex;
    gap: 2px;
    background: var(--bg-light);
    border-radius: 6px;
    padding: 2px;
    border: 1px solid var(--border);
}

.grid-selector button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.15s;
}

.grid-selector button.active {
    background: var(--primary);
    color: white;
}

.grid-selector button:hover:not(.active) {
    background: var(--bg-lighter);
    color: var(--text-light);
}

.streams-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
    transition: grid-template-columns 0.3s ease;
}
.streams-grid[data-count="1"] { grid-template-columns: 1fr; max-width: 900px; }
.streams-grid[data-count="2"] { grid-template-columns: repeat(2, 1fr); }
.streams-grid[data-count="3"] { grid-template-columns: repeat(3, 1fr); }
.streams-grid[data-count="4"] { grid-template-columns: repeat(2, 1fr); }
.streams-grid[data-count="5"],
.streams-grid[data-count="6"] { grid-template-columns: repeat(3, 1fr); }
.streams-grid[data-count="7"],
.streams-grid[data-count="8"],
.streams-grid[data-count="9"] { grid-template-columns: repeat(3, 1fr); }
.streams-grid[data-count="10"],
.streams-grid[data-count="11"],
.streams-grid[data-count="12"],
.streams-grid[data-count="13"],
.streams-grid[data-count="14"],
.streams-grid[data-count="15"],
.streams-grid[data-count="16"] { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1200px) {
    .streams-grid[data-count="3"],
    .streams-grid[data-count="5"],
    .streams-grid[data-count="6"],
    .streams-grid[data-count="7"],
    .streams-grid[data-count="8"],
    .streams-grid[data-count="9"] { grid-template-columns: repeat(2, 1fr); }
    .streams-grid[data-count="10"],
    .streams-grid[data-count="11"],
    .streams-grid[data-count="12"],
    .streams-grid[data-count="13"],
    .streams-grid[data-count="14"],
    .streams-grid[data-count="15"],
    .streams-grid[data-count="16"] { grid-template-columns: repeat(3, 1fr); }
}

.no-streams {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.no-streams p { font-size: 15px; margin-bottom: 6px; }
.no-streams small { font-size: 13px; color: var(--text-dim); }

.streams-ghost {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    padding: 40px 20px;
}

.no-streams-icon {
    font-size: 48px;
    color: var(--text-muted);
    opacity: 0.4;
    user-select: none;
    margin-bottom: 8px;
}

.streams-ghost p {
    margin-top: 4px;
}

.streams-ghost small {
    margin-top: 8px;
    opacity: 0.5;
}

.stream-card {
    background: var(--bg-light);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md), var(--highlight-top);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.stream-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg), var(--highlight-top);
}

.stream-card.stream-offline {
    opacity: 0.5;
    border-color: var(--danger);
}

.stream-card.stream-offline .stream-status {
    color: var(--danger);
}

.stream-video {
    position: relative;
    padding-top: 56.25%;
    background: #000;
}

.stream-video video {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: contain;
}

.detection-overlay-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.video-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    color: var(--text-muted);
    font-size: 13px;
    z-index: 3;
}

.stream-info {
    padding: 12px 16px;
}

.stream-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.stream-name-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
}

.stream-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.stream-status::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 2s infinite;
}

.signal-bars {
    vertical-align: middle;
    flex-shrink: 0;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.stream-meta {
    font-size: 11px;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.stream-meta code {
    background: var(--bg-dark);
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 11px;
    color: var(--accent);
}

.stream-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.stream-actions button {
    font-size: 12px;
    padding: 6px 12px;
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.stream-actions button svg {
    flex-shrink: 0;
    vertical-align: middle;
}

.streams-list { display: grid; gap: 8px; }

.stream-item {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.15s;
}

.stream-item:hover { border-color: var(--primary); }

.stream-item-info h3 { font-size: 14px; margin-bottom: 4px; }

.stream-item-info p {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.stream-item-info code {
    background: var(--bg-dark);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 11px;
    color: var(--accent);
}

.stream-key-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stream-key-masked {
    font-family: monospace;
    letter-spacing: 1px;
    min-width: 70px;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 3px;
    border-radius: 4px;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    transition: color 0.15s, background 0.15s;
}

.btn-icon:hover {
    color: var(--primary);
    background: rgba(245,158,11,0.1);
}

.stream-item-actions { display: flex; gap: 8px; align-items: center; }

.recordings-filters {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.recordings-filters .filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.recordings-filters .filter-group label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-input {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 13px;
    min-width: 160px;
}

.filter-input:focus {
    outline: none;
    border-color: var(--primary);
}

.recordings-date-group {
    margin-bottom: 24px;
}

.recordings-date-header {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: capitalize;
    padding-bottom: 8px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.recordings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.recording-card {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-md), var(--highlight-top);
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.recording-card:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow-lg), var(--highlight-top); }
.recording-thumbnail {
    position: relative;
    width: 100%;
    height: 120px;
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.recording-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.recording-thumbnail-image {
    color: rgba(255, 255, 255, 0.25);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(22, 22, 24, 0.8));
}
.recording-thumbnail-video {
    color: rgba(255, 255, 255, 0.2);
    background: linear-gradient(135deg, rgba(22, 22, 24, 0.8), rgba(10, 10, 11, 0.9));
}
.media-viewer-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 300px;
    min-height: 200px;
    color: rgba(255, 255, 255, 0.5);
}
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary, #F59E0B);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.recording-thumbnail-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    color: white;
    opacity: 0;
    transition: opacity 0.2s;
}
.recording-thumbnail:hover .recording-thumbnail-overlay { opacity: 1; }
.rec-thumb-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.rec-thumb-play svg {
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.6));
    opacity: 0.85;
}
.recording-info { padding: 8px 10px 2px; }
.recording-info h4 { margin-bottom: 2px; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recording-info p { font-size: 11px; color: var(--text-muted); margin-bottom: 1px; }
.recording-actions { display: flex; gap: 6px; padding: 6px 10px 10px; }
.recording-actions .btn-sm { font-size: 11px; padding: 4px 8px; }

.media-viewer-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}
.media-viewer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    cursor: pointer;
}
.media-viewer-container {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-dark, #0A0A0B);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}
.media-viewer-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.media-viewer-close:hover { background: rgba(0, 0, 0, 0.85); }
.media-viewer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 300px;
    min-height: 200px;
}
.media-viewer-image {
    max-width: 85vw;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 4px;
}
.media-viewer-video {
    max-width: 85vw;
    max-height: 75vh;
    border-radius: 4px;
    background: #000;
}
.media-viewer-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.88rem;
    gap: 12px;
}
.media-viewer-actions { display: flex; gap: 8px; flex-shrink: 0; }

@media (max-width: 768px) {
    .media-viewer-container { max-width: 96vw; }
    .media-viewer-image, .media-viewer-video { max-width: 94vw; max-height: 70vh; }
    .recording-thumbnail { height: 100px; }
    .recordings-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
}

.settings-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    max-width: 100%;
}

.settings-card {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    overflow: visible;
    -webkit-overflow-scrolling: touch;
    box-shadow: var(--shadow-md), var(--highlight-top);
}

.settings-card h3 {
    margin-bottom: 20px;
    font-size: 15px;
    font-weight: 600;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.settings-card .form-group { margin-bottom: 16px; }

.settings-card label:not(.rbac-checkbox-label):not(.switch-toggle):not(.toggle-switch) {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 13px;
    color: var(--text-muted);
}

.settings-card input[type="text"],
.settings-card input[type="number"],
.settings-card input[type="password"],
.settings-card input[type="email"],
.settings-card input[type="url"],
.settings-card textarea {
    width: 100%;
    padding: 8px 10px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px;
    color: var(--text-light);
    font-size: 13px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s, border-color 0.15s;
}

.settings-card input:focus, .settings-card textarea:focus, .settings-card select:focus {
    outline: none;
    border-color: rgba(245,158,11,0.4);
    box-shadow: 0 0 0 2px rgba(245,158,11,0.12), var(--shadow-sm);
}

.settings-card input[type="color"] {
    width: 60px;
    height: 36px;
    cursor: pointer;
    padding: 2px;
}

.settings-card small {
    display: block;
    margin-top: 4px;
    color: var(--text-dim);
    font-size: 11px;
}

.color-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
}

.color-row .form-group { flex: 1; }

.logo-upload-area {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    background: var(--bg-dark);
}

.logo-upload-area:hover, .logo-upload-area.drag-over {
    border-color: var(--primary);
    background: var(--primary-light);
}

.logo-upload-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
}

.logo-upload-prompt svg { opacity: 0.5; }
.logo-upload-prompt span { font-size: 13px; }
.logo-upload-prompt small { font-size: 11px; color: var(--text-dim); }

.logo-preview {
    padding: 12px;
    background: var(--bg-dark);
    border-radius: 6px;
    text-align: center;
    position: relative;
    display: inline-block;
}

.logo-preview img {
    max-height: 48px;
    max-width: 200px;
    object-fit: contain;
}

.logo-remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--danger);
    color: white;
    border: none;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.15s;
}

.logo-remove-btn:hover { background: var(--danger-dark); }

#usersTableContainer {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.inventory-status-filters {
    display: flex;
    gap: 8px;
    padding: 0 0 12px 0;
    flex-wrap: wrap;
}

.btn-inv-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-inv-filter:hover {
    border-color: var(--text-light);
    color: var(--text-light);
}

.btn-inv-filter.active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

.btn-inv-filter .flight-status-dot {
    width: 8px;
    height: 8px;
    flex-shrink: 0;
}

.inv-filter-count {
    background: rgba(255,255,255,0.08);
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 11px;
    margin-left: 2px;
}

.btn-inv-filter.active .inv-filter-count {
    background: rgba(245, 158, 11, 0.2);
}

.btn-inv-filter.filter-umn {
    color: var(--text-muted);
}

.btn-inv-filter.filter-umn.active {
    border-color: #f97316;
    background: rgba(249, 115, 22, 0.1);
    color: #f97316;
}

.btn-inv-filter.filter-umn.active .inv-filter-count {
    background: rgba(249, 115, 22, 0.2);
}

.users-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.users-table th, .users-table td {
    padding: 10px 12px;
    text-align: left;
    font-size: 13px;
    border-bottom: 2px solid var(--border);
}

.users-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 3px solid var(--border);
}

.users-table td { color: var(--text-light); }

.users-table tr:hover td { background: rgba(255,255,255,0.04); }

.deactivated-toggle {
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--text-muted);
}
.deactivated-toggle label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}
.deactivated-toggle input[type="checkbox"] {
    accent-color: var(--primary);
}
.user-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 12px;
}

.user-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 16px;
    box-shadow: var(--shadow-md), var(--highlight-top);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.user-card:hover {
    border-color: rgba(255,255,255,0.12);
    box-shadow: var(--shadow-lg), var(--highlight-top);
}

.user-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.user-card-identity {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.user-card-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-card-you {
    font-weight: 400;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.4);
}

.user-card-email {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-card-badges {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}

.user-card-details {
    display: flex;
    gap: 16px;
    padding: 10px 0;
    border-top: 1px solid rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 12px;
}

.user-card-detail {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.user-card-detail-label {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.35);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.user-card-detail-value {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.75);
}

.user-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.user-card-deactivated {
    opacity: 0.55;
}

.user-card-deactivated .user-card-actions {
    opacity: 1;
}

.user-card-suspended .user-card-name {
    color: #f59e0b;
}

.user-card-actions .role-select {
    width: auto;
}

@media (max-width: 600px) {
    .user-cards-grid {
        grid-template-columns: 1fr;
    }
    .user-card-details {
        flex-wrap: wrap;
        gap: 10px;
    }
}

.logs-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.logs-table .badge-action {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(245, 158, 11, 0.15);
    color: var(--primary);
}

.severity-filter-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.btn-severity-filter {
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-severity-filter:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.btn-severity-filter.active {
    border-color: var(--primary);
    color: #fff;
}

.filter-sev-all.active {
    background: rgba(255, 255, 255, 0.12);
}

.filter-sev-info.active {
    background: rgba(59, 130, 246, 0.25);
    border-color: #6da3f7;
}

.filter-sev-warning.active {
    background: rgba(245, 158, 11, 0.25);
    border-color: #f0a530;
}

.filter-sev-critical.active {
    background: rgba(239, 68, 68, 0.25);
    border-color: #f06060;
}

.logs-table .badge-info {
    background: rgba(59, 130, 246, 0.15);
    color: #6da3f7;
}

.logs-table .badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #f0a530;
}

.logs-table .badge-critical {
    background: rgba(239, 68, 68, 0.15);
    color: #f06060;
}

.logs-table tr.log-info td {
    color: rgba(255, 255, 255, 0.7);
}

.logs-table tr.log-warning td {
    color: #f0a530;
}

.logs-table tr.log-critical td {
    color: #f06060;
}

.logs-table td:nth-child(4) {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logs-table td:nth-child(5) {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--text-muted);
}

.badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.badge-admin { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
.badge-viewer { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }

.modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-light);
    border-radius: 10px;
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg), var(--highlight-top);
}

.modal-large { max-width: 640px; }

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

.modal-header h2 { font-size: 16px; font-weight: 600; }

.modal-header .modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    width: 28px; height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.15s;
}

.modal-header .modal-close:hover { background: var(--bg-lighter); color: var(--text-light); }

.modal-footer .modal-close.btn-secondary {
    width: auto;
    height: auto;
    font-size: 13px;
}

.modal-body { padding: 20px; }
.modal-body .form-group { margin-bottom: 16px; }
.modal-body label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 13px; }
.modal-body input, .modal-body textarea, .modal-body select {
    width: 100%;
    padding: 8px 10px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px;
    color: var(--text-light);
    font-size: 13px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s, border-color 0.15s;
}
.modal-body input:focus, .modal-body textarea:focus, .modal-body select:focus {
    outline: none;
    border-color: rgba(245,158,11,0.4);
    box-shadow: 0 0 0 2px rgba(245,158,11,0.12), var(--shadow-sm);
}
.modal-body textarea { min-height: 80px; resize: vertical; }
.modal-body small { font-size: 12px; color: var(--text-dim); display: block; margin-top: 4px; }

.fix-parts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 4px;
}

.fix-part-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 0.9rem;
}

.fix-part-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.fix-part-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    flex-shrink: 0;
}

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

.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; }
.form-group input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), .form-group textarea {
    width: 100%;
    padding: 8px 10px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px;
    color: var(--text-light);
    font-size: 13px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s, border-color 0.15s;
}
.form-group input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):focus, .form-group textarea:focus {
    outline: none;
    border-color: rgba(245,158,11,0.4);
    box-shadow: 0 0 0 2px rgba(245,158,11,0.12), var(--shadow-sm);
}
.form-group input[type="checkbox"] {
    accent-color: var(--primary, #F59E0B);
    cursor: pointer;
}

.stream-config h3 { margin-bottom: 16px; font-size: 18px; }

.config-group { margin-bottom: 16px; }
.config-group label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 13px; color: var(--text-muted); }

.input-copy { display: flex; gap: 6px; }
.input-copy input {
    flex: 1;
    padding: 8px 10px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-light);
    font-family: monospace;
    font-size: 13px;
}

.info-box {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
}

.info-box h4 { font-size: 13px; margin-bottom: 8px; color: var(--primary); font-weight: 600; }
.info-box > p { color: var(--text-muted); font-size: 13px; margin-bottom: 12px; }

.config-preview {
    background: var(--bg-darker);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 8px;
}

.config-item { margin-bottom: 12px; }
.config-item:last-child { margin-bottom: 0; }

.config-item label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.value-display {
    background: var(--bg-light);
    padding: 8px 12px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
    color: var(--accent);
    border: 1px solid var(--border);
    word-break: break-all;
}

.config-note {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 8px;
    padding: 8px 12px;
    background: var(--primary-light);
    border-radius: 4px;
    border-left: 2px solid var(--primary);
}

.stream-title-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.stream-title-display h3 { font-size: 18px; margin: 0; }

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.config-section { margin-bottom: 20px; }
.config-section h4 { font-size: 13px; margin-bottom: 12px; color: var(--primary); font-weight: 600; }

.config-instructions {
    background: var(--bg-dark);
    border-radius: 8px;
    padding: 16px;
    border-left: 3px solid var(--primary);
}

.config-instructions h4 { font-size: 13px; margin-bottom: 12px; color: var(--text-light); }

.config-instructions ol {
    margin-left: 16px;
    color: var(--text-muted);
    line-height: 1.8;
}

.config-instructions li { margin-bottom: 6px; font-size: 13px; }
.config-instructions li strong { color: var(--text-light); }

.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    z-index: 2000;
    animation: slideIn 0.3s ease;
    max-width: 360px;
}

.toast-success { background: var(--success); color: white; }
.toast-error { background: var(--danger); color: white; }

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

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

.mobile-status-dot { display: none; }
.mobile-time { display: none; }

.logbook-table td {
    vertical-align: top;
}

.logbook-notes-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-lang {
    width: 100%;
    padding: 6px 8px;
    margin-bottom: 8px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.15s;
    text-align: center;
}
.login-lang-toggle {
    display: block;
    margin: 16px auto 0;
    padding: 4px 16px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.15s;
}
.login-lang-toggle:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}
.btn-lang:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 150;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-light);
    padding: 8px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.mobile-overlay {
    display: none;
}

@media (max-width: 768px) {
    .mobile-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        width: 260px;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
        padding: 16px;
        padding-top: 56px;
    }
    .mobile-menu-btn {
        display: flex;
    }
    .mobile-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }
    .streams-grid {
        grid-template-columns: 1fr !important;
    }
    .streams-grid[data-count="2"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .settings-container {
        grid-template-columns: 1fr;
    }
    .view-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .view-header-actions {
        width: 100%;
    }
    .color-row {
        flex-wrap: wrap;
    }
    .form-row {
        flex-direction: column;
    }
    .users-table:not(.logbook-table), .user-cards-grid, .logs-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .logbook-table thead,
    .logbook-table .mobile-hide,
    #inventoryTableContainer .users-table thead,
    #inventoryTableContainer .users-table .mobile-hide {
        display: none;
    }
    .mobile-status-dot { display: inline; margin-right: 6px; }
    .mobile-time { display: inline; }
    .logbook-table tbody tr:not(.detail-row),
    #inventoryTableContainer .users-table tbody tr:not(.detail-row) {
        display: block;
        background: var(--bg-light);
        border: 1px solid var(--border);
        border-radius: 8px;
        margin-bottom: 8px;
        padding: 10px 12px;
    }
    .logbook-table tbody tr:not(.detail-row) td,
    #inventoryTableContainer .users-table tbody tr:not(.detail-row) td {
        display: flex;
        align-items: center;
        padding: 3px 0;
        border: none;
        font-size: 13px;
    }
    .logbook-table tbody tr:not(.detail-row) td[data-label]:not([data-label=""])::before,
    #inventoryTableContainer .users-table tbody tr:not(.detail-row) td[data-label]:not([data-label=""])::before {
        content: attr(data-label) ": ";
        font-weight: 600;
        color: var(--text-muted);
        min-width: 80px;
        font-size: 11px;
        flex-shrink: 0;
    }
    .logbook-table .detail-row td,
    #inventoryTableContainer .users-table .detail-row td {
        display: block;
        padding: 0;
    }
    .logbook-table .detail-row,
    #inventoryTableContainer .users-table .detail-row {
        border: none;
        margin-top: -8px;
        margin-bottom: 8px;
    }
    .input-copy {
        flex-wrap: wrap;
    }
    .input-copy input {
        min-width: 0;
    }
    .stream-item {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    .stream-item-actions {
        width: 100%;
        justify-content: flex-start;
    }
    .config-instructions ol {
        padding-left: 20px;
    }
    .modal-content {
        width: 95%;
        max-height: 85vh;
    }
    .modal-large {
        max-width: 95%;
    }
    .modal-body {
        max-height: 65vh;
    }
    .dh-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .dh-card-reporter {
        align-self: flex-start;
    }
    .actions-menu {
        right: auto;
        left: 0;
        min-width: 150px;
    }
    .detail-panel {
        grid-template-columns: 1fr 1fr;
        margin: 0 4px 4px;
        padding: 10px 12px;
    }
    .btn-primary, .btn-secondary, .btn-danger, .btn-warning, .btn-success {
        font-size: 13px;
        padding: 8px 14px;
    }
    .toast-container {
        left: 12px;
        right: 12px;
        bottom: 12px;
    }
    .toast {
        min-width: auto;
        width: 100%;
    }
    .abort-reasons {
        max-height: 40vh;
    }
    .recordings-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .settings-tabs {
        flex-direction: column;
    }
    .settings-tab {
        padding: 8px 14px;
        font-size: 0.82rem;
    }
    .registries-grid {
        grid-template-columns: 1fr;
    }
    .lpr-search-input {
        width: 100%;
    }
    .drone-summary-grid {
        grid-template-columns: 1fr 1fr;
    }
    .stream-actions {
        flex-wrap: wrap;
    }
    .sidebar-header {
        padding: 18px 16px 16px;
        gap: 10px;
    }
    .sidebar-logo {
        width: 56px;
        height: 56px;
    }
    .sidebar-logo-img {
        width: 56px;
        height: 56px;
    }
    .sidebar-logo img:not(.sidebar-logo-img) {
        width: 56px;
        height: 56px;
    }
    .sidebar-header h2 {
        font-size: 16px;
    }
    .logbook-map-preview {
        height: 160px;
    }
    .logbook-detail-map {
        height: 180px;
    }
    .location-card-actions {
        flex-wrap: wrap;
    }
    .flight-plan-card-actions {
        flex-wrap: wrap;
    }
    #flightPlansList {
        grid-template-columns: 1fr 1fr;
    }
    .map-editor-tools {
        padding: 12px;
    }
    .map-elements-list {
        padding: 12px;
    }
    .map-tool-grid {
        grid-template-columns: 1fr 1fr;
        gap: 4px;
    }
    .map-tool-item {
        padding: 8px 4px;
        font-size: 0.65rem;
    }
}

.stream-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--primary);
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 500;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.registries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.registry-header h3 {
    margin: 0 0 12px;
    font-size: 0.95rem;
    font-weight: 600;
}

.registry-add-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.registry-add-row input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.85rem;
}

.registry-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.registry-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

.registry-item:last-child {
    border-bottom: none;
}

.registry-empty {
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding: 8px 0;
}

.btn-xs {
    padding: 2px 8px;
    font-size: 0.75rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    background: var(--danger);
    color: white;
    line-height: 1.4;
}

.btn-xs:hover {
    background: var(--danger-dark);
}

.drone-summary {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
}

.drone-summary h4 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--primary);
}

.drone-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 6px 16px;
    font-size: 12px;
}

.drone-summary-grid .summary-label {
    color: var(--text-muted);
}

.drone-summary-notes {
    grid-column: 1 / -1;
}

.logbook-map-preview {
    height: 200px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
    background: var(--bg-dark);
}

.logbook-detail-map {
    height: 250px;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-dark);
    margin-top: 8px;
}

.detail-item.detail-map {
    grid-column: 1 / -1;
}

.role-select {
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.8rem;
    cursor: pointer;
}

.badge-commander {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.badge-operator {
    background: rgba(245, 158, 11, 0.15);
    color: #F59E0B;
}

.badge-control_room {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.flight-status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
}

.flight-status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.flight-status-dot.green { background: #22c55e; box-shadow: 0 0 6px rgba(34, 197, 94, 0.5); }
.flight-status-dot.yellow { background: #eab308; box-shadow: 0 0 6px rgba(234, 179, 8, 0.5); }
.flight-status-dot.red { background: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, 0.5); }

.traffic-light-selector {
    display: flex;
    gap: 12px;
    margin: 8px 0;
}

.traffic-light-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    flex: 1;
    transition: border-color 0.2s, background 0.2s;
}

.traffic-light-option:hover {
    background: var(--bg-light);
}

.traffic-light-option.selected {
    border-color: var(--primary);
    background: var(--bg-light);
}

.traffic-light-option input[type="radio"] {
    display: none;
}

.traffic-light-option .tl-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}

.traffic-light-option .tl-dot.green { background: #22c55e; }
.traffic-light-option .tl-dot.yellow { background: #eab308; }
.traffic-light-option .tl-dot.red { background: #ef4444; }

.traffic-light-option .tl-label {
    font-size: 13px;
    font-weight: 500;
}

.traffic-light-option .tl-label.yellow {
    color: #eab308;
}

.traffic-light-option .tl-label.red {
    color: #ef4444;
}

.traffic-light-option .tl-desc {
    font-size: 11px;
    color: var(--text-muted);
}

.damage-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 8px 0;
}

.damage-info {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.detail-row td {
    padding: 0 !important;
    border-top: none !important;
}

.detail-panel {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-top: 2px solid var(--primary);
    border-radius: 0 0 8px 8px;
    margin: 0 8px 8px;
    padding: 14px 18px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px 24px;
    font-size: 13px;
}

.detail-panel .detail-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.detail-panel .detail-label {
    color: var(--text-muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 600;
}

.detail-panel .detail-value {
    font-weight: 500;
    color: var(--text-primary);
}

.detail-panel .detail-full {
    grid-column: 1 / -1;
}

.detail-panel .damage-summary {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 2px;
}

.detail-panel .damage-tag {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.last-active-text {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
}

.flight-hours-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.flight-hours-ok {
    background: rgba(16,185,129,0.1);
    color: #10b981;
}

.flight-hours-warn {
    background: rgba(245,158,11,0.15);
    color: #f59e0b;
}

.flight-hours-urgent {
    background: rgba(239,68,68,0.15);
    color: #ef4444;
}

.flight-hours-grounded {
    background: rgba(220,38,38,0.25);
    color: #fca5a5;
    font-weight: 700;
    animation: pulse-grounded 2s ease-in-out infinite;
}

@keyframes pulse-grounded {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.flight-hours-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    margin-top: 2px;
    letter-spacing: 0.3px;
}

.flight-hours-label.flight-hours-warn {
    background: none;
}

.flight-hours-label.flight-hours-urgent {
    background: none;
}

.flight-hours-label.flight-hours-grounded {
    background: none;
    font-weight: 700;
}

.btn-icon {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 13px;
    transition: background 0.15s, color 0.15s;
    line-height: 1;
}

.btn-icon:hover {
    background: var(--bg-light);
    color: var(--text-primary);
}

.drone-status-warning {
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 12px;
    font-size: 13px;
    line-height: 1.5;
}

.drone-status-warning p {
    margin: 8px 0;
    font-weight: 500;
}

.drone-status-warning .status-warning-header {
    font-size: 14px;
    font-weight: 600;
}

.drone-status-warning .status-warning-damage,
.drone-status-warning .status-warning-notes {
    margin-top: 8px;
    font-size: 12px;
}

.drone-status-warning .damage-summary {
    display: inline-flex;
    gap: 6px;
    flex-wrap: wrap;
    vertical-align: middle;
}

.drone-status-warning .damage-tag {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.drone-status-red {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

.drone-status-red .damage-tag {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.drone-status-yellow {
    background: rgba(234, 179, 8, 0.12);
    border: 1px solid rgba(234, 179, 8, 0.35);
    color: #fde68a;
}

.drone-status-yellow .damage-tag {
    background: rgba(234, 179, 8, 0.2);
    color: #fde68a;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.drone-status-umn {
    background: rgba(239, 120, 40, 0.12);
    border: 1px solid rgba(239, 120, 40, 0.35);
    color: #fdba74;
}

.drone-status-accepted {
    opacity: 0.6;
    border-style: dashed;
}

.btn-success {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.4);
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-success:hover {
    background: rgba(34, 197, 94, 0.35);
}

.btn-warning {
    background: rgba(234, 179, 8, 0.2);
    color: #fde68a;
    border: 1px solid rgba(234, 179, 8, 0.4);
}

.btn-warning:hover {
    background: rgba(234, 179, 8, 0.35);
}

.user-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.user-active {
    background: rgba(16,185,129,0.12);
    color: #10b981;
}

.user-suspended {
    background: rgba(245,158,11,0.15);
    color: #f59e0b;
}

.user-deactivated {
    background: rgba(239,68,68,0.15);
    color: #ef4444;
}

.user-row-deactivated td {
    opacity: 0.5;
}

.user-row-deactivated td:last-child {
    opacity: 1;
}

.user-row-suspended td:first-child strong {
    color: #f59e0b;
}

@media (max-width: 600px) {
    .traffic-light-selector {
        flex-direction: column;
    }
    .detail-panel {
        grid-template-columns: 1fr;
    }
    .login-container {
        padding: 24px;
        margin: 16px;
        width: calc(100% - 32px);
    }
    .view-header h1 {
        font-size: 18px;
    }
    .dh-card {
        padding: 10px 12px;
    }
    .dh-card-date {
        font-size: 13px;
    }
    .modal-header h2 {
        font-size: 16px;
    }
    .streams-grid[data-count="2"] {
        grid-template-columns: 1fr !important;
    }
    .settings-container {
        grid-template-columns: 1fr;
    }
    .registry-add-row {
        flex-direction: column;
    }
    .color-row {
        flex-direction: column;
    }
    .login-logo-img {
        width: 120px;
        height: 120px;
    }
    .login-container h1 {
        font-size: 22px;
    }
    .logbook-map-preview {
        height: 140px;
    }
    .logbook-detail-map {
        height: 150px;
    }
    .sidebar-logo {
        width: 48px;
        height: 48px;
    }
    .sidebar-logo-img {
        width: 48px;
        height: 48px;
    }
    .sidebar-logo img:not(.sidebar-logo-img) {
        width: 48px;
        height: 48px;
    }
    .sidebar-header h2 {
        font-size: 15px;
    }
    .locations-grid {
        grid-template-columns: 1fr;
    }
    .location-card-body {
        flex-direction: column;
    }
    .location-card-map {
        height: 120px;
        width: 100%;
    }
    .map-editor-map {
        height: 40vh;
    }
    .rbac-role-section {
        padding: 12px;
    }
    .rbac-checkboxes {
        grid-template-columns: 1fr;
    }
}

.logbook-aborted {
    position: relative;
    opacity: 0.7;
}

.logbook-aborted td {
    text-decoration: line-through;
    text-decoration-color: #ef4444;
    text-decoration-thickness: 2px;
}

.logbook-aborted td:last-child {
    text-decoration: none;
}

.abort-badge {
    display: inline-block;
    background: #ef4444;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.abort-detail {
    border-left: 3px solid #ef4444;
    padding-left: 8px;
}

.abort-warning-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 18px;
    color: #ef4444;
    font-weight: 600;
    font-size: 1rem;
}

.abort-warning-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.abort-reason-display {
    background: var(--bg-tertiary, #1e1e2e);
    border-radius: 8px;
    padding: 20px;
}

.abort-reason-header {
    text-align: center;
    margin-bottom: 8px;
}

.abort-reason-box {
    background: var(--bg-primary, #0A0A0B);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 6px;
    padding: 14px 16px;
    color: var(--text-primary, #e0e0e0);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 60px;
}

.abort-reason-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 14px;
    font-size: 0.85rem;
    color: var(--text-secondary, #a0a0a0);
}

#abortReasonInput {
    border-color: rgba(239, 68, 68, 0.3);
}

#abortReasonInput:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.damage-history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dh-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 14px 16px;
    transition: background 0.15s;
}

.dh-card:hover {
    background: rgba(255,255,255,0.06);
}

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

.dh-card-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dh-card-meta {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.dh-card-date {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
}

.dh-card-time {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
}

.dh-card-reporter {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.06);
    padding: 4px 10px;
    border-radius: 6px;
}

.dh-card-areas {
    margin-bottom: 4px;
}

.dh-card-areas .damage-summary {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.dh-card-areas .damage-tag {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.dh-card-fixed {
    border-color: rgba(34, 197, 94, 0.2);
    background: rgba(34, 197, 94, 0.04);
}

.dh-fixed-badge {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.3);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.dh-notes-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.15s;
}

.dh-notes-toggle:hover {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.8);
}

.dh-notes-toggle .dh-notes-icon {
    display: inline-block;
    transition: transform 0.2s;
    font-size: 10px;
}

.dh-notes-toggle.open .dh-notes-icon {
    transform: rotate(180deg);
}

.dh-notes-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease, padding 0.25s ease;
    font-size: 13px;
    color: rgba(255,255,255,0.65);
    line-height: 1.5;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
    padding: 0 12px;
    margin-top: 0;
}

.dh-notes-content.expanded {
    max-height: 200px;
    padding: 10px 12px;
    margin-top: 8px;
}

.actions-dropdown {
    position: relative;
    display: inline-block;
}

.actions-trigger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.actions-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: #1e2330;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    min-width: 170px;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0,0,0,0.6);
    padding: 4px 0;
    overflow: hidden;
    backdrop-filter: blur(12px);
}

.actions-menu.open {
    display: block;
}

.actions-menu button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 9px 14px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.12s;
}

.actions-menu button:hover {
    background: rgba(255,255,255,0.06);
}

.actions-menu .action-success {
    color: #86efac;
}

.actions-menu .action-danger {
    color: #fca5a5;
}

.actions-menu .action-danger:hover {
    background: rgba(239, 68, 68, 0.12);
}

.actions-menu .action-success:hover {
    background: rgba(34, 197, 94, 0.12);
}

.analytics-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.analytics-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.analytics-badge-online {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}
.analytics-badge-online::before {
    background: #10b981;
    box-shadow: 0 0 6px #10b981;
}
.analytics-badge-offline {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}
.analytics-badge-offline::before {
    background: #ef4444;
}

.analytics-mode-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    padding: 3px;
    background: rgba(10, 10, 11, 0.4);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow-x: auto;
}
.analytics-mode-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.78rem;
    font-weight: 500;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    position: relative;
    font-family: inherit;
    flex: 1;
    justify-content: center;
}
.analytics-mode-tab:hover {
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.04);
}
.analytics-mode-tab.active {
    background: var(--primary, #F59E0B);
    color: #fff;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}
.analytics-mode-tab.active .analytics-mode-badge {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}
.analytics-mode-badge {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 1px 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.35);
}
.analytics-mode-tab svg {
    width: 15px;
    height: 15px;
}
.analytics-mode-content {
    display: none;
}
.analytics-mode-content.active {
    display: block;
}

.settings-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.settings-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    justify-content: center;
}
.settings-tab:hover {
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.04);
}
.settings-tab.active {
    background: var(--primary, #F59E0B);
    color: #fff;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}
.settings-tab-content {
    display: none;
}
.settings-tab-content.active {
    display: block;
}

.lpr-search-input {
    width: 160px;
}
.lpr-plate-number {
    font-family: monospace;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-primary, #EDEDED);
}

@media (max-width: 768px) {
    .analytics-mode-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 4px;
    }
    .analytics-mode-tab {
        padding: 8px 12px;
        font-size: 0.78rem;
    }
    .analytics-mode-tab span:not(.analytics-mode-badge) {
        display: none;
    }
}

.analytics-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.analytics-stat-card {
    background: var(--card-bg, rgba(22, 22, 24, 0.5));
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 18px 14px;
    text-align: center;
    transition: border-color 0.2s, transform 0.15s;
}
.analytics-stat-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}
.analytics-stat-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
    color: var(--accent, #FBBF24);
    opacity: 0.8;
}
.analytics-stat-icon svg {
    width: 22px;
    height: 22px;
}
.analytics-stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary, #EDEDED);
    line-height: 1;
    margin-bottom: 6px;
}
.analytics-stat-label {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.analytics-panels {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.analytics-panel {
    min-height: 200px;
}
.analytics-panel h3 {
    margin: 0 0 14px 0;
    font-size: 0.95rem;
    font-weight: 600;
}
.analytics-panel-full {
    grid-column: 1 / -1;
}
.analytics-panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.analytics-panel-header h3 {
    margin: 0;
    flex: 1;
}
.analytics-disabled-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: rgba(234, 179, 8, 0.08);
    border: 1px solid rgba(234, 179, 8, 0.2);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.88rem;
    margin-bottom: 16px;
}
.analytics-disabled-notice svg {
    color: #eab308;
    flex-shrink: 0;
}
.analytics-select {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary, #EDEDED);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
}
.analytics-select option {
    background: #161618;
    color: #EDEDED;
}
.analytics-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.35);
    text-align: center;
}
.analytics-empty p {
    margin: 12px 0 0 0;
    font-size: 0.85rem;
}

.people-counts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}
.people-count-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.people-count-card.has-people {
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.06);
}
.people-count-stream {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.people-count-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary, #EDEDED);
    line-height: 1;
}
.people-count-card.has-people .people-count-value {
    color: #60a5fa;
}
.people-count-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 4px;
    text-transform: uppercase;
}
.people-count-time {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.25);
    margin-top: 6px;
}
.object-counts-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    justify-content: center;
}
.object-count-item {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.analytics-chart {
    width: 100%;
    min-height: 200px;
    position: relative;
}
.chart-canvas-wrap {
    width: 100%;
    height: 220px;
    position: relative;
}
.chart-bar-group {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 180px;
    padding: 0 8px;
    overflow-x: auto;
}
.chart-bar {
    flex: 1;
    min-width: 4px;
    max-width: 20px;
    background: var(--accent, #FBBF24);
    border-radius: 3px 3px 0 0;
    opacity: 0.7;
    transition: opacity 0.15s;
    position: relative;
}
.chart-bar:hover {
    opacity: 1;
}
.chart-bar-tooltip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.85);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
    z-index: 10;
    margin-bottom: 4px;
}
.chart-bar:hover .chart-bar-tooltip {
    display: block;
}
.chart-time-labels {
    display: flex;
    justify-content: space-between;
    padding: 6px 8px 0;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.3);
}

.detection-events-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 500px;
    overflow-y: auto;
}
.detection-event-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.15s;
}
.detection-event-row:hover {
    background: rgba(255, 255, 255, 0.06);
}
.detection-event-thumb {
    width: 56px;
    height: 42px;
    border-radius: 6px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}
.detection-event-info {
    flex: 1;
    min-width: 0;
}
.detection-event-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary, #EDEDED);
    text-transform: capitalize;
}
.detection-event-stream {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2px;
}
.detection-event-meta {
    text-align: right;
    flex-shrink: 0;
}
.detection-event-score {
    font-size: 0.8rem;
    font-weight: 600;
    color: #34d399;
}
.detection-event-time {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 2px;
}

.analytics-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}
.analytics-pagination button {
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary, #EDEDED);
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.15s;
}
.analytics-pagination button:hover {
    background: rgba(255, 255, 255, 0.1);
}
.analytics-pagination button:disabled {
    opacity: 0.3;
    cursor: default;
}

@media (max-width: 768px) {
    .analytics-summary-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .analytics-panels {
        grid-template-columns: 1fr;
    }
    .analytics-stat-value {
        font-size: 1.5rem;
    }
    .analytics-panel-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .people-counts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .detection-event-row {
        flex-wrap: wrap;
    }
    .detection-event-meta {
        text-align: left;
        width: 100%;
        margin-top: 4px;
    }
}

@media (max-width: 480px) {
    .analytics-summary-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .analytics-stat-card {
        padding: 14px 10px;
    }
    .people-counts-grid {
        grid-template-columns: 1fr;
    }
    .recordings-grid {
        grid-template-columns: 1fr;
    }
}

.locations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.location-card {
    background: var(--card-bg, rgba(255,255,255,0.03));
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.15s;
    cursor: pointer;
}

.location-card:hover {
    border-color: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.location-card-map {
    height: 160px;
    background: #1a1f2e;
    position: relative;
}

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

.location-card-body h3 {
    margin: 0 0 4px;
    font-size: 1rem;
    font-weight: 600;
}

.location-card-body p {
    margin: 0;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
}

.location-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.4);
}

.location-card-actions {
    display: flex;
    gap: 6px;
    padding: 0 16px 16px;
}

.no-locations {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255,255,255,0.4);
}

.no-locations svg {
    opacity: 0.2;
    margin-bottom: 16px;
}

.no-locations p {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.no-locations small {
    font-size: 0.85rem;
    opacity: 0.6;
}

.flight-plan-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--card-bg, rgba(255,255,255,0.03));
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    margin-bottom: 8px;
    transition: border-color 0.2s;
}

.flight-plan-item:hover {
    border-color: rgba(255,255,255,0.15);
}

.flight-plan-item-info h3 {
    margin: 0 0 2px;
    font-size: 0.95rem;
    font-weight: 500;
}

.flight-plan-item-info p {
    margin: 0;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
}

.flight-plan-item-actions {
    display: flex;
    gap: 6px;
}

#flightPlansList {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.flight-plan-card {
    background: var(--card-bg, rgba(255,255,255,0.03));
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.15s;
}

.flight-plan-card:hover {
    border-color: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

.flight-plan-card-map {
    width: 100%;
    height: 160px;
    background: rgba(0,0,0,0.3);
}

.flight-plan-card-body {
    padding: 12px 14px;
}

.flight-plan-card-body h3 {
    margin: 0 0 4px;
    font-size: 0.95rem;
    font-weight: 600;
}

.flight-plan-card-body p {
    margin: 0;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.4);
}

.flight-plan-card-actions {
    margin-top: 8px;
    display: flex;
    gap: 6px;
}

@media (max-width: 600px) {
    #flightPlansList {
        grid-template-columns: 1fr;
    }
}

.map-editor-container {
    display: flex;
    height: calc(100vh - 140px);
    gap: 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08);
}

.map-editor-sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--card-bg, rgba(255,255,255,0.03));
    border-right: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.map-editor-tools {
    padding: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.map-editor-tools h3 {
    margin: 0 0 12px;
    font-size: 0.9rem;
    font-weight: 600;
}

.map-tool-btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    font-size: 0.8rem;
}

.map-elements-list {
    padding: 16px;
    flex: 1;
    overflow-y: auto;
}

.map-elements-list h4 {
    margin: 0 0 10px;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.map-element-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px;
    margin-bottom: 4px;
    font-size: 0.8rem;
    transition: background 0.15s;
}

.map-element-item:hover {
    background: rgba(255,255,255,0.07);
}

.map-element-item-info {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}

.map-element-dot {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    border-radius: 2px;
}

.map-element-dot.dot-nfz { background: rgba(239,68,68,0.5); border: 2px solid #ef4444; }
.map-element-dot.dot-pz { background: rgba(34,197,94,0.5); border: 2px solid #22c55e; }
.map-element-dot.dot-prop { background: #3b82f6; border-radius: 50%; border: 2px solid #fff; }
.map-element-dot.dot-circle { border-radius: 50%; }
.map-element-dot.dot-rectangle { border-radius: 1px; }

.map-element-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.map-editor-map {
    flex: 1;
    min-height: 400px;
}

.map-editor-map .leaflet-control-zoom a {
    background: #161618;
    color: #fff;
    border-color: rgba(255,255,255,0.1);
}

.leaflet-popup-content-wrapper {
    background: #161618;
    color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.leaflet-popup-tip {
    background: #161618;
}

.leaflet-popup-content {
    margin: 10px 14px;
    font-size: 0.85rem;
}

.leaflet-draw-toolbar a {
    background-color: #161618;
    border-color: rgba(255,255,255,0.1);
}

@media (max-width: 768px) {
    .locations-grid {
        grid-template-columns: 1fr;
    }

    .map-editor-container {
        flex-direction: column;
        height: auto;
    }

    .map-editor-sidebar {
        width: 100%;
        min-width: unset;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }

    .map-editor-map {
        height: 50vh;
    }

    .location-card-map {
        height: 120px;
    }
}

.rbac-role-section {
    padding: 12px 16px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    margin-bottom: 8px;
}

.rbac-role-section h4 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
}

.rbac-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.settings-card .rbac-checkbox-label,
.rbac-checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.85);
    font-weight: 400;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
    margin-bottom: 0;
}

.settings-card .rbac-checkbox-label:hover,
.rbac-checkbox-label:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.12);
}

.settings-card .rbac-checkbox-label input[type="checkbox"],
.rbac-checkbox-label input[type="checkbox"] {
    accent-color: var(--primary, #F59E0B);
    width: 14px;
    height: 14px;
    padding: 0;
    background: none;
    border: none;
}

.role-checkbox-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

@media (max-width: 600px) {
    .rbac-checkboxes {
        flex-direction: column;
    }
}

.map-color-picker {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.map-color-picker input[type="color"] {
    width: 28px;
    height: 28px;
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    background: none;
    cursor: pointer;
    padding: 0;
}

.map-color-presets {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.map-color-swatch {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid rgba(255,255,255,0.1);
    transition: transform 0.1s, border-color 0.15s;
}

.map-color-swatch:hover {
    transform: scale(1.15);
    border-color: rgba(255,255,255,0.4);
}

.map-tool-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-bottom: 8px;
}

.map-tool-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 4px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.03);
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    font-size: 0.65rem;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.map-tool-item svg {
    width: 16px;
    height: 16px;
}

.map-tool-item:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.2);
}

.map-tool-item:active {
    transform: scale(0.95);
}

.map-tool-item.active {
    background: var(--primary, #F59E0B);
    color: #fff;
    border-color: var(--primary, #F59E0B);
}

#btnEditMode.active {
    background: var(--primary, #F59E0B);
    color: #fff;
    border-color: var(--primary, #F59E0B);
}

#btnToggleLabels.active {
    background: var(--primary, #F59E0B);
    color: #fff;
    border-color: var(--primary, #F59E0B);
}

.map-mode-toggle {
    display: flex;
    gap: 0;
    margin-top: 8px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
}

.map-mode-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 5px 8px;
    font-size: 0.7rem;
    background: rgba(255,255,255,0.03);
    color: rgba(255,255,255,0.5);
    border: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.map-mode-btn:first-child {
    border-right: 1px solid rgba(255,255,255,0.1);
}

.map-mode-btn:hover {
    background: rgba(255,255,255,0.06);
}

.map-mode-btn.active {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.9);
}

.map-point-icon {
    background: none !important;
    border: none !important;
    overflow: visible !important;
}

.map-tool-hint {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.75);
    color: rgba(255,255,255,0.9);
    font-size: 12px;
    padding: 6px 14px;
    border-radius: 6px;
    z-index: 1000;
    pointer-events: none;
    white-space: nowrap;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.1);
}

.map-element-label {
    background: rgba(0,0,0,0.7) !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    color: #fff !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    padding: 2px 6px !important;
    border-radius: 3px !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4) !important;
    white-space: nowrap !important;
}

.map-element-label::before {
    display: none !important;
}

#locDrawMarker.active,
#locDrawPolyline.active,
#locDrawPolygon.active {
    background: var(--primary, #F59E0B);
    color: #fff;
    border-color: var(--primary, #F59E0B);
}

.analytics-general-card {
    padding: 16px 20px;
}

.analytics-general-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.analytics-general-left h3 {
    font-size: 14px;
    margin-bottom: 4px;
}

.analytics-general-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.analytics-inline-field {
    display: flex;
    align-items: center;
    gap: 8px;
}

.analytics-general-controls {
    display: flex;
    gap: 24px;
    align-items: flex-end;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border, #2A2A2E);
    flex-wrap: wrap;
}

.analytics-inline-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.analytics-inline-control label {
    margin: 0;
    white-space: nowrap;
    font-size: 13px;
}

.analytics-confidence-control {
    flex: 1;
    min-width: 200px;
}

.analytics-confidence-slider {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.analytics-confidence-slider input[type="range"] {
    flex: 1;
}

.analytics-confidence-value {
    font-size: 13px;
    color: var(--primary, #F59E0B);
    font-weight: 600;
    min-width: 36px;
    text-align: right;
}

.analytics-features-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.analytics-feature-card {
    transition: border-color 0.2s;
    padding: 14px 20px;
}

.analytics-feature-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.analytics-feature-info {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

.analytics-feature-info h3 {
    font-size: 14px;
    margin-bottom: 0;
}

.analytics-feature-info small {
    opacity: 0.5;
    font-size: 0.8rem;
    margin-top: 2px;
    display: block;
}

.analytics-feature-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(245, 158, 11, 0.1);
    color: var(--primary, #F59E0B);
    flex-shrink: 0;
}

.analytics-feature-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.analytics-feature-config {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border, #2A2A2E);
}

.analytics-config-hint {
    margin-bottom: 12px;
    opacity: 0.5;
    font-size: 0.8rem;
}

.analytics-save-bar {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 4px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #3A3A3E;
    transition: 0.2s;
    border-radius: 24px;
}

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

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary, #F59E0B);
}

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

.tracked-objects-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.detection-category {
    background: var(--card-bg, #1E1E20);
    border: 1px solid var(--border, #2A2A2E);
    border-radius: 8px;
    padding: 12px;
}

.detection-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text, #EDEDED);
}

.detection-category-header .btn-link {
    background: none;
    border: none;
    color: var(--primary, #F59E0B);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 2px 6px;
}

.detection-category-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.detection-object-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--border, #2A2A2E);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    background: transparent;
    font-size: 0.85rem;
    user-select: none;
}

.detection-object-toggle input[type="checkbox"] {
    display: none;
}

.detection-object-toggle:hover {
    border-color: var(--primary, #F59E0B);
    background: rgba(245, 158, 11, 0.05);
}

.detection-object-toggle.active {
    border-color: var(--primary, #F59E0B);
    background: rgba(245, 158, 11, 0.15);
    color: var(--primary, #F59E0B);
}

.detection-object-icon {
    font-size: 1.1rem;
    line-height: 1;
}

.detection-object-label {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .detection-object-toggle {
        padding: 5px 8px;
        font-size: 0.8rem;
    }
}

.audit-user-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
}

.audit-user-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.audit-user-card:hover {
    background: rgba(255,255,255,0.08);
    border-color: var(--primary);
}

.audit-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.audit-user-role {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.06);
    padding: 2px 8px;
    border-radius: 4px;
}

.audit-user-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.audit-action-count {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 600;
}

.audit-last-activity {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.3);
}

.audit-detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.audit-detail-title {
    font-weight: 600;
    font-size: 0.95rem;
    flex: 1;
}

.integrity-badge {
    font-family: monospace;
    font-size: 0.72rem;
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
}

.integrity-verified {
    background: rgba(16,185,129,0.15);
    color: #10b981;
}

.integrity-legacy {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.3);
}

.session-code {
    font-size: 0.72rem;
    background: rgba(255,255,255,0.06);
    padding: 2px 5px;
    border-radius: 3px;
    color: rgba(255,255,255,0.5);
}

.tfa-badge {
    font-size: 0.85rem;
    line-height: 1;
}

.tfa-badge.tfa-on {
    color: #10b981;
}

.tfa-badge.tfa-off {
    color: #ef4444;
}

.security-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
}

.security-toggle-label {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.8);
}

.enforce2fa-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 10px;
    padding: 16px 20px;
}

.enforce2fa-banner-left {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--primary);
}

.enforce2fa-banner-text {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
}

.switch-toggle {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

.switch-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 28px;
    transition: background 0.25s;
}

.switch-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.25s;
}

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

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

.grace-period-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}

.grace-period-left {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.grace-countdown {
    margin-top: 10px;
    padding: 10px 16px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 8px;
    color: #6da3f7;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 768px) {
    .audit-user-list {
        grid-template-columns: 1fr;
    }
    .audit-detail-header {
        flex-wrap: wrap;
    }
}

.summary-period-selector {
    display: flex;
    gap: 6px;
}

.summary-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.summary-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.summary-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.summary-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.summary-stat-alert .summary-stat-value {
    color: #ef4444;
}

.summary-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 140px;
    padding: 0 4px;
    overflow-x: auto;
}

.summary-bar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 28px;
    height: 100%;
    justify-content: flex-end;
}

.summary-bar {
    width: 100%;
    max-width: 40px;
    background: var(--primary);
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    transition: height 0.3s;
}

.summary-bar-label {
    font-size: 9px;
    color: var(--text-muted);
    margin-top: 6px;
    white-space: nowrap;
}

.summary-tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

.summary-top-row td {
    color: var(--primary) !important;
    font-weight: 600;
}

.summary-crown {
    color: var(--primary);
    font-size: 14px;
}

@media (max-width: 768px) {
    .summary-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .summary-tables-grid {
        grid-template-columns: 1fr;
    }
    .summary-stat-value {
        font-size: 1.5rem;
    }
}
