:root {
  --navy: #123a6b;
  --brand: #1f6feb;
  --brand-dark: #1a56c4;
  --ink: #0f172a;
  --ink-soft: #475569;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f4f6fb;
  --card: #ffffff;
  --ok: #15803d;
  --ok-bg: #dcfce7;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --bad: #b91c1c;
  --bad-bg: #fee2e2;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
  --sidebar-w: 240px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.5; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6rem; }
h2 { font-size: 1.15rem; }
.muted { color: var(--muted); }
.help { color: var(--muted); font-size: .85rem; }
.help ul { margin: .3rem 0 0; padding-left: 1.1rem; }
code { background: #eef2f7; padding: .1rem .35rem; border-radius: 4px; }

/* Botones */
.btn { display: inline-block; background: var(--brand); color: #fff; border: 0; border-radius: 8px; padding: .6rem 1.1rem; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--brand-dark); }
.btn-ghost { background: transparent; color: var(--ink-soft); border: 1px solid var(--line); }
.btn-ghost:hover { background: #eef2f7; }
.btn-small { padding: .3rem .7rem; font-size: .85rem; }
.btn-block { width: 100%; }
.btn-icon { background: none; border: 0; font-size: 1.3rem; cursor: pointer; display: none; }
button.link { background: none; border: 0; color: var(--brand); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }

/* Formularios */
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; margin-bottom: .3rem; font-size: .9rem; }
.field input, .field select, .field textarea { width: 100%; padding: .6rem .7rem; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; background: #fff; }
.field input:focus, .field select:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.field .error { color: var(--bad); font-size: .85rem; margin-top: .25rem; }
.has-error input { border-color: var(--bad); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 5.5rem; }
.pw-toggle { position: absolute; right: .4rem; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--brand); cursor: pointer; font-size: .85rem; }

/* Mensajes y etiquetas */
.messages { margin-bottom: 1rem; }
.msg { padding: .7rem 1rem; border-radius: 8px; margin-bottom: .5rem; background: #e0ecff; color: #1e3a8a; }
.msg-success { background: var(--ok-bg); color: var(--ok); }
.msg-error { background: var(--bad-bg); color: var(--bad); }
.msg-warning { background: var(--warn-bg); color: var(--warn); }
.badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; background: #eef2f7; color: var(--ink-soft); font-size: .8rem; font-weight: 600; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }

/* Marca */
.brand-mark { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 14px; background: #fff; color: var(--navy); font-weight: 800; font-size: 1.3rem; }
.brand-mark.sm { width: 36px; height: 36px; border-radius: 10px; font-size: .95rem; background: var(--navy); color: #fff; }

/* Pantallas de acceso */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-wrap.single { grid-template-columns: 1fr; place-items: center; }
.auth-brand { background: linear-gradient(160deg, var(--navy), #1f4f8f); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: center; }
.auth-brand h1 { font-size: 2rem; margin-top: 1.2rem; }
.brand-org { opacity: .85; margin: 0 0 1.5rem; font-size: 1.1rem; }
.brand-tag { max-width: 28rem; opacity: .9; }
.auth-card { background: var(--card); padding: 3rem; display: flex; flex-direction: column; justify-content: center; max-width: 520px; width: 100%; margin: 0 auto; }
.auth-wrap.single .auth-card { border-radius: var(--radius); box-shadow: var(--shadow); }
.auth-links { margin-top: 1rem; text-align: center; }

/* Panel de gestión */
.app.gestion { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar { background: var(--navy); color: #fff; padding: 1.2rem .9rem; }
.sidebar-brand { display: flex; gap: .7rem; align-items: center; margin-bottom: 1.5rem; }
.sidebar-brand .brand-mark.sm { background: #fff; color: var(--navy); }
.sidebar-brand small { display: block; opacity: .75; }
.nav a { display: block; color: #dbe6f5; text-decoration: none; padding: .55rem .8rem; border-radius: 8px; margin-bottom: .15rem; }
.nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav a.active { background: rgba(255, 255, 255, .16); color: #fff; font-weight: 600; }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 1rem; background: #fff; border-bottom: 1px solid var(--line); padding: .7rem 1.5rem; }
.topbar-title { font-weight: 700; flex: 1; }
.topbar-user { color: var(--muted); font-size: .9rem; }
.content { padding: 1.5rem; max-width: 1200px; }
.page-h { font-size: 1.5rem; }

/* Portal cliente */
.app.portal { min-height: 100vh; display: flex; flex-direction: column; }
.portal-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; background: #fff; border-bottom: 1px solid var(--line); padding: .8rem 1.5rem; }
.portal-brand { display: flex; gap: .6rem; align-items: center; }
.portal-brand small { display: block; color: var(--muted); }
.portal-nav { display: flex; gap: .4rem; align-items: center; }
.portal-nav a { text-decoration: none; color: var(--ink-soft); padding: .45rem .8rem; border-radius: 8px; }
.portal-nav a.active { background: #e0ecff; color: var(--brand-dark); font-weight: 600; }
.portal-content { width: 100%; max-width: 960px; margin: 0 auto; flex: 1; }
.portal-footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 1.5rem; }

/* Tarjetas, tablas */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.3rem 1.4rem; margin-bottom: 1.2rem; }
.card.narrow { max-width: 560px; }
.card.empty { text-align: center; padding: 2.5rem 1.4rem; }
.grid { display: grid; gap: 1.2rem; }
.cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid > .card { margin-bottom: 0; min-width: 0; }
.grid + .card, .grid { margin-bottom: 1.2rem; }
.stat { display: flex; flex-direction: column; gap: .3rem; }
.stat-label { color: var(--muted); font-size: .85rem; font-weight: 600; }
.stat-value { font-size: 1.8rem; font-weight: 800; }
.stat-value small { font-size: .9rem; color: var(--muted); font-weight: 500; }
.meter { height: 8px; background: #e8edf5; border-radius: 99px; overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: var(--brand); }
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .02em; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1.2rem; margin: 0 0 1rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.filters { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; }
.filters .field { margin: 0; min-width: 220px; }
.pager { display: flex; gap: 1rem; justify-content: center; margin-top: 1rem; }
.changes { margin: .3rem 0 0; padding-left: 1rem; font-size: .85rem; }
.steps { padding-left: 1.2rem; }
.steps li { margin-bottom: .8rem; }
.qr { margin: .6rem 0; }
.qr img { border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.secret { display: inline-block; margin-top: .4rem; letter-spacing: .08em; }

@media (max-width: 1200px) {
  .cards-2 { grid-template-columns: 1fr; }
}

/* Móvil */
@media (max-width: 860px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-brand { padding: 1.5rem; }
  .auth-brand h1 { font-size: 1.4rem; margin-top: .6rem; }
  .brand-tag { display: none; }
  .auth-card { padding: 1.5rem 16px; }
  .app.gestion { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); transform: translateX(-100%); transition: transform .2s; z-index: 20; }
  body.nav-open .sidebar { transform: none; }
  .btn-icon { display: inline-block; }
  .topbar { padding: .6rem 16px; }
  .topbar-user { display: none; }
  .content { padding: 1rem 16px; }
  .cards-3, .cards-2 { grid-template-columns: 1fr; }
  .portal-header { padding: .7rem 16px; }
}

/* ---------- Acceso: diseño dividido (ingreso, activación, contraseñas, 2FA) ---------- */
.auth-split { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(420px, 1fr); font-family: var(--lp-font); background: #fff; }
.auth-hero { position: relative; overflow: hidden; color: #fff; padding: clamp(40px, 6vh, 72px) 0 36px clamp(40px, 5.5vw, 96px); display: flex;
  background:
    radial-gradient(900px 520px at 78% 8%, rgba(76, 140, 255, .55), rgba(76, 140, 255, 0) 60%),
    radial-gradient(700px 700px at 60% 105%, rgba(35, 104, 235, .55), rgba(35, 104, 235, 0) 62%),
    linear-gradient(140deg, #0a45c2 0%, #0a2f86 42%, #061a4d 100%); }
.auth-hero-copy { position: relative; z-index: 2; width: 54%; max-width: 600px; display: flex; flex-direction: column; }
/* Logo oficial siempre sobre fondo blanco: no se altera su color (no hay versión blanca oficial). */
.auth-wordmark { align-self: flex-start; display: inline-flex; background: #fff; border-radius: 18px; padding: 10px 16px; margin-bottom: 40px; box-shadow: 0 10px 30px rgba(3, 16, 48, .25); }
.auth-wordmark img { display: block; height: 56px; width: auto; }
.auth-eyebrow { align-self: flex-start; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .14); color: #e3ecff; font-size: .72rem; letter-spacing: .28em; font-weight: 700; text-transform: uppercase; padding: 7px 16px; border-radius: 999px; }
.auth-title { font-size: clamp(2.3rem, 3.25vw, 3.7rem); font-weight: 800; letter-spacing: -.03em; line-height: 1; margin: 18px 0 16px; white-space: nowrap; }
.auth-title span { color: #3ea0ff; }
.auth-subtitle { font-size: clamp(1.15rem, 1.65vw, 1.7rem); font-weight: 600; line-height: 1.2; margin: 0; }
.auth-subtitle span { color: #4fb0ff; }
.auth-rule { width: 100%; max-width: 440px; height: 2px; border: 0; margin: 22px 0; background: linear-gradient(90deg, #3ea0ff, rgba(62, 160, 255, 0)); }
.auth-claim { font-size: 1.2rem; font-weight: 700; line-height: 1.3; margin: 0 0 8px; }
.auth-text { color: #d3def5; line-height: 1.5; margin: 0 0 26px; }
.auth-features { list-style: none; padding: 0; margin: 0 0 32px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.auth-features li { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; font-size: .86rem; font-weight: 600; line-height: 1.25; }
.auth-features span { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .16); }
.auth-features .ico { width: 26px; height: 26px; stroke-width: 1.6; }
.auth-signature { margin: auto 0 0; font-size: .74rem; letter-spacing: .3em; text-transform: uppercase; color: #5f9bff; font-weight: 600; }
.auth-glow { position: absolute; right: -12%; top: -18%; width: 60%; aspect-ratio: 1; border-radius: 50%; border: 90px solid rgba(90, 150, 255, .18); pointer-events: none; }
.auth-device { position: absolute; z-index: 1; left: 60%; right: -30%; top: 17%; font-size: clamp(7px, .82vw, 12px); color: var(--lp-ink); }
.lp-laptop-auth { transform: perspective(2200px) rotateY(-14deg) rotateX(4deg) rotateZ(-3deg); transform-origin: 0 50%; filter: drop-shadow(0 50px 60px rgba(0, 10, 40, .5)); }

.auth-panel { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; padding: 48px clamp(28px, 4.5vw, 88px); background: #fff; color: var(--lp-ink); }
.auth-panel::before, .auth-panel::after { content: ""; position: absolute; border-radius: 50%; border: 44px solid #eef4ff; pointer-events: none; }
.auth-panel::before { width: 320px; height: 320px; right: -170px; top: -150px; }
.auth-panel::after { width: 360px; height: 360px; right: -210px; bottom: -220px; }
.auth-panel-inner { position: relative; z-index: 1; width: 100%; max-width: 540px; }
.auth-logo img { display: block; width: 282px; max-width: 70%; height: auto; margin-bottom: 44px; }
.auth-h1, .auth-panel-inner h2 { font-size: clamp(2.2rem, 3.4vw, 3.3rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.05; color: var(--lp-navy); margin: 0 0 12px; }
.auth-panel-inner h2 { font-size: clamp(1.7rem, 2.4vw, 2.3rem); }
.auth-lead, .auth-panel-inner > .muted { font-size: 1.15rem; color: #5b6b86; margin: 0 0 32px; }
.auth-panel .field label { font-size: 1rem; color: var(--lp-ink); margin-bottom: 8px; }
.auth-panel .field input { height: 56px; border-radius: 12px; border: 1px solid #cfd8e8; font-size: 1rem; padding: 0 16px; }
.auth-panel .field input:focus { outline: 3px solid rgba(10, 86, 214, .18); border-color: var(--lp-blue); outline-offset: 0; }
.auth-input { position: relative; }
.auth-input > .ico { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); z-index: 1; color: #4a5872; width: 22px; height: 22px; }
.auth-input input { padding-left: 54px !important; }
.auth-panel .pw-wrap input { padding-right: 96px; }
.auth-panel .pw-toggle { right: 16px; font-size: 1rem; font-weight: 600; color: var(--lp-blue); }
.auth-panel .btn { border-radius: 12px; }
.auth-submit, .auth-panel .btn-block { height: 58px; font-size: 1.15rem; display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: var(--lp-blue); margin-top: 10px; }
.auth-submit:hover { background: var(--lp-blue-dark); }
.auth-submit .ico { width: 22px; height: 22px; }
.auth-panel .auth-links { margin-top: 30px; font-size: 1.05rem; }
.auth-panel .auth-links a, .auth-panel button.link { color: var(--lp-blue); }

@media (max-width: 1100px) {
  .auth-split { grid-template-columns: minmax(0, 1.2fr) minmax(400px, 1fr); }
  .auth-hero-copy { width: 100%; padding-right: 40px; }
  .auth-device { display: none; }
}
@media (max-width: 860px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-panel { align-items: flex-start; padding: 32px 16px 48px; }
  .auth-logo img { width: 200px; margin-bottom: 32px; }
  .auth-panel::before, .auth-panel::after { display: none; }
}

/* ---------- Fase 1: componentes operativos ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.text-warn { color: var(--warn); }
.inline { display: inline; }
.badge-info { background: #e0ecff; color: #1a56c4; }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-pink { background: #fde3eb; color: #c8365f; }
.badge-muted { background: #f1f5f9; color: var(--muted); }
.btn-warn { background: #b45309; }
.btn-warn:hover { background: #92400e; }
.nav-sep { display: block; height: 1px; background: rgba(255, 255, 255, .14); margin: .6rem .4rem; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head .page-h { margin-bottom: .2rem; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.card-head h2, .card-head h3 { margin: 0; }
.card-alert { border-left: 4px solid var(--warn); }
.card-warn { border-top: 4px solid var(--warn); }
.cards-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
a.stat-link { text-decoration: none; color: inherit; transition: box-shadow .15s; }
a.stat-link:hover { box-shadow: 0 4px 14px rgba(15, 23, 42, .12); }
.meter-full span { background: var(--warn); }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .6rem 0; border-top: 1px solid var(--line); }
.rows li:first-child { border-top: 0; }
.empty-inline { text-align: center; padding: 1.5rem 0; }
.form-card { max-width: 860px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.2rem; }
.form-grid .span-2 { grid-column: 1 / -1; }
.field input[type="checkbox"] { width: auto; margin-right: .4rem; }
.inline-form { display: flex; gap: .8rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: 1rem; }
.inline-form .field { margin: 0; }
.inline-form .field.grow { flex: 1; min-width: 180px; }
.inline-form select, .inline-form input { padding: .5rem .6rem; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; width: 100%; }
.kv-tight { margin-top: 1rem; }
.note-internal { background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: .6rem .8rem; font-size: .9rem; }
.chip { display: inline-block; background: #eef2f7; border-radius: 999px; padding: .15rem .65rem; margin: 0 .3rem .3rem 0; font-size: .85rem; }
.profile-grid h3 { font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-bottom: .4rem; }
.checklist { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .9rem; margin: 0 0 1rem; max-height: 280px; overflow: auto; }
.checklist legend { font-weight: 600; font-size: .9rem; padding: 0 .3rem; }
.checklist label { display: flex; align-items: center; gap: .4rem; padding: .3rem 0; flex-wrap: wrap; }

/* Pestañas */
.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--line); margin: 0 0 1.2rem; overflow-x: auto; }
.tabs a { padding: .6rem 1rem; text-decoration: none; color: var(--ink-soft); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--brand-dark); border-bottom-color: var(--brand); font-weight: 600; }
.count { display: inline-grid; place-items: center; min-width: 1.4rem; height: 1.4rem; padding: 0 .35rem; border-radius: 999px; background: var(--warn-bg); color: var(--warn); font-size: .75rem; font-weight: 700; }

/* Ficha del cliente */
.client-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }
.client-id { display: flex; gap: 1rem; align-items: flex-start; }
.client-id h1 { font-size: 1.5rem; margin: 0 0 .2rem; }
.client-id p { margin: 0 0 .4rem; }
.avatar { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: #e0ecff; color: var(--brand-dark); font-weight: 800; font-size: 1.3rem; flex: none; }

/* Línea de tiempo */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 8.5rem 1fr; gap: .8rem; padding: .55rem 0; border-top: 1px solid var(--line); font-size: .92rem; }
.timeline li:first-child { border-top: 0; }
.timeline time { color: var(--muted); font-size: .85rem; }

/* Pipeline (kanban) */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: .9rem; overflow-x: auto; padding-bottom: .8rem; }
.kanban-col { background: #eef2f8; border-radius: var(--radius); padding: .8rem; min-height: 200px; }
.kanban-col header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; }
.kanban-col h2 { font-size: .9rem; margin: 0; }
.kanban-col .count { background: #fff; color: var(--ink-soft); }
.kanban-card { background: #fff; border-radius: 10px; padding: .7rem .8rem; margin-bottom: .6rem; box-shadow: var(--shadow); }
.kanban-card.is-stale { border-left: 4px solid var(--warn); }
.kanban-card .help { margin: .2rem 0 .4rem; }
.kanban-move { display: flex; gap: .4rem; margin-top: .5rem; }
.kanban-move select { flex: 1; min-width: 0; font-size: .8rem; padding: .25rem; border: 1px solid #cbd5e1; border-radius: 6px; }
.kanban-empty { color: var(--muted); font-size: .85rem; text-align: center; margin-top: 1.5rem; }

/* Barras por etapa */
.stage-bars { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .6rem; }
.stage-bar { background: #f4f7fb; border-radius: 10px; padding: .7rem; text-align: center; }
.stage-n { display: block; font-size: 1.5rem; font-weight: 800; }
.stage-label { font-size: .8rem; color: var(--muted); }

/* Portal: pasos del proceso */
.stepper { list-style: none; margin: .4rem 0 .8rem; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); position: relative; }
.stepper::before { content: ""; position: absolute; left: 10%; right: 10%; top: 18px; height: 3px; background: #e2e8f0; }
.stepper li { position: relative; display: flex; flex-direction: column; align-items: center; gap: .4rem; text-align: center; font-size: .85rem; color: var(--muted); }
.stepper .dot { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #fff; border: 3px solid #e2e8f0; font-weight: 700; z-index: 1; }
.stepper .dot .ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.stepper .is-done { color: var(--brand-dark); }
.stepper .is-done .dot { border-color: var(--brand); color: var(--brand); }
.stepper .is-current { color: var(--ink); font-weight: 700; }
.stepper .is-current .dot { background: #e9527f; border-color: #fbd3df; color: #fff; }
.section-h { font-size: 1.05rem; margin: 1.4rem 0 .7rem; display: flex; align-items: center; gap: .5rem; }
.proposal h3, .application h3 { font-size: 1.1rem; margin: 0 0 .2rem; }
.proposal .why { background: #f4f8ff; border-radius: 8px; padding: .6rem .8rem; }
.respond { display: flex; gap: .8rem; flex-wrap: wrap; align-items: flex-start; margin-top: .8rem; }
.respond-approve { display: flex; gap: .5rem; flex: 1; min-width: 260px; }
.respond-approve input { flex: 1; padding: .55rem .7rem; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; min-width: 0; }
.respond-discard summary { list-style: none; }
.respond-discard summary::-webkit-details-marker { display: none; }
.respond-discard[open] form { margin-top: .8rem; background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: .8rem; }

@media (max-width: 1200px) {
  .cards-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .cards-4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .timeline li { grid-template-columns: 1fr; gap: .1rem; }
  .stepper li span:last-child { font-size: .72rem; }
  .respond-approve { min-width: 100%; }
}

/* Portal en pantallas angostas */
@media (max-width: 600px) {
  .portal-header { gap: .5rem; }
  .portal-nav { width: 100%; flex-wrap: wrap; gap: .2rem; }
  .portal-nav a { padding: .4rem .6rem; font-size: .92rem; }
  .portal-nav form { margin-left: auto; }
  .stepper li span:last-child { display: none; }
  .portal .cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
  .portal .cards-3 .stat { padding: .8rem .7rem; }
  .portal .cards-3 .stat-label { font-size: .72rem; line-height: 1.25; }
  .portal .cards-3 .stat-value { font-size: 1.5rem; }
}

.brand-mark.brand-logo, .sidebar-brand .brand-mark.brand-logo { background: #fff; padding: 3px; }
.brand-logo img { width: 100%; height: 100%; object-fit: contain; }

.sub-h { font-size: .95rem; margin: 1.2rem 0 .5rem; }
.field label.check { display: flex; align-items: center; gap: .5rem; font-weight: 600; }
.field label.check input { width: auto; }

/* ---------- Fase 2: operación diaria ---------- */
.text-bad { color: var(--bad); font-weight: 600; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg a { padding: .4rem .8rem; text-decoration: none; color: var(--ink-soft); font-size: .9rem; }
.seg a.active { background: var(--brand); color: #fff; }
.op-counters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; margin-bottom: 1.2rem; }
.op-counter { display: flex; align-items: baseline; gap: .6rem; padding: .9rem 1.1rem; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); border-left: 5px solid; }
.op-counter b { font-size: 1.8rem; }
.op-counter.c-bad { border-color: var(--bad); } .op-counter.c-bad b { color: var(--bad); }
.op-counter.c-brand { border-color: var(--brand); } .op-counter.c-brand b { color: var(--brand); }
.op-counter.c-warn { border-color: #d97706; } .op-counter.c-warn b { color: #b45309; }
.op-counter.c-muted { border-color: #94a3b8; }
.op-counter.is-zero b { color: var(--muted); }
.op-section h2 { margin-bottom: .4rem; }
.op-section h3 { font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 1.1rem 0 .3rem; }
.op-bad { border-top: 4px solid var(--bad); }
.op-brand { border-top: 4px solid var(--brand); }
.op-warn { border-top: 4px solid #d97706; }
details.op-section > summary { list-style: none; cursor: pointer; }
details.op-section > summary::-webkit-details-marker { display: none; }
details.op-section > summary h2 { display: inline; }
.op-list { list-style: none; margin: 0; padding: 0; }
.op-row { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .6rem .2rem; border-top: 1px solid var(--line); }
.op-list .op-row:first-child { border-top: 0; }
.op-row.is-overdue { background: linear-gradient(90deg, #fef2f2, transparent 60%); }
.op-row.prio-alta .op-main > a strong, .op-row.prio-alta .op-main > strong { color: var(--ink); }
.op-main { min-width: 0; }
.op-meta { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; font-size: .82rem; color: var(--ink-soft); margin-top: .2rem; }
.op-action { display: flex; gap: .4rem; align-items: center; flex: none; }
.op-min { width: 4.8rem; padding: .3rem .4rem; border: 1px solid #cbd5e1; border-radius: 6px; font: inherit; font-size: .85rem; }
.op-attn h3 { margin-top: .2rem; }
.time-line { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.time-line b { font-size: 1.2rem; }
.total-row td { border-top: 2px solid var(--line); }
.filters label.check { display: flex; gap: .4rem; align-items: center; }
.tab-toggle { margin-left: auto; font-size: .85rem; }
.danger-zone { margin-top: 1.4rem; padding-top: 1rem; border-top: 1px dashed var(--line); }
.interview h3 { font-size: 1.1rem; margin: 0 0 .2rem; }
.interview .why, .proposal .why { background: #f4f8ff; border-radius: 8px; padding: .6rem .8rem; }
@media (max-width: 860px) {
  .op-counters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .op-row { flex-wrap: wrap; }
}

.client-group + .client-group { margin-top: 1rem; padding-top: .6rem; border-top: 1px solid var(--line); }
.client-group h3 { font-size: 1rem; margin: 0 0 .3rem; }

/* Archivos de clientes (Gestión) */
.file-list { list-style: none; margin: .5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.file-list li { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: .45rem .6rem; }
.file-list li.is-deleted { opacity: .7; }
.file-list strong { overflow-wrap: anywhere; }
details.file-action { display: inline-block; }
details.file-action > summary { list-style: none; }
details.file-action > summary::-webkit-details-marker { display: none; }
details.file-action[open] { flex-basis: 100%; }
details.file-action[open] form { display: flex; flex-direction: column; gap: .4rem; margin-top: .5rem; background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: .7rem; min-width: 0; }
details.file-action input { padding: .45rem .6rem; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; width: 100%; max-width: 100%; box-sizing: border-box; }
.rows-files > li > span { min-width: 0; }
@media (max-width: 640px) {
  .rows-files > li { flex-wrap: wrap; }
  .rows-files > li > .actions { flex-basis: 100%; }
}
