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

/* --- Campus Command Center Neumorphic Design System --- */

:root {
    --bg-color: #ecf0f3;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --blue-accent: #3a86ff;
    --blue-hover: #1b62db;
    --shadow-light: #ffffff;
    --shadow-dark: #b8bec5;
    --red-alert: #ff4757;
    --green-status: #2ed573;
    --font-stack: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-stack);
    font-weight: 300; /* Roboto Light by default */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 24px;
    transition: background-color 0.3s ease;
}

main {
    display: block;
    width: 100%;
    box-sizing: border-box;
}

/* --- App Header & Tab Navigation --- */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-radius: 20px;
    background: var(--bg-color);
    box-shadow: 8px 8px 16px var(--shadow-dark), -8px -8px 16px var(--shadow-light);
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
    position: sticky;
    top: 15px;
    z-index: 1000;
}

.header-logo h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.badge-blue {
    color: var(--blue-accent);
    text-shadow: 1px 1px 2px var(--shadow-dark);
}

.tab-navigation {
    display: flex;
    gap: 15px;
    background: var(--bg-color);
    padding: 6px;
    border-radius: 14px;
    box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
}

.tab-btn {
    border: none;
    outline: none;
    background: none;
    padding: 10px 20px;
    font-family: var(--font-stack);
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn.active {
    color: var(--blue-accent);
    background: var(--bg-color);
    box-shadow: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light);
}

.system-status {
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 30px;
    background: var(--bg-color);
    box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--green-status);
    box-shadow: 0 0 10px var(--green-status);
    display: inline-block;
}

.status-dot.offline {
    background-color: var(--red-alert);
    box-shadow: 0 0 10px var(--red-alert);
}

/* --- Tab Control Utility --- */
.tab-content {
    display: none;
    width: 100%;
    box-sizing: border-box;
}

.tab-content.active {
    display: block;
    width: 100%;
    box-sizing: border-box;
    animation: fadeIn 0.3s ease;
}

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

/* --- Layout Grid --- */
.dashboard-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.content-layout {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
}

@media (max-width: 1024px) {
    .content-layout {
        grid-template-columns: 1fr;
    }
}

/* --- Neumorphic Cards & Buttons --- */
.neumorphic-card {
    background: var(--bg-color);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 9px 9px 18px var(--shadow-dark), -9px -9px 18px var(--shadow-light);
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 0;
}

.live-video-panel {
    min-width: 0;
    width: 100%;
}

#streams-grid {
    min-width: 0;
    width: 100%;
}

.metric-card {
    text-align: center;
    padding: 18px 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 12px 12px 24px var(--shadow-dark), -12px -12px 24px var(--shadow-light);
}

.metric-card h3 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 600;
}

.metric-val {
    font-size: 36px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.metric-trend {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.text-blue {
    color: var(--blue-accent);
}

.text-alert {
    color: var(--red-alert);
}

/* --- Buttons --- */
.neumorphic-btn {
    border: none;
    outline: none;
    padding: 12px 24px;
    border-radius: 14px;
    font-family: var(--font-stack);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    background: var(--bg-color);
    color: var(--text-primary);
    box-shadow: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
    transition: all 0.2s ease;
}

.neumorphic-btn:active {
    box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
}

.btn-blue {
    background: var(--blue-accent);
    color: white;
    box-shadow: 4px 4px 10px rgba(58, 134, 255, 0.4), -4px -4px 8px var(--shadow-light);
}

.btn-blue:hover {
    background: var(--blue-hover);
}

.btn-blue:active {
    box-shadow: inset 3px 3px 6px rgba(0, 0, 0, 0.2);
}

/* --- Event logs table CSS --- */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 16px;
    box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light);
    background: var(--bg-color);
    padding: 12px;
}

.events-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.events-table th, .events-table td {
    padding: 16px;
    font-size: 14px;
}

