/* Tarjetas tipo calculadora (recetas compuestas) + utilidades Gestión Comercial */

/* ===== Costos directos: tarjetas lista ===== */
.cd-card {
    border: 1px solid var(--light-gray);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.cd-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.cd-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1.1rem;
    background: var(--light-beige);
    border-bottom: 1px solid var(--light-gray);
}
.cd-card__title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
    letter-spacing: 0.01em;
}
.cd-card__title-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--light-gray);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 0.9rem;
}
.cd-card__count {
    background: var(--primary-color);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    margin-left: 4px;
}
.cd-card__add-btn {
    background: var(--primary-color);
    color: #fff;
    border: none;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: filter 0.15s ease;
}
.cd-card__add-btn:hover {
    filter: brightness(0.92);
    color: #fff;
}
.cd-card__body {
    padding: 0.5rem 0.5rem;
    flex: 1 1 auto;
}
.cd-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.cd-list__item {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    transition: background 0.15s ease;
}
.cd-list__item + .cd-list__item {
    border-top: 1px dashed var(--light-gray);
}
.cd-list__item:hover {
    background: var(--light-beige);
}
.cd-list__name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.92rem;
    line-height: 1.2;
    word-break: break-word;
}
.cd-list__qty {
    font-size: 0.82rem;
    color: #6b6b6b;
    background: var(--light-beige);
    padding: 3px 9px;
    border-radius: 999px;
    white-space: nowrap;
}
.cd-list__amount {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 0.95rem;
    white-space: nowrap;
    min-width: 80px;
    text-align: right;
}
.cd-list__actions .btn {
    border-color: transparent;
    color: var(--secondary-color);
    padding: 4px 8px;
}
.cd-list__actions .btn:hover {
    background: rgba(181, 122, 119, 0.12);
    color: var(--secondary-color);
}
.cd-empty {
    text-align: center;
    padding: 1.5rem 1rem;
    color: #8a8a8a;
}
.cd-empty__icon {
    font-size: 1.6rem;
    opacity: 0.4;
    margin-bottom: 0.5rem;
}
.cd-empty__btn {
    margin-top: 0.5rem;
    background: transparent;
    color: var(--primary-color);
    border: 1.5px dashed var(--primary-color);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 6px 14px;
    border-radius: 8px;
    transition: background 0.15s ease;
}
.cd-empty__btn:hover {
    background: var(--light-beige);
    color: var(--primary-color);
}
.cd-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 1.1rem;
    background: var(--light-beige);
    border-top: 1px solid var(--light-gray);
    font-weight: 700;
    color: var(--primary-color);
}
.cd-card__footer.flex-column {
    flex-direction: column;
    align-items: stretch;
}
.cd-card__header.card-header-accent {
    background-color: var(--accent-color);
    border-bottom: 2px solid #8a9a8c;
    color: #fff;
}
.cd-card__footer-amount {
    font-size: 1.05rem;
}
@media (max-width: 480px) {
    .cd-list__item {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "name actions"
            "qty amount";
        row-gap: 4px;
    }
    .cd-list__name {
        grid-area: name;
    }
    .cd-list__actions {
        grid-area: actions;
    }
    .cd-list__qty {
        grid-area: qty;
        justify-self: start;
    }
    .cd-list__amount {
        grid-area: amount;
    }
}

