@font-face { font-family: Outfit; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/static/outfit.woff2) format("woff2"); }

:root {
  --bg: #f1eee8;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #dcd8d0;
  --card: #ffffff;
  --accent: #2563eb;
  --accent-ink: #1d4ed8;
  --accent-soft: #eff6ff;
  --ok: #15803d;
  --ok-soft: #f0fdf4;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --bad: #b91c1c;
  --bad-soft: #fef2f2;
  --side: #0f172a;
  --side-2: #1e293b;
  --side-ink: #cbd5e1;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .04);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* .field{display:grid} no debe anular hidden */
html, body { margin: 0; height: 100%; }
body { font-family: Outfit, system-ui, sans-serif; color: var(--ink); background: var(--bg); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }

/* ------------------------------------------------------------ wordmark */
.wordmark { font-weight: 800; letter-spacing: .06em; line-height: 1; }
.wordmark .x { color: var(--accent); }
.byline { color: var(--muted); font-size: 14px; letter-spacing: .02em; }

/* ---------------------------------------------------------------- login */
.login-wrap { min-height: 100%; display: grid; place-items: center; padding: 24px; background:
  radial-gradient(1200px 600px at 50% -10%, #eef2ff 0%, transparent 60%), var(--bg); }
.login-card { width: 100%; max-width: 400px; text-align: center; }
.login-card .wordmark { font-size: 76px; color: var(--ink); }
.login-card .byline { margin-top: 6px; }
.login-form { margin-top: 36px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); text-align: left; }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.input, select.input { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid #d6d3d1; border-radius: 10px; background: #fff; color: var(--ink); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
.btn { font: inherit; font-weight: 500; border: 0; border-radius: 10px; padding: 10px 16px; cursor: pointer; background: var(--accent); color: #fff; }
.btn:hover { background: var(--accent-ink); }
.btn.block { width: 100%; padding: 12px; }
.btn.ghost { background: transparent; color: var(--ink-2); border: 1px solid var(--line); }
.btn.ghost:hover { background: #f5f5f4; }
.btn.small { padding: 6px 10px; font-size: 14px; }
.alert { border-radius: 10px; padding: 10px 12px; font-size: 15px; margin-bottom: 16px; }
.alert.bad { background: var(--bad-soft); color: var(--bad); border: 1px solid #fecaca; }
.alert.ok { background: var(--ok-soft); color: var(--ok); border: 1px solid #bbf7d0; }

/* ---------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100%; background: linear-gradient(90deg, var(--side) 248px, transparent 248px); }
.side { background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side .brand { padding: 22px 22px 18px; }
.side .brand .wordmark { font-size: 30px; color: #fff; }
.side .brand .byline { color: #94a3b8; font-size: 12px; margin-top: 4px; }
.nav { padding: 8px 12px; display: grid; gap: 2px; }
.nav-label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: #64748b; padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; color: var(--side-ink); font-size: 15.5px; }
.nav a:hover { background: var(--side-2); color: #fff; }
.nav a.active { background: var(--accent); color: #fff; }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav a .soon { margin-left: auto; font-size: 11.5px; padding: 1px 6px; border-radius: 99px; background: rgba(148, 163, 184, .16); color: #94a3b8; }
.nav a.active .soon { background: rgba(255, 255, 255, .2); color: #fff; }
.side .me { margin-top: auto; padding: 16px 18px; border-top: 1px solid var(--side-2); display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 15px; flex: none; }
.me .who { min-width: 0; }
.me .who b { display: block; color: #fff; font-weight: 500; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .who span { font-size: 13px; color: #94a3b8; }
.me form { margin-left: auto; }
.icon-btn { background: transparent; border: 0; color: #94a3b8; cursor: pointer; padding: 6px; border-radius: 8px; display: grid; }
.icon-btn:hover { background: var(--side-2); color: #fff; }
.icon-btn svg { width: 18px; height: 18px; }

.main { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 22px 32px 0; }
.topbar h1 { font-size: 27px; }
.topbar .sub { color: var(--muted); font-size: 15px; margin-top: 2px; }
/* Enlaces «← volver» (Sergio 31/10: texto y flecha más grandes) */
a.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 17px; font-weight: 500; color: var(--accent); text-decoration: none; }
a.back-link:hover { color: var(--accent-ink, #1d4ed8); text-decoration: underline; }
a.back-link .back-arr { font-size: 22px; line-height: 1; transform: translateY(-1px); }
.btn .back-arr { font-size: 18px; line-height: 1; margin-right: 2px; }
.content { padding: 24px 32px 40px; }

/* ---------------------------------------------------------------- cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.card-h h2 { font-size: 17px; }
.card-b { padding: 18px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { padding: 18px; }
.kpi .k { font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.kpi .k svg { width: 16px; height: 16px; color: var(--accent); }
.kpi .v { font-size: 30px; font-weight: 600; margin-top: 8px; letter-spacing: -.02em; }
.kpi .v.empty { color: #cbd5e1; }
.kpi .n { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.empty-state { color: var(--muted); font-size: 15px; padding: 26px 18px; text-align: center; }
.tag { display: inline-block; font-size: 13px; padding: 2px 8px; border-radius: 99px; background: #f1f5f9; color: var(--ink-2); }
.tag.blue { background: var(--accent-soft); color: var(--accent-ink); }
.tag.green { background: var(--ok-soft); color: var(--ok); }
.tag.gray { background: #f5f5f4; color: var(--muted); }

table.t { width: 100%; border-collapse: collapse; font-size: 15px; }
table.t th { text-align: left; font-weight: 500; color: var(--muted); font-size: 14.5px; padding: 10px 18px; border-bottom: 1px solid var(--line); background: #fafaf9; }
table.t td { padding: 11px 18px; border-bottom: 1px solid #f5f5f4; }
table.t tr:last-child td { border-bottom: 0; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.form-row .field { margin: 0; }

.placeholder { max-width: 640px; }
.placeholder .phase { font-size: 14px; color: var(--accent-ink); font-weight: 500; }
.placeholder p { color: var(--ink-2); }

/* Barra superior, cajón y barra inferior: solo en el móvil (bloque «Móvil» al final del archivo). */
.mbar, .nav-scrim, .side-close, .tabbar { display: none; }

/* ------------------------------------------------------------- fase 1 */
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; }
.r { text-align: right; }
th.r { text-align: right; }
.nowrap { white-space: nowrap; }
.muted-link { font-size: 14px; color: var(--muted); }
.muted-link:hover { color: var(--accent); }
a.kpi.link { color: inherit; transition: border-color .15s, transform .15s; }
a.kpi.link:hover { border-color: #bfdbfe; transform: translateY(-1px); }
.kpi .v.accent { color: var(--accent); }
.kpi .v.warn, .big-n.warn { color: var(--warn); }
.big-n { font-size: 34px; font-weight: 600; letter-spacing: -.02em; }
.tag.red { background: var(--bad-soft); color: var(--bad); }
.pill { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--warn-soft); color: var(--warn); font-size: 13px; margin-left: 4px; }
.btn.ghost { display: inline-flex; align-items: center; gap: 8px; }
.btn.ghost svg { width: 16px; height: 16px; }
.section { margin-top: 16px; }
.scroll-x { overflow-x: auto; }
.meta-line { display: flex; flex-wrap: wrap; gap: 22px; margin-bottom: 16px; color: var(--muted); font-size: 15px; }
.meta-line b { color: var(--ink); font-weight: 500; margin-left: 4px; }
.map { display: inline-block; margin: 2px 14px 2px 0; font-size: 14px; }
.detail { max-width: 380px; word-break: break-word; }
form.inline { display: inline; }

.bars { display: grid; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 170px 1fr 40px; align-items: center; gap: 12px; font-size: 14.5px; }
.bar-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.bar-track { height: 8px; background: #f1f5f9; border-radius: 99px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.bar-fill.done { background: var(--ok); }
.bar-fill.off { background: #cbd5e1; }
.bar-n { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }

.dropzone { border: 2px dashed #d6d3d1; box-shadow: none; transition: border-color .15s, background .15s; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.busy { opacity: .7; pointer-events: none; }
.dz-inner { display: grid; justify-items: center; gap: 6px; padding: 36px 20px; cursor: pointer; text-align: center; }
.dz-icon { width: 46px; height: 46px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 6px; }
.dz-icon svg { width: 22px; height: 22px; }
.dz-inner b { font-size: 17px; font-weight: 500; }
.dz-busy { text-align: center; padding: 0 0 18px; color: var(--accent); font-weight: 500; }
code { background: #f5f5f4; padding: 1px 5px; border-radius: 5px; font-size: 13px; }

.confirm { border-color: #bfdbfe; background: linear-gradient(0deg, #fff, #f8fbff); }
.confirm .card-b { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.confirm-actions { display: flex; gap: 10px; }

.tabs { display: flex; gap: 4px; margin-bottom: 14px; }
.tabs a { padding: 7px 12px; border-radius: 9px; color: var(--ink-2); font-size: 15px; }
.tabs a:hover { background: #f5f5f4; }
.tabs a.on { background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink); }

.export-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.export .k { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 15px; }
.export .k svg { width: 16px; height: 16px; color: var(--accent); }
.export .v { font-size: 30px; font-weight: 600; margin: 6px 0 2px; }
.export .field { margin: 14px 0; }
.export-actions { display: flex; gap: 8px; }

/* ---------------------------------------------------------- operaciones */
.c-default, .c-gray { --c-bg: #f1f1ef; --c-ink: #55534e; --c-dot: #9b9a97; }
.c-brown { --c-bg: #f4eeee; --c-ink: #6b4f3f; --c-dot: #a27763; }
.c-orange { --c-bg: #fbecdd; --c-ink: #8a4a10; --c-dot: #d9730d; }
.c-yellow { --c-bg: #fbf3db; --c-ink: #7a5d0b; --c-dot: #dfab01; }
.c-green { --c-bg: #edf3ec; --c-ink: #2b593f; --c-dot: #4d9a6c; }
.c-blue { --c-bg: #e7f3f8; --c-ink: #1f4f7a; --c-dot: #2f80c4; }
.c-purple { --c-bg: #f6f3f9; --c-ink: #5a3d7a; --c-dot: #9065b0; }
.c-pink { --c-bg: #faf1f5; --c-ink: #7a2d55; --c-dot: #c14c8a; }
.c-red { --c-bg: #fdebec; --c-ink: #8e2a2a; --c-dot: #d44c47; }
.pill-status { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 500; padding: 2px 9px 2px 8px; border-radius: 99px; background: var(--c-bg); color: var(--c-ink); white-space: nowrap; }
.pill-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c-dot); }
.pill-status.big, .status-select.big { font-size: 15px; padding: 6px 12px; }
.status-select { font: inherit; font-size: 13.5px; font-weight: 500; border: 0; border-radius: 99px; padding: 3px 24px 3px 10px; background: var(--c-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2364748b' fill='none' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 9px center; color: var(--c-ink); appearance: none; cursor: pointer; max-width: 190px; }
.status-select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.ops-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.seg { display: inline-flex; background: #f1f5f9; border-radius: 11px; padding: 3px; }
.seg a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 9px; color: var(--ink-2); font-size: 15px; font-weight: 500; }
.seg a svg { width: 16px; height: 16px; }
.seg a.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(15, 23, 42, .08), 0 2px 8px rgba(15, 23, 42, .06); }
.chips { display: inline-flex; gap: 6px; }
.chip { padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-size: 14.5px; }
.chip:hover { border-color: #cbd5e1; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.ops-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.input.sm, select.input.sm { padding: 7px 10px; font-size: 14.5px; width: auto; max-width: 170px; border-radius: 9px; }
.input.search { width: 240px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 14.5px; color: var(--ink-2); }

.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 14px; align-items: flex-start; min-height: calc(100vh - 210px); }
.board-group-label { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: #94a3b8; padding: 8px 0; flex: none; }
.col { flex: 0 0 272px; background: #f6f5f3; border-radius: 12px; display: flex; flex-direction: column; max-height: calc(100vh - 210px); transition: background .12s, box-shadow .12s; }
/* Sergio 31/10: el fondo de cada columna es el color de su Status (como en Notion) */
.board .col.tinted { background: color-mix(in srgb, var(--c-dot) 13%, #fff); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-dot) 18%, transparent); }
.board .col.tinted .col-n { color: var(--c-ink); }
.col.over, .board .col.tinted.over { background: #eaf1fd; box-shadow: inset 0 0 0 2px #bfdbfe; }
.col-h { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 8px 10px; position: sticky; top: 0; }
.col-n { font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.col-body { padding: 2px 8px 10px; display: grid; gap: 8px; overflow-y: auto; min-height: 60px; align-content: start; }
.op-card { display: grid; gap: 7px; background: #fff; border: 1px solid #ebe9e6; border-radius: 10px; padding: 10px 11px; color: var(--ink); box-shadow: 0 1px 2px rgba(15, 23, 42, .04); cursor: pointer; }
.board[data-editable="true"] .op-card { cursor: grab; }
.op-card:hover { border-color: #cbd5e1; box-shadow: 0 2px 10px rgba(15, 23, 42, .07); }
.op-card b { font-weight: 500; font-size: 15px; line-height: 1.3; }
.op-card.dragging { opacity: .45; }
.op-card.saving { opacity: .6; pointer-events: none; }
.op-meta { display: flex; flex-wrap: wrap; gap: 5px; }
.op-meta .tag { font-size: 12.5px; }
.op-money { font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.table-wrap { overflow-x: auto; }
.ops-table th { cursor: pointer; user-select: none; white-space: nowrap; }
.ops-table th[data-dir="asc"]::after { content: " ↑"; }
.ops-table th[data-dir="desc"]::after { content: " ↓"; }
.ops-table td { padding: 8px 14px; vertical-align: middle; }
.ops-table th { padding: 10px 14px; }
.op-link { color: var(--ink); font-weight: 500; white-space: nowrap; }
.ops-table td.small { min-width: 180px; max-width: 260px; }
.op-link:hover { color: var(--accent); }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 15px; box-shadow: 0 8px 24px rgba(15, 23, 42, .2); z-index: 50; }
.toast.bad { background: var(--bad); }

.ficha { display: grid; grid-template-columns: minmax(0, 1fr) 430px; gap: 16px; align-items: start; }
.side-col { display: grid; gap: 16px; }
.props th { width: 190px; background: transparent; font-size: 14px; vertical-align: top; padding-top: 11px; }
.props td { padding: 10px 18px; }
.pre { white-space: pre-wrap; }
.share-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid #f5f5f4; }
.share-form { display: flex; gap: 8px; margin-top: 10px; }
.share-form select { flex: 1; }
.event { padding: 7px 0; border-bottom: 1px solid #f5f5f4; font-size: 15px; }
.event:last-child { border-bottom: 0; }
@media (max-width: 1100px) { .ficha { grid-template-columns: 1fr; } }

.job-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.job-grid > div { display: grid; }
.job-grid .big-n { font-size: 26px; }

/* ---------------------------------------------------------- colaboradores */
.collab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; }
.city-list { display: flex; flex-wrap: wrap; gap: 6px; }
.city-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-soft); color: var(--accent-ink); border-radius: 99px; padding: 3px 4px 3px 11px; font-size: 14.5px; }
.city-chip button { border: 0; background: transparent; color: var(--accent-ink); cursor: pointer; width: 22px; height: 22px; border-radius: 50%; font-size: 16px; line-height: 1; }
.city-chip button:hover { background: #dbeafe; }
/* Zona del colaborador: provincia + casillas (Sergio 31/10) */
.city-chip.prov { background: #0f172a; color: #fff; }
.city-chip.prov .muted, .city-chip.prov button { color: #cbd5e1; }
.city-chip.prov button:hover { background: rgba(255,255,255,.15); }
.zp-prov { display: grid; gap: 4px; margin-top: 14px; }
.zp-prov select { width: 100%; max-width: none; }
.zp-form { margin-top: 10px; display: grid; gap: 10px; }
.zp-all { justify-self: start; }
.zp-note { margin: 0; padding: 9px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); font-size: 14.5px; }
.zp-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.zp-tools .input { max-width: 190px; }
.zp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; max-height: 300px; overflow: auto; padding: 2px; }
.zp-c { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; font-size: 14.5px; min-width: 0; }
.zp-c span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zp-c small { color: var(--muted); font-size: 12.5px; }
.zp-c:hover { border-color: var(--accent); }
.zp-c.sel { border-color: var(--accent); background: var(--accent-soft); }
.zp-c.on { opacity: .55; cursor: default; background: #f5f5f4; }
.zp-c input { accent-color: var(--accent); margin: 0; }
.zp-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; position: sticky; bottom: 0; background: var(--card); padding-top: 4px; }
textarea.input { resize: vertical; }
.visit-new { border-bottom: 1px solid var(--line); }
.visit-new summary { cursor: pointer; padding: 12px 18px; color: var(--accent); font-weight: 500; list-style: none; }
.visit-new summary::-webkit-details-marker { display: none; }
.visit-form { padding: 4px 18px 18px; display: grid; gap: 12px; }
.visit-form .field { margin: 0; }
.visit { padding: 14px 18px; border-bottom: 1px solid #f5f5f4; }
.visit:last-child { border-bottom: 0; }
.visit-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.visit-h .tag { margin-left: 6px; }
.visit-text { margin: 8px 0 0; }
.visit-data { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; font-size: 15px; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 10px; }
.photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 9px; border: 1px solid var(--line); display: block; }
@media (max-width: 600px) { .collab-grid { grid-template-columns: 1fr; } .form-row { grid-template-columns: 1fr; } }

/* ------------------------------------------------- shell compacto (Filtrado) */
/* Raíl de iconos de 64px; el botón ☰ despliega el menú completo por encima del contenido. */
.side-toggle { display: none; }
.shell.compact { grid-template-columns: 64px minmax(0, 1fr); background: linear-gradient(90deg, var(--side) 64px, transparent 64px); }
.shell.compact .side { width: 64px; z-index: 1000; transition: width .16s ease, box-shadow .16s ease; overflow: hidden; }
.shell.compact .side .brand { padding: 14px 0 6px; text-align: center; }
.shell.compact .side .brand .wordmark { font-size: 16px; letter-spacing: .04em; }
.shell.compact .side .brand .byline { display: none; }
.shell.compact .side-toggle { display: grid; place-items: center; margin: 2px auto 4px; width: 40px; height: 34px; border: 0; border-radius: 9px; background: transparent; color: #94a3b8; cursor: pointer; }
.shell.compact .side-toggle:hover { background: var(--side-2); color: #fff; }
.shell.compact .side-toggle svg { width: 20px; height: 20px; }
.shell.compact .nav { padding: 4px 10px; }
.shell.compact .nav-label { display: none; }
.shell.compact .nav a { justify-content: center; padding: 10px 0; }
.shell.compact .nav a span { display: none; }
.shell.compact .me { padding: 12px 0; justify-content: center; flex-direction: column; gap: 6px; }
.shell.compact .me .who { display: none; }
.shell.compact .me form { margin: 0; }
.shell.compact.side-open .side { width: 248px; box-shadow: 8px 0 32px rgba(15, 23, 42, .28); }
.shell.compact.side-open .side .brand { padding: 18px 22px 8px; text-align: left; }
.shell.compact.side-open .side .brand .wordmark { font-size: 26px; }
.shell.compact.side-open .side-toggle { margin: 0 0 4px 14px; }
.shell.compact.side-open .nav-label { display: block; }
.shell.compact.side-open .nav a { justify-content: flex-start; padding: 9px 10px; }
.shell.compact.side-open .nav a span { display: inline; }
.shell.compact.side-open .me { flex-direction: row; padding: 16px 18px; justify-content: flex-start; }
.shell.compact.side-open .me .who { display: block; }
.shell.compact.side-open .me form { margin-left: auto; }

/* Escritorio con ratón: el menú se despliega al pasar el cursor, el botón ☰ sobra (en táctil y móvil se mantiene). */
@media (hover: hover) and (min-width: 901px) {
  .shell.compact .side-toggle { display: none; }
}

/* ---------------------------------------------------------- contactos */
.contact-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: end; }
.contact-form .field { margin: 0; }
.contact-form .wide { grid-column: 1 / -1; }
.contact-actions { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; }
tr.editing td { background: #f8fbff; padding: 16px 18px; }
b.strong { font-weight: 500; }
.tag { white-space: nowrap; }

/* ------------------------------------------------- directorios y fichas */
.tag.amber { background: var(--warn-soft); color: var(--warn); }
.tag.cap { background: #eef2ff; color: #3730a3; font-weight: 500; }
.tag.big { font-size: 15px; padding: 4px 12px; }
.topbar > div:last-child { display: flex; align-items: center; gap: 8px; }
.crumb { color: var(--muted); font-weight: 500; }
.crumb:hover { color: var(--accent); }
.h-ic { display: inline-flex; align-items: center; gap: 8px; }
.h-ic svg { width: 19px; height: 19px; color: var(--accent); }
.chip-n { display: inline-block; min-width: 18px; margin-left: 4px; padding: 0 6px; border-radius: 99px; background: #f1f5f9; color: var(--ink-2); font-size: 13px; text-align: center; }
.chip.on .chip-n { background: rgba(255, 255, 255, .18); color: #fff; }
.chip-n.warn { background: var(--warn-soft); color: var(--warn); }
.dir-table td { vertical-align: top; padding-top: 12px; padding-bottom: 12px; }
.dir-table .city-list { gap: 4px; max-width: 320px; }
tr.row-link { cursor: pointer; }
tr.row-link:hover td { background: #fafaf9; }
.city-chip.static { padding: 3px 11px; }
.dir-table .city-chip { font-size: 13.5px; padding: 2px 9px; }
.kpis.mini { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.kpis.mini .kpi { padding: 14px 16px; }
.kpis.mini .kpi .v { font-size: 26px; margin-top: 4px; }
.kpi .v.sm { font-size: 20px !important; }
.pv-title { font-size: 14px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; margin: 18px 0 8px; }
.pv-title:first-child { margin-top: 0; }
.pv { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 18px; }
.pv > div { padding: 8px 0; border-bottom: 1px solid #f5f5f4; min-width: 0; }
.pv dt { font-size: 13.5px; color: var(--muted); }
.pv dd { margin: 2px 0 0; font-size: 15.5px; word-break: break-word; }
.profile-edit { display: grid; gap: 4px; }
.profile-edit .qsection { margin-top: 10px; }
.range-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.range-card { padding: 14px 16px; display: grid; gap: 2px; color: var(--ink); transition: border-color .15s, transform .15s; }
.range-card:hover { border-color: #c7d2fe; transform: translateY(-1px); }
.range-card.on { border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79, 70, 229, .12); }
.range-k { font-size: 14px; color: var(--muted); font-weight: 500; }
.range-v { font-size: 28px; font-weight: 600; letter-spacing: -.02em; }
.range-card.on .range-k { color: #3730a3; }
.muted-card .range-v { color: var(--muted); }
a.link-card { color: inherit; transition: border-color .15s; }
a.link-card:hover { border-color: #bfdbfe; }
.people-b { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.people-b > div, .range-mini > div { display: grid; }
.range-mini { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.range-mini > div { background: #f8fafc; border-radius: 10px; padding: 10px 8px; text-align: center; }
.range-mini .rm-v { font-size: 22px; font-weight: 600; color: #3730a3; }
.range-mini .rm-k { font-size: 13px; color: var(--muted); white-space: nowrap; }
.range-mini .zero .rm-v { color: #cbd5e1; }

/* invitaciones */
.invite-ready { border: 1px solid #bbf7d0; background: linear-gradient(0deg, #fff, #f0fdf4); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; }
.invite-ready-h { display: flex; align-items: center; gap: 8px; color: var(--ok); }
.invite-ready-h svg { width: 18px; height: 18px; }
.invite-ready p { margin: 6px 0 10px; }
.copy-row { display: flex; gap: 8px; }
.copy-row .input { flex: 1; font-size: 14px; background: #fff; }
.copy-row .btn { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.copy-row .btn svg { width: 16px; height: 16px; }
.invite-form { grid-template-columns: minmax(240px, 1.4fr) repeat(auto-fit, minmax(170px, 1fr)); }

/* --------------------------------------------- registro / bienvenida (móvil primero) */
.onb-body { background: radial-gradient(900px 480px at 50% -8%, #e8eefc 0%, transparent 62%) no-repeat, var(--bg); }
.onb-wrap { max-width: 760px; margin: 0 auto; padding: 18px 16px 48px; }
.onb-top { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 18px; }
.onb-top .wordmark { font-size: 28px; color: var(--ink); }
.onb-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 26px 22px; }
.onb-card h1 { font-size: 28px; }
.onb-lead { color: var(--ink-2); margin: 6px 0 18px; font-size: 16.5px; }
.center { text-align: center; }
.req { color: var(--bad); }
.role-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.role-card { display: grid; gap: 6px; align-content: start; padding: 20px; border: 1.5px solid var(--line); border-radius: 14px; color: var(--ink-2); background: #fff; transition: border-color .15s, box-shadow .15s, transform .15s; }
.role-card:hover, .role-card:focus-visible { border-color: var(--accent); box-shadow: 0 6px 22px rgba(37, 99, 235, .12); transform: translateY(-2px); outline: none; }
.role-card b { font-size: 19px; color: var(--ink); font-weight: 600; }
.role-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 4px; }
.role-ic svg { width: 22px; height: 22px; }
.role-go { color: var(--accent); font-weight: 500; margin-top: 6px; }
.onb-foot { margin: 18px 0 0; text-align: center; }
.role-chosen { display: inline-block; align-self: start; border-radius: 14px !important; background: var(--accent-soft); color: var(--accent-ink); border-radius: 99px; padding: 5px 14px; font-size: 15px; margin-bottom: 16px; }
.role-chosen a { font-weight: 500; text-decoration: underline; }
.onb-form { display: grid; gap: 4px; }
.qsection { border: 0; padding: 0; margin: 14px 0 6px; min-width: 0; }
.qsection legend { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; padding: 0; margin-bottom: 12px; color: var(--ink); }
.step-n { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; display: inline-grid; place-items: center; font-size: 14px; font-weight: 600; flex: none; }
.qgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.qgrid .field { margin: 0; }
.q.wide { grid-column: 1 / -1; }
.qlabel { font-size: 14.5px; font-weight: 500; color: var(--ink-2); }
.qhelp { font-size: 13.5px; color: var(--muted); }
.ferr { font-size: 14px; color: var(--bad); }
.has-err .input { border-color: #f87171; }
.has-err .opt span { border-color: #fca5a5; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.opt span { display: inline-block; padding: 9px 15px; border: 1px solid #d6d3d1; border-radius: 10px; background: #fff; font-size: 15.5px; cursor: pointer; transition: all .12s; user-select: none; }
.opt input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.opt input:focus-visible + span { box-shadow: 0 0 0 3px rgba(37, 99, 235, .25); }
.city-picker { display: grid; gap: 8px; }
.city-picker [data-chips]:empty { display: none; }
.city-picker .city-chip { padding: 4px 4px 4px 12px; }
.city-add { display: flex; gap: 8px; }
.city-add .input { flex: 1; }
.consent-box { display: flex; gap: 12px; align-items: flex-start; background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: 14px; font-size: 14.5px; color: var(--ink-2); cursor: pointer; }
.consent-box input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--accent); }
.consent.has-err .consent-box { border-color: #fca5a5; background: var(--bad-soft); }
.btn.big { padding: 14px; font-size: 17px; margin-top: 14px; }
/* confirmación de email («Revisa tu correo», enlace del correo). Prefijo ev-: «mail-*» es del cliente de Correo */
.ev-wrap { max-width: 520px; padding-top: 6vh; }
.onb-card.ev-card { text-align: center; padding: 34px 32px 28px; }
.ev-ic { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 18px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px #dbe6fb; }
.ev-ic svg { width: 30px; height: 30px; }
.ev-ic.ok { background: var(--ok-soft); color: var(--ok); box-shadow: inset 0 0 0 1px #c9ecd3; }
.ev-ic.bad { background: var(--warn-soft); color: var(--warn); box-shadow: inset 0 0 0 1px #f6e2b5; }
.ev-card .onb-lead { margin-bottom: 20px; line-height: 1.55; }
.ev-addr { color: var(--ink); font-weight: 600; word-break: break-all; }
.ev-card .alert { text-align: left; }
.alert.dev { background: #f8fafc; color: var(--ink-2); border: 1px dashed #cbd5e1; font-size: 14px; }
.alert.dev code { font-size: 13px; background: #eef2f7; padding: 1px 5px; border-radius: 5px; }
.ev-steps { text-align: left; margin: 0 0 14px; padding: 14px 16px 14px 36px; background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; color: var(--ink-2); font-size: 15.5px; line-height: 1.55; display: grid; gap: 4px; }
.ev-help { margin: 0 0 20px; }
.ev-actions { display: grid; gap: 10px; }
.ev-actions form { margin: 0; }
.ev-actions .btn { display: flex; justify-content: center; width: 100%; margin: 0; }
.ev-foot { margin: 16px 0 0; }
.ev-wrap .legal-links, .ev-wrap > nav { margin-top: 18px; text-align: center; }
/* Mi perfil · email de acceso */
.email-card .email-now { font-weight: 600; color: var(--ink); word-break: break-all; }
.email-pending { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--warn-soft); border: 1px solid #f6e2b5; color: var(--warn); font-size: 14.5px; }
.email-pending b { color: #92400e; word-break: break-all; }
.email-pending .row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.email-pending form { margin: 0; }
.email-form { display: grid; gap: 10px; margin-top: 12px; }
.email-change { margin-top: 12px; }
.email-change summary { cursor: pointer; color: var(--accent); font-weight: 500; font-size: 15px; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.email-change summary::-webkit-details-marker { display: none; }
.email-change summary::before { content: "›"; display: inline-block; transition: transform .15s; font-size: 17px; line-height: 1; }
.email-change[open] summary::before { transform: rotate(90deg); }
.email-form .field { margin: 0; }
.email-form .btn { justify-self: start; }
@media (max-width: 640px) {
  .ev-wrap { padding-top: 10px; }
  .onb-card.ev-card { padding: 26px 18px 22px; }
  .onb-wrap { padding: 10px 12px 36px; }
  .onb-card { padding: 20px 16px; border-radius: 16px; }
  .onb-card h1 { font-size: 25px; }
  .role-pick, .qgrid { grid-template-columns: 1fr; }
  .opt span { padding: 10px 14px; }
  .input, select.input { font-size: 17px; }  /* evita el zoom de iOS al enfocar */
  .copy-row { flex-direction: column; }
  .range-mini { grid-template-columns: repeat(3, 1fr); }
}
.input.sm.search { width: 300px; max-width: 100%; }
.dir-table .email { white-space: nowrap; }
.qgrid .field { align-content: start; }
.card-h { gap: 12px; }

/* ------------------------------------------------------------ análisis NPL (fase 6) */
.npl-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.npl-filters .input.sm.wide { max-width: 230px; }
.npl-filters .input.sm.search { width: 230px; }
.sem-help { margin-left: auto; font-size: 14px; color: var(--muted); border-bottom: 1px dashed #cbd5e1; cursor: help; white-space: pre-line; }
.npl-table { font-size: 14.5px; }
.npl-table td { padding: 9px 10px; vertical-align: middle; }
.npl-table th { padding: 10px; white-space: nowrap; }
.npl-table td:first-child, .npl-table th:first-child { padding-left: 16px; }
.npl-table .pill-status { max-width: 150px; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: middle; }
.npl-table .op-link { white-space: normal; }
.npl-table .last { white-space: nowrap; margin-top: 3px; font-size: 12.5px; }
.npl-table th.r { text-align: right; }
.doc-progress { display: flex; align-items: center; gap: 8px; min-width: 92px; }
.dp-n { font-variant-numeric: tabular-nums; font-size: 14px; color: var(--ink-2); min-width: 26px; }
.dp-track { display: inline-block; flex: 1; height: 6px; min-width: 44px; background: #f1f5f9; border-radius: 99px; overflow: hidden; vertical-align: middle; }
.dp-fill { display: block; height: 100%; background: #94a3b8; border-radius: 99px; }
.dp-fill.ok { background: var(--accent); }
.dp-fill.done { background: var(--ok); }
.sem { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); white-space: nowrap; }
.sem.verde { color: var(--ok); } .sem.ambar { color: var(--warn); } .sem.rojo { color: var(--bad); }
.sem-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #cbd5e1; flex: none; }
.sem-dot.verde { background: #16a34a; box-shadow: 0 0 0 3px #dcfce7; }
.sem-dot.ambar { background: #f59e0b; box-shadow: 0 0 0 3px #fef3c7; }
.sem-dot.rojo { background: #dc2626; box-shadow: 0 0 0 3px #fee2e2; }
.dec { font-size: 13.5px; font-weight: 500; padding: 2px 9px; border-radius: 99px; background: #f1f5f9; color: var(--ink-2); white-space: nowrap; }
.dec-ofertar { background: var(--accent-soft); color: var(--accent-ink); }
.dec-negociar { background: #f5f3ff; color: #5b21b6; }
.dec-descartar { background: #f5f5f4; color: var(--muted); }
.dec-comprada { background: var(--ok-soft); color: var(--ok); }
a.npl-dash { display: block; }
.npl-toast { display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 24px); }
.npl-toast .linkish { color: #93c5fd; }
.npl-toast.bad .linkish { color: #fff; text-decoration: underline; }
.npl-dash-b { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 12px; align-items: center; }
.npl-dash-b > div { display: grid; }
.sem-counts { display: flex !important; gap: 10px; flex-wrap: wrap; }
.sem-count { display: inline-flex; align-items: center; gap: 7px; font-size: 22px; font-weight: 600; padding: 6px 12px; border-radius: 10px; background: #f8fafc; }
.sem-count small { font-size: 13px; font-weight: 400; color: var(--muted); }
.sem-count.verde { color: var(--ok); } .sem-count.ambar { color: var(--warn); } .sem-count.rojo { color: var(--bad); }

/* expediente */
.npl-strip { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); margin-bottom: 16px; overflow: hidden; }
.sem-box { padding: 14px 18px; border-right: 1px solid var(--line); background: #f8fafc; }
.sem-box.verde { background: linear-gradient(180deg, #f0fdf4, #fff); }
.sem-box.ambar { background: linear-gradient(180deg, #fffbeb, #fff); }
.sem-box.rojo { background: linear-gradient(180deg, #fef2f2, #fff); }
.sem-big { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 600; }
.sem-box.verde .sem-big { color: var(--ok); } .sem-box.ambar .sem-big { color: var(--warn); } .sem-box.rojo .sem-big { color: var(--bad); }
.sem-big .sem-dot { width: 14px; height: 14px; }
.sem-why { margin: 8px 0 0; padding-left: 18px; font-size: 14px; color: var(--ink-2); display: grid; gap: 2px; }
.sem-why.ok { padding: 0; }
.kv { margin: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kv > div { padding: 12px 16px; border-left: 1px solid #f5f5f4; display: grid; align-content: start; gap: 2px; min-width: 0; }
.kv dt { font-size: 13.5px; color: var(--muted); }
.kv dd { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kv .src { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv .src .dp-track { width: 100%; margin-top: 6px; }
.kv.mini { grid-template-columns: 1fr 1fr; margin: 10px 0; border: 1px solid #f1f1ef; border-radius: 10px; }
.kv.mini > div { padding: 8px 12px; border-left: 0; border-bottom: 1px solid #f5f5f4; }
.kv.mini dd { font-size: 16px; }
.npl-ws { display: grid; grid-template-columns: minmax(0, 1fr) 480px; gap: 16px; align-items: start; }
.npl-ws.solo { grid-template-columns: minmax(0, 1fr); max-width: 980px; }
.ws-side { display: grid; gap: 16px; }
.collab-note { margin: 0; padding: 12px 18px; font-size: 15px; color: var(--ink-2); background: var(--accent-soft); border-bottom: 1px solid var(--line); }
ol.docs { list-style: none; margin: 0; padding: 0; }
ol.docs > li { border-bottom: 1px solid #f1f1ef; }
ol.docs > li:last-child { border-bottom: 0; }
.doc { scroll-margin-top: 70px; }
.doc > summary { display: flex; align-items: center; gap: 12px; padding: 12px 18px; cursor: pointer; list-style: none; }
.doc > summary::-webkit-details-marker { display: none; }
.doc > summary:hover { background: #fafaf9; }
.doc[open] > summary { background: #fafaf9; border-bottom: 1px solid #f1f1ef; }
.doc-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13.5px; font-weight: 600; background: #f1f5f9; color: var(--ink-2); flex: none; }
.doc.st-recibido .doc-n, .doc.st-revisado .doc-n { background: var(--ok); color: #fff; }
.doc.st-na .doc-n { background: #e7e5e4; color: var(--muted); }
.doc.st-incidencia .doc-n { background: var(--bad); color: #fff; }
.doc.st-solicitado .doc-n { background: #dbeafe; color: var(--accent-ink); }
.doc-name { font-weight: 500; font-size: 15.5px; flex: 1; min-width: 0; }
.doc-meta { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.doc-files { font-size: 13.5px; color: var(--ink-2); }
.doc-st { font-size: 13px; font-weight: 500; padding: 2px 9px; border-radius: 99px; background: #f1f5f9; color: var(--ink-2); white-space: nowrap; }
.doc-st.st-solicitado { background: var(--accent-soft); color: var(--accent-ink); }
.doc-st.st-recibido { background: #ecfdf5; color: #047857; }
.doc-st.st-revisado { background: var(--ok); color: #fff; }
.doc-st.st-incidencia { background: var(--bad-soft); color: var(--bad); }
.doc-st.st-na { background: #f5f5f4; color: var(--muted); }
.doc-body { padding: 14px 18px 16px 56px; display: grid; gap: 14px; }
.doc-body.with-text { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding-left: 18px; }
.doc-body.with-text .doc-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.doc-body.with-text .doc-text { position: sticky; top: 12px; max-height: calc(100vh - 24px); }
.doc-main { display: grid; gap: 14px; min-width: 0; align-content: start; }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px 12px; }
.doc-grid .field { margin: 0; gap: 4px; }
.doc-grid .field.wide { grid-column: 1 / -1; }
.doc-grid .input, .params-form .input { padding: 7px 10px; font-size: 15px; border-radius: 9px; }
.input.num { text-align: right; font-variant-numeric: tabular-nums; }
.field.sug .input { background: #fffbeb; border-color: #fcd34d; }
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.field.sug .hint { color: var(--warn); }
.doc-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.files { display: grid; gap: 6px; }
.file-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 10px; border: 1px solid #f1f1ef; border-radius: 10px; background: #fff; }
.file-kind { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; padding: 3px 6px; border-radius: 6px; background: #f1f5f9; color: var(--ink-2); }
.file-kind.k-pdf { background: #fee2e2; color: #991b1b; }
.file-kind.k-jpg, .file-kind.k-png { background: #e0f2fe; color: #075985; }
.file-kind.k-docx { background: #dbeafe; color: #1e40af; }
.file-kind.k-xlsx { background: #dcfce7; color: #166534; }
.file-name { font-weight: 500; color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
.file-name:hover { color: var(--accent); }
.file-act { margin-left: auto; display: inline-flex; gap: 6px; align-items: center; }
.file-act .btn { white-space: nowrap; }
.file-thumb img { width: 44px; height: 34px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }
.btn.danger, .linkish.danger { color: var(--bad); }
.upload-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border: 1.5px dashed #d6d3d1; border-radius: 10px; }
.upload-pick { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-ink); font-size: 14.5px; font-weight: 500; cursor: pointer; max-width: 100%; }
.upload-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.upload-pick .up-ic svg { width: 16px; height: 16px; display: block; }
.up-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.visits-box { display: grid; gap: 6px; padding: 10px 12px; background: #f8fafc; border-radius: 10px; font-size: 15px; }
.visit-mini { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.notes { display: grid; gap: 8px; }
.note { padding: 8px 10px; border-radius: 10px; background: #fafaf9; border: 1px solid #f1f1ef; }
.note.internal { background: #fffbeb; border-color: #fde68a; }
.note-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.note-tag { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--warn); }
.note:not(.internal) .note-tag { color: var(--ok); }
.note p { margin: 4px 0 0; font-size: 15px; }
.linkish { background: none; border: 0; padding: 0; font: inherit; font-size: 13.5px; color: var(--accent); cursor: pointer; }
.note-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.note-form textarea { flex: 1 1 100%; min-height: 36px; padding: 7px 10px; font-size: 15px; }
.note-form .btn { margin-left: auto; }
.doc-text { border: 1px solid var(--line); border-radius: 10px; background: #fdfdfc; display: flex; flex-direction: column; max-height: 560px; min-width: 0; }
.dt-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.dt-head b { font-weight: 500; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt-head .linkish { margin-left: auto; }
.dt-text { padding: 10px 12px; overflow: auto; white-space: pre-wrap; font-size: 13.5px; line-height: 1.5; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.dt-loading { padding: 16px; color: var(--muted); }
mark.hl-eur { background: #dcfce7; color: #14532d; border-radius: 3px; cursor: copy; }
mark.hl-date { background: #dbeafe; color: #1e3a8a; border-radius: 3px; cursor: copy; }
.an-b { display: grid; gap: 8px; padding: 14px 16px; }
.warn-line { font-size: 14px; padding: 8px 10px; border-radius: 9px; line-height: 1.4; }
.warn-line.warn { background: var(--warn-soft); color: #92400e; border: 1px solid #fde68a; }
.warn-line.info { background: #f8fafc; color: var(--ink-2); border: 1px solid #e2e8f0; }
.warn-line.bad { background: var(--bad-soft); color: var(--bad); border: 1px solid #fecaca; }
table.scen { font-size: 14.5px; }
table.scen th { padding: 7px 8px; font-size: 13px; }
table.scen td { padding: 8px; border-bottom: 1px solid #f5f5f4; }
table.scen tr.best > td { background: #f0fdf4; }
table.scen tr.best > td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
table.scen tr.ref > td { color: #94a3b8; }
table.scen tr.ref .scen-name { color: #94a3b8; }
.scen-name { background: none; border: 0; padding: 0; font: inherit; font-weight: 500; color: var(--ink); cursor: pointer; text-align: left; }
.scen-name:hover { color: var(--accent); }
.best-tag, .ref-tag { display: inline-block; margin-left: 6px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: 1px 6px; border-radius: 99px; background: var(--ok); color: #fff; vertical-align: 1px; }
.ref-tag { background: #e7e5e4; color: var(--muted); }
td.neg, .lines td.neg { color: var(--bad); }
.scen-detail > td { background: #fcfcfb; padding: 4px 8px 10px !important; }
table.lines { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.lines td { padding: 3px 4px; border-bottom: 1px dotted #e7e5e4; }
table.lines tr.tot td { font-weight: 600; border-bottom: 0; }
.fine { margin: 0; font-size: 12.5px; }
.params > summary, .rules > summary { cursor: pointer; font-size: 14.5px; font-weight: 500; color: var(--accent); padding: 6px 0; }
.params-form fieldset { border: 0; margin: 8px 0 0; padding: 0; }
.params-form legend { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.p-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; align-items: end; }
.p-grid .field { margin: 0; gap: 3px; }
.p-grid label { font-size: 13px; line-height: 1.25; }
.p-grid .field.changed .input { border-color: var(--accent); background: var(--accent-soft); }
.rules ul { margin: 4px 0 0; padding-left: 18px; font-size: 14px; color: var(--ink-2); display: grid; gap: 4px; }
.dec-form { display: grid; gap: 12px; }
.dec-form .field { margin: 0; }
.dec-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.dec-opts .opt span { padding: 7px 12px; font-size: 15px; }
.dec-opts .opt input:checked + span.dec-descartar { background: #57534e; border-color: #57534e; }
.dec-opts .opt input:checked + span.dec-comprada { background: var(--ok); border-color: var(--ok); }
.dec-opts .opt input:checked + span.dec-ofertar { background: var(--accent); border-color: var(--accent); }
.dec-opts .opt input:checked + span.dec-negociar { background: #6d28d9; border-color: #6d28d9; }
.dec-hist { display: grid; gap: 4px; border-top: 1px solid #f5f5f4; padding-top: 10px; }
.timeline { display: grid; gap: 0; max-height: 420px; overflow: auto; padding-top: 6px; }
.tl { padding: 7px 0 7px 14px; border-left: 2px solid #e7e5e4; position: relative; font-size: 14.5px; }
.tl::before { content: ""; position: absolute; left: -5px; top: 12px; width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; }
.tl.ev-npl_decision::before { background: var(--accent); }
.tl.ev-npl_archivo::before { background: var(--ok); }
.tl.ev-status::before { background: #9065b0; }
@media (max-width: 1280px) { .npl-ws { grid-template-columns: minmax(0, 1fr) 440px; } .kv { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) {
  .npl-ws { grid-template-columns: 1fr; }
  .npl-strip { grid-template-columns: 1fr; }
  .sem-box { border-right: 0; border-bottom: 1px solid var(--line); }
  .doc-body.with-text { grid-template-columns: 1fr; }
  .npl-dash-b { grid-template-columns: 1fr 1fr; }
  .npl-dash-b .sem-counts { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .doc-body { padding: 12px 14px 14px; }
  .doc > summary { padding: 12px 14px; gap: 10px; flex-wrap: wrap; }
  .doc-name { flex-basis: calc(100% - 40px); }
  .doc-meta { margin-left: 36px; }
  .file-row { padding: 8px 10px; }
  .file-name { max-width: none; flex: 1 1 0; min-width: 0; white-space: normal; word-break: break-word; }
  .file-row > .muted { flex-basis: 100%; }
  .file-act { margin-left: 0; }
  .upload-form { flex-direction: column; align-items: stretch; }
  .upload-pick { justify-content: center; padding: 12px; font-size: 16px; }
  .upload-form .btn { padding: 12px; font-size: 16px; }
  .note-form { flex-wrap: wrap; }
  .p-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr 1fr; }
  .topbar { flex-wrap: wrap; gap: 10px; }
  .topbar > div:last-child { flex-wrap: wrap; }
  .npl-filters .input.sm, .npl-filters .input.search { max-width: none; flex: 1 1 140px; }
  .sem-help { margin-left: 0; }
}

/* ------------------------------------------------- fase 8: portal del inversor */
.progress { height: 8px; border-radius: 99px; background: #eef2f7; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2563eb, #3b82f6); }
.progress.sm { height: 6px; width: 170px; margin-bottom: 4px; }
.kpi .v.pos { color: var(--ok); }
.ok-text { color: var(--ok); display: inline-flex; align-items: center; gap: 5px; }
.ok-text svg { width: 14px; height: 14px; }
.btn.danger { background: var(--bad); }
.btn.danger:hover { background: #991b1b; }
.btn.danger:not(.ghost) { color: #fff; }   /* botón rojo sólido: texto blanco (Sergio 31/10) */
.danger-text { color: var(--bad) !important; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.sec-title { font-size: 19px; margin: 22px 0 12px; }
.tag svg { width: 12px; height: 12px; vertical-align: -1px; margin-right: 3px; }

/* socios: lista y editor */
.opp-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.opp-bar .seg .pill { margin-left: 2px; }
.opp-table td { vertical-align: middle; }
.opp-dash .npl-dash-b { grid-template-columns: 1fr 1fr 1.4fr; }
.privacy-note { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 18px; padding: 10px 12px; border-radius: 10px; background: #f8fafc; border: 1px solid #e2e8f0; color: var(--ink-2); font-size: 14.5px; }
.privacy-note svg { width: 17px; height: 17px; flex: none; color: var(--accent); margin-top: 1px; }
.opp-form .form-row { margin-bottom: 16px; }
.opp-form .form-row.two-one { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.opp-form .form-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.opp-form .form-row.end { align-items: end; margin-bottom: 8px; }
.form-note { margin: -8px 0 16px; }
.fs { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.fs legend { font-size: 14px; font-weight: 500; color: var(--ink-2); padding: 0; margin-bottom: 8px; }
.risk-pick, .seg-radio { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.risk-opt input, .seg-radio input { accent-color: var(--accent); }
.risk-opt { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 99px; border: 1px solid var(--line); background: #fff; font-size: 15px; cursor: pointer; }
.risk-opt:has(input:checked) { border-color: currentColor; font-weight: 500; }
.risk-opt.r-bajo:has(input:checked) { color: #15803d; background: #f0fdf4; }
.risk-opt.r-medio:has(input:checked) { color: #b45309; background: #fffbeb; }
.risk-opt.r-alto:has(input:checked) { color: #b91c1c; background: #fef2f2; }
.seg-radio label { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 15px; cursor: pointer; background: #fff; }
.seg-radio label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.check-grid, .inv-pick { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; }
.inv-pick { max-height: 220px; overflow: auto; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.cover-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.cover-row .input { flex: 1 1 220px; width: auto; }
.cover-thumb { width: 120px; height: 72px; object-fit: cover; border-radius: 9px; border: 1px solid var(--line); }
.mini-dl { margin: 12px 0 0; display: grid; gap: 8px; }
.mini-dl > div { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.mini-dl dt { color: var(--muted); }
.mini-dl dd { margin: 0; font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; }
.mini-dl dd.ok { color: var(--ok); }
.mini-dl.two { grid-template-columns: 1fr 1fr; gap: 10px 18px; margin: 0; }
.mini-dl.two > div { display: grid; gap: 1px; justify-content: stretch; }
.mini-dl.two dd { text-align: left; }
.req-row { display: flex; justify-content: space-between; gap: 14px; padding: 14px 18px; border-bottom: 1px solid #f1f1ef; }
.req-row:last-child { border-bottom: 0; }
.req-main { min-width: 0; display: grid; gap: 3px; }
.req-who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.req-amount { font-size: 19px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.req-msg { margin: 2px 0; padding: 8px 10px; border-radius: 9px; background: #f8fafc; font-size: 14.5px; color: var(--ink-2); }
.req-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; }
.reject summary { list-style: none; cursor: pointer; }
.reject summary::-webkit-details-marker { display: none; }
.reject[open] summary { background: #f5f5f4; }
.reject-form { display: grid; gap: 6px; margin-top: 8px; width: 240px; }
.sub-h { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 4px 0 8px; font-weight: 600; }
.docs-admin .sub-h:not(:first-child) { margin-top: 18px; }
table.t.compact td { padding: 8px 10px; }
table.t.compact th { padding: 7px 10px; }
.vis-toggle { font: inherit; font-size: 13.5px; display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 5px; border-radius: 99px; border: 1px solid var(--line); background: #f8fafc; color: var(--muted); cursor: pointer; white-space: nowrap; }
.vis-toggle .knob { width: 26px; height: 16px; border-radius: 99px; background: #cbd5e1; position: relative; flex: none; transition: background .15s; }
.vis-toggle .knob::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: left .15s; }
.vis-toggle.on { border-color: #bbf7d0; background: var(--ok-soft); color: var(--ok); font-weight: 500; }
.vis-toggle.on .knob { background: #16a34a; }
.vis-toggle.on .knob::after { left: 12px; }
.upload-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.upload-inline .input { flex: 1 1 260px; width: auto; }
.part { padding: 14px 18px; border-bottom: 1px solid #f1f1ef; }
.part-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.part-n { display: grid; justify-items: end; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.part .dist { margin-top: 8px; border: 1px solid #f1f1ef; border-radius: 9px; overflow: hidden; }
.part-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.part-actions details { flex: 1 1 100%; }
.part-actions details:not([open]) { flex: 0 0 auto; }
.part-actions summary, .part-new summary { list-style: none; cursor: pointer; }
.part-actions summary::-webkit-details-marker, .part-new summary::-webkit-details-marker { display: none; }
.mini-form { margin-top: 10px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.part-new summary { padding: 12px 18px; color: var(--accent); font-weight: 500; font-size: 15px; }
.part-new .mini-form { margin: 0 18px 4px; }

/* inversor: catálogo */
.cat-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.cat-ticket { padding: 6px 12px; border: 1px solid var(--line); border-radius: 99px; background: #fff; }
.opp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
a.opp-card { display: flex; flex-direction: column; color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); transition: transform .15s, border-color .15s, box-shadow .15s; }
a.opp-card:hover { transform: translateY(-2px); border-color: #bfdbfe; box-shadow: 0 2px 4px rgba(15, 23, 42, .05), 0 12px 28px rgba(15, 23, 42, .08); }
.opp-cover { position: relative; aspect-ratio: 16 / 8; background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%); display: grid; place-items: center; overflow: hidden; }
.opp-cover.t-reo { background: linear-gradient(135deg, #0f172a 0%, #155e75 100%); }
.opp-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover-mark { font-size: 44px; font-weight: 800; letter-spacing: .08em; color: rgba(255, 255, 255, .14); }
.cover-chip { position: absolute; top: 12px; left: 12px; font-size: 13px; font-weight: 600; letter-spacing: .04em; padding: 3px 9px; border-radius: 99px; background: rgba(15, 23, 42, .72); color: #fff; backdrop-filter: blur(4px); }
.risk-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; padding: 3px 10px; border-radius: 99px; background: #fff; color: var(--ink-2); white-space: nowrap; }
.risk-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.risk-pill.r-bajo { color: #15803d; background: #f0fdf4; }
.risk-pill.r-medio { color: #b45309; background: #fffbeb; }
.risk-pill.r-alto { color: #b91c1c; background: #fef2f2; }
.risk-pill.big { font-size: 14.5px; padding: 6px 12px; }
.opp-cover .risk-pill { position: absolute; top: 12px; right: 12px; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.opp-body { padding: 16px 18px 18px; display: grid; gap: 10px; }
.opp-body h3 { font-size: 20px; }
.opp-loc { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14.5px; margin-top: -6px; }
.opp-loc svg { width: 14px; height: 14px; }
.opp-metrics { margin: 2px 0; display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid #f1f1ef; border-radius: 10px; }
.opp-metrics > div { padding: 8px 10px; display: grid; gap: 1px; }
.opp-metrics > div + div { border-left: 1px solid #f1f1ef; }
.opp-metrics dt { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.opp-metrics dd { margin: 0; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.opp-prog-l { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; margin-top: -4px; }
.opp-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14.5px; padding-top: 10px; border-top: 1px solid #f5f5f4; }

/* inversor: detalle */
.alert.preview { display: flex; align-items: center; gap: 8px; background: var(--accent-soft); color: var(--accent-ink); border: 1px solid #bfdbfe; }
.alert.preview svg { width: 16px; height: 16px; }
.opp-detail { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.opp-side { display: grid; gap: 16px; position: sticky; top: 16px; }
.opp-hero { overflow: hidden; }
.hero-img { display: block; width: 100%; max-height: 340px; object-fit: cover; }
.hero-kpis { margin: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.hero-kpis > div { padding: 14px 16px; display: grid; gap: 2px; border-left: 1px solid #f5f5f4; }
.hero-kpis > div:first-child { border-left: 0; }
.hero-kpis dt { font-size: 13px; color: var(--muted); }
.hero-kpis dd { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hero-kpis .hl dd { color: var(--accent-ink); }
.hero-prog { padding: 4px 16px 16px; display: grid; gap: 8px; }
.hero-prog .opp-prog-l { margin: 0; }
.lead { margin: 0; font-size: 16.5px; color: var(--ink-2); line-height: 1.55; }
.strategy { display: flex; gap: 8px; margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; background: #f8fafc; font-size: 15px; }
.strategy svg { width: 17px; height: 17px; color: var(--accent); flex: none; margin-top: 1px; }
.inv-kv { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.inv-kv > div { border-bottom: 1px solid #f5f5f4; }
.scen-t tr.best td { background: #f0fdf4; }
.scen-t tr.ref td { color: var(--muted); }
.inv-docs { display: grid; gap: 8px; }
a.doc-link { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); font-size: 15px; background: #fff; }
a.doc-link:hover { border-color: #bfdbfe; background: var(--accent-soft); }
a.doc-link svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
a.doc-link span { display: grid; min-width: 0; overflow-wrap: anywhere; }
a.doc-link small { color: var(--muted); font-size: 13px; }
a.doc-link.strong { border-color: #bfdbfe; background: var(--accent-soft); font-weight: 500; }
.locked { display: flex; gap: 12px; align-items: flex-start; padding: 6px 2px; }
.locked svg { width: 22px; height: 22px; color: var(--muted); flex: none; margin-top: 2px; }
.locked p { margin: 4px 0 0; }
.interest { border-color: #bfdbfe; box-shadow: 0 0 0 3px rgba(37, 99, 235, .06), var(--shadow); }
.input.big-in { font-size: 20px; font-weight: 600; padding: 12px 14px; font-variant-numeric: tabular-nums; }
.part-card .big-n { font-size: 28px; }

/* inversor: cartera */
.inv-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.inv-kpis .kpi .v { font-size: 26px; }
.cartera-links { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
a.mini-link { display: flex; align-items: center; gap: 10px; padding: 14px 18px; color: var(--ink); font-size: 15.5px; }
a.mini-link svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
a.mini-link .muted-link { margin-left: auto; }
.inv-pos { margin-bottom: 14px; overflow: hidden; }
.inv-pos-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 16px 18px 6px; }
.inv-pos-h h3 { font-size: 19px; }
.inv-pos-amt { display: grid; justify-items: end; text-align: right; }
.inv-pos-amt span { font-size: 22px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.inv-pos-amt small { color: var(--muted); font-size: 13.5px; }
.phase-line { list-style: none; margin: 8px 18px 12px; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); }
.phase-line li { position: relative; display: grid; justify-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); text-align: center; }
.phase-line li::before { content: ""; position: absolute; top: 6px; left: -50%; right: 50%; height: 2px; background: #e2e8f0; }
.phase-line li:first-child::before { display: none; }
.phase-line .dot { position: relative; z-index: 1; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid #cbd5e1; }
.phase-line li.done .dot { background: var(--accent); border-color: var(--accent); }
.phase-line li.done::before, .phase-line li.now::before { background: var(--accent); }
.phase-line li.now .dot { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(37, 99, 235, .15); background: #fff; }
.phase-line li.now { color: var(--ink); font-weight: 600; }
.inv-pos-grid { display: grid; grid-template-columns: 1fr 1fr 220px; border-top: 1px solid #f1f1ef; }
.ret { padding: 12px 18px 14px; }
.ret + .ret { border-left: 1px solid #f1f1ef; }
.ret h4 { margin: 0 0 6px; font-size: 13.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
.ret.real h4 { color: var(--ok); }
.ret dl { margin: 0; display: grid; gap: 4px; }
.ret dl > div { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; }
.ret dt { color: var(--muted); }
.ret dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.inv-pos-links { display: grid; gap: 6px; padding: 12px 14px; border-left: 1px solid #f1f1ef; background: #fcfcfb; align-content: start; }
.inv-pos-links a.doc-link { padding: 6px 10px; font-size: 14.5px; }

@media (max-width: 1280px) {
  .hero-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-kpis > div:nth-child(4) { border-left: 0; }
  .hero-kpis > div { border-bottom: 1px solid #f5f5f4; }
  .inv-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .opp-detail { grid-template-columns: 1fr; }
  .opp-side { position: static; }
  .inv-pos-grid { grid-template-columns: 1fr 1fr; }
  .inv-pos-links { grid-column: 1 / -1; border-left: 0; border-top: 1px solid #f1f1ef; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}
@media (max-width: 640px) {
  .opp-grid { grid-template-columns: 1fr; gap: 14px; }
  .cat-filters .input.sm { max-width: none; flex: 1 1 140px; }
  .cat-filters .chips { flex: 1 1 100%; }
  .hero-kpis { grid-template-columns: 1fr 1fr; }
  .hero-kpis > div { border-left: 0; }
  .hero-kpis > div:nth-child(even) { border-left: 1px solid #f5f5f4; }
  .hero-kpis dd { font-size: 17px; }
  .inv-kv { grid-template-columns: 1fr 1fr; }
  .scen-t thead { display: none; }
  .scen-t, .scen-t tbody, .scen-t tr, .scen-t td { display: block; width: 100%; }
  .scen-t tr { padding: 10px 14px; border-bottom: 1px solid #f1f1ef; }
  .scen-t td { border: 0 !important; padding: 2px 0 !important; text-align: left; }
  .scen-t td[data-l]:not(:first-child) { display: flex; justify-content: space-between; }
  .scen-t td[data-l]:not(:first-child)::before { content: attr(data-l); color: var(--muted); font-size: 14px; }
  .scen-t td:first-child { font-weight: 600; margin-bottom: 4px; }
  .inv-kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .inv-kpis .kpi { padding: 14px; }
  .inv-kpis .kpi .v { font-size: 20px; }
  .inv-kpis .kpi .n { font-size: 12.5px; }
  .inv-kpis .kpi:last-child { grid-column: 1 / -1; }
  .cartera-links { grid-template-columns: 1fr; gap: 10px; }
  .inv-pos-h { flex-direction: column; gap: 6px; }
  .inv-pos-amt { justify-items: start; text-align: left; }
  .phase-line { margin: 8px 8px 12px; }
  .phase-line li { font-size: 11.5px; }
  .inv-pos-grid { grid-template-columns: 1fr; }
  .ret + .ret { border-left: 0; border-top: 1px solid #f1f1ef; }
  .inv-pos-links { grid-template-columns: 1fr 1fr 1fr; }
  .opp-form .form-row.two-one, .opp-form .form-row.three { grid-template-columns: 1fr; }
  .req-row { flex-direction: column; }
  .req-side { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .mini-dl.two { grid-template-columns: 1fr; }
  .opp-dash .npl-dash-b { grid-template-columns: 1fr 1fr; }
}

/* fase 8: ajustes tras revisión visual */
table.t th.r { text-align: right; }
.scen-t td.r { white-space: nowrap; }
.page-fine { margin-top: 12px; }
.mobile-cta { display: none; text-align: center; }
@media (max-width: 1100px) { .mobile-cta { display: block; margin-top: 4px; } }
@media (max-width: 640px) {
  .inv-pos-links { display: flex; flex-wrap: wrap; }
  .inv-pos-links a.doc-link { flex: 1 1 auto; justify-content: center; }
  .inv-pos-links a.doc-link small { display: none; }
  .dist-t thead { display: none; }
  .dist-t, .dist-t tbody { display: block; }
  .dist-t tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "o i" "f c"; gap: 2px 12px; padding: 10px 16px; border-bottom: 1px solid #f5f5f4; }
  .dist-t td { padding: 0 !important; border: 0 !important; }
  .dist-t .d-o { grid-area: o; font-weight: 500; }
  .dist-t .d-i { grid-area: i; font-weight: 600; }
  .dist-t .d-f { grid-area: f; color: var(--muted); font-size: 14px; }
  .dist-t .d-c { grid-area: c; color: var(--muted); font-size: 14px; text-align: right; }
}
.ficha > .side-col { grid-template-columns: minmax(0, 1fr); min-width: 0; }
.ficha .side-col table.t td { overflow-wrap: anywhere; }
.ficha .side-col table.t td:first-child { padding-right: 8px; }
.ficha .side-col table.t td.r { padding-left: 8px; }
.ficha .side-col .pill-status { white-space: normal; text-align: left; }

/* ---------------------------------------------- portal inversor: % socios, cancelada y correos (29/10) */
.socios-line { margin: 2px 0 8px; font-size: 14px; color: var(--ink-2); font-weight: 500; }
.socios-line.big { font-size: 15px; margin: 0 0 8px; }
.socios-calc { margin: -6px 0 2px; color: var(--accent-ink); font-weight: 500; min-height: 1em; }
.alert.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid #fde68a; }
.mail-banner { display: flex; align-items: center; gap: 8px; }
.mail-banner svg { width: 18px; height: 18px; flex: none; }
.phase-cancel { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 18px 12px; padding: 10px 12px; border-radius: 10px; background: #f8fafc; border: 1px dashed var(--line); }
.mail-t .mail-subj { color: var(--ink-2); margin-top: 4px; max-width: 420px; }
.mail-t .mail-err { color: var(--bad); margin-top: 4px; max-width: 320px; overflow-wrap: anywhere; }
.mail-t td { vertical-align: top; }
.mail-t .mail-actions form { margin-left: 4px; }
.pref-card .check { display: flex; gap: 10px; align-items: flex-start; }
.pref-card .check input { margin-top: 3px; }
@media (max-width: 640px) {
  .mail-t thead { display: none; }
  .mail-t tr { display: grid; grid-template-columns: 1fr; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .mail-t td { border: 0; padding: 3px 14px; text-align: left; }
  .mail-t td.r { text-align: left; }
}
.socios-calc { margin: 2px 0 6px; }
.inv-sees { margin: 2px 0 6px; padding: 6px 8px; background: #f8fafc; border-radius: 8px; }

/* ---------- dashboard: negocio (parte económica, gestores, conversión) */
.biz-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 6px 0 12px; }
.biz-head h2 { font-size: 20px; }
.biz-grid { margin-bottom: 16px; align-items: start; }
.biz-stack { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.biz-grid > .card { min-width: 0; }
.biz-st .pill-status { max-width: 100%; }
.biz-tw { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
.biz-table { min-width: 860px; table-layout: fixed; width: 100%; }
.biz-table col.c-op { width: 18%; } .biz-table col.c-tipo { width: 14%; } .biz-table col.c-dir { width: 24.5%; }
.biz-table col.c-st { width: 18.5%; } .biz-table col.c-num { width: 9%; } .biz-table col.c-pct { width: 7%; }
.biz-table td, .biz-table th { white-space: nowrap; }
.biz-table td.ell { overflow: hidden; text-overflow: ellipsis; }
.biz-table td .pill-status { max-width: 100%; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: middle; }
.biz-eco .card-h { flex-wrap: wrap; gap: 8px; }
.biz-st { display: flex; flex-wrap: wrap; gap: 6px; }
.biz-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.biz-metrics > div { display: grid; gap: 2px; min-width: 0; }
.biz-k { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.biz-v { font-size: 19px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.biz-v.ok, td.ok { color: var(--ok); }
.biz-v.bad { color: var(--bad); }
.biz-note { margin: 10px 0 0; }
.biz-table { margin-top: 4px; }
.biz-table td { vertical-align: middle; }
.biz-table .pill-status { font-size: 13px; }
.biz-more { display: inline-block; margin-top: 10px; }
.biz-warn { color: var(--warn); font-weight: 500; }
.biz-legend { display: flex; gap: 16px; font-size: 13.5px; color: var(--muted); margin-bottom: 12px; }
.biz-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.biz-gbars { display: grid; gap: 12px; }
.biz-grow { display: grid; grid-template-columns: 150px 1fr 70px; align-items: center; gap: 12px; font-size: 15px; }
.biz-gname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.biz-gtrack { position: relative; display: flex; height: 16px; background: #f1f5f9; border-radius: 6px; overflow: visible; }
.biz-gseg { height: 100%; }
.biz-gseg:first-child { border-radius: 6px 0 0 6px; }
.biz-gseg:last-of-type { border-radius: 0 6px 6px 0; }
.biz-gavg { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); opacity: .55; border-radius: 2px; }
.biz-gn { text-align: right; font-variant-numeric: tabular-nums; }
.biz-conv { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.biz-pct { font-size: 40px; font-weight: 650; letter-spacing: -.02em; color: var(--accent); line-height: 1; }
.biz-funnel .bar-row { grid-template-columns: 190px 1fr 40px; }
@media (max-width: 1200px) { .biz-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .biz-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .biz-grow { grid-template-columns: 100px 1fr 56px; }
  .biz-funnel .bar-row { grid-template-columns: 120px 1fr 32px; }
  .biz-conv { flex-direction: column; align-items: flex-start; }
}

/* ---- Páginas legales públicas y enlaces legales ---- */
.legal-wrap{max-width:820px;margin:0 auto;padding:40px 24px 64px}
.legal-wrap .wordmark{font-size:28px;margin-bottom:4px}
.legal-wrap h1{font-size:28px;margin:18px 0 4px}
.legal-wrap h2{font-size:18px;margin:32px 0 8px}
.legal-wrap p,.legal-wrap li{line-height:1.65;color:#1e293b}
.legal-wrap .meta{color:#64748b;font-size:14px;margin:0 0 8px}
.legal-wrap table{width:100%;border-collapse:collapse;margin:12px 0;font-size:15px}
.legal-wrap th,.legal-wrap td{border:1px solid #e2e8f0;padding:8px 10px;text-align:left;vertical-align:top}
.legal-wrap th{background:#f1f5f9}
.legal-wrap .todo{background:#fef3c7;border-radius:4px;padding:0 4px}
.legal-nav{display:flex;flex-wrap:wrap;gap:6px 18px;margin:14px 0 6px;font-size:15px}
.legal-nav a{color:#2563eb;text-decoration:none}.legal-nav a:hover{text-decoration:underline}
.legal-foot{display:flex;flex-wrap:wrap;gap:4px 12px;justify-content:center;margin-top:18px;font-size:13px}
.legal-foot a{color:#64748b;text-decoration:none}.legal-foot a:hover{color:#2563eb;text-decoration:underline}
.side .legal-foot{justify-content:flex-start;padding:10px 18px 14px;margin:0}
.side .legal-foot a{color:#94a3b8}
.shell.compact .side .legal-foot{display:none}
.stack > .card { margin-bottom: 16px; }
.stack .btn { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.stack .btn svg { width: 16px; height: 16px; }

/* Contactos: ficha desplegable */
.more { margin-top: 4px; } .more summary { cursor: pointer; color: var(--accent-ink); }
.more div { margin-top: 3px; max-width: 520px; white-space: normal; }

/* ---------------------------------------------------------- tareas de los socios */
.task-table tr.is-done td { opacity: .55; }
.task-table tr.is-done .strong { text-decoration: line-through; }
.task-table .status-select { max-width: 150px; }
.task-modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(15, 23, 42, .45); backdrop-filter: blur(2px); }
.task-modal-card { width: min(520px, 100%); background: var(--card); border-radius: 16px; padding: 24px; box-shadow: 0 20px 60px rgba(15, 23, 42, .25); }
.task-modal-h { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.task-modal-h h2 { font-size: 19px; margin: 0 0 3px; }
.task-modal-ic { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); }
.task-modal-ic svg { width: 20px; height: 20px; }
.task-modal-label { margin: 6px 0; }
.task-modal-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.task-modal-list li { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid var(--bad); border-radius: 10px; background: #fff; }
.task-card .task-modal-list { padding: 14px 18px; }
.task-card .task-modal-list li { flex-direction: row; align-items: center; gap: 10px; }
.task-card .task-modal-list li .muted { margin-left: auto; }
.task-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.task-row { cursor: pointer; }
/* Lo editable se pulsa directamente (sin botón «Editar») */
[data-edit-href], [data-toggle-details] { cursor: pointer; border-radius: 8px; transition: background-color .12s; }
[data-edit-href]:hover, [data-edit-href]:focus-visible, [data-toggle-details]:hover { background-color: #f6f8fc; }
tr[data-edit-href]:hover td { background: #f6f8fc; }
.op-delete { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line, #ebe8e2); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.task-row:hover td { background: #fafaf8; }
.task-link { color: var(--ink); text-decoration: none; font-weight: 600; }
.task-link:hover { color: var(--accent-ink); }
.task-snip { margin-top: 3px; max-width: 520px; }
.task-desc { line-height: 1.6; color: var(--ink-2); overflow-wrap: anywhere; }
.task-desc p { margin: 0 0 10px; }
.task-desc h3 { font-size: 17px; margin: 14px 0 6px; color: var(--ink); }
.task-desc .desc-list { margin: 0 0 10px; padding-left: 20px; }
.task-desc blockquote { margin: 0 0 10px; padding-left: 12px; border-left: 3px solid var(--line); color: var(--muted); }
.task-desc a { color: var(--accent-ink); }
.mini-dl.task-dl { grid-template-columns: max-content minmax(0, 1fr); gap: 12px 16px; align-items: center; margin: 0; }
.mini-dl.task-dl dd { justify-self: end; text-align: right; }
.task-detail { align-items: start; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 900px) { .task-detail { grid-template-columns: 1fr; } }
.task-form textarea { width: 100%; resize: vertical; }

.ficha > .main-col { display: grid; gap: 16px; min-width: 0; }

/* ficha: «Visitas de campo» vive en la columna lateral (estrecha) */
.side-col .visit-form .form-row { grid-template-columns: 1fr; }
.side-col .visit-form .form-row .field { min-width: 0; }
.side-col .photos img { max-width: 100%; }

.contact-list li { border-left-color: #d9730d; padding: 0; }
.contact-list li a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; color: inherit; text-decoration: none; border-radius: 10px; }
.contact-list li a:hover { background: #fafaf8; }
.contact-list li a .muted { margin-left: auto; }
.task-modal-card { max-height: 88vh; overflow: auto; }
/* Resumen diario compacto (Sergio 31/10): filas de una línea, secciones con cabecera clicable */
.tm-compact { width: min(500px, 100%); padding: 16px 18px 14px; }
.tm-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.tm-head .task-modal-ic { width: 32px; height: 32px; border-radius: 10px; }
.tm-head .task-modal-ic svg { width: 17px; height: 17px; }
.tm-head h2 { font-size: 17px; margin: 0; flex: 1; min-width: 0; }
.tm-x { border: 0; background: none; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; padding: 2px 6px; border-radius: 8px; }
.tm-x:hover { background: #f5f5f4; color: var(--ink); }
.tm-sec { padding: 8px 0; border-top: 1px solid #f0ede7; }
.tm-sec-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; color: var(--ink); font-weight: 600; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; }
.tm-sec-h:hover { color: var(--accent); }
.tm-n { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muted); }
.tm-row { display: flex; align-items: center; gap: 10px; padding: 5px 10px; margin: 2px 0; border-left: 3px solid var(--line); border-radius: 6px; color: inherit; min-width: 0; }
.tm-row:hover { background: #faf9f6; }
.tm-row.bad { border-left-color: var(--bad); }
.tm-row.warn { border-left-color: #d9730d; }
.tm-row b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.tm-meta { flex: none; font-size: 14px; color: var(--muted); }
.tm-more { font-size: 14px; color: var(--muted); padding: 2px 13px 0; }
.tm-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.tm-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px 5px 6px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); }
.tm-chip:hover { border-color: var(--accent); }
.tm-compact .task-modal-actions { margin-top: 10px; }

/* dashboard: contactar (izquierda) | tareas (derecha), 50/50 */
.grid-halves { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.dash-todo { margin-bottom: 16px; }
.dash-todo > .card { min-width: 0; }
.dash-todo .task-modal-list { grid-template-columns: minmax(0, 1fr); }
.dash-todo .task-modal-list li, .dash-todo .contact-list li a { min-width: 0; }
.dash-todo .contact-list li a b, .dash-tasks .task-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.dash-tasks .task-t { font-weight: 400; }
.dash-todo .contact-list li a .tag, .dash-todo .contact-list li a .muted { flex: none; }
.dash-tasks li { border-left-color: var(--line); }
.dash-tasks li.prio-alta { border-left-color: var(--bad); }
.dash-tasks li.prio-media { border-left-color: #d9730d; }
@media (max-width: 900px) { .grid-halves { grid-template-columns: minmax(0, 1fr); } }


/* ------------------------------------------------- inmobiliaria: Valorador + Calibración (ROADMAP 9) */
.inmo-chips { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.inmo-chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 12px; border-radius: 99px; background: #fff; border: 1px solid var(--line); color: var(--ink); white-space: nowrap; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.inmo-chip:hover { border-color: #c7c2b8; }
.inmo-chip .k { font-size: 13.5px; color: var(--muted); }
.inmo-chip b { font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; }
.inmo-chip .of { font-size: 13.5px; color: var(--muted); }
.inmo-chip.ok { background: var(--ok-soft); border-color: #bbf7d0; }
.inmo-chip.ok b { color: var(--ok); }
.inmo-chip.bad { background: var(--bad-soft); border-color: #fecaca; }
.inmo-chip.bad b, .inmo-chip.low b { color: var(--bad); }
.rv-bar .inmo-chip { padding: 3px 10px; }
.rv-bar .inmo-chip b { font-size: 15.5px; }
.alert.info { background: var(--accent-soft); color: var(--accent-ink); border: 1px solid #bfdbfe; }
.calib-banner { display: flex; gap: 12px; align-items: flex-start; border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; font-size: 15.5px; }
.calib-banner svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.calib-banner.bad { background: var(--bad-soft); color: #7f1d1d; border: 1px solid #fecaca; }
.calib-banner.bad svg { color: var(--bad); }
.calib-banner.warn { background: var(--warn-soft); color: #78350f; border: 1px solid #fde68a; }
.calib-banner.warn svg { color: var(--warn); }
.calib-top { margin-bottom: 16px; }
.calib-top > .card { min-width: 0; height: 100%; }
.calib-form .field { margin-bottom: 14px; }
.calib-form .form-row { margin-bottom: 14px; }
.calib-form .form-row .field { margin: 0; }
.mono-in { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .03em; text-transform: uppercase; }
.money-in { position: relative; }
.money-in .input { padding-right: 34px; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.money-in span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 500; }
.calib-def { background: #f8f7f4; border-left: 3px solid var(--accent); padding: 6px 10px; border-radius: 0 8px 8px 0; color: var(--ink-2); }
.seg-field { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.seg-field legend { font-size: 14px; font-weight: 500; color: var(--ink-2); padding: 0; margin-bottom: 6px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid #d6d3d1; border-radius: 10px; overflow: hidden; background: #fff; }
.seg-opt { position: relative; cursor: pointer; }
.seg-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg-opt span { display: block; text-align: center; padding: 10px 8px; font-weight: 500; color: var(--ink-2); transition: background .12s; }
.seg-opt + .seg-opt span { border-left: 1px solid #d6d3d1; }
.seg-opt input:checked + span { background: var(--ink); color: #fff; }
.seg-opt input:focus-visible + span { box-shadow: inset 0 0 0 3px rgba(37, 99, 235, .35); }
.has-err .seg { border-color: #f87171; }
.calib-foot { margin: 10px 0 0; text-align: center; }
.quota-n { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.quota-n b { font-size: 40px; font-weight: 650; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.quota-n span { color: var(--muted); }
.quota-bar { height: 10px; background: #efece6; border-radius: 99px; overflow: hidden; margin: 10px 0 14px; }
.quota-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #3b82f6); border-radius: 99px; }
.quota-facts { margin: 0 0 16px; padding-left: 18px; display: grid; gap: 6px; font-size: 15px; color: var(--ink-2); }
.calib-rules { background: #f8f7f4; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 14.5px; color: var(--ink-2); }
.calib-rules ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.calib-t td { vertical-align: top; }
.calib-t tr.off td { opacity: .55; }
.calib-entries td.near { color: var(--warn); font-weight: 600; }
.calib-entries th, .calib-entries td { padding-left: 8px; padding-right: 8px; white-space: nowrap; }
.calib-entries th:first-child, .calib-entries td:first-child { padding-left: 18px; }
.calib-entries th:last-child, .calib-entries td:last-child { padding-right: 18px; }
.calib-entries td.ell { max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.calib-entries .why { white-space: normal; min-width: 180px; }
.calib-entries .why .small { margin-top: 2px; line-height: 1.3; }
.calib-retry { display: block; margin-top: 6px; }
.calib-retry .btn { white-space: nowrap; }
.mono-in::placeholder { font-family: Outfit, system-ui, sans-serif; text-transform: none; letter-spacing: 0; }
.rv-bar .inmo-chip { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .16); color: #fff; box-shadow: none; }
.rv-bar .inmo-chip:hover { border-color: rgba(255, 255, 255, .32); }
.rv-bar .inmo-chip .k, .rv-bar .inmo-chip .of { color: #94a3b8; }
.rv-bar .inmo-chip.ok { background: rgba(21, 128, 61, .22); border-color: rgba(134, 239, 172, .35); }
.rv-bar .inmo-chip.ok b { color: #86efac; }
.rv-bar .inmo-chip.bad { background: rgba(185, 28, 28, .25); border-color: rgba(252, 165, 165, .35); }
.rv-bar .inmo-chip.bad b, .rv-bar .inmo-chip.low b { color: #fca5a5; }
.calib-next { border-top: 1px solid var(--line); }
.calib-next code { font-size: 13px; background: #f5f5f4; padding: 1px 5px; border-radius: 5px; }
.calib-kpis { margin-bottom: 16px; }
.lock-card { max-width: 620px; margin: 24px auto; padding: 32px 32px 26px; text-align: center; }
.lock-card .lock-ic { width: 56px; height: 56px; border-radius: 16px; background: var(--bad-soft); color: var(--bad); display: grid; place-items: center; margin: 0 auto 14px; }
.lock-card .lock-ic svg { width: 26px; height: 26px; }
.lock-card h2 { font-size: 22px; margin-bottom: 8px; }
.lock-card p { color: var(--ink-2); margin: 0 0 16px; }
.lock-progress { text-align: left; background: #f8f7f4; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 2px; margin: 0 0 18px; }
.lock-progress .quota-n b { font-size: 30px; }
.lock-card .btn { display: inline-flex; align-items: center; gap: 8px; }
.lock-card .btn svg { width: 16px; height: 16px; }
.lock-card .muted { margin: 14px 0 0; }
.draft-banner { background: var(--warn-soft); border: 1px solid #fde68a; color: #78350f; padding: 12px 14px; border-radius: 10px; }
@media (max-width: 900px) {
  .inmo-chips { margin-left: 0; width: 100%; }
  .rv-bar .inmo-chips { width: auto; }
}
@media (max-width: 640px) {
  .inmo-chip .k { font-size: 13px; }
  .inmo-chip .k-long { display: none; }
  .inmo-chips { flex-wrap: nowrap; }
  .calib-t thead { display: none; }
  table.t.calib-t, .calib-t tbody, .calib-t tr { display: block; width: 100%; }
  .calib-t tr { padding: 10px 16px; border-bottom: 1px solid var(--line); }
  .calib-t tr:last-child { border-bottom: 0; }
  table.t.calib-t td { display: block; position: relative; padding: 3px 0 3px 104px; border: 0; text-align: left; white-space: normal; min-height: 24px; max-width: none; }
  table.t.calib-t td::before { content: attr(data-l); position: absolute; left: 0; top: 5px; width: 96px; color: var(--muted); font-size: 13.5px; line-height: 1.3; }
  table.t.calib-t td[data-l=""] { padding-left: 0; }
  table.t.calib-t td[data-l=""]:empty { display: none; }
  table.t.calib-t td[data-l=""]::before { content: none; }
  .calib .card-h { flex-wrap: wrap; gap: 4px 10px; }
  .lock-card { padding: 24px 18px 20px; margin: 8px auto; }
  .quota-n b { font-size: 32px; }
}

/* ------------------------------------------------ Contactos · Bancos */
.bk-bar .bk-sort { display: flex; gap: 6px; flex-wrap: wrap; }
.contact-form.bank-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
table.bank-t { table-layout: fixed; width: 100%; }
table.bank-t col.c-who { width: 22%; }
table.bank-t col.c-pos { width: 16%; }
table.bank-t col.c-tel { width: 132px; }
table.bank-t col.c-mail { width: 24%; }
table.bank-t col.c-off { width: auto; }
table.bank-t col.c-act { width: 150px; }
table.bank-t td { vertical-align: top; }
table.bank-t td.bk-email, table.bank-t td.bk-office, table.bank-t td.bk-pos { overflow-wrap: anywhere; }
.bk-sub { color: var(--muted); font-size: 14px; margin-top: 3px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bk-sub .tag { font-size: 12.5px; }
.bk-note { margin-top: 5px; padding: 5px 9px; border-left: 2px solid #cbd5e1; background: #f8fafc; border-radius: 0 6px 6px 0; color: var(--ink-2); font-size: 14px; }
table.bank-t tr.bk-head th { background: #f6f4f0; color: var(--ink); font-size: 15.5px; font-weight: 600; padding: 9px 18px; border-top: 1px solid var(--line); letter-spacing: .01em; }
table.bank-t tbody.bk-group:first-of-type tr.bk-head th { border-top: 0; }
.bk-head .bk-bank { margin-right: 6px; }
table.bank-t tr:not(.bk-head):not(.editing):hover td { background: #fbfaf8; }
@media (max-width: 760px) {
  table.bank-t, table.bank-t tbody, table.bank-t tr, table.bank-t td { display: block; width: 100%; }
  table.bank-t colgroup, table.bank-t thead { display: none; }
  table.bank-t tr:not(.bk-head):not(.editing) { padding: 10px 14px; border-bottom: 1px solid #f1efeb; }
  table.bank-t td { border: 0; padding: 3px 0 3px 84px; position: relative; min-height: 22px; }
  table.bank-t td::before { content: attr(data-l); position: absolute; left: 0; top: 4px; width: 78px; color: var(--muted); font-size: 13.5px; }
  table.bank-t td[data-l="Contacto"] { padding-left: 0; }
  table.bank-t td[data-l="Contacto"]::before, table.bank-t td[data-l=""]::before { content: none; }
  table.bank-t td[data-l=""] { padding-left: 0; text-align: left; margin-top: 6px; }
  table.bank-t tr.bk-head th { display: block; }
  table.bank-t tr.editing td { padding: 14px; }
  .contact-form.bank-form { grid-template-columns: 1fr; }
}

/* ====================================================================== Móvil (≤900 px, Sergio 31/10)
   Barra superior fija (marca + sección + ☰) → cajón lateral superpuesto; barra inferior por rol (main.MOBILE_TABS).
   Reglas: sin scroll horizontal de página, controles ≥40 px, campos a 16 px (iOS no hace zoom), formularios en una
   columna. El escritorio (>900 px) no cambia: todo lo de aquí vive dentro de esta media query. */
@media (max-width: 900px) {
  :root { --mbar-h: 56px; --tabbar-h: 0px; --gut-m: 16px; }
  body.has-tabbar { --tabbar-h: 62px; }
  html { scroll-padding-top: calc(var(--mbar-h) + 12px); }
  body.nav-open { overflow: hidden; }

  .mbar { display: flex; align-items: center; gap: 12px; position: fixed; top: 0; left: 0; right: 0; z-index: 1050;
    height: calc(var(--mbar-h) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) max(6px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
    background: var(--side); color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, .05), 0 6px 18px rgba(15, 23, 42, .16); }
  .mbar-brand { font-size: 20px; color: #fff; flex: none; padding: 8px 0; }
  .mbar-title { flex: 1 1 auto; min-width: 0; padding-left: 12px; border-left: 1px solid #334155; font-size: 17px; font-weight: 500;
    color: #e2e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mbar-btn { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 11px;
    background: transparent; color: #e2e8f0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .mbar-btn:active, .mbar-btn[aria-expanded="true"] { background: var(--side-2); }
  .mbar-btn svg { width: 24px; height: 24px; }

  .shell, .shell.compact { grid-template-columns: minmax(0, 1fr); background: none;
    padding-top: calc(var(--mbar-h) + env(safe-area-inset-top)); padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }

  /* El menú (normal y compacto) es el mismo cajón */
  .nav-scrim { display: block; position: fixed; inset: 0; z-index: 1090; background: rgba(2, 6, 23, .52); backdrop-filter: blur(1.5px);
    animation: nx-fade .2s ease; }
  .nav-scrim[hidden] { display: none; }
  .shell .side, .shell.compact .side, .shell.compact.side-open .side { position: fixed; top: 0; bottom: 0; left: 0; z-index: 1100;
    width: min(320px, 86vw); height: auto; flex-direction: column; flex-wrap: nowrap; align-items: stretch;
    overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; visibility: hidden; transform: translateX(-102%);
    transition: transform .22s ease, visibility 0s .22s; box-shadow: none;
    padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom) env(safe-area-inset-left); }
  body.nav-open .shell .side { visibility: visible; transform: none; transition: transform .24s cubic-bezier(.2, .8, .2, 1);
    box-shadow: 16px 0 48px rgba(2, 6, 23, .45); }
  .shell .side .brand, .shell.compact .side .brand, .shell.compact.side-open .side .brand { padding: 20px 64px 14px 22px; text-align: left; }
  .shell .side .brand .wordmark, .shell.compact .side .brand .wordmark { font-size: 26px; letter-spacing: .06em; }
  .shell.compact .side .brand .byline { display: block; }
  .side-close { display: grid; place-items: center; position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 10px;
    width: 44px; height: 44px; border: 0; border-radius: 11px; background: transparent; color: #cbd5e1; cursor: pointer; }
  .side-close:active, .side-close:hover { background: var(--side-2); color: #fff; }
  .side-close svg { width: 22px; height: 22px; }
  .shell.compact .side-toggle { display: none; }
  .shell .nav, .shell.compact .nav, .shell.compact.side-open .nav { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 4px 12px 8px; width: auto; }
  .shell .nav-label, .shell.compact .nav-label { display: block; padding: 16px 12px 6px; }
  .shell .nav a, .shell.compact .nav a, .shell.compact.side-open .nav a { justify-content: flex-start; min-height: 46px; padding: 10px 12px; font-size: 16.5px; border-radius: 10px; }
  .shell.compact .nav a span { display: inline; }
  .shell .nav a svg { width: 20px; height: 20px; }
  .shell .side .legal-foot, .shell.compact .side .legal-foot { display: flex; padding: 10px 22px 12px; gap: 6px 14px; }
  .shell .side .legal-foot a { padding: 4px 0; }
  .shell .me, .shell.compact .me, .shell.compact.side-open .me { order: 0; margin: auto 0 0; flex-direction: row; justify-content: flex-start;
    padding: 14px 14px 14px 20px; border-top: 1px solid var(--side-2); }
  .shell.compact .me .who { display: block; }
  .shell.compact .me form, .shell .me form { margin-left: auto; }
  .shell .me .avatar { width: 38px; height: 38px; }
  .shell .me .icon-btn { width: 44px; height: 44px; place-items: center; }
  .shell .me .icon-btn svg { width: 20px; height: 20px; }

  /* Barra inferior */
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 1040;
    padding: 5px max(4px, env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left));
    background: rgba(255, 255, 255, .97); backdrop-filter: saturate(1.4) blur(10px); border-top: 1px solid var(--line);
    box-shadow: 0 -6px 18px rgba(15, 23, 42, .06); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; min-height: 52px;
    color: var(--muted); font-size: 12.5px; font-weight: 500; letter-spacing: -.005em; border-radius: 12px; -webkit-tap-highlight-color: transparent; }
  .tabbar a svg { width: 52px; height: 28px; padding: 3px 15px; border-radius: 99px; transition: background .15s, color .15s; }
  .tabbar a span { max-width: 100%; padding: 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tabbar a.active { color: var(--accent-ink); font-weight: 600; }
  .tabbar a.active svg { background: var(--accent-soft); color: var(--accent); }
  .tabbar a:active svg { background: #e2e8f0; }

  /* Lo que se pegaba a top:0 ahora va bajo la barra fija; lo que va abajo, sobre la barra inferior */
  body .rv-bar { position: static; }
  .toolbar { top: calc(var(--mbar-h) + env(safe-area-inset-top)); }
  .opp-side, .mail-folders, .doc-body.with-text .doc-text { position: static; max-height: none; }
  .toast { bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom)); max-width: calc(100vw - 32px); }
  .task-modal { z-index: 1200; padding: 12px; }
  body .peek { z-index: 1150; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  body .pp-pop { z-index: 1160; }
  body .peek-btn { min-height: 42px; min-width: 42px; justify-content: center; }

  /* Página: cabecera y márgenes */
  .topbar, .content { padding-left: var(--gut-m); padding-right: var(--gut-m); }
  .topbar { padding-top: 18px; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; }
  .topbar > div:first-child { min-width: 0; flex: 1 1 220px; }
  .topbar > div:last-child { flex-wrap: wrap; }
  .topbar h1 { overflow-wrap: anywhere; }
  .content { padding-top: 18px; padding-bottom: 28px; }

  /* Controles: táctiles y sin zoom de iOS */
  .input, select.input, textarea.input, .content input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), .content select, .content textarea { font-size: 16px; }
  .input, select.input { min-height: 44px; }
  .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
  .btn.small { min-height: 40px; padding: 8px 12px; font-size: 15px; }
  .form-row, .contact-form { grid-template-columns: minmax(0, 1fr); }
  .card-h { flex-wrap: wrap; gap: 8px; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .kpi { padding: 14px; min-width: 0; }
  .kpi .v { overflow-wrap: anywhere; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 380px) { .kpis { grid-template-columns: minmax(0, 1fr); } }
@keyframes nx-fade { from { opacity: 0; } to { opacity: 1; } }
/* Móvil · controles concretos: tamaño táctil y 16 px en campos (los .sm y selects de estado venían a 13,5–15,5 px).
   Prefijo `body` para ganar a las hojas de cada página (reo/valorador/visita/ops_panel.css se cargan después). */
@media (max-width: 900px) {
  body .input.sm, body select.input.sm, body input.input.sm, body .status-select, body .status-select.big, body .v-searchrow input,
  body .content input:not([type]), body .content input[type=text], body .content input[type=search], body .content input[type=email],
  body .content input[type=tel], body .content input[type=number], body .content input[type=date], body .content input[type=password],
  body .content input[type=url], body .content select, body .content textarea { font-size: 16px; }
  body .input.sm, body select.input.sm { min-height: 42px; }
  body .status-select { min-height: 40px; padding: 6px 28px 6px 12px; background-position: right 10px center; }
  body .seg a, body .tabs a, body .chip, body .seg-radio label, body .vl-tabs a { min-height: 42px; display: inline-flex; align-items: center; }
  body .tabs, body .chips, body .vl-tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
  .tabs::-webkit-scrollbar, .chips::-webkit-scrollbar, .vl-tabs::-webkit-scrollbar { display: none; }
  body .tabs a, body .chip { flex: none; white-space: nowrap; }
  body .tm-x { width: 42px; height: 42px; display: grid; place-items: center; font-size: 26px; }
  body .pp-pencil { opacity: 1; width: 40px; height: 40px; margin-top: 0; }
  body .v-searchrow input, body .v-searchrow .rv-btn { height: 46px; }
  body .rv-btn { min-height: 42px; }
  body .more summary, body .email-change summary { min-height: 40px; display: flex; align-items: center; gap: 6px; }
  :where(details) > :where(summary) { padding-block: 9px; }
  body .legal-foot a, body .legal-nav a { padding: 9px 0; }
  body textarea.input, body textarea#notes { min-height: 44px; }
}
/* Móvil · Operaciones: barra de filtros en rejilla y la Tabla como tarjetas (nombre + status arriba, datos en 2 columnas). */
@media (max-width: 900px) {
  body .ops-bar { gap: 10px; }
  body .ops-bar > .seg { flex: 1 1 auto; }
  body .ops-bar > .seg a { flex: 1; justify-content: center; }
  body .ops-filters { margin-left: 0; width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  body .ops-filters select { width: 100%; min-width: 0; }
  body .ops-filters .search, body .ops-filters .check, body .ops-filters .muted-link { grid-column: 1 / -1; width: 100%; }
  body .ops-filters .check { min-height: 40px; display: flex; align-items: center; gap: 8px; }
  body .ops-filters .check input { width: 20px; height: 20px; }
  body .ops-filters .muted-link { padding: 8px 0; }
  .card.table-wrap:has(> .ops-table) { overflow: visible; background: transparent; border: 0; box-shadow: none; }
  table.t.ops-table thead { display: none; }
  table.t.ops-table, table.t.ops-table tbody { display: block; }
  table.t.ops-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; padding: 14px 16px; margin-bottom: 10px;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
  table.t.ops-table td, table.t.ops-table td.small { display: block; padding: 0; border: 0; min-width: 0; max-width: none; text-align: left; font-size: 15.5px; overflow-wrap: anywhere; white-space: normal; }
  table.t.ops-table td::before { content: attr(data-label); display: block; font-size: 12.5px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 1px; }
  table.t.ops-table td.c-name { grid-column: 1 / -1; font-size: 17.5px; font-weight: 600; }
  table.t.ops-table td.c-name::before, table.t.ops-table td.c-status::before { content: none; }
  table.t.ops-table td.c-name .op-link { display: block; padding: 2px 0; color: var(--ink); white-space: normal; }
  table.t.ops-table td.c-status { grid-column: 1 / -1; grid-row: 2; }
  table.t.ops-table td.c-wide { grid-column: 1 / -1; }
  table.t.ops-table td.nil { display: none; }
  table.t.ops-table td.mono { font-size: 14.5px; }
}
/* Móvil · listas como tarjetas: `table.t.t-cards` (etiquetas desde <th> vía base.html). 1.ª celda = título; la celda
   con botones/formularios = acciones a lo ancho; `.c-wide` ocupa la fila entera; `.nil` (vacías) no se muestran. */
@media (max-width: 900px) {
  .card.table-wrap:has(> table.t-cards), .card:has(> table.t-cards) { overflow: visible; background: transparent; border: 0; box-shadow: none; }
  table.t.t-cards thead { display: none; }
  table.t.t-cards, table.t.t-cards tbody { display: block; width: 100%; }
  table.t.t-cards tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; padding: 14px 16px; margin-bottom: 10px;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
  table.t.t-cards td { display: block; padding: 0; border: 0; min-width: 0; max-width: none; text-align: left; white-space: normal; overflow-wrap: anywhere; font-size: 15.5px; }
  table.t.t-cards td::before { content: attr(data-label); display: block; font-size: 12.5px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 1px; }
  table.t.t-cards td:first-child { grid-column: 1 / -1; font-size: 17px; }
  table.t.t-cards td:first-child::before, table.t.t-cards td.c-full::before, table.t.t-cards td.c-act::before { content: none; }
  table.t.t-cards td.c-wide, table.t.t-cards td.c-full { grid-column: 1 / -1; }
  table.t.t-cards td:last-child:has(.btn, form, button) { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-start; padding-top: 4px; }
  table.t.t-cards td:last-child:has(.btn, form, button)::before { content: none; }
  table.t.t-cards td:last-child form.inline { display: inline-flex; }
  table.t.t-cards td.nil { display: none; }
  table.t.t-cards tr.editing { display: block; }
  table.t.t-cards tr.editing td { padding: 0; background: transparent; }
  table.t.t-cards .nowrap { white-space: normal; }
}
@media (max-width: 900px) {
  /* Tareas: el título manda; prioridad y estado en la misma fila debajo */
  /* Tareas en el móvil (Sergio 31/10): tarjeta compacta — título arriba; prioridad · responsables · fecha en una
     línea; estado a la derecha; borde izquierdo con el color de la prioridad; sin etiquetas en mayúsculas. */
  table.t.t-cards.task-table tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 12px 14px 12px 16px;
    border-left: 4px solid var(--prio, #d6d3cd); }
  table.t.t-cards.task-table tr.prio-alta { --prio: #e5484d; }
  table.t.t-cards.task-table tr.prio-media { --prio: #f5a524; }
  table.t.t-cards.task-table tr.prio-baja { --prio: #c9c6bf; }
  table.t.t-cards.task-table td::before { content: none; }
  table.t.t-cards.task-table td { font-size: 14.5px; }
  table.t.t-cards.task-table td:nth-child(2) { order: -1; flex: 1 1 100%; font-size: 17px; line-height: 1.3; }
  table.t.t-cards.task-table td:nth-child(2) .task-snip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 3px; font-size: 14.5px; }
  table.t.t-cards.task-table td:first-child { flex: 0 0 auto; }
  table.t.t-cards.task-table td:first-child .tag { font-size: 13px; }
  table.t.t-cards.task-table td:nth-child(3) .tag { background: none; padding: 0; color: var(--muted); font-size: 14px; }
  table.t.t-cards.task-table td:nth-child(3) .tag:not(:last-child)::after { content: " ·"; }
  table.t.t-cards.task-table td:nth-child(4) { color: var(--muted); }
  table.t.t-cards.task-table td:nth-child(4)::before { content: "· "; }
  table.t.t-cards.task-table td:nth-child(5) { margin-left: auto; }
  table.t.t-cards.task-table td:nth-child(5) form { display: block; }
  table.t.t-cards.task-table .status-select { max-width: none; min-height: 40px; }
  /* El Filtrado REO/NPL no se usa en el móvil (Sergio 31/10): fuera del menú y de la barra inferior */
  body .nav a.nav-desk-only { display: none; }
  table.t.t-cards td .op-link, table.t.t-cards td .task-link { white-space: normal; }
  table.t.t-cards.npl-table .pill-status { max-width: 100%; }
  table.t.t-cards.dir-table .city-list { max-width: none; }
}
@media (max-width: 900px) {
  /* Filtrado REO/NPL: las decisiones van en una barra fija abajo (sustituye a la barra de pestañas en esa pantalla) */
  body.rv-page { --tabbar-h: 66px; }
  body.rv-page .tabbar { display: none; }
  body.rv-page .rv-actions { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1040; display: grid;
    grid-template-columns: 52px minmax(0, 1fr) minmax(0, 1.35fr) 52px; gap: 8px;
    padding: 8px max(10px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    background: rgba(255, 255, 255, .97); backdrop-filter: saturate(1.4) blur(10px); border-top: 1px solid var(--line);
    box-shadow: 0 -6px 18px rgba(15, 23, 42, .08); }
  body.rv-page .rv-actions .rv-btn { min-height: 48px; padding: 0 6px; font-size: 17px; }
  body.rv-page .rv-actions #btnPrev, body.rv-page .rv-actions #btnNext { font-size: 22px; padding: 0; }
  body.rv-page .rv-actions .rv-lbl { display: none; }
  body.rv-page .rv-actions #btnPrev { order: 0; } body.rv-page .rv-actions #btnDiscard { order: 1; }
  body.rv-page .rv-actions #btnOperation { order: 2; } body.rv-page .rv-actions #btnNext { order: 3; }
}
.rv-ftoggle { display: none; }
@media (max-width: 900px) {
  body .rv-title { width: 100%; flex-wrap: wrap; row-gap: 6px; }
  body .rv-ftoggle { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; min-height: 40px; padding: 0 14px; border-radius: 10px;
    border: 1px solid #334155; background: #1e293b; color: #e2e8f0; font: inherit; font-size: 15.5px; font-weight: 500; cursor: pointer; }
  body .rv-ftoggle b { min-width: 22px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 13.5px; text-align: center; }
  body .rv-ftoggle[aria-expanded="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
  body .rv-ftoggle[aria-expanded="true"] b { background: rgba(255, 255, 255, .25); }
  body.rv-page .rv-bar:not(.f-open) .rv-filters { display: none; }
}
@media (max-width: 900px) {
  body .content .input, body .content select.input, body .content textarea.input { font-size: 16px; }
  body .city-chip button { width: 40px; height: 40px; margin: -9px -8px -9px 0; font-size: 20px; }
  body .toolbar button { padding: 10px 11px; min-width: 22px; }
  body .zp-tools { flex-wrap: wrap; }
  body .zp-tools .input { max-width: none; flex: 1 1 160px; }
  body .zp-grid label { min-height: 40px; }
}
@media (max-width: 900px) {
  body details > summary { min-height: 40px; }
  body .legal-foot a, body .legal-nav a { padding: 10px 0; }
  body .sops-main select, body .sops-main input { font-size: 16px; }
  body .sops-tree .icon-btn, body .st-head .icon-btn { width: 40px; height: 40px; place-items: center; }
  body .sops-tree summary { min-height: 40px; display: flex; align-items: center; }
}
@media (max-width: 900px) { body .scen-name { padding-top: 10px; padding-bottom: 10px; } }
@media (max-width: 900px) {
  /* Valorador · «Mis últimas consultas»: RC y valor arriba, dirección debajo a todo el ancho */
  body .v-hist, body .v-hist tbody { display: block; width: 100%; }
  body .v-hist tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 8px 2px; border-bottom: 1px solid var(--line); }
  body .v-hist tr:last-child { border-bottom: 0; }
  body .v-hist td { display: block; padding: 0; border: 0; text-align: left; }
  body .v-hist td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; color: var(--ink-2); }
  body .v-hist td.r { text-align: right; font-weight: 600; white-space: nowrap; }
  body .v-hist td a { display: inline-block; padding: 4px 0; }
}
@media (max-width: 900px) {
  /* Barras de filtros (Operaciones, Contactos, Inversores…): campos a todo el ancho disponible, búsqueda en su propia fila */
  body .ops-bar .input.sm { max-width: none; flex: 1 1 150px; }
  body .ops-bar .input.sm.search { flex-basis: 100%; width: 100%; }
  body .ops-filters select, body .ops-filters .input.sm { max-width: none; }
}
@media (max-width: 900px) {
  /* Dashboard del colaborador · «Pendientes de visita»: nombre a lo ancho, ciudad y estado debajo */
  body .visit-list, body .visit-list tbody { display: block; }
  body .visit-list tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 10px; padding: 10px 16px; border-bottom: 1px solid #f1efeb; }
  body .visit-list td { display: block; padding: 0; border: 0; }
  body .visit-list td:first-child { grid-column: 1 / -1; font-weight: 500; }
  body .visit-list td:first-child a { display: block; padding: 2px 0; }
  body .visit-list td:nth-child(2) { color: var(--muted); font-size: 15px; }
  /* Board en el móvil: sin las columnas vacías (se arrastra igual entre las que tienen operaciones) */
  body .board .col.is-empty { display: none; }
  body .board { min-height: 0; }
  body .board .col { flex-basis: min(300px, 82vw); scroll-snap-align: start; }
  body .board { scroll-snap-type: x proximity; scroll-padding-left: 2px; }
}
@media (max-width: 380px) { body .tabbar a { font-size: 11.5px; letter-spacing: -.01em; } body .tabbar a span { padding: 0; } }
@media (max-width: 900px) { body .board .board-group-label { display: none; } }
@media (max-width: 900px) {
  /* Selectores de vista (.seg) en una sola fila de segmentos iguales */
  body .seg[role=tablist], body .seg[role=group] { display: grid; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); width: 100%; }
  body .seg[role=tablist] a, body .seg[role=group] a { justify-content: center; text-align: center; white-space: normal; line-height: 1.2; padding-left: 8px; padding-right: 8px; }
}
@media (max-width: 900px) { body .rv-title > b { display: none; } /* ya lo dice la barra superior */ }
