/* Smart Tactical Ops — sistema visual */
:root {
  /* Sistema cromático Bauhaus — Brand Guideline v1.2 */
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #faf9f7;
  --ink: #1a1a1a;            /* negro estructural */
  --ink-2: #333333;
  --muted: #6e6e6e;
  --line: #e4e2dd;
  --line-strong: #c9c7c1;
  --accent: #f4b400;         /* amarillo Bauhaus: acento único de la pieza */
  --accent-ink: #1a1a1a;
  --accent-soft: #fdf3d3;
  --ok: #0a9f5b;             /* verde Bauhaus */
  --ok-soft: #e2f4ea;
  --warn: #8a6400;
  --warn-soft: #fdf3d3;
  --info: #1f5fbf;           /* azul Bauhaus */
  --info-soft: #e7eefa;
  --bad: #d32f2f;            /* rojo Bauhaus */
  --bad-soft: #fce9e9;
  --muted-soft: #efeeea;
  --shadow: 0 1px 2px rgba(26, 26, 26, 0.06), 0 4px 16px rgba(26, 26, 26, 0.06);
  --radius: 10px;
  --radius-sm: 7px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sidebar: 236px;
  --topbar: 56px;
  --tabbar: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #141414; --surface: #1d1d1d; --surface-2: #232323; --ink: #f2f1ee; --ink-2: #d8d7d3; --muted: #a3a29e; --line: #333333;
    --line-strong: #474747; --accent: #f4b400; --accent-ink: #1a1a1a; --accent-soft: #3a3012; --ok: #4ec98e; --ok-soft: #15301f; --warn: #e3c35c; --warn-soft: #332b10;
    --info: #7aa7e8; --info-soft: #16233a; --bad: #ef7070; --bad-soft: #3a1818; --muted-soft: #2a2a28;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 20px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --bg: #141414; --surface: #1d1d1d; --surface-2: #232323; --ink: #f2f1ee; --ink-2: #d8d7d3; --muted: #a3a29e; --line: #333333;
    --line-strong: #474747; --accent: #f4b400; --accent-ink: #1a1a1a; --accent-soft: #3a3012; --ok: #4ec98e; --ok-soft: #15301f; --warn: #e3c35c; --warn-soft: #332b10;
    --info: #7aa7e8; --info-soft: #16233a; --bad: #ef7070; --bad-soft: #3a1818; --muted-soft: #2a2a28; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14.5px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; letter-spacing: -0.01em; font-weight: 800; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-size: 0.92em; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------------------------------------------------------------- Layout */
.app { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; flex: none; background: currentColor; color: var(--ink);
  -webkit-mask: url('/img/isotipo.svg') no-repeat center / contain; mask: url('/img/isotipo.svg') no-repeat center / contain; }
.brand-lockup { display: block; background: currentColor; color: var(--ink);
  -webkit-mask: url('/img/lockup.svg') no-repeat center / contain; mask: url('/img/lockup.svg') no-repeat center / contain; }
.brand-name { font-weight: 800; letter-spacing: 0.09em; font-size: 13px; }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: 0.02em; }
.nav { padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: var(--radius-sm); text-decoration: none;
  color: var(--ink-2); font-weight: 520;
}
.nav a svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.nav a:hover { background: var(--muted-soft); }
.nav a.active { background: var(--muted-soft); color: var(--ink); box-shadow: inset 3px 0 0 var(--accent); }
.nav a.active svg { color: var(--ink); }
.nav-sep { height: 1px; background: var(--line); margin: 8px 6px; }
.sidebar-foot { padding: 12px 14px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--muted-soft); display: grid; place-items: center; font-weight: 650; font-size: 12.5px; flex: none; }
.who { min-width: 0; flex: 1; }
.who b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who span { font-size: 11.5px; color: var(--muted); }

