/* ============================================
   IGACOS Smart Emergency Dispatch System
   Professional Command Center Design
   ============================================ */

/* Google Fonts - Inter for professional look */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* CSS Variables - Professional Light Theme */
:root {
    /* Primary Colors - Professional Blue */
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-darker: #1e40af;
    --primary-light: #3b82f6;
    --primary-lighter: #60a5fa;

    /* Secondary Colors */
    --secondary-color: #64748b;
    --secondary-dark: #475569;
    --secondary-light: #94a3b8;

    /* Status Colors */
    --success-color: #10b981;
    --success-dark: #059669;
    --warning-color: #f59e0b;
    --warning-dark: #d97706;
    --danger-color: #ef4444;
    --danger-dark: #dc2626;
    --critical-color: #dc2626;
    --info-color: #06b6d4;

    /* Background Colors - Light Theme */
    --bg-body: #f1f5f9;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-sidebar: #0f172a;
    --bg-topbar: rgba(255, 255, 255, 0.95);
    --bg-white: #ffffff;

    /* Text Colors */
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-dark: #0f172a;
    --text-white: #ffffff;

    /* Border Colors */
    --border-color: #e2e8f0;
    --border-light: #cbd5e1;
    --border-focus: var(--primary-color);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.2);
    --shadow-glow-danger: 0 0 20px rgba(239, 68, 68, 0.3);

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 20px;
    --radius-full: 9999px;

    /* Layout */
    --sidebar-width: 280px;
    --topbar-height: 72px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
    --transition-slow: 0.3s ease;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Selection styling */
::selection {
    background: var(--primary-color);
    color: white;
}

a {
    text-decoration: none;
    color: inherit;
}

ul, ol {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    font-family: inherit;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

img {
    max-width: 100%;
    display: block;
}

/* ============================================
   Layout Structure
   ============================================ */

.app-container {
    display: flex;
    min-height: 100vh;
    background: var(--bg-body);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: var(--text-white);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-slow);
    border-right: none;
    box-shadow: var(--shadow-lg);
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.sidebar-logo .logo-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4);
    overflow: hidden;
}

.sidebar-logo .logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-logo h1 {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 0%, var(--primary-lighter) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-logo span {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    display: block;
    margin-top: 3px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

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

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

.nav-section-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.5);
    padding: 0 24px;
    margin-bottom: 12px;
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 24px;
    margin: 4px 14px;
    color: rgba(255, 255, 255, 0.7);
    transition: all var(--transition-normal);
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 500;
    position: relative;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    box-shadow: inset 3px 0 0 var(--primary-light);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 70%;
    background: var(--primary-color);
    border-radius: 0 4px 4px 0;
}

.nav-item .nav-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    opacity: 0.8;
}

.nav-item:hover .nav-icon {
    opacity: 1;
}

.nav-item .nav-badge {
    margin-left: auto;
    background: var(--danger-color);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-body);
}

/* Top Navigation */
.topbar {
    height: var(--topbar-height);
    background: var(--bg-topbar);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.menu-toggle {
    display: none;
    background: var(--bg-secondary);
    padding: 10px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 20px;
    transition: all var(--transition-fast);
}

.menu-toggle:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

/* Live Status Indicator */
.live-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    color: var(--success-color);
}

.live-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--success-color);
    border-radius: 50%;
    animation: pulse-live 1.5s infinite;
}

@keyframes pulse-live {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-search {
    position: relative;
}

.topbar-search input {
    padding: 10px 18px 10px 44px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    width: 320px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all var(--transition-normal);
    font-size: 14px;
}

.topbar-search input::placeholder {
    color: var(--text-muted);
}

.topbar-search input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-white);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.topbar-search .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
}

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

.topbar-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all var(--transition-normal);
    font-size: 18px;
}

.topbar-btn:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.topbar-btn .badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 20px;
    height: 20px;
    background: var(--danger-color);
    color: white;
    font-size: 10px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse-badge 2s infinite;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: background var(--transition-normal);
    background: var(--bg-white);
    border: 1px solid var(--border-color);
}

