/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #eef0f3;
  --line: #dfe2e7;
  --text: #0b0c0e;
  --muted: #4d525b;
  --faint: #868b94;
  --accent: #1f5fae;
  --accent-hover: #194d8d;
  --accent-ink: #ffffff;
  --accent-soft: #e3edf9;
  --good: #1a7f37;
  --good-soft: #e5f4e9;
  --warn: #9a5b00;
  --warn-soft: #fff1d9;
  --bad: #c62828;
  --bad-soft: #fdeaea;
  --series-1: #1f5fae;
  --grid: #e6e8ec;
  --plate-band: #1d4f9c;
  --shadow: 0 1px 2px rgb(0 0 0 / .06), 0 4px 16px rgb(0 0 0 / .06);
  --radius: 12px;
  --nav-h: 64px;
  --top-h: 56px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111214;
    --surface: #191b1e;
    --surface-2: #23262a;
    --line: #32363c;
    --text: #eef0f3;
    --muted: #bfc4cc;
    --faint: #8b9099;
    --accent: #6ea4ec;
    --accent-hover: #8db8f1;
    --accent-ink: #0b1a2e;
    --accent-soft: #162a44;
    --good: #4cc26a;
    --good-soft: #15291b;
    --warn: #f0a531;
    --warn-soft: #33260f;
    --bad: #f06b6b;
    --bad-soft: #3a1718;
    --series-1: #6ea4ec;
    --grid: #2b2e33;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 4px 16px rgb(0 0 0 / .3);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111214; --surface: #191b1e; --surface-2: #23262a; --line: #32363c;
  --text: #eef0f3; --muted: #bfc4cc; --faint: #8b9099;
  --accent: #6ea4ec; --accent-hover: #8db8f1; --accent-ink: #0b1a2e; --accent-soft: #162a44;
  --good: #4cc26a; --good-soft: #15291b; --warn: #f0a531; --warn-soft: #33260f; --bad: #f06b6b; --bad-soft: #3a1718;
  --series-1: #6ea4ec; --grid: #2b2e33;
}

