@layer legado {
/* estilos/01-base-shell-partes-y-formularios.css · fichero 1/11 de la hoja HEREDADA (líneas 1-3650 del antiguo styles.css).
   Base y acceso, shell y primitivos, partes, facturas y fechas, formularios y cajones, centro de mando, listas, hojas y asistentes. Tramos internos, en este orden:
     · 01-base-y-acceso (1-322): Variables heredadas (:root), reset, pantalla de arranque, acceso (login), campos y botón base, avisos
     · 02-shell-y-primitivos (323-825): Panel de instalación, maquetación (layout), barra lateral, topbar, métricas, panel, tabla, pill, listas, vacíos
     · 03-partes (826-1714): Partes: listado en tarjetas, detalle, firma, resumen, equipos del parte, formulario compacto
     · 04-facturas-y-fechas (1715-2185): Revisión y líneas de factura, importes, resumen MACSA del mes, selector de mes y de fecha
     · 05-formularios-y-cajones (2186-2663): Edición de detalle, overlay de modal clásico, cajones (drawer), formularios a dos columnas, material del parte, responsive 980
     · 06-centro-de-mando (2664-3004): Command Center: tarjeta de usuario, puntos de sincronización, navegación, topbar, heros, status-pill
     · 07-listas-hojas-y-asistentes (3005-3650): Vista rápida en filas, selección múltiple, stepper del presupuesto, modal genérico, app-sheet, revisión fiscal, trabajo por equipo, dietas, asistentes por pasos, firma
   El orden ES la cascada: va tras css/componentes.css y antes de 02-presupuestos-y-clientes.css; no se reordena. Índice: static/styles.css. */
/* ── tramo 01-base-y-acceso (líneas 1-322 del antiguo styles.css): Variables heredadas (:root), reset, pantalla de arranque, acceso (login), campos y botón base, avisos ── */
:root {
  --typy-orange: #ff5a00;
  --typy-orange-hover: #e84f00;
  --typy-orange-soft: #fff1e8;
  --typy-orange-border: rgb(255 90 0 / 22%);
  --page-background: #fbfaf8;
  --sidebar-background: #ffffff;
  --surface: #fbfaf8;
  --surface-muted: #f6f7f8;
  --surface-warm: #fff8f2;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-muted: #746e67;   /* era #9ca3af: 2,54:1 sobre blanco. AA pide 4,5. Ahora 5,04 */
  --border-soft: rgb(17 24 39 / 8%);
  --border-medium: rgb(17 24 39 / 12%);
  --success: #22c55e;
  --success-soft: #eafbf0;
  --warning: #f59e0b;
  --warning-soft: #fff7e6;
  --danger: #ef4444;
  --danger-soft: #fef2f2;
  --info: #3b82f6;
  --info-soft: #eff6ff;
  --teal: #14b8a6;
  --teal-soft: #e6fffb;
  --brand: var(--typy-orange);
  --brand-soft: var(--typy-orange-soft);
  --brand-strong: #b84200;
  --ink: var(--text-primary);
  --muted: var(--text-secondary);
  --line: var(--border-soft);
  --panel: rgb(255 255 255 / 88%);
  --panel-solid: #ffffff;
  --panel-soft: var(--surface-warm);
  --blue: #2563eb;
  --shadow: 0 24px 70px rgb(17 24 39 / 10%);
  --soft-shadow: 0 14px 36px rgb(17 24 39 / 7%);
  --radius: 24px;
  --control-radius: 14px;
  font-family: var(--ty-fuente, Inter, ui-sans-serif, system-ui, sans-serif);
  color: var(--ink);
  background: var(--surface);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none;
}

html,
body,
.app-root {
  min-height: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, #fffaf6 0%, #fff3e9 48%, #f7eee6 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

img,
svg,
canvas {
  max-width: 100%;
}

.boot-screen {
  min-height: calc(1vh * 100);
  display: grid;
  place-items: center;
}

.boot-screen img {
  width: 132px;
  height: 132px;
  object-fit: contain;
}

.login-page {
  min-height: calc(1vh * 100);
  display: grid;
  grid-template-columns: minmax(280px, 0.88fr) minmax(320px, 1.12fr);
  background:
    linear-gradient(180deg, rgb(255 252 249 / 92%), rgb(255 242 230 / 92%)),
    var(--surface);
}

.login-brand {
  min-height: calc(1vh * 100);
  padding: 42px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--line);
  background: rgb(255 255 255 / 46%);
  color: var(--ink);
  backdrop-filter: blur(18px);
}

.brand-block {
  display: grid;
  gap: 24px;
  align-content: start;
}

.brand-logo {
  width: 118px;
  height: 118px;
  padding: 10px;
  object-fit: contain;
  background: white;
  border-radius: 28px;
}

.login-brand h1 {
  margin: 0;
  max-width: 640px;
  font-size: clamp(38px, calc(1vw * 8), 72px);
  line-height: 0.92;
  letter-spacing: 0;
}

.brand-company {
  margin: -14px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-transform: none;
}

.brand-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.brand-strip span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #f1d4bf;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--brand-strong);
  background: var(--brand-soft);
  font-weight: 800;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-box {
  width: min(100%, 420px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.login-box h2,
.section-title h2,
.drawer h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.12;
  letter-spacing: 0;
}

.login-box p,
.section-title p {
  margin: 8px 0 0;
  color: var(--muted);
}

.form-grid {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea,
.search-input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  padding: 12px 16px;
  color: var(--ink);
  background: rgb(255 255 255 / 84%);
  outline: 0;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

label,
input,
select,
textarea,
button {
  min-width: 0;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.search-input:focus {
  border-color: rgb(228 103 1 / 62%);
  box-shadow: 0 0 0 4px rgb(228 103 1 / 12%);
  background: white;
}

.field textarea {
  min-height: 116px;
  resize: vertical;
}

.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 18px;
  color: var(--ink);
  background: rgb(255 255 255 / 78%);
  text-decoration: none;
  font-weight: 800;
  box-shadow: 0 1px 0 rgb(255 255 255 / 86%) inset;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--soft-shadow);
}

.btn.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: white;
}

.btn.ghost {
  background: transparent;
}

.btn.danger {
  border-color: rgb(179 38 30 / 28%);
  color: var(--danger);
}

.btn.icon {
  width: 40px;
  padding: 0;
}

.error,
.notice {
  border-radius: var(--radius);
  padding: 12px 16px;
  font-weight: 700;
  margin-bottom: 16px;
}

.error {
  color: var(--danger);
  background: #fff1ef;
  border: 1px solid #ffd2cc;
}

.notice {
  color: #315b32;
  background: #eff8ee;
  border: 1px solid #cae7c7;
}

/* ── tramo 02-shell-y-primitivos (líneas 323-825 del antiguo styles.css): Panel de instalación, maquetación (layout), barra lateral, topbar, métricas, panel, tabla, pill, listas, vacíos ── */
.install-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid #f0c7a5;
  border-radius: 22px;
  padding: 13px 14px;
  background: #fff7f0;
}

