/* CRM IVECO Murcia: sistema visual v0.5
   Tipografía: Geist (interfaz) e Instrument Serif (títulos), alojadas aquí (licencia OFL en /fonts).
   Iconos: Lucide (ISC) en un sprite dentro de index.html. Sin recursos de terceros en tiempo de ejecución. */

@font-face { font-family: "Geist"; src: url("/fonts/geist.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("/fonts/instrument-serif.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("/fonts/instrument-serif-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  --canvas: #f5f4f0; --surface: #ffffff; --surface-2: #faf9f6; --sunken: #efede7;
  --ink: #111824; --ink-2: #3a4555; --muted: #697282; --faint: #9aa1ab;
  --line: #e7e4dd; --line-2: #d8d4ca;
  --brand: #13233a; --brand-fg: #f7f5f0; --brand-hover: #1c3352;
  --accent: #a8834b; --accent-soft: #f3ebde;
  --link: #1f4e8c; --focus: #2f6fd6;
  --ok: #2c7a4b; --ok-bg: #e7f3ec; --ok-line: #c4e2cf;
  --warn: #9a5a0b; --warn-bg: #fbf1e2; --warn-line: #f0d9b5;
  --bad: #b3262f; --bad-bg: #fbeaea; --bad-line: #f1c9cb;
  --info: #2b4f86; --info-bg: #eaf0f8; --info-line: #cfdcef;
  --violet: #6c3f8f; --violet-bg: #f3ecf8;
  --side: #0f1b2d; --side-ink: #c4ccd8; --side-muted: #7f8ba0; --side-line: #1d2a3e; --side-hover: #16263c; --side-on: #1d3150;
  --shadow-1: 0 1px 2px rgb(17 24 36 / .04), 0 1px 1px rgb(17 24 36 / .03);
  --shadow-2: 0 2px 4px rgb(17 24 36 / .04), 0 8px 24px rgb(17 24 36 / .07);
  --shadow-3: 0 12px 32px rgb(17 24 36 / .14), 0 2px 6px rgb(17 24 36 / .06);
  --r-sm: 8px; --r: 12px; --r-lg: 16px;
  --sans: "Geist", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --serif: "Instrument Serif", ui-serif, Georgia, "Times New Roman", serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --tabh: 64px; --toph: 56px; --sidew: 252px; --railw: 76px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --canvas: #0b0e13; --surface: #12161d; --surface-2: #161b23; --sunken: #0e1218;
  --ink: #eceef1; --ink-2: #c3c9d2; --muted: #8e97a4; --faint: #646d7a;
  --line: #222932; --line-2: #2e3641;
  --brand: #ebe5d8; --brand-fg: #111824; --brand-hover: #f6f1e6;
  --accent: #d1b077; --accent-soft: #2a2418;
  --link: #8fb5ef; --focus: #6aa0ff;
  --ok: #6fcf97; --ok-bg: #12261b; --ok-line: #1f4430;
  --warn: #f0b45c; --warn-bg: #2a1f0f; --warn-line: #4a3517;
  --bad: #f2878d; --bad-bg: #2c1416; --bad-line: #4d2226;
  --info: #9cbcf0; --info-bg: #142033; --info-line: #22385a;
  --violet: #c9a6ea; --violet-bg: #231a2e;
  --side: #080b10; --side-ink: #c4ccd8; --side-muted: #6f7a8c; --side-line: #161c26; --side-hover: #11171f; --side-on: #18212d;
  --shadow-1: 0 1px 2px rgb(0 0 0 / .3); --shadow-2: 0 8px 24px rgb(0 0 0 / .35); --shadow-3: 0 16px 40px rgb(0 0 0 / .5);
  color-scheme: dark;
} }
:root[data-theme="dark"] {
  --canvas: #0b0e13; --surface: #12161d; --surface-2: #161b23; --sunken: #0e1218;
  --ink: #eceef1; --ink-2: #c3c9d2; --muted: #8e97a4; --faint: #646d7a;
  --line: #222932; --line-2: #2e3641;
  --brand: #ebe5d8; --brand-fg: #111824; --brand-hover: #f6f1e6;
  --accent: #d1b077; --accent-soft: #2a2418;
  --link: #8fb5ef; --focus: #6aa0ff;
  --ok: #6fcf97; --ok-bg: #12261b; --ok-line: #1f4430;
  --warn: #f0b45c; --warn-bg: #2a1f0f; --warn-line: #4a3517;
  --bad: #f2878d; --bad-bg: #2c1416; --bad-line: #4d2226;
  --info: #9cbcf0; --info-bg: #142033; --info-line: #22385a;
  --violet: #c9a6ea; --violet-bg: #231a2e;
  --side: #080b10; --side-ink: #c4ccd8; --side-muted: #6f7a8c; --side-line: #161c26; --side-hover: #11171f; --side-on: #18212d;
  --shadow-1: 0 1px 2px rgb(0 0 0 / .3); --shadow-2: 0 8px 24px rgb(0 0 0 / .35); --shadow-3: 0 16px 40px rgb(0 0 0 / .5);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--toph) + 12px); }
