/* ===================================================
   EKSPOR IMPOR DASHBOARD V2 — White + Soft Pastel
   Clean, Modern, Government Enterprise UI
   Inspired by konsumsi_dashboard.css (kim-* system)
   =================================================== */

body::before, body::after {
    display: none !important;
    content: none !important;
}

/* ------ Page Background ------ */
.exim-page-bg {
    background: linear-gradient(150deg, #f8fafc 0%, #f1f5f9 60%, #f0fdf9 100%);
    min-height: 100vh;
}

/* ------ Page Title Row ------ */
.exim-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.exim-page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.01em;
    line-height: 1.3;
}
.exim-page-sub {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 2px;
}

/* ------ Reset Button ------ */
.exim-reset-btn {
    font-size: 0.78rem;
    font-weight: 600;
    color: #0f766e;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 6px 16px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: all 0.15s;
    white-space: nowrap;
}
.exim-reset-btn:hover {
    background: #f0fdf4;
    color: #065f46;
    border-color: #6ee7b7;
    box-shadow: 0 2px 6px rgba(16,185,129,0.14);
}

/* ------ Glass / Base Card ------ */
.exim-glass-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(15,23,42,0.03), 0 4px 14px rgba(15,23,42,0.03);
    transition: box-shadow 0.2s;
    animation: eximFadeUp 0.4s ease both;
}
.exim-glass-card:hover {
    box-shadow: 0 4px 18px rgba(15,23,42,0.07);
}

/* ------ Section Label ------ */
.exim-section-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.exim-field-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 5px;
}

/* ------ Select ------ */
.exim-select {
    width: 100%;
    font-size: 0.8rem;
    color: #1e293b;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 7px 30px 7px 10px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 13px;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
    cursor: pointer;
}
.exim-select:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16,185,129,0.14);
}
.exim-select:hover { border-color: #94a3b8; }

/* =============================================
   KPI CARDS — White with Soft Pastel Gradient
   ============================================= */
.exim-kpi-card {
    border-radius: 13px;
    padding: 15px 18px 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 110px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 4px rgba(15,23,42,0.04), 0 4px 12px rgba(15,23,42,0.02);
    transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
    animation: eximFadeUp 0.4s ease both;
    position: relative;
    overflow: hidden;
}
.exim-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15,23,42,0.08);
}
.exim-kpi-card:nth-child(1) { animation-delay: 0.05s; }
.exim-kpi-card:nth-child(2) { animation-delay: 0.10s; }
.exim-kpi-card:nth-child(3) { animation-delay: 0.15s; }
.exim-kpi-card:nth-child(4) { animation-delay: 0.20s; }
.exim-kpi-card:nth-child(5) { animation-delay: 0.25s; }

/* Top accent line */
.exim-kpi-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
}