.user-menu:hover {
    background: var(--bg-secondary);
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}

.user-info {
    text-align: left;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Content Area */
.content-area {
    flex: 1;
    padding: 28px;
}

/* ============================================
   Stats Cards - Command Center Style
   ============================================ */

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

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: flex-start;
    gap: 18px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), transparent);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--border-light);
}

.stat-card.danger::before {
    background: linear-gradient(90deg, var(--danger-color), transparent);
}

.stat-card.warning::before {
    background: linear-gradient(90deg, var(--warning-color), transparent);
}

.stat-card.success::before {
    background: linear-gradient(90deg, var(--success-color), transparent);
}

.stat-card.info::before {
    background: linear-gradient(90deg, var(--info-color), transparent);
}

.stat-icon {
    width: 58px;
    height: 58px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
}

.stat-icon.primary {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.2) 0%, rgba(14, 165, 233, 0.1) 100%);
    color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
}

.stat-icon.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(16, 185, 129, 0.1) 100%);
    color: var(--success-color);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.stat-icon.warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(245, 158, 11, 0.1) 100%);
    color: var(--warning-color);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.stat-icon.danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(239, 68, 68, 0.1) 100%);
    color: var(--danger-color);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
    animation: glow-danger 2s ease-in-out infinite;
}

.stat-icon.info {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.2) 0%, rgba(6, 182, 212, 0.1) 100%);
    color: var(--info-color);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.2);
}

@keyframes glow-danger {
    0%, 100% { box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2); }
    50% { box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4); }
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    font-family: 'JetBrains Mono', monospace;
}

.stat-change {
    font-size: 12px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.stat-change.positive { color: var(--success-color); }
.stat-change.negative { color: var(--danger-color); }

/* ============================================
   Cards & Widgets - Dark Theme
   ============================================ */

.card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

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

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

/* Widget Styles */
.widget {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.widget:hover {
    border-color: var(--border-light);
}

.widget-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-secondary);
}

.widget-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.3px;
}

.widget-title::before {
    content: '';
    width: 4px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 2px;
    flex-shrink: 0;
}

.widget-body {
    padding: 20px;
}

.widget-body-map {
    padding: 0;
    position: relative;
    min-height: 400px;
}

/* ============================================
   Dashboard Grid
   ============================================ */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
}

.col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }

/* ============================================
   Incident List - Enhanced
   ============================================ */

.incident-list {
    display: flex;
    flex-direction: column;
}

.incident-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    margin: 0;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition-normal);
    border-radius: 0;
}

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

.incident-item:hover {
    background: rgba(14, 165, 233, 0.05);
    border-radius: var(--radius-lg);
}

.incident-type-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.incident-type-icon.fire {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(239, 68, 68, 0.1) 100%);
    color: var(--danger-color);
}

.incident-type-icon.medical {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(16, 185, 129, 0.1) 100%);
    color: var(--success-color);
}

.incident-type-icon.crime {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(139, 92, 246, 0.1) 100%);
    color: #8b5cf6;
}

.incident-type-icon.accident {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(245, 158, 11, 0.1) 100%);
    color: var(--warning-color);
}

.incident-type-icon.disaster {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.2) 0%, rgba(6, 182, 212, 0.1) 100%);
    color: var(--info-color);
}

.incident-details {
    flex: 1;
    min-width: 0;
}

.incident-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.incident-location {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.incident-meta {
    text-align: right;
    flex-shrink: 0;
}

.incident-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    font-family: 'JetBrains Mono', monospace;
}

/* Agency Status */
.agency-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.agency-icon.pnp {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.2) 0%, rgba(14, 165, 233, 0.1) 100%);
    color: var(--primary-color);
}

.agency-icon.bfp {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(239, 68, 68, 0.1) 100%);
    color: var(--danger-color);
}

.agency-icon.ems {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(16, 185, 129, 0.1) 100%);
    color: var(--success-color);
}

.agency-icon.traffic {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(245, 158, 11, 0.1) 100%);
    color: var(--warning-color);
}

