/* SIA · sistema visual "Placa y rotulador"
   Cartón gris cálido, tinta grafito, cinta amarilla de rotuladora como acción/estado activo,
   códigos de equipo impresos como cinta, placa de inventario de aluminio con código de barras. */

:root {
  --ground: #edebe5;
  --panel: #fbfaf7;
  --panel-2: #f4f2ec;
  --panel-3: #e7e4dc;
  --ink: #23211d;
  --ink-2: #57534b;
  --ink-3: #6f6a61;
  --line: #dcd8cf;
  --line-2: #c6c1b6;

  --tape: #f3d03e;
  --tape-2: #e4bd22;
  --tape-soft: #fbf0bd;
  --tape-ink: #1d1b17;

  --body: #262420;
  --body-2: #33302b;
  --body-ink: #e4e0d6;
  --body-ink-2: #a39e92;

  --ok: #3b7628;
  --ok-soft: #e3eedb;
  --warn: #9a5c00;
  --warn-soft: #f7e7c8;
  --bad: #b0281f;
  --bad-soft: #f6dcd8;
  --neutral: #6c675e;

  /* Paleta categórica validada (orden fijo) */
  --c1: #c2502a; /* correctivo */
  --c2: #008a7c; /* soporte */
  --c3: #a8820a; /* otro */
  --c4: #8a4f99; /* instalación */
  --c5: #4a7d2c; /* preventivo */

  --r: 6px;
  --r-sm: 4px;
  --shadow-1: 0 1px 2px rgba(35, 33, 29, .06), 0 1px 1px rgba(35, 33, 29, .04);
  --shadow-2: 0 6px 20px -6px rgba(35, 33, 29, .22), 0 2px 6px rgba(35, 33, 29, .08);
  --ease: cubic-bezier(.16, 1, .3, 1);

  --font: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --side-w: 236px;

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.5;
  font-stretch: 96%;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
::selection { background: var(--tape); color: var(--tape-ink); }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--tape-2); }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-stretch: 88%; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.12rem; font-weight: 650; }
h3 { font-size: .98rem; font-weight: 650; }
p { margin: 0 0 .75em; }
img, svg { display: block; }
.i { width: 18px; height: 18px; flex: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 5px var(--tape); border-radius: 3px; }
html { scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 2px solid var(--ground); }
.muted { color: var(--ink-3); }
.mono { font-family: var(--mono); font-size: .9em; letter-spacing: -.01em; }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Rótulo grabado: versalitas angostas bajo cada control */
.lbl, label.lbl, th {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-stretch: 78%;
  color: var(--ink-2);
}

/* ------------------------------------------------------------------ armazón */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; background: linear-gradient(90deg, var(--body) var(--side-w), transparent 0); }
.side {
  position: sticky; top: 0; height: 100vh;
  background: var(--body);
  color: var(--body-ink);
  display: flex; flex-direction: column;
  padding: 18px 14px 14px;
  border-right: 1px solid #14130f;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px 18px; text-decoration: none; }
.brand-tape {
  background: var(--tape); color: var(--tape-ink);
  font-weight: 800; font-stretch: 70%; font-size: 21px; letter-spacing: .06em;
  padding: 3px 11px 2px; border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), inset 0 -1px 0 rgba(0,0,0,.12), 0 1px 0 #000;
}
.brand-txt { font-size: 11px; line-height: 1.25; color: var(--body-ink-2); font-stretch: 80%; letter-spacing: .04em; text-transform: uppercase; }
.brand-txt b { display: block; color: var(--body-ink); font-weight: 600; letter-spacing: .02em; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-sec { margin: 16px 8px 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--body-ink-2); font-stretch: 78%; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 10px; border-radius: var(--r-sm);
  text-decoration: none; color: var(--body-ink); font-weight: 500;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.nav a .i { color: var(--body-ink-2); transition: color .18s var(--ease); }
.nav a:hover { background: var(--body-2); }
.nav a:hover .i { color: var(--body-ink); }
.nav a[aria-current="page"] {
  background: var(--tape); color: var(--tape-ink); font-weight: 650;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 1px 0 #000;
}
.nav a[aria-current="page"] .i { color: var(--tape-ink); }
.nav .count { margin-left: auto; font-family: var(--mono); font-size: 11px; background: var(--body-2); color: var(--body-ink); padding: 0 6px; border-radius: 3px; }
.nav a[aria-current="page"] .count { background: rgba(0,0,0,.12); color: var(--tape-ink); }

.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--body-2); display: flex; align-items: center; gap: 10px; }
.side-foot .who { min-width: 0; flex: 1; font-size: 13px; line-height: 1.25; }
.side-foot .who a { text-decoration: none; font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot .who span { color: var(--body-ink-2); font-size: 11.5px; }
.side-foot form { margin: 0; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  border: 0; border-radius: var(--r-sm); background: transparent; color: inherit; cursor: pointer;
}
.side .icon-btn { color: var(--body-ink-2); }
.side .icon-btn:hover { background: var(--body-2); color: var(--body-ink); }
.av {
  display: inline-grid; place-items: center; flex: none;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--panel-3); color: var(--ink); font-size: 12px; font-weight: 700; font-stretch: 80%;
  border: 1px solid var(--line-2);
}
.side .av { background: var(--body-2); color: var(--body-ink); border-color: #45413a; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 28px;
  background: rgba(237, 235, 229, .92);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar .menu-btn { display: none; }
.jump { position: relative; flex: 0 1 340px; margin-left: auto; }
.jump .i { position: absolute; left: 10px; top: 50%; translate: 0 -50%; color: var(--ink-3); width: 16px; height: 16px; }
.jump input { padding-left: 34px; padding-right: 34px; background: var(--panel); font-family: var(--mono); font-size: 13px; }
.jump input::placeholder { font-family: var(--font); font-size: 13.5px; }
.jump kbd {
  position: absolute; right: 8px; top: 50%; translate: 0 -50%;
  font-family: var(--mono); font-size: 11px; color: var(--ink-3);
  border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--panel-2);
}
.content { padding: 26px 28px 60px; width: 100%; max-width: 1440px; }