/* Green — Ekspor Nilai */
.exim-kpi-green {
    background: linear-gradient(135deg, #ffffff 60%, #f0fdf4 100%);
    border-color: #bbf7d0;
}
.exim-kpi-green::before { background: linear-gradient(90deg, #10b981, #34d399); }
.exim-kpi-green:hover { border-color: #86efac; }

/* Amber — Impor Nilai */
.exim-kpi-amber {
    background: linear-gradient(135deg, #ffffff 60%, #fffbeb 100%);
    border-color: #fde68a;
}
.exim-kpi-amber::before { background: linear-gradient(90deg, #f59e0b, #fcd34d); }
.exim-kpi-amber:hover { border-color: #fcd34d; }

/* Cyan — Volume Ekspor */
.exim-kpi-cyan {
    background: linear-gradient(135deg, #ffffff 60%, #ecfeff 100%);
    border-color: #a5f3fc;
}
.exim-kpi-cyan::before { background: linear-gradient(90deg, #06b6d4, #67e8f9); }
.exim-kpi-cyan:hover { border-color: #67e8f9; }

/* Purple — Volume Impor */
.exim-kpi-purple {
    background: linear-gradient(135deg, #ffffff 60%, #faf5ff 100%);
    border-color: #e9d5ff;
}
.exim-kpi-purple::before { background: linear-gradient(90deg, #8b5cf6, #c4b5fd); }
.exim-kpi-purple:hover { border-color: #d8b4fe; }

/* Indigo — Neraca / Balance */
.exim-kpi-indigo {
    background: linear-gradient(135deg, #ffffff 60%, #eef2ff 100%);
    border-color: #c7d2fe;
}
.exim-kpi-indigo::before { background: linear-gradient(90deg, #4f46e5, #818cf8); }
.exim-kpi-indigo:hover { border-color: #a5b4fc; }

/* KPI Typography */
.exim-kpi-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    line-height: 1.3;
}
.exim-kpi-value {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: #0f172a;
    margin: 4px 0;
}
.exim-kpi-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    flex-wrap: wrap;
}
.exim-kpi-unit {
    font-size: 0.68rem;
    font-weight: 500;
    color: #94a3b8;
}

/* ------ YoY Badge ------ */
.exim-yoy-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
}
.exim-yoy-badge.positive { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.exim-yoy-badge.negative { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.exim-yoy-badge.neutral  { background: #f8fafc; color: #64748b; border: 1px solid #e2e8f0; }

/* =============================================
   CHART & TABLE CONTAINERS
   ============================================= */
.exim-chart-wrap {
    display: flex;
    flex-direction: column;
}

/* Chart Header */
.exim-chart-header {
    height: 54px;
    padding: 0 18px;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.exim-chart-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.exim-chart-header-left .exim-section-label {
    font-size: 0.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #0f172a 0%, #065f46 70%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.exim-chart-header-left .exim-section-label::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 13px;
    border-radius: 4px;
    background: #10b981;
    flex-shrink: 0;
}
.exim-chart-sub {
    font-size: 0.68rem;
    color: #64748b;
    font-weight: 600;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 2px 9px;
    border-radius: 20px;
}

/* Chart Body */
.exim-chart-body {
    flex: 1;
    padding: 14px 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ------ Tall Chart (timeseries) ------ */
.exim-chart-tall {
    height: 460px;
}
/* ------ Half Chart (tables) ------ */
.exim-chart-half {
    height: 480px;
}

/* =============================================
   TOGGLE BUTTONS (Ekspor / Impor)
   ============================================= */
.exim-toggle-group {
    display: flex;
    gap: 4px;
    align-items: center;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 3px;
}
.exim-toggle-btn {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.exim-toggle-btn:hover {
    color: #334155;
    background: #e2e8f0;
}
.exim-toggle-btn.active-ekspor {
    background: #dcfce7;
    color: #065f46;
    border: 1px solid #bbf7d0;
}
.exim-toggle-btn.active-impor {
    background: #fef3c7;
    color: #78350f;
    border: 1px solid #fde68a;
}

/* =============================================
   TABLE
   ============================================= */
.exim-table-wrap {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
}
.exim-table-wrap::-webkit-scrollbar { width: 4px; height: 4px; }
.exim-table-wrap::-webkit-scrollbar-track { background: transparent; }
.exim-table-wrap::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
.exim-table-wrap::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.exim-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.8rem;
}
.exim-table thead {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #f8fafc;
}
.exim-table thead th {
    height: 44px;
    padding: 6px 12px;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #334155;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    vertical-align: middle !important;
    white-space: nowrap;
}
.exim-th-sub {
    display: block;
    font-size: 0.58rem;
    font-weight: 500;
    color: #94a3b8;
    text-transform: none;
    letter-spacing: 0;
    line-height: 1;
    margin-top: 1px;
}
.exim-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.12s;
}
.exim-table tbody tr:hover { background: #f8fafc; }
.exim-table tbody td {
    height: 42px;
    padding: 6px 12px;
    color: #1e293b;
    vertical-align: middle !important;
    font-size: 0.78rem;
    border-bottom: 1px solid #f1f5f9;
}

/* Rank Badge */
.exim-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px; height: 22px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 800;
    background: #f1f5f9;
    color: #475569;
}
.exim-rank.r1 { background: #fef3c7; color: #78350f; border: 1px solid #fde68a; }
.exim-rank.r2 { background: #f1f5f9; color: #334155; border: 1px solid #cbd5e1; }
.exim-rank.r3 { background: #fed7aa; color: #7c2d12; border: 1px solid #fdba74; }

/* Bar inline */
.exim-bar-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}
.exim-bar-bg {
    flex: 1;
    height: 5px;
    border-radius: 99px;
    background: #f1f5f9;
    overflow: hidden;
    min-width: 40px;
}
.exim-bar-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.6s ease;
}
.exim-bar-fill.fill-green { background: linear-gradient(90deg, #10b981, #34d399); }
.exim-bar-fill.fill-amber { background: linear-gradient(90deg, #f59e0b, #fcd34d); }

/* =============================================
   PERIOD RANGE FILTER
   ============================================= */
/* ------ Quick Year Chips ------ */
.exim-year-chip {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 11px;
    border-radius: 9999px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.15s ease;
    outline: none;
    white-space: nowrap;
}
.exim-year-chip:hover {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #cbd5e1;
}
.exim-year-chip.active {
    background: #059669;
    color: #ffffff;
    border-color: #059669;
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25);
}

.exim-subfield-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 4px;
}

.exim-select-sm {
    padding: 6px 26px 6px 9px;
    font-size: 0.78rem;
    border-radius: 7px;
    background-color: #ffffff;
}

.exim-period-box {
    border-radius: 11px;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.exim-period-box:hover {
    border-color: #cbd5e1;
    background: #ffffff;
}
.exim-period-dari {
    border-left: 3.5px solid #10b981;
}
.exim-period-sampai {
    border-left: 3.5px solid #f59e0b;
}
.exim-period-label {
    font-size: 0.74rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}
.exim-period-dari .exim-period-label { color: #065f46; }
.exim-period-sampai .exim-period-label { color: #92400e; }
.exim-period-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.exim-period-dari .exim-period-dot { background: #10b981; }
.exim-period-sampai .exim-period-dot { background: #f59e0b; }

/* =============================================
   NERACA INDICATOR
   ============================================= */
.exim-neraca-positive {
    color: #059669;
    font-weight: 800;
}
.exim-neraca-negative {
    color: #dc2626;
    font-weight: 800;
}

/* ------ Animations ------ */
@keyframes eximFadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position:  200% 0; }
}
.shimmer-loading {
    background: linear-gradient(90deg, #f0f4f8 25%, #e8edf2 50%, #f0f4f8 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

/* ------ Responsive ------ */
@media (max-width: 768px) {
    .exim-page-title { font-size: 1.05rem; }
    .exim-kpi-value  { font-size: 1.1rem; }
    .exim-kpi-card   { padding: 12px 13px; }
    .exim-chart-tall { height: 380px; }
    .exim-chart-half { height: 400px; }
    .exim-chart-header { height: auto; padding: 10px 14px; flex-direction: column; align-items: flex-start; gap: 8px; }
}
@media (max-width: 480px) {
    .exim-kpi-value { font-size: 0.95rem; }
    .exim-title-row { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ===== Tren Chart Controls (ported from detail-negara.css) ===== */
.tv-time-btn {
    background: transparent;
    border: none;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}
.tv-time-btn:hover { color: #0f172a; background: #e2e8f0; }
.tv-time-btn.active { color: #0f172a; background: #e2e8f0; }

.tv-chart-btn {
    border: none;
    background: transparent;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 14px;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s;
}
.tv-chart-btn:hover { color: #0f172a; }
.tv-chart-btn.active { background: white; color: #0f172a; box-shadow: 0 1px 4px rgba(0,0,0,0.1); }
