/* Boket Motor — Nueva OS flow, detail drawer, toasts, drag&drop
   Loaded after shared.css. Uses the same tokens. */

/* ====================== OVERLAY / SCRIM ====================== */
.nos-scrim {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(20,24,28,0.42);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 24px;
  opacity: 0; transition: opacity .18s ease;
  overflow-y: auto;
}
.nos-scrim.in { opacity: 1; }
.nos-scrim.fs { padding: 0; align-items: stretch; background: var(--bg); backdrop-filter: none; }

/* ====================== SHARED SHELL ====================== */
.nos {
  background: var(--card);
  border: 0.5px solid var(--line-2);
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(20,24,28,0.28);
  width: 100%;
  display: flex; flex-direction: column;
  transform: translateY(8px) scale(0.99);
  transition: transform .2s cubic-bezier(.2,.7,.3,1);
  overflow: hidden;
}
.nos-scrim.in .nos { transform: none; }
.nos.modal { max-width: 560px; }
.nos.wizard { max-width: 620px; }
.nos.fs { max-width: none; border-radius: 0; border: 0; box-shadow: none; min-height: 100vh; }

/* Header */
.nos-hd {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 22px;
  border-bottom: 0.5px solid var(--line);
  flex-shrink: 0;
}
.nos-hd .tag {
  font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.12em;
  color: var(--motor); text-transform: uppercase;
}
.nos-hd h2 {
  font-family: var(--ff-serif); font-size: 22px; font-weight: 500;
  letter-spacing: -0.02em; line-height: 1.05;
}
.nos-hd h2 em { color: var(--motor); font-style: italic; }
.nos-hd .os-no {
  margin-left: auto;
  font-family: var(--ff-mono); font-size: 12px; font-weight: 600;
  color: var(--ink-2);
  background: var(--bg-soft); border: 0.5px solid var(--line);
  padding: 5px 10px; border-radius: 7px;
}
.nos-hd .x {
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--ff-mono); font-size: 15px; color: var(--ink-2);
  border: 0.5px solid var(--line-2); background: var(--card);
}
.nos-hd .x:hover { background: var(--bg-soft); color: var(--ink); }

/* Body scroll area */
.nos-body { padding: 20px 22px; overflow-y: auto; flex: 1; }
.nos.modal .nos-body { max-height: calc(100vh - 240px); }

/* Footer */
.nos-ft {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 22px;
  border-top: 0.5px solid var(--line);
  background: var(--bg-soft);
  flex-shrink: 0;
}
.nos-ft .spacer { flex: 1; }
.nos-ft .hint { font-family: var(--ff-mono); font-size: 10.5px; color: var(--ink-3); letter-spacing: 0.04em; }

/* ====================== FORM GROUPS ====================== */
.nos-group { margin-bottom: 22px; }
.nos-group:last-child { margin-bottom: 0; }
.nos-group > .gh {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
.nos-group > .gh .n {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--ink); color: var(--citron);
  font-family: var(--ff-mono); font-size: 10px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.nos-group > .gh .t {
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-2);
}
.nos-group > .gh .rule { flex: 1; height: 0.5px; background: var(--line); }

.nos-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.nos-grid.three { grid-template-columns: 1fr 1fr 1fr; }
.nos-field { display: flex; flex-direction: column; gap: 5px; }
.nos-field.full { grid-column: 1 / -1; }
.nos-field label {
  font-family: var(--ff-mono); font-size: 9.5px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-3);
  display: flex; align-items: center; gap: 6px;
}
.nos-field label .req { color: var(--st-repair); }
.nos-field input[type=text],
.nos-field input[type=date],
.nos-field input[type=time],
.nos-field input[type=number],
.nos-field textarea,
.nos-field select {
  font-family: var(--ff-sans); font-size: 13.5px;
  color: var(--ink);
  background: var(--card);
  border: 0.5px solid var(--line-2);
  border-radius: 8px;
  padding: 9px 11px;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
  width: 100%;
}
.nos-field textarea { resize: vertical; min-height: 64px; line-height: 1.4; }
.nos-field input:focus,
.nos-field textarea:focus,
.nos-field select:focus {
  border-color: var(--motor);
  box-shadow: 0 0 0 3px var(--motor-soft);
}
.nos-field input.err, .nos-field select.err, .nos-field textarea.err {
  border-color: var(--st-repair);
  box-shadow: 0 0 0 3px rgba(199,90,61,0.14);
}
.nos-field .help { font-size: 11px; color: var(--ink-3); }

