/* ==========================================================================
   SIHARAPANKU — FRONTEND & PORTAL PUBLIK DESIGN SYSTEM
   Modern Government Food Price Intelligence Platform (Provinsi Sumatera Utara)
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap");

:root {
    --primary: #059669;
    --primary-dark: #047857;
    --primary-light: #10b981;
    --primary-soft: #ecfdf5;
    --primary-50: #f0fdf4;
    --primary-100: #dcfce7;
    --primary-200: #bbf7d0;
    --primary-600: #16a34a;
    --primary-700: #15803d;
    --primary-800: #166534;
    --primary-900: #14532d;

    --navy-900: #0f172a;
    --navy-800: #1e293b;
    --navy-700: #334155;
    --navy-600: #475569;

    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;

    --success: #10b981;
    --success-soft: #d1fae5;
    --warning: #f59e0b;
    --warning-soft: #fef3c7;
    --danger: #ef4444;
    --danger-soft: #fee2e2;
    --info: #0284c7;
    --info-soft: #e0f2fe;

    --card-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --card-shadow-hover:
        0 12px 24px -4px rgba(0, 0, 0, 0.08), 0 4px 8px -2px rgba(0, 0, 0, 0.04);
    --card-shadow-lg:
        0 20px 25px -5px rgba(0, 0, 0, 0.06),
        0 8px 10px -6px rgba(0, 0, 0, 0.04);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-full: 9999px;

    --font-heading:
        "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, sans-serif;
    --font-body:
        "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        sans-serif;
}

/* --- Base Reset & Typography --- */
body.portal-body {
    background-color: #f8fafc;
    color: var(--slate-700);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6,
.portal-heading {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--slate-900);
    line-height: 1.25;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.2s ease;
}
a:hover {
    color: var(--primary-dark);
    text-decoration: none;
}

/* --- Header & Navigation Bar --- */
.portal-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--slate-200);
    position: sticky;
    top: 0;
    z-index: 1050;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.portal-topbar {
    background: linear-gradient(90deg, #064e3b, #047857);
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.portal-topbar a {
    color: #fef08a;
    font-weight: 600;
}

.portal-topbar a:hover {
    color: #ffffff;
}

.portal-navbar {
    padding: 12px 0;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none !important;
}

.portal-brand img {
    height: 48px;
    width: auto;
    object-fit: contain;
}

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

.portal-brand-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 800;
    color: var(--slate-900);
    letter-spacing: -0.5px;
    line-height: 1.15;
}

.portal-brand-title span {
    color: var(--primary);
}

.portal-brand-sub {
    font-size: 11px;
    font-weight: 500;
    color: var(--slate-500);
    line-height: 1.2;
    letter-spacing: 0.2px;
}

.portal-nav {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 4px;
}

.portal-nav-item {
    position: relative;
}

.portal-nav-link {
    font-family: var(--font-heading);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--slate-600);
    padding: 8px 14px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.portal-nav-link:hover {
    color: var(--primary);
    background-color: var(--primary-soft);
}

.portal-nav-link.active {
    color: var(--primary-dark);
    background-color: var(--primary-100);
    font-weight: 700;
}

.btn-portal-login {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #ffffff !important;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: var(--radius-full);
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
}

.btn-portal-login:hover {
    background: linear-gradient(135deg, var(--primary-dark), #065f46);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35);
    transform: translateY(-1px);
}

/* Mobile Toggle */
.portal-menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    font-size: 18px;
    color: var(--slate-700);
    cursor: pointer;
}

/* --- Hero & Live Stats Strip --- */
.portal-hero-strip {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-bottom: 1px solid var(--slate-200);
    padding: 24px 0 20px;
}

.portal-hero-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.portal-hero-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--slate-900);
    letter-spacing: -0.5px;
    margin: 0;
}

.portal-hero-subtitle {
    font-size: 13px;
    color: var(--slate-500);
    margin: 4px 0 0;
}

.portal-live-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-full);
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--slate-700);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    position: relative;
}

.pulse-dot::after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-color: #10b981;
    border-radius: 50%;
    animation: pulse 1.6s infinite ease-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(3);
        opacity: 0;
    }
}

/* Stat Metric Cards */
.portal-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.portal-stat-card {
    background: #ffffff;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--card-shadow);
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.portal-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--primary-200);
}

