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

html, body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    height: 100vh;
    font-family: 'Inter', -apple-system, sans-serif;
    background: #F5F6F8;
    color: #1E293B;
}

#react-entry-point, #react-entry-point > div,
#react-entry-point > div > div {
    height: 100vh;
    overflow: hidden;
}

._dash-loading { display: none !important; }

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.app-header {
    flex: 0 0 44px;
    background: white;
    border-bottom: 1px solid #E2E8F0;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 10px 16px 6px;
}

/* Each page wrapper fills body */
.app-body > div {
    height: 100%;
}

/* Tabs */
.nav-pills {
    display: flex;
    gap: 2px;
}

.nav-pills .nav-link {
    font-weight: 500;
    font-size: 0.72rem;
    color: #94A3B8;
    border-radius: 4px;
    padding: 5px 10px;
    margin: 0;
    transition: all 0.15s ease;
    border-bottom: 2px solid transparent;
}

.nav-pills .nav-link.active {
    background: transparent;
    color: #2563EB;
    border-bottom: 2px solid #2563EB;
    font-weight: 600;
}

.nav-pills .nav-link:hover:not(.active) {
    background: transparent;
    color: #1E293B;
    border-bottom: 2px solid #E2E8F0;
}

/* Panel */
.panel {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    overflow: hidden;
}

/* Force Plotly to fill container */
.panel .dash-graph,
.panel .js-plotly-plot,
.panel .plot-container.plotly,
.panel .svg-container {
    width: 100% !important;
    height: 100% !important;
}

/* KPI */
.kpi-box {
    text-align: center;
    padding: 12px 6px;
    border-radius: 8px;
    background: white;
    border: 1px solid #E2E8F0;
}

.kpi-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    font-weight: 600;
    color: #2563EB;
    line-height: 1.2;
}

.kpi-label {
    font-size: 0.63rem;
    font-weight: 500;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-top: 2px;
}

/* Stat pills */
.stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 9px;
    border-radius: 5px;
    background: white;
    border: 1px solid #E2E8F0;
    font-size: 0.72rem;
}

.stat-pill .val {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: #2563EB;
}

.stat-pill .lbl {
    color: #64748B;
    text-transform: uppercase;
    font-size: 0.6rem;
    letter-spacing: 0.3px;
}

/* Click hint */
.click-hint {
    font-size: 0.62rem;
    color: #94A3B8;
    text-align: center;
    padding: 2px 0;
}

/* Finding cards */
.finding-card {
    padding: 10px 12px;
    border-radius: 6px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
}

/* Table */
.table { color: #1E293B; margin: 0; }
.table th {
    color: #64748B;
    border-bottom: 1px solid #E2E8F0;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 500;
    padding: 5px 6px;
}
.table td {
    border-bottom: 1px solid #F1F5F9;
    font-size: 0.78rem;
    padding: 6px;
}
.table-hover tbody tr:hover { background: #F8FAFC; }

/* Modal */
.modal { position: fixed !important; }
.modal-content {
    border-radius: 12px;
    border: 1px solid #E2E8F0;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.modal-header { border-bottom: 1px solid #E2E8F0; padding: 12px 16px;
    display: flex; align-items: center; justify-content: space-between; }
.modal-body { padding: 12px 16px; }

/* Static-build modal overlay (replaces dash-bootstrap Modal) */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
}
.modal-overlay .modal-content {
    background: white;
    width: min(440px, 92vw);
    max-height: 80vh;
    overflow: auto;
}
.modal-overlay .modal-title { margin: 0; font-size: 1.05rem; font-weight: 600; }

/* Takeaway items */
.takeaway-item {
    opacity: 0;
    animation: slideUp 0.3s ease forwards;
    padding: 14px 18px;
    margin: 6px 0;
    border-radius: 8px;
    background: white;
    border: 1px solid #E2E8F0;
    border-left: 3px solid #2563EB;
}
.takeaway-item:nth-child(1) { animation-delay: 0.08s; }
.takeaway-item:nth-child(2) { animation-delay: 0.16s; }
.takeaway-item:nth-child(3) { animation-delay: 0.24s; }
.takeaway-item:nth-child(4) { animation-delay: 0.32s; }
.takeaway-item:nth-child(5) { animation-delay: 0.4s; }

@keyframes slideUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