body { margin: 0; min-height: 100dvh; background: var(--canvas); color: var(--ink); font: 400 15px/1.5 var(--sans); font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
img, svg { display: block; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; display: inline-block; vertical-align: -.2em; }
.ic.sm { width: 15px; height: 15px; } .ic.lg { width: 22px; height: 22px; }
h1, h2, h3 { margin: 0; color: var(--ink); text-wrap: balance; }
h1 { font: 400 clamp(28px, 3.2vw, 38px)/1.1 var(--serif); letter-spacing: -.01em; margin: 4px 0 6px; }
h2 { font-size: 15px; font-weight: 600; letter-spacing: -.005em; margin: 32px 0 12px; display: flex; align-items: center; gap: 8px; }
h3 { font-size: 14px; font-weight: 600; margin: 0 0 8px; }
p { margin: 8px 0; text-wrap: pretty; }
code, kbd, pre { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .88em; }
code { background: var(--sunken); padding: 1px 6px; border-radius: 6px; }
kbd { border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; padding: 0 6px; font-size: 11px; color: var(--muted); background: var(--surface); }
pre { white-space: pre-wrap; font-size: 12px; background: var(--sunken); padding: 12px; border-radius: var(--r-sm); overflow-x: auto; border: 1px solid var(--line); }
.num, td, .kv dd, .tl-time, time { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 13px; } .xs { font-size: 12px; }
.warn { color: var(--warn); } .bad { color: var(--bad); } .ok { color: var(--ok); }
.pad { padding: 16px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; box-shadow: var(--shadow-2); }
.skip:focus { left: 8px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--ink) 16%, transparent); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }
* { scrollbar-color: color-mix(in srgb, var(--ink) 18%, transparent) transparent; scrollbar-width: thin; }

/* ---------- Estructura (móvil primero) ---------- */
.side { display: none; }
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; height: calc(var(--toph) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 12px 0 16px;
  background: color-mix(in srgb, var(--canvas) 82%, transparent); -webkit-backdrop-filter: saturate(1.6) blur(16px); backdrop-filter: saturate(1.6) blur(16px); border-bottom: 1px solid transparent; transition: border-color .2s var(--ease); }
body.scrolled .top { border-bottom-color: var(--line); }
.top-brand { display: flex; }
#top-title { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transform: translateY(4px); transition: opacity .2s var(--ease), transform .2s var(--ease); }
body.scrolled #top-title { opacity: 1; transform: none; }
.mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--side); color: #efe6d4; font: italic 400 21px/1 var(--serif); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .08); position: relative; }
.mark::after { content: ""; position: absolute; right: 6px; bottom: 7px; width: 4px; height: 4px; border-radius: 50%; background: #c9a467; }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border: 0; background: none; box-shadow: none; padding: 0; color: var(--ink); border-radius: 12px; cursor: pointer; }
.icon-btn:hover { background: var(--sunken); }
main { padding: 4px 16px calc(var(--tabh) + 96px + env(safe-area-inset-bottom)); max-width: 1240px; margin: 0 auto; outline: none; min-width: 0; overflow-wrap: break-word; }
body.auth .top, body.auth .tabs, body.auth .fab, body.auth .side { display: none !important; }
body.auth main { padding: 0; max-width: none; }

.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: flex; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 86%, transparent); -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px); border-top: 1px solid var(--line); }
.tabs a, .tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px; border: 0; background: none; font: 500 11px/1 var(--sans); color: var(--muted); text-decoration: none; border-radius: 12px; cursor: pointer; letter-spacing: .01em; transition: color .15s; }
.tabs .ic { width: 22px; height: 22px; stroke-width: 1.6; }
.tabs button { box-shadow: none; padding: 0; }
.tabs button:hover, .tabs a:hover { background: none; }
.tabs .on { color: var(--ink); }
.tabs .on .ic { stroke-width: 2.1; }
.tabs a:hover { text-decoration: none; }
.fab { position: fixed; right: 18px; bottom: calc(var(--tabh) + 18px + env(safe-area-inset-bottom)); z-index: 31; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 18px; border: 0; background: var(--brand); color: var(--brand-fg); box-shadow: var(--shadow-3); cursor: pointer; transition: transform .15s var(--ease); }
.fab .ic { width: 24px; height: 24px; stroke-width: 2; }
.fab:active { transform: scale(.94); }