.portal-stat-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.portal-stat-icon.green {
    background: var(--primary-soft);
    color: var(--primary);
}

.portal-stat-icon.blue {
    background: var(--info-soft);
    color: var(--info);
}

.portal-stat-icon.amber {
    background: var(--warning-soft);
    color: var(--warning);
}

.portal-stat-icon.red {
    background: var(--danger-soft);
    color: var(--danger);
}

.portal-stat-info {
    flex-grow: 1;
}

.portal-stat-label {
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--slate-400);
    margin-bottom: 2px;
}

.portal-stat-value {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 800;
    color: var(--slate-900);
    line-height: 1.1;
}

.portal-stat-desc {
    font-size: 11px;
    color: var(--slate-500);
    margin-top: 3px;
}

/* --- Main Dashboard Container --- */
.portal-main-section {
    padding: 24px 0 40px;
}

.portal-dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 430px;
    gap: 20px;
    align-items: start;
}

@media (max-width: 1200px) {
    .portal-dashboard-grid {
        grid-template-columns: 1fr 380px;
    }
}

@media (max-width: 991px) {
    .portal-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Card Container Modern */
.portal-card {
    background: #ffffff;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    margin-bottom: 20px;
    transition: all 0.25s ease;
}

.portal-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--slate-100);
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.portal-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--slate-900);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.portal-card-title i {
    color: var(--primary);
}

.portal-card-body {
    padding: 20px;
    position: relative;
}

/* Pill Tabs for Map Filters */
.portal-pill-tabs {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.portal-pill-btn {
    background: var(--slate-100);
    color: var(--slate-600);
    border: 1px solid transparent;
    padding: 6px 14px;
    font-family: var(--font-heading);
    font-size: 11.5px;
    font-weight: 600;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s ease;
}

.portal-pill-btn:hover {
    background: var(--slate-200);
    color: var(--slate-800);
}

.portal-pill-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary-dark);
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25);
}

/* Map Filter Toolbar */
.portal-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: var(--slate-50);
    border-bottom: 1px solid var(--slate-200);
    flex-wrap: wrap;
    gap: 12px;
}

.portal-filter-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.portal-select-wrapper {
    min-width: 200px;
}

.portal-select {
    width: 100%;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: 1px solid var(--slate-300);
    background-color: #ffffff;
    color: var(--slate-800);
    outline: none;
    transition: border-color 0.2s;
}

.portal-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
}

.portal-date-input {
    padding: 7px 12px;
    font-size: 13px;
    border-radius: var(--radius-md);
    border: 1px solid var(--slate-300);
    background-color: #ffffff;
    color: var(--slate-800);
    outline: none;
}

.portal-date-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
}

/* --- Interactive Map Presentation --- */
.portal-map-container {
    position: relative;
    background: radial-gradient(circle at 50% 50%, #f1f5f9 0%, #e2e8f0 100%);
    border-radius: var(--radius-md);
    overflow: hidden;
    min-height: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portal-map-svg {
    width: 100%;
    height: auto;
    max-height: 520px;
    display: block;
    cursor: grab;
    transition: transform 0.3s ease;
}

/* SVG Map Presentation - Restored Clean Visuals */
.portal-map-svg .btn_district {
    fill: #cbd5e1; /* ABU-ABU: Standar fallback untuk wilayah yang datanya kosong / null / belum terdeteksi */
    stroke: #ffffff;
    stroke-width: 1.5;
    stroke-linejoin: round;
    transition:
        fill 0.25s ease,
        stroke 0.25s ease;
    cursor: pointer;
}

.portal-map-svg .btn_district:hover {
    stroke: #0f172a;
    stroke-width: 2.5;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.portal-map-svg .btn_district.active-district {
    stroke: #0f172a;
    stroke-width: 2.5;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25));
}

/* Map Status Colors - Strictly 4 Categories (3 Valid + 1 Grey Fallback) */
.portal-map-svg .btn_district.l1 {
    fill: #34d399; /* 1. Hijau / Rendah / Turun */
}

.portal-map-svg .btn_district.l2 {
    fill: #fbbf24; /* 2. Kuning / Stabil / Sedang */
}

.portal-map-svg .btn_district.l3 {
    fill: #f87171; /* 3. Merah / Tinggi / Gejolak */
}

.portal-map-svg .btn_district.l0,
.portal-map-svg .btn_district.no-data {
    fill: #cbd5e1; /* 4. Abu-abu / Data Kosong / Null / Tidak Terdeteksi */
}

/* Background & Geography Element Protections */
.portal-map-svg #ocean {
    fill: #e2e8f0;
    opacity: 0.35;
    stroke: none;
    cursor: default;
}

