:root {
    --min-value: 0;
    --max-value: 1;
    --accent: #007663;
    --accent-dark: #004d42;
    --accent-light: #33a18f;
    --accent-bg: #e6f5f2;
    --surface: #ffffff;
    --surface-hover: #f8fafc;
    --border: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --radius: 12px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,.07);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-family: 'Roboto', sans-serif; }
body { background: #f1f5f9; color: var(--text-primary); min-height: 100vh; }

/* ── Container ── */
.main-container {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* ── Resumo da operadora ── */
.resumo-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.resumo-header {
    background: var(--accent-bg);
    padding: .85rem 1.25rem;
    font-weight: 600;
    font-size: .95rem;
    color: var(--accent-dark);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: .5rem;
}
.resumo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.resumo-item {
    padding: .75rem 1.25rem;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
}
.resumo-label {
    font-size: .7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-secondary);
    margin-bottom: .15rem;
}
.resumo-value {
    font-size: .9rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* ── Tabs ── */
.tabs-container {
    margin-bottom: 0;
}
.tabs {
    display: flex;
    gap: .35rem;
    padding: 0;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.tab {
    cursor: pointer;
    color: var(--text-secondary);
    padding: .6rem 1.25rem;
    border-radius: var(--radius) var(--radius) 0 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-bottom: none;
    font-size: .85rem;
    font-weight: 500;
    transition: all .2s;
    position: relative;
    top: 1px;
}
.tab:hover {
    color: var(--accent);
    background: var(--accent-bg);
}
.tab.active {
    background: var(--surface);
    color: var(--accent);
    font-weight: 600;
    border-color: var(--border);
    border-bottom: 2px solid var(--surface);
    z-index: 2;
}

/* ── Conteudo das abas ── */
.tab-content {
    display: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.titulo {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    text-transform: uppercase;
    color: var(--accent-dark);
    padding-bottom: .75rem;
    border-bottom: 2px solid var(--accent-bg);
    letter-spacing: .3px;
}

/* ── Tabelas de indicadores ── */
.principal-table,
.item-table,
.subitem-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: .75rem;
    border-radius: 8px;
    overflow: hidden;
}

.principal-table {
    background: var(--accent-bg);
    border: 1px solid #b2dfdb;
}
.item-table {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}
.subitem-table {
    background: var(--surface-hover);
    border: 1px solid var(--border);
}

.principal-table td,
.item-table td,
.subitem-table td {
    border: none;
    text-align: left;
    padding: .55rem 1.25rem;
    vertical-align: top;
    font-size: .88rem;
    line-height: 1.5;
}

.principal-table td:first-child,
.item-table td:first-child,
.subitem-table td:first-child {
    width: 80%;
}

.sub-item {
    font-weight: 600;
    font-size: .9rem !important;
    color: var(--text-primary);
}

.principal-table .sub-item {
    color: var(--accent-dark);
    font-size: .95rem !important;
}

/* ── Termometro ── */
.thermometer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.thermometer {
    position: relative;
    height: 22px;
    width: 180px;
    background: linear-gradient(to right,
        #ef4444 0%, #ef4444 20%,
        #f97316 20%, #f97316 40%,
        #eab308 40%, #eab308 60%,
        #84cc16 60%, #84cc16 80%,
        var(--accent) 80%, var(--accent) 100%);
    border-radius: 4px;
    margin: 12px 0;
    outline: 2px solid rgba(0,0,0,.12);
    outline-offset: -1px;
}
.thermometer::before {
    content: '';
    position: absolute;
    top: -2px;
    left: calc((var(--value) - var(--min-value)) / (var(--max-value) - var(--min-value)) * 100%);
    transform: translateY(-50%) rotate(180deg);
    border: 8px solid transparent;
    border-bottom-color: var(--text-primary);
    z-index: 1;
}
.nota {
    font-weight: 600;
    font-size: .82rem;
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    color: var(--text-primary);
}
.nota-texto {
    font-weight: 600;
    font-size: .88rem;
    color: var(--accent);
    padding: .5rem 0;
}

/* ── Links ── */
.links-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem;
    margin-bottom: 2rem;
}
.links-title {
    font-weight: 600;
    font-size: .95rem;
    color: var(--text-primary);
    margin-bottom: .75rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.links-card a {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--accent);
    text-decoration: none;
    font-size: .88rem;
    padding: .4rem 0;
    transition: color .15s;
}
.links-card a:hover {
    color: var(--accent-dark);
    text-decoration: underline;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .main-container { padding: 0 1rem; margin: 1rem auto; }
    .tabs { justify-content: flex-start; }
    .tab { padding: .5rem .85rem; font-size: .8rem; }
    .resumo-grid { grid-template-columns: 1fr; }
    .thermometer { width: 140px; }
    .principal-table td,
    .item-table td,
    .subitem-table td { padding: .5rem .75rem; font-size: .82rem; }
}
