/* =================== PresuPRO · tema oscuro premium =================== */
:root {
  --bg: #07090f; --bg-2: #0c0f19; --card: #121625; --card-2: #181d2f; --card-3: #1f2539;
  --line: rgba(255, 255, 255, .075); --line-2: rgba(255, 255, 255, .045);
  --text: #eef1f8; --text-2: #c2c8d8; --muted: #8a93a9; --muted-2: #636b80;
  --primary: #7c6cff; --primary-2: #a78bfa; --primary-soft: rgba(124, 108, 255, .16);
  --grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #c084fc 100%);
  --grad-soft: linear-gradient(135deg, rgba(99, 102, 241, .22), rgba(139, 92, 246, .12));
  --ok: #34d399; --ok-soft: rgba(52, 211, 153, .14); --info: #60a5fa; --info-soft: rgba(96, 165, 250, .14);
  --bad: #f87171; --bad-soft: rgba(248, 113, 113, .14); --warn: #fbbf24; --warn-soft: rgba(251, 191, 36, .14);
  --gray-soft: rgba(148, 163, 184, .14); --cyan: #22d3ee;
  --radius: 18px; --radius-sm: 12px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px rgba(0, 0, 0, .35);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, .6);
  --side: 252px; --head: 60px; --tab: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
html, body { overflow-x: hidden; }
body {
  margin: 0; font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 15px; line-height: 1.5;
  color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; min-height: 100vh;
  background-image: radial-gradient(900px 500px at 85% -10%, rgba(124, 108, 255, .13), transparent 60%), radial-gradient(700px 400px at -10% 30%, rgba(34, 211, 238, .05), transparent 60%);
  background-attachment: fixed;
}
a { color: var(--primary-2); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.02em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.nowrap { white-space: nowrap; }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.right { text-align: right; }
.hidden { display: none !important; }
.spacer { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.nw { flex-wrap: nowrap; }
.stack { display: grid; gap: 14px; }
.num-big { font-variant-numeric: tabular-nums; }
.boot { min-height: 60vh; display: grid; place-items: center; }
.spinner { width: 30px; height: 30px; border: 3px solid rgba(124, 108, 255, .2); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ico { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ico.sm { width: 16px; height: 16px; }
.skeleton { background: linear-gradient(90deg, var(--card) 0%, var(--card-2) 50%, var(--card) 100%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--radius); }
@keyframes sk { to { background-position: -200% 0; } }
.fade-in { animation: fadeUp .28s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 13px;
  border: 1px solid var(--line); background: var(--card-2); color: var(--text); font-weight: 600; font-size: 14.5px; cursor: pointer;
  transition: background .15s, border-color .15s, transform .08s, opacity .15s; white-space: nowrap; text-decoration: none !important; user-select: none;
}
.btn:hover { background: var(--card-3); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 10px 24px rgba(124, 108, 255, .35); }
.btn-primary:hover { background: var(--grad); filter: brightness(1.08); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(255, 255, 255, .05); }
.btn-danger { color: var(--bad); background: var(--bad-soft); border-color: transparent; }
.btn-ok { background: linear-gradient(135deg, #10b981, #34d399); border-color: transparent; color: #04120c; box-shadow: 0 10px 24px rgba(52, 211, 153, .3); }
.btn-sm { height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 11px; }
.btn-lg { height: 52px; padding: 0 22px; font-size: 16px; border-radius: 15px; }
.btn-icon { width: 42px; padding: 0; }
.btn-icon.btn-sm { width: 36px; }
.btn-block { width: 100%; }
.btn .spinner { width: 18px; height: 18px; border-width: 2px; border-color: rgba(255, 255, 255, .3); border-top-color: #fff; }

/* ---------- Formularios ---------- */
.field { display: grid; gap: 6px; }
.field > span, .label { font-size: 12.5px; font-weight: 600; color: var(--muted); letter-spacing: .01em; }
.input, select.input, textarea.input {
  width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--bg-2);
  outline: none; transition: border-color .15s, box-shadow .15s, background .15s; font-size: 16px; color: var(--text);
}
textarea.input { height: auto; min-height: 84px; padding: 11px 14px; resize: vertical; line-height: 1.45; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); background: #0e1220; }
.input::placeholder { color: var(--muted-2); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238a93a9' stroke-width='2'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
input[type=date].input { color-scheme: dark; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.help { font-size: 12px; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; color: var(--text-2); }
.check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--primary); flex: none; }
.form-error { background: var(--bad-soft); color: var(--bad); border: 1px solid rgba(248, 113, 113, .25); padding: 11px 13px; border-radius: 12px; font-size: 14px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 48px; }
.pw-toggle { position: absolute; right: 4px; top: 4px; height: 38px; width: 40px; border: 0; background: none; cursor: pointer; color: var(--muted); display: grid; place-items: center; }

/* ---------- Tarjetas ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 6px; }
.card-head h3 { font-size: 15px; font-weight: 700; }
.card-body { padding: 10px 18px 18px; }
.sec-title { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin: 6px 4px 10px; display: flex; align-items: center; gap: 8px; }
.empty { text-align: center; padding: 40px 22px; color: var(--muted); }
.empty .ico-big { width: 64px; height: 64px; border-radius: 20px; background: var(--grad-soft); color: var(--primary-2); display: grid; place-items: center; margin: 0 auto 16px; border: 1px solid rgba(124, 108, 255, .25); }
.empty .ico-big .ico { width: 28px; height: 28px; }
.empty h3 { color: var(--text); font-size: 18px; margin-bottom: 6px; }
.empty p { margin-bottom: 18px; font-size: 14.5px; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.st-borrador { background: var(--gray-soft); color: #a8b3c7; }
.st-enviado { background: var(--info-soft); color: var(--info); }
.st-aceptado { background: var(--ok-soft); color: var(--ok); }
.st-rechazado { background: var(--bad-soft); color: var(--bad); }
.st-caducado { background: var(--warn-soft); color: var(--warn); }
.pill { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.pill.up { background: var(--ok-soft); color: var(--ok); }
.pill.down { background: var(--bad-soft); color: var(--bad); }
.pill.flat { background: var(--gray-soft); color: var(--muted); }

/* ---------- Avatares ---------- */
.avatar { width: 42px; height: 42px; border-radius: 14px; font-weight: 700; display: grid; place-items: center; flex: none; font-size: 14px; color: #fff; background: var(--card-3); }
.avatar.sm { width: 34px; height: 34px; border-radius: 11px; font-size: 12.5px; }
.avatar.lg { width: 64px; height: 64px; border-radius: 20px; font-size: 22px; }
.avatar .ico { width: 18px; height: 18px; }

/* ---------- Toasts ---------- */
#toasts { position: fixed; left: 50%; top: calc(12px + var(--safe-t)); transform: translateX(-50%); display: grid; gap: 8px; z-index: 1000; width: min(420px, calc(100% - 24px)); pointer-events: none; }
.toast { background: rgba(30, 35, 54, .92); backdrop-filter: blur(14px); border: 1px solid var(--line); color: #fff; padding: 12px 16px; border-radius: 14px; box-shadow: var(--shadow-lg); font-size: 14px; display: flex; gap: 10px; align-items: center; animation: toastIn .25s ease; }
.toast.err { border-color: rgba(248, 113, 113, .4); }
.toast.err .ico { color: var(--bad); }
.toast.ok .ico { color: var(--ok); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } }

/* ---------- Modales / hojas ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(2, 4, 10, .66); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 900; padding: 16px; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--card); border: 1px solid var(--line); border-radius: 22px; width: min(540px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: pop .2s ease; }
.modal.wide { width: min(720px, 100%); }
@keyframes pop { from { transform: translateY(14px) scale(.98); opacity: 0; } }
.grab { display: none; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 10px; }
.modal-head h3 { font-size: 18px; }
.modal-body { padding: 6px 20px 16px; overflow: auto; overflow-x: hidden; overscroll-behavior: contain; }
.modal { min-width: 0; } .modal * { min-width: 0; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 20px calc(16px + var(--safe-b)); border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.sheet-list { display: grid; gap: 4px; padding-bottom: 6px; }
.sheet-item { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 12px; border: 0; border-radius: 14px; background: transparent; color: var(--text); font-weight: 600; font-size: 15px; cursor: pointer; text-align: left; }
.sheet-item:hover, .sheet-item:active { background: var(--card-2); }
.sheet-item .si { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--card-2); color: var(--primary-2); }
.sheet-item > span { min-width: 0; }
.sheet-item.danger { color: var(--bad); }
.sheet-item.danger .si { color: var(--bad); background: var(--bad-soft); }
.sheet-item.on .si { background: var(--grad); color: #fff; }

/* ---------- Listas ---------- */
.list { display: grid; min-width: 0; }
.list > *, .stack > *, .dash > *, .det > *, .tiles > *, .ed-desk > * { min-width: 0; }
.li { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-top: 1px solid var(--line-2); color: inherit; text-decoration: none !important; cursor: pointer; width: 100%; background: none; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; }
.li:first-child { border-top: 0; }
.li:active { background: rgba(255, 255, 255, .03); }
@media (hover: hover) { .li:hover { background: rgba(255, 255, 255, .025); } }
.li .main { flex: 1; min-width: 0; }
.li .t { font-weight: 650; font-weight: 600; font-size: 15px; }
.li .s { font-size: 13px; color: var(--muted); }
.li .r { text-align: right; flex: none; }
.li .amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.li .chev { color: var(--muted-2); }
.month-h { position: sticky; top: calc(var(--head) + var(--safe-t)); z-index: 5; padding: 14px 4px 8px; font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; display: flex; justify-content: space-between; background: linear-gradient(var(--bg) 70%, transparent); }
.qstrip { width: 4px; align-self: stretch; border-radius: 4px; flex: none; }
.pick-list { display: grid; gap: 6px; max-height: 56vh; overflow: auto; margin-top: 12px; }
.pick { display: flex; gap: 12px; align-items: center; text-align: left; padding: 11px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--card-2); cursor: pointer; width: 100%; color: var(--text); }
.pick:hover { border-color: var(--primary); }
.pick .t { font-weight: 600; }
.pick .s { font-size: 13px; color: var(--muted); }

/* ---------- Segmentados / chips ---------- */
.seg { display: flex; gap: 4px; padding: 4px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; }
.seg button { flex: 1; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; padding: 0 10px; transition: color .15s, background .15s; }
.seg button.on { background: var(--card-3); color: var(--text); box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 4px; margin: 0 -2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { height: 34px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; color: var(--text-2); flex: none; }
.chip.on { background: var(--text); color: #0b0d14; border-color: var(--text); }
.chip .n { opacity: .55; margin-left: 5px; }
.search { position: relative; }
.search .ico { position: absolute; left: 14px; top: 13px; color: var(--muted); width: 20px; height: 20px; }
.search .input { padding-left: 44px; }

/* =================== Marca =================== */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -.03em; color: var(--text); text-decoration: none !important; }
.brand-mark { width: 34px; height: 34px; border-radius: 11px; background: var(--grad); display: grid; place-items: center; box-shadow: 0 8px 20px rgba(124, 108, 255, .45); flex: none; }
.brand-mark svg { width: 20px; height: 20px; }
.brand b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* =================== Landing =================== */
.lp-nav { position: sticky; top: 0; z-index: 50; backdrop-filter: saturate(160%) blur(14px); background: rgba(7, 9, 15, .7); border-bottom: 1px solid var(--line-2); }
.lp-nav .in { max-width: 1140px; margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 12px 20px; }
.lp-hero .in { max-width: 1140px; margin: 0 auto; padding: 64px 20px 56px; display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.tag { display: inline-flex; gap: 8px; align-items: center; padding: 6px 12px; border-radius: 99px; background: var(--primary-soft); border: 1px solid rgba(124, 108, 255, .3); color: var(--primary-2); font-size: 13px; font-weight: 600; }
.lp-hero h1 { font-size: clamp(36px, 5.4vw, 60px); font-weight: 800; letter-spacing: -.045em; margin: 18px 0 16px; line-height: 1.05; }
.lp-hero h1 span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lp-hero p.lead { font-size: 18px; color: var(--text-2); max-width: 540px; }
.lp-cta { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.lp-proof { display: flex; gap: 18px; margin-top: 22px; color: var(--muted); font-size: 14px; flex-wrap: wrap; }
.lp-proof span { display: inline-flex; gap: 6px; align-items: center; }
.lp-proof .ico { color: var(--ok); width: 16px; height: 16px; }
.phone { width: min(330px, 100%); margin: 0 auto; border-radius: 40px; padding: 12px; background: linear-gradient(160deg, #262c42, #10131e); border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 40px 100px rgba(0, 0, 0, .6), 0 0 120px rgba(124, 108, 255, .25); }
.phone-in { border-radius: 30px; background: var(--bg); padding: 18px 14px; overflow: hidden; display: grid; gap: 10px; }
.lp-section { max-width: 1140px; margin: 0 auto; padding: 64px 20px; }
.lp-section h2 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; letter-spacing: -.035em; text-align: center; }
.lp-section .sub { text-align: center; color: var(--muted); max-width: 620px; margin: 12px auto 36px; font-size: 17px; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.feature { padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); }
.feature .fi { width: 44px; height: 44px; border-radius: 14px; background: var(--grad-soft); border: 1px solid rgba(124, 108, 255, .25); color: var(--primary-2); display: grid; place-items: center; margin-bottom: 14px; }
.feature h3 { font-size: 16.5px; margin-bottom: 6px; }
.feature p { color: var(--muted); font-size: 14.5px; }
.lp-final { margin: 0 20px 64px; }
.lp-final .in { max-width: 1100px; margin: 0 auto; border-radius: 28px; padding: 48px 26px; text-align: center; color: #fff; background: var(--grad); box-shadow: 0 30px 80px rgba(124, 108, 255, .35); }
.lp-final h2 { font-size: clamp(24px, 3.4vw, 36px); font-weight: 800; }
.lp-final p { opacity: .9; margin: 10px 0 24px; font-size: 17px; }
.lp-final .btn { background: #fff; color: #4c1d95; border-color: #fff; }
.lp-foot { border-top: 1px solid var(--line-2); padding: 26px 20px; text-align: center; color: var(--muted); font-size: 14px; }

/* =================== Auth =================== */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 28px 18px; }
.auth-box { width: min(420px, 100%); }
.auth-card { padding: 28px 24px; }
.auth-box h1 { font-size: 27px; font-weight: 800; margin-bottom: 6px; letter-spacing: -.03em; }
.auth-box .sub { color: var(--muted); margin-bottom: 22px; }
.auth-alt { margin-top: 18px; text-align: center; color: var(--muted); font-size: 14px; }

/* =================== Estructura de la app =================== */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.shell > div { min-width: 0; }
.side { position: sticky; top: 0; height: 100vh; background: rgba(12, 15, 25, .8); border-right: 1px solid var(--line-2); display: flex; flex-direction: column; padding: 20px 14px; gap: 4px; }
.side .brand { padding: 2px 8px 20px; }
.nav-a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: var(--muted); font-weight: 600; text-decoration: none !important; font-size: 14.5px; }
.nav-a:hover { background: rgba(255, 255, 255, .04); color: var(--text); }
.nav-a.on { background: var(--primary-soft); color: var(--text); }
.nav-a.on .ico { color: var(--primary-2); }
.side .new { margin: 0 0 14px; }
.side-foot { margin-top: auto; padding: 12px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); display: flex; align-items: center; gap: 10px; cursor: pointer; text-decoration: none !important; color: var(--text); }
.side-foot .who { min-width: 0; flex: 1; }
.side-foot .who b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot .who span { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apphead { position: sticky; top: 0; z-index: 40; height: calc(var(--head) + var(--safe-t)); padding: var(--safe-t) 20px 0; display: flex; align-items: center; gap: 10px; background: rgba(7, 9, 15, .78); backdrop-filter: saturate(160%) blur(16px); border-bottom: 1px solid var(--line-2); }
.apphead h1 { font-size: 19px; font-weight: 750; font-weight: 700; letter-spacing: -.02em; }
.apphead .hsub { font-size: 12px; color: var(--muted); font-weight: 500; }
.apphead .htitle { min-width: 0; flex: 1; }
.appmain { padding: 20px 28px 60px; max-width: 1200px; width: 100%; margin: 0 auto; }
.tabbar { display: none; }
.desk-only { }
.mob-only { display: none !important; }

/* =================== Panel =================== */
.dash { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; align-items: start; }
.hero { position: relative; overflow: hidden; padding: 18px 18px 10px; border-radius: 22px; border: 1px solid rgba(124, 108, 255, .28);
  background: radial-gradient(120% 140% at 100% 0%, rgba(139, 92, 246, .35), transparent 55%), radial-gradient(100% 120% at 0% 100%, rgba(34, 211, 238, .12), transparent 60%), linear-gradient(160deg, #171b30, #10131f); box-shadow: 0 20px 50px rgba(0, 0, 0, .45); }
.hero .lbl { font-size: 13px; color: var(--text-2); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.hero .big { font-size: 34px; font-weight: 800; letter-spacing: -.04em; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.hero .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.chart { position: relative; margin: 8px -6px 0; touch-action: pan-y; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-tip { position: absolute; top: 0; transform: translateX(-50%); background: rgba(10, 12, 20, .92); border: 1px solid var(--line); border-radius: 10px; padding: 6px 9px; font-size: 12px; pointer-events: none; white-space: nowrap; box-shadow: var(--shadow-lg); z-index: 3; }
.chart-tip b { display: block; font-size: 13px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 2px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { padding: 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); position: relative; overflow: hidden; min-height: 112px; display: flex; flex-direction: column; }
.tile .tk { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.tile .tk .dot { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; }
.tile .tk .dot .ico { width: 16px; height: 16px; }
.tile .tv { font-size: 21px; font-weight: 800; letter-spacing: -.03em; margin-top: auto; padding-top: 10px; font-variant-numeric: tabular-nums; }
.tile .td { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; margin-top: 2px; }
.tile .ring { position: absolute; right: 10px; top: 10px; width: 34px; height: 34px; }
.stbar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--bg-2); gap: 2px; }
.stbar i { display: block; height: 100%; }
.stleg { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 12px; }
.stleg div { text-align: center; padding: 8px 2px; border-radius: 12px; background: var(--bg-2); }
.stleg b { display: block; font-size: 17px; }
.stleg span { font-size: 9.5px; white-space: nowrap; letter-spacing: -.01em; color: var(--muted); font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 4px; }
.stleg span i { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.qa { display: grid; justify-items: center; gap: 7px; padding: 12px 4px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); color: var(--text-2); font-size: 12px; font-weight: 600; text-decoration: none !important; cursor: pointer; }
.qa .qi { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: var(--grad-soft); color: var(--primary-2); border: 1px solid rgba(124, 108, 255, .22); }
.bar-mini { height: 6px; border-radius: 9px; background: var(--bg-2); overflow: hidden; margin-top: 7px; }
.bar-mini i { display: block; height: 100%; background: var(--grad); border-radius: 9px; }
.notice { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 18px; background: var(--grad-soft); border: 1px solid rgba(124, 108, 255, .3); }
.notice .ico { color: var(--primary-2); }

/* =================== Editor =================== */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.step { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: 13.5px; cursor: pointer; }
.step .n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--card-3); font-size: 12px; flex: none; }
.step.on { border-color: rgba(124, 108, 255, .5); color: var(--text); background: var(--primary-soft); }
.step.on .n { background: var(--grad); color: #fff; }
.step.done .n { background: var(--ok-soft); color: var(--ok); }
.client-card { display: flex; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--card-2); }
.client-card .info { flex: 1; min-width: 0; font-size: 13.5px; color: var(--muted); }
.client-card .info b { display: block; font-size: 16px; color: var(--text); }
.pickers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bigpick { display: grid; justify-items: center; gap: 8px; padding: 18px 10px; border-radius: 16px; border: 1px dashed rgba(124, 108, 255, .4); background: var(--primary-soft); color: var(--text); font-weight: 600; cursor: pointer; font-size: 14px; }
.bigpick .ico { color: var(--primary-2); width: 24px; height: 24px; }
.lrow { display: flex; gap: 12px; align-items: center; padding: 13px 14px; border-radius: 15px; background: var(--card); border: 1px solid var(--line); cursor: pointer; width: 100%; text-align: left; color: var(--text); }
.lrow:active { transform: scale(.99); }
.lrow .main { flex: 1; min-width: 0; }
.lrow .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .s { font-size: 12.5px; color: var(--muted); }
.lrow .amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.lrow.sec { background: transparent; border-style: dashed; color: var(--primary-2); font-weight: 700; text-transform: uppercase; font-size: 12.5px; letter-spacing: .06em; padding: 10px 14px; }
.lrow .lnum { width: 26px; height: 26px; border-radius: 8px; background: var(--card-3); display: grid; place-items: center; font-size: 12px; color: var(--muted); flex: none; }
.lines { display: grid; gap: 8px; }
.add-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.add-row .btn { padding: 0 8px; gap: 6px; font-size: 13.5px; min-width: 0; overflow: hidden; }
.totals { display: grid; gap: 9px; font-size: 14.5px; }
.totals .tr { display: flex; justify-content: space-between; gap: 10px; color: var(--text-2); }
.totals .tr span:last-child { font-variant-numeric: tabular-nums; }
.totals .tr.big { font-size: 24px; font-weight: 800; letter-spacing: -.03em; padding-top: 12px; border-top: 1px solid var(--line); margin-top: 4px; color: var(--text); }
.inline-num { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--text-2); }
.inline-num .input { width: 96px; height: 40px; text-align: right; }
.amount-live { display: flex; justify-content: space-between; align-items: center; padding: 14px; border-radius: 14px; background: var(--grad-soft); border: 1px solid rgba(124, 108, 255, .25); }
.amount-live b { font-size: 22px; }
.ed-desk { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
.ed-desk .sticky { position: sticky; top: calc(var(--head) + 16px); display: grid; gap: 12px; }

/* =================== Detalle =================== */
.qhero { padding: 18px; border-radius: 22px; border: 1px solid var(--line); background: radial-gradient(120% 140% at 100% 0%, rgba(139, 92, 246, .22), transparent 55%), var(--card); }
.qhero .big { font-size: 32px; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.qhero .meta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; color: var(--muted); }
.qhero .meta span { display: inline-flex; gap: 6px; align-items: center; }
.acts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.act { display: grid; justify-items: center; gap: 6px; padding: 12px 2px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); color: var(--text-2); font-size: 12px; font-weight: 600; cursor: pointer; text-decoration: none !important; }
.act .ai { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: var(--card-3); color: var(--text); }
.act.main .ai { background: var(--grad); color: #fff; box-shadow: 0 8px 20px rgba(124, 108, 255, .4); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 24px; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 10px var(--primary); }
.timeline li::after { content: ""; position: absolute; left: 8px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline .when { color: var(--muted); font-size: 12px; }
.doc-frame { border-radius: 20px; padding: 14px; background: #1a1f31; border: 1px solid var(--line); overflow: hidden; }
.det { display: grid; grid-template-columns: 1fr 360px; gap: 16px; align-items: start; }

/* =================== Documento (papel blanco) =================== */
.doc { --accent: #4f46e5; background: #fff; color: #111827; width: 100%; max-width: 820px; margin: 0 auto; padding: 46px 50px; border-radius: 8px; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); font-size: 13.5px; line-height: 1.5; }
.doc a { color: inherit; }
.doc-top { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; padding-bottom: 22px; border-bottom: 3px solid var(--accent); }
.doc-logo { max-height: 70px; max-width: 220px; object-fit: contain; display: block; margin-bottom: 10px; }
.doc-co { font-size: 12.5px; color: #4b5563; }
.doc-co b { font-size: 17px; color: #111827; display: block; margin-bottom: 4px; }
.doc-title { text-align: right; }
.doc-title h2 { font-size: 28px; font-weight: 800; color: var(--accent); letter-spacing: .02em; }
.doc-title .n { font-weight: 700; font-size: 15px; margin-top: 4px; }
.doc-meta { margin-top: 10px; font-size: 12.5px; color: #4b5563; display: grid; gap: 2px; }
.doc-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 24px 0 20px; }
.doc-box h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin-bottom: 6px; }
.doc-box { font-size: 13px; color: #374151; }
.doc-box b { color: #111827; font-size: 14.5px; }
.doc table { width: 100%; border-collapse: collapse; }
.doc th { background: #f8fafc; text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #6b7280; padding: 10px; border-bottom: 2px solid #e5e7eb; }
.doc td { padding: 10px; border-bottom: 1px solid #eef0f4; vertical-align: top; }
.doc td.desc { white-space: pre-wrap; word-break: break-word; }
.doc tr.sec td { font-weight: 700; color: var(--accent); background: #fafbff; padding-top: 12px; }
.doc .num { text-align: right; white-space: nowrap; }
.doc-sum { display: flex; justify-content: flex-end; margin-top: 18px; }
.doc-sum table { width: 330px; }
.doc-sum td { border: 0; padding: 5px 10px; }
.doc-sum tr.tot td { font-size: 18px; font-weight: 800; color: #fff; background: var(--accent); padding: 12px 10px; }
.doc-sum tr.tot td:first-child { border-radius: 8px 0 0 8px; box-shadow: 2px 0 0 var(--accent); }
.doc-sum tr.tot td:last-child { border-radius: 0 8px 8px 0; }
.doc-notes { margin-top: 26px; display: grid; gap: 14px; font-size: 12.5px; color: #4b5563; }
.doc-notes h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #111827; margin-bottom: 4px; }
.doc-notes p { white-space: pre-wrap; }
.doc-stamp { margin-top: 22px; border: 2px solid #059669; color: #065f46; background: #ecfdf5; border-radius: 10px; padding: 12px 16px; font-size: 13px; }
.doc-stamp.bad { border-color: #dc2626; color: #991b1b; background: #fef2f2; }
.doc-foot { margin-top: 30px; padding-top: 12px; border-top: 1px solid #eef0f4; font-size: 11px; color: #9ca3af; text-align: center; }

/* =================== Página pública =================== */
.pub { min-height: 100vh; padding-bottom: 130px; }
.pub-top { position: sticky; top: 0; z-index: 40; background: rgba(7, 9, 15, .8); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line-2); }
.pub-top .in { max-width: 860px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 12px; }
.pub-wrap { max-width: 860px; margin: 18px auto; padding: 0 12px; }
.pub-bar { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(18, 22, 37, .94); backdrop-filter: blur(16px); border-top: 1px solid var(--line); padding: 12px 16px calc(12px + var(--safe-b)); z-index: 60; }
.pub-bar .in { max-width: 860px; margin: 0 auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pub-bar .tot { font-weight: 800; font-size: 22px; letter-spacing: -.03em; }
.pub-msg { max-width: 860px; margin: 0 auto 14px; padding: 14px 16px; border-radius: 16px; font-weight: 600; display: flex; gap: 10px; align-items: center; }
.pub-msg.ok { background: var(--ok-soft); color: var(--ok); border: 1px solid rgba(52, 211, 153, .3); }
.pub-msg.bad { background: var(--bad-soft); color: var(--bad); border: 1px solid rgba(248, 113, 113, .3); }
.pub-msg.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid rgba(251, 191, 36, .3); }
.made-by { text-align: center; color: var(--muted); font-size: 13px; margin-top: 20px; }

/* =================== Ajustes =================== */
.acc { border-radius: 18px; background: var(--card); border: 1px solid var(--line); overflow: hidden; }
.acc + .acc { margin-top: 10px; }
.acc > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 15px 16px; cursor: pointer; font-weight: 600; }
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary .si { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--grad-soft); color: var(--primary-2); }
.acc > summary .chev { margin-left: auto; color: var(--muted); transition: transform .2s; }
.acc[open] > summary .chev { transform: rotate(90deg); }
.acc .acc-body { padding: 4px 16px 16px; display: grid; gap: 14px; }
.acc .acc-foot { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.profile-card { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 20px; background: radial-gradient(120% 140% at 100% 0%, rgba(139, 92, 246, .25), transparent 55%), var(--card); border: 1px solid var(--line); margin-bottom: 14px; }
.logo-box { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.logo-prev { width: 120px; height: 70px; border: 1px dashed var(--line); border-radius: 14px; display: grid; place-items: center; background: #fff; overflow: hidden; color: #6b7280; font-size: 12px; }
.logo-prev img { max-width: 100%; max-height: 100%; object-fit: contain; }
.color-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--card); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.swatch.on { box-shadow: 0 0 0 2px var(--text); }

/* =================== Impresión / PDF =================== */
#print-root { display: none; }
@media print {
  @page { size: A4; margin: 12mm; }
  :root { color-scheme: light; }
  html, body { background: #fff !important; background-image: none !important; }
  #app, #toasts, .modal-bg { display: none !important; }
  #print-root { display: block; }
  #print-root .doc { box-shadow: none; padding: 0; max-width: none; border-radius: 0; }
  .doc tr, .doc-notes, .doc-sum, .doc-stamp { break-inside: avoid; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* =================== Responsive (móvil = app) =================== */
@media (max-width: 1080px) {
  .dash, .det, .ed-desk { grid-template-columns: 1fr; }
  .ed-desk .sticky { position: static; }
}
@media (max-width: 900px) {
  :root { --head: 58px; }
  .lp-hero .in { grid-template-columns: 1fr; padding-top: 40px; gap: 36px; }
  .features { grid-template-columns: 1fr 1fr; }
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .desk-only { display: none !important; }
  .mob-only { display: initial !important; }
  .apphead { padding-left: 14px; padding-right: 10px; }
  .appmain { padding: 14px 14px calc(var(--tab) + 28px + var(--safe-b)); }
  .appmain.sub { padding-bottom: calc(110px + var(--safe-b)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; position: fixed; left: 10px; right: 10px; bottom: calc(10px + var(--safe-b)); height: var(--tab); z-index: 60;
    background: rgba(20, 24, 40, .86); backdrop-filter: saturate(160%) blur(18px); border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 20px 50px rgba(0, 0, 0, .6); padding: 0 4px; }
  .tabbar a { display: grid; justify-items: center; gap: 3px; font-size: 10.5px; font-weight: 600; color: var(--muted); padding: 8px 0; text-decoration: none !important; }
  .tabbar a.on { color: var(--text); }
  .tabbar a.on .ico { color: var(--primary-2); filter: drop-shadow(0 0 8px rgba(167, 139, 250, .6)); }
  .tabbar .ico { width: 23px; height: 23px; }
  .tabbar .plus { justify-self: center; width: 54px; height: 54px; border-radius: 18px; background: var(--grad); color: #fff; display: grid; place-items: center; box-shadow: 0 12px 26px rgba(124, 108, 255, .55); margin-top: -6px; padding: 0; }
  .tabbar .plus .ico { width: 26px; height: 26px; color: #fff; filter: none; }
  .month-h { top: calc(var(--head) + var(--safe-t)); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .doc-frame { padding: 6px; margin: 0 -4px; border-radius: 16px; }
  .steps { position: sticky; top: calc(var(--head) + var(--safe-t)); z-index: 6; background: var(--bg); padding: 8px 0; margin: -8px 0 8px; }
  .step { justify-content: center; padding: 9px 6px; font-size: 12.5px; }
}
@media (max-width: 640px) {
  .features { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-2.keep { grid-template-columns: 1fr 1fr; }
  .hero .big { font-size: 31px; }
  .tile .tv { font-size: 19px; }
  .doc { padding: 20px 15px; font-size: 12px; }
  .doc-top { flex-direction: column; gap: 14px; }
  .doc-title { text-align: left; }
  .doc-parties { grid-template-columns: 1fr; gap: 14px; }
  .doc th.hm, .doc td.hm { display: none; }
  .doc-sum table { width: 100%; }
  .modal-bg { padding: 0; place-items: end stretch; }
  .modal { width: 100% !important; border-radius: 26px 26px 0 0; max-height: 92vh; border-bottom: 0; animation: sheetUp .28s cubic-bezier(.2, .8, .2, 1); }
  @keyframes sheetUp { from { transform: translateY(100%); } }
  .grab { display: block; width: 42px; height: 5px; border-radius: 9px; background: rgba(255, 255, 255, .2); margin: 10px auto 0; }
  .modal-head { padding-top: 10px; }
  .modal-foot .btn { flex: 1; }
  .pub-bar .btn { flex: 1; }
  .pub-bar .tot { width: 100%; }
  .step .lbl { display: none; }
  .step.on .lbl { display: inline; }
}

/* Barra de acciones (escritorio: flotante dentro del contenido) */
.actionbar { display: flex; gap: 10px; align-items: center; position: sticky; bottom: 16px; margin-top: 18px; padding: 12px 14px; border-radius: 20px;
  background: rgba(18, 22, 37, .92); backdrop-filter: blur(16px); border: 1px solid var(--line); box-shadow: var(--shadow-lg); z-index: 30; }
.actionbar .tot .xs { color: var(--muted); }
.actionbar .tot b { font-size: 20px; display: block; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
@media (max-width: 900px) {
  .actionbar { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; border-radius: 22px 22px 0 0; border-bottom: 0; padding: 12px 14px calc(12px + var(--safe-b)); }
}
