/* ============================================================================
   ESTILOS — Tablero de medición de módulos · APEC
   ============================================================================ */

:root {
  --azul: #2f6fb0;
  --azul-bg: #e6f1fb;
  --azul-tx: #0c447c;
  --gris: #9c9a90;
  --gris-bg: #f1efe8;
  --gris-tx: #56554f;
  --ambar: #e0941c;
  --ambar-bg: #faeeda;
  --ambar-tx: #6b400a;
  --pared: #3a3a37;
  --bg: #faf9f5;
  --surface: #ffffff;
  --border: #e3e0d6;
  --text: #2c2c2a;
  --text-mut: #76746c;
  --text-faint: #a3a199;
  --radius: 10px;
  --radius-sm: 7px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  padding: 14px;
  max-width: 860px;
  margin: 0 auto;
}

h1 {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 2px;
  letter-spacing: -0.01em;
}
.sub { font-size: 12px; color: var(--text-faint); margin: 0 0 16px; }

.bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.bar label { font-size: 13px; color: var(--text-mut); }

select {
  font: inherit;
  font-size: 14px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  min-width: 130px;
}

.sesion {
  font-size: 11px;
  color: var(--text-faint);
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.leyenda {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-mut);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }

.plano-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  margin-bottom: 18px;
}
svg { display: block; width: 100%; height: auto; touch-action: manipulation; }
.estacion { cursor: pointer; }
.est-num { font-weight: 600; pointer-events: none; }

.seccion-tit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 8px;
}
.seccion-tit p { font-size: 13px; font-weight: 600; color: var(--text-mut); margin: 0; }
.contador { font-size: 12px; color: var(--text-faint); }

#log {
  max-height: 230px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}
.log-line {
  font-size: 13px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 10px;
  align-items: baseline;
}
.log-line:last-child { border-bottom: none; }
.log-time { color: var(--text-faint); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.log-empty { padding: 20px 12px; text-align: center; color: var(--text-faint); font-size: 13px; }

.acciones { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
button {
  font: inherit;
  font-size: 14px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background 0.15s;
}
button:hover { background: var(--gris-bg); }
button:active { transform: scale(0.98); }
button.primary { background: var(--azul); border-color: var(--azul); color: #fff; }
button.primary:hover { background: var(--azul-tx); }
button svg { width: 16px; height: 16px; }

.nota {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 16px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

/* menú emergente de estado (bottom sheet) */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
}
.overlay.show { display: flex; }
.sheet {
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 420px;
  padding: 8px 0 max(16px, env(safe-area-inset-bottom));
  animation: slideUp 0.18s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-head {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-mut);
  padding: 10px 0 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.sheet-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  font-size: 15px;
  cursor: pointer;
}
.sheet-opt:active { background: var(--gris-bg); }
.sheet-opt .dot { width: 14px; height: 14px; }
.sheet-sub { font-size: 12px; color: var(--text-faint); padding: 8px 20px 4px; }

@media (min-width: 600px) {
  .overlay { align-items: center; }
  .sheet { border-radius: 16px; animation: none; }
}
