/* Flux Notify - Cyberpunk Theme with Dark/Light modes */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;900&family=Rajdhani:wght@300;400;500;600;700&family=Share+Tech+Mono&display=swap');

/* ---- Dark Mode (default) ---- */
:root, [data-theme="dark"] {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #161622;
    --bg-input: #1a1a2e;
    --border-color: #2a2a4a;
    --border-glow: #00f0ff;
    --text-primary: #eeeeff;
    --text-secondary: #b0b0cc;
    --text-muted: #7e7ea0;
    --text-table-head: #9999bb;
    --neon-cyan: #00f0ff;
    --neon-pink: #ff00aa;
    --neon-green: #00ff88;
    --neon-yellow: #ffee00;
    --neon-orange: #ff6600;
    --neon-red: #ff0044;
    --neon-purple: #aa00ff;
    --type-initial: #ff3366;
    --type-update: #ffee00;
    --type-resolved: #00ff88;
    --type-bridge: #cc55ff;
    --type-onetime: #00f0ff;
    --status-open: #ff3366;
    --status-closed: #00ff88;
    --status-sent: #00ff88;
    --status-failed: #ff3366;
    --status-pending: #ffee00;
    --status-draft: #9999bb;
    --status-queued: #00f0ff;
    --glow-sm: 0 0 5px;
    --glow-md: 0 0 10px;
    --glow-lg: 0 0 20px;
    --scanline-opacity: 0.01;
    --grid-opacity: 0.03;
    --particle-color: var(--neon-cyan);
    --card-glow-opacity: 0.5;
    --shadow-card: 0 2px 12px rgba(0,0,0,0.4);
    --hover-row: rgba(0, 240, 255, 0.03);
}

/* ---- Light Mode ---- */
[data-theme="light"] {
    --bg-primary: #f0f2f5;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-input: #f5f6fa;
    --border-color: #d0d4dd;
    --border-glow: #0077aa;
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a6a;
    --text-muted: #6a6a8a;
    --text-table-head: #5a5a7a;
    --neon-cyan: #0088bb;
    --neon-pink: #cc0088;
    --neon-green: #00994d;
    --neon-yellow: #aa8800;
    --neon-orange: #cc5500;
    --neon-red: #cc0033;
    --neon-purple: #7700bb;
    --type-initial: #cc0033;
    --type-update: #aa8800;
    --type-resolved: #00884d;
    --type-bridge: #7700bb;
    --type-onetime: #0077aa;
    --status-open: #cc0033;
    --status-closed: #00884d;
    --status-sent: #00884d;
    --status-failed: #cc0033;
    --status-pending: #aa8800;
    --status-draft: #6a6a8a;
    --status-queued: #0077aa;
    --glow-sm: 0 0 0px;
    --glow-md: 0 0 0px;
    --glow-lg: 0 0 0px;
    --scanline-opacity: 0;
    --grid-opacity: 0;
    --particle-color: transparent;
    --card-glow-opacity: 0;
    --shadow-card: 0 1px 4px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
    --hover-row: rgba(0, 100, 180, 0.04);
}

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

body {
    font-family: 'Rajdhani', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    font-size: 16px;
    line-height: 1.6;
}

/* Scanline overlay */
body::after {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 240, 255, var(--scanline-opacity)) 2px,
        rgba(0, 240, 255, var(--scanline-opacity)) 4px
    );
    pointer-events: none;
    z-index: 9999;
}

/* Grid background */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image: 
        linear-gradient(rgba(0, 240, 255, var(--grid-opacity)) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, var(--grid-opacity)) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: -1;
}