.portal-map-svg #samosir {
    fill: #10b981;
    stroke: #ffffff;
    stroke-width: 1.5;
    cursor: default;
}

.portal-legend-badge.l0 {
    background: #cbd5e1;
}

/* Map Floating Controls */
.portal-map-controls {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 10;
}

.portal-map-btn {
    width: 34px;
    height: 34px;
    background: #ffffff;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--slate-700);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.portal-map-btn:hover {
    background: var(--slate-100);
    color: var(--slate-900);
}

/* Map Floating Legend */
.portal-map-legend {
    position: absolute;
    bottom: 16px;
    left: 16px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(8px);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    z-index: 10;
}

.portal-legend-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--slate-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.portal-legend-items {
    display: flex;
    align-items: center;
    gap: 12px;
}

.portal-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--slate-700);
}

.portal-legend-badge {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.portal-legend-badge.l1 {
    background-color: #34d399;
}
.portal-legend-badge.l2 {
    background-color: #fbbf24;
}
.portal-legend-badge.l3 {
    background-color: #f87171;
}

/* Map Tooltip Card (Modern Popover) */
.portal-map-tooltip {
    position: absolute;
    top: 20px;
    left: 20px;
    background: #ffffff;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    padding: 16px;
    min-width: 250px;
    max-width: 320px;
    box-shadow: var(--card-shadow-lg);
    z-index: 12;
    animation: fadeIn 0.2s ease;
    transition: all 0.2s ease;
}

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

.portal-tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--slate-100);
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.portal-tooltip-district {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    color: var(--slate-900);
    margin: 0;
}

.portal-tooltip-date {
    font-size: 11px;
    color: var(--slate-400);
}

.portal-tooltip-body {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.portal-tooltip-commodity {
    font-size: 12px;
    color: var(--slate-500);
    font-weight: 500;
}

.portal-tooltip-price {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 800;
    color: var(--slate-900);
}

.portal-tooltip-status {
    margin-bottom: 10px;
}

.portal-tooltip-action a {
    display: block;
    text-align: center;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    background: var(--primary-soft);
    color: var(--primary-dark);
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.portal-tooltip-action a:hover {
    background: var(--primary);
    color: #ffffff;
}

/* --- Trend Line Chart Card --- */
.portal-chart-card {
    background: #ffffff;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    padding: 20px;
    margin-top: 20px;
}

.portal-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.portal-chart-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--slate-900);
    margin: 0;
}

.portal-chart-subtitle {
    font-size: 12px;
    color: var(--slate-500);
    margin-top: 2px;
}

.portal-chart-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.portal-chart-price-display {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 800;
    color: var(--primary-dark);
}

.portal-chart-canvas-wrapper {
    position: relative;
    height: 180px;
    width: 100%;
}

/* --- Price Comparison Panel (Right Column) --- */
.portal-compare-panel {
    background: #ffffff;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    position: sticky;
    top: 80px;
}

.portal-compare-header {
    background: linear-gradient(135deg, #064e3b 0%, #047857 100%);
    color: #ffffff;
    padding: 18px 20px;
}

.portal-compare-title {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    letter-spacing: -0.2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.portal-compare-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
    margin: 4px 0 0;
}

.portal-compare-body {
    padding: 18px;
}

/* Compare Filter Controls */
.compare-selector-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.compare-input-group label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--slate-500);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.compare-input-group select,
.compare-input-group input {
    width: 100%;
    padding: 7px 10px;
    font-size: 12.5px;
    border-radius: var(--radius-md);
    border: 1px solid var(--slate-300);
    background: #ffffff;
    color: var(--slate-800);
    outline: none;
}

.compare-input-group select:focus,
.compare-input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
}

.btn-compare-run {
    width: 100%;
    padding: 8px 16px;
    background: var(--primary);
    color: #ffffff;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 16px;
}

.btn-compare-run:hover {
    background: var(--primary-dark);
}

