:root {
    /* Colores RODILOAD PREMIUM - NUDE & NIGHT OCEAN THEME */
    --bg-dark: #F2E3D0; /* Nude */
    --bg-main: #F2E3D0; /* Nude */
    --bg-card: #FDFBF8; /* Lighter Nude for cards */
    --bg-panel: #163A45; /* Night Ocean */
    --bg-hover: rgba(130, 149, 152, 0.15); /* Grey hover */
    
    --primary: #DE8B2A; /* Orange */
    --primary-glow: transparent;
    --primary-hover: #C27822; /* Darker Orange */
    --primary-light: rgba(222, 139, 42, 0.15);
    
    --text-main: #163A45; /* Night Ocean */
    --text-muted: #829598; /* Grey */
    --text-light: #829598; /* Grey */
    
    --border: rgba(130, 149, 152, 0.4); /* Grey border */
    --border-active: #DE8B2A; /* Orange active */
    
    --success: #163A45; /* Night Ocean */
    --warning: #DE8B2A; /* Orange */
    --danger: #ef4444;

    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 16px;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    --shadow-glow: transparent;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    background-image: url('fondo-sistema.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    font-size: 13px;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Header Branding */
.main-header {
    background: var(--bg-card);
    padding: 12px 30px; 
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-img {
    height: 32px;
    width: auto;
}

.logo-title {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-main);
    margin: 0;
    line-height: 1;
}

.tagline-text {
    font-size: 9px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 700;
}

.version-pill {
    background: var(--primary-light);
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 40px;
    font-size: 10px;
    font-weight: 800;
    border: 1px solid var(--primary);
    box-shadow: var(--shadow-glow);
}

/* User Profile & Plan Badge */
.user-profile-area {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-right: 20px;
}

.plan-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.03);
    padding: 6px 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s;
}

.plan-badge:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--primary-light);
}

.plan-icon {
    width: 32px;
    height: 32px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.plan-icon i { width: 18px; height: 18px; }

.plan-details {
    display: flex;
    flex-direction: column;
}

.plan-type {
    font-size: 8px;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.plan-name {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-main);
}

.btn-logout-premium {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-logout-premium:hover {
    background: #ef4444;
    color: white;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.btn-logout-premium i { width: 18px; height: 18px; }


/* Layout Principal */
.main-layout {
    flex: 1;
    display: flex;
    padding: 12px;
    gap: 12px;
    overflow-y: auto; /* Permitir scroll si el contenido es mayor que el viewport */
}


.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 0;
}

.sidebar {
    width: 350px;
    min-width: 350px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    padding-right: 8px;
}

/* Glassmorphism Panels */
.panel-card {
    background: transparent;
    border-radius: var(--radius-lg);
    padding: 0;
    border: none;
    transition: all 0.3s ease;
}

.panel-title {
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
}

.panel-header-with-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    width: 100%;
    background: var(--bg-panel);
    padding: 15px 20px;
    border-radius: var(--radius-lg);
    color: white;
}

.btn-manual-mode {
    background: #ffffff;
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 8px 24px;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-ai-sparkle {
    background: var(--primary);
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 9px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(82, 181, 212, 0.3);
}

.btn-ai-sparkle:hover {
    transform: scale(1.05);
    background: #62c5e4;
}

/* Inputs Premium */
.input-row { display: flex; gap: 12px; margin-bottom: 12px; }
.input-group { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.input-group label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.input-group input {
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-main);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-group input:focus {
    border-color: var(--primary);
    background: #ffffff;
    outline: none;
    box-shadow: 0 0 0 2px var(--primary-light);
}

.input-group input::placeholder {
    color: var(--text-muted);
}

/* Custom Select */
.custom-select-wrapper {
    position: relative;
    width: 100%;
    user-select: none;
    z-index: 50;
}

.custom-select-trigger {
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--primary);
    border-radius: 20px;
    padding: 10px 15px;
    font-weight: 600;
    font-size: 11px;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.custom-select-trigger:hover, .custom-select-wrapper.open .custom-select-trigger {
    border-color: var(--primary-hover);
    background: #ffffff;
    box-shadow: 0 0 0 2px var(--primary-light);
}

.custom-select-options {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 300px;
    overflow-y: auto;
}

.custom-select-wrapper.open .custom-select-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-option {
    padding: 12px 14px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
    pointer-events: none; /* Dejar que el clic del div lo maneje */
}

.custom-option:last-child {
    border-bottom: none;
}

.custom-option:hover {
    background: var(--bg-hover);
    color: var(--primary);
    padding-left: 20px;
}

.custom-option.selected {
    color: var(--primary);
    background: rgba(0, 245, 212, 0.05);
}

.select-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-muted);
    width: 16px;
    height: 16px;
    transition: transform 0.3s;
}

.custom-select-wrapper.open .select-icon {
    transform: translateY(-50%) rotate(180deg);
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 10px 0;
}

.cb-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
}

