/* Liquidity Sentinel — Custom Styles */

:root {
    --bg: #0d0f14;
    /* page background */
    --surface: #13161e;
    /* sidebar + card background */
    --surface2: #1a1e28;
    /* nav hover + elevated surface */
    --border: #252935;
    /* all borders */
    --text: #e8eaf0;
    /* primary text */
    --muted: #6b7280;
    /* labels, subtitles, secondary text */
    --gold: #d4a843;
    /* primary accent */
    --gold-dim: #a07830;
    /* dimmed gold */
    --green: #3ecf8e;
    /* positive */
    --red: #f87171;
    /* negative */
    --blue: #60a5fa;
    /* informational */
    --purple: #a78bfa;
    /* secondary informational */

    /* Sidebar config */
    --sidebar-width: 220px;

    /* Font mapping for easier replacement if needed */
    --sans-font: 'DM Sans', sans-serif;
    --mono-font: 'DM Mono', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--sans-font);
    font-size: 14px;
    margin: 0;
    line-height: 1.5;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    width: 220px;
    height: 100vh;
    background-color: var(--surface);
    border-right: 1px solid var(--border);
    position: fixed;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
}

.brand {
    padding-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
}

.logo {
    font-size: 1.5rem;
    color: var(--gold);
}

.brand-text h1 {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.05rem;
    color: var(--text);
}

.brand-text p {
    font-size: 0.72rem;
    color: var(--muted);
}

.nav-links {
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--muted);
    font-size: 0.88rem;
    text-decoration: none;
    transition: all 0.15s;
    margin-bottom: 2px;
}

.nav-item:hover {
    background: var(--surface2);
    color: var(--text);
}

.nav-item.active {
    background: var(--surface2);
    color: var(--gold);
}

.sidebar-footer {
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.sidebar-footer p {
    font-size: 0.7rem;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.author {
    display: flex;
    flex-direction: column;
}

.author .label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--muted);
}

.author .name {
    font-family: var(--mono-font);
    font-size: 0.85rem;
    color: var(--text);
}

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 2rem 3rem;
    max-width: 1400px;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.section-title h2 {
    font-family: var(--mono-font);
    font-size: 1.5rem;
    font-weight: 600;
    text-transform: uppercase;
}

.live-status {
    font-family: var(--mono-font);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: var(--green);
    border-radius: 50%;
}

.pulse {
    animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
    0% {
        box-shadow: 0 0 0 0px rgba(16, 185, 129, 0.4);
    }

    100% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
}

/* Currency Toggle */
.currency-toggle-wrap {
    position: relative;
}

.currency-btn {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    padding: 6px 12px;
    cursor: pointer;
    font-family: var(--mono-font);
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.currency-btn:hover {
    border-color: var(--gold);
    background: var(--surface);
}

.currency-btn::before {
    content: '$';
    font-size: 0.9rem;
    color: var(--gold);
}

.currency-btn.active-idr::before {
    content: 'Rp';
}

.fx-rate-tooltip {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    color: var(--muted);
    margin-top: 8px;
    white-space: nowrap;
    z-index: 100;
}

.currency-toggle-wrap:hover .fx-rate-tooltip {
    display: block;
}

.fx-rate-tooltip::before {
    content: 'Rate: ';
}

.fx-rate-tooltip::after {
    content: ' / USD';
}

/* Content Sections */
.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* Grid and Cards */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 22px;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gold);
}

.card-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
    display: block;
}

.card-value {
    font-family: var(--mono-font);
    font-size: 1.7rem;
    font-weight: 500;
    color: var(--text);
    line-height: 1.1;
    margin-bottom: 4px;
}

.card-subtitle {
    font-size: 0.75rem;
    color: var(--muted);
}

/* Scenario Status Cards */
.scenario-status-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.scenario-card {
    background-color: var(--card-bg);
    padding: 1.25rem;
    border: 1px solid var(--border-dim);
    text-align: center;
}

.sc-header {
    font-family: var(--mono-font);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.sc-prob {
    font-size: 0.75rem;
    margin-bottom: 0.75rem;
}

.sc-verdict {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-family: var(--mono-font);
    font-size: 0.8rem;
    font-weight: 600;
}

.sc-verdict.green {
    color: var(--accent-green);
    background-color: rgba(16, 185, 129, 0.1);
}

.sc-verdict.amber {
    color: var(--accent-amber);
    background-color: rgba(245, 158, 11, 0.1);
}

.sc-verdict.red {
    color: var(--accent-red);
    background-color: rgba(239, 68, 68, 0.1);
}

/* Charts */
.chart-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.chart-row.flex-col {
    flex-direction: column;
}

.chart-container {
    background-color: var(--card-bg);
    padding: 1.5rem;
    border: 1px solid var(--border-dim);
    height: 400px;
    /* Increased from 350px for better visibility */
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Center horizontally */
}

.chart-container.half {
    flex: 1;
}

.chart-container.square {
    width: 400px;
    height: 400px;
    flex: none;
}

.chart-container.full {
    width: 100%;
    height: 450px;
}

.chart-container canvas {
    max-width: 100%;
    max-height: 100%;
    flex: 1;
    min-height: 0;
}

.chart-container h3 {
    font-family: var(--mono-font);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    align-self: flex-start;
    /* Title stays left */
}

.chart-legend {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    justify-content: center;
}

.legend-item {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

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

.dot.normal {
    background-color: #2196F3;
}

.dot.mild {
    background-color: #FF9800;
}

.dot.severe {
    background-color: #F44336;
}

/* Tables */
.data-table-container {
    margin-bottom: 2.5rem;
}

.data-table-container h3 {
    font-family: var(--mono-font);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--sans-font);
}

th {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--muted);
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text);
}