/* Compare Search Box */
.compare-search-box {
    margin-bottom: 12px;
    position: relative;
}

.compare-search-box input {
    width: 100%;
    padding: 6px 12px 6px 30px;
    font-size: 12px;
    border-radius: var(--radius-full);
    border: 1px solid var(--slate-200);
    background-color: var(--slate-50);
    outline: none;
}

.compare-search-box input:focus {
    background-color: #ffffff;
    border-color: var(--primary);
}

.compare-search-box i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: var(--slate-400);
}

/* Compare Table Styling */
.compare-table-wrapper {
    max-height: 480px;
    overflow-y: auto;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.compare-table th {
    background: var(--slate-100);
    color: var(--slate-700);
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--slate-200);
    position: sticky;
    top: 0;
    z-index: 5;
}

.compare-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--slate-100);
    color: var(--slate-700);
    vertical-align: middle;
}

.compare-table tbody tr:hover {
    background-color: var(--primary-soft);
}

.commodity-name-cell {
    font-weight: 600;
    color: var(--slate-900);
}

.commodity-unit-badge {
    font-size: 10px;
    color: var(--slate-400);
    display: block;
}

.price-cell {
    font-family: var(--font-heading);
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
}

.change-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.change-badge.up {
    background: var(--danger-soft);
    color: var(--danger);
}

.change-badge.down {
    background: var(--success-soft);
    color: var(--primary-dark);
}

.change-badge.equal {
    background: var(--slate-100);
    color: var(--slate-500);
}

/* Compare Footnote */
.compare-footnote {
    font-size: 11px;
    color: var(--slate-400);
    margin-top: 10px;
    line-height: 1.4;
}

/* --- Strategic Commodity Grid Section --- */
.portal-commodities-section {
    padding: 30px 0;
    border-top: 1px solid var(--slate-200);
}

.portal-section-header {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 12px;
}

.portal-section-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--slate-900);
    margin: 0;
}

.portal-section-subtitle {
    font-size: 13px;
    color: var(--slate-500);
    margin: 3px 0 0;
}

.portal-commodities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.portal-commodity-card {
    background: #ffffff;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--card-shadow);
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.portal-commodity-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--primary-light);
}

.commodity-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.commodity-card-title {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    color: var(--slate-900);
    margin: 0;
    line-height: 1.25;
}

.commodity-card-unit {
    font-size: 11px;
    color: var(--slate-400);
}

.commodity-card-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.commodity-card-bottom {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid var(--slate-100);
}

.commodity-card-price {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 800;
    color: var(--slate-900);
}

/* --- Press Release & News Section --- */
.portal-news-section {
    padding: 30px 0 50px;
    background: #ffffff;
    border-top: 1px solid var(--slate-200);
}

.portal-news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 991px) {
    .portal-news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .portal-news-grid {
        grid-template-columns: 1fr;
    }
}

.portal-news-card {
    background: #ffffff;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
}

.portal-news-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--slate-300);
}

.portal-news-img-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    background: var(--slate-100);
    overflow: hidden;
}

.portal-news-img-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.portal-news-card:hover .portal-news-img-wrap img {
    transform: scale(1.04);
}

.portal-news-content {
    padding: 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.portal-news-date {
    font-size: 11px;
    color: var(--slate-400);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.portal-news-title {
    font-family: var(--font-heading);
    font-size: 14.5px;
    font-weight: 700;
    color: var(--slate-900);
    margin: 0 0 8px;
    line-height: 1.35;
    flex-grow: 1;
}

.portal-news-link {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
}

/* --- Government Official Footer --- */
.portal-footer {
    background: linear-gradient(135deg, #064e3b 0%, #022c22 100%);
    color: rgba(255, 255, 255, 0.85);
    padding: 50px 0 24px;
    border-top: 4px solid var(--primary-light);
}

.portal-footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 30px;
    margin-bottom: 40px;
}

@media (max-width: 991px) {
    .portal-footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 576px) {
    .portal-footer-grid {
        grid-template-columns: 1fr;
    }
}

.footer-brand-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
    margin: 12px 0 6px;
}

.footer-brand-desc {
    font-size: 12.5px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 14px;
}

.footer-gov-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    color: #ffffff;
}

.footer-col-title {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    position: relative;
    padding-bottom: 8px;
}