.events-table th {
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.events-table td {
    color: var(--text-primary);
    border-bottom: 1px solid rgba(0, 0, 0, 0.02);
}

/* --- Badge elements --- */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.badge.staff { background: #ffeaa7; color: #d63031; }
.badge.parent { background: #dff9fb; color: #0984e3; }
.badge.student { background: #e3fafc; color: #0b7285; }
.badge.visitor { background: #f1f2f6; color: #2f3542; }
.badge.unknown { background: #ffeae6; color: #ff4757; }

/* --- Live Alert Feed (Snapshots) --- */
.snapshot-feed {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: 480px;
    overflow-y: auto;
    padding-right: 8px;
}

.snapshot-feed::-webkit-scrollbar, .table-wrapper::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.snapshot-feed::-webkit-scrollbar-thumb, .table-wrapper::-webkit-scrollbar-thumb {
    background: var(--shadow-dark);
    border-radius: 4px;
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 60px 0;
}

.snapshot-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border-radius: 16px;
    background: var(--bg-color);
    box-shadow: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
}

.snapshot-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: inset 2px 2px 5px var(--shadow-dark);
    border: 3px solid var(--bg-color);
}

.snapshot-details h4 {
    font-size: 15px;
    margin-bottom: 4px;
}

.snapshot-details p {
    font-size: 12px;
    color: var(--text-secondary);
}

/* --- Registration Section Styles --- */
.registration-container {
    display: block;
    width: 100%;
}

@media (max-width: 900px) {
    .registration-container {
        width: 100%;
    }
}

.form-section {
    display: flex;
    flex-direction: column;
}

.neumorphic-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.neumorphic-input, .neumorphic-select {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    outline: none;
    font-family: var(--font-stack);
    background: var(--bg-color);
    color: var(--text-primary);
    box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
    transition: box-shadow 0.2s ease;
}

.neumorphic-input:focus, .neumorphic-select:focus {
    box-shadow: inset 4px 4px 10px var(--shadow-dark), inset -4px -4px 10px var(--shadow-light);
}

/* Photo acquisition workspace layout */
.photo-capture-group {
    background: var(--bg-color);
    border-radius: 16px;
    padding: 16px;
    box-shadow: inset 2px 2px 6px var(--shadow-dark), inset -2px -2px 6px var(--shadow-light);
}

.capture-workspace {
    width: 100%;
    height: 260px;
    border-radius: 12px;
    background: #000;
    overflow: hidden;
    margin-bottom: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: inset 2px 2px 6px var(--shadow-dark);
    position: relative;
}

.video-preview, .photo-preview-box {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.capture-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.upload-fallback {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
}

.upload-fallback input[type="file"] {
    font-family: var(--font-stack);
    font-size: 12px;
}

.form-submit-btn {
    padding: 16px;
    margin-top: 10px;
}

/* --- App Footer --- */
.app-footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* --- Unified Registration Switcher & Overlays --- */
.registration-toggle-container .neumorphic-btn {
    border: 1px solid transparent;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.registration-toggle-container .neumorphic-btn.active-tab-btn {
    background: var(--blue-accent);
    color: white;
    box-shadow: inset 3px 3px 6px rgba(0, 0, 0, 0.2), 4px 4px 10px rgba(58, 134, 255, 0.3);
}

.btn-green {
    background: #2ed573;
    color: white;
    box-shadow: 4px 4px 10px rgba(46, 213, 115, 0.3), -4px -4px 8px var(--shadow-light);
}
.btn-green:hover { background: #26af5f; }
.btn-green:disabled { background: #a4b0be; box-shadow: none; cursor: not-allowed; }

.btn-red {
    background: #ff4757;
    color: white;
    box-shadow: 4px 4px 10px rgba(255, 71, 87, 0.3), -4px -4px 8px var(--shadow-light);
}
.btn-red:hover { background: #e03d4b; }
.btn-red:disabled { background: #a4b0be; box-shadow: none; cursor: not-allowed; }

/* Camera overlays */
.camera-guide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.face-oval-guide {
    width: 160px;
    height: 220px;
    border: 3px dashed rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5); /* Dim outer area */
    transition: border-color 0.3s ease;
}

.vehicle-box-guide {
    width: 260px;
    height: 160px;
    border: 3px dashed rgba(255, 255, 255, 0.85);
    border-radius: 12px;
    margin-bottom: 10px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5); /* Dim outer area */
}

.plate-box-guide {
    width: 160px;
    height: 50px;
    border: 2px dashed rgba(46, 213, 115, 0.9);
    border-radius: 6px;
    background: rgba(46, 213, 115, 0.1);
}

.guide-text {
    position: absolute;
    bottom: 15px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

/* Multi-Sample Slots Grid - Horizontal Scrolling */
.samples-grid {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 12px;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding: 10px 5px 14px 5px;
    margin-top: 10px;
    width: 100%;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--shadow-dark) transparent;
}

.samples-grid::-webkit-scrollbar {
    height: 5px;
}
.samples-grid::-webkit-scrollbar-track {
    background: transparent;
}
.samples-grid::-webkit-scrollbar-thumb {
    background: var(--shadow-dark);
    border-radius: 10px;
}

.sample-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-radius: 16px;
    background: var(--bg-color);
    box-shadow: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid transparent;
    flex: 0 0 90px;
    min-width: 90px;
    scroll-snap-align: start;
}

.sample-slot.active-slot {
    border-color: var(--blue-accent);
    box-shadow: inset 2px 2px 5px var(--shadow-dark), inset -2px -2px 5px var(--shadow-light);
}

.sample-slot.acquired-slot {
    border-color: #2ed573;
}

.slot-thumbnail {
    width: 100%;
    height: 80px;
    border-radius: 10px;
    background: #dfe4ea;
    box-shadow: inset 1px 1px 3px var(--shadow-dark);
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sample-slot.acquired-slot .slot-thumbnail::after {
    content: "✓";
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    background: #2ed573;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.slot-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Responsive Split Layout */
.registration-split-layout {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 40px;
    margin-top: 15px;
}

.registration-inputs-pane,
.registration-capture-pane {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

@media (max-width: 900px) {
    .registration-split-layout {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
        width: 100% !important;
    }
    .registration-inputs-pane,
    .registration-capture-pane {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }
    .registration-toggle-container {
        flex-direction: row !important;
        gap: 10px !important;
    }
    .form-group-row {
        flex-direction: column !important;
        gap: 10px !important;
    }
    .camera-controls-bar {
        flex-direction: column !important;
        gap: 10px !important;
    }
    .registration-container,
    .neumorphic-form,
    .form-group,
    .neumorphic-input,
    .neumorphic-select,
    .neumorphic-card,
    .form-section,
    .list-section,
    .dashboard-container,
    .content-layout,
    .metrics-grid {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    .capture-workspace {
        height: 220px !important;
    }
    .photo-capture-group {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }
}

/* Maximized CCTV Panel Mode */
.maximized-panel {
    position: fixed !important;
    top: 24px !important;
    left: 24px !important;
    right: 24px !important;
    bottom: 24px !important;
    width: calc(100% - 48px) !important;
    height: calc(100vh - 48px) !important;
    z-index: 99999 !important;
    background: var(--bg-color) !important;
    display: flex !important;
    flex-direction: column !important;
    margin-bottom: 0 !important;
    box-shadow: 18px 18px 36px var(--shadow-dark), -18px -18px 36px var(--shadow-light) !important;
    border-radius: 24px !important;
    padding: 30px !important;
}

.maximized-panel .stream-container {
    height: calc(100% - 60px) !important;
    width: 100% !important;
    flex: 1 !important;
}

/* --- Mobile Responsive Enhancements (max-width: 768px) --- */
@media (max-width: 768px) {
    body {
        padding: 12px !important;
    }
    
    .capture-workspace {
        height: 210px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .app-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 12px 18px;
        margin-bottom: 20px;
        gap: 10px;
        flex-wrap: nowrap !important;
    }
    
    /* Logo adjustments */
    .logo-desktop {
        display: none !important;
    }
    .logo-mobile {
        display: block !important;
    }
    
    /* System status capsule */
    .system-status {
        padding: 4px 6px 4px 12px !important;
        gap: 8px !important;
        border-radius: 20px !important;
        display: flex !important;
        align-items: center !important;
        font-size: 12px !important;
        order: 3 !important;
        overflow: visible !important;
        position: relative !important;
    }

    .profile-dropdown-container {
        position: relative !important;
        display: inline-block !important;
    }
    
    #profile-dropdown-menu {
        position: absolute !important;
        top: calc(100% + 8px) !important;
        right: 0 !important;
        left: auto !important;
        min-width: 150px !important;
        width: max-content !important;
        z-index: 99999 !important;
        box-shadow: 0 8px 24px rgba(0,0,0,0.18), 0 2px 6px rgba(0,0,0,0.12) !important;
    }
    
    .system-status .status-text {
        display: none !important;
    }
    
    .system-status .status-indicator {
        gap: 0 !important;
    }
    
    .system-status .neumorphic-btn {
        padding: 4px 8px !important;
        border-radius: 12px !important;
        font-size: 14px !important;
        box-shadow: 2px 2px 5px var(--shadow-dark), -2px -2px 5px var(--shadow-light) !important;
    }
    
    /* Top horizontal navigation bar style for tabs */
    .tab-navigation {
        display: flex !important;
        flex-direction: row !important;
        justify-content: flex-start !important;
        align-items: center !important;
        gap: 5px !important;
        padding: 4px !important;
        border-radius: 12px !important;
        order: 2 !important;
        width: auto !important;
        flex: 1 !important;
        max-width: 320px !important;
        box-sizing: border-box !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
    }
    .tab-navigation::-webkit-scrollbar {
        display: none !important;
    }
    
    .tab-btn {
        padding: 6px 8px !important;
        font-size: 11px !important;
        border-radius: 8px !important;
        text-align: center !important;
        white-space: nowrap !important;
    }
    
    /* Smaller metrics card layout */
    .metrics-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 10px !important;
    }
    
    .metric-card {
        padding: 12px 8px !important;
        border-radius: 16px !important;
    }
    
    .metric-card h3 {
        font-size: 11px !important;
        margin-bottom: 4px !important;
    }
    
    .metric-val {
        font-size: 22px !important;
        margin-bottom: 4px !important;
    }
    
    .metric-trend {
        font-size: 9px !important;
    }
    
    /* 2x2 grid for streams on mobile */
    #streams-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    
    #streams-grid > div {
        padding: 8px !important;
        border-radius: 12px !important;
    }
    
    #streams-grid h3 {
        font-size: 11px !important;
    }
    
    #streams-grid button {
        padding: 2px 4px !important;
        font-size: 9px !important;
        border-radius: 4px !important;
    }
    
    #streams-grid svg {
        width: 10px !important;
        height: 10px !important;
    }
    
    #streams-grid div[style*="height: 180px"] {
        height: 80px !important;
    }
    
    #streams-grid div[style*="font-size: 12px"] {
        font-size: 9px !important;
        margin-top: 6px !important;
    }
    
    .camera-controls-bar {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }
    
    .camera-controls-bar button {
        width: 100%;
    }
    
    .neumorphic-card, .form-section, .list-section {
        padding: 20px 15px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Reports form actions layout wrap */
    #reports-filter-form > div[style*="display: flex"] {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 15px !important;
    }
    
    #reports-filter-form > div[style*="display: flex"] > div {
        flex-direction: column !important;
        width: 100%;
    }
    
    #reports-filter-form > div[style*="display: flex"] button {
        width: 100%;
    }
    
    /* Center and stack pagination controls on mobile to prevent overlapping */
    .pagination-container {
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 12px !important;
        text-align: center !important;
        margin-top: 20px !important;
    }
    
    .pagination-container > div {
        justify-content: center !important;
        width: 100% !important;
        flex-wrap: wrap !important;
    }
}

/* --- Apple iOS Settings panel styling (Light Mode) --- */
.ios-settings-group {
    background: var(--bg-color);
    border-radius: 16px;
    margin-bottom: 25px;
    overflow: hidden;
    color: var(--text-primary);
    box-shadow: 6px 6px 12px var(--shadow-dark), -6px -6px 12px var(--shadow-light);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.ios-settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    cursor: pointer;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    transition: background-color 0.15s ease;
}

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

.ios-settings-item:hover, .ios-settings-item:active {
    background-color: rgba(0, 0, 0, 0.02);
}

.ios-settings-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ios-icon-box {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
    box-shadow: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light);
    font-size: 15px;
    flex-shrink: 0;
}