/* Plate input — special */
.nos-plate-wrap { position: relative; }
.nos-plate-wrap input {
  font-family: var(--ff-mono) !important; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
}

/* Client search dropdown */
.nos-search { position: relative; }
.nos-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  background: var(--card);
  border: 0.5px solid var(--line-2);
  border-radius: 10px;
  box-shadow: 0 14px 40px rgba(20,24,28,0.18);
  z-index: 20; overflow: hidden;
  max-height: 240px; overflow-y: auto;
}
.nos-results .r {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; cursor: pointer;
  border-bottom: 0.5px solid var(--line);
}
.nos-results .r:last-child { border-bottom: 0; }
.nos-results .r:hover, .nos-results .r.sel { background: var(--bg-soft); }
.nos-results .r .av {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--motor-soft); color: var(--motor-2);
  font-family: var(--ff-mono); font-size: 10px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.nos-results .r .meta { line-height: 1.25; min-width: 0; }
.nos-results .r .meta b { font-size: 13px; font-weight: 500; }
.nos-results .r .meta small { display: block; color: var(--ink-3); font-size: 11px; font-family: var(--ff-mono); }
.nos-results .r .badge {
  margin-left: auto; flex-shrink: 0;
  font-family: var(--ff-mono); font-size: 9px; letter-spacing: 0.06em;
  padding: 2px 7px; border-radius: 999px;
  background: var(--card-2); color: var(--ink-2);
}
.nos-results .r.new { color: var(--motor); }
.nos-results .r.new .av { background: var(--ink); color: var(--citron); }

/* History pill — appears when an existing vehicle is matched */
.nos-history {
  margin-top: 10px;
  display: none;
  grid-template-columns: repeat(4, 1fr); gap: 8px;
  padding: 12px;
  background: var(--motor-soft);
  border: 0.5px solid var(--motor-glow);
  border-radius: 10px;
}
.nos-history.show { display: grid; }
.nos-history .h {
  display: flex; flex-direction: column; gap: 2px;
}
.nos-history .h .l { font-family: var(--ff-mono); font-size: 9px; letter-spacing: 0.06em; color: var(--motor-2); text-transform: uppercase; }
.nos-history .h .v { font-size: 14px; font-weight: 600; color: var(--ink); font-family: var(--ff-serif); }
.nos-history .h .v.sm { font-size: 12px; font-family: var(--ff-mono); font-weight: 500; }

/* Segmented control (tipo, etc.) */
.nos-seg { display: flex; gap: 0; border: 0.5px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.nos-seg button {
  flex: 1; padding: 9px 8px;
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.06em;
  color: var(--ink-2);
  border-right: 0.5px solid var(--line);
  transition: background .12s, color .12s;
}
.nos-seg button:last-child { border-right: 0; }
.nos-seg button.on { background: var(--ink); color: var(--citron); }
.nos-seg button:not(.on):hover { background: var(--bg-soft); }

/* Fuel slider */
.nos-fuel { display: flex; flex-direction: column; gap: 6px; }
.nos-fuel .track { display: flex; align-items: center; gap: 10px; }
.nos-fuel input[type=range] {
  -webkit-appearance: none; appearance: none;
  flex: 1; height: 6px; border-radius: 999px;
  background: var(--card-2); outline: none;
}
.nos-fuel input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--motor); border: 2px solid var(--card);
  box-shadow: 0 1px 3px rgba(0,0,0,0.25); cursor: pointer;
}
.nos-fuel input[type=range]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--motor); border: 2px solid var(--card); cursor: pointer;
}
.nos-fuel .ends { display: flex; justify-content: space-between; font-family: var(--ff-mono); font-size: 9.5px; color: var(--ink-3); letter-spacing: 0.08em; }
.nos-fuel .val { font-family: var(--ff-mono); font-size: 12px; font-weight: 600; color: var(--motor); min-width: 44px; text-align: right; }