tr:hover td {
    background: var(--surface2);
}

/* Callouts */
.callout {
    padding: 1.25rem;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.callout.amber {
    background-color: rgba(245, 158, 11, 0.05);
    color: var(--text-primary);
}

.callout.show-border {
    border-left: 4px solid var(--accent-amber);
}

/* Policy Card */
.policy-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-dim);
    border-left: 6px solid var(--accent-amber);
    padding: 2rem;
    margin-bottom: 2.5rem;
}

.policy-header {
    font-family: var(--mono-font);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    letter-spacing: 0.05rem;
}

.policy-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.policy-item {
    display: flex;
    flex-direction: column;
}

.p-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.p-value {
    font-family: var(--mono-font);
    font-size: 1.5rem;
    font-weight: 600;
}

.p-value.red {
    color: var(--accent-red);
}

.policy-footer {
    margin-top: 1.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Responsive */
@media (max-width: 1024px) {
    .main-content {
        padding: 1.5rem 2rem;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }

    .sidebar .brand-text,
    .sidebar .sidebar-footer,
    .nav-item span:not(.icon) {
        display: none;
    }

    .main-content {
        margin-left: 70px;
        padding: 24px;
    }

    .scenario-status-row {
        grid-template-columns: 1fr;
    }

    .chart-row {
        flex-direction: column;
    }

    .policy-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Operational Status Section ─────────────────────────────────────── */

/* Scenario Banner */
.status-banner {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    border-left: 3px solid #e8a020;
    /* warm gold */
}

.status-banner-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 4px;
}

.status-banner-value {
    font-family: var(--mono-font);
    font-size: 1rem;
    font-weight: 500;
    color: #e8a020;
}

.status-banner-right {
    text-align: right;
}

.status-banner-time {
    font-family: var(--mono-font);
    font-size: 13px;
    color: var(--text);
    margin-bottom: 2px;
}

.status-banner-sub {
    font-family: var(--mono-font);
    font-size: 11px;
    color: var(--muted);
}

/* Status Grid — 2-column */
.status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

/* Status Card */
.status-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 22px;
    position: relative;
    overflow: hidden;
}

/* Top accent bar — consistent with OTC KPI cards */
.status-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border);
    /* default */
}

.status-card.accent-green::before {
    background: var(--green);
}

.status-card.accent-gold::before {
    background: var(--gold);
}

.status-card.accent-red::before {
    background: var(--red);
}

/* Status Verdict Badge */
.status-verdict {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 14px;
}

.status-verdict.green {
    background: rgba(62, 207, 142, 0.15);
    color: var(--green);
}

.status-verdict.amber,
.status-verdict.gold {
    background: rgba(212, 168, 67, 0.15);
    color: var(--gold);
}

.status-verdict.red {
    background: rgba(248, 113, 113, 0.15);
    color: var(--red);
}

/* Status Primary Number */
.status-primary {
    font-family: var(--mono-font);
    font-size: 1.7rem;
    font-weight: 500;
    line-height: 1.1;
    margin-bottom: 4px;
}

.status-primary.red {
    color: var(--red);
}

.status-primary.gold {
    color: var(--gold);
}

.status-primary.green {
    color: var(--green);
}

/* Status Sub */
.status-sub {
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 16px;
}

/* Breakdown rows */
.status-breakdown {
    border-top: 1px solid var(--border);
    padding-top: 12px;
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bk-key {
    font-size: 0.75rem;
    color: var(--muted);
}

.bk-val {
    font-family: var(--mono-font);
    font-size: 0.8rem;
    color: var(--text);
}

.bk-val.red {
    color: var(--red);
}

.bk-val.green {
    color: var(--green);
}

.bk-val.gold {
    color: var(--gold);
}

/* Time Buffer Card specific */
.status-time-body {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 16px;
}

.status-time-main {
    flex: 1;
}

.status-time-bar-wrap {
    flex: 1;
}

.time-bar-label {
    font-size: 0.7rem;
    color: var(--muted);
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.time-bar-track {
    height: 4px;
    background: var(--surface2);
    border-radius: 2px;
    overflow: hidden;
}

.time-bar-fill {
    height: 100%;
    border-radius: 2px;
    /* background set by JS: var(--red), var(--gold), or var(--green) */
    width: 0%;
    transition: width 0.6s ease;
}

/* Action Row */
.action-divider-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--muted);
    margin: 20px 0 10px;
}

.action-row {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
}

.action-row.level-escalate {
    border-top: 2px solid var(--red);
}

.action-row.level-review {
    border-top: 2px solid var(--gold);
}

.action-row.level-monitor {
    border-top: 2px solid var(--green);
}

.action-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.action-text {
    flex: 1;
}

.action-title {
    font-family: var(--mono-font);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.action-title.escalate {
    color: var(--red);
}

.action-title.review {
    color: var(--gold);
}

.action-title.monitor {
    color: var(--green);
}

.action-desc {
    font-size: 0.82rem;
    color: var(--muted);
}

.action-badge {
    font-family: var(--mono-font);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 4px;
    white-space: nowrap;
}

.action-badge.escalate {
    background: rgba(248, 113, 113, 0.15);
    color: var(--red);
}

.action-badge.review {
    background: rgba(212, 168, 67, 0.15);
    color: var(--gold);
}

.action-badge.monitor {
    background: rgba(62, 207, 142, 0.15);
    color: var(--green);
}