.ios-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ios-settings-right {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.ios-chevron {
    color: #b0b0b5;
    font-weight: 400;
    font-size: 15px;
}

/* Slide Panels and Animations */
.ios-panel-view {
    display: none;
    animation: iosSlideIn 0.25s cubic-bezier(0.1, 0.76, 0.55, 0.94);
}

.ios-panel-view.active {
    display: block;
}

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

.ios-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--blue-accent);
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 20px;
    background: none;
    border: none;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    transition: opacity 0.15s;
}

.ios-back-btn:hover {
    opacity: 0.8;
}

/* Reports Bento Grid Style */
.reports-bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

.bento-card {
    padding: 24px;
    border-radius: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.bento-card:hover {
    transform: translateY(-3px);
}

.bento-card-double {
    grid-column: span 2;
}

.bento-card-full {
    grid-column: span 4;
}

.bento-card.total-logs {
    background: linear-gradient(135deg, var(--bg-color), rgba(52, 152, 219, 0.05));
    border: 1px solid rgba(52, 152, 219, 0.15);
}

.bento-card.unknown-detections {
    background: linear-gradient(135deg, var(--bg-color), rgba(231, 76, 60, 0.05));
    border: 1px solid rgba(231, 76, 60, 0.15);
}

@media (max-width: 900px) {
    .reports-bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .bento-card-double {
        grid-column: span 2;
    }
    .bento-card-full {
        grid-column: span 2;
    }
}

@media (max-width: 600px) {
    .reports-bento-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
    .bento-card-double {
        grid-column: span 2 !important;
    }
    .bento-card-full {
        grid-column: span 2 !important;
    }
    .bento-card {
        padding: 16px !important;
    }
}

.dropdown-item:hover {
    background: rgba(0, 0, 0, 0.05);
    box-shadow: inset 1px 1px 3px var(--shadow-dark), inset -1px -1px 3px var(--shadow-light);
}

/* --- Granular iOS-style Toggle Switch (Blue Accent) --- */
.switch-toggle {
    position: relative;
    display: inline-block;
    width: 62px;
    height: 30px;
}

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

.slider-toggle {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1; /* Gray for OFF */
    transition: .3s ease;
    border-radius: 30px;
    box-shadow: inset 1px 1px 3px rgba(0,0,0,0.1);
}

.slider-toggle:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s ease;
    border-radius: 50%;
    box-shadow: 1px 1px 3px rgba(0,0,0,0.2);
    z-index: 2;
}

