/* SOSFIX Impuestos — estilos (mobile-first). Diseñado por SOSFIX · By Atlas */
:root {
  --navy: #0F094F;      /* azul marino del logo */
  --navy-2: #1E1873;
  --red: #9D1514;       /* rojo del logo */
  --red-2: #C21F25;
  --primary: var(--navy);
  --accent: var(--red);
  --bg: #F2F4F9;
  --card: #FFFFFF;
  --field: #F8F9FC;
  --line: #D5DAE6;
  --text: #121633;
  --muted: #5A6278;
  --success: #1B7F3B;
  --warning: #B7791F;
  --danger: #B42318;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15,9,79,.06), 0 6px 20px rgba(15,9,79,.07);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --nav-h: 76px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.45;
}
/* franja superior estilo bandera: azul + rojo */
body::before { content: ''; display: block; height: 6px; background: linear-gradient(90deg, var(--navy) 0 62%, var(--red) 62% 100%); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--navy); }
:focus-visible { outline: 3px solid rgba(157,21,20,.45); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app { max-width: 760px; margin: 0 auto; padding: 12px 12px calc(var(--nav-h) + 80px + env(safe-area-inset-bottom, 0px)); }
.app.wide { max-width: 1000px; padding-bottom: 24px; }

/* Header */
.header {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); padding: 10px 14px; border-radius: var(--radius);
  border: 1px solid var(--line); border-bottom: 3px solid var(--navy);
  box-shadow: var(--shadow); margin-bottom: 12px; position: relative;
}
.header::after { content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 3px; background: var(--red); border-radius: 0 0 4px 4px; opacity: .9; }
.logo { width: 72px; height: auto; flex-shrink: 0; }
.header h1 { font-size: 1.02rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--navy); line-height: 1.15; }
.header .sub { font-size: .8rem; color: var(--red); font-weight: 600; letter-spacing: .02em; }
.badge { display: inline-block; background: var(--navy); color: #fff; padding: 3px 11px; border-radius: 99px; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-left: auto; flex-shrink: 0; }
.header a.badge { text-decoration: none; }

/* Progress (transform-only, no layout) */
.progress { display: flex; align-items: center; gap: 12px; background: var(--card); padding: 12px 14px; border-radius: var(--radius); margin: 18px 0 12px; border: 1px solid var(--line); }
.progress-track { flex: 1; height: 8px; background: #E4E8F1; border-radius: 99px; overflow: hidden; }
.progress-fill {
  height: 100%; width: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--navy), var(--navy-2) 70%, var(--red));
  transform-origin: left center; transform: scaleX(0);
  transition: transform .45s var(--ease-out);
}
.progress-text { font-size: .85rem; color: var(--muted); min-width: 7.5em; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* Steps */
.step { display: none; background: var(--card); padding: 20px 16px; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); }
.step.active { display: block; }
.step.enter { animation: stepIn .28s var(--ease-out) both; }
.step.enter.back { animation-name: stepInBack; }
@keyframes stepIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes stepInBack { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }

