/* Sistema Onix: gestión de taller de Maestranza Onix. Columna de 1180px, tarjetas sobrias, gris acero con acento naranja. */
:root {
  --bg: #F1F3F5; --surface: #FFFFFF; --surface-2: #F6F8F9; --surface-3: #E7EBEF;
  --ink: #1B252F; --muted: #55626E; --line: #D2D9E0;
  --primary: #3E4C5B; --primary-ink: #3B4855; --primary-soft: #E3E8EE; --on-primary: #FFFFFF;
  --accent: #C9581A; --accent-ink: #A4460C; --accent-soft: #FBEADF; --on-accent: #FFFFFF;
  --ok: #2D7A4C; --ok-soft: #E0F0E6; --danger: #B3392D; --danger-soft: #F8E0DC;
  --nav: #2E3944; --nav-ink: #C9D3DC;
  --shadow: 0 1px 2px rgba(20, 30, 40, .06), 0 10px 26px rgba(20, 30, 40, .09);
  --display: 'Saira Condensed', 'Arial Narrow', Arial, sans-serif;
  --body: 'Public Sans', 'Segoe UI', Arial, sans-serif;
  --mono: 'IBM Plex Mono', Consolas, 'Courier New', monospace;
  --sig-ink: #1D2A44; --paper: #FFFFFF;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10161C; --surface: #182028; --surface-2: #1C252E; --surface-3: #26313B;
    --ink: #E3E9EE; --muted: #9DABB7; --line: #2C3741;
    --primary: #A9BBCB; --primary-ink: #C9D5DF; --primary-soft: #22303C; --on-primary: #10161C;
    --accent: #EE8340; --accent-ink: #F4A26C; --accent-soft: #3A2416; --on-accent: #1A0F06;
    --ok: #63C08C; --ok-soft: #16301F; --danger: #F07B6D; --danger-soft: #3A1B18;
    --nav: #0C1217; --nav-ink: #A9B7C3;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 26px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.55 var(--body); }
h1, h2, h3, h4, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--primary-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Menú lateral: fijo a la izquierda en el computador; en el celular se abre con «Menú». */
:root { --side: 232px; }
.brand { display: flex; align-items: center; gap: 10px; color: #FFFFFF; text-decoration: none; flex: none; }
.brand img { display: block; height: 29px; width: auto; }
.brand span { font: 500 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--nav-ink); padding-left: 10px; border-left: 1px solid rgba(255, 255, 255, .25); }
.logo img { display: block; height: auto; max-width: 100%; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 50; width: var(--side); display: flex; flex-direction: column; gap: 22px; background: var(--nav); color: #FFFFFF; padding: calc(18px + env(safe-area-inset-top, 0px)) 12px calc(14px + env(safe-area-inset-bottom, 0px)); overflow-y: auto; }
.sidebar > .brand { padding: 4px 8px; }
.sidenav { display: grid; gap: 2px; }
.sidenav a { display: flex; align-items: center; gap: 12px; color: var(--nav-ink); text-decoration: none; padding: 9px 12px; border-radius: 8px; font-size: 15px; font-weight: 500; }
.sidenav a:hover { color: #FFFFFF; background: rgba(255, 255, 255, .06); }
.sidenav a.on { background: rgba(255, 255, 255, .12); color: #FFFFFF; box-shadow: inset 3px 0 0 var(--accent); }
.sidenav svg, .menu-btn svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sideuser { margin-top: auto; padding: 14px 12px 0; border-top: 1px solid rgba(255, 255, 255, .14); display: grid; gap: 6px; font-size: 14px; color: var(--nav-ink); }
.sideuser .who { color: #FFFFFF; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidelinks { display: flex; gap: 14px; flex-wrap: wrap; }
.sidelinks a, .sidelinks button { color: var(--nav-ink); background: none; border: 0; padding: 0; font-size: 14px; text-decoration: underline; }
.sidelinks a:hover, .sidelinks button:hover { color: #FFFFFF; }
.mobilebar { display: none; }
.side-scrim { display: none; }
@media (min-width: 900px) {
  body { padding-left: var(--side); }
}
@media (max-width: 899px) {
  .mobilebar { display: flex; align-items: center; gap: 14px; position: sticky; top: 0; z-index: 30; background: var(--nav); min-height: 54px; padding: env(safe-area-inset-top, 0px) clamp(14px, 3vw, 28px) 0; }
  .mobilebar .brand img { height: 25px; }
  .menu-btn { display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, .1); color: #FFFFFF; border: 0; border-radius: 8px; padding: 8px 12px; font-size: 15px; font-weight: 600; }
  .sidebar { width: min(280px, 84vw); transform: translateX(-100%); transition: transform .2s ease; box-shadow: none; }
  body.menu-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .35); }
  body.menu-open .side-scrim { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(15, 29, 51, .5); }
  body.menu-open { overflow: hidden; }
}
@media print {
  .sidebar, .mobilebar, .side-scrim { display: none !important; }
  body { padding-left: 0 !important; }
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 22px clamp(14px, 3vw, 28px) 90px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.wrap > * { min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.page-head h1 { font: 700 clamp(28px, 3.6vw, 38px)/1.08 var(--display); letter-spacing: .005em; }
.page-head p { color: var(--muted); margin-top: 4px; }
.eyebrow { font: 500 12px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--primary-ink); }
h2.section { font: 700 20px/1.25 var(--display); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.flash { border-radius: 10px; padding: 12px 16px; font-weight: 500; }
.flash.ok { background: var(--ok-soft); color: var(--ok); }
.flash.err { background: var(--danger-soft); color: var(--danger); }
.flash.warn { background: var(--accent-soft); color: var(--accent-ink); }
.flash.info { background: var(--primary-soft); color: var(--primary-ink); }
.flash ul { list-style: disc; padding-left: 20px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; display: grid; gap: 12px; min-width: 0; align-content: start; }
.card-title { font: 600 12px/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 860px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 2px; text-decoration: none; color: var(--ink); }
.kpi span { font-size: 13px; color: var(--muted); }
.kpi b { font: 700 28px/1.15 var(--display); font-variant-numeric: tabular-nums; }
a.kpi:hover { border-color: var(--primary); }
.kpi.alert { background: var(--accent-soft); border-color: transparent; }
.kpi.alert span, .kpi.alert b { color: var(--accent-ink); }
@media (max-width: 760px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 9px; padding: 10px 16px; font-weight: 600; font-size: 15px; text-decoration: none; line-height: 1.2; }
.btn.primary { background: var(--primary); color: var(--on-primary); }
.btn.secondary { background: var(--primary); color: var(--on-primary); }
.btn.ok { background: var(--ok); color: var(--surface); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1.5px var(--danger-soft); }
.btn.sm { padding: 6px 11px; font-size: 13.5px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.linklike { background: none; border: 0; padding: 0; color: var(--primary-ink); text-decoration: underline; font-size: 14px; }

/* Tablas */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { text-align: left; font: 600 11.5px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); padding: 8px 10px; white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.sub td { font-weight: 700; background: var(--surface-2); }
.tbl tr.dim td { color: var(--muted); }
.tbl td.actions-cell { white-space: nowrap; text-align: right; }

/* Pills de estado */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.st-borrador { background: var(--surface-3); color: var(--muted); }
.st-enviado { background: var(--primary-soft); color: var(--primary-ink); }
.st-observado { background: var(--accent-soft); color: var(--accent-ink); }
.st-aprobado { background: var(--ok-soft); color: var(--ok); }
.st-firmado { background: var(--ok); color: var(--surface); }
.st-late { background: var(--accent-soft); color: var(--accent-ink); }

/* Formularios */
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-3 { grid-column: 1 / -1; }
@media (max-width: 760px) { .form-grid { grid-template-columns: 1fr; } .form-grid .span-2 { grid-column: auto; } }
.field { display: grid; gap: 5px; font-size: 14px; }
.field > span { font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea, .input { width: 100%; max-width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 9px 11px; font-size: 15px; color: var(--ink); }
.field textarea { min-height: 90px; resize: vertical; }
.field small { color: var(--muted); }
.field .error, .error { color: var(--danger); font-size: 13.5px; font-weight: 600; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.input.sm { padding: 5px 8px; font-size: 14px; }
.input.num-in { width: 96px; text-align: right; font-family: var(--mono); }

.empty { padding: 26px; text-align: center; color: var(--muted); display: grid; gap: 8px; justify-items: center; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs a { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 600; }
.tabs a.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }

/* Barra de avance real vs. proyectado */
.prog { display: grid; gap: 4px; min-width: 150px; }
.prog-track { position: relative; height: 8px; background: var(--surface-3); border-radius: 4px; }
.prog-track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--primary); }
.prog-track i.over { background: var(--accent); }
.prog-track em { position: absolute; top: -3px; width: 2px; height: 14px; background: var(--ink); }
.prog small { font-size: 12.5px; color: var(--muted); }
.prog small b { color: var(--accent-ink); }
.meta { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 14px; color: var(--muted); }
.meta b { color: var(--ink); font-family: var(--mono); margin-left: 4px; }


/* Ingreso */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px 16px; }
.auth-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px; display: grid; gap: 16px; box-shadow: var(--shadow); }
.auth-card .logo { display: block; margin-bottom: 10px; }
.auth-card .logo img { width: 200px; }

/* Fotos, selección múltiple, firma, acciones fijas e historial (de SICME) */
.photo-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.photo-strip figure { position: relative; }
.photo-strip img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: var(--surface-3); }
.photo-strip .del { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(27, 37, 47, .75); color: #FFFFFF; font-size: 15px; line-height: 26px; padding: 0; }
.photo-add { aspect-ratio: 1; border: 2px dashed var(--line); border-radius: 8px; display: grid; place-content: center; text-align: center; color: var(--primary-ink); font-weight: 600; font-size: 13px; cursor: pointer; padding: 6px; }
.photo-add:focus-within { outline: 3px solid var(--accent); }
.photo-add.busy { opacity: .6; pointer-events: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 14px; background: var(--surface); }
.chips input { accent-color: var(--primary); }
.sig-box { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 8px; display: grid; gap: 4px; }
.sig-box canvas { width: 100%; height: 150px; display: block; touch-action: none; color: var(--sig-ink); cursor: crosshair; border-bottom: 1.5px solid #C3CEDB; }
.sig-foot { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: #55657A; }
.sig-foot button { border: 0; background: none; color: #55657A; text-decoration: underline; font-size: 12.5px; padding: 0; }
.sticky-actions { position: sticky; bottom: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px)); display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.sticky-actions .btn { flex: 1; }
.history { display: grid; gap: 6px; font-size: 14px; }
.history li { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px; }
.history time { font-family: var(--mono); color: var(--muted); font-size: 12.5px; }
.act-line { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.act-line:last-child { border-bottom: 0; }
.act-line small { display: block; color: var(--accent-ink); font-size: 13px; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; }
.costline { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--primary-soft); color: var(--primary-ink); font-weight: 600; }
.costline b { font: 700 20px/1.2 var(--display); font-variant-numeric: tabular-nums; }
.linkbox { display: flex; gap: 8px; flex-wrap: wrap; }
.linkbox input { flex: 1; min-width: 220px; }

.pager { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pager a, .pager span { padding: 6px 11px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; font-size: 14px; background: var(--surface); }
.pager .on { background: var(--ink); color: var(--surface); }

.dl { display: grid; grid-template-columns: minmax(110px, auto) minmax(0, 1fr); gap: 6px 14px; font-size: 14.5px; }
.dl dt { color: var(--muted); font-weight: 600; font-size: 13.5px; }
.pre { white-space: pre-line; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) { .form-grid.two { grid-template-columns: 1fr; } }

/* ===== Módulos de Onix ===== */
.cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.stack { display: grid; gap: 18px; min-width: 0; }
@media (max-width: 980px) { .cols { grid-template-columns: minmax(0, 1fr); } }
a.kpi:hover { border-color: var(--primary); }
.error { color: var(--danger); }
.btn.secondary { background: var(--primary-soft); color: var(--primary-ink); }
.btn.big { padding: 14px 22px; font-size: 17px; border-radius: 12px; min-height: 52px; }
.btn.stop { background: var(--danger); color: #FFFFFF; }

/* Alertas del panel */
.alert-item { border: 1px solid var(--line); border-left: 4px solid var(--primary); border-radius: 10px; padding: 12px 14px; display: grid; gap: 6px; background: var(--surface); }
.alert-item.crit { border-left-color: var(--danger); }
.alert-item.warn { border-left-color: var(--accent); }
.alert-item .at { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; flex-wrap: wrap; }
.alert-item p { font-size: 14px; color: var(--muted); }
.alert-item .btn { justify-self: start; }
.card > .alert-item + .alert-item { margin-top: 0; }

/* Voz del taller y avatares */
.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: 14px; background: var(--primary); color: var(--on-primary); flex: none; }
.avatar.big { width: 64px; height: 64px; font-size: 26px; }
.voice-row { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.voice-row:last-child { border-bottom: 0; }
.voice-row p { font-size: 14.5px; }

/* Etapas */
.stages { display: inline-flex; gap: 3px; align-items: center; vertical-align: middle; margin-right: 6px; }
.stages i { width: 14px; height: 6px; border-radius: 2px; background: var(--surface-3); }
.stages i.past { background: var(--primary); opacity: .55; }
.stages i.now { background: var(--accent); width: 22px; }
.stage-steps { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.stage-steps button { border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); border-radius: 8px; padding: 9px 6px; font-size: 13px; font-weight: 600; line-height: 1.2; }
.stage-steps button.past { background: var(--primary-soft); color: var(--primary-ink); border-color: transparent; }
.stage-steps button.now { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
@media (max-width: 760px) { .stage-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Candidatos (reasignar, urgencias, historial) */
.cand { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cand:last-child { border-bottom: 0; }
.cand p { font-size: 14px; }
.cand.best { background: var(--ok-soft); margin-inline: -12px; padding-inline: 12px; border-radius: 10px; border-bottom-color: transparent; }
@media (max-width: 640px) { .cand { grid-template-columns: minmax(0, 1fr); } }

/* Línea de tiempo del proyecto */
.tl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.tl { display: grid; min-width: calc(220px + var(--cols) * 34px); font-size: 12.5px; }
.tl-row { display: grid; grid-template-columns: 220px repeat(var(--cols), minmax(30px, 1fr)); align-items: center; min-height: 34px; border-bottom: 1px solid var(--line); }
.tl-row:last-child { border-bottom: 0; }
.tl-label { grid-column: 1; padding: 4px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.tl-label small { color: var(--muted); margin-left: 4px; }
.tl-head { background: var(--surface-2); font: 500 10.5px/1.1 var(--mono); color: var(--muted); }
.tl-head .tl-label { background: var(--surface-2); }
.tl-day { text-align: center; padding: 4px 0; text-transform: capitalize; }
.tl-day b { display: block; font-size: 12px; color: var(--ink); }
.tl-day.monday { border-left: 1px solid var(--line); }
.tl-day.today { background: var(--accent-soft); color: var(--accent-ink); }
.tl-day.due { box-shadow: inset 0 -3px 0 var(--danger); }
.tl-bar { grid-row: 1; height: 18px; border-radius: 4px; background: var(--primary); margin: 0 1px; }
.tl-bar.ext { background: transparent; border: 1.5px dashed var(--accent); }
.tl-bar.done { opacity: .35; }
.tl-bar.stop { background: repeating-linear-gradient(135deg, var(--primary) 0 6px, var(--danger) 6px 10px); }
.tl-bar.free { background: var(--surface-3); border: 1.5px dashed var(--muted); }

/* Planificación por persona */
.gantt-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.gantt { min-width: calc(170px + var(--cols) * 62px); font-size: 12.5px; }
.g-row { display: grid; grid-template-columns: 170px repeat(var(--cols), minmax(56px, 1fr)); row-gap: 4px; }
.g-head { background: var(--surface-2); border-bottom: 1px solid var(--line); }
.g-head > div { padding: 8px 4px; text-align: center; font: 500 11px/1.2 var(--mono); color: var(--muted); text-transform: capitalize; }
.g-head > div b { color: var(--ink); }
.g-head .g-day.today { background: var(--accent-soft); color: var(--accent-ink); }
.g-head .g-day.monday, .g-person .g-load.monday { border-left: 1px solid var(--line); }
.g-person { border-bottom: 1px solid var(--line); padding: 6px 0; }
.g-person:last-child { border-bottom: 0; }
.g-name { grid-column: 1; padding: 2px 12px; display: flex; flex-direction: column; justify-content: center; min-width: 0; position: sticky; left: 0; background: var(--surface); z-index: 2; }
.g-head .g-name { background: var(--surface-2); text-align: left; }
.g-name b { font-size: 14px; }
.g-name span { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-load { grid-row: 1; text-align: center; font: 500 10.5px/1.6 var(--mono); color: var(--muted); border-radius: 4px; margin: 0 2px; }
.g-load.full { color: var(--ink); font-weight: 600; }
.g-load.over { background: var(--danger); color: #FFFFFF; font-weight: 700; }
.g-bar { display: block; margin: 0 2px; min-height: 28px; border-radius: 6px; padding: 5px 8px; color: #FFFFFF; background: var(--c, #3E4C5B); font-size: 12px; font-weight: 600; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.35; }
.g-bar span { font-family: var(--mono); font-weight: 500; opacity: .85; margin-right: 4px; }
.g-bar:hover { filter: brightness(1.1); }
.g-bar.half { background-image: repeating-linear-gradient(135deg, transparent 0 7px, rgba(255, 255, 255, .18) 7px 10px); }
.g-bar.done { opacity: .45; text-decoration: line-through; }
.g-bar.stop { outline: 2px dashed var(--danger); outline-offset: 1px; }
.g-bar.urgent { box-shadow: inset 0 0 0 2px var(--accent); }
.pc0 { --c: #2F6FA8; } .pc1 { --c: #227366; } .pc2 { --c: #6A52A3; } .pc3 { --c: #66712A; }
.pc4 { --c: #7C5A3A; } .pc5 { --c: #3D5A80; } .pc6 { --c: #8A3F6B; } .pc7 { --c: #2E6B4E; }

/* Costeo de cotizaciones */
.item-card { scroll-margin-top: 80px; }
.tbl.costing td { padding: 6px; vertical-align: top; }
.tbl.costing select.input, .tbl.costing input.input { margin-bottom: 4px; }
.tbl.costing td:first-child { min-width: 190px; }
.tbl.costing td:nth-child(2) { min-width: 200px; }
.cost-sum { display: grid; grid-template-columns: auto auto; gap: 4px 18px; justify-content: end; font-size: 14.5px; margin: 0; }
.cost-sum dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); }
.cost-sum dt { color: var(--muted); }
.plate-calc .form-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 760px) { .plate-calc .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
fieldset[disabled] input, fieldset[disabled] select, fieldset[disabled] textarea { background: var(--surface-2); }

/* Menús en línea (movimientos, comprado, editar equipo) */
.inline-menu { display: inline-block; position: relative; }
.inline-menu > summary { list-style: none; cursor: pointer; }
.inline-menu > summary::-webkit-details-marker { display: none; }
.inline-menu[open] > summary { box-shadow: inset 0 0 0 1.5px var(--primary); }
.mini-form { display: grid; gap: 6px; padding: 10px; margin-top: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); min-width: 240px; text-align: left; position: absolute; right: 0; z-index: 20; }
details > summary.btn { list-style: none; display: inline-flex; }
details > summary.btn::-webkit-details-marker { display: none; }
.pin-show { font: 700 44px/1 var(--mono); letter-spacing: .3em; }

/* Tablet del taller */
body.kiosk { padding-left: 0; }
.kiosk-bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--nav); color: #FFFFFF; padding: calc(10px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); }
.kiosk-bar .brand img { height: 28px; }
.kiosk-clock { color: var(--nav-ink); font-size: 14px; }
.kiosk-who { margin-left: auto; font-weight: 700; font-size: 17px; }
.kiosk-out { background: rgba(255, 255, 255, .12); border: 0; color: #FFFFFF; border-radius: 10px; padding: 10px 16px; font-weight: 600; font-size: 15px; }
.kiosk-bar form:first-of-type:not(:only-child) { margin-left: 0; }
.kiosk-bar > form { margin-left: auto; }
.kiosk-bar .kiosk-who + form { margin-left: 0; }
.kiosk-main { max-width: 1040px; margin: 0 auto; padding: 22px max(16px, env(safe-area-inset-right, 0px)) 80px max(16px, env(safe-area-inset-left, 0px)); display: grid; gap: 16px; }
.kiosk-title { font: 700 clamp(30px, 4vw, 40px)/1.1 var(--display); }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.person { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.person[open] { grid-column: 1 / -1; border-color: var(--accent); }
.person > summary { list-style: none; display: grid; justify-items: center; gap: 8px; padding: 22px 12px; cursor: pointer; font-size: 18px; }
.person > summary::-webkit-details-marker { display: none; }
.person > summary small { color: var(--muted); font-size: 13px; }
.pinpad { display: grid; justify-items: center; gap: 14px; padding: 0 16px 22px; }
.pin-dots { display: flex; gap: 14px; }
.pin-dots i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--primary); }
.pin-dots i.on { background: var(--primary); }
.keys { display: grid; grid-template-columns: repeat(3, 84px); gap: 10px; }
.keys button { height: 72px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); font: 600 28px/1 var(--mono); color: var(--ink); }
.keys button:active { background: var(--primary-soft); }
.job { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: grid; gap: 14px; }
.job.running { border-color: var(--primary); box-shadow: inset 5px 0 0 var(--primary); }
.job.stopped { border-color: var(--danger); box-shadow: inset 5px 0 0 var(--danger); }
.job h2 { font: 700 clamp(24px, 3vw, 30px)/1.15 var(--display); }
.job-project { font-size: 14px; color: var(--muted); }
.job-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.job-actions form { flex: 1; min-width: 150px; }
.job-actions .btn { width: 100%; }
.job-check { display: grid; gap: 6px; }
.check-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 15px; }
.check-row .input { flex: 1; min-width: 180px; }
.cant > summary { width: 100%; justify-content: center; }
.cant-form { display: grid; gap: 12px; margin-top: 12px; padding: 14px; border-radius: 12px; background: var(--surface-2); }
.reasons { display: flex; flex-wrap: wrap; gap: 8px; }
.reasons label { position: relative; }
.reasons input { position: absolute; opacity: 0; pointer-events: none; }
.reasons span { display: block; padding: 11px 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 600; font-size: 15px; cursor: pointer; }
.reasons input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.reasons input:focus-visible + span { outline: 3px solid var(--accent); }

/* Portal de clientes */
body.portal { padding-left: 0; }
.portal-bar { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--nav); color: #FFFFFF; padding: calc(12px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px)); }
.portal-user { display: flex; gap: 14px; align-items: center; font-size: 14px; color: var(--nav-ink); }
.portal-user a, .portal-user button { color: var(--nav-ink); background: none; border: 0; padding: 0; text-decoration: underline; font-size: 14px; }
.portal-project { display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.portal-project:last-child { border-bottom: 0; }
.portal-meta { display: grid; gap: 2px; justify-items: end; text-align: right; }
.portal-meta b { font: 700 28px/1 var(--display); }
.portal-meta span { color: var(--muted); font-size: 13px; }
.track7 { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: 8px; }
.track7 div { display: grid; gap: 4px; font-size: 11px; color: var(--muted); text-align: center; line-height: 1.15; overflow-wrap: anywhere; }
.track7 i { height: 6px; border-radius: 3px; background: var(--surface-3); }
.track7 .past i { background: var(--primary); opacity: .55; }
.track7 .now i { background: var(--accent); }
.track7 .now { color: var(--ink); font-weight: 600; }
@media (max-width: 640px) { .portal-project { grid-template-columns: minmax(0, 1fr); } .portal-meta { justify-items: start; text-align: left; } }

/* Fotos con comentario */
.photo-strip figure { display: grid; gap: 4px; align-content: start; }
.caption-in { font-size: 12.5px; padding: 5px 7px; }
@media (max-width: 640px) { .tl { min-width: calc(140px + var(--cols) * 30px); } .tl-row { grid-template-columns: 140px repeat(var(--cols), minmax(26px, 1fr)); } }
