/* ============================================================
   LOGITRAX - SISTEMA DEVICE (CONDUCTORES)
   Optimizado para móvil — pantalla táctil
   Color principal: #4d9eff
   Color acento:    #3a7bc8
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── BASE ───────────────────────────────────────────────────── */
body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background: #0d1b2a;
    position: relative;
    overflow-x: hidden;
}

/* ── FONDO BLUREADO ─────────────────────────────────────────── */
.bg-blur {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: url('../../images/topw.webp') no-repeat center center;
    background-size: cover;
    filter: blur(10px) brightness(0.6);
    transform: scale(1.05);
    z-index: 0;
}

/* ── LOGIN WINDOW ───────────────────────────────────────────── */
.login-window {
    position: relative;
    z-index: 1;
    width: 460px;
    background: #fff;
    border: 2px solid #4d9eff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(77,158,255,0.3), 0 8px 32px rgba(0,0,0,0.4);
}

.login-banner { width: 100%; height: 160px; overflow: hidden; }
.login-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }

.login-header {
    display: flex; flex-direction: row;
    justify-content: center; align-items: center;
    gap: 12px; padding: 18px 0 0;
    background: #fff; width: 100%;
}
.login-logo { max-height: 60px; filter: drop-shadow(0 0 8px #4d9eff); }
.login-title { color: #4d9eff; font-size: 28px; font-weight: 900; letter-spacing: 3px; }

.login-body { padding: 20px 35px 28px; background: #fff; }

.error-message {
    background: #f8d7da; border: 1px solid #f5c6cb;
    color: #721c24; padding: 10px 14px;
    border-radius: 8px; margin-bottom: 20px;
    font-size: 14px; display: flex; align-items: center; gap: 8px;
}

.input-group {
    display: flex; align-items: center;
    background: #f9fbff; border: 1px solid #d0dce8;
    border-radius: 10px; margin-bottom: 18px;
    transition: border 0.3s, box-shadow 0.3s; overflow: hidden;
}
.input-group:focus-within { border-color: #4d9eff; box-shadow: 0 0 0 3px rgba(77,158,255,0.1); }

.input-icon {
    width: 46px; display: flex; justify-content: center;
    align-items: center; color: #4d9eff; font-size: 16px;
    flex-shrink: 0; border-right: 1px solid #e0eaf5;
    padding: 0 12px; height: 48px;
}

.input-group input, .form-control {
    flex: 1; padding: 13px 14px;
    background: transparent; border: none; outline: none;
    color: #2c3e50; font-size: 15px; font-family: inherit;
}
.input-group input::placeholder { color: #aaa; font-size: 14px; }

.toggle-pass {
    background: none; border: none; color: #aaa;
    cursor: pointer; padding: 0 12px; font-size: 14px;
    transition: color 0.2s;
}
.toggle-pass:hover { color: #4d9eff; }

.btn-login {
    width: 100%; padding: 13px; margin-top: 6px;
    background: #4d9eff; color: #fff;
    font-size: 16px; font-weight: 700;
    border: none; border-radius: 10px; cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    display: flex; justify-content: center; align-items: center;
    gap: 8px; font-family: inherit;
}
.btn-login:hover { background: #3a7bc8; transform: translateY(-2px); }

.login-footer {
    margin-top: 16px; text-align: center;
    font-size: 13px; color: #4d9eff;
    display: flex; justify-content: center; align-items: center; gap: 7px;
}

/* ── DASHBOARD CONTAINER ────────────────────────────────────── */
.dashboard-container {
    position: relative;
    z-index: 1;
    width: 92%;
    max-width: 600px;
    margin: 20px auto;
    background: rgba(255,255,255,0.97);
    border-radius: 24px;
    padding: 24px 20px;
    backdrop-filter: blur(8px);
    border: 1px solid #e0eaf5;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.dashboard-title {
    color: #2c3e50; font-size: 1.5rem;
    font-weight: 800; text-align: center; margin-bottom: 6px;
}
.dashboard-title i { color: #4d9eff; margin-right: 8px; }
.dashboard-subtitle { color: #888; text-align: center; font-size: 0.85rem; margin-bottom: 20px; }

/* ── LISTA DE PEDIDOS ───────────────────────────────────────── */
.lista-pedidos { max-height: 300px; overflow-y: auto; margin-bottom: 12px; }

.pedido-item {
    background: #fff; border: 2px solid #e0eaf5;
    border-radius: 16px; padding: 16px; margin-bottom: 12px;
    cursor: pointer; transition: all 0.2s;
}
.pedido-item:hover { border-color: #4d9eff; box-shadow: 0 4px 12px rgba(77,158,255,0.15); }
.pedido-item.seleccionado {
    background: #4d9eff; border-color: #4d9eff;
    box-shadow: 0 0 0 3px rgba(77,158,255,0.2);
}
.pedido-item.seleccionado .pedido-cliente,
.pedido-item.seleccionado .pedido-fecha { color: #fff; }

.pedido-cliente { font-weight: 700; color: #4d9eff; font-size: 1.1rem; }
.pedido-fecha { font-size: 0.8rem; color: #888; }

/* ── BOTÓN DETALLES ─────────────────────────────────────────── */
.btn-detalles-pedido {
    width: 100%; background: #4d9eff; color: #fff;
    border: none; border-radius: 14px; padding: 14px 16px;
    font-size: 1rem; font-weight: 700; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    gap: 10px; transition: background 0.2s, transform 0.15s;
    box-shadow: 0 4px 14px rgba(77,158,255,0.3); font-family: inherit;
}
.btn-detalles-pedido:hover { background: #3a7bc8; transform: scale(1.02); }

/* ── CARDS DEL DASHBOARD ────────────────────────────────────── */
.dashboard-cards { display: flex; flex-direction: column; gap: 15px; margin-top: 10px; }

.card {
    background: #fff; border: 2px solid #e0eaf5;
    border-radius: 20px; padding: 18px 16px;
    text-align: center; cursor: pointer;
    transition: all 0.3s ease;
    display: flex; align-items: center; justify-content: center;
    gap: 16px; box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.card:hover:not(:disabled):not(.card-disabled) {
    background: #4d9eff; border-color: #4d9eff;
    transform: scale(1.02);
}
.card:hover:not(:disabled):not(.card-disabled) .card-icon i,
.card:hover:not(:disabled):not(.card-disabled) h3,
.card:hover:not(:disabled):not(.card-disabled) p { color: #fff; }

.card-icon i { font-size: 2rem; color: #4d9eff; }
.card h3 { color: #2c3e50; font-size: 1.2rem; font-weight: 700; margin: 0; }
.card p  { color: #888; font-size: 0.75rem; margin: 0; }

.card-disabled { opacity: 0.38; cursor: not-allowed; transform: none !important; pointer-events: none; }

.btn-salir { background: #eef2f5; border-color: #d0dce8; pointer-events: auto !important; opacity: 1 !important; }
.btn-salir h3, .btn-salir i { color: #4d9eff !important; }
.btn-salir:hover { background: #4d9eff !important; border-color: #4d9eff !important; }
.btn-salir:hover h3, .btn-salir:hover i { color: #fff !important; }

/* ── MODALES ────────────────────────────────────────────────── */
.modal {
    display: none; position: fixed; z-index: 1000;
    left: 0; top: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    justify-content: center; align-items: center;
}
.modal-content {
    background: #fff; border-radius: 24px; padding: 24px;
    width: 90%; max-width: 400px; border-top: 4px solid #4d9eff;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.modal-content h3 { color: #4d9eff; margin-bottom: 20px; font-size: 1.4rem; }
.modal-content label { display: block; margin-top: 12px; margin-bottom: 6px; font-weight: 600; color: #555; }
.modal-content input, .modal-content select {
    width: 100%; padding: 10px; border: 1px solid #d0dce8;
    border-radius: 8px; font-size: 1rem; font-family: inherit;
}
.modal-content input:focus, .modal-content select:focus {
    outline: none; border-color: #4d9eff;
    box-shadow: 0 0 0 3px rgba(77,158,255,0.1);
}
.modal-buttons { display: flex; gap: 12px; margin-top: 24px; }
.modal-buttons button { flex: 1; padding: 12px; border: none; border-radius: 12px; font-weight: 700; cursor: pointer; font-family: inherit; }
.btn-guardar { background: #4d9eff; color: #fff; }
.btn-guardar:hover { background: #3a7bc8; }
.btn-cancelar { background: #eef2f5; color: #555; }
.btn-cancelar:hover { background: #d0dce8; }

/* ── MODAL DETALLES ─────────────────────────────────────────── */
.modal-detalles { max-width: 500px; max-height: 85vh; overflow-y: auto; }
.detalle-mapa { margin-bottom: 12px; border-radius: 12px; overflow: hidden; }
.detalle-direccion { background: #f9fbff; padding: 12px; border-radius: 12px; margin-bottom: 12px; border: 1px solid #e0eaf5; }
.detalle-direccion label { font-weight: 700; color: #4d9eff; margin-bottom: 6px; display: block; }
.detalle-direccion p { color: #2c3e50; margin: 0; word-break: break-word; font-size: 0.9rem; }

.btn-google-maps {
    background: #4285F4; color: #fff; border: none;
    padding: 9px 14px; border-radius: 10px; cursor: pointer;
    font-weight: 700; font-size: 0.85rem;
    display: flex; align-items: center; justify-content: center;
    gap: 8px; width: auto; min-width: 140px;
    margin: 0 auto 14px auto; transition: background 0.2s;
}
.btn-google-maps:hover { background: #3367D6; }

/* ── ITEMS DEL PEDIDO ───────────────────────────────────────── */
.detalle-items { margin-top: 4px; }
.detalle-items label { font-weight: 700; color: #4d9eff; display: block; margin-bottom: 8px; }
.detalle-items ul { list-style: none; padding: 0; }
.detalle-items li {
    background: #f9fbff; border: 1px solid #e0eaf5;
    border-radius: 8px; padding: 8px 12px;
    margin-bottom: 8px; color: #2c3e50; font-size: 0.85rem;
}

/* ── MENSAJES ESTADO ────────────────────────────────────────── */
.cargando, .sin-pedidos, .error {
    background: #f9fbff; color: #4d9eff;
    padding: 20px; text-align: center; border-radius: 12px;
    border: 1px solid #e0eaf5;
}
.error { color: #dc3545; background: #f8d7da; border-color: #f5c6cb; }

/* ── RESPONSIVE MÓVIL ───────────────────────────────────────── */
@media (max-width: 480px) {
    .login-window { width: 95%; }
    .login-body { padding: 16px 20px 24px; }
    .login-title { font-size: 22px; }
    .dashboard-container { width: 96%; padding: 16px; }
    .card { padding: 14px 12px; }
    .card h3 { font-size: 1rem; }
}
