﻿:root {
    --bg: #f6f7fb;
    --text: #111827;
    --muted: #4b5563;
    --line: #e5e7eb;
    --card: #ffffff;
    --sidebar: #f3efe6;
    --accent: #0b6b3a;
    --accentBlue: #2563eb;
    --shadow: 0 8px 20px rgba(17,24,39,.08);
    --r: 10px;
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* Top bar */
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255,255,255,.92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
}

.topbarInner {
    max-width: 1220px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), #38b000);
}

.brandName {
    font-weight: 800;
}

.brandSub {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

.linkTop {
    color: var(--accentBlue);
    text-decoration: none;
    font-weight: 600;
}

/* Page layout */
.page {
    max-width: 1220px;
    margin: 0 auto;
    padding: 14px 16px 20px;
}

.grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 18px;
    align-items: start;
}

/* Panels (each scrolls independently) */
.leftPanel {
    background: var(--sidebar);
    border: 1px solid #e6e0d4;
    border-radius: var(--r);
    padding: 16px 16px 0;
    height: calc(100vh - 92px);
    overflow: auto;
}

.rightPanel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 16px;
    height: calc(100vh - 92px);
    overflow: auto;
}

/* Titles */
.panelTitle {
    font-size: 20px;
    font-weight: 800;
    margin: 2px 0 10px;
}

/* Form */
.form h3 {
    margin: 14px 0 6px;
    font-size: 12px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #374151;
}

label {
    display: block;
    margin: 10px 0;
    font-size: 13px;
}

input, select {
    width: 100%;
    padding: 10px 10px;
    margin-top: 6px;
    border-radius: 6px;
    border: 1px solid #cfcfcf;
    background: #ffffff;
    color: var(--text);
    outline: none;
}

    input:focus, select:focus {
        border-color: rgba(37,99,235,.55);
        box-shadow: 0 0 0 4px rgba(37,99,235,.12);
    }

.row2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.row3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.check {
    display: flex;
    align-items: center;
    gap: 10px;
}

    .check input {
        width: auto;
        margin: 0;
    }

