/* =====================================================
   EXECUTIVE DASHBOARD — SHARED STYLES
===================================================== */

/* ---------- PAGE HEADER ---------- */

.page-icon-badge {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    background: linear-gradient(135deg, #0F766E 0%, #14B8A6 100%);
    box-shadow: 0 10px 22px rgba(15, 118, 110, .28);
    flex-shrink: 0;
}

.page-title {
    font-weight: 800;
    letter-spacing: -.4px;
    color: var(--text-main, #0f172a);
    font-size: 1.45rem;
}

.page-subtitle {
    color: var(--text-muted, #64748b);
    font-size: .88rem;
}

/* =====================================================
   SYSTEM STATUS CHIP (HEADER)
===================================================== */

.meta-status {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: .65rem 1.1rem;
    border-radius: 14px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .05);
    text-align: center;
    min-width: 240px;
}

.meta-status>div {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex: 1;
}

.meta-status #dashboardSystemStatusText {
    line-height: 1.2;
}

.meta-status #dashboardSystemStatusDetail {
    line-height: 1.2;
}

body.dark-mode .meta-status {
    background: #1E293B;
    border-color: #334155;
}

@media (max-width: 575.98px) {
    .meta-status {
        min-width: 0;
        width: 100%;
    }
}

/* ---------- KPI CARD ---------- */

.kpi-card {
    border: 1px solid rgba(226, 232, 240, .9);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 18px rgba(15, 23, 42, .05);
    transition: all .25s ease;
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.kpi-card.accent-success::before {
    background: #16A34A;
}

.kpi-card.accent-primary::before {
    background: #6366F1;
}

.kpi-card.accent-danger::before {
    background: #DC2626;
}

.kpi-card.accent-warning::before {
    background: #F59E0B;
}

.kpi-card.accent-info::before {
    background: #0EA5E9;
}

.kpi-card.accent-secondary::before {
    background: #64748B;
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 32px rgba(15, 23, 42, .10);
}

.kpi-label {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: #94A3B8;
}

.kpi-value {
    font-weight: 800;
    font-size: 1.6rem;
    letter-spacing: -.5px;
    color: #0f172a;
}

.kpi-hint {
    font-size: .74rem;
    color: #94A3B8;
    font-weight: 500;
}

.kpi-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

/* ---------- CARD / SECTION ---------- */

.card {
    border: 1px solid rgba(226, 232, 240, .9);
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 18px rgba(15, 23, 42, .05);
}

.section-card-header {
    background: #F8FAFC;
    border-bottom: 1px solid #E2E8F0;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.section-card-header h5 {
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -.3px;
    margin: 0;
}

/* ---------- BUTTON GRADIENT ---------- */

.btn-gradient {
    background: linear-gradient(135deg, #0F766E 0%, #14B8A6 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: .85rem;
    padding: .55rem 1.05rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    box-shadow: 0 8px 20px rgba(15, 118, 110, .28);
    transition: all .2s ease;
}

.btn-gradient:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(15, 118, 110, .35);
}

.btn-gradient:disabled {
    opacity: .7;
    transform: none;
}

/* ---------- CHART LOADING ---------- */

.chart-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .85);
    z-index: 2;
}

body.dark-mode .chart-loading {
    background: rgba(30, 41, 59, .85);
}

/* ---------- MINI KPI ---------- */

.dashboard-mini-kpi {
    padding: .75rem;
    border-radius: 12px;
}

/* ---------- AI MODULE ---------- */

.dashboard-ai-module {
    padding: .75rem .9rem;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    background: #F8FAFC;
    transition: all .2s ease;
}

.dashboard-ai-module:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, .06);
}

/* ---------- RECOMMENDATION ITEM ---------- */

.recommendation-item {
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    padding: 1rem 1.1rem;
    background: #F8FAFC;
    transition: all .2s ease;
}

.recommendation-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, .06);
}

.recommendation-item.border-danger {
    border-left: 4px solid #DC2626;
}

.recommendation-item.border-warning {
    border-left: 4px solid #F59E0B;
}

.recommendation-item.border-primary {
    border-left: 4px solid #2563EB;
}

.recommendation-item.border-success {
    border-left: 4px solid #16A34A;
}

/* ---------- SYSTEM INFO CARD ---------- */

.system-info-card {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: .85rem 1rem;
    height: 100%;
    transition: all .2s ease;
}

.system-info-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, .06);
}

/* ---------- INFO BOX (Dataset Summary) ---------- */

.dashboard-info-box {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    height: 100%;
    transition: all .2s ease;
}

.dashboard-info-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, .06);
}

/* ---------- PERIOD CARD ---------- */

.dashboard-period-card {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 1rem 1.1rem;
}

.period-item .period-label {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: #94A3B8;
    margin-bottom: .35rem;
}

.period-item .period-value {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -.3px;
}

/* ---------- PROGRESS ---------- */

.progress {
    height: 10px;
    border-radius: 999px;
    background: #E2E8F0;
    overflow: hidden;
}

.progress-bar {
    border-radius: 999px;
    font-weight: 600;
    font-size: .72rem;
}

/* ---------- OVERLAY ---------- */

.dashboard-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, .85);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dashboard-overlay-content {
    text-align: center;
}

