/* Easypoint · sistema de diseño v2. Tokens → componentes. Claro/oscuro. Sin dependencias. */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --font: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --bg: #f6f7f2;
  --bg-2: #eef0e7;
  --surface: #ffffff;
  --surface-2: #fafbf7;
  --ink: #0b1220;
  --ink-2: #2a3347;
  --muted: #5e6a80;
  --line: #e3e6dc;
  --line-2: #d2d7c9;
  --brand: #84cc16;
  --brand-2: #65a30d;
  --brand-3: #4d7c0f;
  --brand-soft: #ecfccb;
  --on-brand: #0b1d03;
  --accent: #0ea5a4;
  --warn: #f59e0b;
  --warn-soft: #fef3c7;
  --bad: #e11d48;
  --bad-soft: #ffe4e6;
  --ok: #16a34a;
  --ok-soft: #dcfce7;
  --info: #2563eb;
  --info-soft: #dbeafe;
  --r-sm: 10px; --r: 16px; --r-lg: 24px; --r-xl: 32px;
  --shadow-1: 0 1px 2px rgba(11,18,32,.06), 0 4px 14px rgba(11,18,32,.05);
  --shadow-2: 0 2px 6px rgba(11,18,32,.07), 0 18px 40px rgba(11,18,32,.10);
  --shadow-3: 0 30px 80px rgba(11,18,32,.22);
  --glow: 0 0 0 4px rgba(132,204,22,.22);
  --ease: cubic-bezier(.2,.8,.2,1);
  /* compat con web-ui (lib) */
  --accent-color: var(--brand-2);
  --bg-color: var(--bg);
  --bg-alt-color: var(--bg-2);
  --text-color: var(--ink);
  --muted-color: var(--muted);
  --border-color: var(--line);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #070b14; --bg-2: #0b1220; --surface: #0f1626; --surface-2: #131c30;
  --ink: #e9eef9; --ink-2: #c7d1e6; --muted: #8e9bb4; --line: #1d2842; --line-2: #2a3856;
  --brand: #a3e635; --brand-2: #84cc16; --brand-3: #bef264; --brand-soft: #1d2b0c; --on-brand: #0b1d03;
  --warn-soft: #3a2b08; --bad-soft: #3b0f1c; --ok-soft: #0f2d1a; --info-soft: #11264d;
  --shadow-1: 0 1px 2px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.3);
  --shadow-2: 0 2px 6px rgba(0,0,0,.45), 0 18px 40px rgba(0,0,0,.4);
  --glow: 0 0 0 4px rgba(163,230,53,.18);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #070b14; --bg-2: #0b1220; --surface: #0f1626; --surface-2: #131c30;
    --ink: #e9eef9; --ink-2: #c7d1e6; --muted: #8e9bb4; --line: #1d2842; --line-2: #2a3856;
    --brand: #a3e635; --brand-2: #84cc16; --brand-3: #bef264; --brand-soft: #1d2b0c; --on-brand: #0b1d03;
    --warn-soft: #3a2b08; --bad-soft: #3b0f1c; --ok-soft: #0f2d1a; --info-soft: #11264d;
    --shadow-1: 0 1px 2px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.3);
    --shadow-2: 0 2px 6px rgba(0,0,0,.45), 0 18px 40px rgba(0,0,0,.4);
    --glow: 0 0 0 4px rgba(163,230,53,.18);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink); line-height: 1.55; font-size: 16px; -webkit-font-smoothing: antialiased; }
img, svg, canvas { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.1; letter-spacing: -.02em; font-weight: 800; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--brand) 40%, transparent); }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; } }

