/* ============================================================
   Klokk — base.css
   Layout: barra lateral oscura fija (272px) + espacio de trabajo claro;
   el contenido vive en una tarjeta blanca redondeada con cabecera de módulo,
   sub-navegación horizontal, barra de herramientas y tabla densa.
   ============================================================ */

:root {
  --font-ui: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* superficies y texto */
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #f3f5f9;
  --surface-3: #e9edf3;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --fg: #0b0d14;
  --fg-2: #3b4458;
  --muted: #64748b;
  --muted-2: #94a3b8;

  /* marca */
  --primary: #2d7ff9;
  --primary-hover: #1a5fc8;
  --primary-soft: #eef4ff;
  --on-primary: #ffffff;
  --accent: #1a5fc8;
  --accent-hover: #154ea6;
  --accent-soft: #e4eefe;
  --on-accent: #ffffff;

  /* semánticos */
  --ok: #1f9a5a;  --ok-soft: #e3f6ec;
  --warn: #d98c00; --warn-soft: #fff4dc;
  --danger: #d8413c; --danger-soft: #fde8e7;
  --info: #2d7ff9; --info-soft: #eef4ff;
  --neutral: #6b7390; --neutral-soft: #eef0f5;

  /* barra lateral */
  --sb-bg: #1c2233;
  --sb-fg: #c3c8d6;
  --sb-fg-strong: #ffffff;
  --sb-hover: #273047;
  --sb-active: #2f3a55;
  --sb-border: #2a3349;
  --sb-input: #273047;

  /* banner */
  --banner-bg: #2d7ff9;
  --banner-fg: #ffffff;

  --shadow-sm: 0 1px 2px rgba(20, 24, 40, .06);
  --shadow: 0 4px 16px rgba(20, 24, 40, .08);
  --shadow-lg: 0 18px 48px rgba(20, 24, 40, .18);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;

  --sidebar-w: 272px;
  --topbar-h: 56px;
  --banner-h: 44px;

  --chart-1: #2457d6; --chart-2: #5250d8; --chart-3: #1f9a5a; --chart-4: #d98c00; --chart-5: #d8413c; --chart-6: #2a9fd4;
  --chart-grid: #e8eaf1;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d14; --surface: #141825; --surface-2: #1c2233; --surface-3: #232b3d;
    --border: #2a3349; --border-strong: #3b4a68;
    --fg: #e7eaf2; --fg-2: #c3c8d6; --muted: #929ab0; --muted-2: #6d7489;
    --primary: #2d7ff9; --primary-hover: #5a9bff; --primary-soft: #1a2a4a; --on-primary: #ffffff;
    --accent: #5a9bff; --accent-hover: #7db1ff; --accent-soft: #1a2a4a; --on-accent: #0b0d14;
    --ok: #3fc47c; --ok-soft: #16301f; --warn: #f0b23c; --warn-soft: #3a2d10; --danger: #f06b66; --danger-soft: #3b1c1b; --info: #5a9bff; --info-soft: #1a2a4a;
    --neutral: #9aa1b4; --neutral-soft: #262c3b;
    --sb-bg: #0b0d14; --sb-fg: #b7bdcc; --sb-hover: #1c2233; --sb-active: #273047; --sb-border: #1c2233; --sb-input: #1c2233;
    --banner-bg: #1a5fc8;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow: 0 4px 16px rgba(0,0,0,.4); --shadow-lg: 0 18px 48px rgba(0,0,0,.6);
    --chart-grid: #2a3349;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0d14; --surface: #141825; --surface-2: #1c2233; --surface-3: #232b3d;
  --border: #2a3349; --border-strong: #3b4a68;
  --fg: #e7eaf2; --fg-2: #c3c8d6; --muted: #929ab0; --muted-2: #6d7489;
  --primary: #2d7ff9; --primary-hover: #5a9bff; --primary-soft: #1a2a4a; --on-primary: #ffffff;
  --accent: #5a9bff; --accent-hover: #7db1ff; --accent-soft: #1a2a4a; --on-accent: #0b0d14;
  --ok: #3fc47c; --ok-soft: #16301f; --warn: #f0b23c; --warn-soft: #3a2d10; --danger: #f06b66; --danger-soft: #3b1c1b; --info: #5a9bff; --info-soft: #1a2a4a;
  --neutral: #9aa1b4; --neutral-soft: #262c3b;
  --sb-bg: #0b0d14; --sb-fg: #b7bdcc; --sb-hover: #1c2233; --sb-active: #273047; --sb-border: #1c2233; --sb-input: #1c2233;
  --banner-bg: #1a5fc8;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow: 0 4px 16px rgba(0,0,0,.4); --shadow-lg: 0 18px 48px rgba(0,0,0,.6);
  --chart-grid: #2a3349;
  color-scheme: dark;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--font-ui); font-size: 14px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; text-wrap: balance; line-height: 1.25; }