.install-panel strong,
.install-panel span {
  display: block;
}

.install-panel strong {
  margin-bottom: 3px;
}

.install-panel span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.install-panel.installed {
  border-color: #b9ddd8;
  background: #edf8f6;
}

.install-status {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #b9ddd8;
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--teal);
  background: #edf8f6;
  font-size: 13px;
  font-weight: 900;
}

.layout {
  min-height: calc(1vh * 100);
  display: grid;
  grid-template-columns: 268px 1fr;
  background:
    linear-gradient(180deg, rgb(255 252 249 / 94%), rgb(255 243 232 / 94%)),
    var(--surface);
}

.sidebar {
  position: sticky;
  top: 0;
  min-height: calc(1vh * 100);
  padding: 22px;
  border-right: 1px solid var(--line);
  background: rgb(255 255 255 / 58%);
  color: var(--ink);
  backdrop-filter: blur(18px);
}

.sidebar-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.sidebar-head img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  padding: 6px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--soft-shadow);
}

.sidebar-title {
  display: grid;
  gap: 2px;
}

.sidebar-title strong {
  line-height: 1;
}

.sidebar-title span {
  color: var(--muted);
  font-size: 12px;
}

.sidebar-title .sidebar-context {
  color: rgb(249 250 251 / 66%);
  font-size: 12px;
  font-weight: 700;
}

.about-erpy-brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.about-erpy-brand img {
  width: 74px;
  height: 74px;
  padding: 8px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
}

.about-erpy-brand h3,
.about-erpy-brand p {
  margin: 0;
}

.about-erpy-brand p {
  margin-top: 6px;
  color: var(--muted);
}

.nav {
  display: grid;
  gap: 7px;
}

.nav button {
  min-height: 48px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 18px;
  padding: 11px 14px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  font-weight: 800;
}

.nav button.active,
.nav button:hover {
  color: var(--ink);
  border-color: #f1d4bf;
  background: var(--brand-soft);
}

.workspace {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: rgb(255 250 246 / 78%);
  backdrop-filter: blur(16px);
}

.topbar-user {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 700;
}

.mobile-view-label {
  display: none;
}

.avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--teal);
  font-weight: 900;
}

.content {
  min-width: 0;
  padding: 28px;
}

.mobile-tabbar {
  display: none;
}

.section-title {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 20px;
  padding-left: 18px;
}

.section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 6px;
  height: 44px;
  border-radius: 999px;
  background: var(--brand);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric {
  min-height: 112px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--panel);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(14px);
}

.metric span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.metric strong {
  font-size: 32px;
  line-height: 1;
  letter-spacing: 0;
}







.mini-list {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.mini-list span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.needs-attention {
  box-shadow: inset 5px 0 0 var(--brand);
  background: rgb(255 244 236 / 66%);
}

.cell-warning {
  color: var(--brand-strong);
  font-weight: 900;
}

.grid-two {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 16px;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--soft-shadow);
  overflow: hidden;
  backdrop-filter: blur(14px);
}

.panel-head {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-head h3 {
  margin: 0;
  font-size: 16px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  /* `break-word`, no `anywhere`. Las dos parten una palabra larga cuando de verdad no cabe, pero
     `anywhere` ademas encoge la anchura MINIMA de la celda, asi que la columna se cierra sobre el
     contenido y lo aplasta. Medido a 492px: la pildora «Facturado» se quedaba con 2,3px de aire a
     la derecha en vez de 10. Es el mismo fallo que partia un correo por la mitad en el directorio
     de Tecnicos con sitio de sobra al lado. */
  overflow-wrap: break-word;
}

/* Objetivo tactil (WCAG 2.5.8): un enlace suelto en una celda salia de 17px de alto. La celda ya
   tiene el sitio, asi que se le da el alto sin mover la maqueta. */
td > a:only-child,
td > a[href^="mailto:"],
td > a[href^="tel:"] {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}

.data-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: none;
  background: rgb(255 250 246 / 82%);
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table tr.selected td {
  background: rgb(255 240 227 / 72%);
}

.muted {
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 9px;
  background: #eef4f3;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

.pill.blue {
  background: #eef3f8;
  color: var(--blue);
}

.pill.orange {
  background: #fff3e9;
  color: var(--brand-strong);
}

.stack {
  display: grid;
  gap: 12px;
}

.list {
  display: grid;
}

.list-row {
  display: grid;
  gap: 6px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

.list-row:last-child {
  border-bottom: 0;
}

.list-row strong {
  line-height: 1.2;
}

/* LA SEGUNDA LINEA DE UNA FILA ES SECUNDARIA, Y TIENE QUE PARECERLO.
   `.muted` solo pone COLOR, no tamaño. Donde se ve bien es porque el contenedor le da uno (una
   celda, un `small`); dentro de `.list-row` no lo daba nadie, asi que heredaba los 16px del cuerpo
   y el correo de un tecnico salia tan grande como su nombre. Medido en el directorio de Tecnicos:
   «j.hontoria@typyspain.es» necesitaba 198px y tenia 198 justos, asi que se partia por la mitad
   («typyspai / n.es») con sitio de sobra al lado. A 13px pide 161 y entra entero.
   No es solo que quepa: un dato secundario al mismo tamaño que el titulo deja de leerse como
   secundario, y esa es la mitad de que dos pantallas parezcan software distinto. */
.list-row .muted,
.list-row small {
  font-size: 13px;
}

.empty {
  padding: 28px 16px;
  color: var(--muted);
}

.empty.compact {
  padding: 12px 0;
}


.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.top-gap {
  margin-top: 12px;
}

/* ── tramo 03-partes (líneas 826-1714 del antiguo styles.css): Partes: listado en tarjetas, detalle, firma, resumen, equipos del parte, formulario compacto ── */
.workorders-view {
  display: grid;
}

.workorder-card-list {
  display: none;
}

/* Aligerar el scroll de listas largas: el navegador omite renderizar las tarjetas fuera de
   pantalla hasta que se acercan. Solo en listas de TARJETAS (en tablas desalinearía columnas). */
.workorder-card,
.agenda-card {
  content-visibility: auto;
  contain-intrinsic-size: auto 96px;
}

.workorder-card {
  width: 100%;
  display: grid;
  gap: 7px;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 15px 16px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.workorder-card:last-child {
  border-bottom: 0;
}

.workorder-card.active,
.workorder-card:active {
  background: var(--brand-soft);
}

.workorder-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.workorder-card-head strong,
.workorder-card-client {
  line-height: 1.2;
}

.workorder-card-client {
  display: block;
  font-size: 17px;
  font-weight: 900;
}

.workorder-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.detail-panel {
  padding: 0;
  overflow: clip;
}

.detail-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
  background: rgb(255 250 246 / 72%);
}

.detail-hero h2 {
  margin: 6px 0 4px;
  font-size: 28px;
  line-height: 1.05;
  letter-spacing: 0;
}

.detail-hero p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.detail-mode-note {
  max-width: 760px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
}


.workorder-detail-anchor:focus {
  outline: 3px solid rgb(201 95 42 / 28%);
  outline-offset: 4px;
}

.workorder-number-pill {
  margin-top: 10px;
}

.workorder-action-rail {
  display: grid;
  grid-template-columns: minmax(180px, 0.75fr) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at top left, rgb(255 90 0 / 10%), transparent 34%),
    rgb(255 255 255 / 82%);
}

.workorder-action-rail strong {
  display: block;
  margin: 3px 0;
  font-size: 20px;
}

.workorder-action-rail small {
  color: var(--muted);
  font-weight: 750;
}

.detail-hero-actions {
  align-items: flex-start;
  justify-content: flex-end;
}

.workorder-action-context {
  display: grid;
  gap: 6px;
}

.workorder-action-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.workorder-action-controls {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.workorder-action-primary,
.workorder-action-secondary {
  justify-content: flex-end;
}

.workorder-tabs {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 92%);
  backdrop-filter: blur(18px);
  scrollbar-width: none;
}

.workorder-tabs::-webkit-scrollbar {
  display: none;
}

.workorder-tab-button {
  flex: 0 0 auto;
  color: var(--brand-strong);
  font: inherit;
  font-weight: 900;
  border: 1px solid var(--typy-orange-border);
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--brand-soft);
  cursor: pointer;
}

.workorder-tab-button.is-active {
  color: #fff;
  border-color: var(--brand-strong);
  background: var(--brand-strong);
  box-shadow: var(--soft-shadow);
}

.workorder-tab-panel {
  display: none;
}

.workorder-tab-panel.is-active {
  display: block;
}

/* Los paneles también llevan .detail-section (display:grid), que ganaba a `display:none` por
   orden de cascada y dejaba TODOS los paneles visibles a la vez (scroll infinito, info repetida,
   pérdida de foco). Esta regla (2 clases) gana en especificidad y oculta de verdad los inactivos. */
.workorder-tab-panel:not(.is-active) {
  display: none;
}

.workorder-readiness {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  padding: 14px;
  background: rgb(255 255 255 / 72%);
}

.workorder-readiness.warning {
  border-color: rgb(245 158 11 / 32%);
  background: var(--warning-soft);
}

.workorder-readiness.success {
  border-color: rgb(34 197 94 / 32%);
  background: var(--success-soft);
}

.workorder-readiness strong {
  display: block;
  margin: 3px 0;
}

.workorder-readiness small {
  color: var(--muted);
  font-weight: 750;
}

.workorder-readiness ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-weight: 800;
}