/* Photos */
.nos-photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.nos-photo {
  aspect-ratio: 4/3;
  border-radius: 8px;
  border: 1px dashed var(--line-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  cursor: pointer; color: var(--ink-3);
  background: var(--bg-soft);
  transition: border-color .12s, color .12s;
}
.nos-photo:hover { border-color: var(--motor); color: var(--motor); }
.nos-photo .ic { font-family: var(--ff-mono); font-size: 18px; }
.nos-photo .t { font-family: var(--ff-mono); font-size: 9px; letter-spacing: 0.06em; }
.nos-photo.filled {
  border-style: solid; border-color: var(--st-ready);
  background: rgba(47,107,58,0.08); color: var(--st-ready);
}

/* Signature */
.nos-sign { display: flex; flex-direction: column; gap: 8px; }
.nos-sign canvas {
  width: 100%; height: 120px;
  border: 0.5px solid var(--line-2); border-radius: 10px;
  background: repeating-linear-gradient(135deg, var(--card) 0 11px, var(--bg-soft) 11px 12px);
  touch-action: none; cursor: crosshair;
}
.nos-sign .row { display: flex; align-items: center; gap: 12px; }
.nos-sign .clear { font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.06em; color: var(--ink-3); }
.nos-sign .clear:hover { color: var(--st-repair); }

/* Checkbox */
.nos-check { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; background: var(--bg-soft); border: 0.5px solid var(--line); border-radius: 10px; cursor: pointer; }
.nos-check input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--motor); }
.nos-check .tx { font-size: 12.5px; line-height: 1.4; color: var(--ink-2); }
.nos-check .tx b { color: var(--ink); font-weight: 600; }

/* ====================== WIZARD ====================== */
.nos-steps { display: flex; gap: 0; padding: 0 22px; border-bottom: 0.5px solid var(--line); flex-shrink: 0; }
.nos-step {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 0; margin-right: 22px;
  font-family: var(--ff-mono); font-size: 10.5px; letter-spacing: 0.06em;
  color: var(--ink-3); text-transform: uppercase;
  border-bottom: 2px solid transparent; margin-bottom: -0.5px;
}
.nos-step .dot {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--card-2); color: var(--ink-3);
  display: flex; align-items: center; justify-content: center; font-size: 9px;
}
.nos-step.done .dot { background: var(--st-ready); color: #fff; }
.nos-step.cur { color: var(--ink); border-bottom-color: var(--ink); }
.nos-step.cur .dot { background: var(--ink); color: var(--citron); }

.nos-pane { display: none; }
.nos-pane.cur { display: block; animation: nosFade .22s ease; }
@keyframes nosFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ====================== FULLSCREEN ====================== */
.nos.fs .nos-fs-grid {
  display: grid; grid-template-columns: 1fr 360px; gap: 0;
  flex: 1; min-height: 0;
}
.nos.fs .nos-fs-main { padding: 26px 40px; overflow-y: auto; }
.nos.fs .nos-fs-main .inner { max-width: 720px; margin: 0 auto; }
.nos.fs .nos-fs-side {
  border-left: 0.5px solid var(--line);
  background: var(--bg-soft);
  padding: 26px 24px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 16px;
}
.nos-fs-side .sum-card {
  background: var(--ink); color: #f4f3ef;
  border-radius: 14px; padding: 20px;
}
.nos-fs-side .sum-card .lb { font-family: var(--ff-mono); font-size: 9.5px; letter-spacing: 0.1em; color: rgba(244,243,239,0.5); text-transform: uppercase; }
.nos-fs-side .sum-card h3 { font-family: var(--ff-serif); font-size: 24px; font-weight: 500; margin-top: 4px; }
.nos-fs-side .sum-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 9px 0; border-bottom: 0.5px solid rgba(244,243,239,0.1);
  font-size: 12.5px;
}
.nos-fs-side .sum-row:last-child { border-bottom: 0; }
.nos-fs-side .sum-row .k { font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.06em; color: rgba(244,243,239,0.5); text-transform: uppercase; }
.nos-fs-side .sum-row .v { text-align: right; color: #f4f3ef; }
.nos-fs-side .sum-row .v.muted { color: rgba(244,243,239,0.4); }

/* ====================== DETAIL DRAWER ====================== */
.dtl-scrim {
  position: fixed; inset: 0; z-index: 190;
  background: rgba(20,24,28,0.38);
  opacity: 0; transition: opacity .18s ease;
  display: flex; justify-content: flex-end;
}
.dtl-scrim.in { opacity: 1; }
.dtl {
  width: 460px; max-width: 92vw; height: 100%;
  background: var(--card);
  border-left: 0.5px solid var(--line-2);
  box-shadow: -20px 0 60px rgba(20,24,28,0.22);
  display: flex; flex-direction: column;
  transform: translateX(20px); transition: transform .22s cubic-bezier(.2,.7,.3,1);
}
.dtl-scrim.in .dtl { transform: none; }
.dtl-hd { padding: 20px 22px; border-bottom: 0.5px solid var(--line); display: flex; align-items: flex-start; gap: 14px; }
.dtl-hd .x { margin-left: auto; width: 30px; height: 30px; border-radius: 8px; border: 0.5px solid var(--line-2); display: flex; align-items: center; justify-content: center; font-family: var(--ff-mono); color: var(--ink-2); }
.dtl-hd .x:hover { background: var(--bg-soft); }
.dtl-hd h2 { font-family: var(--ff-serif); font-size: 22px; font-weight: 500; letter-spacing: -0.02em; }
.dtl-hd .os-no { font-family: var(--ff-mono); font-size: 11px; color: var(--ink-3); letter-spacing: 0.06em; }
.dtl-body { flex: 1; overflow-y: auto; padding: 20px 22px; }
.dtl-sec { margin-bottom: 22px; }
.dtl-sec .sh { font-family: var(--ff-mono); font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; }
.dtl-kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px 14px; font-size: 13px; }
.dtl-kv .k { font-family: var(--ff-mono); font-size: 11px; color: var(--ink-3); letter-spacing: 0.04em; }
.dtl-kv .v { color: var(--ink); }
.dtl-flow { display: flex; flex-wrap: wrap; gap: 6px; }
.dtl-flow button {
  font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.06em;
  padding: 7px 11px; border-radius: 999px;
  border: 0.5px solid var(--line-2); color: var(--ink-2);
  background: var(--card);
}
.dtl-flow button.on { background: var(--ink); color: var(--citron); border-color: var(--ink); }
.dtl-flow button:not(.on):hover { background: var(--bg-soft); }