/* ---------- Generales ---------- */
.empty { text-align: center; color: var(--muted); padding: 32px 16px; }
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.tabs { margin-bottom: 14px; }
.tabs .badge { position: static; margin-left: 4px; }
.row.end { justify-content: flex-end; }
.stack.tight { gap: 8px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 599px) { .grid3 { grid-template-columns: 1fr 1fr; } .grid3 > :last-child { grid-column: 1 / -1; } }
input:disabled, select:disabled { opacity: .6; }
.list .item .num { white-space: nowrap; }
.kpi .value { white-space: nowrap; }
.kpi.hero .value { font-size: 26px; }
.link-row { display: flex; gap: 8px; }
.link-row input { flex: 1; }
.btn.wa { color: #128c4a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.wa { color: #4cd07d; } }
:root[data-theme="dark"] .btn.wa { color: #4cd07d; }

/* Patente: como la chapa del Mercosur (blanca con la franja azul arriba) */
.plate {
  display: inline-flex; align-items: center; flex: none; padding: 5px 7px 2px; border: 1.5px solid #1b1b1b; border-top: 5px solid var(--plate-band);
  border-radius: 5px; background: #fff; color: #111; font: 700 13px/1 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .06em;
  white-space: nowrap;
}
.plate-input { font: 700 22px/1.2 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .08em; text-transform: uppercase; max-width: 260px; }

/* ---------- Tablero del taller ---------- */
.board { display: grid; gap: 16px; }
@media (min-width: 700px) { .board { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
@media (min-width: 1150px) { .board { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.board-col h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; font-size: 16px; }
.board-col h2 .count { color: var(--faint); font-weight: 600; }
.board-col > p { margin: 0 0 8px; }
.cards-list { display: flex; flex-direction: column; gap: 8px; }
.order-card {
  display: flex; flex-direction: column; gap: 6px; text-align: left; width: 100%; cursor: pointer; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px;
}
.order-card:hover { border-color: var(--accent); }
.order-card .top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.order-card .who { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-card .num { color: var(--faint); font-size: 13px; }
.order-card .what { font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.order-card .what strong { color: var(--text); font-weight: 600; }
.order-card .bottom { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.order-card .total { margin-left: auto; font-weight: 700; white-space: nowrap; }

/* Moto: un ícono al lado de la patente */
.kind-ico { display: inline-flex; color: var(--muted); flex: none; }
.kind-ico svg { width: 20px; height: 20px; }
#vkind button svg { width: 18px; height: 18px; vertical-align: -4px; }

/* ---------- Ingreso ---------- */
.intake { max-width: 760px; }
.picked { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); }
.picked strong { margin-right: auto; }
.results-list { display: flex; flex-direction: column; gap: 4px; max-height: 300px; overflow-y: auto; }
.results-list button {
  text-align: left; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; cursor: pointer; display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.results-list button:hover { border-color: var(--accent); }
.results-list svg { width: 18px; height: 18px; }

/* ---------- Orden de trabajo ---------- */
.ot-head { flex-wrap: wrap; align-items: center; }
.ot-head h1 { margin-right: 4px; }
.ot-who { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.ot-car { display: flex; align-items: center; gap: 12px; text-align: left; background: none; border: 0; padding: 0; font: inherit; color: var(--text); cursor: pointer; }
.ot-cust { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 8px; }
.steps button {
  min-height: 44px; border-radius: 10px; border: 2px solid var(--line); background: var(--surface); color: var(--muted);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; padding: 4px; line-height: 1.15;
}
.steps button.done { border-color: var(--accent); color: var(--accent); }
.steps button.on { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.steps button:disabled { cursor: default; }
@media (max-width: 599px) { .steps { grid-template-columns: repeat(3, 1fr); } .steps button { font-size: 13px; } }
.ot-grid { display: grid; gap: 16px; margin-top: 12px; padding-bottom: 80px; }
@media (min-width: 960px) { .ot-grid { grid-template-columns: 1fr 360px; align-items: start; } }
.ot-grid h3 { margin: 4px 0 6px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.wlines { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.wline { display: grid; grid-template-columns: 1fr 70px 110px auto 34px; gap: 6px 8px; align-items: end; padding: 8px; border-radius: 10px; background: var(--surface-2); }
.wline.repuesto:has(input[data-f=unitCost]) { grid-template-columns: 1fr 70px 110px 110px auto 34px; }
.wline label { font-size: 12px; }
.wline input { min-height: 40px; padding: 6px 10px; }
.wline .sub { font-weight: 700; padding-bottom: 10px; text-align: right; min-width: 84px; white-space: nowrap; }
.wline .icon-btn { min-width: 34px; min-height: 40px; }
.wline .icon-btn svg { width: 18px; height: 18px; }
/* La mano de obra es un trabajo de la lista: se ve como texto y se toca para cambiarlo */
.job-name {
  display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; text-align: left; cursor: pointer; min-width: 0;
}
.job-name span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-name svg { width: 16px; height: 16px; color: var(--faint); flex: none; }
.job-name:hover { border-color: var(--accent); }
.job-list button { flex-wrap: nowrap; }
@media (max-width: 599px) {
  /* Descripción arriba; cantidad, precio y costo en una fila; el subtotal abajo con el botón de sacar */
  .wline, .wline.repuesto:has(input[data-f=unitCost]) { grid-template-columns: 64px 1fr 1fr 34px; }
  .wline > input[data-f=description], .wline > .job-name { grid-column: 1 / -1; }
  .wline .sub { grid-column: 1 / 4; text-align: left; padding: 0; }
}
.totals .kv { font-size: 15px; align-items: center; }
.money-in { width: 130px; min-height: 36px; padding: 4px 10px; text-align: right; }
.savebar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom)); z-index: 30;
  display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--accent); box-shadow: var(--shadow); max-width: calc(100% - 24px);
}
.savebar span { font-weight: 600; }
@media (min-width: 900px) { .savebar { bottom: 20px; } }

/* ---------- Vehículos ---------- */
.reminder { display: flex; flex-direction: column; gap: 6px; }
.reminder p { margin: 0; }