.workorder-history-list {
  display: grid;
  gap: 10px;
}

.workorder-history-item {
  display: grid;
  gap: 4px;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 12px;
  background: rgb(255 255 255 / 72%);
}

.workorder-history-item span,
.workorder-history-item small {
  color: var(--muted);
  font-weight: 750;
}

.inline-command {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
  margin: 10px 0 14px;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  background: rgb(255 255 255 / 68%);
}

.inline-command input,
.inline-command select,
.signature-capture input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  padding: 0 12px;
  background: #fff;
  font: inherit;
  font-weight: 750;
}

.inline-command-block {
  display: grid;
  gap: 8px;
}

.inline-hint {
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.signature-capture {
  display: grid;
  gap: 12px;
}

.signature-preview-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  background: rgb(255 255 255 / 82%);
}

.signature-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.signature-preview-head strong,
.signature-preview-head span {
  display: block;
}

.signature-preview-head span {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.signature-preview-image {
  display: block;
  width: min(100%, 680px);
  min-height: 140px;
  object-fit: contain;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  background: #fff;
}

.signature-preview-image-error {
  border-color: rgb(179 38 30 / 28%);
  background: #fff1ef;
}




.signature-pad {
  width: 100%;
  min-height: 180px;
  border: 1px dashed var(--typy-orange-border);
  border-radius: 18px;
  background: #fff;
  touch-action: none;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 80%);
}

.eyebrow {
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 900;
  text-transform: none;
}

.detail-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border-bottom: 1px solid var(--line);
  background: var(--line);
}

.detail-summary > div {
  min-height: 82px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 14px 16px;
  background: rgb(255 255 255 / 70%);
}

.detail-summary span,
.detail-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-summary strong,
.detail-row strong {
  line-height: 1.2;
}

.workorder-summary-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.85fr);
  gap: 16px;
  align-items: start;
}

.workorder-summary-grid,
.workorder-billing-snapshot {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.workorder-summary-card {
  display: grid;
  gap: 6px;
  min-width: 0;
}

/* Estado operativo: varios pills (p. ej. "Validado factura subcontrata" + "Validado subcontrata")
   deben APILARSE y envolver el texto dentro de la tarjeta, no solaparse ni desbordar sobre la
   tarjeta contigua (Rubén 3-ago: "se solapa lo de validado subcontrata y validado"). */
.wo-status-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
  min-width: 0;
}
.wo-status-pills .status-pill {
  max-width: 100%;
  white-space: normal;
  line-height: 1.25;
  text-align: left;
}

/* Contenido de las tarjetas de resumen (nombre de contacto, EMAIL largo, cliente…): romper cadenas
   largas sin espacios para que envuelvan dentro de la tarjeta y no se corten ni desborden
   (Rubén 3-ago: "contacto/firma pasa lo mismo" — email largo cortado). */