.cb-item input {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    outline: none;
}
.cb-item input:checked {
    background: var(--primary);
    border-color: var(--primary);
}
.cb-item input:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid var(--text-main);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.btn-secondary.btn-editing {
    background: #f59e0b; /* Orange/Amber for editing */
    border-color: #d97706;
    color: white;
}

.btn-secondary.btn-editing:hover {
    background: #d97706;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

/* Botones Premium */
.btn-primary {
    background: var(--primary);
    color: #1F2D33;
    border: none;
    padding: 12px 20px;
    border-radius: 50px;
    font-weight: 800;
    width: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px var(--primary-glow);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px var(--primary-glow);
}

.btn-primary i {
    filter: drop-shadow(0 0 2px rgba(0,0,0,0.2));
}

.btn-secondary {
    background: #ffffff;
    color: var(--text-main);
    border: 1px solid var(--primary);
    padding: 10px;
    border-radius: 20px;
    font-weight: 700;
    width: 100%;
    cursor: pointer;
    margin-bottom: 8px;
    transition: all 0.2s;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--primary-hover);
    color: var(--primary-hover);
}

.btn-action-pill {
    background: var(--text-main);
    color: #ffffff;
    border: 1px solid var(--text-main);
    padding: 10px;
    border-radius: 20px;
    font-weight: 700;
    width: 100%;
    cursor: pointer;
    margin-bottom: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(22, 58, 69, 0.2);
}

.btn-action-pill:hover {
    background: #112830;
    border-color: #112830;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(22, 58, 69, 0.35);
}

.btn-action-pill i {
    filter: drop-shadow(0 0 2px rgba(0,0,0,0.2));
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--primary-hover);
    color: var(--primary-hover);
}

/* Selection Actions Pills */
.selection-actions-pill {
    display: flex;
    gap: 10px;
    margin-top: 5px;
    margin-bottom: 15px;
}

.btn-pill {
    flex: 1;
    padding: 12px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
}

.btn-edit-pill {
    background: #ffffff;
    color: #060b13;
    box-shadow: 0 4px 15px rgba(255,255,255,0.1);
}

.btn-edit-pill:hover {
    background: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-delete-pill {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2) !important;
}

.btn-delete-pill:hover {
    background: #ef4444;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}


.btn-link {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    background: none;
    border: none;
    text-decoration: underline;
    cursor: pointer;
    display: block;
    margin: 15px auto;
    transition: color 0.2s;
}

.btn-link:hover { color: var(--primary); }

/* Lista de Piezas */
.items-list { display: flex; flex-direction: column; gap: 8px; margin: 15px 0; }
.items-list:empty { margin: 0; display: none; }
.cargo-item-row-premium {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    color: #ffffff;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.cargo-item-row-premium:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

.cargo-item-row-premium.selected {
    background: rgba(222, 139, 42, 0.15);
    border-color: var(--primary);
}

.cargo-item-row-premium.selected::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary);
}


.item-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.item-desc {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
}

.item-row-body {
    display: flex;
    gap: 8px;
}

