/* Única fuente del sitio: Lato, con sus 5 pesos reales (Thin/Light/Regular/Bold/Black) y su cursiva
   correspondiente para cada uno. No existe un peso "Medium" (500) en Lato.

@font-face { font-family: Latofont !important; font-weight: 600; font-style: normal; font-display: swap; src: url(/fonts/lato-regular-webfont.ttf) format('woff'); } */

@font-face { font-family: Latofont; font-weight: normal; font-style: normal; src: url(/fonts/lato-regular-webfont.ttf) format("truetype"); }

:root {
  --bg: #f4f6fa; --card: #fff; --text: rgb(74, 74, 74); --muted: #667089; --line: #e2e6ef;
  --brand: #1f6feb; --brand-dark: #1857bb; --ok: #1a7f4b; --warn: #b7791f; --bad: #c53030; --cyan: #0e7f96; --purple: #7c3aed;
  --ok-bg: #e6f6ee; --warn-bg: #fdf3dc; --bad-bg: #fde8e8; --info-bg: #e7f0fe; --cyan-bg: #e1f4f7; --purple-bg: #f1e9fe;
  --side: #111a2e; --side-text: #b9c3dc;
  --s-eq: #2563eb; --s-ex: #d97706; --s-tu: #059669;
  --g-red: #d1546f; --g-orange: #ef9f3a; --g-lime: #a6e05a; --g-green: #4caf6a;
  --b-eq: #c2273d; --b-ex: #3b2a86; --b-tu: #0f8fc4;
}
@media (prefers-color-scheme: dark) { :root:not([data-mode="light"]) { --bg: #0e1424; --card: #171f33; --text: #e8ecf6; --muted: #93a0bf; --line: #27314b; --cyan: #22d3ee; --purple: #a78bfa;
    --ok-bg: #12332a; --warn-bg: #3a2f14; --bad-bg: #3d1b1b; --info-bg: #14284a; --cyan-bg: #113a42; --purple-bg: #2f2350; --side: #0a0f1c; --s-eq: #60a5fa; --s-ex: #fbbf24; --s-tu: #34d399; --g-red: #e06a84; --g-orange: #f3ad50; --g-lime: #b7ea75; --g-green: #5cc27d; --b-eq: #f07185; --b-ex: #a99cf0; --b-tu: #4cc0ee; } }
:root[data-mode="dark"] { --bg: #0e1424; --card: #171f33; --text: #e8ecf6; --muted: #93a0bf; --line: #27314b; --cyan: #22d3ee; --purple: #a78bfa;
    --ok-bg: #12332a; --warn-bg: #3a2f14; --bad-bg: #3d1b1b; --info-bg: #14284a; --cyan-bg: #113a42; --purple-bg: #2f2350; --side: #0a0f1c; --s-eq: #60a5fa; --s-ex: #fbbf24; --s-tu: #34d399; --g-red: #e06a84; --g-orange: #f3ad50; --g-lime: #b7ea75; --g-green: #5cc27d; --b-eq: #f07185; --b-ex: #a99cf0; --b-tu: #4cc0ee; }
* { box-sizing: border-box; }
/* Checkbox y radio personalizados en toda la app — mismo estilo en todos los formularios de registro
   y de agregar/editar, y en las tablas con selección múltiple (checkboxes de fila, "seleccionar
   todas", etc.), inspirado en el ejemplo de W3Schools "Custom Checkbox"
   (https://www.w3schools.com/howto/tryit.asp?filename=tryhow_css_custom_checkbox): se aplica
   directamente sobre el <input> nativo (appearance:none + pseudo-elemento ::after para la marca/punto),
   sin envolver cada uno en markup nuevo, así que un solo cambio cubre TODO checkbox/radio existente del
   sitio. Se coloca aquí, al inicio de la hoja de estilos, para que cualquier regla más específica que
   venga después (".lw-method input" para su posición dentro de la tarjeta, ".switch input" para el
   interruptor de encendido/apagado que ya tiene su propio diseño, etc.) pueda seguir ajustando o
   reemplazando lo que necesite sin pelear con esta base. */
input[type=checkbox], input[type=radio] {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  width: 20px; height: 20px; min-width: 20px; margin: 0; padding: 0;
  border: 2px solid var(--line); border-radius: 4px; background: var(--bg);
  position: relative; display: inline-block;
  cursor: pointer; flex: none; vertical-align: middle;
  transition: background .15s, border-color .15s;
}
input[type=radio] { border-radius: 50%; }
input[type=checkbox]:hover, input[type=radio]:hover { background: color-mix(in srgb, var(--brand) 18%, var(--bg)); border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
input[type=checkbox]:checked, input[type=radio]:checked { background: var(--brand); border-color: var(--brand); }
input[type=checkbox]:checked::after { content: ''; position: absolute; left: 5px; top: 1px; width: 4px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
input[type=radio]:checked::after { content: ''; position: absolute; top: 50%; left: 50%; width: 7px; height: 7px; border-radius: 50%; background: #fff; transform: translate(-50%, -50%); }
input[type=checkbox]:disabled, input[type=radio]:disabled { opacity: .55; cursor: not-allowed; }
input[type=checkbox]:focus-visible, input[type=radio]:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
body { margin: 0; font: var(--fs, 15px)/1.5 var(--font, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif); background-color: rgb(255, 255, 255); color: var(--text); font-weight: var(--fw, 400); font-style: var(--fst, normal); }
h1 { font-size: var(--tt-fs, 22px); font-weight: var(--tt-fw, 700); font-style: var(--tt-fst, normal); margin: 0 0 4px; color: rgb(74, 74, 74); }
h2 { font-size: var(--st-fs, 17px); font-weight: var(--st-fw, 700); font-style: var(--st-fst, normal); margin: 0 0 12px; color: rgb(74, 74, 74); }
h3 { font-size: calc(var(--st-fs, 17px) - 2px); font-weight: var(--st-fw, 700); font-style: var(--st-fst, normal); margin: 16px 0 8px; color: rgb(74, 74, 74); }
a { color: var(--brand); text-decoration: none; cursor: pointer; } a:hover { text-decoration: underline; }
.muted { color: var(--muted); font-weight: var(--ds-fw, 400); font-style: var(--ds-fst, normal); } .small { font-size: var(--ds-fs, 13px); } .right { text-align: right; } .nowrap { white-space: nowrap; }

/* Layout */
.layout { display: flex; min-height: 100vh; }
.side { width: 280px; background: var(--side); color: var(--side-text); padding: 18px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; flex-shrink: 0; }
.side-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 4px 16px 8px; min-height: 52px; }
.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand img { max-height: 40px; max-width: 150px; object-fit: contain; display: block; }
.brand .bname { color: #fff; font-weight: 700; font-size: 17px; line-height: 1.2; overflow-wrap: anywhere; }
.side-toggle { background: transparent; border: 0; color: var(--side-text); cursor: pointer; padding: 6px; border-radius: 6px; display: flex; flex-shrink: 0; }
.side-toggle:hover { background: rgba(255,255,255,.1); color: #fff; }
.side .ic { width: 19px; height: 19px; flex-shrink: 0; }
.layout.collapsed .side { width: 66px; padding: 18px 8px; }
.layout.collapsed .side .lbl, .layout.collapsed .side .bname { display: none; }
.layout.collapsed .side-top { flex-direction: column; padding: 2px 0 14px; } .layout.collapsed .brand img { max-width: 40px; }
.layout.collapsed .side a { justify-content: center; padding: 10px 0; position: relative; } .layout.collapsed .side a .dot { position: absolute; top: 2px; right: 6px; margin: 0; }
.layout.collapsed .side .who { padding: 4px 0; display: flex; justify-content: center; }
.logo-prev { margin: 4px 0 14px; padding: 12px; background: #1b2a4a; border-radius: 8px; display: inline-block; min-width: 120px; } .logo-prev img { max-height: 48px; max-width: 220px; display: block; }
.login-brand { justify-content: center; margin-bottom: 14px; } .login-brand img { max-height: 64px; max-width: 240px; } .login-brand .bname { color: var(--text); font-size: 22px; }
.portal-brand img { max-height: 44px; max-width: 200px; margin-bottom: 6px; }
.side a { display: flex; justify-content: space-between; align-items: center; color: var(--side-text); padding: 9px 12px; border-radius: 6px; margin-bottom: 1px; border-left: 3px solid transparent; }
.side a:hover { background: rgba(255,255,255,.07); text-decoration: none; }
.side a.active { background: rgba(255,255,255,.13); color: #fff; font-weight: 600; border-left-color: #fff; }
.side .spacer { flex: 1; }
.side .who { padding: 10px 12px; font-size: 13px; }
.main { flex: 1; padding: 26px 30px; min-width: 0; }
/* Aviso de "área segura" al pie de cada página, igual que en Credit Repair Cloud. */
.secure-footer { margin-top: 40px; padding: 14px 16px; border-top: 1px solid var(--line); background: #f7f7f7; color: var(--muted); font-size: 11.5px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.portal-wrap { max-width: 900px; margin: 0 auto; padding: 22px 16px 60px; }
.portal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 10px; flex-wrap: wrap; }

/* Components */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 18px; margin-bottom: 16px; }
.grid { display: grid; gap: 14px; } .g4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); } .g2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.stat .n {    font-size: 28px;    font-weight: 700;    line-height: 1.1;    color: rgb(176, 173, 171);    margin: 24px 0;    font-weight: 700;    font-size: 96px;    font-family: Latofont;    padding: 8px;    text-align: center;    border-bottom: none;    margin-bottom: 24px;} .stat .l {    color: var(--muted);    font-size: 13px;    margin-bottom: 24px;    font-size: 18px;    font-weight: 700;    color: #4a4a4a;    font-family: Latofont;    text-align: center;}
table { width: 100%; border-collapse: collapse; } th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 12px; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
tr.click:hover { background: var(--info-bg); cursor: pointer; }
.table-wrap { overflow-x: auto; }
/* ---------- Tabla flex (divs con display:flex en vez de <table>) ----------
   Credit Repair Cloud arma sus listados con divs en flexbox (su MUI DataGrid), no con <table>: cada fila
   es "display:flex" y la tabla completa es "width:fit-content" (se ajusta al contenido, no siempre ocupa
   el 100% del contenedor). .ftable reproduce el mismo look de una tabla normal (encabezado, bordes,
   hover, densidad) pero con esa base — se usa en todos los listados del sitio en vez de <table>.
   Columnas: por defecto cada celda reparte el espacio sobrante en partes iguales (flex:1 1 170px);
   .wide le da más peso a la columna principal (p. ej. el nombre); .narrow es de ancho fijo para badges/
   fechas cortas; .shrink se ajusta solo al contenido (iconos, checkboxes, el menú de acciones). */
.ftable { display: flex; flex-direction: column; width: fit-content; min-width: 100%; }
.ftable-row { display: flex; align-items: center!important; border-bottom: 1px solid var(--line); }
.ftable-row:last-child { border-bottom: 0; }
.ftable-row.head { background: var(--bg); }
.ftable-row.head .ftable-cell { font-size: 12px; letter-spacing: .04em; color: var(--muted); font-weight: 600; overflow-wrap: break-word; }
.ftable-row.head .ic { width: 13px; height: 13px; margin-right: 5px; vertical-align: -2px; opacity: .5; flex-shrink: 0; }
.ftable-row.click:hover { background: var(--info-bg); cursor: pointer; }
.ftable-row:not(.head):not(.click):hover { background: color-mix(in srgb, var(--brand) 4%, transparent); }
.ftable-cell { flex: 1 1 170px; min-width: 0; padding: 9px 10px; font-size: 12px; overflow-wrap: anywhere; }
.ftable-cell.shrink { flex: 0 0 auto; min-width: auto; }
.ftable-cell.narrow { flex: 0 0 140px; }
.ftable-cell.wide { flex: 2 1 220px; }
.ftable-cell.nowrap { white-space: nowrap; }
.ftable-cell.num { text-align: right; justify-content: flex-end; }
.ftable-cell a, .ftable-cell b {    color: var(--brand);    font-weight: 700;    font-size: 14px;    /* text-decoration: underline; */    overflow-wrap: normal;    white-space: nowrap;}
.ftable-row.head .ftable-cell a, .ftable-row.head .ftable-cell b { color: inherit; font-weight: inherit; font-size: inherit; text-decoration: none; }
.ftable-cell .ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; max-width: 320px; }
/* .ellip puede ir en un span/b dentro de la celda (arriba) o en la celda misma (aquí, sin max-width fijo:
   ya se recorta al ancho real de la columna gracias a min-width:0 en .ftable-cell). */
.ftable-cell.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drag-handle { display: inline-flex; color: var(--muted); cursor: grab; }
.drag-handle .ic { width: 16px; height: 16px; }
.ftable-row[data-status-key] { cursor: default; }
.ftable[data-density="compact"] .ftable-cell { padding: 5px 8px; }
.ftable[data-density="comfortable"] .ftable-cell { padding: 15px 12px; }
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--card); color: var(--text); padding: 8px 14px; border-radius: 8px; cursor: pointer; font: inherit; font-size: 14px; }
.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff;     box-shadow: rgba(0, 0, 0, 0.2) 0px 3px 1px -2px, rgba(0, 0, 0, 0.14) 0px 2px 2px 0px, rgba(0, 0, 0, 0.12) 0px 1px 5px 0px;
    line-height: 20px;
    padding: 12px 24px !important; } .btn.primary:hover { background: var(--brand-dark); }
.btn.danger { color: var(--bad); } .btn.sm { padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn[hidden] { display: none; }
.btn .ic { width: 25px; height: 25px; flex-shrink: 0; }
.btn .chev { display: inline-flex; opacity: .6; margin-left: -1px; } .btn .chev .ic { width: 11px; height: 11px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--info-bg); color: var(--brand); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); } .badge.warn { background: var(--warn-bg); color: var(--warn); } .badge.bad { background: var(--bad-bg); color: var(--bad); } .badge.gray { background: var(--line); color: var(--muted); } .badge.cyan { background: var(--cyan-bg); color: var(--cyan); } .badge.purple { background: var(--purple-bg); color: var(--purple); }
.dot { background: var(--bad); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; font-weight: 700; }
/* Mismo estilo de pestañas que usa Configuración (.settings-tabs, ver más abajo): sin caja, con línea de
   acento debajo de la pestaña activa y una sombra suave en vez de una línea completa. Se comparten las
   reglas para que luzcan idénticas en toda la app (Agenda, Message Center, perfil de cliente, etc.). */
.tabs { display: flex; gap: 22px; box-shadow: 0 6px 8px -4px rgba(0, 0, 0, 0.12); margin-bottom: 31px; overflow-x: auto; }
.tabs a { padding: 0 0 10px; color: var(--muted); font-size: 14px; font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; } .tabs a.active { color: var(--brand); border-color: var(--brand); font-weight: 600; } .tabs a:hover { color: var(--text); text-decoration: none; }
[data-reorder] a[draggable="true"] { cursor: grab; } [data-reorder] a[draggable="true"]:active { cursor: grabbing; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.notice { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; background: var(--warn-bg); color: var(--warn); font-size: 14px; }
.notice.ok { background: var(--ok-bg); color: var(--ok); } .notice.info { background: var(--info-bg); color: var(--brand); } .notice.bad { background: var(--bad-bg); color: var(--bad); }
.notice.with-icon { display: flex; align-items: flex-start; gap: 8px; } .notice.with-icon .ic { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 1px; }
.empty { text-align: center; padding: 30px; color: var(--muted); }
/* Asistente "Letters & Status" (Select Letters / Attach Documents / Print & Mail / Confirm), igual al
   de Credit Repair Cloud: un stepper horizontal con círculos numerados y una línea que los conecta. */
.lw-steps { display: flex; align-items: center; margin-bottom: 22px; flex-wrap: wrap; gap: 4px; }
.lw-step { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.lw-dot { width: 26px; height: 26px; border-radius: 50%; background: var(--line); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.lw-dot .ic { width: 14px; height: 14px; }
.lw-step.on .lw-dot { background: var(--brand); color: #fff; } .lw-step.on { color: var(--text); }
.lw-step.done .lw-dot { background: var(--ok); color: #fff; } .lw-step.done { color: var(--text); }
.lw-line { flex: 1; min-width: 24px; height: 2px; background: var(--line); margin: 0 6px; }
.lw-body h3 { margin: 0 0 4px; }
.lw-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 14px 0; }
.lw-method { position: relative; display: block; border: 1.5px solid var(--line); border-radius: 12px; padding: 16px; cursor: pointer; }
.lw-method:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.lw-method input { position: absolute; top: 14px; right: 14px; }
.lw-method.on { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.gen-rounds .lw-method { min-height: 84px; }
.gen-round-empty { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 150px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); text-align: left; }
.gen-round-empty-icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--info-bg); color: var(--brand); font-weight: 700; }
.gen-round-empty div { display: flex; flex-direction: column; gap: 3px; }
.gen-round-empty b { color: var(--text); }
.gen-round-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 10px; }
.gen-round-toolbar h3 { margin: 0; }
.gen-round-toolbar p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.gen-items-shell { margin-top: 4px; }
.gen-items-table { min-width: 1280px; }
.gen-items-table .ftable-row { min-width: 1280px; }
.gen-select-col { flex: 0 0 54px; min-width: 54px; justify-content: center; align-items: center !important; }
.gen-checkbox { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; padding: 0; border: 1px solid var(--line); border-radius: 4px; background: var(--card); color: #fff; cursor: pointer; }
.gen-checkbox:hover, .gen-item-choice.selected .gen-checkbox, .gen-select-all[aria-checked="true"] { border-color: var(--brand); background: var(--brand); }
.gen-checkbox .ic { width: 14px; height: 14px; }
.gen-item-choice { display: flex; align-items: center; justify-content: center; gap: 5px; width: 100%; min-height: 68px; padding: 3px 4px; border: 0; background: transparent; color: var(--brand); cursor: pointer; }
.gen-item-choice:hover { background: var(--info-bg); }
.gen-item-choice .badge { pointer-events: none; }
.gen-item-choice .gen-checkbox { flex: 0 0 20px; }
@media (max-width: 700px) { .gen-round-toolbar { align-items: stretch; flex-direction: column; } .gen-round-toolbar .btn { align-self: flex-start; } }
.gen-wizard { padding: 0; overflow: hidden; }
.gen-wizard-head { padding: 24px 26px 18px; border-bottom: 1px solid var(--line); }
.gen-wizard-head h2 { margin: 0 0 4px; }
.gen-wizard-head p { margin: 0; }
.gen-step { margin: 18px 22px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.gen-step-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.gen-step-head h3 { margin: 0 0 3px; font-size: 18px; }
.gen-step-head p { margin: 0; color: var(--muted); font-size: 13px; }
.gen-step-number { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; }
.gen-round-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.gen-round-choice { display: flex; align-items: flex-start; gap: 12px; min-height: 98px; padding: 15px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; background: var(--card); }
.gen-round-choice:hover, .gen-round-choice.on { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); background: var(--info-bg); }
.gen-round-choice input { width: 18px; height: 18px; flex: 0 0 18px; margin: 2px 0 0; padding: 0; accent-color: var(--brand); }
.gen-step-locked .gen-step-head, .gen-step-locked .gen-subheading, .gen-step-locked .gen-round-choice { opacity: .5; }
.gen-step-locked .gen-round-choice { cursor: not-allowed; }
.gen-step-locked .gen-round-choice:hover { border-color: var(--line); box-shadow: none; background: var(--card); }
.gen-step-locked .gen-round-choice input { cursor: not-allowed; }
.ndi-intro { margin: -4px 0 18px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.ndi-bureaus-field { padding: 12px 14px 3px; border: 1px solid var(--line); border-radius: 9px; background: color-mix(in srgb, var(--info-bg) 48%, var(--card)); }
.ndi-bureaus-field > label { margin-bottom: 10px; color: var(--text); font-size: 13px; font-weight: 700; }
.ndi-bureau-options { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.ndi-bureau-options .chk { display: inline-flex; align-items: center; margin: 0; gap: 8px; color: var(--text); font-size: 13px; }
.ndi-bureau-options .chk input { margin: 0; }
.ndi-bureau-options .bureau-logo { padding: 0; }
.ndi-bureau-options .bureau-logo img { height: 22px; max-width: 120px; }
.ndi-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; margin-top: 7px; }
.ndi-field-wide { grid-column: 1 / -1; }
.ndi-field-help { display: block; margin-top: 6px; color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.ndi-manage-link, .ndi-manual-link { padding: 0; border: 0; background: transparent; color: var(--brand); cursor: pointer; font: inherit; font-size: inherit; font-weight: 600; text-decoration: none; }
.ndi-manage-link:hover, .ndi-manual-link:hover { color: var(--brand-dark); text-decoration: underline; }
.ndi-manual-instruction { margin: -2px 0 6px; padding: 12px 14px 2px; border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line)); border-radius: 9px; background: color-mix(in srgb, var(--info-bg) 42%, var(--card)); }
.ndi-manual-instruction[hidden] { display: none; }
.ndi-manual-instruction .field { margin-bottom: 10px !important; }
.ndi-manual-instruction textarea { min-height: 76px !important; }
.ndi-save-manual { margin: 3px 0 10px !important; color: var(--text); font-size: 12px; }
.ndi-manager-copy { margin: 0 0 14px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.ndi-manager-list { max-height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.ndi-manager-row { display: flex; align-items: center; justify-content: space-between; min-height: 38px; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--line); color: var(--text); font-size: 13px; }
.ndi-manager-row:last-child { border-bottom: 0; }
.ndi-manager-lock { display: inline-flex; color: var(--muted); }
.ndi-manager-lock .ic { width: 15px; height: 15px; }
.ndi-manager-add { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.ndi-manager-add input { min-width: 0; padding: 9px 10px; font-size: 13px; }
.ndi-manager-add .btn { flex: 0 0 auto; min-height: 38px; padding: 8px 13px; }
.ndi-manager-footer { display: flex; justify-content: flex-end; margin-top: 14px; }
@media (max-width: 620px) {
  .ndi-form-grid { grid-template-columns: 1fr; }
  .ndi-field-wide { grid-column: auto; }
  .ndi-bureau-options { align-items: flex-start; flex-direction: column; gap: 9px; }
  .ndi-manager-add { align-items: stretch; flex-direction: column; }
  .ndi-manager-add .btn { width: 100%; justify-content: center; }
}
.gen-round-choice span { display: flex; flex-direction: column; gap: 3px; }
.gen-round-choice b { color: var(--brand); font-size: 14px; }
.gen-round-choice strong { font-size: 15px; color: var(--text); }
.gen-round-choice small { color: var(--muted); line-height: 1.35; }
.gen-recipient { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.gen-recipient h4 { margin: 0 0 10px; font-size: 15px; }
.gen-recipient h4 span { color: var(--muted); font-weight: 400; }
.gen-recipient-options { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.gen-radio-option { display: inline-flex; align-items: center; gap: 8px; color: var(--text); cursor: pointer; }
.gen-radio-option input { width: 18px; height: 18px; margin: 0; padding: 0; accent-color: var(--brand); }
.gen-recipient-picker { max-width: 430px; margin-top: 12px; }
.gen-recipient-picker label { display: block; margin-bottom: 5px; color: var(--muted); }
.gen-advice { margin: 0 0 15px; padding: 10px 12px; border-radius: 6px; background: var(--info-bg); color: var(--brand); font-size: 13px; }
.gen-step-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.gen-step-buttons { display: flex; flex-wrap: wrap; gap: 9px; }
.gen-count { color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.gen-selection-empty { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 112px; border: 1px dashed var(--line); border-radius: 7px; color: var(--muted); }
.gen-selection-empty div { display: flex; flex-direction: column; gap: 3px; }
.gen-selection-empty b { color: var(--text); }
.gen-step-footer { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.gen-step2-footer { padding-top: 14px; border-top: 1px solid var(--line); }
.gen-letter-helper { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-size: 13px; }
.gen-letter-helper > span { display: inline-flex; align-items: center; gap: 7px; }
.gen-letter-helper .ic { width: 17px; height: 17px; color: var(--brand); }
.gen-letter-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.gen-letter-fields label > span { display: block; margin-bottom: 6px; color: var(--text); font-weight: 600; }
.gen-letter-fields label b { color: var(--bad); }
.gen-letter-fields select { min-height: 44px; }
.gen-ai-only { display: inline-flex; align-items: center; gap: 8px; margin-top: 13px; color: var(--text); cursor: pointer; }
.gen-ai-only input { width: 17px; height: 17px; margin: 0; padding: 0; accent-color: var(--brand); }
.gen-recipient-note { margin: 13px 0 0; }
.gen-saved-list { display: grid; gap: 7px; max-height: 52vh; overflow-y: auto; padding-right: 3px; }
.gen-saved-row { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; }
.gen-saved-row:hover { border-color: var(--brand); background: var(--info-bg); }
.gen-saved-row input { width: 18px; height: 18px; flex: 0 0 18px; margin: 0; padding: 0; accent-color: var(--brand); }
.gen-saved-copy { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.gen-saved-copy b { color: var(--text); }
.gen-saved-copy small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 780px) {
  .gen-round-choice-grid, .gen-letter-fields { grid-template-columns: 1fr; }
  .gen-step { margin: 14px 10px; padding: 16px; }
  .gen-step-toolbar, .gen-letter-helper { align-items: stretch; flex-direction: column; }
  .gen-count { align-self: flex-start; }
  .gen-wizard-head { padding: 19px 16px 14px; }
}
.lw-tag { display: inline-block; background: var(--ok-bg); color: var(--ok); font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-bottom: 8px; }
.lw-brand { margin-top: 8px; font-size: 12px; font-weight: 700; color: var(--muted); }
/* Miniaturas de "Adjuntar Documentos" (paso 2 del asistente Letters & Status) */
.lw-doc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 14px 0; }
.lw-doc-card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; text-align: center; }
.lw-doc-thumb { height: 100px; background: var(--bg); display: flex; align-items: center; justify-content: center; color: var(--muted); overflow: hidden; }
.lw-doc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lw-doc-thumb .ic { width: 30px; height: 30px; }
.lw-doc-info { padding: 8px 10px 10px; }
.lw-doc-info b { display: block; font-size: 12.5px; margin-bottom: 6px; }
/* Vista De Reporte de "Saved Dispute Items": una cuenta por tarjeta, comparada lado a lado solo en los
   burós que realmente reportan esa cuenta. Antes era un <table>; ahora es un CSS Grid dinámico: cada
   ".rv-row" es "display:contents" y ".rv-cell.span3" ocupa todas las columnas presentes para
   reemplazar los colspan de Mostrar Más Detalles, Motivo e Instrucciones. Ver itemsReportView() en
   public/staff.js. */
.rv-card { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 18px; overflow: hidden; }
.rv-grid { display: grid; grid-template-columns: 160px repeat(3, minmax(160px, 1fr)); width: 100%; min-width: 640px; }
.rv-row, .rv-more-grid { display: contents; }
.rv-more-grid[hidden] { display: none; }
.rv-cell { padding: 9px 12px; font-size: 13.5px; border-bottom: 1px solid var(--line); display: flex; align-items: center; min-width: 0; }
.rv-cell.label { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.rv-cell.span3 { grid-column: 2 / -1; }
/* Fila de encabezado (antes <thead><th>): mismo estilo que las cabeceras de ".ftable". */
.rv-cell.head { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); font-weight: 600; background: var(--bg); border-bottom: 1px solid var(--line); padding-top: 12px; padding-bottom: 12px; }
/* Tarjeta de cuenta "negativa" (algún ítem de tipo cobranza/charge-off/registro público/pago tardío):
   fondo rosado suave en toda la tarjeta, igual que Credit Repair Cloud. */
.rv-card.rv-negative .rv-cell { background: var(--bad-bg); }
/* Encabezado con el logo de cada buró centrado en su columna, en una sola fila — igual que el
   "Report View" de Credit Repair Cloud (el nombre del acreedor/furnisher que reportó cada buró va
   aparte, en su propia fila "Account Name", como cualquier otro campo). */
.rv-cell.head.center { justify-content: center; }
/* Fila con el nombre de la cuenta (antes tr.rv-head): mismo fondo/tamaño que la cabecera. */
.rv-row.rv-head .rv-cell { background: var(--bg); font-size: 14px; padding-top: 12px; padding-bottom: 12px; }
.rv-acct { letter-spacing: .04em; }
/* "Mostrar Más Detalles +": las filas quedan ocultas hasta que se pulsa el enlace. */
.rv-more-toggle { cursor: pointer; font-size: 13px; font-weight: 600; }
.rv-neg-badge { display: inline-block; margin-top: 6px; }
.rv-indispute { color: var(--warn); }
/* Motivo/Instrucciones compartidos de la cuenta: el combo ocupa el ancho disponible y el enlace de
   "agregar nuevo" queda a la derecha, como los botones rojos "Add Reason"/"Add Instructions" de CRC. */
.rv-reason-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.rv-reason-row .sel-combo { flex: 1; min-width: 220px; }
.rv-reason-row a { white-space: nowrap; font-weight: 600; }
.rv-actions-cell { justify-content: flex-end; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: 14px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; }
.progress { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; } .progress > div { height: 100%; background: var(--ok); }
.score { display: flex; align-items: baseline; gap: 10px; } .score .big { font-size: 34px; font-weight: 700; }

/* Forms */
input, select, textarea { font: caption; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 15px 15px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
textarea { min-height: 90px; resize: vertical; } label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 0px; } .field.label {  margin-bottom: 0px; }
.field { margin-bottom: 12px; } .fields2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
/* Controles compactos de Apariencia (sliders de tamaño/espaciado) */
.rng-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 2px 18px; margin-bottom: 6px; }
.field.plain.rng { margin-bottom: 8px; }
.field.plain.rng label { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.field.plain.rng label b { color: var(--text); font-weight: 600; }
.style-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; margin-bottom: 10px; }
@media (max-width: 560px) { .style-row { grid-template-columns: 1fr; } }
.search { max-width: 260px; }

/* Modal / toast */
#modal-root .backdrop { position: fixed; inset: 0; background: rgba(8,12,24,.55); display: flex; align-items: center; justify-content: center; padding: 40px 14px; overflow-y: auto; z-index: 50; }
.modal { background: var(--card); border-radius: 14px; width: 100%; max-width: 640px; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.modal.wide { max-width: 860px; } .modal h2 { margin-bottom: 14px; } .modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
#toast { position: fixed; top: 22px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 8px; align-items: center; }
#toast div { display: flex; align-items: center; gap: 10px; background: var(--brand); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: 0 8px 26px rgba(20,30,60,.25); font-size: 14.5px; font-weight: 500; max-width: min(92vw, 460px); animation: toast-in .18s ease-out; }
#toast .err { background: var(--bad); }
#toast div .ic { width: 20px; height: 20px; flex: none; }
#toast div span { flex: 1; }
#toast div button { flex: none; background: none; border: 0; padding: 2px; margin: 0 -4px 0 4px; color: #fff; opacity: .85; cursor: pointer; display: flex; }
#toast div button:hover { opacity: 1; }
#toast div button .ic { width: 16px; height: 16px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* Message center */
.mc { display: grid; grid-template-columns: 300px 1fr; gap: 14px; min-height: 480px; }
.mc .list { padding: 0; overflow: hidden; } .mc .list .thread { padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; } .mc .list .thread:hover, .mc .list .thread.active { background: var(--info-bg); }
.thread .top { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; } .thread .snip { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; padding: 4px 2px 10px; }
.bubble { max-width: 78%; padding: 9px 13px; border-radius: 14px; background: var(--line); align-self: flex-start; white-space: pre-wrap; word-wrap: break-word; }
.bubble.out { background: var(--brand); color: #fff; align-self: flex-end; } .bubble.note { background: var(--warn-bg); color: var(--warn); align-self: center; border: 1px dashed var(--warn); }
.bubble .meta { font-size: 11px; opacity: .75; margin-top: 3px; }
pre.letter { white-space: pre-wrap; font: 13px/1.55 ui-monospace, Menlo, Consolas, monospace; background: var(--bg); padding: 14px; border-radius: 8px; max-height: 340px; overflow: auto; }

/* Login */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login .card { width: 100%; max-width: 380px; padding: 28px; }
/* Login del dominio del portal de clientes (p.ej. accesosegurocliente.com): mismo formulario, fondo
   e icono de candado distintos para que se sienta como un portal aparte, no como el panel de staff. */
.login-portal { background: radial-gradient(1100px 760px at 20% 8%, var(--brand) 0%, var(--brand-dark) 55%, #0b1f45 100%); }
.login-portal .card { box-shadow: 0 18px 50px rgba(0,0,0,.28); }
.login-portal-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 4px; }
.login-portal-lock { font-size: 28px; line-height: 1; }
.login-portal-brand h1 { margin: 0; text-align: center; }

#print-area { display: none; }
@media print { body > *:not(#print-area) { display: none !important; } #print-area { display: block; white-space: pre-wrap; font: 13pt/1.5 Georgia, serif; color: #000; background: #fff; } }
@media (max-width: 800px) {
  .main { padding: 16px 12px; } .mc { grid-template-columns: 1fr; } .fields2 { grid-template-columns: 1fr; } .kv { grid-template-columns: 100px 1fr; }
}

/* Gráfica de puntajes y monitoreo */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; } .chart .ch-t { font-size: 11px; fill: var(--muted); } .chart .ch-v { font-size: 12px; font-weight: 700; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 10px; }
.legend .li { display: flex; align-items: baseline; gap: 8px; } .legend .sw { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.legend .val { font-size: 20px; font-weight: 700; } .delta { font-size: 13px; font-weight: 600; } .delta.up { color: var(--ok); } .delta.down { color: var(--bad); } .delta.flat { color: var(--muted); }
.mon-status { text-align: center; padding: 8px 0 4px; } .mon-status .big { font-size: 20px; font-weight: 600; }
.mon-actions { display: flex; flex-direction: column; gap: 10px; max-width: 320px; margin: 16px auto 0; }
.btn.green { background: var(--ok); border-color: var(--ok); color: #fff; } .btn.green:hover { filter: brightness(.92); }
.btn.green > :nth-of-type(1) {font-size: 22px; }
.access-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px 24px; } .access-grid dt { font-size: 12px; color: var(--muted); } .access-grid dd { margin: 2px 0 0; word-break: break-all; }
.review h3 { margin-top: 18px; } .review .scorebox { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.review .scorebox .prev { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Indicador de carga mientras la IA analiza un reporte (modal "Importar reporte de crédito") */
.ai-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 36px 16px 24px; text-align: center; gap: 6px; }
.ai-loading-spinner { width: 60px; height: 60px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--primary); animation: ai-spin .9s linear infinite; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.ai-loading-spinner .ic { width: 26px; height: 26px; animation: ai-spin 1.8s linear infinite reverse; }
.ai-loading-title { font-weight: 600; font-size: 15px; }
@keyframes ai-spin { to { transform: rotate(360deg); } }

/* Ícono grande arriba del botón "Importar reporte" (tarjeta Reporte de crédito) */
.mon-icon { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 14px; background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); margin: 4px auto 2px; }
.mon-icon .ic { width: 30px; height: 30px; }

/* Vista Importar / Auditoría del perfil de cliente. Mantiene el mismo lenguaje de tarjetas,
   iconos y botones del CRM, pero separa visualmente el flujo de carga, sus registros y el acceso. */
.mon-page { width: 100%; min-width: 0; }
.mon-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.mon-heading { display: flex; align-items: center; gap: 16px; min-width: 0; }
.mon-heading h1 { margin: 0 0 5px; font-size: clamp(28px, 2.7vw, 38px); line-height: 1.08; }
.mon-heading p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.45; }
.mon-flow { display: flex; align-items: flex-start; flex: 0 1 570px; min-width: 470px; padding-top: 8px; }
.mon-flow-step { display: flex; flex: 1 1 0; flex-direction: column; align-items: center; gap: 7px; min-width: 90px; color: var(--muted); text-align: center; }
.mon-flow-step span { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--line); color: var(--muted); font-size: 13px; font-weight: 700; }
.mon-flow-step b { font-size: 11px; font-weight: 600; line-height: 1.2; white-space: nowrap; }
.mon-flow-step.active { color: var(--brand); }
.mon-flow-step.active span { background: var(--brand); color: #fff; }
.mon-flow i { flex: 1 1 28px; min-width: 22px; height: 1px; margin-top: 14px; background: var(--line); }
.mon-main-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 14px; align-items: start; }
.mon-side-stack { display: grid; gap: 14px; min-width: 0; }
.mon-card { min-width: 0; margin: 0; padding: 18px; border-radius: 10px; box-shadow: 0 6px 18px rgba(34, 77, 130, .045); }
.mon-card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.mon-card-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mon-card-title h2 { margin: 0; font-size: 17px; line-height: 1.2; }
.mon-card-title .cp-section-icon { width: 34px; height: 34px; }
.mon-card-title .cp-section-icon .ic { width: 19px; height: 19px; }
.mon-provider { color: var(--muted); font-size: 12px; white-space: nowrap; }
.mon-provider b { color: var(--text); }
.mon-mode-tabs { display: grid; grid-template-columns: 1fr 1fr; margin: 16px 0 18px; border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line)); border-radius: 9px; overflow: hidden; }
.mon-mode { min-width: 0; min-height: 45px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 12px; border: 0; border-right: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line)); background: var(--card); color: var(--brand); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.mon-mode:last-child { border-right: 0; }
.mon-mode.active { background: var(--brand); color: #fff; }
.mon-mode .ic { width: 19px; height: 19px; flex: 0 0 auto; }
.mon-upload-zone { width: 100%; min-height: 254px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 24px 18px; border: 2px dashed color-mix(in srgb, var(--brand) 28%, var(--line)); border-radius: 10px; background: color-mix(in srgb, var(--brand) 2%, var(--card)); color: var(--muted); font: inherit; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.mon-upload-zone:hover, .mon-upload-zone:focus-visible { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, var(--card)); outline: none; }
.mon-upload-zone strong { color: var(--text); font-size: 16px; }
.mon-upload-zone > span:not(.mon-upload-icon) { font-size: 13px; }
.mon-upload-zone small { font-size: 12px; line-height: 1.45; }
.mon-upload-icon { width: 64px; height: 64px; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 4px; border-radius: 50%; background: color-mix(in srgb, var(--brand) 11%, var(--card)); color: var(--brand); }
.mon-upload-icon .ic { width: 31px; height: 31px; }
.mon-imported-state { min-height: 254px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 24px 18px; border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--line)); border-radius: 10px; background: color-mix(in srgb, var(--brand) 3%, var(--card)); text-align: center; }
.mon-imported-state strong { color: var(--text); font-size: 16px; }
.mon-imported-state > span:last-child { max-width: 360px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.mon-actions { max-width: 340px; margin: 16px auto 0; }
.mon-main-action, .mon-secondary-action { width: 100%; justify-content: center; min-height: 44px; }
.mon-secondary-action { color: var(--brand); }
.mon-helper { margin: 9px 0 0; text-align: center; line-height: 1.4; }
.mon-cycle-status { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 14px; margin-top: 15px; padding-top: 12px; border-top: 1px solid var(--line); text-align: center; }
.mon-status-value { color: var(--text); font-size: 13px; font-weight: 600; }
.mon-history-card { overflow-x: auto; }
.mon-history-table { min-width: 540px; }
.mon-history-table .ftable-row { min-height: 58px; }
.mon-history-table .ftable-cell { display: flex; align-items: center; gap: 7px; padding: 10px 11px; font-size: 13px; }
.mon-history-table .ftable-row.head .ftable-cell { font-size: 11px; text-transform: none; letter-spacing: 0; line-height: 1.2; }
.mon-history-table .ftable-row > .ftable-cell:nth-child(1) { flex: 1.3 1 170px; }
.mon-history-table .ftable-row > .ftable-cell:nth-child(2) { flex: 1 1 125px; }
.mon-history-table .ftable-row > .ftable-cell:nth-child(3) { flex: 1 1 135px; }
.mon-history-table .ftable-row > .ftable-cell:nth-child(4) { flex: 0 0 58px; justify-content: center; }
.mon-history-date { flex-direction: column; align-items: flex-start !important; gap: 2px !important; }
.mon-history-date b { color: var(--text); font-size: 13px; }
.mon-history-date span, .mon-history-detail { color: var(--muted); font-size: 11px; line-height: 1.3; }
.mon-history-detail { display: block; }
.mon-row-actions .icon-btn { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.mon-empty-inline { padding: 28px 14px; color: var(--muted); font-size: 13px; text-align: center; }
.mon-pending-card { overflow-x: auto; }
.mon-pending-table { min-width: 500px; }
.mon-pending-table .ftable-row.head .ftable-cell { font-size: 11px; text-transform: none; letter-spacing: 0; }
.mon-pending-table .ftable-row.head .ftable-cell:first-child { flex: 1.3 1 220px; }
.mon-pending-table .ftable-row.head .ftable-cell:nth-child(2) { flex: 1 1 170px; }
.mon-pending-table .ftable-row.head .ftable-cell:last-child { flex: 0 0 76px; }
.mon-empty { min-height: 172px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 20px; text-align: center; }
.mon-empty > span { width: 54px; height: 54px; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 4px; border-radius: 50%; background: color-mix(in srgb, var(--brand) 7%, var(--card)); color: color-mix(in srgb, var(--brand) 65%, var(--muted)); }
.mon-empty > span .ic { width: 28px; height: 28px; }
.mon-empty b { color: var(--text); font-size: 15px; }
.mon-empty small { color: var(--muted); font-size: 12px; }
.mon-access-card { margin-top: 14px; }
.mon-access-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 28px; margin-top: 4px; }
.mon-access-grid dd { min-height: 22px; }
.mon-security-note { margin: 18px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.mon-access-log { margin-top: 12px; }
.mon-access-log summary { cursor: pointer; }
.mon-access-log .ftable { margin-top: 8px; }

/* Flujo de reimportación: progreso, resumen de puntajes y revisión de cambios. */
.mon-import-progress { display: grid; gap: 8px; margin-top: 14px; padding: 14px; border: 1px solid color-mix(in srgb, var(--brand) 20%, var(--line)); border-radius: 9px; background: color-mix(in srgb, var(--brand) 4%, var(--card)); }
.mon-import-progress strong { color: var(--text); }
.mon-import-progress span { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; }
.mon-import-progress .ic { width: 16px; height: 16px; color: var(--brand); }
.review-import-modal { max-height: calc(100vh - 32px); display: flex; flex-direction: column; overflow: hidden; }
.review-import-modal .mbody { min-height: 0; overflow: auto; }
.review-import-modal .actions { flex: 0 0 auto; }
.review-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 18px; background: var(--brand); color: #fff; }
.review-panel-head h3 { margin: 0; color: #fff; font-size: 18px; }
.review-panel-head span { color: rgba(255,255,255,.9); font-size: 13px; white-space: nowrap; }
.review-panel-head span b { margin-left: 10px; }
.review-score-panel, .review-factor-panel { overflow: hidden; margin-top: 16px; border: 1px solid var(--brand); border-radius: 9px; background: var(--card); }
.review-score-panel .gauges { padding: 12px 8px 16px; }
.review-factor-panel .review-change-grid { border-top: 1px solid var(--line); }
.review-change-grid, .bp-factor-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.review-change-card { display: flex; min-height: 116px; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 14px 10px; border-right: 1px solid var(--line); text-align: center; }
.review-change-card:last-child { border-right: 0; }
.review-change-card strong { color: var(--muted); font-size: 48px; line-height: 1; }
.review-change-card span { color: var(--text); font-size: 13px; font-weight: 600; }
.review-change-card.deleted strong { color: #dc2626; }
.review-change-card.updated strong { color: #ca8a04; }
.review-change-card.repaired strong { color: #2563eb; }
.review-change-card.added strong { color: #16a34a; }
.review-factor-line { margin-top: 14px; padding: 11px 14px; border-radius: 8px; background: color-mix(in srgb, var(--brand) 10%, var(--card)); color: var(--brand); font-size: 13px; line-height: 1.5; }
.review-details .notice.info { margin: 12px 0; }
.review-details h3 { margin-top: 18px; }

/* Versión de impresión: solo portada, puntajes y cambios. Nunca incluye la tabla de cuentas. */
.bp-report { max-width: 900px; margin: 0 auto; color: #111827; font-family: Arial, sans-serif; font-size: 14px; }
.bp-report-greeting { margin-bottom: 22px; font-size: 25px; }
.bp-report > p { margin: 0 0 24px; font-size: 18px; }
.bp-score-panel, .bp-factor-panel { overflow: hidden; margin: 0 0 20px; border: 2px solid #0875dc; border-radius: 8px; background: #fff; }
.bp-score-panel > header, .bp-factor-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 24px; background: #0c5fba; color: #fff; }
.bp-score-panel > header strong, .bp-factor-panel > header strong { font-size: 24px; }
.bp-score-panel > header span, .bp-factor-panel > header span { font-size: 14px; white-space: nowrap; }
.bp-score-panel > header b, .bp-factor-panel > header b { margin-left: 10px; }
.bp-score-panel .gauges { padding: 10px 12px 20px; }
.bp-score-panel .gauge { padding: 8px 14px 12px; }
.bp-score-panel .gauge .g-name { font-size: 17px; }
.bp-factor-grid .review-change-card { min-height: 150px; }
.bp-report-note { padding: 28px 18px; border: 2px solid #0875dc; border-radius: 8px; text-align: center; }
#print-area .bp-report { padding: 28px; }

@media (max-width: 1050px) {
  .mon-header { flex-direction: column; }
  .mon-flow { width: 100%; max-width: 700px; min-width: 0; align-self: stretch; }
  .mon-main-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .mon-heading { align-items: flex-start; gap: 12px; }
  .mon-heading .tk-hicon { width: 56px; height: 56px; border-radius: 13px; }
  .mon-heading .tk-hicon .ic { width: 28px; height: 28px; }
  .mon-heading h1 { font-size: 29px; }
  .mon-heading p { font-size: 13px; }
  .mon-flow { overflow-x: auto; padding: 4px 0 7px; }
  .mon-flow-step { min-width: 88px; }
  .mon-flow-step b { font-size: 10px; }
  .mon-flow i { min-width: 14px; }
  .mon-card { padding: 14px; }
  .mon-card-head { align-items: flex-start; flex-direction: column; }
  .mon-card-head > .btn { align-self: flex-end; }
  .mon-provider { white-space: normal; }
  .mon-mode-tabs { grid-template-columns: 1fr; }
  .mon-mode { border-right: 0; border-bottom: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line)); }
  .mon-mode:last-child { border-bottom: 0; }
  .mon-upload-zone { min-height: 220px; }
  .mon-access-grid { grid-template-columns: 1fr; gap: 13px; }
  .mon-cycle-status { align-items: flex-start; flex-direction: column; }
  .review-panel-head { align-items: flex-start; flex-direction: column; gap: 5px; }
  .review-change-grid, .bp-factor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-change-card:nth-child(2) { border-right: 0; }
  .review-change-card:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .review-score-panel .gauges { grid-template-columns: 1fr; }
  .review-score-panel .gauge + .gauge { border-left: 0; border-top: 1px solid var(--line); padding-top: 14px; }
  .bp-score-panel > header, .bp-factor-panel > header { align-items: flex-start; flex-direction: column; gap: 5px; }
  .bp-score-panel > header span, .bp-factor-panel > header span { white-space: normal; }
}

/* Zona de arrastrar-y-soltar para subir el archivo del reporte (modal "Importar reporte de crédito") */
.dropzone { position: relative; border: 2px dashed var(--line); border-radius: 12px; padding: 22px 16px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; background: var(--bg); }
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, var(--bg)); }
.dropzone .dz-icon { display: flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 50%; background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); margin: 0 auto 10px; }
.dropzone .dz-icon .ic { width: 24px; height: 24px; }
.dropzone .dz-text { font-weight: 600; font-size: 14px; }
.dropzone .dz-text b { color: var(--brand); }
.dropzone .dz-hint { font-size: 12px; color: var(--muted); margin-top: 3px; }
.dropzone .dz-file { font-size: 13px; margin-top: 8px; color: var(--text); font-weight: 600; }
.dropzone input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* Aviso de "Reporte duplicado" (ver showDuplicateWarning), igual al de Credit Repair Cloud: dos
   documentos con una X roja entre ellos. */
.dupwarn-icons { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 4px 0 18px; }
.dupwarn-doc { display: flex; align-items: center; justify-content: center; width: 54px; height: 54px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); flex: none; }
.dupwarn-doc .ic { width: 26px; height: 26px; }
.dupwarn-x { color: var(--bad); flex: none; }
.dupwarn-x .ic { width: 22px; height: 22px; }
.dupwarn p { text-align: center; margin: 0 0 14px; }

/* Tarjetas de puntaje en el resumen de importación impreso (ver importSummaryPrintHtml) */
.bp-score { text-align: center; } .bp-score-n { font-size: 26px; font-weight: 700; }

/* Medidores de puntaje (300–850) */
.gauges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.gauge { text-align: center; padding: 6px 10px 10px; } .gauge + .gauge { border-left: 1px solid var(--line); }
.gauge svg { width: 100%; max-width: 250px; height: auto; display: block; margin: 0 auto; }
.gauge .g-track { stroke: var(--line); } .gauge .g-tick { font-size: 10.5px; fill: var(--muted); }
.gauge .g-score { font-size: 38px; font-weight: 700; fill: var(--text); } .gauge .g-delta { font-size: 14px; font-weight: 700; } .gauge .g-delta.up { fill: var(--ok); } .gauge .g-delta.down { fill: var(--bad); } .gauge .g-delta.flat { fill: var(--muted); }
.gauge .g-name { font-size: 17px; font-weight: 700; margin-top: 2px; letter-spacing: .01em; } .gauge .g-date { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
@media (max-width: 640px) { .gauges { grid-template-columns: 1fr; } .gauge + .gauge { border-left: 0; border-top: 1px solid var(--line); padding-top: 14px; } }

/* Menú lateral con iconos (debe ir después de las reglas base) */
.side a { gap: 11px; justify-content: flex-start; } .side a .dot { margin-left: auto; }
.side .who a { padding: 8px 0 0; }
.side-top .brand { flex: 1; min-width: 0; }
.brand:has(img):has(.bname) { flex-direction: column; align-items: flex-start; gap: 4px; }
.layout.collapsed .side a { justify-content: center; }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 4px; background: transparent; border: 2px solid transparent; border-radius: 10px; padding: 6px 8px; cursor: pointer; color: var(--text); font: inherit; }
.swatch .sw { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); }
.swatch.sel { border-color: var(--brand); } .swatch:hover { background: var(--bg); }
input[type=color] { padding: 2px; height: 40px; width: 56px; cursor: pointer; }
.color-swatch-row { display: flex; align-items: center; gap: 10px; }
.color-hex { font-family: ui-monospace, Consolas, monospace; font-size: 13px; color: var(--muted); letter-spacing: .02em; }

.eye { background: transparent; border: 0; color: var(--muted); cursor: pointer; padding: 2px 6px; vertical-align: middle; border-radius: 6px; } .eye:hover { color: var(--brand); background: var(--bg); }
.eye .ic { width: 18px; height: 18px; display: block; }
.secret { font-family: ui-monospace, Consolas, monospace; word-break: break-all; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 22px; } .check { display: flex; align-items: center; gap: 8px; color: var(--text); cursor: pointer; }

.pop-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; margin-top: 6px; }
.pop-style { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; background: var(--card); color: var(--text); border: 2px solid var(--line); border-radius: 10px; padding: 8px 6px; cursor: pointer; font-size: 13px; text-align: center; }
.pop-style .pop-aa { font-size: 24px; line-height: 1.1; } .pop-style:hover { background: var(--bg); } .pop-style.sel { border-color: var(--brand); }
.pop-style > span:last-child { font-size: 11px; line-height: 1.2; }
/* Insignia de "seleccionado" (globito con check) en la esquina de la tarjeta de estilo elegida —
   igual que el selector de color de los estados de clientes, para que se note de un vistazo cuál
   está activa sin tener que fijarse en el color del borde. */
.pop-style .pop-check { display: none; position: absolute; top: 6px; right: 6px; width: 18px; height: 18px; border-radius: 50%; background: var(--brand); color: #fff; align-items: center; justify-content: center; }
.pop-style .pop-check .ic { width: 12px; height: 12px; stroke-width: 3; }
.pop-style.sel .pop-check { display: flex; }

/* ---------- Apariencia → Tipografía: tarjetas con insignia de icono + panel de "Vista previa" en
   vivo, al estilo de Credit Repair Cloud. Ver tipografiaCard()/roleCtl() en public/staff.js. ---------- */
.ic-badge { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; letter-spacing: -.02em; }
.ic-badge .ic { width: 21px; height: 21px; }
.ic-badge.lg { width: 50px; height: 50px; border-radius: 13px; font-size: 16px; }
.ic-badge.lg .ic { width: 25px; height: 25px; }
.ic-badge.indigo { background: color-mix(in srgb, #6366f1 15%, transparent); color: #6366f1; }
.ic-badge.blue { background: color-mix(in srgb, #2563eb 15%, transparent); color: #2563eb; }
.ic-badge.purple { background: color-mix(in srgb, #9333ea 15%, transparent); color: #9333ea; }
.ic-badge.green { background: color-mix(in srgb, #059669 15%, transparent); color: #059669; }
.ap-head-title { display: flex; align-items: center; gap: 14px; }
.ap-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px; margin-bottom: 18px; }
.ap-card-head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.ap-top-panel {  margin-bottom: 16px; }
.ap-top { display: grid; grid-template-columns: 1fr 384px; gap: 18px; align-items: start; }
.ap-top-main { min-width: 0; padding: 4px; }
.ap-top-main .ap-card-head { margin-bottom: 16px; }
.ap-general-size { max-width: 520px; margin-top: 14px; margin-bottom: 0; }
@media (max-width: 900px) { .ap-top { grid-template-columns: 1fr; } }
.ap-preview { background: color-mix(in srgb, var(--brand) 5%, var(--card)); border: 1px solid color-mix(in srgb, var(--brand) 10%, var(--line)); border-radius: 12px; padding: 16px; }
.ap-preview-head { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.ap-preview-head .ic { width: 16px; height: 16px; }
.ap-preview-box { background: var(--bg); border-radius: 10px; padding: 16px; }
.ap-prev-title { font-size: var(--tt-fs, 22px); font-weight: var(--tt-fw, 700); font-style: var(--tt-fst, normal); margin: 0 0 4px; color: rgb(74, 74, 74); }
.ap-prev-subtitle { font-size: var(--st-fs, 17px); font-weight: var(--st-fw, 700); font-style: var(--st-fst, normal); margin: 0 0 10px; color: rgb(74, 74, 74); }
.ap-prev-desc { font-size: var(--ds-fs, 13px); font-weight: var(--ds-fw, 400); font-style: var(--ds-fst, normal); color: var(--muted); margin: 0 0 14px; }
.ap-role-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
.ap-role-grid .ap-card { margin-bottom: 0; }
.ap-role-controls { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) minmax(240px, 1.35fr); gap: 16px; align-items: center; }
.ap-role-controls .field { min-width: 0; margin-bottom: 0; }
.ap-range-row { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.ap-range-row input[type=range] { flex: 1; }
.ap-range-row input[type=range] { -webkit-appearance: none; width: 100%; height: 15px; border-radius: 5px; background: #d3d3d3; outline: none; opacity: 0.7; -webkit-transition: .2s; transition: opacity .2s; }
.ap-range-row input[type=range]:hover { opacity: 1; }
.ap-range-row input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 25px; height: 25px; border-radius: 50%; background: #1f6feb; cursor: pointer; }
.ap-range-row input[type=range]::-moz-range-thumb { width: 25px; height: 25px; border-radius: 50%; background: #1f6feb; cursor: pointer; }
.ap-range-chip { flex: 0 0 auto; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; font-size: 13px; font-weight: 600; color: var(--text); min-width: 46px; text-align: center; }
@media (max-width: 1100px) { .pop-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 800px) {
  .ap-role-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ap-role-size { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .ap-top-panel { padding: 14px; }
  .ap-top-main { padding: 0; }
  .pop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ap-role-controls { grid-template-columns: 1fr; gap: 10px; }
  .ap-role-size { grid-column: auto; }
}

/* Columna de "Configuración" con su propio color de fondo y una raya completa que la separa del
   contenido, de arriba a abajo, igual que en Credit Repair Cloud. En escritorio (ver más abajo)
   el menú (.side) y esta columna (.subnav-wrap) nunca se mueven: cada uno mide siempre el alto
   completo de la pantalla y solo el contenido (.settings-body) tiene su propio scroll interno. */
.settings-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 0; }
.subnav-wrap { min-width: 0; background: #fafafa; border-right: 1px solid var(--line); padding: 16px 16px 16px 0; }
.settings-col { min-width: 0; }
.settings-body { min-width: 0; padding: 16px 0 16px 26px; }
.subnav-title { text-transform: uppercase; letter-spacing: .04em; font-weight: 700; font-size: 11.5px; color: var(--muted); margin: 0 0 8px 4px; }
.subnav { background: none; border: 0; border-radius: 0; padding: 0; }
.subnav a { display: flex; align-items: center; gap: 10px; padding: var(--sn-pady, 12px) var(--sn-padx, 14px); border-radius: 8px; color: var(--text); font-size: 14px; }
.subnav a:hover { background: var(--bg); text-decoration: none; }
.subnav a.active { background: color-mix(in srgb, var(--brand) 14%, var(--card)); color: var(--brand); font-weight: 600; }
.subnav .ic { width: 19px; height: 19px; flex-shrink: 0; }
.settings-body > .topbar { margin-bottom: 2px; }
.settings-tabs { display: flex; gap: 22px; box-shadow: 0 6px 8px -4px rgba(0, 0, 0, 0.12); margin: 12px 0 18px; overflow-x: auto; }
.settings-tabs a { padding: 0 0 10px; color: var(--muted); font-size: 14px; font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; }
.settings-tabs a:hover { color: var(--text); text-decoration: none; }
.settings-tabs a.active { color: var(--brand); border-color: var(--brand); font-weight: 700; }
/* Segunda fila de pestañas (nivel 2), como "Credit Bureau Details / Dispute Reasons / Dispute
   Instructions" dentro de "Dispute Options" en Credit Repair Cloud: más compacta y sin la sombra
   de la fila principal, para que se lea como subordinada a la pestaña de nivel 1 activa. */
.settings-tabs-sub { gap: 16px; box-shadow: none; margin: 25px 0 25px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.settings-tabs-sub a { font-size: 13px; padding-bottom: 8px; }
/* La raya que marca la pestaña activa en este segundo nivel usa un color fijo (pedido por Johan),
   distinto del color de marca que usa la primera fila de pestañas. */
.settings-tabs-sub a.active { border-color: #2c2c2c; }
.settings-subtitle { margin: 4px 0 2px; }
.settings-desc { margin: 4px 0 18px; max-width: 640px; font-size: 13.5px; }
/* "Todos los ajustes": encabezados con icono destacado y tarjetas blancas enlazables. */
.settings-ov-group { margin-bottom: 28px; }
.settings-ov-group h3 { display: flex; align-items: center; gap: 14px; margin: 0 0 12px; font-size: 19px; line-height: 1.2; }
.settings-ov-group h3 .ic { width: 48px; height: 48px; padding: 11px; box-sizing: border-box; border-radius: 11px; background: color-mix(in srgb, var(--brand) 11%, var(--card)); color: var(--brand); flex: 0 0 auto; }
.settings-ov-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px 16px; }
.settings-ov-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.settings-ov-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.settings-ov-card { display: flex; align-items: center; justify-content: space-between; min-height: 58px; padding: 15px 18px; border: 1px solid color-mix(in srgb, var(--brand) 14%, var(--line)); border-radius: 9px; color: var(--text); font-size: 15px; font-weight: 500; background: var(--card); }
.settings-ov-card::after { content: "\203A"; margin-left: 16px; color: var(--brand); font-size: 27px; font-weight: 400; line-height: 1; }
.settings-ov-card:hover { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, var(--card)); text-decoration: none; }
@media (max-width: 900px) { .settings-ov-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) {
  .settings-ov-grid-2, .settings-ov-grid-3 { grid-template-columns: 1fr; }
  .settings-ov-group h3 { font-size: 17px; }
}
/* Contenido de Configuración abierto (sin "cajas"), como Credit Repair Cloud: las secciones se separan
   con una línea fina, no con tarjetas flotantes. */
.settings-body .card { background: none; border: 0; border-radius: 0; box-shadow: none; padding: 0 0 26px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.settings-body .card:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 2px; }
.settings-body .card + .card { padding-top: 2px; }
.subnav-group { margin: 2px 0; }
.subnav-grp { width: 100%; display: flex; align-items: center; gap: 10px; padding: var(--sn-pady, 12px) var(--sn-padx, 14px); border-radius: 8px; background: none; border: 0; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; text-align: left; }
.subnav-grp:hover { background: var(--bg); }
.subnav-grp.in { color: var(--brand); font-weight: 600; }
/* El ícono de flecha (chevron) siempre mide igual: el control de "tamaño de ícono" de Apariencia
   → Menú (--sn-ic) no debe afectarlo, solo los íconos propios de cada sección. */
.subnav-grp .chev { margin-left: auto; width: 15px; height: 15px; flex-shrink: 0; transition: transform .15s ease; }
.subnav-grp .chev.ic, .subnav-grp .chev .ic { width: 15px !important; height: 15px !important; }
.subnav-group.open .subnav-grp .chev { transform: rotate(180deg); }
/* Los subitems (cuando un grupo está abierto) no encogen la caja resaltada como antes: el "indent"
   que los distingue del nivel superior va en el padding-izquierdo del propio link, igual que en
   Credit Repair Cloud, así el fondo resaltado sigue llegando casi al ancho completo de la columna. */
.subnav-sub { display: none; flex-direction: column; margin: 2px 0; }
.subnav-group.open .subnav-sub { display: flex; }
.subnav-sub a { display: flex; align-items: center; padding: var(--sn-pady, 12px) var(--sn-padx, 14px) var(--sn-pady, 12px) calc(var(--sn-padx, 14px) + 22px); border-radius: 8px; color: var(--muted); font-size: var(--sn-fs, 14px); font-family: var(--sn-font, inherit); font-weight: var(--sn-fw, 400); }
.subnav-sub a:hover { background: var(--bg); text-decoration: none; }
.subnav-sub a.active { background: color-mix(in srgb, var(--brand) 14%, var(--card)); color: var(--brand); font-weight: max(var(--sn-fw, 400), 600); }
@media (max-width: 800px) { .settings-layout { grid-template-columns: 1fr; } .subnav-wrap { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); margin: -16px -12px 12px; padding: 12px; } .subnav { position: static; display: flex; flex-wrap: wrap; gap: 2px; } .subnav-group { width: 100%; } .settings-body { padding: 0; } }

/* Campos con título flotante, como Credit Repair Cloud: en reposo el título se ve DENTRO del campo
   (como un placeholder); al enfocar el campo, o si ya tiene un valor, sube y queda sobre el borde.
   Los <select> (siempre muestran un valor elegido) y los campos con un ejemplo de relleno real
   (f.placeholder, p. ej. "smtp.gmail.com" — ver field() en core.js, clase .field-hint) mantienen el
   título siempre arriba, para no toparse con ese texto de ejemplo. */
select { appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238a94ab' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; background-size: 12px 8px; }
.field:not(.plain):has(> select, > textarea, > input:not([type=checkbox]):not([type=radio]):not([type=file])),
.field.field-select { position: relative; margin-top: 12px; margin-bottom: 14px; }
/* OJO: esta etiqueta flotante solo debe aplicar a un .field que en verdad envuelve un <select>/<textarea>/
   <input> (o tiene .field-select) — ese es el único caso en el que el .field de arriba recibe
   "position: relative" (regla justo arriba). Un .field usado solo como contenedor de un <label> + contenido
   libre (p. ej. "Estilo del texto general" en Tipografía, el título del selector de color, o los campos
   "status"/"palette" que usan .kebab en vez de un <input> hijo directo) NO tiene ese "position: relative",
   así que si esta regla no se limita igual, el label con "position: absolute" se posiciona respecto a un
   ancestro lejano y termina flotando en una esquina de la pantalla.
   El ":where(...)" de abajo es a propósito: agrega la misma condición SIN sumar especificidad (":where()"
   siempre cuenta como 0), para no ganarle a las reglas de abajo que ponen "top:-8px" cuando el campo ya
   tiene valor o foco — si esto se escribiera con ":has(...)" a secas (como se hizo antes), la selección
   quedaría más específica que esas reglas y el <select> se quedaría con la etiqueta congelada a medio
   camino, encimada con el valor elegido, en vez de subir chiquita arriba del campo. */
.field:not(.plain):where(:has(> select, > textarea, > input:not([type=checkbox]):not([type=radio]):not([type=file])), .field-select) > label {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%); z-index: 1; padding: 0; background: none; color: var(--muted);
  font-size: 14.5px; line-height: 16px; max-width: calc(100% - 30px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; pointer-events: none;
  transition: top .12s ease, font-size .12s ease, transform .12s ease, background-color .12s ease, padding .12s ease; }
.field:not(.plain):focus-within > label,
.field:not(.plain).field-hint > label,
.field:not(.plain).field-select > label,
.field:not(.plain):has(> select) > label,
.field:not(.plain):has(> input:not(:placeholder-shown)) > label,
.field:not(.plain):has(> textarea:not(:placeholder-shown)) > label {
  top: -8px; transform: none; left: 10px; padding: 0 5px; background: var(--card); font-size: 12px; }
.field:not(.plain):focus-within > label { color: var(--brand); }
.field:not(.plain) > select:focus, .field:not(.plain) > input:focus, .field:not(.plain) > textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
/* Campo bloqueado (p. ej. "País"), igual que el candadito gris de Credit Repair Cloud: valor fijo,
   no se puede tocar. */
.field-locked > input { background: var(--bg); color: var(--muted); cursor: not-allowed; padding-right: 34px; }
.field-locked > .ic { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }

.bureau-logo {    display: inline-flex;    align-items: center;    justify-content: center;    /* background: #fff; */    border-radius: 6px;    padding: 3px 8px;}
.bureau-logo img { height: 26px; max-width: 140px; object-fit: contain; display: block; } .bureau-logo.sm img { height: 21px; max-width: 80px; } .bureau-logo.sm { padding: 2px 6px; }
.gauge .g-name .bureau-logo { margin-top: 2px; }
.menu-wrap { position: relative; display: inline-block; }
.kebab { background: transparent; border: 0; color: var(--muted); cursor: pointer; padding: 4px 8px; border-radius: 6px; font-size: 20px; line-height: 1; } .kebab:hover { background: var(--bg); color: var(--text); }
.popmenu { position: absolute; right: 0; top: 100%; z-index: 30; min-width: 190px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 6px; }
.popmenu button { display: block; width: 100%; text-align: left; background: transparent; border: 0; color: var(--text); padding: 9px 12px; border-radius: 8px; cursor: pointer; font: inherit; font-size: 14px; } .popmenu button:hover { background: var(--bg); }
.bureau-table .ftable-cell { align-items: center; padding: 14px 10px; } .bureau-table .addr { white-space: pre-line; }
.bureau-table .nologo { color: var(--muted); font-size: 12.5px; }
.gauge .g-name { min-height: 32px; display: flex; align-items: center; justify-content: center; }

.ftiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 900px) { .ftiles { grid-template-columns: repeat(2, 1fr); } } @media (max-width: 560px) { .ftiles { grid-template-columns: 1fr; } }
.ftile { background: linear-gradient(160deg, var(--card), color-mix(in srgb, var(--brand) 6%, var(--card))); border: 1px solid var(--line); border-radius: 22px; padding: 16px 18px; box-shadow: 0 6px 18px rgba(20, 30, 60, .06); display: flex; flex-direction: column; gap: 10px; }
.ft-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; } .ft-title { font-size: 15px; font-weight: 500; }
.ft-go { flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; font-size: 14px; } .ft-go:hover { border-color: var(--brand); color: var(--brand); }
.ft-mid { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .ft-val { font-size: 30px; font-weight: 500; line-height: 1.1; }
.ft-st { width: 9px; height: 9px; border-radius: 50%; } .ft-st.good { background: var(--ok); } .ft-st.warn { background: #e0a020; } .ft-st.bad { background: var(--bad); }
.ft-badge { margin-left: auto; font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; color: #1c2a0a; }
.ft-badge.high { background: #b7ea75; } .ft-badge.medium { background: #d5ef8f; } .ft-badge.low { background: #f6a15a; }
.ft-desc { font-size: 12.5px; color: var(--muted); line-height: 1.4; } .ft-auto { opacity: .8; }

/* Menú lateral claro (predeterminado) */
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-sep { height: 1px; background: var(--line); margin: 16px 6px 12px; }
.side-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; color: var(--muted); padding: 0 14px 8px; }
.side .who small { display: block; font-size: 12px; opacity: .75; }
.layout.collapsed .side-label, .layout.collapsed .who small { display: none; }
.side a { padding: 10px 14px; font-size: 14.5px; font-weight: 500; }
.layout.collapsed .side a { padding: 10px 0; }
:root:not([data-side="dark"]) .side { background: linear-gradient(190deg, var(--card) 0%, color-mix(in srgb, var(--brand) 5%, var(--card)) 55%, color-mix(in srgb, var(--brand) 14%, var(--card)) 100%); color: var(--muted); border-right: 1px solid var(--line); padding: 22px 14px; }
:root:not([data-side="dark"]) .side a { color: var(--muted); }
:root:not([data-side="dark"]) .side a:hover { background: color-mix(in srgb, var(--brand) 9%, transparent); color: var(--text); }
:root:not([data-side="dark"]) .side a.active { background: var(--brand); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--brand) 35%, transparent); }
:root:not([data-side="dark"]) .brand .bname { color: var(--brand); }
:root:not([data-side="dark"]) .side-toggle { color: var(--muted); } :root:not([data-side="dark"]) .side-toggle:hover { background: color-mix(in srgb, var(--brand) 9%, transparent); color: var(--brand); }
:root:not([data-side="dark"]) .side .who { color: var(--text); }
:root:not([data-side="dark"]) .side .who a { color: var(--muted); padding-left: 0; }
:root[data-side="dark"] .side .who a { padding-left: 0; }

.g-dash { grid-template-columns: repeat(auto-fit, minmax(min(100%, 430px), 1fr)); }
.h2-sub { display: block; font-size: 12.5px; font-weight: 400; color: var(--muted); margin-top: 2px; }
h2 { text-wrap: balance; }
/* En escritorio, el contenido tiene su propio scroll y los menús quedan completamente afuera de
   esa zona: nunca se mueven, igual que el pie "Secure Area", que queda fijo abajo (no se
   desplaza con el contenido), como en Credit Repair Cloud.
   - .main es una columna fija de 100vh: arriba el contenido con scroll propio (.main-scroll),
     abajo el pie, siempre visible.
   - En Configuración, la 2ª columna (.settings-col) repite el mismo patrón: arriba
     .settings-body con su scroll propio, abajo el mismo pie fijo. La columna del menú
     (.subnav-wrap) mide 100vh completos, así que su borde divisorio queda completo de arriba
     a abajo, incluso junto al pie. */
@media (min-width: 801px) {
  .main { height: 100vh; display: flex; flex-direction: column; padding: 0; overflow: hidden; }
  .main-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 26px 30px; }
  .settings-layout { grid-template-columns: 265px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); height: 100vh; }
  .subnav a { white-space: nowrap; }
  .subnav-wrap { height: 100%; overflow-y: auto; padding: 40px 10px 16px 10px; }
  .settings-col { height: 100%; display: flex; flex-direction: column; }
  .settings-body { flex: 1; min-height: 0; overflow-y: auto; padding: 42px 30px 26px 26px; }
  /* La sombra bajo las tabs se pega al área del menú: llega hasta el divisor a la izquierda y
     hasta el borde derecho, igual que en Credit Repair Cloud (los márgenes negativos cancelan
     el padding de .settings-body y el padding interno mantiene las pestañas en su lugar). */
  .settings-tabs { margin-left: -26px; margin-right: -30px; padding: 0 30px 0 26px; }
  .secure-footer { flex-shrink: 0; margin-top: 0; padding: 12px 30px; }
  .settings-col .secure-footer { padding-left: 26px; }
}
.card td a, .card td b { overflow-wrap: normal; }
.card{overflow-x:auto}
.card table td,.card table th{padding-left:8px;padding-right:8px}
.card table td.nw,.card table td .nw{white-space:nowrap}
.card table td{overflow-wrap:anywhere}
.card table td a,.card table td b{ color: var(--brand); font-weight: 700; font-size: 14px; text-decoration: underline; overflow-wrap:normal;white-space:nowrap}
.g-dash .card table td{padding-left:6px;padding-right:6px;font-size:14px}
.side-top { border-bottom: 1px solid var(--line); margin: 0 6px 14px; padding: 2px 0 16px; }
.side .who { border-top: 1px solid var(--line); margin: 0 6px; padding: 14px 6px 8px; }
.bureau-logo.lg img { height: 34px; max-width: 150px; } .bureau-logo.lg { padding: 4px 10px; }
.due-list { margin-top: 6px; }
.due-row { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(0, 1.5fr) auto; align-items: center; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.due-row:last-child { border-bottom: 0; }
.due-name a { font-weight: 600; }
.due-bureau { display: flex; align-items: center; gap: 12px; min-width: 0; }
.due-round { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.due-date { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-weight: 600; white-space: nowrap; }
.due-date .badge { font-weight: 600; }
.due-row { grid-template-columns: minmax(96px, 1fr) minmax(0, 1.2fr) auto; gap: 16px; }
.due-bureau { flex-direction: column; align-items: flex-start; gap: 4px; }
/* Formulario de cliente (por secciones) */
.modal.wide { max-width: 980px; max-height: 92vh; overflow-y: auto; }
.cform .fsec { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 16px 16px 6px; margin-bottom: 14px; }
.cform .fsec h3 { font-size: 15px; margin: 0 0 12px; }
.fgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.fgrid[hidden] { display: none; }
.fgrid .field { margin-bottom: 14px; }
.chk { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; margin: 2px 0 14px; }
/* El tamaño/color del checkbox y radio de ".chk" ahora viene del estilo personalizado único definido
   al inicio de la hoja (ver el bloque junto a "* { box-sizing: border-box; }") — así se ve idéntico
   en todos lados, en vez de tener un tamaño propio aquí que no coincida con el resto del sitio. */
.ssnf { position: relative; } .ssnf input { padding-right: 40px; } .ssnf .eye { position: absolute; right: 8px; top: 8px; }
.portalsw { grid-column: span 2; align-self: center; }
@media (max-width: 800px) { .fgrid { grid-template-columns: 1fr; } .portalsw { grid-column: auto; } }

.portalsw { grid-column: span 3; padding: 2px 0 12px; } .portalsw .pl { font-size: 14px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.tip { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; border-radius: 50%; background: #9aa3b5; color: #fff; font: 700 11px/1 serif; cursor: help; }
.tip .tipbox { display: none; position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); width: 270px; background: #5a5a5a; color: #fff; font: 500 13px/1.4 var(--font, sans-serif); padding: 10px 12px; border-radius: 8px; z-index: 5; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.tip:hover .tipbox, .tip:focus .tipbox { display: block; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch i { width: 38px; height: 22px; border-radius: 999px; background: #9aa3b5; position: relative; transition: background .15s; flex: none; }
.switch i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.switch input:checked + i { background: var(--brand); } .switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { outline: 2px solid var(--brand); outline-offset: 2px; }
.switch .on { display: none; } .switch input:checked ~ .swl .on { display: inline; } .switch input:checked ~ .swl .off { display: none; }
.switch-field { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.switch-label { font-size: 14px; color: var(--text); }
@media (max-width: 800px) { .portalsw { grid-column: auto; } }

/* Selector de fecha */
.dp { position: relative; } .dp .dp-txt { width: 100%; padding-right: 44px; }
.dp-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); padding: 6px; border-radius: 8px; cursor: pointer; display: flex; }
.dp-btn:hover { color: var(--text); background: var(--bg); }
.dp-pop { position: fixed; z-index: 9999; width: 320px; background: var(--card); color: var(--text); border-radius: 6px; box-shadow: 0 6px 24px rgba(0,0,0,.28); padding: 12px 10px 14px; border: 1px solid var(--line); }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; padding: 0 4px; }
.dp-my { border: 0; background: none; font: inherit; font-size: 15px; color: var(--text); cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-radius: 8px; }
.dp-my i { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 5px solid currentColor; } .dp-my i.up { border-top: 0; border-bottom: 5px solid currentColor; }
.dp-nav button { border: 0; background: none; font-size: 22px; line-height: 1; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; color: var(--text); } .dp-nav button:hover:not(:disabled) { background: var(--bg); } .dp-nav button:disabled { color: var(--line); cursor: default; }
.dp-week, .dp-days { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; }
.dp-week span { font-size: 12px; color: var(--muted); padding: 6px 0; }
.dp-days button, .dp-days span { height: 38px; } .dp-days button { border: 0; background: none; font: inherit; font-size: 14px; color: var(--text); border-radius: 50%; cursor: pointer; width: 38px; margin: 0 auto; }
.dp-days button:hover:not(:disabled) { background: var(--bg); } .dp-days button.today { box-shadow: inset 0 0 0 1px var(--muted); } .dp-days button.on { background: var(--brand); color: #fff; } .dp-days button:disabled { color: var(--line); cursor: default; }
.dp-years { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; max-height: 250px; overflow-y: auto; position: relative; }
.dp-years button { border: 0; background: none; font: inherit; font-size: 14px; padding: 12px 0; border-radius: 999px; cursor: pointer; color: var(--text); } .dp-years button:hover { background: var(--bg); } .dp-years button.on { background: var(--brand); color: #fff; font-weight: 600; }

/* Selector múltiple (chips) */
.ms-box { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); cursor: pointer; }
.ms-box:focus, .ms-box:focus-visible { outline: 2px solid var(--brand); outline-offset: -1px; }
.ms-chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.ms-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px 6px 3px 12px; font-size: 14px; }
.ms-chip b { width: 18px; height: 18px; border-radius: 50%; background: #9aa3b5; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; line-height: 1; cursor: pointer; } .ms-chip b:hover { background: #667089; }
.ms-arrow { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 4px solid var(--muted); flex: none; }
.ms-pop { position: fixed; z-index: 9999; background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.25); padding: 6px 0; max-height: 240px; overflow-y: auto; }
.ms-pop button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: none; font: inherit; font-size: 14px; color: var(--text); padding: 9px 14px; cursor: pointer; } .ms-pop button:hover { background: var(--bg); }
.ms-pop button i { width: 16px; height: 16px; border: 1.5px solid var(--muted); border-radius: 4px; flex: none; } .ms-pop button.on i { background: var(--brand); border-color: var(--brand); box-shadow: inset 0 0 0 2px var(--card); }
.field:not(.plain):has(> .dp, > .ms) { position: relative; margin-top: 12px; margin-bottom: 14px; }
.field:not(.plain):has(> .dp, > .ms) > label { position: absolute; top: -8px; left: 10px; z-index: 1; padding: 0 5px; background: var(--card); font-size: 12px; line-height: 16px; color: var(--muted); pointer-events: none; }
.field:not(.plain):focus-within > label { color: var(--brand); }
.cform .field > label { background: var(--bg) !important; }
.dp .dp-txt:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }

/* Agenda */
.btn.green { background: #16a34a; border-color: #16a34a; color: #fff; } .btn.green:hover { background: #128a3f; }
.icon-btn { border: 0; background: none; width: 36px; height: 36px; border-radius: 50%; font-size: 24px; line-height: 1; cursor: pointer; color: var(--brand); } .icon-btn:hover { background: var(--bg); }
.sc-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.sc-nav, .sc-tools { display: flex; align-items: center; gap: 8px; } .sc-tools .field { margin: 0; min-width: 220px; }
.sc-title { margin: 0 8px; font-size: 20px; font-weight: 500; }
.sc-wrap { background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: auto; }
.sc-grid { min-width: calc(60px + var(--n) * 96px); }
.sc-row { display: grid; grid-template-columns: 76px repeat(var(--n), minmax(0, 1fr)); border-bottom: 1px solid var(--line); padding-right: var(--sbw, 0px); }
.sc-gut { font-size: 12px; color: var(--muted); padding: 8px 6px; text-align: center; display: flex; align-items: center; justify-content: center; }
.sc-dh { text-align: center; font-size: 12.5px; font-weight: 600; color: var(--brand); padding: 14px 4px; border-left: 1px solid var(--line); } .sc-dh.today { background: color-mix(in srgb, var(--brand) 8%, transparent); }
.sc-adc { border-left: 1px solid var(--line); min-height: 44px; padding: 3px; display: flex; flex-direction: column; gap: 2px; } .sc-adc.today { background: color-mix(in srgb, var(--brand) 6%, transparent); }
.sc-scroll { max-height: 62vh; overflow-y: auto; }
.sc-body { display: grid; grid-template-columns: 76px repeat(var(--n), minmax(0, 1fr)); }
.sc-hours { display: block; padding: 0; } .sc-hl { position: relative; border-bottom: 1px solid var(--line); } .sc-hl span { position: absolute; top: 6px; left: 0; right: 0; font-size: 11.5px; color: var(--muted); }
.sc-col { position: relative; border-left: 1px solid var(--line); cursor: pointer; background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 29px, var(--line) 29px, var(--line) 30px, transparent 30px, transparent 59px, var(--line) 59px, var(--line) 60px); background-size: 100% 60px; }
.sc-col.today { background-color: color-mix(in srgb, var(--brand) 6%, transparent); }
.sc-ev { position: absolute; color: #fff; border-radius: 4px; padding: 2px 6px; font-size: 12px; line-height: 1.3; overflow: hidden; cursor: pointer; box-shadow: 0 0 0 1px rgba(255,255,255,.55); }
.sc-ev b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .sc-ev span { display: block; opacity: .9; font-size: 11px; }
.sc-chip { position: static; white-space: nowrap; text-overflow: ellipsis; box-shadow: none; margin-bottom: 2px; }
.sc-now { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid #e5342b; pointer-events: none; z-index: 2; }
.sc-month { min-width: 720px; } .sc-mh { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); } .sc-mh div { text-align: center; font-size: 12.5px; font-weight: 600; padding: 12px 0; }
.sc-mg { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.sc-mc { min-height: 118px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px; cursor: pointer; } .sc-mc:nth-child(7n) { border-right: 0; }
.sc-mc.other { background: var(--bg); } .sc-mc.today { background: color-mix(in srgb, var(--brand) 8%, transparent); }
.sc-mn { text-align: right; font-size: 18px; color: var(--text); padding: 2px 6px 6px; } .sc-mc.other .sc-mn { color: var(--muted); }
.sc-more { display: block; text-align: center; font-size: 12px; color: var(--brand); cursor: pointer; }
.sc-pop { position: fixed; z-index: 9990; width: 290px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 28px rgba(0,0,0,.3); }
.sc-pop-h { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; background: var(--bg); font-size: 14px; } .sc-pop-h button { border: 0; background: none; font-size: 20px; cursor: pointer; color: var(--muted); }
.sc-pop-b { padding: 8px; max-height: 260px; overflow-y: auto; }

/* Agenda: lenguaje visual compartido con Tasks & Events. */
.sc-page { min-width: 0; background: color-mix(in srgb, var(--brand) 3%, var(--card)); border-radius: 16px; box-shadow: none; }
.sc-head { display: flex; align-items: center; gap: 14px; padding: 0px 0 14px; }
.sc-head-copy h1 { margin: 0; color: var(--text); font-size: 29px; line-height: 1.1; }
.sc-head-copy .muted { margin-top: 4px; font-size: 13px; }
.sc-tabs { margin: 0 0 18px; padding: 0; gap: 28px; box-shadow: none; border-bottom: 1px solid var(--line); }
.sc-tabs a { padding: 0 8px 12px; font-size: 13px; font-weight: 600; }
.sc-tabs a.active { border-bottom-width: 3px; }
.sc-page .sc-bar { margin: 0 0 14px; gap: 14px; }
.sc-page .sc-nav, .sc-page .sc-tools { gap: 10px; }
.sc-page .sc-nav { flex-wrap: wrap; }
.sc-page .icon-btn.sc-nav-btn, .sc-page .icon-btn.sc-action-btn { width: 46px; height: 46px; border: 1px solid color-mix(in srgb, var(--brand) 8%, var(--line)); border-radius: 10px; background: color-mix(in srgb, var(--brand) 8%, var(--card)); font-size: 28px; line-height: 1; }
.sc-page .icon-btn.sc-nav-btn:hover, .sc-page .icon-btn.sc-action-btn:hover { background: color-mix(in srgb, var(--brand) 15%, var(--card)); }
.sc-action-btn .ic { width: 21px; height: 21px; }
.sc-page .sc-title { min-height: 46px; display: inline-flex; align-items: center; margin: 0; padding: 0 17px; border: 1px solid color-mix(in srgb, var(--brand) 14%, var(--line)); border-radius: 10px; background: var(--card); color: var(--text); font-size: 15px; font-weight: 700; white-space: nowrap; }
.sc-page .sc-today { min-height: 46px; padding: 0 17px; border: 1px solid color-mix(in srgb, var(--brand) 10%, var(--line)); border-radius: 10px; background: color-mix(in srgb, var(--brand) 9%, var(--card)); color: var(--brand); font-weight: 700; }
.sc-page .sc-tools { flex-wrap: wrap; }
.sc-page .sc-tools .field { min-width: 218px; margin: 0; }
.sc-page .sc-tools .field > label { color: var(--brand); font-weight: 600; }
.sc-page .sc-tools .select-like { min-height: 46px; border-radius: 10px; padding-top: 11px; padding-bottom: 11px; }
.sc-page .sc-add-btn { min-height: 46px; display: inline-flex; align-items: center; gap: 8px; padding: 0 19px !important; border-radius: 10px; font-weight: 700; white-space: nowrap; }
.sc-page .sc-add-btn .ic { width: 20px; height: 20px; }
.sc-page .sc-wrap { border: 1px solid color-mix(in srgb, var(--brand) 12%, var(--line)); border-radius: 11px; box-shadow: 0 7px 20px rgba(44, 92, 150, .05); background: var(--card); }
.sc-page .sc-grid { min-width: calc(76px + var(--n) * 120px); }
.sc-page .sc-row { border-bottom-color: color-mix(in srgb, var(--brand) 9%, var(--line)); }
.sc-page .sc-gut { color: color-mix(in srgb, var(--text) 72%, var(--muted)); font-weight: 600; }
.sc-page .sc-dh { min-height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 7px 4px; border-left-color: color-mix(in srgb, var(--brand) 9%, var(--line)); background: color-mix(in srgb, var(--brand) 4%, var(--card)); }
.sc-page .sc-dh b { font-size: 12px; font-weight: 700; }
.sc-page .sc-dh span { font-size: 11px; color: var(--muted); }
.sc-page .sc-dh.today { background: color-mix(in srgb, var(--brand) 13%, var(--card)); color: var(--brand); }
.sc-page .sc-adc { min-height: 44px; padding: 5px 7px; border-left-color: color-mix(in srgb, var(--brand) 9%, var(--line)); background: var(--card); }
.sc-page .sc-adc.today { background: color-mix(in srgb, var(--brand) 6%, var(--card)); }
.sc-page .sc-scroll { max-height: 62vh; background: var(--card); }
.sc-page .sc-hl { border-bottom-color: color-mix(in srgb, var(--brand) 9%, var(--line)); }
.sc-page .sc-hl span { top: 7px; font-size: 11px; font-weight: 600; color: var(--muted); }
.sc-page .sc-col { border-left-color: color-mix(in srgb, var(--brand) 9%, var(--line)); background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 29px, color-mix(in srgb, var(--brand) 9%, var(--line)) 29px, color-mix(in srgb, var(--brand) 9%, var(--line)) 30px, transparent 30px, transparent 59px, color-mix(in srgb, var(--brand) 9%, var(--line)) 59px, color-mix(in srgb, var(--brand) 9%, var(--line)) 60px); }
.sc-page .sc-col.today { background-color: color-mix(in srgb, var(--brand) 6%, var(--card)); }
.sc-page .sc-ev { z-index: 1; border-left: 4px solid var(--sc-color, var(--brand)); border-radius: 7px; padding: 5px 9px; background: color-mix(in srgb, var(--sc-color, var(--brand)) 14%, var(--card)); color: color-mix(in srgb, var(--sc-color, var(--brand)) 70%, var(--text)); box-shadow: 0 1px 3px rgba(31, 55, 88, .08); }
.sc-page .sc-ev b { font-size: 12px; }
.sc-page .sc-ev span { color: color-mix(in srgb, var(--sc-color, var(--brand)) 75%, var(--text)); font-size: 10.5px; opacity: 1; }
.sc-page .sc-chip { margin-bottom: 3px; padding: 4px 8px; }
.sc-page .sc-task-chip { border: 1px dashed var(--brand); border-left: 4px solid var(--brand); background: var(--info-bg) !important; color: var(--brand) !important; box-shadow: none; }
.sc-page .sc-task-chip .ic { width: 13px; height: 13px; color: var(--brand); }
.sc-page .sc-now { border-top-width: 2px; box-shadow: 0 0 0 1px rgba(229, 52, 43, .08); }
.sc-page .sc-month { min-width: 720px; }
.sc-page .sc-mh { border-bottom-color: color-mix(in srgb, var(--brand) 10%, var(--line)); background: color-mix(in srgb, var(--brand) 4%, var(--card)); }
.sc-page .sc-mh div { padding: 10px 0; color: color-mix(in srgb, var(--text) 72%, var(--muted)); font-size: 11px; }
.sc-page .sc-mg { background: var(--card); }
.sc-page .sc-mc { min-height: 118px; padding: 6px; border-right-color: color-mix(in srgb, var(--brand) 9%, var(--line)); border-bottom-color: color-mix(in srgb, var(--brand) 9%, var(--line)); }
.sc-page .sc-mc.other { background: color-mix(in srgb, var(--brand) 2%, var(--bg)); }
.sc-page .sc-mc.today { background: color-mix(in srgb, var(--brand) 10%, var(--card)); }
.sc-page .sc-mn { padding: 2px 5px 6px; font-size: 14px; font-weight: 700; }
.sc-page .sc-mc.other .sc-mn { color: var(--muted); }
.sc-page .sc-more { padding: 3px 0; font-weight: 600; }
.sc-page .sc-pop { border-color: color-mix(in srgb, var(--brand) 15%, var(--line)); border-radius: 10px; box-shadow: 0 12px 30px rgba(31, 55, 88, .18); overflow: hidden; }
.sc-page .sc-pop-h { padding: 10px 12px; background: color-mix(in srgb, var(--brand) 6%, var(--card)); font-weight: 700; }

@media (max-width: 1000px) {
  .sc-tabs { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
  .sc-page .sc-bar { align-items: stretch; flex-direction: column; }
  .sc-page .sc-nav, .sc-page .sc-tools { width: 100%; }
  .sc-page .sc-tools { justify-content: flex-end; }
  .sc-page .sc-tools .field { flex: 1 1 220px; }
}
@media (max-width: 680px) {
  .sc-page { border-radius: 13px; }
  .sc-head { padding-top: 14px; }
  .sc-head-copy h1 { font-size: 25px; }
  .sc-head-copy .muted { font-size: 12px; }
  .sc-tabs { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; gap: 12px; }
  .sc-tabs a { padding-left: 5px; padding-right: 5px; }
  .sc-page .sc-nav { display: grid; grid-template-columns: 46px 46px minmax(0, 1fr); }
  .sc-page .sc-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .sc-page .sc-today { grid-column: 1 / -1; width: 100%; }
  .sc-page .sc-tools { display: grid; grid-template-columns: 46px 1fr; }
  .sc-page .sc-tools .field { min-width: 0; width: 100%; }
  .sc-page .sc-tools .field-select { grid-column: 2; }
  .sc-page .sc-add-btn { grid-column: 1 / -1; width: 100%; justify-content: center; }
  .sc-page .sc-grid { min-width: calc(76px + var(--n) * 110px); }
  .sc-page .sc-month { min-width: 650px; }
}
@media (max-width: 430px) {
  .sc-page .sc-head { align-items: flex-start; }
  .sc-head-copy h1 { font-size: 23px; }
  .sc-page .sc-nav { grid-template-columns: 42px 42px minmax(0, 1fr); }
  .sc-page .icon-btn.sc-nav-btn { width: 42px; height: 42px; }
  .sc-page .sc-title { font-size: 13px; }
  .sc-page .sc-tools { grid-template-columns: 42px 1fr; }
  .sc-page .icon-btn.sc-action-btn { width: 42px; height: 42px; }
}
/* formulario de evento */
.evform .ev-r1 { display: grid; grid-template-columns: 76px 1fr; gap: 12px; align-items: start; }
.ev-dt { display: grid; grid-template-columns: 1fr 1fr 16px 1fr 1fr; gap: 0 8px; align-items: start; } .ev-dash { text-align: center; padding-top: 12px; color: var(--muted); }
.ev-r2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.evc { position: relative; margin-top: 12px; } .evc-btn { width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
.evc-btn i { width: 34px; height: 26px; border-radius: 5px; display: block; } .evc-btn b { border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid var(--muted); }
.evc-pop { position: absolute; z-index: 20; top: 50px; left: 0; width: 420px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 28px rgba(0,0,0,.28); padding: 10px; display: grid; grid-template-columns: repeat(11, 1fr); gap: 6px; } .evc-pop[hidden] { display: none; }
.evc-pop button { height: 26px; border: 0; border-radius: 4px; cursor: pointer; } .evc-pop .evc-none { grid-column: 1 / -1; height: 30px; background: none; border: 2px solid #16a34a; color: #16a34a; font-weight: 600; background: var(--card); }
@media (max-width: 800px) { .ev-dt, .ev-r2 { grid-template-columns: 1fr; } .ev-dash { display: none; } .evc-pop { width: 280px; grid-template-columns: repeat(6, 1fr); } .sc-tools .field { min-width: 0; flex: 1; } }
/* Ventanas más amplias y con más aire */
.modal { max-width: 780px; padding: 30px 34px; max-height: 92vh; overflow-y: auto; }
.modal.wide { max-width: 1040px; }
.modal h2 { font-size: 21px; margin-bottom: 22px; }
.modal .field { margin-bottom: 24px !important; margin-top: 14px !important; }
.modal .field > input, .modal .field > select, .modal .field > textarea, .modal .dp-txt, .modal .ms-box { padding-top: 14px; padding-bottom: 14px; font-size: 15px; }
.modal .field > textarea { min-height: 110px; }
.modal .dp-txt { min-width: 0; }
.modal .fields2 { gap: 0 20px; }
.modal .actions { margin-top: 30px; gap: 12px; } .modal .actions .btn { padding: 11px 22px; }
.fgrid { gap: 0 22px; } .cform .fsec { padding: 24px 24px 8px; margin-bottom: 20px; } .cform .fsec h3 { margin-bottom: 18px; font-size: 16px; }
.ev-dt { gap: 0 14px; grid-template-columns: 1.3fr 1fr 16px 1.3fr 1fr; } .ev-r2 { gap: 0 22px; } .evform .ev-r1 { gap: 16px; grid-template-columns: 84px 1fr; }
.evc-btn { height: 50px; }
.chk { margin: 4px 0 24px; font-size: 15px; }
@media (max-width: 800px) { .modal { padding: 22px 18px; } }
.modal .ms-box { min-height: 52px; padding-top: 6px; padding-bottom: 6px; } .modal .ms-chip { padding-top: 2px; padding-bottom: 2px; }
/* Ventana chica para formularios cortos (p. ej. Nuevo/Editar Estado De Cliente), del mismo tamaño
   que usa Credit Repair Cloud, en vez del tamaño grande que se usa en el resto del sitio. */
.modal.compact { max-width: 440px; padding: 22px 24px; }
.modal.compact h2 { font-size: 17px; margin-bottom: 14px; }
.modal.compact .field { margin-bottom: 14px !important; margin-top: 0 !important; }
.modal.compact label { margin-bottom: 6px; }
.modal.compact .field > input, .modal.compact .field > select, .modal.compact .field > textarea, .modal.compact .dp-txt, .modal.compact .ms-box { padding-top: 9px; padding-bottom: 9px; font-size: 14px; }
.modal.compact .actions { margin-top: 16px; gap: 8px; } .modal.compact .actions .btn { padding: 8px 16px; }
@media (max-width: 800px) { .modal.compact { padding: 18px 16px; } }

.evnotif { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 20px 22px 8px; margin-top: 6px; } .evnotif h3 { font-size: 16px; margin: 0 0 12px; } .evnotif .chk { margin-bottom: 6px; } .evhint { margin: 0 0 18px 28px; } .evnotif > .muted.small:last-child { margin: -6px 0 14px; }

/* ---------- Tareas ("Task & Eventos" / "Tasks & Events" de Credit Repair Cloud) — ver
   public/tasks.js. El diseño (encabezado con ícono, franjas Vencidas/Próximas con ícono en círculo,
   botones de Editar/Eliminar por fila, menús de dos líneas para los filtros) sigue al detalle un
   mockup que Johan mandó (creado con ChatGPT a partir de la página de CRC), así que estas reglas
   son intencionalmente más "vistosas" (iconos en cajas de color, degradados) que el resto del sitio. */
.tk-page { min-height: calc(100vh - 52px); background: color-mix(in srgb, var(--brand) 3%, var(--card)); border-radius: 18px; box-shadow: 0 14px 38px rgba(44, 92, 150, .08); }
.tk-head { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 16px; }
.tk-head h1 { margin: 0; color: var(--text); font-size: 32px; line-height: 1.1; }
.tk-hicon { flex: 0 0 auto; width: 66px; height: 66px; border-radius: 15px; background: color-mix(in srgb, var(--brand) 11%, var(--card)); color: var(--brand); display: flex; align-items: center; justify-content: center; }
.tk-hicon .ic { width: 32px; height: 32px; }
.tk-video-pill { display: inline-flex; align-items: center; justify-self: start; gap: 8px; background: color-mix(in srgb, var(--brand) 4%, var(--card)); border: 1px solid color-mix(in srgb, var(--brand) 65%, var(--line)); color: var(--brand); border-radius: 9px; padding: 8px 14px 8px 8px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.tk-video-pill .ic { width: 22px; height: 22px; padding: 4px; box-sizing: border-box; background: var(--brand); color: #fff; border-radius: 50%; }
.tk-video-pill:hover, .tk-bulk-btn:hover, .tk-iconbtn:hover { filter: brightness(.97); }

.tk-tabs { margin: 26px -30px 0; padding: 0 30px; border-bottom: 1px solid var(--line); gap: 28px; }
.tk-tabs a { padding: 0 10px 16px; color: var(--muted); font-size: 15px; font-weight: 600; cursor: pointer; }
.tk-tabs a.active { color: var(--brand); border-bottom: 3px solid var(--brand); }
.tk-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; padding: 18px 0 20px; margin: 0 0 2px; }
.tk-toolbar .row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tk-bulk-btn { min-height: 60px; display: inline-flex; align-items: center; gap: 10px; background: color-mix(in srgb, var(--brand) 9%, var(--card)); border: 0; color: var(--brand); font: inherit; font-weight: 600; font-size: 15px; padding: 0 18px; border-radius: 10px; cursor: pointer; }
.tk-bulk-btn .ic { width: 21px; height: 21px; }
.tk-bulk-btn .chev { display: inline-flex; margin-left: 8px; opacity: .7; }
.tk-iconbtn { width: 60px; height: 60px; border-radius: 10px; background: color-mix(in srgb, var(--brand) 9%, var(--card)); color: var(--brand); border: 0; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.tk-iconbtn .ic { width: 23px; height: 23px; }

.tk-dd .tk-dd-trigger { min-width: 218px; min-height: 60px; display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid color-mix(in srgb, var(--brand) 15%, var(--line)); border-radius: 10px; padding: 8px 14px; cursor: pointer; font: inherit; color: var(--text); }
.tk-dd .tk-dd-trigger .ic { width: 22px; height: 22px; color: var(--muted); flex: 0 0 auto; }
.tk-dd-text { display: flex; flex-direction: column; text-align: left; line-height: 1.25; min-width: 0; }
.tk-dd-text b { font-size: 12px; font-weight: 600; color: var(--brand); text-transform: none; letter-spacing: 0; }
.tk-dd-text span { font-size: 15px; font-weight: 600; white-space: nowrap; }
.tk-dd .chev { display: inline-flex; margin-left: auto; opacity: .6; }
.tk-toolbar > .row:last-child .btn.primary { min-height: 60px; padding: 0 22px; border-radius: 10px; font-size: 16px; white-space: nowrap; }

.tk-list-card { background: var(--card); border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 8px 24px rgba(44, 92, 150, .06); overflow-x: auto; }
.tk-banded { overflow: visible; }
.tk-band { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 12px 24px; border-radius: 15px 15px 0 0; font-weight: 700; font-size: 18px; color: #fff; }
.tk-band:not(:first-child) { margin-top: 28px; }
.tk-band-ic { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; background: rgba(255,255,255,.92); color: currentColor; display: flex; align-items: center; justify-content: center; }
.tk-band-ic .ic { width: 17px; height: 17px; color: var(--bad); }
.tk-band.upcoming .tk-band-ic .ic { color: var(--warn); }
.tk-band.overdue { background: linear-gradient(90deg, color-mix(in srgb, var(--bad) 95%, #f15d66), var(--bad)); }
.tk-band.upcoming { background: linear-gradient(90deg, color-mix(in srgb, var(--warn) 95%, #ffb029), var(--warn)); }
.tk-banded > .ftable { background: var(--card); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 15px 15px; box-shadow: 0 8px 24px rgba(44, 92, 150, .06); overflow: hidden; }
.tk-list-card .ftable-row.head, .tk-banded > .ftable .ftable-row.head { background: color-mix(in srgb, var(--brand) 4%, var(--card)); }
.tk-list-card .ftable-row.head .ftable-cell, .tk-banded > .ftable .ftable-row.head .ftable-cell { color: color-mix(in srgb, var(--text) 72%, var(--muted)); font-size: 14px; text-transform: none; letter-spacing: 0; font-weight: 700; }
.tk-list-card .ftable-cell, .tk-banded > .ftable .ftable-cell { min-height: 57px; display: flex; align-items: center; padding: 12px 16px; font-size: 15px; }
.tk-list-card .ftable-row, .tk-banded > .ftable .ftable-row { min-width: 900px; }
.tk-list-card .ftable-cell.wide, .tk-banded > .ftable .ftable-cell.wide { flex-basis: 360px; }
.tk-list-card .ftable-cell.shrink, .tk-banded > .ftable .ftable-cell.shrink { min-width: 205px; }
.tk-list-card .ftable-cell a, .tk-banded > .ftable .ftable-cell a { color: var(--brand); text-decoration: none; font-size: inherit; font-weight: 600; }
.tk-list-card .ftable-cell a:hover, .tk-banded > .ftable .ftable-cell a:hover { text-decoration: underline; }
.tk-title { display: flex; align-items: center; gap: 0; min-width: 0; font-weight: 500; }
.tk-title .ic { display: none; }
.tk-title-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-type { margin-left: 5px; color: var(--muted); font-weight: 400; white-space: nowrap; }
.ftable-row.dim { opacity: .6; }
.strike { text-decoration: line-through; }
.tk-overdue-text { color: var(--bad); font-weight: 600; }
.tk-noclient { color: var(--brand); font-weight: 600; }
.tk-rowbtns { display: flex; gap: 12px; }
.tk-btn-edit, .tk-btn-del { min-height: 38px; display: inline-flex; align-items: center; gap: 7px; border-radius: 9px; padding: 0 14px; font: inherit; font-size: 14px; font-weight: 600; border: 0; cursor: pointer; white-space: nowrap; }
.tk-btn-edit { background: color-mix(in srgb, var(--brand) 10%, var(--card)); color: var(--brand); }
.tk-btn-del { background: var(--bad-bg); color: var(--bad); }
.tk-btn-edit:hover, .tk-btn-del:hover { filter: brightness(.96); }
.tk-btn-edit .ic, .tk-btn-del .ic { width: 16px; height: 16px; }
.tk-completed-list { margin-top: 24px; }

@media (max-width: 1000px) {
  .tk-page { padding: 24px 22px 28px; }
  .tk-tabs { margin-left: -22px; margin-right: -22px; padding-left: 22px; padding-right: 22px; }
  .tk-toolbar { align-items: stretch; flex-direction: column; }
  .tk-toolbar > .row { width: 100%; }
  .tk-toolbar > .row:last-child { justify-content: stretch; }
  .tk-toolbar > .row:last-child .tk-dd { flex: 1 1 190px; }
  .tk-toolbar > .row:last-child .tk-dd-trigger { width: 100%; }
  .tk-toolbar > .row:last-child .btn.primary { margin-left: auto; }
}
@media (max-width: 680px) {
  .tk-page { padding: 18px 16px 24px; border-radius: 14px; }
  .tk-head { grid-template-columns: auto 1fr; gap: 12px; }
  .tk-head h1 { font-size: 27px; }
  .tk-video-pill { grid-column: 2; justify-self: stretch; width: fit-content; max-width: 100%; }
  .tk-tabs { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; gap: 8px; overflow-x: auto; }
  .tk-tabs a { white-space: nowrap; font-size: 14px; }
  .tk-toolbar > .row:last-child { display: grid; grid-template-columns: 1fr 1fr; }
  .tk-toolbar > .row:last-child .tk-dd { min-width: 0; }
  .tk-toolbar > .row:last-child .btn.primary { grid-column: 1 / -1; margin-left: 0; width: 100%; }
  .tk-list-card .ftable-row, .tk-banded > .ftable .ftable-row { min-width: 820px; }
}
@media (max-width: 430px) {
  .tk-head { display: flex; flex-wrap: wrap; }
  .tk-head h1 { font-size: 25px; }
  .tk-video-pill { width: 100%; justify-content: center; }
  .tk-toolbar > .row:first-child { display: grid; grid-template-columns: 1fr 1fr 1fr; }
  .tk-bulk-btn { grid-column: 1 / -1; justify-content: center; }
  .tk-iconbtn { width: 100%; }
  .tk-toolbar > .row:last-child { grid-template-columns: 1fr; }
  .tk-toolbar > .row:last-child .btn.primary { grid-column: auto; }
}
/* Tareas mostradas en el calendario de la Agenda (ver scTaskChipHtml en public/schedule.js): a
   diferencia de un evento (fondo de color sólido), una tarea se pinta como una píldora con borde,
   sin relleno, con su propio ícono de checklist — para que a simple vista se note que es una tarea
   y no una cita/evento, aunque comparta la clase base ".sc-ev.sc-chip". */
.sc-task-chip { background: var(--bg) !important; color: var(--text) !important; border: 1px solid var(--line); display: flex; align-items: center; gap: 4px; box-shadow: none; }
.sc-task-chip .ic { width: 11px; height: 11px; flex: 0 0 auto; color: var(--muted); }
.sc-task-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sc-task-chip.overdue { border-color: var(--bad); color: var(--bad) !important; }
.sc-task-chip.overdue .ic { color: var(--bad); }
.ag-list { margin: 4px 0 8px; } .ag-row { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line); } .ag-row:last-child { border-bottom: 0; } .ag-list .ag-row { cursor: pointer; } .ag-list .ag-row:hover { background: var(--bg); }
.ag-when { width: 74px; flex: none; display: flex; flex-direction: column; } .ag-when b { font-size: 14px; } .ag-when span { font-size: 12px; color: var(--muted); }
.ag-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: block; } .ag-title { min-width: 0; font-weight: 600; } .ag-title small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; }

/* ---------- Submenú Disputas ---------- */
.side-group .grp { cursor: pointer; }
.side-group .grp .chev { margin-left: auto; display: flex; transition: transform .2s; } .side-group .grp .chev .ic { width: 15px; height: 15px; }
.side-group.open .grp .chev { transform: rotate(180deg); }
.side-sub { display: none; flex-direction: column; gap: 2px; margin: 3px 0 4px 20px; padding-left: 10px; border-left: 1px solid var(--line); }
.side-group.open .side-sub { display: flex; }
.side .side-sub a { padding: 8px 14px; font-size: 13.5px; }
/* Formulario que reemplaza el enlace del submenú al hacer doble clic para renombrarlo (solo lo ve
   el administrador principal, ver actions.navRename / startNavRename en staff.js). */
.navrename { display: flex; align-items: center; gap: 4px; padding: 4px 8px 4px 14px; }
.navrename input { flex: 1; min-width: 0; font: inherit; font-size: 13.5px; padding: 4px 6px; border: 1px solid var(--brand); border-radius: 6px; background: var(--card); color: var(--text); }
.navrename button { flex: none; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 2px; display: flex; }
.navrename button:hover { color: var(--bad); }
.navrename .ic { width: 14px; height: 14px; }
.side-group .grp.in { font-weight: 600; }
:root:not([data-side="dark"]) .side-group .grp.in { color: var(--text); }
:root[data-side="dark"] .side-group .grp.in { color: #fff; }
.layout.collapsed .side-sub, .layout.collapsed .side .chev { display: none; }

/* ---------- Biblioteca de cartas / Acreedores ---------- */
.row-btns { display: flex; justify-content: space-around; gap: 10px; flex-wrap: wrap; align-items: center; }
.ban { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ban-x { background: none; border: 0; font-size: 22px; line-height: 1; color: inherit; cursor: pointer; opacity: .7; padding: 0 2px; } .ban-x:hover { opacity: 1; }
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font: inherit; }
.icon-btn:hover { background: color-mix(in srgb, var(--brand) 10%, transparent); color: var(--brand); }
.icon-btn .ic { width: 18px; height: 18px; }
.icon-btn.heart.on { color: #e11d48; } .icon-btn.heart.on .ic { fill: #e11d48; }
.okc { color: var(--ok); display: inline-flex; } .okc .ic { width: 20px; height: 20px; }
table.lbt th.c, table.lbt td.c { text-align: center; }
#agreements-card table td { vertical-align: middle; }
table.lbt tr.dim td { opacity: .6; } table.lbt tr.dim td:last-child, table.lbt tr.dim td:nth-child(3) { opacity: 1; }
.tlink { cursor: pointer; color: var(--text); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 360px; } .tlink:hover { color: var(--brand); text-decoration: underline; }
/* En la biblioteca de cartas la columna "Título" se ve demasiado ancha (ver captura de Credit Repair
   Cloud) — se reduce solo ahí, sin tocar el max-width de 360px que usan las demás tablas. */
table.lbt .tlink { max-width: 220px; }
/* Títulos de tablas (nombre de carta, cliente, etc.): en vez de deformar la fila o desbordar, se recortan
   con "…" al final, igual que Credit Repair Cloud. Se aplica a la primera columna de las tablas de listado
   y a cualquier celda marcada con .ellip. */
.table-wrap table td:first-child > b, .table-wrap table td .ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; max-width: 320px; }
.table-wrap table td.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 178px; }
.cr-notes { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 13px; }
.lb-filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
/* Variante compacta/ancho automático del combo .sel-combo (ver core.js selectCombo()) para usarse suelto
   en barras de filtro, en vez de dentro de un .field completo con etiqueta flotante. */
.kebab.sel-combo.sel-combo-auto { width: auto; min-width: 180px; }
.sel-combo-auto .select-like { padding: 10px 14px; }
/* Variante chica para usarse dentro de una celda de tabla (p. ej. el estado de un ítem de crédito). */
.kebab.sel-combo.sel-combo-sm { width: auto; min-width: 0; }
.sel-combo-sm .select-like { padding: 4px 10px; font-size: 13px; }
.sel-combo-sm .kmenu { min-width: 140px; }
.sbox { position: relative; flex: 1; min-width: 200px; max-width: 360px; } .sbox .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); pointer-events: none; } .sbox input { padding-left: 36px; }
.tabs.seg a { cursor: pointer; }
.tbl-foot { padding: 12px 4px 2px; float: right; } .tbl-foot.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.pager .pg { display: flex; align-items: center; gap: 10px; } .pager .pg select { width: auto; padding: 4px 8px; display: inline-block; }
.cr-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.kebab { position: relative; display: inline-block; text-align: left; }
.kmenu { display: none; position: fixed; z-index: 90; min-width: 170px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 6px; }
.kebab.open .kmenu { display: block; }
.kmenu a { display: block; padding: 9px 12px; border-radius: 7px; color: var(--text); cursor: pointer; font-size: 14px; white-space: nowrap; } .kmenu a:hover { background: color-mix(in srgb, var(--brand) 9%, transparent); text-decoration: none; } .kmenu a.bad { color: var(--bad); }
.kmenu a.on { font-weight: 700; color: var(--brand); } .kmenu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.kmenu a .ic { width: 15px; height: 15px; margin-right: 8px; vertical-align: -3px; flex-shrink: 0; opacity: .7; }
.kmenu a.bad .ic { opacity: 1; }
.stdot { display: inline-block; width: 20px; height: 20px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.stdot.lg { width: 17px; height: 17px; margin-right: 0; }
.badge.stbtn { display: inline-flex; align-items: center; gap: 3px; border: 0; cursor: pointer; font: inherit; white-space: nowrap; }
.badge.stbtn .chev { display: inline-flex; opacity: .7; } .badge.stbtn .chev .ic { width: 10px; height: 10px; }
.table-wrap[data-density="compact"] th, .table-wrap[data-density="compact"] td { padding: 5px 8px; }
.table-wrap[data-density="comfortable"] th, .table-wrap[data-density="comfortable"] td { padding: 15px 12px; }
.table-wrap[data-density] thead th { white-space: nowrap; }
.table-wrap[data-density] thead th .ic { width: 13px; height: 13px; margin-right: 5px; vertical-align: -2px; opacity: .5; flex-shrink: 0; }
.kebab.sel-status, .kebab.sel-combo { display: block; width: 100%; }
/* El botón que abre la lista debe verse y medir igual que cualquier otro campo del sitio (mismo
   padding/borde/radio que "input, select, textarea"), para que no se note que no es un <select> nativo. */
.select-like { width: 100%; justify-content: flex-start; font-weight: 400; padding: 15px 15px; text-align: left; }
.select-like:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.kebab.open .select-like { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.kebab.open .select-like .chev { transform: rotate(180deg); }
.select-like .chev { transition: transform .15s ease; }
.select-like[disabled] { cursor: not-allowed; opacity: .65; }
.select-like .sf-label { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-like .chev { margin-left: auto; opacity: .55; display: inline-flex; flex-shrink: 0; }
.select-like .stdot { flex-shrink: 0; }
.kebab.sel-pal { display: inline-block; }
.kebab.sel-combo .kmenu { max-height: 260px; overflow-y: auto; }
.pal-trigger { width: auto; padding: 8px 10px; gap: 10px; }
.kmenu.pal-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 12px; width: 166px; min-width: 0; }
.pal-sw { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; padding: 0; cursor: pointer; }
.pal-sw:hover { transform: scale(1.08); }
.pal-sw.on { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--brand); }
.st-color-cell { display: flex; align-items: center; }
/* Categoría / Estado / Título / botón "Ver marcadores" en una sola fila, como Credit Repair Cloud. */
.lb-row4 { display: grid; grid-template-columns: 1.4fr 1fr 1.4fr auto; gap: 14px; align-items: start; margin-bottom: 26px; }
.lb-row4 .field { margin-bottom: 0; }
.lb-row4 .lb-ph-btn { margin-top: 14px; white-space: nowrap; }
@media (max-width: 800px) { .lb-row4 { grid-template-columns: 1fr; margin-bottom: 12px; } .lb-row4 .lb-cat { margin-bottom: 26px; } .lb-row4 .lb-ph-btn { margin-top: 0; width: 100%; } }
.lb-cat { position: relative; } .lb-cat .lb-link { position: absolute; right: 2px; top: calc(100% + 4px); }
.lb-link { color: var(--brand); font-size: 13px; cursor: pointer; } .lb-link:hover { text-decoration: underline; }
.lb-ph { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 14px; background: color-mix(in srgb, var(--brand) 4%, var(--card)); }
.chip-ph { border: 1px solid var(--line); background: var(--card); color: var(--brand); border-radius: 999px; padding: 4px 10px; margin: 0 6px 6px 0; font: 12.5px ui-monospace, Menlo, monospace; cursor: pointer; } .chip-ph:hover { border-color: var(--brand); }
.lb-count { text-align: right; margin: -6px 0 12px; }
.lb-preview { max-height: 60vh; overflow-y: auto; padding: 16px; background: #f2f3f5; border-radius: 8px; }
.lb-paper { background: #fff; color: #414141; border: 1px solid #e2e4e8; border-radius: 6px; box-shadow: 0 1px 4px rgba(0,0,0,.08); max-width: 640px; margin: 0 auto; padding: 26px 28px; font-size: 13.5px; line-height: 1.65; font-weight: normal; }
.lb-paper p { margin: 0 0 .9em; } .lb-paper h1 { font-size: 1.5em; margin: .3em 0 .5em; } .lb-paper h2 { font-size: 1.3em; margin: .3em 0 .5em; } .lb-paper h3 { font-size: 1.1em; margin: .3em 0 .5em; }
.lb-paper img { max-width: 100%; height: auto; }
.lb-preview-plain { font: inherit; white-space: pre-wrap; word-wrap: break-word; margin: 0; line-height: 1.65; }
/* Barra "Ver Marcadores" del editor de Acuerdos (como el panel de Credit Repair Cloud) */
.ph-bar { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; background: var(--card); cursor: pointer; font-weight: 700; font-size: 13.5px; user-select: none; }
.ph-bar:hover { border-color: var(--brand); }
.ph-bar .chev { display: flex; opacity: .7; transition: transform .15s ease; }
.ph-bar.open .chev { transform: rotate(180deg); }
.ph-panel { border: 1px solid var(--line); border-radius: 8px; padding: 14px 18px; margin: -2px 0 12px; background: color-mix(in srgb, var(--brand) 4%, var(--card)); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px 22px; }
.ph-panel[hidden] { display: none; }
.ph-opt { text-align: left; background: none; border: 0; padding: 3px 0; cursor: pointer; font-size: 12.5px; line-height: 1.5; color: var(--text); }
.ph-opt b { color: var(--brand); font-family: ui-monospace, Menlo, monospace; font-weight: 700; }
.ph-opt:hover b { text-decoration: underline; }
@media (max-width: 720px) { .ph-panel { grid-template-columns: 1fr; } }
.cat-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.cat-row { display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px 4px 12px; }
.cat-add { display: flex; gap: 8px; }
.sort-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sort-list li { display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px 6px 12px; gap: 10px; } .sort-btns { display: flex; flex-shrink: 0; }
/* Razones/Instrucciones de disputa (Configuración → Disputas), estilo Credit Repair Cloud */
.dopt-list { display: flex; flex-direction: column; }
.dopt-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-weight: 500; padding: 5px 2px; border-bottom: 1px solid var(--line); }
.dopt-row:last-child { border-bottom: 0; }
.dopt-row > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.dopt-new { gap: 8px; padding: 8px 2px; }
.dopt-new input { flex: 1; min-width: 0; height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; font: inherit; background: var(--card); color: var(--text); }
.dopt-new input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.cr-addr { border: 1px solid var(--line); border-radius: 8px; padding: 14px 14px 4px; margin-bottom: 12px; }
.cr-addr-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; color: var(--muted); }
.fields3 { display: grid; grid-template-columns: 2fr 1fr 1.2fr; gap: 14px; } @media (max-width: 800px) { .fields3 { grid-template-columns: 1fr; } }
table.lbt .badge { white-space: nowrap; }
.side .side-sub a { padding: 8px 10px; font-size: 13px; white-space: nowrap; }
.side-sub { margin-left: 18px; padding-left: 8px; }
table.lbt.cr td:nth-child(4), table.lbt.cr th:nth-child(4) { white-space: nowrap; } table.lbt.cr td:nth-child(2) { min-width: 220px; }

/* ---------- Estilo del menú (Apariencia) ---------- */
.side .side-nav > a, .side .side-group > a { font-family: var(--mn-font, inherit); font-size: var(--mn-fs, 14.5px); font-weight: var(--mn-fw, 500); font-style: var(--mn-fst, normal); }
.side .side-nav .ic { width: var(--mn-ic, 19px); height: var(--mn-ic, 19px); }
.side .side-group .grp .chev .ic { width: 15px; height: 15px; }
.side-nav { gap: var(--mn-gap, 4px); }
.side .side-sub a { font-family: var(--mn-font, inherit); font-size: calc(var(--mn-fs, 14.5px) - 1.5px); font-weight: 400; }
.side-sub { gap: calc(var(--mn-gap, 4px) / 2); }
.subnav { display: flex; flex-direction: column; gap: var(--sn-gap, 2px); }
.subnav a { font-family: var(--sn-font, inherit); font-size: var(--sn-fs, 14px); font-weight: var(--sn-fw, 400); font-style: var(--sn-fst, normal); }
.subnav a.active { font-weight: max(var(--sn-fw, 400), 600); }
.subnav .ic { width: var(--sn-ic, 19px); height: var(--sn-ic, 19px); }
.subnav-grp { font-family: var(--sn-font, inherit); font-size: var(--sn-fs, 14px); font-weight: var(--sn-fw, 400); font-style: var(--sn-fst, normal); }
.subnav-grp.in { font-weight: max(var(--sn-fw, 400), 600); }
.subnav-sub a { font-style: var(--sn-fst, normal); }
@media (max-width: 800px) { .subnav { flex-direction: column; } }
input[type=range] { width: 100%; padding: 0; accent-color: var(--brand); height: 4px; margin: 0; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--brand); cursor: pointer; margin-top: -5px; }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--brand); border: 0; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 999px; background: var(--line); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 999px; background: var(--line); }

/* ---------- Lista de Clientes ---------- */
.clients-page { width: 100%; min-width: 0; }
.clients-header { display: flex; align-items: center; gap: 18px; margin-bottom: 26px; }
.clients-title { display: flex; align-items: center; gap: 18px; min-width: 0; }
.clients-title h1 { margin: 0 0 4px; font-size: clamp(30px, 2.6vw, 38px); line-height: 1.05; }
.clients-title .muted { font-size: 17px; color: var(--muted); }
.clients-video { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 7px 12px 7px 7px; border: 1px solid color-mix(in srgb, var(--brand) 65%, var(--line)); border-radius: 10px; background: color-mix(in srgb, var(--brand) 4%, var(--card)); color: var(--brand); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.clients-video .ic { width: 25px; height: 25px; padding: 4px; box-sizing: border-box; border-radius: 50%; background: var(--brand); color: #fff; }
.clients-video:hover { filter: brightness(.97); }
.clients-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; min-width: 0; }
.clients-toolbar-group { display: flex; align-items: center; gap: 12px; min-width: 0; }
.clients-toolbar-primary { flex: 0 0 auto; }
.clients-toolbar-actions { flex: 0 0 auto; }
.clients-toolbar-spacer { flex: 1 1 auto; min-width: 8px; }
.clients-toolbar .btn, .clients-toolbar .kebab > .btn { min-height: 50px; padding: 10px 14px; border-radius: 10px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.clients-toolbar .btn .ic { width: 21px; height: 21px; }
.clients-toolbar-primary .ic, .clients-search .ic { color: var(--brand); }
.clients-toolbar .clients-new .ic { color: #fff; }
.clients-toolbar .kebab > .btn { width: 100%; justify-content: space-between; }
.clients-toolbar-primary > .kebab:first-child > .btn { min-width: 180px; justify-content: space-between; color: var(--muted); font-weight: 500; }
.clients-toolbar-primary > .kebab:nth-of-type(2) > .btn { min-width: 125px; }
.clients-toolbar-primary > .kebab:nth-of-type(3) > .btn { min-width: 135px; }
.clients-toolbar-primary > .kebab:nth-of-type(4) > .btn { min-width: 210px; }
.clients-search { flex: 0 0 285px; width: 285px; max-width: 285px; }
.clients-search input { height: 50px; border-radius: 10px; padding-right: 14px; font-size: 14px; }
.clients-new { min-width: 180px; justify-content: center; font-size: 14px !important; }
.clients-table-card { padding: 0; margin-bottom: 0; border-radius: 10px; overflow-x: auto; overflow-y: hidden; box-shadow: 0 8px 22px rgba(34, 77, 130, .06); }
.clients-table { width: 100%; min-width: 1180px; }
.clients-table .ftable-row { width: 100%; }
.clients-table .ftable-row.head { min-height: 60px; background: color-mix(in srgb, var(--brand) 5%, var(--card)); }
.clients-table .ftable-row:not(.head) { min-height: 78px; background: var(--card); }
.clients-table .ftable-row:not(.head):last-child { border-bottom: 0; }
.clients-table .ftable-cell { display: flex; align-items: center; gap: 7px; padding: 2px 10px!important; font-size: 14px; line-height: 1.35; }
.clients-table .ftable-row.head .ftable-cell { gap: 6px; color: var(--muted); font-size: 12px; line-height: 1.2; letter-spacing: 0; }
.clients-table .ftable-row.head .ftable-cell .ic { width: 21px; height: 21px; margin-right: 2px; color: var(--brand); opacity: 1; }
.clients-table .ftable-row > .ftable-cell:nth-child(1) { flex: 2.25 1 250px; }
.clients-table .ftable-row > .ftable-cell:nth-child(2) { flex: 1.25 1 150px; }
.clients-table .ftable-row > .ftable-cell:nth-child(3) { flex: 1.15 1 135px; }
.clients-table .ftable-row > .ftable-cell:nth-child(4) { flex: 0 1 122px; }
.clients-table .ftable-row > .ftable-cell:nth-child(5) { flex: 0 1 132px; }
.clients-table .ftable-row > .ftable-cell:nth-child(6) { flex: 0 1 128px; }
.clients-table .ftable-row > .ftable-cell:nth-child(7) { flex: 1.15 1 150px; }
.clients-table .ftable-row > .ftable-cell:nth-child(8) { flex: 0 1 112px; }
.clients-table .ftable-row > .ftable-cell:nth-child(9) { flex: 0 0 70px; justify-content: center; }
.clients-table .ftable-row:not(.head):hover { background: color-mix(in srgb, var(--brand) 3%, var(--card)); }
.clients-client-cell { gap: 12px !important; }
.cl-avatar { width: 46px; height: 46px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; background: color-mix(in srgb, var(--brand) 14%, var(--card)); color: var(--brand); font-size: 17px; font-weight: 700; }
.clients-table .ftable-row:nth-child(3) .cl-avatar { background: color-mix(in srgb, var(--purple) 14%, var(--card)); color: var(--purple); }
.cl-client-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cl-client-meta .ellip { max-width: none; }
.cl-client-meta b { color: var(--brand); font-size: 15px; }
.cl-client-meta .muted { font-size: 13px; }
.clients-table .badge { padding: 6px 10px; font-size: 12px; }
.clients-table .clients-status { min-width: 98px; justify-content: center; }
.clients-table .clients-onboard { padding: 6px 10px; }
.clients-row-actions .icon-btn { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--muted); }
.clients-row-actions .icon-btn:hover { border-color: var(--brand); background: var(--info-bg); color: var(--brand); }
.clients-table-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; min-height: 64px; border-top: 1px solid var(--line); }
.clients-table-footer .small { font-size: 14px; }
.clients-table-footer .pg { gap: 9px; }
.clients-table-footer .pg label { display: inline-flex; align-items: center; gap: 8px; }
.clients-table-footer .pg select { min-height: 38px; border-radius: 9px; font-size: 14px; }
.clients-table-footer .pg > .btn { min-width: 38px; min-height: 38px; justify-content: center; border-radius: 9px; font-size: 20px; line-height: 1; }
.clients-table-footer .pg > .small { font-size: 14px; font-weight: 700; color: var(--text); }
.clients-page .empty { padding: 44px 24px; }

@media (max-width: 1500px) {
  .clients-header { flex-wrap: wrap; }
  .clients-toolbar { flex-wrap: wrap; }
  .clients-toolbar-primary { flex: 1 1 100%; flex-wrap: wrap; }
  .clients-toolbar-spacer { display: none; }
  .clients-toolbar-actions { margin-left: auto; }
}
@media (max-width: 800px) {
  .clients-header { align-items: flex-start; gap: 14px; margin-bottom: 22px; }
  .clients-title { gap: 14px; }
  .clients-title h1 { font-size: 30px; }
  .clients-title .muted { font-size: 15px; }
  .clients-video { width: 100%; justify-content: center; }
  .clients-toolbar { align-items: stretch; gap: 10px; margin-bottom: 20px; }
  .clients-toolbar-group { flex-wrap: wrap; gap: 10px; width: 100%; }
  .clients-toolbar-primary > .kebab, .clients-toolbar-primary > .btn { flex: 1 1 calc(50% - 5px); min-width: 0 !important; }
  .clients-toolbar-actions { margin-left: 0; }
  .clients-search { flex: 1 1 100%; width: 100%; max-width: none; }
  .clients-new { flex: 1 1 100%; width: 100%; }
  .clients-table-footer { align-items: flex-start; flex-direction: column; padding: 18px; }
.clients-table-footer .pg { width: 100%; justify-content: space-between; }
}

/* ---------- Panel ---------- */
.dash-page { width: 100%; min-width: 0; }
.dash-header { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }
.dash-header h1 { margin: 0 0 3px; font-size: 30px; line-height: 1.1; }
.dash-header .muted { font-size: 13px; }
.dash-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.dash-stat { display: flex; align-items: center; gap: 13px; min-width: 0; min-height: 82px; margin: 0; padding: 14px 16px; border-radius: 9px; box-shadow: 0 5px 16px rgba(34, 77, 130, .05); background: color-mix(in srgb, var(--brand) 3%, var(--card)); }
.dash-stat-icon { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; border-radius: 9px; }
.dash-stat-icon .ic { width: 23px; height: 23px; }
.dash-stat-copy { display: block; min-width: 0; }
.dash-stat .n { display: block; font-size: 23px; line-height: 1.1; white-space: nowrap; }
.dash-stat .l { display: block; margin-top: 5px; font-size: 12px; line-height: 1.25; font-weight: 600; color: color-mix(in srgb, var(--text) 72%, var(--muted)); }
.dash-tone-blue .dash-stat-icon { background: var(--info-bg); color: var(--brand); }
.dash-tone-green .dash-stat-icon { background: var(--ok-bg); color: var(--ok); }
.dash-tone-red .dash-stat-icon { background: var(--bad-bg); color: var(--bad); }
.dash-tone-orange .dash-stat-icon { background: var(--warn-bg); color: var(--warn); }
.dash-tone-purple .dash-stat-icon { background: var(--purple-bg); color: var(--purple); }
.dash-tone-cyan .dash-stat-icon { background: var(--cyan-bg); color: var(--cyan); }
.dash-panels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.dash-card { min-width: 0; margin: 0; padding: 16px 18px; border-radius: 9px; box-shadow: 0 5px 16px rgba(34, 77, 130, .045); }
.dash-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.dash-section-title { display: flex; align-items: flex-start; gap: 11px; min-width: 0; }
.dash-section-icon { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; border-radius: 8px; background: var(--info-bg); color: var(--brand); }
.dash-section-icon .ic { width: 20px; height: 20px; }
.dash-section-title h2 { margin: 3px 0 0; font-size: 16px; line-height: 1.2; }
.dash-section-title .h2-sub { margin-top: 4px; font-size: 12px; line-height: 1.3; }
.dash-section-go { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; border-radius: 50%; background: var(--info-bg); color: var(--brand); font-size: 24px; line-height: 1; }
.dash-card .ag-list { margin-top: 2px; }
.dash-card .ag-row { min-height: 62px; padding: 9px 2px; }
.dash-card .ag-when { width: 72px; }
.dash-card .ag-when b { font-size: 14px; }
.dash-card .ag-title { font-size: 13px; }
.dash-card .ag-title small { font-size: 12px; }
.dash-card .due-list { margin-top: 0; }
.dash-card .due-row { padding: 10px 2px; }
.dash-empty { min-height: 112px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 16px 8px; }
.dash-empty .ic { width: 27px; height: 27px; color: color-mix(in srgb, var(--brand) 55%, var(--muted)); }
.dash-empty b { font-size: 13px; color: color-mix(in srgb, var(--text) 75%, var(--muted)); }
.dash-cancel { grid-column: 1 / -1; min-height: 132px; }
.dash-cancel .dash-empty { min-height: 58px; }
.dash-activity { margin-top: 16px; }
.dash-activity .dash-section-head { margin-bottom: 7px; }
.dash-activity .ftable-row { min-height: 28px; }
.dash-activity .ftable-cell { padding: 6px 10px; font-size: 13px; }
.dash-activity .ftable-cell:first-child { flex-basis: 142px; }
.dash-activity .ftable-cell a { font-size: 13px; }

@media (max-width: 1200px) {
  .dash-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash-panels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-cancel { grid-column: 1 / -1; }
}
@media (max-width: 800px) {
  .dash-header { gap: 13px; margin-bottom: 18px; }
  .dash-header h1 { font-size: 28px; }
  .dash-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .dash-stat { min-height: 74px; padding: 12px; gap: 9px; }
  .dash-stat-icon { width: 32px; height: 32px; }
  .dash-stat-icon .ic { width: 19px; height: 19px; }
  .dash-stat .n { font-size: 20px; }
  .dash-stat .l { font-size: 11px; }
  .dash-panels { grid-template-columns: 1fr; gap: 12px; }
  .dash-cancel { grid-column: auto; }
  .dash-activity { margin-top: 12px; overflow-x: auto; }
  .dash-activity .ftable { min-width: 560px; }
}

/* ---------- Message Center ---------- */
.mc-page { width: 100%; min-width: 0; }
.mc-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.mc-heading { display: flex; align-items: center; gap: 16px; min-width: 0; }
.mc-heading h1 { margin: 0 0 5px; font-size: clamp(30px, 2.6vw, 38px); line-height: 1.05; }
.mc-heading p { margin: 0; color: var(--muted); font-size: 15px; }
.mc-new { min-height: 48px; padding: 10px 19px !important; border-radius: 9px; font-weight: 700; white-space: nowrap; }
.mc-new .ic { width: 19px; height: 19px; }
.mc-surface { background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 7px 20px rgba(34, 77, 130, .045); overflow: hidden; }
.mc-tabs { margin: 0; padding: 18px 16px 0; gap: 31px; box-shadow: 0 5px 8px -6px rgba(0, 0, 0, .16); }
.mc-tabs a { padding-bottom: 13px; font-size: 14px; cursor: pointer; }
.mc-filterbar { display: flex; align-items: center; gap: 12px; padding: 18px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.mc-search, .mc-filter { position: relative; display: flex; align-items: center; min-height: 44px; }
.mc-search { flex: 1 1 380px; min-width: 220px; }
.mc-search input { width: 57%; height: 44px; padding: 10px 14px 10px 42px; border-radius: 8px; }
.mc-search > .ic, .mc-filter > .ic:first-child { position: absolute; left: 13px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.mc-filter { flex: 0 1 234px; min-width: 185px; }
.mc-filter select { width: 100%; height: 44px; appearance: none; padding: 10px 35px 10px 40px; border-radius: 8px; background: var(--card); color: var(--text); }
.mc-filter > .ic:last-child { position: absolute; right: 12px; width: 14px; height: 14px; color: var(--muted); pointer-events: none; }
.mc2-body { display: grid; grid-template-columns: minmax(300px, 36%) minmax(0, 1fr); min-height: min(650px, calc(100vh - 300px)); }
.mc2-left { border-right: 1px solid var(--line); min-width: 0; overflow: auto; }
.mc-list-label { display: flex; justify-content: space-between; align-items: center; padding: 15px 18px 10px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.mc-list-label span { color: var(--brand); }
.mc-thread { position: relative; display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 14px 18px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.mc-thread:hover, .mc-thread.active { background: color-mix(in srgb, var(--brand) 7%, var(--card)); }
.mc-thread.active { box-shadow: inset 3px 0 var(--brand); }
.mc-thread.unread .mc-thread-subject, .mc-thread.unread .mc-thread-preview { color: var(--text); font-weight: 600; }
.mc-avatar { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%; font-size: 14px; font-weight: 800; }
.mc-avatar-client-0, .mc-avatar-team-0 { background: var(--info-bg); color: var(--brand); }
.mc-avatar-client-1, .mc-avatar-team-1 { background: var(--purple-bg); color: var(--purple); }
.mc-avatar-client-2, .mc-avatar-team-2 { background: #fde7f0; color: #c02670; }
.mc-avatar-client-3, .mc-avatar-team-3 { background: var(--ok-bg); color: var(--ok); }
.mc-avatar-client-4, .mc-avatar-team-4 { background: var(--warn-bg); color: var(--warn); }
.mc-thread-copy { display: block; min-width: 0; flex: 1; }
.mc-thread-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mc-thread-row strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.mc-thread-row time { flex: 0 0 auto; color: var(--muted); font-size: 12px; }
.mc-thread-subject, .mc-thread-preview { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-thread-subject { margin-top: 3px; font-size: 13px; }
.mc-thread-preview { margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 400; }
.mc-thread-meta { display: flex; align-items: center; gap: 8px; margin-top: 7px; }
.mc-thread-meta .badge { padding: 2px 8px; font-size: 11px; }
.mc-unread { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); }
.mc-none { min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 30px 20px; color: var(--muted); text-align: center; }
.mc-none svg { width: 42px; height: 42px; margin-bottom: 5px; color: color-mix(in srgb, var(--brand) 64%, var(--muted)); }
.mc-none strong { color: var(--text); font-size: 14px; }
.mc-none span { max-width: 250px; font-size: 12px; }
.mc2-right { display: flex; min-width: 0; }
.mc-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 500px; padding: 30px; color: var(--muted); text-align: center; }
.mc-empty svg { width: 54px; height: 54px; color: color-mix(in srgb, var(--brand) 58%, var(--muted)); }
.mc-empty strong { color: var(--text); font-size: 16px; }
.mc-empty span { font-size: 13px; }
.mc-conv { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.mc-conv-head { display: flex; align-items: center; gap: 14px; min-height: 82px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.mc-back { display: none; }
.mc-contact { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.mc-contact h2 { margin: 0 0 4px; font-size: 18px; line-height: 1.2; }
.mc-contact p { margin: 0; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-contact .badge { margin-left: 4px; }
.mc-head-actions { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.mc-head-actions .btn { min-height: 40px; color: var(--brand); border-color: color-mix(in srgb, var(--brand) 26%, var(--line)); }
.mc-head-actions .btn .ic { width: 18px; height: 18px; }
.mc-head-actions .icon-btn { width: 40px; height: 40px; }
.mc-chat { display: flex; flex: 1; flex-direction: column; gap: 8px; min-height: 320px; overflow-y: auto; padding: 18px 20px 14px; background: color-mix(in srgb, var(--bg) 58%, var(--card)); }
.mc-date-separator { display: flex; align-items: center; gap: 10px; margin: 5px 0 10px; color: var(--muted); font-size: 11px; }
.mc-date-separator::before, .mc-date-separator::after { content: ''; height: 1px; flex: 1; background: var(--line); }
.mc-message-row { display: flex; justify-content: flex-start; }
.mc-message-row.out { justify-content: flex-end; }
.mc-bubble { max-width: min(72%, 560px); padding: 11px 14px; border-radius: 14px; background: var(--line); color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.mc-bubble.out { background: var(--info-bg); }
.mc-bubble.note { background: var(--warn-bg); color: var(--warn); border: 1px dashed color-mix(in srgb, var(--warn) 55%, transparent); }
.mc-message-body { font-size: 13.5px; line-height: 1.45; }
.mc-message-body p { margin: 0 0 .7em; } .mc-message-body p:last-child { margin-bottom: 0; }
.mc-message-meta { margin-top: 5px; color: var(--muted); font-size: 11px; }
.mc-checks { color: var(--brand); font-weight: 800; letter-spacing: -2px; }
.mc-empty-inline { margin: auto; color: var(--muted); font-size: 13px; }
.mc-composer { margin: 0; padding: 14px 16px 12px; border-top: 1px solid var(--line); background: var(--card); }
.mc-compose-box { display: flex; align-items: flex-end; gap: 10px; }
.mc-compose-box textarea { flex: 1; min-height: 46px; max-height: 130px; resize: vertical; padding: 13px 14px; border-radius: 9px; }
.mc-compose-tools { position: relative; display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.mc-compose-tool {    display: inline-flex;    align-items: center;    justify-content: center;    min-height: 64px;    max-height: 130px;    padding: 13px 14px;    border: 1px solid var(--line);    border-radius: 8px;    background: var(--card);    color: var(--muted);    cursor: pointer;}
.mc-compose-tool:hover { color: var(--brand); border-color: var(--brand); background: var(--info-bg); }
.mc-compose-tool .ic { width: 25px; height: 25px; }
.mc-emoji-menu { position: absolute; z-index: 5; left: 0; bottom: 43px; display: grid; grid-template-columns: repeat(4, 34px); gap: 3px; padding: 7px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); box-shadow: 0 10px 26px rgba(20, 40, 80, .18); }
.mc-emoji-menu[hidden] { display: none; }
.mc-emoji-menu button { width: 34px; height: 34px; border: 0; border-radius: 6px; background: transparent; font-size: 18px; cursor: pointer; }
.mc-emoji-menu button:hover { background: var(--info-bg); }
.mc-send {    display: inline-flex;    align-items: center;    justify-content: center;    flex: 0 0 46px;    /* width: 46px; */    /* height: 46px; */    min-height: 64px;    max-height: 130px;    padding: 13px 14px;    padding: 0 !important;    border-radius: 9px;    cursor: pointer;}
.mc-send:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.mc-send .ic { width: 25px; height: 30px; }
.mc-compose-options { display: flex; align-items: center; gap: 10px; margin-top: 8px; color: var(--muted); font-size: 11px; }
.mc-compose-options select { width: auto; min-height: 28px; padding: 4px 25px 4px 8px; font-size: 12px; }
.mc-compose-options span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-conversation-type { display: flex; justify-content: center; margin: -4px 0 2px; }
.mc-conversation-type .badge { font-size: 11px; }
.mc-attachment { display: flex; align-items: center; gap: 7px; max-width: 100%; margin-top: 8px; padding: 7px 9px; border: 1px solid color-mix(in srgb, var(--brand) 20%, var(--line)); border-radius: 7px; background: color-mix(in srgb, var(--card) 72%, transparent); color: var(--brand); font: inherit; font-size: 12px; text-align: left; cursor: pointer; }
.mc-attachment:hover { border-color: var(--brand); }
.mc-attachment .ic:first-child { width: 16px; height: 16px; flex: 0 0 auto; }
.mc-attachment .ic:last-child { width: 14px; height: 14px; margin-left: auto; flex: 0 0 auto; }

/* Modal Nuevo mensaje: reutiliza .modal, .btn, .field, .rte y .tk-hicon del sistema. */
#modal-root .mc-new-modal { max-width: min(1180px, calc(100vw - 28px)); width: 100%; height: min(920px, calc(100vh - 80px)); max-height: none; padding: 0; overflow: hidden; }
#modal-root .mc-new-modal > h2 { display: none; }
#modal-root .mc-new-modal .mbody { display: flex; flex-direction: column; height: 100%; max-height: none; padding: 0; overflow: hidden; }
.mc-modal-head { position: relative; display: flex; align-items: flex-start; gap: 17px; padding: 25px 60px 22px 28px; border-bottom: 1px solid var(--line); }
.mc-modal-head .tk-hicon { flex: 0 0 auto; }
.mc-modal-head h2 { margin: 1px 0 6px; font-size: 25px; line-height: 1.1; }
.mc-modal-head p { max-width: 930px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.mc-modal-close { position: absolute; top: 24px; right: 24px; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.mc-modal-close:hover { background: var(--info-bg); color: var(--brand); }
.mc-modal-close .ic { width: 21px; height: 21px; }
.mc-modal-content { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 22px 28px 24px; }
.mc-recipient-section { display: grid; grid-template-columns: auto minmax(390px, 1.15fr) minmax(400px, 1.45fr); align-items: start; gap: 14px; }
.mc-recipient-label { padding-top: 14px; color: var(--text); font-weight: 700; }
.mc-recipient-options { display: flex; gap: 10px; }
.mc-recipient-option { position: relative; display: flex; align-items: center; gap: 8px; min-height: 66px; flex: 1 1 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); cursor: pointer; }
.mc-recipient-option.active { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 7%, var(--card)); }
.mc-recipient-option.disabled { opacity: .55; cursor: not-allowed; }
.mc-recipient-option input { position: absolute; opacity: 0; pointer-events: none; }
.mc-recipient-option b { font-size: 13px; line-height: 1.2; }
.mc-recipient-option-icon { display: inline-flex; color: var(--muted); }
.mc-recipient-option.active .mc-recipient-option-icon { color: var(--brand); }
.mc-recipient-option-icon .ic { width: 19px; height: 19px; }
.mc-radio { width: 18px; height: 18px; margin-left: auto; border: 2px solid color-mix(in srgb, var(--muted) 55%, var(--line)); border-radius: 50%; }
.mc-recipient-option.active .mc-radio { border: 5px solid var(--brand); }
.mc-recipient-fields { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 12px; }
.mc-recipient-fields .field, .mc-client-fields .field { margin: 0 !important; }
.mc-recipient-fields .field label, .mc-client-fields .field label { margin-bottom: 6px; }
.mc-client-fields { margin-top: 15px; }
.mc-editor-field { margin-top: 15px; }
.mc-editor-field > label { display: block; margin: 0 0 7px; font-weight: 700; }
.mc-editor-field > label b { color: var(--bad); }
.mc-editor-field .rte-area { min-height: 220px !important; max-height: 36vh; }
.mc-quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.mc-quick-block { min-width: 0; padding: 15px 17px; border-radius: 9px; background: color-mix(in srgb, var(--brand) 5%, var(--card)); }
.mc-quick-title { display: flex; align-items: center; gap: 7px; margin-bottom: 10px; color: var(--brand); font-size: 13px; }
.mc-quick-title .ic { width: 18px; height: 18px; }
.mc-quick-title span { color: var(--muted); }
.mc-quick-block select, .mc-quick-block input { width: 100%; min-height: 42px; }
.mc-quick-block a { display: inline-block; margin-top: 8px; color: var(--brand); font-size: 13px; text-decoration: underline; }
.mc-check-row { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; color: var(--text); font-size: 13px; cursor: pointer; }
.mc-check-row input { width: 18px; min-height: 18px; flex: 0 0 auto; }
.mc-note-label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.mc-modal-footer { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 28px; border-top: 1px solid var(--line); background: var(--card); }
.mc-modal-footer-right { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; }
.mc-modal-footer .btn { min-height: 44px; }
.mc-modal-footer .btn.primary { min-width: 166px; justify-content: center; }
.mc-modal-attach .ic, .mc-modal-footer .btn.primary .ic { width: 19px; height: 19px; }
.mc-modal-file { max-width: 190px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) { .mc-filterbar { align-items: stretch; } .mc-search { flex-basis: 100%; } .mc-filter { flex: 1 1 180px; } }
@media (max-width: 800px) {
  .mc-header { align-items: flex-start; gap: 15px; margin-bottom: 20px; }
  .mc-heading { gap: 13px; }
  .mc-heading h1 { font-size: 30px; }
  .mc-heading p { font-size: 14px; }
  .mc-new { width: 100%; justify-content: center; }
  .mc-filterbar { padding: 12px; }
  .mc-filter { flex-basis: 100%; }
  .mc2-body { grid-template-columns: 1fr; min-height: 520px; }
  .mc2-left { border-right: 0; border-bottom: 1px solid var(--line); max-height: 560px; }
  .mc2-body.has-selection .mc2-left { display: none; }
  .mc2-body.has-selection .mc2-right { min-height: 580px; }
  .mc-back { display: inline-flex; align-items: center; flex: 0 0 auto; border: 0; background: transparent; color: var(--brand); font: inherit; font-size: 12px; cursor: pointer; }
  .mc-conv-head { align-items: flex-start; flex-wrap: wrap; padding: 12px 14px; }
  .mc-contact { order: 2; flex-basis: calc(100% - 4px); }
  .mc-head-actions { margin-left: auto; }
  .mc-head-actions .btn span { display: none; }
  .mc-head-actions .btn { padding: 8px 10px; }
  .mc-chat { padding: 14px 12px; }
  .mc-bubble { max-width: 88%; }
  .mc-compose-options { align-items: flex-start; flex-wrap: wrap; }
  #modal-root .mc-new-modal { max-width: calc(100vw - 18px); height: calc(100vh - 24px); }
  .mc-modal-head { padding: 20px 50px 18px 18px; gap: 11px; }
  .mc-modal-head h2 { font-size: 21px; }
  .mc-modal-head p { font-size: 12px; }
  .mc-modal-content { padding: 17px 18px 20px; }
  .mc-recipient-section, .mc-recipient-fields, .mc-quick-grid { grid-template-columns: 1fr; }
  .mc-recipient-label { padding-top: 0; }
  .mc-recipient-options { flex-wrap: wrap; }
  .mc-recipient-option { min-width: 145px; }
  .mc-modal-footer { align-items: stretch; flex-direction: column-reverse; padding: 14px 18px; }
  .mc-modal-footer-right { flex-wrap: wrap; }
  .mc-modal-footer-right .btn.primary { flex: 1 1 160px; }
  .mc-modal-attach { flex: 0 0 auto; }
}
.side .side-nav > a, .side .side-group > a { white-space: nowrap; } .side .side-nav > a .lbl { overflow: hidden; text-overflow: ellipsis; }

/* ---------- Editor de cartas ---------- */
.rte { border: 1px solid var(--line); border-radius: 8px; background: var(--card); overflow: hidden; }
.rte:focus-within { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.rte-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--brand) 3%, var(--card)); }
.rte-b { background: none; border: 0; color: var(--text); width: 34px; height: 34px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font: inherit; font-size: 16px; } .rte-b:hover { background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); }
.rte-sep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }
.rte-sel { width: auto; padding: 5px 8px; border-radius: 8px; font-size: 13.5px; height: 34px; }
.rte-area {    padding: 18px 20px;    outline: none;    max-height: 55vh;    overflow-y: auto;    line-height: 1.6;    font-family: sans-serif;    color: #414141;    font-size: 14px;    line-height: 1.6;    padding: 20px;    font-weight: normal;    -webkit-box-sizing: border-box;    -moz-box-sizing: border-box;    box-sizing: border-box;    overflow-x: auto;    min-height: 60px;    text-align: left;    overflow-x: visible !important;    word-wrap: break-word;    background: transparent;    position: relative;    z-index: 2;    -webkit-user-select: auto;    outline: 0 solid transparent;}
.rte-area:empty::before, .rte-area:has(> br:only-child)::before { content: attr(data-ph); color: var(--muted); }
.rte-area p { margin: 0 0 .9em; } .rte-area h1 { font-size: 1.6em; margin: .3em 0 .5em; } .rte-area h2 { font-size: 1.35em; margin: .3em 0 .5em; } .rte-area h3 { font-size: 1.15em; margin: .3em 0 .5em; }
.rte-area img { max-width: 100%; height: auto; } .rte-area ul, .rte-area ol { padding-left: 26px; } .rte-area a { color: var(--brand); text-decoration: underline; }
.rte-foot { display: flex; justify-content: flex-end; padding: 6px 14px 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
#print-area.html { white-space: normal; font: 12pt/1.5 Georgia, serif; } #print-area.html img { max-width: 100%; } #print-area.html p { margin: 0 0 .9em; }
.rte-sel[data-rte=block] { min-width: 118px; } .rte-sel[data-rte=size] { min-width: 96px; } .rte-sel[data-rte=ph] { min-width: 150px; }

/* ---------- Facturación ---------- */
.billing-page { width: 100%; min-width: 0; }
.billing-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.billing-title { display: flex; align-items: center; gap: 16px; min-width: 0; }
.billing-title h1 { margin: 0 0 5px; font-size: clamp(30px, 2.6vw, 38px); line-height: 1.05; }
.billing-title .muted { font-size: 15px; }
.billing-primary { min-height: 50px; padding: 10px 20px !important; border-radius: 10px; font-size: 15px; font-weight: 600; white-space: nowrap; }
.billing-primary .ic { width: 22px; height: 22px; }
.billing-tabs { margin: 0 0 20px; gap: 28px; }
.billing-tabs a { padding: 0 2px 12px; font-size: 15px; cursor: pointer; }
.billing-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.billing-toolbar-left, .billing-toolbar-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; }
.billing-toolbar .btn, .billing-toolbar .kebab > .btn { min-height: 46px; border-radius: 9px; padding: 9px 14px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.billing-toolbar .btn .ic { width: 21px; height: 21px; color: var(--brand); }
.billing-toolbar .btn.primary .ic { color: #fff; }
.billing-manage { min-width: 220px; justify-content: space-between; }
.billing-manage > .ic:last-child { width: 13px; height: 13px; color: var(--muted); margin-left: 8px; }
.billing-search { flex: 0 1 300px; width: 300px; max-width: 300px; }
.billing-search input { height: 46px; border-radius: 9px; padding-right: 14px; font-size: 14px; }
.billing-search .ic { color: var(--brand); }
.billing-monthly { min-height: 46px !important; padding: 9px 14px !important; }
.billing-section { margin-bottom: 24px; min-width: 0; }
.billing-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 11px; }
.billing-section-head h2 { margin: 0 0 4px; font-size: 18px; line-height: 1.2; }
.billing-section-head p { margin: 0; font-size: 13px; }
.billing-table-card { min-width: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; overflow-y: hidden; box-shadow: 0 7px 20px rgba(34, 77, 130, .045); }
.billing-table-card > .ftable { width: 100%; min-width: 760px; }
.billing-table-card .ftable-row { min-height: 58px; width: 100%; }
.billing-table-card .ftable-row.head { min-height: 50px; background: color-mix(in srgb, var(--brand) 5%, var(--card)); }
.billing-table-card .ftable-cell { display: flex; align-items: center; gap: 7px; padding: 10px 14px; font-size: 14px; line-height: 1.35; }
.billing-table-card .ftable-row.head .ftable-cell { color: color-mix(in srgb, var(--text) 70%, var(--muted)); font-size: 12px; line-height: 1.2; text-transform: none; letter-spacing: 0; }
.billing-table-card .ftable-cell a, .billing-table-card .ftable-cell b { font-size: 14px; }
.billing-table-card .ftable-row:not(.head):hover { background: color-mix(in srgb, var(--brand) 3%, var(--card)); }
.billing-empty-row { min-height: 260px; display: flex; align-items: center; justify-content: center; }
.billing-empty-row .empty { padding: 24px; }
.billing-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.billing-empty .ic { width: 46px; height: 46px; color: color-mix(in srgb, var(--brand) 52%, var(--muted)); }
.billing-empty b { color: color-mix(in srgb, var(--text) 78%, var(--muted)); font-size: 16px; }
.billing-empty span { color: var(--muted); font-size: 13px; }
.billing-invoices .ftable-row > .ftable-cell:nth-child(1), .billing-transactions .ftable-row > .ftable-cell:nth-child(1) { flex: 1.25 1 190px; }
.billing-invoices .ftable-row > .ftable-cell:nth-child(2), .billing-transactions .ftable-row > .ftable-cell:nth-child(2) { flex: 1.7 1 250px; }
.billing-invoices .ftable-row > .ftable-cell:nth-child(3), .billing-transactions .ftable-row > .ftable-cell:nth-child(3) { flex: 0 1 125px; }
.billing-invoices .ftable-row > .ftable-cell:nth-child(4), .billing-transactions .ftable-row > .ftable-cell:nth-child(4) { flex: 0 1 135px; }
.billing-invoices .ftable-row > .ftable-cell:nth-child(5), .billing-transactions .ftable-row > .ftable-cell:nth-child(5) { flex: 0 1 125px; }
.billing-invoices .ftable-row > .ftable-cell:nth-child(6), .billing-transactions .ftable-row > .ftable-cell:nth-child(6) { flex: 0 0 auto; min-width: 205px; }
.billing-invoices .ftable-row > .ftable-cell:nth-child(5) .badge, .billing-transactions .ftable-row > .ftable-cell:nth-child(6) .badge { margin-right: 5px; }
.billing-invoices .ftable-cell.shrink { justify-content: flex-end; }
.billing-invoices .ftable-cell.shrink .btn { min-height: 34px; }
.billing-plans > .ftable { width: 100%; min-width: 680px; }
.billing-plans .ftable-row > .ftable-cell:nth-child(1) { flex: 1.1 1 180px; }
.billing-plans .ftable-row > .ftable-cell:nth-child(2), .billing-plans .ftable-row > .ftable-cell:nth-child(3) { flex: 0 1 120px; }
.billing-plans .ftable-row > .ftable-cell:nth-child(4) { flex: 1.7 1 250px; }
.billing-plans .ftable-row > .ftable-cell:nth-child(5) { flex: 0 0 185px; justify-content: flex-end; }
.billing-plans .ftable-row > .ftable-cell:nth-child(5) .btn + .btn { margin-left: 5px; }
.billing-table-card .empty { padding: 56px 24px; }

@media (max-width: 900px) {
  .billing-toolbar-left, .billing-toolbar-right { width: 100%; }
  .billing-toolbar-right { justify-content: stretch; }
  .billing-search { flex: 1 1 220px; max-width: none; }
  .billing-monthly { flex: 0 0 auto; }
}
@media (max-width: 800px) {
  .billing-header { align-items: flex-start; gap: 15px; margin-bottom: 20px; }
  .billing-title { gap: 13px; }
  .billing-title h1 { font-size: 30px; }
  .billing-title .muted { font-size: 14px; }
  .billing-primary { width: 100%; justify-content: center; }
  .billing-toolbar { align-items: stretch; }
  .billing-toolbar-left, .billing-toolbar-right { align-items: stretch; gap: 9px; }
  .billing-toolbar-left > .kebab, .billing-toolbar-left > .btn, .billing-toolbar-right > .btn, .billing-search { flex: 1 1 100%; width: 100%; max-width: none; }
  .billing-toolbar .kebab > .btn { width: 100%; justify-content: space-between; }
  .billing-monthly { justify-content: center; }
  .billing-section-head { align-items: flex-start; flex-direction: column; }
}


@font-face { font-family: 'Firma'; src: url('fonts/firma.woff2') format('woff2'), url('fonts/firma.woff') format('woff'), local('Dancing Script'), local('DancingScript-Regular'), local('Great Vibes'), local('Segoe Print'), local('Bradley Hand'), local('Bradley Hand ITC'), local('Noteworthy'), local('Chalkboard SE'), local('Ink Free'), local('Comic Sans MS'); }
.rt-sig { font-family: 'Firma', 'Dancing Script', 'Great Vibes', 'Segoe Print', 'Bradley Hand', 'Ink Free', 'Chalkboard SE', 'Comic Sans MS', cursive; font-size: 32px; line-height: 1.1; color: #2b2b2b; transform: rotate(-1.5deg); display: inline-block; padding: 4px 0 0; }
img[alt="Firma"] { vertical-align: bottom; }

/* Indicador de carga (círculo giratorio) */
.spin { display: inline-block; width: 30px; height: 30px; border-radius: 50%; border: 4px solid color-mix(in srgb, var(--brand) 25%, transparent); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#lb-more.loading { padding: 14px 0 18px; }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2s; } }

/* ---------- Versión móvil: barra superior + menú lateral deslizable ---------- */
.m-top, .m-scrim, .m-close { display: none; }
@media (max-width: 800px) {
  .layout { flex-direction: column; }
  .m-top { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 40; height: 56px; padding: 0 12px; background: var(--card); border-bottom: 1px solid var(--line); }
  #toast { top: 66px; }
  .m-top .brand img { max-height: 32px; max-width: 160px; } .m-top .brand .bname { color: var(--brand); font-size: 16px; }
  .m-btn { position: relative; display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 8px; cursor: pointer; flex-shrink: 0; }
  .m-btn .ic { width: 22px; height: 22px; } .m-btn .dot { position: absolute; top: -3px; right: -5px; }
  .m-scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(10,16,30,.5); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .layout.drawer-open .m-scrim { opacity: 1; pointer-events: auto; }
  .side, .layout.collapsed .side { position: fixed; z-index: 60; left: 0; top: 0; bottom: 0; width: min(84vw, 310px); height: 100dvh; overflow-y: auto; padding: calc(18px + env(safe-area-inset-top)) 14px calc(12px + env(safe-area-inset-bottom)); transform: translateX(-104%); transition: transform .25s ease; box-shadow: none; }
  .layout.drawer-open .side { transform: none; box-shadow: 8px 0 30px rgba(0,0,0,.28); }
  .side-toggle { display: none; } .side { overscroll-behavior: contain; }
  .m-close { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 0; background: transparent; color: inherit; border-radius: 10px; cursor: pointer; }
  .m-close .ic { width: 22px; height: 22px; }
  .side a, .layout.collapsed .side a { padding: 13px 16px; font-size: 15.5px; justify-content: flex-start; }
  .layout.collapsed .side .lbl, .layout.collapsed .side .bname { display: revert; }
  .layout.collapsed .side-top { flex-direction: row; padding: 2px 4px 16px 8px; } .layout.collapsed .brand img { max-width: 150px; }
  .layout.collapsed .side-label, .layout.collapsed .who small { display: block; }
  .layout.collapsed .side a .dot { position: static; }
  .layout.collapsed .side .who { display: block; padding: 14px 6px 8px; }
  .layout.collapsed .side-group.open .side-sub { display: flex; } .layout.collapsed .side .chev { display: flex; }
  .side .side-sub a { padding: 11px 14px; font-size: 14.5px; }
  .main { min-width: 0; }
  .side-top, .side .who { margin: 0 6px; }
}

.page-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 90px 0; }
.page-loading.full { min-height: 60vh; }
.spin.lg { width: 44px; height: 44px; border-width: 5px; }

/* Menú del usuario (abajo en la barra lateral) */
.side .who { position: relative; padding: 10px 6px 8px; }
.who-btn { width: 100%; display: flex; align-items: center; gap: 10px; background: transparent; border: 0; color: inherit; padding: 8px; border-radius: 8px; cursor: pointer; text-align: left; font: inherit; }
.who-btn:hover, .who.open .who-btn { background: color-mix(in srgb, var(--brand) 10%, transparent); }
.who-btn .lbl { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; flex: 1; }
.who-btn .lbl small { display: block; font-weight: 400; font-size: 12px; opacity: .75; }
.who-btn .chev { flex: 0 0 auto; display: flex; opacity: .7; } .who-btn .chev .ic { width: 16px; height: 16px; transform: rotate(180deg); transition: transform .2s; } .who.open .chev .ic { transform: none; }
.avatar { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13.5px; letter-spacing: .02em; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.avatar.xl { width: 84px; height: 84px; font-size: 26px; }
/* Lista de miembros del equipo (Configuración → Empresa & Equipo → Miembros Del Equipo), como en
   Credit Repair Cloud: fila con foto/iniciales, nombre, rol, se hace clic para editar el perfil. */
.team-row { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.team-row:last-child { border-bottom: 0; }
.team-row:hover { background: var(--bg); }
.team-row-info { flex: 1; min-width: 0; }
.team-row-info b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar-pick { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 18px; }
.avatar-pick label { color: var(--brand); font-size: 13.5px; font-weight: 600; cursor: pointer; }
.avatar-pick label:hover { text-decoration: underline; }
.avatar-pick .avatar.xl { position: relative; }
.avatar-pick .cam { position: absolute; right: -2px; bottom: -2px; width: 26px; height: 26px; border-radius: 50%; background: var(--card); color: var(--brand); display: flex; align-items: center; justify-content: center; border: 2px solid var(--card); box-shadow: 0 0 0 1.5px var(--line); }
.avatar-pick .cam .ic { width: 14px; height: 14px; }
.user-menu { display: none; position: absolute; left: 6px; right: auto; width: max-content; min-width: calc(100% - 12px); bottom: calc(100% - 4px); z-index: 30; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(10,16,30,.22); padding: 6px; min-width: 210px; }
.who.open .user-menu { display: block; }
.um-item { width: 100%; white-space: nowrap; display: flex; align-items: center; gap: 12px; background: transparent; border: 0; color: var(--text); font: inherit; font-size: 14.5px; padding: 11px 12px; border-radius: 10px; cursor: pointer; text-align: left; }
.um-item:hover { background: color-mix(in srgb, var(--brand) 10%, transparent); } .um-item .ic { width: 18px; height: 18px; opacity: .8; } .um-item.bad { color: var(--bad); }
.layout.collapsed .who-btn { justify-content: center; padding: 6px 0; } .layout.collapsed .who-btn .lbl { display: none; }
.layout.collapsed .user-menu { left: calc(100% + 8px); right: auto; bottom: 6px; }
@media (max-width: 800px) { .layout.collapsed .who-btn .lbl { display: block; } .layout.collapsed .user-menu { left: 6px; right: 6px; bottom: calc(100% - 4px); } }

/* Seguridad */
.chklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; } .chklist li { display: flex; gap: 12px; align-items: flex-start; }
.chklist .mark { flex: 0 0 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: #fff; }
.chklist li.ok .mark { background: var(--ok); } .chklist li.no .mark { background: var(--warn); }
.row-gap { display: flex; flex-wrap: wrap; gap: 10px; }
/* Antes era "tr.dim-bad td" de cuando la bitácora de seguridad usaba un <table> real — ya usa
   ".ftable" (ver secLogHtml en public/security.js), así que el selector apunta a ".ftable-cell". */
.ftable-row.dim-bad .ftable-cell { background: color-mix(in srgb, var(--bad) 6%, transparent); }

/* Batch Print */
#print-area .bp-page { break-after: page; page-break-after: always; } #print-area .bp-page:last-child { break-after: auto; page-break-after: auto; }
#print-area .bp-img { text-align: center; } #print-area .bp-img img { max-width: 100%; max-height: 90vh; } #print-area .bp-cap { font: 10pt sans-serif; color: #555; margin-bottom: 8px; }
/* Resumen de importación imprimible (ver importSummaryPrintHtml en public/staff.js): usa ".ftable"
   en vez de un <table> real, así que evitamos que una fila quede partida entre dos páginas impresas
   (con <table> el navegador ya lo hacía solo). */
#print-area .ftable-row { break-inside: avoid; page-break-inside: avoid; }
.link { color: var(--brand); font-weight: 600; font-size: 14px; text-decoration: none; } .link:hover { text-decoration: underline; }
.bp-form .fields2 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 14px; } .bp-form { margin-bottom: 4px; }
@media (min-width: 900px) { .bp-form { display: grid; grid-template-columns: 1.25fr 1.25fr 1fr 1fr 1fr; gap: 0 14px; } .bp-form .fields2 { display: contents; } }

/* Barra de scroll personalizada */
* { scrollbar-width: thin; scrollbar-color: rgb(189, 189, 189) rgb(241, 241, 241); }
::-webkit-scrollbar { height: 8px; width: 8px; background: rgb(204, 204, 204); }
::-webkit-scrollbar-thumb { background: rgb(189, 189, 189); border-radius: 4px; }
::-webkit-scrollbar-track { background: rgb(241, 241, 241); }
@media (prefers-color-scheme: dark) {
  :root:not([data-mode="light"]) { scrollbar-color: #4a5674 #1b2439; }
  :root:not([data-mode="light"]) ::-webkit-scrollbar { background: #1b2439; }
  :root:not([data-mode="light"]) ::-webkit-scrollbar-thumb { background: #4a5674; }
  :root:not([data-mode="light"]) ::-webkit-scrollbar-track { background: #1b2439; }
}
:root[data-mode="dark"] { scrollbar-color: #4a5674 #1b2439; }
:root[data-mode="dark"] ::-webkit-scrollbar { background: #1b2439; }
:root[data-mode="dark"] ::-webkit-scrollbar-thumb { background: #4a5674; }
:root[data-mode="dark"] ::-webkit-scrollbar-track { background: #1b2439; }

/* ---------- Perfil del cliente ---------- */
.client-profile { width: 100%; min-width: 0; }
.cp-header { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.cp-back { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--brand); font-size: 23px; line-height: 1; }
.cp-title-icon { width: 58px; height: 58px; border-radius: 14px; }
.cp-title-icon .ic { width: 29px; height: 29px; }
.cp-identity { flex: 1 1 320px; min-width: 0; }
.cp-name-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cp-name-row h1 { margin: 0; font-size: clamp(26px, 2.5vw, 36px); line-height: 1.05; }
.cp-contact { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 7px; color: var(--muted); font-size: 13px; }
.cp-contact > span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.cp-contact .ic { width: 15px; height: 15px; color: var(--brand); flex: 0 0 auto; }
.cp-header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cp-header-actions .btn { min-height: 42px; }
.cp-tabs { margin: 0 0 20px; gap: 18px; border-bottom: 1px solid var(--line); box-shadow: none; }
.cp-tabs a { padding: 0 7px 11px; font-size: 13px; }
.cp-summary { display: flex; flex-direction: column; gap: 16px; }
.cp-score-card, .cp-card, .cp-documents, .cp-detail-card { margin: 0; padding: 16px; border-radius: 10px; box-shadow: 0 6px 18px rgba(34, 77, 130, .04); }
.cp-section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 10px; }
.cp-section-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cp-section-title h2 { margin: 0; font-size: 17px; line-height: 1.2; }
.cp-section-title p { margin: 3px 0 0; font-size: 12px; }
.cp-section-icon { width: 32px; height: 32px; border-radius: 8px; background: var(--info-bg); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.cp-section-icon .ic { width: 19px; height: 19px; }
.cp-section-actions { flex-wrap: wrap; justify-content: flex-end; }
.cp-score-note { text-align: center; margin-top: 8px; }
.cp-secondary-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(340px, .9fr); gap: 16px; align-items: start; }
.cp-right-stack { display: flex; flex-direction: column; gap: 16px; }
.cp-dispute-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(190px, .75fr); gap: 14px; }
.cp-dispute-table { min-width: 0; overflow-x: auto; }
.cp-dispute-table .ftable { width: 100%; min-width: 430px; }
.cp-dispute-table .ftable-cell { display: flex; align-items: center; gap: 6px; padding: 7px 9px; font-size: 12.5px; }
.cp-dispute-table .ftable-row { min-height: 36px; }
.cp-dispute-table .ftable-row.head .ftable-cell { font-size: 11px; text-transform: none; letter-spacing: 0; }
.cp-dispute-table .ftable-cell.num { justify-content: center; text-align: center; }
.cp-dispute-table .ftable-cell.num .bureau { max-width: 72px; }
.cp-dispute-foot { margin: 8px 0 0; }
.cp-dispute-chart { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.cp-donut { width: 125px; height: 125px; border-radius: 50%; display: grid; place-items: center; position: relative; }
.cp-donut::after { content: ''; width: 76px; height: 76px; border-radius: 50%; background: var(--card); position: absolute; }
.cp-donut > div { position: relative; z-index: 1; text-align: center; font-size: 22px; font-weight: 700; }
.cp-donut > div span { display: block; font-size: 10px; font-weight: 500; color: var(--muted); }
.cp-legend { display: flex; flex-direction: column; gap: 5px; width: 100%; font-size: 12px; }
.cp-legend > span { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cp-legend > span > span { display: inline-flex; align-items: center; }
.cp-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.cp-task-list, .cp-note-list { display: flex; flex-direction: column; gap: 0; }
.cp-task-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); }
.cp-task-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cp-task-main b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-task-main span { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-task-date { white-space: nowrap; font-size: 12px; color: var(--muted); }
.cp-row-actions { display: flex; gap: 2px; }
.cp-row-actions .icon-btn { width: 30px; height: 30px; font-size: 18px; }
.cp-note { padding: 9px 10px; background: var(--warn-bg); border-left: 3px solid var(--warn); border-radius: 6px; margin-bottom: 7px; font-size: 12.5px; white-space: pre-wrap; word-break: break-word; }
.cp-note:last-child { margin-bottom: 0; }
.cp-note-meta { display: block; margin-top: 4px; font-size: 10.5px; color: var(--muted); }
.cp-empty { padding: 22px 10px; }
.cp-card-foot { margin: 9px 0 0; }
.cp-documents { min-width: 0; }
.cp-documents .ftable { width: 100%; min-width: 620px; }
.cp-documents .ftable-cell { display: flex; align-items: center; padding: 10px 12px; font-size: 13px; }
.cp-documents .ftable-row { min-height: 48px; }
.cp-documents .ftable-row.head .ftable-cell { font-size: 11px; text-transform: none; letter-spacing: 0; }
.cp-documents .ftable-cell.wide { flex: 2 1 280px; }
.cp-documents .ftable-cell:nth-child(2) { flex: 0 1 130px; }
.cp-documents .ftable-cell:nth-child(3) { flex: 0 1 145px; }
.cp-documents .ftable-cell.shrink { flex: 0 0 150px; justify-content: flex-end; gap: 4px; }
.cp-documents .tabs.seg { margin-bottom: 12px; box-shadow: none; }
.cp-details-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cp-detail-card h2 { margin-top: 0; }
.doc-preview { min-height: 180px; display: flex; align-items: center; justify-content: center; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow: auto; }
.doc-preview-image { display: block; max-width: 100%; max-height: 65vh; object-fit: contain; }
.doc-preview-frame { width: 100%; height: 65vh; border: 0; background: #fff; }
.doc-preview-actions { justify-content: flex-end; margin-top: 12px; }

@media (max-width: 1000px) {
  .cp-secondary-grid, .cp-details-grid { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .cp-header { align-items: flex-start; }
  .cp-title-icon { width: 56px; height: 56px; }
  .cp-title-icon .ic { width: 28px; height: 28px; }
  .cp-header-actions { width: 100%; }
  .cp-header-actions .btn { flex: 1 1 auto; }
  .cp-dispute-layout { grid-template-columns: 1fr; }
  .cp-documents { overflow-x: auto; }
  .cp-documents .cp-section-head { min-width: 620px; }
}
@media (max-width: 560px) {
  .cp-header-actions .btn { width: 100%; justify-content: center; }
  .cp-name-row h1 { font-size: 28px; }
  .cp-contact { gap: 8px; flex-direction: column; align-items: flex-start; }
  .cp-score-card, .cp-card, .cp-documents, .cp-detail-card { padding: 13px; }
  .cp-section-head { align-items: flex-start; flex-direction: column; }
  .cp-section-head > .btn, .cp-section-actions { width: 100%; }
  .cp-section-actions > * { flex: 1 1 auto; justify-content: center; }
  .cp-task-row { grid-template-columns: minmax(0, 1fr) auto; }
  .cp-task-date { grid-column: 1; }
  .cp-row-actions { grid-column: 2; grid-row: 1 / span 2; }
}

/* ---------- Perfil del cliente: elementos en disputa ---------- */
.items-page { width: 100%; min-width: 0; }
.items-content-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.items-content-head > .tk-hicon { flex: 0 0 auto; }
.items-content-head h1 { margin: 1px 0 6px; font-size: clamp(26px, 3vw, 34px); line-height: 1.12; }
.items-description { max-width: 1100px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.items-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.items-view-tabs { display: inline-flex; align-items: stretch; gap: 0; margin: 0; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; box-shadow: none; background: var(--card); }
.items-view-tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 10px 16px; border: 0; color: var(--muted); font-size: 13px; font-weight: 600; }
.items-view-tabs a + a { border-left: 1px solid var(--line); }
.items-view-tabs a.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.items-view-tabs a:hover { color: var(--brand); background: var(--info-bg); text-decoration: none; }
.items-view-tabs a.active:hover { color: #fff; background: var(--brand-dark); }
.items-view-tabs .ic { width: 17px; height: 17px; flex: 0 0 auto; }
.items-toolbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex: 1 1 520px; flex-wrap: wrap; }
.items-toolbar-actions .btn { min-height: 42px; }
.items-toolbar-actions .items-add-btn { margin-left: 2px; }
.items-table-shell { width: 100%; overflow-x: auto; overflow-y: visible; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.items-list-table { width: 100%; min-width: 1180px; }
.items-list-table .ftable-row { width: 100%; min-width: 1180px; align-items: stretch; }
.items-list-table .ftable-cell { display: flex; align-items: flex-start; padding: 12px 13px; font-size: 13px; line-height: 1.35; }
.items-list-table .ftable-row.head { min-height: 52px; }
.items-list-table .ftable-row.head .ftable-cell { font-size: 11px; text-transform: none; letter-spacing: 0; font-weight: 700; color: var(--muted); white-space: normal; }
.items-list-table .ftable-row:not(.head) { min-height: 96px; background: var(--card); }
.items-list-table .ftable-row:not(.head):hover { background: color-mix(in srgb, var(--brand) 4%, var(--card)); }
.items-list-table .ftable-row:last-child { border-bottom: 0; }
.items-creditor-col { flex: 1.2 1 190px; min-width: 190px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px; }
.items-creditor-col b { color: var(--text); font-size: 14px; line-height: 1.25; }
.items-creditor-col .small { font-size: 11px; }
.items-account-col { flex: 1.35 1 220px; min-width: 220px; align-items: flex-start; }
.items-issue-col { flex: 1.2 1 220px; min-width: 205px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px; }
.items-bureau-col { flex: 0 1 155px; min-width: 155px; justify-content: center; align-items: stretch; }
.items-actions-col { flex: 0 0 76px; justify-content: center; }
.items-account-lines { display: flex; flex-direction: column; gap: 2px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.items-account-lines span { display: block; white-space: nowrap; }
.items-account-lines b { color: var(--muted); font-size: 11px; font-weight: 600; }
.items-issue-title { color: var(--text); font-size: 13px; font-weight: 600; }
.items-issue-meta { color: var(--muted); font-size: 11px; }
.items-bureau-entry { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; min-height: 68px; margin: 0; }
.items-status-picker { display: flex; justify-content: center; min-width: 0; width: auto; }
.items-status-badge { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; width: auto; min-width: 82px; min-height: 0; padding: 0 4px 2px; border: 0; border-radius: 0; background: transparent !important; color: var(--brand) !important; font: inherit; font-size: 12px; font-weight: 600; line-height: 1.2; text-align: center; cursor: pointer; }
.items-status-badge:hover { color: var(--brand-dark) !important; }
.items-status-badge .items-status-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 18px; width: 18px; height: 18px; border-radius: 3px; }
.items-status-badge .items-status-icon .ic { width: 13px; height: 13px; color: #fff; }
.items-status-badge .sf-label { flex: none; max-width: none; color: inherit; overflow: visible; text-overflow: clip; white-space: nowrap; }
.items-status-badge .chev { display: none; }
.items-status-badge.status-warn .items-status-icon { background: var(--warn); }
.items-status-badge.status-ok .items-status-icon { background: var(--ok); }
.items-status-badge.status-bad .items-status-icon { background: var(--bad); }
.items-status-badge.status-gray .items-status-icon { background: var(--muted); }
.items-status-badge.status-cyan .items-status-icon { background: var(--cyan); }
.items-status-badge.status-purple .items-status-icon { background: var(--purple); }
.items-group-mark { display: inline-flex; align-items: center; justify-content: center; width: 25px; height: 25px; border-radius: 50%; background: var(--info-bg); color: var(--brand); font-size: 11px; font-weight: 700; }
.items-row-actions { position: relative; }
.items-row-actions .icon-btn { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--muted); }
.items-row-actions .icon-btn:hover { border-color: var(--brand); background: var(--info-bg); color: var(--brand); }
.items-footer { display: flex; justify-content: flex-end; padding: 12px 4px 0; color: var(--muted); font-size: 13px; }
.items-footer b { color: var(--text); }
.items-empty { border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.items-editor-date { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: -4px 0 10px; padding: 0 2px; color: var(--muted); font-size: 13px; }
.items-editor-date b { color: var(--text); font-weight: 600; }
.items-editor-bureaus { margin-top: 8px; overflow-x: auto; padding-bottom: 2px; }
.items-editor-grid { display: grid; grid-template-columns: 150px repeat(3, minmax(190px, 1fr)); min-width: 720px; align-items: center; border-top: 1px solid var(--line); }
.items-editor-grid > * { min-width: 0; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.items-editor-bureau-head { display: flex; align-items: center; justify-content: center; min-height: 48px; background: color-mix(in srgb, var(--brand) 4%, var(--card)); }
.items-editor-bureau-head .items-editor-bureau-check { width: 16px; height: 16px; margin-right: 8px; accent-color: var(--brand); }
.items-editor-bureau-head .items-editor-bureau-check[aria-disabled="true"] { pointer-events: none; }
.items-editor-bureau-head .bureau-logo { max-width: 112px; }
.items-editor-bureau-name { display: none; margin-left: 7px; color: var(--muted); font-size: 11px; font-weight: 600; }
.items-editor-column-title { display: flex; align-items: center; min-height: 48px; background: color-mix(in srgb, var(--brand) 4%, var(--card)); }
.items-editor-label { color: var(--muted); font-size: 12px; font-weight: 600; }
.items-editor-grid input, .items-editor-grid select, .items-editor-grid textarea { width: 100%; min-width: 0; min-height: 38px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--card); color: var(--text); font: inherit; font-size: 13px; }
.items-editor-grid textarea { min-height: 58px; resize: vertical; }
.items-editor-grid input:focus, .items-editor-grid select:focus, .items-editor-grid textarea:focus { border-color: var(--brand); outline: 2px solid color-mix(in srgb, var(--brand) 17%, transparent); }
.items-editor-grid input:disabled, .items-editor-grid select:disabled, .items-editor-grid textarea:disabled { color: var(--muted); background: color-mix(in srgb, var(--line) 24%, var(--card)); opacity: .72; cursor: not-allowed; }
.items-editor-date-field { position: relative; min-width: 0; }
.items-editor-date-field input { padding-right: 36px !important; }
.items-editor-date-field > span { position: absolute; top: 50%; right: 10px; display: inline-flex; color: var(--muted); transform: translateY(-50%); pointer-events: none; }
.items-editor-date-field .ic { width: 17px; height: 17px; }
.items-editor-grid .items-editor-dp { position: relative; width: 100%; min-width: 0; }
.items-editor-grid .items-editor-dp .dp-txt { width: 100%; padding-right: 38px; }
.items-editor-grid .items-editor-dp .dp-btn { position: absolute; top: 50%; right: 5px; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; border: 0; background: transparent; color: var(--muted); transform: translateY(-50%); cursor: pointer; }
.items-editor-grid .items-editor-dp .dp-btn:hover { color: var(--brand); }
.items-editor-grid .items-editor-dp .dp-btn:disabled { cursor: not-allowed; opacity: .7; }
.items-editor-section { margin-bottom: 18px; border: 1px solid color-mix(in srgb, var(--brand) 13%, var(--line)); border-radius: 9px; overflow: hidden; }
.items-editor-section-head { display: flex; align-items: center; gap: 10px; padding: 11px 14px; background: color-mix(in srgb, var(--info-bg) 72%, var(--card)); color: var(--brand); }
.items-editor-section-head > .ic { width: 21px; height: 21px; flex: 0 0 21px; }
.items-editor-section-head h3 { margin: 0; color: var(--brand); font-size: 16px; }
.items-editor-section-head p { margin: 2px 0 0; color: var(--muted); font-size: 11.5px; }
.items-editor-top { padding: 14px; }
.items-editor-top-pair { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); gap: 18px; }
.items-editor-action-control { display: grid; grid-template-columns: minmax(0, 1fr) max-content; align-items: center; gap: 12px; min-width: 0; }
.items-editor-action-control textarea { width: 100%; }
.items-editor-add-option { color: var(--brand); font-size: 12px; font-weight: 600; white-space: nowrap; }
.items-editor-add-option:hover { color: var(--brand-dark); text-decoration: underline; }
.items-editor-help { display: inline-flex; margin-left: 6px; color: var(--muted); vertical-align: -2px; cursor: help; }
.items-editor-help .ic { width: 14px; height: 14px; }
.items-editor-bureau-section .items-editor-bureaus { margin: 0; padding: 0 14px 14px; }
.items-editor-bureau-section .items-editor-grid { border-top: 0; }
@media (max-width: 800px) {
  #modal-root .items-editor-top-pair { grid-template-columns: 1fr; gap: 12px; }
  #modal-root .items-editor-action-control { grid-template-columns: 1fr; align-items: start; }
  #modal-root .items-editor-add-option { justify-self: start; }
}
.items-report-view { min-width: 0; }
.items-report-view .rv-card { margin-bottom: 14px; box-shadow: 0 5px 16px rgba(34, 77, 130, .035); }
.items-report-view .rv-cell.head { text-transform: none; letter-spacing: 0; }
.items-report-view .rv-cell { font-size: 13px; }

/* Vista de reporte: el orden del informe completo. Las tarjetas de Account History conservan el
   editor existente, mientras las consultas se muestran como filas por buró y despliegan su propia
   configuración solo después de seleccionar una consulta. */
.rv-report-section { margin: 0 0 30px; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--card);     box-shadow: 0 6px 8px -4px rgba(0, 0, 0, 0.12); }
.rv-report-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; margin: 0; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.rv-section-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rv-section-icon { width: 34px; height: 34px; border-radius: 9px; }
.rv-section-icon .ic { width: 20px; height: 20px; }
.rv-report-section-head h2 { margin: 0; color: var(--text); font-size: 17px; }
.rv-report-section-head p { margin: 3px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.rv-section-toggle { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 32px; width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--card); color: var(--brand); cursor: pointer; }
.rv-section-toggle:hover { border-color: var(--brand); background: var(--info-bg); }
.rv-section-toggle .ic { width: 17px; height: 17px; transform: rotate(180deg); transition: transform .16s ease; }
.rv-section-toggle[aria-expanded="false"] .ic { transform: rotate(0deg); }
.rv-report-section-body { padding: 14px 14px 14px; }
.rv-report-section-body[hidden] { display: none; }
.rv-report-table { overflow-x: auto; border: 1px solid var(--line); border-radius: 9px; background: var(--card); }
.rv-report-row { display: grid; grid-template-columns: minmax(170px, 1.05fr) repeat(3, minmax(150px, 1fr)); min-width: 700px; }
.rv-report-row > div {   font-weight: 700; min-width: 0; min-height: 38px; display: flex; align-items: center; gap: 7px; padding: 9px 12px; border-bottom: 1px solid var(--line); color: var(--text); font-size: 13px; overflow-wrap: anywhere; }
.rv-report-row:last-child > div { border-bottom: 0; }
.rv-report-row.head > div { min-height: 48px; background: var(--bg); color: var(--muted); font-size: 11.5px; font-weight: 700; }
.rv-report-row.head > div:nth-child(2) { background: color-mix(in srgb, var(--b-eq) 11%, var(--bg)); }
.rv-report-row.head > div:nth-child(3) { background: color-mix(in srgb, var(--b-ex) 10%, var(--bg)); }
.rv-report-row.head > div:nth-child(4) { background: color-mix(in srgb, var(--b-tu) 10%, var(--bg)); }
.rv-report-row.head > div:not(:first-child) { justify-content: center; }
.rv-report-row.head .bureau-logo { max-width: 92px; max-height: 22px; }
.rv-report-row.head .bureau-logo img { max-height: 22px; }
.rv-row-label { justify-content: flex-start; color: var(--muted) !important; font-size: 14px !important; text-align: right; font-weight: 700; }
.rv-profile-table .rv-report-row > div:not(:first-child), .rv-summary-table .rv-report-row > div:not(:first-child) { align-items: flex-start; }
.rv-profile-table .rv-report-row:not(.head) > div:not(:first-child), .rv-summary-table .rv-report-row:not(.head) > div:not(:first-child) { line-height: 1.45; }
.rv-profile-fallback-table { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); }
.rv-profile-fallback-table > .rv-profile-fallback { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.rv-profile-fallback > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); }
.rv-profile-fallback .rv-data-label { color: var(--muted); font-size: 11.5px; }
.rv-profile-fallback strong { color: var(--text); font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.rv-report-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 92px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--muted); text-align: center; }
.rv-empty-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; background: var(--info-bg); color: var(--brand); }
.rv-empty-icon .ic { width: 18px; height: 18px; }
.rv-inquiry-table { overflow-x: auto; border: 1px solid var(--line); border-radius: 9px; background: var(--card); }
.rv-inquiry-head, .rv-inquiry-row { display: grid; grid-template-columns: minmax(180px, 1.1fr) repeat(3, minmax(155px, 1fr)) minmax(120px, .65fr); min-width: 850px; }
.rv-inquiry-head > div { display: flex; align-items: center; gap: 6px; min-height: 48px; padding: 9px 11px; background: var(--bg); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11.5px; font-weight: 700; }
.rv-inquiry-head > div:not(:first-child) { justify-content: center; }
.rv-inquiry-head .bureau-logo { max-width: 94px; max-height: 22px; }
.rv-inquiry-row { position: relative; align-items: stretch; }
.rv-inquiry-row > .rv-inquiry-label, .rv-inquiry-row > .rv-inquiry-cell, .rv-inquiry-row > .rv-inquiry-state, .rv-inquiry-row > .rv-inquiry-actions { min-height: 74px; padding: 12px 11px; border-bottom: 1px solid var(--line); }
.rv-inquiry-label { display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.rv-inquiry-label b { color: var(--text); font-size: 13px; }
.rv-inquiry-label span { color: var(--muted); font-size: 11px; }
.rv-inquiry-cell { display: flex; align-items: center; justify-content: center; text-align: center; }
.rv-inquiry-cell.empty { color: var(--muted); }
.rv-inquiry-cell.persisted { flex-direction: column; gap: 5px; color: var(--muted); font-size: 12px; }
.rv-inquiry-check { color: var(--ok); }
.rv-inquiry-check .ic { width: 20px; height: 20px; }
.rv-inquiry-trigger { padding: 4px 2px; border: 0; background: transparent; color: var(--brand); cursor: pointer; font: inherit; font-size: 12px; line-height: 1.35; text-decoration: underline; }
.rv-inquiry-trigger:hover { color: var(--brand-dark); }
.rv-inquiry-cell.selected { background: color-mix(in srgb, var(--brand) 6%, var(--card)); }
.rv-inquiry-state { display: flex; align-items: center; justify-content: center; }
.rv-inquiry-actions { display: flex; align-items: center; justify-content: center; }
.rv-inquiry-actions .kebab { position: relative; }
.rv-inquiry-actions .icon-btn { width: 30px; height: 30px; color: var(--brand); }
.rv-inquiry-dispute-panel { grid-column: 1 / -1; padding: 14px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--brand) 5%, var(--card)); }
.rv-inquiry-panel-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; color: var(--text); font-size: 13px; }
.rv-inquiry-panel-title span { color: var(--muted); font-size: 11.5px; }
.rv-inquiry-config-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.rv-inquiry-config { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.rv-inquiry-config-head { display: flex; align-items: center; gap: 7px; min-height: 28px; margin-bottom: 9px; color: var(--text); }
.rv-inquiry-config-head .bureau-logo { max-width: 90px; max-height: 21px; }
.rv-inquiry-config > label { display: grid; gap: 5px; margin-top: 9px; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.rv-inquiry-config .select-like { min-height: 36px; padding: 7px 9px; font-size: 12px; }
.rv-inquiry-config .kmenu a { font-size: 12px; }
.rv-inquiry-links { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-top: 10px; }
.rv-inquiry-links a { color: var(--brand); font-size: 11.5px; font-weight: 600; cursor: pointer; }
.rv-inquiry-links a:hover { text-decoration: underline; }
.rv-public-table .rv-report-row { grid-template-columns: minmax(190px, 1.15fr) repeat(3, minmax(150px, 1fr)) minmax(90px, .5fr); min-width: 760px; }
.rv-public-table .rv-report-row.head > div:not(:first-child) { justify-content: flex-start; }
.rv-summary-section { margin-bottom: 6px; }
@media (max-width: 800px) {
  .rv-report-section-head { align-items: flex-start; flex-direction: column; gap: 2px; }
  .rv-inquiry-config-grid { grid-template-columns: 1fr; }
  .rv-profile-fallback-table, .rv-profile-fallback-table > .rv-profile-fallback { grid-template-columns: 1fr; }
  .rv-report-section-body { padding-left: 10px; padding-right: 10px; }
}

/* Tarjetas independientes de Vista de reporte. Cada tarjeta representa un ítem/buró real; la
   Vista de lista conserva sus propias reglas y no depende de estos estilos. */
.items-report-view .rv-bureau-card { --rv-accent: var(--brand); --rv-tint: var(--info-bg); margin-bottom: 14px; overflow: hidden; border-color: color-mix(in srgb, var(--rv-accent) 18%, var(--line)); box-shadow: 0 5px 16px rgba(34, 77, 130, .035); }
.items-report-view .rv-bureau-equifax { --rv-accent: var(--b-eq); --rv-tint: color-mix(in srgb, var(--b-eq) 7%, var(--card)); }
.items-report-view .rv-bureau-experian { --rv-accent: var(--b-ex); --rv-tint: color-mix(in srgb, var(--b-ex) 7%, var(--card)); }
.items-report-view .rv-bureau-transunion { --rv-accent: var(--b-tu); --rv-tint: color-mix(in srgb, var(--b-tu) 7%, var(--card)); }
.rv-bureau-head { display: flex; align-items: center; justify-content: space-between; min-height: 56px; padding: 9px 16px 9px 18px; border-left: 4px solid var(--rv-accent); background: var(--rv-tint); }
.rv-bureau-logo { display: inline-flex; align-items: center; min-height: 28px; }
.rv-bureau-logo .bureau-logo { max-width: 132px; max-height: 28px; }
.rv-bureau-logo .bureau-logo img { max-height: 28px; }
.rv-collapse { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 1px solid color-mix(in srgb, var(--rv-accent) 16%, var(--line)); border-radius: 50%; background: var(--card); color: var(--rv-accent); cursor: pointer; }
.rv-collapse:hover { border-color: var(--rv-accent); background: color-mix(in srgb, var(--rv-accent) 8%, var(--card)); }
.rv-collapse .ic { width: 17px; height: 17px; transition: transform .16s ease; transform: rotate(180deg); }
.rv-collapse[aria-expanded="false"] .ic { transform: rotate(0deg); }
.rv-card-body { padding: 14px 16px 16px; background: var(--card); }
.rv-card-body[hidden] { display: none; }
.rv-summary-grid { display: grid; grid-template-columns: minmax(170px, 1.3fr) minmax(145px, 1fr) minmax(135px, .9fr) minmax(145px, 1fr) minmax(150px, 1fr) max-content; gap: 14px; align-items: center; }
.rv-data-field { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rv-data-label, .rv-control-label { color: var(--muted); font-size: 11.5px; line-height: 1.25; }
.rv-data-field strong { min-width: 0; color: var(--text); font-size: 13.5px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.rv-data-field .rv-acct { white-space: nowrap; letter-spacing: .04em; }
.rv-detail-action { align-self: center; justify-self: end; white-space: nowrap; }
.rv-more-toggle { display: inline-flex; align-items: center; gap: 5px; padding: 5px 0; border: 0; background: transparent; color: var(--brand); cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 700; }
.rv-more-toggle:hover { color: var(--brand-dark); text-decoration: underline; }
.rv-more-grid { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); gap: 12px 16px; margin-top: 14px; padding: 12px 0 2px; border-top: 1px solid var(--line); }
.rv-more-grid[hidden] { display: none; }
.rv-dispute-panel { display: grid; grid-template-columns: minmax(205px, .85fr) minmax(430px, 2.1fr) minmax(185px, .8fr); gap: 18px; align-items: stretch; margin-top: 14px; padding: 14px; border-radius: 9px; background: color-mix(in srgb, var(--rv-tint) 72%, var(--card)); }
.rv-status-stack, .rv-dispute-fields { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.rv-control-row { display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 10px; align-items: center; min-width: 0; }
.rv-control-label { color: var(--text); font-size: 12px; font-weight: 600; }
.rv-status-select, .rv-option-select { min-width: 0; width: 100%; }
.rv-status-select .select-like, .rv-option-select .select-like { min-height: 38px; padding: 8px 11px; border-radius: 7px; font-size: 13px; }
.rv-status-select .kmenu a, .rv-option-select .kmenu a { font-size: 13px; }
.rv-system-value { min-height: 38px; display: flex; align-items: center; color: var(--text); font-size: 13px; }
.rv-system-negative { color: var(--bad); }
.rv-indispute { color: var(--warn); }
.rv-control-content { display: flex; align-items: center; gap: 12px; min-width: 0; }
.rv-control-content .sel-combo { flex: 1 1 260px; min-width: 0; }
.rv-add-option { flex: 0 0 auto; color: var(--brand); font-size: 12px; font-weight: 600; white-space: nowrap; }
.rv-add-option:hover { color: var(--brand-dark); text-decoration: underline; }
.rv-include { display: flex; align-items: flex-start; gap: 9px; margin: 0; padding: 3px 2px; color: var(--text); cursor: pointer; }
.rv-include input { margin-top: 2px; accent-color: var(--brand); }
.rv-include span { display: flex; flex-direction: column; gap: 3px; }
.rv-include b { font-size: 13px; font-weight: 600; }
.rv-include small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.rv-card-actions { display: flex; justify-content: flex-end; min-height: 28px; margin-top: 8px; }
.rv-card-actions .items-row-actions .icon-btn { width: 32px; height: 32px; }
.rv-step-two { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 11px 14px; border: 1px solid color-mix(in srgb, var(--warn) 55%, var(--line)); border-radius: 8px; background: color-mix(in srgb, var(--warn-bg) 78%, var(--card)); color: var(--text); }
.rv-step-two p { margin: 0; font-size: 13px; line-height: 1.4; }
.rv-step-number { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%; background: var(--warn); color: #fff; font-size: 16px; font-weight: 700; }
.rv-final-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.rv-final-actions .btn { min-height: 42px; justify-content: center; }
.rv-final-actions .btn.green { flex: 1 1 310px; }
.rv-final-secondary { background: var(--card) !important; color: var(--ok) !important; }
.rv-final-secondary:hover { background: var(--ok-bg) !important; }

@media (max-width: 1080px) {
  .rv-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rv-detail-action { justify-self: start; }
  .rv-dispute-panel { grid-template-columns: minmax(210px, .85fr) minmax(0, 1.8fr); }
  .rv-include { grid-column: 1 / -1; padding-top: 2px; }
}
@media (max-width: 700px) {
  .rv-bureau-head { padding-left: 13px; }
  .rv-card-body { padding: 12px; }
  .rv-summary-grid, .rv-more-grid, .rv-dispute-panel { grid-template-columns: 1fr; }
  .rv-dispute-panel { gap: 14px; }
  .rv-control-row { grid-template-columns: 1fr; gap: 5px; align-items: stretch; }
  .rv-control-content { flex-direction: column; align-items: stretch; gap: 5px; }
  .rv-add-option { align-self: flex-start; }
  .rv-include { grid-column: auto; }
  .rv-final-actions { flex-direction: column; }
  .rv-final-actions .btn.green { width: 100%; }
}

/* Editor de ítems: cabecera y acciones permanecen fijas mientras solo el contenido de campos se desplaza. */
#modal-root .items-editor-modal { position: relative; display: flex; flex-direction: column; width: 100%; max-width: min(1100px, calc(100vw - 28px)); height: min(900px, calc(100vh - 40px)); max-height: none; padding: 0; overflow: hidden; }
#modal-root .items-editor-modal > h2 { flex: 0 0 auto; margin: 0; padding: 20px 70px 18px 28px; border-bottom: 1px solid var(--line); font-size: 21px; }
#modal-root .items-editor-modal .mbody { flex: 1 1 auto; min-height: 0; padding: 22px 28px 24px; overflow-y: auto; }
#modal-root .items-editor-modal .actions { flex: 0 0 auto; margin: 0; padding: 14px 28px; border-top: 1px solid var(--line); background: var(--card); }
#modal-root .items-editor-modal .field { margin-top: 0 !important; margin-bottom: 14px !important; }
#modal-root .items-editor-modal .field > input, #modal-root .items-editor-modal .field > select, #modal-root .items-editor-modal .field > textarea { padding-top: 10px; padding-bottom: 10px; font-size: 14px; }
#modal-root .items-editor-top { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
#modal-root .items-editor-top-row { display: grid; grid-template-columns: 145px minmax(0, 1fr); gap: 14px; align-items: center; }
#modal-root .items-editor-top-row > label { color: var(--text); font-size: 13px; }
#modal-root .items-editor-top-row.items-editor-instruction-row { align-items: start; }
#modal-root .items-editor-top-control { min-width: 0; }
#modal-root .items-editor-top-control > input, #modal-root .items-editor-top-control > select, #modal-root .items-editor-top-control > textarea { width: 100%; min-height: 40px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--card); color: var(--text); font: inherit; font-size: 14px; }
#modal-root .items-editor-top-control > textarea { min-height: 82px; resize: vertical; }
#modal-root .items-editor-top-control > input:focus, #modal-root .items-editor-top-control > select:focus, #modal-root .items-editor-top-control > textarea:focus { border-color: var(--brand); outline: 2px solid color-mix(in srgb, var(--brand) 17%, transparent); }
.items-editor-readonly { display: flex; align-items: center; justify-content: space-between; min-height: 40px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--info-bg); color: var(--muted); }
.items-editor-readonly .ic { width: 16px; height: 16px; }
.items-editor-close { position: absolute; top: 14px; right: 20px; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.items-editor-close:hover { background: var(--info-bg); color: var(--brand); }
.items-editor-close .ic { width: 21px; height: 21px; }

@media (max-width: 1100px) {
  .items-toolbar-actions { flex-basis: 100%; justify-content: flex-start; }
}
@media (max-width: 800px) {
  .items-content-head { gap: 12px; }
  .items-content-head > .tk-hicon { width: 56px; height: 56px; border-radius: 13px; }
  .items-content-head > .tk-hicon .ic { width: 28px; height: 28px; }
  .items-toolbar { align-items: stretch; }
  .items-view-tabs { width: 100%; }
  .items-view-tabs a { flex: 1 1 0; justify-content: center; }
  .items-toolbar-actions { justify-content: flex-start; }
  .items-toolbar-actions .btn { flex: 1 1 auto; justify-content: center; }
  .items-table-shell { border-radius: 8px; }
  .items-list-table, .items-list-table .ftable-row { min-width: 1080px; }
  .items-list-table .ftable-cell { padding: 10px 11px; }
}
@media (max-width: 560px) {
  .items-content-head { flex-direction: column; }
  .items-content-head h1 { font-size: 28px; }
  .items-description { font-size: 12.5px; }
  .items-toolbar-actions .btn { width: 100%; }
  .items-list-table, .items-list-table .ftable-row { min-width: 1040px; }
}
@media (max-width: 800px) {
  #modal-root .items-editor-modal { max-width: calc(100vw - 20px); height: calc(100vh - 24px); }
  #modal-root .items-editor-modal > h2 { padding-left: 18px; }
  #modal-root .items-editor-modal .mbody { padding: 18px; }
  #modal-root .items-editor-modal .actions { padding: 12px 18px; }
}

/* ---------- Biblioteca de Cartas ---------- */
.lb-page { width: 100%; min-width: 0; }
.lb-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; margin-bottom: 18px; }
.lb-heading { display: flex; align-items: center; gap: 16px; min-width: 0; }
.lb-heading h1 { margin: 0 0 4px; font-size: clamp(28px, 2.5vw, 36px); line-height: 1.1; }
.lb-heading p { margin: 0; color: var(--muted); font-size: 15px; }
.lb-header-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.lb-header-actions .btn { min-height: 46px; gap: 8px; padding: 0 16px; border-radius: 9px; font-weight: 700; }
.lb-header-actions .btn .ic { width: 19px; height: 19px; }
.lb-list-surface { overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(44, 92, 150, .05); }
.lb-tabs { margin: 0; padding: 0 18px; border-bottom: 1px solid var(--line); }
.lb-tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 15px 16px 13px; }
.lb-tabs a .ic { width: 17px; height: 17px; }
.lb-filters { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 18px; margin: 0; border-bottom: 1px solid var(--line); }
.lb-filters .sbox { flex: 1 1 300px; max-width: none; }
.lb-filters .sbox input { min-height: 46px; border-radius: 9px; }
.lb-filter-select { position: relative; flex: 0 1 235px; min-width: 190px; }
.lb-filter-select .select-like { min-height: 46px; padding-left: 42px; border-radius: 9px; }
.lb-filter-icon { position: absolute; z-index: 1; left: 13px; top: 50%; display: inline-flex; transform: translateY(-50%); color: var(--brand); pointer-events: none; }
.lb-filter-icon .ic { width: 18px; height: 18px; }
.lb-table-wrap, #lb-table { min-width: 0; overflow-x: auto; }
.lbt { width: 100%; min-width: 900px; }
.lbt .ftable-row { width: 100%; min-width: 900px; }
.lbt .ftable-cell { display: flex; align-items: center; min-height: 68px; padding: 12px 16px; font-size: 14px; line-height: 1.35; overflow-wrap: normal; }
.lbt .ftable-row.head { min-height: 48px; background: color-mix(in srgb, var(--brand) 4%, var(--card)); }
.lbt .ftable-row.head .ftable-cell { min-height: 48px; color: color-mix(in srgb, var(--text) 68%, var(--muted)); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .035em; }
.lbt .lb-title-col { flex: 2.45 1 340px; min-width: 300px; gap: 12px; }
.lbt .lb-category-col { flex: 1.4 1 205px; min-width: 175px; }
.lbt .lb-status-col { flex: 1 1 135px; min-width: 125px; }
.lbt .lb-ai-col { flex: 0 1 145px; min-width: 125px; }
.lbt .lb-fav-col { flex: 0 0 90px; justify-content: center; }
.lbt .lb-actions-col { flex: 0 0 88px; justify-content: center; }
.lb-doc-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 42px; width: 42px; height: 42px; border-radius: 10px; background: color-mix(in srgb, var(--brand) 11%, var(--card)); color: var(--brand); }
.lb-doc-icon .ic { width: 22px; height: 22px; }
.lb-title-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.lbt .tlink { display: block; max-width: none; color: var(--brand); font-size: 14px; line-height: 1.3; text-decoration: none; white-space: normal; }
.lbt .tlink:hover { text-decoration: underline; }
.lb-template-desc { color: var(--muted); font-size: 12px; line-height: 1.3; }
.lb-category { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; font-weight: 600; }
.lb-category .ic { width: 18px; height: 18px; flex: 0 0 auto; }
.lb-category > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-cat-blue { color: var(--brand); }
.lb-cat-purple { color: var(--purple, #7c3aed); }
.lb-cat-orange { color: var(--warn, #d97706); }
.lb-cat-gray { color: var(--muted); }
.lb-status, .lb-ai { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 13px; font-weight: 600; }
.lb-status { padding: 6px 10px; border-radius: 999px; }
.lb-status.active { color: #087f43; background: color-mix(in srgb, #16a05d 12%, var(--card)); }
.lb-status.inactive { color: #a55e00; background: color-mix(in srgb, var(--warn) 14%, var(--card)); }
.lb-status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.lb-ai.yes { color: #087f43; }
.lb-ai.no { color: var(--bad); }
.lb-ai .ic { width: 18px; height: 18px; padding: 3px; border-radius: 5px; color: #fff; }
.lb-ai.yes .ic { background: #12a15a; }
.lb-ai.no .ic { background: var(--bad); }
.lbt .heart { width: 34px; height: 34px; color: var(--muted); }
.lbt .heart .ic { width: 20px; height: 20px; }
.lbt .heart.on { color: var(--brand); }
.lbt .heart.on .ic { fill: color-mix(in srgb, var(--brand) 18%, transparent); }
.lb-menu { min-width: 142px; }
.lb-menu a { display: flex; align-items: center; gap: 8px; }
.lb-menu a .ic { width: 16px; height: 16px; flex: 0 0 auto; }
.lb-menu a.bad { color: var(--bad); }
.lb-empty { min-height: 120px; justify-content: center; }
.lb-empty .ftable-cell { flex: 1 1 auto; justify-content: center; }
.lb-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; min-height: 62px; border-top: 1px solid var(--line); }
.lb-pagination { display: inline-flex; align-items: center; gap: 5px; }
.lb-page-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--card); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.lb-page-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.lb-page-btn.active { border-color: var(--brand); background: var(--brand); color: #fff; }
.lb-page-btn:disabled { opacity: .45; cursor: not-allowed; }
.lb-letter-editor .rte-area, .rte-area.letter-document { font-family: var(--letter-font, Latofont, Lato, Arial, Helvetica, sans-serif); font-size: var(--letter-fs, 14px); line-height: var(--letter-lh, 1.6); }
.lb-letter-editor .rte-bar { font-family: var(--font); font-size: var(--fs); }
#print-area.html.letter-document { font-family: var(--letter-font, Latofont, Lato, Arial, Helvetica, sans-serif); font-size: var(--letter-fs, 14px); line-height: var(--letter-lh, 1.6); }
#modal-root .modal.lb-preview-modal { position: relative; max-width: 920px; max-height: 90vh; padding: 0; overflow: hidden; }
#modal-root .lb-preview-modal h2 { margin: 0; padding: 24px 66px 0 28px; font-size: 24px; }
.lb-preview-modal .mbody { padding: 0 28px 24px; overflow: hidden; }
.lb-preview-name { padding: 5px 42px 18px 0; color: var(--muted); font-size: 16px; }
.lb-preview-close { position: absolute; top: 18px; right: 20px; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.lb-preview-close:hover { color: var(--text); }
.lb-preview-close .ic { width: 24px; height: 24px; }
.lb-preview { max-height: min(62vh, 620px); overflow: auto; padding: 20px; background: color-mix(in srgb, var(--brand) 4%, var(--bg)); border: 1px solid var(--line); border-radius: 8px; }
.lb-paper { min-height: 560px; max-width: 700px; margin: 0 auto; padding: 54px 60px; background: #fff; color: #1f2937; border: 1px solid #e4e7ec; border-radius: 2px; box-shadow: 0 3px 12px rgba(31, 41, 55, .12); font-family: var(--letter-font, Latofont, Lato, Arial, Helvetica, sans-serif); font-size: var(--letter-fs, 14px); line-height: var(--letter-lh, 1.6); font-weight: 400; }
.lb-paper p { margin: 0 0 .9em; }
.lb-paper h1 { font-size: 1.5em; margin: .3em 0 .5em; }
.lb-paper h2 { font-size: 1.3em; margin: .3em 0 .5em; }
.lb-paper h3 { font-size: 1.1em; margin: .3em 0 .5em; }
.lb-paper img { max-width: 100%; height: auto; }
.lb-preview-plain { margin: 0; color: inherit; font: inherit; line-height: inherit; white-space: pre-wrap; overflow-wrap: anywhere; }
.lb-preview-actions { display: flex; justify-content: flex-end; padding-top: 16px; }
.ap-letter-card { margin-top: 16px; }
.ap-letter-card .ap-card-head { margin-bottom: 16px; }
.ap-letter-card .ap-card-head .ic { width: 22px; height: 22px; }
.ap-letter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ap-letter-grid .field { margin: 0; }

/* ---------- Configuración → Apariencia → Tipografía de cartas ---------- */
.letter-typography-page { margin: 0 0 26px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.letter-typography-head { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.letter-typography-head .tk-hicon { width: 60px; height: 60px; border-radius: 13px; }
.letter-typography-head .tk-hicon .ic { width: 30px; height: 30px; }
.letter-typography-head h2 { margin: 0; color: var(--text); font-size: 22px; }
.letter-typography-head p { margin: 3px 0 0; color: var(--muted); font-size: 14px; }
.letter-typography-grid { display: grid; grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); gap: 30px; padding: 18px 26px 26px; align-items: start; }
.letter-typography-controls { min-width: 0; padding-top: 3px; }
.letter-typography-controls .field { margin-bottom: 26px; }
.letter-typography-controls .field label { font-size: 15px; font-weight: 700; color: var(--text); }
.letter-typography-controls .field select { min-height: 48px; font-size: 15px; }
.letter-typography-controls .tip { display: inline-flex; margin-left: 4px; vertical-align: middle; }
.letter-typography-info { margin: 34px 0 0; padding: 13px 14px; line-height: 1.45; }
.letter-preview-panel { min-width: 0; padding: 16px; background: color-mix(in srgb, var(--brand) 5%, var(--card)); border-radius: 10px; }
.letter-preview-title h3 { margin: 0; font-size: 19px; color: var(--text); }
.letter-preview-title p { margin: 3px 0 12px; color: var(--muted); font-size: 14px; }
.letter-preview-stage { padding: 16px; background: color-mix(in srgb, var(--brand) 3%, var(--bg)); border-radius: 8px; overflow: auto; }
.letter-preview-paper { min-height: 560px; max-width: 610px; margin: 0 auto; padding: 46px 42px; background: #fff; color: #111; box-shadow: 0 3px 16px rgba(31, 41, 55, .16); }
.letter-preview-paper p { margin: 0 0 1.15em; }
.letter-preview-paper p:last-child { margin-bottom: 0; }
.letter-document { font-family: var(--letter-font, Latofont, Lato, Arial, Helvetica, sans-serif); font-size: var(--letter-fs, 14px); line-height: var(--letter-lh, 1.6); }
@media (max-width: 900px) { .letter-typography-grid { grid-template-columns: 1fr; } .letter-preview-panel { order: -1; } }
@media (max-width: 560px) {
  .letter-typography-head { align-items: flex-start; padding: 16px; }
  .letter-typography-head .tk-hicon { width: 54px; height: 54px; }
  .letter-typography-head .tk-hicon .ic { width: 27px; height: 27px; }
  .letter-typography-head h2 { font-size: 19px; }
  .letter-typography-head p { font-size: 13px; }
  .letter-typography-grid { padding: 16px; gap: 18px; }
  .letter-preview-paper { min-height: 420px; padding: 34px 24px; }
}
@media (max-width: 800px) {
  .lb-header { flex-direction: column; }
  .lb-header-actions { width: 100%; }
  .lb-header-actions .btn { flex: 1 1 0; justify-content: center; }
  .lb-heading { align-items: flex-start; }
  .lb-heading .tk-hicon { width: 56px; height: 56px; border-radius: 13px; }
  .lb-heading .tk-hicon .ic { width: 28px; height: 28px; }
  .lb-filters .sbox, .lb-filter-select { flex: 1 1 100%; max-width: none; }
  .lb-footer { align-items: flex-start; flex-direction: column; }
  .lb-pagination { align-self: flex-end; }
  .lb-paper { min-height: 420px; padding: 34px 28px; }
  #modal-root .modal.lb-preview-modal { max-width: calc(100vw - 24px); }
  .lb-preview-modal .mbody { padding-left: 16px; padding-right: 16px; }
  .lb-preview { padding: 10px; }
  .ap-letter-grid { grid-template-columns: 1fr; }
}

/* ---------- Editor completo de cartas ---------- */
.letter-editor-page { padding: 0; overflow: hidden; animation: letter-editor-reveal .82s cubic-bezier(.16, 1, .3, 1) both; transform-origin: top center; }
@keyframes letter-editor-reveal {
  0% { opacity: 0; transform: translate3d(0, 24px, 0) scale(.985); filter: blur(2px); }
  70% { opacity: 1; transform: translate3d(0, -1px, 0) scale(1.001); filter: blur(0); }
  to { opacity: 1; transform: translateY(0); }
}
.le-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 22px 24px 16px; border-bottom: 1px solid var(--line); }
.le-head h1 { margin: 0 0 4px; font-size: 23px; }
.le-head p { margin: 0; }
.le-progress { display: grid; grid-template-columns: auto 54px auto 54px auto 54px auto; align-items: start; gap: 8px; min-width: 405px; padding-top: 2px; }
.le-progress > i { height: 1px; margin-top: 14px; background: var(--line); }
.le-progress-step { display: grid; justify-items: center; gap: 5px; color: var(--muted); text-align: center; white-space: nowrap; }
.le-progress-step > span { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: color-mix(in srgb, var(--muted) 18%, var(--card)); color: var(--muted); font-size: 13px; font-weight: 700; }
.le-progress-step > span .ic { width: 16px; height: 16px; }
.le-progress-step.done, .le-progress-step.active { color: var(--brand); }
.le-progress-step.done > span, .le-progress-step.active > span { background: var(--brand); color: #fff; }
.le-progress-step small { font-size: 11px; }
.le-tabs { display: flex; align-items: stretch; gap: 4px; overflow-x: auto; padding: 0 20px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--brand) 2%, var(--card)); }
.le-tab { display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 15px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.le-tab:hover, .le-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.le-tab .bureau-logo { display: inline-flex; min-width: 78px; justify-content: center; }
.le-tab .bureau-logo img { max-width: 86px; max-height: 25px; }
.le-tab:not(.le-docs-tab) { min-width: 112px; justify-content: center; }
.le-tab:not(.le-docs-tab) > .bureau-logo { min-width: 0; }
.le-tab > .ic { width: 19px; height: 19px; }
.le-docs-tab { margin-left: auto; }
.le-address { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; margin: 20px 24px 16px; padding: 17px 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); }
.le-address b { margin-bottom: 2px; }
.le-editor-wrap { margin: 0 24px 18px; border: 1px solid var(--line); background: var(--card); }
.le-editor-wrap .rte { border: 0; }
.le-editor-wrap .rte-area { min-height: 480px !important; max-height: 65vh; }
.le-editor-meta { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 10px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.le-editor-meta label { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.le-editor-meta input { width: 180px; min-height: 31px; }
.le-response-note { margin: 0; border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0; }
.le-export { display: flex; align-items: center; gap: 9px; padding: 0 24px 14px; color: var(--muted); font-size: 12px; }
.le-export .link-btn { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: transparent; color: var(--brand); font: inherit; cursor: pointer; }
.le-export .link-btn:hover { text-decoration: underline; }
.le-export .ic { width: 14px; height: 14px; }
.le-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 24px; border-top: 1px solid var(--line); }
.le-footer > div { display: flex; align-items: center; gap: 10px; }
.le-footer .ic { width: 15px; height: 15px; }
.le-documents { padding: 24px; }
.le-documents > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.le-documents h2 { margin: 0 0 4px; font-size: 20px; }
.le-documents header p { margin: 0; color: var(--muted); font-size: 13px; }
.le-doc-table { overflow-x: auto; border: 1px solid var(--line); border-radius: 7px; }
.le-doc-row { display: grid; grid-template-columns: minmax(230px, 2fr) minmax(120px, 1fr) minmax(150px, 1fr) minmax(180px, 1.1fr); align-items: center; min-height: 54px; border-top: 1px solid var(--line); }
.le-doc-row:first-child { border-top: 0; }
.le-doc-row > div { min-width: 0; padding: 11px 14px; font-size: 13px; }
.le-doc-row.head { min-height: 43px; background: color-mix(in srgb, var(--brand) 5%, var(--bg)); color: var(--muted); font-size: 12px; }
.le-doc-row.head > div { font-size: 12px; font-weight: 700; }
.le-doc-row b { display: block; font-weight: 600; }
.le-doc-row small { display: block; margin-top: 3px; color: var(--muted); }
.le-doc-actions { display: inline-flex; align-items: center; gap: 4px; }
.le-doc-actions .icon-btn { width: 30px; height: 30px; }
.le-doc-menu { position: relative; display: inline-block; }
.le-doc-menu > .icon-btn { color: var(--muted); }
.le-doc-menu > .icon-btn:hover { color: var(--text); }
.le-doc-menu .kmenu { min-width: 150px; }
.le-doc-menu .kmenu a, .le-doc-menu-upload { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 7px; color: var(--text); cursor: pointer; font-size: 14px; white-space: nowrap; }
.le-doc-menu .kmenu a:hover, .le-doc-menu-upload:hover { background: color-mix(in srgb, var(--brand) 9%, transparent); text-decoration: none; }
.le-doc-menu .kmenu a.bad { color: var(--bad); }
.le-doc-menu-upload .ic, .le-doc-menu .kmenu a .ic { width: 15px; height: 15px; flex: 0 0 15px; }
.le-documents h3 { margin: 22px 0 10px; font-size: 16px; }
.le-documents > .small { margin: 14px 0 0; }
@media (max-width: 900px) {
  .le-head { flex-direction: column; }
  .le-progress { width: 100%; min-width: 0; grid-template-columns: auto 1fr auto 1fr auto 1fr auto; }
  .le-editor-meta label { margin-left: 0; }
}
@media (max-width: 620px) {
  .le-head, .le-documents { padding: 16px; }
  .le-tabs { padding: 0 10px; }
  .le-tab { padding: 0 10px; }
  .le-docs-tab { margin-left: 0; }
  .le-address, .le-editor-wrap { margin-left: 16px; margin-right: 16px; }
  .le-footer { align-items: stretch; flex-direction: column; padding: 14px 16px; }
  .le-footer > div { justify-content: flex-end; flex-wrap: wrap; }
  .le-footer > .btn { align-self: flex-start; }
  .le-progress-step small { font-size: 10px; white-space: normal; }
}

/* ---------- Guardado final de cartas y tarea de seguimiento ---------- */
#modal-root .modal.letter-save-modal,
#modal-root .modal.letter-abbr-modal,
#modal-root .modal.letter-settings-modal { position: relative; max-width: 610px; padding: 28px 26px 22px; }
#modal-root .modal.letter-save-modal h2,
#modal-root .modal.letter-abbr-modal h2,
#modal-root .modal.letter-settings-modal h2 { margin: 0 34px 18px 0; color: var(--text); font-size: 21px; }
.letter-save-close { position: absolute; top: 20px; right: 18px; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.letter-save-close:hover { color: var(--text); }
.letter-save-close .ic { width: 20px; height: 20px; }
.letter-save-copy { margin: 0 0 18px; line-height: 1.5; }
.letter-save-fields { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 14px; }
.letter-save-fields .field, .letter-save-modal .field { margin: 0 0 14px !important; }
.letter-save-modal .field label { display: block; margin-bottom: 6px; color: var(--text); font-size: 12px; font-weight: 700; }
.letter-save-modal .field input, .letter-save-modal .field select, .letter-settings-modal .field input { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--card); color: var(--text); font: inherit; }
.letter-save-modal .field input:focus, .letter-save-modal .field select:focus, .letter-settings-modal .field input:focus { border-color: var(--brand); outline: 2px solid color-mix(in srgb, var(--brand) 18%, transparent); }
.letter-save-hint { margin: -4px 0 16px; color: var(--muted); font-size: 12px; }
.letter-save-links { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -2px 0 19px; flex-wrap: wrap; }
.letter-save-links .btn { border-color: var(--ok); color: var(--ok); background: transparent; }
.letter-save-links .btn:hover { background: color-mix(in srgb, var(--ok) 8%, var(--card)); }
.letter-save-links .ic { width: 15px; height: 15px; }
.letter-save-links .link-btn { padding: 0; border: 0; background: transparent; color: var(--brand); font: inherit; cursor: pointer; }
.letter-save-links .link-btn:hover { text-decoration: underline; }
.letter-reminder-check { display: flex; align-items: flex-start; gap: 9px; margin: 4px 0 8px; color: var(--text); line-height: 1.4; }
.letter-reminder-check input { flex: 0 0 auto; width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--brand); }
.letter-followup-days { display: flex; align-items: center; gap: 9px; margin: 0 0 16px 26px; color: var(--muted); }
.letter-followup-days input { width: 88px; min-height: 39px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--card); color: var(--text); font: inherit; }
.letter-followup-days input:focus { border-color: var(--brand); outline: 2px solid color-mix(in srgb, var(--brand) 18%, transparent); }
.letter-save-note { margin: 0; line-height: 1.4; }
.letter-save-footer, .letter-abbr-footer { display: flex; align-items: center; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.letter-abbr-add { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; margin-bottom: 14px; }
.letter-abbr-add input { min-height: 42px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--card); color: var(--text); font: inherit; }
.letter-abbr-add input:focus { border-color: var(--brand); outline: 2px solid color-mix(in srgb, var(--brand) 18%, transparent); }
.letter-abbr-heading { padding: 11px 12px; background: color-mix(in srgb, var(--brand) 6%, var(--bg)); color: var(--text); font-weight: 700; }
.letter-abbr-list { max-height: 310px; overflow-y: auto; border: 1px solid var(--line); border-top: 0; }
.letter-abbr-row { display: flex; align-items: center; justify-content: space-between; min-height: 42px; padding: 6px 10px 6px 12px; border-top: 1px solid var(--line); }
.letter-abbr-row:first-child { border-top: 0; }
.letter-abbr-row .icon-btn { width: 30px; height: 30px; }
.letter-settings-modal > .mbody > p { margin: 0 0 14px; line-height: 1.5; }
.letter-settings-radios { display: flex; gap: 22px; margin: 0 0 18px; }
.letter-settings-radios label { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.letter-settings-radios input { width: 17px; height: 17px; accent-color: var(--brand); }
.letter-leave-modal { position: relative; }
#modal-root .modal.letter-leave-modal { max-width: 560px; padding: 28px 26px 22px; }
#modal-root .modal.letter-leave-modal h2 { margin: 0 34px 18px 0; color: var(--text); font-size: 20px; }
.letter-leave-close { position: absolute; top: 18px; right: 17px; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.letter-leave-close:hover { color: var(--text); }
.letter-leave-close .ic { width: 20px; height: 20px; }
.letter-leave-content { display: flex; align-items: flex-start; gap: 13px; color: var(--muted); line-height: 1.5; }
.letter-leave-content p { margin: 0; }
.letter-leave-icon { display: inline-flex; flex: 0 0 22px; align-items: center; justify-content: center; color: var(--bad); }
.letter-leave-icon .ic { width: 22px; height: 22px; fill: color-mix(in srgb, var(--bad) 12%, transparent); }
.letter-leave-footer { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 24px; }
.letter-leave-footer .link-btn { padding: 8px 0; border: 0; background: transparent; color: var(--brand); font: inherit; cursor: pointer; }
.letter-leave-footer .link-btn:hover { text-decoration: underline; }
@media (max-width: 560px) {
  #modal-root .modal.letter-save-modal, #modal-root .modal.letter-abbr-modal, #modal-root .modal.letter-settings-modal { max-width: calc(100vw - 24px); padding: 22px 17px 18px; }
  #modal-root .modal.letter-leave-modal { max-width: calc(100vw - 24px); padding: 22px 17px 18px; }
  .letter-save-fields { grid-template-columns: 1fr; gap: 0; }
  .letter-save-links { align-items: flex-start; flex-direction: column; }
  .letter-save-footer { flex-wrap: wrap; }
}

/* ---------- Generar Cartas: flujo visual con línea de pasos ---------- */
.gen-wizard { position: relative; overflow: visible; padding: 0 0 2px; background: transparent; border: 0; box-shadow: none; }
.gen-wizard::before { content: ''; position: absolute; z-index: 0; top: 28px; bottom: 42px; left: 27px; width: 2px; background: color-mix(in srgb, var(--brand) 25%, var(--line)); }
.gen-step { position: relative; z-index: 1; margin: 0 0 18px 64px; padding: 20px 18px 18px; border: 1px solid color-mix(in srgb, var(--brand) 11%, var(--line)); border-radius: 10px; background: var(--card); box-shadow: 0 5px 16px rgba(34, 77, 130, .045); }
.gen-step:last-child { margin-bottom: 0; }
.gen-step-entering { animation: gen-step-reveal .82s cubic-bezier(.16, 1, .3, 1) both; transform-origin: top center; }
@keyframes gen-step-reveal {
  0% { opacity: 0; transform: translate3d(0, 30px, 0) scale(.975); filter: blur(3px); }
  70% { opacity: 1; transform: translate3d(0, -2px, 0) scale(1.002); filter: blur(0); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.gen-step-entering .gen-step-head,
.gen-step-entering .gen-advice,
.gen-step-entering .gen-step-toolbar,
.gen-step-entering .gen-items-shell,
.gen-step-entering .gen-step-footer,
.gen-step-entering .gen-letter-helper,
.gen-step-entering .gen-letter-fields,
.gen-step-entering .gen-ai-only,
.gen-step-entering .gen-recipient-note { animation: gen-step-content-reveal .58s .12s ease-out both; }
@keyframes gen-step-content-reveal {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: translateY(0); }
}
.gen-step-number { position: absolute; top: 16px; left: -52px; z-index: 2; width: 34px; height: 34px; border: 4px solid var(--bg); border-radius: 50%; background: var(--brand); color: #fff; font-size: 15px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand) 12%, var(--line)); }
.gen-step-head { align-items: center; gap: 13px; min-height: 42px; margin-bottom: 18px; }
.gen-step-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 42px; width: 42px; height: 42px; border-radius: 10px; background: color-mix(in srgb, var(--brand) 10%, var(--card)); color: var(--brand); }
.gen-step-icon .ic { width: 23px; height: 23px; }
.gen-step-head h3 { margin: 0 0 3px; color: var(--text); font-size: 20px; }
.gen-step-head p { margin: 0; color: var(--muted); font-size: 13px; }
.gen-step-head > div { min-width: 0; flex: 1; }
.gen-step1-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr); gap: 20px; align-items: stretch; }
.gen-step1-layout:not(.has-recipient) { grid-template-columns: 1fr; }
.gen-step1-layout > div:first-child { min-width: 0; }
.gen-subheading { margin: 0 0 10px; color: var(--text); font-size: 15px; }
.gen-round-choice-grid { grid-template-columns: 1fr; gap: 8px; }
.gen-round-choice { align-items: center; min-height: 60px; padding: 12px 13px; border-radius: 8px; }
.gen-round-choice b { color: var(--text); font-size: 14px; }
.gen-round-choice small { color: var(--muted); font-size: 12px; }
.gen-round-choice input { margin-left: 1px; }
.gen-no-dispute-trigger { display: flex; justify-content: flex-end; margin-top: 12px; }
.gen-no-dispute-trigger .link-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--brand); }
.gen-no-dispute-trigger .ic { width: 16px; height: 16px; }
.gen-no-dispute-option { margin-top: 14px; }
.gen-no-dispute-divider { margin: 0 0 14px; border-top: 1px dashed color-mix(in srgb, var(--brand) 25%, var(--line)); opacity: 0.45; }
.gen-no-dispute-card { display: flex; align-items: center; width: 100%; min-height: 84px; gap: 14px; padding: 14px 16px 14px 18px; border: 1px solid color-mix(in srgb, var(--brand) 45%, var(--line)); border-radius: 10px; background: color-mix(in srgb, var(--info-bg) 72%, var(--card)); color: var(--text); cursor: pointer; text-align: left; transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease, transform .18s ease; }
.gen-no-dispute-card:hover { border-color: var(--brand); background: color-mix(in srgb, var(--info-bg) 84%, var(--card)); box-shadow: 0 4px 14px rgba(24, 91, 180, .12); transform: translateY(-1px); }
.gen-no-dispute-card:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 32%, transparent); outline-offset: 2px; }
.gen-no-dispute-icon { display: inline-flex; flex: 0 0 48px; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 12px; background: var(--ok-bg); color: var(--ok); }
.gen-no-dispute-icon .ic { width: 26px; height: 26px; }
.gen-no-dispute-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 4px; }
.gen-no-dispute-copy b { color: var(--text); font-size: 16px; line-height: 1.25; }
.gen-no-dispute-copy small { color: var(--muted); font-size: 13px; line-height: 1.35; }
.gen-no-dispute-arrow { flex: 0 0 auto; color: var(--muted); font-size: 36px; font-weight: 300; line-height: 1; }
.gen-step1-recipient { min-width: 0; }
.gen-recipient { height: 100%; min-height: 165px; margin: 0; padding: 13px 15px 14px; border: 0; border-radius: 9px; background: color-mix(in srgb, var(--info-bg) 58%, var(--card)); }
.gen-recipient-note { display: flex; align-items: center; gap: 8px; margin: 0 0 15px; padding: 8px 10px; border-radius: 6px; background: color-mix(in srgb, var(--brand) 7%, var(--card)); color: var(--brand); font-size: 12px; }
.gen-recipient-note .ic { flex: 0 0 16px; width: 16px; height: 16px; }
.gen-recipient h4 { margin: 0 0 12px; font-size: 15px; }
.gen-recipient-options { flex-direction: column; gap: 11px; }
.gen-radio-option { align-items: flex-start; gap: 9px; }
.gen-radio-option input { margin-top: 2px; }
.gen-radio-option span { display: flex; flex-direction: column; gap: 2px; }
.gen-radio-option b { color: var(--text); font-size: 13px; }
.gen-radio-option small { color: var(--muted); font-size: 12px; }
.gen-step-2 .gen-step-head, .gen-step-3 .gen-step-head { margin-bottom: 14px; }
.gen-step-2 .gen-count { flex: 0 0 auto; margin-left: auto; padding: 9px 13px; border: 1px solid color-mix(in srgb, var(--ok) 17%, var(--line)); border-radius: 8px; background: var(--ok-bg); color: var(--ok); font-size: 12px; font-weight: 700; white-space: nowrap; }
.gen-step-2 .gen-advice { margin: 0 0 14px; padding: 9px 12px; border-radius: 7px; background: color-mix(in srgb, var(--info-bg) 70%, var(--card)); color: var(--muted); font-size: 12px; }
.gen-step-toolbar { margin-bottom: 12px; }
.gen-step-buttons .btn { min-height: 40px; }
.gen-items-shell { margin-top: 2px; border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; }
.gen-items-table { border: 0; }
.gen-modal-table { max-height: none; overflow: visible; }
.gen-modal-table .gen-items-table { min-width: 0; }
.gen-modal-choice { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 68px; cursor: pointer; }
.gen-modal-item-checkbox { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); cursor: pointer; }
.gen-modal-select-all { margin: 0; }
.gen-items-table .ftable-row.head { background: color-mix(in srgb, var(--brand) 5%, var(--bg)); }
.gen-items-table .ftable-row:not(.head):nth-child(even) { background: color-mix(in srgb, var(--brand) 1.5%, var(--card)); }
.gen-items-table .ftable-row,
.gen-items-table { min-width: 0; }
.gen-items-table .items-creditor-col { flex: 1.1 1 0; min-width: 0; overflow-wrap: anywhere; }
.gen-items-table .items-account-col { flex: 1.15 1 0; min-width: 0; }
.gen-items-table .items-issue-col { flex: 1.1 1 0; min-width: 0; overflow-wrap: anywhere; }
.gen-items-table .items-bureau-col { flex: 1 1 0; min-width: 0; }
.gen-items-table .items-account-lines span { white-space: normal; overflow-wrap: anywhere; }
.gen-items-table .bureau-logo { min-width: 0; padding: 2px; }
.gen-items-table .bureau-logo.lg img { width: 100%; max-width: 110px; height: auto; max-height: 30px; }
.gen-items-table .badge { max-width: 100%; white-space: nowrap; }
.gen-step-footer { margin-top: 14px; }
.gen-step2-footer { border-top: 0; }
.gen-step-3 .gen-finder-btn { flex: 0 0 auto; margin-left: auto; }
.gen-step-3 .gen-letter-helper { margin-bottom: 14px; border: 0; background: color-mix(in srgb, var(--info-bg) 60%, var(--card)); }
.gen-step-3 .gen-letter-fields label > span { color: var(--muted); font-size: 12px; font-weight: 600; }
.gen-step-3 .gen-step-footer { padding-top: 2px; }
.gen-no-dispute-panel { overflow: hidden; }
.gen-no-dispute-panel .gen-letter-fields { margin-bottom: 14px; }
.gen-no-dispute-address { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.gen-no-dispute-address h4 { margin: 0 0 13px; color: var(--text); font-size: 15px; }
.gen-address-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.gen-address-grid label > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
.gen-address-grid label b { color: var(--bad); }
.gen-address-grid input, .gen-address-grid select { width: 100%; min-height: 42px; }
.gen-no-dispute-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 20px; }
.gen-no-dispute-footer .gen-step-footer { margin-top: 0; }
@media (max-width: 900px) {
  .gen-step1-layout { grid-template-columns: 1fr; }
  .gen-recipient { min-height: 0; }
}
@media (max-width: 780px) {
  .gen-wizard::before { left: 19px; }
  .gen-step { margin-left: 48px; padding: 16px 14px; }
  .gen-step-number { left: -45px; }
  .gen-step-head { align-items: flex-start; }
  .gen-step-2 .gen-count { margin-left: 0; }
  .gen-step-2 .gen-step-head { flex-wrap: wrap; }
  .gen-step-2 .gen-count { flex-basis: auto; }
  .gen-step-3 .gen-finder-btn { margin-left: 0; }
  .gen-no-dispute-footer { align-items: stretch; flex-direction: column; }
  .gen-no-dispute-footer .gen-step-footer { justify-content: flex-end; }
}
@media (max-width: 560px) {
  .gen-wizard::before { left: 15px; }
  .gen-step { margin-left: 38px; }
  .gen-step-number { left: -35px; width: 30px; height: 30px; font-size: 13px; }
  .gen-step-icon { flex-basis: 36px; width: 36px; height: 36px; }
  .gen-step-icon .ic { width: 20px; height: 20px; }
  .gen-step-head h3 { font-size: 17px; }
  .gen-step-buttons { width: 100%; }
  .gen-step-buttons .btn { flex: 1 1 100%; justify-content: center; }
  .gen-step-2 .gen-count { width: 100%; text-align: center; }
  .gen-address-grid { grid-template-columns: 1fr; }
  .gen-no-dispute-trigger { justify-content: flex-start; }
  .gen-no-dispute-card { align-items: flex-start; min-height: 72px; padding: 12px 13px; }
  .gen-no-dispute-icon { flex-basis: 42px; width: 42px; height: 42px; }
  .gen-no-dispute-icon .ic { width: 23px; height: 23px; }
  .gen-no-dispute-copy b { font-size: 14px; }
  .gen-no-dispute-copy small { font-size: 12px; }
  .gen-no-dispute-arrow { margin-left: auto; font-size: 30px; }
  .gen-no-dispute-footer .gen-step-footer { flex-direction: column-reverse; }
  .gen-no-dispute-footer .gen-step-footer .btn { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .gen-step-entering, .gen-step-entering > *, .letter-editor-page { animation: none; filter: none; }
}
@media (max-width: 900px) {
  .gen-items-shell { overflow-x: auto; }
  .gen-items-table, .gen-items-table .ftable-row { min-width: 860px; }
}

/* Tipografía del contenido del editor: coincide con la carta predeterminada de Credit Repair Cloud. */
.letter-editor-page .le-editor-wrap .rte-area.letter-document {
  font-family: var(--letter-font, Latofont, Lato, sans-serif);
  font-size: var(--letter-fs, 14px);
  line-height: var(--letter-lh, 1.6);
  color: #414141;
  font-weight: 400;
  letter-spacing: 0;
}
.letter-editor-page .le-editor-wrap .rte-area.letter-document p,
.letter-editor-page .le-editor-wrap .rte-area.letter-document li {
  line-height: inherit;
  letter-spacing: inherit;
}
