/* ===================================================
   busqueda-page.css — Ca&Pe Courier S.A.C.
   wwwroot/css/busqueda-page.css
   =================================================== */

.page-wrapper {
    min-height: 100vh;
    background: #f0f4f8;
    font-family: 'DM Sans', sans-serif;
    display: flex;
    flex-direction: column;
}

/* ===== NAVBAR ===== */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    height: 68px;
    background: linear-gradient(90deg, #0A1B4B 0%, #0d2266 100%);
    box-shadow: 0 2px 20px rgba(10,27,75,0.4);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    display: flex;
    align-items: center;
}

.nav-logo {
    height: 44px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.nav-logo-fallback {
    display: flex;
    align-items: baseline;
    gap: 3px;
}

.nf-ca {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    color: white;
    font-weight: 700;
}

.nf-amp {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    color: #ff4444;
    font-weight: 700;
}

.nf-pe {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    color: white;
    font-weight: 700;
}

.nf-courier {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.7);
    margin-left: 4px;
    align-self: flex-end;
    padding-bottom: 3px;
    letter-spacing: 0.06em;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px 6px 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.15);
    max-width: 340px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #D40000, #ff4444);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    min-width: 0;
}

.user-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.user-code {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.75);
    white-space: nowrap;
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    background: rgba(212,0,0,0.2);
    border: 1px solid rgba(212,0,0,0.4);
    border-radius: 10px;
    color: #ff9999;
    font-size: 0.82rem;
    font-weight: 500;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

    .btn-logout:hover {
        background: #D40000;
        border-color: #D40000;
        color: white;
    }

    .btn-logout svg {
        width: 16px;
        height: 16px;
    }

/* ===== MAIN ===== */
.main-content {
    flex: 1;
    padding: 32px;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ===== SECTION HEADER ===== */
.section-title-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
}

.section-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #0A1B4B, #1a3a8f);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

    .section-icon svg {
        width: 22px;
        height: 22px;
    }

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    color: #0A1B4B;
    margin-bottom: 2px;
}

.section-subtitle {
    font-size: 0.875rem;
    color: #64748b;
}

/* ===== SEARCH CARD ===== */
.search-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.07);
    border: 1px solid #e8eef6;
    overflow: hidden;
    animation: fadeIn 0.4s ease both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-card-body {
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.search-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.combo-group {
    flex: 0 0 240px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.text-group {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

    .input-label svg {
        width: 14px;
        height: 14px;
    }

.select-wrapper {
    position: relative;
}

.combo-select {
    width: 100%;
    padding: 12px 40px 12px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    font-size: 0.9rem;
    font-family: 'DM Sans', sans-serif;
    color: #1e293b;
    font-weight: 500;
    appearance: none;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
}

    .combo-select:focus {
        border-color: #0A1B4B;
        background: white;
        box-shadow: 0 0 0 3px rgba(10,27,75,0.1);
    }

.select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #64748b;
    display: flex;
}

    .select-arrow svg {
        width: 16px;
        height: 16px;
    }

.text-wrapper {
    display: flex;
    align-items: center;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    transition: all 0.2s;
}

    .text-wrapper:focus-within {
        border-color: #0A1B4B;
        background: white;
        box-shadow: 0 0 0 3px rgba(10,27,75,0.1);
    }

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 13px 14px;
    font-size: 0.9rem;
    font-family: 'DM Sans', sans-serif;
    color: #1e293b;
    outline: none;
}

    .search-input::placeholder {
        color: #cbd5e1;
    }

.clear-btn {
    padding: 0 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

    .clear-btn:hover {
        color: #D40000;
    }

    .clear-btn svg {
        width: 16px;
        height: 16px;
    }

.btn-buscar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 28px;
    background: linear-gradient(135deg, #0A1B4B, #1a3a8f);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

    .btn-buscar svg {
        width: 18px;
        height: 18px;
    }

    .btn-buscar:hover:not(:disabled) {
        background: linear-gradient(135deg, #D40000, #ff2222);
        transform: translateY(-1px);
        box-shadow: 0 8px 20px rgba(212,0,0,0.3);
    }

    .btn-buscar:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

.btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.quick-pills {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pills-label {
    font-size: 0.78rem;
    color: #94a3b8;
    font-weight: 500;
    margin-right: 4px;
}

.pill {
    padding: 5px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 50px;
    background: none;
    font-size: 0.78rem;
    font-family: 'DM Sans', sans-serif;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s;
}

    .pill:hover {
        border-color: #0A1B4B;
        color: #0A1B4B;
    }

    .pill.active {
        background: #0A1B4B;
        border-color: #0A1B4B;
        color: white;
    }

/* ===== ESTADOS ===== */
.state-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    border-radius: 16px;
    animation: fadeIn 0.3s ease;
}

    .state-card svg {
        width: 28px;
        height: 28px;
        flex-shrink: 0;
    }

.error-card {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #9f1239;
}

    .error-card p {
        font-size: 0.9rem;
    }

.empty-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
}

.empty-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #374151;
}

.empty-sub {
    font-size: 0.85rem;
    margin-top: 2px;
}

.welcome-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 24px;
    gap: 16px;
    text-align: center;
    animation: fadeIn 0.4s ease;
}

.welcome-icon {
    opacity: 0.7;
}

.welcome-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    color: #374151;
}