.item-card {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.item-card label {
    font-size: 9px;
    color: var(--primary);
    font-weight: 800;
    text-transform: uppercase;
    display: block;
    margin-bottom: 2px;
}

.item-card span {
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
}

.btn-action {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.btn-edit {
    background: rgba(255, 255, 255, 0.1); 
    color: var(--text-main);      /* Light icon */
    border: 1px solid var(--border);
}

.btn-edit:hover {
    background: var(--primary);
    transform: scale(1.1);
}

.btn-delete {
    background: rgba(255, 255, 255, 0.02);
    color: #ef4444; /* Red icon as in Image 4 */
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    transform: scale(1.1);
}

.item-actions {
    display: flex;
    gap: 8px;
}

/* Visor 3D Section */
.viewer-container {
    flex: 3;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    min-height: 380px; /* Reducido para evitar clipping en pantallas pequeñas */
}



.viewer-header {
    padding: 10px 16px;
    background: rgba(40, 55, 77, 0.6); /* True Navy translucent */
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
    font-weight: 700;
    font-size: 14px;
}

.viewer-header i { color: var(--primary); }

.canvas-3d { 
    flex: 1; 
    position: relative; 
    min-height: 0;
    width: 100%;
    height: 100%;
}


.unit-chips {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.unit-carousel-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.viewer-footer {
    padding: 6px 10px;
    background: transparent;
    border-top: none;
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    bottom: 15px;
    width: 100%;
    z-index: 10;
}

.carousel-btn {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border);
    color: var(--text-main);
    width: 36px; /* Reducido */
    height: 36px; /* Reducido */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    cursor: pointer;
}

.carousel-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: scale(1.1);
}

.unit-chip {
    display: none;
    padding: 6px 20px;
    min-width: 140px;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-weight: 700;
    font-size: 11px;
    color: var(--text-main);
    text-align: center;
    white-space: nowrap;
    animation: fadeIn 0.3s ease;
}

.unit-chip.active {
    display: block; /* Solo mostrar la activa */
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(82, 181, 212, 0.3);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Stats Bottom Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px; /* Reducido */
}

.stat-box {
    background: var(--bg-card);
    padding: 15px; /* Restored original padding to match Image 1 */
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px; /* Restored */
    transition: all 0.3s ease;
    min-height: 100px; /* Restored to match Image 1 taller cards */
}


.stat-box label {
    font-size: 10px;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
    display: block;
}

.stat-box:hover {
    border-color: rgba(0, 245, 212, 0.2);
    transform: translateY(-2px);
}

.stat-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.circle-progress { 
    width: 50px; 
    height: 50px; 
    position: relative;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.circle-text { 
    position: absolute;
    font-size: 11px; 
    font-weight: 800;
    color: var(--primary);
    text-align: center;
    width: 100%;
}

.stat-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.info-main {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.1;
}

.info-sub { 
    font-size: 10px; 
    color: var(--text-muted); 
    margin-top: 2px;
}

.stat-content-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-icon {
    color: var(--primary);
    width: 20px;
    height: 20px;
}

/* Harmonize Input Arrows (Image 2) */
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
    -webkit-appearance: none; 
    margin: 0; 
}
input[type=number] {
    -moz-appearance: textfield;
}

/* PANELS DE AJUSTE (MODALES INTERNOS) */
.manual-panel, .calibration-panel {
    position: absolute;
    top: 80px;
    right: 20px;
    width: 260px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    z-index: 2000;
    overflow: hidden;
}

.manual-header, .calib-header {
    background: rgba(0,0,0,0.03);
    color: var(--primary);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 800;
    font-size: 11px;
    text-transform: uppercase;
}

.manual-body, .calib-body { padding: 20px; }

.ctrl-group label, .calib-row span {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: block;
}

.ctrl-grid, .calib-controls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.ctrl-grid button, .calib-controls button {
    background: rgba(0,0,0,0.03);
    border: 1px solid var(--border);
    height: 45px;
    border-radius: 12px;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s;
}

.ctrl-grid button:hover, .calib-controls button:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-lock {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 800;
    margin-top: 15px;
}

.btn-delete-manual {
    width: 100%;
    margin-top: 15px;
    padding: 14px;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
    font-weight: 800;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
    text-transform: uppercase;
}
.btn-delete-manual:hover {
    background: #ef4444;
    color: white;
    box-shadow: 0 5px 15px rgba(239, 68, 68, 0.3);
}

/* MODALES */
.detail-container {
    background: #060b13;
    width: 90%; max-width: 700px;
    border-radius: 24px; border: 1px solid var(--border);
    max-height: 85vh; overflow: hidden; display: flex; flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.detail-header {
    background: rgba(255, 255, 255, 0.02);
    padding: 24px; border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
}

.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(20px);
    display: flex; align-items: center; justify-content: center; z-index: 3000;
}

/* REDESIGNED HISTORY MODAL (IMAGEN 2) */
.history-container {
    background: #060b13;
    width: 95%;
    max-width: 1200px;
    height: 85vh;
    border-radius: 24px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.history-header {
    background: rgba(255, 255, 255, 0.02);
    padding: 20px 30px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-header h3 {
    color: var(--primary);
    font-size: 14px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.history-main-layout {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 320px;
    overflow: hidden;
}

.history-table-wrapper {
    padding: 20px;
    overflow-y: auto;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text-main);
    font-size: 12px;
}

.history-table th {
    text-align: left;
    padding: 15px;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 10px;
    border-bottom: 1px solid var(--border);
}

.history-table td {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
}

.history-row {
    cursor: pointer;
    transition: all 0.2s;
}

.history-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.history-row.active {
    background: var(--primary) !important;
    color: #060b13 !important;
}

.history-row.active td {
    color: #060b13 !important;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}

.status-delivered {
    background: rgba(52, 199, 89, 0.2);
    color: #34c759;
    border: 1px solid rgba(52, 199, 89, 0.3);
}

/* History Preview Area */
.history-preview-pane {
    background: rgba(255, 255, 255, 0.01);
    border-left: 1px solid var(--border);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.preview-card {
    background: #111827;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    position: relative;
    aspect-ratio: 16/9;
}

.preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-visualize {
    background: var(--primary);
    color: #060b13;
    border: none;
    padding: 12px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
}

.unit-icon-small {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.history-row.active .unit-icon-small {
    background: rgba(0, 0, 0, 0.1);
    color: #060b13;
}

/* PDF BUTTONS */
.btn-pdf { 
    background: #829598; /* Grey */
    color: #ffffff; 
    border: none; 
    padding: 10px 15px; 
    border-radius: 8px; 
    font-size: 11px; 
    font-weight: 700; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    transition: 0.2s; 
    width: 100%; 
    justify-content: center; 
    box-shadow: var(--shadow);
}
.btn-pdf:not(.disabled):hover { background: #163A45; transform: translateY(-2px); }
.btn-pdf.disabled { opacity: 0.5; cursor: not-allowed; }

/* Scrollbar Style */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* Shipment Buttons */

.btn-generate-shipment {
    background: linear-gradient(135deg, #00f5d4 0%, #00d2b4 100%);
    box-shadow: 0 8px 16px var(--primary-glow);
    color: #060b13; 
    border: none; 
    padding: 14px; 
    border-radius: 12px; 
    font-weight: 800; 
    width: 100%; 
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-generate-shipment:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px var(--primary-glow);
}

.nom-list { font-size: 9px; color: var(--text-muted); margin-top: 5px; }
.nom-item { display: flex; align-items: center; gap: 5px; margin-bottom: 4px; }
.nom-item i { color: var(--primary); width: 12px; }

/* BOTÓN AJUSTE MANUAL - ESTADO PREMIUM */
.btn-manual-mode {
    background: rgba(40, 55, 77, 0.85); /* True Navy */
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 12px 30px; 
    min-width: 180px; 
    border-radius: 50px;
    font-size: 12px; /* Increased */
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: not-allowed;
    transition: all 0.3s;
    text-transform: uppercase;
    opacity: 0.6;
}

.btn-manual-mode:not(.disabled) {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
    cursor: pointer;
    opacity: 1;
}

.btn-manual-mode.active {
    background: var(--primary);
    color: white;
}

.unit-chips.locked {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
}

.unit-chips.locked::after {
    content: '🔒 RECOMENDADO';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    color: var(--danger);
    font-weight: bold;
}

/* --- ULTRA-PREMIUM LOGIN SCREEN --- */
.login-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-dark);
    background-image: url('fondo-sistema.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    overflow: hidden;
    animation: fadeIn 0.8s ease-out;
}

.login-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(253, 251, 248, 0.4);
    backdrop-filter: blur(8px);
    z-index: 0;
}

.login-card {
    position: relative;
    z-index: 10;
    background: rgba(16, 24, 39, 0.6);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    width: 100%;
    max-width: 420px;
    padding: 50px;
    border-radius: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.7);
    text-align: center;
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-brand { margin-bottom: 40px; }

.login-logo {
    height: 70px;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 15px rgba(0, 245, 212, 0.5));
}

.login-brand h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 38px;
    font-weight: 800;
    color: white;
    letter-spacing: -1.5px;
    margin-bottom: 8px;
}

.login-brand p {
    color: var(--primary);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 4px;
}

.login-form { display: flex; flex-direction: column; gap: 25px; text-align: left; }

.login-input-group { display: flex; flex-direction: column; gap: 12px; }

.login-input-group label {
    font-size: 10px;
    font-weight: 800;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.login-input-group label i { color: var(--primary); width: 16px; height: 16px; }

.login-input-group input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    padding: 16px 20px;
    color: white;
    font-size: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-input-group input:focus {
    outline: none;
    background: rgba(0, 245, 212, 0.05);
    border-color: var(--primary);
    box-shadow: 0 0 25px rgba(0, 245, 212, 0.2);
    transform: scale(1.02);
}

.terms-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-light);
    cursor: pointer;
    margin: 10px 0;
}

.terms-label input {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
}

.btn-login {
    background: transparent;
    color: #ffffff;
    border: 1px solid var(--border);
    padding: 18px;
    border-radius: 60px;
    font-weight: 900;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
}

.btn-login:hover {
    transform: translateY(-4px);
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: var(--shadow);
}

/* Cubos Decorativos Flotantes */
.cube-decorator {
    position: absolute;
    background: linear-gradient(45deg, var(--primary-light), transparent);
    border: 1px solid var(--border);
    backdrop-filter: blur(5px);
    z-index: 1;
    animation: floatCube 20s infinite ease-in-out;
}

.cube-1 {
    top: 15%; left: 10%; width: 180px; height: 180px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    animation-duration: 15s;
}

.cube-2 {
    bottom: 10%; right: 15%; width: 300px; height: 300px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    animation-delay: -5s;
    animation-duration: 25s;
}

.cube-3 {
    top: 40%; right: 5%; width: 120px; height: 120px;
    background: rgba(0, 245, 212, 0.3);
    box-shadow: 0 0 60px rgba(0, 245, 212, 0.4);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    animation-delay: -10s;
}

@keyframes floatCube {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -50px) rotate(15deg); }
    66% { transform: translate(-20px, 30px) rotate(-15deg); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(60px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Modal Términos Premium */
.terms-container {
    background: rgba(11, 20, 29, 0.95);
    backdrop-filter: blur(30px);
    width: 90%; max-width: 600px;
    border-radius: 40px; border: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 80vh; overflow: hidden; display: flex; flex-direction: column;
}

.modal-header-premium {
    padding: 30px 40px; background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center;
}

.modal-header-premium h3 { color: var(--primary); font-size: 16px; font-weight: 900; letter-spacing: 2px; }

.terms-content { padding: 40px; overflow-y: auto; color: var(--text-light); line-height: 1.8; }

/* Calibration Panel Styles */
.viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-main-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-icon-header {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-icon-header:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

.calibration-panel {
    position: fixed;
    top: 100px;
    left: 40px;
    width: 320px;
    background: rgba(11, 20, 29, 0.98);
    backdrop-filter: blur(40px);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: 0 50px 100px rgba(0,0,0,0.9);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    animation: slideInLeft 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.calib-body {
    padding: 10px 0;
    overflow-y: scroll; /* Forzar scroll */
    flex: 1;
}

/* Custom Scrollbar for Panel */
.calib-body::-webkit-scrollbar {
    width: 4px;
}
.calib-body::-webkit-scrollbar-track {
    background: transparent;
}
.calib-body::-webkit-scrollbar-thumb {
    background: rgba(0, 245, 212, 0.3);
    border-radius: 10px;
}

.calib-section {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.calib-section:last-of-type {
    border-bottom: none;
    padding-bottom: 10px;
}

.btn-lock {
    margin: 15px 20px 25px 20px;
    width: calc(100% - 40px);
    padding: 16px;
    background: var(--primary);
    color: #060b13;
    border: none;
    border-radius: 15px;
    font-weight: 800;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
}

.btn-lock:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 245, 212, 0.3);
}

.calib-section label {
    font-size: 9px;
    font-weight: 800;
    color: var(--primary);
    display: block;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.calib-controls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.calib-controls button {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    color: white;
    padding: 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.calib-controls button:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.calib-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.calib-row span {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
}

/* PANEL DE CALIBRACIÓN - ESTILO PREMIUM */
.calibration-panel {
    position: absolute;
    top: 60px;
    right: 20px;
    width: 280px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 16px;
    z-index: 2000;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    color: white;
    font-family: 'Outfit', sans-serif;
}

.calib-header {
    padding: 15px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--primary);
}

.calib-body {
    padding: 20px;
}

.calib-section {
    margin-bottom: 25px;
}

.calib-section label {
    display: block;
    font-size: 9px;
    font-weight: 800;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-transform: uppercase;
}

.calib-controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.calib-controls button {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: white;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.calib-controls button:hover {
    background: var(--primary);
    color: #060b13;
    border-color: var(--primary);
}

.calib-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    font-weight: 600;
    margin-top: 15px;
}

.btn-lock {
    width: 100%;
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 12px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: 0.3s;
}

.btn-lock:hover {
    background: var(--primary);
    color: white;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
}

/* PANTALLA DE CARGA - PREMIUM */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #060b13;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: white;
    transition: all 0.5s ease-out;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(0, 245, 212, 0.1);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite, pulseGlow 2s ease-in-out infinite;
}

.loader-title {
    font-family: 'Outfit', sans-serif;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 2px;
    margin: 0;
    text-shadow: 0 0 20px rgba(0, 245, 212, 0.4);
}

.loader-text {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
    animation: pulseText 1.5s infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 10px rgba(0, 245, 212, 0.2); }
    50% { box-shadow: 0 0 30px rgba(0, 245, 212, 0.6); }
    100% { box-shadow: 0 0 10px rgba(0, 245, 212, 0.2); }
}

@keyframes pulseText {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}
/* --- CUBICACION MASIVA STYLES --- */
.mode-selection-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 2500;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    background-color: var(--bg-dark);
    background-image: url('fondo-sistema.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    overflow: hidden;
}
.mode-selection-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(253, 251, 248, 0.4);
    backdrop-filter: blur(8px);
    z-index: 0;
}
.mode-selection-logo {
    margin-bottom: 50px;
    animation: fadeInDown 1s ease;
}
.mode-selection-logo img {
    height: 80px;
    object-fit: contain;
}
.mode-cards-container {
    display: flex;
    gap: 30px;
    margin-top: 40px;
}
.mode-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    width: 300px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-main);
}
.mode-card:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    transform: translateY(-5px);
}
.mode-card i {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 20px;
}
.mode-card h2 {
    font-size: 20px;
    margin-bottom: 10px;
}
.mode-card p {
    font-size: 13px;
    color: #a0aec0;
}

