/* ─── FILTROS ─── */
.filtros-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.filtros-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    white-space: nowrap;
}

.filtros-bar .form-select {
    border: 1px solid var(--border) !important;
    border-radius: 10px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: var(--blue-800) !important;
    background: var(--surface) !important;
    padding: 8px 14px !important;
    max-width: 160px;
    cursor: pointer;
}

.filtros-bar .form-select:focus {
    border-color: rgba(37, 99, 235, 0.45) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08) !important;
}

/* ─── KPI GRID ─── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.kpi-tile {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px 24px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.kpi-tile:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.kpi-tile::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: 4px 0 0 4px;
    background: linear-gradient(180deg, var(--blue-600), var(--blue-400));
}

.kpi-tile.green::before {
    background: linear-gradient(180deg, #10b981, #34d399);
}

.kpi-tile.amber::before {
    background: linear-gradient(180deg, #f59e0b, #fbbf24);
}

.kpi-tile-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--blue-50);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--blue-600);
    margin-bottom: 14px;
}

.kpi-tile.green .kpi-tile-icon {
    background: #ecfdf5;
    color: #10b981;
}

.kpi-tile.amber .kpi-tile-icon {
    background: #fffbeb;
    color: #f59e0b;
}

.kpi-tile-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    margin-bottom: 6px;
    display: block;
}

.kpi-tile-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--blue-800);
    line-height: 1;
}

.kpi-tile.green .kpi-tile-value {
    color: #065f46;
}

/* Sub KPIs */
.sub-kpis {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.sub-kpi {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    text-align: center;
}

.sub-kpi-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 6px;
    display: block;
}

.sub-kpi-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--blue-800);
}

/* ─── CHARTS CARD ─── */
.charts-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 20px;
}

.charts-card-header {
    padding: 18px 24px 0;
}

/* ─── NAV TABS CUSTOM ─── */
.nav-tabs-custom {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    margin-bottom: 0;
    list-style: none;
}

.nav-tabs-custom .nav-item {
    margin: 0;
}

.nav-tabs-custom .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 10px 10px 0 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.nav-tabs-custom .nav-link:hover {
    color: var(--blue-600);
    background: var(--blue-50);
}

.nav-tabs-custom .nav-link.active {
    color: var(--blue-600);
    border-bottom-color: var(--blue-600);
    background: var(--blue-50);
}

.tab-content-custom {
    padding: 24px;
}

/* ─── RANKINGS ─── */
.ranking-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.ranking-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border);
}

.ranking-header .rh-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--blue-50);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    color: var(--blue-600);
}

.ranking-header.danger .rh-icon {
    background: #fef2f2;
    color: #dc2626;
}

.ranking-header h6 {
    font-size: 14px;
    font-weight: 700;
    color: var(--blue-800);
    margin: 0;
}

.ranking-header.danger h6 {
    color: #dc2626;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
}

.ranking-table thead th {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    padding: 10px 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.ranking-table tbody tr {
    transition: background 0.15s;
}

.ranking-table tbody tr:hover td {
    background: var(--blue-50);
}

.ranking-table tbody td {
    font-size: 13px;
    color: var(--blue-800);
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.ranking-table tbody tr:last-child td {
    border-bottom: none;
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    background: var(--blue-50);
    color: var(--blue-600);
    margin-right: 8px;
}

.rank-badge.top1 {
    background: #fef9c3;
    color: #b45309;
}
.rank-badge.top2 {
    background: #f1f5f9;
    color: #475569;
}
.rank-badge.top3 {
    background: #fff7ed;
    color: #c2410c;
}

.value-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 700;
    background: var(--blue-50);
    color: var(--blue-600);
}

.value-pill.danger {
    background: #fef2f2;
    color: #dc2626;
}