.agency-icon.mdrrmo {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.2) 0%, rgba(6, 182, 212, 0.1) 100%);
    color: var(--info-color);
}

.agency-icon.barangay {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(139, 92, 246, 0.1) 100%);
    color: #8b5cf6;
}

/* ============================================
   Badges & Status Indicators
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-primary {
    background: rgba(14, 165, 233, 0.15);
    color: var(--primary-light);
    border: 1px solid rgba(14, 165, 233, 0.3);
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning-color);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-info {
    background: rgba(6, 182, 212, 0.15);
    color: var(--info-color);
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.badge-secondary {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-secondary);
    border: 1px solid rgba(148, 163, 184, 0.3);
}

/* Priority Badges */
.priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.priority-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.priority-critical {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.3);
    animation: pulse-critical 2s infinite;
}

.priority-critical::before {
    background: var(--danger-color);
    animation: blink 1s infinite;
}

@keyframes pulse-critical {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.3); }
    50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.priority-high {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning-color);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.priority-high::before { background: var(--warning-color); }

.priority-medium {
    background: rgba(14, 165, 233, 0.15);
    color: var(--primary-light);
    border: 1px solid rgba(14, 165, 233, 0.3);
}

.priority-medium::before { background: var(--primary-color); }

.priority-low {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.priority-low::before { background: var(--success-color); }

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-new {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-color);
}

.status-new::before {
    background: var(--danger-color);
    animation: blink 0.8s infinite;
}

.status-validated {
    background: rgba(14, 165, 233, 0.15);
    color: var(--primary-light);
}

.status-validated::before { background: var(--primary-color); }

.status-assigned {
    background: rgba(6, 182, 212, 0.15);
    color: var(--info-color);
}

.status-assigned::before { background: var(--info-color); }

.status-enroute {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning-color);
}

.status-enroute::before { background: var(--warning-color); }

.status-onsite {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
}

.status-onsite::before { background: #8b5cf6; }

.status-resolved {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
}

.status-resolved::before {
    background: var(--success-color);
    animation: none;
}

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

/* ============================================
   Buttons - Professional Style
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 600;
    transition: all var(--transition-normal);
    cursor: pointer;
    border: none;
}

.btn-sm {
    padding: 7px 14px;
    font-size: 12px;
    border-radius: var(--radius-md);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-darker) 100%);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.45);
    transform: translateY(-2px);
}

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

.btn-secondary:hover {
    background: var(--border-color);
    border-color: var(--border-light);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, var(--success-dark) 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-success:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
    transform: translateY(-2px);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, var(--warning-dark) 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.btn-warning:hover {
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, var(--danger-dark) 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

.btn-danger:hover {
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.45);
    transform: translateY(-2px);
}

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

.btn-outline:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-lg);
}

/* ============================================
   Tables - Dark Theme
   ============================================ */

.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
}

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

.data-table th,
.data-table td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-secondary);
    font-weight: 700;
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.data-table tbody tr {
    transition: all var(--transition-normal);
}

.data-table tbody tr:hover {
    background: rgba(14, 165, 233, 0.05);
}

.data-table td {
    font-size: 14px;
    color: var(--text-primary);
}

/* ============================================
   Forms - Dark Theme
   ============================================ */

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

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-label .required {
    color: var(--danger-color);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-white);
    color: var(--text-primary);
    transition: all var(--transition-normal);
    font-size: 14px;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-white);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-select {
    cursor: pointer;
}

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

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
}

/* Filter Select */
.filter-select {
    padding: 10px 36px 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-white);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    min-width: 160px;
    transition: all var(--transition-normal);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

/* Checkbox & Toggle */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

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

.toggle {
    position: relative;
    width: 48px;
    height: 26px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--border-color);
    border-radius: var(--radius-full);
    transition: var(--transition-normal);
}

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

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

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

/* ============================================
   Chips
   ============================================ */

.chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    font-size: 13px;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.chip-remove {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chip-remove:hover {
    background: var(--danger-color);
    color: white;
}

.chip.chip-primary {
    background: rgba(14, 165, 233, 0.15);
    color: var(--primary-light);
    border-color: rgba(14, 165, 233, 0.3);
}

.chip.chip-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
    border-color: rgba(16, 185, 129, 0.3);
}

.chip.chip-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning-color);
    border-color: rgba(245, 158, 11, 0.3);
}

.chip.chip-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-color);
    border-color: rgba(239, 68, 68, 0.3);
}

.chip.chip-info {
    background: rgba(6, 182, 212, 0.15);
    color: var(--info-color);
    border-color: rgba(6, 182, 212, 0.3);
}

/* ============================================
   Timeline
   ============================================ */

.timeline {
    position: relative;
    padding-left: 32px;
}

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

.timeline-item {
    position: relative;
    padding-bottom: 26px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -28px;
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--primary-color);
}

.timeline-item.completed .timeline-marker {
    background: var(--success-color);
    border-color: var(--success-color);
}

.timeline-item.active .timeline-marker {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.2);
}

.timeline-content {
    background: rgba(255, 255, 255, 0.03);
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.timeline-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-family: 'JetBrains Mono', monospace;
}

.timeline-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.timeline-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ============================================
   Map Styles
   ============================================ */

.widget-map-full {
    height: calc(100vh - 240px);
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

.widget-map-full .widget-header {
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.widget-body-map {
    flex: 1;
    padding: 0;
    position: relative;
    min-height: 400px;
}

#dashboard-map, #gis-map, #analytics-map, #ticket-map {
    width: 100%;
    height: 100%;
    min-height: 300px;
    z-index: 1;
}

/* Leaflet customization */
.leaflet-control-zoom {
    border: none !important;
    box-shadow: var(--shadow-lg) !important;
    border-radius: var(--radius-lg) !important;
    overflow: hidden;
}

.leaflet-control-zoom a {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.leaflet-control-zoom a:last-child {
    border-bottom: none !important;
}

.leaflet-control-zoom a:hover {
    background: var(--bg-card-hover) !important;
    color: var(--primary-color) !important;
}

.leaflet-popup-content-wrapper {
    border-radius: var(--radius-lg) !important;
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    box-shadow: var(--shadow-xl) !important;
}

.leaflet-popup-tip {
    background: var(--bg-card) !important;
}

.leaflet-container {
    background: var(--bg-body) !important;
}

/* ============================================
   GIS Page
   ============================================ */

.gis-container {
    display: grid;
    grid-template-columns: 280px 1fr 300px;
    grid-template-rows: 1fr auto;
    gap: 0;
    height: calc(100vh - var(--topbar-height));
    margin: -28px;
}

.gis-sidebar {
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    padding: 24px;
    overflow-y: auto;
}

.gis-sidebar-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 18px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.layer-group {
    margin-bottom: 28px;
}

.layer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.layer-name {
    font-size: 14px;
    color: var(--text-primary);
}

.gis-map {
    position: relative;
    overflow: hidden;
}

.gis-map-container {
    position: relative;
    min-height: 500px;
}

.gis-map-container #gis-map {
    width: 100%;
    height: 100%;
    min-height: 500px;
    position: absolute;
    top: 0;
    left: 0;
}

.gis-filters {
    background: var(--bg-card);
    border-left: 1px solid var(--border-color);
    padding: 24px;
    overflow-y: auto;
}

.filter-group {
    margin-bottom: 28px;
}

.filter-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
}

.filter-color {
    width: 14px;
    height: 14px;
    border-radius: 50%;
}

.filter-label {
    font-size: 14px;
    color: var(--text-primary);
}

.filter-count {
    margin-left: auto;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.08);
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

.gis-legend {
    grid-column: 1 / -1;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 18px 28px;
    display: flex;
    align-items: center;
    gap: 36px;
}

.legend-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.legend-items {
    display: flex;
    gap: 28px;
}

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

.legend-icon {
    width: 18px;
    height: 18px;
    border-radius: var(--radius-sm);
}

/* ============================================
   Incident Ticket Page
   ============================================ */