.footer-col-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 32px;
    height: 2px;
    background: var(--primary-light);
    border-radius: var(--radius-full);
}

.footer-links-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-links-list li {
    margin-bottom: 9px;
}

.footer-links-list a {
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    transition: all 0.2s;
}

.footer-links-list a:hover {
    color: #ffffff;
    padding-left: 4px;
}

.footer-contact-list {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 13px;
}

.footer-contact-list li {
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.footer-contact-list i {
    color: #fde047;
    margin-top: 3px;
}

.portal-footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

/* --- Responsive Adjustments --- */
@media (max-width: 991px) {
    .portal-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #ffffff;
        border-bottom: 1px solid var(--slate-200);
        padding: 16px;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    }

    .portal-nav.show {
        display: flex;
    }

    .portal-menu-toggle {
        display: block;
    }

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

@media (max-width: 576px) {
    .portal-stat-grid {
        grid-template-columns: 1fr;
    }

    .portal-brand-title {
        font-size: 15px;
    }

    .portal-brand-sub {
        font-size: 10px;
    }

    .portal-map-legend {
        position: static;
        margin: 12px;
    }

    .portal-map-tooltip {
        position: static;
        margin: 12px;
        width: calc(100% - 24px);
        max-width: 100%;
    }
}

/* ==========================================================================
   PORTAL CONTAINER & CONTENT WRAPPER
   ========================================================================== */
.portal-container {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .portal-container {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* ==========================================================================
   PORTAL BREADCRUMB & SUBPAGE HEADERS
   ========================================================================== */
.portal-breadcrumb-section {
    background: linear-gradient(
        135deg,
        rgba(15, 23, 42, 0.03) 0%,
        rgba(5, 150, 105, 0.05) 100%
    );
    border-bottom: 1px solid var(--border-light);
    padding: 24px 0 20px;
    margin-bottom: 32px;
}

.portal-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.portal-breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.portal-breadcrumb a:hover {
    color: var(--primary);
}

.portal-breadcrumb .separator {
    color: var(--text-muted);
    font-size: 11px;
}

.portal-breadcrumb .active {
    color: var(--primary);
    font-weight: 600;
}

.portal-subpage-title {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 800;
    color: var(--navy-900);
    letter-spacing: -0.02em;
    margin: 0 0 6px;
}

.portal-subpage-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

/* ==========================================================================
   ARTICLE & PUBLICATION DETAIL
   ========================================================================== */
.portal-article-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    padding: 36px 40px;
    margin-bottom: 32px;
}

.portal-article-title {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 800;
    color: var(--navy-900);
    line-height: 1.35;
    letter-spacing: -0.02em;
    margin: 0 0 16px;
}

.portal-article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 20px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-light);
}

.portal-article-meta-left {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.portal-article-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(5, 150, 105, 0.1);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 12px;
}

.portal-article-featured {
    width: 100%;
    margin-bottom: 28px;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.portal-article-featured img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    max-height: 520px;
}

.portal-article-body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.8;
    color: var(--navy-800);
    margin-bottom: 32px;
}

.portal-article-body p {
    margin-bottom: 18px;
}

.portal-article-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: 16px 0;
}

.portal-article-body blockquote {
    border-left: 4px solid var(--primary);
    padding: 12px 20px;
    margin: 20px 0;
    background: #f8fafc;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-style: italic;
    color: var(--navy-800);
}

.portal-share-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

.portal-share-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--navy-800);
}

.portal-share-buttons {
    display: flex;
    gap: 8px;
}

.portal-share-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 14px;
    text-decoration: none;
    transition:
        transform 0.2s,
        opacity 0.2s;
}

.portal-share-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
    color: #ffffff;
}

.portal-share-btn.wa {
    background: #25d366;
}
.portal-share-btn.fb {
    background: #1877f2;
}
.portal-share-btn.tw {
    background: #1da1f2;
}
.portal-share-btn.copy {
    background: #64748b;
}

/* ==========================================================================
   SIDEBAR & WIDGETS
   ========================================================================== */
.portal-sidebar-widget {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 24px;
}