/* Las tarjetas del resumen que llevan a una pestaña se ven y se sienten pulsables. */
.workorder-summary-card.is-clickable {
  cursor: pointer;
  position: relative;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.workorder-summary-card.is-clickable:hover,
.workorder-summary-card.is-clickable:focus-visible {
  border-color: var(--typy-orange, #ff8928);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgb(0 0 0 / 18%);
}
.workorder-summary-card.is-clickable::after {
  content: "›";
  position: absolute;
  top: .5rem;
  right: .7rem;
  opacity: .45;
  font-size: 1.1rem;
  line-height: 1;
}

.workorder-summary-card > span,
.workorder-summary-card strong,
.workorder-summary-card small {
  /* break-word (no "anywhere"): envuelve en espacios y en los <wbr> de los emails; solo parte una
     palabra a mitad como ÚLTIMO recurso, que con emails ya troceados por <wbr> no llega a pasar. */
  overflow-wrap: break-word;
  min-width: 0;
}

.workorder-summary-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.workorder-summary-side {
  display: grid;
  gap: 12px;
}

.workorder-billing-compact {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.workorder-billing-compact-main,
.workorder-billing-compact-side {
  display: grid;
  gap: 12px;
}

.workorder-billing-blockers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.workorder-focus-note {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  background: rgb(255 255 255 / 78%);
}

.workorder-focus-note.warning {
  border-color: rgb(245 158 11 / 32%);
  background: var(--warning-soft);
}

.workorder-focus-note p {
  margin: 0;
  color: var(--ink);
  line-height: 1.5;
  white-space: pre-wrap;
}

.detail-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.42fr) minmax(0, 1fr);
  gap: 14px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
}

.detail-row.wide {
  background: rgb(255 250 246 / 62%);
}

.detail-section {
  display: grid;
  gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.detail-section:last-child {
  border-bottom: 0;
}

.detail-section h3 {
  margin: 0;
  font-size: 16px;
}

.detail-section p {
  margin: 0;
  color: var(--ink);
  line-height: 1.45;
  white-space: pre-wrap;
}

.equipment-ops-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.equipment-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.equipment-scope-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 14px 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgb(236 232 227 / 70%);
}

.equipment-scope-tabs button {
  min-height: 62px;
  display: grid;
  gap: 2px;
  justify-items: start;
  padding: 10px 14px;
  border: 0;
  border-radius: 14px;
  color: var(--muted);
  background: transparent;
  text-align: left;
}

.equipment-scope-tabs button strong {
  color: var(--ink);
  font-size: 15px;
}

.equipment-scope-tabs button span {
  font-size: 12px;
}

.equipment-scope-tabs button.active {
  color: var(--brand-strong);
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.equipment-scope-tabs button.active strong {
  color: var(--brand-strong);
}

.equipment-catalog-toolbar p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.equipment-product-table {
  min-width: 1220px;
}

.equipment-product-table tbody tr {
  cursor: default;
}

/* El estado vacio global usa display:grid; en una celda con colspan eso rompe el ancho de tabla. */
.equipment-product-table td.empty {
  display: table-cell;
  white-space: normal;
  text-align: center;
}

.equipment-toolbar {
  display: grid;
  gap: 10px;
  padding: 12px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgb(255 255 255 / 82%);
}

.equipment-toolbar .search-input {
  max-width: none;
}

.equipment-filter-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  background: rgb(255 255 255 / 88%);
  color: var(--muted);
  font-weight: 850;
}

.filter-chip.active,
.filter-chip:hover {
  color: var(--brand-strong);
  border-color: rgb(228 103 1 / 38%);
  background: rgb(255 242 232 / 94%);
}

.equipment-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.78fr);
  gap: 16px;
  align-items: start;
}

.equipment-table-panel,
.equipment-detail-panel {
  min-width: 0;
}

.equipment-table-wrap {
  max-height: 650px;
}

.equipment-workbench-table {
  min-width: 1060px;
}

.equipment-workbench-table tr {
  cursor: pointer;
}

.equipment-workbench-table td {
  vertical-align: middle;
}

.equipment-workbench-table td strong,
.equipment-workbench-table td span,
.equipment-workbench-table td small {
  display: block;
}

.equipment-workbench-table td small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.equipment-detail-hero {
  align-items: center;
}

.equipment-summary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.equipment-summary-grid > div {
  min-height: 70px;
}

.equipment-insight-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.equipment-insight-card {
  display: grid;
  gap: 4px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgb(255 255 255 / 72%);
}

.equipment-insight-card span,
.equipment-insight-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.equipment-insight-card strong {
  font-size: 24px;
}

.equipment-action-drawer {
  background: linear-gradient(180deg, rgb(255 250 246 / 60%), rgb(255 255 255 / 76%));
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-title-row h3,
.section-title-row p {
  margin: 0;
}

.equipment-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.equipment-action-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgb(255 255 255 / 84%);
  overflow: hidden;
}

