:root {
    --gold: #F5C142; --gold-dark: #D4960A; --gold-light: #FFD97D;
    --black: #111111; --gray-light: #f7f5ee;
}
* { box-sizing: border-box; }
body {
    margin: 0; font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--gray-light); color: var(--black);
    -webkit-tap-highlight-color: transparent;
}
.pantalla { display: none; min-height: 100vh; flex-direction: column; }
.pantalla.activa { display: flex; }

.topbar {
    background: var(--black); color: #fff; padding: 14px 16px;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: 16px; margin: 0; font-weight: 700; }
.topbar .volver { color: #fff; text-decoration: none; font-size: 20px; background: none; border: none; }
.topbar .salir { color: #ff8a8a; background: none; border: none; font-size: 13px; font-weight: 600; }

.contenido { flex: 1; padding: 16px; }

/* Login */
.login-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; }
.logo-circulo {
    width: 70px; height: 70px; border-radius: 50%; overflow: hidden;
    display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
    background: linear-gradient(135deg, var(--gold-light), var(--gold-dark));
}
.logo-circulo img { width: 100%; height: 100%; object-fit: cover; }
.login-titulo { font-size: 22px; font-weight: 800; margin: 0; }
.login-subtitulo { font-size: 14px; color: #888; margin: 4px 0 28px; }
.campo { width: 100%; max-width: 320px; }
input, textarea, select {
    width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid #e5e2d8;
    background: #fff; font-size: 15px; margin-bottom: 12px; font-family: inherit;
}
.btn {
    width: 100%; max-width: 320px; padding: 14px; border-radius: 10px; border: none;
    font-weight: 700; font-size: 15px; cursor: pointer;
}
.btn-dorado { background: var(--gold); color: var(--black); }
.btn-dorado:active { background: var(--gold-dark); }
.btn-negro { background: var(--black); color: #fff; }
.btn-outline { background: #fff; border: 1px solid #ccc; color: #333; font-weight: 600; font-size: 13px; }
.btn:disabled { opacity: .6; }
.login-ayuda { margin-top: 28px; text-align: center; color: #888; font-size: 12px; }

/* Instalar banner */
#bannerInstalar {
    display: none; background: var(--gold-light); color: var(--black); padding: 10px 16px;
    font-size: 13px; text-align: center; font-weight: 600;
}
#bannerInstalar button { margin-left: 8px; background: var(--black); color: #fff; border: none; border-radius: 6px; padding: 6px 10px; font-size: 12px; }

/* Resumen / rutas */
.resumen-card { background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 12px; display: flex; justify-content: space-between; }
.resumen-card .label { color: #888; font-size: 13px; }
.resumen-card .valor { font-weight: 700; }
.ruta-card {
    background: #fff; border-radius: 14px; padding: 14px; margin-bottom: 10px;
}
.ruta-card.pendiente { border: 1.5px solid var(--gold); }
.ruta-card .fila { display: flex; justify-content: space-between; margin-bottom: 4px; }
.ruta-card .cliente { font-weight: 700; font-size: 14px; }
.ruta-card .estado { font-size: 11px; font-weight: 700; color: #888; }
.ruta-card .direccion, .ruta-card .horario { color: #888; font-size: 12px; }
.vacio { text-align: center; color: #888; margin-top: 40px; }

/* Cards genéricas */
.card { background: #fff; border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.card .dato { color: #555; font-size: 13px; margin-bottom: 2px; }
.card .titulo-servicio { font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.card .label-mini { color: #888; font-size: 12px; }

.nota { text-align: center; color: #888; font-size: 12px; margin-top: 8px; }

/* En curso */
.cronometro-card { background: #fff; border-radius: 14px; padding: 18px; margin-bottom: 12px; text-align: center; }
.estado-encurso { color: #e2432a; font-weight: 700; margin-bottom: 8px; }
.cronometro { font-size: 32px; font-weight: 800; }

/* Finalizar */
.fila-evidencia { display: flex; justify-content: space-between; align-items: center; }
#previewFoto { width: 100%; border-radius: 10px; margin-top: 10px; display: none; max-height: 200px; object-fit: cover; }

/* Completado */
.completado-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; }
.check-circulo {
    width: 64px; height: 64px; border-radius: 50%; background: #d3f9e6; color: #0a8a4a;
    display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 700; margin-bottom: 16px;
}

.spinner {
    width: 18px; height: 18px; border: 2px solid rgba(0,0,0,.2); border-top-color: var(--black);
    border-radius: 50%; display: inline-block; animation: girar .7s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }

#mapaServicio { height: 240px; border-radius: 10px; margin-bottom: 10px; }

/* Stepper (wizard de finalizar) */
.stepper { display: flex; margin-bottom: 14px; }
.stepper-item { flex: 1; text-align: center; }
.stepper-circulo {
    width: 26px; height: 26px; border-radius: 50%; background: #e5e2d6; color: #999;
    display: flex; align-items: center; justify-content: center; margin: 0 auto;
    font-size: 12px; font-weight: 700;
}
.stepper-item.activo .stepper-circulo, .stepper-item.completo .stepper-circulo { background: var(--black); color: var(--gold); }
.stepper-label { font-size: 9px; color: #999; margin-top: 4px; }
.stepper-item.activo .stepper-label { color: var(--black); font-weight: 700; }

/* Chips (selector de producto) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip {
    border: 1px solid #ddd; border-radius: 20px; padding: 8px 12px; font-size: 12px;
    font-weight: 600; color: #333; background: #fff; cursor: pointer;
}
.chip.activo { background: var(--black); border-color: var(--black); color: var(--gold); }

/* Filas de dos columnas */
.fila-dos { display: flex; gap: 10px; }
.fila-dos .mitad { flex: 1; }

/* Fotos (grid con miniaturas removibles) */
.grid-fotos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.foto-mini-wrap { position: relative; width: 72px; height: 72px; }
.foto-mini-wrap img { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; }
.foto-mini-wrap .quitar-foto {
    position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%;
    background: var(--black); color: #fff; border: none; font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}

/* Revisar */
.titulo-revision { font-weight: 700; font-size: 14px; margin-bottom: 10px; }
.revision-item { border-bottom: 1px solid var(--gray-light); padding: 8px 0; }
.revision-item .revision-label { font-size: 11px; color: #999; text-transform: uppercase; }
.revision-item .revision-valor { font-size: 14px; font-weight: 600; margin-top: 2px; }

/* Firmas */
.firma-box { border: 1px solid #eee; border-radius: 10px; overflow: hidden; margin-top: 8px; background: #fff; }
.firma-box canvas { width: 100%; height: 160px; display: block; touch-action: none; }
.fila-firma-botones { display: flex; justify-content: flex-end; margin-top: 8px; }
.fila-firmas-completado { display: flex; gap: 16px; }
.fila-firmas-completado > div { flex: 1; text-align: center; }
.fila-firmas-completado img { width: 100%; height: 80px; object-fit: contain; background: var(--gray-light); border-radius: 8px; }
.fila-firmas-completado .firma-label { font-size: 11px; color: #888; margin-top: 6px; }

/* Navegación del wizard */
.fila-nav-pasos { display: flex; gap: 10px; margin-top: 8px; }
