:root {
  --azul: #1A81A2;
  --azul-oscuro: #156983;
  --titulo: #0F4F63;
  --fondo: #F6F5F4;
  --texto: #202124;
  --gris: #5F6368;
  --linea: #DADCE0;
  --rojo: #C0392B;
  --verde: #2E8B57;
  --naranja: #E67E22;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fondo); color: var(--texto); font: 15px/1.45 Roboto, -apple-system, "Segoe UI", Arial, sans-serif; }
a { color: var(--azul-oscuro); }
button, input, select { font: inherit; }

/* Pantallas sencillas: acceso, revisa tu correo, entrar */
body.sencilla { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.tarjeta { width: 100%; max-width: 420px; background: #fff; border-radius: 10px; border-top: 8px solid var(--azul); padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.tarjeta .logo { height: 34px; width: auto; display: block; margin-bottom: 18px; }
.tarjeta h1 { font-size: 22px; color: var(--titulo); margin: 0 0 10px; }
.tarjeta label { display: block; margin: 16px 0 6px; font-weight: 500; }
.tarjeta input { width: 100%; padding: 12px; border: 1px solid var(--linea); border-radius: 6px; }
.tarjeta button, .controles button { background: var(--azul); color: #fff; border: 0; border-radius: 6px; padding: 12px 18px; font-weight: 500; cursor: pointer; }
.tarjeta button { width: 100%; margin-top: 14px; }
.tarjeta button:hover, .controles button:hover { background: var(--azul-oscuro); }
.aviso { background: #FFF4E5; border-left: 4px solid #E8A33D; padding: 10px 12px; border-radius: 4px; margin: 12px 0; }

/* Mapa */
body.mapa { display: flex; flex-direction: column; min-height: 100vh; }
.barra { display: flex; align-items: center; gap: 12px; background: #fff; padding: 10px 16px; border-bottom: 3px solid var(--azul); }
.logo-barra { height: 26px; width: auto; }
.titulo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.titulo strong { color: var(--titulo); line-height: 1.2; }
.titulo span { color: var(--gris); font-size: 12px; }
.enlace { background: none; border: 0; color: var(--azul-oscuro); cursor: pointer; padding: 6px; }
.controles { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 16px; }
.controles input, .controles select { flex: 1 1 220px; padding: 11px 12px; border: 1px solid var(--linea); border-radius: 6px; background: #fff; }
.estados { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 8px; }
.estados button { background: #fff; color: var(--titulo); border: 1px solid var(--linea); border-radius: 18px; padding: 8px 14px; cursor: pointer; }
.estados button.activo { background: var(--titulo); border-color: var(--titulo); color: #fff; }
.resumen { margin: 0 16px 8px; font-weight: 500; color: var(--titulo); }
.resumen:empty { display: none; }
.leyenda { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 0 16px 8px; color: var(--gris); font-size: 13px; }
.punto { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.punto.tuya { background: var(--azul); }
.punto.atendida { background: var(--rojo); }
.punto.libre { background: var(--verde); }
.punto.visitada { border: 3px solid var(--naranja); background: #fff; }
.punto.aprox { border: 2px dashed var(--gris); }
#cuenta { margin-left: auto; font-weight: 500; color: var(--texto); }
body.mapa > .aviso { margin: 0 16px 8px; }
.cuerpo { flex: 1; display: flex; flex-direction: column; }
#mapa { height: 55vh; min-height: 300px; }
.lista { list-style: none; margin: 0; padding: 0 0 24px; background: #fff; }
.lista li { padding: 12px 16px; border-bottom: 1px solid var(--linea); display: flex; flex-direction: column; gap: 2px; cursor: pointer; border-left: 5px solid transparent; }
.lista li.tuya { border-left-color: var(--azul); }
.lista li.atendida { border-left-color: var(--rojo); }
.lista li.libre { border-left-color: var(--verde); }
.lista li .vis, .leaflet-popup-content .vis { color: var(--naranja); font-weight: 500; font-size: 13px; }
.leaflet-popup-content .marcar { display: block; width: 100%; margin-top: 10px; background: var(--verde); color: #fff; border: 0; border-radius: 6px; padding: 10px 12px; font-weight: 500; cursor: pointer; }
.leaflet-popup-content .marcar:disabled { background: var(--gris); cursor: default; }
.lista li span { color: var(--gris); font-size: 13px; }
.lista li em { font-style: normal; font-size: 13px; color: var(--titulo); }
.lista li.vacio, .lista li.acceso { cursor: default; color: var(--gris); }

@media (min-width: 900px) {
  .cuerpo { flex-direction: row; min-height: 0; }
  #mapa { flex: 1; height: auto; }
  .lista { width: 380px; max-height: calc(100vh - 150px); overflow-y: auto; }
}