.welcome-sub {
    font-size: 0.875rem;
    color: #94a3b8;
}

/* ===== RESULTADOS ===== */
.results-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: fadeIn 0.4s ease;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.results-count {
    display: flex;
    align-items: center;
    gap: 8px;
}

.count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    background: #D40000;
    color: white;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 700;
}

.count-text {
    font-size: 0.9rem;
    color: #374151;
    font-weight: 500;
}

.results-meta {
    font-size: 0.82rem;
    color: #94a3b8;
}

    .results-meta strong {
        color: #0A1B4B;
    }

    .results-meta em {
        color: #64748b;
    }

.table-wrapper {
    background: white;
    border-radius: 16px;
    border: 1px solid #e8eef6;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

    .results-table thead {
        background: linear-gradient(90deg, #0A1B4B, #0d2266);
    }

    .results-table th {
        padding: 14px 16px;
        text-align: left;
        font-size: 0.78rem;
        font-weight: 600;
        color: rgba(255,255,255,0.85);
        letter-spacing: 0.05em;
        text-transform: uppercase;
        white-space: nowrap;
    }

        .results-table th:first-child {
            padding-left: 20px;
        }

.table-row {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
    animation: rowIn 0.3s ease both;
}

@keyframes rowIn {
    from {
        opacity: 0;
        transform: translateX(-8px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.table-row:last-child {
    border-bottom: none;
}

.table-row:hover {
    background: #f8fafc;
}

.results-table td {
    padding: 14px 16px;
    font-size: 0.875rem;
    color: #374151;
    vertical-align: middle;
}

    .results-table td:first-child {
        padding-left: 20px;
    }

.cell-num {
    color: #94a3b8;
    font-weight: 600;
    font-size: 0.8rem;
    width: 40px;
}

.cargo-badge {
    display: inline-block;
    padding: 3px 10px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #1d4ed8;
    font-family: monospace;
    letter-spacing: 0.02em;
}

.cell-dest {
    font-weight: 500;
}

.cell-dir {
    color: #64748b;
    font-size: 0.845rem;
}

.cell-cont, .cell-glos {
    color: #64748b;
    font-size: 0.845rem;
    max-width: 200px;
}

.cell-fecha {
    color: #64748b;
    font-size: 0.845rem;
    white-space: nowrap;
}

.estado-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.estado-ok {
    background: #dcfce7;
    color: #166534;
}

.estado-transit {
    background: #fef3c7;
    color: #92400e;
}

.estado-pending {
    background: #dbeafe;
    color: #1e40af;
}

.estado-returned {
    background: #fee2e2;
    color: #991b1b;
}

.estado-default {
    background: #f1f5f9;
    color: #475569;
}

.btn-ver {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: linear-gradient(135deg, #0A1B4B, #1a3a8f);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    opacity: 0.85;
}

    .btn-ver svg {
        width: 14px;
        height: 14px;
    }

    .btn-ver:hover {
        background: linear-gradient(135deg, #D40000, #ff2222);
        opacity: 1;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(212,0,0,0.25);
    }

    .btn-ver:disabled,
    .btn-ver.no-imagen {
        background: #e2e8f0;
        color: #94a3b8;
        cursor: not-allowed;
        opacity: 0.6;
        transform: none;
        box-shadow: none;
    }

/* ===== PAGINADO ===== */
.pagination-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: white;
    border: 1px solid #e8eef6;
    border-radius: 14px;
    flex-wrap: wrap;
    gap: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.page-info {
    font-size: 0.82rem;
    color: #64748b;
}

    .page-info strong {
        color: #0A1B4B;
        font-weight: 700;
    }

.page-btns {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    font-size: 0.82rem;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    line-height: 1;
    outline: none;
    box-sizing: border-box;
}

    .page-btn:hover:not(:disabled) {
        border-color: #0A1B4B;
        color: #0A1B4B;
        background: #eff6ff;
        transform: translateY(-1px);
        box-shadow: 0 3px 8px rgba(10,27,75,0.12);
    }

    .page-btn.active {
        background: linear-gradient(135deg, #0A1B4B, #1a3a8f);
        border-color: #0A1B4B;
        color: white;
        box-shadow: 0 3px 10px rgba(10,27,75,0.25);
    }

    .page-btn:disabled {
        opacity: 0.35;
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }

    .page-btn svg {
        width: 14px;
        height: 14px;
        flex-shrink: 0;
    }

.page-ellipsis {
    padding: 0 6px;
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 36px;
    user-select: none;
}

/* ===== MODAL DETALLE ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 27, 75, 0.65);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeOverlay 0.2s ease;
    backdrop-filter: blur(6px);
}

@keyframes fadeOverlay {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-container {
    background: white;
    border-radius: 22px;
    box-shadow: 0 32px 100px rgba(10, 27, 75, 0.4);
    width: 100%;
    max-width: 1100px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    animation: slideModal 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

@keyframes slideModal {
    from {
        opacity: 0;
        transform: scale(0.90) translateY(24px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 28px;
    background: linear-gradient(90deg, #0A1B4B 0%, #0d2266 100%);
    flex-shrink: 0;
}

.modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.modal-title-icon {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .modal-title-icon svg {
        width: 20px;
        height: 20px;
        color: white;
    }

.modal-title-text h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    color: white;
    margin: 0 0 2px 0;
}

.modal-title-text p {
    font-size: 0.76rem;
    color: rgba(255,255,255,0.65);
    font-family: monospace;
    letter-spacing: 0.04em;
    margin: 0;
}

.modal-close {
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,0.1);
    border: 1.5px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

    .modal-close:hover {
        background: #D40000;
        border-color: #D40000;
        transform: scale(1.05);
    }

    .modal-close svg {
        width: 18px;
        height: 18px;
    }

/* Body: grid 2 columnas */
.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px;
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 22px;
    align-items: start;
}

/* Loading */
.modal-loading {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 72px 24px;
}

.modal-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid #e2e8f0;
    border-top-color: #0A1B4B;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

.modal-loading p {
    font-size: 0.875rem;
    color: #64748b;
}

/* Columna izquierda */
.modal-left {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.detail-section {
    background: #f8fafc;
    border: 1px solid #e8eef6;
    border-radius: 16px;
    overflow: hidden;
}

.detail-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 20px;
    background: linear-gradient(90deg, #0A1B4B, #1a3a8f);
}

    .detail-section-header.red {
        background: linear-gradient(90deg, #991b1b, #D40000);
    }

    .detail-section-header svg {
        width: 16px;
        height: 16px;
        color: rgba(255,255,255,0.85);
        flex-shrink: 0;
    }

    .detail-section-header span {
        font-size: 0.77rem;
        font-weight: 700;
        color: white;
        letter-spacing: 0.07em;
        text-transform: uppercase;
    }

.detail-grid {
    padding: 16px 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 22px;
}

.detail-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .detail-field.full-width {
        grid-column: 1 / -1;
    }

.field-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.field-value {
    font-size: 0.875rem;
    color: #1e293b;
    font-weight: 500;
    line-height: 1.45;
}

    .field-value.mono {
        font-family: monospace;
        font-size: 0.82rem;
        font-weight: 700;
        color: #1d4ed8;
        background: #eff6ff;
        border: 1px solid #bfdbfe;
        border-radius: 6px;
        padding: 3px 9px;
        display: inline-block;
    }

.situacion-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 700;
}

/* Columna derecha: Imagen */
.modal-right {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
}

.image-panel {
    background: #f8fafc;
    border: 1px solid #e8eef6;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.image-panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 20px;
    background: linear-gradient(90deg, #D40000, #ff2222);
    flex-shrink: 0;
}

    .image-panel-header svg {
        width: 16px;
        height: 16px;
        color: rgba(255,255,255,0.9);
    }

    .image-panel-header span {
        font-size: 0.77rem;
        font-weight: 700;
        color: white;
        letter-spacing: 0.07em;
        text-transform: uppercase;
    }

.image-body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: #f1f5f9;
    min-height: 200px;
    max-height: 400px;
    overflow: hidden;
}

.doc-image {
    max-width: 100%;
    max-height: 360px;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.18);
    object-fit: contain;
    cursor: zoom-in;
    transition: transform 0.2s, box-shadow 0.2s;
    display: block;
}

    .doc-image:hover {
        transform: scale(1.03);
        box-shadow: 0 8px 30px rgba(0,0,0,0.26);
    }

/* Hint debajo de imagen */
.image-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 16px;
    background: #f8fafc;
    border-top: 1px solid #e8eef6;
    font-size: 0.72rem;
    color: #94a3b8;
}

    .image-hint svg {
        width: 13px;
        height: 13px;
        flex-shrink: 0;
    }

.no-image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    text-align: center;
    padding: 40px 20px;
}

    .no-image-placeholder svg {
        width: 52px;
        height: 52px;
        opacity: 0.3;
        color: #94a3b8;
    }

    .no-image-placeholder p {
        font-size: 0.875rem;
        font-weight: 600;
        color: #64748b;
        margin: 0;
    }

    .no-image-placeholder span {
        font-size: 0.78rem;
        color: #94a3b8;
    }

/* ===== LIGHTBOX ===== */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.93);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeOverlay 0.18s ease;
    cursor: zoom-out;
}

.lightbox-inner {
    position: relative;
    max-width: 92vw;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: slideModal 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox-img {
    max-width: 90vw;
    max-height: 85vh;
    width: auto;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.7);
    object-fit: contain;
    display: block;
    cursor: default;
}

.lightbox-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 40px;
    height: 40px;
    background: #D40000;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 1;
}

    .lightbox-close:hover {
        background: #ff2222;
        transform: scale(1.12) rotate(90deg);
    }

    .lightbox-close svg {
        width: 18px;
        height: 18px;
    }

.lightbox-caption {
    margin-top: 14px;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.45);
    font-family: monospace;
    letter-spacing: 0.05em;
    text-align: center;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 860px) {
    .modal-body {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .modal-right {
        position: static;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 16px;
    }

    .navbar {
        padding: 0 16px;
    }

    .search-row {
        flex-direction: column;
    }

    .combo-group {
        flex: 1;
        width: 100%;
    }

    .btn-buscar {
        width: 100%;
    }

    .user-name {
        max-width: 140px;
    }

    .table-wrapper {
        overflow-x: auto;
    }

    .results-table {
        min-width: 820px;
    }
}
