/* =============================================
   ISD Operations Dashboard — Design System
   Premium Light Mode
   ============================================= */

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

/* ---------- CSS Variables ---------- */
:root {
    /* Colours — Light Mode */
    --bg-primary: #f1f5f9;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-glass: rgba(255, 255, 255, 0.7);
    --bg-hover: rgba(99, 102, 241, 0.06);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --border-color: rgba(15, 23, 42, 0.08);
    --border-focus: rgba(99, 102, 241, 0.5);

    /* Accent */
    --accent-primary: #6366f1;
    --accent-primary-glow: rgba(99, 102, 241, 0.15);
    --accent-secondary: #8b5cf6;

    /* Health colours */
    --health-green: #16a34a;
    --health-green-bg: rgba(22, 163, 74, 0.08);
    --health-green-border: rgba(22, 163, 74, 0.25);
    --health-amber: #d97706;
    --health-amber-bg: rgba(217, 119, 6, 0.08);
    --health-amber-border: rgba(217, 119, 6, 0.25);
    --health-red: #dc2626;
    --health-red-bg: rgba(220, 38, 38, 0.06);
    --health-red-border: rgba(220, 38, 38, 0.25);

    /* Priority colours */
    --priority-highest: #dc2626;
    --priority-high: #ea580c;
    --priority-medium: #ca8a04;
    --priority-low: #16a34a;
    --priority-lowest: #64748b;

    /* Spacing */
    --sidebar-width: 260px;
    --header-height: 64px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px var(--accent-primary-glow);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
}

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

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

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

a { color: var(--accent-primary); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--accent-secondary); }

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

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.04);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-base);
}

.sidebar-brand {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand .brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    color: white;
    flex-shrink: 0;
}

.sidebar-brand .brand-text {
    display: flex;
    flex-direction: column;
}

.sidebar-brand .brand-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.2;
}

.sidebar-brand .brand-sub {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

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

.nav-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
    transition: all var(--transition-fast);
    position: relative;
    cursor: pointer;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-primary-glow);
    color: var(--accent-primary);
    font-weight: 600;
}

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

.nav-item .nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.7;
}

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

.nav-item .nav-badge {
    margin-left: auto;
    background: var(--health-red);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

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

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

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

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: white;
    flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-muted); text-transform: capitalize; }

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

.top-bar {
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

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

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sync-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.sync-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--health-green);
    animation: pulse 2s infinite;
}

.sync-dot.stale { background: var(--health-amber); }

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

.btn-refresh {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.btn-refresh.spinning svg { animation: spin 1s linear infinite; }

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.alert-bell {
    position: relative;
    padding: 8px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.alert-bell:hover { background: var(--bg-hover); }

.alert-bell .badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--health-red);
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 8px;
    min-width: 16px;
    text-align: center;
}

/* ---------- Page Content ---------- */
.page-content {
    padding: 28px;
}

/* ---------- KPI Cards Grid ---------- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.kpi-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 22px;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.kpi-card.health-green::before { background: var(--health-green); }
.kpi-card.health-amber::before { background: var(--health-amber); }
.kpi-card.health-red::before { background: var(--health-red); }

.kpi-card.health-green { border-color: var(--health-green-border); }
.kpi-card.health-amber { border-color: var(--health-amber-border); }
.kpi-card.health-red { border-color: var(--health-red-border); }

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.kpi-card.health-green:hover { box-shadow: 0 4px 20px rgba(34, 197, 94, 0.15); }
.kpi-card.health-amber:hover { box-shadow: 0 4px 20px rgba(245, 158, 11, 0.15); }
.kpi-card.health-red:hover { box-shadow: 0 4px 20px rgba(239, 68, 68, 0.15); }

.kpi-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.kpi-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-card.health-green .kpi-icon { background: var(--health-green-bg); color: var(--health-green); }
.kpi-card.health-amber .kpi-icon { background: var(--health-amber-bg); color: var(--health-amber); }
.kpi-card.health-red .kpi-icon { background: var(--health-red-bg); color: var(--health-red); }

.kpi-value {
    font-size: 36px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}

.kpi-card.health-green .kpi-value { color: var(--health-green); }
.kpi-card.health-amber .kpi-value { color: var(--health-amber); }
.kpi-card.health-red .kpi-value { color: var(--health-red); }

.kpi-subtitle {
    font-size: 11px;
    color: var(--text-muted);
}

/* ---------- Cards / Panels ---------- */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

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

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

.card-body { padding: 22px; }
.card-body.no-padding { padding: 0; }

