/* =========================================
   RESET Y BASE (Optimizado para Celulares)
   ========================================= */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    /* Fuente moderna de sistema */
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; 
    -webkit-tap-highlight-color: transparent; /* Quita el cuadro azul al tocar en Android */
}

body { 
    background-color: #f0f2f5; 
    color: #333; 
    padding-bottom: 100px; /* Espacio para que el teclado/barra no tape el fondo */
}

/* =========================================
   LA CLASE MÁS IMPORTANTE (Corrige el error de la ventana fantasma)
   ========================================= */
.oculto { 
    display: none !important; 
}

/* =========================================
   ENCABEZADO
   ========================================= */
header { 
    background: linear-gradient(135deg, #1a1a2e, #16213e); 
    color: white; 
    padding: 25px 20px; 
    text-align: center; 
    border-bottom-left-radius: 20px; 
    border-bottom-right-radius: 20px; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.15); 
}
header h1 { font-size: 26px; letter-spacing: 1px; font-weight: 800; }
header p { font-size: 14px; color: #a5b4fc; margin-top: 5px; }

/* =========================================
   NAVEGACIÓN (Pestañas Flotantes)
   ========================================= */
.tabs { 
    display: flex; 
    background: white; 
    margin: -15px 20px 20px; 
    position: relative;
    border-radius: 12px; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.08); 
    overflow: hidden; 
}
.tab-btn { 
    flex: 1; 
    padding: 16px; 
    border: none; 
    background: transparent; 
    font-size: 15px; 
    font-weight: 700; 
    color: #94a3b8; 
    cursor: pointer; 
    transition: all 0.3s ease; 
}
.tab-btn.activo { 
    color: #d63384; 
    background-color: #fdf2f8; 
    border-bottom: 3px solid #d63384; 
}

/* =========================================
   PANTALLAS Y TARJETAS
   ========================================= */
.pantalla { display: none; padding: 0 20px 20px; }
/* Animación suave al cambiar de pantalla */
.pantalla.activa { display: block; animation: aparecer 0.4s ease; }
@keyframes aparecer { 
    from { opacity: 0; transform: translateY(10px); } 
    to { opacity: 1; transform: translateY(0); } 
}

.tarjeta { 
    background: white; 
    padding: 22px; 
    border-radius: 16px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.04); 
    border: 1px solid #e2e8f0; 
}

/* =========================================
   FORMULARIOS (Listos para dedos gruesos)
   ========================================= */
label { 
    display: block; 
    font-weight: 600; 
    margin: 18px 0 8px; 
    color: #475569; 
    font-size: 14px; 
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.input-grande { 
    width: 100%; 
    padding: 14px 16px; 
    border: 2px solid #e2e8f0; 
    border-radius: 12px; 
    font-size: 16px; 
    background-color: #f8fafc; 
    color: #0f172a;
    transition: all 0.2s; 
    outline: none; 
}
.input-grande:focus { 
    border-color: #d63384; 
    background-color: #fff; 
    box-shadow: 0 0 0 4px rgba(214, 51, 132, 0.1); 
}

/* =========================================
   BOTONES DE TARIFA
   ========================================= */
.grupo-botones { display: flex; gap: 10px; margin-bottom: 10px; }
.btn-tarifa { 
    flex: 1; 
    padding: 14px 5px; 
    border: 2px solid #e2e8f0; 
    border-radius: 12px; 
    font-size: 14px; 
    font-weight: 700; 
    background: white; 
    color: #64748b; 
    cursor: pointer; 
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); 
}
.btn-tarifa.seleccionado { 
    background: #1e293b; 
    color: white; 
    border-color: #1e293b; 
    transform: scale(1.05); 
    box-shadow: 0 6px 12px rgba(0,0,0,0.15); 
}
.btn-tarifa.manual.seleccionado { 
    background: #f59e0b; 
    border-color: #f59e0b; 
}

/* Grid de tiempos (Dos columnas perfectas) */
.grid-tiempos { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 15px; 
    margin-top: 10px; 
}

/* =========================================
   BARRA TOTAL INFERIOR (Fija y Elegante)
   ========================================= */
.barra-total { 
    position: fixed; 
    bottom: 0; 
    left: 0; 
    width: 100%; 
    background: white; 
    padding: 15px 25px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08); 
    border-top-left-radius: 24px; 
    border-top-right-radius: 24px; 
    z-index: 100; 
}
.info-total span { 
    font-size: 12px; 
    color: #94a3b8; 
    font-weight: 700; 
    text-transform: uppercase; 
}
.info-total h2 { 
    color: #d63384; 
    font-size: 28px; 
    font-weight: 900; 
    margin-top: -2px; 
}
.btn-guardar { 
    background: linear-gradient(135deg, #d63384, #be185d); 
    color: white; 
    border: none; 
    padding: 16px 28px; 
    font-size: 16px; 
    font-weight: 800; 
    border-radius: 14px; 
    box-shadow: 0 4px 15px rgba(214, 51, 132, 0.35); 
    transition: transform 0.1s; 
}
.btn-guardar:active { transform: scale(0.95); } /* Se encoge al tocar */

/* =========================================
   TARJETAS DE RESUMEN (Pantalla 2)
   ========================================= */
.tarjeta-resumen { 
    background: white; 
    padding: 20px; 
    border-radius: 14px; 
    margin-bottom: 15px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-left: 6px solid #f59e0b; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.03); 
}
.resumen-info h3 { font-size: 18px; color: #0f172a; margin-bottom: 4px; font-weight: 800; }
.resumen-info p { font-size: 14px; color: #64748b; margin-bottom: 6px; font-weight: 500; }
.resumen-info strong { color: #d63384; font-size: 18px; font-weight: 800; }

.acciones-resumen {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-detalle {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
}

.btn-pagar { 
    background: #10b981; 
    color: white; 
    border: none; 
    padding: 10px 15px; 
    border-radius: 8px; 
    font-weight: 700; 
    font-size: 13px; 
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
    transition: transform 0.1s;
}
.btn-pagar:active { transform: scale(0.92); }


/* =========================================
   ESTILOS DE MODAL Y LISTA DE DETALLES
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex; /* Esto se activará SOLO cuando JS quite la clase 'oculto' */
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 15px;
}

.modal-contenido {
    background: white;
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    border-radius: 18px;
    overflow-y: auto;
    padding: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    animation: aparecer 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 12px;
    margin-bottom: 15px;
}

.modal-header h2 {
    font-size: 18px;
    color: #1e293b;
}

.btn-cerrar {
    background: none;
    border: none;
    font-size: 28px;
    color: #94a3b8;
    cursor: pointer;
}

/* Tarjeta individual de cada día dentro del Modal */
.item-dia {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-dia {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 13px;
    color: #475569;
}

.info-dia strong {
    color: #0f172a;
}

.monto-dia {
    color: #d63384 !important;
    font-size: 15px;
    margin-top: 2px;
}

.acciones-dia {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.btn-editar-item {
    background: #f59e0b;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.btn-eliminar-item {
    background: #ef4444;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}