.equipment-action-card summary {
  min-height: 50px;
  display: flex;
  align-items: center;
  padding: 12px 16px;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.equipment-action-card[open] summary {
  border-bottom: 1px solid var(--line);
  background: rgb(255 247 240 / 88%);
}

.equipment-action-card .compact-form {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.equipment-relation-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.equipment-relation-grid > article {
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgb(255 255 255 / 72%);
}

.row-actions.nowrap {
  flex-wrap: nowrap;
}

.row-actions.wrap {
  flex-wrap: wrap;
}

.compact-form {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgb(255 255 255 / 72%);
}

.compact-form h3 {
  margin-bottom: 2px;
}

@media (max-width: 860px) {
  .equipment-ops-grid {
    grid-template-columns: 1fr;
  }

  .equipment-kpi-grid,
  .equipment-workbench,
  .equipment-action-grid,
  .equipment-relation-grid,
  .equipment-insight-grid {
    grid-template-columns: 1fr;
  }

  .equipment-scope-tabs {
    grid-template-columns: 1fr;
  }
}

/* ── tramo 04-facturas-y-fechas (líneas 1715-2185 del antiguo styles.css): Revisión y líneas de factura, importes, resumen MACSA del mes, selector de mes y de fecha ── */
.review-section {
  background: linear-gradient(180deg, rgb(255 248 242 / 72%), rgb(255 255 255 / 76%));
}

.review-check-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.review-check {
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  display: grid;
  gap: 5px;
  min-height: 86px;
  padding: 13px 14px;
}

.review-check span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.review-check strong {
  line-height: 1.25;
}

.review-check.success {
  background: var(--success-soft);
  border-color: rgb(34 197 94 / 24%);
}

.review-check.warning {
  background: var(--warning-soft);
  border-color: rgb(245 158 11 / 26%);
}

.review-check.info {
  background: var(--info-soft);
  border-color: rgb(59 130 246 / 22%);
}

.review-check.neutral {
  background: var(--surface-muted);
}

.detail-list,
.line-list {
  display: grid;
}

.line-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.form-line-row {
  grid-template-columns: minmax(180px, 1.4fr) minmax(88px, 0.4fr) minmax(180px, 1fr) minmax(140px, 0.8fr);
  align-items: end;
}

.line-row:last-child {
  border-bottom: 0;
}

.line-row strong,
.line-row span {
  display: block;
}

/* Modal de factura: bloque de importes (base / IVA / total / cobrado / pendiente) */
.invoice-amounts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.invoice-amounts.secondary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

.invoice-amount {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgb(255 255 255 / 70%);
  align-content: center;
}

.invoice-amount span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: none;
}

.invoice-amount strong {
  font-size: 20px;
  line-height: 1.15;
}

.invoice-amount.total {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
}

.invoice-amount.total span {
  color: rgb(255 255 255 / 80%);
}

.invoice-amount.total strong {
  color: white;
  font-size: 24px;
}

.invoice-amount.pending strong {
  color: var(--danger, #c0392b);
}

.invoice-amount.paid strong {
  color: var(--success, #1e8e5a);
}

.invoice-tax-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.invoice-tax-breakdown span {
  white-space: nowrap;
}

/* Líneas de la factura con base / IVA / total alineados a la derecha */
.line-amounts {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
  white-space: nowrap;
}

.line-amounts span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.line-amounts strong {
  font-size: 15px;
}

@media (max-width: 640px) {
  .invoice-amounts {
    grid-template-columns: 1fr;
  }
}

/* Panel de factura MACSA del mes: contadores y aviso de otros meses con pendientes */
.macsa-month-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.macsa-month-hint {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgb(255 196 0 / 8%);
  margin-bottom: 12px;
  font-size: 13px;
}

.macsa-month-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Selector de mes con popover (rejilla de 12 meses + navegación de año) */
.month-picker-wrap {
  position: relative;
  display: grid;
  gap: 4px;
  justify-items: start;
}

.month-picker-top {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: none;
}

.month-picker-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
  justify-content: space-between;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-weight: 700;
  cursor: pointer;
}

.month-picker-trigger.is-open,
.month-picker-trigger:hover {
  border-color: var(--brand);
}

.month-picker-trigger small {
  color: var(--muted);
}

.month-picker-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.month-picker-pop {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  z-index: 41;
  width: 300px;
  max-width: calc(1vw * 86);
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 18px 48px rgb(15 23 42 / 18%);
}

.month-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.month-picker-head strong {
  font-size: 18px;
}

.month-nav {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.month-nav:hover {
  border-color: var(--brand);
}

.month-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.month-cell {
  padding: 12px 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--surface, #f4f5f7);
  font-weight: 700;
  text-transform: capitalize;
  cursor: pointer;
}

.month-cell:hover {
  border-color: var(--brand);
}

.month-cell.is-selected {
  background: var(--brand);
  color: #fff;
}

/* Date picker (día → mes → año) */
.date-field {
  position: relative;
  display: block;
}

.date-field-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-weight: 700;
  cursor: pointer;
}

.date-field-trigger:hover {
  border-color: var(--brand);
}

.date-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.date-pop {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 8px;
  z-index: 41;
  width: 320px;
  max-width: calc(1vw * 90);
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 18px 48px rgb(15 23 42 / 18%);
}

.dp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.dp-nav {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.dp-nav:hover {
  border-color: var(--brand);
}

.dp-title {
  border: 0;
  background: transparent;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  text-transform: capitalize;
}

.dp-title:hover {
  color: var(--brand);
}

.dp-grid {
  display: grid;
  gap: 6px;
}

.dp-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.dp-grid-7 {
  grid-template-columns: repeat(7, 1fr);
}

.dp-weekdays {
  margin-bottom: 4px;
}

.dp-weekday {
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.dp-cell {
  padding: 10px 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--surface, #f4f5f7);
  font-weight: 700;
  text-transform: capitalize;
  cursor: pointer;
}

.dp-day {
  background: transparent;
  padding: 9px 0;
}

.dp-cell:hover {
  border-color: var(--brand);
}

.dp-muted {
  color: var(--muted);
  opacity: 0.5;
}

.dp-cell.is-selected {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.line-qty {
  min-width: 42px;
  min-height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--brand);
  font-weight: 900;
}

.line-serials {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.line-serials span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--muted);
  background: rgb(255 255 255 / 72%);
  font-size: 12px;
  font-weight: 800;
}

/* ── tramo 05-formularios-y-cajones (líneas 2186-2663 del antiguo styles.css): Edición de detalle, overlay de modal clásico, cajones (drawer), formularios a dos columnas, material del parte, responsive 980 ── */
.detail-edit {
  align-self: start;
  position: static;
}

.detail-edit-intro {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 4px;
}

.detail-edit-intro h2 {
  margin-bottom: 6px;
}

.detail-edit-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.4;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: grid;
  align-content: start;
  align-items: start;
  justify-items: center;
  padding: max(24px, env(safe-area-inset-top, 0px)) 24px max(24px, env(safe-area-inset-bottom, 0px));
  overflow: auto;
  background: rgb(17 24 39 / 38%);
  backdrop-filter: blur(6px);
}

.modal-card {
  /* Modales amplios como el de partes: tamaño generoso por defecto para TODOS los diálogos
     centrados. Los diálogos que necesiten otro ancho lo sobrescriben (p.ej. el drawer lateral). */
  width: min(1200px, calc(1vw * 94));
  max-height: calc(calc(1vh * 100) - 48px);
  overflow: auto;
  min-width: 0;
  max-width: calc(calc(1vw * 100) - 48px);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 20px;
  background: var(--panel);
  box-shadow: var(--soft-shadow);
}





.form-actions {
  justify-content: flex-end;
}


.action-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.wide-drawer {
  margin-top: 16px;
}

.form-two,
.form-three {
  display: grid;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
}

.form-two > *,
.form-three > *,
.form-grid > *,
.modal-card > *,
.drawer > *,
.panel > * {
  min-width: 0;
}

.form-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.check-row {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  align-self: end;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.check-row input {
  /* 24x24 es el objetivo tactil de WCAG 2.5.8; con guantes no sobra nada. `flex: none` porque
     estas casillas viven en filas flex que si no las encogen por debajo de 24. Medido: 16-22px. */
  width: 24px;
  height: 24px;
  flex: none;
  accent-color: var(--ty-marca-accion);
}

.drawer {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--panel);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(14px);
}

.drawer h2 {
  margin-bottom: 14px;
}

.material-line-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  background: rgb(255 255 255 / 82%);
}

.material-line-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.workorder-equipment-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.workorder-equipment-badge {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  color: var(--text-secondary);
  background: var(--surface-muted);
  font-size: 12px;
  font-weight: 800;
}

.workorder-equipment-badge.linked {
  border-color: rgb(34 197 94 / 22%);
  color: rgb(22 101 52 / 92%);
  background: var(--success-soft);
}

.workorder-equipment-badge.manual {
  border-color: rgb(245 158 11 / 26%);
  color: rgb(154 52 18 / 96%);
  background: var(--warning-soft);
}

.workorder-equipment-advanced {
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 12px 14px 14px;
  background: rgb(255 250 246 / 58%);
}

.workorder-equipment-advanced summary {
  cursor: pointer;
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 850;
  list-style: none;
}

.workorder-equipment-advanced summary::-webkit-details-marker {
  display: none;
}

.workorder-equipment-advanced[open] summary {
  margin-bottom: 12px;
}


@media (max-width: 980px) {
  .login-page,
  .grid-two,
  .workorder-detail-grid,
  .sync-grid,
  .action-grid,
  .form-two,
  .form-three,
  .form-line-row {
    grid-template-columns: 1fr;
  }

  .layout {
    min-height: calc(1vh * 100);
    display: block;
    padding-bottom: 84px;
  }

  .login-brand {
    min-height: auto;
    padding: 28px;
    gap: 34px;
  }

  .sidebar {
    display: none;
  }


  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-edit {
    position: static;
  }

  .detail-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-tabbar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 10px;
    z-index: 30;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(72px, 1fr);
    gap: 4px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    border: 1px solid var(--line);
    border-radius: 26px;
    padding: 7px;
    background: rgb(255 255 255 / 88%);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
  }

  .mobile-tabbar button {
    min-width: 72px;
    min-height: 54px;
    display: grid;
    place-items: center;
    gap: 4px;
    border: 0;
    border-radius: 20px;
    padding: 8px 10px;
    color: var(--muted);
    background: transparent;
    font-size: 12px;
    font-weight: 900;
    text-align: center;
    white-space: nowrap;
  }

  .mobile-tabbar button.active {
    color: var(--brand-strong);
    background: var(--brand-soft);
  }

  .tab-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: transparent;
  }

  .mobile-tabbar button.active .tab-dot {
    background: var(--brand);
  }
}

