/* SmartGov Modern Intelligence Dashboard Styling */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-color: #1e3a8a;
    --primary-light: #3b82f6;
    --primary-dark: #0f172a;
    --accent-emerald: #059669;
    --accent-amber: #d97706;
    --accent-rose: #e11d48;
    --accent-indigo: #4f46e5;
    --accent-cyan: #0891b2;
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-soft: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 12px 28px -4px rgba(15, 23, 42, 0.10);
}

* {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-page);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Custom Navbar */
.smartgov-navbar {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-badge {
    background: linear-gradient(135deg, #38bdf8 0%, #6366f1 100%);
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* KPI Cards */
.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: #cbd5e1;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.kpi-card.kpi-primary::before { background: linear-gradient(90deg, #2563eb, #60a5fa); }
.kpi-card.kpi-success::before { background: linear-gradient(90deg, #059669, #34d399); }
.kpi-card.kpi-warning::before { background: linear-gradient(90deg, #d97706, #fbbf24); }
.kpi-card.kpi-danger::before { background: linear-gradient(90deg, #e11d48, #f87171); }
.kpi-card.kpi-purple::before { background: linear-gradient(90deg, #7c3aed, #a78bfa); }

.kpi-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.kpi-val {
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

/* Scorecard Banner */
.ikd-banner {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: var(--radius-lg);
    color: white;
    padding: 1.75rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.3);
}

.ikd-banner::after {
    content: '';
    position: absolute;
    right: -50px;
    bottom: -50px;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
    border-radius: 50%;
}

.ikd-score-dial {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    border: 4px solid #38bdf8;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}

/* Content Cards */
.gov-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.gov-card-header {
    padding: 1.1rem 1.4rem;
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gov-card-body {
    padding: 1.4rem;
}

/* Status Badges */
.badge-optimal {
    background-color: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
    font-weight: 600;
}

.badge-waspada {
    background-color: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
    font-weight: 600;
}

.badge-kritis {
    background-color: #ffe4e6;
    color: #be123c;
    border: 1px solid #fecdd3;
    font-weight: 600;
}

/* ==============================================================
   HIGH CONTRAST & LEGIBILITY RULES (ENSURES ALL TEXT IS CLEARLY READABLE)
   ============================================================== */
.badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em !important;
    padding: 0.35em 0.65em !important;
    border-radius: 6px !important;
}

/* Default / Fallback badge contrast */
.badge:not([class*="bg-"]) {
    background-color: #e2e8f0 !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
}

/* Solid Badges High Contrast */
.badge.bg-danger { background-color: #dc2626 !important; color: #ffffff !important; }
.badge.bg-warning { background-color: #f59e0b !important; color: #1e293b !important; font-weight: 700 !important; }
.badge.bg-success { background-color: #16a34a !important; color: #ffffff !important; }
.badge.bg-primary { background-color: #2563eb !important; color: #ffffff !important; }
.badge.bg-info { background-color: #06b6d4 !important; color: #0f172a !important; font-weight: 700 !important; }
.badge.bg-secondary { background-color: #64748b !important; color: #ffffff !important; }
.badge.bg-dark { background-color: #0f172a !important; color: #ffffff !important; }
.badge.bg-light { background-color: #f1f5f9 !important; color: #0f172a !important; border: 1px solid #cbd5e1 !important; }
.badge.bg-white,
.badge.bg-white.text-white,
.badge.bg-white[class*="bg-opacity"] {
    background-color: #ffffff !important;
    color: #0f172a !important;
    font-weight: 700 !important;
    border: 1px solid #cbd5e1 !important;
}

/* Ensure dim text on dark cards is crisp and legible */
.text-white-50 {
    color: rgba(255, 255, 255, 0.85) !important;
}
.text-white.text-opacity-50 {
    color: rgba(255, 255, 255, 0.85) !important;
}
.text-white.text-opacity-75 {
    color: rgba(255, 255, 255, 0.92) !important;
}

/* High contrast text-muted readability on white cards */
.text-muted {
    color: #475569 !important;
}

/* Subtle Badges Contrast */
.bg-danger-subtle { background-color: #fee2e2 !important; color: #991b1b !important; border: 1px solid #fca5a5 !important; }
.bg-warning-subtle { background-color: #fef3c7 !important; color: #92400e !important; border: 1px solid #fcd34d !important; }
.bg-success-subtle { background-color: #dcfce7 !important; color: #166534 !important; border: 1px solid #86efac !important; }
.bg-primary-subtle { background-color: #dbeafe !important; color: #1e40af !important; border: 1px solid #93c5fd !important; }
.bg-info-subtle { background-color: #cffafe !important; color: #155e75 !important; border: 1px solid #67e8f9 !important; }

/* Table Text Legibility */
.table td, .table th {
    color: #1e293b;
}
.table thead th {
    color: #334155 !important;
    font-weight: 700 !important;
    letter-spacing: 0.03em !important;
}

/* Indicator Progress Bar */
.progress-thin {
    height: 7px;
    border-radius: 10px;
    background-color: #f1f5f9;
}

/* Solution Roadmap Timeline Card */
.solution-card {
    border-left: 4px solid var(--primary-light);
    border-radius: var(--radius-sm);
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    padding: 1.25rem;
    margin-bottom: 1.15rem;
    transition: all 0.2s ease;
}

.solution-card:hover {
    background: #ffffff;
    border-color: #cbd5e1;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.solution-card.priority-mendesak {
    border-left-color: var(--accent-rose);
}

.solution-card.priority-tinggi {
    border-left-color: var(--accent-amber);
}

.solution-card.priority-strategis {
    border-left-color: var(--accent-emerald);
}

/* Potensi Sector Card */
.potensi-badge-lq {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    background: #e0e7ff;
    color: #3730a3;
}

/* Policy Simulation Slider */
.sim-slider-container {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.form-range::-webkit-slider-thumb {
    background: #2563eb;
    box-shadow: 0 0 6px rgba(37, 99, 235, 0.5);
}

/* Tabs */
.nav-pills .nav-link {
    border-radius: 10px;
    padding: 0.65rem 1.25rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.25s ease;
    border: 1px solid transparent;
}

.nav-pills .nav-link:hover {
    color: var(--primary-light);
    background-color: #f1f5f9;
}

.nav-pills .nav-link.active {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Modern Pulse Animation */
@keyframes pulseSlow {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.85; }
}

.pulse-badge {
    animation: pulseSlow 2.5s infinite ease-in-out;
}

/* EWS Alert Ribbon */
.ews-alert-strip {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-left: 5px solid #ef4444;
    border-radius: var(--radius-md);
    padding: 1rem 1.4rem;
    box-shadow: var(--shadow-soft);
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.ews-alert-strip::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 150px;
    background: linear-gradient(90deg, transparent, rgba(239, 68, 68, 0.08));
    pointer-events: none;
}

/* 5 Janji Politik Card Styles */
.janji-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.25rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    height: 100%;
}

.janji-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px -4px rgba(15, 23, 42, 0.12);
    border-color: #3b82f6;
}

.janji-card .janji-num {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #64748b;
    text-transform: uppercase;
}

/* Cascading & Audit Visuals */
.cascading-meter-box {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    color: white;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

/* SDGs Mini Cards */
.sdgs-goal-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1rem;
    transition: all 0.25s ease;
    height: 100%;
}

.sdgs-goal-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px -2px rgba(15, 23, 42, 0.08);
}

.sdgs-number-badge {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 0.85rem;
}

/* Spatial Kecamatan Mini Explorer */
.spatial-chip {
    padding: 0.65rem 0.9rem;
    border-radius: 12px;
    border: 1.5px solid #e2e8f0;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.spatial-chip:hover, .spatial-chip.active {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
    transform: translateY(-2px);
}

/* Mandatory Spending Progress Bar */
.mandatory-track {
    height: 12px;
    border-radius: 20px;
    background: #e2e8f0;
    position: relative;
    overflow: visible;
}

.mandatory-fill {
    height: 100%;
    border-radius: 20px;
    transition: width 0.8s ease;
}

.mandatory-target-line {
    position: absolute;
    top: -4px;
    bottom: -4px;
    width: 3px;
    background: #0f172a;
    border-radius: 2px;
    z-index: 2;
}

/* Print styles for executive briefing */
@media print {
    .no-print, .smartgov-navbar, .nav-pills, .btn {
        display: none !important;
    }
    body {
        background: white !important;
        color: black !important;
    }
    .gov-card, .kpi-card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        break-inside: avoid;
    }
}

/* ==============================================================
   MOBILE APP-STYLE RESPONSIVE ARCHITECTURE (< 992px)
   ============================================================== */
@media (max-width: 991.98px) {
    /* 1. Global Mobile Layout Hygiene */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
    }

    body {
        /* Adequate clearance so content is never covered by bottom fixed menu */
        padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
    }

    .smartgov-main-container {
        padding-left: 0.85rem !important;
        padding-right: 0.85rem !important;
        padding-top: 1rem !important;
        padding-bottom: 2rem !important;
        overflow-x: hidden !important;
    }

    /* 2. Sleek Mobile Top Navbar */
    .smartgov-navbar {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }

    .smartgov-navbar .container-fluid {
        padding-left: 0.85rem !important;
        padding-right: 0.85rem !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .smartgov-brand-title {
        font-size: 1.15rem !important;
    }

    .smartgov-navbar-controls {
        width: 100% !important;
        margin-top: 0.75rem !important;
        margin-left: 0 !important;
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }

    .smartgov-daerah-box {
        flex: 1 1 calc(60% - 0.25rem) !important;
        min-width: 0 !important;
    }

    .smartgov-daerah-box select {
        width: 100% !important;
        min-width: 0 !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        font-size: 0.82rem !important;
    }

    .smartgov-year-box {
        flex: 0 0 auto !important;
    }

    .smartgov-btn-group {
        width: 100% !important;
        display: flex !important;
        gap: 0.5rem !important;
        margin-top: 0.25rem !important;
    }

    .smartgov-btn-group button,
    .smartgov-btn-group a {
        flex: 1 1 50% !important;
        justify-content: center !important;
        font-size: 0.78rem !important;
        padding: 0.45rem 0.65rem !important;
    }

    /* 3. Executive Profile Banner */
    .ikd-banner {
        padding: 1.15rem 1rem !important;
        border-radius: 14px !important;
        margin-bottom: 1.15rem !important;
    }

    .ikd-daerah-title {
        font-size: 1.35rem !important;
    }

    .ikd-composite-box {
        width: 100% !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        margin-top: 0.5rem !important;
        padding: 0.85rem 1rem !important;
    }

    .ikd-score-dial {
        width: 82px !important;
        height: 82px !important;
        border-width: 3px !important;
    }
    .ikd-score-dial span.fs-2 {
        font-size: 1.45rem !important;
    }

    /* 4. FIXED BOTTOM NAVIGATION BAR WITH HORIZONTAL SCROLL */
    .smartgov-bottom-nav {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 1045 !important;
        margin: 0 !important;
        border-radius: 18px 18px 0 0 !important;
        border-left: 0 !important;
        border-right: 0 !important;
        border-bottom: 0 !important;
        border-top: 1px solid rgba(226, 232, 240, 0.95) !important;
        background: rgba(255, 255, 255, 0.98) !important;
        backdrop-filter: blur(16px) !important;
        -webkit-backdrop-filter: blur(16px) !important;
        box-shadow: 0 -8px 30px rgba(15, 23, 42, 0.14) !important;
        padding: 0.55rem 0.75rem calc(0.55rem + env(safe-area-inset-bottom, 0px)) 0.75rem !important;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        gap: 0.5rem !important;
    }

    .smartgov-bottom-nav::-webkit-scrollbar {
        display: none !important;
    }

    .smartgov-bottom-nav .nav-item {
        flex: 0 0 auto !important;
    }

    .smartgov-bottom-nav .nav-link {
        display: inline-flex !important;
        align-items: center !important;
        gap: 0.45rem !important;
        white-space: nowrap !important;
        font-size: 0.82rem !important;
        font-weight: 600 !important;
        padding: 0.55rem 0.95rem !important;
        border-radius: 12px !important;
        color: #475569 !important;
        background: #f8fafc !important;
        border: 1px solid #e2e8f0 !important;
        transition: all 0.2s ease !important;
    }

    .smartgov-bottom-nav .nav-link:hover {
        background: #f1f5f9 !important;
        color: #1e293b !important;
    }

    .smartgov-bottom-nav .nav-link.active {
        background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%) !important;
        color: #ffffff !important;
        border-color: #1d4ed8 !important;
        box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35) !important;
    }

    .smartgov-bottom-nav .nav-link.active i {
        color: #ffffff !important;
    }

    /* 5. Early Warning System (EWS) Alert Strip */
    .ews-alert-strip {
        padding: 1.15rem 1rem !important;
        border-radius: 14px !important;
        margin-bottom: 1.25rem !important;
    }

    .ews-alert-strip .btn {
        width: 100% !important;
    }

    /* 6. KPI Cards on Mobile */
    .kpi-card {
        padding: 0.85rem !important;
        border-radius: 12px !important;
    }

    .kpi-val {
        font-size: 1.35rem !important;
    }

    .kpi-icon-box {
        width: 36px !important;
        height: 36px !important;
        font-size: 1rem !important;
    }

    /* 7. Janji Politik & Program Cards */
    .janji-card {
        padding: 1rem !important;
        border-radius: 14px !important;
    }

    /* 8. General Card & Table Responsiveness */
    .gov-card {
        border-radius: 14px !important;
        margin-bottom: 1.15rem !important;
    }

    .gov-card-header {
        padding: 0.95rem 1rem !important;
    }

    .gov-card-body {
        padding: 1rem !important;
    }

    /* Prevent any text overflow inside badges or buttons */
    .badge {
        white-space: normal !important;
        text-align: left !important;
    }

    /* Tables always horizontally scrollable smoothly */
    .table-responsive {
        border-radius: 10px !important;
        border: 1px solid #e2e8f0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* ApexCharts container fitting */
    #pillarRadarChart, #performanceTrendChart {
        min-height: 280px !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }

    /* Stacked elements separator */
    .cascading-meter-box .border-start {
        border-left: none !important;
        border-top: 1px solid rgba(255, 255, 255, 0.2) !important;
        padding-top: 0.75rem !important;
        padding-left: 0 !important;
        margin-top: 0.75rem !important;
    }
}

/* ==============================================================
   UNIVERSAL TABLE-TO-CARDS VIEW MODE (ALL MODULES)
   ============================================================== */
.smartgov-view-mode-toggle .btn {
    font-size: 0.78rem !important;
    padding: 0.25rem 0.65rem !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.25rem !important;
    transition: all 0.2s ease !important;
}

.smartgov-view-mode-toggle .btn.active {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25) !important;
}

/* When Cards View Mode is Active on .gov-card */
.gov-card.cards-view-mode .table-responsive,
.cards-view-mode.table-responsive {
    overflow: visible !important;
    background: transparent !important;
    border: none !important;
}

.gov-card.cards-view-mode table,
.gov-card.cards-view-mode thead,
.gov-card.cards-view-mode tbody,
.gov-card.cards-view-mode th,
.gov-card.cards-view-mode td,
.gov-card.cards-view-mode tr,
.cards-view-mode table,
.cards-view-mode thead,
.cards-view-mode tbody,
.cards-view-mode th,
.cards-view-mode td,
.cards-view-mode tr {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Hide standard table header row in Cards view */
.gov-card.cards-view-mode thead,
.cards-view-mode thead {
    display: none !important;
}

/* Card Grid Layout */
.gov-card.cards-view-mode tbody,
.cards-view-mode tbody {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)) !important;
    gap: 1.15rem !important;
    padding: 1.15rem !important;
    background: #f8fafc !important;
    border-radius: 0 0 16px 16px !important;
}

@media (max-width: 768px) {
    .gov-card.cards-view-mode tbody,
    .cards-view-mode tbody {
        grid-template-columns: 1fr !important;
        padding: 0.85rem !important;
        gap: 0.85rem !important;
    }
}

/* Individual Card (transformed from TR) */
.gov-card.cards-view-mode tbody tr,
.cards-view-mode tbody tr {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 14px !important;
    padding: 1.15rem !important;
    box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.05) !important;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
    position: relative !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

.gov-card.cards-view-mode tbody tr:hover,
.cards-view-mode tbody tr:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 24px -4px rgba(15, 23, 42, 0.12) !important;
    border-color: #3b82f6 !important;
}

/* Card Top Colored Accent Line */
.gov-card.cards-view-mode tbody tr::before,
.cards-view-mode tbody tr::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 4px !important;
    background: linear-gradient(90deg, #1e3a8a, #3b82f6) !important;
    display: block !important;
}

/* Empty State row in Cards view */
.gov-card.cards-view-mode tbody tr[data-is-empty="true"],
.gov-card.cards-view-mode tbody tr td[colspan],
.cards-view-mode tbody tr[data-is-empty="true"],
.cards-view-mode tbody tr td[colspan] {
    grid-column: 1 / -1 !important;
    text-align: center !important;
    padding: 2.5rem 1rem !important;
    background: #ffffff !important;
    border-radius: 14px !important;
    color: #64748b !important;
    font-weight: 500 !important;
}

/* Card Index Pill (top right) */
.gov-card.cards-view-mode tbody tr td[data-is-index="true"],
.cards-view-mode tbody tr td[data-is-index="true"] {
    position: absolute !important;
    top: 0.85rem !important;
    right: 0.85rem !important;
    width: auto !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    z-index: 2 !important;
}

.gov-card.cards-view-mode tbody tr td[data-is-index="true"]::before,
.cards-view-mode tbody tr td[data-is-index="true"]::before {
    display: none !important;
}

.gov-card.cards-view-mode tbody tr td[data-is-index="true"],
.cards-view-mode tbody tr td[data-is-index="true"] {
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    color: #64748b !important;
    background: #f1f5f9 !important;
    padding: 3px 8px !important;
    border-radius: 6px !important;
    border: 1px solid #e2e8f0 !important;
}

/* Card Primary Title (Name/Label) */
.gov-card.cards-view-mode tbody tr td[data-is-title="true"],
.cards-view-mode tbody tr td[data-is-title="true"] {
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    border-bottom: 1.5px solid #e2e8f0 !important;
    padding-bottom: 0.75rem !important;
    margin-bottom: 0.55rem !important;
    padding-top: 0.35rem !important;
    padding-left: 0 !important;
    padding-right: 2.5rem !important; /* Space for index pill */
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
    background: transparent !important;
}

.gov-card.cards-view-mode tbody tr td[data-is-title="true"]::before,
.cards-view-mode tbody tr td[data-is-title="true"]::before {
    display: none !important;
}

/* Card Attribute Fields */
.gov-card.cards-view-mode tbody tr td:not([data-is-title="true"]):not([data-is-action="true"]):not([data-is-index="true"]):not([colspan]),
.cards-view-mode tbody tr td:not([data-is-title="true"]):not([data-is-action="true"]):not([data-is-index="true"]):not([colspan]) {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0.45rem 0 !important;
    border-bottom: 1px dashed #f1f5f9 !important;
    font-size: 0.85rem !important;
    color: #334155 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    background: transparent !important;
    white-space: normal !important;
    word-break: break-word !important;
}

/* Attribute Label */
.gov-card.cards-view-mode tbody tr td:not([data-is-title="true"]):not([data-is-action="true"]):not([data-is-index="true"]):not([colspan])::before,
.cards-view-mode tbody tr td:not([data-is-title="true"]):not([data-is-action="true"]):not([data-is-index="true"]):not([colspan])::before {
    content: attr(data-label) !important;
    font-weight: 600 !important;
    color: #64748b !important;
    font-size: 0.76rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.4px !important;
    margin-right: 0.75rem !important;
    flex-shrink: 0 !important;
    max-width: 48% !important;
    text-align: left !important;
}

/* Card Action Buttons (Bottom Row) */
.gov-card.cards-view-mode tbody tr td[data-is-action="true"],
.cards-view-mode tbody tr td[data-is-action="true"] {
    border-bottom: none !important;
    margin-top: auto !important;
    padding-top: 0.85rem !important;
    padding-bottom: 0 !important;
    border-top: 1.5px solid #f1f5f9 !important;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 0.5rem !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    background: transparent !important;
}

.gov-card.cards-view-mode tbody tr td[data-is-action="true"]::before,
.cards-view-mode tbody tr td[data-is-action="true"]::before {
    content: 'Tindakan:' !important;
    font-weight: 600 !important;
    color: #94a3b8 !important;
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.4px !important;
    margin-right: auto !important;
}

.gov-card.cards-view-mode tbody tr td[data-is-action="true"] .btn,
.cards-view-mode tbody tr td[data-is-action="true"] .btn {
    padding: 0.35rem 0.65rem !important;
    font-size: 0.82rem !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
}

/* Excel Export Button Styling */
.smartgov-btn-export-excel {
    background-color: #10b981 !important;
    border-color: #059669 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    font-size: 0.82rem !important;
    padding: 0.28rem 0.65rem !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.smartgov-btn-export-excel:hover {
    background-color: #059669 !important;
    border-color: #047857 !important;
    color: #ffffff !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35) !important;
}

/* Cards View: Summary Footer Row (tfoot) */
.gov-card.cards-view-mode tfoot,
.cards-view-mode tfoot {
    display: block !important;
    grid-column: 1 / -1 !important;
    width: 100% !important;
    background: #f0fdf4 !important;
    border: 1.5px solid #bbf7d0 !important;
    border-radius: 14px !important;
    padding: 1rem 1.25rem !important;
    margin-top: 0.75rem !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.08) !important;
}

.gov-card.cards-view-mode tfoot tr,
.cards-view-mode tfoot tr {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 0.75rem !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.gov-card.cards-view-mode tfoot td,
.cards-view-mode tfoot td {
    border: none !important;
    padding: 0.25rem 0.5rem !important;
    font-size: 0.85rem !important;
}

/* ==========================================================================
   AI Analytical Report & Executive Master Document Styling
   ========================================================================== */
.ai-rendered-content {
    background: #ffffff;
    border-radius: 12px;
    padding: 2.5rem 3.5rem;
    color: #1e293b;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    line-height: 1.8;
    font-size: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
}

.ai-rendered-content h1 {
    font-size: 1.85rem;
    font-weight: 800;
    color: #1e3a8a;
    border-bottom: 3px solid #1e3a8a;
    padding-bottom: 0.75rem;
    margin-top: 1.5rem;
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
    text-align: center;
}

.ai-rendered-content h2 {
    font-size: 1.45rem;
    font-weight: 700;
    color: #0f172a;
    border-bottom: 2px solid #cbd5e1;
    padding-bottom: 0.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.ai-rendered-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e3a8a;
    background: #f1f5f9;
    padding: 0.6rem 1rem;
    border-left: 5px solid #1e3a8a;
    border-radius: 0 6px 6px 0;
    margin-top: 2.25rem;
    margin-bottom: 1.15rem;
}

.ai-rendered-content h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e40af;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.ai-rendered-content table {
    width: 100%;
    margin: 1.5rem 0;
    border-collapse: collapse;
    font-size: 0.88rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border-radius: 8px;
    overflow: hidden;
}

.ai-rendered-content table th {
    background-color: #1e3a8a !important;
    color: #ffffff !important;
    font-weight: 600;
    padding: 10px 12px;
    border: 1px solid #1e3a8a;
    text-align: center;
    vertical-align: middle;
}

.ai-rendered-content table td {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    color: #334155;
    vertical-align: middle;
}

.ai-rendered-content table tr:nth-child(even) {
    background-color: #f8fafc;
}

.ai-rendered-content table tr:hover {
    background-color: #f1f5f9;
}

.ai-rendered-content blockquote {
    border-left: 4px solid #3b82f6;
    padding: 0.75rem 1.25rem;
    margin: 1.25rem 0;
    background-color: #f0fdf4;
    border-radius: 0 8px 8px 0;
    color: #166534;
    font-style: italic;
}

/* Elegant Report Figure Card */
.report-figure-card {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem auto;
    max-width: 920px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.report-figure-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.09);
}

.report-figure-card img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    display: inline-block;
    background: #ffffff;
}

.report-figure-caption {
    font-size: 0.88rem;
    font-style: italic;
    font-weight: 600;
    color: #475569;
    margin-top: 0.75rem;
}

/* Executive Cover Card for Web UI Preview */
.report-executive-cover {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: #ffffff;
    border-radius: 12px;
    padding: 2.25rem 2.5rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 8px 25px rgba(30, 58, 138, 0.25);
    position: relative;
    overflow: hidden;
    border-left: 6px solid #f59e0b;
}

.report-executive-cover .cover-badge {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    display: inline-block;
    margin-bottom: 1rem;
    color: #fef08a;
}

.report-executive-cover .cover-title {
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: #ffffff;
}

.report-executive-cover .cover-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.report-executive-cover .meta-item {
    font-size: 0.85rem;
}

.report-executive-cover .meta-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 2px;
}

.report-executive-cover .meta-val {
    font-weight: 700;
    color: #ffffff;
}




