/* Registra · demo. Mundo: registro de cocina profesional. Tabla blanca de polietileno,
   marca de la consultoría en la carcasa, tinta de bolígrafo azul para lo apuntado. */
:root {
  color-scheme: light;
  --brand: #1f3a5f;
  --brand-soft: #e3eaf3;
  --ground: #eef1f0;
  --surface: #ffffff;
  --ink: #161a1e;
  --ink-2: #47515b;
  --ink-3: #6b7680;
  --line: #d6dcda;
  --line-2: #e7ebea;
  --pen: #2447a8;
  --pen-soft: #e6ecfb;
  --ok: #1d7443;
  --ok-bg: #e2f2e8;
  --ok-line: #9fd0b2;
  --warn: #9a5800;
  --warn-dot: #e09a1f;
  --warn-bg: #fdf0d8;
  --bad: #b3261e;
  --bad-dot: #d2382e;
  --bad-bg: #fce6e3;
  --bad-line: #efb2ab;
  --chrome: #1c1f22;
  --chrome-2: #2c3136;
  --chrome-ink: #e8ecef;
  --hi: #fff1b8;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --sans: "Public Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "Public Sans", "Segoe UI", system-ui, sans-serif;
  --r: 14px;
  --shadow: 0 1px 2px rgba(22, 26, 30, .05), 0 6px 18px -8px rgba(22, 26, 30, .14);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font-family: var(--sans); font-size: 1.125rem; line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
::selection { background: var(--pen-soft); color: var(--ink); }
input, select, button, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
:focus-visible { outline: 3px solid var(--pen); outline-offset: 2px; border-radius: 6px; }
* { scrollbar-width: thin; scrollbar-color: #b9c1c6 transparent; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-3); font-weight: 400; }
.pad { padding: 4px 0; }
[hidden] { display: none !important; }
.ico { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pen { font-family: var(--mono); color: var(--pen); font-weight: 700; font-variant-numeric: tabular-nums; }
.pen--bad { color: var(--bad); }

/* ---------- Franja de la demo ---------- */
.demo-bar {
  position: sticky; top: 0; z-index: 40;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  min-height: 64px; padding: 10px 24px; background: var(--chrome); color: var(--chrome-ink);
}
.demo-bar__note { display: flex; align-items: center; gap: 10px; font-size: .9375rem; color: #c5ccd2; }
.demo-bar__note strong { color: #fff; font-weight: 600; }
.demo-bar__reset { justify-self: end; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 10px; font-size: .9375rem; color: #c5ccd2; transition: background-color 160ms ease, color 160ms ease, transform 160ms var(--ease-out); }
.demo-bar__reset:active { transform: scale(.97); }
.switch { display: flex; padding: 4px; gap: 4px; background: var(--chrome-2); border-radius: 12px; }
.switch__btn { display: inline-flex; align-items: center; gap: 10px; padding: 10px 20px; min-height: 46px; border-radius: 9px; font-size: 1.0625rem; font-weight: 600; color: #c9d0d6; transition: background-color 180ms ease, color 180ms ease, transform 160ms var(--ease-out); }
.switch__btn.is-on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch__btn:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) {
  .switch__btn:not(.is-on):hover { color: #fff; background: #383e44; }
  .demo-bar__reset:hover { color: #fff; background: var(--chrome-2); }
}

/* ---------- Monograma ---------- */
.mono { display: inline-grid; place-items: center; flex: none; background: #fff; color: var(--brand); font-weight: 800; letter-spacing: -0.02em; border-radius: 12px; line-height: 1; }
.mono--lg { width: 60px; height: 60px; font-size: 1.6rem; border-radius: 14px; }
.mono--app { width: 44px; height: 44px; font-size: 1.15rem; border-radius: 11px; }
.mono--xs { width: 26px; height: 26px; font-size: .75rem; border-radius: 7px; background: var(--brand); color: #fff; }

/* ---------- Panel: cabecera ---------- */
.phead { background: var(--brand); color: #fff; padding: 22px 32px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 16px; min-width: 0; }
.brand__txt { min-width: 0; }
.brand__name { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.015em; line-height: 1.15; text-wrap: balance; overflow-wrap: anywhere; }
.brand__sub { font-size: 1.0625rem; color: rgba(255,255,255,.82); margin-top: 2px; }
.phead__right { text-align: right; flex: none; }
.phead__date { font-size: 1.0625rem; font-weight: 600; }
.poweredby { font-size: .875rem; color: rgba(255,255,255,.7); margin-top: 2px; }
.poweredby b { font-weight: 600; color: rgba(255,255,255,.88); }

.pwrap { max-width: 1520px; margin: 0 auto; padding: 24px 32px 40px; }

/* Resumen */
.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.sum { display: flex; align-items: baseline; gap: 12px; padding: 18px 24px; flex-wrap: wrap; }
.sum + .sum { border-left: 1px solid var(--line-2); }
.sum__n { font-size: 2.25rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.sum__of { font-size: 1.25rem; font-weight: 600; color: var(--ink-3); letter-spacing: 0; }
.sum__l { font-size: 1.0625rem; color: var(--ink-2); line-height: 1.3; }
.sum--bad .sum__n { color: var(--bad); }
.sum--warn .sum__n { color: var(--warn); }

.pgrid { display: grid; grid-template-columns: minmax(0, 1fr) 480px; gap: 24px; margin-top: 24px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }

/* Lista de locales */
.list__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px 16px; flex-wrap: wrap; }
.h2 { font-size: 1.375rem; font-weight: 800; letter-spacing: -0.01em; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 1rem; font-weight: 600; color: var(--ink-2); background: #fff; transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms var(--ease-out); }
.chip__n { font-family: var(--mono); font-size: .875rem; color: var(--ink-3); }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.is-on .chip__n { color: #c9d0d6; }
.chip:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { .chip:not(.is-on):hover { border-color: #aeb8bd; color: var(--ink); } }

.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: .9375rem; font-weight: 600; color: var(--ink-3); padding: 10px 16px; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line); background: #f8faf9; }
.tbl th:first-child { padding-left: 24px; }
.tbl td { padding: 14px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl td:first-child { padding-left: 24px; }
.row { cursor: pointer; transition: background-color 160ms ease; }
@media (hover: hover) and (pointer: fine) { .row:hover { background: #f5f8f7; } }
.row.is-sel { background: var(--brand-soft); }
.row.is-sel .lname { color: var(--brand); }
.row.is-flash { animation: hi 1.8s var(--ease-out); }
@keyframes hi { 0%, 35% { background: var(--hi); } 100% { background: var(--brand-soft); } }
.rowbtn { display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 2px; }
.lname { font-size: 1.1875rem; font-weight: 700; line-height: 1.25; }
.lmeta { font-size: .9375rem; color: var(--ink-3); }
.c-dots { white-space: nowrap; }
.c-state { min-width: 260px; }
.c-state .badge { margin-right: 10px; }
.stext { display: block; font-size: 1rem; color: var(--ink-2); margin-top: 6px; line-height: 1.35; }
.stext--bad { color: var(--bad); font-weight: 600; }
.c-chev { width: 40px; color: var(--ink-3); padding-right: 20px !important; }
.empty { text-align: center; color: var(--ink-3); padding: 40px !important; }

.dots { display: inline-flex; gap: 7px; align-items: center; }
.dot { display: inline-block; width: 18px; height: 18px; border-radius: 50%; flex: none; }
.dot--ok { background: var(--ok); }
.dot--part { background: var(--warn-dot); }
.dot--bad { background: var(--bad-dot); }
.dot--none { background: transparent; box-shadow: inset 0 0 0 2px #b4bec2; }
.dot--today { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #7c878f; }
.dot--today.dot--none { box-shadow: inset 0 0 0 2px #b4bec2, 0 0 0 2px #fff, 0 0 0 4px #7c878f; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 16px 24px 20px; font-size: .9375rem; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend .dot { width: 14px; height: 14px; }

.badge { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 10px; border-radius: 999px; font-size: .9375rem; font-weight: 700; white-space: nowrap; }
.badge__dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.badge--ok { background: var(--ok-bg); color: var(--ok); }
.badge--warn { background: var(--warn-bg); color: var(--warn); }
.badge--bad { background: var(--bad-bg); color: var(--bad); }

/* Ficha del local */
.detail { position: sticky; top: 88px; max-height: calc(100vh - 104px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overscroll-behavior: contain; }
.detail__in { padding: 22px 24px 28px; }
.detail__back { display: none; }
.dhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dhead__name { font-size: 1.5rem; font-weight: 800; line-height: 1.2; letter-spacing: -0.01em; text-wrap: balance; }
.dhead__meta { font-size: 1rem; color: var(--ink-2); margin-top: 6px; }
.dact { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.dsec { margin-top: 26px; }
.h3 { font-size: 1.0625rem; font-weight: 800; padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.tks { list-style: none; }
.tk { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 1.0625rem; }
.tk__ic { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 2px #b4bec2; display: grid; place-items: center; }
.tk__ic .ico { width: 15px; height: 15px; stroke-width: 3; }
.tk--ok .tk__ic { background: var(--ok); box-shadow: none; color: #fff; }
.tk--bad .tk__ic { background: var(--bad-dot); box-shadow: none; color: #fff; }
.tk__l .muted { font-size: .9375rem; margin-left: 4px; }
.tk__v { text-align: right; white-space: nowrap; font-size: 1rem; }
.incs { list-style: none; }
.inc { padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.inc__t { display: flex; gap: 10px; align-items: flex-start; font-size: 1.0625rem; }
.inc__t .ico { margin-top: 3px; }
.inc--open .inc__t .ico { color: var(--bad); }
.inc--done .inc__t .ico { color: var(--ok); }
.inc__a { margin: 6px 0 0 34px; font-size: 1rem; line-height: 1.45; }
.inc__a .pen { font-family: var(--sans); font-weight: 500; }
.inc__a--open { color: var(--bad); font-weight: 700; display: inline-block; background: var(--bad-bg); padding: 3px 10px; border-radius: 6px; }
.hday { margin-top: 12px; }
.hday__h { font-size: 1rem; font-weight: 700; text-transform: capitalize; margin-bottom: 2px; }
.hday__h .muted { text-transform: none; }
.hday__empty { font-size: 1rem; }
.htbl { width: 100%; border-collapse: collapse; font-size: 1rem; }
.htbl td { padding: 6px 8px 6px 0; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.htbl .muted { font-size: .9375rem; }
.h-time { font-variant-numeric: tabular-nums; color: var(--ink-3); width: 56px; font-size: .9375rem; }
.h-val { text-align: right; white-space: nowrap; }
.h-who { color: var(--ink-3); text-align: right; white-space: nowrap; width: 84px; font-size: .9375rem; }
.htbl tr.is-bad td { background: var(--bad-bg); }

.pfoot { display: flex; align-items: center; gap: 10px; justify-content: center; margin-top: 32px; color: var(--ink-3); font-size: .9375rem; text-align: center; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; padding: 0 18px; border-radius: 11px; border: 1px solid var(--line); background: #fff; font-size: 1.0625rem; font-weight: 700; color: var(--ink); transition: background-color 160ms ease, border-color 160ms ease, transform 160ms var(--ease-out), opacity 160ms ease; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn--primary:disabled { opacity: .38; }
.btn--ghost { border-style: dashed; border-color: #a9b3b8; color: var(--ink-2); }
.btn--text { border: 0; background: none; color: var(--ink-2); min-height: 44px; }
.btn--block { width: 100%; }
.btn--ondark { background: transparent; border-color: #4a5158; color: #fff; }
@media (hover: hover) and (pointer: fine) {
  .btn:not(.btn--primary):not(.btn--ondark):not(:disabled):hover { border-color: #9aa5ab; }
  .btn--primary:not(:disabled):hover { filter: brightness(1.12); }
  .btn--ondark:hover { background: #2c3136; }
}
.linkbtn { color: var(--pen); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Vista del local ---------- */
.lwrap { display: grid; grid-template-columns: minmax(0, 400px) auto; justify-content: center; align-items: center; gap: 72px; padding: 40px 32px 48px; min-height: calc(100vh - 74px); }
.lside__h { font-size: 2.125rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.12; text-wrap: balance; }
.lside__p { font-size: 1.1875rem; color: var(--ink-2); margin-top: 14px; }
.lside__p b { color: var(--ink); }
.steps { list-style: none; counter-reset: s; margin: 24px 0 28px; display: grid; gap: 14px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 34px 1fr; gap: 12px; font-size: 1.0625rem; line-height: 1.45; }
.steps li::before { content: counter(s); width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .9375rem; margin-top: -2px; }
.fl { display: block; font-size: .9375rem; font-weight: 700; color: var(--ink-2); margin: 14px 0 6px; }
.inp { width: 100%; min-height: 50px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 1.0625rem; caret-color: var(--pen); }
.inp:focus { outline: none; border-color: var(--pen); box-shadow: 0 0 0 3px var(--pen-soft); }
.inp--mono { font-family: var(--mono); color: var(--pen); font-weight: 600; }
select.inp { appearance: none; padding-right: 40px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2347515b' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 12px center / 20px; }

.phone { width: 400px; height: min(830px, calc(100vh - 150px)); min-height: 640px; padding: 12px; background: #1b1e21; border-radius: 54px; box-shadow: 0 0 0 1px #3a3f44 inset, 0 40px 80px -30px rgba(22, 26, 30, .45), 0 12px 24px -12px rgba(22, 26, 30, .3); }
.phone__screen { height: 100%; border-radius: 43px; overflow: hidden; background: var(--ground); position: relative; }

.app { display: flex; flex-direction: column; height: 100%; }
.app__status { display: flex; justify-content: space-between; align-items: center; padding: 14px 28px 4px; font-size: .875rem; font-weight: 700; background: var(--brand); color: #fff; font-variant-numeric: tabular-nums; }
.app__sig { display: inline-flex; gap: 2px; align-items: flex-end; }
.app__sig i { width: 3px; background: #fff; border-radius: 1px; }
.app__sig i:nth-child(1) { height: 4px; } .app__sig i:nth-child(2) { height: 6px; } .app__sig i:nth-child(3) { height: 8px; } .app__sig i:nth-child(4) { height: 10px; }
.app__head { display: flex; align-items: center; gap: 12px; padding: 10px 20px 16px; background: var(--brand); color: #fff; }
.app__brand { min-width: 0; }
.app__cons { font-size: 1.0625rem; font-weight: 800; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.app__local { font-size: .9375rem; color: rgba(255,255,255,.85); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app__date { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 16px 20px 8px; }
.app__h { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.02em; }
.app__d { font-size: 1rem; color: var(--ink-2); }
.app__body { flex: 1; overflow-y: auto; padding: 4px 16px 20px; overscroll-behavior: contain; }
.app__pw { text-align: center; font-size: .8125rem; color: var(--ink-3); margin-top: 20px; }
.app__nav { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); background: #fff; padding: 6px 12px max(14px, env(safe-area-inset-bottom)); }
.anav { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px; font-size: .875rem; font-weight: 700; color: var(--ink-3); border-radius: 10px; }
.anav .ico { width: 24px; height: 24px; }
.anav.is-on { color: var(--brand); }

.aprog { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.aprog__top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.aprog__t { font-size: 1.0625rem; }
.aprog__s { font-size: .9375rem; color: var(--ok); font-weight: 700; }
.aprog__bar { height: 8px; border-radius: 99px; background: var(--line-2); margin-top: 10px; overflow: hidden; }
.aprog__bar span { display: block; height: 100%; background: var(--ok); border-radius: inherit; transform-origin: left; transition: transform 420ms var(--ease-out); }
.agroup { font-size: .9375rem; font-weight: 800; color: var(--ink-2); margin: 20px 4px 8px; }
.tasks { list-style: none; display: grid; gap: 8px; }
.task { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; transition: border-color 160ms ease; }
.task__row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 14px; min-height: 68px; text-align: left; transition: background-color 160ms ease; }
.task__row:active:not(.task__row--static) { background: #f3f6f5; }
.task__row--static { padding-bottom: 6px; }
.task__ic { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--ok); color: #fff; }
.task__ic .ico { width: 20px; height: 20px; stroke-width: 2.6; }
.task__ic--todo { background: var(--brand-soft); color: var(--brand); }
.task__ic--todo .ico { stroke-width: 2; }
.task--bad .task__ic { background: var(--bad-dot); }
.task__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.task__t { font-size: 1.125rem; font-weight: 700; line-height: 1.25; }
.task__s { font-size: .9375rem; color: var(--ink-3); line-height: 1.35; }
.task__val { font-size: 1.25rem; white-space: nowrap; }
.task__go { color: var(--ink-3); font-size: 1.25rem; font-weight: 700; }
.task__sig { height: 34px; width: auto; }
.task--done { border-color: var(--ok-line); }
.task--done.task--bad { border-color: var(--bad-line); }

.tin { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 4px 14px 0; }
.tin__field { position: relative; }
.tin__input { width: 100%; height: 60px; padding: 0 52px 0 16px; border: 2px solid var(--line); border-radius: 12px; font-family: var(--mono); font-size: 1.75rem; font-weight: 700; color: var(--pen); background: #fbfcfc; caret-color: var(--pen); font-variant-numeric: tabular-nums; transition: border-color 160ms ease, background-color 160ms ease; }
.tin__input::placeholder { color: #c3cace; }
.tin__input:focus { outline: none; border-color: var(--pen); background: #fff; }
.tin__u { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 1.125rem; font-weight: 700; color: var(--ink-3); pointer-events: none; }
.tin__field--sm .inp { padding-right: 46px; }
.tin__save { height: 60px; padding: 0 20px; }
.tin__hint { padding: 6px 16px 12px; font-size: .9375rem; color: var(--ink-3); min-height: 1.5em; }
.is-okv .tin__input { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
.is-okv .tin__hint { color: var(--ok); font-weight: 700; }
.is-badv .tin__input { border-color: var(--bad); background: var(--bad-bg); color: var(--bad); }
.is-badv .tin__hint { color: var(--bad); font-weight: 700; }
.is-badv { border-color: var(--bad-line); }

.acard { border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.acard--bad { background: var(--bad-bg); border: 1px solid var(--bad-line); }
.acard__h { display: flex; align-items: center; gap: 8px; font-size: 1.125rem; font-weight: 800; color: var(--bad); }
.acard__p { font-size: 1rem; margin-top: 6px; line-height: 1.45; }
.acc { display: grid; gap: 8px; margin-top: 12px; }
.acc__o { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px; min-height: 52px; background: #fff; border: 1px solid var(--bad-line); border-radius: 11px; font-size: 1rem; font-weight: 600; line-height: 1.3; transition: border-color 160ms ease, transform 160ms var(--ease-out); }
.acc__o:active { transform: scale(.98); }
.acc__r { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 2px #a9b3b8; flex: none; transition: box-shadow 160ms ease; }
.acc__o.is-on { border-color: var(--ink); }
.acc__o.is-on .acc__r { box-shadow: inset 0 0 0 7px var(--ink); }

.sigbox, .form { padding: 0 14px 14px; }
.sigbox .fl:first-child, .form .fl:first-child { margin-top: 6px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg__b { min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; font-size: 1rem; font-weight: 600; transition: background-color 160ms ease, transform 160ms var(--ease-out); }
.seg__b:active { transform: scale(.97); }
.seg__b.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.pad { position: relative; height: 150px; border: 1px solid var(--line); border-radius: 12px; background: #fff; margin-bottom: 12px; touch-action: none; }
.pad canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.pad__line { position: absolute; left: 20px; right: 20px; bottom: 34px; border-bottom: 1.5px dashed #b4bec2; pointer-events: none; }
.pad__clear { position: absolute; top: 8px; right: 8px; padding: 6px 10px; font-size: .875rem; font-weight: 700; color: var(--ink-2); border-radius: 8px; background: #f1f4f3; }
.form__2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 10px; }
.form .btn { margin-top: 12px; }
.photo { position: relative; margin-top: 14px; }
.photo__img svg { display: block; width: 100%; height: auto; border-radius: 12px; }
.photo__cap { font-size: .875rem; color: var(--ink-3); margin-top: 6px; }
.photo .pad__clear { top: 8px; right: 8px; }

.hl { list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.hl__i { display: grid; grid-template-columns: 52px 1fr auto; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line-2); font-size: 1rem; align-items: baseline; }
.hl__i:last-child { border-bottom: 0; }
.hl__i.is-bad { background: var(--bad-bg); }
.hl__h { font-family: var(--mono); color: var(--ink-3); font-size: .9375rem; }
.hl__w .muted { font-size: .875rem; }

/* ---------- Aviso ---------- */
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 70; display: flex; align-items: center; gap: 12px; max-width: min(620px, calc(100vw - 32px)); padding: 12px 12px 12px 16px; background: var(--chrome); color: #fff; border-radius: 14px; box-shadow: 0 18px 40px -16px rgba(0,0,0,.5); font-size: 1rem; line-height: 1.35; opacity: 0; transform: translate(-50%, 12px); transition: opacity 220ms ease, transform 320ms var(--ease-out); }
.toast.is-in { opacity: 1; transform: translate(-50%, 0); }
.toast--warn .toast__ic { background: var(--bad-dot); }
.toast__ic { width: 28px; height: 28px; border-radius: 50%; background: var(--ok); display: grid; place-items: center; flex: none; }
.toast__ic .ico { width: 17px; height: 17px; stroke-width: 3; }
.toast__btn { flex: none; padding: 10px 14px; border-radius: 10px; background: #fff; color: var(--ink); font-weight: 700; font-size: .9375rem; transition: transform 160ms var(--ease-out); }
.toast__btn:active { transform: scale(.97); }

/* ---------- Dosier ---------- */
.dossier { position: fixed; inset: 0; z-index: 60; background: #2a2f34; display: flex; flex-direction: column; }
body.has-dossier { overflow: hidden; }
.dbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 24px; background: var(--chrome); color: #c5ccd2; }
.dbar__t { font-size: .9375rem; }
.dscroll { flex: 1; overflow: auto; padding: 28px 16px 56px; }
.sheet { width: min(920px, 100%); margin: 0 auto; background: #fff; color: var(--ink); padding: 52px 60px 40px; border-radius: 4px; box-shadow: 0 30px 60px -24px rgba(0,0,0,.6); font-size: 1rem; }
.sh__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding-bottom: 20px; border-bottom: 2px solid var(--brand); }
.sh__head .mono { background: var(--brand); color: #fff; }
.brand__name--doc { font-size: 1.375rem; color: var(--brand); }
.sh__head .brand__sub { color: var(--ink-2); }
.sh__meta { text-align: right; font-size: .875rem; color: var(--ink-3); }
.sh__h { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; margin-top: 28px; }
.sh__sub { font-size: 1.125rem; color: var(--ink-2); margin-top: 4px; }
.sh__dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 24px 0 0; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sh__dl dt { font-size: .8125rem; font-weight: 700; color: var(--ink-3); }
.sh__dl dd { margin: 2px 0 0; font-size: 1rem; font-weight: 600; }
.sh__sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding: 16px 0 4px; font-size: .9375rem; color: var(--ink-2); }
.sh__sum b { display: block; font-size: 1.375rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.sh__sec { margin-top: 30px; break-inside: auto; }
.sh__sec h2 { font-size: 1.1875rem; font-weight: 800; margin-bottom: 8px; color: var(--brand); }
.dt { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.dt th { text-align: left; font-size: .8125rem; font-weight: 700; color: var(--ink-2); padding: 7px 8px; background: #f3f6f5; border-bottom: 1px solid var(--line); vertical-align: bottom; }
.dt td { padding: 7px 8px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.dt .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.dt th.num { font-family: var(--sans); }
.th2 { display: block; font-weight: 400; color: var(--ink-3); }
.dt td.num { color: var(--pen); font-weight: 600; }
.dt td.bad, .dt .bad { color: var(--bad); }
.dt td.num.bad { background: var(--bad-bg); }
.dt .miss { color: var(--ink-3); }
.dt .lote { font-family: var(--mono); color: var(--pen); }
.dt tr { break-inside: avoid; }
.dsig { height: 26px; vertical-align: middle; margin-right: 6px; }
.sh__foot { display: flex; align-items: center; gap: 10px; margin-top: 36px; padding-top: 14px; border-top: 1px solid var(--line); font-size: .8125rem; color: var(--ink-3); }

/* ---------- Pantallas medianas: la ficha pasa a hoja ---------- */
@media (max-width: 1099px) {
  .pgrid { grid-template-columns: minmax(0, 1fr); }
  .detail { position: fixed; z-index: 45; top: 0; right: 0; bottom: 0; left: auto; width: min(560px, 100%); max-height: none; border-radius: 0; border: 0; transform: translateX(100%); transition: transform 300ms var(--ease-drawer); box-shadow: -20px 0 50px -20px rgba(0,0,0,.35); visibility: hidden; }
  .detail.is-open { transform: none; visibility: visible; }
  body.has-sheet { overflow: hidden; }
  .detail__back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin: -6px 0 10px -6px; padding: 0 10px 0 4px; border-radius: 10px; font-weight: 700; color: var(--brand); }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sum:nth-child(3) { border-left: 0; }
  .sum:nth-child(n+3) { border-top: 1px solid var(--line-2); }
  .lwrap { gap: 40px; }
}
@media (max-width: 900px) {
  .lwrap { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .lside { max-width: 520px; }
}

/* ---------- Móvil ---------- */
@media (max-width: 760px) {
  body { font-size: 1.0625rem; }
  .hide-sm { display: none; }
  .demo-bar { grid-template-columns: 1fr auto; grid-template-areas: "note reset" "switch switch"; gap: 8px 12px; padding: 8px 12px 10px; }
  .demo-bar__note { grid-area: note; font-size: .875rem; }
  .demo-bar__reset { grid-area: reset; padding: 8px 10px; }
  .switch { grid-area: switch; }
  .switch__btn { flex: 1; justify-content: center; padding: 8px 10px; font-size: 1rem; gap: 8px; }
  .phead { padding: 16px; flex-direction: column; align-items: flex-start; gap: 10px; }
  .phead__right { text-align: left; display: flex; gap: 12px; flex-wrap: wrap; align-items: baseline; }
  .brand__name { font-size: 1.375rem; }
  .brand__sub { font-size: 1rem; }
  .mono--lg { width: 52px; height: 52px; font-size: 1.35rem; }
  .pwrap { padding: 16px 16px 32px; }
  .sum { padding: 14px 16px; gap: 4px 10px; }
  .sum__n { font-size: 1.875rem; }
  .sum__l { font-size: .9375rem; }
  .list__head { padding: 16px 16px 12px; }
  .chips { gap: 6px; }
  .chip { min-height: 40px; padding: 0 12px; font-size: .9375rem; }
  .tbl thead { display: none; }
  .tbl, .tbl tbody { display: block; }
  .tbl tr.row { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name chev" "state chev" "dots chev"; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
  .tbl tr.row td { padding: 0 !important; border: 0; }
  .c-name { grid-area: name; }
  .c-state { grid-area: state; min-width: 0; }
  .c-dots { grid-area: dots; }
  .c-chev { grid-area: chev; align-self: center; width: auto; }
  .legend { padding: 14px 16px 18px; gap: 6px 16px; font-size: .875rem; }
  .detail__in { padding: 16px 16px 32px; }
  .dhead { flex-direction: column; }
  .dact .btn { width: 100%; }
  .h-who { display: none; }
  /* La app ocupa la pantalla */
  .lwrap { display: block; padding: 0; min-height: 0; }
  .lside { display: none; }
  .phone { width: 100%; height: calc(100dvh - 104px); min-height: 520px; padding: 0; border-radius: 0; background: none; box-shadow: none; }
  .phone__screen { border-radius: 0; }
  .app__status { display: none; }
  .app__head { padding-top: 14px; }
  .toast { bottom: 16px; }
  .dbar { padding: 8px 12px; }
  .dbar__t { display: none; }
  .dscroll { padding: 12px 8px 40px; }
  .sheet { padding: 24px 18px; }
  .sh__head { flex-direction: column; gap: 10px; }
  .sh__meta { text-align: left; }
  .sh__h { font-size: 1.625rem; }
  .sh__dl, .sh__sum { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sh__sec { overflow-x: auto; }
  .dt { font-size: .875rem; min-width: 520px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; }
  .row.is-flash { animation: none; }
}

/* ---------- Impresión del dosier ---------- */
@media print {
  @page { size: A4; margin: 14mm 12mm; }
  body { background: #fff; font-size: 10.5pt; }
  .demo-bar, main, .toast, .dbar { display: none !important; }
  .dossier { position: static; background: #fff; display: block; }
  .dscroll { overflow: visible; padding: 0; }
  .sheet { width: auto; padding: 0; box-shadow: none; border-radius: 0; font-size: 10pt; }
  .sh__sec { overflow: visible; }
  .dt { min-width: 0; font-size: 9pt; }
  .dt td.num.bad, .dt th, .mono--xs, .sh__head .mono { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.u { font-size: .8em; color: var(--pen); margin-left: .18em; font-weight: 600; }
.u--bad { color: var(--bad); }
@media (min-width: 901px) {
  body[data-view="local"] .toast { left: calc(50% - 236px); max-width: 420px; }
}