/* ---------- Data Tables ---------- */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: color var(--transition-fast);
}

.data-table thead th:hover { color: var(--text-primary); }

.data-table thead th.sorted { color: var(--accent-primary); }

.data-table thead th .sort-arrow {
    display: inline-block;
    margin-left: 4px;
    opacity: 0.5;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover { background: var(--bg-hover); }
.data-table tbody tr:last-child { border-bottom: none; }

.data-table tbody td {
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Row colouring for ageing */
.data-table tbody tr.row-red { background: var(--health-red-bg); }
.data-table tbody tr.row-red:hover { background: rgba(239, 68, 68, 0.15); }
.data-table tbody tr.row-amber { background: var(--health-amber-bg); }
.data-table tbody tr.row-amber:hover { background: rgba(245, 158, 11, 0.15); }

/* ---------- Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-green { background: var(--health-green-bg); color: var(--health-green); border: 1px solid var(--health-green-border); }
.badge-amber { background: var(--health-amber-bg); color: var(--health-amber); border: 1px solid var(--health-amber-border); }
.badge-red { background: var(--health-red-bg); color: var(--health-red); border: 1px solid var(--health-red-border); }
.badge-blue { background: rgba(59, 130, 246, 0.1); color: #3b82f6; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-purple { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; border: 1px solid rgba(139, 92, 246, 0.3); }
.badge-gray { background: rgba(100, 116, 139, 0.1); color: #94a3b8; border: 1px solid rgba(100, 116, 139, 0.3); }

.badge-priority-highest { background: rgba(220, 38, 38, 0.15); color: #dc2626; border: 1px solid rgba(220, 38, 38, 0.3); }
.badge-priority-high { background: rgba(249, 115, 22, 0.15); color: #f97316; border: 1px solid rgba(249, 115, 22, 0.3); }
.badge-priority-medium { background: rgba(234, 179, 8, 0.15); color: #eab308; border: 1px solid rgba(234, 179, 8, 0.3); }
.badge-priority-low { background: rgba(34, 197, 94, 0.15); color: #22c55e; border: 1px solid rgba(34, 197, 94, 0.3); }
.badge-priority-lowest { background: rgba(100, 116, 139, 0.15); color: #94a3b8; border: 1px solid rgba(100, 116, 139, 0.3); }

.badge-forwarded {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    box-shadow: 0 2px 8px var(--accent-primary-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
    color: white;
}

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

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

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

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

.btn-danger:hover { background: rgba(239, 68, 68, 0.25); }

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

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

.form-input,
.form-select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    transition: border-color var(--transition-fast);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

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

/* ---------- Filters Bar ---------- */
.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 150px;
}

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

.filter-group select,
.filter-group input {
    padding: 7px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 12px;
    font-family: 'Inter', sans-serif;
}

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

/* ---------- Charts ---------- */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.chart-container {
    position: relative;
    height: 280px;
    padding: 8px;
}

/* ---------- Workload Bars ---------- */
.workload-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
    cursor: pointer;
}

.workload-bar:hover { background: var(--bg-hover); }
.workload-bar:last-child { border-bottom: none; }