/* Tablet: carril de iconos */
@media (min-width: 768px) {
  .top, .tabs, .fab { display: none !important; }
  body:not(.auth) { padding-left: var(--railw); }
  .side { display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: var(--railw); z-index: 30; background: var(--side); color: var(--side-ink); padding: 14px 10px calc(14px + env(safe-area-inset-bottom)); gap: 6px; overflow-y: auto; scrollbar-width: none; }
  .side .side-label, .side .side-sec { display: none; }
  .side-brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 14px; color: #f3efe6; text-decoration: none !important; justify-content: center; }
  .side-brand .mark { background: #1b2c45; }
  .side-brand b { display: block; font-weight: 600; font-size: 14px; letter-spacing: .02em; }
  .side-brand small { display: block; color: var(--side-muted); font-size: 12px; }
  .side-search, .side-new, .side-nav a, .side-foot button { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 14px; border-radius: 10px; border: 0; background: none; color: var(--side-ink); font: 500 14px/1 var(--sans); text-decoration: none !important; cursor: pointer; width: 100%; justify-content: center; transition: background .15s, color .15s; }
  .side-search { border: 1px solid var(--side-line); color: var(--side-muted); }
  .side-new { background: #efe6d4; color: #13233a; font-weight: 600; margin-bottom: 10px; }
  .side-new:hover { background: #f7f0e2; }
  .side-nav { display: flex; flex-direction: column; gap: 2px; }
  .side-nav a { flex-direction: column; gap: 4px; padding: 8px 2px; min-height: 54px; }
  .side-nav a::after { content: attr(data-short); font-size: 10.5px; font-weight: 500; letter-spacing: .01em; color: var(--side-muted); }
  .side-nav a.on::after, .side-nav a:hover::after { color: #fff; }
  .side-nav a:hover, .side-foot button:hover, .side-search:hover { background: var(--side-hover); color: #fff; }
  .side-nav a.on { background: var(--side-on); color: #fff; }
  .side-nav a.on .ic { color: #d6b47a; }
  .side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--side-line); }
  .side-user { display: block; padding: 0 14px 6px; font-size: 12px; color: var(--side-muted); }
  main { padding: 28px 32px 64px; }
  #toast { bottom: 24px !important; }
}
/* Escritorio: barra lateral completa */
@media (min-width: 1100px) {
  body:not(.auth) { padding-left: var(--sidew); }
  .side { width: var(--sidew); padding: 18px 14px; }
  .side .side-label { display: block; }
  .side .side-sec { display: block; padding: 14px 14px 4px; font-size: 12px; color: var(--side-muted); font-weight: 500; }
  .side-nav a { min-height: 40px; flex-direction: row; gap: 12px; padding: 0 14px; }
  .side-nav a::after { content: none; }
  .side-brand { justify-content: flex-start; padding: 2px 8px 18px; }
  .side-search, .side-new, .side-nav a, .side-foot button { justify-content: flex-start; }
  .side-search kbd { margin-left: auto; background: transparent; border-color: var(--side-line); color: var(--side-muted); }
  main { padding: 36px 48px 72px; }
}

/* ---------- Cabecera de página ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin: 8px 0 22px; }
.page-head > div:first-child { min-width: 0; }
.page-head h1 { margin: 0; }
.page-head .sub { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.page-head .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.back:hover { color: var(--ink); text-decoration: none; }

/* ---------- Superficies ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; margin: 10px 0; box-shadow: var(--shadow-1); }
.card > h3:first-child, .card > .row:first-child h3 { margin-bottom: 4px; }
.card.link { display: block; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s var(--ease); }
.card.link:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); }
.card.flush { padding: 0; overflow: hidden; }
.card.tight { padding: 4px 18px; }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel-h h3 { margin: 0; }
.section-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 30px 0 10px; }
.section-h h2 { margin: 0; }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--sunken); color: var(--muted); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.count.bad { background: var(--bad-bg); color: var(--bad); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 4px 16px; }
.cols { display: grid; gap: 0 28px; grid-template-columns: minmax(0, 1fr); margin-top: 8px; }
@media (min-width: 1100px) { .cols { grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); } .cols > div > .section-h:first-child, .cols > div > h2:first-child { margin-top: 0; } }
.stack > * + * { margin-top: 10px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* Listas */
.list-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none !important; min-width: 0; }
.list-item:last-child { border-bottom: 0; }
.li-2 { display: flex; flex-direction: column; gap: 1px; min-width: 0; } .list-item > .chip { flex-shrink: 0; }
a.list-item:hover { color: var(--ink); }
a.list-item:hover > span:first-child, a.list-item:hover strong { color: var(--link); }
.card > .list-item:first-child { padding-top: 4px; } .card > .list-item:last-of-type { padding-bottom: 4px; }
.rows { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); overflow: hidden; }
.rowlink { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none !important; transition: background .12s; }
.rowlink:last-child { border-bottom: 0; }
.rowlink:hover { background: var(--surface-2); }
.rowlink .t { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rowlink .s { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rowlink .meta { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.rowlink .chev { color: var(--faint); }
@media (min-width: 900px) {
  .rowlink.c4 { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.4fr) minmax(0, 1fr) 20px; }
  .rowlink.c4 .s.x { display: block; }
}
.rowlink .s.x { display: none; }
.rowlink .chev { display: none; }
.rowlink .mn { min-width: 0; }
@media (min-width: 900px) { .rowlink.c4 .s.m { display: none; } .rowlink.c4 .chev { display: block; } .rowlink.c4 .meta { justify-content: flex-start; } }
.rows-h { display: none; }
@media (min-width: 900px) { .rows-h { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.4fr) minmax(0, 1fr) 20px; gap: 16px; padding: 10px 18px; font-size: 12px; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--line); background: var(--surface-2); } }

/* Pares clave-valor */
.kv { display: grid; grid-template-columns: minmax(110px, 160px) 1fr; gap: 10px 16px; font-size: 14px; margin: 8px 0 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; color: var(--ink); }
@media (max-width: 520px) { .kv { grid-template-columns: 1fr; gap: 2px; } .kv dd { margin-bottom: 10px; } }

/* Chips y estados */
.chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; background: var(--sunken); color: var(--ink-2); font-size: 12px; font-weight: 500; white-space: nowrap; border: 1px solid transparent; line-height: 1; }
.chip::before { content: none; }
.chip.dot::before, [class*="chip t-"]::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.t-propio_confirmado { background: var(--ok-bg); color: var(--ok); }
.t-daniel { background: var(--bad-bg); color: var(--bad); }
.t-otro_companero { background: var(--warn-bg); color: var(--warn); }
.t-pendiente { background: var(--info-bg); color: var(--info); }
.t-compartido_excepcion { background: var(--violet-bg); color: var(--violet); }
.t-conflicto { background: var(--bad); color: #fff; }
.t-conflicto::before { background: #fff; }
.chip.ok { background: var(--ok-bg); color: var(--ok); } .chip.warn { background: var(--warn-bg); color: var(--warn); } .chip.bad { background: var(--bad-bg); color: var(--bad); } .chip.info { background: var(--info-bg); color: var(--info); }
.chip.gold { background: var(--accent-soft); color: color-mix(in srgb, var(--accent) 80%, var(--ink)); }
.chip.outline { background: transparent; border-color: var(--line-2); }

/* Botones */
button, .btn { font: 500 14px/1 var(--sans); min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none !important; display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; box-shadow: var(--shadow-1);
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s; -webkit-tap-highlight-color: transparent; }
button:hover, .btn:hover { border-color: color-mix(in srgb, var(--ink) 25%, var(--line-2)); background: var(--surface-2); }
button:active, .btn:active { transform: translateY(.5px); }
button.pri, .btn.pri { background: var(--brand); color: var(--brand-fg); border-color: var(--brand); box-shadow: 0 1px 2px rgb(17 24 36 / .2), inset 0 1px 0 rgb(255 255 255 / .08); }
button.pri:hover, .btn.pri:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
button.danger, .btn.danger { color: var(--bad); border-color: var(--bad-line); }
button.danger:hover { background: var(--bad-bg); }
button.ghost, .btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
button.ghost:hover, .btn.ghost:hover { background: var(--sunken); }
button.link { border: 0; background: none; color: var(--link); padding: 0; min-height: 0; box-shadow: none; font-weight: 500; }
button.link:hover { text-decoration: underline; background: none; }
button.sm, .btn.sm { min-height: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
button:disabled { opacity: .45; cursor: not-allowed; }
.btn.gmaps { gap: 8px; }
@media (max-width: 767px) { button, .btn { min-height: 44px; } button.sm, .btn.sm { min-height: 36px; } }
.actions-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 10px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--sunken); border-radius: 11px; border: 1px solid var(--line); }
.seg button, .seg a { border: 0; border-radius: 8px; min-height: 32px; background: transparent; box-shadow: none; color: var(--muted); padding: 0 12px; font-size: 13px; }
.seg button.on, .seg a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.pills { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin: 0 -16px 8px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
@media (min-width: 768px) { .pills { margin: 0 0 8px; padding: 0 0 4px; flex-wrap: wrap; } }
.pills a { flex: none; display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink-2); font-size: 13px; font-weight: 500; background: var(--surface); text-decoration: none !important; }
.pills a.on { background: var(--brand); border-color: var(--brand); color: var(--brand-fg); }

/* Formularios */
label { display: block; font-size: 13px; font-weight: 500; color: var(--ink-2); margin: 14px 0 6px; }
input, select, textarea { font: 400 16px/1.3 var(--sans); width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); color: var(--ink); transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none; }
@media (min-width: 768px) { input, select, textarea { font-size: 15px; min-height: 42px; } }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23889' stroke-width='1.8' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--ink) 22%, var(--line-2)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
textarea { min-height: 96px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; min-height: 0; padding: 0; accent-color: var(--brand); -webkit-appearance: auto; appearance: auto; flex: none; }
input[type=file] { padding: 8px; }
input[type=date], input[type=time] { min-width: 0; }
.check { display: flex; gap: 10px; align-items: center; color: var(--ink); font-size: 14px; font-weight: 400; margin: 14px 0; cursor: pointer; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; align-items: center; margin-bottom: 12px; }
.filters .check { margin: 0; }
.search-field { position: relative; grid-column: 1 / -1; }
.search-field .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-field input { padding-left: 42px; height: 48px; border-radius: 12px; font-size: 16px; }
details.filters-more > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); padding: 4px 0 10px; cursor: pointer; }
details.filters-more > summary::-webkit-details-marker { display: none; }

