:root {
  --bg: #f6f6f8;
  --card: #ffffff;
  --line: #e9e9ee;
  --line-2: #f1f1f4;
  --ink: #16161a;
  --ink-2: #4a4a55;
  --mute: #8a8a96;
  --side: #ffffff;
  --side-2: #f4f4f6;
  --side-ink: #3a3a42;
  --acc: #1b8bd2;
  --acc-2: #1c63b8;
  --acc-soft: #e8f3fb;
  --red: #1c63b8;
  --grad: linear-gradient(135deg, #1b8bd2 0%, #1c63b8 100%);
  --head: Poppins, Inter, system-ui, sans-serif;
  --ok: #16a34a; --ok-soft: #e8f7ee;
  --warn: #d97706; --warn-soft: #fdf3e2;
  --bad: #b91c1c; --bad-soft: #fdecec;
  --info: #2563eb; --info-soft: #e9f0fe;
  --r: 14px;
  --shadow: 0 1px 2px rgba(20,20,30,.04), 0 4px 16px rgba(20,20,30,.04);
  --shadow-lg: 0 20px 60px rgba(20,20,40,.18);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: Roboto, Inter, system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--ink); font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.ic { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.num { font-variant-numeric: tabular-nums; }

/* ── Layout ─────────────────────────────────────── */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 22px 12px 14px; z-index: 30; }
.logo { display: block; padding: 2px 10px 18px; }
.logo img { display: block; width: 170px; height: auto; }
.logo small { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.logo small i { width: 6px; height: 6px; border-radius: 50%; background: var(--acc); }
#nav { flex: 1; overflow-y: auto; }
.nav-group { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #9a9aa4; font-weight: 600; padding: 16px 12px 6px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; margin: 2px 0; font-weight: 500; color: var(--side-ink); transition: background .15s, color .15s; }
.nav-item:hover { background: var(--side-2); color: var(--ink); }
.nav-item.on { background: var(--grad); color: #fff; box-shadow: 0 6px 18px rgba(27,139,210,.28); }
.nav-item .badge { margin-left: auto; font-size: 11px; background: var(--side-2); padding: 1px 7px; border-radius: 99px; }
.nav-item.on .badge { background: rgba(255,255,255,.25); }
.nav-item .new { margin-left: auto; font-size: 10px; font-weight: 700; background: var(--acc); color: #fff; padding: 1px 6px; border-radius: 99px; letter-spacing: .03em; }
.side-foot { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 10px; }
.ai-pill { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 8px 12px; border-radius: 10px; background: var(--bg); color: var(--ink-2); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 0 rgba(52,211,153,.6); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52,211,153,.6);} 70% { box-shadow: 0 0 0 8px rgba(52,211,153,0);} 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0);} }
.user { display: flex; align-items: center; gap: 10px; padding: 4px 8px; }
.user b { display: block; color: var(--ink); font-size: 13px; }
.user small { color: #8a8a96; font-size: 11px; display: block; max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #111; display: grid; place-items: center; color: #fff; font-weight: 700; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 14px 28px; background: rgba(255,255,255,.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, rgba(27,139,210,.55), transparent); }
.search { position: relative; display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; width: min(420px, 100%); color: var(--mute); }
.search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; color: var(--ink); }
.search kbd { font-size: 11px; border: 1px solid var(--line); background: #fff; border-radius: 5px; padding: 0 6px; color: var(--mute); }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); display: none; max-height: 380px; overflow: auto; padding: 6px; }
.search-results.on { display: block; }
.sr-item { display: block; padding: 8px 10px; border-radius: 8px; color: var(--ink); cursor: pointer; }
.sr-item:hover, .sr-item.sel { background: var(--bg); }
.sr-item b { font-weight: 500; display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-item small { color: var(--mute); font-size: 12px; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 14px; position: relative; }
.sync { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--mute); }
.sync .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid transparent; background: transparent; display: grid; place-items: center; color: var(--ink-2); position: relative; }
.icon-btn:hover { background: var(--bg); border-color: var(--line); }
.bell i { position: absolute; top: 2px; right: 2px; background: #ef4444; color: #fff; font-style: normal; font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 99px; display: grid; place-items: center; padding: 0 4px; }
.menu-btn { display: none; }
.notif { position: absolute; top: 46px; right: 0; width: 380px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); display: none; overflow: hidden; }
.notif.on { display: block; }
.notif h4 { margin: 0; padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 14px; display: flex; justify-content: space-between; }
.notif h4 small { color: var(--mute); font-weight: 400; }
.notif-item { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.notif-item:hover { background: var(--bg); }
.notif-item b { font-weight: 500; font-size: 13px; display: block; line-height: 1.35; }
.notif-item small { color: var(--mute); font-size: 12px; }

.view { padding: 26px 28px 60px; max-width: 1480px; width: 100%; }

/* ── Primitives ─────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 6px; }
.card-h h3 { margin: 0; font-size: 15px; font-weight: 600; }
.card-h p { margin: 2px 0 0; color: var(--mute); font-size: 12px; }
.card-b { padding: 12px 20px 20px; }
.eyebrow { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); font-weight: 600; }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; padding: 8px 14px; border-radius: 10px; font-weight: 500; font-size: 13px; white-space: nowrap; transition: transform .1s, box-shadow .15s, background .15s; }
.btn:hover { background: var(--bg); }
.btn:active { transform: translateY(1px); }
.btn .ic { width: 16px; height: 16px; }
.btn.pri { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 6px 18px rgba(27,139,210,.25); }
.btn.pri:hover { filter: brightness(1.05); }
.btn.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 99px; background: var(--bg); color: var(--ink-2); white-space: nowrap; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.info { background: var(--info-soft); color: var(--info); }
.tag.acc { background: var(--acc-soft); color: var(--acc); }
.tag .ic { width: 12px; height: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 6px 12px; font-size: 13px; font-weight: 500; color: var(--ink-2); transition: all .15s; }
.chip:hover { border-color: #d6d6de; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.on .ic { stroke: #fff; }
.chip .ic { width: 14px; height: 14px; }
.input, select.input { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 12px; outline: none; min-width: 0; }
.input:focus { border-color: var(--acc); box-shadow: 0 0 0 3px rgba(27,139,210,.12); }
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-h h1, .hero h1, .card-h h3, .kpi b, .hero-stats b, .scan-top h3, .notif h4 { font-family: var(--head); }
.page-h h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.page-h p { margin: 6px 0 0; color: var(--mute); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.muted { color: var(--mute); }
.ring { --p: 0; --c: var(--ok); width: 44px; height: 44px; border-radius: 50%; background: conic-gradient(var(--c) calc(var(--p) * 1%), #ececf1 0); display: grid; place-items: center; flex: none; position: relative; }
.ring::before { content: ''; position: absolute; inset: 4px; background: #fff; border-radius: 50%; }
.ring b { position: relative; font-size: 13px; font-weight: 700; }
.ring.lg { width: 92px; height: 92px; }
.ring.lg::before { inset: 8px; }
.ring.lg b { font-size: 26px; }
.ring.lg b small { font-size: 12px; color: var(--mute); font-weight: 500; }
.ring.sm { width: 34px; height: 34px; }
.ring.sm::before { inset: 3px; }
.ring.sm b { font-size: 11px; }
.bar { height: 6px; background: #ececf1; border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--grad); }
.empty { text-align: center; padding: 40px 20px; color: var(--mute); }

/* ── Dashboard ──────────────────────────────────── */
.hero { position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--grad); }
.hero::after { content: ''; position: absolute; right: -80px; top: -120px; width: 420px; height: 320px; background: radial-gradient(closest-side, rgba(27,139,210,.10), transparent); pointer-events: none; }
.hero-top { display: flex; justify-content: space-between; gap: 16px; padding: 24px 24px 22px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero h1 { margin: 6px 0 6px; font-size: 26px; letter-spacing: -.02em; }
.hero p { margin: 0; color: var(--ink-2); }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.hero-stats > div { padding: 18px 24px; border-right: 1px solid var(--line); }
.hero-stats > div:last-child { border-right: 0; background: var(--ink); color: #fff; border-radius: 0 0 var(--r) 0; }
.hero-stats > div:last-child .eyebrow { color: #a1a1ad; }
.hero-stats > div:last-child small { color: #a1a1ad; }
.hero-stats b { display: block; font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin: 6px 0 2px; }
.hero-stats small { color: var(--mute); font-size: 12px; }
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin: 18px 0; }
.kpi { padding: 16px 18px; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.kpi:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(20,20,40,.08); }
.kpi-h { display: flex; justify-content: space-between; align-items: center; }
.kpi-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; }
.kpi-ic .ic { width: 16px; height: 16px; }
.kpi b { display: block; font-size: 28px; font-weight: 700; margin: 12px 0 6px; letter-spacing: -.02em; }
.kpi small { color: var(--mute); font-size: 12px; }
.kpi small strong { color: var(--ink); font-weight: 600; }
.dash-2 { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; margin-bottom: 16px; }
.dash-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.match-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.match-row:last-child { border-bottom: 0; }
.match-row:hover .mr-t { color: var(--acc); }
.mr-body { flex: 1; min-width: 0; }
.mr-t { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .15s; }
.mr-s { color: var(--mute); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.mr-r { text-align: right; flex: none; }
.mr-r b { display: block; font-size: 13px; }
.mr-r small { font-size: 11px; color: var(--mute); }
.why { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.funnel svg { width: 100%; height: auto; display: block; }
.feed-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.feed-item:last-child { border-bottom: 0; }
.feed-ic { width: 30px; height: 30px; border-radius: 9px; background: var(--bg); display: grid; place-items: center; flex: none; color: var(--ink-2); }
.feed-ic .ic { width: 15px; height: 15px; }
.feed-item p { margin: 0; font-size: 13px; line-height: 1.4; }
.feed-item small { color: var(--mute); font-size: 11px; }
.due { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.due:last-child { border-bottom: 0; }
.due-d { width: 44px; text-align: center; border-radius: 10px; background: var(--bg); padding: 5px 0; flex: none; }
.due-d b { display: block; font-size: 17px; line-height: 1.1; }
.due-d small { font-size: 10px; text-transform: uppercase; color: var(--mute); font-weight: 600; }
.due-d.hot { background: var(--bad-soft); color: var(--bad); }
.due-d.hot small { color: var(--bad); }
.sector-bars .sb { display: grid; grid-template-columns: 130px 1fr 40px; gap: 10px; align-items: center; padding: 6px 0; font-size: 13px; }
.sector-bars .sb span:last-child { text-align: right; color: var(--mute); }

/* ── Licitaciones table ─────────────────────────── */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.toolbar .search-in { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 7px 12px; flex: 1; min-width: 220px; color: var(--mute); }
.toolbar .search-in input { border: 0; outline: 0; flex: 1; min-width: 0; color: var(--ink); }
.range { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.range input { accent-color: var(--acc); width: 110px; }
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fcfcfd; cursor: pointer; user-select: none; }
.tbl th.sorted { color: var(--ink); }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr { cursor: pointer; transition: background .1s; }
.tbl tbody tr:hover { background: #f3f8fc; }
.tbl tbody tr.dim { opacity: .55; }
.t-obj { max-width: 460px; }
.t-obj b { font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.35; }
.t-obj small { color: var(--mute); font-size: 12px; display: block; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-num { text-align: right; white-space: nowrap; font-weight: 600; }
.t-num small { display: block; color: var(--mute); font-weight: 400; font-size: 11px; }
.tbl-foot { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; color: var(--mute); font-size: 12px; }
.scan-banner { display: flex; align-items: center; gap: 16px; padding: 16px 20px; margin-bottom: 16px; background: linear-gradient(120deg, #111, #0a2340); color: #fff; border-radius: var(--r); position: relative; overflow: hidden; }
.scan-banner::after { content: ''; position: absolute; inset: 0; background: radial-gradient(400px 120px at 85% 0%, rgba(27,139,210,.4), transparent); pointer-events: none; }
.scan-banner .sb-ic { width: 42px; height: 42px; border-radius: 12px; background: var(--grad); display: grid; place-items: center; flex: none; }
.scan-banner b { display: block; font-size: 15px; }
.scan-banner small { color: #b8c9da; }
.scan-banner .btn { position: relative; z-index: 1; margin-left: auto; color: var(--ink); }

/* ── Pipeline ───────────────────────────────────── */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: 280px; gap: 14px; overflow-x: auto; padding-bottom: 16px; min-height: 60vh; }
.col { display: flex; flex-direction: column; min-height: 0; }
.col-h { border-top: 3px solid var(--c); padding: 10px 4px; display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; font-size: 13px; }
.col-h small { color: var(--mute); font-weight: 500; }
.col-sum { font-size: 11px; color: var(--mute); padding: 0 4px 8px; }
.col-body { flex: 1; display: flex; flex-direction: column; gap: 10px; border-radius: 12px; padding: 4px; transition: background .15s; min-height: 120px; }
.col-body.over { background: rgba(27,139,210,.06); outline: 2px dashed rgba(27,139,210,.35); }
.kcard { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); cursor: grab; transition: box-shadow .15s, transform .15s; }
.kcard:hover { box-shadow: 0 8px 24px rgba(20,20,40,.1); }
.kcard.drag { opacity: .4; }
.kcard-t { font-weight: 500; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kcard-o { color: var(--mute); font-size: 12px; margin: 4px 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kcard-f { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; }
.kcard-f b { font-size: 13px; }
.kcard-m { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }

/* ── Drawer ─────────────────────────────────────── */
.drawer-wrap { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.drawer-bg { position: absolute; inset: 0; background: rgba(15,15,25,.35); opacity: 0; transition: opacity .2s; }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(760px, 100%); background: #fff; box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform .28s cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column; }
.drawer-wrap.on { pointer-events: auto; }
.drawer-wrap.on .drawer-bg { opacity: 1; }
.drawer-wrap.on .drawer { transform: none; }
.dr-h { padding: 22px 26px 18px; border-bottom: 1px solid var(--line); }
.dr-h h2 { margin: 10px 0 6px; font-size: 20px; line-height: 1.3; letter-spacing: -.01em; }
.dr-h .close { position: absolute; top: 16px; right: 16px; }
.dr-b { flex: 1; overflow-y: auto; padding: 20px 26px 30px; }
.dr-f { padding: 14px 26px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; background: #fcfcfd; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 20px; }
.facts > div { background: #fff; padding: 12px 14px; }
.facts small { display: block; color: var(--mute); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; margin-bottom: 4px; }
.facts b { font-weight: 600; font-size: 14px; }
.ai-box { border: 1px solid #cbdff0; background: linear-gradient(180deg, #f0f6fb, #fff); border-radius: 14px; padding: 16px 18px; margin-bottom: 20px; }
.ai-box h4 { margin: 0 0 8px; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--acc); }
.ai-box p { margin: 0; line-height: 1.6; color: var(--ink-2); }
.score-head { display: flex; gap: 20px; align-items: center; margin-bottom: 18px; }
.score-head h4 { margin: 0 0 4px; font-size: 16px; }
.score-head p { margin: 0; color: var(--ink-2); line-height: 1.5; }
.sec-t { font-size: 13px; font-weight: 600; margin: 22px 0 10px; display: flex; align-items: center; gap: 8px; }
.checks { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.check { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; padding: 11px 14px; border-bottom: 1px solid var(--line-2); }
.check:last-child { border-bottom: 0; }
.check-i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; }
.check-i .ic { width: 13px; height: 13px; stroke-width: 2.6; }
.check-i.ok { background: var(--ok-soft); color: var(--ok); }
.check-i.warn { background: var(--warn-soft); color: var(--warn); }
.check-i.bad { background: var(--bad-soft); color: var(--bad); }
.check b { font-weight: 500; display: block; }
.check small { color: var(--mute); font-size: 12px; }
.check .pts { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.crit { display: grid; grid-template-columns: 170px 1fr 44px; align-items: center; gap: 12px; padding: 6px 0; font-size: 13px; }
.crit span:last-child { text-align: right; font-weight: 600; }
.risk { display: flex; gap: 10px; padding: 8px 0; font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.risk .ic { color: var(--warn); width: 16px; height: 16px; margin-top: 2px; }
.stage-sel { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── Scan modal ─────────────────────────────────── */
.modal-wrap { position: fixed; inset: 0; z-index: 70; background: rgba(15,15,25,.45); display: none; place-items: center; padding: 20px; }
.modal-wrap.on { display: grid; }
.modal { background: #fff; border-radius: 18px; width: min(560px, 100%); box-shadow: var(--shadow-lg); overflow: hidden; }
.scan-top { background: linear-gradient(120deg, #111, #0a2340); color: #fff; padding: 24px 26px; position: relative; overflow: hidden; }
.scan-top h3 { margin: 0 0 4px; font-size: 18px; }
.scan-top p { margin: 0; color: #b8c9da; font-size: 13px; }
.scan-top .radar { position: absolute; right: 24px; top: 50%; width: 64px; height: 64px; margin-top: -32px; border-radius: 50%; border: 1px solid rgba(255,255,255,.2); background: conic-gradient(from 0deg, rgba(10,120,200,.7), transparent 30%); animation: spin 1.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.scan-steps { padding: 18px 26px; }
.scan-step { display: flex; align-items: center; gap: 12px; padding: 8px 0; color: var(--mute); transition: color .2s; }
.scan-step .si { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; flex: none; }
.scan-step.run { color: var(--ink); }
.scan-step.run .si { border-color: var(--acc); border-top-color: transparent; animation: spin .8s linear infinite; }
.scan-step.done { color: var(--ink); }
.scan-step.done .si { border-color: var(--ok); background: var(--ok); color: #fff; }
.scan-step.done .si .ic { width: 12px; height: 12px; stroke-width: 3; }
.scan-step span:last-child { margin-left: auto; font-size: 12px; font-variant-numeric: tabular-nums; }
.scan-prog { margin: 6px 26px 0; }
.scan-foot { padding: 16px 26px 22px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.scan-result { display: none; padding: 0 26px 6px; }
.scan-result.on { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.scan-result > div { background: var(--bg); border-radius: 12px; padding: 12px; text-align: center; }
.scan-result b { display: block; font-size: 24px; }
.scan-result small { color: var(--mute); font-size: 12px; }

/* ── Documentos (generador) ─────────────────────── */
.gen { display: grid; grid-template-columns: 360px 1fr; gap: 18px; align-items: start; }
.gen-side { position: sticky; top: 84px; }
.gen-side .card-b { display: grid; gap: 14px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field .input { width: 100%; }
.doc-opts { display: grid; gap: 8px; }
.doc-opt { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; transition: border-color .15s, background .15s; }
.doc-opt:hover { border-color: #d6d6de; }
.doc-opt.on { border-color: var(--acc); background: #f0f6fb; }
.doc-opt input { accent-color: var(--acc); margin-top: 2px; }
.doc-opt b { font-weight: 500; display: block; font-size: 13px; }
.doc-opt small { color: var(--mute); font-size: 12px; }
.tone { display: flex; gap: 6px; flex-wrap: wrap; }
.gen-tabs { display: flex; gap: 8px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 14px; align-items: center; }
.gen-tablist { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.gen-tablist::-webkit-scrollbar { display: none; }
.gen-tab { white-space: nowrap; }
.gen-exp { display: flex; gap: 6px; flex: none; }
.gen-tab { border: 0; background: transparent; padding: 8px 12px; border-radius: 8px; font-weight: 500; font-size: 13px; color: var(--ink-2); display: flex; gap: 8px; align-items: center; }
.gen-tab.on { background: var(--ink); color: #fff; }
.gen-tab .st { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.gen-tab .st.run { background: var(--warn); animation: blink 1s infinite; }
.gen-tab .st.done { background: var(--ok); }
@keyframes blink { 50% { opacity: .3; } }
.paper-wrap { background: #e9e9ee; border-radius: var(--r); padding: 28px; height: calc(100vh - 230px); min-height: 420px; overflow-y: auto; overscroll-behavior: contain; scroll-behavior: auto; }
.paper { background: #fff; max-width: 800px; margin: 0 auto; padding: 64px 72px; box-shadow: 0 2px 10px rgba(0,0,0,.08); font-family: 'Source Serif 4', Georgia, serif; font-size: 15px; line-height: 1.65; color: #222; min-height: 900px; }
.paper .doc-head { display: flex; justify-content: space-between; align-items: center; font-family: Inter, sans-serif; font-size: 11px; color: var(--mute); border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 36px; }
.paper .doc-title { font-size: 28px; font-weight: 700; line-height: 1.25; margin: 0 0 8px; color: #111; }
.paper .doc-sub { font-family: Inter, sans-serif; color: var(--ink-2); font-size: 13px; margin-bottom: 34px; }
.paper h2 { font-size: 19px; margin: 30px 0 10px; color: #111; }
.paper h3 { font-size: 16px; margin: 20px 0 8px; }
.paper p { margin: 0 0 12px; text-align: justify; }
.paper ul { margin: 0 0 12px; padding-left: 22px; }
.paper li { margin-bottom: 4px; }
.paper table { width: 100%; border-collapse: collapse; font-family: Inter, sans-serif; font-size: 12px; margin: 8px 0 16px; }
.paper th, .paper td { border: 1px solid #ddd; padding: 7px 9px; text-align: left; }
.paper th { background: #f5f5f7; font-weight: 600; }
.paper .gantt td.g { padding: 0; }
.paper .gantt td.g i { display: block; height: 14px; margin: 0 2px; background: var(--grad); border-radius: 3px; }
.paper .sign { margin-top: 40px; font-family: Inter, sans-serif; font-size: 13px; }
.paper .note { font-family: Inter, sans-serif; font-size: 12px; background: #f0f6fb; border-left: 3px solid var(--acc); padding: 10px 12px; color: var(--ink-2); margin: 12px 0; }
.caret::after { content: ''; display: inline-block; width: 8px; height: 17px; background: var(--acc); vertical-align: text-bottom; margin-left: 2px; animation: blink .8s infinite; }
.paper-empty { font-family: Inter, sans-serif; text-align: center; color: var(--mute); padding: 160px 20px; }
.paper-empty .big { width: 64px; height: 64px; border-radius: 18px; background: var(--grad); color: #fff; display: grid; place-items: center; margin: 0 auto 16px; }
.paper-empty .big .ic { width: 30px; height: 30px; }
.gen-stats { display: flex; gap: 16px; font-size: 12px; color: var(--mute); padding: 0 4px 10px; flex-wrap: wrap; align-items: center; min-height: 32px; font-variant-numeric: tabular-nums; }
.gen-stats span { display: inline-flex; align-items: center; gap: 4px; }
.gen-stats .ic { width: 14px; height: 14px; }
.gen-stats b { color: var(--ink); }

/* ── Calendario ─────────────────────────────────── */
.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); margin-bottom: 12px; }
.cal-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--line); gap: 1px; }
.cal-dow { background: #fcfcfd; text-align: center; padding: 10px 0; font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--mute); }
.cal-day { background: #fff; min-height: 116px; padding: 8px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day.out { background: #f7f7f9; }
.cal-day.out .cd-n { color: #c0c0c8; }
.cd-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
.cd-n { font-size: 12px; font-weight: 600; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.cal-day.today .cd-n { background: var(--acc); color: #fff; }
.cd-c { font-size: 10px; color: var(--mute); }
.ev { font-size: 11px; padding: 3px 6px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 10%, #fff); color: #333; }
.ev:hover { background: color-mix(in srgb, var(--c) 18%, #fff); }
.ev-more { font-size: 10px; color: var(--mute); padding-left: 4px; }

/* ── Perfil ─────────────────────────────────────── */
.prof { display: grid; grid-template-columns: 1fr 360px; gap: 18px; align-items: start; }
.prof .card-b { display: grid; gap: 18px; }
.presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.preset { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fff; text-align: left; transition: all .15s; }
.preset:hover { border-color: #d6d6de; }
.preset.on { border-color: var(--acc); background: #f0f6fb; box-shadow: 0 0 0 3px rgba(27,139,210,.1); }
.preset b { display: block; margin: 8px 0 2px; }
.preset small { color: var(--mute); font-size: 12px; }
.preset .pi { width: 32px; height: 32px; border-radius: 9px; background: var(--bg); display: grid; place-items: center; }
.preset.on .pi { background: var(--grad); color: #fff; }
.f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
textarea.input { width: 100%; min-height: 80px; resize: vertical; line-height: 1.5; }
.kb-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.kb-item:last-child { border-bottom: 0; }
.kb-item .fi { width: 30px; height: 30px; border-radius: 8px; background: var(--bg); display: grid; place-items: center; flex: none; }
.kb-item .fi .ic { width: 15px; height: 15px; }
.kb-item small { color: var(--mute); display: block; font-size: 11px; }
.drop { border: 1.5px dashed #d6d6de; border-radius: 12px; padding: 16px; text-align: center; color: var(--mute); font-size: 12px; margin-top: 10px; }

/* ── Toasts ─────────────────────────────────────── */
.toasts { position: fixed; bottom: 22px; right: 22px; z-index: 90; display: grid; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: center; font-size: 13px; animation: tin .25s ease; max-width: 380px; }
.toast .ic { color: #34d399; }
@keyframes tin { from { transform: translateY(10px); opacity: 0; } }

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .dash-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1080px) {
  .dash-2, .gen, .prof { grid-template-columns: 1fr; }
  .gen-side { position: static; }
  .paper { padding: 40px 32px; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; width: 250px; transform: translateX(-100%); transition: transform .25s; }
  .side.on { transform: none; box-shadow: var(--shadow-lg); }
  .menu-btn { display: grid; }
  .sync { display: none; }
  .top { padding: 12px 16px; }
  .view { padding: 18px 16px 50px; }
  .hero-stats { grid-template-columns: 1fr; }
  .hero-stats > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .hero-stats > div:last-child { border-radius: 0 0 var(--r) var(--r); }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .dash-3, .presets, .f2 { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr 1fr; }
  .cal-day { min-height: 80px; padding: 4px; }
  .ev { font-size: 9px; padding: 2px 3px; }
  .notif { width: calc(100vw - 32px); }
  .paper-wrap { padding: 10px; }
  .paper { padding: 28px 20px; min-height: 0; }
  .crit { grid-template-columns: 110px 1fr 40px; }
}

@media print {
  body { background: #fff; }
  .side, .top, .gen-side, .gen-tabs, .gen-stats, .toasts, .page-h { display: none !important; }
  .app { display: block; }
  .view { padding: 0; max-width: none; }
  .gen { display: block; }
  .paper-wrap { background: none; padding: 0; }
  .paper { box-shadow: none; padding: 0; max-width: none; min-height: 0; }
  .caret::after { display: none; }
}

/* ── Cabecera de empresa ──────────────────────────────── */
.co-head { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(90deg, #fff, #f0f6fb); flex-wrap: wrap; }
.co-head img { width: 150px; height: auto; }
.co-head b { display: block; font-family: var(--head); font-size: 15px; }
.co-head small { color: var(--mute); font-size: 12px; display: flex; align-items: center; gap: 4px; }
.co-head small .ic { width: 13px; height: 13px; }
.co-head .btn { margin-left: auto; }
.powered { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 10px; color: var(--mute); letter-spacing: .04em; }
.powered b { color: var(--ink-2); letter-spacing: .08em; }

/* ── Métricas BI ────────────────────────────────── */
.mx-tabs { display: flex; gap: 4px; align-items: center; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.mx-tabs a { display: flex; align-items: center; gap: 8px; padding: 10px 14px; font-weight: 500; color: var(--ink-2); border: 1px solid transparent; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; border-radius: 8px 8px 0 0; }
.mx-tabs a:hover { color: var(--ink); }
.mx-tabs a.on { color: var(--ink); border-color: var(--line); border-bottom: 2px solid var(--acc); background: #fff; }
.mx-tabs .ic { width: 16px; height: 16px; }
.note-bar { display: flex; gap: 10px; align-items: flex-start; background: #fff8e6; border: 1px solid #f6e3b0; color: #7a5a00; border-radius: 12px; padding: 12px 16px; margin: 0 0 16px; font-size: 13px; line-height: 1.5; }
.note-bar .ic { color: var(--warn); width: 16px; height: 16px; margin-top: 2px; flex: none; }
.chart { width: 100%; height: auto; display: block; }
.dt-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 12px; }
.dt-q { padding: 6px 10px; font-size: 13px; width: 220px; }
.tbl th.r, .tbl td.r { text-align: right; }
.tbl tr.me td { background: #f0f6fb; }
.ell { display: block; max-width: 380px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos { color: var(--ok); font-weight: 600; }
.warnc { color: var(--warn); font-weight: 600; }
.org-bars .ob { padding: 7px 0; }
.ob-t { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 5px; }
.ob-t span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ob-t span:last-child { white-space: nowrap; }
@media (max-width: 860px) { .kpis[style] { grid-template-columns: repeat(2, 1fr) !important; } .dash-2[style] { grid-template-columns: 1fr !important; } }

/* ── Ajustes responsive ─────────────────────────── */
.grid > *, .dash-2 > *, .dash-3 > *, .gen > *, .prof > *, .kpis > *, .card { min-width: 0; }
.view { min-width: 0; overflow-x: clip; }
.field .doc-opt { display: flex; margin: 0; font-weight: 400; color: inherit; }
.chart-wrap { width: 100%; overflow: hidden; }
.agenda { display: none; }
.ag-day { display: flex; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line-2); background: #fff; }
.ag-day:last-child { border-bottom: 0; }
.ag-d { width: 40px; text-align: center; flex: none; }
.ag-d b { display: block; font-size: 18px; line-height: 1.1; }
.ag-d small { font-size: 10px; text-transform: uppercase; color: var(--mute); font-weight: 600; }
.ag-day.today .ag-d b { color: var(--acc); }
.ag-evs { flex: 1; min-width: 0; display: grid; gap: 4px; }
.ag-evs .ev { font-size: 12px; padding: 6px 8px; }

@media (max-width: 1080px) {
  .kpis[style] { grid-template-columns: repeat(2, 1fr) !important; }
  .dash-2[style] { grid-template-columns: 1fr !important; }
  .paper-wrap { height: 75vh; }
}
@media (max-width: 860px) {
  body.nav-open::after { content: ''; position: fixed; inset: 0; background: rgba(15,15,25,.35); z-index: 25; }
  .top { gap: 10px; }
  .search { width: auto; flex: 1; }
  .search kbd { display: none; }
  .page-h h1 { font-size: 22px; }
  .page-h > .row { width: 100%; }
  .hero-top { padding: 20px 18px; }
  .hero-top > .row { width: 100%; }
  .hero h1 { font-size: 22px; }
  .hero-stats > div { padding: 14px 18px; }
  .hero-stats b { font-size: 24px; }
  .kpi { padding: 14px; }
  .kpi b { font-size: 22px; margin: 8px 0 4px; }
  .card-h { padding: 16px 16px 4px; }
  .card-b { padding: 10px 16px 16px; }
  .scan-banner { flex-wrap: wrap; padding: 16px; }
  .scan-banner > div { flex: 1; min-width: 200px; }
  .scan-banner .btn { margin-left: 0; width: 100%; justify-content: center; }
  .toolbar { padding: 12px; }
  .toolbar .search-in { min-width: 100%; }
  .toolbar select.input { flex: 1 1 40%; min-width: 0; }
  .toolbar .range { flex: 1 1 100%; }
  .toolbar .range input { flex: 1; }
  #fOnly { width: 100%; }
  .board { grid-auto-columns: 82vw; scroll-snap-type: x mandatory; }
  .col { scroll-snap-align: start; }
  .dr-h { padding: 18px 18px 14px; }
  .dr-h h2 { font-size: 17px; padding-right: 30px; }
  .dr-b { padding: 16px 18px 24px; }
  .dr-f { padding: 12px 18px; }
  .dr-f .btn { flex: 1; justify-content: center; }
  .score-head { gap: 14px; }
  .ring.lg { width: 72px; height: 72px; }
  .ring.lg b { font-size: 20px; }
  .check { grid-template-columns: 22px 1fr auto; padding: 10px 12px; }
  .gen-tabs { flex-wrap: wrap; }
  .gen-tablist { flex-basis: 100%; }
  .gen-exp { margin-left: auto; }
  .co-head .btn { margin-left: 0; }
  .mx-tabs > .tag { display: none; }
  .mx-tabs a { padding: 9px 10px; font-size: 13px; }
  .dt-h { flex-wrap: wrap; }
  .dt-q { width: 100%; }
  .dt-t { min-width: 640px; }
  .note-bar { font-size: 12px; padding: 10px 12px; }
  .sector-bars .sb { grid-template-columns: 110px 1fr 30px; }
  .toasts { left: 16px; right: 16px; bottom: 16px; }
  .toast { max-width: none; }
  .modal-wrap { padding: 12px; }
  .scan-steps, .scan-foot, .scan-result { padding-left: 18px; padding-right: 18px; }
  .scan-top { padding: 20px 18px; }
  .scan-top .radar { width: 44px; height: 44px; margin-top: -22px; right: 16px; }
}
@media (max-width: 640px) {
  .cal, .cal-legend { display: none; }
  .agenda { display: block; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
  .tbl.lic thead { display: none; }
  .tbl.lic, .tbl.lic tbody { display: block; }
  .tbl.lic tr { display: grid; grid-template-columns: 38px 1fr auto; gap: 6px 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
  .tbl.lic td { padding: 0; border: 0; }
  .tbl.lic td:nth-child(1) { grid-row: 1 / 4; align-self: start; }
  .tbl.lic td:nth-child(2) { grid-column: 3; grid-row: 2; text-align: right; }
  .tbl.lic td:nth-child(3) { grid-column: 2 / 4; grid-row: 1; }
  .tbl.lic td:nth-child(4), .tbl.lic td:nth-child(5) { display: none; }
  .tbl.lic td:nth-child(6) { grid-column: 2; grid-row: 2; text-align: left; }
  .tbl.lic td:nth-child(7) { grid-column: 2; grid-row: 3; }
  .tbl.lic td:nth-child(7) small { display: none !important; }
  .tbl.lic td:nth-child(8) { grid-column: 3; grid-row: 3; text-align: right; }
  .t-obj { max-width: none; }
  .t-num small { display: inline; margin-left: 4px; }
  .facts { grid-template-columns: 1fr 1fr; }
  .gen-side .card-b { gap: 12px; }
  .paper-wrap { height: 70vh; min-height: 360px; padding: 8px; }
  .paper { padding: 24px 18px; font-size: 14px; }
  .paper .doc-title { font-size: 22px; }
  .paper h2 { font-size: 17px; }
  .paper table { font-size: 11px; display: block; overflow-x: auto; }
  .presets { grid-template-columns: 1fr; }
  .co-head img { width: 120px; }
  .notif { right: -8px; }
}
@media print { .paper-wrap { height: auto; overflow: visible; } }

/* ── Agentes IA ─────────────────────────────────── */
.ag { display: grid; grid-template-columns: 280px 1fr; gap: 18px; height: calc(100vh - 160px); min-height: 520px; }
.ag-list { display: flex; flex-direction: column; overflow: auto; }
.ag-items { display: grid; gap: 4px; padding: 8px 10px; }
.ag-item { display: flex; gap: 12px; align-items: center; text-align: left; border: 1px solid transparent; background: none; border-radius: 12px; padding: 10px; transition: background .15s, border-color .15s; }
.ag-item:hover { background: var(--bg); }
.ag-item.on { background: #f0f6fb; border-color: #cbdff0; }
.ag-item b { display: block; font-size: 13px; font-weight: 600; }
.ag-item small { color: var(--mute); font-size: 12px; }
.ag-av { --c: var(--acc); width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; color: #fff; background: var(--c); box-shadow: 0 4px 12px color-mix(in srgb, var(--c) 30%, transparent); }
.ag-av .ic { width: 17px; height: 17px; }
.ag-av.lg { width: 40px; height: 40px; }
.ag-av.sm { width: 28px; height: 28px; border-radius: 8px; }
.ag-av.sm .ic { width: 14px; height: 14px; }
.ag-caps { margin-top: auto; padding: 14px 18px 18px; border-top: 1px solid var(--line); display: grid; gap: 8px; font-size: 12px; color: var(--ink-2); }
.ag-caps > div { display: flex; gap: 8px; align-items: center; }
.ag-caps .ic { width: 14px; height: 14px; color: var(--ok); }
.ag-chat { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.ag-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.ag-head b { display: block; font-family: var(--head); }
.ag-head small { color: var(--mute); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.ag-head .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); display: inline-block; }
.ag-head .btn { margin-left: auto; }
.ag-thread { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 20px 18px; display: flex; flex-direction: column; gap: 18px; background: linear-gradient(180deg, #fcfcfd, #fff); }
.msg { display: flex; gap: 12px; max-width: 920px; }
.msg.me { align-self: flex-end; max-width: 75%; }
.msg.me .bubble { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 16px 16px 4px 16px; line-height: 1.5; white-space: pre-wrap; }
.ai-body { flex: 1; min-width: 0; }
.ai-name { font-weight: 600; font-size: 13px; margin: 6px 0 6px; }
.ai-name small { color: var(--mute); font-weight: 400; margin-left: 4px; }
.ai-via { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--mute); background: var(--bg); border-radius: 99px; padding: 3px 9px; margin-bottom: 8px; }
.ai-via .ic { width: 12px; height: 12px; }
.steps { display: grid; gap: 4px; margin-bottom: 10px; }
.steps:empty { display: none; }
.step { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--mute); }
.step .si { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; flex: none; }
.step.run { color: var(--ink-2); }
.step.run .si { border-color: var(--acc); border-top-color: transparent; animation: spin .8s linear infinite; }
.step.done .si { border-color: var(--ok); background: var(--ok); color: #fff; }
.step.done .si .ic { width: 9px; height: 9px; stroke-width: 3.4; }
.ai-text { line-height: 1.6; color: var(--ink); }
.ai-text .caret::after { height: 14px; width: 6px; }
.typing { display: inline-flex; gap: 4px; padding: 6px 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: #c9c9d2; animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
.ai-blocks { margin-top: 12px; display: grid; gap: 8px; }
.ai-blocks.in { animation: tin .3s ease; }
.ag-card { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 12px; }
.ag-card.pre { background: #f7f9ff; border-color: #dfe7fb; }
.ag-n { font-size: 11px; font-weight: 700; color: var(--mute); width: 14px; text-align: center; flex: none; }
.ag-c-body { flex: 1; min-width: 0; }
.ag-c-body > b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-c-body > small { display: block; color: var(--mute); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-c-meta { display: flex; gap: 8px; align-items: center; margin-top: 5px; font-size: 12px; flex-wrap: wrap; }
.ag-c-act { display: flex; gap: 6px; flex: none; }
.ag-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.ag-btns:empty { display: none; }
.ag-sub { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-top: 6px; }
.ag-sub .ic { width: 14px; height: 14px; }
.ag-checks .check { padding: 8px 12px; }
.ag-tbl { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: 13px; }
.ag-tbl td, .ag-tbl th { padding: 8px 12px; }
.ag-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ag-stats > div { border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: grid; grid-template-columns: 8px 1fr; column-gap: 8px; align-items: center; }
.ag-stats i { width: 8px; height: 8px; border-radius: 50%; }
.ag-stats span { font-size: 12px; color: var(--ink-2); }
.ag-stats b { grid-column: 2; font-size: 18px; font-family: var(--head); }
.ag-stats small { grid-column: 2; color: var(--mute); font-size: 11px; }
.doc-snip { border: 1px solid var(--line); border-radius: 12px; background: #e9e9ee; padding: 12px; max-height: 300px; overflow: hidden; position: relative; }
.doc-snip::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 80px; background: linear-gradient(transparent, #e9e9ee); }
.doc-snip .paper { min-height: 0; padding: 28px 34px; font-size: 13px; }
.doc-snip .paper .doc-title { font-size: 20px; }
.doc-snip .paper .doc-sub { margin-bottom: 16px; }
.ag-follow { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.ag-follow .chip { font-size: 12px; padding: 5px 10px; background: #fff; }
.ag-follow .chip:hover { border-color: var(--acc); color: var(--acc); }
.ag-input { display: flex; gap: 10px; align-items: flex-end; padding: 12px 14px 6px; border-top: 1px solid var(--line); background: #fff; }
.ag-input textarea { flex: 1; resize: none; border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; outline: none; line-height: 1.4; max-height: 140px; font: inherit; }
.ag-input textarea:focus { border-color: var(--acc); box-shadow: 0 0 0 3px rgba(27,139,210,.12); }
.ag-input .btn { height: 44px; width: 44px; justify-content: center; padding: 0; border-radius: 12px; }
.ag-disc { display: block; text-align: center; color: var(--mute); font-size: 11px; padding: 0 0 10px; background: #fff; }
.fab { position: fixed; right: 22px; bottom: 22px; z-index: 40; display: flex; align-items: center; gap: 8px; background: var(--grad); color: #fff; padding: 12px 18px; border-radius: 99px; font-weight: 600; font-size: 14px; box-shadow: 0 10px 28px rgba(27,139,210,.35); transition: transform .15s; }
.fab:hover { transform: translateY(-2px); }
.fab.off { display: none; }
.toasts { bottom: 84px; }
@media (max-width: 1080px) {
  .ag { grid-template-columns: 1fr; height: auto; }
  .ag-list .card-h, .ag-caps { display: none; }
  .ag-items { display: flex; overflow-x: auto; padding: 8px; scrollbar-width: none; }
  .ag-items::-webkit-scrollbar { display: none; }
  .ag-item { flex: none; padding: 8px 12px 8px 8px; }
  .ag-chat { height: calc(100dvh - 190px); min-height: 440px; }
}
@media (max-width: 860px) {
  .ag-thread { padding: 16px 12px; }
  .msg.me { max-width: 88%; }
  .msg.ai .ag-av { display: none; }
  .ag-head { padding: 12px; }
  .ag-head .btn span { display: none; }
  .ag-card { flex-wrap: wrap; }
  .ag-c-act { width: 100%; padding-left: 26px; }
  .ag-c-act .btn { flex: 1; justify-content: center; }
  .ag-stats { grid-template-columns: repeat(2, 1fr); }
  .doc-snip .paper { padding: 18px; }
  .fab { right: 16px; bottom: 16px; padding: 12px; }
  .fab span { display: none; }
  .toasts { bottom: 80px; }
}
.msg.ai { width: 100%; min-width: 0; }
.ai-blocks { grid-template-columns: minmax(0, 1fr); }
.ag-thread { overflow-x: hidden; }
@media (max-width: 1080px) { .ag-chat { height: calc(100dvh - 215px); } }

/* ── Marca Boprisa: azul corporativo en todos los acentos ── */
.logo small i { background: var(--red); }
.nav-item .new { background: var(--red); }
.bell i { background: var(--red); }
.hero::before { background: linear-gradient(90deg, var(--acc), var(--acc) 70%, var(--red)); }
.logo img { width: 190px; }

/* ── Agente en ventana emergente ────────────────── */
button.fab { border: 0; cursor: pointer; font: inherit; font-weight: 600; }
.pop { position: fixed; right: 22px; bottom: 22px; z-index: 55; width: 420px; height: min(640px, calc(100vh - 44px)); background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; opacity: 0; transform: translateY(16px) scale(.98); transform-origin: bottom right; pointer-events: none; visibility: hidden; transition: opacity .18s, transform .18s, visibility .18s; }
.pop.on { opacity: 1; transform: none; pointer-events: auto; visibility: visible; }
.pop-h { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; border-bottom: 1px solid var(--line); }
.pop-t { flex: 1; min-width: 0; }
.pop-t b { display: block; font-family: var(--head); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pop-t select { border: 0; background: transparent; color: var(--ink); font-family: var(--head); font-weight: 700; font-size: 14px; padding: 0 18px 0 0; margin-left: -2px; cursor: pointer; max-width: 100%; }
.pop-t select:focus { outline: none; }
.pop-t small { display: block; color: var(--mute); font-size: 11px; }
.pop .ag-thread { padding: 16px 14px; gap: 14px; }
.pop .msg.ai .ag-av { display: none; }
.pop .msg.me { max-width: 85%; }
.pop .ag-card { flex-wrap: wrap; }
.pop .ag-c-act { width: 100%; padding-left: 26px; }
.pop .ag-c-act .btn { flex: 1; justify-content: center; }
.pop .ag-stats { grid-template-columns: repeat(2, 1fr); }
.pop .doc-snip .paper { padding: 18px; }
.pop .ag-input { padding: 10px 12px 12px; }
@media (max-width: 860px) {
  .pop { inset: 0; width: auto; height: 100dvh; border-radius: 0; border: 0; }
}

/* ── Probabilidad de adjudicación ───────────────── */
.prob { display: inline-flex; flex-direction: column; gap: 4px; min-width: 74px; }
.prob b { font-size: 14px; font-variant-numeric: tabular-nums; }
.prob i { display: block; height: 5px; border-radius: 99px; background: #e8ebf0; overflow: hidden; }
.prob u { display: block; height: 100%; border-radius: 99px; }
.winbox { display: grid; grid-template-columns: 170px 1fr; gap: 16px; border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 18px; background: linear-gradient(180deg, #fff, #f6f9fc); }
.wb-p { display: flex; flex-direction: column; justify-content: center; border-right: 1px solid var(--line); padding-right: 12px; }
.wb-p b { font-size: 46px; line-height: 1; font-weight: 800; color: var(--c); font-family: var(--head); letter-spacing: -0.02em; }
.wb-p b small { font-size: 20px; margin-left: 2px; }
.wb-p span { font-size: 12px; color: var(--mute); margin-top: 6px; }
.wb-f { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.wf { display: flex; gap: 8px; align-items: flex-start; }
.wf b { display: block; font-size: 12.5px; font-weight: 600; }
.wf small { color: var(--mute); font-size: 11.5px; line-height: 1.35; display: block; }
.wf-i { font-size: 10px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; flex: none; margin-top: 1px; }
.wf.up .wf-i { background: var(--ok-soft); color: var(--ok); }
.wf.mid .wf-i { background: var(--warn-soft); color: var(--warn); }
.wf.down .wf-i { background: var(--bad-soft); color: var(--bad); }

/* ── Documentos del expediente ──────────────────── */
.docs-exp { display: grid; gap: 8px; }
.dx { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.dx > div { flex: 1; min-width: 0; }
.dx b { display: block; font-weight: 500; font-size: 13.5px; }
.dx small { color: var(--mute); font-size: 12px; }
.dx-i { width: 34px; height: 40px; border-radius: 6px; background: #fdecec; color: #c62828; font-size: 10px; font-weight: 800; display: grid; place-items: center; flex: none; letter-spacing: .04em; }
.dx-i.lg { width: 44px; height: 52px; font-size: 11px; background: var(--acc-soft); color: var(--acc); }
.dx-i .ic { width: 20px; height: 20px; }

/* ── Análisis de documentos ─────────────────────── */
.ana { display: grid; grid-template-columns: 340px 1fr; gap: 18px; align-items: start; }
.ana > * { min-width: 0; }
.ana-side { display: grid; gap: 14px; position: sticky; top: 84px; }
.drop-a { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 28px 18px; border: 2px dashed #b9cde0; border-radius: var(--r); background: #f7fafd; cursor: pointer; transition: border-color .15s, background .15s; }
.drop-a:hover, .drop-a.over { border-color: var(--acc); background: var(--acc-soft); }
.dz-i { width: 48px; height: 48px; border-radius: 14px; background: var(--grad); color: #fff; display: grid; place-items: center; margin-bottom: 4px; transform: rotate(180deg); }
.dz-i .ic { width: 22px; height: 22px; }
.drop-a b { font-size: 15px; }
.drop-a small { color: var(--mute); }
.dz-n { display: flex; gap: 6px; align-items: center; font-size: 11.5px; color: var(--ink-2); margin-top: 8px; }
.dz-n .ic { width: 13px; height: 13px; color: var(--ok); }
.ex-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ana-hi { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; border: 1px solid transparent; background: none; border-radius: 10px; padding: 8px; }
.ana-hi:hover { background: var(--bg); }
.ana-hi.on { border-color: var(--line); background: var(--acc-soft); }
.ana-hi b { display: block; font-size: 13px; font-weight: 500; }
.ana-hi small { color: var(--mute); font-size: 11.5px; }
.ana-hi .dx-i { width: 28px; height: 34px; font-size: 9px; }
.ana-res, .ana-run, .ana-empty { padding: 22px 24px; }
.ana-h { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.ana-h b { font-size: 16px; word-break: break-all; }
.ana-run .steps { margin: 8px 0 0; gap: 8px; }
.ana-run .step { font-size: 14px; }
.ana-facts { grid-template-columns: repeat(3, 1fr); }
.ana-facts .span3 { grid-column: 1 / -1; }
.ana-facts .span2 { grid-column: span 2; }
.ana-facts b { font-size: 13.5px; line-height: 1.4; }
.ana-2 { margin-top: 4px; }
.ana-2 .crit { grid-template-columns: 1fr 120px 30px; }
.mem-eval { display: flex; gap: 18px; align-items: center; }
.ana-empty { text-align: center; padding: 70px 24px; color: var(--mute); }
.ana-empty .big { width: 60px; height: 60px; border-radius: 18px; background: var(--grad); color: #fff; display: grid; place-items: center; margin: 0 auto 14px; }
.ana-empty .big .ic { width: 28px; height: 28px; }
.ana-empty b { display: block; color: var(--ink); font-size: 16px; }
@media (max-width: 1080px) { .ana { grid-template-columns: 1fr; } .ana-side { position: static; } }
@media (max-width: 860px) {
  .winbox { grid-template-columns: 1fr; }
  .wb-p { border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 12px; }
  .wb-f { grid-template-columns: 1fr; }
  .ana-facts { grid-template-columns: 1fr 1fr; }
  .ana-facts .span2 { grid-column: 1 / -1; }
  .ana-res, .ana-run { padding: 16px; }
  .mem-eval { flex-direction: column; align-items: flex-start; }
}
