/* Portal de socios IA2 · Verde profundo y lima (mismo estilo que el inicio de iados.com.mx) */
:root {
  --bg: #F3F6F1;
  --bg-soft: #F8FAF5;
  --card: #FFFFFF;
  --card-tint: #F1F8E4;
  --card-bd: #DCEFC0;
  --line: #E3E8E0;
  --line-2: #EDF1EA;
  --ink: #10231B;
  --muted: #55645B;
  --deep: #0A1F18;
  --deep-2: #061812;
  --forest: #0F3D2E;
  --forest-2: #17513D;
  --lime: #A3E635;
  --lime-hover: #B5EC4B;
  --lime-txt: #3F6212;
  --lime-soft: #D9F99D;
  --campo-bd: #CDD7C9;
  --amber: #F59E0B;
  --amber-bg: #FEF6E4;
  --amber-bd: #F5D28A;
  --amber-txt: #8A5A00;
  --red: #B42318;
  --red-bg: #FDECEC;
  --green: #3F6212;
  --green-bg: #ECF7DA;
  --blue-bg: #E6F0F9;
  --blue-txt: #245A8C;
  --ok: #16A34A;
  --ok-2: #22C55E;
  --anillo: rgba(163, 230, 53, .42);
  --radius: 18px;
  --radius-s: 12px;
  --shadow: 0 1px 2px rgba(16, 35, 27, .05), 0 12px 30px -18px rgba(16, 35, 27, .28);
  --shadow-lg: 0 24px 60px -18px rgba(6, 24, 18, .45), 0 2px 6px rgba(6, 24, 18, .08);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', Consolas, 'Courier New', monospace;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--bg); }
img, svg { max-width: 100%; }
a { color: var(--forest-2); text-underline-offset: 2px; }
a:hover { color: var(--lime-txt); }
h1, h2, h3 { line-height: 1.25; margin: 0; text-wrap: balance; color: var(--deep); }
h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 1.08rem; font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: .95rem; font-weight: 700; margin-top: 4px; }
p { margin: 0; }
code { font-family: var(--mono); font-size: .9em; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
:focus-visible { outline: 3px solid rgba(101, 163, 13, .55); outline-offset: 2px; }
[hidden] { display: none !important; }

.tenue { color: var(--muted); }
.nota { color: var(--muted); font-size: .86rem; }
.romper { overflow-wrap: anywhere; }
.vencido { color: var(--red); font-weight: 600; }
.sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Estructura de la app ---------- */
body.app { background: radial-gradient(1100px 360px at 100% 0%, rgba(163, 230, 53, .10), transparent 65%), var(--bg); background-repeat: no-repeat; }
.saltar { position: absolute; left: 12px; top: -60px; z-index: 60; background: var(--lime); color: var(--deep); font-weight: 700; padding: 8px 14px; border-radius: 0 0 10px 10px; }
.saltar:focus { top: 0; }
.top {
  position: relative; z-index: 30; color: #fff;
  background: radial-gradient(520px 220px at 88% -30%, rgba(163, 230, 53, .20), transparent 70%), radial-gradient(620px 260px at 4% 150%, rgba(46, 168, 79, .24), transparent 70%), var(--deep);
  box-shadow: 0 12px 30px -20px rgba(6, 24, 18, .9);
}
/* Rejilla fina, como en las franjas oscuras del sitio */
.top::before { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px); background-size: 44px 44px; -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 45%, #000 70%, transparent 100%); mask-image: linear-gradient(90deg, transparent 0%, #000 45%, #000 70%, transparent 100%); }
.top > * { position: relative; }
.top :focus-visible { outline-color: var(--lime); }
.top-in, .tabs-in, .main, .pie p {
  max-width: 1180px; margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 11px; }
.marca { display: inline-flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; flex: none; }
.marca:hover { color: #fff; }
.logo-mark { flex: none; }
.marca-txt { font-size: 1.4rem; font-weight: 800; letter-spacing: -.02em; }
.marca-txt b { color: var(--lime); }
.emisor-marca b { color: #65A30D; }
.marca-sub { font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; background: rgba(163, 230, 53, .12); border: 1px solid rgba(163, 230, 53, .3); color: var(--lime-soft); }
.quien { display: flex; align-items: center; gap: 10px; min-width: 0; }
.quien form { margin: 0; }
.quien-nombre { display: inline-flex; align-items: center; gap: 8px; color: #fff; font-weight: 600; text-decoration: none; min-width: 0; padding: 3px 10px 3px 3px; border-radius: 999px; transition: background-color .15s; }
.quien-nombre:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.quien-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 20ch; }
.rol { font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; background: var(--lime); color: var(--deep); border-radius: 999px; padding: 1px 7px; }
.avatar { flex: none; width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .74rem; font-weight: 800; letter-spacing: .02em; color: #fff; background: linear-gradient(140deg, #2E7D4F, var(--forest-2)); box-shadow: 0 0 0 2px rgba(163, 230, 53, .35); }
.avatar.av-ia2 { background: var(--lime); color: var(--deep); }
.btn-salir { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 7px 10px; border-radius: 999px; color: rgba(255, 255, 255, .72); font-weight: 600; font-size: .9rem; cursor: pointer; transition: background-color .15s, color .15s; }
.btn-salir:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.top .btn-link, .top .btn-link:hover { color: rgba(255, 255, 255, .85); }
.ayuda-btn { flex: none; width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 800; font-size: 1rem; color: #fff; text-decoration: none; border: 1.5px solid rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .05); transition: background-color .15s, color .15s, border-color .15s; }
.ayuda-btn:hover, .ayuda-btn.activo { background: var(--lime); border-color: var(--lime); color: var(--deep); }

/* Quién está en línea */
.enlinea { position: relative; flex: none; }
.enlinea-btn { list-style: none; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; background: rgba(163, 230, 53, .12); color: #E9FBCB; font-size: .86rem; font-weight: 600; padding: 7px 13px 7px 11px; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(163, 230, 53, .34); white-space: nowrap; transition: background-color .15s; }
.enlinea-btn::-webkit-details-marker { display: none; }
.enlinea-btn:hover { background: rgba(163, 230, 53, .2); }
.enlinea-btn b { font-weight: 800; font-variant-numeric: tabular-nums; color: #fff; }
.punto { position: relative; flex: none; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--lime); }
.punto::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--lime); animation: latido 1.8s ease-out infinite; }
.punto-fijo { background: var(--ok-2); vertical-align: middle; margin-right: 4px; }
.punto-fijo::after { background: var(--ok-2); }
@keyframes latido { 0% { transform: scale(1); opacity: .75; } 80%, 100% { transform: scale(2.9); opacity: 0; } }
.enlinea-pop { position: absolute; right: 0; top: calc(100% + 10px); z-index: 40; width: min(340px, calc(100vw - 32px)); background: #fff; color: var(--ink); border-radius: 16px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.enlinea-pop::before { content: ''; position: absolute; right: 26px; top: -7px; width: 14px; height: 14px; background: #fff; border-left: 1px solid var(--line); border-top: 1px solid var(--line); transform: rotate(45deg); }
.enlinea-pop :focus-visible { outline-color: rgba(101, 163, 13, .55); }
.enlinea-tit { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.enlinea-lista { list-style: none; margin: 0; padding: 0; max-height: min(60vh, 420px); overflow-y: auto; }
.enlinea-lista li { display: flex; align-items: center; gap: 11px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.enlinea-lista li:last-child { border-bottom: 0; }
.enlinea-lista .avatar { position: relative; width: 36px; height: 36px; box-shadow: none; }
.enlinea-lista .avatar::after { content: ''; position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--ok-2); border: 2px solid #fff; }
.enlinea-quien { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.enlinea-quien b { font-size: .93rem; overflow-wrap: anywhere; }
.enlinea-quien i { font-style: normal; font-weight: 500; color: var(--muted); font-size: .82rem; }
.enlinea-lugar { font-size: .84rem; color: var(--lime-txt); font-weight: 600; }
.enlinea-extra { font-size: .76rem; color: var(--muted); overflow-wrap: anywhere; }
.enlinea-pie { font-size: .74rem; color: var(--muted); }

.tabs { background: rgba(0, 0, 0, .2); border-top: 1px solid rgba(255, 255, 255, .06); }
.tabs-in { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-block: 8px; }
.tabs-in::-webkit-scrollbar { display: none; }
.tabs a { flex: none; display: inline-flex; align-items: center; gap: 7px; color: rgba(255, 255, 255, .72); text-decoration: none; font-weight: 600; font-size: .9rem; padding: 7px 15px; border-radius: 999px; white-space: nowrap; transition: background-color .15s, color .15s; }
.tabs a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.tabs a[aria-current="page"] { color: var(--deep); background: var(--lime); box-shadow: 0 8px 20px -12px rgba(163, 230, 53, .8); }
.tabs a[aria-current="page"] .ico { color: var(--deep); }
.ico { flex: none; }

.main { padding-block: 28px 48px; display: flex; flex-direction: column; gap: 18px; }
.main > * { min-width: 0; }
.enc { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.enc h1 { font-size: 1.8rem; letter-spacing: -.025em; }
.enc-acc { display: flex; gap: 8px; flex-wrap: wrap; }
.pie { border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }
.pie p { padding-block: 16px 24px; }

/* ---------- Avisos ---------- */
.aviso { border-radius: var(--radius-s); padding: 11px 14px; border: 1px solid; font-weight: 500; }
.aviso-ok { background: var(--green-bg); border-color: #CDE8A6; color: var(--green); }
.aviso-alerta { background: var(--amber-bg); border-color: var(--amber-bd); color: var(--amber-txt); }
.aviso-error { background: var(--red-bg); border-color: #F3C2BE; color: var(--red); }

/* ---------- Cajas y rejillas ---------- */
.caja { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.caja-alerta { background: var(--amber-bg); border-color: var(--amber-bd); }
.caja-info { background: var(--card-tint); border-color: var(--card-bd); }
.caja-enc { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.error-caja { max-width: 560px; }
details.caja > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; color: var(--deep); }
details.caja > summary::-webkit-details-marker { display: none; }
details.caja > summary::before { content: '+'; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: var(--card-tint); color: var(--lime-txt); font-weight: 800; }
details.caja[open] > summary::before { content: '–'; }
.pila { display: flex; flex-direction: column; gap: 12px; }
.rejilla-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.rejilla-campos { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px 14px; }
.botones { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.vacio { border: 1.5px dashed var(--card-bd); border-radius: var(--radius); padding: 22px 16px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 12px; background: var(--bg-soft); }
.notas { white-space: pre-wrap; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px; font-size: .93rem; }
.zona-peligro { display: flex; justify-content: flex-end; padding-top: 14px; border-top: 1px dashed var(--line); }

/* ---------- Formularios ---------- */
.campo { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.campo.ancho { grid-column: 1 / -1; }
.campo > label, .etiqueta { font-weight: 600; font-size: .86rem; color: var(--ink); }
.campo > small, .casilla small { color: var(--muted); font-size: .8rem; }
.req { color: var(--red); }
input, select, textarea, button { font: inherit; color: inherit; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea {
  width: 100%; min-width: 0; background: #fff; border: 1px solid var(--campo-bd); border-radius: var(--radius-s);
  padding: 9px 12px; font-size: .95rem; line-height: 1.35;
  transition: border-color .12s, box-shadow .12s, background-color .12s;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):hover, select:hover, textarea:hover { border-color: #A9BBA4; }
textarea { resize: vertical; }
input[readonly], textarea[readonly] { background: var(--bg-soft); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--forest-2); box-shadow: 0 0 0 3px var(--anillo); }
input[type="file"] { padding: 8px; border: 1.5px dashed var(--card-bd); border-radius: var(--radius-s); background: var(--bg-soft); width: 100%; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--forest-2); flex: none; margin: 2px 0 0; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 12px 14px; margin: 0; min-width: 0; }
legend { font-weight: 700; color: var(--deep); padding: 0 6px; }
.casilla { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.casilla > span { display: flex; flex-direction: column; gap: 2px; }
.filtros { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; box-shadow: 0 1px 2px rgba(16, 35, 27, .04); }
.filtros .campo { flex: 1 1 200px; }
.filtros .campo > label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.elegir { max-width: 560px; }
.en-linea { display: inline-flex; margin: 0; }
.etapa-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding-top: 12px; border-top: 1px solid var(--line); }
.etapa-form .campo { flex: 1 1 200px; }
.actividad-form { display: grid; grid-template-columns: 190px minmax(0, 1fr) 180px auto; gap: 10px 12px; align-items: end; }
.actividad-form .campo.ancho { grid-column: auto; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--forest); color: #fff; border: 1px solid var(--forest); border-radius: 999px;
  padding: 9px 19px; font-weight: 700; font-size: .9rem; line-height: 1.2; text-decoration: none; cursor: pointer; white-space: nowrap;
  box-shadow: 0 8px 18px -12px rgba(15, 61, 46, .85);
  transition: background-color .18s, border-color .18s, color .18s, transform .18s, box-shadow .18s;
}
.btn:hover { background: var(--forest-2); border-color: var(--forest-2); color: #fff; transform: translateY(-1px); box-shadow: 0 12px 24px -14px rgba(15, 61, 46, .9); }
.btn:active { transform: none; }
.btn-sec { background: #fff; color: var(--forest); border-color: #C5D3C0; box-shadow: 0 1px 2px rgba(16, 35, 27, .05); }
.btn-sec:hover { background: var(--card-tint); color: var(--forest); border-color: var(--forest); box-shadow: 0 1px 2px rgba(16, 35, 27, .05); }
.btn-peligro { background: #fff; color: var(--red); border-color: #EDB5B0; box-shadow: none; }
.btn-peligro:hover { background: var(--red); color: #fff; border-color: var(--red); box-shadow: 0 10px 20px -14px rgba(180, 35, 24, .85); }
.btn-mini { padding: 6px 12px; font-size: .8rem; }
.btn-mini .ico { width: 15px; height: 15px; }
.btn-ancho { width: 100%; }
.btn-link { background: none; border: 0; padding: 0; color: var(--forest-2); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.btn-link:hover { color: var(--lime-txt); }
.acciones-rapidas { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Etiquetas ---------- */
.badge { display: inline-block; font-size: .74rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; vertical-align: middle; }
.b-gris { background: #EEF1EC; color: #4B5A52; }
.b-azul { background: var(--blue-bg); color: var(--blue-txt); }
.b-verde { background: var(--green-bg); color: var(--green); }
.b-rojo { background: var(--red-bg); color: var(--red); }
.b-ambar { background: #FEF0CF; color: var(--amber-txt); }
.chip { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 1px 8px; border-radius: 6px; background: var(--card-tint); color: var(--lime-txt); }
.clave { font-size: 1.3rem; letter-spacing: .06em; padding: 4px 10px; background: #fff; }

/* ---------- Tablas (rejillas ordenables) ---------- */
.tabla-caja { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.tabla { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .92rem; }
.tabla th { text-align: left; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); background: var(--bg-soft); padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tabla td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.tabla tbody tr:last-child td { border-bottom: 0; }
.tabla:not(.tabla-precios) th, .tabla:not(.tabla-precios) td { padding: 11px 14px; }
.tabla:not(.tabla-precios) td { vertical-align: middle; transition: background-color .15s, box-shadow .15s; }
.tabla:not(.tabla-precios) tbody tr:nth-child(even) td { background: #FAFCF8; }
.tabla:not(.tabla-precios) tbody tr:hover td { background: #F3F9E8; }
.tabla:not(.tabla-precios) tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--lime); }
.tabla td > a { text-decoration: none; }
.tabla td > a b { color: var(--deep); transition: color .15s; }
.tabla td > a:hover b { color: var(--lime-txt); text-decoration: underline; text-underline-offset: 3px; }
.tabla .num, .num { text-align: right; font-variant-numeric: tabular-nums; }
.tabla tr.tenue td { opacity: .6; }
table[data-grid] thead th[tabindex] { cursor: pointer; user-select: none; transition: color .15s; }
table[data-grid] thead th[tabindex]:hover, table[data-grid] thead th[aria-sort] { color: var(--forest-2); }
table[data-grid] thead th[tabindex]:focus-visible { outline: 2px solid var(--forest-2); outline-offset: -2px; }
table[data-grid] thead th[tabindex]::after { content: "↕"; margin-left: 6px; opacity: .3; font-size: .95em; }
table[data-grid] thead th[aria-sort="ascending"]::after { content: "↑"; opacity: 1; color: #65A30D; }
table[data-grid] thead th[aria-sort="descending"]::after { content: "↓"; opacity: 1; color: #65A30D; }
.grid-pie { margin: -8px 6px 0; text-align: right; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tabla-gastos { font-size: .88rem; background: #fff; border-radius: 10px; }
.tabla-gastos td { padding: 7px 12px; }
.tabla-gastos tfoot td { border-top: 2px solid var(--card-bd); border-bottom: 0; }
.tabla-compacta td, .tabla-compacta th { padding: 6px 10px; }
/* Lista de precios: página ancha y tabla que nunca se desplaza de lado. */
body:has(.tabla-precios) :is(.top-in, .tabs-in, .main, .pie p) { max-width: 1680px; }
.tabla-caja:has(> .tabla-precios) { overflow-x: visible; }
.tabla-precios { width: 100%; }
.tabla-precios thead th:first-child { border-top-left-radius: 16px; }
.tabla-precios thead th:last-child { border-top-right-radius: 16px; }
.tabla-precios td { font-size: .88rem; }
.tabla-precios td.num { white-space: nowrap; }
.tabla-precios td.num .tenue { white-space: normal; }
.tabla-precios td.pr-sis { min-width: 200px; }
.tabla-precios th { white-space: normal; vertical-align: bottom; line-height: 1.25; }
.tabla-precios th.num { width: 9.25%; }
.tabla-precios th.num:last-child { width: 6%; }
.tabla-precios th, .tabla-precios td { padding-left: 9px; padding-right: 9px; }
.pr-acc { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pr-acc .btn-mini { padding: 4px 10px; font-size: .76rem; }
.pr-nombre { color: inherit; text-decoration: none; }
@media (min-width: 1200px) {
  .tabla-precios td { transition: background-color .15s, box-shadow .15s; }
  .tabla-precios tbody tr:nth-child(even) td { background: #FAFCF8; }
  .tabla-precios tbody tr:hover td { background: #F3F9E8; }
  .tabla-precios tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--lime); }
}
/* En pantallas donde las diez columnas no caben, cada sistema se muestra como tarjeta. */
@media (max-width: 1199px) {
  .tabla-caja:has(> .tabla-precios) { border: 0; background: none; border-radius: 0; box-shadow: none; }
  .tabla-precios, .tabla-precios tbody, .tabla-precios tr, .tabla-precios td { display: block; }
  .tabla-precios thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tabla-precios tbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
  .tabla-precios tr { border: 1px solid var(--line); border-radius: 16px; background: #fff; padding: 12px 14px; min-width: 0; box-shadow: var(--shadow); }
  .tabla-precios td, .tabla-precios tbody tr:hover td { border: 0; padding: 4px 0; background: none; }
  .tabla-precios td.pr-sis { min-width: 0; padding-bottom: 10px; margin-bottom: 6px; border-bottom: 1px solid var(--line); font-size: .95rem; }
  .tabla-precios td.num { display: flow-root; white-space: normal; }
  .tabla-precios td.num::before { content: attr(data-label); float: left; max-width: 58%; text-align: left; color: var(--muted); }
}
.tabla-edicion td { vertical-align: middle; }
.tabla-edicion input:not([type="checkbox"]) { min-width: 90px; padding: 6px 8px; font-size: .88rem; }
.tabla-edicion .col-desc { min-width: 260px; }
.tabla-edicion textarea { min-width: 240px; font-size: .86rem; }
.tabla-lineas td { vertical-align: middle; }
.tabla-lineas .col-on { width: 44px; text-align: center; }
.tabla-lineas .col-desc { min-width: 240px; }
.tabla-lineas .col-num { width: 130px; min-width: 100px; }
.tabla-lineas .col-num input { text-align: right; }
.tabla-lineas tr.apagada td:not(.col-on) { opacity: .5; }
.totales { margin-left: auto; margin-top: 10px; border-collapse: collapse; min-width: 280px; font-variant-numeric: tabular-nums; }
.totales th { text-align: left; font-weight: 500; color: var(--muted); padding: 5px 18px 5px 0; }
.totales td { text-align: right; padding: 5px 0; }
.totales tr.gran th, .totales tr.gran td { font-weight: 800; color: var(--deep); font-size: 1.05rem; border-top: 2px solid var(--deep); padding-top: 9px; }

/* Edición en el mismo renglón */
.en-renglon { display: inline-flex; align-items: center; gap: 5px; margin: 0; vertical-align: middle; }
.celda-usd { display: inline-flex; align-items: center; gap: 5px; }
.celda-usd i { font-style: normal; font-size: .78em; color: var(--muted); }
.tabla input.celda.celda { width: 6.4em; text-align: right; padding: 5px 8px; font-size: .9rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--deep); background: #F7FBF0; border: 1px dashed #BFD99A; border-radius: 9px; }
.tabla input.celda.celda.celda-corta { width: 4.4em; }
.tabla input.celda.celda.celda-pct { width: 3.7em; }
.tabla input.celda.celda:hover:not(:focus) { border-style: solid; border-color: var(--forest-2); background: #fff; }
.tabla input.celda.celda:focus { border-style: solid; border-color: var(--forest-2); background: #fff; box-shadow: 0 0 0 3px var(--anillo); outline: 0; }
select.sel-pill { width: auto; appearance: none; -webkit-appearance: none; font-weight: 700; font-size: .78rem; line-height: 1.3; padding: 4px 28px 4px 12px; border-radius: 999px; border: 1px solid transparent; cursor: pointer; background-color: #EEF1EC; color: #4B5A52; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 15px) 54%, calc(100% - 10px) 54%; background-size: 5px 5px; background-repeat: no-repeat; transition: box-shadow .15s, border-color .15s; }
select.sel-pill:hover { border-color: currentColor; }
select.sel-pill:focus { border-color: currentColor; box-shadow: 0 0 0 3px var(--anillo); outline: 0; }
select.sel-pill option { background: #fff; color: var(--ink); font-weight: 600; }
select.sel-pill[data-tono="azul"] { background-color: var(--blue-bg); color: var(--blue-txt); }
select.sel-pill[data-tono="verde"] { background-color: var(--green-bg); color: var(--green); }
select.sel-pill[data-tono="rojo"] { background-color: var(--red-bg); color: var(--red); }
select.sel-pill[data-tono="ambar"] { background-color: #FEF0CF; color: var(--amber-txt); }

/* ---------- Listas ---------- */
.lista { list-style: none; margin: 0; padding: 0; }
.lista li { display: flex; justify-content: space-between; align-items: baseline; gap: 6px 14px; flex-wrap: wrap; padding: 9px 0; border-bottom: 1px solid var(--line); }
.lista li:last-child { border-bottom: 0; }
.lista li > a { text-decoration: none; color: var(--ink); min-width: 0; }
.lista li > a:hover { color: var(--lime-txt); text-decoration: underline; }
.lista li > .tenue, .lista li > .vencido { font-size: .85rem; white-space: nowrap; }
.caja-alerta .lista li { border-bottom-color: var(--amber-bd); }
.reglas { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.checks li.si { color: var(--green); }
.checks li.no { color: var(--red); }
.checks li > span[aria-hidden] { font-weight: 800; display: inline-block; width: 1.2em; }
.datos { display: grid; grid-template-columns: fit-content(48%) minmax(0, 1fr); gap: 6px 16px; margin: 0; }
.datos dt { color: var(--muted); font-size: .88rem; }
.datos dd { margin: 0; font-weight: 500; overflow-wrap: break-word; min-width: 0; }

/* ---------- Inicio: tarjetas oscuras con cifras en lima ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.kpi {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 4px; min-width: 0;
  padding: 16px 18px 15px; border-radius: var(--radius); text-decoration: none; color: #fff;
  background: radial-gradient(260px 150px at 100% 0%, rgba(163, 230, 53, .18), transparent 70%), linear-gradient(160deg, #12352A 0%, var(--deep) 70%);
  border: 1px solid rgba(163, 230, 53, .14); box-shadow: 0 16px 34px -22px rgba(6, 24, 18, .9);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
a.kpi:hover { color: #fff; transform: translateY(-2px); border-color: rgba(163, 230, 53, .45); box-shadow: 0 22px 40px -22px rgba(6, 24, 18, .95); }
.kpi:focus-visible { outline-color: var(--lime); }
.kpi-tit { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: rgba(255, 255, 255, .64); }
.kpi-val { font-size: 1.85rem; font-weight: 800; color: var(--lime); font-variant-numeric: tabular-nums; line-height: 1.15; letter-spacing: -.02em; }
.kpi-det { font-size: .84rem; color: rgba(255, 255, 255, .62); }
.embudo { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.embudo a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); text-decoration: none; color: var(--ink); background: var(--bg-soft); transition: border-color .15s, background-color .15s, transform .15s; }
.embudo a:hover { border-color: #84CC16; background: var(--card-tint); transform: translateY(-1px); }
.embudo a > :first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.embudo b { flex: none; font-size: 1.1rem; color: var(--deep); }

/* ---------- Actividades ---------- */
.actividades { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.actividades li { border-left: 3px solid #84CC16; background: var(--bg-soft); border-radius: 0 var(--radius-s) var(--radius-s) 0; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.actividades li .tenue { font-size: .82rem; }
.actividades li.hecha { border-left-color: var(--line); opacity: .7; }

/* ---------- Materiales ---------- */
.docs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.doc-item { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.doc-item:hover { border-color: #C9DDB0; box-shadow: var(--shadow); }
.doc-ico { flex: none; width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; background: var(--deep); color: var(--lime); font-size: .72rem; font-weight: 800; letter-spacing: .04em; }
.doc-ico.x-pdf { background: linear-gradient(150deg, #E5484D, #B42318); color: #fff; }
.doc-ico.x-ppt { background: linear-gradient(150deg, #F97316, #C2410C); color: #fff; }
.doc-ico.x-doc { background: linear-gradient(150deg, #3B82F6, #1D4ED8); color: #fff; }
.doc-ico.x-xls { background: linear-gradient(150deg, #22C55E, #15803D); color: #fff; }
.doc-ico.x-img { background: linear-gradient(150deg, #A78BFA, #6D28D9); color: #fff; }
.doc-ico.x-vid { background: linear-gradient(150deg, #475569, #0F172A); color: #fff; }
.doc-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.doc-info span { font-size: .88rem; overflow-wrap: anywhere; }
.doc-info .tenue { font-size: .8rem; }
.doc-acc { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- Cotizador ---------- */
.cotizador-cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.cotizador-main { min-width: 0; }
.productos { display: flex; flex-direction: column; gap: 10px; }
.prod { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 110px; gap: 10px 16px; align-items: center; border: 1.5px solid var(--line); border-radius: 14px; padding: 12px; background: #fff; transition: border-color .15s, background-color .15s; }
.prod.sel { border-color: #84CC16; background: var(--card-tint); }
.prod-sel { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; min-width: 0; }
.prod-nom { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.prod-nom small { color: var(--muted); font-size: .82rem; }
.prod-precio { display: flex; flex-direction: column; gap: 1px; font-size: .84rem; color: var(--muted); }
.prod-precio b { color: var(--ink); }
.prod-cant { display: flex; flex-direction: column; gap: 3px; }
.prod-cant label { font-size: .74rem; font-weight: 600; color: var(--muted); }
.prod-cant input { text-align: right; }
.extra { padding-top: 12px; border-top: 1px dashed var(--line); }
.extra:first-of-type { border-top: 0; padding-top: 0; }
.resumen { position: sticky; top: 12px; color: #fff; border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 10px; background: radial-gradient(280px 180px at 100% 0%, rgba(163, 230, 53, .18), transparent 70%), linear-gradient(160deg, #12352A, var(--deep) 70%); border: 1px solid rgba(163, 230, 53, .14); box-shadow: 0 20px 40px -24px rgba(6, 24, 18, .9); }
.resumen h2 { color: #fff; }
.resumen :focus-visible { outline-color: var(--lime); }
.resumen-fila { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-variant-numeric: tabular-nums; }
.resumen-fila > span { color: rgba(255, 255, 255, .7); font-size: .9rem; }
.resumen-fila b { white-space: nowrap; }
.resumen-fila.gran { border-top: 1px solid rgba(255, 255, 255, .16); padding-top: 10px; flex-wrap: wrap; }
.resumen-fila.gran b { font-size: 1.3rem; color: var(--lime); white-space: nowrap; margin-left: auto; }
.resumen .nota { color: var(--lime-soft); }
.resumen .vivo-nota { color: rgba(255, 255, 255, .7); }
.resumen .btn { background: var(--lime); color: var(--deep); border-color: var(--lime); box-shadow: 0 10px 22px -14px rgba(163, 230, 53, .8); }
.resumen .btn:hover { background: var(--lime-hover); border-color: var(--lime-hover); color: var(--deep); }
.resumen .btn-sec { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); box-shadow: none; }
.resumen .btn-sec:hover { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .6); }
.resumen-plano { position: static; background: var(--bg-soft); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.resumen-plano .resumen-fila > span { color: var(--muted); }
.resumen-plano .resumen-fila.gran { border-top-color: var(--line); }
.resumen-plano .resumen-fila.gran b { color: var(--deep); }

/* ---------- Plan (Gantt): los colores coinciden con los del dibujo ---------- */
.gantt-caja { margin: 0; display: flex; flex-direction: column; gap: 8px; overflow-x: auto; }
.gantt { display: block; width: 100%; min-width: 560px; height: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-s); }
.leyenda { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .8rem; color: var(--muted); }
.ley { display: inline-flex; align-items: center; gap: 6px; }
.ley::before { content: ''; width: 14px; height: 9px; border-radius: 3px; background: var(--muted); }
.ley-arranque::before { background: #1E3A5F; }
.ley-conf::before { background: #2B6CB0; }
.ley-pruebas::before { background: #8FB3DE; }
.ley-libera::before { background: #F59E0B; }
.ley-hito::before { width: 9px; height: 9px; border-radius: 1px; background: #1E3A5F; transform: rotate(45deg); }

/* ---------- Entrar y páginas sueltas: foto de fondo con capa oscura ---------- */
body.suelta { background: var(--deep-2); }
body.suelta::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(700px 480px at 12% 18%, rgba(163, 230, 53, .14), transparent 70%), linear-gradient(100deg, rgba(6, 24, 18, .95) 0%, rgba(6, 24, 18, .84) 46%, rgba(6, 24, 18, .6) 100%), url("fondo/acceso-1920.webp") center / cover no-repeat;
}
.suelta-in { min-height: 100vh; display: grid; place-items: center; padding-block: 32px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.entrar {
  width: 100%; max-width: 430px; color: #fff; border-radius: 22px; padding: 32px 28px; display: flex; flex-direction: column; gap: 16px;
  background: rgba(10, 31, 24, .62); -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .75);
}
.entrar h1 { color: #fff; font-size: 1.75rem; }
.entrar .tenue, .entrar .nota { color: rgba(255, 255, 255, .7); }
.entrar a:not(.btn) { color: var(--lime); }
.entrar a:not(.btn):hover { color: var(--lime-hover); }
.entrar :focus-visible { outline-color: var(--lime); }
.entrar .campo > label { color: rgba(255, 255, 255, .9); }
.entrar input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) { background: rgba(255, 255, 255, .96); border-color: transparent; color: var(--ink); padding-block: 11px; }
.entrar input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus { border-color: var(--lime); box-shadow: 0 0 0 3px rgba(163, 230, 53, .5); }
.entrar .btn { background: var(--lime); color: var(--deep); border-color: var(--lime); padding-block: 12px; font-size: .98rem; box-shadow: 0 12px 26px -14px rgba(163, 230, 53, .85); }
.entrar .btn:hover { background: var(--lime-hover); border-color: var(--lime-hover); color: var(--deep); }
.entrar-marca { display: flex; align-items: center; gap: 10px; color: var(--deep); }
.entrar .entrar-marca { color: #fff; }
.entrar-marca .marca-txt b { color: var(--lime); }
.form-entrar { display: flex; flex-direction: column; gap: 14px; }
.entrar .caja { box-shadow: none; padding: 0; border: 0; background: none; color: inherit; }

/* ---------- Documentos imprimibles ---------- */
body.doc { background: #E7ECE5; }
.doc-barra { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding-block: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); background: var(--deep); }
.doc-barra :focus-visible { outline-color: var(--lime); }
.doc-barra .btn:not(.btn-sec) { background: var(--lime); color: var(--deep); border-color: var(--lime); }
.doc-barra .btn:not(.btn-sec):hover { background: var(--lime-hover); border-color: var(--lime-hover); color: var(--deep); }
.doc-barra .btn-sec { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); box-shadow: none; }
.doc-barra .btn-sec:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.doc-tip { color: rgba(255, 255, 255, .7); font-size: .84rem; }
.hoja { position: relative; overflow: hidden; background: #fff; width: min(8.5in, calc(100% - 32px)); margin: 24px auto 48px; padding: clamp(18px, 5vw, .6in); box-shadow: 0 6px 30px rgba(16, 35, 27, .14); border-radius: 4px; display: flex; flex-direction: column; gap: 20px; font-size: 13.5px; }
.hoja > * { position: relative; z-index: 1; min-width: 0; }
.marca-agua { position: absolute !important; z-index: 0 !important; inset: 0; display: grid; place-items: center; pointer-events: none; font-size: clamp(48px, 13vw, 110px); font-weight: 800; letter-spacing: .08em; color: rgba(15, 61, 46, .07); transform: rotate(-28deg); text-transform: uppercase; white-space: nowrap; }
.doc-enc { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 3px solid var(--forest); }
.emisor { display: flex; gap: 12px; align-items: flex-start; font-size: .82rem; color: var(--muted); }
.emisor .logo-mark { width: 40px; height: 44px; }
.emisor-marca { font-size: 1.5rem; font-weight: 800; color: var(--deep); line-height: 1.1; }
.doc-tit { text-align: right; }
.doc-tit h1 { font-size: 1.5rem; text-transform: uppercase; letter-spacing: .04em; }
.doc-tit dl { display: grid; grid-template-columns: auto auto; gap: 2px 10px; justify-content: end; margin: 8px 0 0; font-size: .82rem; }
.doc-tit dt { color: var(--muted); }
.doc-tit dd { margin: 0; font-weight: 600; }
.doc-sec { display: flex; flex-direction: column; gap: 10px; }
.doc-sec h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--forest-2); border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.doc-partes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.pago-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; }
.pago-cols > .nota { grid-column: 1 / -1; }
.hoja .tabla-caja { box-shadow: none; border-radius: 10px; }
.hoja .tabla { font-size: .86rem; }
.hoja .tabla tbody tr:nth-child(even) td, .hoja .tabla tbody tr:hover td { background: none; box-shadow: none; }

/* Campos que se editan en la misma ficha: parecen texto hasta pasar el cursor o enfocar. */
.vivo { display: flex; flex-direction: column; gap: 14px; }
.vivo .rejilla-campos { gap: 8px 14px; }
.vivo .campo > label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding-left: 9px; }
.vivo .campo > small { padding-left: 9px; }
.vivo input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .vivo select, .vivo textarea { border-color: transparent; background-color: transparent; padding: 6px 8px; font-weight: 600; color: var(--ink); text-overflow: ellipsis; }
.vivo input::placeholder, .vivo textarea::placeholder { font-weight: 500; color: #9AA89F; }
.vivo .campo:hover input:not([type="checkbox"]):not([type="radio"]):not(:focus), .vivo .campo:hover select:not(:focus), .vivo .campo:hover textarea:not(:focus) { border-color: var(--campo-bd); background-color: var(--bg-soft); }
.vivo input:not([type="checkbox"]):not([type="radio"]):focus, .vivo select:focus, .vivo textarea:focus { background-color: #fff; border-color: var(--forest-2); }
.vivo textarea { font-weight: 500; background-color: var(--bg-soft); border-color: var(--line); }
.vivo-sub { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--lime-txt); padding: 10px 0 0 9px; border-top: 1px solid var(--line); margin: 0; }
.vivo-nota { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); }
.vivo-nota .punto-fijo { animation: none; }
.vivo .sin-etiqueta > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.caja-enc .etapa-viva { align-items: center; gap: 8px; }
.etapa-viva { display: inline-flex; margin: 0; }
.etapa-viva select { width: auto; font-weight: 700; font-size: .84rem; padding: 5px 30px 5px 12px; border-radius: 999px; border-color: var(--card-bd); background-color: var(--card-tint); color: var(--lime-txt); cursor: pointer; }

/* Estado del guardado automático */
.guardado { position: fixed; z-index: 50; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); max-width: min(420px, calc(100vw - 32px)); display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; font-size: .86rem; font-weight: 700; color: #fff; background: var(--deep); box-shadow: var(--shadow-lg); transition: opacity .4s, background-color .2s; }
.guardado.g-ok { background: var(--lime); color: var(--deep); }
.guardado.g-quieto { opacity: .6; }
.guardado.g-pendiente { background: #fff; color: var(--muted); border: 1px solid var(--line); }
.guardado.g-error { background: var(--red); color: #fff; border-radius: 14px; }
.guardado.g-guardando::before { content: ''; width: 13px; height: 13px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .3); border-top-color: var(--lime); animation: girar .7s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }
.invalido { border-color: var(--red) !important; box-shadow: 0 0 0 3px rgba(180, 35, 24, .14) !important; }

/* Vista previa de materiales */
dialog.visor { width: min(1120px, calc(100vw - 24px)); height: min(90vh, 920px); max-width: none; max-height: none; padding: 0; border: 0; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-lg); background: var(--deep); color: #fff; }
dialog.visor[open] { display: flex; flex-direction: column; }
dialog.visor::backdrop { background: rgba(6, 24, 18, .7); backdrop-filter: blur(4px); }
.visor-barra { flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--deep-2); border-bottom: 1px solid rgba(255, 255, 255, .08); }
.visor-barra :focus-visible { outline-color: var(--lime); }
.visor-tit { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.visor-barra .btn:not(.btn-sec) { background: var(--lime); color: var(--deep); border-color: var(--lime); }
.visor-barra .btn:not(.btn-sec):hover { background: var(--lime-hover); border-color: var(--lime-hover); color: var(--deep); }
.visor-barra .btn-sec { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); box-shadow: none; }
.visor-barra .btn-sec:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.visor-cuerpo { flex: 1; min-height: 0; display: grid; place-items: center; background: #12261E; }
.visor-cuerpo iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.visor-cuerpo img, .visor-cuerpo video { max-width: 100%; max-height: 100%; object-fit: contain; }
.visor-cuerpo p { color: rgba(255, 255, 255, .72); padding: 24px; text-align: center; }

/* Página que se muestra dentro del visor para Word, Excel y PowerPoint */
body.vista { background: var(--bg); padding: 18px max(16px, env(safe-area-inset-right, 0px)) 40px max(16px, env(safe-area-inset-left, 0px)); }
.vista-in { max-width: 900px; margin-inline: auto; display: flex; flex-direction: column; gap: 14px; }
.vista-nota { font-size: .84rem; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; }
.lamina { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.lamina-num { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--lime-txt); }
.lamina h2 { font-size: 1.1rem; }
.lamina p { font-size: .93rem; overflow-wrap: anywhere; }
.lamina ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; font-size: .93rem; }
.lamina-fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.lamina-fotos img { width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-soft); }
.vista-texto p { margin-bottom: .6em; }
.vista-texto h2 { margin: .4em 0; }

/* Manual breve */
.ayuda-intro { color: var(--muted); font-size: 1rem; margin-top: -8px; }
.pasos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.paso { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.paso-txt { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.paso-num { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1.05rem; color: var(--deep); background: var(--lime); box-shadow: 0 8px 16px -10px rgba(101, 163, 13, .9); }
.paso h2 { font-size: 1.2rem; }
.paso-img { display: block; min-width: 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 10px 30px -16px rgba(6, 24, 18, .45); }
.paso-img img { display: block; width: 100%; height: auto; }
.ayuda-tips .reglas { list-style: none; padding-left: 0; }

@media (min-width: 900px) and (min-height: 620px) { .top { position: sticky; top: 0; } .resumen { top: 122px; } }

/* ---------- Movimiento: entrada suave al cargar, como en el inicio del sitio ---------- */
@media (prefers-reduced-motion: no-preference) {
  @keyframes entra { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
  .main > * { animation: entra .5s cubic-bezier(.2, .8, .2, 1) backwards; }
  .main > *:nth-child(2) { animation-delay: .05s; }
  .main > *:nth-child(3) { animation-delay: .1s; }
  .main > *:nth-child(4) { animation-delay: .15s; }
  .main > *:nth-child(n+5) { animation-delay: .2s; }
  .kpi { animation: entra .5s cubic-bezier(.2, .8, .2, 1) backwards; }
  .kpi:nth-child(2) { animation-delay: .07s; }
  .kpi:nth-child(3) { animation-delay: .14s; }
  .kpi:nth-child(4) { animation-delay: .21s; }
  .entrar, .acuerdo { animation: entra .6s cubic-bezier(.2, .8, .2, 1) backwards; }
}
@media (prefers-reduced-motion: reduce) {
  .punto::after, .guardado.g-guardando::before { animation: none; }
  .btn, .kpi, .embudo a, .doc-item, select.sel-pill, .tabla td { transition: none; }
}

/* ---------- Pantallas medianas y chicas ---------- */
@media (max-width: 900px) {
  .rejilla-2, .cotizador-cols { grid-template-columns: minmax(0, 1fr); }
  .resumen { position: static; }
  .actividad-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .actividad-form .campo.ancho { grid-column: 1 / -1; }
  body.suelta::before { background-image: radial-gradient(500px 380px at 20% 10%, rgba(163, 230, 53, .14), transparent 70%), linear-gradient(180deg, rgba(6, 24, 18, .88) 0%, rgba(6, 24, 18, .8) 100%), url("fondo/acceso-960.webp"); }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  h1 { font-size: 1.35rem; }
  .main { padding-block: 18px 32px; gap: 14px; }
  .caja { padding: 14px; }
  .marca-sub, .quien-txt, .btn-salir span, .enlinea-txt { display: none; }
  .quien { gap: 6px; }
  .quien-nombre { padding: 3px; }
  .rol { display: none; }
  .enc h1 { font-size: 1.45rem; }
  .enlinea-pop { position: fixed; left: 16px; right: 16px; top: 62px; width: auto; }
  .enlinea-pop::before { display: none; }
  .tabs a { padding: 7px 12px; }
  .paso { grid-template-columns: minmax(0, 1fr); padding: 14px; gap: 14px; }
  dialog.visor { width: 100vw; height: 100dvh; border-radius: 0; }
  .visor-barra .btn span { display: none; }
  .prod { grid-template-columns: minmax(0, 1fr) 96px; }
  .prod-sel { grid-column: 1 / -1; }
  .actividad-form { grid-template-columns: minmax(0, 1fr); }
  .datos { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .datos dd { margin-bottom: 8px; }
  .doc-partes, .pago-cols { grid-template-columns: minmax(0, 1fr); }
  .doc-tit { text-align: left; }
  .doc-tit dl { justify-content: start; }
  .doc-item { flex-wrap: wrap; }
  .doc-acc { width: 100%; justify-content: flex-start; }
  .totales { min-width: 0; width: 100%; }
  .kpi-val { font-size: 1.55rem; }
  .enc-acc { width: 100%; }
  .entrar { padding: 26px 20px; border-radius: 18px; }
}

/* ---------- Impresión (carta) ---------- */
@page { size: letter; margin: 12mm; }
@media print {
  body, body.doc { background: #fff; font-size: 12px; }
  body.suelta::before { display: none; }
  .no-print, .top, .tabs, .pie, .guardado, .saltar, dialog.visor, .enc-acc, .zona-peligro, .acciones-rapidas, form.en-linea, .btn { display: none !important; }
  .hoja { width: auto; margin: 0; padding: 0; box-shadow: none; border-radius: 0; overflow: visible; }
  .caja, .kpi, .tabla-caja { box-shadow: none; }
  .kpi { background: #fff; color: var(--ink); border: 1px solid #CCD6CC; }
  .kpi-tit, .kpi-det { color: var(--muted); }
  .kpi-val { color: var(--deep); }
  .tabla-caja { overflow: visible; border-color: #CCD6CC; }
  .gantt-caja { overflow: visible; }
  .gantt { min-width: 0; }
  .tabla tr, .totales, .gantt-caja, .doc-partes, .pago, .emisor { break-inside: avoid; }
  .doc-sec h2 { break-after: avoid; }
  .salto { break-before: page; }
  a { color: inherit; text-decoration: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Acuerdo de socio y firma digital ---------- */
.acuerdo { width: 100%; max-width: 960px; background: var(--card); border: 1px solid rgba(255, 255, 255, .2); border-radius: 22px; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .7); padding: 24px 30px 22px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ac-enc { display: flex; flex-direction: column; gap: 5px; }
.ac-enc .entrar-marca { flex-wrap: wrap; }
.ac-enc .entrar-marca .marca-txt b { color: #65A30D; }
.ac-version { margin-left: auto; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; }
.ac-sobre { margin: 6px 0 0; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--lime-txt); }
.ac-enc h1 { font-size: clamp(1.4rem, 1.05rem + 1.5vw, 1.9rem); letter-spacing: -.02em; }
.ac-sub { margin: 0; color: var(--muted); font-size: 1rem; }
.ac-cols { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 18px; align-items: start; }
.ac-puntos { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ac-punto { display: flex; gap: 12px; align-items: flex-start; background: var(--card-tint); border: 1px solid var(--card-bd); border-radius: 14px; padding: 12px 15px; min-width: 0; }
.ac-punto > div { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ac-punto h2 { font-size: 1.02rem; }
.ac-punto p { margin: 0; font-size: .93rem; color: #33463C; }
.ac-ico { flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #fff; border: 1px solid var(--card-bd); color: var(--forest-2); }
.ac-recibe { background: var(--amber-bg); border-color: var(--amber-bd); }
.ac-recibe .ac-ico { border-color: var(--amber-bd); color: var(--amber-txt); }
.ac-ia2 { background: var(--deep); border-color: var(--deep); }
.ac-ia2 h2 { color: #fff; }
.ac-ia2 p, .ac-ia2 .ac-lista li { color: rgba(255, 255, 255, .78); }
.ac-ia2 .ac-ico { background: rgba(163, 230, 53, .14); border-color: rgba(163, 230, 53, .35); color: var(--lime); }
.ac-ia2 .ac-lista li::before { background: var(--lime); }
.ac-lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ac-lista li { position: relative; padding-left: 16px; font-size: .93rem; color: #33463C; }
.ac-lista li::before { content: ''; position: absolute; left: 1px; top: .58em; width: 6px; height: 6px; border-radius: 50%; background: #65A30D; }
.ac-nota { margin: 2px 2px 0; font-size: .8rem; color: var(--muted); }
.ac-firma { background: var(--bg-soft); border: 1px solid var(--card-bd); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ac-firma h2 { font-size: 1.08rem; }
.ac-partes { margin: 0; font-size: .84rem; color: var(--muted); }
.firma-prev { display: flex; flex-direction: column; gap: 4px; background: #fff; border: 1px dashed #BFD99A; border-radius: 12px; padding: 12px 18px 10px; min-width: 0; }
.firma-prev > span, .firma-trazo > span { font-family: 'Caveat', 'Segoe Script', 'Brush Script MT', cursive; font-weight: 600; font-size: 2.3rem; line-height: 1.15; color: var(--forest); border-bottom: 1.5px solid #A9BBA4; padding: 0 4px 2px; overflow-wrap: anywhere; min-height: 1.2em; }
.firma-prev > span.firma-vacia { font-family: var(--font); font-size: 1rem; font-weight: 500; color: #9AA89F; display: flex; align-items: flex-end; padding-bottom: 8px; }
.firma-prev small, .firma-trazo small { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.btn-firmar { font-size: 1.05rem; padding-block: 13px; }
.ac-salir { display: flex; justify-content: center; margin: 0; }
.ac-salir .btn-link { color: var(--muted); font-size: .9rem; }

/* Constancia de firma */
.firma-bloque { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 22px; align-items: start; }
.firma-trazo { display: flex; flex-direction: column; gap: 6px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px; padding: 18px 18px 12px; min-width: 0; }
.huella { font-family: var(--mono); font-size: .8rem; }
.ac-doc h3 { font-size: 1rem; margin-top: 14px; }
.ac-doc p, .ac-doc li { font-size: .9rem; }
.ac-doc ul { margin: 6px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 5px; }
.ac-doc-tit { font-weight: 800; color: var(--deep); letter-spacing: .02em; margin: 0; }

@media (max-width: 900px) {
  .ac-cols { grid-template-columns: minmax(0, 1fr); }
  .firma-bloque { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .acuerdo { padding: 22px 16px 20px; border-radius: 18px; gap: 16px; }
  .ac-version { margin-left: 0; }
  .ac-firma { padding: 16px 14px; }
  .firma-prev > span, .firma-trazo > span { font-size: 1.9rem; }
}
@media print {
  .acuerdo { box-shadow: none; border-color: var(--line); }
  .ac-ia2 { background: var(--green-bg); border-color: #CDE8A6; }
  .ac-ia2 h2 { color: var(--deep); }
  .ac-ia2 p, .ac-ia2 .ac-lista li { color: #33463C; }
  .firma-bloque, .ac-doc li { break-inside: avoid; }
  .ac-doc h3 { break-after: avoid; }
}

/* ============ Cuenta de cobro del socio ============ */
.caja-cobro { margin-top: 18px; }
.opciones-cobro { list-style: none; margin: 4px 0 18px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.opciones-cobro li { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-soft); min-width: 0; }
.opciones-cobro li:first-child { border-color: #84CC16; background: var(--card-tint); box-shadow: 0 0 0 3px rgba(163, 230, 53, .25); }
.opciones-cobro li:first-child b::after { content: "Recomendada"; margin-left: 8px; padding: 2px 8px; border-radius: 99px; background: var(--lime); color: var(--deep); font-size: .68rem; font-weight: 700; letter-spacing: .03em; vertical-align: middle; white-space: nowrap; }
.opciones-cobro b { font-size: .93rem; }
.opciones-cobro span { color: var(--muted); font-size: .84rem; line-height: 1.4; }