/* layout */
.container { width: min(1180px, 100% - 32px); margin-inline: auto; }
.container-sm { width: min(760px, 100% - 32px); margin-inline: auto; }
.section { padding: clamp(56px, 8vw, 112px) 0; }
.stack > * + * { margin-top: var(--gap, 16px); }
.row { display: flex; align-items: center; gap: var(--gap, 12px); }
.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.between { justify-content: space-between; }
.center { text-align: center; }
.grid { display: grid; gap: var(--gap, 16px); }
.g2 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); }
.auto-grid { grid-template-columns: repeat(auto-fill, minmax(var(--min, 260px), 1fr)); }
@media (max-width: 860px) { .g3, .g4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
.hide-sm { } @media (max-width: 760px) { .hide-sm { display: none !important; } }
.only-sm { display: none !important; } @media (max-width: 760px) { .only-sm { display: initial !important; } }
.muted { color: var(--muted); } .small { font-size: .875rem; } .tiny { font-size: .75rem; } .bold { font-weight: 700; }
.kicker { font-size: .78rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 700; color: var(--brand-2); }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.3rem); color: var(--muted); max-width: 62ch; }
.h1 { font-size: clamp(2.4rem, 6.2vw, 4.8rem); font-weight: 900; letter-spacing: -.035em; }
.h2 { font-size: clamp(1.8rem, 3.8vw, 3rem); font-weight: 800; }
.h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); font-weight: 700; }
.grad { background: linear-gradient(95deg, var(--brand-2), var(--accent) 70%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mt-1{margin-top:8px}.mt-2{margin-top:16px}.mt-3{margin-top:24px}.mt-4{margin-top:40px}.mb-2{margin-bottom:16px}.mb-3{margin-bottom:24px}.p-2{padding:16px}.p-3{padding:24px}

/* botones */
.btn { --h: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--h); padding: 0 20px; border-radius: 999px; border: 1.5px solid transparent; font-weight: 700; font-size: .95rem; transition: transform .18s var(--ease), box-shadow .18s, background .18s, border-color .18s; white-space: nowrap; user-select: none; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: var(--brand); color: var(--on-brand); box-shadow: 0 6px 18px color-mix(in srgb, var(--brand) 45%, transparent); }
.btn-primary:hover { background: color-mix(in srgb, var(--brand) 88%, white); transform: translateY(-1px); box-shadow: 0 10px 26px color-mix(in srgb, var(--brand) 55%, transparent); }
.btn-dark { background: var(--ink); color: var(--bg); }
.btn-dark:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); background: color-mix(in srgb, var(--ink) 4%, transparent); }
.btn-soft { background: var(--brand-soft); color: var(--brand-3); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-sm { --h: 36px; padding: 0 14px; font-size: .85rem; }
.btn-lg { --h: 56px; padding: 0 30px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-loading { opacity: .55; pointer-events: none; }
.btn .spin { width: 16px; height: 16px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* tarjetas y superficies */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1); }
.card-pad { padding: 20px; }
.card-hover { transition: transform .25s var(--ease), box-shadow .25s, border-color .25s; }
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); border-color: var(--line-2); }
.glass { background: color-mix(in srgb, var(--surface) 72%, transparent); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); border: 1px solid color-mix(in srgb, var(--line) 80%, transparent); }
.divider { height: 1px; background: var(--line); margin: 16px 0; }