.ticket-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 28px;
}

.ticket-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.ticket-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.ticket-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
}

.ticket-id {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-family: 'JetBrains Mono', monospace;
}

.ticket-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.ticket-actions {
    display: flex;
    gap: 10px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.info-item {
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.info-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Agency Panel */
.agency-panel {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.agency-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.agency-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-normal);
    background: rgba(255, 255, 255, 0.02);
}

.agency-item:hover {
    border-color: var(--primary-color);
    background: rgba(14, 165, 233, 0.05);
}

.agency-item.selected {
    border-color: var(--primary-color);
    background: rgba(14, 165, 233, 0.1);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

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

.agency-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Status Buttons */
.status-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.status-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    transition: all var(--transition-normal);
    text-align: left;
}

.status-btn:hover {
    border-color: var(--primary-color);
    background: rgba(14, 165, 233, 0.05);
}

.status-btn.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
}

.status-btn .status-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.1);
}

/* ============================================
   Report Form (Public)
   ============================================ */

.report-container {
    max-width: 760px;
    margin: 0 auto;
}

.report-header {
    text-align: center;
    margin-bottom: 36px;
}

.report-logo {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 42px;
    color: white;
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.4);
}

.report-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.report-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
}

.report-form {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 36px;
    border: 1px solid var(--border-color);
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 36px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    background: rgba(255, 255, 255, 0.02);
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(14, 165, 233, 0.05);
}

.upload-icon {
    font-size: 52px;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.upload-text {
    font-size: 14px;
    color: var(--text-secondary);
}

.upload-text strong {
    color: var(--primary-color);
}

/* Success Page */
.success-container {
    max-width: 560px;
    margin: 0 auto;
    text-align: center;
    padding: 70px 28px;
}

.success-icon {
    width: 130px;
    height: 130px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(16, 185, 129, 0.1) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 28px;
    font-size: 64px;
    color: var(--success-color);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.25);
}

.success-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 14px;
    letter-spacing: -0.5px;
}

.success-message {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 36px;
    line-height: 1.7;
}

.success-ref {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px 28px;
    border-radius: var(--radius-lg);
    margin-bottom: 36px;
    border: 1px solid var(--border-color);
}

.success-ref-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.success-ref-number {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary-color);
    font-family: 'JetBrains Mono', monospace;
}

/* ============================================
   Analytics Page
   ============================================ */

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
}

.analytics-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    padding: 28px;
}

.analytics-card-title {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.analytics-card-value {
    font-size: 40px;
    font-weight: 800;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
}

.analytics-card-change {
    font-size: 14px;
    margin-top: 10px;
    font-weight: 600;
}

.performance-item {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.performance-agency {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 180px;
}

.performance-bar {
    flex: 1;
    height: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.performance-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

.performance-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 70px;
    text-align: right;
    font-family: 'JetBrains Mono', monospace;
}

/* ============================================
   Filters & Search
   ============================================ */

.filters-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.filter-dropdown {
    position: relative;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.filter-btn:hover {
    border-color: var(--primary-color);
    background: var(--bg-secondary);
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 420px;
}

.search-box input {
    width: 100%;
    padding: 12px 18px 12px 44px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 14px;
    background: var(--bg-white);
    color: var(--text-primary);
    transition: all var(--transition-normal);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.search-box .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* ============================================
   Pagination
   ============================================ */

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
}

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

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.page-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-white);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    transition: all var(--transition-normal);
}

.page-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--bg-secondary);
}

.page-btn.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
}

/* ============================================
   Empty States
   ============================================ */

.empty-state {
    text-align: center;
    padding: 70px 28px;
}

.empty-icon {
    font-size: 72px;
    color: var(--text-muted);
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.empty-message {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 28px;
}

/* ============================================
   Modal Styles
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
    padding: 22px 28px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-secondary);
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    border: none;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
}

.modal-close:hover {
    background: var(--danger-color);
    color: white;
}

.modal-body {
    padding: 28px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 18px 28px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 14px;
    background: var(--bg-secondary);
}

/* ============================================
   Emergency Banner & Alerts
   ============================================ */

.emergency-banner {
    background: linear-gradient(135deg, var(--danger-color) 0%, var(--danger-dark) 100%);
    color: white;
    padding: 22px 28px;
    border-radius: var(--radius-xl);
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.35);
    animation: pulse-banner 3s ease-in-out infinite;
}