.workload-name {
    width: 140px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.workload-progress {
    flex: 1;
    height: 24px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
}

.workload-progress-fill {
    height: 100%;
    border-radius: var(--radius-sm);
    transition: width var(--transition-slow);
    display: flex;
    align-items: center;
    padding: 0 8px;
    font-size: 11px;
    font-weight: 700;
    color: white;
    min-width: fit-content;
}

.workload-progress-fill.health-green { background: linear-gradient(90deg, var(--health-green), #16a34a); }
.workload-progress-fill.health-amber { background: linear-gradient(90deg, var(--health-amber), #d97706); }
.workload-progress-fill.health-red { background: linear-gradient(90deg, var(--health-red), #dc2626); }

.workload-stats {
    display: flex;
    gap: 20px;
    min-width: 200px;
}

.workload-stat {
    text-align: center;
}

.workload-stat-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.workload-stat-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* ---------- Stage Progress (City Manager) ---------- */
.stage-progress {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 12px 0;
}

.stage-step {
    flex: 1;
    text-align: center;
    position: relative;
}

.stage-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    margin: 0 auto 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    position: relative;
    z-index: 2;
    transition: all var(--transition-base);
}

.stage-step.completed .stage-dot {
    background: var(--health-green);
    border-color: var(--health-green);
    color: white;
}

.stage-step.current .stage-dot {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    box-shadow: 0 0 12px var(--accent-primary-glow);
}

.stage-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 12px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: var(--border-color);
    z-index: 1;
}

.stage-step.completed:not(:last-child)::after {
    background: var(--health-green);
}

.stage-label {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 500;
}

.stage-step.current .stage-label { color: var(--accent-primary); font-weight: 600; }
.stage-step.completed .stage-label { color: var(--health-green); }

/* ---------- SLA Compliance Meters ---------- */
.compliance-meters {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.compliance-meter {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
}

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

.compliance-meter .meter-value {
    font-size: 42px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}

.compliance-meter .meter-sub {
    font-size: 11px;
    color: var(--text-muted);
}

/* ---------- Alerts Panel ---------- */
.alert-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}

.alert-item:hover { background: var(--bg-hover); }
.alert-item:last-child { border-bottom: none; }

.alert-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}

.alert-dot.critical { background: var(--health-red); box-shadow: 0 0 6px rgba(239, 68, 68, 0.4); }
.alert-dot.warning { background: var(--health-amber); }
.alert-dot.info { background: var(--accent-primary); }

.alert-content { flex: 1; }
.alert-title { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.alert-message { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.alert-time { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

/* ---------- Stale Data Banner ---------- */
.stale-banner {
    background: var(--health-amber-bg);
    border: 1px solid var(--health-amber-border);
    border-radius: var(--radius-md);
    padding: 10px 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--health-amber);
    font-weight: 500;
}

/* ---------- Stats Row ---------- */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-item {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 18px;
    text-align: center;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

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

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 20px;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.pagination a:hover { background: var(--bg-hover); color: var(--text-primary); }

.pagination .active {
    background: var(--accent-primary);
    color: white;
    font-weight: 600;
}

/* ---------- Grid Layouts ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* ---------- Login Page ---------- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.04);
}

.login-brand {
    text-align: center;
    margin-bottom: 32px;
}

.login-brand .brand-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 22px;
    color: white;
    margin: 0 auto 16px;
}

.login-brand h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.login-brand p {
    font-size: 13px;
    color: var(--text-muted);
}

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

.login-card .btn-primary {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    justify-content: center;
}

/* ---------- Flash Messages ---------- */
.flash {
    padding: 12px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.flash-success { background: var(--health-green-bg); color: var(--health-green); border: 1px solid var(--health-green-border); }
.flash-error { background: var(--health-red-bg); color: var(--health-red); border: 1px solid var(--health-red-border); }

/* ---------- Empty State ---------- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state svg { margin-bottom: 16px; opacity: 0.3; }
.empty-state h3 { font-size: 16px; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p { font-size: 13px; }

/* ---------- Error Page ---------- */
.error-page { display: flex; align-items: center; justify-content: center; min-height: 60vh; }
.error-content { text-align: center; }
.error-content h1 { font-size: 72px; font-weight: 800; color: var(--text-muted); margin: 16px 0 8px; }
.error-content p { color: var(--text-secondary); margin-bottom: 24px; }
.error-icon { color: var(--text-muted); }

/* ---------- Frustrated Reporter Widget ---------- */
.reporter-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
}

.reporter-card:last-child { border-bottom: none; }

.reporter-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--health-red-bg);
    border: 1px solid var(--health-red-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--health-red);
    flex-shrink: 0;
}

.reporter-info { flex: 1; }
.reporter-name { font-weight: 600; font-size: 13px; color: var(--text-primary); }
.reporter-meta { font-size: 11px; color: var(--text-muted); }

.reporter-count {
    font-size: 22px;
    font-weight: 800;
    color: var(--health-red);
}

/* ---------- Settings Sections ---------- */
.settings-section {
    margin-bottom: 28px;
}

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

/* ---------- Ticket Portal Card (City Manager) ---------- */
.portal-ticket {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 14px;
    transition: all var(--transition-base);
}

.portal-ticket:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 2px 12px var(--accent-primary-glow);
}

.portal-ticket-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.portal-ticket-key {
    font-weight: 700;
    font-size: 14px;
    color: var(--accent-primary);
}

.portal-ticket-summary {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 14px;
}

.portal-ticket-meta {
    display: flex;
    gap: 20px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .charts-grid { grid-template-columns: 1fr; }
    .compliance-meters { grid-template-columns: 1fr; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .kpi-grid { grid-template-columns: 1fr; }
    .page-content { padding: 16px; }
    .top-bar { padding: 0 16px; }
    .filters-bar { flex-direction: column; }
    .workload-stats { display: none; }
}
