:root {
    /* Paleta de Colores Premium */
    --primary-color: #2563eb;
    /* Azul Real */
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    /* Gris Espacial */
    --success-color: #2563eb;
    /* Usamos el azul para éxito para mantener 2 tonos */
    --warning-color: #64748b;
    /* ==========================================================================
   PREMIUM UI COMPONENTS - ANTIGRAVITY v5.0
   ========================================================================== */

/* PREMIUM TOGGLE SWITCH */
.switch-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

input:checked + .slider {
    background-color: #2563eb;
}

input:checked + .slider:before {
    transform: translateX(24px);
}
    /* Ámbar */
    --danger-color: #ef4444;
    /* Rojo Coral */
    --background-dark: #0f172a;
    /* Fondo Oscuro */
    --card-bg: rgba(255, 255, 255, 0.9);
    --sidebar-bg: #1e293b;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;

    /* Gradientes */
    --grad-primary: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --grad-surface: linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(248, 250, 252, 1) 100%);

    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-radius: 0.75rem;
}

/* Aplicación General del Diseño Premium */
body {
    background-color: #f1f5f9;
    color: var(--text-main);    transition: background 0.3s ease;
}

.content-area {
    padding: 1.5rem;
    max-width: 100%;
    margin: 0;
}

/* Estilo Plano sin Tarjetas */
.tab-content {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    margin-top: 1rem;
    animation: fadeInSlide 0.4s ease-out;
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Inputs Refinados */
input[type="number"],
input[type="text"],
select {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.6rem 0.8rem;
    transition: all 0.2s ease;
    background: white;
    width: 100%;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Botones Premium */
#calculateButton,
.pvgis-lookup-box button {
    background: var(--grad-primary);
    color: white;
    font-family: var(--font-headings);
    font-weight: var(--weight-bold);
    border: none;
    border-radius: 8px;
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow-md);
    letter-spacing: 0.01em;
}

#calculateButton:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

#calculateButton:active {
    transform: translateY(0);
}

/* Headers de Pestañas y Secciones */
h3 {
    font-family: var(--font-headings);
    font-size: 1.5rem;
    font-weight: var(--weight-bold);
    color: var(--background-dark);
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
    padding-bottom: 0.3rem;
    letter-spacing: -0.02em;
}

/* Tablas Modernas */
.table-v-idae, .table-vi, .pr-breakdown-table {
    border-radius: 0.8rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    width: 100%;
}

.table-v-idae thead tr, .table-vi thead tr {
    background: #1e293b;
    color: white;
}

.table-v-idae td {
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
    font-size: 0.9rem;
}

.calculated-value-final {
    font-size: 1.1rem !important;
    color: var(--primary-color);
    font-weight: 700;
}

/* Feedback Visual (Semáforo) */
.status-success {
    color: var(--success-color);
    font-weight: 600;
}

.status-warning {
    color: var(--warning-color);
    font-weight: 600;
}

.status-danger {
    color: var(--danger-color);
    font-weight: 600;
}

/* --- NUEVOS ESTILOS PARA EVITAR ABURRIMIENTO VISUAL --- */

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.info-card {
    transition: all 0.3s ease;
}

.info-card:hover {
    /* Removed border and shadow for flat consistency */
}

.info-card h4 {
    font-family: var(--font-headings);
    margin-top: 0;
    margin-bottom: 1.2rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: var(--weight-bold);
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 0.5rem;
    letter-spacing: -0.015em;
}

.input-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.input-row>div {
    flex: 1;
    min-width: 140px;
}

.input-row label, .info-card label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.4rem;
}


/* --- ESTILOS DE TARJETAS TÉCNICAS (PARIDAD ABSOLUTA CON RED) --- */
/* Forzar variables de paridad en el bloque de resumen */
#final-summary-container {
    --primary-color: #2563eb; 
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

#final-summary-container .summary-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#final-summary-container .summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
}

#final-summary-container .summary-card-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: #0f172a;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 2px solid #2563eb !important; /* Estándar Red */
    padding-bottom: 12px;
    width: 100%;
}

#final-summary-container .summary-card-title i {
    color: #2563eb;
    font-size: 1.2rem;
}

#final-summary-container .summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0 !important;
    border-bottom: 1px solid #f1f5f9 !important; /* Línea sólida fina, NO dashed */
    background-color: transparent !important; /* Anticebreado absoluto */
    background: transparent !important;
}

#final-summary-container .summary-item:last-child {
    border-bottom: none !important;
}

#final-summary-container .summary-item .label {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 400; /* Regular, no bold */
}

#final-summary-container .summary-item .value {
    font-size: 1rem;
    font-weight: 700 !important; /* Bold standard, no extra bold */
    color: #0f172a;
    padding: 0;
    background: transparent !important;
    border-radius: 0;
}

#final-summary-container .summary-item .value.ok { color: #16a34a !important; background: transparent !important; }
#final-summary-container .summary-item .value.warn { color: #ca8a04 !important; background: transparent !important; }
#final-summary-container .summary-item .value.fail { color: #dc2626 !important; background: transparent !important; }

/* RECOMENDACIONES DE EQUIPO REINVENTADAS */
.recommendation-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.recommendation-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
}

.recommendation-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.recommendation-card.selected {
    border: 2px solid var(--primary-color);
    background: #f0f7ff;
}

.recommendation-card h5 {
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    color: #0f172a;
    font-weight: 700;
}

.recommendation-card .why {
    font-size: 0.85rem;
    color: #475569;
    background: #f8fafc;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 3px solid var(--primary-color);
}

.recommendation-card ul {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    font-size: 0.85rem;
    color: #64748b;
    flex-grow: 1;
}