/* Tablas */
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.card.scroll { padding: 0; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; }
td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td, table tr:hover td { background: var(--surface-2); }

/* Avisos */
.notice { display: block; background: var(--warn-bg); border: 1px solid var(--warn-line); color: color-mix(in srgb, var(--warn) 55%, var(--ink)); border-radius: var(--r); padding: 12px 14px; margin: 10px 0; font-size: 13.5px; line-height: 1.5; }
.notice.info { background: var(--info-bg); border-color: var(--info-line); color: color-mix(in srgb, var(--info) 55%, var(--ink)); }
.notice strong { color: inherit; }
.notice .row { margin-top: 10px; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 14px; }
.error-box { background: var(--bad-bg); border: 1px solid var(--bad-line); color: var(--bad); padding: 12px 14px; border-radius: var(--r); margin: 10px 0; font-size: 14px; }
.banner { position: sticky; top: 0; z-index: 40; display: flex; gap: 10px; align-items: center; justify-content: center; background: var(--warn); color: #fff; padding: calc(8px + env(safe-area-inset-top)) 16px 8px; font-size: 13px; }
@media (min-width: 768px) { .banner { margin-left: 0; } }
.foot-note { color: var(--muted); font-size: 12.5px; margin-top: 28px; max-width: 72ch; }
details > summary { cursor: pointer; padding: 4px 0; font-weight: 500; }
details.card > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: ""; width: 8px; height: 8px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); transition: transform .2s var(--ease); flex: none; margin-right: 4px; }
details.card[open] > summary::after { transform: rotate(225deg); }
details.card[open] > summary { margin-bottom: 8px; }