@media (max-width: 620px) {
  .content,
  .topbar {
    padding: 16px;
  }

  .section-title {
    align-items: stretch;
    flex-direction: column;
  }


  .toolbar {
    justify-content: stretch;
  }

  .toolbar > * {
    flex: 1 1 160px;
  }

  .install-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .metrics,
  .office-command-grid,
  .nav {
    grid-template-columns: 1fr;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    align-items: stretch;
    min-height: 64px;
    flex-direction: row;
    background: rgb(255 250 246 / 86%);
  }


  .mobile-view-label {
    display: block;
    color: var(--ink);
    font-size: 18px;
    font-weight: 900;
  }

  .topbar .toolbar {
    flex: 0 0 auto;
    justify-content: flex-end;
  }

  .topbar .install-status,
  .topbar [data-action="install-app"],
  .topbar [data-action="logout"] {
    display: none;
  }

  .detail-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .workorder-action-rail,
  .workorder-readiness {
    grid-template-columns: 1fr;
  }

  .workorder-action-rail {
    padding: 14px 16px;
  }

  .workorder-action-controls {
    justify-items: stretch;
  }

  .workorder-action-primary,
  .workorder-action-secondary {
    justify-content: flex-start;
  }

  .workorder-tabs {
    top: 64px;
    padding: 10px 16px;
  }

  .workorder-summary-layout,
  .workorder-billing-compact,
  .workorder-summary-grid,
  .workorder-billing-snapshot,
  .detail-summary,
  .detail-row {
    grid-template-columns: 1fr;
  }

  .row-actions .btn,
  .form-actions .btn {
    flex: 1 1 100%;
  }

  .topbar .btn {
    min-height: 40px;
    width: auto;
    padding: 8px 12px;
    font-size: 13px;
  }

  .table-wrap.workorder-table-wrap {
    display: none;
  }

  .workorder-card-list {
    display: grid;
  }

  .workorders-view.detail-open .workorders-title,
  .workorders-view.detail-open .workorder-list-panel,
  .workorders-view.detail-open + .new-workorder-panel,
  .workorders-view.detail-open .empty-detail {
    display: none;
  }


  .workorder-detail-grid {
    margin-top: 0;
  }

  .detail-panel,
  .detail-edit,
  .drawer,
  .panel,
  .metric {
    border-radius: 22px;
  }

  .new-workorder-panel {
    margin-top: 14px;
  }

  .content {
    padding-bottom: 28px;
  }

  .login-panel {
    padding: 18px;
  }

  .login-box {
    padding: 20px;
  }
}

/* ── tramo 06-centro-de-mando (líneas 2664-3004 del antiguo styles.css): Command Center: tarjeta de usuario, puntos de sincronización, navegación, topbar, heros, status-pill ── */
/* Command Center refresh */
.command-layout {
  grid-template-columns: 292px minmax(0, 1fr);
  background:
    radial-gradient(circle at 84% 0%, rgb(255 90 0 / 10%), transparent 34%),
    linear-gradient(180deg, #fffdfb 0%, var(--page-background) 42%, #fff4ec 100%);
}

.command-sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 18px;
  background: rgb(255 255 255 / 84%);
}

.sidebar-user-card,
.sync-mini {
  border: 1px solid var(--border-soft);
  border-radius: 22px;
  padding: 14px;
  background: linear-gradient(180deg, #fff, var(--surface-warm));
  box-shadow: 0 14px 34px rgb(17 24 39 / 6%);
}

.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-user-card strong,
.sidebar-user-card span,
.sync-mini strong,
.sync-mini span {
  display: block;
}

.sidebar-user-card strong {
  line-height: 1.15;
}

.sidebar-user-card span,
.sync-mini span {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 750;
}

.sync-mini {
  display: grid;
  gap: 10px;
}


.sync-dot,
.status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 4px var(--success-soft);
}

.sync-dot.warning,
.status-dot.warning {
  background: var(--warning);
  box-shadow: 0 0 0 4px var(--warning-soft);
}

.sync-dot.danger,
.status-dot.danger {
  background: var(--danger);
  box-shadow: 0 0 0 4px var(--danger-soft);
}

.sync-dot.info,
.status-dot.info {
  background: var(--info);
  box-shadow: 0 0 0 4px var(--info-soft);
}

.sync-dot.offline,
.status-dot.offline,
.sync-dot.neutral,
.status-dot.neutral {
  background: #6b7280;
  box-shadow: 0 0 0 4px rgb(107 114 128 / 18%);
}

.command-nav {
  gap: 16px;
}

.nav-section {
  display: grid;
  gap: 7px;
}

.nav-section-title {
  padding: 0 10px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: none;
}

.command-nav button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  border-radius: 16px;
}

.command-nav button span {
  min-width: 0;
  flex: 1;
}

.command-nav button.active {
  color: var(--brand-strong);
  border-color: var(--typy-orange-border);
  background: linear-gradient(90deg, var(--typy-orange-soft), rgb(255 255 255 / 86%));
}

.command-nav button.active::before {
  content: "";
  width: 5px;
  height: 22px;
  margin-right: 10px;
  border-radius: 999px;
  background: var(--typy-orange);
}

.nav-badge {
  min-width: 26px;
  min-height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--brand-strong);
  background: var(--typy-orange-soft);
  font-size: 12px;
  font-weight: 950;
}

.sidebar-logout {
  margin-top: auto;
  width: 100%;
}

.command-topbar {
  position: sticky;
  top: 0;
  z-index: 18;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(260px, 0.8fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 86px;
  background: rgb(255 252 249 / 86%);
}

.topbar-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}


.topbar-kicker {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: none;
}

.topbar-title {
  color: var(--text-primary);
  font-size: 21px;
  font-weight: 900;
  line-height: 1.05;
}




.command-hero,
.sync-hero,
.personal-sync,
.command-create-card {
  border: 1px solid var(--border-soft);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 92%), rgb(255 248 242 / 88%)),
    var(--surface);
  box-shadow: var(--soft-shadow);
}

.command-hero,
.sync-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
  padding: 22px;
}

.command-hero h2,
.sync-hero h2 {
  margin: 8px 0 8px;
  font-size: clamp(26px, calc(1vw * 4), 38px);
  line-height: 1;
  letter-spacing: 0;
}

