/* EVUR ERP — estilos. Colores tomados de la web de EVUR TOURS AND TRAVELS. */
:root {
  --ink: #0e0d2b; --ink-2: #3d3c5c; --muted: #6b6a86; --faint: #9a99b0;
  --line: #e6e6f0; --line-2: #d6d6e4;
  --bg: #f5f6fb; --card: #ffffff; --tint: #f0efff;
  --navy: #140f47; --navy-2: #1e1766; --navy-3: #2a2380;
  --brand: #3b2ee6; --brand-2: #5a4bff; --brand-ink: #2a1fc4;
  --sky: #3fb8f0; --pink: #ff3e86; --sun: #ffb020;
  --wa: #1fb855; --wa-d: #17a049;
  --ok: #138a4b; --ok-bg: #e7f6ee;
  --warn: #9a5b00; --warn-bg: #fff3dc;
  --bad: #c22553; --bad-bg: #ffe8ef;
  --info: #0b6c9c; --info-bg: #e5f5fd;
  --r-sm: 8px; --r: 12px; --r-lg: 18px;
  --shadow: 0 1px 2px rgba(14, 13, 43, .05), 0 4px 16px rgba(14, 13, 43, .06);
  --shadow-lg: 0 2px 6px rgba(14, 13, 43, .08), 0 24px 60px rgba(14, 13, 43, .22);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --side: 244px;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14.5px; line-height: 1.5; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.num, td.num, th.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.boot { display: grid; place-items: center; min-height: 100vh; color: var(--muted); }

/* ---------- Estructura ---------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--navy); color: #d9d8f2; padding: 18px 12px 12px; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: #fff; }
.brand img { max-height: 44px; max-width: 170px; object-fit: contain; }
.brand img.logo-claro { background: #fff; border-radius: 8px; padding: 4px 6px; }
.brand-mark { width: 36px; height: 36px; flex: none; border-radius: 10px; background: var(--brand); display: grid; place-items: center; font-weight: 800; color: #fff; position: relative; }
.brand-mark::after { content: ""; position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--sun); }
.brand b { display: block; font-size: 15px; letter-spacing: .04em; }
.brand small { display: block; font-size: 11px; color: #a9a7d6; letter-spacing: .02em; }
.nav { display: grid; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px;
  color: #cfcdee; font-weight: 600; font-size: 14px; text-decoration: none;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a[aria-current="page"] { background: var(--navy-3); color: #fff; box-shadow: inset 3px 0 0 var(--sun); }
.nav-sep { margin: 14px 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #8583bd; }
.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .08); position: relative; }
.me { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; border-radius: 10px; background: transparent; color: #fff; cursor: pointer; text-align: left; }
.me:hover { background: rgba(255, 255, 255, .06); }
.me small { display: block; color: #a9a7d6; font-size: 11.5px; }
.avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--brand-2); color: #fff; font-weight: 700; font-size: 13px; }
.me-menu { position: absolute; bottom: calc(100% + 6px); left: 0; right: 0; background: #fff; color: var(--ink); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; display: grid; z-index: 30; }
.me-menu button { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 9px 10px; border-radius: 8px; cursor: pointer; text-align: left; font-weight: 600; }
.me-menu button:hover { background: var(--bg); }

.scrim { display: none; }
.body { min-width: 0; display: flex; flex-direction: column; grid-column: 2; }
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 12px 28px; background: rgba(245, 246, 251, .88); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.icon-btn.menu-btn { display: none; }
.gsearch { position: relative; flex: 1; max-width: 520px; }
.gsearch .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.gsearch input { width: 100%; height: 40px; padding: 0 12px 0 38px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; }
.gsearch input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(59, 46, 230, .12); }
.pop { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; max-height: 70vh; overflow: auto; z-index: 40; }
.pop h5 { margin: 8px 10px 4px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pop a, .pop button.opt { display: flex; flex-direction: column; width: 100%; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; border: 0; background: none; text-align: left; cursor: pointer; }
.pop a:hover, .pop a.on, .pop button.opt:hover, .pop button.opt.on { background: var(--tint); }
.pop small { color: var(--muted); font-size: 12px; }
.pop .none { padding: 10px; color: var(--muted); }
.top-actions { margin-left: auto; display: flex; gap: 8px; }
.main { padding: 24px 28px 64px; width: 100%; max-width: 1360px; }

/* ---------- Encabezado de página ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 24px; font-weight: 800; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.page-head .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.crumb { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.crumb:hover { color: var(--brand-ink); text-decoration: none; }
.crumb .i { width: 15px; height: 15px; }
.title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--line-2); background: #fff; color: var(--ink);
  font-weight: 650; font-size: 14px; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .1s var(--ease);
}
.btn:hover { text-decoration: none; border-color: #c4c3d8; background: #fbfbfe; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn .i { width: 17px; height: 17px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); }
.btn-wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.btn-wa:hover { background: var(--wa-d); border-color: var(--wa-d); }
.btn-danger { color: var(--bad); }
.btn-danger:hover { background: var(--bad-bg); border-color: #f3b8c9; }
.btn-danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: rgba(14, 13, 43, .05); border-color: transparent; }
.btn-sm { height: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { background: rgba(14, 13, 43, .06); color: var(--ink); }
.icon-btn.danger:hover { background: var(--bad-bg); color: var(--bad); }
.wa-link { display: inline-flex; align-items: center; gap: 5px; color: var(--wa-d); font-weight: 600; }
.wa-link .i { width: 15px; height: 15px; }

/* ---------- Tarjetas y rejillas ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 12px; }
.card-head h2, .card-head h3 { font-size: 15.5px; font-weight: 750; }
.card-head .sub { color: var(--muted); font-size: 13px; }
.card-body { padding: 0 20px 18px; }
.card + .card, .stack > * + * { margin-top: 16px; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.split > .stack > .card + .card { margin-top: 16px; }
.sticky { position: sticky; top: 84px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { padding: 16px 18px; }
.kpi-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
.kpi-dot { width: 8px; height: 8px; border-radius: 50%; }
.kpi-value { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi-value .alt { display: block; font-size: 15px; font-weight: 700; color: var(--ink-2); }
.kpi-foot { margin-top: 6px; color: var(--muted); font-size: 12.5px; }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .02em; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fafafd; }
.t td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr[data-href] { cursor: pointer; }
.t tbody tr[data-href]:hover td { background: #fafaff; }
.t td .main-text { font-weight: 650; color: var(--ink); }
.t td .sub-text { display: block; color: var(--muted); font-size: 12.5px; }
.t th:first-child, .t td:first-child { padding-left: 20px; }
.t th:last-child, .t td:last-child { padding-right: 20px; }
.t tfoot td { font-weight: 750; background: #fafafd; border-top: 1px solid var(--line); }
.t.compact td, .t.compact th { padding: 8px 10px; }
.card > .table-wrap:first-child table th:first-child { border-top-left-radius: var(--r-lg); }

/* ---------- Distintivos ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: #eeeef5; color: var(--ink-2); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.plain::before { display: none; }
.tone-ok { background: var(--ok-bg); color: var(--ok); }
.tone-warn { background: var(--warn-bg); color: var(--warn); }
.tone-bad { background: var(--bad-bg); color: var(--bad); }
.tone-info { background: var(--info-bg); color: var(--info); }
.tone-brand { background: var(--tint); color: var(--brand-ink); }
.tone-muted { background: #eeeef5; color: var(--muted); }

/* ---------- Barra de herramientas ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.search-inline { position: relative; flex: 1; min-width: 200px; max-width: 420px; }
.search-inline .i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; }
.search-inline input { width: 100%; height: 38px; padding: 0 12px 0 34px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; }
.seg { display: inline-flex; padding: 3px; background: #ececf4; border-radius: 10px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-weight: 650; font-size: 13px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(14, 13, 43, .1); }
.seg button .count { color: var(--muted); font-weight: 600; margin-left: 4px; }

/* ---------- Formularios ---------- */
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px 14px; }
.f { grid-column: span 6; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.f.s1 { grid-column: span 1; } .f.s2 { grid-column: span 2; } .f.s3 { grid-column: span 3; } .f.s4 { grid-column: span 4; } .f.s5 { grid-column: span 5; }
.f.s8 { grid-column: span 8; } .f.s12 { grid-column: span 12; }
.f > label, .lbl { font-size: 13px; font-weight: 650; color: var(--ink-2); }
.f .req { color: var(--bad); }
.f .hint { font-size: 12px; color: var(--muted); }
input.in, select.in, textarea.in, .f input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .f select, .f textarea {
  width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.f textarea, textarea.in { resize: vertical; min-height: 76px; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand) !important; box-shadow: 0 0 0 3px rgba(59, 46, 230, .12); }
input[readonly] { background: #f7f7fb; }
.check { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); }
.section-title { display: flex; align-items: center; gap: 10px; font-size: 15.5px; font-weight: 750; }
.step { width: 26px; height: 26px; border-radius: 50%; background: var(--tint); color: var(--brand-ink); font-size: 13px; font-weight: 800; display: grid; place-items: center; flex: none; }
.form-error { background: var(--bad-bg); color: var(--bad); border-radius: 10px; padding: 10px 12px; font-weight: 600; font-size: 13.5px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

/* ---------- Selector de cliente ---------- */
.picker { position: relative; }
.picked { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfbfe; }
.picked .avatar { background: var(--brand); }
.picked-info { flex: 1; min-width: 0; }
.picked-info b { font-size: 15px; }
.picked-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--ink-2); font-size: 13px; margin-top: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ---------- Editor de servicios ---------- */
.items { display: grid; gap: 10px; }
.it-head { display: none; }
.it-row {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px 10px; align-items: end;
  padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fbfbfe;
}
.it-row > * { min-width: 0; order: 4; grid-column: span 2; }
.it-row > .cell-tipo { order: 1; grid-column: span 3; }
.it-row > .cell-desc { order: 2; grid-column: span 8; }
.it-row > .it-del { order: 3; grid-column: span 1; justify-self: end; }
.it-row > .cell-prov { grid-column: span 3; }
.it-row > .it-sub { grid-column: span 3; }
.it-row.loc > .cell-desc { grid-column: span 5; }
.it-row.loc > .cell-loc { order: 2; grid-column: span 3; }
.it-row select, .it-row input, .it-row textarea { width: 100%; min-height: 38px; padding: 7px 9px; border: 1px solid var(--line-2); border-radius: 9px; background: #fff; font-size: 13.5px; }
.it-row textarea { resize: vertical; min-height: 38px; height: 38px; line-height: 1.4; }
.it-row input[type="number"] { text-align: right; font-variant-numeric: tabular-nums; }
.it-sub { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; min-height: 38px; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 13.5px; line-height: 1.3; }
.it-sub small { font-weight: 600; font-size: 11.5px; }
.it-sub small.neg { color: var(--bad); }
.it-sub small.pos { color: var(--ok); }
.it-lbl { display: block; font-size: 11.5px; font-weight: 700; color: var(--muted); margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.it-add { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.it-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; font-size: 13px; color: var(--ink-2); }
.it-tools input { width: 70px; height: 32px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 8px; text-align: right; }

/* ---------- Resumen de totales ---------- */
.totals { display: grid; gap: 8px; }
.totals .row { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.totals .row span:first-child { color: var(--ink-2); }
.totals .row b { font-weight: 700; }
.totals .big { padding-top: 10px; border-top: 1px dashed var(--line-2); font-size: 18px; }
.totals .big b { font-weight: 800; }
.totals .good { color: var(--ok); }
.totals .bad { color: var(--bad); }

/* ---------- Progreso ---------- */
.progress { height: 6px; border-radius: 999px; background: #ececf4; overflow: hidden; min-width: 70px; }
.progress > i { display: block; height: 100%; background: var(--wa); border-radius: 999px; }
.progress.lg { height: 10px; }

/* ---------- Listas de datos ---------- */
.dl { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px 14px; font-size: 14px; }
.dl dt { color: var(--muted); font-weight: 600; }
.dl dd { margin: 0; overflow-wrap: anywhere; }
.list { display: grid; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 20px; border-top: 1px solid var(--line); }
.list-item:first-child { border-top: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .t1 { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .t2 { color: var(--muted); font-size: 12.5px; }
.ico-tile { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; }
.ico-tile .i { width: 17px; height: 17px; }
.date-tile { width: 46px; flex: none; text-align: center; border-radius: 10px; background: var(--tint); color: var(--brand-ink); padding: 5px 0; line-height: 1.1; }
.date-tile b { display: block; font-size: 17px; font-weight: 800; }
.date-tile small { font-size: 11px; font-weight: 700; text-transform: uppercase; }

.empty { padding: 34px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }
.empty .btn { margin-top: 12px; }
.note { background: var(--warn-bg); color: #6d4200; border-radius: 10px; padding: 10px 12px; font-size: 13.5px; }
.note.info { background: var(--info-bg); color: #07506f; }
.note.bad { background: var(--bad-bg); color: #8f1a3d; }
.pre { white-space: pre-wrap; }

/* ---------- Gráfico ---------- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: #ececf4; stroke-width: 1; }
.chart .axis-text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.chart .bar { fill: var(--brand); transition: opacity .15s; }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover + .bar, .chart .bar.on { fill: var(--brand-ink); }
.chart-tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; border-radius: 8px; padding: 7px 10px; font-size: 12.5px; white-space: nowrap; transform: translate(-50%, -100%); margin-top: -8px; box-shadow: var(--shadow-lg); z-index: 5; }
.chart-tip b { display: block; font-size: 13.5px; }

/* ---------- Modal ---------- */
dialog.modal { border: 0; padding: 0; border-radius: 18px; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); box-shadow: var(--shadow-lg); color: var(--ink); }
dialog.modal.wide { width: min(820px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(14, 13, 43, .45); }
dialog.modal[open] { animation: pop .18s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal form { display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 6px; }
.modal-head h2 { font-size: 17px; font-weight: 800; }
.modal-body { padding: 12px 20px 16px; overflow-y: auto; display: grid; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: #fafafd; border-radius: 0 0 18px 18px; }

/* ---------- Avisos ---------- */
.toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 100; }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 600; max-width: 380px; animation: pop .2s var(--ease); }
.toast.err { background: var(--bad); }

/* ---------- Acceso ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 600px at 10% -10%, #2a2380 0%, transparent 60%), var(--navy); }
.auth-card { width: min(420px, 100%); background: #fff; border-radius: 22px; padding: 30px 28px; box-shadow: var(--shadow-lg); }
.auth-card .brand { color: var(--ink); padding: 0 0 18px; }
.auth-card .brand small { color: var(--muted); }
.auth-card h1 { font-size: 21px; font-weight: 800; margin-bottom: 4px; }
.auth-card p.sub { color: var(--muted); margin-bottom: 18px; }
.auth-card form { display: grid; gap: 14px; }
.auth-card form .f { grid-column: auto; }
.auth-card .btn { height: 44px; }

/* ---------- Documento de cotización ---------- */
.doc { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 34px 38px; box-shadow: var(--shadow); font-size: 13.5px; color: #1b1a33; }
.doc-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; padding-bottom: 18px; border-bottom: 3px solid var(--navy); }
.doc-brand img { max-height: 64px; max-width: 220px; object-fit: contain; display: block; }
.doc-brand.fondo-oscuro { background: var(--navy); border-radius: 12px; padding: 10px 18px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.doc-brand.fondo-oscuro img { max-height: 54px; }
.logo-preview { min-height: 70px; display: grid; place-items: center; border-radius: 12px; padding: 12px; background: #fafafd; border: 1px dashed var(--line-2); }
.logo-preview.oscuro { background: var(--navy); border-color: var(--navy); }
.doc-word { font-weight: 800; font-size: 20px; letter-spacing: .04em; color: var(--navy); line-height: 1.1; }
.doc-word small { display: block; font-size: 11px; letter-spacing: .14em; color: var(--brand); font-weight: 700; margin-top: 3px; }
.doc-agency { text-align: right; font-size: 12px; color: #4a4966; line-height: 1.55; }
.doc-agency b { color: var(--navy); font-size: 13px; }
.doc-title { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; margin: 22px 0 18px; }
.doc-title .eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--brand); }
.doc-title h2 { font-size: 22px; font-weight: 800; color: var(--navy); margin-top: 4px; }
.doc-meta { text-align: right; font-size: 12.5px; color: #4a4966; line-height: 1.6; }
.doc-meta b { color: var(--navy); font-size: 14px; }
.doc-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.doc-box { background: #f6f6fb; border-radius: 10px; padding: 12px 14px; }
.doc-box h4, .doc h4 { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); margin-bottom: 6px; }
.doc-box p { line-height: 1.6; }
.doc-items { width: 100%; border-collapse: collapse; margin-bottom: 6px; }
.doc-items th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #fff; background: var(--navy); padding: 8px 10px; }
.doc-items th:first-child { border-radius: 8px 0 0 8px; } .doc-items th:last-child { border-radius: 0 8px 8px 0; }
.doc-items td { padding: 9px 10px; border-bottom: 1px solid #ececf4; vertical-align: top; }
.doc-items .tipo { font-size: 11px; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .05em; display: block; }
.doc-total { display: flex; justify-content: flex-end; margin: 12px 0 20px; }
.doc-total > div { min-width: 260px; background: var(--navy); color: #fff; border-radius: 12px; padding: 12px 16px; display: grid; gap: 3px; }
.doc-total .r { display: flex; justify-content: space-between; gap: 16px; font-variant-numeric: tabular-nums; }
.doc-total .r.big { font-size: 19px; font-weight: 800; }
.doc-total .r.pp { color: #c9c7ff; font-size: 13px; }
.doc-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 16px; }
.doc ul { margin: 0; padding-left: 18px; line-height: 1.6; }
.doc .cond { font-size: 12px; color: #4a4966; line-height: 1.6; white-space: pre-wrap; }
.doc-foot { margin-top: 20px; padding-top: 14px; border-top: 1px solid #ececf4; display: flex; justify-content: space-between; gap: 16px; font-size: 12px; color: #4a4966; flex-wrap: wrap; }
.doc-foot b { color: var(--navy); }

/* ---------- Asistente virtual ---------- */
.btn-ia { border-color: #d9d4ff; background: var(--tint); color: var(--brand-ink); }
.btn-ia:hover { background: #e6e3ff; border-color: #c9c2ff; }
.btn-ia[aria-expanded="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.ia-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(430px, 100vw); z-index: 70;
  display: flex; flex-direction: column; background: #fff; border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg); transform: translateX(105%); transition: transform .28s var(--ease);
}
.ia-panel.open { transform: none; }
.ia-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--line); }
.ia-head .grow { flex: 1; min-width: 0; line-height: 1.25; }
.ia-head small { display: block; color: var(--muted); font-size: 12px; }
.ia-logo { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--pink)); color: #fff; }
.ia-logo.sm { width: 34px; height: 34px; border-radius: 10px; }
.ia-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; background: var(--bg); overscroll-behavior: contain; }
.ia-hola { display: grid; gap: 12px; color: var(--ink-2); }
.ia-sugs { display: grid; gap: 6px; }
.ia-sug { text-align: left; border: 1px solid var(--line-2); background: #fff; border-radius: 12px; padding: 9px 12px; font-size: 13.5px; cursor: pointer; color: var(--ink); }
.ia-sug:hover { border-color: var(--brand); background: var(--tint); }
.ia-msg { max-width: 92%; padding: 10px 13px; border-radius: 16px; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.ia-msg.user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 5px; white-space: pre-wrap; }
.ia-msg.bot { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.ia-msg.bot.err { background: var(--bad-bg); border-color: #f3b8c9; color: #8f1a3d; }
.ia-msg.bot p { margin: 0 0 8px; } .ia-msg.bot p:last-of-type { margin-bottom: 0; }
.ia-msg.bot ul { margin: 4px 0 8px; padding-left: 18px; }
.ia-msg.bot li + li { margin-top: 3px; }
.ia-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ia-copy { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; border: 0; background: none; padding: 0; color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; }
.ia-copy .i { width: 13px; height: 13px; }
.ia-copy:hover { color: var(--brand-ink); }
.ia-pensando { display: flex; gap: 5px; padding: 14px 16px; }
.ia-pensando i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); animation: ia-punto 1.1s infinite ease-in-out; }
.ia-pensando i:nth-child(2) { animation-delay: .15s; } .ia-pensando i:nth-child(3) { animation-delay: .3s; }
@keyframes ia-punto { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.ia-form { display: flex; gap: 8px; align-items: flex-end; padding: 12px 12px 6px; border-top: 1px solid var(--line); }
.ia-form textarea { flex: 1; resize: none; min-height: 42px; max-height: 160px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 12px; line-height: 1.4; }
.ia-form .btn { height: 42px; width: 46px; padding: 0; }
.ia-aviso { padding: 0 14px 10px; font-size: 11.5px; color: var(--muted); }
@media print { .ia-panel { display: none !important; } }
.codigo { font-family: ui-monospace, Consolas, monospace; letter-spacing: .06em; color: var(--ink); white-space: nowrap; }
.codigo-grande { font-family: ui-monospace, Consolas, monospace; font-size: 28px; font-weight: 800; letter-spacing: .14em;
  text-align: center; padding: 14px; background: var(--tint); color: var(--brand-ink); border-radius: 12px; user-select: all; }

/* ---------- Adaptación a pantallas ---------- */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .sticky { position: static; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: min(280px, 84vw); z-index: 60; transform: translateX(-100%); transition: transform .25s var(--ease); }
  .shell.nav-open .side { transform: none; box-shadow: var(--shadow-lg); }
  .body { grid-column: 1; }
  .scrim { position: fixed; inset: 0; background: rgba(14, 13, 43, .4); z-index: 50; }
  .shell.nav-open .scrim { display: block; }
  .icon-btn.menu-btn { display: inline-grid; }
  .top { padding: 10px 16px; }
  .main { padding: 18px 16px 56px; }
  .cols-2, .cols-3 { grid-template-columns: minmax(0, 1fr); }
  .top-actions .label { display: none; }
  .doc { padding: 22px 18px; }
  .doc-head, .doc-title { flex-direction: column; align-items: flex-start; }
  .doc-agency, .doc-meta { text-align: left; }
  .doc-cols, .doc-lists { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .f, .f.s2, .f.s3, .f.s4, .f.s8 { grid-column: span 12; }
  .f.half { grid-column: span 6; }
  .f.s5 { grid-column: span 10; }
  .f.s1 { grid-column: span 2; }
  .page-head h1 { font-size: 21px; }
  .dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .dl dd { margin-bottom: 8px; }
  .card-head, .toolbar { padding-left: 16px; padding-right: 16px; }
  .card-body { padding: 0 16px 16px; }
  .t th:first-child, .t td:first-child { padding-left: 16px; }
  .list-item { padding: 11px 16px; }
  .t.stack-sm thead { display: none; }
  .t.stack-sm tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .t.stack-sm td { padding: 0 !important; border: 0; }
  .t.stack-sm td.hide-sm { display: none; }
  .t.stack-sm td.num { text-align: right; }
  .doc-total > div { min-width: 0; width: 100%; }
  .picked { flex-wrap: wrap; }
  .picked-info { flex: 1 1 calc(100% - 60px); }
  .picked > div:last-child { width: 100%; justify-content: flex-start !important; }
  .picked-meta span { white-space: nowrap; }
  .it-row > .cell-tipo { grid-column: span 10; }
  .it-row > .it-del { order: 2; grid-column: span 2; }
  .it-row > .cell-desc, .it-row.loc > .cell-desc { order: 3; grid-column: span 12; }
  .it-row > .cell-prov, .it-row.loc > .cell-loc { order: 4; grid-column: span 12; }
  .it-row > .cell-n, .it-row > .cell-n.n-cant { grid-column: span 4; }
  .it-row > .it-sub { grid-column: span 12; }
}

/* ---------- Impresión (cotización en PDF) ---------- */
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; font-size: 12.5px; }
  .side, .top, .no-print, .toasts, .scrim { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; max-width: none; }
  .split { display: block; }
  .doc { border: 0; box-shadow: none; padding: 0; border-radius: 0; }
  .doc-items th, .doc-total > div { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .doc-box { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .doc-items tr, .doc-lists, .doc-total { break-inside: avoid; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
