:root {
    --azul-oscuro: #16324f;
    --azul: #2a5a8c;
    --rojo: #c0392b;
    --gris-claro: #f2f4f6;
    --gris-borde: #dde2e6;
    --texto: #1f2d3a;
    --texto-suave: #64748b;
    --verde: #1d9e75;
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    background: var(--gris-claro);
    color: var(--texto);
}

/* ---- Login ---- */
#pantalla-login {
    max-width: 340px;
    margin: 60px auto;
    padding: 24px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    text-align: center;
}
#pantalla-login h1 { color: var(--azul-oscuro); }

/* ---- Cabecera ---- */
header {
    background: var(--azul-oscuro);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}
header h1 { font-size: 17px; margin: 0; }
#estado-gps {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(255,255,255,0.15);
}

#pantalla-app { padding: 12px; padding-bottom: 40px; }

/* ---- Bloque de turno ---- */
#turno {
    background: #fff;
    border-radius: 10px;
    padding: 12px;
    margin: 12px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
#turno-info { font-weight: 600; color: var(--azul-oscuro); }
#turno button { width: auto; }
#btn-finalizar-turno {
    background: var(--rojo);
    color: #fff;
    font-weight: 600;
    border: none;
}

/* ---- Pestañas ---- */
.tabs {
    display: flex;
    gap: 4px;
    margin: 12px 0;
    background: #fff;
    border-radius: 10px;
    padding: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.tab-btn {
    flex: 1;
    padding: 10px 4px;
    font-size: 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--texto-suave);
    font-weight: 600;
    margin: 0;
}
.tab-btn.activo { background: var(--azul); color: #fff; }

/* ---- Inputs generales ---- */
input, select, textarea, button {
    padding: 12px;
    font-size: 15px;
    margin: 4px 0;
    width: 100%;
    border: 1px solid var(--gris-borde);
    border-radius: 8px;
    background: #fff;
    color: var(--texto);
}
button {
    cursor: pointer;
    border: none;
    background: var(--azul);
    color: #fff;
    font-weight: 600;
}
button:active { opacity: 0.85; }
textarea { min-height: 60px; }
.error { color: var(--rojo); font-size: 13px; }

/* ---- Tarjetas de servicio ---- */
#lista-servicios { list-style: none; padding: 0; margin: 0; }
#lista-servicios li {
    background: #fff;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
    border-left: 5px solid var(--gris-borde);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
#lista-servicios li.prioridad-urgente { border-left-color: var(--rojo); }
#lista-servicios li.prioridad-normal { border-left-color: var(--azul); }

.servicio-cabecera {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--texto-suave);
    margin-bottom: 4px;
}
.servicio-estado-badge {
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 600;
    background: var(--gris-claro);
    color: var(--azul-oscuro);
}
.servicio-paciente { font-size: 17px; font-weight: 700; margin: 2px 0; }
.servicio-ruta { font-size: 14px; color: var(--texto); margin: 4px 0; }
.servicio-extra { font-size: 13px; color: var(--texto-suave); margin: 2px 0; }
.servicio-acciones { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.servicio-acciones button { width: auto; flex: 1; min-width: 120px; }
.btn-avanzar { background: var(--verde); }
.btn-no-traslado { background: #fff; color: var(--rojo); border: 1px solid var(--rojo); }
.enlace-maps {
    display: inline-block;
    margin-top: 4px;
    font-size: 13px;
    color: var(--azul);
    font-weight: 600;
    text-decoration: none;
}

/* ---- Mensajes ---- */
#lista-mensajes {
    max-height: 220px;
    overflow-y: auto;
    background: #fff;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
#lista-mensajes p { margin: 4px 0; font-size: 14px; }

/* ---- Pantalla de detalle (tema oscuro tipo "Incident Details") ---- */
.detalle-oscuro {
    position: fixed; inset: 0; background: #17181c; color: #e6e6e8; z-index: 100;
    overflow-y: auto; font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
}
.detalle-cabecera {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px; border-bottom: 1px solid #2a2b30; position: sticky; top: 0; background: #17181c;
}
.detalle-cabecera #detalle-titulo { font-size: 16px; font-weight: 700; flex: 1; margin-left: 10px; }
.detalle-cabecera #detalle-hora { font-size: 13px; color: #9a9aa2; }
.btn-volver { width: auto; background: #23242a; color: #cfd0d6; border: 1px solid #33343b; padding: 6px 12px; font-size: 13px; }

.detalle-contenido { padding: 14px; }
.tarjeta-oscura { background: #1f2025; border: 1px solid #2a2b30; border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.tarjeta-oscura h3 { font-size: 13px; color: #cfd0d6; margin: 0 0 10px; text-transform: uppercase; letter-spacing: .04em; }
.campo-oscuro { margin-bottom: 8px; }
.campo-oscuro .etiqueta { font-size: 11px; color: #8a8b93; text-transform: uppercase; }
.campo-oscuro .valor { font-size: 14px; color: #e6e6e8; font-weight: 600; }
.valor.alerta { color: #ff6b6b; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.enlace-maps-oscuro {
    display: inline-block; margin-top: 6px; color: #5aa9ff; font-weight: 600; text-decoration: none; font-size: 13px;
}

.estado-actual-oscuro { font-size: 13px; color: #ffb020; font-weight: 700; margin-bottom: 10px; }

.linea-tiempo { display: flex; overflow-x: auto; gap: 4px; padding-bottom: 6px; margin-bottom: 12px; }
.paso-tiempo { flex-shrink: 0; width: 78px; text-align: center; font-size: 10px; color: #6c6d75; }
.paso-punto { width: 26px; height: 26px; border-radius: 50%; background: #2a2b30; margin: 0 auto 4px; display:flex; align-items:center; justify-content:center; font-size:12px; }
.paso-tiempo.completo .paso-punto { background: #1d9e75; color: #fff; }
.paso-tiempo.actual .paso-punto { background: #ff9f1c; color: #17181c; box-shadow: 0 0 0 4px rgba(255,159,28,0.25); }
.paso-tiempo.completo, .paso-tiempo.actual { color: #cfd0d6; }

.botones-estado-rapido { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 10px; }
.boton-estado-rapido {
    padding: 10px 6px; border-radius: 8px; border: none; font-weight: 700; font-size: 12px; color: #fff; cursor: pointer;
}
.boton-estado-rapido.activo-actual { outline: 2px solid #fff; }
.boton-no-trasladado-oscuro { background: #7a2323; color: #fff; width: 100%; margin-top: 4px; padding: 10px; border: none; border-radius: 8px; font-weight: 700; }

.nota-oscura { display: flex; gap: 6px; margin-top: 10px; }
.nota-oscura input { flex: 1; background: #101114; border: 1px solid #2a2b30; color: #e6e6e8; }
.nota-oscura button { width: auto; background: #23242a; border: 1px solid #33343b; color: #cfd0d6; }

/* ---- Sección "Otros" ---- */
h3 { margin-top: 20px; margin-bottom: 6px; font-size: 14px; color: var(--azul-oscuro); }

