/* ============================================================ */
/* PENDING ASSIGN — Asignaciones pendientes de ventas          */
/* ============================================================ */

/* ---- Tokens ---- */
:root {
    --navy:         #0f172a;
    --navy-light:   #1e293b;
    --blue:         #2563eb;
    --blue-hover:   #1d4ed8;
    --teal:         #0891b2;
    --oliva:        #16a34a;
    --amber:        #d97706;
    --rose:         #e11d48;
    --purple:       #7c3aed;
    --amber-soft:   #fef3c7;
    --rose-soft:    #ffe4e6;
    --border:       #e2e8f0;
    --bg:           #f8fafc;
    --surface:      #ffffff;
    --text-primary: #0f172a;
    --text-muted:   #475569;
    --text-subtle:  #94a3b8;
}

body:has(.view) {
    background: linear-gradient(135deg, #e2e8f0 0%, #f8fafc 100%);
    min-height: 100vh;
    margin: 0;
}

/* ============================================================ */
/* CONTENEDOR PRINCIPAL (LA VENTANA)                             */
/* ============================================================ */
.view {
    padding: 2.5rem 3rem;
    font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    min-height: calc(100vh - 4rem);
    max-width: 1400px;
    margin: 2rem auto;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0,0,0,0.05), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.4);
    width: 95%;
    box-sizing: border-box;
    color: var(--text-primary);
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================ */
/* CABECERA DE PÁGINA                                            */
/* ============================================================ */
.view .page-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}

.view .breadcrumb {
    font-size: 0.8rem;
    color: var(--text-subtle);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: none;
    padding: 0;
    font-weight: 500;
}

.view .breadcrumb a {
    color: var(--blue);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.view .breadcrumb a:hover {
    color: var(--blue-hover);
}

.view .page-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.view .page-title {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0 0 0.4rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.view .page-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0;
    max-width: 600px;
    line-height: 1.5;
}

.view .page-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ============================================================ */
/* ALERT / BANNER INFO                                           */
/* ============================================================ */
.view .alert {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    font-size: 0.9rem;
    line-height: 1.5;
    border: 1px solid transparent;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.view .alert-info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

.view .alert-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.05rem;
    font-style: normal;
}

/* ============================================================ */
/* TABLA                                                         */
/* ============================================================ */
.view .table-wrapper {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.view .table-wrapper:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

.view .table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin-bottom: 0;
}

.view .table thead tr {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
}

.view .table th {
    padding: 1rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #f8fafc;
    text-align: left;
    border: none;
    white-space: nowrap;
}

.view .table th.num,
.view .table td.num {
    text-align: right;
}

.view .table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: all 0.2s ease;
}

.view .table tbody tr:last-child {
    border-bottom: none;
}

.view .table td {
    padding: 1rem 1.25rem;
    color: var(--text-primary);
    vertical-align: middle;
    border: none;
}

.view .table tbody tr.clickable {
    cursor: pointer;
}

.view .table tbody tr.clickable:hover {
    background-color: #f1f5f9;
    transform: scale(1.001);
}

/* ============================================================ */
/* BOTONES                                                       */
/* ============================================================ */
.view .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    height: auto;
    box-sizing: border-box;
}

.view .btn-primary {
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-hover) 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.view .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

.view .btn:active {
    transform: translateY(0);
}

.view .btn-sm {
    font-size: 0.8rem;
    padding: 0.4rem 0.9rem;
    border-radius: 8px;
}

/* ============================================================ */
/* BADGES                                                        */
/* ============================================================ */
.view .badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
    border: 1px solid transparent;
    letter-spacing: 0.02em;
}

.view .badge-primary   { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.view .badge-secondary { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.view .badge-tertiary  { background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; }
.view .badge-default   { background: #f3f4f6; color: #6b7280; border-color: #e5e7eb; }

/* ============================================================ */
/* UTILIDADES                                                    */
/* ============================================================ */
.view .mono,
.view .font-mono { font-family: 'Fira Code', 'Courier New', monospace; }
.view .text-sm   { font-size: 0.875rem; }
.view .text-xs   { font-size: 0.75rem; }
.view .text-muted   { color: var(--text-muted); }
.view .text-subtle  { color: var(--text-subtle); }
.view .text-center  { text-align: center; }
.view .mb-6  { margin-bottom: 1.5rem; }

/* ============================================================ */
/* RESPONSIVIDAD                                                 */
/* ============================================================ */
@media (max-width: 768px) {
    .view {
        padding: 1.5rem;
        margin: 1rem auto;
        border-radius: 16px;
        min-height: calc(100vh - 2rem);
    }

    .view .page-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .view .table th,
    .view .table td {
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 480px) {
    .view .table {
        font-size: 0.85rem;
    }
}