.massive-container {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    padding: 40px;
    overflow-y: auto;
    background: transparent;
}
.massive-container::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: url('fondo-sistema.png') no-repeat center center;
    background-size: cover;
    background-attachment: fixed;
    z-index: -1;
}
.massive-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}
.massive-header h1 {
    font-size: 24px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}
.btn-volver {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}
.btn-volver:hover {
    background: rgba(255,255,255,0.1);
}

.massive-setup {
    display: flex;
    gap: 30px;
}
.massive-panel {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 24px;
    flex: 1;
}
.drop-zone {
    border: 2px dashed rgba(82, 181, 212, 0.5);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: 0.3s;
    background: rgba(82, 181, 212, 0.05);
}
.drop-zone:hover {
    background: rgba(82, 181, 212, 0.1);
}
.drop-zone i {
    font-size: 40px;
    color: #52b5d4;
    margin-bottom: 15px;
}
.unit-select-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}
.unit-select-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(11, 20, 29, 0.6);
    padding: 12px 18px;
    border-radius: 8px;
    border: 1px solid rgba(82, 181, 212, 0.2);
    transition: all 0.3s ease;
}
.unit-select-item:hover {
    background: rgba(82, 181, 212, 0.1);
    border-color: #52b5d4;
    transform: translateY(-2px);
}
.unit-select-item label {
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 500;
}
.unit-select-item input[type="checkbox"] {
    accent-color: #00e5ff;
    width: 16px;
    height: 16px;
    cursor: pointer;
}
.unit-select-item input[type="number"] {
    width: 70px;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(82, 181, 212, 0.3);
    color: #00e5ff;
    padding: 6px;
    border-radius: 6px;
    text-align: center;
    font-weight: bold;
    outline: none;
}
.unit-select-item input[type="number"]:focus {
    border-color: #00e5ff;
    box-shadow: 0 0 5px rgba(0, 229, 255, 0.3);
}
.btn-process {
    background: var(--primary);
    color: var(--bg-panel);
    border: none;
    padding: 15px;
    width: 100%;
    border-radius: 8px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    margin-top: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow);
}