.portal-sidebar-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--navy-900);
    padding-bottom: 12px;
    margin: 0 0 16px;
    border-bottom: 2px solid var(--primary-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.portal-sidebar-news {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px dashed var(--border-light);
    text-decoration: none;
    transition: background-color 0.2s;
}

.portal-sidebar-news:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.portal-sidebar-news-thumb {
    width: 72px;
    height: 60px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}

.portal-sidebar-news-content {
    flex: 1;
    min-width: 0;
}

.portal-sidebar-news-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--navy-900);
    line-height: 1.4;
    margin: 0 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.portal-sidebar-news:hover .portal-sidebar-news-title {
    color: var(--primary);
}

.portal-sidebar-news-date {
    font-size: 11px;
    color: var(--text-muted);
}

.portal-cat-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.portal-cat-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: var(--radius-md);
    color: var(--navy-800);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.portal-cat-link:hover {
    background: rgba(5, 150, 105, 0.08);
    color: var(--primary);
    transform: translateX(4px);
}

/* ==========================================================================
   NEWS ARCHIVE & GRID
   ========================================================================== */
.portal-news-headline-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 28px;
    transition:
        transform 0.25s,
        box-shadow 0.25s;
}

.portal-news-headline-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.portal-news-headline-img {
    width: 100%;
    max-height: 360px;
    object-fit: cover;
    display: block;
}

.portal-news-headline-body {
    padding: 24px 28px;
}

.portal-news-headline-title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    color: var(--navy-900);
    margin: 0 0 10px;
    line-height: 1.4;
}

.portal-news-item-card {
    display: flex;
    gap: 20px;
    background: #ffffff;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    padding: 16px;
    margin-bottom: 16px;
    transition: all 0.25s;
    text-decoration: none;
}

.portal-news-item-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.portal-news-item-thumb {
    width: 180px;
    height: 120px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
}

.portal-news-item-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.portal-news-item-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--navy-900);
    margin: 0 0 8px;
    line-height: 1.4;
    transition: color 0.2s;
}

.portal-news-item-card:hover .portal-news-item-title {
    color: var(--primary);
}

.portal-news-item-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ==========================================================================
   CONTACT PAGE STYLES
   ========================================================================== */
.portal-contact-info-card {
    background: linear-gradient(135deg, var(--navy-900) 0%, #1e293b 100%);
    border-radius: var(--radius-lg);
    color: #ffffff;
    padding: 36px 32px;
    height: 100%;
    box-shadow: var(--shadow-lg);
}

.portal-contact-info-title {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 12px;
}

.portal-contact-info-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin-bottom: 28px;
}

.portal-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.portal-contact-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: rgba(5, 150, 105, 0.2);
    border: 1px solid rgba(52, 211, 153, 0.3);
    color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.portal-contact-item-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.5);
    margin: 0 0 4px;
}

.portal-contact-item-val {
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
    line-height: 1.5;
    margin: 0;
}

.portal-contact-form-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
    padding: 36px 40px;
}

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

.portal-form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--navy-800);
    margin-bottom: 6px;
}

.portal-form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--navy-900);
    background: #ffffff;
    transition: all 0.2s;
    font-family: inherit;
}

.portal-form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

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

/* ==========================================================================
   STATISTIK & PROFILE DAERAH
   ========================================================================== */
.portal-profile-stat-box {
    background: #ffffff;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    margin-bottom: 16px;
    transition: transform 0.2s;
}

.portal-profile-stat-box:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.portal-profile-stat-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.portal-profile-stat-val {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 800;
    color: var(--navy-900);
    margin: 0;
}

/* ==========================================================================
   COMPARISON MODE TOGGLE
   ========================================================================== */
.portal-compare-mode-toggle {
    display: flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: var(--radius-md);
    gap: 4px;
    margin-bottom: 16px;
}

.portal-mode-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--slate-600);
    border-radius: calc(var(--radius-md) - 2px);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.portal-mode-btn:hover {
    color: var(--primary-dark);
}

.portal-mode-btn.active {
    background: #ffffff;
    color: var(--primary-dark);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   SIARAN PERS CAROUSEL
   ========================================================================== */
.portal-pr-carousel-wrapper {
    position: relative;
    overflow: hidden;
    padding: 10px 0 20px;
}

.portal-pr-track {
    display: flex;
    transition: transform 0.4s ease;
    gap: 24px;
}

.portal-pr-slide {
    flex: 0 0 calc(33.333% - 16px);
    min-width: calc(33.333% - 16px);
    box-sizing: border-box;
}

@media (max-width: 992px) {
    .portal-pr-slide {
        flex: 0 0 calc(50% - 12px);
        min-width: calc(50% - 12px);
    }
}

@media (max-width: 576px) {
    .portal-pr-slide {
        flex: 0 0 100%;
        min-width: 100%;
    }
}

.portal-pr-card {
    background: #ffffff;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: all 0.25s ease;
}

.portal-pr-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -6px rgba(15, 23, 42, 0.12);
}

