:root {
  --bg: #0f1115;
  --card: #181b21;
  --card2: #20242c;
  --line: #2a2f38;
  --text: #f2f3f5;
  --muted: #a3a9b4;
  --accent: #ff7a45;
  --ok: #4ade80;
  --warn: #facc15;
  --bad: #fb7185;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-size: 16px; line-height: 1.4;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.pantalla { max-width: 480px; margin: 0 auto; padding: 16px 20px 96px; display: flex; flex-direction: column; gap: 12px; }
.pantalla.centro { min-height: 100vh; justify-content: center; padding-bottom: 32px; }
.pantalla.con-pie { padding-bottom: 120px; }
.h1 { margin: 0; font-family: 'Barlow Condensed', 'Inter', sans-serif; font-weight: 700; font-size: 36px; line-height: 1; letter-spacing: 0.01em; }
.h1.grande { font-size: 44px; }
.h1.med { font-size: 30px; }
h2 { margin: 0; font-size: 17px; font-weight: 600; }
.seccion { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 8px 0 0; }
.muted { color: var(--muted); }
.sub { margin: 4px 0 0; font-size: 14px; }
.chico { font-size: 12px; }
.cap { text-transform: capitalize; }
.lema { text-align: center; font-family: 'Barlow Condensed', 'Inter', sans-serif; font-weight: 600; font-size: 20px; letter-spacing: 0.02em; padding: 12px 8px; border: 1px solid var(--line); border-radius: 20px; margin: 4px 0 0; }
.vacio { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.etq { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.lbl { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }

.tarjeta { background: var(--card); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.tarjeta.chica { padding: 12px 14px; }
.tarjeta.destaque { border: 1px solid var(--accent); }
.tarjeta.marco { border: 2px solid var(--accent); }
.aviso { background: #2b2610; color: var(--warn); border-radius: 14px; padding: 12px 14px; font-size: 14px; }
.enc { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-top: 8px; }
.topbar { display: flex; align-items: center; gap: 4px; min-height: 44px; margin: 0 -8px; }
.volver { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; }

.btn { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 52px; padding: 0 18px; border: 0; border-radius: 16px; background: var(--accent); color: #0f1115; font-weight: 600; width: 100%; }
.btn.sec { background: var(--card2); color: var(--text); }
.btn.mini { min-height: 44px; width: auto; padding: 0 14px; font-size: 14px; border-radius: 14px; }
.btn.corto { width: 96px; flex: none; }
.btn-link { background: none; border: 0; color: var(--accent); min-height: 44px; font-size: 14px; font-weight: 600; padding: 0; }
.cargando { opacity: 0.6; pointer-events: none; }
.acciones { display: flex; flex-direction: column; gap: 10px; }

.campo { display: flex; flex-direction: column; }
.campo label, .campo > .etq { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.campo label b.val { color: var(--text); }
input[type=text], input[type=email], input[type=password], input[type=date], input:not([type]), select, textarea {
  width: 100%; min-height: 48px; padding: 0 14px; background: var(--card2); border: 1px solid var(--line); border-radius: 14px; font-size: 16px;
}
textarea { padding: 10px 14px; min-height: 64px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #8a91a0; }
input[type=range] { width: 100%; min-height: 48px; accent-color: var(--accent); background: none; border: 0; padding: 0; }
input[type=checkbox] { width: 24px; height: 24px; margin: 0; accent-color: var(--accent); flex: none; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--text) !important; margin: 0 !important; min-height: 44px; }
.fila-op { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

.chips { display: grid; gap: 8px; }
.chips.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chips.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.chips.c7 { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.fila-chips { display: flex; flex-wrap: wrap; }
.chip { min-height: 48px; padding: 0 12px; border: 0; border-radius: 14px; background: var(--card); color: var(--text); font-size: 14px; font-weight: 500; }
.chips.c7 .chip { padding: 0; font-size: 16px; }
.fila-chips .chip { border-radius: 999px; min-height: 44px; padding: 0 16px; }
.chip.sel { background: var(--text); color: #0f1115; font-weight: 600; }
.tarjeta .chip { background: var(--card2); }
.tarjeta .chip.sel { background: var(--text); }
.tag { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; padding: 4px 8px; border-radius: 999px; background: var(--card2); color: var(--muted); }

.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.kpis.dos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpi { background: var(--card); border-radius: 16px; padding: 12px; }
.kpi b { display: block; font-family: 'Barlow Condensed', 'Inter', sans-serif; font-size: 32px; line-height: 1; }
.kpi span { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.kpi.ok b { color: var(--ok); }
.kpi.aviso-k b { color: var(--warn); }

.fila { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--card); border-radius: 16px; min-height: 64px; }
.fila.off { opacity: 0.6; }
.fila-txt { flex: 1; min-width: 0; }
.fila-t { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.fila-s { font-size: 13px; color: var(--muted); }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: #262b34; display: flex; align-items: center; justify-content: center; font-weight: 600; flex: none; }
.avatar.grande { width: 64px; height: 64px; font-size: 26px; }
.perfil { display: flex; align-items: center; gap: 14px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.al_dia { background: #14281d; color: var(--ok); }
.pill.atrasado { background: #2b2610; color: var(--warn); }
.pill.sin_cargar { background: #2e1a20; color: var(--bad); }
.pill.pausado { background: var(--card2); color: var(--muted); }

.gran { font-family: 'Barlow Condensed', 'Inter', sans-serif; font-weight: 700; font-size: 40px; line-height: 1; margin-top: 6px; }
.gran small { font-size: 18px; color: var(--muted); font-family: 'Inter', sans-serif; font-weight: 500; }
.grafico-enc { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.dif { color: var(--ok); font-size: 13px; font-weight: 600; padding-bottom: 4px; }
.chart { display: block; margin-top: 4px; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-line { stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chart-dot { fill: var(--accent); }
.chart-dot-last { fill: var(--bg); stroke: var(--accent); stroke-width: 3; }

.datos { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.dato dt { font-size: 12px; color: var(--muted); }
.dato dd { margin: 2px 0 0; font-size: 15px; overflow-wrap: anywhere; }
.reg { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.reg:last-child { border-bottom: 0; }

.foto { margin: 0; }
.foto img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 14px; background: var(--card2); display: block; }
.foto figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; }
.foto.vacia { aspect-ratio: 3 / 4; border-radius: 14px; background: var(--card2); display: flex; align-items: center; justify-content: center; text-align: center; padding: 8px; }
.par + .par { margin-top: 12px; }
.foto-slot { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; height: 112px; background: var(--card2); border: 1px dashed #3a404b; border-radius: 16px; font-size: 13px; color: var(--text); cursor: pointer; }
.foto-slot .ok-t { display: none; font-size: 12px; }
.foto-slot.lista { border-style: solid; border-color: var(--ok); }
.foto-slot.lista .ok-t { display: block; color: var(--ok); }
.foto-slot:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

.stepper { display: flex; align-items: center; background: var(--card2); border-radius: 14px; padding: 4px; gap: 4px; }
.stepper button { width: 44px; height: 44px; border: 0; border-radius: 10px; background: #2a2f38; font-size: 22px; flex: none; }
.stepper input { text-align: center; border: 0; background: none; min-width: 0; font-family: 'Barlow Condensed', 'Inter', sans-serif; font-weight: 700; font-size: 26px; padding: 0; }
.serie { display: flex; align-items: center; gap: 12px; padding: 0 14px; min-height: 52px; border-radius: 16px; background: var(--card); }
.serie.hecha { background: #14281d; }
.serie b { flex: 1; }
.ok-t { color: var(--ok); }

.prog { height: 4px; border-radius: 2px; background: var(--line); }
.prog i { display: block; height: 4px; border-radius: 2px; background: var(--accent); }
.pie { position: fixed; left: 0; right: 0; bottom: 0; background: var(--bg); border-top: 1px solid var(--line); padding: 12px 20px 20px; display: flex; gap: 10px; max-width: 480px; margin: 0 auto; }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; background: var(--bg); border-top: 1px solid var(--line); display: flex; justify-content: space-around; padding: 6px 8px 10px; max-width: 480px; margin: 0 auto; }
.tab { background: none; border: 0; color: var(--muted); font-size: 12px; font-weight: 500; min-width: 64px; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.tab.on { color: var(--accent); font-weight: 600; }

#toasts { position: fixed; left: 12px; right: 12px; bottom: 96px; display: flex; flex-direction: column; gap: 8px; align-items: center; z-index: 10; pointer-events: none; }
.toast { background: var(--text); color: #0f1115; padding: 12px 16px; border-radius: 14px; font-size: 14px; font-weight: 500; max-width: 440px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4); }
.toast.err { background: #fecdd3; color: #4c0519; }
