:root {
  /* Papel y tinta de Megatherium Studio (Atelier), con el bordó y el dorado de Madero Tango
     apagados: superficies planas, líneas finas, sin brillos ni sombras blandas. */
  --bg: #f4f1ea;
  --surface: #fbfaf6;
  --surface-2: #efebe2;
  --line: #ddd6c7;
  --line-2: #cbc2b0;
  --ink: #1d1c18;
  --ink-2: #47463f;
  --muted: #6e7068;
  --accent: #6e2630;
  --accent-hover: #561d25;
  --accent-soft: #f0e5e2;
  --gold: #957a45;
  --gold-hi: #c9ad73;
  --night: #1e1c1a;
  --night-2: #252220;
  --night-3: #2c2926;
  --night-line: #3b3632;
  --night-ink: #ebe6de;
  --night-muted: #a59e93;
  --ok: #2f6640;   --ok-bg: #e7efe6;
  --warn: #85602a; --warn-bg: #f6eedc;
  --bad: #9a3328;  --bad-bg: #f6e6e1;
  --info: #3c5a76; --info-bg: #e8edf0;
  --radius: 8px;
  --shadow: none;
  --shadow-pop: 0 10px 30px rgba(20,16,12,.16);
  --serif: "IBM Plex Serif", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --lento: cubic-bezier(.3,.6,.25,1);
  font-size: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--sans);
  background: var(--bg); color: var(--ink); line-height: 1.55;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button { font: inherit; cursor: pointer; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent); }