/* ====================== TOAST ====================== */
.nos-toasts { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.nos-toast {
  display: flex; align-items: center; gap: 12px;
  background: var(--ink); color: #f4f3ef;
  padding: 12px 18px; border-radius: 12px;
  box-shadow: 0 14px 40px rgba(20,24,28,0.3);
  font-size: 13px;
  opacity: 0; transform: translateY(10px); transition: opacity .2s, transform .2s;
}
.nos-toast.in { opacity: 1; transform: none; }
.nos-toast .d { width: 8px; height: 8px; border-radius: 50%; background: var(--citron); }
.nos-toast b { font-weight: 600; }
.nos-toast .go { margin-left: 6px; font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.06em; color: var(--citron); border: 0.5px solid rgba(220,255,77,0.4); padding: 4px 9px; border-radius: 999px; }

/* ====================== KANBAN: drag + new ====================== */
.kcard[draggable=true] { cursor: grab; }
.kcard.dragging { opacity: 0.45; cursor: grabbing; }
.kanban .col.drop-over { border-color: var(--motor); background: var(--motor-soft); }
.kanban .col .drop-hint {
  border: 1px dashed var(--motor); border-radius: 8px;
  height: 40px; display: none;
}
.kanban .col.drop-over .drop-hint { display: block; }
@keyframes newPulse {
  0% { box-shadow: 0 0 0 0 rgba(45,95,184,0.5); border-color: var(--motor); }
  100% { box-shadow: 0 0 0 14px rgba(45,95,184,0); border-color: var(--line); }
}
.kcard.is-new { animation: newPulse 1.4s ease-out 2; }
.kcard .badge-new {
  font-family: var(--ff-mono); font-size: 8px; letter-spacing: 0.08em;
  background: var(--citron); color: var(--ink);
  padding: 1px 5px; border-radius: 999px;
}

/* Empty column state */
.kanban .col .empty-col {
  font-family: var(--ff-mono); font-size: 10px; color: var(--ink-3);
  text-align: center; padding: 18px 0; letter-spacing: 0.06em;
}

body.kanban-compact .kcard { padding: 7px 9px; gap: 4px; }
body.kanban-compact .kcard .nm small { display: none; }