/* Carga */
.loading { height: 3px; margin: 0 -16px; background: linear-gradient(90deg, transparent, var(--accent), transparent); background-size: 40% 100%; background-repeat: no-repeat; animation: load 1.1s var(--ease) infinite; border-radius: 2px; opacity: .8; }
@keyframes load { from { background-position: -40% 0; } to { background-position: 140% 0; } }
.skel { height: 14px; border-radius: 6px; background: var(--sunken); margin: 10px 0; }

/* ---------- Hoy ---------- */
.hello { color: var(--muted); font-size: 14px; margin: 0 0 2px; }
.day-title { font-size: clamp(34px, 5vw, 50px); line-height: 1.02; }
.day-title em { font-style: italic; color: color-mix(in srgb, var(--accent) 70%, var(--ink)); }
.summary { color: var(--ink-2); font-size: 15px; margin: 10px 0 0; }
.summary b { font-weight: 600; color: var(--ink); }
.quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 18px 0 10px; }
@media (min-width: 640px) { .quick { display: flex; flex-wrap: wrap; } }
.quick .btn, .quick button { justify-content: flex-start; }
@media (max-width: 639px) { .quick .btn, .quick button { min-height: 48px; } }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.tl { display: grid; grid-template-columns: 52px 18px minmax(0, 1fr); gap: 0 10px; align-items: stretch; }
.tl-time { padding-top: 15px; text-align: right; font-weight: 600; font-size: 14px; color: var(--ink); }
.tl-time small { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.tl-rail { position: relative; display: flex; justify-content: center; }
.tl-rail::before { content: ""; position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line-2); }
.tl:first-child .tl-rail::before { top: 20px; } .tl:last-child .tl-rail::before { bottom: calc(100% - 22px); }
.tl:only-child .tl-rail::before { display: none; }
.tl-dot { position: relative; margin-top: 17px; width: 11px; height: 11px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ink-2); }
.tl.fija .tl-dot { background: var(--accent); border-color: var(--accent); }
.tl.hecha .tl-dot { background: var(--ok); border-color: var(--ok); }
.tl.off .tl-dot { border-color: var(--faint); }
.tl-card { display: block; margin: 6px 0; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1); color: inherit; text-decoration: none !important; min-width: 0; transition: border-color .15s, box-shadow .15s; }
a.tl-card:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); }
.tl-card .t { font-weight: 600; display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.tl-card .t span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-card .s { color: var(--muted); font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-card .o { font-size: 13.5px; margin-top: 6px; color: var(--ink-2); }
.tl.off .tl-card { opacity: .62; }
@media (max-width: 520px) {
  .tl { grid-template-columns: 44px 14px minmax(0, 1fr); gap: 0 8px; }
  .tl-card { padding: 12px 14px; }
  .tl-card .t { flex-direction: column; align-items: flex-start; gap: 6px; }
  .tl-card .t span:first-child { white-space: normal; }
}

.task { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.card > .task:first-child { padding-top: 4px; } .card > .task:last-child { padding-bottom: 4px; }
.task .tick { flex: none; width: 22px; height: 22px; min-height: 0; padding: 0; border-radius: 7px; border: 1.5px solid var(--line-2); background: var(--surface); box-shadow: none; margin-top: 1px; display: grid; place-items: center; color: transparent; }
.task .tick:hover { border-color: var(--ok); color: var(--ok); background: var(--ok-bg); }
.task .tick .ic { width: 14px; height: 14px; stroke-width: 2.5; }
.task .body { flex: 1; min-width: 0; }
.task .body .d { color: var(--ink); }
.task .body .m { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.task .body .m a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.task.overdue .m .when { color: var(--bad); font-weight: 500; }

/* ---------- Ficha ---------- */
.ficha { display: flex; flex-direction: column; }
.ficha-main, .ficha-side { display: contents; }
.ficha section { order: 50; min-width: 0; }
.ficha .o-1 { order: 1; } .ficha .o-2 { order: 2; } .ficha .o-3 { order: 3; } .ficha .o-4 { order: 4; } .ficha .o-5 { order: 5; } .ficha .o-6 { order: 6; } .ficha .o-7 { order: 7; } .ficha .o-8 { order: 8; } .ficha .o-9 { order: 9; }
@media (min-width: 1100px) {
  .ficha { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 0 28px; align-items: start; margin-top: 8px; }
  .ficha-main, .ficha-side { display: block; min-width: 0; }
  .ficha-side > section:first-child > .section-h, .ficha-main > section:first-child > .section-h { margin-top: 0; }
}
.centro-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.centro-h .n { font-weight: 600; font-size: 15px; }
.centro-h .k { color: var(--muted); font-size: 13px; font-weight: 400; }
.addr { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 2px; font-size: 15px; }
.addr .ic { color: var(--muted); margin-top: 2px; }
.contact { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.contact:last-of-type { border-bottom: 0; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: color-mix(in srgb, var(--accent) 70%, var(--ink)); font: 400 17px/1 var(--serif); }
.contact .n { font-weight: 600; } .contact .r { color: var(--muted); font-size: 13px; }
.contact .links { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13.5px; margin-top: 4px; }
.contact .links a { display: inline-flex; align-items: center; gap: 5px; }

/* Flota del cliente */
.veh { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.veh:last-of-type { border-bottom: 0; }
.veh-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--sunken); color: var(--ink-2); }
.veh .n { font-weight: 600; } .veh .r { color: var(--muted); font-size: 13px; margin-top: 1px; }
.veh-a { display: flex; gap: 2px; }

/* Avance del mes (Hoy) */
.month-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; margin: 16px 0 2px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1); color: var(--ink-2); font-size: 14px; text-decoration: none !important; position: relative; overflow: hidden; transition: border-color .15s; }
.month-strip:hover { border-color: var(--line-2); }
.month-strip b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.month-strip .ms-t { font: italic 400 19px/1 var(--serif); color: color-mix(in srgb, var(--accent) 70%, var(--ink)); }
.ms-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--sunken); }
.ms-bar i { display: block; height: 100%; background: var(--accent); border-radius: 0 2px 2px 0; transition: width .5s var(--ease); }