/* When checked (ON state), background is blue */
.switch-toggle input:checked + .slider-toggle {
    background-color: #228be6; /* Blue for ON */
}

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

/* Text status indicators (ON/OFF) */
.slider-toggle::after {
    position: absolute;
    font-size: 10px;
    font-weight: 700;
    top: 50%;
    transform: translateY(-50%);
    transition: all .3s ease;
    z-index: 1;
}

/* OFF Text when unchecked */
.switch-toggle input + .slider-toggle::after {
    content: "OFF";
    right: 8px;
    color: #64748b;
}

/* Hide OFF text when checked and show ON */
.switch-toggle input:checked + .slider-toggle::after {
    content: "ON";
    left: 10px;
    color: white;
}

/* Pulsing blue scanner circle */
.pulsing-scan-circle {
    position: relative;
    animation: bluePulse 2s infinite ease-in-out;
}
@keyframes bluePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 71, 187, 0.8), 0 0 15px rgba(0, 71, 187, 0.5);
    }
    70% {
        box-shadow: 0 0 0 35px rgba(0, 71, 187, 0), 0 0 25px rgba(0, 71, 187, 0.2);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 71, 187, 0), 0 0 0 rgba(0, 71, 187, 0);
    }
}

/* Slide up animation for cards */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Leaflet maps container styles */
#snapshot-map-container {
    border: 2px solid var(--border-color);
}