.main { margin-left: var(--sidebar); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 15; height: var(--topbar); display: flex; align-items: center; gap: 12px; padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.topbar .title { font-weight: 650; font-size: 15px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .back { display: none; }
.content { padding: 22px 24px 48px; max-width: 1240px; width: 100%; }
.page-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .grow { flex: 1; min-width: 220px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

.tabbar { display: none; }
.mobile-only { display: none; }

@media (max-width: 899px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); }
  .topbar { padding: 0 12px; }
  .topbar .back { display: inline-flex; }
  .content { padding: 16px 16px 32px; }
  h1 { font-size: 19px; }
  .mobile-only { display: initial; }
  .desktop-only { display: none !important; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--tabbar) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line);
  }
  .tabbar a, .tabbar button {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none;
    font-size: 10.5px; color: var(--muted); background: none; border: 0; padding: 0; position: relative;
  }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar .active { color: var(--ink); } .tabbar a.active svg, .tabbar .active svg { color: var(--ink); } .tabbar .active::after { content: ''; position: absolute; top: 0; left: 25%; right: 25%; height: 3px; background: var(--accent); border-radius: 0 0 3px 3px; }
}

/* ---------------------------------------------------------------- Superficies */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card + .card { margin-top: 14px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-head h2, .card-head h3 { flex: 1; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush .card-head { padding: 14px 16px 0; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } }
@media (max-width: 899px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.stack > * + * { margin-top: 14px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.tight { gap: 6px; }
.spacer { flex: 1; }

.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; display: block; }
.stat .label { font-size: 12px; color: var(--muted); }
.stat .value { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 12px; color: var(--muted); }
a.stat:hover { border-color: var(--line-strong); }

/* ---------------------------------------------------------------- Controles */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 13.5px;
  cursor: pointer; text-decoration: none; white-space: nowrap; user-select: none;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: var(--surface-2); }
.btn:focus-visible, .input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.btn.primary:hover { filter: brightness(1.25); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--muted-soft); }
.btn.danger { color: var(--bad); }
.btn.sm { height: 31px; padding: 0 10px; font-size: 12.5px; }
.btn.icon { width: 38px; padding: 0; }
.btn.sm.icon { width: 31px; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn.block { width: 100%; }
@media (max-width: 899px) { .btn { height: 42px; } .btn.sm { height: 34px; } }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.input, select.input, textarea.input {
  width: 100%; height: 38px; padding: 0 11px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface);
  font-size: 14px; min-width: 0;
}
textarea.input { height: auto; min-height: 76px; padding: 9px 11px; resize: vertical; line-height: 1.45; }
@media (max-width: 899px) { .input, select.input { height: 44px; font-size: 16px; } textarea.input { font-size: 16px; } }
.input[readonly] { background: var(--surface-2); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }

.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 7px 12px; font-weight: 600; font-size: 13px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--ink); color: var(--surface); }
.seg button + button { border-left: 1px solid var(--line); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; background: var(--muted-soft); font-size: 12px; font-weight: 550; color: var(--ink-2); border: 1px solid transparent; }
.chip button { border: 0; background: none; cursor: pointer; padding: 0; color: var(--muted); line-height: 1; font-size: 14px; }
.chip.toggle { cursor: pointer; border-color: var(--line); background: var(--surface); }
.chip.toggle.on { background: var(--accent-soft); color: var(--ink); border-color: var(--accent); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 650; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.muted { background: var(--muted-soft); color: var(--muted); }
.badge.plain::before { display: none; }

/* ---------------------------------------------------------------- Tablas */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.t th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 650; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
.t td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.t tr:last-child td { border-bottom: 0; }
.t td.num, .t th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.t tr.click { cursor: pointer; }
.t tr.click:hover td { background: var(--surface-2); }
.t tfoot td { font-weight: 700; background: var(--surface-2); }
.t .sub td { color: var(--muted); }
@media (max-width: 760px) {
  table.t.cards thead { display: none; }
  table.t.cards, table.t.cards tbody, table.t.cards tr, table.t.cards td { display: block; width: 100%; }
  table.t.cards tr { border-bottom: 1px solid var(--line); padding: 10px 14px; }
  table.t.cards td { border: 0; padding: 3px 0; display: flex; gap: 10px; justify-content: space-between; text-align: right; }
  table.t.cards td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-align: left; flex: none; }
  table.t.cards td.lead { display: block; text-align: left; font-weight: 600; padding-bottom: 4px; }
  table.t.cards td.lead::before { display: none; }
  table.t.cards td.num { justify-content: space-between; }
  table.t.cards tfoot { display: block; }
}