.massive-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.trip-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: 0.3s;
}
.trip-card:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
}
.trip-route {
    font-weight: bold;
    font-size: 16px;
    color: #52b5d4;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.trip-details {
    font-size: 13px;
    color: #a0aec0;
}
.btn-menu-back {
    background: var(--primary);
    border: none;
    color: var(--bg-dark);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 13px;
    transition: all 0.3s ease;
    margin-right: 15px;
    box-shadow: var(--shadow);
}
.btn-menu-back:hover {
    background: var(--primary-hover);
    color: #ffffff;
    transform: translateY(-2px);
}

/* Add Units Modal & Extra Unit Styles */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(6,11,19,0.8); backdrop-filter: blur(8px); display: flex; justify-content: center; align-items: center; z-index: 9999; }
.modal-content { background: #0c1522; border: 1px solid rgba(249,115,22,0.3); border-radius: 16px; padding: 25px; width: 90%; max-width: 400px; box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 20px rgba(249,115,22,0.1); }
.modal-header { margin-bottom: 15px; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 10px; }
.modal-header h3 { margin: 0; display: flex; align-items: center; gap: 8px; color: #f97316; font-size: 18px; }
.modal-body { color: #fff; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 25px; }
.btn-cancel { background: transparent; color: #a0aec0; border: 1px solid rgba(255,255,255,0.1); padding: 8px 16px; border-radius: 8px; cursor: pointer; transition: 0.2s; }
.btn-cancel:hover { background: rgba(255,255,255,0.05); color: #fff; }
.btn-confirm { padding: 8px 16px; border-radius: 8px; cursor: pointer; transition: 0.2s; border: 1px solid transparent; font-weight: bold; }
.btn-confirm:hover { box-shadow: 0 0 15px rgba(249,115,22,0.3); }
.trip-card.extra-unit { border-color: rgba(249,115,22,0.5); box-shadow: 0 0 15px rgba(249,115,22,0.1); }
.trip-card.extra-unit:hover { background: rgba(249,115,22,0.05); border-color: #f97316; box-shadow: 0 5px 20px rgba(249,115,22,0.2); }
.trip-card.extra-unit .trip-route { color: #f97316; }

.custom-select, .custom-input {
    width: 100%;
    padding: 12px;
    background: #0c1522;
    border: 1px solid rgba(249, 115, 22, 0.4);
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
    color-scheme: dark; /* Force native dark mode dropdown */
}
.custom-select:focus, .custom-input:focus {
    border-color: #f97316;
    box-shadow: 0 0 15px rgba(249, 115, 22, 0.2);
}
.custom-select option {
    background: #0c1522;
    color: #e2e8f0;
    padding: 12px;
}

/* Botón VER EN 3D de tarjetas de viaje masivo */
.btn-menu-option {
    background: transparent;
    border: 1px solid rgba(82, 181, 212, 0.4);
    color: #52b5d4;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.25s ease;
    margin-top: 10px;
    font-family: 'Outfit', sans-serif;
}
.btn-menu-option:hover {
    background: rgba(82, 181, 212, 0.12);
    border-color: #00e5ff;
    color: #00e5ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.2);
}
.btn-menu-option:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Hover del logo (reemplaza los onmouseover inline que causaban SyntaxError) */
#logo-link-mode:hover {
    transform: scale(1.05);
}
#logo-link-header:hover {
    opacity: 0.85;
}
