/* ----- RESET Y VARIABLES ----- */

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

body {
    font-family: 'Inter', sans-serif;
    background: #f9fafc;
    color: #1e293b;
    line-height: 1.5;
    padding: 2rem 1rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}


/* ----- TARJETAS ----- */

.card {
    background: #ffffff;
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    transition: transform .15s ease, box-shadow .15s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.08);
}


/* ----- TÍTULOS ----- */

h1 {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: #64748b;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.label-title {
    display: block;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 0.8rem;
    letter-spacing: 0.05em;
}


/* ----- CUSTOM SELECT DROP DOWN ----- */

.custom-select-wrapper {
    position: relative;
    width: 100%;
    user-select: none;
}

.select-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    font-size: 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.select-btn:hover {
    border-color: #3b82f6;
}

.custom-select-wrapper.active .select-btn {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.arrow-icon {
    border: solid #64748b;
    border-width: 0 2px 2px 0;
    display: inline-block;
    padding: 3px;
    transform: rotate(45deg);
    transition: transform 0.3s ease;
}

.custom-select-wrapper.active .arrow-icon {
    transform: rotate(-135deg);
}

.select-content {
    position: absolute;
    width: 100%;
    margin-top: 8px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 100;
    overflow: hidden;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.custom-select-wrapper.active .select-content {
    display: block;
}

.search-container {
    padding: 12px;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
}

.search-container input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    outline: none;
    font-size: 0.95rem;
    font-family: inherit;
}

.search-container input:focus {
    border-color: #3b82f6;
}

.options-list {
    max-height: 280px;
    overflow-y: auto;
    margin: 0;
    padding: 6px;
    list-style: none;
}

.options-list li {
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.options-list li:hover {
    background: #eff6ff;
    color: #3b82f6;
}

.options-list li.no-result {
    padding: 20px;
    color: #94a3b8;
    text-align: center;
}


/* ----- GRID Y LAYOUT ----- */

.row {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    width: 100%;
}


/* Sistema de 6 columnas para métricas */

.row-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}


/* Proporciones de las columnas corregidas */

.col-4 {
    flex: 0 0 calc(33.333% - 1rem);
    min-width: 200px;
}

.col-8 {
    flex: 1;
    min-width: 300px;
}

.col-6 {
    flex: 1;
    min-width: 300px;
}

.col-12 {
    flex: 0 0 100%;
    width: 100%;
}


/* MARGEN INFERIOR ESTÁNDAR PARA FILAS */

.mb-4 {
    margin-bottom: 1.5rem;
}


/* ESTILO REPLICADO PARA calculatorUI BASADO EN row mb-4 */

#calculatorUI {
    margin-bottom: 1.5rem;
}


/* ----- METRICAS ----- */

.metric-card {
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    transition: all 0.2s;
    min-height: 90px;
}

.col-metric:nth-child(1) .metric-card {
    border-color: #007bff;
}

.col-metric:nth-child(1) .metric-value {
    color: #007bff;
}

.col-metric:nth-child(2) .metric-card {
    border-color: #28a745;
}

.metric-card.editable-card {
    border-color: #28a745;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.1);
}

.col-metric:nth-child(3) .metric-card {
    border-color: #fd7e14;
}

.col-metric:nth-child(3) .metric-value {
    color: #fd7e14;
}

.col-metric:nth-child(4) .metric-card {
    border-color: #dc3545;
}

.col-metric:nth-child(4) .metric-value {
    color: #dc3545;
}

.col-metric:nth-child(5) .metric-card {
    border-color: #6f42c1;
}

.col-metric:nth-child(5) .metric-value {
    color: #6f42c1;
}

.col-metric:nth-child(6) .metric-card {
    border-color: #e83e8c;
}

.col-metric:nth-child(6) .metric-value {
    color: #e83e8c;
}

.metric-label {
    display: block;
    color: #64748b;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
    letter-spacing: 0.02em;
}

.metric-value {
    display: block;
    font-size: 1.2rem;
    font-weight: 800;
}


/* ----- ESTILO SENCILLO PARA RADIOS (ZONA) ----- */

.col-4 input[type="radio"] {
    accent-color: #3b82f6;
    /* Color azul congruente con el slider */
    transform: scale(1.1);
    cursor: pointer;
}

.col-4 label:has(input[type="radio"]) {
    color: #475569;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.col-4 label:hover {
    color: #3b82f6;
}


/* ----- INPUT PLAIN DENTRO DE CARD ----- */

.editable-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.input-plain {
    border: none;
    background: transparent;
    font-size: 1.3rem;
    font-weight: 800;
    color: #28a745;
    width: 65px;
    text-align: center;
    outline: none;
    padding: 0;
}

.unit {
    font-weight: 800;
    color: #28a745;
    font-size: 1.1rem;
}


/* ----- INPUTS Y SLIDERS ----- */

input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 5px;
    background-image: linear-gradient(#3b82f6, #3b82f6);
    background-size: 0% 100%;
    background-repeat: no-repeat;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 22px;
    width: 22px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border: 2px solid #3b82f6;
}


/* ----- RESULTADO UTILIDAD ----- */

.profit-card {
    background: #1e293b;
    color: white;
    padding: 2.5rem;
    border-radius: 16px;
    border: none;
}

.bg-profit-success {
    background: #10b981;
}

.bg-profit-warning {
    background: #f59e0b;
}

.bg-profit-danger {
    background: #ef4444;
}


/* ----- DESGLOSE ----- */

.breakdown-item {
    background: #f8fafc;
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    font-weight: 500;
    border: 1px solid #f1f5f9;
}


/* Regla para que los valores calculados en el desglose sean Bold */

#dppAmountDisplay,
#utilidadBreakdown,
#costoNetoBreakdown,
#ventaIVADisplay,
#ventaSinIVADisplay,
#costoBrutoDisplay {
    font-weight: 700;
}


/* ----- BOTÓN REINICIAR ----- */

.reset-btn {
    background: #0c5df5;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    border: none;
}

.reset-btn:hover {
    background: #0849c4;
    transform: translateY(-1px);
}

#priceListInfo span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.price-info {
    margin-bottom: 1.5rem;
    padding: 0.5rem 1rem;
    background: #ffffff;
    border-radius: 8px;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.info-label {
    color: #475569;
    font-weight: 600;
}

.info-value {
    font-weight: 800;
}

.info-date {
    color: #006bcf;
}

.info-list {
    color: #7200cf;
}