/* =====================================================
   DARK MODE
===================================================== */

body.dark-mode .kpi-card,
body.dark-mode .card,
body.dark-mode .meta-status,
body.dark-mode .dashboard-ai-module,
body.dark-mode .recommendation-item,
body.dark-mode .system-info-card,
body.dark-mode .dashboard-info-box,
body.dark-mode .dashboard-period-card {
    background: #1E293B;
    border-color: #334155;
}

body.dark-mode .page-title,
body.dark-mode .kpi-value,
body.dark-mode .section-card-header h5,
body.dark-mode .period-item .period-value {
    color: #F1F5F9;
}

body.dark-mode .section-card-header {
    background: #0F172A;
    border-bottom-color: #334155;
}

body.dark-mode .kpi-card:hover,
body.dark-mode .dashboard-ai-module:hover,
body.dark-mode .recommendation-item:hover,
body.dark-mode .system-info-card:hover,
body.dark-mode .dashboard-info-box:hover {
    box-shadow: 0 12px 28px rgba(0, 0, 0, .35);
}

body.dark-mode .progress {
    background: #334155;
}

body.dark-mode .dashboard-overlay {
    background: rgba(15, 23, 42, .9);
}

/* =====================================================
   RESPONSIVE
===================================================== */

@media (max-width: 767.98px) {
    .page-icon-badge {
        width: 46px;
        height: 46px;
        font-size: 1.25rem;
    }

    .page-title {
        font-size: 1.2rem;
    }

    .kpi-value {
        font-size: 1.35rem;
    }

    .header-actions {
        width: 100%;
    }

    .header-actions .btn {
        flex: 1;
    }
}

/* ---------- LEGACY SUPPORT (jangan dihapus) ---------- */

.prediction-card {
    background: linear-gradient(135deg, #0F766E, #16A34A);
    color: white;
    border-radius: 18px;
    padding: 20px;
}

.semantic-score {
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 20px;
    background: #DBEAFE;
    color: #1D4ED8;
}

.similarity-card {
    border-left: 5px solid #0F766E;
}

.anomaly-card {
    border-left: 6px solid #DC2626;
    background: #FEF2F2;
}

.normal-card {
    border-left: 6px solid #16A34A;
    background: #F0FDF4;
}

.recommendation-score {
    background: linear-gradient(135deg, #0F766E, #22C55E);
    color: white;
}

/* =====================================================
   RECOMMENDATION SUMMARY GRID (2 KOLOM)
===================================================== */

.recommendation-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .75rem;
}

@media (max-width: 575.98px) {
    .recommendation-grid {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   PIPELINE MODE SELECTION
===================================================== */

.pipeline-mode-option {
    border: 2px solid #E2E8F0;
    border-radius: 12px;
    padding: 1rem 1.1rem;
    margin-bottom: .75rem;
    cursor: pointer;
    transition: all .2s ease;
    background: #fff;
}

.pipeline-mode-option:last-child {
    margin-bottom: 0;
}

.pipeline-mode-option:hover {
    border-color: #14B8A6;
    background: #F0FDFA;
}

.pipeline-mode-option.active {
    border-color: #0F766E;
    background: #ECFDF5;
    box-shadow: 0 6px 18px rgba(15, 118, 110, .12);
}

.pipeline-mode-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

/* Dark mode */
body.dark-mode .pipeline-mode-option {
    background: #1E293B;
    border-color: #334155;
}

body.dark-mode .pipeline-mode-option:hover {
    border-color: #14B8A6;
    background: #0F172A;
}

body.dark-mode .pipeline-mode-option.active {
    background: #052E2B;
    border-color: #0F766E;
}

body.dark-mode #pipelineCustomNotebooks {
    background: #0F172A;
    border-color: #334155;
    color: #F1F5F9;
}

.bg-gradient-info {
    background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%) !important;
}

/* =====================================================
   CLUSTER DESCRIPTION & SAMPLE INSIGHT
===================================================== */

.cluster-desc {
    font-size: .8rem;
    color: #6c757d;
    line-height: 1.4;
}

body.dark-mode .cluster-desc {
    color: #94A3B8;
}

.cluster-sample-card {
    background: #f8f9fa;
    border-radius: .6rem;
    padding: .85rem 1rem;
    border-left: 4px solid #0dcaf0;
    height: 100%;
}

.cluster-sample-card h6 {
    font-size: .85rem;
    font-weight: 700;
    margin-bottom: .5rem;
}

.cluster-sample-card ul {
    margin: 0;
    padding-left: 1.1rem;
    font-size: .78rem;
    color: #495057;
}

.cluster-sample-card ul li {
    margin-bottom: .25rem;
}

.cluster-sample-card .sample-conclusion {
    margin-top: .6rem;
    font-size: .78rem;
    color: #212529;
    font-style: italic;
    border-top: 1px dashed #dee2e6;
    padding-top: .5rem;
}

body.dark-mode .cluster-sample-card {
    background: #0F172A;
    border-left-color: #0EA5E9;
}

body.dark-mode .cluster-sample-card ul,
body.dark-mode .cluster-sample-card .sample-conclusion {
    color: #CBD5E1;
}

body.dark-mode .cluster-sample-card .sample-conclusion {
    border-top-color: #334155;
}