/* Indicadores */
.stats { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); margin-top: 6px; }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1500px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.stats .card { margin: 0; }
.stat { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.stat:last-of-type { border-bottom: 0; }
.stat .l { color: var(--ink-2); min-width: 0; }
.stat .l small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.stat .v { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink); }
.stat .v.bad { color: var(--bad); } .stat .v.warn { color: var(--warn); }
.filters label { margin: 0 0 4px; }

/* Etapas de la oportunidad */
.pills.stage a.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); color: color-mix(in srgb, var(--accent) 75%, var(--ink)); font-weight: 600; }
.ficha-side .empty, .cols > div:last-child .empty { padding: 16px 8px; }

/* ---------- Agenda ---------- */
.agenda-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.agenda-nav { display: flex; align-items: center; gap: 6px; }
.agenda-nav strong { font-weight: 600; min-width: 0; padding: 0 6px; }
.week { display: grid; gap: 10px; }
@media (min-width: 1100px) { .week { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; } .week .day { min-height: 280px; } .week .day .list-item { flex-direction: column; align-items: flex-start; gap: 4px; } }
.day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 14px; box-shadow: var(--shadow-1); min-width: 0; }
.day.today { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); box-shadow: 0 0 0 3px var(--accent-soft); }
.day-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.day-h b { font-weight: 600; font-size: 13.5px; text-transform: capitalize; }
.day .list-item { padding: 8px 0; font-size: 13.5px; }
.day .list-item > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.day .free { color: var(--faint); font-size: 13px; padding: 6px 0; }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; font-size: 12px; }
.month .wd { color: var(--muted); font-size: 12px; font-weight: 500; padding: 4px 6px; }
.month .d { display: block; background: var(--surface); min-height: 76px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; color: inherit; text-decoration: none !important; overflow: hidden; transition: border-color .15s; }
.month .d:hover { border-color: var(--line-2); }
.month .d .n { font-weight: 600; font-size: 12.5px; margin-bottom: 2px; }
.month .d.out { opacity: .38; } .month .d.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.month .ev { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); padding: 1px 0; }
@media (max-width: 600px) { .month .d { min-height: 54px; padding: 4px; } .month .ev { font-size: 0; height: 5px; width: 5px; border-radius: 50%; background: var(--ink-2); display: inline-block; margin-right: 2px; } }