/* formularios */
.field { display: grid; gap: 6px; }
.field > label, .lbl { font-size: .8rem; font-weight: 700; color: var(--ink-2); letter-spacing: .01em; }
.input, .select, .textarea { width: 100%; height: 46px; padding: 0 14px; border-radius: var(--r-sm); border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink); font: inherit; transition: border-color .15s, box-shadow .15s; }
.textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand-2); box-shadow: var(--glow); }
.input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.help { font-size: .78rem; color: var(--muted); }
.error { font-size: .82rem; color: var(--bad); font-weight: 600; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; cursor: pointer; }
.check input { accent-color: var(--brand-2); width: 18px; height: 18px; margin-top: 2px; }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line-2); border-radius: 999px; overflow: hidden; background: var(--surface); }
.stepper button { width: 42px; height: 42px; border: 0; background: transparent; font-size: 1.2rem; font-weight: 700; }
.stepper button:hover { background: var(--brand-soft); }
.stepper span { min-width: 36px; text-align: center; font-weight: 800; }
.seg { display: inline-flex; background: var(--bg-2); border-radius: 999px; padding: 4px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; font-weight: 700; font-size: .88rem; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

/* chips, badges */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: var(--bg-2); color: var(--ink-2); border: 1px solid var(--line); }
button.chip:hover, a.chip:hover { border-color: var(--brand-2); }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-ok { background: var(--ok-soft); color: var(--ok); } .b-warn { background: var(--warn-soft); color: #b45309; } .b-bad { background: var(--bad-soft); color: var(--bad); }
.b-info { background: var(--info-soft); color: var(--info); } .b-mute { background: var(--bg-2); color: var(--muted); } .b-brand { background: var(--brand-soft); color: var(--brand-3); }
:root[data-theme="dark"] .b-warn { color: #fbbf24; }

/* tablas */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 800; padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); position: sticky; top: 0; white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tr.click { cursor: pointer; }
.right { text-align: right; }

/* KPI */
.kpi { padding: 18px 20px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); position: relative; overflow: hidden; }
.kpi::after { content: ''; position: absolute; inset: auto -20% -60% auto; width: 120px; height: 120px; border-radius: 50%; background: var(--tone, var(--brand)); opacity: .12; filter: blur(8px); }
.kpi .v { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 900; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.kpi .h { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.kpi[data-tone="ok"] { --tone: var(--ok); } .kpi[data-tone="warn"] { --tone: var(--warn); } .kpi[data-tone="bad"] { --tone: var(--bad); } .kpi[data-tone="info"] { --tone: var(--info); }

/* modal / drawer / toast */
.overlay { position: fixed; inset: 0; background: rgba(5,9,18,.55); backdrop-filter: blur(4px); z-index: 100; display: grid; place-items: center; padding: 16px; animation: fade .2s; }
.modal { width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-3); animation: pop .28s var(--ease); }
.modal.wide { width: min(860px, 100%); }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 8px; }
.modal-b { padding: 8px 24px 24px; }
.modal-f { display: flex; gap: 10px; justify-content: flex-end; padding: 0 24px 24px; flex-wrap: wrap; }
.x { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--bg-2); font-size: 1.2rem; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100%); background: var(--surface); box-shadow: var(--shadow-3); z-index: 101; overflow: auto; animation: slide .3s var(--ease); }
@keyframes fade { from { opacity: 0 } } @keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97) } } @keyframes slide { from { transform: translateX(40px); opacity: 0 } }
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; width: min(440px, calc(100% - 24px)); pointer-events: none; }
.toast { pointer-events: auto; padding: 12px 16px; border-radius: 14px; background: var(--ink); color: var(--bg); font-weight: 600; box-shadow: var(--shadow-3); animation: pop .25s var(--ease); display: flex; gap: 10px; align-items: center; }
.toast.ok { background: #14532d; color: #dcfce7; } .toast.bad { background: #881337; color: #ffe4e6; }

/* misc */
.skeleton { background: linear-gradient(90deg, var(--bg-2), var(--surface-2), var(--bg-2)); background-size: 200% 100%; animation: sh 1.2s infinite; border-radius: 10px; min-height: 16px; }
@keyframes sh { to { background-position: -200% 0; } }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty .ico { font-size: 2.4rem; margin-bottom: 8px; }
.progress { height: 8px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-2), var(--brand)); border-radius: 99px; transition: width .5s var(--ease); }
.pill-tabs { display: flex; gap: 6px; overflow: auto; padding-bottom: 4px; scrollbar-width: none; }
.pill-tabs::-webkit-scrollbar { display: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); display: inline-block; box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 60%, transparent); animation: ping 2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.tag-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; background: var(--bg-2); padding: 2px 8px; border-radius: 6px; }
.link { color: var(--brand-3); font-weight: 700; } .link:hover { text-decoration: underline; }
:root[data-theme="dark"] .link { color: var(--brand); }