/* ---------------------------------------------------------------- Listas */
.list { display: flex; flex-direction: column; }
.li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.li:last-child { border-bottom: 0; }
a.li:hover, .li.click:hover { background: var(--surface-2); cursor: pointer; }
.li .main-col { flex: 1; min-width: 0; }
.li .title { font-weight: 600; }
.li .meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.li .side { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

.progress { height: 6px; background: var(--muted-soft); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--ok); border-radius: 99px; }

/* ---------------------------------------------------------------- Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 0 16px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: none; padding: 10px 13px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 13.5px; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.tabs button .count { margin-left: 5px; font-size: 11px; background: var(--muted-soft); padding: 1px 6px; border-radius: 99px; color: var(--muted); }

/* ---------------------------------------------------------------- Estado del pedido */
.stepper { display: flex; gap: 0; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.step { flex: 1; min-width: 86px; position: relative; text-align: center; font-size: 11px; color: var(--muted); padding-top: 18px; }
.step::before { content: ''; position: absolute; top: 6px; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--line-strong); z-index: 1; }
.step::after { content: ''; position: absolute; top: 10px; left: -50%; right: 50%; height: 2px; background: var(--line); }
.step:first-child::after { display: none; }
.step.done { color: var(--ink-2); }
.step.done::before { background: var(--ok); }
.step.done::after { background: var(--ok); }
.step.current { color: var(--ink); font-weight: 700; }
.step.current::before { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), inset 0 0 0 2px var(--ink); }

.callout { border-radius: var(--radius-sm); padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; }
.callout svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.callout.ok { background: var(--ok-soft); color: var(--ok); }
.callout.warn { background: var(--warn-soft); color: var(--warn); }
.callout.bad { background: var(--bad-soft); color: var(--bad); }
.callout.info { background: var(--info-soft); color: var(--info); }
.callout .body { color: var(--ink); flex: 1; min-width: 0; }
.callout ul { margin: 6px 0 0; padding-left: 18px; }

.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { .kv { grid-template-columns: 1fr; gap: 2px; } .kv dd { margin-bottom: 8px; } }

.money-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-variant-numeric: tabular-nums; font-size: 13.5px; }
.money-row.sub { padding-left: 14px; color: var(--muted); font-size: 13px; }
.money-row.total { font-weight: 700; border-bottom-style: solid; }
.money-row.grand { font-weight: 800; font-size: 15px; border-bottom: 2px solid var(--ink); padding: 10px 0; }
.money-row.recover { color: var(--info); }
.block-tag { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 4px; background: var(--muted-soft); font-size: 10.5px; font-weight: 800; margin-right: 6px; color: var(--muted); }

.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty svg { width: 34px; height: 34px; color: var(--line-strong); margin-bottom: 8px; }

/* ---------------------------------------------------------------- Diálogos */
.overlay { position: fixed; inset: 0; background: rgba(20, 19, 17, 0.45); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade 0.12s ease; }
.dialog { background: var(--surface); border-radius: 14px; width: 100%; max-width: 560px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: var(--shadow); }
.dialog.wide { max-width: 860px; }
.dialog-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { flex: 1; }
.dialog-body { padding: 16px 18px; overflow-y: auto; }
.dialog-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
@media (max-width: 899px) {
  .overlay { align-items: flex-end; padding: 0; }
  .dialog, .dialog.wide { max-width: none; border-radius: 16px 16px 0 0; max-height: 92vh; animation: up 0.18s ease; }
  .dialog-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .dialog-foot .btn { flex: 1; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(30px); opacity: 0.6; } }