/* ------------------------------------------------------------------ cabecera de página */
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .t { flex: 1 1 320px; min-width: 0; }
.page-head .t p { margin: 6px 0 0; color: var(--ink-2); max-width: 70ch; }
.crumb { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); text-decoration: none; margin-bottom: 8px; }
.crumb:hover { color: var(--ink); }
.crumb .i { width: 15px; height: 15px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ------------------------------------------------------------------ botones */
.btn {
  --bg: var(--panel); --fg: var(--ink); --bd: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px;
  border: 1px solid var(--bd); border-radius: var(--r-sm);
  background: var(--bg); color: var(--fg);
  font: inherit; font-weight: 600; font-size: 14px; font-stretch: 92%;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  box-shadow: var(--shadow-1);
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .15s var(--ease), box-shadow .15s var(--ease);
}
.btn .i { width: 16px; height: 16px; }
.btn:hover { background: var(--panel-2); border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }
.btn-primary {
  --bg: var(--tape); --fg: var(--tape-ink); --bd: #c9a514;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 1px 0 rgba(0,0,0,.18), 0 2px 6px -2px rgba(150, 115, 0, .45);
}
.btn-primary:hover { background: var(--tape-2); border-color: #b18f0c; }
.btn-dark { --bg: var(--ink); --fg: #f4f1e8; --bd: var(--ink); }
.btn-dark:hover { background: #3a3731; border-color: #3a3731; }
.btn-ghost { --bg: transparent; --bd: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--panel-3); border-color: transparent; }
.btn-danger { --fg: var(--bad); }
.btn-danger:hover { background: var(--bad-soft); border-color: var(--bad); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.is-loading { pointer-events: none; opacity: .75; }
.btn.is-loading::after { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { rotate: 360deg; } }

/* ------------------------------------------------------------------ cinta (códigos) */
.tape {
  display: inline-flex; align-items: center;
  font-family: var(--mono); font-weight: 600; font-size: 12.5px; letter-spacing: .02em;
  color: var(--tape-ink); background: #fff;
  padding: 1px 8px; border-radius: 2px;
  border: 1px solid var(--line-2);
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.05), 0 1px 0 rgba(0,0,0,.04);
  white-space: nowrap;
}
.tape-y { background: var(--tape); border-color: #caa716; }
.tape-k { background: var(--ink); color: #f4f1e8; border-color: var(--ink); }
a.tape-link { text-decoration: none; }
a.tape-link:hover .tape { background: var(--tape-soft); border-color: var(--tape-2); }

/* ------------------------------------------------------------------ estados por forma */
.st { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 550; white-space: nowrap; color: var(--ink); }
.st .mk { width: 10px; height: 10px; border-radius: 50%; flex: none; border: 2px solid currentColor; }
.st-operativo .mk { background: var(--ok); border-color: var(--ok); }
.st-reparacion .mk { border-color: var(--warn); background: linear-gradient(90deg, var(--warn) 50%, transparent 50%); }
.st-bodega .mk { border-color: var(--neutral); background: transparent; }
.st-baja { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--bad); }
.st-baja .mk { border: 0; border-radius: 1px; height: 2px; width: 11px; background: var(--bad); }
.sol-abierta .mk { border-color: var(--warn); background: transparent; }
.sol-en_proceso .mk { border-color: var(--warn); background: linear-gradient(90deg, var(--warn) 50%, transparent 50%); }
.sol-resuelta .mk { border-color: var(--ok); background: var(--ok); }
.sol-cerrada .mk { border-color: var(--ink-2); background: var(--ink-2); border-radius: 2px; }
.sol-cancelada { color: var(--ink-3); text-decoration: line-through; }
.sol-cancelada .mk { border: 0; border-radius: 1px; height: 2px; width: 11px; background: var(--ink-3); }

.prio { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; white-space: nowrap; }
.prio .bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.prio .bars i { width: 3px; background: var(--line-2); border-radius: 1px; }
.prio .bars i:nth-child(1) { height: 4px; } .prio .bars i:nth-child(2) { height: 7px; }
.prio .bars i:nth-child(3) { height: 10px; } .prio .bars i:nth-child(4) { height: 12px; }
.prio .bars i.on { background: var(--ink-2); }
.prio-alta .bars i.on { background: var(--warn); }
.prio-critica .bars i.on { background: var(--bad); }
.prio-critica { font-weight: 650; color: var(--bad); }

.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--panel-3); color: var(--ink-2); white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; flex: none; }

/* ------------------------------------------------------------------ paneles */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1); }
.panel-h { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 14px 18px 12px; border-bottom: 1px solid var(--line); }
.panel-h h2 { flex: 1; font-size: 1rem; }
.panel-h .lnk { font-size: 13px; color: var(--ink-2); text-decoration: none; display: inline-flex; align-items: center; gap: 3px; }
.panel-h .lnk:hover { color: var(--ink); text-decoration: underline; }
.panel-h .lnk .i { width: 14px; height: 14px; }
.panel-b { padding: 16px 18px; }
.panel-b.flush { padding: 0; }
.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 18px; }