.portal-pr-img-wrap {
    height: 220px;
    background: #f8fafc;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid var(--border-light);
}

.portal-pr-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.portal-pr-card:hover .portal-pr-img-wrap img {
    transform: scale(1.05);
}

.portal-pr-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.portal-pr-date {
    font-size: 12px;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.portal-pr-title {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    color: var(--slate-900);
    margin: 0 0 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.portal-pr-link {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

.portal-pr-link:hover {
    color: var(--primary-dark);
}

.portal-pr-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

.portal-pr-arrow {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid var(--slate-200);
    color: var(--slate-700);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}

.portal-pr-arrow:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.portal-pr-dots {
    display: flex;
    gap: 6px;
    align-items: center;
}

.portal-pr-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cbd5e1;
    cursor: pointer;
    transition: all 0.2s;
}

.portal-pr-dot.active {
    width: 24px;
    border-radius: 4px;
    background: var(--primary);
}

/* ==========================================================================
   FLOATING HOVER TOOLTIP (MAP DISTRICTS)
   ========================================================================== */
.portal-map-hover-tooltip {
    position: absolute;
    z-index: 30;
    pointer-events: none;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    color: #ffffff;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.35), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
    min-width: 210px;
    max-width: 280px;
    font-size: 12px;
    line-height: 1.35;
    transition: opacity 0.15s ease;
}

.portal-map-hover-tooltip .hover-tooltip-title {
    font-family: var(--font-heading);
    font-size: 13.5px;
    font-weight: 700;
    color: #38bdf8;
    margin-bottom: 6px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    gap: 6px;
}

.portal-map-hover-tooltip .hover-tooltip-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 3px;
}

.portal-map-hover-tooltip .hover-tooltip-row:last-child {
    margin-bottom: 0;
}

.portal-map-hover-tooltip .hover-label {
    color: #94a3b8;
    font-size: 11px;
    font-weight: 500;
}

.portal-map-hover-tooltip .hover-value {
    color: #f1f5f9;
    font-weight: 600;
    font-size: 12px;
    text-align: right;
}

.portal-map-hover-tooltip .hover-value.price {
    font-family: var(--font-heading);
    font-size: 13.5px;
    font-weight: 800;
    color: #34d399;
}

.portal-map-hover-tooltip .hover-value.price.no-data {
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 500;
    font-style: italic;
}

.portal-map-hover-tooltip .hover-value.date {
    color: #cbd5e1;
    font-size: 11px;
}

/* ==========================================================================
   TARGETED MOBILE OPTIMIZATIONS (TABLET & SMARTPHONE)
   Preserves 100% of desktop/tablet layout while refining <= 768px & <= 576px
   ========================================================================== */

/* Tablet & Mobile Map Controls Refinement (<= 768px) */
@media (max-width: 768px) {
    .portal-hero-strip {
        padding: 16px 0 14px;
    }
    .portal-stat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .portal-compare-panel {
        position: static;
        margin-top: 20px;
    }
}

/* Smartphone Strict Refinements (<= 576px: 320px - 430px) */
@media (max-width: 576px) {
    /* 1. Stat Metric Cards */
    .portal-stat-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .portal-stat-card {
        padding: 12px 14px;
    }
    .portal-stat-icon {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
    .portal-stat-value {
        font-size: 17px;
    }

    /* 2. Map Card Filter Toolbar */
    .portal-filter-bar {
        padding: 10px 12px;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .portal-filter-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        width: 100%;
    }
    .portal-filter-controls > div {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .portal-filter-controls > div label {
        min-width: 68px;
        font-size: 12px;
        flex-shrink: 0;
    }
    .portal-select-wrapper {
        min-width: 0;
        flex: 1;
    }
    .portal-select {
        font-size: 12px;
        padding: 6px 10px;
    }
    .portal-date-input {
        flex: 1;
        width: 100%;
        font-size: 12px;
        padding: 6px 10px;
    }

    /* 3. Interactive Map Container & Overlays */
    .portal-map-container {
        min-height: 370px;
        height: 370px;
    }
    .portal-map-svg {
        max-height: 350px;
    }
    .portal-map-controls {
        top: 10px;
        right: 10px;
        gap: 4px;
    }
    .portal-map-btn {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    .portal-map-tooltip {
        top: 10px;
        left: 10px;
        right: 50px;
        max-width: calc(100% - 58px);
        min-width: 0;
        padding: 10px 12px;
        border-radius: var(--radius-md);
    }
    .portal-tooltip-header {
        padding-bottom: 6px;
        margin-bottom: 6px;
    }
    .portal-tooltip-district {
        font-size: 13px;
    }
    .portal-tooltip-date {
        font-size: 10px;
    }
    .portal-tooltip-body {
        margin-bottom: 4px;
    }
    .portal-tooltip-price {
        font-size: 15px;
    }
    .portal-tooltip-commodity {
        font-size: 11px;
    }
    .portal-tooltip-action a {
        padding: 4px 8px;
        font-size: 11px;
    }
    .portal-map-legend {
        bottom: 8px;
        left: 8px;
        right: 8px;
        padding: 6px 10px;
    }
    .portal-legend-title {
        font-size: 10px;
        margin-bottom: 3px;
    }
    .portal-legend-items {
        flex-wrap: wrap;
        gap: 4px 8px;
    }
    .portal-legend-item {
        font-size: 10px;
        gap: 4px;
    }

    /* 4. Price Trend Line Chart Card */
    .portal-chart-card {
        padding: 14px;
        margin-top: 16px;
    }
    .portal-chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 12px;
    }
    .portal-chart-title {
        font-size: 14px;
    }
    .portal-chart-subtitle {
        font-size: 11px;
    }
    .portal-chart-meta {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-top: 1px dashed var(--slate-200);
        padding-top: 8px;
        margin-top: 4px;
    }
    .portal-chart-price-display {
        font-size: 16px;
    }
    .portal-chart-canvas-wrapper {
        height: 180px;
    }

    /* 5. Price Comparison Panel */
    .portal-compare-header {
        padding: 14px 16px;
    }
    .portal-compare-title {
        font-size: 14px;
    }
    .portal-compare-subtitle {
        font-size: 11px;
    }
    .portal-compare-body {
        padding: 14px;
    }
    .portal-compare-mode-toggle {
        margin-bottom: 12px;
    }
    .portal-mode-btn {
        font-size: 11.5px;
        padding: 7px 8px;
    }
    .compare-selector-grid {
        grid-template-columns: 1fr;
        gap: 8px;
        margin-bottom: 10px;
    }
    .compare-input-group label {
        font-size: 10.5px;
    }
    .compare-input-group select,
    .compare-input-group input {
        font-size: 12px;
        padding: 6px 10px;
    }
    .btn-compare-run {
        font-size: 12px;
        padding: 8px 12px;
        margin-bottom: 12px;
    }
    .compare-table-wrapper {
        max-height: 420px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .compare-table {
        min-width: 320px;
        font-size: 11.5px;
    }
    .compare-table th {
        font-size: 10px;
        padding: 6px 8px;
    }
    .compare-table td {
        padding: 6px 8px;
    }

    /* 6. Siaran Pers Ketahanan Pangan Carousel */
    .portal-pr-track {
        gap: 16px;
    }
    .portal-pr-slide {
        flex: 0 0 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        user-select: none;
        -webkit-user-select: none;
    }
    .portal-pr-card {
        border-radius: var(--radius-md);
    }
    .portal-pr-img-wrap {
        height: 180px;
    }
    .portal-pr-img-wrap img {
        -webkit-user-drag: none;
        user-drag: none;
    }
    .portal-pr-body {
        padding: 14px;
    }
    .portal-pr-title {
        font-size: 13.5px;
        margin-bottom: 8px;
    }
    .portal-pr-link {
        font-size: 12px;
    }
    .portal-pr-controls {
        margin-top: 14px;
        gap: 10px;
    }
    .portal-pr-arrow {
        width: 34px;
        height: 34px;
        font-size: 12px;
    }
}