.command-hero p,
.sync-hero p {
  margin: 0;
  color: var(--text-secondary);
  font-weight: 750;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.technician-hero {
  background:
    radial-gradient(circle at 100% 0%, rgb(20 184 166 / 14%), transparent 34%),
    linear-gradient(135deg, #fff, var(--typy-orange-soft));
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--text-secondary);
  background: var(--surface-muted);
  font-size: 12px;
  font-weight: 900;
}

.status-pill.success {
  color: #15803d;
  border-color: rgb(34 197 94 / 24%);
  background: var(--success-soft);
}

.status-pill.warning {
  color: #a16207;
  border-color: rgb(245 158 11 / 24%);
  background: var(--warning-soft);
}

.status-pill.danger {
  color: #b91c1c;
  border-color: rgb(239 68 68 / 24%);
  background: var(--danger-soft);
}

.status-pill.info {
  color: #1d4ed8;
  border-color: rgb(59 130 246 / 24%);
  background: var(--info-soft);
}

.status-pill.offline,
.status-pill.neutral {
  color: #4b5563;
  border-color: rgb(107 114 128 / 24%);
  background: rgb(243 244 246 / 86%);
}

.metric {
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.metric:hover,
.panel:hover {
  border-color: var(--border-medium);
}

.metric:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.data-table tbody tr {
  transition: background 0.14s ease;
}

.data-table tbody tr:hover td {
  background: rgb(255 248 242 / 72%);
}

/* ── tramo 07-listas-hojas-y-asistentes (líneas 3005-3650 del antiguo styles.css): Vista rápida en filas, selección múltiple, stepper del presupuesto, modal genérico, app-sheet, revisión fiscal, trabajo por equipo, dietas, asistentes por pasos, firma ── */
/* Filas con vista rápida: clic en la fila abre el pop-up (los botones internos siguen funcionando). */
.data-table tbody tr[data-action="quick-view"],
.agenda-card[data-action="quick-view"] {
  cursor: pointer;
}
.data-table tbody tr[data-action="quick-view"]:hover td {
  background: rgb(0 122 255 / 8%);
}

/* Selección múltiple en listas (checkbox + barra de acciones en lote) */
.select-col {
  width: 40px;
  text-align: center;
  cursor: pointer;
}
/* Desde el 22-oct-2026 la casilla es un <button role="checkbox"> (ver dominio-vistas.js): se quita
   el relleno y la altura mínima que los botones heredan, para que mida lo mismo que el <span> de antes. */
.row-select {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  min-height: 0;
  padding: 0;
  cursor: pointer;
  border-radius: 6px;
  border: 1.5px solid var(--border, #cdd2db);
  background: #fff;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}
.row-select.on {
  background: #007aff;
  border-color: #007aff;
}
.list-bulk-bar {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 14px;
  padding: 10px 16px;
  background: rgb(0 122 255 / 10%);
  border: 1px solid rgb(0 122 255 / 26%);
  border-radius: 14px;
  backdrop-filter: saturate(140%) blur(6px);
}
.list-bulk-count {
  font-weight: 650;
}
.list-bulk-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Stepper del presupuesto: estado del ciclo de vida siempre visible */
.quote-stepper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 4px;
  margin: 0 0 12px;
}
.quote-step {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: #9aa0a8;
}
.quote-step:not(:last-child)::after {
  content: "";
  width: 16px;
  height: 2px;
  background: currentColor;
  opacity: 0.4;
  margin: 0 6px;
}
.quote-step-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.quote-flow-actions { margin-bottom: 6px; }
.quote-flow-actions .btn { font-weight: 600; }
.quote-more { margin-top: 8px; }
.quote-more > summary {
  cursor: pointer;
  font-size: 13px;
  color: #8a8f98;
  list-style: none;
  padding: 4px 2px;
  user-select: none;
}
.quote-more > summary::-webkit-details-marker { display: none; }
.quote-more > summary::before { content: "⋯ "; font-weight: 700; }
.quote-more[open] > summary::before { content: "▾ "; }

/* Modal genérico (confirmación / selector) */


@keyframes appModalIn {
  from { transform: translateY(10px) scale(0.98); opacity: 0; }
  to { transform: none; opacity: 1; }
}




/* ── Modal ancho genérico (patrón acordado con Rubén: overlay con blur + tarjeta grande + ✕
   redondo + body con scroll + barra de acciones abajo). Reutilizable: modal fiscal, visita de
   agenda, etc. Mismo look que el detalle de pedido/parte pero con nombres neutros. ── */
.app-sheet-overlay {
  position: fixed; inset: 0; z-index: 1300;
  background: rgba(17, 20, 26, .52);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: clamp(20px, calc(1vh * 5), 64px) clamp(16px, calc(1vw * 3), 40px); overflow-y: auto;
  animation: appSheetFade .16s ease;
}
.app-sheet {
  position: relative; width: min(1040px, calc(1vw * 94));
  background: #fff; border-radius: 22px;
  box-shadow: 0 28px 90px -24px rgba(17, 20, 26, .55);
  overflow: hidden; display: flex; flex-direction: column; max-height: calc(1vh * 92);
  animation: appSheetRise .22s cubic-bezier(.22,.61,.36,1);
}
@keyframes appSheetFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes appSheetRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .app-sheet-overlay, .app-sheet { animation: none; } }
.app-sheet-close {
  position: absolute; top: 16px; right: 16px; z-index: 3;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid #e2e5ea; background: #f4f5f7; color: #4a4f57;
  font-size: 16px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: .15s;
}
.app-sheet-close:hover { background: var(--danger, #ef4444); color: #fff; border-color: transparent; transform: rotate(90deg); }
.app-sheet-head { padding: 24px 64px 16px 28px; border-bottom: 1px solid #eef0f3; }
.app-sheet-head .section-kicker { display: block; font-size: 12px; text-transform: none; color: #9aa0a6; font-weight: 700; }
.app-sheet-head strong, .app-sheet-head h2 { display: block; font-size: 22px; font-weight: 800; margin: 3px 0 0; }
.app-sheet-head p { margin: 6px 0 0; font-size: 13.5px; color: #6b7280; line-height: 1.45; }
.app-sheet-body { padding: 20px 28px; overflow-y: auto; flex: 1 1 auto; }
.app-sheet-actions {
  display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px;
  padding: 16px 28px; border-top: 1px solid #eef0f3; background: #fafbfc;
}
.fiscal-review-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.fiscal-review-meta span { font-size: 12px; font-weight: 600; color: #4a4f57; background: #f2f4f7; border-radius: 999px; padding: 3px 10px; }
.fiscal-review-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 640px) { .fiscal-review-rows { grid-template-columns: 1fr; } }
.fiscal-review-row {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid #e6e8ec;
  border-radius: 12px;
  background: #fbfcfd;
  cursor: pointer;
}
.fiscal-review-row.has-value { background: #fff8f1; border-color: #f6d9b8; }
.fiscal-review-row .fiscal-review-check { width: 18px; height: 18px; margin-top: 2px; accent-color: #ff8928; }
.fiscal-review-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fiscal-review-label { font-weight: 700; font-size: 13px; }
.fiscal-review-overwrite { color: #c2410c; font-style: normal; font-weight: 600; font-size: 12px; }
.fiscal-review-current { font-size: 12px; color: #8a9099; overflow-wrap: anywhere; }
.fiscal-review-suggested { font-size: 13px; color: #1f2430; overflow-wrap: anywhere; }
.fiscal-review-sources { margin-top: 14px; display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.fiscal-review-sources strong { font-size: 12px; text-transform: none; color: #9aa0a6; }
.fiscal-review-sources a { color: #2563eb; }








/* Grupo de checkboxes (type:"checks"), p. ej. dietas por comida */
/* Trabajo por equipo (parte multivisita): una tarjeta por equipo con sus intervenciones por
   fecha, FUERA de la tabla de días (que antes se ensanchaba y se cortaba). */
.wo-equipment-work {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.wo-equipment-work > .eyebrow {
  display: block;
}
.wo-equipment-work-card {
  border: 1px solid var(--hairline, #e6e8ea);
  border-radius: 12px;
  overflow: hidden;
}
.wo-equipment-work-title {
  font-weight: 700;
  font-size: 13px;
  padding: 9px 14px;
  background: rgba(0, 0, 0, 0.03);
  border-bottom: 1px solid var(--hairline, #e6e8ea);
}
.wo-equipment-work-card .table-wrap {
  border: 0;
  border-radius: 0;
}
.wo-equipment-work-table td.nowrap,
.data-table td.nowrap {
  white-space: nowrap;
}
.wo-equipment-work-table td {
  vertical-align: top;
}

/* Resumen "Dietas por fecha" en el panel de días del parte multivisita */
.wo-diet-by-date {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.03);
}
.wo-diet-by-date .eyebrow {
  display: block;
  margin-bottom: 6px;
}
.diet-by-date-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 3px;
  font-size: 14px;
}

.command-create-card {
  margin: 0 0 18px;
  padding: 22px;
}

.form-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.form-hero h2 {
  margin: 6px 0;
  font-size: 26px;
}

.form-hero p {
  margin: 0;
  color: var(--text-secondary);
  font-weight: 750;
}

.form-section {
  display: grid;
  gap: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 22px;
  padding: 16px;
  background: rgb(255 255 255 / 70%);
}

.form-section h3 {
  margin: 0;
  font-size: 16px;
}

.form-section p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
}

.command-bar {
  position: sticky;
  bottom: 18px;
  z-index: 4;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border: 1px solid var(--typy-orange-border);
  border-radius: 999px;
  padding: 10px;
  background: rgb(255 255 255 / 88%);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(18px);
}

.workorder-flow-nav {
  position: sticky;
  top: 88px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 8px;
  margin: 14px 0 18px;
  background: rgb(255 255 255 / 88%);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(18px);
}

.flow-step {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 8px 12px 8px 8px;
  color: var(--text-secondary);
  background: transparent;
  font-weight: 900;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease;
}

.flow-step span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--brand-strong);
  background: var(--typy-orange-soft);
  font-size: 12px;
}

.flow-step.active,
.flow-step:hover {
  border-color: var(--typy-orange-border);
  color: var(--brand-strong);
  background: white;
  transform: translateY(-1px);
}

/* Asistente guiado del presupuesto (mismo patrón que el de partes). La barra de pasos vive dentro
   de un modal de tema OSCURO pero con fondo claro → texto oscuro para que se lea (Rubén 31-jul:
   "me gusta el concepto de guiado que hicimos para los partes"). Sticky pegado al alto del modal. */
.quote-flow-nav {
  top: 6px;
}
.quote-flow-nav .flow-step {
  color: #5a6072;
}
.quote-flow-nav .flow-step.active,
.quote-flow-nav .flow-step:hover {
  color: var(--brand-strong);
}
.quote-step-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

/* "Editar parte" multidía: tarjetas de día grandes y legibles + chips de equipo de solo lectura
   (Rubén 3-ago: rehacer el modal para que sea intuitivo — un solo sitio por día, sin duplicados). */
.wo-day-cards {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}
.wo-day-cards .btn {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  white-space: normal;
  line-height: 1.45;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 800;
}
.wo-equip-readonly {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.wo-equip-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid var(--border-soft, rgba(255, 255, 255, 0.14));
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary, #eef1f8);
  font-weight: 700;
  font-size: 13px;
}

.contract-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  padding: 5px;
  background: rgb(255 255 255 / 70%);
}

.type-choice {
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
}

.assistance-choice {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.choice-pill {
  position: relative;
  width: 100%;
  min-height: 42px;
  display: grid;
  place-items: center;
  appearance: none;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 9px 10px;
  font: inherit;
  color: var(--text-secondary);
  background: transparent;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  cursor: pointer;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease;
}

.choice-pill:hover {
  border-color: var(--border-medium);
  color: var(--text-primary);
  background: rgb(255 255 255 / 72%);
}

.choice-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-pill.active {
  border-color: var(--typy-orange-border);
  color: var(--brand-strong);
  background: var(--typy-orange-soft);
  box-shadow: 0 10px 24px rgb(255 90 0 / 10%);
}

.workorder-hours-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  border: 1px solid var(--typy-orange-border);
  border-radius: 20px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgb(255 90 0 / 10%), rgb(255 255 255 / 80%)),
    var(--typy-orange-soft);
}

.workorder-hours-summary span {
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgb(255 90 0 / 12%);
  border-radius: 14px;
  color: var(--brand-strong);
  background: rgb(255 255 255 / 74%);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.signature-pad {
  display: grid;
  gap: 12px;
  border: 1px solid var(--typy-orange-border);
  border-radius: 22px;
  padding: 16px;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 88%), rgb(255 90 0 / 6%)),
    white;
  box-shadow: var(--soft-shadow);
}

.signature-canvas {
  width: 100%;
  min-height: 220px;
  display: block;
  border: 1px dashed rgb(255 90 0 / 28%);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 96%), rgb(255 248 242 / 98%));
  touch-action: none;
  cursor: crosshair;
}

.signature-canvas.is-signed {
  border-style: solid;
  border-color: var(--typy-orange-border);
}

.signature-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.signature-status {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-secondary);
}

.calculated-field input {
  color: var(--brand-strong);
  background: var(--typy-orange-soft);
  font-weight: 900;
}

.field input:disabled,
.field select:disabled,
.field textarea:disabled {
  color: var(--text-muted);
  background: var(--surface-muted);
}


.section-pulse {
  animation: sectionPulse 0.72s ease;
}

@keyframes sectionPulse {
  0% {
    box-shadow: 0 0 0 0 rgb(255 90 0 / 24%);
  }
  100% {
    box-shadow: 0 0 0 18px rgb(255 90 0 / 0%);
  }
}

.collapsible-list-card {
  margin-top: 16px;
}

.collapsible-list-card > summary,
.collapsible-summary {
  list-style: none;
}

.collapsible-list-card > summary::-webkit-details-marker,
.collapsible-summary::-webkit-details-marker {
  display: none;
}

.collapsible-summary {
  min-height: 62px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
}

.collapsible-summary strong {
  display: block;
  font-size: 17px;
}

.collapsible-summary span:not(.pill) {
  display: block;
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 750;
}

.workorders-view {
  gap: 0;
}

.workorders-view.detail-open .workorder-detail-grid {
  margin-bottom: 16px;
}
}

@layer utilidades {
  [hidden] { display: none; }
}