.step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.step-head h2 { font-size: 1.18rem; color: var(--navy); display: flex; align-items: center; gap: 8px; outline: none; font-weight: 800; }
.step-head h2 .icon { color: var(--red); }
.step-head .help-btn { margin-left: auto; }
.step-count { font-size: .72rem; color: var(--red); margin-bottom: 4px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.icon { width: 1.15em; height: 1.15em; flex-shrink: 0; }
.lead { color: var(--muted); margin-bottom: 12px; font-size: .95rem; }

/* Forms */
.form-group { margin-bottom: 14px; }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.form-group label, .label-row label { font-weight: 600; color: var(--text); font-size: .92rem; }
.form-group > label { display: block; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=number], input[type=password], select {
  width: 100%; padding: 12px 14px; background: var(--field);
  border: 1px solid var(--line); border-radius: 10px; font-size: 16px; /* 16px evita zoom en iOS */
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input::placeholder { color: #98A0B3; }
input:focus, select:focus { outline: none; border-color: var(--navy); background: #fff; box-shadow: 0 0 0 3px rgba(15,9,79,.14); }
.invalid { border-color: var(--danger) !important; }
.err { color: var(--danger); font-size: .82rem; margin-top: 4px; min-height: 0; }
.row2 { display: grid; gap: 0 12px; }
@media (min-width: 560px) { .row2 { grid-template-columns: 1fr 1fr; } }

.help-btn {
  background: #fff; border: 1px solid var(--line); color: var(--navy); font-weight: 600;
  font-size: .78rem; padding: 3px 10px; border-radius: 99px; flex-shrink: 0;
}
.help-btn:hover { border-color: var(--navy); }

.checks { display: grid; gap: 8px; }
@media (min-width: 560px) { .checks { grid-template-columns: 1fr 1fr; } }
.check {
  display: flex; align-items: center; gap: 10px; padding: 12px; background: var(--field);
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 500;
}
.check input { width: 20px; height: 20px; accent-color: var(--navy); flex-shrink: 0; }
.check:has(input:checked) { border-color: var(--navy); background: #EEF0FA; box-shadow: inset 3px 0 0 var(--red); }

/* Dependents as cards (works on phones) */
.dep-card { background: var(--field); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.dep-card .dep-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; color: var(--navy); font-weight: 700; font-size: .85rem; }
.dep-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dep-grid .full { grid-column: 1 / -1; }
.dep-grid input, .dep-grid select { padding: 10px 12px; background: #fff; }
.dep-grid label { font-size: .75rem; color: var(--muted); display: block; margin-bottom: 3px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border: 1px solid transparent; border-radius: 10px; font-weight: 700; font-size: 1rem; letter-spacing: .01em; transition: transform .15s var(--ease-out), opacity .15s, background .15s, box-shadow .15s; text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--navy); color: #fff; box-shadow: 0 2px 0 var(--red); }
.btn-primary:hover { background: var(--navy-2); }
.btn-secondary { background: #fff; color: var(--navy); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--navy); }
.btn-ghost { background: #fff; color: var(--navy); border: 1.5px dashed var(--navy); }
.btn-danger { background: #fff; color: var(--danger); border: 1px solid rgba(180,35,24,.45); padding: 6px 12px; font-size: .85rem; }
.btn-warn { background: var(--red); color: #fff; }
.btn-warn:hover { background: var(--red-2); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: .88rem; }

/* Photos */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 12px; }
.photo { position: relative; border-radius: 10px; overflow: hidden; background: var(--field); border: 1px solid var(--line); animation: pop .25s var(--ease-out) both; }
.photo img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.photo { display: flex; flex-direction: column; }
.photo span, .photo .ph-cap { display: block; font-size: .7rem; padding: 4px 6px 2px; color: var(--muted); white-space: normal; overflow: visible; line-height: 1.25; word-break: break-word; }
.photo button { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: none; background: rgba(15,9,79,.8); color: #fff; }
@keyframes pop { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }

/* Signature */
.auth-label { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; font-size: .92rem; }
.auth-label input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--navy); flex-shrink: 0; }
.sig-box { background: var(--field); border: 2px dashed var(--navy); border-radius: 12px; padding: 10px; }
.sig-box canvas { display: block; width: 100%; height: 180px; background: #fff; border-radius: 8px; touch-action: none; cursor: crosshair; box-shadow: inset 0 -1px 0 var(--line); }
.sig-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 8px; }
.hint { font-size: .8rem; color: var(--muted); }
.summary { background: var(--field); border: 1px solid var(--line); border-left: 4px solid var(--navy); border-radius: 10px; padding: 12px; font-size: .92rem; display: grid; gap: 4px; }
.summary b { color: var(--navy); font-weight: 700; }

/* Sticky bottom nav — chat FAB sits above it, never on top of buttons */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: rgba(255,255,255,.94); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--line); box-shadow: 0 -4px 18px rgba(15,9,79,.08);
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
}
.nav-inner { max-width: 760px; margin: 0 auto; display: flex; gap: 10px; }
.nav-inner .btn { flex: 1; }

/* Done screen */
.done { text-align: center; padding: 28px 16px; }
.done .tick { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; background: rgba(27,127,59,.12); color: var(--success); display: grid; place-items: center; animation: pop .35s var(--ease-out) both; }
.done h2 { color: var(--navy); margin-bottom: 8px; }
.done p { color: var(--muted); margin-bottom: 16px; }
.done .btn { margin: 4px; }

/* Modal (opacity/transform, closable) */
.modal {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(15,9,79,.45); opacity: 0; visibility: hidden;
  transition: opacity .2s ease, visibility 0s linear .2s;
}
.modal.open { opacity: 1; visibility: visible; transition: opacity .2s ease, visibility 0s; }
.modal-card {
  background: var(--card); width: 100%; max-width: 480px; padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
  border-radius: 18px 18px 0 0; border-top: 4px solid var(--navy); position: relative;
  transform: translateY(24px); transition: transform .28s var(--ease-out);
}
.modal.open .modal-card { transform: none; }
@media (min-width: 560px) {
  .modal { align-items: center; }
  .modal-card { border-radius: 18px; transform: translateY(12px) scale(.98); }
}
.modal-close { position: absolute; right: 10px; top: 8px; width: 40px; height: 40px; border: none; background: none; color: var(--navy); font-size: 26px; line-height: 1; }
.modal-card h3 { margin-bottom: 8px; padding-right: 36px; color: var(--navy); }

/* Help demo — fixed height so nothing jumps while it animates */
.demo { margin-top: 14px; background: var(--field); border: 1px solid var(--line); border-radius: 12px; padding: 14px; min-height: 108px; display: grid; align-content: center; }
.demo-cap { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--red); font-weight: 700; margin-bottom: 8px; }
.demo-input { background: #fff; border: 1px solid var(--navy); border-radius: 8px; padding: 10px 12px; font-size: 1.05rem; white-space: nowrap; overflow: hidden; }
.demo-input .typed { color: var(--text); }
.caret { display: inline-block; width: 2px; height: 1.1em; background: var(--red); vertical-align: -0.15em; margin-left: 1px; animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.demo-card { background: #EEF0FA; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; opacity: 0; transform: translateY(8px); transition: opacity .3s ease, transform .3s var(--ease-out); }
.demo-card.in { opacity: 1; transform: none; }
.demo-check { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.demo-box { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--navy); display: grid; place-items: center; color: #fff; }
.demo-box svg { width: 14px; height: 14px; opacity: 0; transform: scale(.4); transition: opacity .2s, transform .25s var(--ease-out); }
.demo-check.on .demo-box { background: var(--navy); }
.demo-check.on .demo-box svg { opacity: 1; transform: none; }

/* Chat */
.chat-fab {
  position: fixed; right: 14px; bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom)); z-index: 60;
  display: flex; align-items: center; gap: 6px; border: 2px solid #fff; color: #fff;
  background: var(--red);
  padding: 10px 14px; border-radius: 99px; font-weight: 700; font-size: .9rem;
  box-shadow: 0 6px 18px rgba(157,21,20,.35);
}
.chat-win {
  position: fixed; right: 12px; left: 12px; bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom)); z-index: 70;
  height: min(420px, 60vh); background: #fff; border: 1px solid var(--line); border-radius: 16px;
  display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 16px 48px rgba(15,9,79,.25);
  opacity: 0; visibility: hidden; transform: translateY(12px); transform-origin: bottom right;
  transition: opacity .2s ease, transform .25s var(--ease-out), visibility 0s linear .25s;
}
.chat-win.open { opacity: 1; visibility: visible; transform: none; transition: opacity .2s ease, transform .25s var(--ease-out), visibility 0s; }
@media (min-width: 560px) { .chat-win { left: auto; width: 360px; } }
.chat-head { background: var(--navy); color: #fff; border-bottom: 3px solid var(--red); padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
.chat-head button { background: none; border: none; color: #fff; font-size: 24px; width: 36px; height: 36px; }
.chat-msgs { flex: 1; padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; background: var(--field); }
.msg { max-width: 82%; padding: 8px 12px; border-radius: 12px; font-size: .93rem; overflow-wrap: anywhere; animation: pop .2s var(--ease-out) both; }
.msg.client { background: var(--navy); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.msg.agent { background: #fff; align-self: flex-start; border-bottom-left-radius: 4px; border: 1px solid var(--line); }
.chat-form { display: flex; gap: 8px; padding: 10px; background: #fff; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; border-radius: 99px; }
.chat-form button { width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--red); color: #fff; flex-shrink: 0; display: grid; place-items: center; }

/* Agent / admin */
.card { background: var(--card); border-radius: var(--radius); padding: 18px 16px; margin-bottom: 12px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.card h2, .card h3 { color: var(--navy); }
.login-box { max-width: 400px; margin: 28px auto; border-top: 4px solid var(--navy); }
.login-box .login-logo { display: block; width: 190px; max-width: 70%; height: auto; margin: 4px auto 14px; }
.login-box h2 { margin-bottom: 4px; text-align: center; font-size: 1.15rem; letter-spacing: .04em; text-transform: uppercase; }
.login-box .login-sub { text-align: center; color: var(--muted); font-size: .85rem; margin-bottom: 14px; }
.login-box input { margin-bottom: 10px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.panel-head .tools { display: flex; gap: 8px; flex-wrap: wrap; }
.list { display: grid; gap: 10px; }
.client-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--navy); padding: 14px; border-radius: 12px; transition: border-color .15s, box-shadow .15s; }
.client-card:hover { border-color: var(--navy); border-left-color: var(--red); box-shadow: var(--shadow); }
.client-card strong { color: var(--navy); }
.client-card small { color: var(--muted); display: block; }
.pill { font-size: .74rem; padding: 3px 10px; border-radius: 99px; background: #E8EBF5; color: var(--navy); font-weight: 700; white-space: nowrap; }
.pill.ok { background: rgba(27,127,59,.12); color: var(--success); }
.pill.warn { background: rgba(157,21,20,.1); color: var(--red); }
.detail h3 { margin-bottom: 10px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; font-size: .93rem; margin-bottom: 12px; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { overflow-wrap: anywhere; }
.sig-img { background: #fff; border: 1px solid var(--line); border-radius: 8px; max-width: 280px; width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.muted { color: var(--muted); }
.no-docs { color: var(--red); margin-bottom: 12px; }
.notice { background: #FFF7E6; border: 1px solid #F1D19A; color: #7A4B00; border-radius: 10px; padding: 10px 12px; font-size: .85rem; margin-bottom: 12px; }

/* Portal */
.portal { display: grid; gap: 12px; margin-top: 18px; }
.portal a { display: block; text-decoration: none; color: inherit; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--navy); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); transition: transform .15s var(--ease-out), border-color .15s; }
.portal a:hover { border-left-color: var(--red); transform: translateY(-2px); }
.portal strong { display: block; color: var(--navy); font-size: 1.1rem; margin-bottom: 4px; }
.hero { text-align: center; padding: 22px 16px 8px; }
.hero img { width: 230px; max-width: 72%; height: auto; }
.hero p { color: var(--muted); margin-top: 8px; }

/* Pie de página */
.site-foot { text-align: center; font-size: .72rem; color: var(--muted); margin: 22px 0 6px; letter-spacing: .02em; }
.site-foot a { color: var(--muted); text-decoration: none; border-bottom: 1px dotted currentColor; }
.site-foot a:hover { color: var(--navy); }
.site-foot .stars { color: var(--red); letter-spacing: .3em; display: block; margin-bottom: 2px; font-size: .6rem; }

@media (min-width: 720px) {
  .app { padding-top: 20px; }
  .header { padding: 12px 20px; }
  .logo { width: 92px; }
  .header h1 { font-size: 1.25rem; }
  .step { padding: 26px 24px; }
}

/* Accesibilidad: sin animaciones si el usuario lo pide */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
}
.chat-fab.has-new::after { content: ''; position: absolute; top: 4px; right: 6px; width: 10px; height: 10px; border-radius: 50%; background: #FFD34D; box-shadow: 0 0 0 2px var(--red); }
.docs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-bottom: 12px; }
.docs-grid a { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--field); color: var(--muted); font-size: .75rem; text-decoration: none; }
.docs-grid img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.docs-grid span { display: block; padding: 4px 6px; }
/* Celular: el logo ya dice el nombre → encabezado compacto */
@media (max-width: 559px) {
  .header h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .logo { width: 92px; }
  .header .sub { font-size: .92rem; color: var(--navy); font-weight: 700; line-height: 1.25; }
  .header .sub::after { content: ''; display: block; width: 28px; height: 3px; background: var(--red); margin-top: 5px; border-radius: 2px; }
}

/* chats en vivo + revisión del expediente */
.live-item { display:flex; justify-content:space-between; align-items:center; gap:10px; width:100%; text-align:left; background:#fff; border:1px solid var(--line); border-left:4px solid var(--navy); padding:10px 12px; border-radius:12px; }
.live-item.unread { border-left-color: var(--red); background:#FFF8F0; }
.live-item strong { color: var(--navy); }
.live-item small { color: var(--muted); display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:60vw; }
.live-box { margin-top:12px; border-top:1px solid var(--line); padding-top:12px; }
.msg small.meta { display:block; font-size:.7rem; opacity:.7; margin-top:2px; }
.review { margin-top:12px; border:1px solid var(--line); border-radius:12px; padding:12px; background:#fff; }
.review ul { list-style:none; margin:8px 0 0; padding:0; display:flex; flex-direction:column; gap:6px; }
.review li { padding:7px 10px; border-radius:8px; font-size:.9rem; border-left:4px solid; }
.review li.error { background:rgba(157,21,20,.08); border-color:var(--red); }
.review li.falta { background:#FFF4E0; border-color:#D98A00; }
.review li.aviso { background:#EEF0FA; border-color:var(--navy); }
.review li b { margin-right:6px; }
.photo .ph-tools { position:static; left:auto; bottom:auto; display:flex; flex-wrap:wrap; gap:4px; padding:0 4px 6px; }
.photo .ph-tools button { position:static; width:auto; height:auto; padding:4px 8px; font-size:.72rem; border-radius:6px; background:rgba(15,9,79,.85); color:#fff; border:0; }
.photo .ph-flag { position:absolute; left:4px; top:4px; font-size:.65rem; background:rgba(27,127,59,.9); color:#fff; padding:2px 6px; border-radius:6px; }
.photo img { object-fit: contain; background: #fff; }

/* 2FA */
.mfa-steps { margin: 8px 0 8px 20px; font-size: .92rem; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.mfa-qr { display: flex; justify-content: center; margin: 8px 0; }
.mfa-qr img { width: 220px; height: 220px; border: 1px solid var(--line); border-radius: 10px; background: #fff; image-rendering: pixelated; }
.mfa-secret { display: inline-block; margin-top: 4px; font-size: .95rem; letter-spacing: 1px; background: var(--field); padding: 4px 8px; border-radius: 6px; word-break: break-all; user-select: all; }
.rc-list { columns: 2; margin: 10px 0 6px 22px; font-size: 1rem; }
.rc-list code { font-size: 1rem; letter-spacing: 1px; }
.invite-link { width: 100%; font-family: monospace; font-size: .85rem; }
.audit-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.audit-table th, .audit-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.audit-wrap { max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
@media print { body:not(.acc-printing):not(.guia-page) * { visibility: hidden; } #rc-list, #rc-list * { visibility: visible; } #rc-list { position: absolute; top: 0; left: 0; } }

/* ---------- Asistente IA SOSFIX (escudo flotante + cajón lateral; diseño del prototipo) ---------- */
:root { --ia-state: #16c8ee; --ia-glow: rgba(22,200,238,.52); }
body.has-ia { padding-bottom: 120px; }
.ia-fab { position: fixed; right: 28px; bottom: 25px; width: 94px; height: 108px; border: 0; background: transparent; padding: 0; z-index: 1001; filter: drop-shadow(0 9px 18px #0d24442b); transition: transform .22s ease; isolation: isolate; cursor: pointer; }
.ia-fab:hover { transform: translateY(-4px) scale(1.035); }
.ia-fab:focus-visible { outline: 3px solid #0ea5e9; outline-offset: 7px; border-radius: 20px; }
.ia-fab img { width: 100%; height: 100%; object-fit: contain; position: relative; z-index: 2; }
.ia-fab::before { content: ""; position: absolute; inset: 15% 12%; z-index: 1; border-radius: 50%; background: var(--ia-state); opacity: .25; filter: blur(20px); transform: scale(.82); animation: ia-glow 2.2s ease-in-out infinite; }
.ia-fab::after { content: ""; position: absolute; inset: 7% 3%; border: 2px solid var(--ia-state); border-radius: 42% 42% 47% 47%; opacity: .7; filter: drop-shadow(0 0 9px var(--ia-glow)); clip-path: polygon(50% 0,100% 20%,93% 66%,50% 100%,7% 66%,0 20%); animation: ia-ring 2.2s ease-in-out infinite; }
.ia-fab[data-status="incorrect"]::before, .ia-fab[data-status="missing"]::before { animation: ia-alert 1s ease-in-out infinite; }
.ia-fab[data-status="missing"]::after { animation: ia-ring .9s ease-in-out infinite; }
.ia-fab[data-status="verified"]::before { opacity: .48; filter: blur(24px); animation: ia-verified 1.7s ease-in-out infinite; }
.ia-fab[data-status="neutral"]::before { opacity: .15; animation: none; }
.ia-fab[data-status="neutral"]::after { opacity: .35; animation: none; }
.ia-tip { position: absolute; right: 106px; bottom: 30px; background: #10213e; color: #fff; padding: 8px 11px; border-radius: 9px; font-size: 11px; white-space: nowrap; box-shadow: 0 7px 18px #0b17302b; pointer-events: none; }
.ia-tip::after { content: ""; position: absolute; right: -5px; top: 50%; width: 9px; height: 9px; background: #10213e; transform: translateY(-50%) rotate(45deg); }
@keyframes ia-glow { 0%,100% { transform: scale(.78); opacity: .2 } 50% { transform: scale(1.08); opacity: .48 } }
@keyframes ia-ring { 0%,100% { transform: scale(.96); opacity: .35 } 50% { transform: scale(1.04); opacity: .85 } }
@keyframes ia-alert { 0%,100% { opacity: .13; transform: scale(.78) } 50% { opacity: .65; transform: scale(1.08) } }
@keyframes ia-verified { 0%,100% { transform: scale(.9); opacity: .3 } 50% { transform: scale(1.1); opacity: .72 } }
.ia-scrim { position: fixed; inset: 0; background: rgba(7,18,39,.28); backdrop-filter: blur(2px); z-index: 1002; opacity: 0; pointer-events: none; transition: opacity .24s; }
.ia-scrim.open { opacity: 1; pointer-events: auto; }
.ia-drawer { position: fixed; right: 0; top: 0; height: 100dvh; width: min(440px,100vw); background: #fff; z-index: 1003; box-shadow: -18px 0 50px #0c23401f; transform: translateX(102%); transition: transform .28s cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column; color: #172033; visibility: hidden; }
.ia-drawer.open { transform: translateX(0); visibility: visible; }
.ia-head { padding: 18px 19px 16px; border-bottom: 1px solid #e8edf4; display: flex; align-items: center; gap: 12px; }
.ia-mini { width: 45px; height: 51px; background: #0d1e3a; border-radius: 12px; display: grid; place-items: center; overflow: hidden; flex-shrink: 0; }
.ia-mini img { width: 37px; height: 46px; object-fit: contain; }
.ia-heading { flex: 1; min-width: 0; }
.ia-heading strong { font-size: 15px; display: block; }
.ia-heading small { display: flex; align-items: center; gap: 6px; color: #75839a; font-size: 11px; margin-top: 4px; }
.ia-dot { width: 7px; height: 7px; border-radius: 50%; background: #16a765; }
.ia-close { width: 34px; height: 34px; border: 1px solid #e2e8f0; background: #fff; border-radius: 10px; color: #65738a; font-size: 21px; line-height: 1; cursor: pointer; }
.ia-context { padding: 10px 18px; background: #f7f9fc; border-bottom: 1px solid #e8edf4; display: flex; gap: 8px; align-items: center; justify-content: space-between; font-size: 11px; color: #65738a; }
.ia-context b { color: #263751; font-weight: 650; }
.ia-chip { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid #e0e7f0; border-radius: 999px; padding: 5px 8px; white-space: nowrap; }
.ia-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--ia-state); }
.ia-msgs { padding: 18px; display: flex; flex-direction: column; gap: 13px; overflow-y: auto; flex: 1; background: linear-gradient(#fff,#fbfcff); }
.ia-welcome { padding: 18px; border: 1px solid #e3eaf3; background: #fff; border-radius: 15px; box-shadow: 0 5px 18px #0b173008; }
.ia-welcome .ia-spark { width: 32px; height: 32px; border-radius: 10px; background: #e8f8fc; color: #0784a5; display: grid; place-items: center; margin-bottom: 12px; font-size: 17px; }
.ia-welcome strong { display: block; font-size: 14px; margin-bottom: 7px; }
.ia-welcome p { margin: 0; color: #6b7890; font-size: 12px; line-height: 1.6; }
.ia-sugs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ia-sug { background: #fff; border: 1px solid #e0e7f0; border-radius: 11px; text-align: left; padding: 11px; font-size: 12px; color: #43516a; line-height: 1.4; cursor: pointer; }
.ia-sug:hover { border-color: #78cfe1; background: #f5fcfe; }
.ia-msg { max-width: 92%; padding: 11px 13px; border-radius: 13px; font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.ia-msg.user { align-self: flex-end; background: #10284c; color: #fff; border-bottom-right-radius: 4px; }
.ia-msg.agent { align-self: flex-start; background: #f1f5fa; color: #31415b; border-bottom-left-radius: 4px; }
.ia-msg.system { align-self: center; max-width: 100%; font-size: 11px; color: #8b5b10; background: #fff8e4; border: 1px solid #f5e4b5; }
.ia-msg.typing::after { content: "▍"; animation: ia-blink 1s steps(2) infinite; }
@keyframes ia-blink { 50% { opacity: 0 } }
.ia-composer { padding: 13px 15px 16px; border-top: 1px solid #e6ecf4; background: #fff; }
.ia-composer form { display: flex; align-items: flex-end; gap: 8px; border: 1px solid #dce5ef; border-radius: 14px; padding: 7px 7px 7px 12px; background: #fff; }
.ia-composer input { min-width: 0; flex: 1; border: 0; outline: 0; padding: 7px 0; font-size: 14px; color: #172033; background: transparent; box-shadow: none; }
.ia-send { width: 34px; height: 34px; border: 0; border-radius: 10px; background: #0c5c90; color: #fff; display: grid; place-items: center; font-size: 17px; cursor: pointer; flex-shrink: 0; }
.ia-send:disabled { opacity: .5; }
.ia-note { font-size: 10px; line-height: 1.5; color: #96a1b2; margin: 9px 2px 0; }
.ia-foot { border-top: 1px solid #edf1f6; padding: 10px 17px; display: flex; justify-content: space-between; align-items: center; color: #9aa4b4; font-size: 10px; }
.ia-foot button { border: 0; background: none; color: #63738d; font-size: 11px; text-decoration: underline; padding: 4px; cursor: pointer; }
@media (max-width: 650px) { .ia-fab { right: 14px; bottom: 14px; width: 64px; height: 75px; } .ia-tip { display: none; } .ia-drawer { width: 100vw; } body.has-ia { padding-bottom: 96px; } }
@media (prefers-reduced-motion: reduce) { .ia-fab::before, .ia-fab::after, .ia-msg.typing::after { animation: none !important; } .ia-drawer, .ia-scrim, .ia-fab { transition: none !important; } }

/* ---------- Borradores: "Llenando ahora" ---------- */
.progress { flex-wrap: wrap; }
.save-note { flex-basis: 100%; font-size: .72rem; margin: 0; color: var(--muted); }
.draft-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; text-align: left; background: var(--field); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; color: inherit; font: inherit; }
.draft-item:hover, .draft-item.sel { border-color: var(--accent); }
.draft-item strong { display: block; }
.draft-item small { color: var(--muted); }
.draft-bar { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 6px; width: 160px; max-width: 100%; }
.draft-bar i { display: block; height: 100%; background: var(--accent); }
.pill.live { background: #dcfce7; color: #166534; }
.pill.live::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #16a34a; margin-right: 5px; animation: ia-blink 1.4s steps(2) infinite; }
.draft-view { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 12px; }
.draft-view .ro { font-size: .75rem; color: var(--muted); }
/* la etiqueta "Pregunta a SOSFIX" se oculta sola a los 6 s para no tapar botones; vuelve al pasar el mouse */
.ia-tip { animation: ia-tipout .4s ease 6s forwards; }
.ia-fab:hover .ia-tip, .ia-fab:focus-visible .ia-tip { animation: none; opacity: 1; }
@keyframes ia-tipout { to { opacity: 0; visibility: hidden; } }

/* ---------- Contabilidad (pestaña del expediente) ---------- */
.tabs { display:flex; gap:4px; border-bottom:2px solid var(--line); margin:4px 0 14px; }
.tabs button { background:none; border:0; padding:10px 16px; font:inherit; font-weight:700; color:var(--muted); cursor:pointer; border-bottom:3px solid transparent; margin-bottom:-2px; border-radius:8px 8px 0 0; }
.tabs button[aria-selected="true"] { color:var(--navy); border-bottom-color:var(--red); background:var(--field); }
.tabs button:focus-visible { outline:2px solid var(--navy); outline-offset:2px; }
.acc-warn { background:#FFF1F0; border:1px solid #F5C2C0; border-left:5px solid #B42318; color:#7A1F1A; padding:10px 12px; border-radius:10px; margin-bottom:12px; font-size:.95rem; }
.acc-notice { background:#FFF6DB; border:1px solid #F0D58A; border-left:5px solid var(--warning); color:#5B3E00; padding:10px 12px; border-radius:10px; margin-bottom:12px; font-size:.95rem; }
.acc-bar { display:flex; flex-wrap:wrap; gap:10px; justify-content:space-between; align-items:center; margin-bottom:6px; }
.acc-bar .tools { display:flex; gap:6px; flex-wrap:wrap; }
.seg { display:inline-flex; background:var(--field); border:1px solid var(--line); border-radius:10px; padding:3px; }
.seg button { border:0; background:none; padding:8px 14px; border-radius:8px; font:inherit; font-weight:700; color:var(--muted); cursor:pointer; }
.seg button[aria-selected="true"] { background:var(--navy); color:#fff; }
.warn-text { color:var(--red); font-weight:600; }
.acc-grid { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(0,1fr); gap:16px; align-items:start; }
@media (max-width: 860px) { .acc-grid { grid-template-columns:1fr; } }
.acc-sec { border:1px solid var(--line); border-radius:12px; padding:4px 12px 10px; margin-bottom:10px; background:#fff; }
.acc-sec > summary { cursor:pointer; font-weight:700; color:var(--navy); padding:8px 0; }
.acc-f { display:grid; grid-template-columns:minmax(0,1fr) 150px; gap:8px; align-items:center; padding:4px 0; font-size:.9rem; }
.acc-f > span { color:var(--text); }
.acc-f > span.sub { padding-left:14px; color:var(--muted); }
.acc-f input, .acc-f select { padding:7px 9px; font-size:.92rem; min-height:36px; }
.acc-f.money input { text-align:right; font-variant-numeric:tabular-nums; }
.acc-check { display:flex; gap:8px; align-items:center; padding:5px 0; font-size:.9rem; }
.acc-dep { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:4px 10px; border-top:1px dashed var(--line); padding:8px 0; }
.acc-dep .acc-f { grid-template-columns:1fr; gap:2px; }
.acc-dep .btn { justify-self:start; align-self:end; }
.acc-res { position:sticky; top:12px; border:1px solid var(--line); border-radius:12px; padding:12px; background:#fff; }
.acc-bigs { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:10px; }
.acc-big { flex:1 1 150px; border-radius:12px; padding:10px 12px; background:var(--field); border:1px solid var(--line); display:flex; flex-direction:column; }
.acc-big b { font-size:1.6rem; color:var(--navy); font-variant-numeric:tabular-nums; }
.acc-big small { color:var(--muted); font-size:.78rem; }
.acc-big.ok b { color:var(--success); } .acc-big.owe b { color:var(--red); }
.acc-t { width:100%; border-collapse:collapse; font-size:.88rem; margin-bottom:10px; }
.acc-t caption { text-align:left; font-weight:700; color:var(--navy); padding:6px 0; }
.acc-t td { padding:4px 2px; border-bottom:1px solid #EEF0F6; }
.acc-t td:last-child { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
.acc-t tr.b td { font-weight:700; }
.acc-t tr.tot td { font-weight:800; color:var(--navy); border-top:2px solid var(--navy); font-size:.98rem; }
.acc-t tr.rec td { text-align:left; background:#EEF0FA; border-radius:6px; padding:6px 8px; }
.acc-list { font-size:.86rem; margin-top:8px; padding:8px 10px; border-radius:10px; }
.acc-list ul { margin:4px 0 0 18px; padding:0; }
.acc-list.falta { background:rgba(157,21,20,.06); border:1px solid rgba(157,21,20,.2); }
.acc-list.aviso { background:#F7F8FC; border:1px solid var(--line); }
.acc-oos { background:rgba(157,21,20,.07); border:1px solid rgba(157,21,20,.3); color:var(--red); padding:12px; border-radius:10px; }
.acc-foot { margin-top:10px; font-size:.8rem; color:var(--warning); font-weight:700; }
.temp-opt { display:flex; flex-direction:column; gap:6px; }
.temp-opt select:disabled { opacity:.55; }
.ext-days { width:auto; min-height:34px; padding:4px 8px; font-size:.85rem; }

/* =====================================================================
   Panel del preparador PREMIUM (agente.html, body.panel) — estética sosfix.us
   azul noche + degradado azul→cian, tarjetas suaves, Geist, microanimaciones
   ===================================================================== */
@font-face { font-family: 'Geist'; src: url('fonts/geist.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
body.panel {
  --p-950: #030915; --p-900: #061527; --p-850: #081c35; --p-800: #0b2545; --p-700: #12345e;
  --p-blue: #1d4ed8; --p-blue5: #2563eb; --p-teal: #0891b2; --p-cyan: #22d3ee;
  --p-grad: linear-gradient(120deg, #1d4ed8 0%, #0891b2 55%, #22d3ee 100%);
  --text: #1f2a3d; --ink: #0b1324; --muted: #5a6a82; --line: #e2e8f0; --line-2: #edf2f7; --bg: #f4f7fb; --field: #f6f9fc;
  --navy: #0b2545; --primary: #1d4ed8; --accent: #0891b2;
  --r: 18px; --r-sm: 12px; --ease: cubic-bezier(.2,.7,.2,1);
  --sh: 0 1px 2px rgba(11,19,36,.05), 0 8px 28px -12px rgba(11,37,69,.18);
  --sh-h: 0 2px 4px rgba(11,19,36,.06), 0 16px 36px -14px rgba(11,37,69,.28);
  font-family: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 420px at 85% -120px, rgba(34,211,238,.10), transparent 60%), var(--bg);
  color: var(--text); letter-spacing: -.005em;
}
body.panel::before { display: none; }
body.panel.noscroll { overflow: hidden; }
body.panel a { color: var(--p-blue); }
body.panel :focus-visible { outline: 3px solid rgba(34,211,238,.55); outline-offset: 2px; border-radius: 10px; }
.licon { width: 18px; height: 18px; flex-shrink: 0; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 2000; background: #fff; padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* barra superior */
.pbar { position: sticky; top: 0; z-index: 800; background: linear-gradient(180deg, var(--p-900), var(--p-850)); color: #e6f0ff; border-bottom: 1px solid rgba(103,232,249,.14); box-shadow: 0 10px 30px -18px rgba(3,9,21,.9); }
.pbar::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--p-grad); opacity: .85; }
.pbar-in { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; gap: 14px; padding: 10px 18px; flex-wrap: wrap; }
.pbrand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit !important; margin-right: auto; }
.pbrand img { width: 34px; height: auto; filter: drop-shadow(0 2px 6px rgba(0,0,0,.4)); background: #fff; border-radius: 9px; padding: 3px; }
.pbrand b { display: block; font-size: 1rem; font-weight: 700; letter-spacing: -.01em; color: #fff; }
.pbrand small { display: block; font-size: .74rem; color: #8fb4d8; font-weight: 500; }
.pbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pbtn { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 11px; border: 1px solid rgba(143,180,216,.25); background: rgba(18,52,94,.45); color: #e6f0ff !important; font-weight: 600; font-size: .88rem; text-decoration: none; transition: background .2s var(--ease), transform .2s var(--ease), border-color .2s; }
.pbtn:hover { background: rgba(29,78,216,.45); border-color: rgba(103,232,249,.45); transform: translateY(-1px); }
.pbtn-grad { background: var(--p-grad); border: 0; color: #fff !important; box-shadow: 0 6px 18px -6px rgba(34,211,238,.6); }
.pbtn-grad:hover { background: var(--p-grad); filter: brightness(1.08); }
.who-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 99px; background: rgba(255,255,255,.06); font-size: .84rem; color: #cfe1f5; max-width: 240px; }
.who-chip #who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

body.panel .app.wide { max-width: 1240px; padding: 18px 18px 120px; }
body.panel .site-foot { color: var(--muted); }
body.panel .site-foot a { color: var(--p-teal); }

/* login */
body.panel .login-box { max-width: 420px; margin: 40px auto; border-radius: 22px; border: 1px solid var(--line); box-shadow: var(--sh-h); padding: 28px 24px; position: relative; overflow: hidden; }
body.panel .login-box::before { content: ''; position: absolute; inset: 0 0 auto; height: 4px; background: var(--p-grad); }
body.panel .login-box h2 { color: var(--ink); }
body.panel .login-box input { border-radius: 12px; }

/* botones */
body.panel .btn { border-radius: 11px; font-weight: 600; letter-spacing: 0; gap: 7px; transition: transform .15s var(--ease), box-shadow .2s, background .2s, filter .2s; }
body.panel .btn:hover:not(:disabled) { transform: translateY(-1px); }
body.panel .btn:active:not(:disabled) { transform: translateY(0) scale(.98); }
body.panel .btn-primary { background: var(--p-grad); color: #fff; box-shadow: 0 6px 16px -8px rgba(29,78,216,.7); border: 0; }
body.panel .btn-primary:hover { filter: brightness(1.07); background: var(--p-grad); }
body.panel .btn-secondary { background: #fff; color: var(--p-800); border: 1px solid var(--line); }
body.panel .btn-secondary:hover { border-color: #b9d7f0; background: #f3f9ff; }
body.panel .btn-warn { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; box-shadow: none; }
body.panel .btn-warn:hover:not(:disabled) { background: #ffedd5; }
body.panel .btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-ghost-danger { background: #fff; color: #b42318; border: 1px solid #fecdca; }
.btn-ghost-danger:hover { background: #fef3f2; }
body.panel .btn-danger { background: #d92d20; color: #fff; border: 0; }
.btn-wa { background: #25d366; color: #05361b !important; border: 0; text-decoration: none; }
.btn-wa:hover { filter: brightness(1.05); }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--p-800); cursor: pointer; transition: background .2s, transform .15s; }
.icon-btn:hover { background: #f1f6fb; transform: rotate(90deg); }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 9px; }
.link-btn { display: inline-flex; align-items: center; gap: 5px; border: 0; background: #eef6ff; color: var(--p-blue); font-weight: 600; font-size: .82rem; padding: 4px 10px; border-radius: 99px; cursor: pointer; }
.link-btn .licon { width: 15px; height: 15px; }
.spin { width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; display: inline-block; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* saludo + KPIs */
.hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 6px 2px 16px; flex-wrap: wrap; }
.hello h1 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); font-weight: 700; letter-spacing: -.025em; color: var(--ink); }
.hello-sub { color: var(--muted); margin-top: 2px; }
.live-note { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); background: #fff; border: 1px solid var(--line); padding: 5px 12px; border-radius: 99px; }
.live-note .dot { width: 8px; height: 8px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 0 rgba(16,185,129,.5); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(16,185,129,0); } 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); } }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi { display: flex; align-items: center; gap: 14px; text-align: left; padding: 16px; border-radius: var(--r); border: 1px solid var(--line); background: #fff; box-shadow: var(--sh); cursor: pointer; position: relative; overflow: hidden; transition: transform .2s var(--ease), box-shadow .2s; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--sh-h); }
.kpi b { display: block; font-size: 1.75rem; font-weight: 700; line-height: 1; letter-spacing: -.03em; color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi small { color: var(--muted); font-size: .84rem; font-weight: 500; }
.kpi-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; flex-shrink: 0; }
.kpi-ic .licon { width: 22px; height: 22px; }
.k-msg .kpi-ic { background: #fff1f0; color: #d92d20; }
.k-live .kpi-ic { background: #ecfdf5; color: #059669; }
.k-rev .kpi-ic { background: #eef4ff; color: var(--p-blue); }
.k-ok .kpi-ic { background: #ecfeff; color: var(--p-teal); }
.kpi.hot::after { content: ''; position: absolute; top: 12px; right: 12px; width: 9px; height: 9px; border-radius: 50%; background: #f04438; animation: pulse-r 1.8s infinite; }
.k-live.hot::after { background: #10b981; }
@keyframes pulse-r { 0% { box-shadow: 0 0 0 0 rgba(240,68,56,.45); } 70% { box-shadow: 0 0 0 9px rgba(240,68,56,0); } 100% { box-shadow: 0 0 0 0 rgba(240,68,56,0); } }
.kpi.bump b { animation: bump .45s var(--ease); }
@keyframes bump { 40% { transform: scale(1.18); color: var(--p-blue); } }

/* tarjetas */
.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.pcard { background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); padding: 18px; scroll-margin-top: 80px; min-width: 0; }
.pcard.span2 { grid-column: 1 / -1; }
.pcard.flash { animation: flash 1.1s var(--ease); }
@keyframes flash { 0%, 100% { box-shadow: var(--sh); } 30% { box-shadow: 0 0 0 4px rgba(34,211,238,.35), var(--sh-h); } }
.pcard-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.pcard-h h2 { display: flex; align-items: center; gap: 9px; font-size: 1.08rem; font-weight: 700; letter-spacing: -.015em; color: var(--ink); }
.pcard-h .tools { display: flex; gap: 8px; flex-wrap: wrap; }
.h-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: #eef6ff; color: var(--p-blue); }
.h-ic .licon { width: 17px; height: 17px; }
.sub-h { margin: -6px 0 12px; }
body.panel .hint { color: var(--muted); font-size: .82rem; }
body.panel .pill { background: #eef2f7; color: #475467; font-weight: 600; font-size: .72rem; padding: 3px 9px; }
body.panel .pill.warn { background: #fef3f2; color: #b42318; }
body.panel .pill.live { background: #ecfdf5; color: #047857; }
.xfull { display: flex; gap: 6px; align-items: center; margin-bottom: 10px; }

/* búsqueda + filtros */
.search { position: relative; margin-bottom: 10px; }
.search .s-ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); display: flex; }
.search input { width: 100%; height: 46px; padding: 0 44px; border-radius: 13px; border: 1px solid var(--line); background: var(--field); font-size: .95rem; transition: border-color .2s, box-shadow .2s, background .2s; }
.search input:focus { outline: none; background: #fff; border-color: #7dd3fc; box-shadow: 0 0 0 4px rgba(34,211,238,.18); }
.search kbd { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); }
kbd { display: inline-block; min-width: 22px; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line); border-bottom-width: 2px; background: #fff; font: 600 .74rem/1.5 ui-monospace, Menlo, monospace; color: var(--muted); text-align: center; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line); background: #fff; color: var(--text); font-weight: 600; font-size: .82rem; cursor: pointer; transition: all .2s var(--ease); }
.chip b { font-weight: 700; color: var(--muted); font-size: .76rem; background: var(--line-2); border-radius: 99px; padding: 0 7px; }
.chip:hover { border-color: #b9d7f0; }
.chip.on { background: var(--p-800); color: #fff; border-color: var(--p-800); }
.chip.on b { background: rgba(255,255,255,.16); color: #fff; }
.kb-hint { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
@media (hover: none) { .kb-hint, .search kbd { display: none; } }

/* listas */
body.panel .list { display: flex; flex-direction: column; gap: 8px; }
.avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0; background: var(--p-grad); color: #fff; font-weight: 700; font-size: .85rem; letter-spacing: .02em; }
.avatar.sm { width: 32px; height: 32px; border-radius: 10px; font-size: .74rem; }
.avatar.lg { width: 50px; height: 50px; border-radius: 15px; font-size: 1rem; }
.who-chip .avatar.sm { width: 28px; height: 28px; border-radius: 99px; font-size: .68rem; }
body.panel .client-card, body.panel .live-item, body.panel .draft-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: 14px; padding: 11px 13px; cursor: pointer; transition: transform .18s var(--ease), box-shadow .2s, border-color .2s, background .2s; position: relative; animation: rise .32s var(--ease) both; }
body.panel .client-card:hover, body.panel .live-item:hover, body.panel .draft-item:hover { border-color: #b9d7f0; box-shadow: var(--sh); transform: translateY(-1px); }
body.panel .client-card:focus-visible, body.panel .client-card.sel, body.panel .live-item.sel, body.panel .draft-item.sel { border-color: #38bdf8; box-shadow: 0 0 0 3px rgba(34,211,238,.22); outline: none; }
body.panel .client-card::before { content: ''; position: absolute; left: -1px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--sc, #cbd5e1); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.cc-main, .li-main, .di-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cc-main strong, .li-main strong, .di-main strong { font-weight: 650; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-main small, .li-main small, .di-main small { color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.mini { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; color: var(--muted); font-weight: 600; }
.mini .licon { width: 15px; height: 15px; }
.mini.warn { color: #b54708; }
.li-t { font-size: .74rem; white-space: nowrap; }
body.panel .live-item.unread { background: linear-gradient(90deg, #fff5f5, #fff 60%); border-color: #fecdca; }
body.panel .live-item.unread strong { font-weight: 750; }
.di-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: .74rem; }
body.panel .draft-item.on { border-color: #a7f3d0; }
body.panel .draft-bar { display: block; height: 5px; background: var(--line-2); border-radius: 99px; overflow: hidden; margin-top: 5px; }
body.panel .draft-bar i { display: block; height: 100%; background: var(--p-grad); border-radius: 99px; transition: width .5s var(--ease); }
body.panel .draft-view, body.panel .live-box { margin-top: 12px; border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--field); animation: rise .3s var(--ease) both; }
.ro { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .8rem; margin-bottom: 10px; }
.dv-h, .chat-box h4 { display: flex; align-items: center; gap: 7px; margin: 12px 0 8px; font-size: .92rem; color: var(--ink); }

/* estados */
.spill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: .75rem; font-weight: 650; white-space: nowrap; background: var(--sbg, #eef2f7); color: var(--sfg, #475467); }
.spill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.s-new { --sbg: #eef4ff; --sfg: #1d4ed8; --sc: #2563eb; }
.s-rev { --sbg: #ecfeff; --sfg: #0e7490; --sc: #06b6d4; }
.s-wait { --sbg: #fffaeb; --sfg: #b54708; --sc: #f79009; }
.s-ready { --sbg: #ecfdf3; --sfg: #067647; --sc: #12b76a; }
.s-done { --sbg: #f2f4f7; --sfg: #475467; --sc: #98a2b3; }
.s-err { --sbg: #fef3f2; --sfg: #b42318; }
.chip.on.s-new, .chip.on.s-rev, .chip.on.s-wait, .chip.on.s-ready, .chip.on.s-done { background: var(--sfg); border-color: var(--sfg); }

/* estados vacíos y esqueletos */
.empty { text-align: center; padding: 22px 14px; border: 1.5px dashed #d5e3f0; border-radius: 14px; background: linear-gradient(180deg, #fbfdff, #f6faff); color: var(--muted); }
.empty.sm { padding: 14px; font-size: .88rem; }
.empty.big { padding: 34px 18px; }
.empty h3 { color: var(--ink); font-size: 1.1rem; margin: 10px 0 6px; }
.empty p { max-width: 520px; margin: 0 auto 12px; }
.empty .btn { margin: 2px; }
.empty-ic { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: var(--p-grad); color: #fff; box-shadow: 0 10px 24px -10px rgba(8,145,178,.7); }
.empty-ic .licon { width: 26px; height: 26px; }
.empty-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; }
.skel { display: grid; grid-template-columns: 40px 1fr 90px; grid-template-rows: 12px 10px; gap: 8px 12px; align-items: center; padding: 14px; border: 1px solid var(--line-2); border-radius: 14px; background: #fff; }
.skel span { border-radius: 8px; background: linear-gradient(90deg, #eef2f7 25%, #f8fafc 50%, #eef2f7 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
.skel .sk-a { grid-row: 1 / 3; width: 40px; height: 40px; border-radius: 12px; }
.skel .sk-b { width: 55%; height: 12px; } .skel .sk-c { width: 35%; height: 10px; grid-column: 2; }
.skel.sm { grid-template-columns: 32px 1fr; } .skel.sm .sk-a { width: 32px; height: 32px; }
.skel.skh { border: 0; padding: 0; width: 100%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* hoja del expediente */
.sheet { position: fixed; inset: 0; z-index: 900; }
.sheet-scrim { position: absolute; inset: 0; background: rgba(3,9,21,.5); backdrop-filter: blur(3px); opacity: 0; transition: opacity .22s var(--ease); }
.sheet-card { position: absolute; top: 0; right: 0; height: 100%; width: min(1040px, 100vw); background: var(--bg); box-shadow: -24px 0 60px -20px rgba(3,9,21,.5); display: flex; flex-direction: column; transform: translateX(28px); opacity: 0; transition: transform .26s var(--ease), opacity .22s var(--ease); outline: none; }
.sheet.open .sheet-scrim { opacity: 1; }
.sheet.open .sheet-card { transform: none; opacity: 1; }
.sh-head { display: flex; align-items: center; gap: 14px; padding: 16px 20px; background: #fff; border-bottom: 1px solid var(--line); }
.sh-title { flex: 1; min-width: 0; }
.sh-title h3 { font-size: 1.25rem; font-weight: 700; letter-spacing: -.02em; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-title small { color: var(--muted); }
.st-sel { display: flex; flex-direction: column; gap: 2px; font-size: .72rem; font-weight: 600; color: var(--muted); }
.st-sel select { height: 38px; border-radius: 11px; border: 1.5px solid var(--sc, var(--line)); background: var(--sbg, #fff); color: var(--sfg, var(--text)); font-weight: 650; padding: 0 30px 0 12px; cursor: pointer; }
.sh-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 20px; background: #fff; border-bottom: 1px solid var(--line); }
body.panel .detail .tabs { padding: 0 20px; margin: 0; background: #fff; border-bottom: 1px solid var(--line); }
body.panel .detail .tabs button { display: inline-flex; align-items: center; gap: 7px; border-radius: 0; background: none; }
body.panel .detail .tabs button[aria-selected="true"] { color: var(--p-blue); border-bottom-color: var(--p-teal); background: none; }
.sh-body { flex: 1; overflow: auto; padding: 18px 20px 140px; }
.sh-cols { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; align-items: start; }
.sh-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.box { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; box-shadow: var(--sh); }
.box h4 { font-size: .95rem; margin-bottom: 10px; color: var(--ink); }
.chat-box { position: sticky; top: 0; }
.chat-box h4 { margin-top: 0; }
body.panel .kv { gap: 8px 14px; font-size: .92rem; }
body.panel .kv dt { color: var(--muted); font-weight: 500; }
.mono { font-family: ui-monospace, Menlo, monospace; letter-spacing: .02em; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 99px; background: #eef6ff; color: var(--p-blue); font-size: .78rem; font-weight: 600; margin: 1px 0; }
body.panel .docs-grid img { border-radius: 10px; }
body.panel .docs-grid a { border-radius: 12px; transition: transform .2s var(--ease); }
body.panel .docs-grid a:hover { transform: translateY(-2px); }
body.panel .chat-msgs { background: var(--field); border-radius: 12px; max-height: 340px; min-height: 120px; padding: 12px; }
body.panel .msg.client { background: #fff; color: var(--text); border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; border-bottom-right-radius: 12px; }
body.panel .msg.agent { background: var(--p-grad); color: #fff; border: 0; align-self: flex-end; border-bottom-right-radius: 4px; border-bottom-left-radius: 12px; }
body.panel .chat-form { display: flex; gap: 8px; margin-top: 8px; background: none; padding: 0; border: 0; }
body.panel .chat-form input { flex: 1; height: 44px; border-radius: 12px; border: 1px solid var(--line); padding: 0 14px; background: #fff; }
body.panel .chat-form input:focus { outline: none; border-color: #7dd3fc; box-shadow: 0 0 0 4px rgba(34,211,238,.18); }
.send-btn { display: inline-flex !important; align-items: center; gap: 6px; height: 44px; width: auto !important; padding: 0 16px !important; border-radius: 12px !important; background: var(--p-grad) !important; color: #fff !important; font-weight: 600; border: 0; }
.send-btn .icon { width: 16px; height: 16px; }
body.panel .review { border-radius: 16px; border: 1px solid var(--line); background: #fff; box-shadow: var(--sh); padding: 14px 16px; margin: 0; animation: rise .3s var(--ease) both; }
.rv-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rv-head strong { display: inline-flex; gap: 7px; align-items: center; margin-right: auto; }
.rv-c { display: flex; gap: 6px; flex-wrap: wrap; }

/* toasts */
.toasts { position: fixed; right: 18px; top: 78px; z-index: 1200; display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(520px, calc(100vw - 24px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 12px 12px 14px; border-radius: 14px; background: var(--p-900, #061527); color: #e6f0ff; box-shadow: 0 18px 40px -16px rgba(3,9,21,.7); font-size: .9rem; animation: tin .3s cubic-bezier(.2,.7,.2,1) both; border: 1px solid rgba(103,232,249,.18); }
.toast > span { flex: 1; }
.toast .licon { color: #34d399; }
.toast.t-err .licon { color: #f97066; } .toast.t-info .licon { color: #67e8f9; }
.toast.t-err { border-color: rgba(249,112,102,.4); }
.t-act { border: 0; background: linear-gradient(120deg,#1d4ed8,#0891b2 55%,#22d3ee); color: #fff; font-weight: 600; border-radius: 9px; padding: 6px 11px; cursor: pointer; white-space: nowrap; }
.t-x { border: 0; background: none; color: #8fb4d8; font-size: 1.2rem; cursor: pointer; padding: 0 4px; }
.toast.out { animation: tout .25s ease both; }
@keyframes tin { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes tout { to { opacity: 0; transform: translateY(8px); } }
body:not(.panel) .toast { background: #0F094F; }

/* diálogo */
.dlg { border: 0; border-radius: 20px; padding: 0; width: min(460px, calc(100vw - 24px)); box-shadow: 0 30px 80px -20px rgba(3,9,21,.6); }
.dlg::backdrop { background: rgba(3,9,21,.5); backdrop-filter: blur(3px); }
.dlg[open] { animation: tin .25s var(--ease) both; }
.dlg form { padding: 22px; }
.dlg h3 { font-size: 1.12rem; color: var(--ink); margin-bottom: 10px; }
.dlg p { color: var(--text); margin-bottom: 10px; }

.dlg.dlg-wide { width: min(760px, calc(100vw - 24px)); }
.dlg.dlg-wide form { max-height: min(92vh, 920px); overflow: auto; }
.edatos { display: flex; flex-direction: column; gap: 12px; }
.edatos .ed-grid, .edatos .ed-dep { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.edatos .ed-span2 { grid-column: 1 / -1; }
.edatos label { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; color: var(--muted); font-weight: 600; }
.edatos label.ed-chk { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; color: var(--text); }
.edatos .ed-warn { background: #fff7ed; border: 1px solid #fdba74; border-radius: 12px; padding: 10px 12px; color: #9a3412; font-size: .88rem; }
.edatos .ed-warn b { display: block; margin-bottom: 4px; }
.edatos .ed-pend-item { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-top: 8px; }
.edatos .ed-pend-acts { display: flex; gap: 6px; flex-shrink: 0; }

.edatos .ed-dep { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: #fff; }
.edatos .ed-dep-h { display: flex; justify-content: space-between; align-items: center; grid-column: 1 / -1; font-size: .88rem; color: var(--ink); }
.edatos .ed-err { color: #b91c1c; font-size: .88rem; min-height: 1em; }
.edatos .ed-hint { font-size: .78rem; font-weight: 500; color: var(--muted); }
@media (max-width: 560px) { .edatos .ed-grid, .edatos .ed-dep { grid-template-columns: 1fr; } }

.dlg-in { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font: inherit; background: var(--field); resize: vertical; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.kv.keys dd { color: var(--muted); }

/* recorrido */
.tour { position: fixed; inset: 0; z-index: 1150; }
.tour-ring { position: fixed; border-radius: 20px; box-shadow: 0 0 0 9999px rgba(3,9,21,.62), 0 0 0 3px #22d3ee; transition: all .35s var(--ease); pointer-events: none; }
.tour-pop { position: fixed; background: #fff; border-radius: 18px; padding: 18px; box-shadow: 0 30px 70px -20px rgba(3,9,21,.7); animation: tin .3s var(--ease) both; }
.tour-pop h3 { color: var(--ink); font-size: 1.05rem; margin: 4px 0 6px; }
.tour-pop p { color: var(--text); font-size: .92rem; }
.tour-n { color: var(--p-teal); font-weight: 700; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; }
.tour-dots { display: flex; gap: 5px; margin-top: 12px; }
.tour-dots i { width: 7px; height: 7px; border-radius: 99px; background: var(--line); transition: all .3s; }
.tour-dots i.on { width: 20px; background: var(--p-grad); }

/* asistente IA por encima de la hoja */
body.panel .ia-fab { z-index: 1001; }

/* responsive */
@media (max-width: 1020px) { .sh-cols { grid-template-columns: 1fr; } .chat-box { position: static; } }
@media (max-width: 900px) { .pgrid { grid-template-columns: 1fr; } .kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
  .toasts { top: auto; bottom: 16px; right: 50%; transform: translateX(50%); }
  .lg-only { display: none; }
  .pbar-in { padding: 8px 12px; gap: 8px; }
  .pbar-actions { width: 100%; flex-wrap: wrap; gap: 6px; }
  .pbtn { flex: 1 1 auto; justify-content: center; height: 36px; padding: 0 10px; font-size: .84rem; }
  body.panel .client-card { flex-wrap: wrap; }
  body.panel .cc-meta { width: 100%; padding-left: 52px; }
  body.panel .cc-meta .mini { display: inline-flex; }
  .who-chip { display: none; }
  body.panel .app.wide { padding: 12px 10px 120px; }
  .kpi { padding: 12px; gap: 10px; } .kpi b { font-size: 1.4rem; } .kpi-ic { width: 38px; height: 38px; }
  .pcard { padding: 14px; }
  .sheet-card { width: 100vw; }
  .sh-head { padding: 12px; flex-wrap: wrap; } .st-sel { order: 3; width: 100%; } .st-sel select { width: 100%; }
  .sh-actions { padding: 10px 12px; gap: 6px; } .sh-actions .btn { flex: 1 1 calc(50% - 6px); justify-content: center; }
  .sh-body { padding: 12px 10px 150px; }
}
@media (prefers-reduced-motion: reduce) { body.panel *, body.panel *::before, body.panel *::after { animation: none !important; transition: none !important; } }

body.panel .sheet-card:focus, body.panel .sheet-card:focus-visible { outline: none; }
.tour-pop { z-index: 2; }
.chat-head .chat-id { display: block; font-size: 11.5px; font-weight: 600; color: #86efac; margin-top: 1px; }

/* =====================================================================
   PC 3 columnas (≥1200 px, body.pc3): clientes | expediente | chat + IA
   Por debajo de 1200 px todo sigue igual (tarjetas apiladas + hoja lateral).
   ===================================================================== */
.ws-left, .ws-right, .mid-detail[hidden], .pc-only { display: none; }
body.panel .tab-n { font-size: .72rem; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--line-2); color: var(--muted); }
body.panel .tabs button[aria-selected="true"] .tab-n { background: rgba(8,145,178,.12); color: var(--p-teal); }
body.panel .tabs button:disabled { opacity: .45; cursor: not-allowed; }
.badge-unread { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: #e11d48; color: #fff; font-size: .72rem; font-weight: 800; vertical-align: 1px; box-shadow: 0 0 0 3px rgba(225,29,72,.14); animation: pop .35s var(--ease, ease) both; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.kind { display: inline-flex; align-items: center; gap: 2px; font-size: .72rem; font-weight: 700; padding: 1px 8px; border-radius: 99px; white-space: nowrap; }
.kind.k-cli { background: #dcfce7; color: #15803d; }
.kind.k-vis { background: #eef2f7; color: #64748b; }
.kind.k-code { background: #fef9c3; color: #a16207; opacity: .75; }
body.panel .avatar.ok { background: linear-gradient(135deg, #16a34a, #0891b2); }
body.panel .avatar.gray { background: linear-gradient(135deg, #94a3b8, #64748b); }
.cc-label { color: var(--p-teal); font-weight: 600; }
.cc-label.warn { color: #b45309; }
.cc-label .licon, .mini.warn .licon { width: 13px; height: 13px; vertical-align: -2px; margin-right: 2px; }
body.panel .client-card.has-unread { border-left-color: #e11d48; }
.side-links { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.sl-h { display: flex; align-items: center; gap: 6px; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 2px 2px 0; }
.sl-h b { background: #dcfce7; color: #15803d; border-radius: 99px; padding: 0 7px; font-size: .72rem; }
.sl-h .licon { width: 14px; height: 14px; }
body.panel .client-card.link-card { border-left-color: #16a34a; background: linear-gradient(90deg, rgba(22,163,74,.05), #fff 40%); }
.mismatch { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 10px 20px; background: #fffbeb; border-bottom: 1px solid #fde68a; color: #78350f; font-size: .9rem; }
.mismatch .licon { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; color: #d97706; }
.live-row { display: flex; flex-direction: column; gap: 4px; }
.live-row .convert-btn { align-self: flex-end; margin-top: -2px; }
body.panel .btn-xs { padding: 4px 10px; font-size: .78rem; border-radius: 9px; gap: 5px; }
body.panel .btn-xs .licon { width: 14px; height: 14px; }
.li-main small { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.li-last { display: block !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.li-t .wait { color: #e11d48; font-weight: 700; font-size: .72rem; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.pbtn.on { border-color: rgba(134,239,172,.55); background: rgba(22,163,74,.28); }
/* nuevo cliente */
.nc-dlg { width: min(520px, calc(100vw - 24px)); }
.nc-dlg h3 { display: flex; align-items: center; gap: 10px; }
.nc-ic { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--p-grad); color: #fff; }
.nc-ic .licon { width: 18px; height: 18px; }
.nc-lab { display: block; font-weight: 700; font-size: .85rem; margin: 12px 0 6px; color: var(--ink); }
.nc-ok { display: flex; align-items: center; gap: 8px; color: #15803d; font-weight: 600; margin-bottom: 10px; }
.nc-link { display: flex; gap: 8px; margin-bottom: 10px; }
.nc-link input { flex: 1; font-size: .8rem; }
.nc-dlg .btn-block { display: flex; justify-content: center; gap: 8px; margin-bottom: 8px; }
/* documentos grandes + visor */
body.panel .docs-grid button { display: block; padding: 0; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--field); color: var(--muted); font: inherit; font-size: .75rem; cursor: zoom-in; text-align: left; transition: transform .18s var(--ease), box-shadow .18s; }
body.panel .docs-grid button:hover { transform: translateY(-2px); box-shadow: var(--sh-h); }
body.panel .docs-grid img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
body.panel .docs-grid button span { display: block; padding: 4px 6px; }
.box h4 .link-btn { margin-left: auto; font-size: .8rem; }
.docs-big { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.doc-tile { display: flex; flex-direction: column; padding: 0; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #fff; box-shadow: var(--sh); cursor: zoom-in; font: inherit; text-align: left; transition: transform .2s var(--ease), box-shadow .2s; }
.doc-tile:hover, .doc-tile:focus-visible { transform: translateY(-3px); box-shadow: var(--sh-h); }
.doc-tile img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--field); }
.doc-tile span { display: flex; align-items: center; gap: 6px; padding: 10px 12px; font-weight: 600; color: var(--ink); font-size: .88rem; }
.doc-tile .licon { width: 16px; height: 16px; color: var(--p-teal); }
.sig-box { margin-top: 16px; max-width: 420px; }
.lightbox { position: fixed; inset: 0; z-index: 1150; background: rgba(3,9,21,.92); display: grid; grid-template-columns: 70px 1fr 70px; grid-template-rows: auto 1fr; animation: fade .2s ease both; }
.lightbox[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.lb-bar { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 12px 18px; color: #e6f0ff; font-weight: 600; }
.lb-bar .lb-n { color: #8fb4d8; font-weight: 500; font-size: .85rem; }
.lb-bar .tools { margin-left: auto; display: flex; gap: 8px; }
.lb-fig { margin: 0; display: grid; place-items: center; overflow: auto; padding: 8px; }
/* posición fija en la cuadrícula: con 1 solo documento las flechas se ocultan y la imagen no debe caer en la columna de 70px */
.lb-fig { grid-column: 2; grid-row: 2; min-width: 0; min-height: 0; }
.lb-nav.prev { grid-column: 1; grid-row: 2; } .lb-nav.next { grid-column: 3; grid-row: 2; }
.lb-fig img { max-width: 100%; max-height: calc(100dvh - 90px); border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.5); background: #fff; }
.lb-nav { align-self: center; justify-self: center; width: 52px; height: 52px; border-radius: 50%; border: 1px solid rgba(143,180,216,.3); background: rgba(18,52,94,.6); color: #fff; font-size: 30px; line-height: 1; cursor: pointer; }
.lb-nav:hover { background: rgba(29,78,216,.7); }
/* conversación archivada */
.conv-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 12px; }
.conv-head h4 { display: flex; align-items: center; gap: 6px; font-size: 1rem; color: var(--ink); }
.conv-head .tools { display: flex; gap: 8px; flex-wrap: wrap; }
.conv-list { list-style: none; margin: 0; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 16px; display: flex; flex-direction: column; gap: 10px; max-height: 62vh; overflow: auto; box-shadow: var(--sh); }
.conv-day { align-self: center; font-size: .74rem; color: var(--muted); text-transform: capitalize; }
.conv-day span { background: var(--line-2); padding: 3px 12px; border-radius: 99px; }
.conv-m { max-width: 78%; padding: 9px 13px 7px; border-radius: 14px; background: var(--field); border: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; }
.conv-m.agent { align-self: flex-end; background: linear-gradient(135deg, #e0ecff, #e0f7fb); border-color: #c7dcfb; }
.conv-m .conv-who { font-size: .74rem; font-weight: 700; color: var(--p-800); }
.conv-m time { font-size: .72rem; color: var(--muted); }
.conv-m p { grid-column: 1 / -1; margin: 0; white-space: pre-wrap; word-break: break-word; color: var(--ink); }
.conv-read { grid-column: 1 / -1; font-size: .7rem; color: var(--muted); }
#tab-conv .chat-form { margin-top: 10px; }
.steps-list { margin: 6px 0 10px 18px; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.steps-list li { text-align: left; padding: 0; }
.steps-list li.done { color: #15803d; padding: 0; text-align: left; }
.steps-list li.now { font-weight: 700; color: var(--p-blue); padding: 0; text-align: left; }
.sl-h-btn { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font: inherit; color: inherit; }
.sl-h-btn:hover, .sl-h-btn:focus-visible { text-decoration: underline; }
object.lb-pdf, embed.lb-pdf { width: min(920px, 96vw); height: min(80vh, 900px); border: 0; background: #fff; border-radius: 8px; }
.lk-st { font-size: .9rem; color: var(--ink); }

@media (min-width: 1200px) {
  body.panel.pc3 { --hdr: 61px; overflow: hidden; height: 100dvh; }
  body.panel.pc3 .pbar-in { max-width: none; padding: 10px 20px; }
  body.panel.pc3 .app.wide { max-width: none; margin: 0; padding: 0; }
  body.panel.pc3 .site-foot { display: none; }
  body.panel.pc3 .narrow-only { display: none !important; }
  body.panel.pc3 .pc-only { display: inline-flex; }
  body.panel.pc3 .ws { display: grid; grid-template-columns: 340px minmax(0, 1fr) 390px; height: calc(100dvh - var(--hdr)); }
  body.panel.pc3 .ws-left, body.panel.pc3 .ws-right { display: flex; flex-direction: column; min-height: 0; background: #fff; }
  body.panel.pc3 .ws-left { border-right: 1px solid var(--line); overflow: auto; }
  body.panel.pc3 .ws-mid { overflow: auto; min-width: 0; padding: 20px 24px 60px; }
  body.panel.pc3 .ws-right { border-left: 1px solid var(--line); }
  /* columna izquierda */
  body.panel.pc3 #clients-card { border: 0; border-radius: 0; box-shadow: none; padding: 14px 14px 30px; }
  body.panel.pc3 #clients-card .pcard-h { flex-wrap: wrap; gap: 8px; }
  body.panel.pc3 #clients-card .pcard-h h2 { font-size: 1.02rem; }
  body.panel.pc3 #clients-card .search { position: sticky; top: -14px; z-index: 2; background: #fff; padding: 6px 0; }
  body.panel.pc3 #clients-card .chips { flex-wrap: wrap; gap: 5px; }
  body.panel.pc3 #clients-card .chip { padding: 4px 9px; font-size: .76rem; }
  body.panel.pc3 #clients-card .client-card { padding: 10px 11px; gap: 10px; flex-wrap: wrap; }
  body.panel.pc3 #clients-card .cc-main { flex: 1 1 170px; min-width: 0; }
  body.panel.pc3 #clients-card .cc-main small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.panel.pc3 #clients-card .cc-meta { flex: 1 1 100%; justify-content: flex-start; padding-left: 50px; margin-top: -4px; }
  body.panel.pc3 #clients-card .kb-hint { font-size: .74rem; }
  /* centro: inicio (sin expediente) */
  body.panel.pc3 #home .pgrid { grid-template-columns: 1fr; }
  body.panel.pc3 #home .kpis { margin-bottom: 18px; }
  /* centro: expediente abierto en la propia página */
  body.panel.pc3 .mid-detail { display: block; animation: rise .28s var(--ease) both; }
  body.panel.pc3 .mid-detail .detail { position: static; display: block; height: auto; width: auto; transform: none; opacity: 1; background: transparent; box-shadow: none; outline: 0; }
  body.panel.pc3 .mid-detail .sh-head, body.panel.pc3 .mid-detail .sh-actions, body.panel.pc3 .mid-detail .tabs, body.panel.pc3 .mid-detail .mismatch { border: 1px solid var(--line); border-bottom: 0; }
  body.panel.pc3 .mid-detail .sh-head { border-radius: var(--r) var(--r) 0 0; }
  body.panel.pc3 .mid-detail .tabs { border-bottom: 1px solid var(--line); border-radius: 0 0 var(--r) var(--r); position: sticky; top: -20px; z-index: 3; box-shadow: 0 8px 18px -14px rgba(11,37,69,.35); }
  body.panel.pc3 .mid-detail .sh-body { overflow: visible; padding: 18px 0 0; }
  body.panel.pc3 .mid-detail .sh-cols { grid-template-columns: 1fr; }
  body.panel.pc3 .mid-detail .chat-col { display: none; }
  body.panel.pc3 .mid-detail .docs-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  body.panel.pc3 .back-btn { flex-shrink: 0; }
  body.panel.pc3 #sheet { display: none !important; }
  /* derecha: chat del cliente + asistente IA */
  .rp-tabs { display: flex; gap: 4px; padding: 10px 10px 0; border-bottom: 1px solid var(--line); background: #fff; }
  .rp-tabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 8px; border: 0; background: none; font: inherit; font-weight: 700; font-size: .88rem; color: var(--muted); border-bottom: 3px solid transparent; cursor: pointer; border-radius: 10px 10px 0 0; }
  .rp-tabs button[aria-selected="true"] { color: var(--p-blue); border-bottom-color: var(--p-teal); background: var(--field); }
  .rp-tabs .licon { width: 17px; height: 17px; }
  .rp-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .rp-pane[hidden] { display: none; }
  body.panel.pc3 #live-card { border: 0; border-radius: 0; box-shadow: none; padding: 12px; flex: 1; min-height: 0; display: flex; flex-direction: column; }
  body.panel.pc3 #live-card > .pcard-h { flex-shrink: 0; }
  body.panel.pc3 #live-list { overflow: auto; flex: 1; min-height: 0; }
  body.panel.pc3 #live-list[hidden] { display: none; }
  body.panel.pc3 #live { flex: 1; min-height: 0; display: flex; flex-direction: column; margin-top: 0; padding: 0; border: 0; background: transparent; animation: none; }
  body.panel.pc3 #live[hidden] { display: none; }
  body.panel.pc3 #live .panel-head { gap: 8px; padding: 2px 0 8px; }
  body.panel.pc3 #live .panel-head h3 { flex: 1; min-width: 0; font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.panel.pc3 #live .tools { flex-shrink: 0; }
  body.panel.pc3 #live-x { display: none; }
  body.panel.pc3 #live-msgs { flex: 1; min-height: 0; max-height: none; height: auto; }
  body.panel.pc3 .ia-drawer.docked { position: static; transform: none; visibility: visible; width: auto; height: auto; flex: 1; min-height: 0; box-shadow: none; z-index: auto; }
  body.panel.pc3 .ia-drawer.docked .ia-close { display: none; }
  body.panel.pc3.ia-docked .ia-fab, body.panel.pc3.ia-docked .ia-scrim { display: none !important; }
  body.panel.pc3 .toasts { top: 74px; right: 410px; }
}
@media (min-width: 1600px) {
  body.panel.pc3 .ws { grid-template-columns: 380px minmax(0, 1fr) 450px; }
  body.panel.pc3 .ws-mid { padding: 24px 36px 60px; }
  body.panel.pc3 .toasts { right: 470px; }
}
/* ajustes tras la prueba visual */
.dlg { margin: auto; }
.rp-tabs button { white-space: nowrap; }
@media (min-width: 1200px) {
  .rp-tabs button { font-size: .84rem; padding: 10px 6px; }
  body.panel.pc3 .toasts { top: auto; bottom: 18px; right: 410px; align-items: flex-end; }
  body.panel.pc3 .mid-detail .sh-title small { display: block; line-height: 1.45; }
  body.panel.pc3 .kpi small { line-height: 1.25; }
}
@media (min-width: 1600px) { body.panel.pc3 .toasts { right: 474px; } }
@media (min-width: 1200px) {
  body.panel.pc3 .mid-detail .tabs { overflow-x: auto; scrollbar-width: none; }
  body.panel.pc3 .mid-detail .tabs button { padding: 10px 12px; flex-shrink: 0; }
  body.panel.pc3 .mid-detail .docs-big { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

/* =====================================================================
   PC 2 columnas (pc4): clientes | expediente a todo lo ancho.
   Chat y Asistente IA en botones flotantes → cajón lateral encima del expediente.
   ===================================================================== */
.pc-fabs { display: none; }
@media (min-width: 1200px) {
  body.panel.pc3 { --ease-p: cubic-bezier(.22, 1, .36, 1); }
  body.panel.pc3 .ws, body.panel.pc3 .ws { grid-template-columns: 300px minmax(0, 1fr); }
  body.panel.pc3 .ws-left, body.panel.pc3 .ws-mid, body.panel.pc3 #live-list, body.panel.pc3 #live-msgs { scroll-behavior: smooth; overscroll-behavior: contain; }
  body.panel.pc3 .ws-mid { padding: 22px 32px 110px; scroll-padding-top: 70px; }
  body.panel.pc3 .ws-mid > #home, body.panel.pc3 .ws-mid > .mid-detail { max-width: 1240px; margin: 0 auto; }
  /* columna izquierda compacta */
  body.panel.pc3 #clients-card { padding: 12px 12px 30px; }
  body.panel.pc3 #clients-card .pcard-h .tools { display: flex; gap: 6px; flex-wrap: wrap; }
  body.panel.pc3 #clients-card .pcard-h .tools .btn { padding: 5px 10px; font-size: .78rem; }
  body.panel.pc3 #clients-card .client-card { padding: 9px 10px; }
  body.panel.pc3 #clients-card .cc-meta { padding-left: 46px; }
  /* expediente cómodo: pestañas grandes, secciones plegables */
  body.panel.pc3 .mid-detail .tabs { gap: 4px; padding: 6px 8px; background: #fff; }
  body.panel.pc3 .mid-detail .tabs button { padding: 12px 18px; font-size: 1rem; border-radius: 12px; transition: background .2s var(--ease-p), color .2s; }
  body.panel.pc3 .mid-detail .tabs button:hover:not(:disabled) { background: var(--field); }
  body.panel.pc3 .mid-detail .tabs button .licon { width: 18px; height: 18px; }
  body.panel.pc3 .mid-detail .sh-head { flex-wrap: wrap; row-gap: 10px; }
  body.panel.pc3 .mid-detail .sh-title { min-width: 220px; flex: 1 1 260px; }
  body.panel.pc3 .mid-detail .sh-actions { flex-wrap: wrap; }
  body.panel.pc3 .mid-detail .sh-body { padding-top: 20px; }
  body.panel.pc3 .mid-detail .kv { grid-template-columns: minmax(130px, 190px) minmax(0, 1fr); }
  body.panel.pc3 .mid-detail .kv dd { overflow-wrap: anywhere; min-width: 0; }
  body.panel.pc3 .mid-detail .box { margin-bottom: 16px; }
  body.panel.pc3 .mid-detail #tab-acc, body.panel.pc3 .mid-detail #tab-conv, body.panel.pc3 .mid-detail #tab-docs { min-width: 0; }
  body.panel.pc3 .mid-detail .conv-list { max-height: none; }
  /* cajón lateral (encima del expediente, no lo achica) */
  body.panel.pc3 .ws-right { position: fixed; z-index: 960; top: calc(var(--hdr) + 12px); right: 14px; bottom: 14px; width: min(440px, calc(100vw - 340px));
    border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: #fff;
    box-shadow: 0 30px 70px -18px rgba(11,37,69,.42), 0 8px 22px -10px rgba(11,37,69,.22);
    transform: translate3d(calc(100% + 28px), 0, 0); opacity: 0; visibility: hidden; pointer-events: none;
    transition: transform .26s var(--ease-p), opacity .2s ease, visibility 0s linear .26s; will-change: transform, opacity; }
  body.panel.pc3 .ws-right.open { transform: none; opacity: 1; visibility: visible; pointer-events: auto; transition: transform .26s var(--ease-p), opacity .18s ease, visibility 0s; }
  body.panel.pc3 .rp-tabs { align-items: center; padding: 10px 10px 0 12px; }
  body.panel.pc3 .rp-close { flex: 0 0 auto !important; width: 36px; height: 36px; margin: 0 0 4px 4px; display: grid !important; place-items: center; border: 1px solid var(--line) !important; border-radius: 11px !important; background: #fff !important; color: var(--muted); cursor: pointer; transition: transform .15s var(--ease-p), background .15s, color .15s; }
  body.panel.pc3 .rp-close:hover { background: var(--field) !important; color: var(--ink); }
  body.panel.pc3 .rp-close:active { transform: scale(.92); }
  body.panel.pc3 .rp-close .licon { width: 18px; height: 18px; }
  /* botones flotantes */
  body.panel.pc3 .pc-fabs { display: flex; flex-direction: column; gap: 14px; position: fixed; right: 24px; bottom: 24px; z-index: 950;
    transition: transform .26s var(--ease-p), opacity .2s ease; }
  body.panel.pc3.rp-open .pc-fabs { transform: translate3d(0, 12px, 0) scale(.9); opacity: 0; pointer-events: none; }
  body.panel.pc3.touring .pc-fabs { opacity: 1; transform: none; }
  .pfab { position: relative; width: 60px; height: 60px; border-radius: 20px; border: 0; cursor: pointer; display: grid; place-items: center; color: #fff;
    background: linear-gradient(145deg, #0b2545, #12355f 55%, #0e7490); box-shadow: 0 14px 30px -10px rgba(11,37,69,.55), inset 0 1px 0 rgba(255,255,255,.18);
    transition: transform .2s var(--ease-p), box-shadow .2s ease; -webkit-tap-highlight-color: transparent; }
  .pfab-ia { background: linear-gradient(145deg, #4c1d95, #6d28d9 55%, #0891b2); }
  .pfab:hover { transform: translate3d(0, -3px, 0) scale(1.04); box-shadow: 0 20px 36px -12px rgba(11,37,69,.6), inset 0 1px 0 rgba(255,255,255,.2); }
  .pfab:active { transform: scale(.94); transition-duration: .08s; }
  .pfab:focus-visible { outline: 3px solid #38bdf8; outline-offset: 4px; }
  .pfab-ic .licon { width: 26px; height: 26px; }
  .pfab-tip { position: absolute; right: calc(100% + 12px); top: 50%; white-space: nowrap; padding: 6px 11px; border-radius: 10px; background: #0b2545; color: #fff; font-size: .8rem; font-weight: 600;
    opacity: 0; transform: translate3d(6px, -50%, 0); pointer-events: none; transition: opacity .16s ease, transform .2s var(--ease-p); }
  .pfab:hover .pfab-tip, .pfab:focus-visible .pfab-tip { opacity: 1; transform: translate3d(0, -50%, 0); }
  .pfab-n { position: absolute; top: -6px; right: -6px; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 99px; background: #e11d48; color: #fff;
    font-size: .76rem; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 3px #fff, 0 6px 14px -4px rgba(225,29,72,.6); }
  .pfab-n[hidden], .pfab-dot[hidden] { display: none; }
  .pfab-n.bump { animation: pfab-pop .5s var(--ease-p) both; }
  .pfab.ring::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 0 0 rgba(225,29,72,.55); animation: pfab-ring 1.4s ease-out 2; pointer-events: none; }
  .pfab-dot { position: absolute; top: 4px; right: 4px; width: 13px; height: 13px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 3px #fff; animation: pfab-pulse 1.8s ease-in-out infinite; }
  .pfab-dot[data-status="incorrect"] { background: #e11d48; }
  @keyframes pfab-pop { 0% { transform: scale(.3); opacity: 0; } 55% { transform: scale(1.22); opacity: 1; } 100% { transform: scale(1); } }
  @keyframes pfab-ring { 0% { box-shadow: 0 0 0 0 rgba(225,29,72,.5); } 100% { box-shadow: 0 0 0 16px rgba(225,29,72,0); } }
  @keyframes pfab-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.25); opacity: .75; } }
  body.panel.pc3 .toasts { right: 104px !important; }
  body.panel.pc3.rp-open .toasts { right: 474px !important; }
}
/* plegables (todas las pantallas) */
@media all {
  body.panel .box > h4[data-fold] { display: flex; align-items: center; gap: 6px; }
  body.panel .box > h4[data-fold] { cursor: pointer; user-select: none; border-radius: 8px; }
  body.panel .box > h4[data-fold]::after { content: ""; width: 9px; height: 9px; margin-left: auto; flex-shrink: 0; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .22s var(--ease, ease); }
  body.panel .box > h4[data-fold] .link-btn { margin-left: auto; }
  body.panel .box > h4[data-fold] .link-btn + * , body.panel .box > h4[data-fold]:has(.link-btn)::after { margin-left: 10px; }
  body.panel .box.folded > h4[data-fold]::after { transform: rotate(-45deg); }
  body.panel .box.folded > :not(h4) { display: none; }
  body.panel .box > h4[data-fold]:focus-visible { outline: 3px solid #38bdf8; outline-offset: 3px; }
}
@media (min-width: 1600px) {
  body.panel.pc3 .ws { grid-template-columns: 320px minmax(0, 1fr); }
  body.panel.pc3 .ws-right { width: 460px; }
  body.panel.pc3 .mid-detail .sh-cols { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  body.panel.pc3 .ws-right, body.panel.pc3 .pc-fabs, .pfab, .pfab-tip { transition: none !important; }
  .pfab-n.bump, .pfab.ring::after, .pfab-dot { animation: none !important; }
  body.panel.pc3 .ws-left, body.panel.pc3 .ws-mid, body.panel.pc3 #live-list, body.panel.pc3 #live-msgs { scroll-behavior: auto; }
}

/* ================= NEX · copiloto fiscal (diseño del prototipo design/nex_copiloto_fiscal_demo.html) ================= */
:root { --nx-bg: #0b0f24; --nx-panel: #10152b; --nx-line: rgba(190,201,255,.14); --nx-text: #f4f6ff; --nx-muted: #a3aed0; --nx-violet: #9365ff; --nx-cyan: #4be3f2; --nx-gold: #ffc878; }
/* --- el personaje: esfera con ojos y chispa --- */
.nex-orb { --s: 132px; position: relative; display: inline-block; flex: 0 0 var(--s); width: var(--s); height: var(--s); border-radius: 50%;
  background: radial-gradient(circle at 32% 23%, #ffffffb8 0 2%, #c8c0ff 4%, transparent 20%), radial-gradient(circle at 34% 29%, #bb9aff 0, #8759ff 27%, #5036c3 53%, #1c5c9b 76%, #43ddec 100%);
  box-shadow: inset calc(var(--s) * -.1) calc(var(--s) * -.12) calc(var(--s) * .2) #060d2d8c, inset calc(var(--s) * .04) calc(var(--s) * .045) calc(var(--s) * .13) #ffffff55, 0 0 calc(var(--s) * .27) #8d62ff70, 0 0 calc(var(--s) * .6) #4bdff22b;
  animation: nex-float 4.5s ease-in-out infinite; transition: box-shadow .4s ease; }
.nex-orb::before { content: ""; position: absolute; inset: 7%; border: 1px solid #ffffff61; border-radius: 50%; background: linear-gradient(135deg, #ffffff26, transparent 45%); box-shadow: inset 0 0 calc(var(--s) * .15) #ffffff16; }
.nex-orb > i { font-style: normal; }
.nex-eyes { position: absolute; inset: 0; z-index: 2; transform: translate3d(var(--ex, 0px), var(--ey, 0px), 0); transition: transform .28s cubic-bezier(.22, 1, .36, 1); }
.nex-eye { position: absolute; top: 41%; width: 9%; height: 11.4%; border-radius: 50%; background: #eafcff; box-shadow: 0 0 calc(var(--s) * .075) #7ef5ff, 0 0 calc(var(--s) * .17) #5ce5ff; transform-origin: 50% 50%; }
.nex-eye:first-child { left: 32.5%; } .nex-eye:last-child { right: 32.5%; }
.nex-orb.blink .nex-eye { animation: nex-blink .24s ease-in-out; }
.nex-spark { position: absolute; z-index: 3; width: 10%; height: 10%; right: 25%; top: 22%; filter: drop-shadow(0 0 calc(var(--s) * .06) #ffcf7e); animation: nex-sparkle 2.8s ease-in-out infinite; }
.nex-spark::before { content: ""; position: absolute; inset: 0; background: var(--nx-gold); clip-path: polygon(50% 0, 62% 37%, 100% 50%, 62% 63%, 50% 100%, 38% 63%, 0 50%, 38% 37%); }
.nex-orb-xs { --s: 36px; } .nex-orb-mini { --s: 28px; animation: none; } .nex-orb-s { --s: 46px; } .nex-orb-m { --s: 62px; } .nex-orb-l { --s: 92px; }
.nex-orb-mini .nex-spark, .nex-orb-xs .nex-spark { width: 16%; height: 16%; right: 18%; top: 14%; }
.nex-orb-mini .nex-eye, .nex-orb-xs .nex-eye { width: 12%; height: 15%; }
/* alerta: la revisión por reglas marcó error/faltante → la chispa dorada brilla fuerte y la esfera toma un halo dorado */
[data-status="incorrect"] .nex-spark, [data-status="missing"] .nex-spark { animation: nex-alert 1.15s ease-in-out infinite; filter: drop-shadow(0 0 calc(var(--s) * .08) #ffd18a) drop-shadow(0 0 calc(var(--s) * .16) #ffb84d); }
[data-status="incorrect"] .nex-orb, [data-status="missing"] .nex-orb { box-shadow: inset calc(var(--s) * -.1) calc(var(--s) * -.12) calc(var(--s) * .2) #060d2d8c, inset calc(var(--s) * .04) calc(var(--s) * .045) calc(var(--s) * .13) #ffffff55, 0 0 0 calc(var(--s) * .04) #ffc87833, 0 0 calc(var(--s) * .4) #ffc87866, 0 0 calc(var(--s) * .6) #8d62ff55; }
@keyframes nex-float { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(0, calc(var(--s) * -.06), 0); } }
@keyframes nex-sparkle { 0%, 100% { opacity: .65; transform: scale(.85) rotate(0); } 50% { opacity: 1; transform: scale(1.2) rotate(25deg); } }
@keyframes nex-alert { 0%, 100% { opacity: .85; transform: scale(1.1) rotate(0); } 50% { opacity: 1; transform: scale(1.75) rotate(45deg); } }
@keyframes nex-blink { 0%, 100% { transform: scaleY(1); } 45%, 55% { transform: scaleY(.08); } }
@keyframes nex-appear { from { opacity: 0; transform: translate3d(0, 6px, 0); } to { opacity: 1; transform: none; } }
@keyframes nex-dots { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
/* --- botón flotante en PC (#fab-ia): la esfera dentro de un botón de vidrio oscuro --- */
.pfab.nex-fabbtn { width: 66px; height: 66px; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #221c52, #0b0f24 70%); box-shadow: 0 16px 34px -12px rgba(76,29,149,.75), 0 0 0 1px #a38bff3d, inset 0 1px 0 #ffffff1f; }
.pfab.nex-fabbtn:hover { box-shadow: 0 20px 40px -12px rgba(76,29,149,.85), 0 0 0 1px #a38bff70, 0 0 28px #8d62ff55, inset 0 1px 0 #ffffff26; }
.pfab.nex-fabbtn .pfab-dot { display: none !important; }
.pfab.nex-fabbtn[data-status="incorrect"], .pfab.nex-fabbtn[data-status="missing"] { box-shadow: 0 16px 34px -12px rgba(76,29,149,.75), 0 0 0 2px #ffc87899, 0 0 24px #ffc87855; }
.pfab.nex-fabbtn[data-status="incorrect"]::before, .pfab.nex-fabbtn[data-status="missing"]::before { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid #ffc878; opacity: 0; animation: nex-ring 2.2s ease-out infinite; pointer-events: none; }
@keyframes nex-ring { 0% { opacity: .7; transform: scale(.95); } 100% { opacity: 0; transform: scale(1.35); } }
/* --- botón flotante en celular/tablet (#ia-fab) --- */
.ia-fab.nex-fab { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 50% 35%, #221c52, #0b0f24 70%); box-shadow: 0 16px 34px -12px rgba(76,29,149,.75), 0 0 0 1px #a38bff3d; filter: none; }
.ia-fab.nex-fab::before, .ia-fab.nex-fab::after { content: none; }
.ia-fab.nex-fab[data-status="incorrect"], .ia-fab.nex-fab[data-status="missing"] { box-shadow: 0 16px 34px -12px rgba(76,29,149,.75), 0 0 0 2px #ffc87899, 0 0 24px #ffc87855; }
.ia-fab.nex-fab .ia-tip { right: 88px; bottom: 26px; background: #151b35; border: 1px solid var(--nx-line); }
.ia-fab.nex-fab .ia-tip::after { background: #151b35; }
/* --- cajón NEX (tema oscuro del prototipo) --- */
.ia-drawer.nex { background: radial-gradient(ellipse at 85% 0, #1a1740 0, transparent 46%), radial-gradient(ellipse at 0 100%, #101b39 0, transparent 40%), var(--nx-bg); color: var(--nx-text); width: min(560px, 100vw); }
.nex-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 12px; border-bottom: 1px solid var(--nx-line); }
.nex-head .nex-orb { animation: none; }
.nex-title { flex: 1; min-width: 0; } .nex-title strong { display: block; font-size: 1rem; letter-spacing: .14em; }
.nex-title small { display: flex; align-items: center; gap: 6px; color: var(--nx-muted); font-size: .72rem; margin-top: 2px; }
.nex-live { width: 7px; height: 7px; border-radius: 50%; background: #70e8b0; box-shadow: 0 0 10px #70e8b088; }
.nex-mode { display: inline-flex; padding: 3px; border: 1px solid var(--nx-line); border-radius: 999px; background: #ffffff08; }
.nex-mode button { border: 0; background: none; color: var(--nx-muted); font: inherit; font-size: .75rem; font-weight: 700; padding: 5px 12px; border-radius: 999px; cursor: pointer; transition: background .2s, color .2s; }
.nex-mode button.on { background: linear-gradient(135deg, #9a72ff, #4ddde9); color: #0a1021; }
.nex-mode button:focus-visible, .nex-q:focus-visible, .nex-send:focus-visible, .nex-x:focus-visible, .nex-foot button:focus-visible, .nex-retry:focus-visible { outline: 2px solid var(--nx-cyan); outline-offset: 2px; }
.ia-drawer.nex .nex-x { width: 34px; height: 34px; border: 1px solid var(--nx-line); background: #ffffff08; color: var(--nx-muted); border-radius: 10px; font-size: 20px; cursor: pointer; }
.nex-ctx { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 16px; font-size: .74rem; color: var(--nx-muted); border-bottom: 1px solid var(--nx-line); background: #ffffff05; }
.nex-ctx b { color: var(--nx-text); font-weight: 650; }
.nex-ctx > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nex-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--nx-line); white-space: nowrap; }
.nex-chip i { width: 7px; height: 7px; border-radius: 50%; background: #4be3f2; }
.nex-chip[data-status="incorrect"] i { background: #ff6b6b; box-shadow: 0 0 8px #ff6b6b; } .nex-chip[data-status="missing"] i { background: var(--nx-gold); box-shadow: 0 0 8px var(--nx-gold); }
.nex-chip[data-status="valid"] i, .nex-chip[data-status="verified"] i { background: #70e8b0; }
.nex-chip[data-status="incorrect"], .nex-chip[data-status="missing"] { color: #ffe2b0; border-color: #ffc87855; }
.nex-msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 18px 10px; display: flex; flex-direction: column; gap: 14px; scrollbar-color: #3a3f6b transparent; }
.nex-hello { display: flex; align-items: center; gap: 16px; padding: 4px 2px 2px; }
.nex-eyebrow { font-size: .66rem; color: #b7a4ff; letter-spacing: .19em; font-weight: 750; text-transform: uppercase; }
.nex-hello h3 { margin: 4px 0 4px; font-size: 1.45rem; letter-spacing: -.02em; background: linear-gradient(95deg, #fff 5%, #b6a2ff 53%, #5be7f1); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nex-hello p { margin: 0; color: var(--nx-muted); font-size: .83rem; line-height: 1.5; }
.nex-rules { border: 1px solid var(--nx-line); border-radius: 14px; padding: 12px 14px; background: #ffffff06; font-size: .8rem; color: #d6dcf5; }
.nex-rules[data-status="incorrect"], .nex-rules[data-status="missing"] { border-color: #ffc87855; background: linear-gradient(135deg, #ffc8780d, #ffffff04); }
.nex-rules-h { font-weight: 700; font-size: .78rem; letter-spacing: .02em; } .nex-rules-h small { color: var(--nx-muted); font-weight: 500; margin-left: 6px; }
.nex-rules-n { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 6px; } .nex-rules-n span { padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700; background: #ffffff0d; }
.nex-rules-n .e { color: #ffb4b4; } .nex-rules-n .f { color: #ffd99a; } .nex-rules-n .a { color: #a9e8ff; }
.nex-rules ul { margin: 4px 0 0; padding: 0; list-style: none; display: grid; gap: 5px; } .nex-rules li { line-height: 1.45; padding-left: 2px; }
.nex-rules li b { font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; margin-right: 4px; padding: 1px 6px; border-radius: 6px; background: #ffffff10; }
.nex-rules li.lv-error b { color: #ffb4b4; } .nex-rules li.lv-falta b { color: #ffd99a; } .nex-rules li.lv-aviso b { color: #a9e8ff; }
.nex-rules p { margin: 6px 0 0; color: var(--nx-muted); }
.nex-quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.nex-q { display: flex; gap: 11px; align-items: flex-start; text-align: left; padding: 12px 13px; border-radius: 14px; border: 1px solid var(--nx-line); background: linear-gradient(135deg, #ffffff08, #ffffff02); color: var(--nx-text); font: inherit; cursor: pointer; transition: transform .2s cubic-bezier(.22, 1, .36, 1), border-color .2s, background .2s; }
.nex-q:hover { border-color: #9c85ff6e; background: #9b7aff12; transform: translateY(-2px); }
.nex-q:active { transform: scale(.98); }
.nex-qi { flex: 0 0 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: #9e82ff1f; color: #c3b3ff; font-size: 15px; }
.nex-q strong { display: block; font-size: .8rem; margin-bottom: 2px; } .nex-q small { display: block; color: #98a3c4; font-size: .7rem; line-height: 1.4; }
.nex-msg { display: flex; gap: 10px; align-items: flex-start; max-width: 92%; animation: nex-appear .28s ease both; }
.nex-msg.user { align-self: flex-end; }
.nex-msg.system { align-self: center; max-width: 100%; }
.nex-b { padding: 11px 14px; border: 1px solid var(--nx-line); background: #ffffff08; border-radius: 4px 14px 14px 14px; color: #e6eaff; font-size: .86rem; line-height: 1.58; white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }
.nex-msg.user .nex-b { background: #8f73ff26; border-color: #a58cff40; border-radius: 14px 4px 14px 14px; }
.nex-msg.system .nex-b { border-color: #ffc87855; background: #ffc8780f; color: #ffe2b0; font-size: .78rem; border-radius: 12px; }
.nex-meta { font-size: .64rem; color: #8f9abb; letter-spacing: .08em; margin-bottom: 4px; white-space: normal; }
.nex-t strong { color: #fff; }
.nex-msg.streaming .nex-t::after { content: "▍"; color: var(--nx-cyan); animation: ia-blink 1s steps(2) infinite; }
.nex-typing { display: inline-flex; gap: 4px; padding: 5px 2px; } .nex-typing i { width: 6px; height: 6px; border-radius: 50%; background: #9f8aff; animation: nex-dots 1s infinite; }
.nex-typing i:nth-child(2) { animation-delay: .15s; } .nex-typing i:nth-child(3) { animation-delay: .3s; }
.ia-drawer.thinking .nex-head .nex-orb .nex-spark { animation: nex-alert .9s ease-in-out infinite; }
.nex-retry { margin-left: 8px; border: 1px solid #ffc87877; background: #ffc8781a; color: #ffe2b0; border-radius: 8px; padding: 3px 9px; font: inherit; font-size: .74rem; font-weight: 700; cursor: pointer; }
.nex-composer { margin: 8px 14px 6px; border: 1px solid #9e8bff45; background: #10152bdb; border-radius: 18px; padding: 8px 8px 6px; box-shadow: 0 15px 45px #0003; transition: border-color .2s, box-shadow .2s; }
.nex-composer:focus-within { border-color: #9d84ff99; box-shadow: 0 0 0 3px #9d84ff1a; }
.nex-row { display: flex; align-items: flex-end; gap: 8px; }
.nex-composer textarea { flex: 1; min-width: 0; resize: none; min-height: 40px; max-height: 140px; border: 0; outline: 0; background: transparent; color: var(--nx-text); font: inherit; font-size: .9rem; line-height: 1.45; padding: 9px 8px; box-shadow: none; }
.nex-composer textarea::placeholder { color: #7f8aaa; }
.nex-send { flex: 0 0 42px; height: 40px; border: 0; border-radius: 12px; background: linear-gradient(135deg, #9a72ff, #4ddde9); color: #0a1021; font-size: 18px; font-weight: 900; cursor: pointer; box-shadow: 0 4px 20px #7862ff35; transition: transform .15s, opacity .2s; }
.nex-send:not(:disabled):hover { transform: translateY(-1px); } .nex-send:disabled { opacity: .4; cursor: default; }
.nex-cfoot { display: flex; justify-content: space-between; gap: 8px; padding: 2px 8px 0; color: #6f7b9e; font-size: .66rem; }
.nex-foot { display: flex; align-items: center; gap: 10px; padding: 8px 16px 12px; font-size: .66rem; color: #7884a5; }
.nex-foot .nex-priv { flex: 1; min-width: 0; line-height: 1.4; }
.nex-foot #nex-uso { white-space: nowrap; color: #a3aed0; }
.nex-foot button { border: 1px solid var(--nx-line); background: #ffffff08; color: #c8cfe8; border-radius: 9px; padding: 5px 9px; font: inherit; font-size: .7rem; cursor: pointer; white-space: nowrap; }
/* cajón de PC: más ancho y oscuro cuando se ve NEX */
@media (min-width: 1200px) {
  body.panel.pc3.rp-nex .ws-right { width: min(680px, calc(100vw - 360px)); background: var(--nx-bg); border-color: #2a2f55; box-shadow: 0 30px 70px -18px rgba(11,8,40,.6), 0 0 0 1px #a38bff22; transition: transform .26s var(--ease-p), opacity .18s ease, visibility 0s, width .3s var(--ease-p); }
  body.panel.pc3.rp-nex .rp-tabs { background: var(--nx-bg); border-bottom-color: var(--nx-line); }
  body.panel.pc3.rp-nex .rp-tabs button { color: var(--nx-muted); }
  body.panel.pc3.rp-nex .rp-tabs button[aria-selected="true"] { color: #fff; background: #ffffff0d; border-bottom-color: var(--nx-violet); }
  body.panel.pc3.rp-nex .rp-close { background: #ffffff08 !important; border-color: var(--nx-line) !important; color: var(--nx-muted); }
  body.panel.pc3.rp-nex.rp-open .toasts { right: 710px !important; }
  body.panel.pc3 .ia-drawer.nex.docked { width: auto; background: transparent; }
  body.panel.pc3 .ia-drawer.nex.docked .nex-x { display: none; }
}
@media (max-width: 650px) {
  .ia-drawer.nex { width: 100vw; }
  .ia-fab.nex-fab { width: 66px; height: 66px; right: 14px; bottom: 14px; } .ia-fab.nex-fab .nex-orb-m { --s: 52px; }
  .nex-quick { grid-template-columns: 1fr; } .nex-hello .nex-orb-l { --s: 64px; } .nex-hello h3 { font-size: 1.2rem; }
  .nex-foot { flex-wrap: wrap; } .nex-foot .nex-priv { flex-basis: 100%; order: 3; }
  .nex-cfoot span:first-child { display: none; } .nex-mode button { padding: 5px 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .nex-orb, .nex-spark, .nex-eye, .nex-msg, .nex-typing i, .nex-q, .nex-eyes, .pfab.nex-fabbtn::before { animation: none !important; transition: none !important; }
  .nex-eyes { transform: none !important; }
}

/* invitación: requisitos de contraseña en vivo */
.pw-wrap { position: relative; }
.login-box .pw-wrap input { margin-bottom: 0; }
.pw-wrap input { padding-right: 76px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .8rem; font-weight: 600; padding: 6px 10px; cursor: pointer; border-radius: 6px; }
.pw-eye:hover, .pw-eye:focus-visible { color: inherit; background: rgba(127,127,127,.12); }
.pw-rules { list-style: none; margin: 6px 0 10px; padding: 0; font-size: .82rem; color: var(--muted); display: grid; gap: 3px; }
.pw-rules li { position: relative; padding-left: 22px; line-height: 1.35; }
.pw-rules li::before { content: "○"; position: absolute; left: 4px; top: 0; }
.pw-rules li.ok { color: #15803d; }
.pw-rules li.ok::before { content: "✓"; font-weight: 700; }
.pw-rules li.no { color: var(--danger); }
.pw-rules li.no::before { content: "✕"; font-weight: 700; }
.pw-rules .pw-n { opacity: .75; }

/* ================= SOSFIX Scan · escáner de documentos (estilo NEX oscuro violeta/cian) ================= */
html.scan-open { overflow: hidden; }
.scan { position: fixed; inset: 0; z-index: 2147482000; display: grid; place-items: center; padding: 18px; background: rgba(5,8,22,.62); backdrop-filter: blur(6px); opacity: 0; transition: opacity .22s ease; font-family: inherit; }
.scan.in { opacity: 1; }
.scan[hidden] { display: none; }
.scan-box { position: relative; display: grid; grid-template-rows: auto 1fr auto auto auto; width: min(1180px, 100%); height: min(860px, 100%); border-radius: 22px; overflow: hidden; color: var(--nx-text); background: radial-gradient(1200px 500px at 0% -10%, #9365ff2b, transparent 60%), radial-gradient(900px 500px at 110% 120%, #4be3f222, transparent 60%), var(--nx-bg); border: 1px solid var(--nx-line); box-shadow: 0 40px 120px -30px #000c, 0 0 0 1px #ffffff08 inset; transform: translateY(10px) scale(.985); transition: transform .28s cubic-bezier(.22,1,.36,1); }
.scan.in .scan-box { transform: none; }
.scan.drag .scan-box { outline: 2px dashed var(--nx-cyan); outline-offset: -8px; }
.scan-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--nx-line); }
.scan-logo { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, #9a72ff, #4ddde9); color: #0a1021; box-shadow: 0 6px 22px -6px #7f5cff; }
.scan-logo svg { width: 24px; height: 24px; }
.scan-title { flex: 1; min-width: 0; } .scan-title strong { display: block; letter-spacing: .12em; font-size: 1rem; } .scan-title small { color: var(--nx-muted); font-size: .76rem; }
.scan-x { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--nx-line); background: #ffffff0a; color: var(--nx-text); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.scan-x:hover { background: #ffffff18; }
.scan-body { display: grid; grid-template-columns: minmax(0, 1fr) 360px; min-height: 0; }
.scan[data-mode] .scan-body:has(.scan-side[hidden]) { grid-template-columns: 1fr; }
.scan-stage { position: relative; display: grid; grid-template-rows: 1fr auto auto; min-height: 0; padding: 14px; gap: 10px; }
.scan-empty { display: grid; place-items: center; min-height: 0; }
.scan-drop { text-align: center; max-width: 460px; padding: 34px 26px; border-radius: 20px; border: 1.5px dashed #9365ff66; background: #ffffff06; }
.scan-drop h3 { margin: 10px 0 6px; font-size: 1.25rem; } .scan-drop p { margin: 0 0 18px; color: var(--nx-muted); font-size: .9rem; line-height: 1.45; }
.scan-drop-ic { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; background: linear-gradient(135deg, #9365ff33, #4be3f233); color: var(--nx-cyan); animation: scan-float 3.2s ease-in-out infinite; }
.scan-drop-ic svg { width: 34px; height: 34px; }
@keyframes scan-float { 50% { transform: translateY(-5px); } }
.scan-src { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.scan-lim { display: block; margin-top: 14px; color: var(--nx-muted); font-size: .74rem; }
.scan-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--nx-line); background: #ffffff0d; color: var(--nx-text); font: inherit; font-weight: 650; font-size: .88rem; cursor: pointer; transition: background .2s, transform .15s, box-shadow .2s; }
.scan-btn svg { width: 18px; height: 18px; }
.scan-btn:hover:not([disabled]) { background: #ffffff1a; transform: translateY(-1px); }
.scan-btn.pri { border: 0; background: linear-gradient(135deg, #9a72ff, #4ddde9); color: #0a1021; box-shadow: 0 8px 24px -10px #7f5cff; }
.scan-btn.pri:hover:not([disabled]) { box-shadow: 0 10px 30px -8px #7f5cffcc; }
.scan-btn.sm { padding: 7px 12px; font-size: .8rem; }
.scan-btn[disabled] { opacity: .45; cursor: not-allowed; }
.scan-btn:focus-visible, .scan-tool:focus-visible, .scan-chip:focus-visible, .scan-x:focus-visible, .scan-pg-b:focus-visible, .scan-dw:focus-visible { outline: 2px solid var(--nx-cyan); outline-offset: 2px; }
.scan-view { min-height: 0; display: grid; place-items: center; border-radius: 16px; background: repeating-conic-gradient(#ffffff05 0 25%, transparent 0 50%) 0 0/22px 22px, #070a1a; border: 1px solid var(--nx-line); overflow: hidden; }
.scan-canvas { width: 100%; height: 100%; display: grid; place-items: center; padding: 12px; min-height: 0; }
.scan-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; box-shadow: 0 14px 40px -12px #000; animation: scan-in .3s ease both; }
@keyframes scan-in { from { opacity: 0; transform: scale(.98); } }
.scan-cropw { position: relative; display: inline-block; max-width: 100%; max-height: 100%; line-height: 0; }
.scan-cropw .scan-img { animation: none; max-height: calc(860px - 330px); }
.scan-svg { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.scan-shade { fill: #050816aa; } .scan-poly { fill: #4be3f214; stroke: var(--nx-cyan); stroke-width: 3; vector-effect: non-scaling-stroke; }
.scan-h { fill: #0b0f24; stroke: var(--nx-cyan); stroke-width: 3; vector-effect: non-scaling-stroke; cursor: grab; filter: drop-shadow(0 0 6px #4be3f2); }
.scan-h:focus { stroke: var(--nx-gold); outline: none; }
.scan-tools, .scan-cropbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.scan-cropbar { justify-content: space-between; color: var(--nx-muted); font-size: .8rem; } .scan-cropbar > div { display: flex; gap: 6px; flex-wrap: wrap; }
.scan-tg { display: flex; align-items: center; gap: 6px; }
.scan-tool { display: inline-flex; align-items: center; gap: 5px; padding: 7px 11px; border-radius: 10px; border: 1px solid var(--nx-line); background: #ffffff0a; color: var(--nx-text); font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; transition: background .2s; }
.scan-tool svg { width: 16px; height: 16px; }
.scan-tool:hover:not([disabled]) { background: #ffffff1c; } .scan-tool.danger { color: #ffb1b1; }
.scan-filters { padding: 3px; border-radius: 999px; border: 1px solid var(--nx-line); background: #ffffff06; }
.scan-chip { border: 0; background: none; color: var(--nx-muted); font: inherit; font-size: .78rem; font-weight: 700; padding: 6px 11px; border-radius: 999px; cursor: pointer; }
.scan-chip[aria-checked="true"] { background: linear-gradient(135deg, #9a72ff, #4ddde9); color: #0a1021; }
.scan-sl label { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; color: var(--nx-muted); }
.scan-sl input[type=range] { width: 92px; accent-color: var(--nx-violet); }
.scan-side { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow: auto; padding: 14px 14px 14px 0; scroll-behavior: smooth; }
.scan-card { border-radius: 16px; border: 1px solid var(--nx-line); background: var(--nx-panel); padding: 12px 14px; }
.scan-cls-h { display: flex; justify-content: space-between; align-items: center; font-size: .74rem; color: var(--nx-muted); text-transform: uppercase; letter-spacing: .08em; }
.scan-kind { font-size: 1.35rem; font-weight: 800; margin: 4px 0 6px; background: linear-gradient(90deg, #fff, #b9f6ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.scan-conf { font-style: normal; font-weight: 700; padding: 2px 8px; border-radius: 999px; text-transform: none; letter-spacing: 0; }
.scan-conf.hi { background: #70e8b022; color: #8ff0c2; } .scan-conf.mid { background: #ffc87822; color: var(--nx-gold); } .scan-conf.lo { background: #ff6b6b22; color: #ffb1b1; }
.scan-why { margin: 0 0 8px; padding-left: 18px; color: var(--nx-muted); font-size: .76rem; line-height: 1.4; }
.scan-sel { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .8rem; color: var(--nx-muted); }
.scan-sel select { flex: 1; max-width: 200px; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--nx-line); background: #0b0f24; color: var(--nx-text); font: inherit; font-size: .84rem; }
.scan-ocr { display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 260px; }
.scan-ocr-h { display: flex; justify-content: space-between; align-items: center; font-size: .86rem; }
.scan-st { color: var(--nx-muted); font-size: .74rem; }
.scan-prog { height: 6px; border-radius: 999px; background: #ffffff12; overflow: hidden; }
.scan-prog i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #9a72ff, #4ddde9); transition: width .25s ease; box-shadow: 0 0 12px #4be3f2; }
.scan-ocr-act { display: flex; gap: 6px; flex-wrap: wrap; }
.scan-flags { display: flex; flex-direction: column; gap: 6px; }
.scan-flag { display: flex; gap: 8px; align-items: flex-start; font-size: .77rem; line-height: 1.35; padding: 7px 9px; border-radius: 10px; background: #ffffff07; border: 1px solid var(--nx-line); }
.scan-flag i { flex: 0 0 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--nx-cyan); }
.scan-flag.aviso i, .scan-flag.dudoso i { background: var(--nx-gold); box-shadow: 0 0 8px var(--nx-gold); } .scan-flag.error i { background: #ff6b6b; box-shadow: 0 0 8px #ff6b6b; }
.scan-flag.dudoso { border-color: #ffc87855; }
.scan-doubt { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: .72rem; color: var(--nx-muted); }
.scan-doubt small { width: 100%; }
.scan-dw { border: 1px solid #ffc87866; background: #ffc8781a; color: var(--nx-gold); border-radius: 6px; padding: 2px 6px; font: inherit; font-size: .74rem; cursor: pointer; }
.scan-ta-l { font-size: .72rem; color: var(--nx-muted); }
.scan-ta { flex: 1; min-height: 150px; resize: vertical; width: 100%; box-sizing: border-box; padding: 10px; border-radius: 12px; border: 1px solid var(--nx-line); background: #070a1a; color: var(--nx-text); font: .8rem/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; }
.scan-ta:focus { outline: 2px solid #9365ff88; }
.scan-strip { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--nx-line); background: #ffffff04; overflow-x: auto; }
.scan-pages { display: flex; gap: 10px; margin: 0; padding: 0; list-style: none; }
.scan-pg { position: relative; flex: 0 0 auto; }
.scan-pg-b { position: relative; display: block; width: 76px; height: 98px; padding: 0; border-radius: 10px; overflow: hidden; border: 2px solid transparent; background: #070a1a; cursor: pointer; }
.scan-pg.on .scan-pg-b { border-color: var(--nx-cyan); box-shadow: 0 0 0 3px #4be3f233; }
.scan-pg-b img { width: 100%; height: 100%; object-fit: cover; }
.scan-pg-b b { position: absolute; left: 4px; top: 4px; min-width: 18px; height: 18px; border-radius: 6px; background: #0b0f24dd; color: #fff; font-size: .7rem; display: grid; place-items: center; }
.scan-badge { position: absolute; left: 0; right: 0; bottom: 0; padding: 2px 4px; background: linear-gradient(0deg, #0b0f24f0, #0b0f2499); color: #b9f6ff; font-size: .62rem; font-style: normal; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scan-badge.busy { color: var(--nx-gold); animation: scan-pulse 1.2s ease-in-out infinite; }
@keyframes scan-pulse { 50% { opacity: .5; } }
.scan-pg-mv { display: flex; justify-content: space-between; margin-top: 3px; }
.scan-pg-mv button { width: 34px; height: 22px; border-radius: 6px; border: 1px solid var(--nx-line); background: #ffffff0a; color: var(--nx-muted); font-size: .62rem; cursor: pointer; }
.scan-pg-mv button[disabled] { opacity: .3; cursor: default; }
.scan-add { display: flex; gap: 6px; flex: 0 0 auto; }
.scan-msg { min-height: 0; padding: 0 18px; font-size: .8rem; color: var(--nx-muted); }
.scan-msg:not(:empty) { padding: 8px 18px; border-top: 1px solid var(--nx-line); }
.scan-msg[data-k="err"] { color: #ffb1b1; background: #ff6b6b14; } .scan-msg[data-k="warn"] { color: var(--nx-gold); } .scan-msg[data-k="ok"] { color: #8ff0c2; }
.scan-msg[data-k="busy"]::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 50%; border: 2px solid var(--nx-cyan); border-right-color: transparent; vertical-align: -1px; animation: scan-spin .8s linear infinite; }
@keyframes scan-spin { to { transform: rotate(360deg); } }
.scan-foot { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--nx-line); }
.scan-sp { flex: 1; }
@media (max-width: 860px) {
  .scan { padding: 0; }
  .scan-box { width: 100%; height: 100%; border-radius: 0; grid-template-rows: auto minmax(0, 1fr) auto auto auto; }
  .scan-body { grid-template-columns: 1fr; grid-auto-rows: max-content; align-content: start; overflow: auto; }
  .scan-stage { grid-template-rows: minmax(260px, 46vh) auto auto; padding: 10px; min-height: auto; }
  .scan-stage:has(.scan-view[hidden]) { grid-template-rows: 1fr; }
  .scan-side { padding: 0 10px 12px; overflow: visible; }
  .scan-ocr { min-height: 0; }
  .scan-ta { min-height: 120px; }
  .scan-cropw .scan-img { max-height: 44vh; }
  .scan-sl input[type=range] { width: 74px; }
  .scan-foot { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
  .scan-foot .scan-btn { padding: 10px 12px; font-size: .84rem; }
  .scan-tool span { display: none; }
  .scan-cropbar > span { display: none; } /* la instrucción ya sale abajo; deja ver «Aplicar» sin desplazar */
  .scan-cropbar .scan-tool { padding: 7px 10px; font-size: .8rem; }
  .scan-cropw .scan-img { max-height: 40vh; }
}
@media (prefers-reduced-motion: reduce) { .scan, .scan-box, .scan-img, .scan-drop-ic, .scan-badge.busy, .scan-prog i { animation: none !important; transition: none !important; } }
/* entrada al escáner desde el formulario del cliente y desde el panel */
.scan-cta { display: flex; align-items: center; gap: 12px; width: 100%; margin: 4px 0 12px; padding: 14px 16px; border-radius: 16px; border: 0; cursor: pointer; text-align: left; font: inherit; color: #f4f6ff; background: radial-gradient(400px 120px at 0 0, #9365ff55, transparent 70%), linear-gradient(135deg, #10152b, #0b0f24); box-shadow: 0 10px 30px -14px #4b2bbf, 0 0 0 1px #9365ff44 inset; transition: transform .18s, box-shadow .2s; }
.scan-cta:hover { transform: translateY(-1px); box-shadow: 0 14px 34px -12px #6b46ff, 0 0 0 1px #4be3f277 inset; }
.scan-cta .scan-logo { flex: 0 0 auto; } .scan-cta b { display: block; font-size: 1rem; } .scan-cta small { color: #a3aed0; font-size: .8rem; }
.scan-chipdoc { position: absolute; top: 6px; left: 6px; z-index: 1; display: inline-flex; gap: 4px; align-items: center; padding: 2px 7px; border-radius: 999px; font-size: .66rem; font-weight: 700; color: #0a1021; background: linear-gradient(135deg, #b9a0ff, #8ef0f8); box-shadow: 0 2px 8px #0005; }
.scan-chipdoc.warn { background: linear-gradient(135deg, #ffd79a, #ffb46b); }
.doc-wrap { position: relative; }
.ph-ocr { position: absolute; left: 6px; top: 6px; font-style: normal; font-size: .64rem; font-weight: 700; padding: 2px 6px; border-radius: 999px; background: #10152bdd; color: #b9f6ff; }
.scan-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.scan-bar .scan-btn { color: #f4f6ff; background: #10152b; } .scan-bar .scan-btn.pri { color: #0a1021; background: linear-gradient(135deg, #9a72ff, #4ddde9); }
.scan-run { flex-basis: 100%; font-size: .8rem; color: var(--muted, #64748b); }
body.panel .docs-grid button { position: relative; }
.doc-tile { position: relative; }
.doc-acts { display: flex; gap: 10px; justify-content: flex-end; padding: 6px 4px 0; }
.doc-acts .link-btn.danger { color: #b91c1c; }

/* ===== ScanCamera (cámara en vivo, ráfaga y revisión) ===== */
.scam { position: fixed; inset: 0; z-index: 2147483000; display: grid; grid-template-rows: auto 1fr auto; background: #04060f; color: #eef1ff; font-family: inherit; }
.scam-top { display: flex; align-items: center; gap: 12px; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); }
.scam-top b { font-size: 1rem; }
.scam-x { width: 44px; height: 44px; border-radius: 50%; border: 1px solid #ffffff33; background: #ffffff12; color: #fff; font-size: 1.2rem; cursor: pointer; }
.scam-focus { margin-left: auto; font-size: .78rem; padding: 5px 10px; border-radius: 999px; background: #4ddde922; color: #8ff3fb; border: 1px solid #4ddde955; }
.scam-live, .scam-review { position: relative; min-height: 0; display: grid; place-items: center; overflow: hidden; }
.scam-live[hidden], .scam-review[hidden] { display: none; }
.scam-video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.scam-guide { position: absolute; inset: 7% 9%; border: 2px dashed #4ddde9aa; border-radius: 16px; box-shadow: 0 0 0 100vmax #00000040; pointer-events: none; }
.scam-live.off .scam-guide { display: none; }
.scam-state { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); padding: 9px 16px; border-radius: 999px; background: #0b1024e6; border: 1px solid #ffffff22; font-weight: 650; font-size: .92rem; white-space: nowrap; }
.scam-state[hidden] { display: none; }
.scam-tips { position: absolute; inset: auto 14px 14px 14px; max-width: 520px; margin: 0 auto; padding: 16px 18px; border-radius: 18px; background: #0d1330f2; border: 1px solid #9a72ff66; box-shadow: 0 20px 50px -20px #000; }
.scam-tips[hidden] { display: none; }
.scam-tips h3 { margin: 0 0 8px; font-size: 1.05rem; }
.scam-tips ul { margin: 0 0 12px; padding: 0; list-style: none; display: grid; gap: 7px; font-size: .95rem; line-height: 1.35; }
.scam-bottom { display: grid; justify-items: center; gap: 10px; padding: 12px 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.scam-hold { margin: 0; font-size: .95rem; font-weight: 650; color: #cfd6ff; text-align: center; }
.scam-hold[hidden] { display: none; }
.scam.holding .scam-hold { color: #8ff3fb; }
.scam-shutter { width: 82px; height: 82px; border-radius: 50%; border: 4px solid #fff; background: transparent; display: grid; place-items: center; cursor: pointer; }
.scam-shutter i { width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(135deg, #9a72ff, #4ddde9); transition: transform .15s; }
.scam-shutter:active i, .scam.holding .scam-shutter i { transform: scale(.85); }
.scam-shutter[disabled] { opacity: .4; }
.scam-shutter[hidden], .scam-acts[hidden], .scam-err[hidden], .scam-warn[hidden], .scam-frames[hidden] { display: none; }
.scam-btn { min-height: 48px; padding: 12px 20px; border-radius: 14px; border: 1px solid #ffffff33; background: #ffffff10; color: #fff; font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer; }
.scam-btn.pri { border: 0; background: linear-gradient(135deg, #9a72ff, #4ddde9); color: #0a1021; }
.scam-acts { display: flex; gap: 10px; width: 100%; max-width: 520px; }
.scam-acts .scam-btn { flex: 1; }
.scam-err { display: grid; gap: 10px; width: 100%; max-width: 520px; text-align: center; }
.scam-err p { margin: 0 0 4px; line-height: 1.4; }
.scam-review { grid-template-rows: 1fr auto auto; gap: 10px; padding: 0 12px; }
.scam-shot { position: relative; min-height: 0; height: 100%; display: grid; place-items: center; }
.scam-shot img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 12px; }
.scam-retake { position: absolute; top: 10px; right: 10px; min-height: 44px; padding: 10px 14px; border-radius: 12px; border: 1px solid #ffffff55; background: #0b1024e0; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.scam-warn { width: 100%; max-width: 620px; padding: 10px 14px; border-radius: 12px; background: #ffb02e1f; border: 1px solid #ffb02e88; color: #ffd690; font-weight: 600; line-height: 1.35; }
.scam-frames { display: flex; gap: 8px; margin: 0; padding: 0; list-style: none; justify-content: center; }
.scam-frames button { position: relative; padding: 0; width: 72px; height: 72px; border-radius: 10px; overflow: hidden; border: 2px solid #ffffff33; background: #000; cursor: pointer; }
.scam-frames button.on { border-color: #4ddde9; box-shadow: 0 0 0 2px #4ddde966; }
.scam-frames img { width: 100%; height: 100%; object-fit: cover; }
.scam-frames em { position: absolute; left: 0; right: 0; bottom: 0; font-size: .62rem; font-style: normal; font-weight: 800; background: #4ddde9; color: #04101a; }
.scan-tips-mini { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: .82rem; color: var(--nx-muted, #aab); text-align: left; }

/* ===== DateField (fecha en casillas Mes / Día / Año — formato USA) ===== */
.df-row { display: flex; gap: 8px; }
.df-c { display: grid; gap: 3px; flex: 0 0 auto; width: 4.6em; margin: 0; font-weight: 600; }
.df-c.df-y { width: 6.4em; }
.df-c span { font-size: .8rem; color: var(--muted); }
.df-c input { width: 100%; text-align: center; font-size: 1.1rem; letter-spacing: .04em; }
.df-ex { display: block; margin-top: 4px; font-size: .78rem; color: var(--muted); }
.df-err { min-height: 0; color: var(--red-2); font-size: .85rem; font-weight: 600; margin-top: 3px; }
.df.invalid input { border-color: var(--red-2); background: #fff5f5; }

/* ===== Estado e historial del expediente (cliente) ===== */
.estado { text-align: left; max-width: 520px; margin: 16px auto; padding: 14px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.estado-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.estado-h b { color: var(--navy); }
.estado-st { padding: 4px 10px; border-radius: 999px; background: rgba(15,9,79,.08); color: var(--navy); font-weight: 700; font-size: .82rem; }
.estado-ev { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: .92rem; }
.estado-ev time { display: block; font-size: .78rem; color: var(--muted); }
.estado-docs { margin: 10px 0 0; font-size: .88rem; color: var(--muted); }

/* ===================== Cliente PREMIUM (oscuro violeta/cian, como el panel NEX) — solo body.cl ===================== */
body.cl {
  --bg: #0b0f24; --card: rgba(20,25,52,.78); --field: rgba(255,255,255,.05); --line: rgba(190,201,255,.16); --text: #f1f3ff; --muted: #a3aed0;
  --navy: #c9b8ff; --navy-2: #e4dcff; --red: #4be3f2; --red-2: #7cf0fa; --danger: #ff8a8a; --success: #56e39f;
  --shadow: 0 18px 50px -24px rgba(0,0,0,.8); --radius: 20px;
  font-family: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: radial-gradient(900px 520px at 10% -10%, #9365ff33, transparent 60%), radial-gradient(800px 500px at 110% 10%, #4be3f222, transparent 55%), #0b0f24 fixed;
  color: var(--text);
}
body.cl::before { height: 3px; background: linear-gradient(90deg, #9365ff, #4be3f2); }
.cl .header { background: rgba(16,21,43,.7); border: 1px solid var(--line); border-radius: 20px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--shadow); }
.cl .header::after { display: none; }
.cl .header h1 { color: #f4f6ff; } .cl .header .sub { color: #8ff3fb; }
.cl .logo { width: 54px; filter: drop-shadow(0 6px 16px #9365ff66); }
.cl .badge { background: linear-gradient(135deg, #9a72ff, #4ddde9); color: #0a1021; }
.cl .progress { background: rgba(16,21,43,.7); border: 1px solid var(--line); flex-wrap: wrap; border-radius: 18px; }
.cl .progress-track { background: #ffffff14; height: 6px; }
.cl .progress-fill { background: linear-gradient(90deg, #9365ff, #4be3f2); }
.cl .save-note { width: 100%; order: 3; }
.stepper { display: flex; width: 100%; order: 2; margin: 2px 0 0; padding: 0; list-style: none; gap: 4px; counter-reset: s; }
.stepper li { flex: 1; display: grid; justify-items: center; gap: 4px; font-size: .66rem; color: var(--muted); counter-increment: s; text-align: center; transition: color .25s; }
.stepper li::before { content: counter(s); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .78rem; border: 1.5px solid #ffffff2e; background: #ffffff08; transition: all .3s var(--ease-out, ease); }
.stepper li.ok::before { content: '✓'; background: #4be3f233; border-color: #4be3f2aa; color: #8ff3fb; }
.stepper li.on { color: #fff; font-weight: 700; }
.stepper li.on::before { background: linear-gradient(135deg, #9a72ff, #4ddde9); border-color: transparent; color: #0a1021; box-shadow: 0 0 0 4px #9365ff33, 0 8px 22px -8px #7f5cff; }
.cl .step, .cl .card { background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.cl .step-head { border-bottom-color: var(--line); }
.cl .step-head h2 { color: #f4f6ff; } .cl .step-head h2 .icon { color: #8ff3fb; }
.cl .step-count { color: #8ff3fb; }
.cl input[type=text], .cl input[type=email], .cl input[type=tel], .cl input[type=number], .cl input:not([type]), .cl select, .cl textarea { background: rgba(255,255,255,.06); border: 1px solid var(--line); color: #fff; min-height: 50px; border-radius: 14px; font-size: 1rem; }
.cl input::placeholder { color: #7f89ad; }
.cl input:focus, .cl select:focus, .cl textarea:focus { border-color: #9a72ff; background: rgba(255,255,255,.09); box-shadow: 0 0 0 3px #9365ff40; }
.cl select option { background: #10152b; color: #fff; }
.cl .help-btn { background: #ffffff0d; color: #cfd6ff; border-color: var(--line); }
.cl .check { background: rgba(255,255,255,.04); border-color: var(--line); color: var(--text); min-height: 52px; border-radius: 14px; }
.cl .check input { accent-color: #9365ff; }
.cl .check:has(input:checked) { background: #9365ff1f; border-color: #9a72ff; box-shadow: inset 3px 0 0 #4be3f2; }
.cl .dep-card, .cl .summary { background: rgba(255,255,255,.04); border-color: var(--line); }
.cl .summary { border-left-color: #9a72ff; }
.cl .sig-box { background: rgba(255,255,255,.04); border-color: #9a72ff88; }
.cl .btn { min-height: 52px; border-radius: 14px; font-weight: 700; transition: transform .15s, box-shadow .2s, background .2s; }
.cl .btn-primary { background: linear-gradient(135deg, #9a72ff, #4ddde9); color: #0a1021; box-shadow: 0 10px 28px -12px #7f5cff; }
.cl .btn-primary:hover { background: linear-gradient(135deg, #a684ff, #64e6f0); }
.cl .btn-secondary, .cl .btn-ghost { background: #ffffff0d; color: #eef1ff; border: 1px solid var(--line); }
.cl .btn-danger { background: transparent; }
.cl .nav { background: rgba(11,15,36,.86); border-top: 1px solid var(--line); box-shadow: 0 -10px 30px -12px #000; }
.cl .done h2 { color: #fff; }
.cl .done .tick { background: radial-gradient(circle, #4be3f233, #9365ff22); color: #8ff3fb; box-shadow: 0 0 0 6px #4be3f214; }
.cl .site-foot a, .cl .site-foot { color: #7f89ad; }
.cl .site-foot .stars { color: #9a72ff; }
.cl .chat-fab { background: linear-gradient(135deg, #9a72ff, #4ddde9); color: #0a1021; }
/* Panel del cliente: contraste del chat, FAB al enviar, "No a todo" y firma en 390px */
body.cl { --nav-h: 108px; }
body.cl .sig-box, body.cl .sig-actions, body.cl #clear-sig, body.cl #clear-sig2, body.cl #edit-form, body.cl #send-err {
  scroll-margin-bottom: calc(var(--nav-h) + 20px);
}
.step[data-step="7"] { padding-bottom: 24px; }

body.form-done { --nav-h: 0px; }
body.form-done .chat-fab, body.form-done .chat-win { bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
.done { padding-bottom: 96px; }
.q-none-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; }
@media (max-width: 420px) {
  .q-none-row { flex-direction: column; align-items: stretch; }
  .q-none-row .hint { font-size: .78rem; line-height: 1.35; }
  .cl .sig-box { margin-bottom: 12px; }
  .cl .sig-actions { flex-wrap: wrap; }
}
.cl .chat-win { background: #141934; border: 1px solid var(--line); color: var(--text); box-shadow: 0 18px 40px -16px #000; }
.cl .chat-head { background: #1a2144; color: #f4f6ff; border-bottom: 2px solid #9a72ff; }
.cl .chat-head button { color: #f4f6ff; }
.cl .chat-head .chat-id { color: #8ff3fb; }
.cl .chat-msgs { background: #0e1328; }
.cl .msg.agent { background: #2a315c; color: #f4f6ff; border: 1px solid rgba(190,201,255,.22); }
.cl .msg.client { background: linear-gradient(135deg, #7c5cff, #5b4ad6); color: #fff; border: 0; }
.cl .msg.greet { background: #1e2648; color: #e8ebff; }
.cl .chat-form { background: #1a2144; border-top: 1px solid var(--line); }
.cl .chat-form input { background: rgba(255,255,255,.08); color: #fff; border: 1px solid var(--line); }
.cl .chat-form input::placeholder { color: #9aa3c7; }
.cl .chat-form button { background: linear-gradient(135deg, #9a72ff, #4ddde9); color: #0a1021; }
.photo-note { font-size: .82rem; color: #f5c16c; margin: 8px 0 0; }
.tab-note { margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: #9365ff22; border: 1px solid #9a72ff66; color: var(--text); font-size: .88rem; }
#doc-up-err { margin-top: 8px; }
#done-load { margin: 0 0 8px; }

.cl .photo { background: rgba(255,255,255,.05); border-color: var(--line); }
.cl.booting #form, .cl.booting #progress-wrap, .cl.booting #nav { visibility: hidden; }
.cl.booting .app::after { content: 'Cargando tu expediente…'; display: block; text-align: center; color: var(--muted); margin-top: 40px; }
/* línea de tiempo del expediente */
.cl .estado { background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; }
.cl .estado-h b { color: #fff; font-size: 1.02rem; }
.cl .estado-st { background: linear-gradient(135deg, #9a72ff33, #4ddde933); color: #8ff3fb; border: 1px solid #4be3f255; }
.cl .estado-ev { list-style: none; padding: 0 0 0 4px; gap: 0; }
.cl .estado-ev li { position: relative; padding: 0 0 14px 22px; border-left: 2px solid #9365ff55; margin-left: 6px; }
.cl .estado-ev li:last-child { border-left-color: transparent; padding-bottom: 0; }
.cl .estado-ev li::before { content: ''; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: linear-gradient(135deg, #9a72ff, #4ddde9); box-shadow: 0 0 0 4px #9365ff2e; }
.cl .estado-ev time { color: #8ff3fb; }
/* pantalla sin enlace */
.gate { text-align: center; padding: 30px 20px; margin-top: 18px; border-radius: 22px; background: rgba(20,25,52,.78); border: 1px solid rgba(190,201,255,.16); box-shadow: 0 18px 50px -24px #000; animation: stepIn .35s ease both; }
.gate[hidden] { display: none; }
.gate-ic { width: 72px; height: 72px; margin: 0 auto 12px; border-radius: 22px; display: grid; place-items: center; font-size: 2rem; background: linear-gradient(135deg, #9365ff44, #4be3f233); border: 1px solid #9a72ff66; }
.gate h2 { font-size: 1.3rem; margin-bottom: 8px; color: #fff; outline: none; }
.gate p { color: #cfd6ff; line-height: 1.5; max-width: 460px; margin: 0 auto; }
.gate-recibo { margin: 16px auto 0; max-width: 460px; padding: 12px 14px; border-radius: 14px; background: #56e39f1a; border: 1px solid #56e39f66; color: #bff5d8; text-align: left; font-weight: 600; }
.gate-steps { text-align: left; max-width: 460px; margin: 18px auto 0; padding-left: 22px; display: grid; gap: 8px; color: #e4e8ff; }
.cl .df-c span { color: #a3aed0; } .cl .df.invalid input { background: #ff8a8a14; border-color: #ff8a8a; }
@media (prefers-reduced-motion: reduce) { .stepper li::before, .cl .btn, .gate { transition: none; animation: none; } }

/* ---------- Cliente con enlace: acciones (Agregar documentos · Corregir un dato · Estado e historial) ---------- */
.cl-acts { display: grid; gap: 10px; max-width: 520px; margin: 14px auto 6px; text-align: left; }
.cl-act { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 12px 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--card, #fff); color: inherit; font: inherit; text-align: left; cursor: pointer; transition: transform .12s, border-color .12s, background .12s; }
.cl-act:hover:not(:disabled), .cl-act[aria-expanded="true"] { border-color: #8f6bff; transform: translateY(-1px); }
.cl-act:disabled { opacity: .45; cursor: not-allowed; }
.cl-act b { display: block; font-size: 1rem; }
.cl-act small { display: block; color: var(--muted); font-size: .84rem; margin-top: 2px; }
.cl-ic { flex: 0 0 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; background: linear-gradient(135deg, #7c4dff33, #22d3ee33); }
.cl-closed { margin: 4px 2px; color: var(--muted); font-size: .9rem; }
.cl-panel { max-width: 520px; margin: 8px auto 14px; padding: 16px 18px; border-radius: 18px; border: 1px solid var(--line); background: var(--card, #fff); text-align: left; display: grid; gap: 8px; }
.cl-panel[hidden] { display: none; }
.cl-panel h3 { margin: 0; font-size: 1.08rem; }
.cl-panel .hint { margin: 0; color: var(--muted); font-size: .86rem; }
.cl-lbl { font-weight: 600; font-size: .92rem; margin-top: 4px; }
.cl-panel select, .cl-panel input, .cl-panel textarea { width: 100%; min-height: 50px; font-size: 16px; border-radius: 12px; padding: 10px 12px; box-sizing: border-box; }
.cl-row { display: flex; gap: 10px; flex-wrap: wrap; }
.cl-row > * { flex: 1 1 160px; min-height: 52px; display: inline-flex; align-items: center; justify-content: center; }
.cl-file { cursor: pointer; }
.cl-msg { margin: 2px 0 0; font-size: .92rem; min-height: 1.2em; }
.estado-corr { list-style: none; margin: 10px 0 0; padding: 10px 0 0; border-top: 1px dashed var(--line); display: grid; gap: 6px; font-size: .9rem; }
.estado-corr time { color: var(--muted); font-size: .8rem; margin-left: 4px; }
.estado-corr .c-aprobada b { color: #16a34a; } .estado-corr .c-rechazada b { color: #dc2626; }
.estado.flash { box-shadow: 0 0 0 3px #22d3ee88; transition: box-shadow .3s; }
.cl .cl-act, .cl .cl-panel { background: rgba(255,255,255,.05); color: var(--text); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.cl .cl-panel select, .cl .cl-panel input, .cl .cl-panel textarea { background: rgba(255,255,255,.06); border: 1px solid var(--line); color: var(--text); }
.cl .cl-panel input[type=date] { color-scheme: dark; }
.cl .estado-corr .c-aprobada b { color: #5eead4; } .cl .estado-corr .c-rechazada b { color: #fca5a5; }

/* ---------- Panel del agente: tarjeta «Expediente {año}» (historial, correcciones, duplicados, unir) ---------- */
.xp-box h4 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.xp-year { font-size: .78rem; padding: 2px 8px; border-radius: 999px; background: #ede9fe; color: #5b21b6; font-weight: 700; }
.xp-acts { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.xp-sec { margin-top: 12px; }
.xp-sec > b { display: block; font-size: .86rem; margin-bottom: 6px; }
.xp-tl { list-style: none; margin: 0; padding: 0 0 0 4px; max-height: 300px; overflow: auto; }
.xp-tl li { position: relative; padding: 0 0 10px 18px; border-left: 2px solid #c4b5fd; margin-left: 5px; font-size: .88rem; }
.xp-tl li::before { content: ''; position: absolute; left: -6px; top: 3px; width: 10px; height: 10px; border-radius: 50%; background: #8b5cf6; }
.xp-tl li.new::before { background: #06b6d4; box-shadow: 0 0 0 3px #06b6d433; }
.xp-tl time, .xp-tl small { color: var(--muted, #667); font-size: .78rem; }
.xp-new { font-size: .7rem; font-weight: 700; color: #0e7490; background: #cffafe; border-radius: 6px; padding: 1px 6px; margin-left: 4px; }
.xp-corr, .xp-dup { border: 1px solid var(--line, #e5e7eb); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; font-size: .88rem; }
.xp-corr .mono { word-break: break-word; }
.xp-corr .xp-row, .xp-dup .xp-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.xp-dup { background: #fff7ed; border-color: #fdba74; }
.xp-warn { color: #9a3412; }
.xp-linkout { display: grid; gap: 6px; margin-top: 8px; padding: 10px; border-radius: 10px; background: #f5f3ff; border: 1px solid #ddd6fe; }
.xp-linkout input { width: 100%; font-family: ui-monospace, monospace; font-size: .8rem; }
.xp-merged { background: #fef3c7; border: 1px solid #fcd34d; border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; }
.nc-news { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 999px; background: #06b6d4; color: #fff; font-size: .7rem; font-weight: 700; line-height: 18px; text-align: center; margin-left: 4px; }
/* anillo de progreso del OCR dentro de la miniatura (solo CSS/SVG; liviano para teléfonos modestos) */
.ocr-ring { position: absolute; inset: 0; z-index: 2; display: grid; place-content: center; justify-items: center; gap: 2px; background: #070a1ab8; color: #eef1ff; pointer-events: none; transition: opacity .35s ease; }
.ocr-ring svg { width: 46px; height: 46px; transform: rotate(-90deg); grid-area: 1 / 1; }
.ocr-ring circle { fill: none; stroke-width: 3.2; }
.ocr-ring .tr { stroke: #ffffff26; }
.ocr-ring .fg { stroke: #4be3f2; stroke-linecap: round; stroke-dasharray: 100; transition: stroke-dashoffset .3s linear; }
body.panel .docs-grid button span.ocr-ring, body.panel .doc-tile span.ocr-ring, .doc-tile span.ocr-ring { display: grid; padding: 0; color: #eef1ff; }
.ocr-ring b { position: static; min-width: 0; height: auto; background: none; border-radius: 0; color: #fff; grid-area: 1 / 1; align-self: center; font-size: .72rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.ocr-ring small { display: block; padding: 0; font-size: .6rem; font-weight: 700; color: #b9f6ff; white-space: nowrap; }
.ocr-ring.ind svg { animation: ocr-spin 1s linear infinite; }
.ocr-ring.ind .fg { stroke-dasharray: 28 72; stroke-dashoffset: 0 !important; transition: none; }
.ocr-ring.out { opacity: 0; }
@keyframes ocr-spin { from { transform: rotate(-90deg); } to { transform: rotate(270deg); } }
.scan-badge.in { animation: ocr-in .35s ease both; }
@keyframes ocr-in { from { opacity: 0; transform: translateY(4px); } }
.scan-badge.err { color: #ffd79a; white-space: normal; line-height: 1.15; }
.doc-tile .ocr-ring svg, .docs-grid .ocr-ring svg { width: 56px; height: 56px; }
@media (prefers-reduced-motion: reduce) { .ocr-ring, .ocr-ring .fg, .scan-badge.in { transition: none !important; animation: none !important; } .ocr-ring.ind svg { animation: none !important; } }

/* ---------- Contabilidad profesional: ventana grande dentro del CRM (23-oct) ---------- */
.acc-launch { border:1px dashed var(--line); border-radius:12px; padding:18px; text-align:center; background:#fff; display:grid; gap:10px; justify-items:center; }
.acc-ws { position:fixed; inset:0; z-index:900; background:rgba(15,9,79,.38); display:none; padding:14px; }
.acc-ws.open { display:block; }
body.acc-ws-on { overflow:hidden; }
.acc-ws-card { background:var(--bg); border-radius:16px; height:100%; width:100%; max-width:1680px; margin:0 auto; display:flex; flex-direction:column; box-shadow:0 20px 60px rgba(15,9,79,.35); overflow:hidden; }
.acc-ws-h { display:flex; flex-wrap:wrap; gap:10px; justify-content:space-between; align-items:center; padding:12px 16px; background:#fff; border-bottom:1px solid var(--line); }
.acc-ws-h h3 { color:var(--navy); font-size:1.15rem; }
.acc-ws-h h3 span { color:var(--muted); font-weight:600; }
.acc-ws-h .tools { display:flex; gap:6px; flex-wrap:wrap; }
.acc-help { width:36px; font-weight:800; border-radius:50% !important; padding:0 !important; }
.acc-ws-b { flex:1; overflow:auto; padding:14px 16px 140px; }
.acc-card { background:#fff; border:1px solid var(--line); border-radius:14px; padding:12px 14px; margin-bottom:12px; box-shadow:var(--shadow); }
.acc-card-h { display:flex; justify-content:space-between; gap:8px; align-items:baseline; flex-wrap:wrap; }
.acc-card-h h4 { color:var(--navy); font-size:1rem; }
.acc-tip { font-size:.8rem; color:var(--muted); background:#F4F6FC; border-left:3px solid var(--navy-2); padding:5px 8px; border-radius:6px; margin:6px 0 8px; }
.acc-dl { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:8px 16px; }
.acc-dl .w { grid-column:1/-1; }
.acc-dl dt { font-size:.74rem; color:var(--muted); text-transform:uppercase; letter-spacing:.03em; }
.acc-dl dd { font-size:.92rem; color:var(--text); }
.acc-chip { display:inline-block; background:#EEF0FA; color:var(--navy); border-radius:999px; padding:2px 9px; margin:2px 4px 2px 0; font-size:.8rem; font-weight:600; }
.acc-kpis { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:8px; margin-bottom:10px; }
.acc-kpi { background:var(--field); border:1px solid var(--line); border-radius:12px; padding:8px 10px; display:flex; flex-direction:column; }
.acc-kpi small { color:var(--muted); font-size:.75rem; }
.acc-kpi b { font-size:1.25rem; color:var(--navy); font-variant-numeric:tabular-nums; }
.acc-kpi.ok b { color:var(--success); } .acc-kpi.owe b { color:var(--red); }
.acc-bars { display:grid; gap:4px; margin-bottom:6px; }
.acc-barrow { display:grid; grid-template-columns:minmax(120px,220px) 1fr 90px; gap:8px; align-items:center; font-size:.84rem; }
.acc-barrow i { display:block; height:10px; border-radius:5px; background:linear-gradient(90deg,var(--navy),var(--navy-2)); }
.acc-barrow b { text-align:right; font-variant-numeric:tabular-nums; }
.ok-text { color:var(--success); }
.acc-grid3 { display:grid; grid-template-columns:minmax(0,1.1fr) minmax(0,1fr) minmax(0,.9fr); gap:14px; align-items:start; }
@media (max-width: 1280px) { .acc-grid3 { grid-template-columns:minmax(0,1.15fr) minmax(0,1fr); } .acc-grid3 .acc-nex { grid-column:1/-1; } }
@media (max-width: 860px) { .acc-grid3 { grid-template-columns:1fr; } .acc-ws { padding:0; } .acc-ws-card { border-radius:0; } .acc-barrow { grid-template-columns:110px 1fr 80px; } }
.acc-form textarea, .acc-nex textarea { width:100%; padding:8px 10px; font:inherit; font-size:.9rem; border:1px solid var(--line); border-radius:10px; background:var(--field); resize:vertical; }
.acc-f1 { display:grid; gap:4px; font-size:.86rem; margin:8px 0; }
@media (min-width: 1281px) { .acc-nex { position:sticky; top:0; } }
.acc-nex-actions { margin-bottom:6px; }
.acc-nex-expl { font-size:.9rem; margin:10px 0 6px; line-height:1.45; }
.acc-cost { font-size:.78rem; color:var(--muted); margin-top:8px; border-top:1px dashed var(--line); padding-top:6px; }
.acc-prop tr.sub td { font-size:.8rem; color:var(--muted); padding-left:22px; }
.acc-tour-hl { position:relative; z-index:2; box-shadow:0 0 0 4px var(--red-2), 0 0 0 9999px rgba(15,9,79,.45) !important; border-radius:12px; }
.acc-tour-tip { position:fixed; z-index:950; max-width:340px; background:#fff; border-radius:14px; padding:12px 14px; box-shadow:0 12px 40px rgba(15,9,79,.4); display:grid; gap:6px; }
.acc-tour-tip strong { color:var(--navy); }
.acc-tour-tip p { font-size:.88rem; }
.acc-tour-tip div { display:flex; gap:6px; justify-content:flex-end; flex-wrap:wrap; }
@media print {
  body.acc-printing > *:not(.acc-ws) { display:none !important; }
  body.acc-printing .acc-ws { position:static; background:none; padding:0; display:block; }
  body.acc-printing .acc-ws-card { box-shadow:none; height:auto; }
  body.acc-printing .acc-ws-b { overflow:visible; padding:0; }
  body.acc-printing .tools, body.acc-printing .acc-form > details:not([data-tour=notas]), body.acc-printing .acc-nex, body.acc-printing .acc-tip, body.acc-printing .seg, body.acc-printing .ia-fab { display:none !important; }
  body.acc-printing .acc-grid3 { display:block; }
  body.acc-printing .acc-card, body.acc-printing .acc-res { box-shadow:none; break-inside:avoid; }
}

/* Plan normal: sin NEX (Workers AI) */
body.plan-normal .pfab-ia, body.plan-normal #rp-t-ia, body.plan-normal #rp-ia, body.plan-normal .ia-fab { display:none !important; }
.acc-pro { background:linear-gradient(135deg,#fff,#F4F3FF); }
.nex-h { margin:14px 0 6px; color:var(--navy); font-size:1rem; }
.nex-cap { display:inline-block; width:90px; height:8px; border-radius:4px; background:#EEF0F6; vertical-align:middle; overflow:hidden; }
.nex-cap i { display:block; height:100%; background:var(--success); } .nex-cap i.mid { background:var(--warning); } .nex-cap i.hi { background:var(--red); }
.nex-t td:nth-child(n+2) { font-variant-numeric:tabular-nums; }
.acc-xb { float:right; border:1px solid var(--line); background:#F4F3FF; color:var(--navy-2); border-radius:999px; font-size:.74rem; font-weight:700; padding:2px 10px; cursor:pointer; }
.acc-card-h .acc-xb { float:none; }
.acc-tutor { background:#F4F6FC; border:1px solid var(--line); border-radius:10px; padding:10px 12px; margin-top:10px; font-size:.88rem; line-height:1.5; }
.acc-tutor strong { color:var(--navy); display:block; margin-bottom:4px; }
.acc-helpwrap { position:relative; }
.acc-helpmenu { position:absolute; right:0; top:110%; background:#fff; border:1px solid var(--line); border-radius:10px; box-shadow:var(--shadow); display:grid; z-index:5; min-width:210px; overflow:hidden; }
.acc-helpmenu[hidden] { display:none; }
.acc-helpmenu button { border:0; background:none; text-align:left; padding:9px 12px; font:inherit; font-size:.88rem; cursor:pointer; }
.acc-helpmenu button:hover { background:#F4F6FC; }
@media print { body.acc-printing .acc-xb { display:none !important; } }

/* Documentos: arrastrar y soltar */
.dd-zone { margin:10px 0; border:2px dashed var(--line); border-radius:14px; padding:16px; text-align:center; background:#FAFBFE; cursor:pointer; display:grid; gap:4px; color:var(--text); transition:border-color .15s, background .15s; }
.dd-zone b { color:var(--navy); } .dd-zone small { color:var(--muted); font-size:.78rem; }
.dd-zone:hover, .dd-zone:focus-visible, .dd-zone.over { border-color:var(--navy-2); background:#EEF0FA; outline:none; }
.dd-prog { margin:6px 0 10px; display:grid; gap:4px; font-size:.85rem; color:var(--muted); }
.dd-bar { height:8px; border-radius:4px; background:#EEF0F6; overflow:hidden; } .dd-bar i { display:block; height:100%; width:0; background:linear-gradient(90deg,var(--navy),var(--navy-2)); transition:width .25s; }

/* NEX en Contabilidad: persona «tutor contable» */
.acc-nex { border-color:rgba(22,200,238,.45); background:linear-gradient(180deg,#F2FBFE,#fff 120px); }
.nex-persona { display:flex; gap:10px; align-items:center; margin-bottom:4px; }
.nex-persona h4 { color:#0B5E73; font-size:1rem; } .nex-persona small { color:var(--muted); font-size:.78rem; }
.nex-av { width:38px; height:38px; border-radius:50%; display:grid; place-items:center; font-weight:800; color:#fff; background:radial-gradient(circle at 30% 30%,#7DE6FA,#16C8EE 45%,#0F094F); box-shadow:0 0 0 3px rgba(22,200,238,.25), 0 6px 16px rgba(22,200,238,.35); flex:none; }
.acc-nex .btn-primary { background:linear-gradient(90deg,#0F094F,#0B8FB0); border-color:transparent; }
.nex-steps { margin-top:10px; border:1px solid rgba(22,200,238,.45); border-radius:12px; background:#F2FBFE; padding:10px 12px; }
.nex-steps-h { display:flex; justify-content:space-between; gap:8px; align-items:baseline; } .nex-steps-h strong { color:#0B5E73; } .nex-steps-h small { color:var(--muted); }
.nex-steps p { margin:6px 0 8px; font-size:.92rem; line-height:1.5; min-height:3em; }
.nex-steps-b { display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.nex-hl { position:relative; z-index:2; border-radius:10px; box-shadow:0 0 0 3px #16C8EE, 0 0 0 7px rgba(22,200,238,.25), 0 8px 24px rgba(22,200,238,.3) !important; background:#F2FBFE; transition:box-shadow .2s; }

/* ===================== Intake 2026 del cliente: Sí/No grandes, bloques cortos y escáner protagonista (solo body.cl) ===================== */
.cl .ssn-note { margin: 0 0 14px; padding: 12px 14px; border-radius: 14px; background: #ffd79a1a; border: 1.5px solid #ffd79a88; color: #ffe9c4; font-size: .98rem; line-height: 1.4; }
.cl .ssn-note b { color: #fff3dc; }
.cl .tip { color: #e4e8ff; background: #4be3f214; border: 1px solid #4be3f244; border-radius: 12px; padding: 10px 12px; }
.cl .sub-h { font-size: 1rem; color: #e4dcff; margin: 18px 0 8px; }
.cl .q { margin: 0 0 12px; padding: 12px; border-radius: 16px; background: rgba(255,255,255,.035); border: 1px solid var(--line); transition: border-color .2s; }
.cl .q.ans { border-color: #9a72ff66; }
.cl .q .q { background: rgba(255,255,255,.03); margin-bottom: 10px; }
.cl .q-t { font-size: 1.02rem; font-weight: 650; color: #f4f6ff; margin: 0 0 10px; line-height: 1.35; }
.cl .q-t small { font-weight: 400; color: var(--muted); }
.cl .yn { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cl .yn-b, .cl .choice label { position: relative; display: grid; place-items: center; min-height: 54px; border-radius: 14px; border: 1.5px solid var(--line); background: rgba(255,255,255,.05); font-weight: 800; font-size: 1.08rem; cursor: pointer; user-select: none; transition: background .15s, border-color .15s, transform .1s; }
.cl .yn-b input, .cl .choice input { position: absolute; opacity: 0; pointer-events: none; }
.cl .yn-b:active, .cl .choice label:active { transform: scale(.98); }
.cl .yn-b:has(input:focus-visible), .cl .choice label:has(input:focus-visible) { outline: 3px solid #4be3f2; outline-offset: 2px; }
.cl .yn-b.yes:has(input:checked) { background: #56e39f2b; border-color: #56e39f; color: #d4ffe8; }
.cl .yn-b.no:has(input:checked) { background: #ffffff1c; border-color: #cfd6ff; color: #fff; }
.cl .yn-b:has(input:checked) span::before { content: '✓ '; }
.cl .more { margin-top: 12px; padding: 12px 0 0 12px; border-left: 3px solid #9a72ff88; animation: stepIn .22s ease both; }
.cl .more[hidden] { display: none; }
.cl .choice { border: 0; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.cl .choice legend { font-size: .95rem; font-weight: 650; color: #f4f6ff; margin-bottom: 8px; padding: 0; }
.cl .choice label { font-size: 1rem; font-weight: 700; padding: 8px; text-align: center; }
.cl .choice label:has(input:checked) { background: #9365ff2e; border-color: #9a72ff; color: #fff; box-shadow: inset 0 0 0 1px #9a72ff; }
.cl .choice-4 { grid-template-columns: 1fr 1fr; }
.cl .blk { margin: 0 0 18px; }
.cl .blk::before { content: attr(data-s); display: block; font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #8ff3fb; margin: 0 0 8px 2px; }
.cl .blk .checks { margin-top: 4px; }
.cl .dep-chk { display: flex; gap: 8px; align-items: center; font-size: .9rem; color: var(--text); min-height: 40px; }
.cl .dep-chk input { width: 22px; height: 22px; padding: 0; margin: 0; accent-color: #9365ff; flex-shrink: 0; }
.cl .cert { margin: 14px 0 6px; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid var(--line); font-size: .93rem; line-height: 1.45; }
.cl .cert ul { margin: 6px 0 8px; padding-left: 20px; display: grid; gap: 4px; }
.cl .cert details summary, .cl .x-alt summary { cursor: pointer; color: #8ff3fb; font-weight: 600; padding: 6px 0; }
.cl .cert details p { color: #cfd6ff; font-size: .85rem; margin: 6px 0; }
.cl .warn-t { color: #ffd79a; font-weight: 400; }
.cl .sum-edit { justify-self: start; margin-top: 6px; background: none; border: 0; color: #8ff3fb; font: inherit; font-weight: 700; cursor: pointer; padding: 6px 0; }
/* Escáner protagonista: botón gigante, borde animado suave, instrucción de 1 línea */
.scan-hero { margin: 0 0 14px; }
.scan-cta.scan-big { position: relative; display: grid; justify-items: center; text-align: center; gap: 8px; padding: 26px 18px 22px; min-height: 210px; align-content: center; border-radius: 24px; margin: 0;
  background: radial-gradient(420px 200px at 50% 0, #9365ff66, transparent 70%), linear-gradient(160deg, #1a1f45, #0b0f24); box-shadow: 0 18px 40px -16px #6b46ff, 0 0 0 2px #4be3f2 inset; animation: scanPulse 2.4s ease-in-out infinite; }
.scan-cta.scan-big .scan-logo { width: 84px; height: 84px; border-radius: 24px; }
.scan-cta.scan-big .scan-logo svg { width: 48px; height: 48px; }
.scan-cta.scan-big .scan-big-t { font-size: 1.45rem; font-weight: 900; color: #fff; letter-spacing: .01em; }
.scan-cta.scan-big .scan-big-s { font-size: 1.05rem; color: #bff7fc; font-weight: 600; }
.scan-cta.scan-big:hover, .scan-cta.scan-big:focus-visible { transform: translateY(-2px); box-shadow: 0 22px 48px -14px #6b46ff, 0 0 0 3px #4be3f2 inset; outline: none; }
.scan-cta.scan-big:active { transform: scale(.985); }
@keyframes scanPulse { 0%, 100% { box-shadow: 0 18px 40px -16px #6b46ff, 0 0 0 2px #4be3f2 inset, 0 0 0 0 #4be3f255; } 50% { box-shadow: 0 18px 40px -16px #6b46ff, 0 0 0 2px #4be3f2 inset, 0 0 0 10px #4be3f200; } }
.scan-steps { list-style: none; padding: 0; margin: 12px 0 6px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; font-size: .86rem; color: #e4e8ff; text-align: center; }
.scan-steps b { display: grid; place-items: center; width: 26px; height: 26px; margin: 0 auto 4px; border-radius: 50%; background: linear-gradient(135deg, #9a72ff, #4ddde9); color: #0a1021; font-weight: 900; }
.scan-what { text-align: center; }
.scan-fallback { display: block; text-align: center; margin-top: 10px; font-size: .9rem; color: #ffd79a; cursor: pointer; }
.scan-fallback[hidden] { display: none; }
.step.scan-direct-only .scan-cta.scan-big,
.step.scan-direct-only .scan-steps,
.step.scan-direct-only .scan-what { display: none; }

.cl .cl-panel .scan-cta.scan-big { min-height: 170px; margin: 10px 0; }
.cl .x-alt { margin: 6px 0 10px; font-size: .9rem; }
.cl .x-alt[open] { display: grid; gap: 8px; }
@media (prefers-reduced-motion: reduce) { .scan-cta.scan-big, .cl .more { animation: none; } }
/* panel: respuestas del intake */
.intake summary { cursor: pointer; font-weight: 600; }
.intake .in-sec { margin: 8px 0; } .intake .in-sec ul { margin: 4px 0 0; padding-left: 18px; font-size: .88rem; }
.intake .in-yes { color: #0f8a4f; } body.panel .intake .in-yes { color: #22c55e; }


/* ===== Dirección estilo USA (cliente) ===== */
.addr-usa { border: 0; margin: 0 0 14px; padding: 0; }
.addr-usa legend { font-weight: 700; font-size: 1rem; margin-bottom: 4px; padding: 0; }
.addr-usa .addr-hint { margin: 0 0 10px; }
.addr-usa select { width: 100%; }
.cl .addr-usa legend { color: #f4f6ff; }
.cl .addr-usa .addr-hint { color: #a3aed0; }

/* ================= Panel de administración (09-nov-2026): modo escritorio con menú lateral ================= */
body.adm { background: #F4F6FA; }
body.adm::before { display: none; }
.adm .d-block { display: block; }
.pill.warn2 { background: #FEF3C7; color: #92400E; }
.pill.info { background: #e8eaf1; color: #5c6178; }
.adm-side-foot .pill.info { background: rgba(255,255,255,.12); color: #c5c9d8; }
#usr-sub { margin-left: 0; }
.link-btn { background: none; border: 0; color: var(--accent); font: inherit; font-size: .82rem; cursor: pointer; text-decoration: underline; padding: 2px 4px; }
.adm-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.adm-side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--navy); color: #E6E8F5; display: flex; flex-direction: column; padding: 18px 14px; gap: 14px; }
.adm-brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 12px; border-bottom: 1px solid rgba(255,255,255,.12); }
.adm-brand img { width: 40px; height: 48px; object-fit: contain; background: #fff; border-radius: 8px; padding: 3px; }
.adm-brand b { display: block; font-size: .95rem; color: #fff; letter-spacing: .02em; }
.adm-brand small { color: #B9BEDD; font-size: .76rem; }
.adm-nav { display: flex; flex-direction: column; gap: 2px; }
.adm-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: #DCDFF2; text-decoration: none; font-weight: 600; font-size: .93rem; }
.adm-nav a .ic { width: 20px; text-align: center; opacity: .85; }
.adm-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.adm-nav a[aria-current="page"] { background: #fff; color: var(--navy); box-shadow: inset 3px 0 0 var(--red); }
.adm-nav a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.adm-side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; font-size: .82rem; border-top: 1px solid rgba(255,255,255,.12); padding-top: 12px; }
.adm-side-foot a { color: #fff; }
.adm-side-foot b { color: #fff; word-break: break-all; }
.adm-main { padding: 26px 32px 30px; min-width: 0; }
.adm-main > section { max-width: 1480px; }
.adm-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.adm-head h1 { font-size: 1.45rem; color: var(--navy); font-weight: 800; }
.adm .card { margin-bottom: 16px; }
.adm .card h2 { font-size: 1.05rem; color: var(--navy); }
.adm-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.adm-kpi { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); }
.adm-kpi b { font-size: 1.6rem; color: var(--navy); line-height: 1.2; }
.adm-kpi small { color: var(--muted); font-size: .8rem; }
.adm-kpi.warn { border-color: rgba(180,35,24,.35); } .adm-kpi.warn b { color: var(--danger); }
.adm-kpi.warn2 b { color: #B45309; } .adm-kpi.ok b { color: var(--success); }
.adm-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.adm-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.adm-table th { position: sticky; top: 0; background: #F7F8FC; text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.adm-table td { padding: 10px 12px; border-bottom: 1px solid #EDF0F6; vertical-align: middle; }
.adm-table tbody tr:hover { background: #FAFBFE; }
.adm-table tr:last-child td { border-bottom: 0; }
.adm-table .r { text-align: right; }
.adm-table select, .adm-table input[type=date] { padding: 6px 8px; font-size: .85rem; min-width: 140px; margin: 0; }
.adm-table .tools { display: inline-flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.adm-table tr.void td { color: var(--muted); text-decoration: line-through; }
.adm-table tr.void td small { text-decoration: none; }
.exp-cell { display: inline-flex; align-items: center; gap: 4px; }
.adm-search { max-width: 280px; margin: 0; }
.adm-toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.adm-toolbar select { max-width: 280px; margin: 0; }
.adm-bulk { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; padding: 10px 12px; background: #EEF0FA; border-radius: 12px; margin-bottom: 10px; }
.adm-bulk label { display: flex; flex-direction: column; font-size: .78rem; color: var(--muted); gap: 3px; }
.adm-bulk select { margin: 0; min-width: 200px; }
.adm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 14px; align-items: end; }
.adm-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.adm label, .adm .lbl { display: block; font-size: .82rem; color: var(--muted); font-weight: 600; }
.adm label > input:not([type=checkbox]), .adm label > select, .adm .lbl > input { margin-top: 4px; }
.adm label.acc-check { display: flex; align-items: center; gap: 8px; color: var(--text); }
.adm dialog label, .adm dialog .lbl { margin-bottom: 10px; }
.adm-dlg { border: 0; border-radius: 16px; padding: 20px 22px; width: min(980px, calc(100vw - 24px)); max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 30px 80px -20px rgba(15,9,79,.45); }
.adm-dlg.sm { width: min(520px, calc(100vw - 24px)); }
.adm-dlg::backdrop { background: rgba(10,8,40,.45); }
.adm-dlg h3 { font-size: .9rem; color: var(--navy); margin: 12px 0 8px; text-transform: uppercase; letter-spacing: .05em; }
.of-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.of-color { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.of-color input[type=color] { width: 54px; height: 38px; padding: 2px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.of-prev { --of: #0F094F; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.of-prev-bar { display: flex; align-items: center; gap: 10px; background: var(--of); color: #fff; padding: 10px 12px; }
.of-prev-bar img { width: 40px; height: 40px; object-fit: contain; background: #fff; border-radius: 8px; padding: 3px; }
.of-prev-bar small { display: block; opacity: .8; font-size: .75rem; }
.of-prev-body { padding: 14px; background: #F7F8FC; }
.of-prev-btn { display: inline-block; background: var(--of); color: #fff; border-radius: 10px; padding: 8px 14px; font-weight: 700; font-size: .85rem; }
.of-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.of-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.of-card.off { opacity: .7; }
.of-card-top { --of: #0F094F; background: var(--of); color: #fff; display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.of-card-top img { width: 42px; height: 42px; object-fit: contain; background: #fff; border-radius: 8px; padding: 3px; }
.of-card-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; font-size: .88rem; }
.of-card-body .tools { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.audit-wrap.tall { max-height: 70vh; }
.adm .site-foot { margin-top: 24px; }
/* tablet / teléfono: el menú lateral pasa a barra superior desplazable */
@media (max-width: 960px) {
  .adm-shell { grid-template-columns: 1fr; }
  .adm-side { position: sticky; top: 0; z-index: 50; height: auto; flex-direction: column; padding: 10px 12px; gap: 8px; }
  .adm-brand { padding: 0 0 6px; border: 0; }
  .adm-nav { flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 4px; scrollbar-width: none; }
  .adm-nav a { white-space: nowrap; padding: 8px 10px; font-size: .85rem; }
  .adm-nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--red); }
  .adm-side-foot { flex-direction: row; flex-wrap: wrap; align-items: center; margin: 0; padding-top: 6px; gap: 6px 12px; }
  .adm-main { padding: 16px 12px 24px; }
  .of-edit { grid-template-columns: 1fr; gap: 0; }
  .adm-table { font-size: .84rem; }
}
@media (max-width: 560px) {
  .adm-side-foot small, .adm-side-foot #mail-status { display: none; }
  .adm-head h1 { font-size: 1.2rem; }
  .adm-grid2 { grid-template-columns: 1fr; }
}
/* marca de oficina: logos de proporciones distintas */
img.logo, img.login-logo, .pbrand img { object-fit: contain; }
body.adm.signed #login-wrap { display: none; }
.adm-dlg { margin: auto; }
.adm-table .tools { flex-wrap: nowrap; }
.adm-table .btn-sm { padding: 6px 10px; font-size: .8rem; white-space: nowrap; }
.adm input[type=search] { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--field); font: inherit; font-size: .9rem; color: var(--text); }
.adm-side-foot .pill { white-space: normal; display: inline-block; }
.adm-cols { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
@media (max-width: 560px) { .adm-cols { grid-template-columns: 1fr; } }
#usr-table .tools { flex-wrap: wrap; min-width: 210px; }
#usr-table td:first-child { min-width: 170px; }
#usr-table td:nth-child(6) { font-size: .8rem; color: var(--muted); }

/* ===== Negocios (13-nov-2026): formulario del negocio + panel Negocios/1099-NEC ===== */
.biz .biz-conf { margin-bottom: 12px; }
.biz .card h3 { display: flex; align-items: center; gap: 8px; justify-content: space-between; font-size: 1rem; margin-bottom: 8px; }
.biz .biz-owner, .biz .biz-ben { box-shadow: none; }
.biz-h3 { margin: 18px 0 8px; font-size: 1rem; color: var(--navy); }
.biz-up { border: 1px dashed var(--line); border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.biz-up-h { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.biz-up-b { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.biz-file { cursor: pointer; }
.biz-pdf { aspect-ratio: 1; display: grid; place-items: center; font-weight: 800; color: var(--red); background: #fff; }
.biz-exp { display: grid; grid-template-columns: 1fr 112px 36px; gap: 6px; margin-bottom: 6px; align-items: center; }
.biz-exp input { margin: 0; }
.biz-exp-h { font-size: .78rem; color: var(--muted); }
.biz-x { width: 36px; height: 40px; border-radius: 8px; border: 1px solid var(--line); background: var(--field); font-size: 1.2rem; cursor: pointer; color: inherit; }
.biz-total { text-align: right; margin-top: 10px; font-size: 1.02rem; }
.biz .cert { margin: 12px 0; font-size: .86rem; line-height: 1.45; white-space: pre-line; }
.biz .sig-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; gap: 8px; }
.biz details summary { cursor: pointer; margin: 14px 0 6px; font-weight: 700; }
.biz-add { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.biz .choice label { display: inline-flex; align-items: center; gap: 6px; margin: 4px 14px 4px 0; }
.negp .neg-tabs { display: flex; gap: 8px; margin: 14px 0; flex-wrap: wrap; }
.neg-tab { padding: 10px 16px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); color: inherit; font-weight: 700; cursor: pointer; }
.neg-tab.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.neg-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: space-between; margin: 8px 0; }
.neg-row h2 { margin: 0; }
.neg-new { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.neg-new input[type=text] { flex: 1 1 260px; margin: 0; }
.neg-new select { width: auto; margin: 0; }
.neg-chk { display: inline-flex; gap: 6px; align-items: center; font-size: .88rem; }
.neg-chk input { width: auto; margin: 0; }
.neg-linkout { margin-top: 12px; padding: 12px; border-radius: 10px; background: var(--field); border: 1px solid var(--line); }
.neg-linkout input { width: 100%; }
.neg-pend { margin-top: 12px; }
.neg-list { display: grid; gap: 8px; margin-top: 10px; }
.neg-item { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: inherit; text-align: left; width: 100%; font: inherit; }
button.neg-item { cursor: pointer; }
.neg-item.sel { outline: 2px solid var(--navy); }
.neg-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-start; }
.neg-detail h3 { margin: 18px 0 8px; font-size: 1rem; }
.neg-kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px 14px; padding: 10px 12px; background: var(--field); border-radius: 10px; border: 1px solid var(--line); margin-bottom: 8px; }
.neg-kv div { display: grid; }
.neg-kv span { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.neg-kv b { font-weight: 600; overflow-wrap: anywhere; }
.neg-docs { display: flex; gap: 6px; flex-wrap: wrap; }
.neg-tbl { width: 100%; border-collapse: collapse; font-size: .88rem; margin: 6px 0 10px; }
.neg-tbl th, .neg-tbl td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.neg-tbl tfoot th { border-top: 2px solid var(--navy); }
.neg-tbl tr.neg-below td { color: var(--muted); }
.neg-tbl td .pill { margin-left: 6px; }

.neg-sigs { display: flex; gap: 12px; flex-wrap: wrap; }
.neg-sigs img { max-width: 260px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.neg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 12px; margin: 6px 0; align-items: end; }
.neg-f { display: grid; gap: 3px; font-size: .8rem; }
.neg-f span { color: var(--muted); }
.neg-f input, .neg-f select { margin: 0; }
.neg-addr { display: grid; grid-template-columns: 2fr 1fr 1.4fr 90px 110px; gap: 6px; margin: 6px 0; }
.neg-addr input, .neg-addr select { margin: 0; }
.neg-party { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.neg-party legend { font-weight: 800; padding: 0 6px; color: var(--navy); }
.neg-fset { border: 0; padding: 0; margin: 0; }
.neg-check p { margin: 4px 0; }
.neg-e { color: var(--danger); }
.neg-w { color: #9a6700; }
.neg-warn { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: rgba(157,21,20,.07); border: 1px solid rgba(157,21,20,.25); }
.neg-rules ul { margin: 6px 0 6px 18px; font-size: .88rem; }
.neg-thr b { font-size: 1.15rem; }
.neg-bulk { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
@media (max-width: 640px) { .neg-addr { grid-template-columns: 1fr 1fr; } .neg-addr input:first-child { grid-column: 1 / -1; } }
.biz .stepper li { min-width: 0; font-size: .6rem; overflow-wrap: anywhere; }
.biz .app { overflow-x: clip; }
.negp .neg-f input, .negp .neg-f select, .negp .neg-addr input, .negp .neg-addr select, .negp .neg-new input, .negp .neg-new select, .negp #nq, .negp .neg-linkout input { box-sizing: border-box; height: 40px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: .9rem; width: 100%; background: #fff; color: inherit; }
.negp .neg-new select { width: auto; }
.negp #nq { max-width: 320px; }
.negp #nd, .negp #fe { scroll-margin-top: 80px; }
.negp .neg-chk input[type=checkbox], .negp td input[type=checkbox] { width: 18px !important; height: 18px !important; min-height: 0; padding: 0; flex: 0 0 auto; accent-color: var(--navy); }
.negp .neg-chk { white-space: nowrap; }

/* 13-nov-2026: categorías de cliente (tipo + años fiscales) */
.cat-flt { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 8px; }
.cat-sel { display: flex; flex-direction: column; gap: 2px; font-size: .74rem; color: var(--p-muted, #667); font-weight: 600; }
.cat-sel select { min-height: 36px; padding: 4px 8px; border: 1px solid #d5dbe5; border-radius: 10px; background: #fff; font: inherit; font-size: .85rem; color: inherit; }
.ct-badge { display: inline-block; font-size: .72rem; padding: 2px 8px; border-radius: 999px; font-weight: 700; vertical-align: 1px; }
.ct-personal { background: #e0f2fe; color: #075985; }
.ct-negocio { background: #fef3c7; color: #92400e; }
.ct-ambos { background: #dcfce7; color: #166534; }
.ct-sin { background: #f1f5f9; color: #64748b; }
.yr-badges { display: inline-flex; gap: 4px; flex-wrap: wrap; margin-left: 4px; vertical-align: 1px; }
.yr-b { font-size: .72rem; padding: 1px 7px; border-radius: 999px; background: #ede9fe; color: #5b21b6; font-weight: 700; cursor: pointer; border: 1px solid transparent; }
.yr-b.on { background: #5b21b6; color: #fff; }
.yr-b.biz { background: #fff7ed; color: #9a3412; }
.yr-b.pend { border-style: dashed; border-color: #8b5cf6; }
.yr-b.pend:not(.on) { background: #fff; }
.yr-b.on.pend { border-color: #c4b5fd; }
.yr-tabs { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 4px 0 8px; }
.yr-tab { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 10px; border: 1px solid #d8d2f5; background: #faf8ff; color: #4c1d95; font-weight: 700; font-size: .82rem; text-decoration: none; cursor: pointer; }
.yr-tab.on { background: #5b21b6; color: #fff; border-color: #5b21b6; }
.yr-tab small { font-weight: 500; opacity: .85; }
.yr-tab.biz { border-color: #fed7aa; background: #fff7ed; color: #9a3412; }
.yr-tab.add { border-style: dashed; background: #fff; }
.xp-note { padding: 8px 10px; border-radius: 10px; background: #f5f3ff; color: #4c1d95; font-size: .84rem; margin: 6px 0; }
.xp-note.hist { background: #f8fafc; color: #475569; }
.ct-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.ct-row select { min-height: 34px; border-radius: 9px; border: 1px solid #d5dbe5; padding: 3px 8px; font: inherit; font-size: .85rem; }
.pre-note { background: #f5f3ff; border-color: #c4b5fd; }
.cc-cats { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 2px 0 1px; }
.cc-cats .yr-badges { margin-left: 0; }
.ct-row select { width: auto; max-width: 100%; flex: 0 1 auto; }

/* ===== 20-nov-2026 · Panel admin premium: tablero, alertas, búsqueda global, modo oscuro ===== */
body.adm { --track: #E9ECF5; --spark-fill: rgba(157,21,20,.10); --navy-c: var(--navy); }
.adm-main { background: radial-gradient(1200px 400px at 80% -120px, rgba(15,9,79,.06), transparent 60%); }
.adm-sub { color: var(--muted); font-size: .86rem; margin-top: 2px; }
.adm-head .tools { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.panel-head .tools { display: inline-flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.panel-head .tools select { margin: 0; max-width: 200px; }
.adm-top { display: flex; align-items: center; gap: 10px; margin: -6px 0 18px; position: sticky; top: 0; z-index: 30; padding: 8px 0; backdrop-filter: blur(8px); }
.gs-wrap { position: relative; flex: 1; max-width: 640px; }
.gs-wrap input { margin: 0; padding-left: 38px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); border: 1px solid var(--line); height: 44px; width: 100%; }
.gs-ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 1.1rem; pointer-events: none; }
.gs-pop { position: absolute; left: 0; right: 0; top: 50px; max-height: 70vh; overflow: auto; padding: 8px; z-index: 60; box-shadow: 0 18px 50px rgba(15,9,79,.22); }
.gs-g h4 { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 8px 8px 4px; }
.gs-i { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 10px; text-decoration: none; color: var(--text); }
.gs-i:hover, .gs-i:focus-visible { background: var(--bg); }
.gs-i small { color: var(--muted); }
.gs-empty { padding: 10px; }
.theme-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); font-size: 1.15rem; color: var(--navy); }
.nav-badge { margin-left: auto; background: var(--red-2); color: #fff; font-size: .72rem; font-weight: 800; border-radius: 999px; padding: 1px 7px; min-width: 22px; text-align: center; }
.hero { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 16px; color: #fff; border: 0;
  background: linear-gradient(120deg, var(--navy) 0%, #241C86 58%, var(--red) 140%); box-shadow: 0 10px 30px rgba(15,9,79,.25); }
.hero small { color: rgba(255,255,255,.82); display: block; }
.hero-n { display: block; font-size: 2.6rem; line-height: 1.1; font-weight: 800; letter-spacing: -.02em; }
.hero-n span { font-size: 1rem; font-weight: 600; opacity: .85; }
.hero-r { display: flex; align-items: center; gap: 14px; }
.hero-r b { font-size: 1.2rem; }
.ring { --p: 0; width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(#fff calc(var(--p) * 1%), rgba(255,255,255,.18) 0); }
.ring span { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: #1A1470; font-weight: 800; }
.adm-kpi { transition: transform .18s var(--ease-out), box-shadow .18s; position: relative; overflow: hidden; }
.adm-kpi::after { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--navy), var(--red)); opacity: .7; }
.adm-kpi:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(15,9,79,.12); }
.dash-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.dash-card { margin: 0; }
.dash-card.wide { grid-column: span 2; }
.dash-card h2 { font-size: 1rem; color: var(--navy); margin-bottom: 12px; }
.donut { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.donut svg { width: 150px; height: 150px; flex: none; }
.donut circle { transition: stroke-dasharray .6s var(--ease-out); }
.dn-n { font-size: 22px; font-weight: 800; fill: var(--text); }
.dn-s { font-size: 9px; fill: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.legend { list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: .85rem; flex: 1; min-width: 150px; }
.legend.row { flex-direction: row; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend li b { margin-left: auto; }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: calc(var(--h) + 22px); }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.bar-stack { height: var(--h); width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.bar { display: block; width: 100%; max-width: 18px; min-height: 2px; border-radius: 5px 5px 2px 2px; transition: height .5s var(--ease-out); }
.bar-col small { font-size: .66rem; color: var(--muted); white-space: nowrap; }
.hbars { display: flex; flex-direction: column; gap: 10px; margin-bottom: 6px; }
.hb { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; font-size: .88rem; }
.hb-t { position: relative; height: 12px; background: var(--track); border-radius: 999px; overflow: hidden; }
.hb-t i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--navy-c); border-radius: 999px; opacity: .35; }
.hb-t i.ok { background: var(--success); opacity: 1; }
.spark { width: 100%; height: 70px; display: block; margin-bottom: 6px; }
.toplist { list-style: none; margin-top: 10px; display: flex; flex-direction: column; gap: 4px; font-size: .86rem; }
.toplist li { display: flex; justify-content: space-between; padding: 4px 8px; border-radius: 8px; background: var(--bg); }
.al-mini { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px; }
.al-mini li { display: grid; grid-template-columns: 10px 1fr; gap: 2px 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.al-mini li small { grid-column: 2; color: var(--muted); }
.lvl { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; grid-row: span 2; }
.lvl.alta { background: var(--danger); box-shadow: 0 0 0 4px rgba(180,35,24,.14); } .lvl.media { background: #D9822B; } .lvl.baja { background: #8A93AD; }
.pill.lvl-alta { background: #FDE8E7; color: var(--danger); } .pill.lvl-media { background: #FEF0DF; color: #9A4A00; } .pill.lvl-baja { background: #EEF0F5; color: #4A5168; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 4px 10px; font-size: .8rem; color: var(--text); }
button.chip:hover { border-color: var(--navy); }
@media (max-width: 1200px) { .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .dash-grid { grid-template-columns: 1fr; } .dash-card.wide { grid-column: auto; } .hero-n { font-size: 2rem; } .adm-top { position: static; } .bar-col small { font-size: .58rem; } .bars .bar-col:nth-child(odd) small { visibility: hidden; } }
/* modo oscuro */
body.adm.dark { --bg: #0B0A1F; --card: #15132E; --field: #1C1A3A; --line: #2C2A52; --text: #E8E9F6; --muted: #A1A6C4; --track: #26244A; --spark-fill: rgba(255,90,90,.14); --navy-c: #8F9BFF; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35); color-scheme: dark; }
body.adm.dark .adm-main { background: radial-gradient(1200px 400px at 80% -120px, rgba(120,110,255,.12), transparent 60%); }
body.adm.dark .card, body.adm.dark .adm-kpi, body.adm.dark .adm-dlg, body.adm.dark .of-card { background: var(--card); color: var(--text); border-color: var(--line); }
body.adm.dark .adm-head h1, body.adm.dark .dash-card h2, body.adm.dark .adm-kpi b, body.adm.dark .panel-head h2, body.adm.dark .card h2, body.adm.dark .adm-dlg h3, body.adm.dark .theme-btn { color: #EEF0FF; }
body.adm.dark .adm-table th, body.adm.dark .audit-table th { background: #1C1A3A; color: var(--muted); }
body.adm.dark .adm-table td, body.adm.dark .audit-table td { border-color: #24224A; }
body.adm.dark .adm-table tbody tr:hover { background: #1B1940; }
body.adm.dark input, body.adm.dark select, body.adm.dark textarea { background: var(--field); color: var(--text); border-color: var(--line); }
body.adm.dark a { color: #AEB7FF; }
body.adm.dark .btn-secondary { background: #221F48; color: #E8E9F6; border-color: #3A3770; }
body.adm.dark .adm-bulk { background: #1C1A3A; }
body.adm.dark .pill { background: #26244A; color: #D6D9F0; }
body.adm.dark .pill.ok { background: rgba(27,127,59,.25); color: #8FE3A9; } body.adm.dark .pill.warn, body.adm.dark .pill.lvl-alta { background: rgba(180,35,24,.28); color: #FFB4AC; } body.adm.dark .pill.warn2, body.adm.dark .pill.lvl-media { background: rgba(217,130,43,.25); color: #FFD19A; }
body.adm.dark .muted, body.adm.dark .hint { color: var(--muted); }
body.adm { background: var(--bg); }
body.adm.dark .tbl-wrap, body.adm.dark .client-card, body.adm.dark .audit-wrap { background: var(--card); border-color: var(--line); color: var(--text); }
body.adm.dark .adm-table td, body.adm.dark .audit-table td { color: var(--text); }
body.adm.dark .adm-top { background: transparent; }
#res-box .adm-cols .tbl-wrap { max-height: 340px; overflow: auto; }
#res-box { margin-top: 16px; }
#res-box .adm-kpis { display: none; } /* los indicadores clásicos se muestran dentro del tablero nuevo */
.adm-h2 { font-size: 1rem; color: var(--navy); margin: 22px 0 0; } body.adm.dark .adm-h2 { color: #EEF0FF; }
body.adm.dark .hero { background: linear-gradient(120deg, #1A1470 0%, #2A2196 58%, #9D1514 140%); border: 0; color: #fff; }
.gs-wrap input[type=search] { padding-left: 42px !important; }
body.adm.dark .adm-nav a { color: #DCDFF2; }
body.adm.dark .adm-nav a[aria-current="page"] { color: var(--navy); }
body.adm.dark .adm-side-foot a { color: #fff; }
/* 20-nov-2026: marca blanca de la oficina en el formulario del cliente */
.brand-welcome { margin: 0 0 14px; padding: 12px 16px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent, var(--red)); color: var(--text); white-space: pre-line; font-size: .95rem; box-shadow: var(--shadow); }
.brand-foot { text-align: center; color: var(--muted); font-size: .82rem; margin: 18px 12px 0; }
/* ===== 20-nov-2026 · Editor premium de oficinas (marca blanca) ===== */
.of-card-top { background: linear-gradient(120deg, var(--of) 0 70%, var(--of2, var(--of)) 140%); }
.of-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; text-align: center; }
.of-stats span { background: var(--bg); border-radius: 10px; padding: 6px 4px; font-size: .74rem; color: var(--muted); display: flex; flex-direction: column; }
.of-stats b { font-size: 1.05rem; color: var(--navy); }
.adm-dlg.of-dlg { width: min(1240px, calc(100vw - 20px)); padding: 0; }
.of-dlg-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); z-index: 3; }
.of-dlg-head .tools { display: flex; gap: 8px; }
.of-dlg-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.of-dlg-id img { width: 46px; height: 46px; object-fit: contain; border-radius: 10px; border: 1px solid var(--line); background: #fff; padding: 3px; }
.of-dlg-id h2 { font-size: 1.15rem; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.of-tabs { display: flex; gap: 4px; padding: 10px 20px 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.of-tabs button { border: 0; background: none; padding: 10px 14px; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.of-tabs button[aria-selected="true"] { color: var(--navy); border-bottom-color: var(--red); }
.of-tabs button:disabled { opacity: .45; cursor: not-allowed; }
#of-err { padding: 0 20px; }
.of-body { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 22px; padding: 16px 20px 22px; }
.of-panels h3:first-child { margin-top: 0; }
.of-panels label { display: block; }
.of-grid3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; }
.of-more { margin: 12px 0; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.of-more summary { cursor: pointer; font-weight: 700; color: var(--navy); }
.of-danger { margin-top: 16px; border: 1px dashed rgba(180,35,24,.45); border-radius: 12px; padding: 12px 14px; }
.of-danger .tools { display: flex; gap: 8px; flex-wrap: wrap; }
.of-logo-box { display: flex; gap: 14px; align-items: center; }
.of-logo-box img { width: 96px; height: 96px; object-fit: contain; border: 1px solid var(--line); border-radius: 14px; background: repeating-conic-gradient(#eef0f6 0 25%, #fff 0 50%) 0 0/16px 16px; padding: 6px; }
.of-logo-box > div { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.of-file { cursor: pointer; }
.of-crop { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); }
.of-crop-stage { background: repeating-conic-gradient(#e3e6ef 0 25%, #fff 0 50%) 0 0/18px 18px; border-radius: 10px; overflow: hidden; line-height: 0; outline: 2px dashed var(--red); outline-offset: -2px; }
.of-crop-stage canvas { cursor: grab; touch-action: none; max-width: 100%; }
.of-crop-ctl { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 8px; }
.of-crop-ctl .tools { display: flex; gap: 8px; flex-wrap: wrap; }
.of-colors { display: flex; flex-direction: column; gap: 10px; }
.of-color-pick { display: grid; grid-template-columns: 86px 54px 100px auto 1fr; align-items: center; gap: 10px; }
.of-color-pick span:first-child { font-weight: 700; }
.of-color-pick input[type=color] { width: 54px; height: 38px; padding: 2px; border-radius: 8px; border: 1px solid var(--line); margin: 0; }
.of-color-pick input[type=text] { margin: 0; font-family: ui-monospace, monospace; text-transform: uppercase; }
.of-swatches { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; }
.of-sw { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; padding: 0; background: none; }
.of-sw i { width: 22px; height: 22px; display: block; }
.of-sw:hover { box-shadow: 0 0 0 2px var(--navy); }
.of-add { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 12px; }
.of-add label { flex: 1; min-width: 160px; }
.of-add select, .of-add input { margin: 0; }
.of-ln-out { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; padding: 10px; background: #EEF8F1; border-radius: 12px; }
.of-ln-out input { flex: 1; min-width: 220px; margin: 0; }
/* vista previa en vivo */
.of-preview { --pv1: #0F094F; --pv2: #9D1514; position: sticky; top: 76px; align-self: start; display: flex; flex-direction: column; gap: 10px; }
.of-prev-tabs { display: flex; background: var(--bg); border-radius: 999px; padding: 3px; gap: 2px; }
.of-prev-tabs button { flex: 1; border: 0; background: none; border-radius: 999px; padding: 7px; font-weight: 700; font-size: .85rem; color: var(--muted); }
.of-prev-tabs button[aria-selected="true"] { background: var(--card); color: var(--navy); box-shadow: var(--shadow); }
.of-phone { border: 10px solid #15132E; border-radius: 34px; overflow: hidden; background: #F2F4F9; box-shadow: 0 16px 40px rgba(15,9,79,.25); max-height: 560px; overflow-y: auto; }
.of-phone.wide { border-width: 6px; border-radius: 16px; }
.pv-cl { padding: 0 0 14px; font-size: .82rem; color: #121633; background: #F2F4F9; }
.pv-cl::before { content: ''; display: block; height: 5px; background: linear-gradient(90deg, var(--pv1) 0 62%, var(--pv2) 62% 100%); }
.pv-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: #fff; border-bottom: 1px solid #D5DAE6; }
.pv-head img, .pv-bar img { width: 34px; height: 34px; object-fit: contain; border-radius: 8px; background: #fff; }
.pv-head b { display: block; color: var(--pv1); font-size: .95rem; }
.pv-head small { color: #5A6278; font-size: .7rem; }
.pv-badge { margin-left: auto; background: var(--pv2); color: #fff; border-radius: 999px; padding: 2px 8px; font-size: .68rem; font-weight: 700; }
.pv-welcome { margin: 10px 12px 0; padding: 8px 10px; background: #fff; border: 1px solid #D5DAE6; border-left: 4px solid var(--pv2); border-radius: 10px; white-space: pre-line; }
.pv-prog { margin: 12px 12px 2px; height: 6px; background: #E3E6EF; border-radius: 999px; overflow: hidden; } .pv-prog i { display: block; width: 18%; height: 100%; background: var(--pv1); }
.pv-step { margin: 0 12px; color: #5A6278; font-size: .7rem; }
.pv-card { margin: 10px 12px; background: #fff; border: 1px solid #D5DAE6; border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.pv-card label { font-size: .7rem; color: #5A6278; display: flex; flex-direction: column; gap: 3px; }
.pv-in { border: 1px solid #D5DAE6; border-radius: 8px; padding: 6px 8px; color: #121633; font-size: .8rem; background: #F8F9FC; }
.pv-btn { display: inline-block; align-self: flex-start; background: var(--pv1); color: #fff; border-radius: 10px; padding: 7px 14px; font-weight: 700; font-size: .78rem; }
.pv-foot { text-align: center; color: #5A6278; font-size: .68rem; margin: 6px 12px 0; }
.pv-panel { background: #F4F6FA; font-size: .8rem; color: #121633; }
.pv-bar { display: flex; align-items: center; gap: 8px; background: var(--pv1); color: #fff; padding: 10px 12px; box-shadow: inset 0 -3px 0 var(--pv2); }
.pv-bar small { margin-left: auto; opacity: .8; font-size: .7rem; }
.pv-pbody { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.pv-chip { align-self: flex-start; border-radius: 999px; padding: 2px 9px; font-size: .7rem; font-weight: 700; background: color-mix(in srgb, var(--pv1) 14%, #fff); color: var(--pv1); }
.pv-chip.alt { background: color-mix(in srgb, var(--pv2) 14%, #fff); color: var(--pv2); }
.pv-row { background: #fff; border: 1px solid #D5DAE6; border-left: 4px solid var(--pv1); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; }
.pv-row small { color: #5A6278; }
.pv-mail { background: #F2F4F9; padding: 10px; font-size: .8rem; color: #121633; }
.pv-mail-meta { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; color: #5A6278; }
.pv-mail-meta b { color: #121633; word-break: break-word; }
.pv-mail-card { background: #fff; border: 1px solid #D5DAE6; border-radius: 10px; overflow: hidden; text-align: center; display: flex; flex-direction: column; align-items: center; }
.pv-s1 { display: block; height: 6px; width: 100%; background: var(--pv1); } .pv-s2 { display: block; height: 3px; width: 100%; background: var(--pv2); }
.pv-mail-card img { width: 84px; height: 84px; object-fit: contain; margin: 14px 0 4px; }
.pv-mail-card h4 { color: var(--pv1); margin: 4px 0; }
.pv-mail-card p { color: #5A6278; margin: 0 12px 10px; }
.pv-mail-card .pv-btn { align-self: center; margin-bottom: 14px; }
.pv-mail-foot { width: 100%; background: var(--pv1); color: #C9CCE6; font-size: .7rem; padding: 8px; }
@media (max-width: 1000px) { .of-body { grid-template-columns: 1fr; } .of-preview { position: static; } .of-color-pick { grid-template-columns: 80px 50px 1fr; } .of-color-pick .acc-check, .of-color-pick .ctr { grid-column: span 1; } .of-grid3 { grid-template-columns: 1fr 1fr; } }
body.adm.dark .of-dlg-head { background: var(--card); }
body.adm.dark .of-ln-out { background: #16352A; }
body.adm.dark .of-stats span, body.adm.dark .of-crop { background: #1C1A3A; }
/* 20-nov-2026: marca de la oficina dentro del tema oscuro del cliente */
.cl.branded .header h1 { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; font-size: .98rem; letter-spacing: .03em; }
.cl.branded-color::before { background: linear-gradient(90deg, var(--b1), var(--b2)); }
.cl.branded-color { background: radial-gradient(900px 520px at 10% -10%, color-mix(in srgb, var(--b1) 38%, transparent), transparent 60%), radial-gradient(800px 500px at 110% 10%, color-mix(in srgb, var(--b2) 26%, transparent), transparent 55%), #0b0f24 fixed; }
.cl.branded-color .header .sub, .cl.branded-color .step-count, .cl.branded-color .step-head h2 .icon { color: color-mix(in srgb, var(--b2) 40%, #fff); }
.cl.branded-color .badge, .cl.branded-color .btn-primary, .cl.branded-color .stepper li.on::before { background: linear-gradient(135deg, color-mix(in srgb, var(--b1) 85%, #fff), color-mix(in srgb, var(--b2) 85%, #fff)); color: #fff; }
.cl.branded-color .btn-primary:hover { background: linear-gradient(135deg, var(--b1), var(--b2)); }
.cl.branded-color .progress-fill { background: linear-gradient(90deg, color-mix(in srgb, var(--b1) 70%, #fff), color-mix(in srgb, var(--b2) 70%, #fff)); }
.cl.branded-color .stepper li.on::before { box-shadow: 0 0 0 4px color-mix(in srgb, var(--b1) 30%, transparent); }
.cl.branded-color .stepper li.ok::before { background: color-mix(in srgb, var(--b2) 25%, transparent); border-color: var(--b2); color: #fff; }
.cl.branded-color .check:has(input:checked) { background: color-mix(in srgb, var(--b1) 22%, transparent); border-color: color-mix(in srgb, var(--b1) 60%, #fff); box-shadow: inset 3px 0 0 var(--b2); }
.cl.branded-color input:focus, .cl.branded-color select:focus, .cl.branded-color textarea:focus { border-color: color-mix(in srgb, var(--b1) 60%, #fff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--b1) 35%, transparent); }
.cl.branded-color .logo { filter: drop-shadow(0 6px 16px color-mix(in srgb, var(--b1) 50%, transparent)); }
.cl .brand-welcome { background: var(--card); border-color: var(--line); border-left-color: var(--b2, #4be3f2); color: var(--text); }
.of-panels textarea { width: 100%; display: block; }
/* 20-nov-2026: marca de la oficina en el panel del agente (body.panel define su propia paleta) */
body.panel.branded-color { --p-blue: var(--b1); --p-blue5: var(--b1); --p-teal: var(--b2); --p-800: color-mix(in srgb, var(--b1) 80%, #000); --p-grad: linear-gradient(120deg, var(--b1) 0%, var(--b2) 100%); --navy: var(--b1); --primary: var(--b1); --accent: var(--b2); }
/* 20-nov: «Mi perfil» en el panel de agente (botón en la ficha de sesión) */
.who-btn { border: 1px solid transparent; cursor: pointer; font: inherit; }
.who-btn:hover, .who-btn:focus-visible { border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.12); outline: none; }
.perfil-dlg { max-width: 440px; width: calc(100% - 32px); }
.perfil-dlg .pf-l { display: block; font-size: .85rem; font-weight: 600; margin: 10px 0 0; }
.perfil-dlg .pf-l input { display: block; width: 100%; margin-top: 4px; padding: 9px 11px; border: 1px solid #cdd6e1; border-radius: 10px; font: inherit; }
.perfil-dlg .pf-pw { margin-top: 12px; } .perfil-dlg .pf-pw summary { cursor: pointer; font-weight: 600; font-size: .88rem; }
.perfil-dlg #pf-meta { margin: 4px 0 6px; }

/* ===== 20-nov-2026: Agenda del preparador (Hoy, tareas, citas, facturas, WhatsApp) + ficha + seguimiento público ===== */
.agp .app.wide { max-width: 1280px; }
.ag-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0; position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 6px 0; }
.ag-tabs button { border: 1px solid var(--line); background: #fff; color: var(--navy); border-radius: 999px; padding: 8px 16px; font-weight: 700; cursor: pointer; }
.ag-tabs button[aria-selected="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.ag-hello h1 { margin: 4px 0 2px; color: var(--navy); font-size: 1.5rem; text-transform: none; }
.ag-hello h1::first-letter { text-transform: uppercase; }
.ag-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }
.ag-kpi { display: flex; flex-direction: column; gap: 2px; text-align: left; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--navy); border-radius: 12px; padding: 12px 14px; cursor: pointer; font: inherit; }
.ag-kpi b { font-size: 1.6rem; color: var(--navy); line-height: 1.1; } .ag-kpi small { color: var(--muted); font-weight: 600; }
.ag-kpi.k-bad { border-left-color: #d63b3b; } .ag-kpi.k-bad b { color: #c02828; } .ag-kpi.k-cit { border-left-color: #1f9d6b; } .ag-kpi.k-doc { border-left-color: #e0a100; } .ag-kpi.k-tar { border-left-color: #3b6fd6; }
.ag-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 12px; align-items: start; }
.ag-cal-grid { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
@media (max-width: 900px) { .ag-grid, .ag-cal-grid { grid-template-columns: 1fr; } }
.ag-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; } .ag-h h2 { margin: 0; flex: 1; font-size: 1.1rem; }
.ag-sub { font-size: .95rem; color: var(--navy); margin: 14px 0 6px; }
.ag-row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); flex-wrap: wrap; } .ag-row > div:first-child { flex: 1; min-width: 200px; }
.ag-row.off { opacity: .55; } .ag-row .hint { margin: 2px 0 0; }
.ag-row > div.ag-time { flex: 0 0 84px; min-width: 84px; } .ag-appt .ag-time { min-width: 76px; font-weight: 800; color: var(--navy); display: flex; flex-direction: column; } .ag-appt .ag-time small { color: var(--muted); font-weight: 600; }
.ag-main { flex: 1; min-width: 180px; } .ag-acts { display: flex; gap: 10px; flex-wrap: wrap; } .link-btn.danger { color: #c02828; }
.ag-task { display: grid; grid-template-columns: 1fr auto; } .ag-task .hint { grid-column: 1; } .ag-task .ag-acts { grid-row: 1 / span 2; grid-column: 2; }
.ag-task.done .ag-chk span { text-decoration: line-through; color: var(--muted); }
.ag-chk { display: flex; gap: 8px; align-items: center; font-weight: 600; cursor: pointer; } .ag-chk input { width: 18px; height: 18px; }
.ag-late { color: #c02828; font-weight: 700; } .ag-today { color: #1f7a54; font-weight: 700; }
.ag-quick { display: flex; gap: 6px; margin: 4px 0 6px; flex-wrap: wrap; } .ag-quick input { flex: 1; min-width: 160px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; } .ag-quick input[type=date] { flex: 0 0 150px; }
.ag-cli { font-weight: 700; color: var(--navy); }
.ag-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; } .ag-seg button { border: 0; background: #fff; padding: 6px 12px; cursor: pointer; font-weight: 600; color: var(--navy); } .ag-seg button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.ag-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; } .ag-cal > b { text-align: center; color: var(--muted); font-size: .8rem; padding: 4px 0; }
.ag-day { min-height: 84px; border: 1px solid var(--line); border-radius: 10px; background: #fff; text-align: left; padding: 4px 6px; display: flex; flex-direction: column; gap: 2px; cursor: pointer; font: inherit; overflow: hidden; }
.ag-day > span { font-weight: 800; color: var(--navy); font-size: .9rem; } .ag-day.out { opacity: .45; } .ag-day.today { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); } .ag-day.sel { background: #eef2fd; }
.ag-dot { font-style: normal; font-size: .7rem; background: #e3ecff; color: #173a8a; border-radius: 4px; padding: 1px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .ag-more { font-style: normal; font-size: .7rem; color: var(--muted); }
.ag-month { text-align: center; }
.ag-f { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .9rem; margin-bottom: 10px; color: var(--navy); } .ag-f .dlg-in { width: 100%; }
.ag-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .ag-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; } @media (max-width: 600px) { .ag-2, .ag-3 { grid-template-columns: 1fr; } }
.ag-dlg { width: min(720px, 96vw); }
.ag-table { display: grid; } .ag-tr { display: grid; grid-template-columns: 1.1fr 1.6fr .9fr .9fr .9fr 1.2fr; gap: 8px; padding: 10px 6px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; font: inherit; cursor: pointer; align-items: center; }
.ag-tr:hover { background: #f6f8fd; } .ag-th { font-weight: 700; color: var(--muted); font-size: .8rem; cursor: default; } .ag-th:hover { background: none; }
@media (max-width: 700px) { .ag-tr { grid-template-columns: 1fr 1fr; } .ag-th { display: none; } }
.spill.s-del { background: #f1f1f4; color: #6b6f80; }
.inv-its { border: 1px solid var(--line); border-radius: 10px; padding: 8px; margin-bottom: 10px; } .inv-it { display: grid; grid-template-columns: 1fr 80px 120px 28px; gap: 6px; margin-bottom: 6px; align-items: center; } .inv-ith { font-size: .8rem; font-weight: 700; color: var(--muted); }
.inv-tot { text-align: right; font-size: 1rem; }
.inv-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; background: #f6f8fd; border-radius: 10px; padding: 10px; } .inv-sum small { display: block; color: var(--muted); font-weight: 600; }
.inv-prev { background: #e9ecf3; padding: 16px; border-radius: 12px; overflow-x: auto; }
.inv-doc { position: relative; background: #fff; color: #1b1e2b; max-width: 800px; margin: 0 auto; padding: 32px 36px; border-top: 8px solid var(--c1); box-shadow: 0 6px 24px rgba(0,0,0,.08); font-size: 14px; }
.inv-dh { display: flex; gap: 16px; align-items: flex-start; border-bottom: 2px solid var(--c2); padding-bottom: 14px; } .inv-dh img { width: 74px; height: 74px; object-fit: contain; } .inv-dh h2 { margin: 0 0 4px; color: var(--c1); font-size: 1.3rem; } .inv-dh p { margin: 2px 0; color: #555b6e; font-size: 12.5px; } .inv-dh > div:nth-child(2) { flex: 1; }
.inv-dn { text-align: right; display: flex; flex-direction: column; } .inv-dn b { color: var(--c1); font-size: 1.4rem; letter-spacing: .08em; } .inv-dn span { font-weight: 700; font-family: ui-monospace, monospace; } .inv-dn small { color: #555b6e; }
.inv-bill { margin: 16px 0; display: flex; flex-direction: column; } .inv-bill small { color: var(--c2); font-weight: 700; text-transform: uppercase; font-size: 11px; letter-spacing: .08em; }
.inv-t { width: 100%; border-collapse: collapse; } .inv-t th { background: var(--c1); color: #fff; text-align: left; padding: 8px; font-size: 12.5px; } .inv-t td { padding: 8px; border-bottom: 1px solid #e3e6ee; } .inv-t th:not(:first-child), .inv-t td:not(:first-child) { text-align: right; }
.inv-tots { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; max-width: 300px; margin: 14px 0 0 auto; } .inv-tots span { color: #555b6e; } .inv-tots b { text-align: right; } .inv-tots .big { font-size: 1.15rem; color: var(--c1); border-top: 2px solid var(--c1); padding-top: 4px; }
.inv-stamp { position: absolute; top: 120px; right: 50px; transform: rotate(-14deg); border: 4px solid #1f9d6b; color: #1f9d6b; font-weight: 900; font-size: 1.8rem; padding: 4px 16px; border-radius: 8px; opacity: .8; } .inv-stamp.void { border-color: #c02828; color: #c02828; }
.inv-notes { margin-top: 18px; color: #333; white-space: pre-wrap; } .inv-foot { margin-top: 22px; border-top: 1px solid #e3e6ee; padding-top: 10px; color: #555b6e; font-size: 12px; text-align: center; }
.inv-print { display: none; }
@media print { body.printing-inv > *:not(#inv-print) { display: none !important; } body.printing-inv #inv-print { display: block !important; } body.printing-inv { background: #fff; } .inv-doc { box-shadow: none; max-width: none; } @page { margin: 12mm; } }
/* ficha del cliente */
.ag-ficha h5 { margin: 0 0 6px; color: var(--navy); font-size: .92rem; display: flex; gap: 8px; align-items: center; }
.agf-sec { border-top: 1px solid var(--line); padding: 10px 0; } .agf-sec:first-of-type { border-top: 0; }
.agf-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 6px 0; } .agf-row input:not([type=checkbox]), .agf-row select, .agf-wa textarea { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; } .agf-row input[id$="-t"], .agf-row #agf-ck-in, .agf-row #agf-ap-n { flex: 1; min-width: 150px; }
.agf-l { display: flex; gap: 6px; align-items: center; font-weight: 600; font-size: .88rem; }
.agf-steps { display: flex; gap: 4px; list-style: none; padding: 0; margin: 8px 0; flex-wrap: wrap; } .agf-steps li { flex: 1; min-width: 80px; text-align: center; font-size: .75rem; padding: 6px 4px; border-radius: 6px; background: #eef0f6; color: var(--muted); font-weight: 600; } .agf-steps li.done { background: #d9f2e6; color: #16704b; } .agf-steps li.cur { background: var(--navy); color: #fff; }
.agf-ck { list-style: none; padding: 0; margin: 0; } .agf-ck li { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--line); } .agf-it { flex: 1; font-weight: 600; } .ck-miss .agf-it::before { content: '● '; color: #d68a00; } .ck-ok .agf-it::before { content: '✓ '; color: #1f9d6b; } .ck-na .agf-it { color: var(--muted); text-decoration: line-through; }
.agf-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; } .agf-seg button { border: 0; background: #fff; padding: 3px 9px; font-size: .78rem; cursor: pointer; font-weight: 600; color: var(--navy); } .agf-seg button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.agf-wa { display: flex; gap: 6px; align-items: flex-end; margin-bottom: 6px; } .agf-wa textarea { flex: 1; }
.agf-link { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; } .agf-link input { flex: 1; min-width: 200px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
.agf-li { padding: 3px 0; }
.pbtn-hoy { background: linear-gradient(135deg, #1f9d6b, #157a52) !important; color: #fff !important; border-color: transparent !important; }
/* seguimiento público */
body.est { --b1: #0F094F; --b2: #e3262f; margin: 0; min-height: 100vh; background: radial-gradient(900px 520px at 10% -10%, color-mix(in srgb, var(--b1) 30%, transparent), transparent 60%), #f2f4f9; font-family: inherit; }
.est-wrap { max-width: 560px; margin: 0 auto; padding: 20px 16px 40px; }
.est-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; } .est-head img { width: 56px; height: 56px; object-fit: contain; } .est-head b { display: block; color: var(--b1); font-size: 1.15rem; } .est-head small { color: var(--muted); } .est-head > div:nth-child(2) { flex: 1; }
.est-lang { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; } .est-lang button { border: 0; background: none; padding: 6px 10px; font-weight: 700; cursor: pointer; color: var(--b1); } .est-lang button[aria-pressed="true"] { background: var(--b1); color: #fff; }
.est-card { background: #fff; border-radius: 18px; padding: 22px 20px; box-shadow: 0 10px 30px rgba(15,9,79,.1); border-top: 6px solid var(--b1); } .est-card h1 { margin: 0; color: var(--b1); font-size: 1.5rem; } .est-year { margin: 4px 0 14px; color: var(--muted); font-weight: 600; }
.est-now { background: linear-gradient(135deg, var(--b1), color-mix(in srgb, var(--b1) 60%, var(--b2))); color: #fff; border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; } .est-now small { opacity: .8; text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; } .est-now b { font-size: 1.35rem; }
.est-steps { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 8px; } .est-steps li { display: flex; gap: 10px; align-items: center; color: var(--muted); font-weight: 600; } .est-steps i { font-style: normal; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #eef0f6; font-size: .85rem; }
.est-steps li.done { color: #16704b; } .est-steps li.done i { background: #1f9d6b; color: #fff; } .est-steps li.cur { color: var(--b1); font-weight: 800; } .est-steps li.cur i { background: var(--b1); color: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--b1) 20%, transparent); }
.est-miss { background: #fff7e0; border: 1px solid #f2d27a; border-radius: 10px; padding: 10px 12px; } .est-bad { color: #c02828; font-weight: 700; } .est-foot { text-align: center; color: var(--muted); font-size: .85rem; margin-top: 14px; }
/* selector de idioma del formulario del cliente */
.cl-lang { position: relative; z-index: 50; display: flex; width: max-content; margin: 8px 12px -4px auto; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; overflow: hidden; background: rgba(11,15,36,.75); backdrop-filter: blur(6px); }
.cl-lang button { border: 0; background: none; color: #fff; padding: 6px 11px; font-weight: 800; cursor: pointer; font-size: .82rem; } .cl-lang button[aria-pressed="true"] { background: #fff; color: #0b0f24; }
/* evitar que la regla genérica .done (pantalla final) afecte listas nuevas */
.est-steps li.done { padding: 0; text-align: left; }
.ag-task.done { text-align: left; }


/* Tino QA 22-nov-2026: casillas 1099 sin solaparse; ayudas; errores TaxBandits persistentes; PDF del cliente */
.neg-checks { display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin: 12px 0; }
.neg-checks .neg-chk,
.neg-feditor .neg-chk,
.neg-pane .neg-chk {
  display: flex; align-items: flex-start; gap: 8px; white-space: normal; line-height: 1.35;
  width: 100%; max-width: 100%; cursor: pointer; box-sizing: border-box;
}
.neg-checks .neg-chk input[type=checkbox],
.neg-feditor .neg-chk input[type=checkbox],
.neg-pane .neg-chk input[type=checkbox],
.negp .neg-chk input[type=checkbox],
.negp td input[type=checkbox] {
  width: 18px !important; height: 18px !important; min-width: 18px; min-height: 18px;
  flex: 0 0 18px; margin: 2px 0 0; padding: 0; accent-color: var(--navy);
}
.fe-help { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; border: 1px solid currentColor; font-size: 11px; font-weight: 700; font-style: normal; text-decoration: none; cursor: help; opacity: .75; margin: 0 3px; vertical-align: middle; line-height: 1; }
.fe-irs { display: inline; font-size: .72rem; color: var(--muted, #5b6570); font-weight: 400; margin-left: 4px; }
.fe-irs-line { margin: 0 0 8px; font-size: .72rem; color: var(--muted, #5b6570); }
.neg-tberr { margin: 12px 0; padding: 12px 14px; border: 1px solid #b42318; border-radius: 8px; background: #fef3f2; color: #7a1f16; }
.neg-tberr-list { margin: 8px 0 0 1.2em; padding: 0; }
.ph-pdf { display: flex; align-items: center; justify-content: center; width: 72px; height: 72px; background: #f3f0e8; border: 1px solid #d0cbb8; border-radius: 6px; font-weight: 700; font-size: .85rem; color: #8b1e1e; }
.sl-note { margin: 0 12px 8px; font-size: .82rem; }
.kpis .kpi small { line-height: 1.25; }
#chat-err:empty { display: none; }
#chat-err { margin: 0 12px 8px; color: #7a1f16; }

.scan-ask { margin: 6px 0; padding: 6px 8px; border-radius: 6px; background: #fff7e6; color: #7a4b00; font-size: .85rem; }

.scan-direct { display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin-top:14px; }
.scan-direct select { min-width: 12rem; }
.ag-group { border:1px solid #e4e8f1; border-radius:10px; margin:8px 0; padding:4px 0; }
.ag-group > .ag-row:first-child { background:#f7f8fc; }

.doc-pdf-thumb, .doc-pdf-badge { display: flex; align-items: center; justify-content: center; }
.doc-pdf-thumb { position: relative; overflow: hidden; background: #eef2f6; border: 1px solid #d9e0ea; }
.doc-pdf-prev { position: absolute; inset: 0; width: 160%; height: 200%; border: 0; pointer-events: none; transform: scale(.62); transform-origin: top left; background: #fff; }
.doc-pdf-thumb .doc-pdf-badge { position: absolute; right: 8px; bottom: 8px; z-index: 1; }
dd .acc-warn { margin: 8px 0 0; }
.doc-tile .doc-pdf-thumb, .docs-grid .doc-pdf-thumb { width: 100%; min-height: 120px; background: linear-gradient(180deg, #f8fafc, #e8eef6); border-radius: 8px; color: #b42318; }
.doc-pdf-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 52px; height: 36px; padding: 0 10px; border-radius: 6px; background: #b42318; color: #fff; font-weight: 800; letter-spacing: .06em; font-size: .85rem; }
.lb-pdf { width: min(920px, 96vw); height: min(80vh, 900px); border: 0; background: #fff; border-radius: 8px; }
.lb-fig { display: flex; align-items: center; justify-content: center; }
.ph-pdf { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 110px; background: #f3f4f6; border-radius: 8px; font-weight: 800; color: #b42318; letter-spacing: .06em; }

/* Lista «Esperando formulario»: el nombre va a la izquierda (no a la derecha por space-between sin columna flexible). */
#list .link-card, #list .draft-card, #side-links .link-card { text-align: left; justify-content: flex-start; }
#list .link-card .cc-main, #list .draft-card .cc-main, #side-links .link-card .cc-main { flex: 1; min-width: 0; text-align: left; }
#list .link-card strong, #list .draft-card strong, #side-links .link-card strong { text-align: left; display: block; }
