/* ============================================================================
   DGCPoT Dashboard - Main Stylesheet
   National Security Campaign (SIM Verification System)
   ============================================================================ */

/* CSS Variables - Color Scheme */
:root {
    --primary: #1a3a5c;
    --primary-light: #2c5282;
    --primary-dark: #0d2137;
    --secondary: #4a5568;
    --success: #28a745;
    --success-light: #48bb78;
    --warning: #ffc107;
    --warning-light: #f6e05e;
    --danger: #dc3545;
    --danger-light: #fc8181;
    --info: #17a2b8;
    --info-light: #63b3ed;

    /* MNO Brand Colors */
    --cellcard: #F6A000;
    --smart: #009639;
    --metfone: #106B5C;
    --seatel: #E60289;

    /* Grades */
    --grade-a: #28a745;
    --grade-b: #20c997;
    --grade-c: #ffc107;
    --grade-d: #fd7e14;
    --grade-f: #dc3545;

    /* Layout */
    --sidebar-width: 260px;
    --header-height: 60px;
    --card-radius: 8px;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.15);
}

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

body {
    font-family: 'Kantumruy Pro', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

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

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header .logo {
    font-size: 24px;
    margin-bottom: 5px;
}

.sidebar-header h1 {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
}

.sidebar-header .subtitle {
    font-size: 11px;
    opacity: 0.7;
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-section {
    padding: 10px 20px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.6;
    margin-top: 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left-color: var(--info);
}

.nav-item.active {
    background: rgba(255,255,255,0.15);
    color: white;
    border-left-color: var(--success);
}

.nav-item i {
    width: 24px;
    margin-right: 12px;
    font-size: 16px;
}

.nav-item span {
    font-size: 14px;
}

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

/* Header */
.header {
    background: white;
    height: var(--header-height);
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.header-left h2 {
    font-size: 20px;
    color: var(--primary);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--secondary);
}

.breadcrumb a {
    color: var(--info);
    text-decoration: none;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.last-updated {
    font-size: 12px;
    color: var(--secondary);
}

.btn {
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-family: "Kantumruy Pro", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

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

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

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

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

/* Content Area */
.content {
    padding: 30px;
}

/* Cards */
.card {
    background: white;
    border-radius: var(--card-radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 16px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header h3 i {
    color: var(--info);
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    background: #f9fafb;
    font-size: 12px;
    color: var(--secondary);
}

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

.kpi-card {
    background: white;
    border-radius: var(--card-radius);
    box-shadow: var(--shadow);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--info);
}

.kpi-card.success::before { background: var(--success); }
.kpi-card.warning::before { background: var(--warning); }
.kpi-card.danger::before { background: var(--danger); }
.kpi-card.primary::before { background: var(--primary); }

.kpi-card .kpi-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 40px;
    opacity: 0.1;
    color: var(--primary);
}

.kpi-card .kpi-label {
    font-size: 12px;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.kpi-card .kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 5px;
}

.kpi-card .kpi-change {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

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

/* Grid Layout */
.grid {
    display: grid;
    gap: 20px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-1-2 { grid-template-columns: 1fr 2fr; }
.grid-2-1 { grid-template-columns: 2fr 1fr; }

@media (max-width: 1200px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-1-2, .grid-2-1 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .sidebar { transform: translateX(-100%); }
    .main-content { margin-left: 0; }
}

/* Charts */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

.chart-container.small { height: 200px; }
.chart-container.large { height: 400px; }

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

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

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: var(--primary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.data-table td {
    font-size: 14px;
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success { background: #d4edda; color: #155724; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-info { background: #d1ecf1; color: #0c5460; }
.badge-primary { background: #cce5ff; color: #004085; }

/* Grade Badges */
.grade {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 14px;
    color: white;
}

.grade-a { background: var(--grade-a); }
.grade-b { background: var(--grade-b); }
.grade-c { background: var(--grade-c); color: #333; }
.grade-d { background: var(--grade-d); }
.grade-f { background: var(--grade-f); }

/* MNO Colors */
.mno-cellcard { color: var(--cellcard); }
.mno-smart { color: var(--smart); }
.mno-metfone { color: var(--metfone); }
.mno-seatel { color: var(--seatel); }

.bg-cellcard { background: var(--cellcard); }
.bg-smart { background: var(--smart); }
.bg-metfone { background: var(--metfone); }
.bg-seatel { background: var(--seatel); }

/* Progress Bars */
.progress-bar-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar {
    flex: 1;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
}

.progress-bar-fill.success { background: var(--success); }
.progress-bar-fill.warning { background: var(--warning); }
.progress-bar-fill.danger { background: var(--danger); }
.progress-bar-fill.info { background: var(--info); }
.progress-bar-fill.cellcard { background: var(--cellcard); }
.progress-bar-fill.smart { background: var(--smart); }
.progress-bar-fill.metfone { background: var(--metfone); }
.progress-bar-fill.seatel { background: var(--seatel); }

.progress-value {
    min-width: 50px;
    text-align: right;
    font-weight: 600;
    font-size: 14px;
}

/* Alert Cards */
.alert {
    padding: 15px 20px;
    border-radius: var(--card-radius);
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert i {
    font-size: 20px;
    margin-top: 2px;
}

.alert-success { background: #d4edda; color: #155724; border-left: 4px solid var(--success); }
.alert-warning { background: #fff3cd; color: #856404; border-left: 4px solid var(--warning); }
.alert-danger { background: #f8d7da; color: #721c24; border-left: 4px solid var(--danger); }
.alert-info { background: #d1ecf1; color: #0c5460; border-left: 4px solid var(--info); }

.alert-content h4 {
    font-size: 14px;
    margin-bottom: 4px;
}

.alert-content p {
    font-size: 13px;
    opacity: 0.9;
}

/* Gauge Chart Styles */
.gauge-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.gauge-value {
    font-size: 48px;
    font-weight: 700;
    color: var(--primary);
    margin-top: 15px;
}

.gauge-label {
    font-size: 14px;
    color: var(--secondary);
}

/* Status Indicators */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-dot.online { background: var(--success); }
.status-dot.warning { background: var(--warning); }
.status-dot.offline { background: var(--danger); }

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

/* Comparison Cards */
.comparison-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.comparison-card {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: var(--card-radius);
}

.comparison-card .mno-name {
    font-size: 12px;
    color: var(--secondary);
    margin-bottom: 8px;
}

.comparison-card .mno-value {
    font-size: 24px;
    font-weight: 700;
}

.comparison-card .mno-change {
    font-size: 11px;
    margin-top: 5px;
}

/* Flag Distribution */
.flag-distribution {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.flag-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: var(--card-radius);
    flex: 1;
    min-width: 150px;
}

.flag-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.flag-0 { background: var(--success); }
.flag-1 { background: var(--info); }
.flag-2 { background: var(--warning); }
.flag-3 { background: var(--danger); }

.flag-label {
    font-size: 12px;
    color: var(--secondary);
}

.flag-value {
    font-weight: 600;
    margin-left: auto;
}

/* Heatmap */
.heatmap-container {
    overflow-x: auto;
}

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

.heatmap-cell {
    aspect-ratio: 1;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: white;
}

/* Filters */
.filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-size: 13px;
    color: var(--secondary);
}

.filter-group select,
.filter-group input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 2px solid #eee;
    margin-bottom: 20px;
}

.tab {
    padding: 12px 24px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s ease;
    font-size: 14px;
    color: var(--secondary);
}

.tab:hover {
    color: var(--primary);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

/* Loading State */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Footer */
.dashboard-footer {
    padding: 20px 30px;
    background: white;
    border-top: 1px solid #eee;
    text-align: center;
    font-size: 12px;
    color: var(--secondary);
}

/* Sidebar Toggle (Pin/Unpin) */
.sidebar {
    transition: transform 0.3s ease;
}

.main-content {
    transition: margin-left 0.3s ease;
}

.sidebar-pin-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.8);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all 0.2s;
    z-index: 10;
}

.sidebar-pin-btn:hover {
    background: rgba(255,255,255,0.25);
    color: white;
}

.sidebar-header {
    position: relative;
}

.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
}

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

.sidebar-expand-btn {
    position: fixed;
    top: 10px;
    left: 10px;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    z-index: 1001;
    box-shadow: var(--shadow-lg);
    transition: all 0.2s;
}

.sidebar-expand-btn:hover {
    background: var(--primary-light);
    transform: scale(1.05);
}

.sidebar-collapsed .sidebar-expand-btn {
    display: flex;
}

/* Print Styles */
@media print {
    .sidebar { display: none; }
    .main-content { margin-left: 0; }
    .header { position: static; }
    .btn { display: none; }
    .sidebar-expand-btn { display: none !important; }
    .sidebar-pin-btn { display: none !important; }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-info { color: var(--info); }
.text-muted { color: var(--secondary); }
.font-bold { font-weight: 700; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.mb-10 { margin-bottom: 10px; }

/* ============================================================================
   Lightweight CSS-Only Visualizations (No JavaScript Required)
   ============================================================================ */

/* Verification Success Rate Container */
.success-rate-container {
    display: flex;
    align-items: center;
    gap: 30px;
    padding: 10px 0;
}

@media (max-width: 768px) {
    .success-rate-container {
        flex-direction: column;
    }
}

/* CSS-Only Circular Progress */
.circular-progress-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.circular-progress {
    --size: 140px;
    --stroke-width: 12px;
    --progress: 0;
    --color: #28a745;
    --track-color: #e9ecef;

    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background: conic-gradient(
        var(--color) calc(var(--progress) * 3.6deg),
        var(--track-color) calc(var(--progress) * 3.6deg)
    );
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.circular-progress::before {
    content: '';
    position: absolute;
    width: calc(var(--size) - var(--stroke-width) * 2);
    height: calc(var(--size) - var(--stroke-width) * 2);
    background: white;
    border-radius: 50%;
}

.circular-progress .progress-value {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.circular-progress .value-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
}

.circular-progress .value-percent {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
}

.circular-progress-wrapper .progress-label {
    margin-top: 12px;
    font-size: 13px;
    color: var(--secondary);
    font-weight: 500;
}

/* Flag Distribution Bars */
.flag-bars {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.flag-bar-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.flag-bar-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.flag-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.flag-name {
    font-size: 13px;
    color: var(--secondary);
    flex: 1;
}

.flag-pct {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    min-width: 45px;
    text-align: right;
}

.flag-bar-track {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.flag-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Large Circular Progress (for Campaign page) */
.circular-progress.large {
    --size: 180px;
    --stroke-width: 16px;
}

.circular-progress.large .value-number {
    font-size: 40px;
}

.circular-progress.large .value-percent {
    font-size: 22px;
}

/* Coverage Progress Container */
.coverage-progress-container {
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 20px;
}

.coverage-stats {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
}

.coverage-stat-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.coverage-stat-item .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
}

.coverage-stat-item .stat-icon.success { background: var(--success); }
.coverage-stat-item .stat-icon.warning { background: var(--warning); }
.coverage-stat-item .stat-icon.info { background: var(--info); }

.coverage-stat-item .stat-info {
    display: flex;
    flex-direction: column;
}

.coverage-stat-item .stat-value {
    font-size: 22px;
    font-weight: 700;
}

.coverage-stat-item .stat-label {
    font-size: 12px;
    color: var(--secondary);
}

/* MNO Share Container (CSS-only pie alternative) */
.mno-share-container {
    padding: 10px;
}

.mno-stacked-bar {
    display: flex;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 24px;
}

.stacked-segment {
    transition: opacity 0.2s ease;
}

.stacked-segment:hover {
    opacity: 0.85;
}

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

.mno-share-item {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.mno-share-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.mno-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.mno-share-header .mno-name {
    flex: 1;
    font-weight: 500;
    font-size: 14px;
}

.mno-share-header .mno-pct {
    font-weight: 700;
    font-size: 16px;
    color: var(--primary);
}

.mno-share-item .mno-count {
    font-size: 12px;
    color: var(--secondary);
    padding-left: 22px;
}

/* Consumer Distribution Container (for Operations page) */
.consumer-distribution-container {
    padding: 20px;
}

.consumer-stacked-bar {
    display: flex;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 24px;
}

.consumer-share-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.consumer-share-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 6px;
}

.consumer-share-item .consumer-name {
    flex: 1;
    font-weight: 500;
}

.consumer-share-item .consumer-count {
    font-weight: 600;
    color: var(--primary);
}

.consumer-share-item .consumer-pct {
    font-size: 12px;
    color: var(--secondary);
    min-width: 45px;
    text-align: right;
}

/* Pending Distribution Container (for Committee page) */
.pending-distribution-container {
    padding: 15px;
}

.pending-stacked-bar {
    display: flex;
    height: 32px;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 20px;
}

.pending-share-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pending-share-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.pending-share-item .item-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
}

.pending-share-item .item-value {
    font-weight: 600;
    font-size: 14px;
    color: var(--primary);
}

/* Outcome Distribution Visual (for Verification page) */
.outcome-distribution-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Mini Stat Cards (Alternative to Charts) */
.mini-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.mini-stat {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: var(--card-radius);
    padding: 15px;
    text-align: center;
    border-left: 3px solid var(--info);
}

.mini-stat.success { border-left-color: var(--success); }
.mini-stat.warning { border-left-color: var(--warning); }
.mini-stat.danger { border-left-color: var(--danger); }

.mini-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.mini-stat-label {
    font-size: 11px;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* Horizontal Bar Summary (Fast Alternative to Pie Charts) */
.stacked-bar-container {
    margin: 15px 0;
}

.stacked-bar {
    height: 24px;
    display: flex;
    border-radius: 12px;
    overflow: hidden;
    background: #e9ecef;
}

.stacked-bar-segment {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: white;
    transition: width 0.3s ease;
}

.stacked-bar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 12px;
    justify-content: center;
}

.stacked-bar-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--secondary);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* Simple Metric Display (No Animation) */
.metric-display {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: var(--card-radius);
}

.metric-value-large {
    font-size: 48px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.metric-details {
    flex: 1;
}

.metric-label-large {
    font-size: 14px;
    color: var(--secondary);
    margin-bottom: 8px;
}

.metric-breakdown {
    display: flex;
    gap: 20px;
    font-size: 12px;
}

.metric-breakdown-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Sparkline-style Mini Bars */
.sparkline-bars {
    display: flex;
    align-items: flex-end;
    height: 40px;
    gap: 2px;
}

.sparkline-bar {
    flex: 1;
    background: var(--info);
    border-radius: 2px 2px 0 0;
    min-width: 8px;
    transition: height 0.2s ease;
}

.sparkline-bar:hover {
    background: var(--primary);
}

/* ============================================================================
   Timeline & Audit Trail Styles (Shared)
   ============================================================================ */
.timeline { position: relative; padding: 10px 0; }
.timeline::before { display: none; } /* Remove vertical line */

.timeline-item {
    position: relative;
    padding: 0;
    margin-bottom: 8px;
    border-left: 4px solid #1a3a5c;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    border-radius: 0 4px 4px 0;
    transition: transform 0.2s;
}
.timeline-item:hover { transform: translateX(5px); background: #f8fafc; }

/* Layer specific left borders */
.timeline-item.primary { border-left-color: #28a745; }
.timeline-item.primary.action-unverified { border-left-color: #dc3545; background: #fff5f5; }
.timeline-item.secondary { border-left-color: #ffc107; }
.timeline-item.secondary.action-unverified { border-left-color: #dc3545; }
.timeline-item.webhook { border-left-color: #17a2b8; }
.timeline-item.consumer { border-left-color: #64748b; }
.timeline-item.committee { border-left-color: #db2777; }
.timeline-item.history { border-left-color: #d97706; }

.timeline-content {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    gap: 15px;
    background: none;
    border: 1px solid #e2e8f0;
    border-left: none;
}

.timeline-date {
    font-size: 11px;
    min-width: 120px;
    color: #64748b;
    margin: 0;
    font-family: monospace;
    flex-shrink: 0;
}

.timeline-title {
    font-size: 13px;
    margin: 0;
    min-width: 150px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.timeline-body {
    font-size: 12px;
    flex-grow: 1;
    display: flex;
    align-items: center;
    gap: 15px;
    overflow: hidden;
}

.details-text {
    flex-shrink: 0;
    min-width: 200px;
    max-width: 350px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.compact-identity {
    display: flex;
    gap: 12px;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: 1px solid #e2e8f0;
}

.compact-identity strong { color: #1e293b; }
.compact-identity .text-muted { color: #64748b; margin-right: 4px; }

.layer-badge { font-size: 9px; padding: 1px 6px; text-transform: uppercase; font-weight: 600; }

.automation-highlight {
    background: #f0f9ff;
    border-left: 4px solid #0ea5e9 !important;
}
.automation-icon {
    color: #0ea5e9;
    font-size: 14px;
    margin-right: 4px;
}

.source-logo {
    width: 16px;
    height: 16px;
    object-fit: contain;
    vertical-align: middle;
}

.ref-tag {
    font-size: 10px;
    color: #94a3b8;
    font-family: monospace;
    margin-left: auto;
    background: #f8fafc;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px dashed #e2e8f0;
    white-space: nowrap;
}

@media (max-width: 1200px) {
    .timeline-content { flex-wrap: wrap; gap: 4px; padding: 6px 10px; }
    .timeline-body { width: 100%; gap: 8px; }
    .details-text { max-width: 100%; flex-grow: 1; }
}

.pdf-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.pdf-spinner-container {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pdf-spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid #f1f5f9;
    border-top: 4px solid #1a3a5c;
    border-radius: 50%;
    animation: pdf-spin 1.5s linear infinite;
}

.pdf-logo-pulse {
    width: 80px;
    height: auto;
    animation: pdf-pulse 2s ease-in-out infinite;
    z-index: 1;
}

.pdf-loading-text {
    margin-top: 20px;
    font-weight: 600;
    color: #1a3a5c;
    font-size: 1.1rem;
    letter-spacing: 1px;
}

@keyframes pdf-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pdf-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

/* Gender Toggle Styles */
.gender-toggle {
    display: flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    gap: 4px;
}
.gender-btn {
    padding: 6px 16px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 6px;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}
.gender-btn:hover {
    color: #1a3a5c;
    background: rgba(255,255,255,0.5);
}
.gender-btn.active {
    background: white;
    color: #1a3a5c;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    font-weight: 700;
}

/* Search Box Styles */
.search-container {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid #e2e8f0;
}
.search-box {
    position: relative;
    width: auto;
    margin-bottom: 0;
    display: flex;
    gap: 10px;
    align-items: center;
}
.search-input {
    width: 200px;
    padding: 10px 15px 10px 40px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    background: white;
}
.search-container {
    background: #f8fafc;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 25px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
}
.search-filters, .search-actions {
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 15px;
}
.search-stats {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 0;
    padding: 0 10px;
    border-left: 1px solid #e2e8f0;
    margin-left: auto;
}
.filter-label {
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
    margin-right: 8px;
}

/* View Toggle Styles */
.view-toggle { display: flex; background: #f1f5f9; padding: 4px; border-radius: 8px; border: 1px solid #e2e8f0; }
.view-btn {
    padding: 6px 12px; border: none; background: none; cursor: pointer; border-radius: 6px;
    color: #64748b; font-size: 13px; font-weight: 500; transition: all 0.2s;
    display: flex; align-items: center; gap: 6px;
}
.view-btn:hover { color: #1a3a5c; background: rgba(255,255,255,0.5); }
.view-btn.active { background: white; color: #1a3a5c; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }

/* Column Selector Styles */
.column-selector { position: relative; }
.column-dropdown {
    position: absolute; right: 0; top: 100%; margin-top: 8px; background: white;
    border: 1px solid #e2e8f0; border-radius: 8px; box-shadow: var(--shadow-lg);
    z-index: 1000; padding: 12px; width: 220px; display: none;
}
.column-dropdown.show { display: block; }
.column-option { display: flex; align-items: center; gap: 10px; padding: 6px 0; cursor: pointer; font-size: 13px; color: #4a5568; }
.column-option input { cursor: pointer; }
.column-option:hover { color: #1a3a5c; }

/* Gallery View Styles */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-top: 20px; }
.gallery-card {
    background: white; border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden;
    transition: all 0.3s ease; box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.gallery-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.gallery-image-container { height: 180px; background: #f8fafc; display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
.gallery-image { width: 100%; height: 100%; object-fit: cover; }
.gallery-no-image { font-size: 40px; color: #cbd5e1; }
.gallery-content { padding: 15px; flex: 1; }
.gallery-title { font-weight: 700; font-size: 16px; color: #1a3a5c; margin-bottom: 5px; }
.gallery-subtitle { font-size: 14px; color: #4a5568; margin-bottom: 12px; font-weight: 500; }
.gallery-info-grid { display: grid; grid-template-columns: 1fr; gap: 6px; }
.gallery-info-item { display: flex; font-size: 12px; border-bottom: 1px dashed #f1f5f9; padding-bottom: 4px; }
.gallery-info-label { color: #64748b; width: 100px; flex-shrink: 0; }
.gallery-info-value { color: #1e293b; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gallery-actions { padding: 12px 15px; background: #f8fafc; border-top: 1px solid #f1f5f9; display: flex; justify-content: flex-end; }

/* List View Styles */
.list-container { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.list-item {
    background: white; border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px 15px;
    display: flex; align-items: center; gap: 15px; transition: all 0.2s;
}
.list-item:hover { border-color: #cbd5e1; background: #fcfdfe; }
.list-avatar { width: 50px; height: 50px; border-radius: 8px; background: #f1f5f9; flex-shrink: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.list-avatar img { width: 100%; height: 100%; object-fit: cover; }
.list-details { flex: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.list-field { display: flex; flex-direction: column; }
.list-field-label { font-size: 10px; text-transform: uppercase; color: #94a3b8; letter-spacing: 0.5px; }
.list-field-value { font-size: 13px; font-weight: 600; color: #1e293b; }
.list-actions { flex-shrink: 0; }

.hidden-col { display: none !important; }

/* Existing Photo Styles */
.citizen-photo {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #eee;
    cursor: pointer;
    transition: transform 0.2s;
}
.citizen-photo:hover {
    transform: scale(2);
    z-index: 100;
    position: relative;
}
.photo-toggle {
    background: none;
    border: none;
    color: #1a3a5c;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 5px;
    transition: all 0.2s;
}
.photo-toggle:hover {
    color: #2d5a88;
    transform: scale(1.2);
}