h1 { font-size: 24px; } h2 { font-size: 18px; } h3 { font-size: 15px; } h4 { font-size: 13px; }
p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { max-width: 100%; }
table { border-collapse: collapse; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.muted-2 { color: var(--muted-2); }
.small { font-size: 12px; }
.xs { font-size: 11px; }
.strong { font-weight: 600; }
.right { text-align: right; }
.center { text-align: center; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.gap-4 { gap: 4px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mb-16 { margin-bottom: 16px; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ok { color: var(--ok); } .warn { color: var(--warn); } .danger { color: var(--danger); } .info { color: var(--info); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- app frame ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100%; }
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  background: var(--sb-bg); color: var(--sb-fg);
  display: flex; flex-direction: column; min-width: 0;
  border-right: 1px solid var(--sb-border);
}
.sb-top { display: flex; align-items: center; justify-content: space-between; height: var(--topbar-h); padding: 0 16px 0 18px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--sb-fg-strong); font-weight: 700; font-size: 18px; letter-spacing: -.01em; text-decoration: none; }
.brand svg { height: 30px; width: auto; display: block; }
.brand-mark { width: 24px; height: 24px; border-radius: 7px; background: linear-gradient(135deg, var(--primary), var(--accent)); display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 800; }
.sb-tools { display: flex; gap: 2px; }
.sb-tools .icon-btn { color: var(--sb-fg); }
.sb-tools .icon-btn:hover { background: var(--sb-hover); color: var(--sb-fg-strong); }
.company {
  margin: 4px 12px 10px; display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius); border: 1px solid var(--sb-border); background: var(--sb-input);
  color: var(--sb-fg-strong); font-weight: 600; cursor: pointer; width: calc(100% - 24px); text-align: left;
}
.company:hover { background: var(--sb-hover); }
.company .avatar { background: var(--sb-active); color: var(--sb-fg-strong); }
.company .chev { margin-left: auto; color: var(--sb-fg); }
.nav { flex: 1 1 auto; overflow-y: auto; padding: 0 12px; display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px;
  color: var(--sb-fg); font-weight: 500; font-size: 14.5px; text-decoration: none;
}
.nav a:hover { background: var(--sb-hover); color: var(--sb-fg-strong); text-decoration: none; }
.nav a.active { background: var(--sb-active); color: var(--sb-fg-strong); font-weight: 600; }
.nav a svg { width: 18px; height: 18px; flex: 0 0 auto; opacity: .9; }
.nav .nav-config { margin-top: 6px; font-size: 13px; color: var(--muted-2); }
.nav .subs { display: flex; flex-direction: column; gap: 1px; padding: 2px 0 6px; }
.nav .subs a.sub { padding: 7px 12px 7px 42px; font-size: 13.5px; font-weight: 500; color: var(--sb-fg); }
.nav .subs a.sub.active { background: var(--sb-active); color: var(--sb-fg-strong); font-weight: 600; }
.kbd-inv { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 5px; background: rgba(255,255,255,.22); color: #fff; font-size: 11px; font-weight: 700; }
.info-dot { display: inline-grid; place-items: center; width: 18px; height: 18px; color: var(--muted); }
.info-dot svg { width: 16px; height: 16px; }
.gem-tip { position: absolute; right: 0; top: calc(100% + 10px); width: 250px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 14px; z-index: 30; }
.onboard { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.onboard .txt { padding: 24px 28px; display: flex; flex-direction: column; gap: 14px; }
.onboard .txt h2 { font-size: 22px; }
.onboard .art { background: linear-gradient(135deg, var(--accent-soft), var(--primary-soft)); display: grid; place-items: center; padding: 28px; }
.onboard ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.onboard li { display: flex; align-items: center; gap: 10px; }
.onboard li .tick { width: 20px; height: 20px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; flex: 0 0 auto; }
.onboard li .tick svg { width: 12px; height: 12px; }
@media (max-width: 900px) { .onboard { grid-template-columns: minmax(0, 1fr); } .onboard .art { display: none; } }
.empty-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 32px; align-items: center; padding: 40px 32px; }
.empty-hero .art { aspect-ratio: 1; max-width: 360px; width: 100%; margin: 0 auto; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; padding: 36px; }
.empty-hero .art .doc-preview { width: 100%; transform: rotate(-3deg); }
.empty-hero h2 { font-size: 26px; margin-bottom: 14px; }
.empty-hero ul { margin: 0 0 20px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.empty-hero li { display: flex; gap: 10px; align-items: center; }
.empty-hero li svg { width: 18px; height: 18px; color: var(--ok); }
@media (max-width: 900px) { .empty-hero { grid-template-columns: minmax(0, 1fr); } .empty-hero .art { max-width: 220px; } }
.learn { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.learn .ico { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; color: var(--muted); }
.learn .ico svg { width: 18px; height: 18px; }
.date-range { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); font-weight: 500; white-space: nowrap; }
.date-range svg { width: 16px; height: 16px; color: var(--muted); }
.view-select { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); font-weight: 600; min-width: 180px; justify-content: space-between; }
.view-select svg { width: 16px; height: 16px; color: var(--muted); }
.list-bar { display: flex; align-items: center; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 12px 12px 0 0; background: var(--surface); flex-wrap: wrap; }
.list-bar + .table-wrap { border-top: 0; border-radius: 0 0 12px 12px; }
.list-bar .search { flex: 0 1 260px; }
.doc-view { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; }
@media (max-width: 1100px) { .doc-view { grid-template-columns: minmax(0, 1fr); } }
.doc-paper { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 28px 32px; display: flex; flex-direction: column; gap: 20px; }
.doc-paper .head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.doc-paper .party { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.doc-paper .party .n { font-weight: 700; font-size: 15px; }
.side-panel { display: flex; flex-direction: column; gap: 12px; }
.side-panel .card { padding: 14px; }
.sb-bottom { padding: 8px 12px 12px; border-top: 1px solid var(--sb-border); display: flex; flex-direction: column; gap: 2px; }
.sb-bottom a, .sb-bottom button {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; width: 100%; text-align: left;
  color: var(--sb-fg); background: transparent; border: 0; font-weight: 500; text-decoration: none;
}
.sb-bottom a:hover, .sb-bottom button:hover { background: var(--sb-hover); color: var(--sb-fg-strong); text-decoration: none; }
.sb-bottom .chev { margin-left: auto; }
.sb-bottom svg { width: 18px; height: 18px; flex: 0 0 auto; }
.sb-bottom .chev svg { width: 16px; height: 16px; }
.sb-bottom .avatar { background: var(--sb-active); color: var(--sb-fg-strong); }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }
.banner {
  height: var(--banner-h); background: var(--banner-bg); color: var(--banner-fg);
  display: flex; align-items: center; gap: 14px; padding: 0 20px; font-size: 13px;
}
.banner .progress { width: 160px; height: 4px; background: rgba(255,255,255,.25); border-radius: 4px; overflow: hidden; }
.banner .progress > span { display: block; height: 100%; background: #fff; border-radius: 4px; }
.banner .sep { width: 1px; height: 20px; background: rgba(255,255,255,.3); }
.banner .btn { background: #fff; color: var(--banner-bg); border: 0; font-weight: 600; }
.banner .close { margin-left: 4px; color: #fff; }
.topbar-mobile { display: none; align-items: center; gap: 8px; height: var(--topbar-h); padding: 0 12px; background: var(--sb-bg); color: var(--sb-fg-strong); }
.topbar-mobile .icon-btn { color: var(--sb-fg-strong); }
.workspace { flex: 1 1 auto; padding: 12px; display: flex; min-width: 0; }
.content {
  flex: 1 1 auto; background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); min-width: 0; display: flex; flex-direction: column;
}
.page { padding: 20px 24px 32px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.page.wide { max-width: none; }

@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 60; transform: translateX(-100%); transition: transform .2s ease; height: 100vh; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .sb-backdrop { position: fixed; inset: 0; background: rgba(10,12,20,.5); z-index: 55; }
  .topbar-mobile { display: flex; }
  .banner { display: none; }
  .workspace { padding: 8px; }
  .page { padding: 16px; }
}

/* ---------- module header / subnav / toolbar ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; display: flex; align-items: center; gap: 10px; }
.page-head .count { font-size: 13px; font-weight: 500; color: var(--muted); background: var(--surface-3); padding: 2px 8px; border-radius: 999px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.subnav { display: flex; gap: 2px; padding: 4px; background: var(--surface-3); border-radius: 10px; width: max-content; max-width: 100%; overflow-x: auto; }
.subnav a, .subnav button {
  padding: 7px 14px; border-radius: 8px; font-weight: 600; color: var(--muted); white-space: nowrap; border: 0; background: transparent; text-decoration: none; font-size: 13.5px;
}
.subnav a:hover, .subnav button:hover { color: var(--fg); text-decoration: none; }
.subnav a.active, .subnav button.active { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-sm); }
.tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--border); }
.tabs button { background: none; border: 0; padding: 10px 2px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.active { color: var(--fg); border-bottom-color: var(--primary); }
.tabs button:hover { color: var(--fg); }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1 1 auto; }
.search { position: relative; min-width: 220px; flex: 0 1 320px; }
.search input { padding-left: 34px; width: 100%; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 12.5px; font-weight: 500; color: var(--fg-2); }
.chip.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.chip button { border: 0; background: none; padding: 0; color: inherit; display: grid; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--fg); font-weight: 600; font-size: 13.5px; white-space: nowrap;
  transition: background .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.btn:hover { background: var(--surface-2); border-color: var(--muted-2); text-decoration: none; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--fg-2); }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; }
.btn-soft { background: var(--primary-soft); border-color: transparent; color: var(--primary); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn-lg { height: 42px; padding: 0 18px; font-size: 14.5px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn {
  width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 8px; border: 0; background: transparent; color: var(--fg-2);
}
.icon-btn:hover { background: var(--surface-3); color: var(--fg); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.sm { width: 28px; height: 28px; } .icon-btn.sm svg { width: 15px; height: 15px; }
.split { display: inline-flex; }
.split .btn:first-child { border-radius: 8px 0 0 8px; }
.split .btn:last-child { border-radius: 0 8px 8px 0; margin-left: -1px; padding: 0 8px; }

/* ---------- inputs ---------- */
.input, .select, .textarea {
  height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--fg); width: 100%; min-width: 0;
}
.textarea { height: auto; min-height: 84px; padding: 8px 10px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: var(--primary); }
.input::placeholder { color: var(--muted-2); }
.select { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.input.sm, .select.sm { height: 30px; font-size: 13px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field .label { font-size: 12.5px; font-weight: 600; color: var(--fg-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.form-grid .span-2 { grid-column: span 2; }
/* campo de ubicación (assets/ubicacion.js): buscador con sugerencias + mapa */
.ub { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ub-caja { position: relative; }
.ub-caja .ub-input { padding-right: 38px; }
.ub-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.ub-btn.activo { color: var(--primary); }
.ub-lista { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; display: flex; flex-direction: column; gap: 1px; padding: 4px; max-height: 280px; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); }
.ub-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; border-radius: 7px; background: none; color: var(--fg); font: inherit; text-align: left; cursor: pointer; }
.ub-item:hover, .ub-item.activo { background: var(--surface-2); }
.ub-item-ico { width: 16px; height: 16px; display: inline-grid; color: var(--muted); flex: none; } .ub-item-ico svg { width: 16px; height: 16px; }
.ub-item-t { font-size: 13.5px; font-weight: 600; } .ub-item-s { font-size: 12px; color: var(--muted); }
.ub-msg { font-size: 12.5px; color: var(--muted); padding: 8px; }
.ub-pie { font-size: 10.5px; color: var(--muted); text-align: right; padding: 4px 8px 2px; border-top: 1px solid var(--border); margin-top: 2px; }
.ub-panel { display: flex; flex-direction: column; gap: 6px; }
.ub-panel .fx-mapa { cursor: crosshair; }
.ub-pie-mapa { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.ub-pie-mapa .link-btn { text-decoration: none; white-space: nowrap; }
.ub-pie-mapa .link-btn:hover { text-decoration: underline; }
@media (max-width: 640px) { .form-grid { grid-template-columns: minmax(0, 1fr); } .form-grid .span-2 { grid-column: auto; } }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }
.switch { position: relative; width: 36px; height: 20px; border-radius: 999px; background: var(--border-strong); border: 0; padding: 0; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: var(--shadow-sm); }
.switch[aria-checked="true"] { background: var(--primary); }
.switch[aria-checked="true"]::after { transform: translateX(16px); }

/* ---------- cards / kpis ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; min-width: 0; }
.card.pad-0 { padding: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h3 { font-size: 15px; }
.card.soft { background: var(--surface-2); }
.card.accent { background: var(--accent-soft); border-color: transparent; }
.kpi { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); min-width: 0; }
.kpi .label { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.kpi .value { font-size: 24px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi .delta { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.kpi .delta.up { color: var(--ok); } .kpi .delta.down { color: var(--danger); }
.kpi .hint { font-size: 12px; color: var(--muted); }
.kpi .spark { margin-top: 4px; }
.stat-list { display: grid; gap: 8px; }
.stat { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.stat:last-child { border-bottom: 0; }
.stat .v { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- badges / status ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--neutral-soft); color: var(--neutral); }
.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.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.primary { background: var(--primary-soft); color: var(--primary); }
.badge.plain::before { display: none; }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px; font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--fg-2); }
.pill-ai { display: inline-flex; align-items: center; height: 16px; padding: 0 5px; border-radius: 4px; font-size: 10px; font-weight: 700; background: var(--primary); color: var(--on-primary); letter-spacing: .04em; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); }
.avatar { width: 30px; height: 30px; border-radius: 8px; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--primary-soft); color: var(--primary); flex: 0 0 auto; }
.avatar.round { border-radius: 50%; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; } .avatar.lg { width: 44px; height: 44px; font-size: 16px; border-radius: 12px; }

/* ---------- tables ---------- */
.table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; background: var(--surface); }
.table { width: 100%; font-size: 13.5px; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: middle; }
.table th { position: sticky; top: 0; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .02em; z-index: 1; user-select: none; }
.table th.sortable { cursor: pointer; }
.table th.sortable:hover { color: var(--fg); }
.table th .sort { margin-left: 4px; opacity: .6; font-size: 10px; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.selected { background: var(--primary-soft); }
.table tbody tr:last-child td { border-bottom: 0; }
.table td.right, .table th.right { text-align: right; }
.table td.num { font-variant-numeric: tabular-nums; }
.table td.wrap { white-space: normal; min-width: 220px; }
.table .cell-check { width: 36px; padding-right: 0; }
.table .cell-check input { accent-color: var(--primary); width: 15px; height: 15px; display: block; }
.table tfoot td { background: var(--surface-2); font-weight: 600; border-top: 1px solid var(--border); }
.table .primary-cell { font-weight: 600; color: var(--fg); }
.table .sub { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.table .row-actions { opacity: 0; transition: opacity .1s; display: inline-flex; gap: 2px; }
.table tr:hover .row-actions { opacity: 1; }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.pager { display: inline-flex; gap: 4px; align-items: center; }
.pager button { height: 28px; min-width: 28px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--fg-2); font-size: 12.5px; }
.pager button.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.pager button[disabled] { opacity: .4; cursor: default; }
.bulk-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--primary-soft); border: 1px solid var(--primary); border-radius: 8px; color: var(--primary); font-weight: 600; flex-wrap: wrap; }
.bulk-bar .btn { height: 30px; }

/* ---------- empty state ---------- */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 48px 24px; color: var(--muted); }
.empty .ico { width: 56px; height: 56px; border-radius: 16px; background: var(--surface-3); display: grid; place-items: center; color: var(--muted); margin-bottom: 6px; }
.empty .ico svg { width: 26px; height: 26px; }
.empty h3 { color: var(--fg); }
.empty p { max-width: 42ch; }

/* ---------- dropdown / menu ---------- */
.dropdown { position: relative; }
.menu {
  position: absolute; z-index: 40; min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg);
  padding: 6px; display: flex; flex-direction: column; gap: 1px; top: calc(100% + 6px); left: 0;
}
.menu.right { left: auto; right: 0; }
.menu.up { top: auto; bottom: calc(100% + 6px); }
.menu .item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; border: 0; background: none; color: var(--fg); text-align: left; width: 100%; font-weight: 500; text-decoration: none; font-size: 13.5px; }
.menu .item:hover { background: var(--surface-3); text-decoration: none; }
.menu .item svg { width: 16px; height: 16px; color: var(--muted); }
.menu .item.danger { color: var(--danger); }
.menu .item .kbd { margin-left: auto; }
.menu .sep { height: 1px; background: var(--border); margin: 4px 2px; }
.menu .head { padding: 6px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.kbd { font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; background: var(--surface-2); }

/* ---------- modal / drawer / toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(12, 15, 26, .45); z-index: 80; display: flex; align-items: center; justify-content: center; padding: 16px; backdrop-filter: blur(2px); }
.modal { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); width: min(640px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; border: 1px solid var(--border); }
.modal.lg { width: min(960px, 100%); }
.modal.sm { width: min(440px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 17px; }
.modal-body { padding: 20px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 14px 14px; }
.drawer-overlay { position: fixed; inset: 0; background: rgba(12, 15, 26, .35); z-index: 80; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--surface); box-shadow: var(--shadow-lg); z-index: 81; display: flex; flex-direction: column; border-left: 1px solid var(--border); animation: slideIn .18s ease; }
.drawer.lg { width: min(800px, 100%); }
@keyframes slideIn { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer .modal-head { padding: 14px 20px; }
.drawer .modal-body { flex: 1 1 auto; }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px; background: var(--fg); color: var(--bg); box-shadow: var(--shadow-lg); font-weight: 500; font-size: 13.5px; animation: toastIn .18s ease; max-width: min(420px, 90vw); }
.toast.ok { background: var(--ok); color: #fff; } .toast.danger { background: var(--danger); color: #fff; } .toast.warn { background: var(--warn); color: #fff; }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- global search palette ---------- */
.palette { width: min(640px, 100%); align-self: flex-start; margin-top: 10vh; }
.palette .modal-body { padding: 8px; gap: 2px; max-height: 60vh; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.palette-input input { border: 0; background: none; flex: 1; font-size: 16px; outline: none; }
.palette .res { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; width: 100%; border: 0; background: none; text-align: left; color: var(--fg); }
.palette .res:hover, .palette .res.active { background: var(--surface-3); }
.palette .res .sub { color: var(--muted); font-size: 12px; margin-left: auto; }

/* ---------- kanban ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.kcol { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; display: flex; flex-direction: column; min-height: 200px; }
.kcol-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; font-weight: 600; font-size: 13.5px; }
.kcol-head .count { color: var(--muted); font-weight: 500; }
.kcol-head .total { font-size: 12px; color: var(--muted); display: block; font-weight: 500; }
.kcol-body { display: flex; flex-direction: column; gap: 8px; padding: 0 8px 8px; min-height: 60px; flex: 1; }
.kcol.over { outline: 2px dashed var(--primary); outline-offset: -4px; }
.kcard { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; cursor: grab; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 6px; }
.kcard:active { cursor: grabbing; }
.kcard .t { font-weight: 600; }
.kcard .m { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.kcard.dragging { opacity: .5; }

/* ---------- misc ---------- */
.progress-bar { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.progress-bar > span { display: block; height: 100%; background: var(--primary); border-radius: 6px; }
.progress-bar.ok > span { background: var(--ok); } .progress-bar.warn > span { background: var(--warn); } .progress-bar.danger > span { background: var(--danger); }
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline .ev { display: grid; grid-template-columns: 20px 1fr; gap: 10px; padding-bottom: 14px; position: relative; }
.timeline .ev::before { content: ""; position: absolute; left: 9px; top: 18px; bottom: 0; width: 2px; background: var(--border); }
.timeline .ev:last-child::before { display: none; }
.timeline .ev .ico { width: 20px; height: 20px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; }
.timeline .ev .ico svg { width: 12px; height: 12px; }
.split-view { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; }
@media (max-width: 1100px) { .split-view { grid-template-columns: minmax(0, 1fr); } }
.list { display: flex; flex-direction: column; }
.list .li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.list .li:last-child { border-bottom: 0; }
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px) { .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .quick { grid-template-columns: minmax(0, 1fr); } }
.quick a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--fg); text-decoration: none; transition: box-shadow .12s, transform .12s; }
.quick a:hover { box-shadow: var(--shadow); text-decoration: none; transform: translateY(-1px); }
.quick a.hero { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.quick a.hero .q-ico { background: rgba(255,255,255,.18); color: #fff; }
.quick a.hero .s { color: inherit; opacity: .85; }
.quick .q-ico { width: 40px; height: 40px; border-radius: 10px; background: var(--surface-3); color: var(--fg-2); display: grid; place-items: center; flex: 0 0 auto; }
.quick .q-ico svg { width: 20px; height: 20px; }
.quick .t { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.quick .s { font-size: 12.5px; color: var(--muted); }
.quick .chev { margin-left: auto; opacity: .6; }
.doc-preview { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; box-shadow: var(--shadow); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c, var(--primary)); margin-right: 6px; vertical-align: -1px; }
.doc-lines { width: 100%; }
.doc-lines th, .doc-lines td { padding: 8px 6px; border-bottom: 1px solid var(--border); font-size: 13px; }
.doc-lines th { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; text-align: left; }
.doc-lines .input, .doc-lines .select { height: 32px; }
.totals { margin-left: auto; width: min(360px, 100%); display: grid; gap: 6px; }
.totals .tr { display: flex; justify-content: space-between; font-size: 13.5px; }
.totals .tr.total { font-size: 16px; font-weight: 700; border-top: 1px solid var(--border); padding-top: 8px; margin-top: 4px; }
.setup-list .li { align-items: flex-start; }
.setup-list .done { color: var(--ok); }
.help-link { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }

/* ---------- avisos en línea (notice) ---------- */
.notice { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--fg); font-size: 13px; }
.notice svg { width: 16px; height: 16px; flex: none; }
.notice.info { background: var(--info-soft); border-color: transparent; color: var(--info); }
.notice.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.notice.danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.notice.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.notice a { color: inherit; font-weight: 600; margin-left: auto; }
.btn-outline { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-soft); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ---------- calendario mensual (fiscal / ausencias) ---------- */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.cal-head { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); text-align: center; padding: 6px 0; }
.cal-cell { min-height: 84px; border-radius: 8px; background: var(--surface-2); padding: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-cell.off { background: transparent; }
.cal-cell.weekend { background: var(--surface-3); }
.cal-cell.today .cal-day { background: var(--primary); color: var(--on-primary); }
.cal-day { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--fg-2); }
.cal-ev { border: 0; border-radius: 5px; padding: 2px 6px; font-size: 11px; font-weight: 500; text-align: left; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: inherit; }
.cal-ev:hover { filter: brightness(.95); }
@media (max-width: 760px) { .cal-cell { min-height: 56px; padding: 4px; } .cal-ev { font-size: 10px; padding: 1px 4px; } }

/* ---------- casillas de modelos tributarios ---------- */
.table.casillas td { vertical-align: middle; }
.table.casillas input.input.sm { height: 28px; padding: 0 8px; font-size: 12.5px; }
.table.casillas td { padding: 6px 8px; }
.table.casillas input.input.sm { width: 84px !important; }
.table.casillas td:first-child { white-space: normal; }

@media (hover: none) { .table .row-actions { opacity: 1; } }

.tabs { overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { white-space: nowrap; flex: none; }


/* ---------- asistente de contratación (planes) ---------- */
.plans-overlay { padding: 24px; align-items: stretch; }
.plans { background: var(--surface); color: var(--fg); border-radius: 16px; box-shadow: var(--shadow-lg); width: min(1240px, 100%); margin: auto; max-height: calc(100vh - 48px); display: flex; flex-direction: column; border: 1px solid var(--border); overflow: hidden; }
.plans-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--border); }
.plans-head .icon-btn { justify-self: end; }
.plans-logo svg { height: 34px; width: auto; display: block; color: var(--fg); }
.plans-steps { list-style: none; display: flex; align-items: center; gap: 0; margin: 0; padding: 0; }
.plans-steps li { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--muted); cursor: default; }
.plans-steps li + li::before { content: ""; width: 48px; height: 2px; background: var(--border); margin: 0 12px; }
.plans-steps li .n { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; font-size: 13px; color: var(--muted); background: var(--surface); }
.plans-steps li .n svg { width: 14px; height: 14px; }
.plans-steps li.active { color: var(--fg); }
.plans-steps li.active .n { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.plans-steps li.done { color: var(--fg-2); cursor: pointer; }
.plans-steps li.done .n { border-color: var(--primary); color: var(--primary); }
.plans-body { padding: 24px 28px; overflow: auto; display: flex; flex-direction: column; gap: 18px; }
.plans-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.plans-title h2 { font-size: 26px; letter-spacing: -.01em; }
.plans-trial { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.plans-trial svg { width: 16px; height: 16px; }
.plans-controls { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.segment { display: inline-flex; padding: 4px; border-radius: 12px; background: var(--surface-3); gap: 4px; }
.segment button { border: 0; background: transparent; padding: 8px 16px; border-radius: 9px; font-weight: 600; color: var(--muted); font-size: 14px; font-family: inherit; white-space: nowrap; }
.segment button.active { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-sm); }
.plans-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.plan-card { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); display: flex; flex-direction: column; min-width: 0; }
.plan-card.popular { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.plan-card.enterprise { background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%); }
.plan-top { padding: 22px 22px 18px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--border); }
.plan-top h3 { font-size: 24px; letter-spacing: -.01em; }
.plan-price { display: flex; align-items: baseline; gap: 6px; margin-top: 8px; }
.plan-price .amount { font-size: 36px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.plan-price .per { color: var(--muted); font-weight: 500; }
.plan-top .strike { color: var(--muted); text-decoration: line-through; font-size: 13.5px; }
.plan-promo { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); font-weight: 600; font-size: 13px; }
.plan-cta { width: 100%; margin-top: 10px; justify-content: center; }
.plan-features { list-style: none; margin: 0; padding: 16px 22px 20px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.plan-features li { display: flex; align-items: center; gap: 10px; }
.plan-features .ico { width: 18px; height: 18px; display: inline-grid; place-items: center; color: var(--primary); flex: none; }
.plan-features .ico svg { width: 16px; height: 16px; }
.plan-features.checks .ico { color: var(--ok); }
.plans-two { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.plans-summary { position: sticky; top: 0; border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.addon { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; }
.addon.on { border-color: var(--primary); background: var(--primary-soft); }
.addon input[type="radio"] { accent-color: var(--primary); }
.plans-foot { display: flex; align-items: center; gap: 20px; padding: 12px 24px; border-top: 1px solid var(--border); background: var(--surface-2); font-size: 13px; color: var(--fg-2); flex-wrap: wrap; }
.plans-foot svg { width: 16px; height: 16px; color: var(--primary); }
.plans-stars { display: inline-flex; align-items: center; gap: 6px; }
.plans-stars svg { width: 14px; height: 14px; color: var(--warn); fill: var(--warn); }
@media (max-width: 1000px) { .plans-grid { grid-template-columns: 1fr; } .plans-two { grid-template-columns: 1fr; } .plans-summary { position: static; } }
@media (max-width: 760px) { .plans-overlay { padding: 8px; } .plans { max-height: calc(100vh - 16px); border-radius: 12px; } .plans-head { padding: 10px 14px; grid-template-columns: auto 1fr auto; } .plans-steps li .l { display: none; } .plans-steps li + li::before { width: 18px; margin: 0 6px; } .plans-body { padding: 16px; } .plans-title h2 { font-size: 20px; } .segment { width: 100%; } .segment button { flex: 1; padding: 8px 6px; font-size: 13px; } .plan-price .amount { font-size: 30px; } }
.plan-top > p.small { min-height: 2.7em; }
.plan-top > p.xs { min-height: 1.4em; }
/* interruptor como <label class="switch"><input type="checkbox"><span></span></label> */
label.switch { display: inline-block; cursor: pointer; flex: none; }
.switch input[type="checkbox"] { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; }
.switch:has(input:checked) { background: var(--primary); }
.switch:has(input:checked)::after { transform: translateX(16px); }
.switch:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.plan-top > p.small { min-height: 40px; }

/* ---------- registro, alta de empresa y selector (cuentas) ---------- */
.auth { position: fixed; inset: 0; z-index: 70; display: grid; grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); background: var(--bg); color: var(--fg); overflow: hidden; }
.auth[hidden] { display: none !important; }
.auth-aside { background: linear-gradient(160deg, #1A5FC8 0%, #2D7FF9 62%, #5A9BFF 100%); color: #fff; padding: 36px 36px 28px; display: flex; flex-direction: column; gap: 28px; overflow: auto; }
.auth-logo svg { height: 42px; width: auto; display: block; }
.auth-pitch { display: flex; flex-direction: column; gap: 14px; margin-top: 24px; }
.auth-pitch h2 { font-size: 30px; line-height: 1.15; letter-spacing: -.02em; text-wrap: balance; }
.auth-pitch p { font-size: 15px; line-height: 1.55; color: rgba(255,255,255,.88); }
.auth-pitch ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.auth-pitch li { display: flex; align-items: center; gap: 12px; font-size: 14.5px; font-weight: 500; }
.auth-pitch .ico { width: 32px; height: 32px; border-radius: 9px; background: rgba(255,255,255,.16); display: grid; place-items: center; flex: none; }
.auth-pitch .ico svg { width: 17px; height: 17px; }
.auth-foot { margin-top: auto; font-size: 13px; color: rgba(255,255,255,.8); }
.auth-main { overflow: auto; display: flex; flex-direction: column; align-items: center; padding: 20px 24px 48px; }
.auth-top { width: min(680px, 100%); display: flex; align-items: center; gap: 12px; min-height: 40px; }
.auth-logo-m { display: none; color: var(--fg); }
.auth-logo-m svg { height: 32px; width: auto; display: block; }
.auth-card { width: min(680px, 100%); display: flex; flex-direction: column; gap: 18px; margin-top: 12px; }
.auth-steps { margin: 4px 0 6px; flex-wrap: wrap; row-gap: 8px; }
.auth-title { display: flex; flex-direction: column; gap: 6px; }
.auth-title h1 { font-size: 28px; letter-spacing: -.02em; text-wrap: balance; }
.auth-title p { font-size: 15px; }
.auth-sub { font-size: 16px; margin-top: 6px; }
.auth-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 6px; }
.auth-alt { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--border); }
.auth-creando { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding: 40px 0; }
.auth-creando h2 { font-size: 24px; }
.field.invalid .input, .field.invalid .select { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.field-error { font-size: 12.5px; color: var(--danger); font-weight: 500; }
.check.invalid input { outline: 2px solid var(--danger); outline-offset: 1px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--primary); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.choice-grid.mods { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.choice { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: var(--surface); color: inherit; font: inherit; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 6px; transition: border-color .12s, background .12s; min-width: 0; }
.choice:hover { border-color: var(--border-strong); }
.choice.on { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.choice.fijo { cursor: default; opacity: .85; }
.choice .ico { width: 32px; height: 32px; border-radius: 9px; background: var(--surface-3); color: var(--fg-2); display: grid; place-items: center; }
.choice.on .ico { background: var(--surface); color: var(--primary); }
.choice .ico svg { width: 17px; height: 17px; }
.choice .tick { width: 18px; height: 18px; color: var(--muted-2); display: inline-grid; }
.choice.on .tick { color: var(--primary); }
.choice .tick svg { width: 18px; height: 18px; }
.chips-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chips-row .chip { padding: 8px 14px; font-size: 13.5px; cursor: pointer; }
.company-list { display: flex; flex-direction: column; gap: 8px; }
.company-pick { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: inherit; font: inherit; text-align: left; cursor: pointer; min-width: 0; }
.company-pick:hover { border-color: var(--primary); background: var(--primary-soft); }
.company-pick .avatar { width: 40px; height: 40px; font-size: 14px; border-radius: 10px; }
.auth-overlay { z-index: 75; }
.avatar.logo { background: #fff; padding: 2px; overflow: hidden; }
.avatar.logo img { width: 100%; height: 100%; object-fit: contain; }
.banner.demo { background: var(--fg); color: var(--bg); }
.banner.demo svg { width: 16px; height: 16px; }
.banner.demo .btn { color: var(--fg); }
.banner .ghost-on-banner { background: transparent; color: inherit; border: 1px solid rgba(255,255,255,.4); }
.banner.demo .ghost-on-banner { color: var(--bg); border-color: currentColor; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--primary-soft); border-top-color: var(--primary); animation: klk-spin .8s linear infinite; display: inline-block; }
@keyframes klk-spin { to { transform: rotate(360deg); } }
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-logo-m { display: block; }
  .auth-main { padding: 12px 16px 40px; }
  .auth-title h1 { font-size: 23px; }
  .auth-card .form-grid { grid-template-columns: 1fr; }
  .auth-card .form-grid .span-2 { grid-column: auto; }
  .choice-grid, .choice-grid.mods { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* asistente de planes: pantalla completa y ajustes de la revisión */
.plans-overlay { padding: 0; align-items: stretch; backdrop-filter: none; }
.plans { width: 100%; height: 100vh; height: 100dvh; max-height: none; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.plans-body { flex: 1 1 auto; min-height: 0; }
.plans-inner { width: min(1240px, 100%); margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.plans-head, .plans-foot { padding-left: max(24px, calc((100% - 1240px) / 2)); padding-right: max(24px, calc((100% - 1240px) / 2)); }
.plans-steps .step-btn { all: unset; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.plans-steps .step-btn:disabled { cursor: default; }
.plans-steps .step-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 6px; }
.plans-trial.ok { background: var(--ok-soft); color: var(--ok); }
.plans-trial.info { background: var(--primary-soft); color: var(--primary); }
.plan-card.current { border-color: var(--ok); }
.plan-card.current.popular { border-color: var(--primary); }
.plan-aviso { color: var(--warn); font-weight: 600; }
.plan-promo.neutral { background: var(--surface-3); color: var(--fg-2); }
.plan-price-meta { min-height: 28px; align-items: center; }
.btn-ink { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn-ink:hover { opacity: .9; }
.plan-cta:disabled { opacity: .55; cursor: not-allowed; }
@media (max-width: 760px) {
  .plans-overlay { padding: 0; }
  .plans { max-height: none; border-radius: 0; }
  .plans-head, .plans-foot { padding-left: 14px; padding-right: 14px; }
  .plans-foot { padding-top: 8px; padding-bottom: 8px; gap: 6px 14px; font-size: 12px; justify-content: center; }
  .plans-foot .hide-sm { display: none; }
  .plans-steps li.active .l { display: inline; font-size: 13px; }
}

/* ---------- sincronización con la nube ---------- */
.nube-estado { display: flex; align-items: center; gap: 6px; margin: -4px 12px 10px; padding: 2px 10px; width: calc(100% - 24px); border: 0; background: transparent; color: var(--sb-fg); font: inherit; font-size: 12px; text-align: left; cursor: pointer; border-radius: 6px; min-width: 0; }
.nube-estado span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.nube-estado:hover { color: var(--sb-fg-strong); background: var(--sb-hover); }
.nube-estado svg { width: 14px; height: 14px; flex: none; }
.nube-estado.ok svg { color: #3fc47c; }
.nube-estado.pendiente svg, .nube-estado.sin-conexion svg, .nube-estado.sin-sesion svg { color: #f0b23c; }
.nube-estado.error svg { color: #f06b66; }
.nube-estado.subiendo svg, .nube-estado.conectando svg { animation: nubeGira 1s linear infinite; }
@keyframes nubeGira { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .nube-estado.subiendo svg, .nube-estado.conectando svg { animation: none; } }
.aviso-nube { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 95; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 12px; background: var(--surface); color: var(--fg); border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-size: 13.5px; max-width: calc(100vw - 32px); }
.aviso-nube > span:first-child svg { width: 16px; height: 16px; color: var(--primary); display: block; }
.auth-segment { display: flex; width: 100%; }
.auth-segment button { flex: 1; }
.aviso-nube > span:first-child, .aviso-nube .btn, .aviso-nube .icon-btn { flex: none; }
.aviso-nube > span:nth-child(2) { flex: 1 1 auto; min-width: 0; }
@media (max-width: 600px) { .aviso-nube { left: 16px; right: 16px; bottom: 16px; transform: none; max-width: none; } }

/* ---------- importador de Excel / CSV (assets/importador.js) ---------- */
.imp-pasos { display: flex; gap: 8px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.imp-pasos li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.imp-pasos li + li::before { content: ''; width: 24px; height: 1px; background: var(--border); }
.imp-pasos .n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--surface-2); border: 1px solid var(--border); }
.imp-pasos li.activo { color: var(--fg); font-weight: 600; }
.imp-pasos li.activo .n { background: var(--primary); border-color: var(--primary); color: #fff; }
.imp-pasos li.hecho .n { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.imp-zona { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 28px 16px; border: 2px dashed var(--border); border-radius: 12px; background: var(--surface-2); cursor: pointer; text-align: center; }
.imp-zona:hover, .imp-zona.sobre { border-color: var(--primary); background: var(--info-soft); }
.imp-zona .ico svg { width: 26px; height: 26px; color: var(--primary); }
.imp-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.imp-columnas summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--primary); padding: 4px 0; }
.imp-tabla-wrap { overflow: auto; max-height: 340px; border: 1px solid var(--border); border-radius: 10px; }
.imp-tabla { font-size: 13px; }
.imp-tabla td, .imp-tabla th { white-space: nowrap; }
.imp-tabla td:last-child { white-space: normal; min-width: 220px; }
.imp-tabla tr.imp-err td { background: var(--danger-soft); }
.imp-resumen { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.imp-mapa { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 16px; padding: 8px 0; }
.imp-mapa-fila { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: center; gap: 8px; }
.imp-pie { width: 100%; align-items: center; flex-wrap: wrap; }
.imp-fin { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 8px 0; }
.imp-fin .ico svg { width: 32px; height: 32px; color: var(--ok); }
.imp-fin ul { margin: 0; padding-left: 18px; line-height: 1.8; }
@media (max-width: 600px) { .imp-mapa-fila { grid-template-columns: minmax(0, 1fr); } .imp-pasos li + li::before { width: 10px; } }