/* Tira de lecturas: una sola regleta con celdas, no tarjetas sueltas */
.strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-1); margin-bottom: 18px; overflow: hidden;
}
.strip > div { padding: 14px 18px 13px; border-right: 1px solid var(--line); position: relative; min-width: 0; }
.strip > div:last-child { border-right: 0; }
.strip .v { font-size: 1.7rem; font-weight: 700; font-stretch: 80%; line-height: 1.1; letter-spacing: -.01em; display: flex; align-items: baseline; gap: 6px; }
.strip .v small { font-size: 13px; font-weight: 500; color: var(--ink-3); font-stretch: 90%; letter-spacing: 0; }
.strip .lbl { display: block; margin-top: 3px; }
.strip a { text-decoration: none; display: block; }
.strip a:hover .v { text-decoration: underline; text-decoration-color: var(--tape-2); text-decoration-thickness: 2px; }
.strip .hot { background: var(--tape-soft); }

/* ------------------------------------------------------------------ filtros */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.filters .f { display: flex; flex-direction: column; gap: 4px; min-width: 130px; }
.filters .f.grow { flex: 1 1 220px; }
.filters .f-actions { display: flex; gap: 6px; }
.seg { display: inline-flex; background: var(--panel-3); border-radius: var(--r-sm); padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg a { padding: 4px 11px; border-radius: 3px; text-decoration: none; font-size: 13px; font-weight: 550; color: var(--ink-2); white-space: nowrap; }
.seg a:hover { color: var(--ink); background: rgba(255,255,255,.5); }
.seg a[aria-current="true"] { background: var(--panel); color: var(--ink); box-shadow: var(--shadow-1); }
.seg a .n { font-family: var(--mono); font-size: 11px; color: var(--ink-3); margin-left: 4px; }

/* ------------------------------------------------------------------ formularios */
input, select, textarea {
  font: inherit; font-size: 14px; color: var(--ink);
  width: 100%; min-height: 36px;
  padding: 7px 10px;
  background: #fff; border: 1px solid var(--line-2); border-radius: var(--r-sm);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
textarea { min-height: 88px; resize: vertical; line-height: 1.45; }
select { appearance: none; padding-right: 30px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2357534b' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 8px center / 16px; }
input::placeholder, textarea::placeholder { color: #8d887e; }
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--tape-soft), 0 0 0 4px var(--tape-2); }
input[type="checkbox"], input[type="radio"] { width: 17px; height: 17px; min-height: 0; accent-color: var(--ink); margin: 0; }
input:disabled, select:disabled { background: var(--panel-2); color: var(--ink-3); }
.form { display: grid; gap: 18px; }
.fieldset { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px 20px; box-shadow: var(--shadow-1); }
.fieldset > h2 { font-size: 1rem; margin-bottom: 4px; }
.fieldset > .hint { color: var(--ink-3); font-size: 13px; margin: 0 0 14px; }
.fields { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px 16px; }
.fld { grid-column: span 4; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fld.s3 { grid-column: span 3; } .fld.s6 { grid-column: span 6; } .fld.s8 { grid-column: span 8; } .fld.s12 { grid-column: span 12; } .fld.s2 { grid-column: span 2; }
.fld .req { color: var(--bad); margin-left: 2px; }
.fld .help { font-size: 12.5px; color: var(--ink-3); }
.fld .err { font-size: 12.5px; color: var(--bad); font-weight: 550; }
.fld.has-err input, .fld.has-err select, .fld.has-err textarea { border-color: var(--bad); background: #fffafa; }
.check { display: flex; align-items: center; gap: 9px; font-size: 14px; cursor: pointer; }
.form-foot { display: flex; gap: 10px; align-items: center; justify-content: flex-end; position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--ground) 30%); }
.form-foot .muted { margin-right: auto; font-size: 13px; }
.cat-block[hidden] { display: none; }

/* ------------------------------------------------------------------ tablas */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 10px 14px 8px; border-bottom: 1px solid var(--line-2); background: var(--panel-2); white-space: nowrap; position: sticky; top: 0; }
td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #f7f5ef; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
td .sub { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
td .clip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 52ch; }
tr.row-link { cursor: pointer; }
.tbl-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.pager { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.pager a, .pager .off { font-weight: 600; text-decoration: none; padding: 4px 10px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--panel); }
.pager a:hover { border-color: var(--ink-3); }
.pager .off { opacity: .45; }
.pg-now { color: var(--ink-3); }

/* ------------------------------------------------------------------ vacío */
.empty { padding: 42px 24px; text-align: center; color: var(--ink-2); }
.empty .tape { font-size: 13px; margin-bottom: 12px; }
.empty h3 { margin-bottom: 6px; color: var(--ink); }
.empty p { max-width: 46ch; margin: 0 auto 14px; }
.empty-inline { color: var(--ink-3); font-size: 13.5px; margin: 4px 0; }

/* ------------------------------------------------------------------ avisos */
.flashes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.flash { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: var(--r-sm); border: 1px solid; font-weight: 500; animation: drop .35s var(--ease); }
.flash .i { margin-top: 1px; }
.flash-ok { background: var(--ok-soft); border-color: #b9d3a8; color: #24501a; }
.flash-error { background: var(--bad-soft); border-color: #e6b3ad; color: #7d1a13; }
.flash button { margin-left: auto; background: none; border: 0; color: inherit; cursor: pointer; padding: 0; opacity: .7; }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }

/* ------------------------------------------------------------------ barras horizontales */
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.hbars li { display: grid; grid-template-columns: minmax(90px, 38%) 1fr 44px; align-items: center; gap: 10px; font-size: 13.5px; }
.hb-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-l a { text-decoration: none; }
.hb-l a:hover { text-decoration: underline; }
.hb-t { height: 12px; background: var(--panel-2); border-radius: 2px; overflow: hidden; }
.hb-f { display: block; height: 100%; background: var(--ink-2); border-radius: 0 4px 4px 0; transform-origin: left; animation: grow .6s var(--ease) both; }
.hbars li:hover .hb-f { background: var(--ink); }
.hb-v { text-align: right; font-weight: 650; font-family: var(--mono); font-size: 12.5px; }
@keyframes grow { from { transform: scaleX(0); } }

/* Barra apilada de clases de servicio */
.stackbar { display: flex; height: 16px; border-radius: 3px; overflow: hidden; gap: 2px; background: var(--panel); }
.stackbar span { display: block; height: 100%; min-width: 3px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend b { color: var(--ink); font-family: var(--mono); font-size: 12px; }
.cl-correctivo { background: var(--c1); } .cl-soporte { background: var(--c2); } .cl-otro { background: var(--c3); }
.cl-instalacion { background: var(--c4); } .cl-preventivo { background: var(--c5); }

.chart-box { position: relative; height: 240px; }
.chart-tip {
  position: absolute; pointer-events: none; z-index: 5;
  background: var(--ink); color: #f4f1e8; font-size: 12.5px; padding: 6px 9px; border-radius: 4px;
  box-shadow: var(--shadow-2); white-space: nowrap; opacity: 0; transition: opacity .12s;
}

/* ------------------------------------------------------------------ listas compactas */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 12px; align-items: baseline; padding: 11px 18px; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .body { flex: 1; min-width: 0; }
.list .body a.ttl { font-weight: 600; text-decoration: none; }
.list .body a.ttl:hover { text-decoration: underline; }
.list .meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--ink-3); margin-top: 3px; align-items: center; }
.list .side-v { text-align: right; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }

/* ------------------------------------------------------------------ placa de inventario */
.plate {
  position: relative;
  border-radius: 7px;
  padding: 18px 22px 16px;
  color: #26241f;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.22) 0 1px, rgba(0,0,0,.025) 1px 3px, rgba(255,255,255,.1) 3px 4px),
    linear-gradient(175deg, #eeede8 0%, #d9d7cf 48%, #e4e2db 52%, #cfccc3 100%);
  border: 1px solid #aca79b;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), inset 0 -1px 0 rgba(0,0,0,.08), 0 1px 1px rgba(0,0,0,.08), 0 10px 24px -14px rgba(35,33,29,.5);
}
.plate::before, .plate::after {
  content: ""; position: absolute; width: 9px; height: 9px; border-radius: 50%; top: 9px;
  background: radial-gradient(circle at 35% 35%, #fff 0 18%, #bbb6aa 45%, #8b8679 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,.7), inset 0 -1px 1px rgba(0,0,0,.25);
}
.plate::before { left: 9px; } .plate::after { right: 9px; }
.plate .rivets::before, .plate .rivets::after {
  content: ""; position: absolute; width: 9px; height: 9px; border-radius: 50%; bottom: 9px;
  background: radial-gradient(circle at 35% 35%, #fff 0 18%, #bbb6aa 45%, #8b8679 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,.7), inset 0 -1px 1px rgba(0,0,0,.25);
}
.plate .rivets::before { left: 9px; } .plate .rivets::after { right: 9px; }
.plate-org { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; font-weight: 650; font-stretch: 75%; color: #4c4840; text-align: center; padding: 0 14px; }
.plate-code { font-family: var(--mono); font-weight: 700; font-size: 1.9rem; letter-spacing: .04em; text-align: center; margin: 4px 0 8px; line-height: 1.1; text-shadow: 0 1px 0 rgba(255,255,255,.6); }
.plate .barcode { width: 100%; max-width: 300px; height: 46px; margin: 0 auto; color: #1d1b17; }
.plate-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; font-family: var(--mono); font-size: 11px; color: #4c4840; }

/* Ficha técnica: pares rótulo/valor */
.specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border-radius: 0 0 var(--r) var(--r); overflow: hidden; }
.specs div { padding: 10px 18px; min-width: 0; background: var(--panel); }
.specs dt { margin: 0 0 2px; }
.specs dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; }
.specs dd.mono { font-weight: 500; }
.specs .wide { grid-column: 1 / -1; }

/* Línea de tiempo de la hoja de vida */
.timeline { list-style: none; margin: 0; padding: 6px 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 111px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.timeline li { display: grid; grid-template-columns: 92px 28px 1fr; gap: 0; padding: 10px 18px 10px 0; position: relative; }
.tl-date { text-align: right; font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); padding-top: 2px; line-height: 1.35; }
.tl-mk { position: relative; }
.tl-mk::before { content: ""; position: absolute; left: 7px; top: 5px; width: 12px; height: 12px; background: var(--panel); border: 2px solid var(--ink-3); border-radius: 50%; }
.tl-servicio .tl-mk::before { background: var(--tape); border-color: var(--tape-ink); border-radius: 2px; }
.tl-solicitud .tl-mk::before { border-color: var(--warn); }
.tl-historial .tl-mk::before { width: 8px; height: 8px; left: 9px; top: 7px; background: var(--ink-3); border: 0; }
.tl-body { min-width: 0; }
.tl-body .ttl { font-weight: 600; }
.tl-body .ttl a { text-decoration: none; }
.tl-body .ttl a:hover { text-decoration: underline; }
.tl-body p { margin: 3px 0 0; color: var(--ink-2); font-size: 13.5px; white-space: pre-line; }
.tl-body .meta { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.tl-filter { display: flex; gap: 6px; flex-wrap: wrap; }

/* Detalle de registro (solicitud / servicio) */
.doc-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.doc-meta div { padding: 12px 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.doc-meta dd { margin: 3px 0 0; font-weight: 550; }
.prose { white-space: pre-line; overflow-wrap: anywhere; max-width: 75ch; }
.block-t { margin: 0 0 6px; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form select { width: auto; min-width: 180px; }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line-2); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 9px 14px; text-decoration: none; font-weight: 600; color: var(--ink-2); border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="true"] { color: var(--ink); border-bottom-color: var(--tape-2); }

details.editrow summary { list-style: none; cursor: pointer; }
details.editrow summary::-webkit-details-marker { display: none; }
details.editrow[open] { background: var(--panel-2); }

/* ------------------------------------------------------------------ login */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr); }
.login-art { background: var(--body); color: var(--body-ink); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art .brand-tape { font-size: 30px; padding: 5px 16px 4px; align-self: flex-start; }
.login-art h1 { font-size: clamp(1.8rem, 3vw, 2.6rem); max-width: 16ch; font-weight: 700; font-stretch: 78%; line-height: 1.08; color: #f4f1e8; }
.login-art p { color: var(--body-ink-2); max-width: 44ch; margin-top: 14px; }
.login-tapes { display: flex; flex-wrap: wrap; gap: 10px; max-width: 460px; }
.login-tapes .tape { font-size: 13px; transform: rotate(var(--rot, 0deg)); }
.login-form { display: grid; place-items: center; padding: 40px 24px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-size: 1.45rem; margin-bottom: 4px; }
.login-card > p { color: var(--ink-2); margin-bottom: 22px; }
.login-card .fld { margin-bottom: 14px; }
.login-card .btn { width: 100%; height: 42px; font-size: 15px; }

.err-page { max-width: 560px; margin: 8vh auto; text-align: center; padding: 0 16px; }
.err-page .tape { font-size: 20px; padding: 4px 14px; margin-bottom: 18px; }

/* ------------------------------------------------------------------ responsivo */
@media (max-width: 1180px) {
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); background: none; }
  .side {
    position: fixed; inset: 0 auto 0 0; width: min(280px, 84vw); z-index: 60;
    transform: translateX(-102%); transition: transform .28s var(--ease);
    box-shadow: 20px 0 40px -20px rgba(0,0,0,.5);
  }
  body.nav-open .side { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(20,19,15,.45); z-index: 50; }
  .topbar { padding: 10px 16px; }
  .topbar .menu-btn { display: inline-grid; }
  .content { padding: 18px 16px 80px; }
  .g-2, .g-3 { grid-template-columns: minmax(0, 1fr); }
  .fld, .fld.s3, .fld.s2 { grid-column: span 6; }
  .fld.s6, .fld.s8 { grid-column: span 12; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { padding: 28px 22px; min-height: 0; gap: 22px; }
  .login-tapes { display: none; }
}
@media (max-width: 600px) {
  h1 { font-size: 1.35rem; }
  .fld, .fld.s3, .fld.s2 { grid-column: span 12; }
  .jump { flex: 1 1 auto; }
  .jump kbd { display: none; }
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strip > div:nth-child(2n) { border-right: 0; }
  .strip > div { border-bottom: 1px solid var(--line); }
  .specs { grid-template-columns: 1fr; }
  .timeline::before { left: 20px; }
  .timeline li { grid-template-columns: 34px 1fr; padding-left: 4px; }
  .tl-date { grid-column: 2; grid-row: 1; text-align: left; }
  .tl-mk { grid-column: 1; grid-row: 1 / span 2; }
  .tl-body { grid-column: 2; }
  .tl-mk::before { left: 9px; }
  .hbars li { grid-template-columns: minmax(80px, 42%) 1fr 36px; }
  /* Tablas → filas apiladas */
  table.resp thead { display: none; }
  table.resp, table.resp tbody, table.resp tr, table.resp td { display: block; width: 100%; }
  table.resp tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  table.resp td { border: 0; padding: 2px 0; }
  table.resp td[data-l]::before { content: attr(data-l); display: inline-block; min-width: 96px; font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-stretch: 78%; color: var(--ink-3); }
  table.resp td.num { text-align: left; }
  .page-head .actions { width: 100%; }
  .form-foot { flex-wrap: wrap; }
  .form-foot .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .side, .topbar, .actions, .filters, .form-foot { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
}

/* ------------------------------------------------------------------ manual */
.mn { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px; align-items: start; }
.mn-toc { position: sticky; top: 76px; }
.mn-toc ol { list-style: none; margin: 8px 0 0; padding: 0; counter-reset: mn; }
.mn-toc li { counter-increment: mn; }
.mn-toc a { display: flex; gap: 8px; padding: 6px 10px; border-radius: var(--r-sm); text-decoration: none; color: var(--ink-2); font-size: 13.5px; }
.mn-toc a::before { content: counter(mn); font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); min-width: 16px; padding-top: 1px; }
.mn-toc a:hover { background: var(--panel-3); color: var(--ink); }
.mn-body { padding: 8px 32px 32px; }
.mn-sec { padding-top: 22px; scroll-margin-top: 76px; max-width: 78ch; }
.mn-sec + .mn-sec { border-top: 1px solid var(--line); margin-top: 18px; }
.mn-sec h2 { font-size: 1.25rem; margin-bottom: 10px; }
.mn-sec h3 { margin: 16px 0 6px; }
.mn-sec p, .mn-sec li, .mn-sec dd { color: var(--ink); line-height: 1.6; }
.mn-steps, .mn-list { margin: 6px 0 12px; padding-left: 22px; }
.mn-steps li, .mn-list li { margin-bottom: 7px; padding-left: 4px; }
.mn-steps li::marker { font-family: var(--mono); font-weight: 700; color: var(--ink-2); }
.mn-tip { background: var(--tape-soft); border: 1px solid #e8cf63; border-radius: var(--r-sm); padding: 10px 14px; }
.mn-table { margin: 8px 0 14px; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.mn-table th { position: static; }
.mn-faq dt { font-weight: 650; margin-top: 12px; }
.mn-faq dd { margin: 3px 0 0; color: var(--ink-2); }
@media (max-width: 900px) {
  .mn { grid-template-columns: minmax(0, 1fr); }
  .mn-toc { position: static; }
  .mn-toc ol { display: flex; flex-wrap: wrap; gap: 2px; }
  .mn-body { padding: 4px 18px 24px; }
}

/* Solicitud grupal: avance */
.grupal { margin-bottom: 18px; padding: 16px 18px; }
.grupal-h { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.grupal-h .v { font-size: 1.7rem; font-weight: 700; font-stretch: 80%; display: block; line-height: 1.1; }
.grupal-h .v small { font-size: 14px; font-weight: 500; color: var(--ink-3); }
.grupal-h p { flex: 1 1 360px; margin: 0; color: var(--ink-2); max-width: 75ch; }
.progress { height: 12px; background: var(--panel-3); border-radius: 3px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--tape); border-right: 1px solid #b18f0c; transition: width .4s var(--ease); }
[data-resolver][hidden], [data-grupal-note][hidden] { display: none; }

/* Manual: capturas y marcas numeradas */
.mn-fig { margin: 14px 0 12px; }
.mn-fig img { width: 100%; height: auto; border: 1px solid var(--line-2); border-radius: var(--r-sm); box-shadow: var(--shadow-2); background: var(--panel); }
.mn-fig figcaption { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }
.mn-sec:has(.mn-fig) { max-width: 960px; }
.mn-numbered { list-style: none; padding-left: 0; }
.mn-numbered li { position: relative; padding-left: 36px; }
.mn-n { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--tape); border: 1.5px solid var(--tape-ink); color: var(--tape-ink); font-weight: 700; font-size: 12.5px; font-family: var(--font); margin-right: 8px; vertical-align: -2px; }
.mn-numbered .mn-n { position: absolute; left: 0; top: 0; margin: 0; }
