/* Tipografía de ruedones.com: Gabarito (Google Fonts, licencia OFL), incluida en la app */
@font-face { font-family: 'Gabarito'; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url(gabarito-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Gabarito'; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url(gabarito-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Colores de marca: los mismos que www.ruedones.com */
:root {
  --brand-blue: #10309b;
  --brand-green: #9ed601;
  --bg: #f6f5f4;
  --panel: #ffffff;
  --ink: #212529;
  --muted: #5d6670;
  --line: #e3e1de;
  --accent: var(--brand-blue);
  --accent-hover: #0b2477;
  --accent-ink: #ffffff;
  --topbar: #10309b;
  --side-active-bg: #eaeefb;
  --side-line: #e3e1de;
  --ok: #4a7f00;
  --warn: #b7791f;
  --bad: #c53030;
  --ok-bg: #eef8d6;
  --warn-bg: #fdf3e1;
  --bad-bg: #fdeaea;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151d; --panel: #1b1f2a; --ink: #e6e8ee; --muted: #9aa1b0; --line: #2b3040;
    --side-active-bg: #1e2a52; --side-line: #2b3040; --topbar: #10309b;
    --accent: #7d97ff; --accent-hover: #9bb0ff; --accent-ink: #0b1430;
    --ok: #9ed601; --warn: #e0a640; --bad: #f07171;
    --ok-bg: #173327; --warn-bg: #3a2e16; --bad-bg: #3d1d1d;
    --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; font: 15px/1.45 'Gabarito', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--ink); min-height: 100vh;
}
button, input, select, textarea { font-family: inherit; }
a { color: var(--accent); }

/* Menú superior, igual que www.ruedones.com */
.topbar { background: var(--topbar); position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 10px rgba(16, 48, 155, .25); }
.tb-in { max-width: 1400px; margin: 0 auto; padding: 0 28px; height: 76px; display: flex; align-items: center; gap: 28px; }
.tb-logo { display: flex; align-items: center; flex-shrink: 0; }
.tb-logo img { height: 60px; width: auto; filter: brightness(0) invert(1); }
.tb-nav { display: flex; align-items: center; gap: 4px; height: 100%; }
.tb-nav > a, .tb-btn { color: rgba(255, 255, 255, .62); text-decoration: none; font-size: 18px; padding: 0 12px; height: 100%; display: flex; align-items: center; gap: 6px;
  background: none; border: 0; cursor: pointer; position: relative; transition: color .15s; }
.tb-nav > a:hover, .tb-btn:hover, .tb-menu:focus-within .tb-btn, .tb-menu.open .tb-btn { color: #fff; }
.tb-nav > a.active, .tb-menu.active .tb-btn { color: #fff; }
.tb-nav > a.active::after, .tb-menu.active .tb-btn::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 14px; height: 3px; border-radius: 2px; background: var(--brand-green); }
.tb-btn .caret { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 5px solid currentColor; margin-left: 2px; }
.tb-menu { position: relative; height: 100%; }
.tb-drop { display: none; position: absolute; top: calc(100% - 10px); left: 0; min-width: 240px; background: #fff; border-radius: 6.4px; padding: 8px 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
.tb-menu:hover .tb-drop, .tb-menu.open .tb-drop { display: block; }
.tb-drop a { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 18px; color: #212529; text-decoration: none; font-size: 17px; }
.tb-drop a:hover { background: #f6f5f4; }
.tb-drop a.active { color: var(--brand-blue); font-weight: 600; box-shadow: inset 3px 0 0 var(--brand-green); }
.tb-drop .tb-sep { height: 1px; background: #e3e1de; margin: 6px 0; }
.tb-der { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.tb-cta { background: var(--brand-green); color: #212529; font-weight: 600; font-size: 16px; padding: 9px 18px; border-radius: 100px; text-decoration: none; white-space: nowrap; }
.tb-cta:hover { background: #b1e51c; }
.tb-ajustes { color: rgba(255, 255, 255, .62); text-decoration: none; font-size: 18px; }
.tb-ajustes:hover, .tb-ajustes.active { color: #fff; }
.tb-burger { display: none; margin-left: auto; background: rgba(255, 255, 255, .1); color: #fff; border: 0; border-radius: 100px; width: 44px; height: 44px; font-size: 22px; cursor: pointer; }
.badge { background: var(--bad); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 7px; font-weight: 600; line-height: 18px; }
.badge.pend { background: #e08a00; }
.tb-btn .badge { font-size: 11px; }
main { padding: 26px 28px 60px; max-width: 1400px; margin: 0 auto; width: 100%; min-width: 0; }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 15px; margin: 0 0 12px; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.head .sub { color: var(--muted); margin-top: 2px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.grid { display: grid; gap: 14px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 14px; }
.kpi .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.kpi .value { font-size: clamp(18px, 1.8vw, 24px); overflow-wrap: anywhere; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .hint { color: var(--muted); font-size: 12px; }
.kpi .value small { font-size: 13px; font-weight: 600; }
a.kpi-link { color: inherit; text-decoration: none; }
a.kpi-link:hover { border-color: var(--accent); }
.kpis-main { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-bottom: 14px; }
.kpi.main { border-top: 3px solid var(--accent); }
.kpi.main .value { font-size: clamp(22px, 2.4vw, 30px); color: var(--accent); }
.kpi.main .value small { font-size: 15px; color: var(--muted); font-weight: 600; }
.two { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); margin-bottom: 14px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.link { cursor: pointer; }
tr.link:hover td { background: rgba(127,127,127,.06); }
.table-wrap { overflow-x: auto; }
.empty { color: var(--muted); padding: 18px 0; text-align: center; }
.btn { appearance: none; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 7px; padding: 7px 12px; font: inherit; cursor: pointer; text-decoration: none; display: inline-block; white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 3px 9px; font-size: 13px; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--line); color: var(--ink); white-space: nowrap; }
.pill.alta, .pill.baja-estado, .pill.abierto { background: var(--bad-bg); color: var(--bad); }
.pill.media, .pill.reparacion, .pill.revision { background: var(--warn-bg); color: var(--warn); }
.pill.montado, .pill.cerrado, .pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.bodega { background: rgba(80,120,200,.15); color: #4a73c2; }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; min-width: 70px; }
.bar > span { display: block; height: 100%; background: var(--brand-green); }
.bar.warn > span { background: var(--warn); }
.bar.bad > span { background: var(--bad); }
.muted { color: var(--muted); }
.positions { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.pos { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; background: var(--panel); display: flex; flex-direction: column; gap: 8px; }
.pos.has-alta { border-color: var(--bad); }
.pos.has-media { border-color: var(--warn); }
.pos .pos-name { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.pos .serie { font-weight: 700; font-size: 16px; }
.pos .pos-cph { font-size: 18px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1.1; }
.pos .pos-cph small { font-size: 12px; color: var(--muted); font-weight: 600; }
.pos dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0; font-size: 13px; }
.pos dt { color: var(--muted); }
.pos dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.pos.empty-pos { border-style: dashed; align-items: flex-start; justify-content: center; min-height: 140px; }
form.f { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
form.f .full, dialog .full { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; font-weight: 400; width: 100%; }
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.filters { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.filters input, .filters select { width: auto; min-width: 160px; }
dialog { border: 1px solid var(--line); border-radius: 12px; padding: 0; width: min(720px, calc(100vw - 32px)); background: var(--panel); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(10,14,20,.5); }
dialog .m-head { padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 16px; }
dialog .m-body { padding: 18px; max-height: 70vh; overflow: auto; }
dialog .m-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.eq-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); gap: 12px 20px; }
.eq-campos { display: grid; gap: 12px; align-content: start; }
.eq-insp-campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 8px; }
tr.inactivo td { opacity: .6; }
.eq-foto { display: flex; flex-direction: column; gap: 8px; }
.eq-foto-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.eq-foto-nota { font-size: 12px; }
.foto43 { aspect-ratio: 4 / 3; border: 1px dashed var(--line); border-radius: 10px; background: var(--bg); overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; text-align: center; }
.foto43 img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto43.ficha { width: 200px; border-style: solid; flex-shrink: 0; }
.eq-head { display: flex; gap: 16px; align-items: center; }
input:disabled { background: var(--bg); color: var(--muted); }
@media (max-width: 640px) {
  .eq-form { grid-template-columns: 1fr; }
  .eq-foto { order: -1; }
  .eq-head { flex-direction: column; align-items: flex-start; }
  .foto43.ficha { width: 100%; }
}
.btn.sec { background: var(--panel); color: var(--accent); border-color: var(--accent); font-weight: 600; }
.btn.sec:hover { background: var(--side-active-bg); }
.insp-comun { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.insp-tabla td { vertical-align: top; }
.insp-tabla .ref { font-size: 12px; white-space: nowrap; }
.insp-tabla input[type=text] { min-width: 160px; }
.in-num { width: 90px; text-align: right; }
.in-mal { border-color: var(--bad); background: var(--bad-bg); }
.in-aviso { border-color: var(--warn); background: var(--warn-bg); }
.insp-tabla tr.rellena > td:first-child { box-shadow: inset 3px 0 0 var(--brand-green); }
.insp-tabla tr.vacia td { background: var(--bg); }
.insp-danos .dano-row { margin-bottom: 8px; }
label.chk { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; margin-top: 8px; color: var(--ink); }
label.chk input { width: auto; }
.ok-txt { color: var(--ok); }
td.acciones-fila { white-space: nowrap; }
textarea#pegado { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
table.docs td { padding: 6px 4px; }
.fotos-danos { display: flex; flex-wrap: wrap; gap: 10px; }
.fotos-danos a { display: flex; flex-direction: column; gap: 4px; width: 120px; font-size: 12px; color: var(--muted); text-decoration: none; }
.fotos-danos img { width: 120px; height: 90px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.flota-datos { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; }
.flota-logo { display: flex; flex-direction: column; gap: 8px; }
.logo-caja { height: 140px; border: 1px dashed var(--line); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; padding: 12px; background: #fff; }
.logo-caja img { max-width: 100%; max-height: 100%; object-fit: contain; }
.flota-campos { display: flex; flex-direction: column; gap: 10px; }
.f2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.f2 .full { grid-column: 1 / -1; }
.empresa-bloque { display: flex; align-items: center; gap: 22px; margin-bottom: 14px; flex-wrap: wrap; position: relative; padding-right: 70px; }
.empresa-bloque > img { height: 64px; max-width: 200px; object-fit: contain; }
.emp-datos { display: flex; flex-direction: column; gap: 2px; min-width: 200px; }
.emp-nombre { font-size: 20px; font-weight: 700; }
.emp-resp { display: flex; flex-direction: column; gap: 2px; padding-left: 22px; border-left: 3px solid var(--brand-green); }
.emp-resp .muted { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.emp-editar { position: absolute; top: 14px; right: 16px; font-size: 13px; }
.lbl-txt { display: block; }
.inf-cliente { margin-left: auto; text-align: right; font-size: 12px; color: #5d6670; display: flex; gap: 12px; align-items: center; }
.inf-cliente img { height: 56px; max-width: 170px; object-fit: contain; }
@media (max-width: 800px) { .flota-datos { grid-template-columns: 1fr; } }
.form-sec { margin: 4px 0 -4px; font-size: 13px; color: var(--accent); border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.reparto-prev { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-top: 10px; background: var(--bg); }
table.reparto td, table.reparto th { padding: 5px 4px; font-size: 13px; text-transform: none; letter-spacing: 0; }
table.reparto th { color: var(--ink); text-align: left; }
table.reparto tr.sub td { font-weight: 700; border-top: 2px solid var(--line); }
table.reparto tr.perd td { color: var(--bad); }
.filters label { flex-direction: row; align-items: center; gap: 6px; }
.err { color: var(--bad); font-size: 13px; margin-top: 8px; min-height: 1em; }
#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(30px); background: var(--ink); color: var(--panel); padding: 10px 16px; border-radius: 8px; opacity: 0; transition: .2s; pointer-events: none; z-index: 10; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.dano-row { border: 1px solid var(--line); border-radius: 8px; padding: 10px; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; align-items: end; }
.info-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 16px; }
.info-list div span { display: block; color: var(--muted); font-size: 12px; }
.info-list div strong { font-variant-numeric: tabular-nums; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .axis { stroke: var(--line); }
.chart text { fill: var(--muted); font-size: 11px; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; }
.chart .dot { fill: var(--accent); }
.chart .limit { stroke: var(--bad); stroke-dasharray: 4 4; }
.hbar { display: grid; grid-template-columns: 140px 1fr 40px; gap: 10px; align-items: center; margin-bottom: 8px; font-size: 13px; }
.hbar .bar { height: 10px; }
.hbar .bar > span { background: var(--accent); }
img.thumb { width: 54px; height: 40px; object-fit: cover; border-radius: 5px; border: 1px solid var(--line); vertical-align: middle; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 12px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; padding: 8px 12px; font: inherit; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.tabs button.active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
/* Anillo de banda y esquema de la máquina */
.ring-fondo { fill: none; stroke: var(--line); }
.ring-arco { fill: none; stroke-linecap: round; transition: stroke-dasharray .3s; }
.ring-ok { stroke: var(--sal-verde); }
.ring-warn { stroke: var(--sal-ambar); }
.ring-bad { stroke: var(--sal-rojo); }
.ring-nd { stroke: var(--muted); }
.ring-fondo.f-bad { stroke: var(--bad-bg); }
.ring-txt.t-bad { fill: var(--bad); }
.ring-txt { text-anchor: middle; dominant-baseline: central; font-weight: 700; fill: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; }
.muted-txt { fill: var(--muted); font-size: 20px; font-weight: 400; }
.ring-libre { fill: none; stroke: var(--muted); stroke-width: 2; stroke-dasharray: 5 5; }
.ring-sel { fill: var(--panel); stroke: transparent; stroke-width: 3; }
svg.anillo { vertical-align: middle; flex-shrink: 0; }
.kpi.kpi-anillo { display: flex; gap: 12px; align-items: center; }
.maquina-cab { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.leyenda { display: flex; gap: 12px; font-size: 12px; color: var(--muted); flex-wrap: wrap; align-items: center; }
.leyenda span { display: inline-flex; align-items: center; gap: 5px; }
.lg { width: 10px; height: 10px; border-radius: 50%; display: inline-block; border: 3px solid; }
.lg.ok { border-color: var(--sal-verde); } .lg.warn { border-color: var(--sal-ambar); } .lg.bad { border-color: var(--sal-rojo); } .lg.nd { border-color: var(--muted); }
.maquina-vista { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 16px; align-items: start; }
@media (max-width: 1150px) { .maquina-vista { grid-template-columns: minmax(0, 1fr) 260px; } }
.esquema-svg { width: 100%; min-width: 300px; max-width: 540px; display: block; margin: 0 auto; height: auto; }
.esquema { overflow-x: auto; }
.esquema-svg .chasis { fill: var(--bg); stroke: var(--muted); stroke-width: 1.5; }
.esquema-svg .eje { stroke: var(--muted); stroke-width: 3; stroke-linecap: round; }
.esquema-svg .frente { text-anchor: middle; fill: var(--muted); font-size: 11px; letter-spacing: .05em; }
.esquema-svg .rueda { cursor: pointer; outline: none; }
.esquema-svg .rueda:hover .ring-sel, .esquema-svg .rueda:focus-visible .ring-sel { stroke: var(--line); fill: var(--side-active-bg); }
.esquema-svg .rueda.sel .ring-sel { stroke: var(--accent); fill: var(--side-active-bg); }
.esquema-svg .rueda-lbl { text-anchor: middle; fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.esquema-svg .rueda.sel .rueda-lbl { fill: var(--accent); font-weight: 700; }
.punto-alta { fill: var(--bad); stroke: var(--panel); stroke-width: 2; }
.punto-media { fill: #e08a00; stroke: var(--panel); stroke-width: 2; }
.pos-panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--bg); position: sticky; top: 14px; }
.pp-cab { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.pp-pos { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.pp-serie { font-size: 17px; font-weight: 700; display: block; }
.pp-cph { font-size: 22px; font-weight: 700; color: var(--accent); margin: 4px 0 8px; font-variant-numeric: tabular-nums; }
.pp-cph small { font-size: 12px; color: var(--muted); font-weight: 600; }
table.pp-datos th, table.pp-datos td { padding: 5px 0; font-size: 13px; text-transform: none; letter-spacing: 0; border-bottom: 1px solid var(--line); }
table.pp-datos th { color: var(--muted); font-weight: 400; }
table.pp-datos td { text-align: right; font-variant-numeric: tabular-nums; }
.txt-ok { color: var(--ok); font-weight: 600; } .txt-warn { color: #b26b00; font-weight: 600; } .txt-bad { color: var(--bad); font-weight: 600; } .txt-nd { color: var(--muted); }
.pp-acciones { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.pp-acciones .btn { text-align: center; }
.pp-fila { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 900px) { .maquina-vista { grid-template-columns: 1fr; } .pos-panel { position: static; } }

/* Informe mensual */
.informe { background: #fff; color: #16242f; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 32px; max-width: 1050px; }
.informe h2 { font-size: 16px; margin: 22px 0 10px; color: #10309b; border-bottom: 2px solid #9ed601; padding-bottom: 4px; }
.informe h2 small { font-weight: 400; color: #5a6b78; font-size: 12px; }
.inf-head { display: flex; gap: 20px; align-items: center; border-bottom: 3px solid #10309b; padding-bottom: 14px; }
.inf-head img { width: 170px; }
.inf-head h1 { font-size: 22px; }
.inf-head .sub { color: #5a6b78; }
.ikpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.ikpi { border: 1px solid #dfe6ec; border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; break-inside: avoid; }
.ikpi span { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: #5a6b78; }
.ikpi strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.ikpi small { font-size: 11px; color: #5a6b78; }
.itab { font-size: 12.5px; margin-top: 8px; }
.itab th, .itab td { padding: 5px 8px; border-bottom: 1px solid #dfe6ec; color: #16242f; }
.itab th { color: #5a6b78; }
.bad-txt { color: var(--bad); font-weight: 700; }
.inf-pie { margin-top: 24px; font-size: 11px; color: #5a6b78; border-top: 1px solid #dfe6ec; padding-top: 8px; }
@media print {
  @page { size: A4; margin: 12mm; }
  body { display: block; background: #fff; }
  .topbar, .no-print, #toast, dialog { display: none !important; }
  main { padding: 0; max-width: none; }
  .informe { border: 0; padding: 0; max-width: none; }
  .informe h2 { break-after: avoid; }
  .itab tr { break-inside: avoid; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
/* Menú en pantallas medianas y móvil: botón de menú que despliega las secciones */
@media (max-width: 1100px) {
  .tb-in { gap: 14px; padding: 0 16px; height: 64px; }
  .tb-logo img { height: 38px; }
  .tb-burger { display: block; }
  .tb-der { margin-left: 0; }
  .tb-der .tb-ajustes { display: none; }
  .tb-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; height: auto; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--topbar); padding: 6px 0 14px; box-shadow: 0 12px 24px rgba(0, 0, 0, .25); max-height: calc(100vh - 64px); overflow-y: auto; }
  .topbar.tb-abierto .tb-nav { display: flex; }
  .tb-nav > a, .tb-btn { height: auto; padding: 12px 20px; width: 100%; font-size: 18px; }
  .tb-nav > a.active::after, .tb-menu.active .tb-btn::after { left: 0; right: auto; top: 10px; bottom: 10px; width: 3px; height: auto; }
  .tb-menu { height: auto; }
  .tb-btn .caret { display: none; }
  .tb-drop, .tb-menu:hover .tb-drop { display: block; position: static; box-shadow: none; background: transparent; padding: 0 0 6px; min-width: 0; border-radius: 0; }
  .tb-drop a { color: rgba(255, 255, 255, .8); padding: 9px 20px 9px 38px; font-size: 16px; }
  .tb-drop a:hover { background: rgba(255, 255, 255, .08); }
  .tb-drop a.active { color: #fff; box-shadow: inset 3px 0 0 var(--brand-green); }
  .tb-drop .tb-sep { background: rgba(255, 255, 255, .15); }
  .tb-movil-solo { display: flex !important; }
}
.tb-movil-solo { display: none !important; }
@media (max-width: 560px) {
  .tb-cta { padding: 8px 12px; font-size: 14px; }
}
@media (max-width: 800px) {
  main { padding: 16px; }
  .two { grid-template-columns: 1fr; }
}

/* ---------- Plataforma: varios usuarios, talleres y flotas ---------- */
/* Sin sesión o sin flota elegida no se muestra el menú de la flota */
body.sin-sesion .tb-nav, body.sin-sesion .tb-der, body.sin-sesion .tb-burger,
body.sin-flota .tb-nav, body.sin-flota .tb-cta, body.sin-flota .tb-ajustes, body.sin-flota .tb-burger { display: none !important; }
.tb-cuenta .tb-btn { color: #fff; font-size: 16px; max-width: 260px; }
.tb-cuenta .cuenta-flota { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 1px solid rgba(255, 255, 255, .35); border-radius: 100px; padding: 6px 14px; }
.tb-cuenta .tb-drop { left: auto; right: 0; min-width: 260px; }
.tb-cuenta .tb-drop a { font-size: 16px; }
.cuenta-quien { padding: 6px 18px 4px; display: flex; flex-direction: column; color: #212529; }
.cuenta-quien span { color: #5d6670; font-size: 13px; }
@media (max-width: 1100px) {
  /* En móvil el menú de cuenta sigue siendo un desplegable, no forma parte del menú lateral */
  .tb-der .tb-cuenta .tb-drop { display: none; position: absolute; top: 100%; right: 0; left: auto; background: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
    border-radius: 6.4px; padding: 8px 0; min-width: 240px; }
  .tb-der .tb-cuenta.open .tb-drop { display: block; }
  .tb-der .tb-cuenta .tb-drop a { color: #212529; padding: 8px 18px; }
  .tb-der .tb-cuenta .tb-drop a:hover { background: #f6f5f4; }
  .tb-der .tb-cuenta .tb-drop a.active { color: var(--brand-blue); }
  .tb-der .tb-cuenta .tb-drop .tb-sep { background: #e3e1de; }
  .tb-der .tb-cuenta .tb-btn { width: auto; padding: 0; }
}
@media (max-width: 560px) {
  .tb-cuenta .tb-btn { max-width: 130px; font-size: 14px; }
  .tb-cuenta .cuenta-flota { padding: 5px 10px; }
}

.acceso { min-height: calc(100vh - 200px); display: grid; place-items: center; }
.acceso .card { width: min(420px, 100%); padding: 28px; }
.acceso h1 { margin: 0 0 6px; }
.acceso .btn.primary { width: 100%; padding: 10px; margin-top: 4px; }
.acceso-nota { font-size: 13px; margin: 16px 0 0; }
.pl-form { display: grid; gap: 12px; }
.pl-form input, .pl-form select { width: 100%; }
.inv-enlace { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }

.flotas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin-bottom: 18px; }
.flota-card { display: flex; flex-direction: column; gap: 12px; border-top: 3px solid var(--brand-blue); }
.flota-card.actual { border-top-color: var(--brand-green); }
.flota-card.inactiva { opacity: .65; border-top-color: var(--line); }
.fc-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.fc-nombre { font-size: 19px; font-weight: 700; }
.fc-coste { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.fc-coste > div { background: var(--bg); border-radius: 8px; padding: 9px 11px; display: flex; flex-direction: column; min-width: 0; }
.fc-coste span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.fc-coste b { font-size: 20px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fc-coste b small { font-size: 13px; color: var(--muted); font-weight: 600; }
.fc-coste em { font-style: normal; color: var(--muted); font-size: 12px; }
.fc-avisos { display: flex; flex-wrap: wrap; gap: 6px; }
.fc-chip { font: inherit; font-size: 13px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); border-radius: 100px; padding: 3px 10px; }
button.fc-chip { cursor: pointer; }
button.fc-chip:hover { border-color: var(--accent); color: var(--accent); }
.fc-chip b { color: var(--ink); font-variant-numeric: tabular-nums; }
.fc-chip.mal { background: var(--bad-bg); border-color: transparent; color: var(--bad); }
.fc-chip.mal b { color: var(--bad); }
.fc-pie { font-size: 12px; }
.pl-kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 14px; }
.kpi.kpi-mal .value { color: var(--bad); }
.pl-orden { display: flex; justify-content: flex-end; margin: -4px 0 8px; }
.pl-orden label.chk { margin: 0; color: var(--muted); font-size: 13px; }
.pl-orden select { width: auto; }
.fc-acc { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.pl-sec { margin-bottom: 18px; }
.pl-sec h2 { margin-top: 0; }
.pl-sec-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.pl-sec-head h2 { margin: 0; }
.pl-sub { font-size: 15px; margin: 18px 0 6px; }
td.acc { text-align: right; white-space: nowrap; }
.tb-cuenta .tb-btn::after { display: none !important; }

/* Perfil Flota: consulta, registra el contador e inspecciona. Lo demás lo hace su taller,
   así que esos botones no se muestran (el servidor también lo impide). */
body.rol-flota :is(#editar, #borrar, #nuevo, #rotar, #desmontar, #add-interv, #add-recl, #borrar-neu, #foto-quitar,
  [data-montar], [data-rotar], [data-desmontar], [data-estado], [data-del-insp], [data-del-interv], [data-edit-recl],
  [data-del-recl], [data-del-doc], [data-edit], [data-del], [data-unir], [data-config], [data-recl],
  a[href^="#/compra"], a[href="#/catalogo/importar"], [data-nav="ajustes"], .emp-editar) { display: none !important; }
/* El estado de un daño se ve, pero no se cambia */
body.rol-flota select[data-dano] { pointer-events: none; appearance: none; border-color: transparent; background: transparent; padding-left: 0; }
/* En el móvil, con el selector de flota no cabe también el botón verde: inspeccionar sigue en el menú ☰ */
@media (max-width: 560px) {
  body.plataforma .tb-cta { display: none; }
  body.plataforma .tb-cuenta .tb-btn { max-width: 170px; }
}
@media (max-width: 560px) { .pl-kpis { grid-template-columns: 1fr 1fr; } .pl-kpis .kpi { padding: 12px; } }

/* ---------- Salud de la flota (panel) ---------- */
:root { --sal-verde: #3f9b0b; --sal-ambar: #e8a317; --sal-rojo: #d03b3b; --sal-nd: #d9d6d1; }
@media (prefers-color-scheme: dark) { :root { --sal-nd: #3a3f4d; } }
.salud-flota { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 14px; margin-bottom: 14px; }
.salud-flota h2 { margin: 0; font-size: 17px; }
.sal-sub { color: var(--muted); font-size: 13px; margin: 2px 0 10px; }
.sal-leyenda { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.sal-leyenda span, .sal-lista span { display: inline-flex; align-items: center; gap: 6px; }
.sal-leyenda i, .sal-lista i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
i.sm-verde, .sm-celda.sm-verde { background: var(--sal-verde); }
i.sm-ambar, .sm-celda.sm-ambar { background: var(--sal-ambar); }
i.sm-rojo, .sm-celda.sm-rojo { background: var(--sal-rojo); }
i.sm-sin_datos, .sm-celda.sm-sin_datos { background: var(--sal-nd); }
.sm-filas { display: flex; flex-direction: column; gap: 6px; }
.sm-fila { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px; align-items: center; }
.sm-maq { color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-maq:hover { color: var(--accent); }
.sm-celdas { display: flex; flex-wrap: wrap; gap: 4px; }
.sm-celda { position: relative; width: 44px; height: 30px; border-radius: 5px; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; text-decoration: none; font-variant-numeric: tabular-nums; }
.sm-celda.sm-ambar { color: #3b2a00; }
.sm-celda.sm-sin_datos { color: var(--muted); }
.sm-celda.sm-vacia { background: transparent; border: 1px dashed var(--line); }
a.sm-celda:hover { outline: 2px solid var(--accent); outline-offset: 1px; }
.sm-celda i { position: absolute; top: -5px; right: -5px; width: 14px; height: 14px; border-radius: 50%; background: var(--panel); color: var(--sal-rojo);
  border: 1.5px solid var(--sal-rojo); font-style: normal; font-size: 10px; line-height: 11px; text-align: center; }
.sal-cuerpo { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 4px; }
.sal-fondo { fill: none; stroke: var(--sal-nd); }
.sal-arco { fill: none; }
.sal-arco.sal-verde { stroke: var(--sal-verde); } .sal-arco.sal-ambar { stroke: var(--sal-ambar); } .sal-arco.sal-rojo { stroke: var(--sal-rojo); }
.sal-nota { text-anchor: middle; font-size: 30px; font-weight: 700; fill: var(--ink); }
.sal-de { text-anchor: middle; font-size: 12px; fill: var(--muted); }
.sal-lista { display: flex; flex-direction: column; gap: 7px; font-size: 14px; }
.sal-lista b { font-variant-numeric: tabular-nums; }
.sal-estado { margin-top: 4px; padding: 3px 12px; border-radius: 100px; font-size: 13px; font-weight: 600; width: fit-content; }
.sal-e-bueno { background: var(--ok-bg); color: var(--ok); }
.sal-e-aceptable { background: var(--warn-bg); color: var(--warn); }
.sal-e-critico { background: var(--bad-bg); color: var(--bad); }
.sal-pie { font-size: 12px; margin-top: 10px; }
@media (max-width: 900px) { .salud-flota { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .sm-fila { grid-template-columns: 1fr; gap: 4px; } .sm-celda { width: 40px; } }
.fc-salud { padding: 3px 11px; border-radius: 100px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.fc-salud b { font-size: 16px; font-variant-numeric: tabular-nums; }
.lista-copias { margin: 8px 0 0; padding-left: 18px; font-size: 13px; columns: 2; } @media (max-width: 640px) { .lista-copias { columns: 1; } }
/* Registro de cambios */
.filtros-registro { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; margin-bottom: 14px; }
.filtros-registro input, .filtros-registro select { width: 100%; }
tr.reg-aviso td { background: var(--bad-bg); }
.paginas { display: flex; align-items: center; gap: 10px; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; }
td.nowrap { white-space: nowrap; }

/* Análisis por eje */
.eje-sec { margin-bottom: 14px; }
.eje-sec h2 { margin: 0; }
.eje-media { text-align: right; display: flex; flex-direction: column; }
.eje-media strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.eje-desg { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.eje-desg strong { font-variant-numeric: tabular-nums; min-width: 38px; }
.eje-barra { flex: 1; min-width: 80px; max-width: 200px; height: 10px; background: var(--bg); border-radius: 5px; overflow: hidden; display: block; }
.eje-barra i { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.eje-lados { white-space: nowrap; font-variant-numeric: tabular-nums; }
.tabla-ejes td { vertical-align: top; }
.eje-nota p { margin: 0 0 6px; font-size: 13px; }

/* ---------- Modo faena: inspección en el móvil, todo grande ---------- */
body.en-faena .tb-cta { display: none !important; }
body.en-faena main { padding-top: 10px; }
.faena { max-width: 560px; margin: 0 auto; font-size: 18px; }
.fa-top { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.fa-top h1 { margin: 0; font-size: 22px; }
.fa-salir { color: var(--accent); text-decoration: none; font-weight: 600; white-space: nowrap; padding: 8px 0; }
.fa-ayuda { color: var(--muted); font-size: 15px; margin: 4px 0 12px; }
.fa-aviso { background: var(--warn-bg); color: var(--warn); padding: 10px 12px; border-radius: 10px; font-size: 15px; }
.fa-alerta { background: var(--bad-bg); color: var(--bad); padding: 10px 12px; border-radius: 10px; font-size: 16px; font-weight: 600; }
.fa-buscar, .fa-sel, .fa-txt { width: 100%; font-size: 18px; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-family: inherit; }
.fa-maquinas { display: grid; gap: 10px; margin-top: 12px; }
.fa-maq { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 16px 18px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line);
  text-decoration: none; color: var(--ink); box-shadow: var(--shadow); min-height: 64px; }
.fa-maq:active { background: var(--side-active-bg); }
.fa-maq-cod { font-size: 22px; font-weight: 700; }
.fa-maq-tipo { grid-column: 1; color: var(--muted); font-size: 15px; }
.fa-maq-est { grid-column: 2; grid-row: 1 / 3; align-self: center; }
.fa-progreso { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.fa-progreso i { display: block; height: 100%; background: var(--brand-green); }
.fa-paso { font-size: 13px; color: var(--muted); margin: 4px 0 10px; }
.fa-titulo { font-size: 24px; margin: 6px 0; }
.fa-pos { font-size: 28px; font-weight: 700; color: var(--accent); }
.fa-serie { font-size: 20px; font-weight: 600; }
.fa-serie span { font-size: 15px; color: var(--muted); font-weight: 400; }
.fa-campo { margin: 14px 0; display: flex; flex-direction: column; gap: 6px; }
.fa-lbl { font-size: 14px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.fa-stepper { display: grid; grid-template-columns: 64px 1fr 64px; gap: 8px; }
.fa-stepper button { height: 64px; font-size: 32px; font-weight: 700; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); color: var(--accent); cursor: pointer; touch-action: manipulation; }
.fa-stepper button:active { background: var(--side-active-bg); }
.fa-num { height: 64px; font-size: 32px; font-weight: 700; text-align: center; border-radius: 14px; border: 2px solid var(--accent); background: var(--panel); color: var(--ink);
  font-variant-numeric: tabular-nums; width: 100%; min-width: 0; font-family: inherit; }
.fa-uni { font-size: 14px; color: var(--muted); text-align: center; }
.fa-link { background: none; border: 0; color: var(--accent); font: inherit; font-size: 16px; text-decoration: underline; padding: 4px 0; cursor: pointer; align-self: flex-start; }
.fa-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fa-chip { font: inherit; font-size: 16px; padding: 10px 14px; border-radius: 100px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; min-height: 44px; }
.fa-chip.sm { font-size: 14px; padding: 8px 12px; min-height: 40px; }
.fa-chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.fa-chip.sev-alta.on { background: var(--sal-rojo); border-color: var(--sal-rojo); color: #fff; }
.fa-chip.sev-media.on { background: var(--sal-ambar); border-color: var(--sal-ambar); color: #3b2a00; }
.fa-dano { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--panel); }
.fa-foto { display: flex; align-items: center; justify-content: center; min-height: 52px; border: 2px dashed var(--line); border-radius: 12px; color: var(--accent); font-weight: 600; cursor: pointer; overflow: hidden; }
.fa-foto img { width: 100%; max-height: 220px; object-fit: cover; }
.fa-pie { position: sticky; bottom: 0; display: grid; grid-template-columns: 1fr 2fr; gap: 10px; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); background: var(--bg); margin-top: 18px; }
.fa-btn { display: flex; align-items: center; justify-content: center; min-height: 58px; font: inherit; font-size: 19px; font-weight: 700; border-radius: 14px; cursor: pointer; text-decoration: none; touch-action: manipulation; }
.fa-pri { background: var(--accent); color: var(--accent-ink); border: 0; }
.fa-pri:disabled { opacity: .6; }
.fa-sec { background: var(--panel); color: var(--accent); border: 1px solid var(--accent); }
.fa-resumen { display: grid; gap: 8px; }
.fa-res { text-align: left; font: inherit; font-size: 16px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); display: flex; flex-direction: column; gap: 2px; cursor: pointer; }
.fa-res-pos { font-weight: 700; color: var(--accent); }
.fa-res-dano { color: var(--bad); font-size: 14px; }
.fa-hecho { text-align: center; display: flex; flex-direction: column; gap: 12px; padding-top: 30px; }
.fa-ok { width: 84px; height: 84px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); font-size: 48px; line-height: 84px; margin: 0 auto; }
.fa-res.sin-datos { opacity: .7; border-style: dashed; }
.fa-num::placeholder { color: var(--muted); opacity: .55; }

.aviso-ok { background: var(--ok-bg); color: var(--ok); padding: 8px 12px; border-radius: 8px; font-weight: 600; }