/* ---------- Mapa ---------- */
#map { height: min(68vh, 720px); min-height: 360px; border-radius: var(--r-lg); border: 1px solid var(--line); box-shadow: var(--shadow-1); z-index: 0; background: var(--sunken); }
@media (max-width: 767px) { #map { height: 60vh; margin: 0 -16px; border-radius: 0; border-left: 0; border-right: 0; } }
.leaflet-container { font-family: var(--sans) !important; }
.leaflet-popup-content-wrapper { border-radius: 12px !important; box-shadow: var(--shadow-3) !important; }
.leaflet-popup-content { margin: 12px 14px !important; font-size: 13px; line-height: 1.45; }
.leaflet-bar a { color: var(--ink) !important; }
:root[data-theme="dark"] .leaflet-tile-pane { filter: brightness(.82) contrast(1.05) saturate(.7); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .leaflet-tile-pane { filter: brightness(.82) contrast(1.05) saturate(.7); } }

/* ---------- Rutario y Google Maps ---------- */
.gmaps-box { display: grid; gap: 12px; }
.gmaps-box .row { gap: 8px; }
.gmaps-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--info-bg); color: var(--info); flex: none; }

/* ---------- Diálogos ---------- */
dialog { border: 1px solid var(--line); border-radius: 20px; padding: 0; width: min(580px, calc(100vw - 32px)); max-height: min(88vh, 900px); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-3); overscroll-behavior: contain; }
dialog[open] { animation: dlg-in .24s var(--ease); }
dialog::backdrop { background: rgb(9 13 20 / .42); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fade .2s ease; }
#dlg-body { padding: 22px 24px 24px; }
#dlg-body > h2:first-child { font: 400 26px/1.15 var(--serif); margin: 0 0 6px; letter-spacing: -.005em; }
#dlg-body form > .row:last-child, #dlg-body > .row:last-child { margin-top: 22px; justify-content: flex-start; flex-direction: row-reverse; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(10px) scale(.985); } }
@keyframes fade { from { opacity: 0; } }
@keyframes sheet-in { from { transform: translateY(100%); } }
@media (max-width: 767px) {
  dialog { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 22px 22px 0 0; border-bottom: 0; max-height: 92dvh; padding-bottom: env(safe-area-inset-bottom); }
  dialog[open] { animation: sheet-in .3s var(--ease); }
  #dlg-body { padding: 20px 18px 22px; }
  #dlg-body form > .row:last-child, #dlg-body > .row:last-child { flex-direction: column-reverse; align-items: stretch; }
  #dlg-body form > .row:last-child > *, #dlg-body > .row:last-child > * { width: 100%; }
}
.sheet { padding: 8px 12px 16px; }
.sheet-grab { width: 38px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 4px auto 10px; }
.sheet-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.sheet-nav a, .sheet-logout { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 82px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); font-size: 12.5px; font-weight: 500; text-align: center; text-decoration: none !important; padding: 8px 4px; }
.sheet-nav a .ic { width: 22px; height: 22px; color: var(--ink-2); }
.sheet-nav a.on { border-color: var(--ink-2); }
.sheet-logout { flex-direction: row; min-height: 48px; width: 100%; margin-top: 10px; color: var(--bad); box-shadow: none; }
@media (min-width: 768px) { .sheet { display: none; } }