h1, h2, h3, h4, h5, h6,
.header-font {
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

code, .mono {
    font-family: 'Share Tech Mono', monospace;
}

a {
    color: var(--neon-cyan);
    text-decoration: none;
    transition: all 0.3s;
}
a:hover {
    color: #fff;
    text-shadow: var(--glow-sm) var(--neon-cyan);
}

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

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

.sidebar-brand {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(180deg, rgba(0,240,255,0.05), transparent);
}

.sidebar-brand h1 {
    font-size: 1.4rem;
    color: var(--neon-cyan);
    text-shadow: var(--glow-md) var(--neon-cyan);
    margin-bottom: 2px;
}

.sidebar-brand .subtitle {
    font-size: 0.7rem;
    color: var(--text-secondary);
    letter-spacing: 0.2em;
    font-family: 'Share Tech Mono', monospace;
}

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

.nav-section {
    padding: 8px 20px 4px;
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-family: 'Orbitron', sans-serif;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}
.nav-link:hover {
    color: var(--text-primary);
    background: rgba(0, 240, 255, 0.05);
    border-left-color: var(--neon-cyan);
    text-shadow: none;
}
.nav-link.active {
    color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.08);
    border-left-color: var(--neon-cyan);
}
.nav-link .icon {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 30px;
    min-height: 100vh;
}

.page-header {
    margin-bottom: 30px;
}

.page-header h2 {
    font-size: 1.6rem;
    color: var(--neon-cyan);
    text-shadow: var(--glow-sm) var(--neon-cyan);
    margin-bottom: 5px;
}

.page-header .breadcrumb {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: 'Share Tech Mono', monospace;
}

/* ---- Cards ---- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
    opacity: var(--card-glow-opacity);
}

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

.card-header h3 {
    font-size: 1rem;
    color: var(--text-primary);
}

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

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

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.05rem;
    font-weight: 500;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 0 2px rgba(0, 240, 255, 0.15), var(--glow-sm) rgba(0, 240, 255, 0.3);
}

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

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2388a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn:hover {
    border-color: var(--neon-cyan);
    box-shadow: var(--glow-sm) rgba(0, 240, 255, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(0, 240, 255, 0.05));
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}
.btn-primary:hover {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.3), rgba(0, 240, 255, 0.1));
    box-shadow: var(--glow-md) rgba(0, 240, 255, 0.3);
    color: #fff;
}

.btn-success {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.2), rgba(0, 255, 136, 0.05));
    border-color: var(--neon-green);
    color: var(--neon-green);
}

.btn-danger {
    background: linear-gradient(135deg, rgba(255, 0, 68, 0.2), rgba(255, 0, 68, 0.05));
    border-color: var(--neon-red);
    color: var(--neon-red);
}

.btn-warning {
    background: linear-gradient(135deg, rgba(255, 238, 0, 0.2), rgba(255, 238, 0, 0.05));
    border-color: var(--neon-yellow);
    color: var(--neon-yellow);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

/* ---- Tables ---- */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    padding: 12px 16px;
    text-align: left;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    color: var(--text-table-head);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(42, 42, 74, 0.5);
    font-size: 0.95rem;
}

tr:hover td {
    background: var(--hover-row);
}

/* ---- Badges ---- */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: 'Share Tech Mono', monospace;
}

.badge-initial { background: rgba(255,0,68,0.15); color: var(--type-initial); border: 1px solid rgba(255,0,68,0.3); }
.badge-update { background: rgba(255,238,0,0.15); color: var(--type-update); border: 1px solid rgba(255,238,0,0.3); }
.badge-resolved { background: rgba(0,255,136,0.15); color: var(--type-resolved); border: 1px solid rgba(0,255,136,0.3); }
.badge-bridge { background: rgba(170,0,255,0.15); color: var(--type-bridge); border: 1px solid rgba(170,0,255,0.3); }
.badge-one-time { background: rgba(0,240,255,0.15); color: var(--type-onetime); border: 1px solid rgba(0,240,255,0.3); }

