:root { --primary: #0f172a; --secondary: #1e293b; --accent: #f59e0b; --bg: #f1f5f9; --danger: #ef4444; --success: #22c55e; --text: #334155; }
        * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
        body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; margin: 0; background: var(--bg); display: flex; flex-direction: column; height: 100vh; overflow: hidden; color: var(--text); }
        
        /* --- 1. HEADER & NAVIGATION --- */
        .navbar { background: var(--primary); color: white; padding: 0 15px; height: 50px; display: flex; align-items: center; justify-content: space-between; border-bottom: 3px solid var(--accent); flex-shrink: 0; z-index: 2000; box-shadow: 0 2px 10px rgba(0,0,0,0.2); }
        .logo-area { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: 0.5px; font-size: 14px; }
        .logo-icon { font-size: 18px; }
        .nav-menu { display: flex; gap: 15px; }
        .nav-item { cursor: pointer; font-size: 12px; font-weight: 600; opacity: 0.8; transition: 0.2s; padding: 5px 8px; border-radius: 4px; }
        .nav-item:hover, .nav-item.active { opacity: 1; background: rgba(255,255,255,0.1); color: var(--accent); }

        /* --- 2. MAP INTERFACE --- */
        #map { flex-shrink: 0; height: 35vh; width: 100%; position: relative; z-index: 1; background: #0f172a; }
        .gps-btn { position: absolute; bottom: 15px; right: 15px; z-index: 900; background: white; border: none; width: 44px; height: 44px; border-radius: 50%; box-shadow: 0 4px 12px rgba(0,0,0,0.3); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 18px; transition: 0.2s; }
        .gps-btn:active { transform: scale(0.95); background: var(--accent); color: white; }

        /* --- 3. STATUS BAR (Error Handling) --- */
        .status-bar { background: var(--secondary); color: white; padding: 6px 15px; font-size: 10px; display: flex; justify-content: space-between; align-items: center; font-weight: 700; border-bottom: 1px solid #334155; flex-shrink: 0; }
        .indicator { display: flex; align-items: center; gap: 8px; }
        .pulse { width: 8px; height: 8px; border-radius: 50%; background: #64748b; transition: all 0.3s ease; }
        .pulse.online { background: var(--success); box-shadow: 0 0 8px var(--success); }
        .pulse.error { background: var(--danger); box-shadow: 0 0 10px var(--danger); animation: blink 1s infinite; }
        .pulse.warning { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
        @keyframes blink { 50% { opacity: 0.5; } }

        /* --- 4. ADVANCED FILTERS --- */
        .filter-shelf { background: white; padding: 10px 15px; display: flex; overflow-x: auto; gap: 10px; border-bottom: 1px solid #e2e8f0; -webkit-overflow-scrolling: touch; flex-shrink: 0; }
        .filter-shelf::-webkit-scrollbar { display: none; }
        
        .f-item { flex: 0 0 140px; } /* Standard Size */
        .f-item.small { flex: 0 0 80px; } /* For Year/Reset */
        
        input, select { width: 100%; padding: 8px 12px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 12px; background: white; outline: none; color: var(--secondary); font-weight: 500; }
        select { cursor: pointer; }
        select:hover { border-color: var(--accent); }

        /* --- 5. DATA FEED --- */
        .content { flex: 1; overflow-y: auto; padding: 12px 15px; background: #f8fafc; }
        .card { background: white; border-radius: 8px; padding: 15px; margin-bottom: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); border-left: 4px solid #cbd5e1; cursor: pointer; position: relative; transition: transform 0.1s; }
        .card:active { transform: scale(0.99); background: #f1f5f9; }
        .card.high-risk { border-left-color: var(--danger); }
        .card-head { display: flex; justify-content: space-between; font-size: 10px; font-weight: 900; color: #94a3b8; margin-bottom: 5px; }
        .card-title { font-size: 15px; font-weight: 700; color: var(--secondary); line-height: 1.3; margin-bottom: 3px; }
        .card-meta { font-size: 12px; color: #64748b; }
        .risk-badge { position: absolute; right: 15px; bottom: 15px; font-size: 10px; font-weight: 800; color: var(--danger); background: #fef2f2; padding: 2px 6px; border-radius: 4px; border: 1px solid #fee2e2; }

        /* --- 6. MODALS --- */
        .modal { display: none; position: fixed; z-index: 3000; left:0; top:0; width:100%; height:100%; background: white; overflow-y: auto; animation: slideUp 0.2s ease-out; }
        @keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
        
        .m-header { position: sticky; top:0; background: white; padding: 15px; border-bottom: 2px solid var(--accent); display: flex; justify-content: space-between; align-items: center; z-index: 10; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
        .m-body { padding: 20px; max-width: 800px; margin: auto; }
        
        /* Report Typography */
        .sec-title { font-size: 11px; font-weight: 900; color: var(--accent); text-transform: uppercase; margin: 25px 0 10px; border-bottom: 1px solid #e2e8f0; padding-bottom: 5px; letter-spacing: 0.5px; }
        .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
        .field-grp { margin-bottom: 5px; }
        .f-lbl { font-size: 10px; font-weight: 800; color: #94a3b8; text-transform: uppercase; }
        .f-val { font-size: 14px; font-weight: 600; color: #1e293b; word-break: break-word; }

        /* Chart Styles */
        .chart-box { margin-bottom: 30px; border: 1px solid #e2e8f0; padding: 15px; border-radius: 8px; background: #fff; }
        .chart-head { font-size: 13px; font-weight: 800; color: var(--secondary); margin-bottom: 15px; text-align: center; }

        /* Buttons */
        .btn { padding: 8px 16px; border-radius: 6px; border: none; font-weight: 700; cursor: pointer; font-size: 13px; transition: 0.2s; }
        .btn-main { background: var(--accent); color: white; width: 100%; }
        .btn-sec { background: #f1f5f9; color: #475569; width: 100%; }
        .btn-sec:hover { background: #e2e8f0; }

        /* Print Override */
        @media print {
            body * { visibility: hidden; }
            #dataModal, #dataModal * { visibility: visible; }
            #dataModal { position: absolute; left: 0; top: 0; width: 100%; height: auto; display: block !important; }
            .no-print { display: none !important; }
        }