body { background-color: #0f172a; font-family: -apple-system, sans-serif; padding-top: 120px; padding-bottom: 90px; user-select: none; overflow-x: hidden; color: white; }

/* CABECERA Y BUSCADOR */
.header-mando { position: fixed; top: 0; left: 0; right: 0; background: rgba(15, 23, 42, 0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid rgba(255,255,255,0.1); z-index: 1030; padding: 12px 10px; }

.search-box { flex-grow: 1; }
.search-box input { border-radius: 20px; box-shadow: none !important; font-weight: 700; font-size: 0.9rem; padding-left: 15px; background: rgba(255,255,255,0.1); color: white; border: 1px solid rgba(255,255,255,0.2); }
.search-box input::placeholder { color: #94a3b8; opacity: 1; }
.search-box input:focus { background: rgba(255,255,255,0.15); color: white; border-color: #3b82f6; }
#resultadosBusqueda { border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.7); max-height: 250px; overflow-y: auto; background: #1e293b; border: 1px solid #334155; }
.resultado-item { padding: 12px; border-bottom: 1px solid #334155; color: white; cursor: pointer; font-size: 0.85rem; }
.resultado-item:active { background-color: #334155; }

/* CARRUSEL MODERNO */
.carrusel-container { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 16px; padding: 4px; margin-top: 10px; }
.carrusel-wrapper { display: flex; overflow-x: auto; white-space: nowrap; padding: 2px 0; scroll-behavior: smooth; gap: 4px; width: 100%; align-items: center; }
.carrusel-wrapper::-webkit-scrollbar { display: none; } 

.carrusel-pill { display: inline-flex; align-items: center; justify-content: center; background: transparent; color: #94a3b8; padding: 6px 14px; border-radius: 12px; font-weight: 800; font-size: 0.95rem; transition: all 0.2s ease; cursor: pointer; gap: 4px; }
.carrusel-pill.activa { background: #3b82f6; color: white; box-shadow: 0 4px 12px rgba(59,130,246,0.4); }
.carrusel-pill.completado { color: #38bdf8; background: rgba(56, 189, 248, 0.08); border: 1px solid rgba(56, 189, 248, 0.2); } 
.carrusel-pill.completado.activa { color: white; background: #0284c7; box-shadow: 0 4px 12px rgba(2, 132, 199, 0.5); border-color: transparent; }

/* NOTIFICACIÓN TOAST (AZUL) ABAJO */
.toast-flotante { 
    position: fixed; 
    bottom: 90px; 
    top: auto;
    left: 50%; 
    transform: translateX(-50%) translateY(150px); 
    background: rgba(59, 130, 246, 0.95); 
    backdrop-filter: blur(10px); 
    color: white; 
    padding: 10px 20px; 
    border-radius: 50px; 
    font-weight: 700; 
    font-size: 0.9rem; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.5); 
    z-index: 9999; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    opacity: 0; 
    white-space: nowrap; 
    border: 1px solid #60a5fa; 
}
.toast-flotante.show { transform: translateX(-50%) translateY(0); opacity: 1; }


.pasillo-container { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 6px; /* <-- Reducimos el hueco central */
    padding: 10px 4px; /* <-- Solo 4px por los lados para que no toque literalmente el borde del móvil */
    position: relative; 
    width: 100vw; 
    max-width: 100%; 
    transition: all 0.3s ease;
    align-content: end;      
    min-height: calc(100vh - 210px); 
}
.pasillo-container::before { content: ""; position: absolute; top: 10px; bottom: 0; left: 50%; width: 4px; background: #334155; transform: translateX(-50%); z-index: 1; border-radius: 2px; }

/* OSCURECER PANTALÁN COMPLETADO */
.pasillo-container.completado .amarre-slot { opacity: 0.55; filter: grayscale(20%); }
.pasillo-container.completado .amarre-slot.hueco-base { opacity: 0.3; }

/* TARJETAS NORMALES */
.amarre-slot { position: relative; border-radius: 16px; height: 100px; background-color: #1e293b; background-size: cover; background-position: center; box-shadow: 0 4px 10px rgba(0,0,0,0.3); border: 1px solid #334155; cursor: pointer; overflow: hidden; z-index: 2; transition: all 0.2s ease; }
.slot-overlay { 
    position: absolute; 
    inset: 0; 
    /* Transparente arriba y en medio, sombra solo abajo para leer el texto */
    background: linear-gradient(to bottom, transparent 0%, transparent 60%, rgba(15,23,42,0.9) 100%); 
    z-index: 3; 
    pointer-events: none; 
}
/* ESTADO LIBRE MARCADO POR MARINERO (ROJO) */
.amarre-slot[data-estado="LIBRE"] { border-color: #ef4444; background-image: none !important; background-color: #fef2f2 !important; box-shadow: inset 0 0 15px rgba(239,68,68,0.2); }
.amarre-slot[data-estado="LIBRE"] .slot-overlay { background: transparent; }
.amarre-slot[data-estado="LIBRE"] .nombre-txt { text-decoration: line-through; color: #dc2626; text-shadow: none; font-weight: 900; }
.amarre-slot[data-estado="LIBRE"] .num-amarre { background: #ef4444; color: white; border-color: #ef4444; }
.amarre-slot[data-estado="LIBRE"] .btn-salida { background: #7f1d1d; border-color: #450a0a; color: #fca5a5; }
.amarre-slot[data-estado="LIBRE"] .btn-salida i::before { content: "\F122"; } 

/* HUECOS LIBRES DE BASE DE DATOS (BLANCOS Y LIMPIOS) */
.hueco-base { border: 2px dashed #94a3b8 !important; background-image: none !important; background-color: #f8fafc !important; box-shadow: none !important; }
.hueco-base .slot-overlay { background: transparent; }
.hueco-base .nombre-txt { color: #64748b; text-shadow: none; font-weight: 900; }
.hueco-base .num-amarre { background: #e2e8f0; color: #475569; border: 1px solid #cbd5e1; box-shadow: none; }
.hueco-base .btn-salida { background: #e2e8f0; border-color: #cbd5e1; color: #94a3b8; box-shadow: none; }

/* ESTADO EDITADO (AMARILLO) */
.amarre-slot[data-estado="EDITADO"] { border-color: #eab308; box-shadow: 0 0 15px rgba(234, 179, 8, 0.2); }

/* LEDS & TEXTOS */
.dots-container { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; z-index: 5; pointer-events: none; }
.led-dot { 
    width: 16px;  /* <-- Antes era 10px */
    height: 16px; /* <-- Antes era 10px */
    border-radius: 50%; 
    animation: ledPulse 1.6s infinite; 
}
.led-red { background-color: #ff0000; color: #ff0000; }
.led-yellow { background-color: #eeff00; color: #eeff00; }
.led-black { background-color: #0f172a; color: #ffffff; border: 1px solid rgba(255,255,255,0.4); }

.num-amarre { font-size: 0.8rem; font-weight: 900; background: rgba(255,255,255,0.9); color: #0f172a; padding: 2px 8px; border-radius: 8px; position: absolute; top: 8px; left: 8px; z-index: 5; border: 1px solid transparent; pointer-events: none; }
.nombre-txt { font-size: 0.85rem; font-weight: 800; color: white; position: absolute; bottom: 8px; left: 8px; right: 45px; z-index: 5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0px 2px 4px rgba(0,0,0,0.9); pointer-events: none; }

.btn-salida { position: absolute; bottom: 8px; right: 8px; background: rgba(220, 53, 69, 0.9); color: white; border: 1px solid #f87171; border-radius: 50%; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; z-index: 10; box-shadow: 0 4px 10px rgba(0,0,0,0.5); backdrop-filter: blur(4px); transition: 0.1s; cursor: pointer; }

/* EL NUEVO BOTÓN FLOTANTE AZUL (FAB) */
.fab-sincronizar { position: fixed; bottom: 25px; left: 50%; transform: translateX(-50%); background: rgba(59, 130, 246, 0.95); backdrop-filter: blur(10px); color: white; border: 1px solid #60a5fa; border-radius: 50px; padding: 14px 28px; font-weight: 900; font-size: 1rem; box-shadow: 0 10px 25px rgba(59, 130, 246, 0.4); display: flex; align-items: center; gap: 10px; z-index: 1040; transition: 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); cursor: pointer; white-space: nowrap; }
.fab-sincronizar:active { transform: translateX(-50%) scale(0.95); background: #2563eb; }

/* MODALES */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(15,23,42,0.85); backdrop-filter: blur(6px); z-index: 2000; align-items: center; justify-content: center; padding: 15px; }
.modal-overlay.open { display: flex; }
.modal-bottom-sheet { background: #1e293b; border: 1px solid #334155; width: 100%; max-width: 450px; max-height: 90vh; overflow-y: auto; border-radius: 24px; color: white; transform: scale(0.9); opacity: 0; transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); display: flex; flex-direction: column; box-shadow: 0 20px 40px rgba(0,0,0,0.8); }
.modal-overlay.open .modal-bottom-sheet { transform: scale(1); opacity: 1; }

.modal-header-img { width: 100%; height: 28vh; min-height: 180px; background-size: contain; background-repeat: no-repeat; background-position: center; background-color: #0f172a; position: relative; border-radius: 24px 24px 0 0; border-bottom: 1px solid #334155; transition: background-image 0.3s; }
.btn-close-modal { position: absolute; top: 12px; right: 12px; background: rgba(0,0,0,0.5); color: white; border: 1px solid rgba(255,255,255,0.2); border-radius: 50%; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); font-size: 1.2rem; cursor: pointer; }

.modal-body-content { padding: 20px; }
.modal-title-bar { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #334155; padding-bottom: 12px; margin-bottom: 15px; }
.modal-boat-name { font-weight: 900; font-size: 1.3rem; margin: 0; }
.modal-amarre-badge { background: #3b82f6; color: white; font-weight: 900; padding: 4px 10px; border-radius: 8px; }

.info-fecha-box { background: rgba(255,255,255,0.05); padding: 12px; border-radius: 12px; margin-bottom: 15px; display: flex; align-items: center; gap: 10px; font-size: 0.9rem; font-weight: 600; border: 1px solid rgba(255,255,255,0.1); }
.text-modal-label { color: #cbd5e1; } 

.form-control.dark-input { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.2); color: white; border-radius: 12px; }
.form-control.dark-input::placeholder { color: #94a3b8; opacity: 1; }
.form-control.dark-input:focus { background: rgba(255,255,255,0.1); border-color: #3b82f6; box-shadow: 0 0 0 0.2rem rgba(59,130,246,0.25); color: white; }

/* AVISO GLOBAL DE CAPITANÍA (MOTD) */
#modal-aviso-global { z-index: 3000; }
.motd-box { background: linear-gradient(145deg, #1e293b, #0f172a); border: 1px solid #3b82f6; text-align: center; }
.motd-icon { font-size: 3.5rem; color: #3b82f6; filter: drop-shadow(0 0 15px rgba(59, 130, 246, 0.4)); margin-bottom: 15px; }


.badge-reserva-linea {
    display: block;
    font-size: 0.68rem;
    color: #b45309;
    font-family: monospace;
    margin-top: 2px;
}

/* ==========================================
   📻 BOTÓN Y PANEL VHF
   ========================================== */
.btn-vhf {
    position: fixed;
    bottom: 95px; /* Por encima del botón Sincronizar */
    right: 20px;
    z-index: 1040;
    background: #0ea5e9;
    color: white;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.btn-vhf:active { transform: scale(0.9); }

.badge-vhf {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-weight: 900;
    font-size: 0.75rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.4);
    border: 2px solid #0f172a;
}

.panel-vhf {
    padding: 20px;
    background: linear-gradient(to bottom, #1e293b, #0f172a);
}
/* ==========================================
   🚨 ETRAQUES CON RESERVA (HOLOGRMA AMARILLO)
   ========================================== */
.slot-reservado-bloqueado {
    border: 2px dashed #eab308 !important;
    background-color: #fef08a !important; 
    box-shadow: 0 0 15px rgba(234, 179, 8, 0.4) !important;
}

/* Forzamos que el filtro amarillo translúcido se quede abajo */
.slot-reservado-bloqueado .slot-overlay {
    background: rgba(254, 240, 138, 0.6) !important; 
    z-index: 2 !important;
}

/* Subimos los textos y la etiqueta a la superficie */
.slot-reservado-bloqueado .nombre-txt {
    color: #854d0e !important;
    font-weight: 900 !important;
    text-shadow: none !important;
    z-index: 10 !important;
}
.slot-reservado-bloqueado .num-amarre {
    background: #eab308 !important;
    color: white !important;
    border-color: #ca8a04 !important;
    z-index: 10 !important;
}
.slot-reservado-bloqueado .btn-salida { display: none !important; }

.badge-reserva-linea {
    display: block;
    font-size: 0.7rem;
    color: #b45309;
    font-family: monospace;
    margin-top: 2px;
    font-weight: 800;
}

/* ==========================================
   ⚠️ FRÁNJA NARANJA DE RESERVA FUTURA (Ocupado)
   ========================================== */
.num-amarre {
    /* CORRECCIÓN 4: Subimos la etiqueta del amarre general a z-index 25 
       para que flote imbatible sobre la franja de reserva futura */
    z-index: 25 !important; 
}

.indicador-futuro {
    position: absolute;
    top: 0; left: 0; right: 0;
    background: #eab308;
    color: #422006;
    font-size: 0.65rem;
    font-weight: 900;
    text-align: center;
    padding: 2.5px;
    z-index: 20; /* Se queda en capa 20, por debajo del número (25) */
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@keyframes ledPulse { 0% { opacity: 0.5; box-shadow: 0 0 2px currentColor; } 50% { opacity: 1; box-shadow: 0 0 10px currentColor; } 100% { opacity: 0.5; box-shadow: 0 0 2px currentColor; } }
@keyframes resplandorAmarillo { 0% { border-color: #3b82f6; box-shadow: 0 0 5px #3b82f6; } 50% { border-color: #60a5fa; box-shadow: 0 0 25px #60a5fa; } 100% { border-color: #3b82f6; box-shadow: 0 0 5px #3b82f6; } }

.badge-reserva-linea {
    display: block;
    font-size: 0.7rem;
    color: #b45309;
    font-family: monospace;
    margin-top: 2px;
    font-weight: 800;
}

/* CHIVATO DE RESERVA FUTURA (Barco ocupado) */
.indicador-futuro {
    position: absolute;
    top: 0; left: 0; right: 0;
    background: #eab308;
    color: #422006;
    font-size: 0.65rem;
    font-weight: 900;
    text-align: center;
    padding: 2px;
    z-index: 20;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* CHIVATO DE RESERVA FUTURA (Barco ocupado) */
.indicador-futuro {
    position: absolute;
    top: 0; left: 0; right: 0;
    background: #eab308;
    color: #422006;
    font-size: 0.65rem;
    font-weight: 900;
    text-align: center;
    padding: 2px;
    z-index: 20;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}



@keyframes ledPulse { 0% { opacity: 0.5; box-shadow: 0 0 2px currentColor; } 50% { opacity: 1; box-shadow: 0 0 10px currentColor; } 100% { opacity: 0.5; box-shadow: 0 0 2px currentColor; } }
@keyframes resplandorAmarillo { 0% { border-color: #3b82f6; box-shadow: 0 0 5px #3b82f6; } 50% { border-color: #60a5fa; box-shadow: 0 0 25px #60a5fa; } 100% { border-color: #3b82f6; box-shadow: 0 0 5px #3b82f6; } }