﻿/* ============================================================================
   ASIGNAR COMERCIO A PRODUCTOS — estilos alineados al sistema MAXIMA
   Reemplaza completamente el contenido anterior.
   Archivo: Maxima.Web/Maxima.Web/wwwroot/css/assign-business.css
   ============================================================================ */


/* ─── Container principal ────────────────────────────────────── */
.asign-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 32px;
}


/* ─── Header de página ───────────────────────────────────────── */
.asign-page-header {
    margin-bottom: 28px;
}

.asign-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a202c;
    margin: 0 0 4px;
    letter-spacing: -0.01em;
}

.asign-subtitle {
    color: #6b7280;
    font-size: 0.95rem;
    margin: 0;
}


/* ─── Stepper ─────────────────────────────────────────────────── */
.asign-stepper {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 24px;
    padding: 20px 24px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.asign-step {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.asign-step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.asign-step.active .asign-step-circle {
    background: #7c3aed;
    color: white;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.15);
}

.asign-step.completed .asign-step-circle {
    background: #10b981;
    color: white;
}

.asign-step-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    white-space: nowrap;
}

.asign-step.active .asign-step-text {
    color: #7c3aed;
    font-weight: 600;
}

.asign-step.completed .asign-step-text {
    color: #10b981;
}

.asign-step-line {
    flex: 1;
    height: 2px;
    background: #e5e7eb;
    margin: 0 12px;
    min-width: 30px;
    transition: background 0.2s;
}

    .asign-step-line.completed {
        background: #10b981;
    }


/* ─── Cards (igual que el resto del sistema) ─────────────────── */
.asign-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    overflow: hidden;
    margin-bottom: 24px;
}

.asign-card-header {
    padding: 20px 28px;
    border-bottom: 1px solid #f3f4f6;
}

.asign-card-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #1a202c;
    margin: 0;
    display: flex;
    align-items: center;
}

.asign-card-body {
    padding: 24px 28px;
}


/* ─── Stats / KPI cards (estilo de los del dashboard) ────────── */
.asign-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin: 16px 0 24px;
}

.asign-stat {
    background: white;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #6b7280;
    border-radius: 12px;
    padding: 16px 20px;
}

.asign-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a202c;
    line-height: 1.1;
    margin-bottom: 2px;
}

.asign-stat-label {
    font-size: 0.8rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.asign-stat-success {
    border-left-color: #10b981;
}

    .asign-stat-success .asign-stat-value {
        color: #059669;
    }

.asign-stat-warning {
    border-left-color: #f59e0b;
}

    .asign-stat-warning .asign-stat-value {
        color: #d97706;
    }

.asign-stat-danger {
    border-left-color: #ef4444;
}

    .asign-stat-danger .asign-stat-value {
        color: #dc2626;
    }

.asign-stat-muted {
    border-left-color: #9ca3af;
}


/* ─── Tip box (info contextual) ──────────────────────────────── */
.asign-tip {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #0c4a6e;
}

    .asign-tip i {
        color: #0284c7;
        flex-shrink: 0;
        margin-top: 2px;
    }


/* ─── Upload area ────────────────────────────────────────────── */
.asign-upload {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 32px 24px;
    text-align: center;
    background: #f9fafb;
    margin-bottom: 20px;
}

.asign-upload-icon {
    font-size: 2.5rem;
    color: #9ca3af;
    display: block;
    margin-bottom: 12px;
}

.asign-upload .form-control {
    max-width: 400px;
    margin: 0 auto;
}

.asign-file-info {
    color: #374151;
    font-size: 0.95rem;
}


/* ─── Alerts (errors, warnings) ──────────────────────────────── */
.asign-alert {
    border-radius: 12px;
    padding: 16px 20px;
    margin: 16px 0;
}

.asign-alert-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.asign-alert-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

    .asign-alert-danger .asign-alert-header i {
        color: #dc2626;
    }

.asign-alert-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

    .asign-alert-warning .asign-alert-header i {
        color: #f59e0b;
    }


/* ─── Tabla de issues (errores de validación) ────────────────── */
.asign-issues-table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

    .asign-issues-table thead th {
        background: #f9fafb;
        color: #374151;
        font-weight: 600;
        font-size: 0.85rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        border-bottom: 2px solid #e5e7eb;
    }

    .asign-issues-table tbody td {
        padding: 10px 12px;
        color: #4b5563;
        font-size: 0.9rem;
    }

    .asign-issues-table code {
        background: #f3f4f6;
        padding: 2px 6px;
        border-radius: 4px;
        font-size: 0.85rem;
        color: #6b7280;
    }


/* ─── Filtros (chips) ────────────────────────────────────────── */
.asign-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    background: #f9fafb;
    border-radius: 12px;
    margin: 16px 0 20px;
}

.asign-filters-label {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 500;
    margin-right: 8px;
}

.asign-chip {
    background: white;
    border: 1px solid #d1d5db;
    color: #374151;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
}

    .asign-chip:hover:not(:disabled) {
        background: #f3f4f6;
        border-color: #9ca3af;
    }

    .asign-chip:disabled {
        opacity: 0.4;
        cursor: not-allowed;
    }

.asign-chip-count {
    margin-left: 6px;
    background: #e5e7eb;
    color: #6b7280;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.asign-chip.active {
    background: #7c3aed;
    color: white;
    border-color: #7c3aed;
}

    .asign-chip.active .asign-chip-count {
        background: rgba(255,255,255,0.25);
        color: white;
    }