/* Sticky actions in left panel */
.leftSticky {
    position: sticky;
    bottom: 0;
    background: var(--sidebar);
    border-top: 1px solid #e6e0d4;
    padding: 12px 0 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.btn {
    border: 0;
    border-radius: 6px;
    padding: 10px 12px;
    font-weight: 800;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
}

    .btn:disabled {
        opacity: .65;
        cursor: not-allowed;
    }

.btnGhost {
    border: 1px solid rgba(17,24,39,.18);
    border-radius: 6px;
    padding: 10px 12px;
    font-weight: 800;
    background: #fff;
    color: #111827;
    cursor: pointer;
}

.status {
    margin-left: auto;
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.error {
    margin: 12px 0 14px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(220,38,38,.25);
    background: rgba(220,38,38,.06);
    color: #7f1d1d;
}

/* Right header / KPIs */
.rightHeader {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
    margin-bottom: 10px;
}

.mutedSmall {
    color: var(--muted);
    font-size: 13px;
}

.mutedTiny {
    color: var(--muted);
    font-size: 12px;
    margin-top: 8px;
}

.link {
    display: inline-block;
    margin-top: 8px;
    color: var(--accentBlue);
    text-decoration: none;
}

.kpis {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 360px;
}

.kpiLabel {
    color: var(--muted);
    font-size: 14px;
}

.kpiValue {
    font-size: 28px;
    font-weight: 900;
    margin-top: 4px;
}

.kpiDivider {
    width: 1px;
    height: 42px;
    background: var(--line);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 18px;
    border-bottom: 1px solid var(--line);
    margin: 10px 0 14px;
}

.tab {
    border: 0;
    background: transparent;
    padding: 10px 0;
    font-weight: 900;
    letter-spacing: .08em;
    font-size: 12px;
    color: #6b7280;
    cursor: pointer;
}

    .tab.active {
        color: var(--accent);
        border-bottom: 3px solid var(--accent);
        margin-bottom: -1px;
    }

/* Chart & table cards */
.chartCard {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px;
    background: #ffffff;
}

canvas {
    width: 100%;
    height: auto;
    display: block;
}

.summaryRow {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.metric {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
    padding: 12px;
}

.metricLabel {
    color: var(--muted);
    font-size: 12px;
}

.metricValue {
    font-size: 18px;
    font-weight: 900;
    margin-top: 6px;
}

.tableCard {
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: auto;
    background: #fff;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
    background: #fff;
}

th, td {
    padding: 10px 10px;
    border-bottom: 1px solid #eef2f7;
    font-size: 13px;
}

th {
    position: sticky;
    top: 0;
    background: #f3f4f6;
    text-align: left;
    z-index: 2;
}

.num {
    text-align: right;
}

tbody tr:hover {
    background: #f3f6ff;
}

/* Disclaimer */
.disclaimer {
    margin-top: 14px;
    border-top: 1px solid var(--line);
    padding-top: 12px;
}

    .disclaimer h3 {
        margin: 0 0 6px;
        font-size: 14px;
        letter-spacing: .08em;
        text-transform: uppercase;
    }

    .disclaimer p {
        margin: 0;
        color: var(--muted);
        line-height: 1.5;
    }

/* Responsive */
@media (max-width: 980px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .leftPanel, .rightPanel {
        height: auto;
        overflow: visible;
    }

    .kpis {
        min-width: 0;
    }

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

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


input.money {
    text-align: right;
    font-variant-numeric: tabular-nums;
    padding-right: 10px; /* 👈 helps a lot */
}

/* Help icon */
.help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 6px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    font-size: 12px;
    color: rgba(17, 24, 39, .9);
    background: rgba(17, 24, 39, .08);
}

    .help:hover {
        background: rgba(17, 24, 39, .14);
    }

/* Modal */
.modalBackdrop {
    position: fixed;
    inset: 0;
    background: rgba(17,24,39,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 9999;
}

.modal {
    width: min(720px, 100%);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 18px 60px rgba(0,0,0,.25);
    overflow: hidden;
}

.modalHeader {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(17,24,39,.10);
}

.modalCategory {
    font-size: 12px;
    color: rgba(17,24,39,.60);
    margin-bottom: 4px;
}

.modalTitle {
    margin: 0;
    font-size: 18px;
    color: rgba(17,24,39,.92);
}

.modalClose {
    border: 0;
    background: transparent;
    font-size: 18px;
    cursor: pointer;
    opacity: .7;
}

    .modalClose:hover {
        opacity: 1;
    }

.modalBody {
    padding: 16px 18px 18px;
}

.helpBlock {
    margin-bottom: 12px;
}

.helpLabel {
    font-size: 12px;
    font-weight: 700;
    color: rgba(17,24,39,.70);
    margin-bottom: 4px;
}

.helpText {
    font-size: 14px;
    color: rgba(17,24,39,.88);
    line-height: 1.35;
}

.helpGrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 10px;
}

.helpFooter {
    display: flex;
    gap: 14px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(17,24,39,.10);
}

.helpLink {
    color: rgba(37,99,235,.95);
    text-decoration: none;
    font-weight: 600;
}

    .helpLink:hover {
        text-decoration: underline;
    }

@media (max-width: 640px) {
    .helpGrid {
        grid-template-columns: 1fr;
    }
}

.topnav {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.linkTop.active {
    font-weight: 800;
    text-decoration: underline;
}

.contentPage {
    max-width: 980px;
    margin: 0 auto;
    padding: 18px;
}

    .contentPage h1 {
        margin-top: 8px;
    }

    .contentPage h2 {
        margin-top: 18px;
    }

    .contentPage p, .contentPage li {
        line-height: 1.45;
        color: rgba(17,24,39,.88);
    }

.brandLink {
    text-decoration: none;
    color: inherit;
    display: inline-block;
}

    .brandLink:focus-visible {
        outline: 3px solid rgba(37,99,235,.45);
        outline-offset: 6px;
        border-radius: 12px;
    }