@keyframes pulse-banner {
    0%, 100% { box-shadow: 0 8px 24px rgba(239, 68, 68, 0.35); }
    50% { box-shadow: 0 8px 32px rgba(239, 68, 68, 0.5); }
}

.emergency-banner-icon {
    font-size: 40px;
    flex-shrink: 0;
    animation: shake 0.5s ease-in-out infinite;
}

@keyframes shake {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

.emergency-banner-text h4 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 5px;
}

.emergency-banner-text p {
    font-size: 14px;
    opacity: 0.9;
}

.form-section {
    margin-bottom: 32px;
}

.form-section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.emergency-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 14px;
}

.emergency-type {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 22px 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
}

.emergency-type:hover {
    border-color: var(--primary-color);
    background: rgba(14, 165, 233, 0.05);
    transform: translateY(-3px);
}

.emergency-type.selected {
    border-color: var(--primary-color);
    background: rgba(14, 165, 233, 0.1);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.2);
}

.emergency-type input { display: none; }

.emergency-type-icon { font-size: 40px; }

.emergency-type-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ============================================
   Powered By Section
   ============================================ */

.powered-by {
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-top: auto;
    padding: 22px;
    gap: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.powered-by img {
    max-width: 50px;
    opacity: 0.6;
    filter: brightness(0) invert(1);
}

/* ============================================
   Utility Classes
   ============================================ */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }

.d-flex { display: flex; }
.d-grid { display: grid; }
.d-none { display: none; }

.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }

.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.overflow-auto { overflow: auto; }
.overflow-hidden { overflow: hidden; }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }

.shadow { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.hidden { display: none !important; }

/* Animation utilities */
.view-section { animation: fadeIn 0.3s ease; }

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

/* Barangay ranking */
.barangay-rank {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-muted);
    width: 36px;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
}

.barangay-rank.top-rank {
    color: var(--primary-color);
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 1400px) {
    .widget-map-full {
        height: calc(100vh - 300px);
        min-height: 400px;
    }
}

@media (max-width: 1200px) {
    .ticket-container {
        grid-template-columns: 1fr;
    }

    .gis-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto auto;
    }

    .gis-sidebar,
    .gis-filters {
        border: none;
        border-bottom: 1px solid var(--border-color);
    }

    .gis-map {
        min-height: 400px;
    }

    .dashboard-grid .col-6,
    .dashboard-grid .col-4,
    .dashboard-grid .col-8 {
        grid-column: span 12;
    }

    .analytics-grid .col-3 {
        grid-column: span 6;
    }

    .widget-map-full {
        height: auto;
        min-height: 400px;
    }

    .widget-body-map {
        min-height: 350px;
    }

    .col-4 .widget {
        margin-bottom: 24px;
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

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

    .menu-toggle {
        display: flex;
    }

    .topbar-search {
        display: none;
    }

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

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

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

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        max-width: none;
    }

    .topbar {
        padding: 0 18px;
    }

    .content-area {
        padding: 18px;
    }

    .user-info {
        display: none;
    }

    .report-form {
        padding: 24px 18px;
    }

    .analytics-grid .col-3,
    .analytics-grid .col-6 {
        grid-column: span 12;
    }
}

@media (max-width: 480px) {
    :root {
        --sidebar-width: 100%;
    }

    .page-title {
        font-size: 18px;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .stat-value {
        font-size: 28px;
    }

    .data-table th,
    .data-table td {
        padding: 10px 14px;
        font-size: 13px;
    }

    .btn {
        padding: 10px 18px;
        font-size: 13px;
    }

    .widget-header {
        padding: 14px 18px;
    }

    .widget-body {
        padding: 16px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-dark);
}