/* ===== Gestión Comercial (ventas) ===== */
.ventas-module .ventas-client-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #7a5240 100%);
    color: #fff;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 14px rgba(97, 64, 47, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.ventas-module .ventas-client-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 2rem;
    border: 3px solid rgba(255, 255, 255, 0.25);
}
.ventas-module .ventas-section-title {
    background-color: var(--carnecito);
    color: var(--primary-color);
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}
.ventas-module .ventas-contact-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.ventas-module .ventas-contact-row:last-child {
    margin-bottom: 0;
}
.ventas-module .ventas-contact-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--light-beige);
    border: 1px solid var(--light-gray);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--icon-cafe);
    font-size: 0.85rem;
    flex-shrink: 0;
}
.ventas-module .ventas-stat-panel {
    border: 1px solid var(--light-gray);
    border-radius: 10px;
    overflow: hidden;
    background: var(--light-color);
}
.ventas-module .ventas-stat-panel__grid {
    display: grid;
    grid-template-columns: 1fr 1px 1fr;
    grid-template-rows: auto 1px auto;
    align-items: stretch;
}
.ventas-module .ventas-stat-panel__cell {
    padding: 1rem 0.75rem;
    text-align: center;
}
.ventas-module .ventas-stat-panel__cell--tl {
    grid-column: 1;
    grid-row: 1;
}
.ventas-module .ventas-stat-panel__cell--tr {
    grid-column: 3;
    grid-row: 1;
}
.ventas-module .ventas-stat-panel__cell--bottom {
    grid-column: 1 / -1;
    grid-row: 3;
}
.ventas-module .ventas-stat-panel__divider-v {
    background: var(--light-gray);
    grid-column: 2;
    grid-row: 1;
}
.ventas-module .ventas-stat-panel__divider-h {
    grid-column: 1 / -1;
    grid-row: 2;
    height: 1px;
    background: var(--light-gray);
    margin: 0;
}
.ventas-module .ventas-stat-panel__value {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 0.25rem;
}
.ventas-module .ventas-stat-panel__value--primary {
    color: var(--primary-color);
}
.ventas-module .ventas-stat-panel__value--accent {
    color: var(--accent-color);
}
.ventas-module .ventas-stat-panel__value--muted {
    color: var(--accent-beige);
}
.ventas-module .ventas-stat-panel__label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin: 0;
}
.ventas-module .ventas-pedido-card {
    border: 1px solid var(--light-gray);
    border-radius: 12px;
    background: #fff;
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease;
    position: relative;
}
.ventas-module .ventas-pedido-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-color);
    border-radius: 12px 0 0 12px;
}
.ventas-module .ventas-pedido-card:hover {
    box-shadow: 0 4px 12px rgba(97, 64, 47, 0.1);
}
.ventas-module .ventas-pedido-card .card-body {
    padding-left: 1.25rem;
}
.ventas-module .ventas-producto-pill {
    background: var(--light-beige);
    border: 1px solid var(--light-gray);
    border-radius: 999px;
    padding: 6px 12px;
    margin: 4px 0;
    border-left: 3px solid var(--primary-color);
}
.ventas-module .ventas-status-badge {
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    display: inline-block;
}
/* 1. Cotizando — Amarillo #D8BE8A */
.ventas-module .status-cotizando {
    background: rgba(216, 190, 138, 0.22);
    color: #7a6030;
    border: 1px solid #D8BE8A;
}
/* 2. Confirmado — Lavanda #A8A1B5 */
.ventas-module .status-confirmado {
    background: rgba(168, 161, 181, 0.2);
    color: #5a5270;
    border: 1px solid #A8A1B5;
}
/* 3. Enviado — verde té #8DA27E */
.ventas-module .status-enviado {
    background: rgba(141, 162, 126, 0.2);
    color: #3d5c30;
    border: 1px solid #8DA27E;
}
/* Legacy aliases ( datos / caché ) */
.ventas-module .status-entregado_pago_pendiente {
    background: rgba(141, 162, 126, 0.2);
    color: #3d5c30;
    border: 1px solid #8DA27E;
}
.ventas-module .status-entregado_pagado {
    background: rgba(141, 162, 126, 0.2);
    color: #3d5c30;
    border: 1px solid #8DA27E;
}
/* 5. Cancelado — Frambuesa #9B6A74 */
.ventas-module .status-cancelado,
.ventas-module .status-cancelada {
    background: rgba(155, 106, 116, 0.18);
    color: #6e3840;
    border: 1px solid #9B6A74;
}
/* Legacy fallbacks (en caso de filas no migradas aún) */
.ventas-module .status-en_proceso {
    background: rgba(168, 161, 181, 0.2);
    color: #5a5270;
    border: 1px solid #A8A1B5;
}
.ventas-module .status-entregado {
    background: rgba(141, 162, 126, 0.2);
    color: #3d5c30;
    border: 1px solid #8DA27E;
}
.ventas-module .status-pendiente {
    background: rgba(216, 190, 138, 0.22);
    color: #7a6030;
    border: 1px solid #D8BE8A;
}
.ventas-module .ventas-btn-action {
    border-radius: 8px;
    padding: 8px 18px;
    font-weight: 600;
    transition: filter 0.15s ease, box-shadow 0.2s ease;
}
.ventas-module .ventas-btn-action:hover {
    filter: brightness(0.97);
}
.ventas-module .ventas-table-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}
.ventas-module .ventas-table-actions .btn-icon-only {
    width: 2rem;
    height: 2rem;
    min-width: 2rem;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    line-height: 1;
}
.ventas-module .ventas-table-actions .btn-icon-only .fa-eye {
    color: var(--primary-color) !important;
    transition: color 0.18s ease, transform 0.18s ease;
}
.ventas-module .ventas-table-actions .btn-icon-only:hover .fa-eye {
    color: #4d3325 !important;
}
.ventas-module .ventas-table-actions .btn-icon-only .fa-pencil {
    color: var(--accent-beige) !important;
    transition: color 0.18s ease, transform 0.18s ease;
}
.ventas-module .ventas-table-actions .btn-icon-only:hover .fa-pencil {
    color: var(--primary-color) !important;
}
.ventas-module .ventas-table-actions .btn-icon-only .icon-trash-universal {
    color: var(--secondary-color) !important;
}
.ventas-module .ventas-table-actions .btn-icon-only:hover .icon-trash-universal {
    color: #c0515e !important;
}
.ventas-module .ventas-search-card {
    border: 1px solid var(--light-gray);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    margin-bottom: 1.5rem;
}
.ventas-module .ventas-table-wrap {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--light-gray);
    background: var(--light-color);
}
.ventas-module .ventas-table {
    margin-bottom: 0;
}
.ventas-module .ventas-table thead th {
    background: var(--light-beige);
    color: var(--primary-color);
    font-weight: 700;
    border-bottom: 2px solid var(--light-gray);
    padding: 0.85rem 1rem;
    vertical-align: middle;
}
.ventas-module .ventas-table tbody td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    border-color: var(--light-gray);
}
.ventas-module .ventas-table tbody tr:hover {
    background: var(--carnecito);
}
.ventas-module .badge.bg-primary {
    background-color: var(--primary-color) !important;
}
.ventas-module .badge.bg-success {
    background-color: var(--accent-color) !important;
}
.ventas-module .badge.bg-warning {
    background-color: var(--accent-beige) !important;
    color: var(--text-color) !important;
}
.ventas-module .badge.bg-info {
    background-color: var(--light-beige) !important;
    color: var(--text-color) !important;
    border: 1px solid var(--light-gray);
}
.ventas-module .badge.bg-danger {
    background-color: var(--secondary-color) !important;
}
.ventas-module .ventas-page-head {
    margin-bottom: 1.5rem;
}
.ventas-module .ventas-periodo-bar {
    border: 1px solid var(--light-gray);
    border-radius: 12px;
    background: #fff;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.ventas-module .ventas-periodo-btn {
    border-radius: 8px;
    padding: 0.5rem 1rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    background: var(--light-color);
    border: 1px solid var(--light-gray);
    color: var(--text-color);
    font-weight: 600;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.ventas-module .ventas-periodo-btn:hover:not(.active) {
    background: var(--light-beige);
    border-color: var(--accent-beige);
}
.ventas-module .ventas-periodo-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}
.ventas-module .ventas-metric-card {
    border: 1px solid var(--light-gray);
    border-radius: 12px;
    background: #fff;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: box-shadow 0.2s ease;
}
.ventas-module .ventas-metric-card:hover {
    box-shadow: 0 4px 12px rgba(97, 64, 47, 0.08);
}
.ventas-module .ventas-metric-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
}
.ventas-module .ventas-metric-label {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 600;
}
.ventas-module .ventas-export-btn {
    border-radius: 8px;
    padding: 0.5rem 1.25rem;
    font-weight: 600;
    background: var(--accent-color);
    border: none;
    color: #fff;
}
.ventas-module .ventas-export-btn:hover {
    filter: brightness(0.95);
    color: #fff;
}