.recommendation-card ul li {
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
}

.recommendation-card ul li strong { color: #334155; }

.string-viability {
    padding: 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    margin-bottom: 15px;
    line-height: 1.4;
}

.viability-ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.viability-warn { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.viability-fail { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

.recommendation-card button {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.recommendation-card:not(.selected) button {
    background: #f1f5f9;
    color: #475569;
}

.recommendation-card:not(.selected) button:hover {
    background: #e2e8f0;
}

.recommendation-card.selected button {
    background: var(--primary-color);
    color: white;
}

/* ---------------------------------------------------
   BRAND PILLS FILTER
--------------------------------------------------- */
.brand-pills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
}

.brand-pill {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.brand-pill:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

.brand-pill.selected {
    background: #2563eb;
    border-color: #2563eb;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
}

.brand-pill.selected::before {
    content: "✓";
    font-size: 0.9em;
}

.brand-pill[data-brand="all"] {
    font-weight: 700;
}

/* ==========================================================================
   TOAST NOTIFICATIONS (Mode Change, etc.)
   ========================================================================== */
.toast-notification {
    position: fixed;
    bottom: 32px;
    right: 24px;
    top: auto;
    left: auto;
    transform: none;
    z-index: 9999;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 12px 24px;
    border-radius: 999px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 260px;
    animation: toastIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.toast-icon {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.2);
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.toast-text {
    display: flex;
    flex-direction: column;
}

.toast-text strong {
    font-size: 0.95rem;
    font-weight: 700;
}

.toast-text small {
    font-size: 0.8rem;
    color: #94a3b8;
}

/* Normalizacion tipografica: Resumen Tecnico y Seleccion de Equipo */
#tabConfig,
#tabTechnical {
    font-family: var(--font-main);
}

#tabConfig .section-title-centered,
#tabTechnical #final-selection-container > h2 {
    font-family: var(--font-headings);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.015em;
}

#tabConfig #final-summary-container .summary-card-title,
#tabTechnical #final-summary-container .summary-card-title {
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 600;
}

#tabConfig #final-summary-container .summary-item,
#tabTechnical #final-summary-container .summary-item {
    font-size: 0.92rem;
}

#tabConfig #final-summary-container .summary-item .label,
#tabTechnical #final-summary-container .summary-item .label {
    font-family: var(--font-main);
    font-size: 0.88rem;
    font-weight: 500;
}

#tabConfig #final-summary-container .summary-item .value,
#tabTechnical #final-summary-container .summary-item .value {
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 600 !important;
}

#tabConfig .component-selection-box h4,
#tabTechnical .component-selection-box h4 {
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 600;
}

#tabConfig .component-selection-box label,
#tabTechnical .component-selection-box label,
#string-validation-module label,
#grid-string-validation label {
    font-family: var(--font-main);
    font-size: 0.88rem;
    font-weight: 500 !important;
}

/* Normalizacion tipografica: otras pestanas (Aislada) */
#tabFI,
#tabBaterias,
#tabPliego,
#tabOrdenTrabajo,
#tabGraficas {
    font-family: var(--font-main);
}

#tabFI h3,
#tabBaterias h3,
#tabPliego h3,
#tabGraficas h3,
#tabOrdenTrabajo .work-order-header h2 {
    font-weight: 600;
}

#tabFI label,
#tabBaterias label,
#tabGraficas label {
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 500 !important;
}

#tabFI small,
#tabBaterias small,
#tabGraficas small {
    font-size: 0.82rem !important;
    font-weight: 400 !important;
}

#tabBaterias #battery-validator-module h4,
#tabBaterias #battery-validator-module p,
#tabBaterias #battery-validator-module label,
#tabBaterias #battery-validator-module span,
#tabBaterias #battery-validator-module small {
    font-family: var(--font-main);
}

#tabBaterias #battery-validator-module h4 {
    font-size: 1rem !important;
    font-weight: 600 !important;
}

#tabBaterias #battery-validator-module p,
#tabBaterias #battery-validator-module span,
#tabBaterias #battery-validator-module label {
    font-size: 0.9rem !important;
    font-weight: 500 !important;
}

#tabBaterias #battery-validator-module input,
#tabBaterias #battery-validator-module select {
    font-size: 0.95rem !important;
    font-weight: 500 !important;
}

#tabPliego .page-content,
#tabPliego .page-content p,
#tabPliego .page-content td,
#tabPliego .page-content th,
#tabPliego .page-content label,
#tabPliego .page-content span {
    font-family: var(--font-main);
    font-weight: 500;
}

#tabPliego .page-content p,
#tabPliego .page-content td,
#tabPliego .page-content th,
#tabPliego .page-content span,
#tabPliego .page-content [style*="font-size"] {
    font-size: 0.9rem !important;
}

#tabPliego .page-content h2 {
    font-size: 1.35rem;
    font-weight: 600;
}

#tabOrdenTrabajo .work-order-container,
#tabOrdenTrabajo .work-order-container p,
#tabOrdenTrabajo .work-order-container span,
#tabOrdenTrabajo .work-order-container div,
#tabOrdenTrabajo .work-order-container li {
    font-family: var(--font-main);
}

#tabOrdenTrabajo .work-order-container h2,
#tabOrdenTrabajo .work-order-container h4 {
    font-weight: 600 !important;
}

#tabOrdenTrabajo .work-order-container p,
#tabOrdenTrabajo .work-order-container span,
#tabOrdenTrabajo .work-order-container li,
#tabOrdenTrabajo .work-order-container [style*="font-size"] {
    font-size: 0.9rem !important;
    font-weight: 500 !important;
}

