/* Selector de año fiscal */
.anyo-selector {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.4rem;
    flex-wrap: wrap;
}

.anyo-selector label {
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
}

.anyo-btn {
    padding: 0.45rem 1.1rem;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-soft);
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}

.anyo-btn.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* Tabs de módulo */
.modo-tabs {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1.4rem;
    flex-wrap: wrap;
}

.modo-tab {
    flex: 1;
    min-width: 120px;
    padding: 0.6rem 0.7rem;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-soft);
    font-family: var(--font-primary);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
    line-height: 1.3;
}

.modo-tab.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.modo-tab i {
    display: block;
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

/* Indicador de resultado */
.irpf-indicator {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-soft);
    margin-top: 1rem;
    grid-column: 1 / -1;
}

.irpf-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.irpf-icon.low {
    background: #d1fae5;
    color: #059669;
}

.irpf-icon.mid {
    background: #dbeafe;
    color: #2563eb;
}

.irpf-icon.high {
    background: #fef3c7;
    color: #d97706;
}

.irpf-icon.veryhigh {
    background: #fee2e2;
    color: #dc2626;
}

.irpf-verdict {
    font-family: var(--font-primary);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-color);
}

.irpf-verdict span {
    display: block;
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

/* Tabla de tramos */
.tabla-tramos {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    font-family: var(--font-primary);
}

.tabla-tramos th {
    background: var(--bg-soft);
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    padding: 0.5rem 0.8rem;
    text-align: right;
    border-bottom: 2px solid var(--border-color);
}

.tabla-tramos th:first-child {
    text-align: left;
}

.tabla-tramos td {
    padding: 0.45rem 0.8rem;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
}

.tabla-tramos td:first-child {
    text-align: left;
}

.tabla-tramos tr.tramo-activo td {
    background: #eff6ff;
    font-weight: 700;
    color: var(--primary-color);
}

.tabla-tramos tr.tramo-pagado td {
    background: #f0fdf4;
    color: #059669;
}

.tabla-wrap {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* Barra visual por tramos */
.barra-tramos {
    margin-top: 1rem;
}

.barra-tramos-track {
    display: flex;
    height: 18px;
    border-radius: 9px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.barra-tramo-seg {
    height: 100%;
    transition: width 0.5s ease;
}

.barra-tramos-leyenda {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.barra-leyenda-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.74rem;
    font-family: var(--font-primary);
    color: var(--text-muted);
}

.barra-leyenda-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* Colores de tramos */
.t0 {
    background: #bfdbfe;
}

.t1 {
    background: #93c5fd;
}

.t2 {
    background: #60a5fa;
}

.t3 {
    background: #3b82f6;
}

.t4 {
    background: #2563eb;
}

.t5 {
    background: #1d4ed8;
}

.t6 {
    background: #1e3a8a;
}

/* Nómina breakdown */
.nomina-breakdown {
    background: var(--bg-soft);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.4rem;
}

.nomina-breakdown h3 {
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.nomina-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    font-family: var(--font-primary);
    font-size: 0.85rem;
}

.nomina-row:last-child {
    border-bottom: none;
}

.nomina-row.total-row {
    font-weight: 700;
    font-size: 0.95rem;
    padding-top: 0.8rem;
    margin-top: 0.2rem;
    border-top: 2px solid var(--border-color);
    border-bottom: none;
}

.nomina-row.total-row .nomina-val {
    color: var(--secondary-color);
}

.nomina-label {
    color: var(--text-muted);
}

.nomina-val {
    font-weight: 600;
    color: var(--text-color);
}

.nomina-val.resta {
    color: #dc2626;
}

.nomina-val.suma {
    color: #059669;
}