.badge-open { background: rgba(255,0,68,0.15); color: var(--status-open); border: 1px solid rgba(255,0,68,0.3); }
.badge-closed { background: rgba(0,255,136,0.15); color: var(--status-closed); border: 1px solid rgba(0,255,136,0.3); }
.badge-sent { background: rgba(0,255,136,0.15); color: var(--status-sent); border: 1px solid rgba(0,255,136,0.3); }
.badge-failed { background: rgba(255,0,68,0.15); color: var(--status-failed); border: 1px solid rgba(255,0,68,0.3); }
.badge-pending { background: rgba(255,238,0,0.15); color: var(--status-pending); border: 1px solid rgba(255,238,0,0.3); }
.badge-pending_approval { background: rgba(0,240,255,0.15); color: var(--neon-cyan); border: 1px solid rgba(0,240,255,0.35); animation: p1-pulse 3s ease-in-out infinite; }
[data-theme="light"] .badge-pending_approval { background: rgba(0,120,180,0.1); color: #006699; border-color: rgba(0,120,180,0.3); }
.badge-draft { background: rgba(136,136,170,0.15); color: var(--status-draft); border: 1px solid rgba(136,136,170,0.3); }
.badge-queued { background: rgba(0,240,255,0.15); color: var(--status-queued); border: 1px solid rgba(0,240,255,0.3); }

.badge-viewer { background: rgba(136,136,170,0.15); color: var(--text-secondary); }
.badge-operator { background: rgba(0,240,255,0.15); color: var(--neon-cyan); }
.badge-admin { background: rgba(255,238,0,0.15); color: var(--neon-yellow); }
.badge-superadmin { background: rgba(255,0,170,0.15); color: var(--neon-pink); }

/* Severity badges */
.badge-P1 { background: rgba(255,0,68,0.2); color: var(--neon-red); border: 1px solid rgba(255,0,68,0.5); font-weight: 900; animation: p1-pulse 2s ease-in-out infinite; }
.badge-P2 { background: rgba(255,102,0,0.2); color: var(--neon-orange); border: 1px solid rgba(255,102,0,0.4); font-weight: 900; }
.badge-P3 { background: rgba(255,238,0,0.15); color: var(--neon-yellow); border: 1px solid rgba(255,238,0,0.3); }
.badge-P4 { background: rgba(136,136,170,0.15); color: var(--text-secondary); border: 1px solid rgba(136,136,170,0.3); }
@keyframes p1-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.7; } }