/* Paleta de búsqueda */
.palette { width: min(640px, calc(100vw - 24px)); margin: 12vh auto auto; padding: 0; border-radius: 16px; }
.pal-in { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.pal-in .ic { color: var(--muted); }
.pal-in input { border: 0; box-shadow: none !important; padding: 18px 0; font-size: 16px; background: transparent; min-height: 58px; }
.pal-res { max-height: min(60vh, 520px); overflow-y: auto; padding: 6px; }
.pal-res .grp { font-size: 12px; color: var(--muted); padding: 10px 12px 4px; font-weight: 500; }
.pal-res a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--ink); text-decoration: none !important; min-width: 0; }
.pal-res a .ic { color: var(--muted); }
.pal-res a > span { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-res a small { color: var(--muted); margin-left: 6px; }
.pal-res a.sel, .pal-res a:hover { background: var(--sunken); }
@media (max-width: 767px) { .palette { margin: 0; width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; border: 0; padding-top: env(safe-area-inset-top); } .palette[open] { animation: fade .18s ease; } .pal-res { max-height: none; } }

/* Aviso flotante */
#toast { position: fixed; left: 50%; bottom: calc(var(--tabh) + 92px + env(safe-area-inset-bottom)); transform: translate(-50%, 8px); background: #121a27; color: #f4f1ea; padding: 11px 16px; border-radius: 12px; font-size: 14px; opacity: 0; transition: opacity .2s var(--ease), transform .2s var(--ease); pointer-events: none; z-index: 60; max-width: min(92vw, 520px); box-shadow: var(--shadow-3); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Acceso ---------- */
.auth-wrap { min-height: 100dvh; display: grid; grid-template-columns: 1fr; background: var(--canvas); }
.auth-art { display: none; }
.auth-form { display: flex; flex-direction: column; justify-content: center; padding: calc(40px + env(safe-area-inset-top)) 24px 40px; max-width: 420px; width: 100%; margin: 0 auto; }
.auth-form .mark { width: 44px; height: 44px; font-size: 28px; border-radius: 12px; margin-bottom: 28px; }
.auth-form h1 { font-size: 38px; margin-bottom: 8px; }
.auth-form form { margin-top: 18px; }
.auth-form button[type=submit] { width: 100%; min-height: 48px; margin-top: 22px; font-size: 15px; }
.auth-foot { margin-top: 28px; font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
@media (min-width: 900px) {
  .auth-wrap { grid-template-columns: minmax(0, 1.1fr) minmax(420px, 1fr); }
  .auth-art { display: flex; flex-direction: column; justify-content: space-between; padding: 48px 56px; background: #0f1b2d; color: #e8e2d4; position: relative; overflow: hidden; }
  .auth-art::before { content: ""; position: absolute; inset: 0; background: radial-gradient(1200px 600px at 110% 120%, rgb(201 164 103 / .16), transparent 60%), radial-gradient(800px 500px at -10% -20%, rgb(80 120 180 / .16), transparent 60%); }
  .auth-art > * { position: relative; }
  .auth-art .lockup { display: flex; align-items: center; gap: 12px; font-weight: 600; letter-spacing: .02em; }
  .auth-art .lockup .mark { background: #1b2c45; }
  .auth-art blockquote { margin: 0; font: 400 clamp(40px, 4.4vw, 64px)/1.04 var(--serif); letter-spacing: -.015em; max-width: 12ch; }
  .auth-art blockquote em { color: #d6b47a; }
  .auth-art .meta { color: #8e9ab0; font-size: 13px; }
  .auth-form .mark { display: none; }
}

/* ---------- Ajustes ---------- */
.theme-pick { display: inline-flex; }

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print { .side, .tabs, .fab, .top { display: none !important; } body { padding: 0 !important; background: #fff; } .card { box-shadow: none; } }

/* Mensajes y plantillas */
.msg-texto { min-height: 190px; line-height: 1.55; font-size: 15px; resize: vertical; }
.plant-list .list-item { padding: 12px 16px; }
.plant-list .list-item:last-child { border-bottom: 0; }
.plant-prev { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.var-chips { gap: 6px; }
button.chip { min-height: 30px; height: 30px; padding: 0 11px; box-shadow: none; cursor: pointer; font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace); font-size: 12px; }
button.chip:hover { border-color: var(--line-2, var(--line)); color: var(--ink); }
#dlg-body .dlg-acc { margin-top: 18px; justify-content: flex-start; flex-direction: row-reverse; }
@media (max-width: 767px) { #dlg-body .dlg-acc { flex-direction: column-reverse; align-items: stretch; } #dlg-body .dlg-acc > * { width: 100%; } }

/* Rutario: semana de lunes a viernes con su zona */
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 12px; }
.semana { display: flex; gap: 6px; align-items: stretch; margin: 0 0 14px; overflow-x: auto; scrollbar-width: none; }
.semana::-webkit-scrollbar { display: none; }
.sem-nav { flex: none; display: grid; place-items: center; width: 32px; border-radius: var(--r); color: var(--muted); text-decoration: none !important; }
.sem-nav:hover { background: var(--surface); color: var(--ink); }
.sem-dia { flex: 1 0 128px; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); color: inherit; text-decoration: none !important; min-width: 0; transition: border-color .15s, box-shadow .15s; }
.sem-dia:hover { border-color: var(--line-2); box-shadow: var(--shadow-1); }
.sem-dia.on { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.sem-dia.libre { background: transparent; border-style: dashed; }
.sd-dia { font-weight: 600; font-size: 13.5px; }
.sd-dia small { color: var(--muted); font-weight: 500; margin-left: 2px; }
.sd-zona { font-size: 12.5px; color: var(--ink-2); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.sd-n { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cartera .num { font-weight: 600; font-variant-numeric: tabular-nums; }
.zona-dia { border: 1px solid var(--line); border-radius: var(--r); padding: 8px 14px 12px; margin: 0 0 10px; }
.zona-dia legend { font-weight: 600; padding: 0 6px; }
.geo-box { margin: 0 0 12px; }
.geo-box progress { width: 100%; height: 6px; margin-top: 8px; accent-color: var(--brand); }