.asign-chip-success.active {
    background: #10b981;
    border-color: #10b981;
}

.asign-chip-warning.active {
    background: #f59e0b;
    border-color: #f59e0b;
}

.asign-chip-muted.active {
    background: #6b7280;
    border-color: #6b7280;
}


/* ─── Tabla principal del preview ────────────────────────────── */
.asign-table-wrap {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    overflow-x: auto;
}

.asign-table {
    margin: 0;
    font-size: 0.9rem;
}

    .asign-table thead th {
        background: #f9fafb;
        color: #374151;
        font-weight: 600;
        font-size: 0.8rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        padding: 12px 16px;
        border-bottom: 2px solid #e5e7eb;
    }

    .asign-table tbody tr {
        transition: background 0.1s;
    }

        .asign-table tbody tr:hover {
            background: #f9fafb;
        }

    .asign-table tbody td {
        padding: 12px 16px;
        color: #1a202c;
        vertical-align: middle;
    }

.asign-code {
    background: #f3f4f6;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #4b5563;
    font-family: 'Courier New', monospace;
}

.asign-truncate {
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* ─── Badges por acción (en la tabla) ────────────────────────── */
.asign-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

    .asign-badge i {
        font-size: 0.85rem;
    }

.asign-badge-success {
    background: #d1fae5;
    color: #065f46;
}

.asign-badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.asign-badge-muted {
    background: #f3f4f6;
    color: #6b7280;
}


/* ─── Estado vacío ───────────────────────────────────────────── */
.asign-empty {
    text-align: center;
    padding: 48px 24px;
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    border-radius: 12px;
    color: #6b7280;
    margin: 16px 0;
}

    .asign-empty i {
        font-size: 2.5rem;
        color: #9ca3af;
        display: block;
        margin-bottom: 12px;
    }

    .asign-empty p {
        margin: 0;
        font-size: 0.95rem;
    }


/* ─── Paginación ─────────────────────────────────────────────── */
.asign-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin: 16px 0;
    font-size: 0.875rem;
}

.asign-pagination-info {
    color: #4b5563;
}

.asign-pagination-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.asign-page-size-wrap {
    display: flex;
    align-items: center;
}

.asign-page-size-select {
    width: auto;
    display: inline-block;
}

.asign-page-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
}

    .asign-page-buttons .btn {
        padding: 4px 10px;
        line-height: 1;
        border-radius: 6px;
    }

        .asign-page-buttons .btn:disabled {
            opacity: 0.35;
        }

.asign-page-indicator {
    color: #4b5563;
    padding: 0 12px;
    white-space: nowrap;
    font-size: 0.875rem;
}


/* ─── Confirmación de sobreescrituras ────────────────────────── */
.asign-confirm {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 12px;
    padding: 16px 20px;
    margin: 20px 0;
}

    .asign-confirm .form-check-label {
        color: #92400e;
        font-size: 0.95rem;
        cursor: pointer;
    }

    .asign-confirm .form-check-input {
        margin-top: 0.2rem;
    }

        .asign-confirm .form-check-input:checked {
            background-color: #f59e0b;
            border-color: #f59e0b;
        }


/* ─── Loader (paso 4) ────────────────────────────────────────── */
.asign-loader {
    text-align: center;
    padding: 64px 24px;
}

    .asign-loader h3 {
        color: #1a202c;
        font-weight: 600;
    }


/* ─── Acciones (botones al final de cada paso) ───────────────── */
.asign-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f3f4f6;
}

    .asign-actions .btn {
        min-width: 140px;
        font-weight: 500;
    }


/* ─── Toast de error global ──────────────────────────────────── */
.asign-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: white;
    border: 1px solid #fca5a5;
    border-left: 4px solid #dc2626;
    color: #991b1b;
    padding: 14px 48px 14px 16px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    max-width: 420px;
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.9rem;
}

    .asign-toast > i {
        color: #dc2626;
        font-size: 1.1rem;
        flex-shrink: 0;
        margin-top: 1px;
    }

.asign-toast-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: #991b1b;
    padding: 4px 8px;
    line-height: 1;
}

    .asign-toast-close:hover {
        color: #7f1d1d;
    }


/* ─── Override del color primario para alinear con MAXIMA ────── */
.asign-page .btn-primary {
    background-color: #7c3aed;
    border-color: #7c3aed;
    font-weight: 500;
    padding: 8px 20px;
    border-radius: 8px;
}

    .asign-page .btn-primary:hover:not(:disabled) {
        background-color: #6d28d9;
        border-color: #6d28d9;
    }

    .asign-page .btn-primary:disabled {
        background-color: #c4b5fd;
        border-color: #c4b5fd;
        opacity: 1;
    }

.asign-page .btn-light {
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 500;
}


/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 992px) {
    .asign-page {
        padding: 16px 20px;
    }

    .asign-stepper {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 16px;
    }

    .asign-step-text {
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {
    .asign-pagination {
        flex-direction: column;
        align-items: stretch;
    }

    .asign-pagination-info {
        text-align: center;
    }

    .asign-pagination-controls {
        justify-content: center;
        gap: 12px;
    }

    .asign-actions {
        flex-direction: column-reverse;
    }

        .asign-actions .btn {
            width: 100%;
        }
}
