@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

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

body {
    font-family: 'DM Sans', sans-serif;
    background: #FAFAF8;
    color: #1a1a2e;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

/* ── Layout ───────────────────────────────────────────────── */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 224px;
    min-width: 224px;
    background: #F5F5F2;
    border-right: 1px solid #E8E8E4;
    padding: 1.75rem 1.25rem;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    height: 100%;
}

.nav-item {
    display: block;
    padding: 0.5rem 0.85rem;
    border-radius: 7px;
    color: #4a4a6a;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s ease;
    border-left: 2px solid transparent;
}
.nav-item:hover {
    background: #EEEEE9;
    color: #1B4F8A;
    text-decoration: none;
    border-left: 2px solid #1B4F8A;
}
.nav-item.active {
    background: #EEF2FF;
    color: #1B4F8A;
    border-left: 2px solid #1B4F8A;
    font-weight: 600;
}

.main-content {
    margin-left: 224px;
    flex: 1;
    padding: 2.5rem 3rem;
}

.page-content { width: 100%; max-width: 1100px; }

/* ── KPI-grid ─────────────────────────────────────────────── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.kpi {
    background: #ffffff;
    border: 1px solid #EBEBЕ6;
    border-radius: 12px;
    padding: 1.1rem 1.3rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.kpi-label {
    font-size: 0.67rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.4rem;
}

.kpi-value {
    font-size: 1.6rem;
    font-weight: 700;
    font-family: 'DM Mono', monospace;
    color: #1a1a2e;
    line-height: 1.2;
}

.kpi-sub {
    font-size: 0.7rem;
    color: #9ca3af;
    margin-top: 0.25rem;
    font-family: 'DM Mono', monospace;
}

/* ── Section titles ───────────────────────────────────────── */
.section-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: #9ca3af;
    margin: 1.5rem 0 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ── Cards ────────────────────────────────────────────────── */
.company-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #F0F0EC;
}
.company-row:last-child { border-bottom: none; }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: 'DM Mono', monospace;
}
.badge-green { background: #ECFDF5; color: #065F46; }
.badge-red   { background: #FEF2F2; color: #991B1B; }
.badge-gray  { background: #F5F5F2; color: #6b7280; }

/* ── Plotly ───────────────────────────────────────────────── */
.js-plotly-plot {
    border-radius: 12px;
    border: 1px solid #EBEBЕ6;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    overflow: hidden;
    background: white;
}

/* ── Dropdown ─────────────────────────────────────────────── */
.Select-control {
    font-family: 'DM Sans', sans-serif !important;
    border-radius: 8px !important;
    border: 1px solid #E8E8E4 !important;
}

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D1D1CB; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #B0B0A8; }

/* ── Responsiv ────────────────────────────────────────────── */
@media (max-width: 900px) {
    .sidebar { width: 60px; padding: 1rem 0.5rem; }
    .sidebar .nav-item span { display: none; }
    .main-content { margin-left: 60px; padding: 1rem; }
    .kpi-grid { grid-template-columns: 1fr 1fr; }
}