[data-theme="light"] .badge-P1 { background: rgba(204,0,33,0.12); color: #cc0022; border-color: rgba(204,0,33,0.35); }
[data-theme="light"] .badge-P2 { background: rgba(204,85,0,0.12); color: #cc5500; border-color: rgba(204,85,0,0.35); }
[data-theme="light"] .badge-P3 { background: rgba(170,136,0,0.12); color: #8a6e00; border-color: rgba(170,136,0,0.3); }
[data-theme="light"] .badge-P4 { background: rgba(100,100,130,0.1); color: #555; border-color: rgba(100,100,130,0.25); }

/* SLA timer */
.sla-timer { font-family: 'Share Tech Mono', monospace; font-size: 0.85rem; padding: 4px 10px; border-radius: 4px; }
.sla-ok { background: rgba(0,255,136,0.1); color: var(--neon-green); }
.sla-warn { background: rgba(255,238,0,0.15); color: var(--neon-yellow); }
.sla-breach { background: rgba(255,0,68,0.2); color: var(--neon-red); animation: p1-pulse 1.5s ease-in-out infinite; }

/* Heatmap */
.heatmap-grid { display: grid; grid-template-columns: 40px repeat(24, 1fr); gap: 2px; font-size: 0.7rem; }
.heatmap-cell { aspect-ratio: 1; border-radius: 3px; display: flex; align-items: center; justify-content: center; font-family: 'Share Tech Mono', monospace; font-size: 0.65rem; cursor: default; }
.heatmap-label { display: flex; align-items: center; font-family: 'Share Tech Mono', monospace; font-size: 0.65rem; color: var(--text-secondary); }
.heat-0 { background: var(--bg-input); }
.heat-1 { background: rgba(0,255,136,0.2); color: var(--neon-green); }
.heat-2 { background: rgba(255,238,0,0.25); color: var(--neon-yellow); }
.heat-3 { background: rgba(255,102,0,0.3); color: var(--neon-orange); }
.heat-4 { background: rgba(255,0,68,0.35); color: var(--neon-red); }
[data-theme="light"] .heat-0 { background: #f0f2f5; }
[data-theme="light"] .heat-1 { background: rgba(0,150,80,0.15); color: #006633; }
[data-theme="light"] .heat-2 { background: rgba(180,140,0,0.2); color: #8a6e00; }
[data-theme="light"] .heat-3 { background: rgba(204,85,0,0.25); color: #cc5500; }
[data-theme="light"] .heat-4 { background: rgba(204,0,33,0.3); color: #cc0022; }

/* ---- Stats cards ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px 8px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.stat-card .stat-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2px;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1.2;
}

/* ---- Timeline ---- */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -25px;
    top: 20px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--neon-cyan);
    background: var(--bg-primary);
}

.timeline-item.type-initial::before { border-color: var(--type-initial); }
.timeline-item.type-update::before { border-color: var(--type-update); }
.timeline-item.type-resolved::before { border-color: var(--type-resolved); }
.timeline-item.type-bridge::before { border-color: var(--type-bridge); }

.timeline-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-family: 'Share Tech Mono', monospace;
}

/* ---- Toggles ---- */
.channel-toggles {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.toggle-btn {
    padding: 8px 18px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-input);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
}

.toggle-btn.active {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.1);
    box-shadow: var(--glow-sm) rgba(0, 240, 255, 0.2);
}

.toggle-btn:hover {
    border-color: var(--neon-cyan);
}

/* ---- Checkbox groups ---- */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.checkbox-item:hover {
    border-color: var(--neon-cyan);
}

.checkbox-item input[type="checkbox"] {
    accent-color: var(--neon-cyan);
}

/* ---- Alerts/Flash ---- */
.alert {
    padding: 14px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-success {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
    color: var(--neon-green);
}

.alert-error {
    background: rgba(255, 0, 68, 0.1);
    border: 1px solid rgba(255, 0, 68, 0.3);
    color: var(--neon-red);
}

.alert-info {
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid rgba(0, 240, 255, 0.3);
    color: var(--neon-cyan);
}

/* ---- Login page ---- */
.login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    width: 100%;
    max-width: 420px;
    padding: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.login-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-pink), var(--neon-cyan));
    animation: borderGlow 3s linear infinite;
}

@keyframes borderGlow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.login-title {
    text-align: center;
    margin-bottom: 10px;
}

.login-title h1 {
    font-size: 2rem;
    color: var(--neon-cyan);
    text-shadow: var(--glow-lg) var(--neon-cyan);
}

.login-title .tagline {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: 'Share Tech Mono', monospace;
    margin-top: 8px;
}

.login-box .form-control {
    font-size: 1.1rem;
}

.login-box .btn-primary {
    width: 100%;
    padding: 14px;
    font-size: 1.05rem;
}

/* ---- Particles (simple CSS) ---- */
.particles {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--neon-cyan);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat 8s infinite;
}

@keyframes particleFloat {
    0% { opacity: 0; transform: translateY(100vh) scale(0); }
    10% { opacity: 0.6; }
    90% { opacity: 0.6; }
    100% { opacity: 0; transform: translateY(-10vh) scale(1); }
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
        z-index: 200;
    }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 15px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .mobile-toggle {
        display: block !important;
        position: fixed;
        top: 10px;
        left: 10px;
        z-index: 201;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: 6px;
        padding: 8px 12px;
        color: var(--neon-cyan);
        cursor: pointer;
        font-size: 1.2rem;
    }
}

.mobile-toggle { display: none; }

/* ---- Utility ---- */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-cyan { color: var(--neon-cyan); }
.text-green { color: var(--neon-green); }
.text-red { color: var(--neon-red); }
.text-yellow { color: var(--neon-yellow); }
.text-muted { color: var(--text-muted); }
.hidden { display: none !important; }
.w-full { width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* Pinned indicator */
.pin-icon { color: var(--neon-yellow); font-size: 0.9rem; margin-right: 4px; }

/* Tab nav */
.tab-nav {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.tab-link {
    padding: 10px 20px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-link:hover { color: var(--text-primary); }
.tab-link.active {
    color: var(--neon-cyan);
    border-bottom-color: var(--neon-cyan);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Multi-select */
.multi-select {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px;
}

/* ---- Theme Toggle ---- */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    margin: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    transition: all 0.3s;
}
.theme-toggle:hover {
    border-color: var(--neon-cyan);
    color: var(--text-primary);
}
.theme-toggle .toggle-icon {
    font-size: 1rem;
    transition: transform 0.3s;
}

/* ---- Light Mode Overrides ---- */
[data-theme="light"] .card {
    box-shadow: var(--shadow-card);
}
[data-theme="light"] .sidebar {
    box-shadow: 2px 0 8px rgba(0,0,0,0.06);
}
[data-theme="light"] .sidebar-brand {
    background: linear-gradient(180deg, rgba(0,100,180,0.04), transparent);
}
[data-theme="light"] .sidebar-brand h1 {
    text-shadow: none;
}
[data-theme="light"] .page-header h2 {
    text-shadow: none;
}
[data-theme="light"] .nav-link:hover {
    background: rgba(0, 100, 180, 0.06);
}
[data-theme="light"] .nav-link.active {
    background: rgba(0, 100, 180, 0.08);
}
[data-theme="light"] .btn:hover {
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
[data-theme="light"] .btn-primary {
    background: #0077aa;
    border-color: #0077aa;
    color: #ffffff;
}
[data-theme="light"] .btn-primary:hover {
    background: #006699;
}
[data-theme="light"] .btn-danger {
    background: #cc0033;
    border-color: #cc0033;
    color: #ffffff;
}
[data-theme="light"] .btn-warning {
    background: #aa7700;
    border-color: #aa7700;
    color: #ffffff;
}
[data-theme="light"] .btn-success {
    background: #00884d;
    border-color: #00884d;
    color: #ffffff;
}
[data-theme="light"] .form-control {
    border-color: #c0c4cc;
}
[data-theme="light"] .form-control::placeholder {
    color: #999;
}
[data-theme="light"] .particle {
    display: none;
}
[data-theme="light"] .badge-initial { background: rgba(204,0,51,0.1); border-color: rgba(204,0,51,0.25); }
[data-theme="light"] .badge-update { background: rgba(170,136,0,0.1); border-color: rgba(170,136,0,0.25); }
[data-theme="light"] .badge-resolved { background: rgba(0,136,77,0.1); border-color: rgba(0,136,77,0.25); }
[data-theme="light"] .badge-bridge { background: rgba(119,0,187,0.1); border-color: rgba(119,0,187,0.25); }
[data-theme="light"] .badge-one-time { background: rgba(0,119,170,0.1); border-color: rgba(0,119,170,0.25); }
[data-theme="light"] .badge-open { background: rgba(204,0,51,0.1); border-color: rgba(204,0,51,0.25); }
[data-theme="light"] .badge-closed { background: rgba(0,136,77,0.1); border-color: rgba(0,136,77,0.25); }
[data-theme="light"] .badge-sent { background: rgba(0,136,77,0.1); border-color: rgba(0,136,77,0.25); }
[data-theme="light"] .badge-failed { background: rgba(204,0,51,0.1); border-color: rgba(204,0,51,0.25); }
[data-theme="light"] .badge-viewer { background: rgba(100,100,130,0.1); }
[data-theme="light"] .badge-operator { background: rgba(0,119,170,0.1); }
[data-theme="light"] .badge-admin { background: rgba(170,136,0,0.1); }
[data-theme="light"] .badge-superadmin { background: rgba(204,0,136,0.1); }
[data-theme="light"] td {
    border-bottom-color: rgba(0,0,0,0.06);
}
[data-theme="light"] .alert-success {
    background: rgba(0,136,77,0.1);
    border-color: rgba(0,136,77,0.3);
    color: #00663a;
}
[data-theme="light"] .alert-error {
    background: rgba(204,0,51,0.08);
    border-color: rgba(204,0,51,0.25);
    color: #aa0028;
}

/* Topbar with UTC clock and shortcuts */
.topbar { display:flex; justify-content:flex-end; align-items:center; padding:6px 0 12px 0; gap:12px; flex-wrap:wrap; }
.topbar-right { display:flex; align-items:center; gap:8px; margin-left:auto; }
.topbar-left { position:relative; flex:1; min-width:200px; }
.search-results-dropdown { position:absolute; top:100%; left:0; right:0; z-index:100; background:var(--bg-card); border:1px solid var(--border-color); border-radius:0 0 6px 6px; max-height:300px; overflow-y:auto; box-shadow:0 8px 30px rgba(0,0,0,0.4); }
.search-item { display:block; padding:8px 12px; font-size:0.85rem; color:var(--text-primary); text-decoration:none; border-bottom:1px solid var(--border-color); }
.search-item:hover { background:rgba(0,240,255,0.05); }
[data-theme="light"] .search-results-dropdown { box-shadow:0 4px 16px rgba(0,0,0,0.12); }

/* Keyboard row selection */
tr.kb-selected { outline:2px solid var(--neon-cyan); outline-offset:-2px; background:rgba(0,240,255,0.05) !important; }
[data-theme="light"] tr.kb-selected { outline-color:#006699; background:rgba(0,100,180,0.06) !important; }

/* War room chat */
.chat-container { max-height:400px; overflow-y:auto; padding:8px 0; }
.chat-msg { padding:8px 12px; margin:4px 0; border-radius:8px; font-size:0.9rem; }
.chat-msg-user { background:rgba(0,240,255,0.06); border-left:3px solid var(--neon-cyan); }
.chat-msg-system { background:rgba(255,238,0,0.05); border-left:3px solid var(--neon-yellow); font-style:italic; }
.chat-msg .chat-author { font-weight:700; font-size:0.8rem; color:var(--neon-cyan); }
.chat-msg .chat-time { font-size:0.7rem; color:var(--text-muted); margin-left:8px; font-family:'Share Tech Mono',monospace; }
[data-theme="light"] .chat-msg-user { background:rgba(0,100,180,0.04); border-left-color:#006699; }
[data-theme="light"] .chat-msg .chat-author { color:#006699; }

/* IC badge */
.ic-badge { display:inline-flex; align-items:center; gap:4px; padding:3px 10px; border-radius:4px; background:rgba(255,136,0,0.12); border:1px solid rgba(255,136,0,0.3); color:var(--neon-orange); font-weight:700; font-size:0.8rem; }
[data-theme="light"] .ic-badge { background:rgba(200,100,0,0.08); color:#c06000; border-color:rgba(200,100,0,0.25); }

/* Anomaly alert banners */
.anomaly-banner { padding:10px 16px; border-radius:6px; margin-bottom:8px; display:flex; align-items:center; gap:10px; font-size:0.9rem; }
.anomaly-warning { background:rgba(255,200,0,0.08); border:1px solid rgba(255,200,0,0.25); color:var(--neon-yellow); }
.anomaly-critical { background:rgba(255,50,50,0.08); border:1px solid rgba(255,50,50,0.25); color:var(--neon-red); }
.anomaly-info { background:rgba(0,240,255,0.06); border:1px solid rgba(0,240,255,0.2); color:var(--neon-cyan); }
[data-theme="light"] .anomaly-warning { background:rgba(200,150,0,0.06); color:#8a6e00; border-color:rgba(200,150,0,0.2); }
[data-theme="light"] .anomaly-critical { background:rgba(200,0,0,0.05); color:#c00; border-color:rgba(200,0,0,0.15); }
[data-theme="light"] .anomaly-info { background:rgba(0,100,180,0.04); color:#006699; border-color:rgba(0,100,180,0.15); }

/* Preset cards */
.preset-card { padding:14px; border:1px solid var(--border-color); border-radius:6px; background:var(--bg-card); transition:border-color 0.2s; cursor:pointer; }
.preset-card:hover { border-color:var(--neon-cyan); }
.preset-card h4 { margin:0 0 6px 0; font-size:0.95rem; }
.preset-card .preset-meta { font-size:0.8rem; color:var(--text-muted); }

/* Dashboard widget toggles */
.widget-toggle { display:inline-flex; align-items:center; gap:4px; padding:4px 10px; border-radius:4px; font-size:0.75rem; cursor:pointer; border:1px solid var(--border-color); background:var(--bg-card); color:var(--text-secondary); transition:all 0.2s; }
.widget-toggle.active { border-color:var(--neon-cyan); color:var(--neon-cyan); background:rgba(0,240,255,0.06); }

/* Grid helpers */
.grid-3 { display:grid; grid-template-columns:repeat(3, 1fr); gap:16px; }
@media (max-width:900px) { .grid-3 { grid-template-columns:1fr; } }
