:root {
    /* light theme */
    --bg: #f7f7fb;
    --surface: #ffffff;
    --text: #19212a;
    --muted: #5b6a7a;
    --border: #e6e8ef;
    --primary: #0a84ff; /* light accent */
    --secondary: #6b778d;
    --good: #1cbf72;
    --warn: #ffb020;
    --danger: #ff4d4f;
}

    :root[data-theme="dark"],
    html[data-theme="dark"],
    body[data-theme="dark"] {
        /* dark theme (neutral + cyan) */
        --bg: #0e1116;
        --surface: #151922;
        --text: #e8edf4;
        --muted: #93a1b3;
        --border: #232a36;
        --primary: #16b3c9; /* cyan accent */
        --secondary: #7b8aa0;
        --good: #32d394;
        --warn: #ffc14d;
        --danger: #ff6b6f;
    }

html, body {
    background: var(--bg);
    color: var(--text);
    margin: 0;
    font: 14px/1.45 system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji","Segoe UI Emoji";
}

.tfp-header, .tfp-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.tfp-footer {
    border-top: 1px solid var(--border);
    border-bottom: none;
    margin-top: 16px;
}

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

.sep {
    opacity: 0.6;
    margin: 0 6px;
}

h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    padding: 16px 20px;
}

.kpi {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 6px 22px rgba(0,0,0,0.15);
}

.kpi-label {
    color: var(--muted);
    font-weight: 600;
    margin-bottom: 4px;
}

.kpi-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
}

.charts-grid {
    padding: 0 20px 16px 20px;
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 6px 22px rgba(0,0,0,0.15);
}

.card-title {
    margin: 2px 0 10px 4px;
    color: var(--muted);
    font-weight: 700;
}

/* Chart container constraints */
.card canvas {
    max-height: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    width: auto !important;
}

/* Chart container - 1/3 of viewport height */
.chart-container {
    height: 400px !important;
    min-height: 400px !important;
    max-height: 400px !important;
}

/* Larger fonts for better readability - AGGRESSIVE OVERRIDES */
* {
    font-size: 16px !important;
}

.chart-controls label {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: var(--text) !important;
}

.chart-controls select {
    font-size: 16px !important;
    padding: 10px 15px !important;
    font-weight: 600 !important;
}

.card-title {
    font-size: 22px !important;
    font-weight: 800 !important;
    color: var(--text) !important;
}

.kpi-label {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: var(--muted) !important;
}

.kpi-value {
    font-size: 32px !important;
    font-weight: 800 !important;
    color: var(--text) !important;
}

.tfp-header h1 {
    font-size: 36px !important;
    font-weight: 800 !important;
    color: var(--text) !important;
}

.tfp-footer {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: var(--muted) !important;
}

.btn {
    font-size: 16px !important;
    font-weight: 700 !important;
    padding: 12px 20px !important;
}

/* Chart toggle button specific styling */
#chartTypeToggle {
    background: var(--primary) !important;
    color: white !important;
    border: 2px solid var(--primary) !important;
    font-weight: 700 !important;
    padding: 10px 20px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

#chartTypeToggle:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

/* Force all text to be larger */
body, html {
    font-size: 16px !important;
}

h1, h2, h3, h4, h5, h6 {
    font-size: 20px !important;
    font-weight: 700 !important;
}

p, span, div {
    font-size: 16px !important;
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}

    .table th, .table td {
        padding: 10px 10px;
        border-bottom: 1px solid var(--border);
        text-align: left;
    }

    .table thead th {
        position: sticky;
        top: 0;
        background: var(--surface);
        z-index: 1;
        color: var(--muted);
    }

    .table tbody tr:hover {
        background: rgba(255,255,255,0.04);
    }

.table-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 10px;
}

.btn {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: transform .08s ease, background .2s ease;
}

    .btn:hover {
        transform: translateY(-1px);
    }

.btn-primary {
    background: var(--primary);
    color: #00161a;
    border-color: transparent;
    font-weight: 700;
}

.btn-secondary {
    background: #1d2330;
    border-color: #2a3243;
    color: var(--text);
}

.input {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 8px 10px;
    border-radius: 10px;
    min-width: 220px;
}

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

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

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

    .tfp-actions {
        flex-wrap: wrap;
    }
}