.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 36px)); }
@media (max-width: 899px) { .toasts { left: 12px; right: 12px; bottom: calc(var(--tabbar) + 12px + env(safe-area-inset-bottom)); max-width: none; } }
.toast { background: var(--ink); color: var(--surface); padding: 11px 14px; border-radius: var(--radius-sm); font-size: 13.5px; box-shadow: var(--shadow); animation: up 0.16s ease; }
.toast.bad { background: var(--bad); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }

.dropdown { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 240px; z-index: 40; padding: 6px; }
.menu button, .menu a { display: flex; width: 100%; gap: 9px; align-items: center; text-align: left; padding: 9px 10px; border: 0; background: none; border-radius: 6px; cursor: pointer; text-decoration: none; font-size: 13.5px; }
.menu button:hover, .menu a:hover { background: var(--muted-soft); }
.menu svg { width: 16px; height: 16px; color: var(--muted); }

.bell { position: relative; }
.dot { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: 10px; font-weight: 700; display: grid; place-items: center; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filters .input { width: auto; min-width: 150px; }
.filters .search { flex: 1; min-width: 200px; }
@media (max-width: 560px) { .filters .input, .filters select { flex: 1 1 140px; } }

.file { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.file + .file { margin-top: 6px; }
.file svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.file .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.drop { border: 1.5px dashed var(--line-strong); border-radius: var(--radius); padding: 18px; text-align: center; color: var(--muted); cursor: pointer; font-size: 13.5px; }
.drop svg { width: 22px; height: 22px; display: block; margin: 0 auto 6px; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

.doc-group { margin-bottom: 18px; }
.doc-group > h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.doc { display: flex; gap: 12px; align-items: center; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
.doc + .doc { margin-top: 6px; }
.doc:hover { border-color: var(--line-strong); }
.doc .main-col { flex: 1; min-width: 0; }
.doc .title { font-weight: 600; font-size: 13.5px; }
.doc .meta { font-size: 12px; color: var(--muted); margin-top: 1px; display: flex; gap: 8px; flex-wrap: wrap; }
.lock { color: var(--bad); font-size: 11px; font-weight: 700; letter-spacing: 0.02em; }

.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.ev { position: relative; padding-bottom: 16px; }
.ev::before { content: ''; position: absolute; left: -19px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); border: 2px solid var(--surface); }
.ev.estado::before { background: var(--accent); }
.ev.mensaje::before { background: var(--info); }
.ev.internal { opacity: 0.85; }
.ev .when { font-size: 12px; color: var(--muted); }
.ev .msg { font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login { width: 100%; max-width: 400px; }
.login .brand { padding: 0 0 18px; justify-content: center; }
.login .card { padding: 22px; }

.loading { display: flex; align-items: center; justify-content: center; padding: 40px; color: var(--muted); gap: 10px; }
.spin { width: 18px; height: 18px; border: 2px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.quote-result { position: sticky; top: calc(var(--topbar) + 16px); }
@media (max-width: 1100px) { .quote-result { position: static; } }
.price-big { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.compare { font-size: 12.5px; color: var(--muted); }
.flag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.flag-opt { display: flex; gap: 9px; align-items: flex-start; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; background: var(--surface); }
.flag-opt input { margin-top: 2px; accent-color: var(--accent); }
.flag-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.validation { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .validation { grid-template-columns: 1fr; } }
.vstep { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; }
.vstep.done { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); background: var(--ok-soft); }
.vstep h4 { font-size: 13px; margin-bottom: 4px; }
.spec-row { display: grid; grid-template-columns: 1fr 1.6fr auto; gap: 8px; margin-bottom: 8px; }
@media (max-width: 560px) { .spec-row { grid-template-columns: 1fr auto; } .spec-row .input:nth-child(2) { grid-column: 1 / 2; grid-row: 2; } }
.diff { font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* Marca en el login */
.login .brand-lockup { width: 210px; height: 218px; margin: 0 auto 6px; }
.login .brand { flex-direction: column; gap: 6px; }