h1 { font-family: var(--serif); font-weight: 400; font-size: 2rem; margin: 0 0 4px; letter-spacing: -.01em; line-height: 1.15; }
h2 { font-family: var(--serif); font-weight: 400; font-size: 1.4rem; margin: 0 0 6px; letter-spacing: -.005em; }
h3 { font-size: 1rem; font-weight: 600; margin: 0 0 6px; }
.lead { color: var(--ink-2); margin: 0 0 22px; max-width: 75ch; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- barra superior ---------- */
.top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 20px;
  background: var(--night); color: var(--night-ink);
  padding: 0 22px; height: 58px;
  border-bottom: 1px solid var(--night-line);
}
.brand { display: flex; flex-direction: column; line-height: 1.15; flex-shrink: 0; text-decoration: none; }
.brand-name { font-family: var(--serif); font-size: 1.2rem; color: #fff; letter-spacing: .01em; }
.brand-name span { color: var(--gold-hi); }
.brand-sub { font-family: var(--mono); font-size: .6rem; color: var(--night-muted); text-transform: uppercase; letter-spacing: .14em; margin-top: 2px; }
.tabs { display: flex; gap: 2px; flex: 1; min-width: 0; align-self: stretch; }
.tabs a {
  display: flex; align-items: center; padding: 0 12px; white-space: nowrap;
  color: var(--night-muted); text-decoration: none; font-size: .9rem;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .2s, border-color .2s;
}
/* las secciones que el rol no ve se ocultan (display: flex le gana al atributo hidden) */
.tabs a[hidden], .navsheet a[hidden] { display: none; }
.tabs a:hover { color: var(--night-ink); }
.tabs a.active { color: #fff; border-bottom-color: var(--gold-hi); font-weight: 500; }
.tabs a .n { font-family: var(--mono); font-size: .7rem; color: var(--gold); margin-right: 7px; }
.tabs a.active .n { color: var(--gold-hi); }
.top-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.sync { display: flex; align-items: center; gap: 7px; font-size: .78rem; color: var(--night-muted); white-space: nowrap; }
.sync .dot { width: 8px; height: 8px; border-radius: 50%; background: #6f9a77; }
.sync.saving .dot { background: var(--gold-hi); }
.sync.offline .dot { background: #c4685c; }
.sync.offline { color: #e7b2aa; }
.btn-top {
  background: transparent; border: 1px solid var(--night-line); color: var(--night-ink);
  padding: 6px 12px; border-radius: 6px; font-size: .84rem;
}
.btn-top:hover { border-color: var(--gold); color: #fff; }
.menu { position: relative; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-pop); padding: 6px; min-width: 300px;
}
.menu-pop button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 10px 12px; border-radius: 6px; }
.menu-pop button:hover { background: var(--surface-2); }
.menu-pop button[hidden] { display: none; }
.btn-top[hidden], .navsheet [hidden] { display: none !important; }
.menu-pop small { display: block; color: var(--muted); font-size: .78rem; }
.menu-sep { border-top: 1px solid var(--line); margin: 6px 4px; }
/* Si la barra no entra: primero se achica (sin subtítulo ni texto de guardado), y si igual no
   entra, las secciones pasan al menú. Así nunca hay que desplazarse de costado. */
.top.justa .brand-sub, .top.justa .sync .lbl { display: none; }
.top.justa .tabs a { padding: 0 9px; }

.main { padding: 26px 30px 70px; max-width: 1500px; margin: 0 auto; }
.main.full { max-width: none; padding: 0; }

/* ---------- elementos comunes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.eyebrow { font-family: var(--mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .14em; color: var(--gold); font-weight: 500; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  padding: 6px 12px; border-radius: 6px; font-size: .86rem; line-height: 1.2; user-select: none;
  transition: border-color .2s, background .2s;
}
.chip:hover { border-color: var(--line-2); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.sm { padding: 4px 9px; font-size: .8rem; }
.tag { display: inline-block; font-size: .72rem; padding: 1px 7px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.tag.gold { background: #f3ecdc; border-color: #e2d4b4; color: #6f5a2c; }
.tag.ok { background: var(--ok-bg); border-color: #c9dbc8; color: var(--ok); }
.tag.warn { background: var(--warn-bg); border-color: #e8d9b6; color: var(--warn); }
.tag.bad { background: var(--bad-bg); border-color: #e9cbc3; color: var(--bad); }
.tag.info { background: var(--info-bg); border-color: #cfd9e0; color: var(--info); }
.btn {
  background: var(--accent); color: #fff; border: 1px solid var(--accent); border-radius: 6px;
  padding: 9px 16px; font-weight: 500; font-size: .9rem; transition: background .2s, border-color .2s;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line-2); }
.btn.ghost:hover { background: var(--accent-soft); border-color: var(--accent-soft); }
.btn.sm { padding: 5px 11px; font-size: .82rem; }
.linkbtn { background: none; border: 0; color: var(--accent); padding: 0; text-decoration: underline; text-decoration-color: rgba(110,38,48,.35); text-underline-offset: 3px; font-size: .86rem; }
.linkbtn:hover { text-decoration-color: currentColor; }
.x { background: none; border: 0; color: var(--muted); font-size: 1.2rem; line-height: 1; padding: 4px 8px; border-radius: 6px; }
.x:hover { background: var(--bad-bg); color: var(--bad); }
textarea, input[type=text], input[type=date], select {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 6px;
  padding: 9px 11px; font-size: .95rem; outline: none; transition: border-color .2s;
}
textarea { resize: vertical; min-height: 74px; line-height: 1.5; }
textarea:focus, input:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(149,122,69,.12); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { background: none; border: 0; padding: 6px 12px; border-radius: 5px; font-size: .86rem; color: var(--ink-2); }
.seg button.on { background: var(--surface); color: var(--ink); font-weight: 500; box-shadow: 0 0 0 1px var(--line); }
.bar { height: 5px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .8s var(--lento); }
.bar.gold > i { background: var(--gold); }
/* Relevamiento: respondidas y, a continuación, las que hay que confirmar */
.bar.bar-estados { display: flex; }
.bar.bar-estados > i { border-radius: 0; }
.bar.bar-estados > i.conf { background: var(--warn); }
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(12px);
  background: var(--night); color: #fff; padding: 10px 18px; border-radius: 6px; font-size: .9rem;
  opacity: 0; pointer-events: none; transition: .35s var(--lento); z-index: 80;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- plan ---------- */
.plan-hero {
  background: var(--night);
  color: var(--night-ink); border-radius: var(--radius); padding: 34px 38px 30px; margin-bottom: 22px;
  border-top: 3px solid var(--accent);
  position: relative; overflow: hidden;
}
.plan-hero h1 { color: #fff; font-size: 2.3rem; }
.plan-hero h1 span { color: var(--gold-hi); }
.plan-hero p { color: #d6d0c6; max-width: 70ch; margin: 6px 0 0; }
.plan-hero .meta { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 16px; font-size: .9rem; color: var(--night-muted); }
.plan-hero .meta b { color: var(--gold-hi); font-weight: 600; }
.timeline { position: relative; margin: 30px 6px 4px; height: 58px; }
.timeline .rail { position: absolute; left: 0; right: 0; top: 23px; height: 2px; background: rgba(255,255,255,.12); }
.timeline .done { position: absolute; left: 0; top: 23px; height: 2px; background: var(--gold-hi); }
.timeline .hito { position: absolute; top: 12px; transform: translateX(-50%); text-align: center; font-size: .8rem; color: var(--night-muted); white-space: nowrap; }
.timeline .hito i { display: block; width: 24px; height: 24px; margin: 0 auto 4px; border-radius: 50%; background: var(--night); border: 2px solid var(--gold-hi); font-style: normal; font-family: var(--mono); color: var(--gold-hi); line-height: 20px; font-size: .72rem; }
.timeline .hito.first { transform: none; text-align: left; }
.timeline .hito.first i { margin: 0 0 4px; }
.timeline .hoy { position: absolute; top: 0; transform: translateX(-50%); font-family: var(--mono); font-size: .64rem; color: #fff; text-transform: uppercase; letter-spacing: .14em; }
.timeline .hoy::after { content: ""; display: block; width: 1px; height: 30px; background: #fff; margin: 2px auto 0; opacity: .7; }
.bloques { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.bloque { display: flex; flex-direction: column; gap: 12px; }
.bloque-head { display: flex; gap: 14px; align-items: flex-start; }
.bloque-num { font-family: var(--serif); font-size: 2.4rem; line-height: .9; color: var(--accent); font-weight: 300; }
.bloque-fecha { font-size: .86rem; color: var(--muted); }
.bloque-fecha b { color: var(--ink); }
.entregable { border-top: 1px solid var(--line); padding-top: 10px; }
.entregable .cod { font-family: var(--mono); font-size: .8rem; color: var(--gold); margin-right: 6px; }
.entregable p { margin: 3px 0 0; font-size: .86rem; color: var(--ink-2); }
.entregable .bar { margin-top: 8px; }
.entregable .prog { font-size: .76rem; color: var(--muted); margin-top: 3px; }
.peds-mini { display: flex; flex-wrap: wrap; gap: 6px; }
.equipo { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.persona { text-align: center; padding: 16px 10px; }
.avatar { width: 46px; height: 46px; margin: 0 auto 8px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-family: var(--serif); font-size: 1.2rem; }
.persona b { display: block; }
.persona span { display: block; font-size: .8rem; color: var(--muted); line-height: 1.3; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 28px 0 12px; }

/* ---------- mapa (escenario) ---------- */
.escenario {
  background: var(--night);
  color: var(--night-ink); min-height: calc(100vh - 58px);
  padding: 20px 26px 50px;
}
.mapa-bar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 12px; }
.mapa-bar h1 { color: #fff; font-size: 1.7rem; margin: 0; }
.mapa-bar .spacer { flex: 1; }
.modo { display: inline-flex; border: 1px solid var(--night-line); border-radius: 7px; padding: 3px; background: rgba(0,0,0,.2); }
.modo button { background: none; border: 0; color: var(--night-muted); padding: 7px 16px; border-radius: 5px; font-size: .9rem; }
.modo button.on { background: var(--gold-hi); color: var(--night); font-weight: 600; }
.contadores { display: flex; gap: 18px; font-size: .86rem; color: var(--night-muted); }
.contadores b { font-family: var(--serif); font-size: 1.3rem; color: #fff; font-weight: 400; margin-right: 5px; }
.contadores .hue b { color: var(--gold-hi); }
.capas { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin-bottom: 6px; }
.capas .lbl { font-family: var(--mono); font-size: .64rem; text-transform: uppercase; letter-spacing: .14em; color: var(--night-muted); margin-right: 6px; }
.capa {
  border: 1px solid var(--night-line); background: transparent; color: var(--night-muted);
  padding: 5px 11px; border-radius: 6px; font-size: .82rem; display: inline-flex; gap: 7px; align-items: center;
  transition: color .2s, border-color .2s, background .2s;
}
.capa i { font-style: normal; font-size: .72rem; color: var(--night-muted); }
.capa:hover { color: var(--night-ink); }
.capa.on { background: rgba(201,173,115,.12); border-color: rgba(201,173,115,.6); color: #fff; }
.capa.on i { color: var(--gold-hi); }
.capa.mini { border-style: dashed; color: var(--night-muted); }
.btn-dark { background: transparent; border: 1px solid var(--night-line); color: var(--night-ink); border-radius: 6px; padding: 6px 12px; font-size: .84rem; }
.btn-dark:hover { border-color: var(--gold-hi); }
.leyenda { display: flex; gap: 16px; flex-wrap: wrap; font-size: .78rem; color: var(--night-muted); margin: 10px 0 0; }
.leyenda span { display: inline-flex; align-items: center; gap: 6px; }

.circuito { position: relative; padding: 26px 64px 26px; margin-top: 8px; }
.circuito svg.lineas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 0; }
.etapas { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); column-gap: 46px; row-gap: 64px; }
.lineas path.seg { fill: none; stroke: rgba(201,173,115,.32); stroke-width: 1.5; stroke-dasharray: 3 9; stroke-linecap: round; animation: fluir 16s linear infinite; }
.lineas path.seg.validado { stroke: var(--gold-hi); stroke-width: 2; stroke-dasharray: 18 4; animation-duration: 12s; }
.lineas .chispa { fill: #e9d8b0; opacity: .8; }
@keyframes fluir { to { stroke-dashoffset: -24; } }
@media (prefers-reduced-motion: reduce) {
  .lineas path.seg { animation: none; }
  .lineas .chispa { display: none; }
}
.etapa {
  position: relative; text-align: left; cursor: pointer;
  background: var(--night-2);
  border: 1px solid var(--night-line); border-radius: var(--radius);
  padding: 14px 16px 12px; color: var(--night-ink);
  display: flex; flex-direction: column; gap: 8px; min-height: 150px;
  transition: border-color .4s, background .4s;
}
.etapa:hover { border-color: #5e5650; background: var(--night-3); }
.etapa.correcciones { border-color: #7c6646; }
.etapa.validado {
  border-color: var(--gold-hi);
  background: #2d2922;
  box-shadow: inset 0 3px 0 var(--gold-hi);
}
.etapa.recien { animation: encender 1.8s var(--lento); }
@keyframes encender { from { background: #4a4030; } to { background: #2d2922; } }
.etapa-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.etapa-num { font-family: var(--mono); font-size: .9rem; line-height: 1; color: var(--gold-hi); letter-spacing: .06em; }
.etapa-nombre { font-family: var(--serif); font-size: 1.35rem; color: #fff; line-height: 1.15; }
.etapa-res { font-size: .76rem; color: var(--night-muted); line-height: 1.3; margin-top: 2px; }
.estado-pill { font-family: var(--mono); font-size: .6rem; text-transform: uppercase; letter-spacing: .1em; padding: 3px 7px; border-radius: 4px; border: 1px solid var(--night-line); color: var(--night-muted); white-space: nowrap; }
.estado-pill.correcciones { border-color: #7c6646; color: #d6bb84; }
.estado-pill.validado { border-color: var(--gold-hi); background: var(--gold-hi); color: var(--night); font-weight: 500; }
.etapa-capas { display: flex; flex-direction: column; gap: 7px; }
.ec { font-size: .82rem; line-height: 1.35; }
.ec .k { display: block; font-family: var(--mono); font-size: .6rem; text-transform: uppercase; letter-spacing: .12em; color: var(--gold); margin-bottom: 1px; }
.ec .v { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; color: #e3ddd4; }
.ec .v em { font-style: normal; color: var(--gold-hi); font-size: .7rem; }
.hueco {
  display: inline-block; font-size: .72rem; font-style: italic; color: #bba272;
  border: 1px dashed rgba(201,173,115,.45); border-radius: 4px; padding: 0 7px;
}
.etapa-pie { margin-top: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .74rem; color: var(--night-muted); padding-top: 6px; border-top: 1px solid rgba(255,255,255,.06); }
.auto { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; padding: 2px 8px; border-radius: 4px; border: 1px solid var(--night-line); color: var(--night-muted); }
.auto::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #6d5a55; }
.auto.ya { color: #a9c9ad; border-color: #405e47; } .auto.ya::before { background: #78a681; }
.auto.menor { color: #dcc595; border-color: #6e5c39; } .auto.menor::before { background: var(--gold-hi); }
.auto.sistema { color: #dcaaa9; border-color: #6e3a3d; } .auto.sistema::before { background: #b9676b; }
.etapa-pie .huecos { margin-left: auto; }
.etapa-pie .huecos b { color: var(--gold-hi); font-weight: 600; }
.nota-card { font-size: .8rem; color: #ddd6cc; background: rgba(0,0,0,.18); border-left: 2px solid var(--gold); padding: 4px 8px; border-radius: 0 4px 4px 0; }
.nota-card b { color: var(--gold-hi); font-weight: 600; }

/* panel lateral de una etapa */
.drawer-bg { position: fixed; inset: 0; background: rgba(20,17,14,.38); z-index: 50; opacity: 0; pointer-events: none; transition: opacity .25s; }
.drawer-bg.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(600px, 100%); z-index: 51;
  background: var(--bg); box-shadow: -1px 0 0 var(--line), var(--shadow-pop);
  transform: translateX(105%); transition: transform .45s var(--lento);
  display: flex; flex-direction: column;
}
.drawer.open { transform: none; }
.drawer-head { background: var(--night); color: #fff; padding: 18px 22px 16px; display: flex; gap: 14px; align-items: flex-start; }
.drawer-head .etapa-num { font-size: 1rem; padding-top: 8px; }
.drawer-head h2 { color: #fff; margin: 0; font-size: 1.5rem; }
.drawer-head .sub { color: var(--night-muted); font-size: .84rem; }
.drawer-head .x { color: #fff; margin-left: auto; font-size: 1.6rem; }
.drawer-head .x:hover { background: rgba(255,255,255,.1); color: #fff; }
.drawer-nav { display: flex; gap: 6px; margin-top: 8px; }
.drawer-nav button { background: rgba(255,255,255,.08); border: 0; color: #fff; border-radius: 7px; padding: 3px 10px; font-size: .8rem; }
.drawer-body { overflow-y: auto; padding: 18px 22px 40px; flex: 1; -webkit-overflow-scrolling: touch; }
.dsec { margin-bottom: 22px; }
.dsec > h3 { font-family: var(--mono); font-size: .66rem; font-weight: 500; text-transform: uppercase; letter-spacing: .14em; color: var(--gold); margin-bottom: 8px; }
.campo { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 14px; margin-bottom: 8px; }
.campo.vacio { border-style: dashed; background: var(--surface-2); }
.campo.no-aplica { background: var(--surface-2); opacity: .6; }
.campo.no-aplica b { color: var(--ink-2); font-weight: 600; }
.campo-head { display: flex; align-items: center; gap: 8px; }
.campo-head b { font-size: .9rem; }
.campo-head .linkbtn { margin-left: auto; }
.entrada { font-size: .93rem; color: var(--ink); margin-top: 5px; padding-left: 10px; border-left: 2px solid var(--line); }
.entrada.resp { border-left-color: var(--gold); }
.entrada .tag { margin-left: 6px; vertical-align: 1px; }
.campo .sin { font-style: italic; color: #8a7853; font-size: .86rem; margin-top: 4px; }
.campo-edit { margin-top: 8px; display: grid; gap: 8px; }
.campo-edit label { font-size: .76rem; color: var(--muted); }
.notas-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.nota { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 9px 12px; display: flex; gap: 10px; align-items: flex-start; }
.nota .who { font-weight: 500; color: var(--accent); white-space: nowrap; }
.nota .txt { flex: 1; font-size: .93rem; }
.nota .when { font-size: .74rem; color: var(--muted); display: block; }
.nota-form { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: grid; gap: 9px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- relevamiento ---------- */
.rel { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 22px; align-items: start; }
.rail { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 6px; max-height: calc(100vh - 100px); overflow-y: auto; padding-bottom: 10px; }
.rail-sep { font-family: var(--mono); font-size: .64rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin: 12px 4px 2px; }
.rail a {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--radius);
  text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  transition: border-color .2s, background .2s;
}
.rail a:hover { border-color: var(--line-2); }
.rail a.on { background: var(--night); color: #fff; border-color: var(--night); }
.rail a.on .r-sub { color: var(--night-muted); }
.rail .avatar { width: 36px; height: 36px; font-size: 1rem; margin: 0; flex-shrink: 0; }
.rail a.on .avatar { background: var(--accent); color: #fff; }
.r-txt { flex: 1; min-width: 0; }
.r-name { font-weight: 500; display: block; line-height: 1.25; }
.r-sub { font-size: .78rem; color: var(--muted); display: block; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-prog { font-family: var(--mono); font-size: .74rem; color: var(--muted); }
.rail a.on .r-prog { color: var(--gold-hi); }
.r-prog.done { color: var(--ok); font-weight: 500; }
.rel-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.rel-head .spacer { flex: 1; }
.aviso { font-size: .8rem; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 5px 10px; }
.secc { font-family: var(--mono); font-size: .66rem; text-transform: uppercase; letter-spacing: .14em; color: var(--gold); margin: 22px 0 8px; font-weight: 500; }
.preg { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; transition: border-color .25s; }
.preg.resp { border-color: var(--line); }
.preg-head { display: flex; gap: 14px; padding: 15px 18px 13px; cursor: pointer; align-items: flex-start; }
.preg-num { font-family: var(--mono); font-size: .8rem; line-height: 1; color: var(--gold); min-width: 26px; padding-top: 7px; }
.preg.resp .preg-num { color: var(--ok); }
.preg.conf .preg-num { color: var(--warn); }
.preg-txt { flex: 1; }
.preg-q { font-family: var(--serif); font-size: 1.12rem; line-height: 1.4; color: var(--ink); }
.preg-dest { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.preg-resumen { margin-top: 8px; font-size: .92rem; color: var(--ink-2); }
.preg-resumen .r { padding-left: 10px; border-left: 2px solid var(--gold); margin-top: 4px; }
.preg-resumen .r b { color: var(--accent); font-weight: 500; }
.preg-ok { color: var(--ok); font-size: 1rem; }
.preg-body { border-top: 1px solid var(--line); background: var(--surface-2); padding: 14px 18px 16px; display: grid; gap: 12px; }
.fila { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 10px; align-items: start; }
.fila > label { font-family: var(--mono); font-size: .64rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; padding-top: 9px; }
.opts .chip { background: var(--surface); font-size: .84rem; padding: 6px 11px; }
.opts .chip.on { background: var(--night); border-color: var(--night); color: #fff; }
.opts .chip.esp { border-style: dashed; }
.quien-otro { max-width: 220px; padding: 6px 10px; font-size: .86rem; border-radius: 6px; }
.resp-list { display: grid; gap: 8px; }
.resp-item { display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; }
.resp-item.edit { border-color: var(--gold); }
.resp-item .txt { flex: 1; font-size: .92rem; }
.resp-item .txt b { color: var(--accent); }
.preg-foot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.preg-foot .spacer { flex: 1; }
.preg-foot .hint { font-size: .78rem; color: var(--muted); }

/* ---------- pedidos ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { padding: 14px 18px; }
.kpi b { font-family: var(--serif); font-size: 1.9rem; font-weight: 300; display: block; line-height: 1.1; }
.kpi span { font-size: .84rem; color: var(--muted); }
.kpi.bad b { color: var(--bad); } .kpi.ok b { color: var(--ok); } .kpi.warn b { color: var(--warn); }
.tabla-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table.peds { width: 100%; border-collapse: collapse; min-width: 1060px; }
.peds th { text-align: left; font-family: var(--mono); font-size: .64rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 500; padding: 11px 10px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.peds td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.peds tr:last-child td { border-bottom: 0; }
.peds input[type=text], .peds input[type=date], .peds select { padding: 6px 9px; font-size: .88rem; border-radius: 6px; }
.peds input.plain { border-color: transparent; background: transparent; }
.peds input.plain:hover { border-color: var(--line); }
.peds .fecha { display: flex; gap: 5px; align-items: center; }
.peds .fecha input { width: 150px; }
.peds td.arch { min-width: 300px; width: 30%; }
.peds select { width: 96px; }
.peds .dias { font-family: var(--serif); font-size: 1.35rem; line-height: 1; font-weight: 300; }
.peds .dias small { font-family: inherit; font-size: .74rem; color: var(--muted); display: block; margin-top: 3px; }
.peds .check { display: flex; gap: 6px; align-items: center; font-size: .82rem; color: var(--ink-2); margin-top: 6px; }
.peds .check input { width: 18px; height: 18px; accent-color: var(--accent); }
.bloque-tag { font-family: var(--serif); }

/* ---------- demo ---------- */
.demo-wrap { position: relative; height: calc(100vh - 58px); }
.demo-wrap iframe { border: 0; width: 100%; height: 100%; display: block; background: var(--bg); }

/* ---------- carga ---------- */
.cargando { display: grid; place-items: center; min-height: 60vh; color: var(--muted); font-family: var(--serif); font-size: 1.15rem; text-align: center; padding: 0 20px; }

/* ---------- menú, paneles e interruptores ---------- */
.hamb, .seccion-actual, .solo-compacto { display: none; }
.hamb { width: 42px; height: 42px; border: 1px solid var(--night-line); border-radius: 6px; background: transparent; flex-direction: column; justify-content: center; align-items: center; gap: 5px; flex-shrink: 0; }
.hamb span { display: block; width: 20px; height: 2px; background: var(--night-ink); border-radius: 2px; transition: transform .25s, opacity .2s; }
.hamb[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamb[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamb[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.seccion-actual { font-family: var(--serif); font-size: 1.15rem; color: #fff; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.navsheet-bg, .sheet-bg { position: fixed; inset: 0; background: rgba(20,17,14,.42); z-index: 60; opacity: 0; pointer-events: none; transition: opacity .25s; }
.navsheet-bg.open, .sheet-bg.open { opacity: 1; pointer-events: auto; }
.navsheet {
  position: fixed; top: 0; left: 0; bottom: 0; width: min(340px, 86vw); z-index: 61;
  background: var(--night); color: var(--night-ink); padding: 18px 14px 20px;
  display: flex; flex-direction: column; gap: 4px; overflow-y: auto;
  transform: translateX(-105%); transition: transform .45s var(--lento);
  box-shadow: var(--shadow-pop);
}
.navsheet.open { transform: none; }
.ns-brand { display: flex; flex-direction: column; padding: 4px 10px 16px; border-bottom: 1px solid var(--night-line); margin-bottom: 8px; }
.navsheet a, .navsheet button {
  display: flex; gap: 14px; align-items: center; text-align: left; width: 100%;
  padding: 11px 12px; border-radius: 6px; color: var(--night-ink); text-decoration: none; background: none; border: 0;
}
.navsheet a .n { font-family: var(--mono); font-size: .8rem; color: var(--gold-hi); width: 26px; text-align: center; }
.navsheet a b, .navsheet button b { display: block; font-weight: 500; }
.navsheet small { display: block; font-size: .8rem; color: var(--night-muted); }
.navsheet a.active { background: var(--night-3); box-shadow: inset 2px 0 0 var(--gold-hi); }
.navsheet button { display: block; padding: 10px 12px 10px 52px; }
.navsheet button:active, .navsheet a:active { background: rgba(255,255,255,.08); }
.ns-sep { font-family: var(--mono); font-size: .62rem; text-transform: uppercase; letter-spacing: .14em; color: var(--night-muted); margin: 14px 12px 2px; }
.ns-pie { margin-top: auto; padding: 14px 12px 0; border-top: 1px solid var(--night-line); }
.ns-pie .sync .lbl { display: inline !important; }

.sheet {
  position: fixed; left: 50%; bottom: 0; z-index: 61; width: min(560px, 100%);
  max-height: 82vh; display: flex; flex-direction: column;
  background: var(--bg); border-radius: 12px 12px 0 0; box-shadow: var(--shadow-pop);
  transform: translate(-50%, 105%); transition: transform .45s var(--lento);
  padding-bottom: env(safe-area-inset-bottom);
}
.sheet.open { transform: translate(-50%, 0); }
.sheet-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 16px 18px 10px; border-bottom: 1px solid var(--line); }
.sheet-head b { font-family: var(--serif); font-weight: 400; font-size: 1.3rem; }
.sheet-head .x { margin-left: auto; font-size: 1.6rem; }
.sheet-body { overflow-y: auto; padding: 10px 14px 14px; }
.sheet-foot { display: flex; gap: 8px; align-items: center; padding-top: 12px; }
.spacer { flex: 1; }
.lista-capas { display: grid; gap: 4px; }
.fila-capa { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 14px; }
.fila-capa .n { flex: 1; }
.fila-capa .h { font-size: .8rem; color: #8a6d33; }
.sw { width: 40px; height: 24px; border-radius: 99px; background: #d9d2c8; position: relative; flex-shrink: 0; transition: background .2s; }
.sw i { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .25s var(--lento); }
.fila-capa.on .sw { background: var(--accent); }
.fila-capa.on .sw i { transform: translateX(16px); }

/* Interruptores cena show / eventos (se pueden prender los dos, nunca apagar los dos) */
.modos { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.modo-sw {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px 5px 9px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: .84rem; line-height: 1.2;
}
.modo-sw i { width: 15px; height: 15px; border-radius: 3px; border: 1.5px solid #bdb3a6; background: #fff; display: inline-grid; place-items: center; font-style: normal; transition: .15s; }
.modo-sw.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); font-weight: 500; }
.modo-sw.on i { background: var(--accent); border-color: var(--accent); }
.modo-sw.on i::after { content: "✓"; color: #fff; font-size: 11px; line-height: 1; }
.ver { display: inline-flex; align-items: center; gap: 10px; }
.ver .lbl { font-family: var(--mono); font-size: .64rem; text-transform: uppercase; letter-spacing: .14em; color: var(--night-muted); }
.ver .modo-sw { background: transparent; border-color: var(--night-line); color: var(--night-muted); padding: 6px 13px 6px 10px; font-size: .88rem; }
.ver .modo-sw i { border-color: #7d6c66; background: transparent; }
.ver .modo-sw.on { background: rgba(201,173,115,.12); border-color: rgba(201,173,115,.6); color: #fff; }
.ver .modo-sw.on i { background: var(--gold-hi); border-color: var(--gold-hi); }
.ver .modo-sw.on i::after { color: var(--night); }
.btn-dark b { color: var(--gold-hi); margin-left: 4px; }

/* panel de etapa: correcciones y anotaciones */
.drawer-head .dh-txt { flex: 1; min-width: 0; }
.drawer-nav { display: flex; gap: 6px; margin: 0; padding: 8px 22px; background: var(--night-2); border-top: 1px solid var(--night-line); }
.drawer-nav button { background: rgba(255,255,255,.06); border: 0; color: var(--night-ink); border-radius: 6px; padding: 5px 11px; font-size: .82rem; }
.seg-full { display: flex; width: 100%; }
.seg-full button { flex: 1; }
.seg button.on.auto-ya { color: var(--ok); } .seg button.on.auto-menor { color: #7a5e22; } .seg button.on.auto-sistema { color: var(--accent); }
.campo.editando { border-color: var(--gold); }
.renglon { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 8px; display: grid; gap: 8px; }
.renglon textarea { min-height: 56px; }
.renglon-pie { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .84rem; }
.renglon-pie .sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.renglon-acciones { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: .78rem; }
.linkbtn.danger { color: var(--bad); }
.mini-lbl { font-size: .74rem; color: var(--muted); }
.quien-nota { color: var(--gold-hi); font-weight: 500; }

/* mapa: entrada escalonada, vuelta del circuito */
.etapas.entrada .etapa { animation: aparecer .9s var(--lento) both; animation-delay: calc(var(--i) * 60ms); }
@keyframes aparecer { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.vuelta { display: none; }
@media (prefers-reduced-motion: reduce) { .etapas.entrada .etapa { animation: none; } }

/* plan: indicadores */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.stats.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats a { display: block; text-decoration: none; color: var(--night-muted); font-size: .82rem; background: transparent; border: 1px solid var(--night-line); border-radius: 6px; padding: 10px 14px; line-height: 1.3; transition: border-color .2s; }
.stats a:hover { border-color: #5a534c; }
.stats a:active { background: rgba(255,255,255,.1); }
.stats b { display: block; font-family: var(--serif); font-weight: 300; font-size: 1.7rem; color: var(--gold-hi); line-height: 1.15; }
.stats b small { font-size: 1rem; color: var(--night-muted); }
.bloque-peds { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; text-decoration: none; color: inherit; border-top: 1px solid var(--line); padding-top: 10px; font-size: .84rem; }
.peds-mini { display: inline-flex; gap: 5px; }
.dot-ped { width: 10px; height: 10px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line-2); }
.dot-ped.info, .dot-ped.warn { background: var(--gold-hi); border-color: var(--gold); }
.dot-ped.ok { background: #7ba383; border-color: var(--ok); }
.dot-ped.bad { background: #c0675d; border-color: var(--bad); }
.bloque-peds .atraso { color: var(--bad); font-weight: 600; }

/* relevamiento */
.preg-chev { color: var(--muted); font-size: .9rem; padding-top: 4px; }
.preg.abierta { border-color: var(--gold); }
.grupo-btn { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; background: var(--night); color: #fff; border: 0; border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; }
.grupo-btn .avatar { width: 42px; height: 42px; margin: 0; background: var(--accent); color: #fff; flex-shrink: 0; }
.grupo-btn .r-sub { color: var(--night-muted); }
.grupo-btn .r-prog { color: var(--gold-hi); }
.grupo-btn .chev { font-size: .8rem; color: var(--gold-hi); border: 1px solid var(--night-line); border-radius: 6px; padding: 5px 9px; white-space: nowrap; }
.rail-sheet { position: static; max-height: none; padding: 0; }
.prog-box { min-width: 180px; }
.peds .fuerte { font-weight: 600; }
.peds .nota-in { font-size: .82rem; color: var(--muted); }

/* relevamiento: vistas, notas libres, selector de personas */
.rel-vistas { margin-bottom: 8px; }
.rel-vistas button { padding: 8px 6px; }
.rail a.notas-link { border-style: dashed; }
.rail a.notas-link.on { border-style: solid; }
.quien-sel { width: auto; max-width: 240px; padding: 4px 9px; font-size: .82rem; border-radius: 6px; }
.nota-libre-form { display: grid; gap: 12px; }
.otros { display: flex; flex-wrap: wrap; gap: 8px; }
.otro { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 6px 12px; font-size: .84rem; color: var(--muted); }
.otro b { color: var(--ink); font-weight: 500; margin-right: 4px; }
.peds tr.grupo-ped td { background: var(--surface-2); font-size: .86rem; color: var(--ink-2); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.peds tr.grupo-ped .bloque-tag { font-family: var(--serif); font-size: 1.02rem; color: var(--accent); }


/* ---------- fuentes, marcas y variantes de los datos ---------- */
.tag.src { font-size: .68rem; padding: 1px 7px; margin-left: 4px; }
.tag.src-cristian { background: #efebe6; border-color: #ddd5cb; color: #6f675f; }
.tag.src-visita-1 { background: #f7f0e1; border-color: #ead9b3; color: #7a5e22; }
.tag.src-dash { background: var(--ok-bg); border-color: #c4e0cd; color: var(--ok); }
.tag.marca { font-size: .68rem; padding: 1px 7px; margin-left: 4px; }
.tag.marca-a-confirmar { background: var(--warn-bg); border-color: #f0dcae; color: var(--warn); }
.tag.marca-lectura { background: var(--info-bg); border-color: #c9d8ea; color: var(--info); }
.tag.marca-supuesto { background: #f1ecf6; border-color: #dccfe8; color: #5b3f7a; }
.tag.var { background: #e9f1f5; border-color: #c9dde6; color: #2f5b6e; font-size: .68rem; padding: 1px 7px; }
.entrada-tags { white-space: nowrap; }
.entrada.de-cristian { color: var(--ink-2); }
.de-cristian { color: #a99d95; }
.campo .de-cristian, .tabla-red .de-cristian { color: var(--muted); }
.ec .v .de-cristian { color: #a99d95; font-style: italic; }
.muestra-cristian { color: #a99d95; font-style: italic; }
.muestra-visita { color: #fff; }
.contadores a { color: var(--night-muted); text-decoration: none; }
.contadores a b { font-family: var(--serif); font-size: 1.35rem; color: #fff; font-weight: 400; margin-right: 4px; }
.chip.sugerida { border-color: var(--gold); }
.preg-para { font-size: .82rem; color: var(--muted); margin-top: 6px; }
.tag.tipo-proxima { background: var(--accent-soft); border-color: #e8c9ce; color: var(--accent); }
.tag.tipo-duda { background: var(--warn-bg); border-color: #f0dcae; color: var(--warn); }
.tag.tipo-sin-dato { background: var(--surface-2); }
.tag.red-t { background: #eef3f6; border-color: #cfdde6; color: #2f5b6e; }
.pend-list { display: grid; gap: 6px; }
.pend { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 9px 12px; font-size: .9rem; }
.pend:hover { border-color: var(--gold); }
.dh-tipo { font-family: var(--mono); text-transform: uppercase; letter-spacing: .12em; font-size: .64rem; }
.fuentes-lista { line-height: 2; font-size: .9rem; color: var(--ink-2); margin: 0; }
.chip.vinc { border-left-width: 3px; }
.chip.vinc-proveedor { border-left-color: #8fa1b8; }
.chip.vinc-interno { border-left-color: #b59c68; }
.chip.vinc-camion { border-left-color: #b8737a; }
.red-ico { width: 4px; height: 38px; border-radius: 2px; flex-shrink: 0; background: var(--c, var(--gold-hi)); margin-top: 6px; }
.red-externo { --c: #8fa1b8; } .red-entrada { --c: #b59a62; } .red-camara { --c: #7fa3ad; } .red-deposito { --c: #ab9d80; }
.red-cocina { --c: #b9676b; } .red-destino { --c: #c9ad73; } .red-descarte { --c: #8f857e; }
.red-v-proveedor { --c: #8fa1b8; } .red-v-interno { --c: #b59c68; } .red-v-camion { --c: #b8737a; }

/* ---------- red de insumos ---------- */
.red-intro { color: var(--night-muted); margin: -4px 0 12px; max-width: 86ch; font-size: .9rem; }
.capas .spacer { flex: 1; }
.red-lienzo { position: relative; margin-top: 12px; min-height: 560px; }
.red-capa-fondo, .red-etiquetas { position: absolute; inset: 0; pointer-events: none; }
.red-etiquetas { z-index: 3; }
.red-zona { position: absolute; left: 0; right: 0; border-radius: var(--radius); background: rgba(255,255,255,.018); border: 1px solid rgba(255,255,255,.045); }
.red-zona span { position: absolute; top: 9px; right: 14px; font-family: var(--mono); font-size: .6rem; text-transform: uppercase; letter-spacing: .16em; color: var(--night-muted); }
.red-grupo { position: absolute; border: 1px dashed rgba(201,173,115,.32); border-radius: var(--radius); background: rgba(201,173,115,.03); }
.red-grupo span { position: absolute; top: 3px; left: 10px; right: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--mono); font-size: .58rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.red-guia { position: absolute; left: 0; top: 0; bottom: 0; width: 160px; z-index: 3; pointer-events: none; }
.red-nivel {
  position: absolute; left: 6px; width: 150px; transform: translateY(-50%); pointer-events: auto;
  display: flex; gap: 8px; align-items: flex-start; text-align: left;
  background: none; border: 0; padding: 6px 8px; border-radius: 6px; color: var(--night-ink);
  transition: background .2s;
}
.red-nivel:hover { background: rgba(255,255,255,.05); }
.red-nivel .chev { color: var(--gold); font-size: 1rem; line-height: 1; padding-top: 1px; width: 12px; }
.red-nivel b { display: block; font-weight: 500; font-size: .86rem; line-height: 1.25; }
.red-nivel small { display: block; font-family: var(--mono); font-size: .6rem; letter-spacing: .06em; color: var(--night-muted); margin-top: 2px; }
.red-nivel.plegado b { color: var(--night-muted); }
.guia-arriba .red-guia { width: auto; right: 0; }
.guia-arriba .red-grupo span { top: auto; bottom: -17px; }
.guia-arriba .red-nivel { transform: none; width: auto; align-items: baseline; padding: 4px 8px; left: 8px; }
.guia-arriba .red-nivel > span:last-child { display: flex; gap: 10px; align-items: baseline; }
.guia-arriba .red-nivel small { margin: 0; }
svg.red-lineas { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 1; }
.rv { fill: none; stroke-linecap: round; }
.rv-proveedor { stroke: #8fa1b8; stroke-width: 1.5; stroke-dasharray: 6 6; animation: fluir 22s linear infinite; }
.rv-interno { stroke: rgba(181,156,104,.62); stroke-width: 1.4; }
.rv-camion { stroke: rgba(184,115,122,.4); stroke-width: 1.2; stroke-dasharray: 5 5; animation: fluir 30s linear infinite; }
.rv.dudoso { stroke: #a39b91; stroke-dasharray: 3 7; animation: none; }
.rv.sel { stroke-width: 3; }
.rv.fuera { opacity: .12; animation: none; }

.vl-doble { color: var(--gold-hi); margin-right: 4px; font-weight: 600; }
.rc { fill: #e7cfd1; opacity: .35; }
@media (prefers-reduced-motion: reduce) { .rv { animation: none; } }
/* foco: se resaltan los movimientos del lugar señalado, o todo el recorrido del lugar elegido */
.rv, .rc, .vl, .nodo { transition: opacity .35s var(--lento), stroke-width .35s, border-color .25s, background .25s; }
.red-lienzo.foco .rv:not(.on), .red-lienzo.foco .rc:not(.on) { opacity: .06; }
.red-lienzo.foco .vl:not(.on) { opacity: .1; }
.red-lienzo.foco .nodo:not(.on) { opacity: .3; }
.red-lienzo.foco .rv-interno.on, .red-lienzo.foco .rv-proveedor.on { stroke-width: 2.2; stroke: #d2b77f; }
.red-lienzo.foco .rv-proveedor.on { stroke: #aebcd0; }
.red-lienzo.foco .rv-camion.on { stroke-width: 2; stroke: #cc8a90; }
.red-lienzo.foco .vl.on { z-index: 4; }
.nodo {
  position: absolute; z-index: 2; text-align: left; cursor: pointer; overflow: hidden;
  background: var(--night-2); color: var(--night-ink);
  border: 1px solid var(--night-line); border-top: 3px solid var(--c, #5e5650); border-radius: var(--radius);
  padding: 6px 10px 6px; display: flex; flex-direction: column; gap: 3px;
}
.nodo:hover { border-color: #5e5650; border-top-color: var(--c, #5e5650); background: var(--night-3); }
.nodo.chico { padding: 0 10px; justify-content: center; border-top-width: 1px; border-left: 3px solid var(--c, #5e5650); }
.nodo.chico .nodo-tipo, .nodo.chico .nodo-pie { display: none; }
.nodo.chico .nodo-nombre { -webkit-line-clamp: 1; font-size: .84rem; }
.nodo-externo { --c: #8fa1b8; } .nodo-entrada { --c: #b59a62; } .nodo-camara { --c: #7fa3ad; } .nodo-deposito { --c: #ab9d80; }
.nodo-cocina { --c: #b9676b; } .nodo-destino { --c: #c9ad73; } .nodo-descarte { --c: #8f857e; }
.nodo-tipo { font-family: var(--mono); font-size: .56rem; text-transform: uppercase; letter-spacing: .14em; color: var(--night-muted); display: flex; gap: 6px; align-items: center; white-space: nowrap; overflow: hidden; min-height: 14px; }
.nodo-tipo i { width: 6px; height: 6px; border-radius: 50%; background: var(--c, #5e5650); }
.nodo-tipo em { font-style: normal; color: #a6c3cf; letter-spacing: .06em; margin-left: auto; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.nodo-nombre { font-family: var(--serif); font-size: .94rem; line-height: 1.2; color: #fff; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nodo-pie { margin-top: auto; display: flex; gap: 6px; align-items: center; font-size: .68rem; color: var(--night-muted); white-space: nowrap; overflow: hidden; }
.nodo-pie .sp { flex: 1; }
.nodo-pie .nh b { color: var(--gold-hi); font-weight: 500; }
.nodo-pie .duda { color: #dcc595; border: 1px dashed #8a7446; border-radius: 99px; padding: 0 5px; }
.nodo.fuera, .red-descarte.fuera, .vl.fuera { opacity: .2; }
.vl {
  position: absolute; transform: translate(-50%, -50%); pointer-events: auto; cursor: pointer;
  font-size: .66rem; line-height: 1.2; padding: 2px 7px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--night); border: 1px solid rgba(181,156,104,.45); color: #e6dcc6;
}
.vl:hover { border-color: var(--gold-hi); }
.vl-proveedor { border-color: #6f8096; color: #d3dce8; }
.vl-camion { border-color: rgba(142,90,96,.6); color: #e6c9cb; opacity: .55; }
.vl-camion:not(.fuera):hover, .red-lienzo.foco .vl-camion.on { opacity: 1; }
.vl-par { cursor: default; display: flex; align-items: center; }
.vl-parte { all: unset; cursor: pointer; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vl-parte:hover, .vl-parte:focus-visible { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.vl-sep { margin: 0 4px; opacity: .6; }
.vl.dudoso { border-style: dashed; border-color: #7d766d; }
.vl-hueco { font-style: italic; color: #b39d70; }
.red-descarte {
  position: absolute; z-index: 2; height: 46px; display: flex; align-items: center; gap: 14px; padding: 0 16px; text-align: left; white-space: nowrap; overflow: hidden;
  background: var(--night-2);
  border: 1px dashed #5e5650; border-radius: var(--radius); color: var(--night-ink); --c: #8f857e;
}
.red-descarte .nodo-tipo { flex-shrink: 0; overflow: visible; }
.red-descarte b { font-family: var(--serif); font-weight: 400; flex-shrink: 0; }
.red-descarte .muted { color: var(--night-muted); font-size: .8rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.vinc-linea { display: inline-block; width: 24px; height: 0; border-top: 2px solid; vertical-align: middle; margin-right: 6px; }
.vinc-linea.vinc-proveedor { border-top: 2px dashed #8fa1b8; }
.vinc-linea.vinc-interno { border-top-color: #b59c68; }
.vinc-linea.vinc-camion { border-top: 3px dashed #b8737a; }
.vinc-linea.vinc-dudoso { border-top: 2px dotted #a39b91; }
/* pie de la red: leyenda y dudas, alineados con el lienzo y a todo el ancho */
.red-pie { display: grid; gap: 12px; margin-top: 18px; }
.red-pie .leyenda { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 36px; padding: 10px 14px; border: 1px solid var(--night-line); border-radius: var(--radius); }
.red-pie .ley-g { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.red-pie .ley-g > span { white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; }
.red-pie .leyenda .vinc-linea { margin: 0; }
.red-pie .ley-t { font-family: var(--mono); font-size: .6rem; text-transform: uppercase; letter-spacing: .14em; color: var(--night-muted); opacity: .8; min-width: 92px; }
.red-dudas { background: rgba(201,173,115,.05); border: 1px dashed rgba(201,173,115,.32); border-radius: var(--radius); padding: 12px 14px; }
.red-dudas h3 { font-family: var(--mono); font-size: .62rem; font-weight: 500; text-transform: uppercase; letter-spacing: .14em; color: var(--gold-hi); margin: 0 0 6px; }
.red-dudas ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.red-dudas li { font-size: .88rem; color: var(--night-ink); line-height: 1.45; }
.red-tabla-t { color: #fff; font-family: var(--serif); font-weight: 400; font-size: 1.3rem; margin: 30px 0 10px; }
/* tabla de movimientos */
.tv-filtros { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.tv-filtros .seg { background: transparent; border-color: var(--night-line); }
.tv-filtros .seg button { color: var(--night-muted); }
.tv-filtros .seg button.on { background: var(--night-3); color: #fff; box-shadow: none; }
.tv-filtros .seg .vinc-linea { width: 16px; margin-right: 6px; }
.tv-filtros .modo-sw { background: transparent; border-color: var(--night-line); color: var(--night-muted); }
.tv-filtros .modo-sw i { border-color: #6b635b; background: transparent; }
.tv-filtros .modo-sw.on { background: rgba(201,173,115,.12); border-color: rgba(201,173,115,.6); color: #fff; }
.tv-filtros .modo-sw.on i { background: var(--gold-hi); border-color: var(--gold-hi); }
.tv-filtros .modo-sw.on i::after { color: var(--night); }
.tv-filtros .muted { color: var(--night-muted); font-size: .82rem; }
.tv-der { margin-left: auto; display: inline-flex; gap: 14px; align-items: baseline; white-space: nowrap; }
.tv-filtros .linkbtn { color: var(--gold-hi); text-decoration-color: rgba(201,173,115,.4); }
.tabla-red { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--night-line); }
.tabla-red table { width: 100%; border-collapse: collapse; min-width: 1040px; background: var(--surface); color: var(--ink); font-size: .84rem; }
.tabla-red th { text-align: left; font-family: var(--mono); font-size: .6rem; font-weight: 500; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); padding: 10px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.tabla-red td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tabla-red tr { cursor: pointer; }
.tabla-red tbody tr:not(.tv-grupo):hover { background: #f6f2e8; }
.tabla-red tr.fuera { opacity: .35; }
.tabla-red .tv-nombre { min-width: 200px; position: sticky; left: 0; background: var(--surface); box-shadow: 1px 0 0 var(--line); }
.tabla-red tbody tr:not(.tv-grupo):hover .tv-nombre { background: #f6f2e8; }
.tabla-red .tv-txt { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.45; }
.tabla-red .tv-txt > div + div { margin-top: 4px; }
.tabla-red .tv-hueco { font-size: .74rem; font-style: italic; color: #a39472; }
.tabla-red tr.tv-grupo td { background: var(--surface-2); padding: 8px 10px; font-size: .84rem; color: var(--ink-2); border-bottom: 1px solid var(--line); position: sticky; left: 0; }
.tabla-red tr.tv-grupo b { font-weight: 500; color: var(--ink); }
.tabla-red tr.tv-grupo .chev { display: inline-block; width: 18px; color: var(--gold); font-size: .95rem; line-height: 1; }
.red-lista { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.red-lista .nodo { position: relative; min-height: 84px; }
.red-zona-t { color: var(--gold-hi); }
@media (max-width: 760px) { .red-lista { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .tabla-red { border: 0; overflow: visible; }
  .tabla-red table, .tabla-red tbody { display: block; min-width: 0; background: none; }
  .tabla-red thead { display: none; }
  .tabla-red tr { display: block; background: var(--surface); border-radius: var(--radius); margin-bottom: 10px; padding: 10px 12px; }
  .tabla-red tr.tv-grupo { background: none; padding: 6px 0 0; margin: 0; }
  .tabla-red tr.tv-grupo td { background: none; color: var(--night-muted); padding: 0; }
  .tabla-red tr.tv-grupo b { color: var(--night-ink); }
  .tabla-red td { display: block; border: 0; padding: 4px 0; }
  .tabla-red .tv-nombre { position: static; box-shadow: none; background: none; }
  .tabla-red td::before { content: attr(data-label); display: block; font-family: var(--mono); font-size: .6rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
  .tabla-red td.tv-nombre::before, .tabla-red tr.tv-grupo td::before { display: none; }
}

/* ---------- entorno ---------- */
.entorno { font-family: var(--mono); font-size: .62rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; padding: 3px 8px; border-radius: 4px; white-space: nowrap; border: 1px solid; }
.entorno-staging { border-color: #8a7446; color: #dcc595; }
.entorno-local { border-color: #4f6b78; color: #a6c3cf; }
.aviso-deploy { background: var(--bad); color: #fff; padding: 8px 16px; font-size: .86rem; text-align: center; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .etapas { column-gap: 32px; }
  .circuito { padding-left: 46px; padding-right: 46px; }
  .equipo { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bloques { grid-template-columns: 1fr; }
  .bloque { display: grid; grid-template-columns: 1fr 1fr; column-gap: 22px; }
  .bloque > .bloque-head, .bloque > .muted, .bloque > .bloque-peds { grid-column: 1 / -1; }
}

/* Tablet y celular (pantalla chica o táctil) */
html.compacto .hamb, html.compacto .seccion-actual, html.barra-menu .hamb { display: flex; }
html.compacto .seccion-actual, html.barra-menu .seccion-actual { display: block; }
html.compacto .tabs, html.compacto .top .menu, html.compacto .brand,
html.barra-menu .tabs, html.barra-menu .top .menu, html.barra-menu .brand { display: none; }
html.compacto .top, html.barra-menu .top { gap: 12px; padding: 0 14px; }
html.compacto .top .sync .lbl, html.barra-menu .top .sync .lbl { display: none; }
@media (max-width: 760px) { html.compacto .lbl-cm { display: none; } }
html.compacto .solo-ancho { display: none !important; }
html.compacto .solo-compacto { display: inline-flex; }
html.compacto .grupo-btn.solo-compacto { display: flex; }
html.compacto .rel { grid-template-columns: minmax(0, 1fr); }
html.compacto .mapa-bar h1 { display: none; }
html.compacto .mapa-bar { gap: 12px; }
html.compacto .chip, html.compacto .modo-sw { min-height: 40px; }
html.compacto .opts .chip { padding: 8px 14px; font-size: .9rem; }
html.compacto .seg button { padding: 9px 13px; }
html.compacto .fila { grid-template-columns: 1fr; gap: 6px; }
html.compacto .fila > label { padding-top: 0; }
html.compacto .preg-body { gap: 14px; }

/* Angosto: el circuito se arma en una columna */
@media (max-width: 900px) {
  .circuito.vertical { padding: 6px 0 10px 34px; max-width: 600px; margin: 8px auto 0; }
  .circuito.vertical .etapas { grid-template-columns: 1fr; row-gap: 40px; }
  .circuito.vertical .etapa { grid-column: 1 !important; grid-row: auto !important; min-height: 0; }
  .circuito.vertical .vuelta { display: block; text-align: center; color: var(--gold-hi); font-family: var(--serif); margin-top: 14px; opacity: .8; }
  .bloque { display: flex; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats.n3 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  /* pedidos como tarjetas */
  .tabla-wrap { background: none; border: 0; box-shadow: none; overflow: visible; }
  table.peds { min-width: 0; }
  .peds thead { display: none; }
  .peds, .peds tbody { display: block; }
  .peds tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; position: relative; box-shadow: var(--shadow); }
  .peds tr.atrasado { border-color: #f2c4bf; }
  .peds td { display: block; border: 0; padding: 0; }
  .peds td::before { content: attr(data-label); display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 3px; }
  .peds td.arch { grid-column: 1 / -1; min-width: 0; width: auto; padding-right: 36px; }
  .peds td.arch::before, .peds td.acc::before { display: none; }
  .peds td.acc { position: absolute; top: 8px; right: 6px; }
  .peds td.fechas { grid-column: 1 / -1; }
  .peds tr.grupo-ped { display: block; background: none; border: 0; box-shadow: none; padding: 8px 2px 2px; margin: 0; }
  .peds tr.grupo-ped td { background: none; border: 0; padding: 0; }
  .peds tr.grupo-ped td::before { display: none; }
  .peds .fecha input { width: 100%; }
  .peds input.plain { padding-left: 0; }
}
@media (max-width: 760px) {
  :root { font-size: 16px; }
  .main { padding: 16px 14px 60px; }
  .escenario { padding: 14px; }
  .equipo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan-hero { padding: 22px 18px; }
  .plan-hero h1 { font-size: 1.7rem; }
  .bloque-num { font-size: 2rem; }
  .preg-head { padding: 13px 14px 11px; gap: 10px; }
  .preg-q { font-size: 1.1rem; }
  .preg-body { padding: 12px 14px 14px; }
  .drawer-head, .drawer-body { padding-left: 16px; padding-right: 16px; }
  .drawer-nav { padding: 8px 16px; }
  .seg-full { flex-direction: column; }
  .contadores { gap: 12px; font-size: .8rem; }
  .contadores b { font-size: 1.15rem; }
  .rel-head h1 { font-size: 1.6rem; }
  .timeline .hito { font-size: .7rem; }
  .preg-foot .hint { flex-basis: 100%; }
  .preg-foot .spacer { display: none; }
  .preg-foot .btn { flex: 1; }
}
html:not(.compacto) .solo-compacto { display: none !important; }

/* Relevamiento · vista Persona: charla con una o varias personas */
.charla { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; margin: 0 0 6px; }
.charla > .muted { font-size: .8rem; }
.peds-guia { display: grid; gap: 8px; }
.ped-guia { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 10px 14px; color: inherit; text-decoration: none; }
.ped-guia b { flex: 1 1 220px; font-weight: 600; }
.ped-guia .muted { font-size: .8rem; }
.ver-resp { display: block; margin: 22px 0 8px; padding: 6px 0; background: none; border: 0; color: var(--muted); font: inherit; font-size: .86rem; cursor: pointer; }
.nueva-preg { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 4px; }
.preg-body .fecha { display: flex; gap: 8px; align-items: center; }
.btn.peligro { color: var(--bad); }
.nueva-preg textarea { flex: 1; min-width: 0; min-height: 40px; resize: vertical; }

/* ---------- acceso: login e invitación ---------- */
body.acceso { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--night); }
.acceso-caja { width: min(420px, 100%); }
.acceso-marca { display: flex; flex-direction: column; margin-bottom: 18px; }
.acceso-marca .brand-name { font-family: var(--serif); font-size: 1.6rem; color: var(--accent); }
.acceso-marca .brand-name span { color: var(--gold); }
.acceso-marca .brand-sub { color: var(--muted); font-size: .85rem; }
.acceso form { display: grid; gap: 14px; }
.acceso label { display: grid; gap: 6px; font-size: .9rem; color: var(--ink-2); }
.acceso input { padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.acceso input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.acceso .btn { justify-self: start; }
.acceso .btn:disabled { opacity: .6; cursor: default; }
.acceso-error { color: var(--bad); font-size: .88rem; margin: 0; min-height: 1.2em; }
.acceso-pie { font-size: .82rem; margin: 16px 0 0; }
.acceso-aviso { font-size: .88rem; color: var(--ink-2); background: var(--surface-2); border-radius: 9px; padding: 10px 12px; margin: 0 0 14px; }
.acceso-aviso:empty { display: none; }
.acceso [hidden] { display: none !important; }
.ya-adentro .quien { margin: 0 0 14px; }
.acceso-botones { display: flex; flex-wrap: wrap; gap: 8px; }
.aviso-sesion { background: var(--accent); color: #fff; padding: 8px 16px; font-size: .86rem; text-align: center; }
.aviso-sesion a { color: #fff; font-weight: 600; }

/* ---------- usuario que entró ---------- */
.btn-top.yo { max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yo-det { display: grid; padding: 8px 12px 6px; }
.yo-det small { color: var(--muted); font-size: .78rem; }
.ns-pie .yo-det { padding: 10px 0 8px; color: var(--night-ink); }
.ns-pie .yo-det small { color: var(--night-muted); }
body.solo-lectura #view input, body.solo-lectura #view textarea, body.solo-lectura #view select,
body.solo-lectura .drawer input, body.solo-lectura .drawer textarea, body.solo-lectura .drawer select { pointer-events: none; opacity: .75; }

/* ---------- usuarios ---------- */
table.usuarios select { padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
table.usuarios td.acc { white-space: nowrap; text-align: right; }
table.usuarios td.acc .btn + .btn { margin-left: 6px; }
.usu-filtros { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; margin-bottom: 12px; }
.usu-filtros label { display: grid; gap: 4px; font-size: .78rem; color: var(--muted); }
.usu-filtros select { padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: .88rem; color: var(--ink); }
.usu-filtros .usu-orden { display: none; }
.usu-cuenta { margin-left: auto; display: flex; gap: 10px; align-items: center; font-size: .84rem; padding-bottom: 8px; }
.peds th .th-orden { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; display: inline-flex; gap: 5px; align-items: center; }
.peds th .th-orden:hover, .peds th .th-orden.on { color: var(--ink); }
.th-orden .flecha { min-width: .8em; }
@media (max-width: 900px) {
  .usu-filtros .usu-orden { display: grid; }
  .usu-filtros label { flex: 1 1 140px; }
  .usu-cuenta { margin-left: 0; flex-basis: 100%; padding-bottom: 0; }
}
.link-inv, .nuevo-usu { margin-bottom: 16px; }
.link-inv p { margin: 0 0 10px; }
.link-fila { display: flex; gap: 8px; flex-wrap: wrap; }
.link-fila input { flex: 1 1 280px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); font-size: .85rem; }
.nuevo-usu h3 { margin: 0 0 12px; font-family: var(--serif); font-weight: 400; }
.nuevo-campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 14px; }
.nuevo-campos label { display: grid; gap: 5px; font-size: .86rem; color: var(--ink-2); }
.nuevo-campos input, .nuevo-campos select { padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.nuevo-acc { display: flex; gap: 8px; }
.roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.rol-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.rol-head input { flex: 1; min-width: 0; }
.rol-head .muted { font-size: .8rem; white-space: nowrap; }
.rol-secs, .rol-flags { display: grid; gap: 6px; }
.rol-flags { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
.rol .check { font-size: .9rem; }
.rol .check.parte { margin-left: 26px; font-size: .84rem; color: var(--ink-2); }
.rol input.plain { border: 1px solid transparent; background: transparent; padding: 4px 6px; border-radius: 6px; font-size: 1.02rem; }
.rol input.plain:hover, .rol input.plain:focus { border-color: var(--line); }
table.usuarios input.plain { border: 1px solid transparent; background: transparent; padding: 4px 6px; border-radius: 6px; }
table.usuarios input.plain:hover, table.usuarios input.plain:focus { border-color: var(--line); }

/* ---------- botón ocupado (acción en curso) ---------- */
.ocupado { position: relative; pointer-events: none; }
.btn.ocupado, .btn-top.ocupado, .menu-pop button.ocupado { color: transparent !important; }
.ocupado::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 1em; height: 1em;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: girar .7s linear infinite;
}
.btn.ocupado::after { border-color: #fff; border-right-color: transparent; }
.btn.ghost.ocupado::after, .menu-pop button.ocupado::after { border-color: var(--accent); border-right-color: transparent; }
.btn-top.ocupado::after { border-color: var(--night-ink); border-right-color: transparent; }
@keyframes girar { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ocupado::after { animation-duration: 2s; } }

/* ---------- notas para un solo rol y modo presentación ---------- */
.tag.interna { background: #ece9f1; border-color: #d6d0e2; color: #4e4766; margin-left: 4px; font-size: .68rem; }
.nota.es-interna { border-style: dashed; border-color: #cfc8dc; background: #faf9fb; }
.para-pie .chip.on { background: #4e4766; border-color: #4e4766; }
.para-pie .chip.on[data-v=""] { background: var(--accent); border-color: var(--accent); }
.pill-presentando { display: none; }
html.presentando .pill-presentando {
  display: inline-flex; align-items: center; background: transparent; border: 1px solid var(--gold); color: var(--gold-hi);
  font-family: var(--mono); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; padding: 4px 9px; border-radius: 4px;
}
html.presentando .entorno, html.presentando .aviso-deploy { display: none; }
/* con el panel abierto sobre el mapa o la red, el fondo apenas se oscurece: se sigue viendo el recorrido */
body.pag-red .drawer-bg.open, body.pag-mapa .drawer-bg.open { background: rgba(10,9,8,.12); }

/* ---------- comentarios y sugerencias ---------- */
.ico-cm { width: 14px; height: 14px; vertical-align: -2px; flex-shrink: 0; }
.btn-cm { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.btn-cm.active { border-color: var(--gold); color: #fff; }
.cm-n { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--gold-hi); color: var(--night); font-family: var(--mono); font-size: .66rem; font-weight: 500; line-height: 17px; text-align: center; }
.cm-n[hidden] { display: none; }
.top.justa .lbl-cm { display: none; }
.cm-cuenta { display: inline-flex; align-items: center; gap: 3px; color: var(--gold-hi); }
.campo-head .linkbtn { margin-left: 0; }
.campo-head { gap: 10px; }
.cm-sugerir { color: var(--muted); text-decoration-color: rgba(110,112,104,.35); }
.cm-lista { display: grid; gap: 8px; }
.cm-de-campo { margin-top: 10px; }
.cm { background: #fbf8f1; border: 1px solid #e6dcc4; border-left: 3px solid var(--gold); border-radius: 6px; padding: 9px 12px; font-size: .9rem; }
.cm.resuelto { background: var(--surface); border-color: var(--line); border-left-color: var(--line-2); color: var(--muted); }
.cm-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.cm-head b { font-weight: 500; color: var(--ink); }
.cm-head .muted { font-size: .76rem; }
.cm-estado { font-family: var(--mono); font-size: .6rem; text-transform: uppercase; letter-spacing: .1em; color: var(--gold); }
.cm.resuelto .cm-estado { color: var(--ok); }
.tag.cm-campo { background: #f3ecdc; border-color: #e2d4b4; color: #6f5a2c; font-size: .68rem; }
.cm-txt { margin-top: 4px; white-space: pre-wrap; color: var(--ink); }
.cm.resuelto .cm-txt { color: var(--ink-2); }
.cm-donde { display: block; background: none; border: 0; padding: 0; margin-top: 3px; color: var(--accent); font-size: .8rem; text-align: left; }
.cm-donde:hover { text-decoration: underline; }
.cm-resp { margin: 8px 0 0 10px; padding-left: 10px; border-left: 2px solid var(--line); font-size: .86rem; }
.cm-resp b { font-weight: 500; }
.cm-resp .muted { font-size: .74rem; }
.cm-acc { display: flex; gap: 14px; margin-top: 6px; }
.cm-acc .linkbtn { font-size: .8rem; }
.cm-form { display: grid; gap: 8px; margin-top: 8px; }
.cm-form textarea { min-height: 56px; }
.cm-pie { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .8rem; }
.cm-nuevo { margin-top: 10px; }
.cm-filtro { margin: 4px 0 16px; }
.cm-pagina { max-width: 860px; }
body.solo-lectura .drawer textarea.cm-in, body.solo-lectura #view textarea.cm-in { pointer-events: auto; opacity: 1; }
body.solo-lectura .drawer .seg { pointer-events: none; opacity: .75; }
.cm-editado { font-size: .74rem; color: var(--muted); }
.cm-resp .cm-acc { margin-top: 2px; }

/* ---------- mapa: anotaciones del equipo y comentarios de revisión, distinguibles en el pie ---------- */
.pie-nota { color: var(--night-muted); }
.pie-coment { display: inline-flex; align-items: center; gap: 4px; color: var(--night); background: var(--gold-hi); border-radius: 99px; padding: 1px 8px 1px 6px; font-weight: 500; }
.pie-coment .ico-cm { width: 12px; height: 12px; }

/* Lo que el rol no puede exportar tampoco aparece en el menú del celular */
.navsheet button[hidden] { display: none; }
