/* =========================================================================
   Tec-11 · Gestión interna — estilos
   ========================================================================= */
:root {
  --bg:        #1a1a1a;
  --bg-2:      #262626;
  --panel:     #ffffff;
  --ink:       #14181f;
  --ink-soft:  #6b7280;
  --line:      #e6e9ef;
  --line-2:    #f0f2f6;
  --brand:     #5bb85a;
  --brand-d:   #459a44;
  --accent:    #5bb85a;
  --ok:        #2a9d54;
  --warn:      #e08a00;
  --danger:    #d64545;
  --danger-bg: #fdecec;
  --radius:    14px;
  --shadow:    0 1px 2px rgba(20,24,31,.04), 0 6px 22px rgba(20,24,31,.06);
  --shadow-sm: 0 1px 2px rgba(20,24,31,.06);
  --font: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: #f4f6fa;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.hidden { display: none !important; }

/* ---------- Botones ---------- */
.btn {
  font-family: inherit; font-weight: 600; font-size: 14px;
  border: none; border-radius: 10px; padding: 10px 16px; cursor: pointer;
  transition: transform .06s ease, background .15s ease, box-shadow .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--brand); color: #fff; box-shadow: 0 2px 9px rgba(91,184,90,.32); }
.btn--primary:hover { background: var(--brand-d); }
.btn--ghost { background: transparent; color: #cfe7ef; border: 1px solid rgba(255,255,255,.25); }
.btn--ghost:hover { background: rgba(255,255,255,.08); }
.btn--sm { padding: 7px 12px; font-size: 13px; }
.linkbtn {
  background: none; border: none; color: var(--ink-soft); font-family: inherit;
  font-size: 12.5px; cursor: pointer; text-decoration: underline; padding: 2px 4px;
}
.linkbtn:hover { color: var(--ink); }
.linkbtn--danger { color: var(--danger); }

/* ---------- Login ---------- */
.login {
  position: fixed; inset: 0; display: grid; place-items: center;
  background: radial-gradient(1200px 600px at 50% -10%, #2e2e2e 0%, var(--bg) 60%);
  padding: 20px;
}
.login__card {
  background: var(--panel); width: min(360px, 92vw); border-radius: 20px;
  padding: 36px 30px; box-shadow: var(--shadow); text-align: center;
  display: flex; flex-direction: column; gap: 14px;
}
.login__img { display: block; width: 240px; max-width: 78%; height: auto; margin: 4px auto 2px; }
.login__sub { margin: 10px 0 6px; color: var(--ink-soft); font-size: 14px; }
.login__pin {
  font-family: inherit; font-size: 18px; text-align: center; letter-spacing: 6px;
  padding: 14px; border: 1.5px solid var(--line); border-radius: 12px; outline: none;
}
.login__pin:focus { border-color: var(--brand); }
.login__inp {
  font-family: inherit; font-size: 15px; padding: 13px 14px;
  border: 1.5px solid var(--line); border-radius: 12px; outline: none;
}
.login__inp:focus { border-color: var(--brand); }
.login__btn { width: 100%; padding: 13px; font-size: 15px; }
.login__err { color: var(--danger); font-size: 13px; min-height: 16px; margin: 0; }

/* ---------- App layout ---------- */
.app { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  display: flex; align-items: center; gap: 18px;
  background: var(--bg); color: #fff; padding: 0 20px; height: 62px;
  position: sticky; top: 0; z-index: 20;
  box-shadow: inset 0 -1px 0 rgba(255,255,255,.07), 0 2px 14px rgba(0,0,0,.14);
}
.topbar__logo { height: 36px; width: auto; display: block; }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.sync { color: var(--ok); font-size: 12px; }
.userinfo { color: #c3c8cc; font-size: 12.5px; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) { .userinfo { display: none; } }

.tabs { display: flex; gap: 4px; }
.tab {
  background: transparent; border: none; color: #aebeca; font-family: inherit;
  font-weight: 600; font-size: 14px; padding: 8px 15px; border-radius: 9px; cursor: pointer;
  letter-spacing: -.01em; transition: color .15s ease, background .15s ease;
}
.tab:hover { color: #fff; background: rgba(255,255,255,.07); }
.tab--active { color: #fff; background: var(--brand); box-shadow: 0 2px 9px rgba(91,184,90,.4); }

.main { flex: 1; padding: 24px; max-width: 1240px; width: 100%; margin: 0 auto; }
.view { display: none; }
.view--active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.viewhead {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px;
}
.subtabs { display: flex; gap: 4px; background: #e9edf3; padding: 4px; border-radius: 12px; }
.subtab {
  border: none; background: transparent; font-family: inherit; font-weight: 600;
  font-size: 13.5px; color: var(--ink-soft); padding: 8px 14px; border-radius: 9px; cursor: pointer;
  transition: color .12s ease, background .12s ease;
}
.subtab:hover { color: var(--ink); }
.subtab--active { background: #fff; color: var(--brand-d); box-shadow: var(--shadow-sm); }
.search {
  flex: 1; min-width: 200px; font-family: inherit; font-size: 14px;
  padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 11px; outline: none; background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search:focus { border-color: var(--brand); box-shadow: 0 0 0 3.5px rgba(91,184,90,.15); }

/* ---------- Tarjetas / tablas ---------- */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.tablewrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
.grid th, .grid td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.grid thead th {
  background: #f6f9fb; font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink-soft); position: sticky; top: 0; z-index: 5;
}
.grid tbody tr:hover { background: #f8fbfd; }
.grid td.modelo { font-weight: 600; }

/* contadores +/- de stock */
.stepper { display: inline-flex; align-items: center; gap: 8px; }
.stepper button {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; font-size: 17px; font-weight: 700; color: var(--ink); cursor: pointer; line-height: 1;
}
.stepper button:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.stepper .qty { min-width: 26px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.qty--zero { color: var(--danger); }
.qty--low  { color: var(--warn); }

.chip {
  display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
}

/* muestras de color en cabecera de Tapas */
.thcolor { text-align: center; }
.swatch {
  display: block; width: 18px; height: 18px; border-radius: 50%; margin: 0 auto;
  border: 1px solid rgba(0,0,0,.18); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25);
}
.swname { display: block; font-size: 10px; margin-top: 4px; font-weight: 600; color: var(--ink-soft); text-transform: none; letter-spacing: 0; }

/* Stock: cabecera fija al hacer scroll + columna Modelo fija + tinte por color */
.tablewrap--stock { max-height: 72vh; overflow: auto; }
.tablewrap--stock .grid thead th { top: 0; }
.tablewrap--stock .grid td.modelo,
.tablewrap--stock .grid thead th:first-child { position: sticky; left: 0; background: #fff; z-index: 4; }
.tablewrap--stock .grid thead th:first-child { background: #f6f9fb; z-index: 6; }
.tapacol { padding: 8px 6px; }
.chip--zero { background: var(--danger-bg); color: var(--danger); }
.chip--ok   { background: #e7f6ee; color: var(--ok); }
.chip--pend { background: #fff3e0; color: var(--warn); }

/* leyenda de tipos de encargo */
.leyenda { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.legchip {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  border: 1.5px solid var(--line); background: #fff; border-radius: 999px;
  padding: 6px 12px; font-family: inherit; font-size: 13px; font-weight: 600; color: var(--ink);
}
.legchip:hover { background: #f6f9fb; }
.legchip--all { --c: #1a1a1a; }
.legdot { width: 11px; height: 11px; border-radius: 50%; background: var(--c); flex: none; }
.legn { font-size: 11px; color: var(--ink-soft); background: #eef2f6; border-radius: 999px; padding: 1px 7px; }
.legchip--on { border-color: var(--c); box-shadow: inset 0 0 0 1px var(--c); }
.legchip--on .legn { background: var(--c); color: #fff; }

.tipochip {
  display: inline-block; margin-top: 5px; font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}

/* ---------- Calendario de encargos ---------- */
.cal { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.cal__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cal__title { font-size: 17px; font-weight: 700; min-width: 160px; text-align: center; }
.calnav {
  width: 34px; height: 34px; border: 1px solid var(--line); background: #fff;
  border-radius: 9px; font-size: 18px; cursor: pointer; color: var(--ink); line-height: 1;
}
.calnav:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.calnav--today { width: auto; padding: 0 14px; font-size: 13px; font-weight: 600; margin-left: auto; }
.cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal__wdrow { margin-bottom: 6px; }
.cal__wd {
  text-align: center; font-size: 12px; font-weight: 700; color: var(--ink-soft);
  text-transform: uppercase; letter-spacing: .03em; padding: 4px 0;
}
.cal__day {
  position: relative;
  min-height: 94px; border: 1px solid var(--line-2); border-radius: 10px; padding: 5px;
  display: flex; flex-direction: column; gap: 3px; cursor: pointer; background: #fff; overflow: hidden;
}
.cal__day:hover { border-color: var(--brand); background: #fbfdfb; }
.cal__day--empty { background: transparent; border: none; cursor: default; }
.cal__day--today { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.cal__num { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.cal__day--today .cal__num { color: var(--brand-d); }
.calchip {
  display: block; background: var(--c); color: #fff; font-size: 11px; font-weight: 600;
  padding: 2px 7px; border-radius: 6px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; cursor: pointer;
}
.calchip--done { opacity: .5; text-decoration: line-through; }
.cal__more { font-size: 11px; color: var(--ink-soft); font-weight: 600; cursor: pointer; padding: 1px 4px; }
.cal__more:hover { color: var(--brand-d); }

/* Cupo de citas por día (máximo diario) */
.cal__cupo { position: absolute; top: 5px; right: 6px; font-size: 9.5px; font-weight: 700;
  color: var(--muted); background: #eef1f5; border-radius: 20px; padding: 1px 6px; letter-spacing: .02em; }
.cal__cupo--full { color: #fff; background: var(--danger); }
.cal__day--full { background: #fdf1f1; border-color: #f0c9c9; cursor: not-allowed; }
.daymcupo { font-size: 12.5px; font-weight: 600; color: var(--brand-d); background: #eaf6ec;
  border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; }
.daymcupo--full { color: var(--danger); background: #fbeaea; }
.sinfecha { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin-top: 16px; }
.sinfecha__h { font-weight: 700; font-size: 14px; margin-bottom: 10px; }
.sinfecha__hint { font-weight: 400; font-size: 12px; color: var(--ink-soft); }
.sinfecha__list { display: flex; flex-wrap: wrap; gap: 7px; }
.sinfecha__list .calchip { display: inline-block; }
.daymlist { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow: auto; margin-bottom: 4px; }
.daymrow { padding: 9px 11px; border-radius: 9px; background: #f8fafc; cursor: pointer; }
.daymrow:hover { background: #eef3f7; }
.daymrow__top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 3px; }
@media (max-width: 640px) {
  .cal__day { min-height: 66px; }
  .calchip { font-size: 10px; padding: 1px 5px; }
  .cal__wd { font-size: 10px; }
}

/* tabla de encargos */
.grid--citas td { vertical-align: top; }
/* la lista cabe en la página: el texto se ajusta por palabras, sin scroll lateral */
.grid--citas th, .grid--citas td { white-space: normal; }
.grid--citas td.fechas, .grid--citas .rowacts, .grid--citas td.contacto { white-space: nowrap; }
.grid--citas td.contacto { overflow-wrap: normal; }
.grid--citas .wrap { max-width: none; overflow-wrap: break-word; }
.grid--citas td { overflow-wrap: break-word; }
.grid--citas td a { color: var(--brand-d); text-decoration: none; font-weight: 600; }
.grid--citas td.wrap { white-space: normal; max-width: 320px; line-height: 1.35; color: #33414f; }
.grid--citas .rowacts { white-space: nowrap; }
.grid--citas .rowacts .minibtn { padding: 5px 9px; }
.grid--citas .row--hecho { opacity: .55; }
.grid--citas .row--hecho .modelo { text-decoration: line-through; }
.grid--citas td.nowrap { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink-soft); }

/* tabla de clientes */
.grid--clientes th.num, .grid--clientes td.num { text-align: center; font-variant-numeric: tabular-nums; }
.grid--clientes td a { color: var(--brand-d); text-decoration: none; font-weight: 600; }
.grid--clientes td.nowrap { color: var(--ink-soft); }
.grid--clientes th.th-sort { cursor: pointer; user-select: none; white-space: nowrap; transition: color .12s, background .12s; }
.grid--clientes th.th-sort:hover { color: var(--brand-d); background: #eef6ef; }
.grid--clientes th.th-sort--on { color: var(--brand-d); }
.grid--clientes .th-arrow { font-size: 10px; margin-left: 4px; vertical-align: middle; }

/* bloque de dos fechas (de un vistazo) */
.grid--citas td.fechas { white-space: nowrap; }
.fechas { display: flex; flex-direction: column; gap: 5px; }
.f-line { font-size: 12.5px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 8px; }
.f-line b { font-weight: 700; font-variant-numeric: tabular-nums; }
.f-line i { font-style: normal; font-weight: 600; }
.f-in   { background: #f1efe8; color: #4a4a45; }
.f-none { background: #f6f6f6; color: #a0a0a0; }
.f-cita { font-weight: 500; }
.f-cita--soon  { background: #eaf3de; color: #2f5e0d; }
.f-cita--today { background: #fff3e0; color: #9a5b00; }
.f-cita--late  { background: var(--danger-bg); color: var(--danger); }
.f-cita--late i { color: var(--danger); }
.rownota { font-size: 12.5px; color: var(--ink-soft); margin-top: 4px; }
.field2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .field2 { grid-template-columns: 1fr; } }
tr.grp td {
  background: #1a1a1a; color: #fff; font-weight: 700; font-size: 13px;
  letter-spacing: .02em; padding: 9px 14px; position: sticky; left: 0; z-index: 3;
}
tr.grp .grp__n { color: var(--brand); font-weight: 600; }

.price { font-weight: 700; font-variant-numeric: tabular-nums; }
.price input {
  width: 86px; font-family: inherit; font-size: 14px; font-weight: 700; text-align: right;
  border: 1px solid transparent; border-radius: 8px; padding: 6px 8px; background: #f4f7fa;
}
.price input:focus { border-color: var(--brand); background: #fff; outline: none; }
.muted { color: var(--ink-soft); }

/* tablas de precios: columnas alineadas y precio centrado */
.grid--precios { table-layout: fixed; }
.grid--precios th, .grid--precios td { white-space: normal; word-break: break-word; }
.grid--precios .thprice { width: 150px; text-align: center; }
.grid--precios3 .thnota { width: 210px; }
.grid--precios .price { text-align: center; }
.grid--precios .price input { text-align: center; }
.nota input.notainp {
  width: 100%; font-family: inherit; font-size: 13.5px; color: var(--ink);
  border: 1px solid transparent; border-radius: 8px; padding: 6px 8px; background: #f4f7fa;
}
.nota input.notainp:focus { border-color: var(--brand); background: #fff; outline: none; }
.nota input.notainp::placeholder { color: #aeb8c2; }

/* ---------- Laboratorio / envíos externos ---------- */
.envio-sum {
  display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: center;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 13px 18px; margin-bottom: 14px; font-size: 14px;
}
.mg-pos { color: var(--ok); font-weight: 700; }
.mg-neg { color: var(--danger); font-weight: 700; }
.sum-warn { color: var(--danger); font-weight: 700; }
.sum-ok { color: var(--ok); font-weight: 700; }

/* ---------- Precios de móviles (compra/venta/margen) + candado ---------- */
.grid--mov th, .grid--mov td { white-space: nowrap; }
.grid--mov td.modelo { white-space: normal; font-weight: 700; }
.grid--mov .thnum, .grid--mov td.num { text-align: right; font-variant-numeric: tabular-nums; }
.grid--mov td.num { white-space: nowrap; }
.pvpinp { width: 92px; text-align: right; font-family: inherit; font-size: 14px; padding: 6px 8px;
  border: 1px solid var(--line); border-radius: 8px; background: #fffdf3; font-variant-numeric: tabular-nums; }
.pvpinp:focus { outline: none; border-color: var(--brand); background: #fff; }
.costebtn { background: none; border: 1px dashed transparent; border-radius: 8px; padding: 5px 8px;
  font: inherit; font-variant-numeric: tabular-nums; color: var(--ink); cursor: pointer; }
.costebtn:hover { border-color: var(--brand); color: var(--brand-d); background: #f2f9f3; }
.mgchip { font-weight: 700; font-size: 12.5px; border-radius: 8px; padding: 2px 9px; }
.mg--alto  { color: #2f7d32; } .mgchip.mg--alto  { background: #e7f5e8; }
.mg--medio { color: #a76a00; } .mgchip.mg--medio { background: #fdf3e2; }
.mg--bajo  { color: var(--danger); } .mgchip.mg--bajo { background: #fbeaea; }
.acc__mg { font-size: 11.5px; font-weight: 700; margin-left: auto; margin-right: 10px; }
.grid--hist td, .grid--hist th { font-size: 13px; }
.grid--hist .thnum, .grid--hist td.num { text-align: right; font-variant-numeric: tabular-nums; }
.hist--now { background: #f2f9f3; }
.uhint { font-size: 12px; color: var(--muted); margin: -4px 0 14px; line-height: 1.45; }
.termlock { display: flex; gap: 14px; }
.lockbox { max-width: 380px; margin: 46px auto; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px 26px; text-align: center; }
.lockbox__ico { font-size: 34px; line-height: 1; }
.lockbox__t { margin: 12px 0 6px; font-size: 18px; }
.lockbox__p { font-size: 13px; color: var(--ink-soft); line-height: 1.5; margin: 0 0 18px; }
.lockbox__inp { width: 100%; font-family: inherit; font-size: 14px; padding: 11px 13px;
  border: 1.5px solid var(--line); border-radius: 10px; outline: none; margin-bottom: 10px; text-align: center; }
.lockbox__inp:focus { border-color: var(--brand); }
.lockbox__btn { width: 100%; margin-top: 4px; }
.lockbox__err { color: var(--danger); font-size: 12.5px; font-weight: 600; min-height: 18px; margin: 10px 0 0; }

/* ---------- Tareas (asignación por empleado) ---------- */
.tgroup { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-bottom: 14px; overflow: hidden; }
.tgroup__head { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 16px; background: #f4f6fa; border-bottom: 1px solid var(--line-2); }
.tgroup__name { font-weight: 800; font-size: 14px; letter-spacing: .01em; }
.tgroup__count { font-size: 11.5px; font-weight: 700; color: var(--muted); background: #fff;
  border: 1px solid var(--line); border-radius: 20px; padding: 2px 11px; }
.tgroup__body { padding: 8px 10px; display: flex; flex-direction: column; gap: 7px; }
.tcard { display: flex; align-items: flex-start; gap: 11px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line-2); border-left: 4px solid var(--p); background: #fff; }
.tcard:hover { background: #f8fbfd; }
.tcard--hecha { opacity: .55; }
.tcard--hecha .tcard__title { text-decoration: line-through; }
.tcard__chk { background: none; border: none; cursor: pointer; font-size: 19px; line-height: 1; padding: 0; color: var(--brand-d); flex: none; }
.tcard__main { flex: 1; min-width: 0; }
.tcard__title { font-weight: 600; font-size: 14px; line-height: 1.35; }
.tcard__nota { font-size: 12.5px; color: var(--ink-soft); margin-top: 3px; line-height: 1.4; }
.tcard__meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 6px; align-items: center; }
.tcard__prio { font-size: 11px; font-weight: 700; border-radius: 8px; padding: 2px 9px; }
.tcard__due { font-size: 11.5px; font-weight: 600; border-radius: 8px; padding: 2px 9px; background: #eef1f5; color: var(--ink-soft); }
.tcard__due--late { background: #fbeaea; color: var(--danger); }
.tcard__due--today { background: #fdf3e2; color: #a76a00; }
.tcard__due--soon { background: #eaf6ec; color: var(--brand-d); }
.tcard__due--done { background: #eef1f5; color: var(--muted); }
.tcard__done { font-size: 11.5px; color: var(--muted); }
.tcard__acts { display: flex; gap: 5px; flex: none; }
.aging-warn { color: var(--warn); font-weight: 700; }
.aging-late { color: var(--danger); font-weight: 700; }
tr.grp--envio td { background: var(--c); }
.grid--envios th, .grid--envios td { white-space: normal; overflow-wrap: break-word; vertical-align: top; }
.grid--envios .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.grid--envios thead .num { text-align: right; }
.grid--envios .ordnum { font-size: 12px; margin-top: 2px; }
.grid--envios .rownota { margin-top: 3px; }
.envioinp {
  width: 80px; font-family: inherit; font-size: 14px; text-align: right;
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: #f4f7fa;
}
.envioinp:focus { border-color: var(--brand); background: #fff; outline: none; }
.envioestado {
  font-family: inherit; font-size: 13px; padding: 6px 8px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer;
}
/* sección Laboratorio en la ficha de reparación */
.labsec { border: 1px dashed var(--line); border-radius: 12px; padding: 10px 12px 4px; margin: 4px 0 2px; background: #faf7fd; }
.labsec__h { font-size: 12.5px; font-weight: 700; color: #8e44ad; margin-bottom: 8px; }
.labtxt {
  width: 100%; font-family: inherit; font-size: 14px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: #f4f7fa;
}
.labtxt:focus { border-color: var(--brand); background: #fff; outline: none; }
.rep-print { white-space: nowrap; }
.rep-print .minibtn { font-size: 15px; padding: 5px 8px; }

/* ---------- Impresión: resguardo (A4) + etiqueta (29×90) ---------- */
/* botones claros de impresión en la ficha de reparación */
.repprint { display: flex; gap: 10px; margin: 10px 0 2px; }
.repprint__btn { flex: 1; font-weight: 700; font-size: 14px; padding: 12px 10px; color: #fff; border-radius: 11px; }
.repprint__hoja { background: var(--brand); }
.repprint__hoja:hover { background: var(--brand-d); }
.repprint__etq { background: #1a1a1a; }
.repprint__etq:hover { background: #333; }
@media (max-width: 480px) { .repprint { flex-direction: column; } }

#printArea { display: none; }

/* Vista previa de impresión (resguardo / etiqueta) */
.pprev { position: fixed; inset: 0; z-index: 200; background: rgba(18,26,34,.72); display: none; flex-direction: column; }
.pprev__bar { display: flex; align-items: center; gap: 12px; padding: 12px 18px; background: #1a1a1a; color: #fff; flex: none; }
.pprev__t { font-weight: 700; font-size: 15px; margin-right: auto; }
.pprev__scroll { flex: 1; overflow: auto; padding: 26px 20px; display: flex; justify-content: center; align-items: flex-start; }
.pprev__doc { background: #fff; width: 210mm; max-width: 100%; padding: 15mm; box-shadow: 0 8px 40px rgba(0,0,0,.45); border-radius: 2px; }
.pprev__doc--label { width: auto; padding: 0; box-shadow: none; background: transparent; }
.pprev__doc--label .doc--label { background: #fff; border: 1px dashed #999; box-shadow: 0 8px 40px rgba(0,0,0,.45); }
.doc { font-family: 'Inter', system-ui, sans-serif; color: #000; }
/* Resguardo de reparación (A4 profesional) */
.rdoc { font-size: 12.5px; line-height: 1.45; color: #1a1a1a; }
.rd__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px;
  border-bottom: 3px solid #1a1a1a; padding-bottom: 14px; margin-bottom: 4px; }
.rd__brand { display: flex; align-items: flex-start; gap: 14px; }
.rd__logo { height: 50px; width: auto; filter: grayscale(1) brightness(.5) contrast(1.2); }
.rd__shop { font-size: 11px; color: #333; line-height: 1.5; }
.rd__razon { font-size: 13px; font-weight: 800; color: #1a1a1a; }
.rd__ord { text-align: right; border: 2px solid #1a1a1a; border-radius: 10px; padding: 8px 14px; min-width: 150px; }
.rd__ord span { display: block; font-size: 9px; font-weight: 700; letter-spacing: .08em; color: #1a1a1a; }
.rd__ord b { display: block; font-size: 22px; font-weight: 800; line-height: 1.1; }
.rd__ord small { font-size: 11px; color: #333; }
.rd__h1 { font-size: 20px; font-weight: 800; margin: 16px 0 12px; letter-spacing: -.01em; }
.rd__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.rd__card { border: 1px solid #888; border-radius: 10px; padding: 12px 14px; }
.rd__card h2, .rd__averia h2 { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  color: #1a1a1a; margin: 0 0 9px; }
.rd__f { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px dotted #aaa; font-size: 12.5px; }
.rd__f:last-child { border-bottom: none; }
.rd__f span { color: #333; }
.rd__f b { font-weight: 700; text-align: right; }
.rd__averia { border: 1px solid #888; border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; }
.rd__averiabox { font-size: 13px; min-height: 34px; }
.rd__terms { font-size: 9.5px; color: #333; margin-bottom: 26px; }
.rd__terms h3 { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: #1a1a1a; margin: 0 0 6px; }
.rd__terms ol { margin: 0; padding-left: 16px; line-height: 1.5; }
.rd__terms li { margin-bottom: 3px; }
.rd__terms b { color: #1a1a1a; }
.rd__sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-bottom: 24px; }
.rd__signbox { border-top: 1px solid #1a1a1a; padding-top: 6px; margin-top: 46px; }
.rd__signbox span { font-size: 12px; font-weight: 700; }
.rd__signbox small { display: block; font-size: 10px; color: #444; margin-top: 2px; }
.rd__signnote { font-size: 9.5px; color: #333; text-align: center; margin: -14px 0 20px; font-style: italic; }
.rd__opt { font-weight: 600; color: #555; font-style: italic; }
.rd__foot { font-size: 10px; color: #444; border-top: 1px solid #999; padding-top: 8px; text-align: center; }
.doc--label {
  width: 90mm; height: 29mm; padding: 1.5mm 2.5mm; box-sizing: border-box;
  font-size: 8pt; line-height: 1.24; overflow: hidden;
}
.doc--label > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lbl__l1 { font-weight: 800; font-size: 9pt; }
.lbl__l4 { font-weight: 600; white-space: normal !important; }
.lbl__l5 { font-style: italic; white-space: normal !important; }

/* ---------- Impresión en BLANCO Y NEGRO ----------
   El taller imprime en B/N: los verdes y grises claros salían casi invisibles.
   Al imprimir forzamos alto contraste (negro y grises oscuros, bordes sólidos). */
@media print {
  .doc, .rdoc { color: #000 !important; }
  .rd__top { border-bottom-color: #000 !important; }
  .rd__razon, .rd__h1, .rd__ord b, .rd__ord span, .rd__ord small,
  .rd__card h2, .rd__averia h2, .rd__f b, .rd__terms b,
  .rd__signbox span, .rd__signbox small { color: #000 !important; }
  .rd__shop, .rd__f span, .rd__terms, .rd__foot, .rd__signnote, .rd__opt { color: #222 !important; }
  .rd__ord { border-color: #000 !important; }
  .rd__card, .rd__averia { border-color: #000 !important; }
  .rd__f { border-bottom-color: #888 !important; }
  .rd__foot { border-top-color: #000 !important; }
}

/* ---------- Patrón de desbloqueo (dibujable) ---------- */
.patwrap { display: flex; align-items: center; gap: 14px; }
.patgrid {
  position: relative; width: 168px; height: 168px; flex: none;
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr);
  background: #f4f7fa; border: 1.5px solid var(--line); border-radius: 12px;
  touch-action: none; user-select: none;
}
.patdot { display: grid; place-items: center; cursor: pointer; }
.patdot::before {
  content: ''; width: 16px; height: 16px; border-radius: 50%; background: #c3cdd8;
  transition: transform .08s, background .08s;
}
.patdot--on::before { background: var(--brand); transform: scale(1.3); }
.patsvg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.patmini { vertical-align: middle; margin-left: 6px; }
.codcell { white-space: nowrap; }

/* ---------- Dashboard de reparaciones (panel) ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi {
  border: none; border-radius: 16px; padding: 16px 18px; cursor: pointer; text-align: left;
  color: #fff; font-family: inherit; display: flex; flex-direction: column; gap: 3px;
  box-shadow: 0 6px 18px rgba(20,24,31,.12); transition: transform .1s ease, box-shadow .15s ease;
}
.kpi:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(20,24,31,.16); }
.kpi b { font-size: 30px; font-weight: 800; line-height: 1; }
.kpi span { font-size: 13px; font-weight: 600; opacity: .95; }
.kpi--blue { background: #2f7fe0; } .kpi--green { background: #3aa655; }
.kpi--amber { background: #e08a00; } .kpi--red { background: #d64545; }
.kanban { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; align-items: start; }
@media (max-width: 1100px) { .kanban { grid-template-columns: repeat(3, 1fr); } }
.kcol { background: #eef2f6; border-radius: 14px; overflow: hidden; }
.kcol__head { padding: 10px 12px; font-weight: 700; font-size: 13px; color: #fff; background: var(--c); display: flex; justify-content: space-between; align-items: center; }
.kcol__head span { background: rgba(255,255,255,.28); border-radius: 999px; padding: 1px 8px; font-size: 12px; }
.kcol__body { padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 40px; }
.kcard { background: #fff; border-radius: 10px; padding: 9px 11px; border-left: 4px solid var(--c); cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.kcard:hover { background: #f8fbfd; }
.kcard__top { display: flex; justify-content: space-between; font-size: 12px; font-variant-numeric: tabular-nums; }
.kcard__cli { font-weight: 700; font-size: 14px; margin-top: 2px; }
.kcard__dev { font-size: 12.5px; color: var(--ink-soft); line-height: 1.35; }
.kcard__date { font-size: 11px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.repmeta { background: #f4f6fa; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin-bottom: 14px; font-size: 13px; color: var(--ink-soft); }
.repmeta b { color: var(--ink); font-variant-numeric: tabular-nums; }
.kempty { color: #aeb8c2; text-align: center; padding: 12px; font-size: 13px; }
.kmore {
  width: 100%; border: 1px dashed var(--line); background: #fff; border-radius: 9px;
  padding: 8px; font-family: inherit; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); cursor: pointer;
}
.kmore:hover { color: var(--brand-d); border-color: var(--brand); background: #f8fbf6; }
@media (max-width: 820px) { .kanban { grid-template-columns: 1fr 1fr; } }

/* secciones por categoría / modelo */
.group { margin-bottom: 18px; }
.group__title {
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--brand-d); margin: 0 0 8px 2px; display: flex; align-items: center; gap: 8px;
}
.group__title::before { content: ''; width: 8px; height: 8px; border-radius: 3px; background: var(--brand); }

/* Precios como acordeón plegable por categoría */
.acc { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); margin-bottom: 10px; overflow: hidden; }
.acc__head { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 11px; padding: 13px 16px; user-select: none; }
.acc__head::-webkit-details-marker { display: none; }
.acc__head::before { content: '▸'; color: var(--brand-d); font-size: 12px; line-height: 1; transition: transform .15s; }
.acc[open] > .acc__head::before { transform: rotate(90deg); }
.acc__head:hover { background: #f4f6fa; }
.acc__name { flex: 1; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; font-size: 13px; color: var(--ink); }
.acc__count { font-size: 11px; font-weight: 700; color: var(--muted); background: #eef1f5; border-radius: 20px; padding: 2px 10px; min-width: 24px; text-align: center; }
.acc[open] > .acc__head { border-bottom: 1px solid var(--line-2); }

/* ---------- Encargos / citas ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; }
.card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 16px 14px; border-left: 4px solid var(--brand); display: flex; flex-direction: column; gap: 8px;
}
.card--hecho { border-left-color: var(--ok); opacity: .72; }
.card__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.card__name { font-weight: 700; font-size: 15.5px; }
.card__tel { font-size: 13px; }
.card__tel a { color: var(--brand-d); text-decoration: none; }
.card__row { font-size: 13.5px; line-height: 1.4; }
.card__row b { color: var(--ink-soft); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.card__pago { font-size: 12.5px; font-weight: 600; color: var(--warn); }
.card__actions { display: flex; gap: 8px; margin-top: 6px; }
.minibtn {
  border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 10px;
  font-family: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink); cursor: pointer;
}
.minibtn:hover { background: #f3f6f9; }
.minibtn--ok { color: var(--ok); border-color: #bfe6cd; }
.minibtn--ok:hover { background: var(--ok); color: #fff; }
.minibtn--del { color: var(--danger); border-color: #f0c9c9; }
.minibtn--del:hover { background: var(--danger); color: #fff; }

.empty { text-align: center; color: var(--ink-soft); padding: 50px 20px; font-size: 14.5px; }

/* ---------- Pestaña reservada (Reparaciones) ---------- */
.tab--soon { position: relative; }
.badge-soon {
  margin-left: 7px; font-size: 9.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; background: var(--brand); color: #06310a;
  padding: 2px 6px; border-radius: 999px; vertical-align: middle;
}
.soon {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 38px 30px; max-width: 760px; margin: 0 auto; text-align: center;
}
.soon__icon { font-size: 46px; line-height: 1; }
.soon__title { margin: 12px 0 2px; font-size: 24px; font-weight: 800; color: var(--ink); }
.soon__tag {
  display: inline-block; margin: 0 0 16px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--brand-d);
  background: #eaf3de; padding: 4px 12px; border-radius: 999px;
}
.soon__desc { color: var(--ink-soft); font-size: 15px; line-height: 1.55; max-width: 560px; margin: 0 auto 22px; }
.soon__desc b { color: var(--ink); }
.soon__flow { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-bottom: 28px; }
.flowstep {
  background: #f1efe8; color: var(--ink); font-weight: 600; font-size: 13.5px;
  padding: 8px 16px; border-radius: 10px; border: 1px solid var(--line);
}
.flowstep--end { background: var(--brand); color: #fff; border-color: var(--brand); }
.flowarrow { color: var(--ink-soft); font-weight: 700; }
.soon__h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); margin: 0 0 14px; }
.planned {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px;
  text-align: left; margin-bottom: 24px;
}
.planned span {
  background: #f8fbf6; border: 1px solid #e4efd9; border-radius: 10px;
  padding: 11px 13px; font-size: 13.5px; color: var(--ink); position: relative; padding-left: 30px;
}
.planned span::before { content: '✓'; position: absolute; left: 12px; color: var(--brand-d); font-weight: 700; }
.planned span i { color: var(--ink-soft); font-style: normal; font-size: 12px; }
.soon__note {
  background: #f6f9fb; border-radius: 12px; padding: 14px 16px; font-size: 13.5px;
  color: var(--ink-soft); margin: 0; line-height: 1.5;
}
.soon__note b { color: var(--ink); }

/* ---------- Footer ---------- */
.foot {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 22px; color: var(--ink-soft); font-size: 12.5px; border-top: 1px solid var(--line);
  background: #fff;
}
.foot__tools { display: flex; gap: 14px; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(13,27,42,.55); display: grid; place-items: center; z-index: 60; padding: 18px; }
.modal__card {
  background: #fff; width: min(680px, 96vw); max-height: 92vh; overflow: auto;
  border-radius: 18px; padding: 24px; box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.modal h3 { margin: 0 0 16px; font-size: 18px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.field input, .field textarea, .field select {
  font-family: inherit; font-size: 14px; padding: 10px 12px; border: 1.5px solid var(--line);
  border-radius: 10px; outline: none; resize: vertical;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--brand); }
.modal__actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* Zona de peligro: eliminar orden, discreto y separado */
.danger-zone { margin-top: 22px; padding-top: 12px; border-top: 1px dashed var(--line); text-align: center; }
.linkdel {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 12.5px; padding: 4px 8px; border-radius: 6px;
  opacity: .6; transition: opacity .15s, color .15s, background .15s;
}
.linkdel:hover { opacity: 1; color: var(--danger); background: #fbeaea; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .topbar { gap: 10px; padding: 0 12px; }
  .tab { padding: 8px 10px; font-size: 13px; }
  .tab span, .tab__emoji { }
  .main { padding: 14px; }
}
