@font-face {
    font-family: 'BTG Pactual';
    src: url('/static/fonts/BTGPactualOffice-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'BTG Pactual';
    src: url('/static/fonts/BTGPactualOffice-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'BTG Pactual';
    src: url('/static/fonts/BTGPactualOffice-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'BTG Pactual';
    src: url('/static/fonts/BTGPactualOffice-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

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

body {
    font-family: 'BTG Pactual', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: #f4f5f7;
    color: #191919;
    font-size: 14px;
    line-height: 1.4;
}

input, select, button, textarea {
    font-family: inherit;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 28px;
    background: #001F62;
    color: #ffffff;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 32px;
}

.header-logo {
    height: 48px;
}

.header-title-wrap {
    display: flex;
    align-items: center;
}

.header-title {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.header-nav {
    display: flex;
    gap: 6px;
}

.header-nav-link {
    padding: 8px 20px;
    border-radius: 5px;
    color: rgba(255, 255, 255, 0.45);
    text-decoration: none;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.3px;
    transition: color 0.2s, background 0.2s;
}

.header-nav-link:hover {
    color: rgba(255, 255, 255, 0.85);
}

.header-nav-link.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

.header-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

/* Site top tabs */
.site-top-tabs {
    display: flex;
    gap: 0;
    padding: 0 24px;
    background: #001F62;
    border-bottom: 2px solid rgba(255, 255, 255, 0.10);
}

.site-top-tab {
    padding: 14px 32px;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.site-top-tab:hover {
    color: rgba(255, 255, 255, 0.85);
}

.site-top-tab.active {
    color: #fff;
    border-bottom-color: #4d9eff;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0;
    padding: 0 28px;
    background: #ffffff;
    border-bottom: 1px solid #d9e0ea;
}

.tab {
    padding: 13px 24px;
    background: none;
    border: none;
    color: #6b7b96;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    font-family: 'BTG Pactual', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.tab:hover {
    color: #001F62;
}

.tab.active {
    color: #195AB4;
    border-bottom-color: #195AB4;
}

/* Main */
main {
    padding: 16px 24px;
}

.main-content {
    display: none;
}

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

/* ── Filters Bar ── */
.filters-bar {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 20px;
    padding: 14px 18px;
    background: #ffffff;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 31, 98, 0.08);
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-group label {
    font-size: 10px;
    font-weight: 700;
    color: #001F62;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group select {
    padding: 7px 14px;
    border: 1px solid #d0d0d0;
    border-radius: 20px;
    font-size: 14px;
    color: #191919;
    background: #ffffff;
    outline: none;
    min-width: 140px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-group select:focus {
    border-color: #195AB4;
    box-shadow: 0 0 0 2px rgba(25, 90, 180, 0.15);
}

/* Toggle switch */
.toggle-switch-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: #d0d0d0;
    border-radius: 20px;
    transition: background 0.2s;
}

.toggle-slider::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 2px;
    width: 16px;
    height: 16px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
    background: #195AB4;
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(16px);
}

/* ── Section Header ── */
.section-header {
    font-size: 14px;
    font-weight: 700;
    color: #001F62;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 24px 0 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid #195AB4;
}

/* ── Dashboard Grid ── */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 8px;
}

.card {
    background: #ffffff;
    border-radius: 6px;
    padding: 18px 20px;
    box-shadow: 0 1px 4px rgba(0, 31, 98, 0.08);
    margin-bottom: 8px;
}

.card-title {
    font-size: 13px;
    font-weight: 700;
    color: #001F62;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid #195AB4;
}

.chart-container {
    position: relative;
    height: 320px;
}

.chart-footnote {
    margin-top: 8px;
    font-size: 11px;
    color: #9baabf;
    font-style: italic;
    text-align: center;
    font-family: 'BTG Pactual', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* ── Summary Table ── */
.card-table .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.card-table table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

.card-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #001F62;
    color: #ffffff;
    font-weight: 700;
    font-size: 12px;
    padding: 8px 10px;
    text-align: center;
    border-bottom: 2px solid #195AB4;
    white-space: nowrap;
}

.card-table thead th:first-child {
    text-align: left;
    position: sticky;
    left: 0;
    z-index: 3;
    background: #001F62;
}

.card-table tbody td {
    padding: 6px 10px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    white-space: nowrap;
}

.card-table tbody td:first-child {
    text-align: left;
    font-weight: 600;
    position: sticky;
    left: 0;
    background: inherit;
    z-index: 1;
}

.card-table tbody tr:nth-child(even) {
    background: #f9f9f9;
}

.card-table tbody tr:nth-child(odd) {
    background: #ffffff;
}

.card-table tbody tr:hover {
    background: #e6eef8;
}

/* Operator group header row */
.op-group-header td {
    background: #0a2a6e !important;
    color: #ffffff;
    font-weight: 700;
    font-size: 12px;
    padding: 8px 10px;
    letter-spacing: 0.3px;
    border-bottom: 1px solid #1a3878;
}

/* Segment label row */
.segment-label-row td {
    background: #e8eff9 !important;
    color: #001F62;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 5px 10px;
    border-bottom: 1px solid #d0dff0;
}

/* Metric label (indented) */
.metric-label {
    padding-left: 20px !important;
    color: #555;
    font-weight: 500 !important;
    font-size: 11px;
}

/* Separator after last metric of an operator */
.last-metric-row td {
    border-bottom: 2px solid #d0d0d0 !important;
}

.val-positive {
    color: #16a34a;
    font-weight: 600;
}

.val-negative {
    color: #dc2626;
    font-weight: 600;
}

/* ── Analysts Footer ── */
.analysts-footer {
    display: flex;
    justify-content: space-between;
    padding: 20px 28px;
    margin-top: 24px;
    border-top: 1px solid #e0e0e0;
}

.analyst {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.analyst-name {
    font-size: 13px;
    font-weight: 700;
    color: #001F62;
}

.analyst-email {
    font-size: 11px;
    color: #666;
    text-decoration: none;
}

.analyst-email:hover {
    color: #195AB4;
    text-decoration: underline;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    header {
        padding: 12px 16px;
    }

    .header-logo {
        height: 28px;
    }

    .header-left {
        gap: 16px;
    }

    .header-nav-link {
        padding: 5px 12px;
        font-size: 14px;
    }

    .header-title {
        font-size: 16px;
    }

    .site-top-tab {
        padding: 11px 22px;
        font-size: 14px;
    }

    .tabs {
        padding: 0 12px;
    }

    .tab {
        padding: 9px 16px;
        font-size: 13px;
    }

    main {
        padding: 8px;
    }

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group select {
        min-width: 100%;
    }

    .chart-container {
        height: 250px;
    }

    /* Telecom table: smaller text on mobile */
    .card-table table {
        font-size: 11px;
    }

    .op-group-header td {
        font-size: 11px;
        padding: 6px 8px;
    }

    .segment-label-row td:first-child {
        font-size: 10px;
        padding: 4px 8px;
        position: sticky;
        left: 0;
        z-index: 1;
        background: #e8eff9;
    }

    .op-group-header td:first-child {
        position: sticky;
        left: 0;
        z-index: 1;
        background: #0a2a6e;
    }

    .metric-label {
        font-size: 10px;
        padding-left: 14px !important;
    }

    .card-table tbody td {
        padding: 5px 6px;
        font-size: 10px;
    }

    .card-table thead th {
        font-size: 10px;
        padding: 6px 6px;
    }

    .analysts-footer {
        flex-direction: column;
        gap: 14px;
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .chart-container {
        height: 200px;
    }

    .filter-group label {
        font-size: 9px;
    }

    .toggle-switch-label {
        min-height: 44px;
        align-items: center;
    }

    .site-top-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        padding: 0 12px;
    }

    .site-top-tab {
        white-space: nowrap;
        padding: 10px 18px;
        font-size: 13px;
    }

    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tab {
        white-space: nowrap;
        padding: 9px 14px;
        font-size: 12px;
    }

    .card {
        padding: 14px 12px;
    }

    .card-title {
        font-size: 12px;
    }
}