.map-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    color: var(--blue-accent);
    text-decoration: none;
    cursor: pointer;
    margin-top: 5px;
}
.map-link-btn:hover {
    text-decoration: underline;
}

/* Bottom Navigation Bar for Mobile */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: rgba(236, 240, 243, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 9999;
    padding: 0 10px;
}

.bottom-nav-btn {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    flex: 1;
    height: 100%;
    transition: all 0.2s ease;
}

.bottom-nav-btn .bottom-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    transition: transform 0.2s ease;
}

.bottom-nav-btn .bottom-nav-icon svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    transition: stroke 0.2s ease;
}

.bottom-nav-btn.active {
    color: var(--blue-accent);
}

.bottom-nav-btn.active .bottom-nav-icon {
    transform: scale(1.12);
}

.bottom-nav-btn.active .bottom-nav-icon svg {
    stroke: var(--blue-accent);
    filter: drop-shadow(0 0 4px rgba(58, 134, 255, 0.4));
}

/* Registration Mobile Sub-tabs */
.registration-view-selector {
    display: none;
}

.reg-subtab-btn.active {
    background: var(--bg-color) !important;
    color: var(--blue-accent) !important;
    box-shadow: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light) !important;
}

/* Responsive Overrides */
@media (max-width: 768px) {
    .tab-navigation {
        display: none !important;
    }
    
    .bottom-nav {
        display: flex !important;
    }
    
    body {
        padding-bottom: 85px !important;
    }
    
    .registration-view-selector {
        display: flex !important;
    }
}
