:root {
  --bg: #e9ecf1;
  --panel: #ffffff;
  --face: #f3f4f7;          /* fondo de las fichas (como el gris de Windows) */
  --line: #c8ced8;
  --line-soft: #dde2e9;
  --text: #1d2633;
  --muted: #5e6b7c;
  --accent: #D4550E;        /* naranja GESSO (oscurecido para texto blanco legible) */
  --accent-soft: #FDE9DC;
  --gesso: #F3671B;         /* naranja del logotipo */
  --navy: #1B1F2B;          /* gris azulado de la marca: barra lateral */
  --navy-2: #252B3A;
  --navy-3: #313849;
  --side-fg: #D5D9E2;
  --side-muted: #8A93A6;
  --side-w: 264px;
  --pressed: #D3D7DF;       /* botón pulsado (gris de Darby) */
  --pressed-line: #8F98A8;
  --font-brand: "Raleway", "Segoe UI", system-ui, Arial, sans-serif;
  --accent-text: #ffffff;
  --danger: #b3261e;
  --ok: #1e7a3c;
  --warn-bg: #fff4d6;
  --input: #ffffff;
  --input-ro: #eef0f4;
  --input-key: #fff9e8;     /* cajas de búsqueda sin color propio */
  --input-req: #ffe6f0;     /* rosa Darby (backColorCajaAjena): el valor tiene que existir en la tabla */
  --input-free: #fceecc;    /* crema Darby (backColorCajaAjenaCarn): texto libre o elegido de la tabla */
  --row-alt: #f7f9fc;
  --row-hover: #fef3ec;
  --row-sel: #fce1cf;
  --shadow: 0 1px 2px rgba(16,24,40,.08), 0 2px 6px rgba(16,24,40,.06);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color-scheme: light;
}
/* Raleway (OFL, fonts/OFL-Raleway.txt): la tipografía de la marca, para la marca, los menús y los títulos */
@font-face { font-family: "Raleway"; font-weight: 500; font-display: swap; src: url(../fonts/raleway-500.woff) format("woff"); }
@font-face { font-family: "Raleway"; font-weight: 600; font-display: swap; src: url(../fonts/raleway-600.woff) format("woff"); }
@font-face { font-family: "Raleway"; font-weight: 700 800; font-display: swap; src: url(../fonts/raleway-700.woff) format("woff"); }
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 13px/1.35 var(--font); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

/* ------------------------------------------------------------ login */
.login-wrap { min-height: 100%; display: grid; place-items: center; padding: 16px; background: var(--navy); }
.login { width: 100%; max-width: 370px; background: var(--panel); border-radius: 12px; box-shadow: 0 20px 50px rgba(0,0,0,.35); padding: 30px 30px 24px; border-top: 5px solid var(--gesso); }
.login-marca { display: flex; align-items: center; gap: 10px; }
.login-logo { height: 40px; width: auto; color: var(--gesso); }
.login-marca .erp, .side .marca .erp { font: 800 13px/1 var(--font-brand); letter-spacing: .14em; color: #fff; background: var(--gesso); border-radius: 4px; padding: 4px 6px 3px; }
.login .lema { margin: 8px 0 18px; color: var(--muted); font: 600 13px/1.3 var(--font-brand); letter-spacing: .02em; }
.login label { display: block; font-weight: 600; margin: 12px 0 4px; }
.login input { width: 100%; height: 36px; border: 1px solid var(--line); border-radius: 6px; padding: 0 10px; background: #fff; }
.login input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.login button { margin-top: 20px; width: 100%; height: 38px; border: 0; border-radius: 6px; background: var(--accent); color: #fff; font: 700 14px/1 var(--font-brand); letter-spacing: .03em; }
.login .err { color: var(--danger); margin-top: 12px; min-height: 18px; }

/* ------------------------------------------------------------ marco general
   barra lateral oscura (menú general: secciones de Darby, submenús y pantallas) + zona de trabajo:
   barra superior (ventanas abiertas, empresa, agenda) de 46px y escritorio con scroll propio.
   --top2 = lo que la barra superior pasa de 44px; se descuenta de las alturas calculadas con 100vh */
:root { --top2: 2px; }
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); height: 100vh; }
.shell.mini { --side-w: 60px; }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.desk { flex: 1; overflow: auto; }

.side { background: var(--navy); color: var(--side-fg); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.side-top { display: flex; align-items: center; gap: 8px; padding: 12px 10px 8px 14px; }
.side .marca { display: flex; align-items: center; gap: 9px; border: 0; background: none; padding: 0; color: #fff; min-width: 0; }
.side .marca svg { height: 24px; width: auto; color: var(--gesso); flex: none; }
.logo-sim { display: none; }
.plegar { margin-left: auto; border: 0; background: none; color: var(--side-muted); width: 30px; height: 30px; border-radius: 6px; display: grid; place-items: center; flex: none; }
.plegar:hover { background: var(--navy-3); color: #fff; }
/* mejora n.º 157: replegar todos los menús (junto a «plegar»; sin él en el menú estrecho) */
.replegar { margin-left: auto; border: 0; background: none; color: var(--side-muted); width: 30px; height: 30px; border-radius: 6px; display: grid; place-items: center; flex: none; }
.replegar:hover { background: var(--navy-3); color: #fff; }
.replegar + .plegar { margin-left: 0; }
.shell.mini .replegar { display: none; }
.side .buscar { display: flex; align-items: center; gap: 8px; margin: 4px 10px 8px; height: 32px; border-radius: 7px; border: 1px solid var(--navy-3); background: var(--navy-2); color: var(--side-muted); padding: 0 8px 0 10px; text-align: left; }
.side .buscar:hover { color: #fff; border-color: var(--side-muted); }
.side .buscar span { flex: 1; }
.side .buscar kbd { font: 600 10.5px/1 var(--font); border: 1px solid var(--navy-3); border-radius: 4px; padding: 3px 5px; }
.nav { flex: 1; overflow: auto; padding: 2px 8px 10px; scrollbar-width: thin; scrollbar-color: var(--navy-3) transparent; }
.sec { margin-bottom: 1px; }
.sec-btn { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; color: var(--side-fg); padding: 7px 8px; border-radius: 7px; text-align: left; font: 600 13.5px/1.2 var(--font-brand); }
.sec-btn:hover { background: var(--navy-2); color: #fff; }
.sec-btn .ico { width: 20px; height: 20px; flex: none; display: grid; place-items: center; color: var(--side-muted); position: relative; }
.sec-btn .ico::after { content: ""; position: absolute; right: -3px; bottom: -2px; width: 8px; height: 8px; border-radius: 50%; background: var(--sec); box-shadow: 0 0 0 2px var(--navy); }
.sec-btn .lbl { flex: 1; min-width: 0; }
.sec-btn .ctx { font: 600 10.5px/1 var(--font); background: var(--navy-3); color: #fff; border-radius: 4px; padding: 3px 5px; max-width: 86px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chev { color: var(--side-muted); transition: transform .15s; flex: none; }
.sec.abierta > .sec-btn .chev { transform: rotate(90deg); }
.sec.activa > .sec-btn, .sec.activa > .sec-btn .ico { color: #fff; }
.items { display: none; padding: 2px 0 8px 28px; }
.sec.abierta > .items { display: block; }
.sub-btn { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; color: var(--side-muted); text-align: left; padding: 5px 8px; border-radius: 6px; font: 600 12.5px/1.25 var(--font); }
.sub-btn:hover { background: var(--navy-2); color: #fff; }
.sub-btn .chev { margin-left: auto; }
.sub.abierto > .sub-btn .chev { transform: rotate(90deg); }
.sub.activo > .sub-btn { color: #fff; }
.sub-items { display: none; margin: 1px 0 4px 8px; padding-left: 8px; border-left: 1px solid var(--navy-3); }
.sub.abierto > .sub-items { display: block; }
.side .it { display: block; width: 100%; border: 0; background: none; color: var(--side-fg); text-align: left; padding: 5px 8px; border-radius: 6px; position: relative; font-size: 13px; line-height: 1.25; }
.side .it:hover:not(:disabled) { background: var(--navy-2); color: #fff; }
.side .it:disabled { color: #636B7E; cursor: default; }
.side .it.sin-ctx { color: #8F97A8; }
/* pantalla actual: iluminada, con la marca naranja de GESSO */
.side .it.actual { background: var(--navy-3); color: #fff; font-weight: 700; }
.side .it.actual::before { content: ""; position: absolute; left: -7px; top: 5px; bottom: 5px; width: 3px; border-radius: 2px; background: var(--gesso); }
.side .sub-items .it.actual::before { left: -9px; }
.side .menu-context { background: var(--navy-2); color: var(--side-fg); margin: 2px 0 4px; }
.side .menu-context .link { color: #fff; }
.side .menu-context .x, .side .menu-context.empty { color: var(--side-muted); }
.side-pie { border-top: 1px solid var(--navy-3); padding: 10px; display: grid; gap: 6px; }
.side .emp-btn { width: 100%; max-width: none; height: auto; border-color: var(--navy-3); background: var(--navy-2); color: #fff; padding: 5px 8px 5px 5px; }
.side .emp-btn:hover { border-color: var(--side-muted); }
.side .emp-txt small { color: var(--side-muted); }
.side .emp-txt b { white-space: normal; overflow-wrap: anywhere; font-size: 12.5px; }
.side .emp-logo { width: 70px; height: 32px; }
.side .emp-list { top: auto; bottom: calc(100% + 4px); left: 0; right: 0; width: auto; max-height: 70vh; }
.emp-list b { overflow-wrap: anywhere; }
.side .emp-list .emp-logo { width: 72px; height: 34px; }
.usuario { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--side-fg); min-width: 0; }
.usuario .u { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usuario button { margin-left: auto; display: flex; align-items: center; gap: 5px; border: 1px solid var(--navy-3); background: none; color: var(--side-fg); border-radius: 6px; height: 26px; padding: 0 8px; }
.usuario button:hover { color: #fff; border-color: var(--side-muted); }
.shell.mini .lbl, .shell.mini .chev, .shell.mini .items, .shell.mini .buscar, .shell.mini .marca .erp, .shell.mini .sec-btn .ctx,
.shell.mini .usuario, .shell.mini .side .emp-txt, .shell.mini .side .emp-flecha, .shell.mini .logo-full { display: none; }
.shell.mini .logo-sim { display: block; height: 26px; }
.shell.mini .side-top { flex-direction: column; padding: 12px 6px; }
.shell.mini .plegar { margin: 0; }
.shell.mini .sec-btn { justify-content: center; padding: 9px 0; }
.shell.mini .sec.activa > .sec-btn { background: var(--navy-3); box-shadow: inset 3px 0 0 var(--gesso); }
.shell.mini .side-pie { padding: 8px 5px; }
.shell.mini .side .emp-btn { justify-content: center; padding: 3px; }
.shell.mini .side .emp-logo { width: 44px; height: 28px; }

.top { display: flex; align-items: flex-end; gap: 8px; height: 46px; flex: none; background: var(--panel); border-bottom: 1px solid var(--line); padding: 0 12px 0 10px; position: relative; z-index: 50; }
.menu-movil { display: none; border: 1px solid var(--line); background: var(--panel); border-radius: 6px; height: 32px; width: 36px; margin-bottom: 6px; place-items: center; }
.wintabs { display: flex; gap: 2px; overflow-x: auto; overflow-y: hidden; flex: 1; min-width: 0; scrollbar-width: none; margin-bottom: -1px; position: relative; z-index: 1; }
.wintabs::-webkit-scrollbar { display: none; }
.wintab { display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 6px 0 11px; border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0;
          background: none; color: var(--muted); white-space: nowrap; cursor: pointer; position: relative; }
.wintab .pt { width: 8px; height: 8px; border-radius: 2px; background: var(--sec, #C0C0C0); flex: none; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.wintab:hover { color: var(--text); background: var(--face); }
.wintab.active { background: var(--bg); color: var(--text); font-weight: 700; border-color: var(--line); }
.wintab.active::before { content: ""; position: absolute; left: -1px; right: -1px; top: -1px; height: 3px; border-radius: 8px 8px 0 0; background: var(--gesso); }
.wintab.inicio { font: 700 13px/1 var(--font-brand); }
/* n.º 226: nombre corto en la pestaña; si aún no cabe, se corta con «…» (el nombre entero, al pasar el ratón) */
.wintab .wt { max-width: 230px; overflow: hidden; text-overflow: ellipsis; }
.wintab .x { border: 0; background: none; width: 20px; height: 20px; border-radius: 4px; color: inherit; opacity: .6; line-height: 1; }
.wintab .x:hover { background: var(--line-soft); opacity: 1; }
.wintab .dot { width: 7px; height: 7px; border-radius: 50%; background: #f0b429; }
.right { display: flex; align-items: center; gap: 8px; margin-left: 8px; white-space: nowrap; align-self: center; }
.agenda-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); padding: 0 10px; }
.agenda-btn:hover { border-color: var(--pressed-line); }
.empsec-btn { border-left: 3px solid var(--sec, var(--line)); }
.empsec-btn svg { color: var(--sec, currentColor); }
/* empresa de trabajo: su logotipo y su nombre, para reconocerla de un vistazo (y cambiar de empresa) */
.emp { position: relative; }
.emp-btn { display: flex; align-items: center; gap: 9px; height: 38px; padding: 2px 9px 2px 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); max-width: 320px; text-align: left; }
.emp-btn:hover { border-color: var(--pressed-line); }
.emp-logo { height: 32px; width: 78px; border-radius: 5px; background: #fff; display: grid; place-items: center; overflow: hidden; flex: none; border: 1px solid var(--line-soft); }
/* el logotipo ocupa la caja sin recortarse, sea cual sea su tamaño o proporción */
.emp-logo { padding: 2px 3px; }
.emp-logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.emp-logo .ini { font: 800 16px/1 var(--font-brand); color: var(--navy); }
.emp-txt { display: grid; min-width: 0; line-height: 1.15; }
.emp-txt small { font-size: 10.5px; color: var(--muted); }
.emp-txt b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emp-flecha { color: var(--muted); font-size: 11px; }
.emp-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 80; width: 320px; max-height: 60vh; overflow: auto; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 14px 34px rgba(0,0,0,.22); padding: 6px; }
.emp-list button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 6px; border-radius: 7px; text-align: left; }
.emp-list button:hover, .emp-list button.on { background: var(--accent-soft); }
.emp-list .emp-logo { height: 38px; width: 90px; }

/* buscador de pantallas (Ctrl+K) */
.paleta { position: fixed; inset: 0; background: rgba(10,12,18,.45); display: grid; place-items: start center; padding: 12vh 16px 0; z-index: 200; }
.paleta-caja { width: min(580px, 100%); background: var(--panel); border-radius: 10px; box-shadow: 0 20px 50px rgba(0,0,0,.35); overflow: hidden; }
.paleta input { width: 100%; border: 0; border-bottom: 1px solid var(--line); height: 48px; padding: 0 16px; font-size: 15px; outline: none; }
.paleta ul { list-style: none; margin: 0; padding: 6px; max-height: 52vh; overflow: auto; }
.paleta li button { width: 100%; text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: 6px; display: flex; gap: 10px; align-items: center; }
.paleta li .d { width: 9px; height: 9px; border-radius: 50%; background: var(--sec); flex: none; box-shadow: 0 0 0 1px rgba(0,0,0,.2); }
.paleta li small { margin-left: auto; color: var(--muted); white-space: nowrap; }
.paleta li button.sel, .paleta li button:hover { background: var(--accent-soft); }
.paleta li.vacio { padding: 10px; color: var(--muted); }

/* menús de las ventanas («Ir a», «Opciones») */
.menu { position: relative; }
.menu-list { display: none; position: absolute; top: 36px; left: 0; min-width: 330px; max-height: calc(100vh - 60px - var(--top2)); overflow: auto;
             background: #fff; color: var(--text); border-radius: 8px; box-shadow: 0 8px 28px rgba(0,0,0,.22); padding: 6px; }
.menu.open .menu-list { display: block; }
.menu-list button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: 5px; }
.menu-list button:hover, .menu-list button:focus-visible { background: var(--accent-soft); outline: none; }
.menu-list hr { border: 0; border-top: 1px solid var(--line-soft); margin: 5px 4px; }

@media (max-width: 900px) {
  .shell, .shell.mini { grid-template-columns: minmax(0, 1fr); --side-w: 0px; }
  .side { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 150; transform: translateX(-100%); transition: transform .18s; }
  .shell.movil .side { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .shell.mini .lbl, .shell.mini .chev, .shell.mini .buscar, .shell.mini .usuario, .shell.mini .marca .erp, .shell.mini .side .emp-txt, .shell.mini .logo-full { display: revert; }
  .shell.mini .sec.abierta > .items { display: block; }
  .shell.mini .logo-sim { display: none; }
  .shell.mini .replegar { display: grid; }
  .menu-movil { display: grid; }
  .plegar { display: none; }
  .top .emp-txt, .agenda-btn span { display: none; }
}
@media (prefers-reduced-motion: reduce) { .side, .chev { transition: none; } }

/* ------------------------------------------------------------ escritorio */
.desk { padding: 12px; }
.welcome { max-width: 760px; margin: 40px auto; background: var(--panel); border-radius: 10px; box-shadow: var(--shadow); padding: 28px; }
.welcome h2 { margin: 0 0 6px; }
.welcome p { color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin-top: 18px; }
.tiles button { text-align: left; border: 1px solid var(--line-soft); background: #fff; border-radius: 8px; padding: 10px 12px; }
.tiles button:hover { border-color: var(--accent); background: var(--accent-soft); }

.win { display: none; background: var(--panel); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; overflow: clip; }
.win.active { display: block; }
.win-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border-bottom: 1px solid var(--line-soft); background: var(--panel); }
.win-title { font: 700 15px/1.2 var(--font-brand); letter-spacing: .02em; margin-right: 6px; color: var(--navy); }
/* tipo (PE: I, C, IC) o número (PO: 01, 02…) de la versión, bien grande junto al título de su ficha */
.tipo-version { display: inline-flex; align-items: center; justify-content: center; min-width: 52px; height: 40px; padding: 0 12px;
  margin-right: 10px; border-radius: 8px; font: 800 26px/1 var(--font-brand); letter-spacing: .04em; color: #fff; background: var(--navy); }
.tipo-version.pe { background: var(--ok); }
.tipo-version.po { background: var(--accent); }
.tb { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.tb button { height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; display: inline-flex; align-items: center; gap: 6px; }
.tb button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.tb button:disabled { opacity: .45; cursor: default; }
.tb button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.tb button.primary:hover:not(:disabled) { color: #fff; filter: brightness(1.08); }
.tb button.danger:hover:not(:disabled) { border-color: var(--danger); color: var(--danger); }
.tb button.nav { padding: 0 7px; }   /* ⏮ ◀ ▶ ⏭: más estrechos (incidencia n.º 99) */
.tb .sep { width: 1px; height: 22px; background: var(--line-soft); margin: 0 4px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; height: 28px; }
.seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.pos { color: var(--muted); min-width: 70px; text-align: center; }
.stamp { margin-left: auto; color: var(--muted); font-size: 12px; display: flex; gap: 14px; }
.stamp b { color: var(--text); font-weight: 600; }
.msg { padding: 7px 12px; border-bottom: 1px solid var(--line-soft); }
.msg.err { background: #fde8e7; color: var(--danger); }
.msg.ok { background: #e6f4ea; color: var(--ok); }
.msg.warn { background: var(--warn-bg); color: #6b4e00; }
.msg.info { background: #e8f0fe; color: #1a3d7c; }

/* ------------------------------------------------------------ listado */
/* incidencia n.º 99: --head-extra = lo que la cabecera de la ventana pasa de una fila (app/ventana.js ajustaAltoCabecera) */
.list { display: flex; flex-direction: column; height: calc(100vh - 140px - var(--top2) - var(--head-extra, 0px)); min-height: 320px; }
.list-bar { display: flex; gap: 8px; align-items: center; padding: 8px 10px; }
.search { position: relative; flex: 0 1 420px; }
.search input { width: 100%; height: 32px; border: 1px solid var(--line); border-radius: 6px; padding: 0 10px 0 30px; }
.search input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.search svg { position: absolute; left: 9px; top: 9px; opacity: .5; }
.count { color: var(--muted); }
.tablewrap { flex: 1; overflow: auto; border-top: 1px solid var(--line-soft); }
table.dl { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
table.dl th { position: sticky; top: 0; background: #f1f3f6; text-align: left; font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line);
              border-right: 1px solid var(--line-soft); white-space: nowrap; cursor: pointer; user-select: none; z-index: 1; }
table.dl th .ar { opacity: .6; margin-left: 4px; }
/* cualquier rejilla se ordena pulsando en la cabecera (ordenar.js) */
thead th.ord { cursor: pointer; }
thead th.ord:hover { filter: brightness(.95); }
thead th .ord-ar { opacity: .6; margin-left: 4px; font-size: .85em; }
table.dl td { padding: 4px 8px; border-bottom: 1px solid var(--line-soft); border-right: 1px solid #eef1f5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 1px; }
table.dl tbody tr:nth-child(even) td { background: var(--row-alt); }
table.dl tbody tr:hover td { background: var(--row-hover); cursor: pointer; }
table.dl tbody tr.sel td { background: var(--row-sel); }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
.more { padding: 10px; text-align: center; }
.more button { border: 1px solid var(--line); background: #fff; border-radius: 6px; height: 30px; padding: 0 14px; }

/* ------------------------------------------------------------ ficha (posiciones de Darby) */
.record { overflow: auto; height: calc(100vh - 140px - var(--top2) - var(--head-extra, 0px)); min-height: 320px; background: var(--face); }
.canvas { position: relative; margin: 10px; }
.c { position: absolute; }
.c-label { font-size: 11.5px; color: #2c394b; white-space: nowrap; overflow: visible; line-height: 1.2; padding-top: 2px; }
.c-frame { border: 1px solid var(--line); border-radius: 5px; }
.c-frame.noborder { border-color: transparent; }
.c-frame > .cap { position: absolute; top: -9px; left: 8px; padding: 0 4px; background: var(--face); font-size: 12px; font-weight: 600; color: #34465f; white-space: nowrap; }
.c-sstab { border: 1px solid var(--line); border-radius: 0 5px 5px 5px; background: #f9fafb; }
.c-field { border: 1px solid var(--line); border-radius: 4px; background: var(--input); padding: 0 5px; font-size: 11.5px; min-height: 20px; }
.c-field:focus { outline: 2px solid rgba(31,95,174,.25); border-color: var(--accent); z-index: 5; }
.c-field[readonly] { background: var(--input-ro); color: #44505f; }
.c-field.num { text-align: right; font-variant-numeric: tabular-nums; }
.c-field.lk { background: var(--input-key); padding-right: 18px; }
.c-field.lk.req { background: var(--input-req); }
.c-field.lk.free { background: var(--input-free); }
.c-field.lk.plain { background: var(--input); }
.c-field.lk[readonly], .c-field.lk.locked { background: var(--input-ro); }
.c-field.narrow { padding: 0 2px; }
.c-field.tiny { padding: 0 1px; text-align: center; }
.c-label.golink { color: var(--accent); text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 2px; cursor: pointer; }
.c-label.golink:hover { text-decoration-style: solid; }
.retbar { display: flex; align-items: center; gap: 10px; padding: 6px 12px; background: #e8f1fc; border-bottom: 1px solid #c7dbf3; font-size: 12.5px; }
.retbar b { font-weight: 600; }
.retbar button { border: 1px solid var(--line); background: #fff; border-radius: 5px; padding: 2px 10px; }
.retbar button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.tbmenu { position: relative; display: inline-block; }
.tbmenu > .menu-list { display: none; position: absolute; top: 100%; left: 0; z-index: 60; background: #fff; border: 1px solid var(--line); border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,.16); min-width: 240px; padding: 4px 0; margin-top: 2px; }
.tbmenu.open > .menu-list { display: block; }
.tbmenu .menu-list button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 5px 14px; white-space: nowrap; font-size: 12.5px; color: var(--text); }
.tbmenu .menu-list button:hover:not(:disabled) { background: var(--accent-soft); }
.tbmenu .menu-list button:disabled { color: #9aa3b1; cursor: default; }
.tbmenu .menu-list button.on::before { content: "✓ "; }
.tbmenu .menu-list .grp { padding: 6px 14px 2px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.tbmenu .menu-list hr { border: 0; border-top: 1px solid var(--line-soft); margin: 4px 0; }
.listfilter { margin-left: 8px; font-size: 12px; color: var(--accent); background: var(--accent-soft); border-radius: 10px; padding: 1px 4px 1px 9px; display: inline-flex; gap: 4px; align-items: center; }
.listfilter button { border: 0; background: none; color: var(--accent); padding: 0 4px; }
.c-field.changed { box-shadow: inset 3px 0 0 #f0b429; }
.c-field[type=date] { padding: 0 2px 0 4px; }
.c-memo { border: 1px solid var(--line); border-radius: 4px; background: #fff; padding: 4px 6px; resize: none; font-size: 12px; }
.c-check { display: flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; }
.c-check input { margin: 0; width: 15px; height: 15px; accent-color: var(--accent); }
.c-tabbtn { border: 1px solid var(--line); border-bottom: 0; border-radius: 6px 6px 0 0; background: #e6e9ee; font-size: 12px; padding: 0 6px;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #34465f; }
.c-tabbtn.on { background: #f9fafb; color: var(--accent); font-weight: 700; box-shadow: inset 0 2px 0 var(--accent); }
.c-img { border: 1px dashed var(--line); border-radius: 4px; display: grid; place-items: center; color: var(--muted); font-size: 11px; background: #fff; }
.lkclear { position: absolute; width: 16px; height: 16px; border: 0; background: none; color: #8a94a3; font-size: 13px; line-height: 16px; padding: 0; z-index: 6; }
.lkclear:hover { color: var(--danger); }
/* lista de las cajas de búsqueda: tabla con las columnas alineadas, texto oscuro y la fila elegida bien marcada */
.dropdown { position: fixed; z-index: 100; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 28px rgba(0,0,0,.18);
            max-height: 300px; max-width: calc(100vw - 16px); overflow: auto; min-width: 260px; font-size: 13px; color: var(--text); padding: 4px; }
.dropdown table { border-collapse: separate; border-spacing: 0; width: 100%; }
.dropdown tr.it { cursor: pointer; }
.dropdown tr.it td { padding: 6px 10px; white-space: nowrap; border-bottom: 1px solid var(--line-soft); color: var(--text); }
.dropdown tr.it td.k { color: #4A5262; font-variant-numeric: tabular-nums; }
.dropdown tr.it td.n { text-align: right; }
.dropdown tr.it:hover td { background: var(--row-hover); }
.dropdown tr.it.on td { background: var(--accent-soft); color: var(--text); }
.dropdown tr.it.on td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.dropdown .empty { padding: 8px 10px; color: var(--muted); }

/* rejillas */
.c-grid { border: 1px solid var(--line); border-radius: 4px; background: #fff; display: flex; flex-direction: column; overflow: hidden; }
.c-grid .gscroll { overflow: auto; flex: 1; }
.c-grid table { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 12px; }
.c-grid th { position: sticky; top: 0; background: #eef1f5; font-weight: 600; text-align: left; padding: 3px 6px; border-bottom: 1px solid var(--line);
             border-right: 1px solid var(--line-soft); white-space: nowrap; z-index: 1; }
.c-grid td { border-bottom: 1px solid #edf0f4; border-right: 1px solid #f1f3f6; padding: 0; height: 22px; white-space: nowrap; }
.c-grid td.ro { background: #f6f7f9; color: #3f4b5b; padding: 0 6px; overflow: hidden; text-overflow: ellipsis; max-width: 1px; }
.c-grid td.lk input { background: var(--input-key); }
.c-grid td input { width: 100%; height: 21px; border: 0; padding: 0 6px; background: transparent; font-size: 12px; }
.c-grid td input:focus { outline: 2px solid rgba(31,95,174,.35); outline-offset: -2px; background: #fff; }
.c-grid td.num, .c-grid td.num input { text-align: right; font-variant-numeric: tabular-nums; }
.c-grid td.ck { text-align: center; }
.c-grid td.act { width: 22px; text-align: center; background: #fafbfc; }
.c-grid td.act button { border: 0; background: none; color: #9aa3b1; width: 20px; height: 20px; padding: 0; }
.c-grid td.act button:hover { color: var(--danger); }
.c-grid tfoot td { position: sticky; bottom: 0; background: #eef1f5; font-weight: 600; padding: 0 6px; border-top: 1px solid var(--line); }
.c-grid .gfoot { display: flex; align-items: center; gap: 8px; padding: 2px 6px; border-top: 1px solid var(--line-soft); background: #fafbfc; font-size: 11px; color: var(--muted); }
.c-grid .gfoot button { border: 1px solid var(--line); background: #fff; border-radius: 4px; height: 20px; font-size: 11px; padding: 0 8px; }
.c-grid .gerr { padding: 8px; color: var(--muted); font-size: 12px; }
.c-gridmissing { border: 1px dashed var(--line); border-radius: 4px; display: grid; place-items: center; color: var(--muted); font-size: 12px; background: #fff; text-align: center; padding: 6px; }

.loading { padding: 24px; color: var(--muted); }
.toast { position: fixed; right: 16px; bottom: 16px; z-index: 300; background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow); max-width: 420px; }
.toast.err { background: var(--danger); color: #fff; }

@media (max-width: 760px) { .stamp { display: none; } }

/* ------------------------------------------------------------ menús y bienvenida */
.welcome h3 { margin: 18px 0 0; font-size: 13px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.c-budget { overflow: auto; padding: 8px; background: var(--panel); border: 1px solid var(--line-soft); }
.c-budget .tb { margin-bottom: 8px; }
.muted { color: var(--muted); }
.err { color: var(--danger); }

/* ------------------------------------------------------------ presupuesto en árbol (presupuesto.js) */
.budget .bw-ver { color: var(--muted); margin-right: 8px; }
.budget .tb select { height: 30px; border: 1px solid var(--line); border-radius: 6px; background: #fff; max-width: 280px; }
.budget .tb button.on { background: var(--accent-soft); color: var(--accent); }
.bw-body { padding: 0; }
.bw-empty { padding: 20px; color: var(--muted); }
.bw-totals { display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 8px 12px; border-bottom: 1px solid var(--line-soft); background: #fafbfc; }
.bw-totals .kv { display: flex; flex-direction: column; }
.bw-totals .kv span { font-size: 11px; color: var(--muted); }
.bw-totals .kv b { font-variant-numeric: tabular-nums; }
.bw-totals .kv.big b { font-size: 16px; color: var(--accent); }
.bw-split { display: grid; grid-template-columns: minmax(420px, 1.25fr) minmax(380px, 1fr); min-height: 60vh; }
@media (max-width: 1100px) { .bw-split { grid-template-columns: 1fr; } }
.bw-tree { border-right: 1px solid var(--line-soft); overflow: auto; max-height: calc(100vh - 230px - var(--top2)); }
.bw-detail { overflow: auto; max-height: calc(100vh - 230px - var(--top2)); background: var(--face); }
.bw-grid { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.bw-grid th { position: sticky; top: 0; background: #eef1f5; text-align: left; font-weight: 600; padding: 5px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; z-index: 1; }
.bw-grid td { padding: 3px 6px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.bw-grid .num { text-align: right; }
.bw-grid td.nm { white-space: normal; min-width: 180px; }
.bw-grid tr.cap td { background: #f4f6fa; font-weight: 600; cursor: pointer; }
.bw-grid tr.tag td { cursor: pointer; }
.bw-grid tr:hover td { background: var(--row-hover); }
.bw-grid tr.sel td { background: var(--row-sel); }
.bw-grid tr.auto td { color: var(--muted); font-style: italic; }
.bw-grid td.fija { color: #8a4b00; font-weight: 600; }
.bw-grid tfoot td { font-weight: 700; border-top: 2px solid var(--line); background: #fafbfc; }
.bw-grid input { width: 100%; min-width: 60px; height: 24px; border: 1px solid transparent; border-radius: 3px; background: transparent; padding: 0 4px; }
.bw-grid input:hover { border-color: var(--line); background: #fff; }
.bw-grid input:focus { border-color: var(--accent); background: #fff; outline: none; }
.bw-grid input.num { text-align: right; }
.bw-grid.small td, .bw-grid.small th { padding: 2px 4px; font-size: 12px; }
.bw-grid .tg { border: 0; background: none; width: 16px; padding: 0; color: var(--muted); }
.bw-grid td.act button { border: 0; background: none; color: #9aa3b1; width: 20px; height: 20px; padding: 0; }
.bw-grid td.act button:hover { color: var(--danger); }
.bw-add { padding: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bw-add button, .bw-btn { height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.bw-add button:hover, .bw-btn:hover { border-color: var(--accent); color: var(--accent); }
.bw-btn.danger:hover { border-color: var(--danger); color: var(--danger); }
.warnx { color: #8a4b00; }
.bw-hint { padding: 24px; }
.bw-card { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.bw-card h3 { margin: 0; font-size: 14px; color: #22334a; }
.bw-card h4 { margin: 4px 0; font-size: 12px; text-transform: uppercase; color: var(--muted); letter-spacing: .3px; }
.bw-row { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: flex-end; }
.bw-f { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--muted); }
.bw-f.grow { flex: 1; }
.bw-f input, .bw-f output { height: 26px; border: 1px solid var(--line); border-radius: 4px; background: var(--input); padding: 0 6px; font-size: 13px; color: var(--text); min-width: 90px; }
.bw-f output { display: inline-flex; align-items: center; justify-content: flex-end; background: var(--input-ro); }
.bw-f input.num { text-align: right; }
.bw-f input.ro, .bw-grid input.ro, input.ro { background: var(--input-ro); color: var(--muted); }
.bw-f input.lk, .bw-grid input.lk { background: var(--input-key); }
.bw-ck { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; height: 26px; }
.w6 { width: 70px; } .w8 { width: 90px; } .w10 { width: 120px; } .w30 { width: 320px; } .w40 { width: 100%; min-width: 260px; } .w100 { width: 100%; }
.bw-sub { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 6px; padding: 6px; }
.gscroll { overflow: auto; }
.bw-k { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); background: #fbfcfe; display: flex; flex-direction: column; gap: 8px; }
.bw-ktab { border-collapse: collapse; }
.bw-ktab th, .bw-ktab td { padding: 2px 6px; text-align: right; }
.bw-ktab th:first-child { text-align: left; font-weight: 600; }
.bw-ktab input { width: 90px; height: 24px; border: 1px solid var(--line); border-radius: 4px; text-align: right; padding: 0 4px; }
.bw-ktab td.num { font-variant-numeric: tabular-nums; min-width: 90px; }
.bw-ktab td.ajuste { color: var(--muted); background: #f6f7f9; }
.bw-ktab td.ajuste.con { color: #b45309; font-weight: 600; }
.bw-ktab tfoot th, .bw-ktab tfoot td { border-top: 1px solid var(--line); padding-top: 4px; font-weight: 600; }
.bw-ktab tfoot td.muted { text-align: left; font-weight: 400; }
.bw-modal { position: fixed; inset: 0; background: rgba(16,24,40,.35); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 50; overflow: auto; }
.bw-dialog { background: var(--panel); border-radius: 10px; box-shadow: var(--shadow); width: min(560px, 100%); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.bw-dialog.wide { width: min(1100px, 100%); }
.bw-dialog > input[type=search] { height: 32px; border: 1px solid var(--line); border-radius: 6px; padding: 0 8px; }
.bw-dh { display: flex; justify-content: space-between; align-items: center; }
.bw-dh button { border: 0; background: none; font-size: 20px; color: var(--muted); }
.bw-picklist { max-height: 55vh; overflow: auto; display: flex; flex-direction: column; }
.bw-picklist button { text-align: left; border: 0; border-bottom: 1px solid var(--line-soft); background: none; padding: 7px 6px; }
.bw-picklist button:hover { background: var(--accent-soft); }
.bw-meds { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow: auto; }
.bw-med { border: 1px solid var(--line-soft); border-radius: 6px; padding: 6px; }
.bw-med .bw-row input, .bw-med .bw-row select { height: 26px; border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; }
.bw-med.ro { color: var(--muted); }
.bw-foot { border-top: 1px solid var(--line-soft); padding-top: 8px; }
.bw-grid.small td.nm { min-width: 130px; }
.bw-grid.small input { min-width: 46px; }
.bw-grid.small input.w100 { min-width: 110px; }
.bw-treebar { background: #fafbfc; border-bottom: 1px solid var(--line-soft); }
.bw-treebar button:disabled { opacity: .45; cursor: default; }
.bw-treebar .sep { width: 1px; height: 22px; background: var(--line-soft); }
.bw-rowact { display: none; margin-left: 8px; gap: 4px; }
.bw-grid tr.cap:hover .bw-rowact, .bw-grid tr.cap.sel .bw-rowact { display: inline-flex; }
.bw-rowact button { border: 1px solid var(--line); background: #fff; border-radius: 4px; font-size: 11px; font-weight: 400; padding: 0 6px; height: 20px; }
.bw-rowact button:hover { border-color: var(--accent); color: var(--accent); }
.bw-texto { width: 100%; min-height: 80px; border: 1px solid var(--line); border-radius: 4px; padding: 6px; font: 13px/1.4 var(--font); color: var(--text); resize: vertical; background: var(--input); }
.bw-texto[readonly] { background: var(--input-ro); }
.bw-col { display: flex; flex-direction: column; gap: 4px; }

/* ------------------------------------------------------------ diálogos de Opciones (opciones.js) */
.modal-bg { position: fixed; inset: 0; background: rgba(16,24,40,.35); display: flex; align-items: flex-start; justify-content: center; padding: 48px 16px; z-index: 80; overflow: auto; }
.modal { background: var(--panel); border-radius: 10px; box-shadow: 0 12px 40px rgba(0,0,0,.25); width: min(640px, 100%); display: flex; flex-direction: column; }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); }
.modal-h .x { border: 0; background: none; font-size: 18px; color: var(--muted); }
.modal-b { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; max-height: 70vh; overflow: auto; }
.modal-b .row { display: flex; align-items: center; gap: 8px; }
.modal-b ol.cols { margin: 0; padding-left: 22px; columns: 2; font-size: 12px; color: #34465f; }
.modal-b .muted { color: var(--muted); margin: 0; }
.modal-b table.dl { width: 100%; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line-soft); }
.modal-f button { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 5px 14px; }
.modal-f button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.c-img.foto { background-size: cover; background-position: center; color: transparent; border-style: solid; }
.c-btn { border: 1px solid var(--line); border-radius: 5px; background: #fff; font-size: 11.5px; padding: 0 6px; line-height: 1.1; white-space: normal; color: var(--accent); }
.c-btn:hover:not(:disabled) { background: var(--accent-soft); }
.c-btn:disabled { color: #9aa3b1; background: #f3f4f6; cursor: default; }

/* menús con grupos (Oferta de obra > Compras, Empresa > Compras) */
.menu-list .menu-group { padding: 6px 12px 2px; font-size: 11px; font-weight: 600; color: var(--muted, #667); text-transform: uppercase; letter-spacing: .04em; }
.menu-list .menu-group.sub { padding: 6px 12px 1px 18px; text-transform: none; letter-spacing: 0; font-size: 11.5px; color: #4a5568; }
.menu-list button.in-group { padding-left: 22px; }
.tiles .tile-group { grid-column: 1 / -1; font-size: 12px; font-weight: 600; color: var(--muted, #667); margin-top: 6px; }
/* compras: elegir documento y reparto de la línea */
.compras-pick { display: flex; flex-direction: column; gap: 6px; min-width: 260px; }
.compras-pick button { text-align: left; padding: 8px 12px; }
.c-grid tr.cur > td { background: #e8f0fe; }
.c-grid .gerr.rep { color: var(--muted, #667); font-style: italic; }
/* diálogos de Ejecución de obra (ejecucion.js) */
.modal.wide { width: min(1120px, 100%); }
.modal-b .row .lbl { min-width: 120px; color: #34465f; }
.modal-b .tablewrap.dlg { max-height: 48vh; overflow: auto; border: 1px solid var(--line-soft); border-radius: 6px; }
.modal-b .tablewrap.dlg td input[type=text] { width: 100%; }
.modal-b td.num input { text-align: right; }
.dropdown { z-index: 120; }
.c-grid tr.cur > td { background: #e8f0fe; }
.modal-b .row { flex-wrap: wrap; }
.modal-b .row .row .lbl { min-width: 0; }

/* Ejecución de obra: obra elegida (menú con contexto) */
.menu-context { display: flex; align-items: center; gap: 4px; padding: 6px 10px; margin: 2px 0 4px; background: var(--accent-soft); border-radius: 5px; font-size: 12.5px; }
.menu-context.empty { background: none; color: var(--muted, #667); font-style: italic; }
.menu-context .link { display: inline; width: auto; padding: 0; color: var(--accent); font-weight: 600; text-align: left; flex: 1; background: none; border: 0; }
.menu-context .link:hover { text-decoration: underline; background: none; }
.menu-context .x { display: inline; width: auto; padding: 0 6px; border: 0; background: none; color: var(--muted, #667); }
.menu-list button:disabled, .tiles button:disabled { color: #9aa3b1; cursor: default; background: none; }
.tiles .tile-ctx { grid-column: 1 / -1; }

/* Secciones con los colores de Darby (secciones.js): etiqueta de la sección en la cabecera de la ventana,
   franja superior de la ventana y de su pestaña, etiquetas de subsección / documento y botones «pulsados» */
.win { border-top: 4px solid var(--sec, transparent); }
.sec-chip { display: inline-block; padding: 3px 12px; margin-right: 10px; border: 1px solid rgba(0,0,0,.25); border-radius: 4px;
  color: #111; font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .3px; white-space: nowrap; }
.c-label.lbl-sub { background: var(--sub); color: var(--subfg, #111); font-weight: 700; border: 1px solid rgba(0,0,0,.2); border-radius: 4px;
  display: flex; align-items: center; justify-content: center; text-align: center !important; padding: 0 4px; }
/* pulsado: hundido y más oscuro, como en Darby (dónde está el usuario), con la marca naranja de GESSO */
.c-btn.pulsado, .c-btn.pulsado:disabled { background: var(--pressed); color: #111; border-color: var(--pressed-line); box-shadow: inset 0 2px 3px rgba(0,0,0,.2); font-weight: 700; }
.c-btn.pulsado::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: 1px; height: 2px; border-radius: 2px; background: var(--gesso); }

/* ------------------------------------------------------------ tesorería (tesoreria.js) */
.c-testree { display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
.c-testree .tt-nota { font-size: 11px; }
.c-testree .tt-box { flex: 1; overflow: auto; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.tt { font-size: 12px; }
.tt td.nm { cursor: default; max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
.tt tr.tt-fila td.nm { cursor: pointer; }
.tt .tw { color: var(--muted); }
.tt tr.tt-grupo td { background: #eef1f5; font-weight: 700; letter-spacing: .4px; }
.tt tr.tt-grupo.tt-c td:first-child { border-left: 4px solid var(--ok); }
.tt tr.tt-grupo { cursor: pointer; }
.tt tr.tt-grupo.tt-c td { background-color: #ecfdf3; }
.tt tr.tt-grupo.tt-p td { background-color: #fef2f2; }
.tt tr.tt-grupo .tt-n { font-weight: 400; font-size: 11px; }
.tt tr.tt-fila td.nm { padding-left: 22px; }
.tt tr.tt-vto td.nm { padding-left: 44px !important; }
.tt tr.tt-fin td { border-bottom: 2px solid var(--line); }
.tt tr.tt-grupo.tt-p td:first-child { border-left: 4px solid var(--danger); }
.tt tr.tt-total td { font-weight: 600; border-top: 1px solid var(--line); background: #fafbfc; }
.tt tr.tt-res td { font-weight: 600; background: #f4f6fa; }
.tt tr.tt-fin td { font-weight: 700; border-top: 2px solid var(--line); }
.tt tr.tt-saldo td { font-style: italic; }
.tt tr.tt-vto td { color: var(--muted); font-size: 11.5px; background: #fcfcfd; }
.tt tr.tt-vto td.nm { padding-left: 26px; }
.tt td.manual { background: var(--warn-bg); font-style: italic; }
.tt td.neg { color: var(--danger); }
.tt td.num:not(:first-child) { cursor: cell; }
.tt .tt-in { width: 90px; text-align: right; font: inherit; }
/* presupuesto de tesorería: columnas coloreadas (vencido y periodos alternos), tipos de vencimiento, enlace a la entidad */
.tt th.col-v, .tt td.col-v { background-image: linear-gradient(rgba(220, 38, 38, .08), rgba(220, 38, 38, .08)); }
.tt th.col-par, .tt td.col-par { background-image: linear-gradient(rgba(37, 99, 235, .07), rgba(37, 99, 235, .07)); }
.tt th.col-v { color: #b91c1c; }
.tt a.tt-ent { color: inherit; text-decoration: none; cursor: pointer; }
.tt a.tt-ent:hover { color: var(--accent, #c2410c); text-decoration: underline; }
/* n.º 218 / 219: nombre con doble clic a la ficha; cabecera de periodo «desde – hasta» */
.tt span.tt-ent:hover { color: var(--accent, #c2410c); text-decoration: underline; }
.tt th.tt-per { white-space: nowrap; }
.tt .tw { cursor: pointer; padding: 0 2px; }
.c-testree .tt-ck { display: inline-flex; align-items: center; gap: 4px; margin: 0 8px; font-size: 12px; white-space: nowrap; }
.c-testree .tt-ley { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-right: 8px; }
.tt-chip { display: inline-block; padding: 0 6px; margin-right: 6px; border-radius: 8px; font-size: 10.5px; line-height: 16px; font-style: normal;
  color: var(--tv-c); background: var(--tv-bg); border: 1px solid var(--tv-b); white-space: nowrap; }
.tv-doc { --tv-c: #1d4ed8; --tv-bg: #eff6ff; --tv-b: #bfdbfe; }
.tv-jus { --tv-c: #7e22ce; --tv-bg: #faf5ff; --tv-b: #e9d5ff; }
.tv-agr { --tv-c: #0f766e; --tv-bg: #f0fdfa; --tv-b: #99f6e4; }
.tv-cp { --tv-c: #b45309; --tv-bg: #fffbeb; --tv-b: #fde68a; }
.tv-prev { --tv-c: #4d7c0f; --tv-bg: #f7fee7; --tv-b: #d9f99d; }
.tv-tras { --tv-c: #be185d; --tv-bg: #fdf2f8; --tv-b: #fbcfe8; }
.tv-pers { --tv-c: #92400e; --tv-bg: #fff7ed; --tv-b: #fed7aa; }
.tt tr.tt-vto[class*="tv-"] td:first-child, .tt tr.tt-fila[class*="tv-"] td:first-child { box-shadow: inset 4px 0 0 var(--tv-b); }
.tt tr.tt-vto[class*="tv-"] td { background-color: var(--tv-bg); color: #374151; }
.imputar .iv-body { display: flex; flex-direction: column; height: calc(100vh - 150px - var(--top2)); }
.imputar .tb { padding: 6px 10px; }
.imputar .tb select, .imputar .tb input[type=search] { height: 30px; border: 1px solid var(--line); border-radius: 6px; background: #fff; max-width: 260px; }
.imputar .tb input[type=search] { width: 230px; padding: 0 8px; }
.imputar .tb button.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.imputar .iv-acc { border-top: 1px solid var(--line-soft); background: #fafbfc; }
/* incidencia n.º 149: «Mostrar más» bajo la tabla de vencimientos */
.imputar .iv-mas { display: flex; gap: 8px; align-items: center; padding: 8px 6px; }
.imputar .iv-info { margin-left: auto; color: var(--muted); font-size: 12px; }
.imputar .iv-chk { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.iv-date { width: 88px; height: 26px; border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; font: inherit; }
table.dl.iv td { max-width: 220px; }
table.dl.iv td.ed input.iv-date { width: 92px; }
table.dl.iv td.ed { padding: 1px 3px; overflow: visible; }
table.dl.iv td.ed input[type=text] { width: 170px; height: 24px; border: 1px solid transparent; border-radius: 3px; background: transparent; font: inherit; padding: 0 4px; }
table.dl.iv td.ed input[type=text]:hover, table.dl.iv td.ed input[type=text]:focus { border-color: var(--line); background: #fff; }
table.dl.iv td.ed select { height: 24px; border: 1px solid transparent; background: transparent; font: inherit; max-width: 200px; }
table.dl.iv td.ed select:hover:not(:disabled) { border-color: var(--line); background: #fff; }
table.dl.iv td.ck { text-align: center; width: 28px; }
table.dl.iv tr.hecho td { color: var(--ok); }
table.dl.iv tbody tr.edit td { background: var(--warn-bg); }
table.dl.iv tbody tr.ro td { color: var(--muted); }
/* «Imputar y desimputar» (imputador.js) */
.imputador .tb { flex-wrap: wrap; row-gap: 4px; }
.imputador .ipt-in { height: 28px; border: 1px solid var(--line); border-radius: 6px; padding: 0 8px; background: #fffbe6; font: inherit; }
.imputador .ipt-in.locked, .imputador .ipt-in[readonly] { background: #eef0f3; color: #333; }
.imputador .ipt-info { font-size: 12px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.dl.iv.ipt td.ed { max-width: 220px; }
/* incidencia n.º 166: todas las columnas con su ancho (por defecto o el del usuario) y estrechables: las celdas no marcan un mínimo y las
   cajas rosas ocupan el ancho de su columna; cabecera que se arrastra para mover la columna */
table.dl.iv.ipt td, table.dl.iv.ipt td.ed { max-width: 1px; }
table.dl.iv.ipt td.ed.lk input[type=text] { width: 100%; min-width: 0; box-sizing: border-box; }
table.dl.iv.ipt th.ck { width: 34px; min-width: 34px; }
table.dl.iv.ipt th[draggable=true] { cursor: grab; }
table.dl.iv.ipt th.ipt-arrastrada { opacity: .5; }
table.dl.iv.ipt th.ipt-drop-antes { box-shadow: inset 3px 0 0 var(--accent); }
table.dl.iv.ipt th.ipt-drop-despues { box-shadow: inset -3px 0 0 var(--accent); }
.imputar .iv-tabla { min-height: 0; }
table.dl.iv.ipt td.col-relleno { max-width: none; }
/* incidencia n.º 190: «×» para vaciar las cajas del filtro y del destino común (solo con texto) */
.ipt-xcaja { position: relative; display: inline-flex; align-items: center; }
.ipt-xcaja > input { padding-right: 20px !important; }
.imputar .tb .ipt-xcaja > button.ipt-x { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); width: 18px; min-width: 0; height: 18px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer; }
.imputar .tb .ipt-xcaja > button.ipt-x:hover { background: rgba(0,0,0,.08); color: var(--text); }
.ipt-xcaja > input:placeholder-shown + .ipt-x { display: none; }
/* mejora n.º 192: árbol del presupuesto en una ventana flotante (Imputar y desimputar) */
.imputar .tb button.ipt-arbol-btn { padding: 0 8px; }
.ipt-arbol { position: fixed; z-index: 60; width: 460px; max-width: calc(100vw - 16px); height: min(560px, calc(100vh - 160px)); display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 32px rgba(0,0,0,.22); resize: both; overflow: hidden; min-width: 300px; min-height: 220px; }
.ipt-arbol-h { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; background: #2b3647; color: #fff; cursor: move; user-select: none; }
.ipt-arbol-h b { flex: 1; font-size: 13px; }
.ipt-arbol-x { border: 0; background: transparent; color: #fff; font-size: 18px; line-height: 1; width: 24px; height: 24px; border-radius: 4px; cursor: pointer; }
.ipt-arbol-x:hover { background: rgba(255,255,255,.15); }
.ipt-arbol-tb { display: flex; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--line-soft); }
.ipt-arbol-q { flex: 1; height: 28px; border: 1px solid var(--line); border-radius: 6px; padding: 0 8px; font: inherit; }
.ipt-arbol-tb button { height: 28px; min-width: 30px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); cursor: pointer; }
.ipt-arbol-modo { display: flex; align-items: center; gap: 4px; padding: 0 8px 6px; border-bottom: 1px solid var(--line-soft); font-size: 12px; min-width: 0; }
.ipt-arbol-modo button { height: 24px; padding: 0 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); font-size: 12px; cursor: pointer; flex: none; }
.ipt-arbol-modo button.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); font-weight: 600; }
.ipt-arbol-linea { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ipt-arbol-b { flex: 1; overflow: auto; padding: 4px 0; font-size: 12.5px; }
.ipt-arbol-b p { padding: 8px 12px; }
.ipt-arbol-n, .ipt-arbol-r { display: flex; align-items: center; gap: 6px; padding: 3px 8px; white-space: nowrap; cursor: pointer; }
.ipt-arbol-n { font-weight: 600; color: #374151; }
.ipt-arbol-n .tg { width: 12px; color: var(--muted); flex: none; }
.ipt-arbol-n.n1 { padding-left: 22px; font-weight: 500; } .ipt-arbol-n.n2 { padding-left: 36px; font-weight: 400; }
.ipt-arbol-r.n2 { padding-left: 40px; } .ipt-arbol-r.n3 { padding-left: 54px; }
.ipt-arbol-r .cod { color: var(--muted); flex: none; min-width: 70px; } .ipt-arbol-r .nom { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.ipt-arbol-r .ud { color: var(--muted); flex: none; }
.ipt-arbol-n:hover, .ipt-arbol-r:hover { background: var(--accent-soft); }
.ipt-arbol-n.actual { color: var(--accent); }
.ipt-arbol-r.sel { background: var(--input-req); font-weight: 600; }
.ipt-arbol-r:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.ipt-arbol-pie { padding: 4px 10px; border-top: 1px solid var(--line-soft); font-size: 11.5px; }
.ipt-xcaja > input[style*="display: none"] + .ipt-x { display: none; }
/* claves ajenas del imputador (centro de costes, unidad de obra, recurso; y las búsquedas del filtro): rosa */
table.dl.iv.ipt td.lk input[type=text], table.dl.iv.ipt td.lk input[type=text]:hover, table.dl.iv.ipt td.lk input[type=text]:focus { background: var(--input-req); }
.imputador .ipt-in.ipt-lk { background: var(--input-req); }
/* filtros del imputador (proveedor, centro de costes, unidad de obra, recurso, nº cert): crema, se elige o se escribe un trozo (29/10/2026) */
.imputador .ipt-in.ipt-lk.free { background: var(--input-free); }
table.dl.iv.ipt td.ipt-doc { cursor: pointer; text-decoration: underline dotted; }
table.dl.iv.ipt td.ipt-rojo input, table.dl.iv.ipt td.ipt-rojo { color: var(--danger); font-weight: 600; }
table.dl.iv.ipt tbody tr.sel td { background: var(--row-sel); }
table.dl.iv.ipt tbody tr.ro td { background: #f3f4f6; }
.ipt-modal { width: min(1100px, 100%); }
.ipt-kpis { display: flex; gap: 10px; flex-wrap: wrap; }
.ipt-kpi { border: 1px solid var(--line-soft); border-radius: 8px; padding: 6px 10px; display: flex; flex-direction: column; min-width: 150px; }
.ipt-kpi small { color: var(--muted); }
.ipt-kpi.neg b { color: var(--danger); }
/* servicios generales (sg.js): PA, resúmenes, visor de repartos, comparación y análisis */
.sgw .sg-tb { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--line-soft); }
.sgw .sg-tb select { height: 30px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.sgw .sg-tb button.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.sgw .sg-tb .iv-chk { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.sgw .sg-info { margin-left: auto; color: var(--muted); font-size: 12px; }
.sgw .sg-body { padding: 8px 10px 10px; }
.sgw .sg-split { display: flex; gap: 14px; align-items: flex-start; }
.sgw .sg-tree { flex: 0 1 48%; min-width: 360px; max-height: calc(100vh - 200px - var(--top2)); overflow: auto; border: 1px solid var(--line); border-radius: 4px; }
.sgw .sg-ficha { flex: 1 1 52%; min-width: 380px; max-height: calc(100vh - 200px - var(--top2)); overflow: auto; padding: 0 4px; }
.sgw .sg-ficha h3 { margin: 4px 0 2px; font-size: 15px; }
.sgw .sg-ficha h4, .sgw h4 { margin: 12px 0 4px; font-size: 13px; }
.sgw .sg-ficha .tb { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.sgw label.row, .modal label.row { display: flex; align-items: center; gap: 8px; margin: 5px 0; }
.sgw label.row .lbl { width: 140px; flex: none; color: var(--muted); }
.sgw label.row input[type=text], .sgw label.row textarea, .sgw label.row select { flex: 1; min-height: 28px; border: 1px solid var(--line); border-radius: 4px; padding: 2px 6px; font: inherit; }
.sgw .sg-tabla { max-height: calc(100vh - 210px - var(--top2)); overflow: auto; }
.sgw .tablewrap { overflow: auto; }
.sgw button.tg { border: 0; background: none; width: 18px; padding: 0; cursor: pointer; color: var(--muted); }
table.dl.sg td { max-width: 420px; }
table.dl.sg-arbol td { max-width: 360px; }
table.dl.sg-arbol tr.sg-tipo td, table.dl.sg tr.sg-tipo td { background: #e3eefb; font-weight: 700; }
table.dl.sg-arbol tr.sg-ue td, table.dl.sg tr.sg-ue td { font-weight: 600; }
table.dl.sg-arbol tr.sg-cap td:first-child { padding-left: 20px; }
table.dl.sg-arbol tr.sg-tar td:first-child, table.dl.sg tr.sg-tar td:first-child { padding-left: 40px; }
table.dl.sg tr.sg-grp td { font-style: italic; background: #f3f7fc; }
table.dl.sg tr.sg-rec td { color: var(--muted); font-size: 12px; }
table.dl.sg tr.sg-sin td { font-style: italic; color: var(--muted); }
table.dl.sg tfoot td, table.dl.sg-mini tfoot td { font-weight: 700; border-top: 2px solid var(--line); background: #fafbfc; }
table.dl td.neg { color: var(--danger); }
.sg-am { color: var(--muted); font-size: 11px; }
table.dl.sg-mini { width: auto; min-width: 0; margin: 4px 0; }
table.dl.sg-mini td { max-width: none; padding: 2px 6px; }
table.dl.sg-mini input.sg-num { width: 100px; text-align: right; }
table.dl.sg-mini input[type=text] { height: 24px; border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; font: inherit; }
table.dl.sg-mini select { height: 26px; max-width: 320px; }
.sgw .sg-meses { overflow-x: auto; margin: 6px 0; }
/* PA con meses (mejora n.º 229): árbol a todo el ancho con Total y periodos; la ficha, debajo */
.sgw .sg-split.sg-conmeses { flex-direction: column; align-items: stretch; }
.sgw .sg-split.sg-conmeses > .sg-tree { flex: none; width: 100%; min-width: 0; }
.sgw .sg-split.sg-conmeses.sg-conficha > .sg-tree { max-height: calc(55vh - var(--top2)); }
.sgw .sg-split.sg-conmeses > .sg-ficha { flex: none; width: 100%; min-width: 0; max-height: none; position: relative; border-top: 2px solid var(--line); padding-top: 4px; }
.sgw .sg-ficha .sg-cierra { position: absolute; right: 4px; top: 6px; border: 1px solid var(--line); background: #fff; border-radius: 4px; width: 26px; height: 26px; cursor: pointer; }
table.dl.sg-arbol.sg-conmeses th.sg-mes, table.dl.sg-arbol.sg-conmeses td.sg-mes { min-width: 78px; font-size: 12px; }
table.dl.sg-arbol.sg-conmeses td.sg-tot, table.dl.sg-arbol.sg-conmeses th:nth-child(3) { font-weight: 600; border-right: 2px solid var(--line); }
.sgw .sg-tb select.sg-nuevocentro { width: 190px; min-width: 0; font-weight: 600; cursor: pointer; }
/* incidencia n.º 233: con meses, Cód y Nombre fijos a la izquierda (el ancho de Cód, en --sg-c1, lo pone sg.js fijaColumnas) */
table.dl.sg-arbol.sg-conmeses .sg-fija { position: sticky; left: 0; z-index: 1; }
table.dl.sg-arbol.sg-conmeses .sg-fija.sg-c2 { left: var(--sg-c1, 90px); box-shadow: inset -2px 0 0 var(--line); }
table.dl.sg-arbol.sg-conmeses tr.sg-tipo td.sg-fija, table.dl.sg-arbol.sg-conmeses tfoot td.sg-fija { box-shadow: inset -2px 0 0 var(--line); }
table.dl.sg-arbol.sg-conmeses tbody tr:nth-child(odd):not(.sel):not(:hover):not(.sg-tipo) td.sg-fija { background: var(--panel, #fff); }
table.dl.sg-arbol.sg-conmeses thead th.sg-fija { z-index: 3; }
table.dl.sg-arbol.sg-conmeses tfoot td.sg-fija { z-index: 3; }
.sgw .sg-split.sg-conmeses .sg-fichah { padding-right: 36px; }
/* incidencia n.º 234: explicación de cada tramo del concepto */
table.dl.sg-mini td.sg-tramo-desc { min-width: 260px; max-width: 520px; white-space: normal; font-size: 12px; color: var(--ink, #1f2937); }
table.dl.sg-mini input.sg-tramo-det { width: 240px; }
table.dl.sg-mini td.sg-tramo-desc.muted { color: var(--muted); }
table.dl.sg-mini td.sg-tramo-desc.err { color: var(--danger); }
/* incidencia n.º 235: obras del grupo de reparto cuyo % no es el del grupo (solo se marcan) */
tr.gr-distinto > td { background: #fff3cd !important; }
tr.gr-distinto > td:first-child { box-shadow: inset 3px 0 0 #d97706; }
/* concepto del PA a pantalla completa (incidencias n.º 230 y 231): capa .bw-full del presupuesto */
.sgw .sg-fichah { display: flex; align-items: center; gap: 8px; }
.sgw .sg-fichah h3 { flex: 1; }
.sgw .sg-full .sg-ficha-full { max-width: 1200px; max-height: none; overflow: visible; }
.sgw .sg-full .sg-ficha-full .sg-meses table.dl.sg-mini { width: 100%; }
table.dl.sg-arbol.sg-conmeses thead th { position: sticky; top: 0; z-index: 1; }
table.dl.sg-arbol.sg-conmeses tfoot td { position: sticky; bottom: 0; font-weight: 700; border-top: 2px solid var(--line); background: #fafbfc; }
.sgw .sg-g4h { margin: 14px 0 4px; }
/* presupuesto de CGO / OGO de la unidad de ejecución */
.bw-grid.bw-ogo td.mes, .bw-grid.bw-ogo th.mes { min-width: 64px; font-size: 11.5px; color: #33475b; }
.bw-grid.bw-tramos { width: auto; margin: 6px 0; }
.bw-grid.bw-tramos input[type=text] { height: 24px; border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; font: inherit; }
.bw-grid.bw-tramos input.num { width: 110px; text-align: right; }
.bw-ogoprev { margin: 6px 0; }
.bw-date { width: 96px; }
.bw-ogoprev table.bw-grid { width: auto; } .bw-ogoprev table.bw-grid th, .bw-ogoprev table.bw-grid td { min-width: 62px; }
/* foto / logotipo de la ficha: iconos de seleccionar y borrar */
.c-img { overflow: hidden; }
.c-img.foto { background-size: contain; background-repeat: no-repeat; }
.c-img-acc { position: absolute; top: 3px; right: 3px; display: flex; gap: 2px; opacity: .25; transition: opacity .15s; }
.c-img:hover .c-img-acc { opacity: 1; }
.c-img-acc button.ico, button.ico { border: 1px solid var(--line); background: #fff; border-radius: 4px; width: 24px; height: 22px; padding: 0; font-size: 12px; line-height: 1; cursor: pointer; color: var(--accent); }
button.ico:hover:not(:disabled) { background: var(--accent-soft); }
button.ico:disabled { opacity: .45; cursor: default; }
/* logotipo de la empresa en la cabecera */
.emp-logo { height: 30px; max-width: 140px; object-fit: contain; background: #fff; border-radius: 4px; padding: 2px 4px; margin: 0 6px 0 2px; align-self: center; }
.tb button.tb-ico { width: 30px; height: 30px; display: inline-grid; place-items: center; padding: 0; border-radius: 6px; }
/* pantalla de inicio (inicio.js) */
.welcome.inicio { max-width: 1500px; margin: 20px auto; padding: 18px 22px; background: transparent; box-shadow: none; }
.ini-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.ini-head { flex-wrap: wrap; gap: 16px; }
.ini-gesso { height: 34px; width: auto; color: var(--gesso); flex: none; }
.ini-hola { flex: 1; min-width: 200px; }
.ini-hola h2 { margin: 0; font: 800 22px/1.2 var(--font-brand); color: var(--navy); }
.ini-hola p { margin: 2px 0 0; color: var(--muted); font-weight: 600; }
.ini-cli .emp-logo { padding: 4px 8px; height: 62px; width: 210px; border: 1px solid var(--line); border-radius: 10px; }
.ini-cli .emp-logo.sin { display: none; }
.ini-pers { border: 1px solid var(--line); background: #fff; border-radius: 6px; height: 32px; padding: 0 12px; cursor: pointer; }
.ini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 14px; align-items: start; }
/* sin huecos (inicio.js, encaja): filas de 4 px, cada cuadro ocupa las de su alto; el hueco entre filas va en el cálculo */
.ini-grid:has(.ini-encaja) { grid-auto-rows: 4px; row-gap: 0; }
.ini-card { background: var(--panel); border-radius: 10px; box-shadow: var(--shadow); padding: 14px 16px; min-height: 90px; }
.ini-card h3 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.ini-card.ini-menus { grid-column: 1 / -1; }
/* panel «Proyección de las obras» (proyeccionobras.js): a lo ancho, con su tabla y la ventana «Ver todas…» */
.ini-card.ini-proyeccion { grid-column: 1 / -1; }
.pyo-wrap { overflow-x: auto; }
.pyo-tab th { font-size: 11px; font-weight: 600; color: var(--muted); text-align: left; padding: 3px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.pyo-tab th.num { text-align: right; } .pyo-tab th.ord { cursor: pointer; } .pyo-tab th.ord:hover { color: var(--text); }
.pyo-tab td.neg { color: var(--danger); }
.pyo-tab td:nth-child(3) { min-width: 260px; }
.pyo-tab td.fijo { overflow: visible; }
.pyo-sem { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #c8ced8; vertical-align: middle; }
.pyo-sem.rojo { background: #d93025; } .pyo-sem.ambar { background: #f2a600; } .pyo-sem.verde { background: #1e8e3e; } .pyo-sem.err { background: #6b2a2a; }
.pyo-estado { margin-left: 8px; font-size: 12px; }
.pyo-re { padding: 0 6px; min-height: 0; line-height: 18px; }
.pyo-re.girando { animation: pyo-gira 1s linear infinite; }
@keyframes pyo-gira { to { transform: rotate(360deg); } }
/* n.º 210: los botones del panel no se parten en dos renglones */
.ini-proyeccion .ini-acc { align-items: center; }
.ini-proyeccion .ini-acc button { white-space: nowrap; flex: none; }
.modal.pyo-modal { width: min(1500px, 97vw); max-width: 97vw; }
.modal.pyo-modal .modal-b { max-height: calc(96vh - 60px); }
.pyo-todas { max-height: calc(96vh - 230px); overflow: auto; }
.pyo-filtro { display: flex; gap: 8px; flex-wrap: wrap; } .pyo-filtro input[type=search] { flex: 1; min-width: 220px; }
.pyo-pie { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.pyo-tab td.warn { color: #b26a00; }
.pyo-av { width: 1%; } .pyo-aviso { color: #b26a00; cursor: help; font-size: 13px; }
.modal-h .pyo-ayuda { margin-left: auto; margin-right: 6px; }
.modal.pyo-ayuda-modal { width: min(780px, 96vw); }
.modal.pyo-ayuda-modal .modal-b { max-height: calc(92vh - 60px); }
.pyo-ayuda-txt { font-size: 13px; line-height: 1.45; }
.pyo-ayuda-txt h4 { margin: 10px 0 2px; font-size: 13.5px; } .pyo-ayuda-txt h4:first-child { margin-top: 0; }
.pyo-ayuda-txt ul, .pyo-ayuda-txt ol { margin: 2px 0; padding-left: 20px; } .pyo-ayuda-txt li { margin: 3px 0; }
.pyo-ayuda-txt p { margin: 2px 0; }
.ini-card h3.ini-asa { cursor: grab; user-select: none; }
.ini-card h3.ini-asa:hover { color: var(--accent); }
.ini-card h3.ini-asa:hover::after { content: " ⠿"; opacity: .6; }
.ini-card.ini-arrastra { opacity: .45; outline: 2px dashed var(--accent); outline-offset: 2px; }
.ini-card h4 { margin: 10px 0 4px; font-size: 12px; color: var(--muted); }
.ini-sub { margin: 0 0 8px; font-weight: 600; }
.ini-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 8px; }
.ini-kpi { display: flex; flex-direction: column; gap: 2px; background: #f5f7fa; border-radius: 6px; padding: 6px 8px; }
.ini-kpi span { font-size: 11px; color: var(--muted); }
.ini-kpi b { font-size: 15px; font-variant-numeric: tabular-nums; }
.ini-kpi.warn b { color: #b26a00; } .ini-kpi.neg b { color: var(--danger); }
.ini-sub { display: flex; justify-content: space-between; align-items: baseline; margin: 4px 0 6px; font-size: 13px; }
.ini-sub span { color: var(--muted); font-variant-numeric: tabular-nums; }
.ini-nota { font-size: 12px; margin: 0 0 8px; }
.ini-aviso { margin: 6px 0 8px; border: 1px solid #f0d9a8; background: #fff8e8; border-radius: 6px; padding: 6px 10px; font-size: 13px; }
.ini-aviso summary { cursor: pointer; color: #7a4b00; font-weight: 600; }
.ini-aviso .ini-tab { margin-top: 6px; width: 100%; font-size: 12px; }
.ini-aviso .ini-tab td { padding-left: 4px; padding-right: 4px; }
.ini-acc { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ini-acc button { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 6px 10px; cursor: pointer; text-align: left; color: var(--accent); display: flex; flex-direction: column; }
.ini-acc button small { color: var(--muted); font-size: 10.5px; }
.ini-acc button:hover:not(:disabled) { background: var(--accent-soft); }
.ini-acc button:disabled { color: #9aa3b1; cursor: default; }
/* n.º 225: accesos rápidos en mosaico de casillas iguales (icono, nombre en dos renglones como mucho y menú), siempre en el orden del usuario */
.ini-accrap { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.ini-accrap button { height: 106px; min-width: 0; align-items: center; justify-content: flex-start; gap: 4px; padding: 10px 6px 6px; border-radius: 8px; text-align: center; overflow: hidden;
  border-top: 4px solid var(--sec, var(--line)); }   /* n.º 228: franja con el color de la sección; alto para dos renglones del nombre */
.ini-accrap button svg { flex: none; }
.ini-accrap .ini-tt { font-size: 12.5px; line-height: 1.25; min-height: 2.5em; flex: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.ini-accrap button small { margin-top: auto; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ini-accrap button:hover:not(:disabled) { border-color: var(--accent); border-top-color: var(--sec, var(--accent)); }
.ini-accrap button:disabled svg { opacity: .5; }
/* n.º 228: mover los accesos arrastrándolos */
.ini-accrap button:not(:disabled) { cursor: pointer; }
.ini-accrap button.ini-accarr { opacity: .45; outline: 2px dashed var(--accent); outline-offset: 2px; }
/* Personalizar: icono de cada acceso y lista para elegirlo */
.ini-pnom { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.ini-picon { flex: none; width: 30px; height: 28px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--line); background: #fff; border-radius: 6px; color: var(--accent); cursor: pointer; }
.ini-picon:hover, .ini-picon.sel { border-color: var(--accent); background: var(--accent-soft); }
.ini-icos { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 0 8px 38px; }
.ini-icos button { width: 34px; height: 32px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--line); background: #fff; border-radius: 6px; color: var(--accent); cursor: pointer; }
.ini-icos button.ini-icauto { width: auto; padding: 0 10px; font-size: 12px; color: var(--text); }
.ini-icos button:hover, .ini-icos button.sel { border-color: var(--accent); background: var(--accent-soft); }
.ini-tab { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
/* las columnas de texto se recortan (…) para que la tabla quepa en el cuadro; las cortas (fechas, tipos) y los importes, enteros */
.ini-tab td { padding: 4px 6px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 0; }
.ini-tab td.num, .ini-tab td.fijo { max-width: none; width: 1%; }
.ini-tab td.num { text-align: right; }
.ini-tab tr.clic { cursor: pointer; } .ini-tab tr.clic:hover td { background: var(--row-hover); }
.ini-tab tr.venc td:first-child { color: var(--danger); font-weight: 600; }
.ini-plist { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.ini-prow { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line-soft); padding: 3px 0; }
.ini-prow label { display: flex; align-items: center; gap: 6px; }
.ini-pacc { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 2px 12px; }
.ini-pacc h4 { grid-column: 1 / -1; margin: 8px 0 2px; }
.ini-pacc [hidden] { display: none !important; }
/* buscador de pantallas (Personalizar la pantalla de inicio): fijo arriba al desplazar la lista */
.ini-pbuscabar { position: sticky; top: -1px; z-index: 2; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 6px 0 8px; background: var(--panel, #fff); }
.ini-pbuscabar .ini-pbusca { flex: 1 1 320px; max-width: 520px; height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.ini-pbuscabar label { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }

/* ------------------------------------------------------------ importador de presupuestos (importador.js) */
.imp .bw-ver { color: var(--muted); margin-right: 8px; }
.imp-bar { padding: 6px 10px; border-bottom: 1px solid var(--line-soft); background: #fafbfc; }
.imp-body { display: grid; grid-template-columns: minmax(320px, 1.1fr) minmax(300px, 1fr) minmax(280px, .9fr); min-height: 62vh; }
/* mejora n.º 82: barras entre los paneles (.imp-asa) para cambiar el ancho del origen (--imp-c1) y del destino (--imp-c3), en px */
.imp-body:has(> .imp-asa) { grid-template-columns: minmax(320px, var(--imp-c1, 1.1fr)) 7px minmax(260px, 1fr) 7px minmax(280px, var(--imp-c3, .9fr)); }
.imp-asa { cursor: col-resize; background: var(--line-soft); border-left: 1px solid var(--line); border-right: 1px solid var(--line); touch-action: none; }
.imp-asa:hover, body.bw-arrastrando .imp-asa { background: var(--accent); }
@media (max-width: 1250px) { .imp-body, .imp-body:has(> .imp-asa) { grid-template-columns: 1fr 1fr; } .imp-asa { display: none; } .imp-dest { grid-column: 1 / -1; border-top: 1px solid var(--line-soft); } }
@media (max-width: 800px) { .imp-body { grid-template-columns: 1fr; } }
.imp-col { display: flex; flex-direction: column; min-width: 0; max-height: calc(100vh - 190px - var(--top2)); overflow: auto; }
.imp-orig, .imp-panel { border-right: 1px solid var(--line-soft); }
.imp-panel { background: var(--face); padding: 8px 10px; gap: 8px; }
.imp-tabs { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px 6px 0; border-bottom: 1px solid var(--line); }
.imp-tabs button { border: 1px solid var(--line); border-bottom: 0; border-radius: 6px 6px 0 0; background: #f1f3f6; padding: 5px 10px; font-size: 12px; }
.imp-tabs button.on { background: #fff; font-weight: 600; color: var(--accent); }
.imp-filtro { display: flex; flex-direction: column; gap: 4px; padding: 8px; border-bottom: 1px solid var(--line-soft); font-size: 12px; }
.imp-filtro > b { font-size: 12px; color: var(--muted); }
.imp-f { display: flex; align-items: center; gap: 4px; }
.imp-f > span { color: var(--muted); width: 118px; flex: none; }
.imp-filtro input, .imp-filtro select { height: 26px; border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; min-width: 0; flex: 1; font-size: 12.5px; }
.imp-filtro .w6 { width: 64px; flex: none; }
.imp-filtro button.mini, .imp-tb button.mini { height: 24px; padding: 0 8px; border: 1px solid var(--line); border-radius: 4px; background: #fff; font-size: 12px; }
.imp-fb { grid-column: 1 / -1; display: flex; gap: 6px; justify-content: flex-end; }
.imp-fb button { height: 28px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.imp-fb button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.imp-tb { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-bottom: 1px solid var(--line-soft); background: #fafbfc; position: sticky; top: 0; z-index: 1; }
.imp-tb select { height: 28px; border: 1px solid var(--line); border-radius: 6px; max-width: 100%; flex: 1; }
.imp-tree { font-size: 12.5px; }
.imp-n { display: flex; align-items: center; gap: 4px; padding: 2px 6px 2px 4px; border-bottom: 1px solid #f1f3f6; cursor: pointer; white-space: nowrap; }
.imp-n:hover { background: var(--row-hover); }
.imp-n.sel, .imp-n.sel:hover { background: var(--row-sel); outline: 1px solid var(--accent); outline-offset: -1px; }
.imp-n .tg { border: 0; background: none; width: 16px; flex: none; padding: 0; color: var(--muted); }
.imp-n .nm { overflow: hidden; text-overflow: ellipsis; flex: 1; }
.imp-n .ud { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.imp-n.n-obra { font-weight: 700; background: #fffbd6; } .imp-n.n-obra.ejec { background: #e4ffe4; }
.imp-n.n-presupost { font-weight: 600; background: #fffde9; } .imp-n.n-presupost.ejec { background: #f0fff0; }
.imp-n.n-ue, .imp-n.n-bbdd { font-weight: 600; background: #eef3fb; }
.imp-n.n-capitulo, .imp-n.n-dcap { background: #ffd7c8; } .imp-n.n-capitulo.sub { background: #ffe6c8; }
.imp-n.n-rec { cursor: default; color: #444; } .imp-n.n-rec.auto { font-style: italic; color: var(--muted); }
.imp-tipo { align-self: flex-start; background: #ffff80; border: 1px solid #d8d860; border-radius: 4px; padding: 2px 8px; font-weight: 700; font-size: 12px; letter-spacing: .3px; }
.imp-kv { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: 3px 10px; font-size: 12.5px; }
.imp-kv .kv { display: contents; }
.imp-kv .kv span { color: var(--muted); }
.imp-kv .kv b { font-weight: 600; white-space: pre-wrap; }
.imp-tot { max-width: 360px; } .imp-tot tr.tot td, .imp-tot tr.tot th { font-weight: 700; }
.imp-obs { white-space: pre-wrap; background: #fff; border: 1px solid var(--line-soft); border-radius: 4px; padding: 6px; margin: 0; font-size: 12px; }
.bw-grid td.neg { color: var(--danger); }
.imp-donde { margin: 6px 8px; font-size: 12px; }
/* análisis de ejecución de obra E-0…E-6 (analisis.js) */
.anw .an-filtro { border-bottom: 1px solid var(--line-soft); padding: 4px 10px; }
.anw .an-filtro summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.anw .an-campos { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; padding: 4px 0; }
.anw .an-campo { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.anw .an-campo > span:first-child { color: var(--muted); }
.anw .an-campo.ancho input[type=search] { width: 300px; }
.anw .an-campo select, .anw .an-campo input[type=text], .anw .an-campo input[type=search] { height: 26px; border: 1px solid var(--line); border-radius: 4px; background: #fff; font: inherit; max-width: 280px; }
.anw .an-chks, .anw .an-fechas { display: inline-flex; gap: 8px; align-items: center; }
.anw .an-copia { padding: 0 6px; height: 24px; }
.anw .an-acciones { display: flex; gap: 6px; padding: 4px 0 6px; }
.anw .an-tb { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--line-soft); }
.anw .an-tabs { display: inline-flex; gap: 2px; }
.anw .an-tabs button.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.anw .an-info { margin-left: auto; color: var(--muted); font-size: 12px; }
.anw .an-body { padding: 8px 10px 10px; }
.anw .an-tabla { max-height: calc(100vh - 290px - var(--top2)); overflow: auto; }
table.dl.an td { max-width: 320px; }
table.dl.an th { cursor: pointer; }
table.dl.an tr.an-grp th { text-align: center; background: #e6ebf2; font-size: 11px; cursor: default; }
table.dl.an th.g-pres, table.dl.an tr.an-grp th.g-pres { background: #fff8d6; }
table.dl.an th.g-p2, table.dl.an tr.an-grp th.g-p2 { background: #e8f4ea; }
table.dl.an tr.an-sin td { font-style: italic; background: #f7f7f7; }
table.dl.an tr.an-acopio td { background: #f3ede2; }
table.dl.an tr.an-cgo td { background: #eef3fb; }
table.dl.an tr.an-uo td { font-weight: 600; background: #f4f6f9; }
table.dl.an tr.an-tar td.an-ind, table.dl.an tr.an-rec td.an-ind { padding-left: 22px; }
table.dl.an tr.an-rec td { color: var(--muted); font-size: 12px; }
table.dl.an tfoot td { font-weight: 700; border-top: 2px solid var(--line); background: #fafbfc; position: sticky; bottom: 0; }
/* EMP-3: cajas de la pestaña 2 y «Gráficas estadísticas» */
.anw .an-ayuda { margin: 0 0 6px; font-size: 12px; }
.an-e3 { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.an-e3f { border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px 8px; margin: 0; background: #fff; flex: 1 1 360px; }
.an-e3f:first-child { flex: 3 1 760px; }
.an-e3f legend { font-weight: 600; font-size: 12px; padding: 0 4px; }
.an-e3g { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 18px; font-size: 12px; }
.an-e3c { display: inline-flex; align-items: center; gap: 6px; }
.an-e3c > span:first-child { color: var(--muted); min-width: 140px; }
.an-e3c .an-e3c > span:first-child { min-width: 90px; }
.an-e3c b { min-width: 80px; display: inline-block; text-align: right; font-variant-numeric: tabular-nums; }
.an-e3c b.tapa { background: #e6ebf2; border-radius: 3px; height: 14px; }
.an-e3c small { color: var(--muted); }
table.dl.an td.an-s { text-align: center; }
.modal.an-e3modal { width: min(720px, 100%); }
.an-svg { width: 100%; height: auto; font-size: 11px; }
.an-svg .grid { stroke: #e6ebf2; stroke-width: 1; }
.an-svg .base { stroke: #8a96a8; stroke-width: 1; }
.an-svg .ax { fill: var(--muted); }
.an-svg .bar { fill: var(--accent); opacity: .78; }
.an-svg .bar:hover { opacity: 1; }
.an-svg .curva { fill: none; stroke: #b26a00; stroke-width: 2; }
.an-svg .caja { fill: #dbe6f5; stroke: var(--accent); stroke-width: 2; }
.an-svg .mediana { stroke: var(--accent); stroke-width: 3; }
.an-svg .bigote { stroke: #5e6b7c; stroke-width: 2; }
.an-svg .punto { fill: var(--accent); stroke: #fff; stroke-width: 2; }
.an-svg .punto.fuera { fill: var(--danger); }
.anw .an-fechasdoc { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 8px; font-size: 12px; }
.anw .an-cuadro { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 10px; align-items: start; }
.anw .an-cuadro.an-pct .an-card { background: #fffdf0; }
.anw .an-card { border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px 8px; background: #fff; }
.anw .an-card { overflow-x: auto; } .anw .an-card.ancha { grid-column: span 2; }
table.an-kv td.num, table.an-kv th.num, table.an-kv td.pct { white-space: nowrap; }
.anw .an-card h4 { margin: 2px 0 6px; font-size: 13px; }
table.an-kv { border-collapse: collapse; width: 100%; margin-bottom: 6px; font-size: 12px; }
table.an-kv caption { text-align: left; color: var(--muted); padding: 4px 0; }
table.an-kv th { text-align: left; font-weight: 400; padding: 2px 6px 2px 0; white-space: nowrap; }
table.an-kv td { padding: 2px 4px; border-bottom: 1px solid var(--line-soft); }
table.an-kv td.num, table.an-kv th.num { text-align: right; }
table.an-kv td.pct { color: var(--muted); width: 70px; }
table.an-kv td.neg { color: var(--danger); }
table.an-kv tr.an-tot th, table.an-kv tr.an-tot td { font-weight: 700; }
table.an-kv tr[title] { cursor: pointer; }
.anw .an-nota { font-size: 11px; margin: 2px 0 0; }

/* certificación por presupuesto: contenido en árbol (ejecucion.js renderCertTree) */
.c-certtree { display: flex; flex-direction: column; gap: 6px; min-height: 0; overflow: hidden; }
.c-certtree .ct-msg { padding: 12px; }
.ct-bar { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 12px; }
.ct-bar button { padding: 1px 8px; font-size: 12px; }
.ct-chk { display: inline-flex; align-items: center; gap: 4px; margin: 0 6px; font-size: 12px; }
.ct-chk input { width: auto; }
.ct-tot { margin-left: auto; font-weight: 600; }
.ct-wrap { flex: 1 1 auto; min-height: 80px; overflow: auto; }
/* árbol a la izquierda, lo elegido (mediciones, descripción) a la derecha; ocupan el alto de la pantalla */
.ct-split { display: flex; gap: 8px; min-height: 0; height: max(360px, calc(100vh - 430px)); }
.ct-izq { flex: 1 1 62%; min-width: 0; display: flex; flex-direction: column; }
.ct-izq .ct-wrap { flex: 1 1 auto; }
.c-certtree .ct-med { flex: 0 0 30%; min-width: 280px; display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--line-soft, #e5e7eb); border-radius: 6px; padding: 6px 8px; }
.c-certtree .ct-med .ct-wrap { flex: 1 1 auto; max-height: none; }
.ct-med .ct-medh b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.ct-med .ct-vacio { margin: auto 0; font-size: 12px; }
.ct-pest { display: flex; gap: 2px; border-bottom: 1px solid var(--line-soft, #e5e7eb); margin: 2px 0 6px; }
.ct-pest button { border: 0; border-bottom: 2px solid transparent; background: none; padding: 3px 10px; font-size: 12px; color: var(--muted, #6b7280); }
.ct-pest button.on { border-bottom-color: var(--accent); color: inherit; font-weight: 600; }
.ct-cuerpo { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.ct-medn { font-size: 12px; padding-bottom: 4px; }
.ct-med table.dl td, .ct-med table.dl th { font-size: 12px; padding: 2px 6px; }
.ct-desc { flex: 1 1 auto; overflow: auto; font-size: 13px; line-height: 1.45; white-space: normal; }
.ct-desc p { margin: 0 0 4px; }
@media (max-width: 1100px) { .ct-split { flex-direction: column; height: auto; } .ct-izq .ct-wrap { max-height: 60vh; } .c-certtree .ct-med { flex: none; min-width: 0; max-height: 50vh; } }
.ct-tbl td, .ct-tbl th { white-space: nowrap; font-size: 12.5px; padding-top: 3px; padding-bottom: 3px; }
table.dl.ct-tbl td, .ct-med table.dl td { max-width: none; }
table.dl.ct-tbl td:nth-child(3) { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.ct-split.sin-panel .ct-med { display: none; }
.ct-cod { display: inline-block; white-space: nowrap; }
.ct-tbl tr { cursor: default; }
.ct-tbl tr.ct-ue td { font-weight: 700; background: #eef3f8; }
.ct-tbl tr.ct-cap td { font-weight: 600; background: #f6f8fa; }
.ct-tbl tr.ct-otra td { font-style: italic; }
.ct-tbl tr.ct-alb td { font-weight: 600; background: #fff6ec; }     /* albarán de certificación a mano: un capítulo más */
/* editor del albarán de certificación (ejecucion.js albaranCertificacion) */
.modal.ac-modal { width: min(1250px, 98vw); }
/* «Añadir mediciones de unidades de obra a certificación» (ejecucion.js certificarPresupuesto) */
.modal.cp-modal { width: min(1500px, 99vw); }
.cp-modal .modal-b { max-height: calc(98vh - 120px); }
.cp-arbol { max-height: 44vh; }
.cp-tabla td input[type=text] { height: 24px; border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; font: inherit; }
.cp-tabla td.num input { text-align: right; }
.cp-tabla input.calc { background: #f1f4f8; color: #555; }
.cp-tabla tr.cp-cap td { font-weight: 600; background: #f6f8fa; }
.cp-tabla tr.cp-cap td.cp-capnota { font-weight: 400; font-size: 12px; text-align: right; }
.cp-tabla tr.cp-tag { cursor: pointer; }
.cp-tabla tr.cp-tag.cp-sel td { background: #fff8ef; }
.cp-tabla tr.cp-tag.sel td { background: var(--row-sel, #fde3d0); }
.cp-tabla td.cp-nom { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-panel { border-top: 1px solid var(--line-soft); padding-top: 6px; display: flex; flex-direction: column; gap: 6px; }
.cp-ph { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cp-tipos { display: flex; gap: 4px; }
.cp-tipos button { border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 2px 10px; font-size: 12px; }
.cp-tipos button.on { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.cp-lin { max-height: 26vh; }
.cp-lin tr.cp-est td { font-weight: 600; background: #f6f8fa; font-size: 12px; }
.cp-lin tr.cp-pa td { font-style: italic; }
.cp-lin tr.ro td { color: var(--muted); }
.ac-tabla td input[type=text] { height: 26px; border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; font: inherit; }
.ac-tabla td.num input { text-align: right; }
.ac-tabla tr.ro td input { background: var(--input-ro, #eef0f3); color: #555; border-color: transparent; }
.ct-tbl tr.sel td { background: #dbe8ff; }
.ct-tog { display: inline-block; width: 16px; border: 0; background: none; padding: 0; margin-right: 2px; cursor: pointer; color: inherit; font-size: 11px; }
.ct-medh { display: flex; gap: 6px; align-items: baseline; padding: 2px 0; }
.c-certtree.ct-full { position: fixed; inset: 56px 16px 16px 16px; z-index: 40; background: #fff; padding: 10px; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.c-certtree.ct-full .ct-split { flex: 1 1 auto; height: auto; }
/* ------------------------------------------------------------ Comparación general (comparacion.js, gestorComparacion.frm) */
/* colores por nivel del árbol como Darby (rejilla / índice Excel): PE backColorPresupost (36), sin imputar backColorEjecucion (4),
   UE matriz backColorUE (36), lila backColorOtrosIngresos (39), EMD (22), CGO (45), OGO (34), GGE (8), RTA backColorADM (36), capítulo (40) */
.cmpw .cmp-cab { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 6px 10px 0; font-size: 12px; }
.cmpw .cmp-cab .an-campo > span:first-child { color: var(--muted); }
.cmpw .cmp-chk { padding: 1px 6px; border-radius: 4px; }
.cmpw .cmp-chk.on { background: #ffdcdc; }
.cmpw .cmp-vistas label.on { background: var(--accent-soft); border-radius: 4px; }
.cmpw .cmp-vistas label { padding: 1px 6px; font-size: 12px; }
.cmpw .an-tabla { max-height: calc(100vh - 410px - var(--top2)); }
.modal.cmp-lin { max-width: 96vw; } .modal.cmp-lin table.dl td { max-width: 260px; }
/* n.º 197: cabecera (dónde, qué se ve, presupuesto y teórico, unidades de la I) y pie de resumen de «Líneas imputadas…» */
.cmp-lin-cab { border: 1px solid var(--line-soft); border-radius: 6px; background: var(--face); padding: 8px 10px; margin-bottom: 8px; font-size: 12px; display: flex; flex-direction: column; gap: 6px; }
.cmp-lin-ruta { font-size: 12.5px; } .cmp-lin-ruta .cmp-lin-aqui { font-weight: 700; color: var(--accent); }
.cmp-lin-que { margin: 0; color: var(--muted); }
.cmp-lin-datos { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; }
.cmp-lin-datos.teo b { font-style: italic; color: #1f4fb5; }
.cmp-lin-grupo { font-weight: 600; color: var(--muted); min-width: 140px; }
.cmp-lin-dato > span { color: var(--muted); margin-right: 4px; }
table.an-kv.cmp-lin-ui { width: auto; margin: 0; } table.an-kv.cmp-lin-ui td, table.an-kv.cmp-lin-ui th { padding-right: 18px; }
.cmp-lin-pie { border-top: 1px solid var(--line-soft); margin-top: 8px; padding-top: 6px; font-size: 12px; }
.cmp-lin-resumen { display: flex; flex-direction: column; max-width: 620px; margin: 4px 0; }
.cmp-lin-res { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dotted var(--line-soft); padding: 1px 0; }
.cmp-lin-res.sub span { padding-left: 14px; color: var(--muted); }
.cmp-lin-res.total { font-weight: 700; } .cmp-lin-res b.neg { color: var(--danger); }
.cmp-lin-pie > p.muted { margin: 4px 0 0; }
/* n.º 198: maximizar la ventana de líneas imputadas */
.modal-h .cmp-lin-max { margin-left: auto; font-size: 15px; }
/* proyección a fin de obra (comparación general, vista 5) */
table.dl.cmp th.g-py { background: #eaf6ee; }
table.dl.cmp td.cmp-txt { font-size: 11px; color: var(--muted); max-width: 90px; }
.cmpw input.cmp-avmin { width: 56px; }
.cmpw .cmp-proy { width: 100%; border-top: 1px dotted var(--line-soft); padding-top: 4px; }
/* n.º 213: desglose de la desviación de la estimación a fin de obra */
.cmpw .cmp-desglose { width: 100%; font-size: 12px; line-height: 1.6; }
.cmpw .cmp-desglose a { color: inherit; text-decoration: underline dotted; }
.cmpw .cmp-desglose b.neg { color: var(--danger); }
.cmpw .cmp-desglose-aviso { color: #8a5300; background: var(--warn-bg); border-radius: 4px; padding: 2px 6px; margin-top: 2px; }
.modal.cmp-lin.max { position: fixed; inset: 0; width: 100vw; max-width: 100vw; height: 100vh; border-radius: 0; }
.modal.cmp-lin.max .modal-b { max-height: none; flex: 1; min-height: 0; }
.modal.cmp-lin.max .modal-b > .tablewrap { max-height: none !important; flex: 1; min-height: 120px; }
table.dl.cmp thead tr:nth-child(2) th { top: 23px; }
table.dl.cmp th { cursor: default; font-size: 11.5px; }
/* n.º 193: el título de grupo y el de columna parten en renglones en vez de ensanchar la columna; anchos fijos por tipo; raya entre grupos */
table.dl.cmp thead th { white-space: normal; line-height: 1.2; vertical-align: bottom; }
table.dl.cmp tr.an-grp th { padding: 3px 6px; font-size: 11px; vertical-align: middle; }
table.dl.cmp thead tr:nth-child(2) th { padding: 4px 6px; }
table.dl.cmp th.cmp-imp, table.dl.cmp td.cmp-imp { width: 88px; min-width: 88px; }
table.dl.cmp th.cmp-pct, table.dl.cmp td.cmp-pct { width: 58px; min-width: 58px; }
table.dl.cmp th.cmp-ck, table.dl.cmp td.cmp-ck { width: 22px; min-width: 22px; text-align: center; padding-left: 2px; padding-right: 2px; }
table.dl.cmp th.cmp-ud, table.dl.cmp td.cmp-ud { width: 34px; min-width: 34px; }
table.dl.cmp th.g-ini, table.dl.cmp td.g-ini { border-left: 2px solid #9aa6b6; }
table.dl.cmp thead tr:nth-child(2) th.num { text-align: right; }
table.dl.cmp th.g-te { background: #e3ecfa; } table.dl.cmp td.g-te-v { font-style: italic; }   /* n.º 195: columnas teóricas C ↔ I */
/* n.º 194: con desplazamiento horizontal, la primera columna (el nombre) se queda a la vista en las pantallas de análisis */
.an-tabla tbody td:first-child, .an-tabla tfoot td:first-child { position: sticky; left: 0; z-index: 1; background-color: var(--panel); box-shadow: inset -1px 0 0 var(--line); }
.an-tabla thead th:first-child { left: 0; z-index: 3; box-shadow: inset -1px 0 0 var(--line); }
/* n.º 194: «Buscar según filtro» iluminado cuando el filtro ha cambiado y los datos que se ven son del filtro anterior */
.an-acciones button.primary.filtro-pendiente { box-shadow: 0 0 0 3px rgba(243, 103, 27, .45); animation: filtro-pendiente 1.4s ease-in-out infinite; }
@keyframes filtro-pendiente { 50% { box-shadow: 0 0 0 5px rgba(243, 103, 27, .18); } }
table.dl.cmp td { max-width: 140px; font-size: 12px; padding: 3px 6px; }
table.dl.cmp td.cmp-nom { max-width: 380px; min-width: 260px; }
table.dl.cmp th.cmp-nom { min-width: 260px; }
table.dl.cmp td.cmp-m { text-align: center; color: var(--danger); font-weight: 700; }
table.dl.cmp td.cmp-real { cursor: zoom-in; }
table.dl.cmp tbody tr td { background: #fff; }
table.dl.cmp tr.cmp-pe td { background: #ffff99; font-weight: 700; }
table.dl.cmp tr.cmp-sin td { background: #c8f7c8; font-weight: 700; }
table.dl.cmp tr.cmp-matriz td { background: #fff3a8; font-weight: 700; }
table.dl.cmp tr.cmp-lila td { background: #e3d4fb; }
table.dl.cmp tr.cmp-emd td { background: #ffdcdc; font-weight: 700; }
table.dl.cmp tr.cmp-cgo td { background: #ffe0b3; font-weight: 700; }
table.dl.cmp tr.cmp-ogo td { background: #d9fbfb; font-weight: 700; }
table.dl.cmp tr.cmp-gge td { background: #b8f0f0; font-weight: 700; }
table.dl.cmp tr.cmp-adm td { background: #fffbd0; font-weight: 700; }
table.dl.cmp tr.cmp-cap td { background: #fff4e8; }
table.dl.cmp tr.cmp-tag td { color: #1f4fb5; }
table.dl.cmp tr.cmp-tar td { font-size: 11px; color: #33475b; }
table.dl.cmp tr td.neg { color: var(--danger); }
table.dl.cmp tbody tr.sel td { box-shadow: inset 0 0 0 9999px rgba(40, 90, 200, .14); }
table.dl.cmp tbody tr:hover td { box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, .04); }
.cmpw .cmp-pie { border-top: 1px solid var(--line-soft); padding: 6px 10px 8px; font-size: 12px; display: flex; flex-wrap: wrap; gap: 6px 24px; }
.cmpw .cmp-ley { display: flex; flex-direction: column; gap: 2px; color: var(--muted); }
.cmpw .cmp-cajas { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; }
.cmpw .cmp-caja b { display: inline-block; min-width: 90px; text-align: right; border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; margin-left: 4px; background: #fff; }
.cmpw .cmp-caja b.neg { color: var(--danger); }
.cmpw .cmp-igual { margin-left: 6px; color: var(--muted); }
.cmpw .cmp-igual.warn { color: #b26a00; font-weight: 600; }
/* Pantallas de análisis (gestoranalisis.js) y selector de ejercicio de G-1…G-4 desde Empresa */
.sgw .sg-ejercicio { background: #f6f9ff; }
.gaw .ga-tb { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--line-soft); }
.gaw .ga-tb .iv-chk { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.gaw .ga-tb input[type=search] { height: 30px; min-width: 220px; border: 1px solid var(--line); border-radius: 6px; padding: 0 8px; }
.gaw .ga-info { margin-left: auto; font-size: 12px; }
.gaw .ga-body { padding: 8px 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.gaw .ga-bh { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; background: #f3f5f8; border: 1px solid var(--line-soft); border-radius: 4px; padding: 4px 8px; cursor: pointer; }
.gaw .ga-carpeta { width: 12px; color: var(--muted); }
.gaw .ga-lista { list-style: none; margin: 2px 0 4px; padding: 0; }
.gaw .ga-p { display: flex; align-items: center; gap: 10px; padding: 3px 8px 3px 26px; border-bottom: 1px solid var(--line-soft); cursor: default; }
.gaw .ga-p:not(.pend):hover, .gaw .ga-p:focus { background: rgba(40, 90, 200, .08); outline: none; }
.gaw .ga-p.aplica .ga-tit, .gaw .ga-p.aplica .ga-cod { font-weight: 700; }
.gaw .ga-p.pend { color: #8a8f98; }
.gaw .ga-cod { min-width: 52px; font-variant-numeric: tabular-nums; }
.gaw .ga-tit { flex: 1; }
.gaw .ga-pend { font-size: 11px; font-style: italic; }
.gaw .ga-abrir { height: 24px; padding: 0 10px; }
/* mejora 46: código + nombre como acceso directo (un clic) */
.gaw .ga-enlace { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; }
.gaw button.ga-enlace { cursor: pointer; }
.gaw button.ga-enlace:hover .ga-tit, .gaw button.ga-enlace:focus-visible .ga-tit { color: var(--accent); text-decoration: underline; }
.gaw button.ga-enlace:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 3px; }
/* CG personal, fase 2 (personalmulti.js): introducción múltiple, datos para nóminas y amortizaciones pendientes */
.persmulti table.dl.iv td.ed input[type=text] { width: auto; min-width: 48px; }
.persmulti table.dl.iv td.ed input.num { width: 76px; text-align: right; }
.persmulti table.dl.iv tr.err td { background: #fdecec; }
.persmulti table.dl.iv tr.tot td { font-weight: 600; border-top: 1px solid var(--line); }
.persmulti h4 { margin: 10px 0 4px; }
.persmulti .pm-filtro { border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; margin: 0 0 8px; }
.persmulti .pm-tiposbox { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 6px; }
.persmulti .pm-lista { max-height: 160px; overflow: auto; display: flex; flex-direction: column; min-width: 260px; border: 1px solid var(--line); border-radius: 4px; padding: 4px 6px; }
/* parques centrales (parque.js): rejilla de recursos reales asociados y producción de la unidad de tiempo */
.pq-rec .pq-prod { gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.pq-rec .pq-prod .kv { display: inline-flex; gap: 4px; align-items: baseline; }
.pq-rec .pq-prod .kv span { font-size: 11px; color: var(--muted); }
.pq-rec tr.pq-sinclase td { color: #a15c00; }

/* ---------------------------------------------------------------- avisos (avisos.js): alertas, gestor de avisos, avisos automáticos y agenda */
.avw-body { padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.al-antes { color: var(--danger); } .al-hoy { color: var(--accent); } .al-prox { color: var(--ok); }
.al-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.al-kpi { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; background: #f5f7fa; border: 1px solid transparent; border-radius: 6px; padding: 6px 8px; cursor: pointer; color: var(--muted); }
.al-kpi b { font-size: 20px; font-variant-numeric: tabular-nums; color: var(--text); }
.al-kpi span { font-size: 11.5px; }
.al-kpi:hover { border-color: var(--accent); }
.al-kpi.con.al-antes { background: #fde8e7; } .al-kpi.con.al-antes b { color: var(--danger); }
.al-kpi.con.al-hoy { background: var(--accent-soft); } .al-kpi.con.al-hoy b { color: var(--accent); }
.al-kpi.con.al-prox { background: #e6f4ea; } .al-kpi.con.al-prox b { color: var(--ok); }
.ini-tab tr.al-antes td:first-child { color: var(--danger); font-weight: 600; }
.ini-tab tr.al-hoy td:first-child { color: var(--accent); font-weight: 600; }
.ini-tab tr.al-prox td:first-child { color: var(--ok); }
.al-msg { margin: 0 0 6px; font-size: 12px; }
.al-leyenda { display: flex; gap: 16px; font-size: 12px; }
.al-lista { max-height: calc(100vh - 260px - var(--top2)); overflow: auto; padding: 0 4px; }
.al-cat { margin: 12px 0 2px; font-size: 14px; text-decoration: underline; }
.al-sub { display: flex; gap: 12px; align-items: baseline; font-weight: 600; margin: 6px 0 2px; }
.al-ul { margin: 0 0 4px 0; padding-left: 20px; }
.al-ul li { margin: 2px 0; }
.al-ul li a { color: inherit; text-decoration: none; } .al-ul li a:hover { text-decoration: underline; }
.al-ul li.al-antes::marker, .al-ul li.al-antes a { color: var(--danger); }
.al-ul li.al-hoy::marker, .al-ul li.al-hoy a { color: var(--accent); }
.al-ul li.al-prox::marker, .al-ul li.al-prox a { color: var(--ok); }
.al-ul details { margin: 2px 0 4px; color: var(--text); } .al-ul summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.al-desc { white-space: pre-wrap; background: #fafbfc; border-left: 3px solid var(--line); padding: 4px 8px; font-size: 12px; }
.al-nota { font-size: 12px; margin: 8px 0 0; }
.av-filtro { border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px 6px; margin: 0; }
.av-filtro legend { font-weight: 600; padding: 0 4px; }
.av-fila { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: flex-end; margin: 3px 0; }
.av-campo { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.av-campo > span:first-child { color: var(--muted); }
.av-campo select, .av-caja, .av-dias { height: 26px; border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; background: var(--input-req); }
.av-campo select, .av-dias { background: #fff; }
.av-caja.locked { background: var(--input-ro); color: var(--muted); }
.av-dias { width: 70px; text-align: right; }
.av-copia { height: 24px; width: 22px; margin: 0 3px; border: 1px solid var(--line); border-radius: 4px; background: #fff; cursor: pointer; padding: 0; }
.av-info, .av-pie { font-size: 12px; }
.av-hoy { font-size: 12.5px; }
.av-tabla { max-height: calc(100vh - 330px - var(--top2)); min-height: 160px; }
table.dl.av-grid td { max-width: 260px; }
table.dl.av-grid td.ck { text-align: center; }
table.dl.av-grid tr.av-vencido td { color: var(--danger); }
table.dl.av-grid tr.av-hoy td { color: var(--accent); }
table.dl.av-grid tr.av-resuelto td { color: #8a94a3; }
table.dl.av-grid td.av-fv, table.dl.av-grid th.av-fv { background: #e4e6ea; }
table.dl.av-grid tbody tr:nth-child(even) td.av-fv { background: #dfe1e6; }
table.dl.av-grid tfoot td { font-weight: 700; border-top: 2px solid var(--line); background: #fafbfc; position: sticky; bottom: 0; }
table.dl.av-grid tbody tr:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.av-desc-t { font-weight: 600; font-size: 12px; margin-top: 4px; }
.av-desc { min-height: 54px; max-height: 140px; overflow: auto; white-space: pre-wrap; border: 1px solid var(--line); border-radius: 4px; background: #fff; padding: 4px 8px; font-size: 12px; }
.agenda-btn { height: 28px; padding: 0 10px; border: 1px solid rgba(255,255,255,.5); border-radius: 6px; background: transparent; color: inherit; cursor: pointer; margin-right: 8px; }
.ag-wrap { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.ag-cal { width: 300px; border: 1px solid var(--line); border-radius: 6px; padding: 8px; background: #fff; outline: none; }
.ag-cal:focus { box-shadow: 0 0 0 2px var(--accent-soft); }
.ag-cab { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; text-transform: capitalize; }
.ag-cab button { border: 1px solid var(--line); background: #fff; border-radius: 4px; height: 26px; padding: 0 8px; cursor: pointer; }
.ag-sem, .ag-dias { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.ag-sem span { font-size: 11px; color: var(--muted); font-weight: 600; }
.ag-sem .dom, .ag-d.dom { color: var(--danger); }
.ag-d { height: 32px; border: 1px solid transparent; border-radius: 4px; background: transparent; cursor: pointer; font-variant-numeric: tabular-nums; }
.ag-d:hover:not(.vacio) { background: var(--row-hover); }
.ag-d.hoy { font-weight: 800; text-decoration: underline; }
.ag-d.nota { background: #fff2c8; color: #8a5a00; }
.ag-d.nota.dom { color: var(--danger); }
.ag-d.sel { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.ag-nota { flex: 1; min-width: 320px; display: flex; flex-direction: column; gap: 4px; }
.ag-texto { width: 100%; min-height: 320px; resize: vertical; border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px; font: inherit; }
.ag-texto[readonly] { background: var(--input-ro); }
.ini-alertas .ini-tab { table-layout: fixed; }
.ini-alertas .ini-tab td:nth-child(1) { width: 78px; } .ini-alertas .ini-tab td:nth-child(2) { width: 56px; }
.ini-alertas .ini-tab td:nth-child(3) { width: 30%; } .ini-alertas .ini-tab td:nth-child(5) { width: 72px; }

/* ---------------------------------------------------------------- planificación general de la UE (planificacion.js) */
.plw-body { padding: 8px 10px; display: flex; flex-direction: column; gap: 8px; }
.plw-cab { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.plw-ue { display: grid; grid-template-columns: auto auto; gap: 2px 8px; align-items: baseline; }
.plw-obsl { display: flex; flex-direction: column; flex: 1; min-width: 260px; }
.plw-obsl span { font-size: 12px; color: var(--muted); }
.plw-obs { width: 100%; border: 1px solid var(--line); border-radius: 4px; padding: 4px 6px; resize: vertical; }
.plw-marcos { display: flex; gap: 10px; flex-wrap: wrap; }
.plw-marcos fieldset { border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px 6px; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(120px, auto)); gap: 2px 14px; align-content: start; }
.plw-marcos legend { font-weight: 600; padding: 0 4px; }
.plw-marcos .kv { display: flex; flex-direction: column; }
.plw-marcos .kv span { font-size: 11.5px; color: var(--muted); }
.plw-marcos .kv.big b { color: var(--accent); }
.plw-grid { max-height: calc(100vh - 420px - var(--top2)); min-height: 220px; overflow: auto; border: 1px solid var(--line-soft); border-radius: 4px; }
.plw-tabla td.num, .plw-tabla th.num { text-align: right; }
table.dl.plw-tabla td { max-width: none; overflow: visible; }
table.dl.plw-tabla td.txt { max-width: 260px; overflow: hidden; }
.plw-tabla td.ck { text-align: center; }
.plw-tabla tr.esp td { background: #f3f4f7 !important; color: #5e6b7c; font-style: italic; }
.plw-tabla td.rojo { color: var(--danger); font-weight: 600; }
.plw-tabla tfoot td { position: sticky; bottom: 0; background: #eef1f5; font-weight: 600; border-top: 1px solid var(--line); padding: 4px 8px; text-align: right; }
.plw-tabla tfoot td:first-child { text-align: left; }
.plw-in { width: 100px; height: 22px; border: 1px solid var(--line); border-radius: 3px; text-align: right; padding: 0 4px; background: #fffef2; }
.plw-ley { margin: 0; }
.plw-curva { border: 1px solid var(--line-soft); border-radius: 4px; padding: 6px; background: #fff; }
.plw-svg { width: 100%; max-height: calc(100vh - 430px - var(--top2)); min-height: 280px; }
.plw-tit { font-weight: 600; font-size: 14px; fill: var(--text); }
.plw-ax { font-size: 11px; fill: #5e6b7c; }
.plw-grid-l { stroke: #e3e7ee; }
.plw-pt { opacity: .0; } .plw-pt:hover { opacity: 1; }

/* ---------------------------------------------------------------- diagrama de Gantt (gantt.js) */
.gw-body { padding: 6px 8px; }
.gw-lbl { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.gw-lbl select, .gw-lbl input { height: 28px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.gw .tb button.on { background: var(--accent-soft); color: var(--accent); }
.gw-split { display: flex; max-height: calc(100vh - 205px - var(--top2)); min-height: 260px; overflow-y: auto; overflow-x: hidden; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.gw-izq { flex: 0 0 auto; max-width: 62%; overflow-x: auto; border-right: 2px solid var(--line); }
.gw-der { flex: 1 1 auto; overflow-x: auto; overflow-y: hidden; }
.gw-tabla { border-collapse: collapse; font-size: 12px; }
.gw-tabla th { height: 40px; position: sticky; top: 0; background: #f1f3f6; border-bottom: 1px solid var(--line); padding: 0 6px; text-align: left; font-weight: 600; z-index: 1; }
.gw-tabla td { height: 24px; max-height: 24px; padding: 0 4px; border-bottom: 1px solid #eef1f5; white-space: nowrap; }
.gw-tabla tr { height: 24px; }
.gw-tabla td.num { text-align: right; }
.gw-tabla td.ck { text-align: center; }
.gw-tabla tr.res td { font-weight: 600; }
.gw-tabla tr.gw-obra td, .gw-tabla tr.gw-emp td { background: #f6f3fb; }
.gw-tabla tr.sel td { background: var(--row-sel); }
.gw-tabla tr.ed td.gw-id { box-shadow: inset 3px 0 0 #e8a33d; }
.gw-tabla .gw-nom { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.gw-tabla .gw-id { color: var(--muted); width: 30px; }
.gw-tabla .gw-sinp { color: #9aa5b4; font-style: italic; }
.gw-tabla .tg, .gw-rt .tg { border: 0; background: none; width: 16px; padding: 0; cursor: pointer; }
.gw-tabla .tg0 { display: inline-block; width: 16px; }
.gw-in { height: 20px; border: 1px solid transparent; border-radius: 3px; background: transparent; padding: 0 3px; font-size: 12px; }
.gw-in:hover, .gw-in:focus { border-color: var(--line); background: #fffef2; }
.gw-in.num { width: 54px; text-align: right; }
.gw-date { width: 84px; }
.gw-pred { width: 120px; }
.gw-svg { display: block; font: 11px var(--font); user-select: none; }
.gw-finde { fill: #eef1f5; }
.gw-alt { fill: #fafbfc; }
.gw-lmes { stroke: #9aa5b4; }
.gw-lsem { stroke: #e3e7ee; }
.gw-lh { stroke: #c8ced8; }
.gw-hm { font-weight: 600; fill: #1d2633; }
.gw-hd { fill: #5e6b7c; font-size: 10px; } .gw-hd.fs { fill: #b0b8c4; }
.gw-hoy { stroke: #b3261e; stroke-dasharray: 4 3; }
.gw-hoyt { fill: #b3261e; font-size: 10px; }
.gw-b { cursor: grab; }
.gw-barra:hover { filter: brightness(1.1); }
.gw-borde { fill: transparent; cursor: ew-resize; }
.gw-asa { fill: #fff; stroke: #1f5fae; stroke-width: 1.5; cursor: crosshair; opacity: 0; }
.gw-b:hover .gw-asa { opacity: 1; }
.gw-bt { fill: #374151; font-size: 10.5px; pointer-events: none; }
.gw-sinpt { fill: #9aa5b4; font-style: italic; }
.gw-flecha { fill: none; stroke: #374151; stroke-width: 1.2; pointer-events: none; }
.gw-flecha-hit { fill: none; stroke: transparent; stroke-width: 8; cursor: pointer; }
.gw-flecha-hit:hover { stroke: rgba(31, 95, 174, .25); }
.gw-nuevo { stroke: #1f5fae; stroke-width: 1.5; stroke-dasharray: 4 3; }
.gw-nota { margin: 4px 0 0; }
.gw-rec { display: flex; flex-direction: column; gap: 6px; }
.gw-rgrid { max-height: calc(100vh - 260px - var(--top2)); overflow: auto; border: 1px solid var(--line-soft); border-radius: 4px; }
.gw-rt td.num { text-align: right; } .gw-rt td.ck { text-align: center; }
.gw-rt tr.gw-rcap td { background: #eef1f5 !important; font-weight: 600; }
.gw-rt tr.gw-rtag td { font-weight: 600; }
.gw-rt tr.gw-rtar td { color: #374151; }
table.dl.gw-rt td { max-width: none; }
table.dl.gw-rt td.gw-nom { max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.gw-rt td.gw-falta { background: #fff4d6 !important; }
@media print { .gw-flecha-hit, .gw-asa, .gw-borde { display: none; } }

/* Resumen versión PO / PE (resumenversion.js): árbol de solo lectura */
.c-budget .rv-tb { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; }
.c-budget .rv-tb .muted { color: var(--muted); font-size: 12px; margin-left: 6px; }
.c-budget .rv-wrap { max-height: calc(100% - 40px); overflow: auto; }
table.dl.rv { width: 100%; font-size: 12px; }
table.dl.rv td { white-space: nowrap; }
table.dl.rv td.rv-nom { white-space: normal; min-width: 220px; }
table.dl.rv td.rv-m, table.dl.rv th.rv-m { text-align: center; }
table.dl.rv tr.rv-v td, table.dl.rv tr.rv-u td, table.dl.rv tr.rv-n td { font-weight: 600; }
table.dl.rv tr.rv-c td { font-weight: 600; background: #f4f6f9; }
table.dl.rv tr.rv-r td { color: var(--muted); }
table.dl.rv tr.rv-x td { color: var(--muted); font-style: italic; }
table.dl.rv .rv-fold { display: inline-block; width: 16px; padding: 0; border: 0; background: none; cursor: pointer; font-size: 11px; line-height: 1; }
table.dl.rv tbody tr { cursor: default; }

/* ---- compras, fase 2 (compras.js) y utilidades de las fichas (utilidades.js, opciones.js) ---- */
.c-grid td.ipt-rojo, .c-grid td.ipt-rojo input { color: var(--danger); font-weight: 600; }
.c-grid td.huerfano, .c-grid td.huerfano input, table.dl td.huerfano { color: var(--danger); }
.cmpr-body { padding: 8px 10px; overflow: auto; }
.cmpr-body h4.nec-h { margin: 10px 0 4px; font-size: 12px; font-weight: 600; color: #3f4b5b; }
.cmpr-body table.dl td.num, .cmpr-body table.dl td input.num { text-align: right; font-variant-numeric: tabular-nums; }
.cmpr-body table.dl td.neg, table.dl tr.neg td { color: var(--danger); }
.cmpr-body table.dl td input[type="text"] { width: 100%; min-width: 60px; border: 1px solid transparent; background: transparent; font-size: 12px; padding: 1px 3px; }
.cmpr-body table.dl td input[type="text"]:focus { border-color: #9cb6dc; background: #fff; }
.cmpr-body table.dl td input[readonly] { color: #3f4b5b; }
.cmpr-body table.dl td.ck { text-align: center; }
.nec-grid1 { max-height: 46vh; }
.nec-tabla tr.nec-padre > td { background: #f6f8fb; font-weight: 600; }
.nec-tabla tr.nec-padre.cur > td { background: #e8f0fe; }
.nec-tabla tr.nec-hijo > td { font-weight: 400; }
.nec-tabla td.nec-nom { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.nec-tabla td.nec-todos input { accent-color: #c62828; }
.nec-tabla td.nec-algunos input { accent-color: #9e9e9e; opacity: .7; }
.nec-carpeta button { padding: 0 4px; }
.nec-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 900px) { .nec-cols { grid-template-columns: 1fr; } }
.nec-observ { white-space: pre-wrap; min-height: 48px; max-height: 140px; overflow: auto; padding: 6px; border: 1px solid #e3e7ee; background: #fbfcfd; font-size: 12px; }
.nec-af td:first-child { white-space: normal; }
.cmpo-grid { max-height: 52vh; }
.cmpo-tabla th.cmpo-pres, .cmpo-tabla td.cmpo-pres { background: #eef0f3; }
.cmpo-tabla th.cmpo-sel, .cmpo-tabla td.cmpo-sel { background: #e7f6e7; }
.cmpo-tabla th.cmpo-p { border-left: 2px solid #cfd6e1; }
.cmpo-tabla td.cmpo-c, .cmpo-tabla td.cmpo-v { cursor: pointer; }
.cmpo-tabla td.cmpo-c.cur { outline: 2px solid rgba(31,95,174,.45); outline-offset: -2px; }
.cmpo-tabla tr.cmpo-tot td { background: #fffbe6; font-weight: 600; }
.cmpo-pie { margin-top: 8px; border-top: 1px solid #e3e7ee; padding-top: 6px; }
/* mejora n.º 23: Comparación de ofertas. El nombre del proveedor no ensancha su pareja de columnas (manda el importe); el recurso, más ancho;
   desplazamiento horizontal con las columnas del recurso y las filas de cabecera fijas; con más de 5 proveedores, lista desplegable */
.cmpo-grid { max-height: calc(100vh - 380px - var(--top2)); min-height: 220px; overflow: auto; }
.cmpo-tabla th.cmpo-p { max-width: none; }
.cmpo-tabla .cmpo-pn { width: 0; min-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmpo-tabla th.cmpo-i, .cmpo-tabla tr:nth-child(2) th.cmpo-pres, .cmpo-tabla tr:nth-child(2) th.cmpo-sel { min-width: 100px; text-align: right; }
.cmpo-tabla tr:nth-child(2) th:nth-child(1) { min-width: 64px; }
.cmpo-tabla tr:nth-child(2) th:nth-child(2) { min-width: 44px; }
.cmpo-tabla th.cmpo-p1, .cmpo-tabla td.cmpo-p1 { border-left: 2px solid #cfd6e1; }
.cmpo-tabla th.cmpo-nom { min-width: 360px; }      /* ancho en la cabecera (las celdas se recortan con «…»): así se puede estrechar arrastrando */
.cmpo-tabla thead th, .cmpo-tabla thead td { position: sticky; z-index: 2; }
.cmpo-tabla thead td { background: #fffbe6; }
.cmpo-tabla .cmpo-fija { position: sticky; z-index: 1; background: var(--panel, #fff); }
.cmpo-tabla tbody tr:nth-child(even) td.cmpo-fija { background: var(--row-alt); }
.cmpo-tabla tbody tr:hover td.cmpo-fija { background: var(--row-hover); }
.cmpo-tabla thead .cmpo-fija { z-index: 3; background: #f1f3f6; }
.cmpo-tabla thead tr.cmpo-tot .cmpo-fija { background: #fffbe6; }
.cmpo-tabla td.nec-nom.cmpo-fija { box-shadow: 2px 0 0 #cfd6e1; }
.cmpo-provsel { display: inline-block; position: relative; margin: 2px 0 6px; }
.cmpo-provsel > summary { cursor: pointer; list-style: none; border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; background: #fff; font-size: 12.5px; }
.cmpo-provsel > summary::-webkit-details-marker { display: none; }
.cmpo-provlista { position: absolute; z-index: 30; margin-top: 4px; background: var(--panel, #fff); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15); padding: 8px 10px; width: min(900px, 90vw); }
.cmpo-provchks { columns: 3 240px; column-gap: 18px; max-height: 260px; overflow: auto; padding-top: 6px; }
.cmpo-provchks .iv-chk { display: flex; gap: 4px; break-inside: avoid; padding: 2px 0; font-size: 12.5px; }
/* mejora n.º 26: comparaciones guardadas (barra de documento y ofertas comparadas) */
.cmpo-doc { padding: 6px 0 2px; display: flex; flex-direction: column; gap: 4px; }
.cmpo-docbar { gap: 6px; }
/* mejora n.º 36: barra de botones arriba (como las fichas); nombre de la comparación en su fila */
.cmpo-barra { padding: 2px 0 6px; border-bottom: 1px solid #e3e7ee; margin-bottom: 6px; }
.cmpo-cabcomp { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; }
.cmpo-docbar button.on { background: var(--accent-soft, #e8f0fe); border-color: var(--accent); color: var(--accent); }
.cmpo-docbar .pos { min-width: 48px; text-align: center; font-size: 12.5px; }
.cmpo-cabcomp .cmpo-general, .cmpo-docbar .cmpo-general { font-size: 12.5px; color: var(--muted, #4b5563); }
/* mejora n.º 31: accesos directos a la comparación desde la oferta (ficha y listado) */
input.cmpo-ir { cursor: pointer; color: var(--accent); text-decoration: underline dotted; text-underline-offset: 2px; }
table.dl td.golink-celda { color: var(--accent); text-decoration: underline dotted; text-underline-offset: 2px; cursor: pointer; }
.cmpo-cabcomp input.cmpo-nombre, .cmpo-docbar input.cmpo-nombre { height: 28px; min-width: 280px; border: 1px solid var(--line); border-radius: 4px; padding: 0 8px; font: 600 13px/1 var(--font); }
.cmpo-ofertas { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; }
.cmpo-chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid #cfd6e1; background: #f4f7fb; border-radius: 12px; padding: 1px 4px 1px 10px; }
.cmpo-chip button.link { padding: 0 4px; font-size: 14px; line-height: 1; }
/* incidencia n.º 34: qué se graba solo y qué hay que grabar en la comparación de ofertas */
.cmpo-estado { font-size: 12px; color: var(--muted, #6b7280); margin: 2px 0 6px; }
.cmpo-estado.pend { color: #b54708; font-weight: 600; }
/* incidencia n.º 34, 2.ª parte: S pasada a la oferta (para el pedido) frente a la S grabada en la comparación */
.cmpo-tabla td.ck.cmpo-bel { background: #dff5df; box-shadow: inset 3px 0 0 #2e9e48; }
.cmpo-estado .cmpo-leyenda { color: #2e7d32; font-weight: 400; }
/* mejora n.º 33: ofertas pendientes de asociar, lista vertical en la pantalla (no flotante) */
.cmpo-pend { margin: 4px 0 6px; font-size: 12.5px; }
.cmpo-pend > summary { cursor: pointer; font-weight: 600; padding: 2px 0; }
.cmpo-pendwrap { display: inline-block; max-width: 100%; }
.cmpo-pendwrap > table.cmpo-pendtabla { display: block; max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 4px; border-collapse: collapse; table-layout: auto; }
.cmpo-pendtabla th { position: sticky; top: 0; background: #f4f7fb; text-align: left; font-weight: 600; }
.cmpo-pendtabla td, .cmpo-pendtabla th { padding: 3px 12px 3px 6px; white-space: nowrap; border-bottom: 1px solid #eef1f5; }
.cmpo-pendtabla td.num { text-align: right; }
.cmpo-pendtabla tr:hover td { background: #f7f9fc; }
.cmpo-pendwrap > .tb { margin-top: 4px; }
.cmpo-tabla .cmpo-of { font-weight: 400; font-size: 11.5px; color: var(--muted, #6b7280); }
table.dl.cmpo-lista tr.cur td { background: var(--row-sel); }
.prw-cambio { border: 1px solid #e3e7ee; padding: 6px; margin: 6px 0; background: #fbfcfd; }

/* tesorería, 2.ª parte: previsiones, agrupaciones y pie de financiación */
.previsiones .pv-tabs button.on, .previsiones .pv-tabs button.on:hover { background: var(--accent, #2f6fde); color: #fff; }
.previsiones .pv-busca { width: 190px; }
.previsiones tr.pv-vencida td { color: #b42318; }
.previsiones tr.pv-vencida td input { color: #b42318; }
.previsiones td.lnk { text-decoration: underline dotted; cursor: pointer; }
.c-grid tr.agr-pasada-p td { background: #ffe1ea; }          /* fresa: ya incluida en la agrupación de pagos */
.c-grid tr.agr-pasada-c td { background: #dff5df; }          /* verde: ya incluida en la agrupación de cobros */
.c-grid tr.agr-noelegida td { color: #8a8f98; }               /* gris: no elegida */
.c-piefin { overflow: auto; border: 1px solid var(--line); border-radius: 4px; background: #fbfcfd; padding: 4px 6px; font-size: 12px; }
.imputar .iv-pie { border-top: 1px solid var(--line-soft); padding: 4px 8px; font-size: 12px; max-height: 220px; overflow: auto; }
.imputar .iv-pie:empty { display: none; }
.pf .pf-h { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-bottom: 2px; }
.pf .pf-t { font-weight: 600; margin-top: 2px; }
.pf .pf-tabla { border-collapse: collapse; }
.pf .pf-tabla td, .pf .pf-tabla th { padding: 1px 4px; }
.pf .pf-tabla select { max-width: 230px; }
.pf .pf-tabla input.num { width: 90px; text-align: right; }
.pf .pf-tabla td.neg { color: #b42318; }
.pf .pf-c, .pf .pf-imp, .pf .pf-b { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 3px; }
.pf .pf-c input[type=text] { width: 150px; }
.pf .pf-c input.pf-doc { width: 90px; }
.pf .pf-msg { color: #b42318; margin-top: 2px; min-height: 1em; }
.pf-nota { margin: 2px 0; }

/* ---------------------------------------------------------------- informes: vista previa (informes.js) */
.inf-bg { padding: 2vh 16px; }
.modal.inf-modal { width: min(1060px, 100%); height: 96vh; }
.inf-barra { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 8px 14px; border-bottom: 1px solid var(--line-soft); background: var(--face); }
.inf-barra select { max-width: 340px; }
.inf-tit { font-size: 13px; }
.inf-ops { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 12.5px; }
.inf-op { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.inf-op.dis { opacity: .5; }
.inf-sep { flex: 1; }
.inf-pres { position: relative; font-size: 12.5px; }
.inf-pres > summary { cursor: pointer; list-style: none; padding: 3px 9px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); white-space: nowrap; }
.inf-pres > summary::-webkit-details-marker { display: none; }
.inf-pres > summary::after { content: " ▾"; }
.inf-pres[open] > summary { background: var(--face); }
.inf-pres-caja { position: absolute; z-index: 5; top: calc(100% + 4px); left: 0; min-width: 300px; display: flex; flex-direction: column; gap: 7px;
  padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.inf-pres-caja .inf-ayuda { color: var(--muted); font-size: 11.5px; white-space: normal; max-width: 340px; }
.inf-cuerpo { flex: 1; min-height: 0; background: #8a929e; padding: 10px; display: flex; }
.inf-marco { flex: 1; border: 0; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.35); width: 100%; height: 100%; }
.inf-estado { margin-right: auto; color: var(--muted); font-size: 12.5px; }
@media (max-width: 640px) { .modal.inf-modal { height: 92vh; } .inf-cuerpo { padding: 4px; } }

/* ---------------------------------------------------------------- Configuración › Correo (SMTP) (correo.js) */
.modal.cor-modal { width: min(620px, 100%); }
.cor-fila { display: grid; grid-template-columns: 11em 1fr; align-items: center; gap: 2px 10px; }
.cor-fila input, .cor-fila select { width: 100%; }
.cor-ayuda { grid-column: 2; color: var(--muted); }
.cor-dos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; align-items: end; }
.cor-dos .cor-fila { grid-template-columns: auto 1fr; }
.cor-chk { display: flex; align-items: center; gap: 6px; padding-left: 11.6em; }
.cor-nota { margin: 0 0 0 11.6em; color: #8a5a00; font-size: 12px; }
.cor-nota:empty { display: none; }
.cor-sello { margin: 0; font-size: 12px; color: var(--muted); }
.cor-prueba { display: flex; justify-content: flex-end; }
@media (max-width: 560px) { .cor-fila { grid-template-columns: 1fr; } .cor-chk, .cor-nota { padding-left: 0; margin-left: 0; } .cor-dos { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ desplegables con búsqueda (combos.js) */
.cb { position: relative; display: inline-flex; align-items: center; min-width: 220px; max-width: 100%; vertical-align: middle; }
.cb-sel { display: none !important; }
.cb-in { width: 100%; height: 26px; border: 1px solid var(--line); border-radius: 4px; background: var(--input); padding: 0 22px 0 6px; font: inherit; text-overflow: ellipsis; }
.cb-in:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.cb-in::placeholder { color: #9aa3b1; }
.cb.dis .cb-in { background: var(--input-ro); color: var(--muted); }
.cb-fl { position: absolute; right: 6px; color: var(--muted); font-size: 11px; cursor: pointer; }
.cb-lista { position: fixed; z-index: 400; margin: 0; padding: 4px; list-style: none; max-width: min(640px, 92vw); overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 10px 28px rgba(0,0,0,.2); font-size: 12.5px; }
.cb-lista li { padding: 5px 8px; border-radius: 4px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-lista li:hover { background: var(--row-hover); }
.cb-lista li.sel { background: var(--accent-soft); font-weight: 600; }
.cb-lista li.vacio { color: var(--muted); font-style: italic; }
.cb-lista li.nada { color: var(--muted); cursor: default; font-style: italic; }

/* ------------------------------------------------------------ columnas a gusto del usuario (columnas.js) */
th.col-red { position: sticky; }
.col-asa { position: absolute; top: 0; right: -3px; width: 7px; height: 100%; cursor: col-resize; z-index: 2; }
/* mejora n.º 116: cabecera con ancho puesto: el título se corta con «…» (no marca el ancho mínimo de la columna); max-width 1px, como las casillas */
table.dl th.col-red.col-ancho, .c-grid th.col-red.col-ancho { overflow: hidden; text-overflow: ellipsis; max-width: 1px; }
th.col-red.col-ancho .col-asa { right: 0; }
table.dl th.col-relleno { cursor: default; border-right: 0; }
table.dl td.col-relleno { border-right: 0; max-width: none; }
.col-asa:hover, body.col-arrastrando .col-asa { background: linear-gradient(90deg, transparent 3px, var(--accent) 3px, var(--accent) 4px, transparent 4px); }
body.col-arrastrando { cursor: col-resize; user-select: none; }
.col-btn { border: 1px solid var(--line); background: var(--panel); border-radius: 5px; height: 24px; padding: 0 8px; font-size: 12px; color: var(--muted); margin-left: 8px; }
.list-bar .col-btn { margin-left: auto; }
.list-bar .count + .col-btn, .gfoot .col-btn { margin-left: auto; }
.gfoot { display: flex; align-items: center; gap: 4px; }
.col-btn:hover { color: var(--accent); border-color: var(--accent); }
.col-panel-bg { position: fixed; inset: 0; z-index: 300; background: rgba(10,12,18,.3); display: grid; place-items: center; padding: 16px; }
.col-panel { width: min(420px, 100%); max-height: 80vh; display: flex; flex-direction: column; background: var(--panel); border-radius: 10px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.col-panel-h { padding: 14px 16px 8px; display: grid; gap: 4px; border-bottom: 1px solid var(--line-soft); }
.col-panel-h b { font: 700 15px/1.2 var(--font-brand); }
.col-panel-h small { color: var(--muted); }
.col-lista { list-style: none; margin: 0; padding: 6px 10px; overflow: auto; }
.col-lista li { display: flex; align-items: center; gap: 8px; padding: 3px 4px; border-radius: 5px; }
.col-lista li:hover { background: var(--row-hover); }
.col-lista label { flex: 1; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.col-mov button { border: 1px solid var(--line); background: var(--panel); border-radius: 4px; width: 24px; height: 22px; padding: 0; }
.col-mov button:disabled { opacity: .35; }
/* mejora n.º 116: ordenar las columnas arrastrando */
.col-lista li[draggable="true"] { cursor: grab; }
.col-lista li.col-arrastrada { opacity: .45; }
.col-lista li.col-drop-antes { box-shadow: inset 0 2px 0 var(--accent); }
.col-lista li.col-drop-despues { box-shadow: inset 0 -2px 0 var(--accent); }
.col-asa-fila { color: var(--muted); font-size: 12px; letter-spacing: -2px; cursor: grab; user-select: none; }
.col-panel-pie { display: flex; justify-content: space-between; padding: 10px 16px; border-top: 1px solid var(--line-soft); }
.col-panel-pie button { height: 30px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.col-panel-pie button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ------------------------------------------------------------ ventanas abiertas que no caben (lista) */
.wintabs-mas { flex: none; align-self: center; height: 30px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); padding: 0 8px; font-weight: 700; color: var(--muted); }
.wintabs-mas:hover, .wintabs-mas[aria-expanded="true"] { color: var(--accent); border-color: var(--accent); }
.wintabs-lista { position: fixed; z-index: 260; width: min(420px, 92vw); max-height: 70vh; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 14px 34px rgba(0,0,0,.22); padding: 6px; }
.wintabs-lista .fila { display: flex; align-items: center; gap: 8px; padding: 2px 4px 2px 8px; border-radius: 6px; }
.wintabs-lista .fila:hover { background: var(--row-hover); }
.wintabs-lista .fila.on { background: var(--accent-soft); font-weight: 700; }
.wintabs-lista .fila .pt { width: 8px; height: 8px; border-radius: 2px; background: var(--sec, #C0C0C0); flex: none; }
.wintabs-lista .fila .t { flex: 1; border: 0; background: none; text-align: left; padding: 6px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wintabs-lista .fila .x { border: 0; background: none; width: 26px; height: 26px; border-radius: 5px; color: var(--muted); font-size: 16px; }
.wintabs-lista .fila .x:hover { background: var(--line-soft); color: var(--danger); }
.wintabs-lista .pie { display: flex; justify-content: flex-end; padding: 6px 4px 2px; border-top: 1px solid var(--line-soft); margin-top: 4px; }
.wintabs-lista .pie button { border: 1px solid var(--line); background: var(--panel); border-radius: 6px; height: 28px; padding: 0 10px; }
.wintabs-lista .pie button:hover { border-color: var(--danger); color: var(--danger); }

/* ------------------------------------------------------------ botones de la ficha: navegación, acción y ayuda de campo */
/* acción (generar, desasociar…): se distingue de los de navegación de la botonera; también está en el menú Acciones */
.c-btn.c-btn-accion { background: var(--accent-soft); border: 1px solid var(--accent); color: var(--accent); font-weight: 700; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.c-btn.c-btn-accion::before { content: "⚡"; font-size: 10px; }
.c-btn.c-btn-accion:hover:not(:disabled) { background: var(--accent); color: #fff; }
/* ayuda de campo (copiar fecha, año de la serie, importar descripción): pequeño y gris */
.c-btn.c-btn-util { background: var(--face); border: 1px solid var(--line); color: var(--muted); border-radius: 4px; font-size: 11px; }
.c-btn.c-btn-util:hover:not(:disabled) { color: var(--text); border-color: var(--pressed-line); }

/* ------------------------------------------------------------ ficha por secciones (data/fichas.json) */
.v2 { padding: 14px 16px 18px; max-width: 2400px; }
.v2-cab, .v2-panel { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 18px; align-items: start; }
.v2-cab { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 10px; padding: 14px 16px; }
.v2-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 0 10px 10px 10px; padding: 16px; min-height: 120px; }
.v2-item { display: grid; gap: 4px; min-width: 0; }
.v2-lab { font-size: 12px; font-weight: 600; color: var(--muted); }
.v2-lab.req::after { content: " *"; color: var(--danger); }
.v2-lab.golink { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 2px; color: var(--accent); }
.v2-fila { display: flex; gap: 6px; min-width: 0; }
.v2-fila > * { flex: 1; min-width: 0; }
/* bloque estrecho (p. ej. el número interno del albarán): las cajas no ocupan toda la columna y las casillas van a su lado */
.v2-item.estrecho { grid-template-columns: minmax(0, 170px) auto; column-gap: 12px; align-items: center; }
.v2-item.estrecho > :first-child { grid-column: 1 / -1; }
.v2-item.estrecho .v2-checks { padding-top: 0; }
.v2 .v2-ctl { position: static; width: 100%; }
.v2 .v2-field { height: 30px; font-size: 13.5px; padding: 0 8px; border-radius: 5px; }
.v2 .grande .v2-field { height: 36px; font: 600 16px/1 var(--font); }
.v2 .v2-memo { min-height: 110px; resize: vertical; }
.v2 .v2-grid { height: 240px; }
.v2-checks { display: flex; flex-wrap: wrap; gap: 6px 16px; padding-top: 4px; }
.v2-checks .v2-check { display: inline-flex; align-items: center; gap: 6px; position: static; width: auto; font-size: 13px; }
.v2-ayuda { font-size: 11.5px; color: var(--muted); }
.v2-tabs { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 16px; }
.v2-tab { border: 1px solid transparent; border-bottom: 0; background: none; padding: 8px 14px; border-radius: 8px 8px 0 0; color: var(--muted); font: 600 13px/1 var(--font-brand); }
.v2-tab:hover { color: var(--text); background: var(--face); }
.v2-tab.on { background: var(--panel); border-color: var(--line); color: var(--text); margin-bottom: -1px; position: relative; }
.v2-tab.on::before { content: ""; position: absolute; left: -1px; right: -1px; top: -1px; height: 3px; border-radius: 8px 8px 0 0; background: var(--gesso); }
@media (max-width: 900px) { .v2-cab, .v2-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); } .v2-item { grid-column: span 2 !important; } }

/* paneles resumen arriba de la ficha (cliente, proveedor…) */
.v2-res { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.v2-res.cargando { opacity: .55; }
.v2-panelres { display: grid; gap: 2px; text-align: left; background: var(--panel); border: 1px solid var(--line-soft); border-left: 4px solid var(--gesso); border-radius: 8px; padding: 9px 12px; font: inherit; color: inherit; }
.v2-panelres.ir { cursor: pointer; }
.v2-panelres.ir:hover { border-color: var(--accent); }
.v2-panelres .v { font: 700 18px/1.2 var(--font-brand); font-variant-numeric: tabular-nums; }
.v2-panelres .l { font-size: 12px; color: var(--muted); font-weight: 600; }
.v2-panelres .s { font-size: 11.5px; color: var(--muted); }
.v2-panelres.alerta { border-left-color: var(--danger); }
.v2-panelres.alerta .v { color: var(--danger); }

.v2-titulo { margin: 6px 0 -4px; font: 700 12px/1.2 var(--font-brand); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line-soft); padding-bottom: 4px; }
.v2-texto { font-size: 12px; color: var(--muted); }
.v2-botones { display: flex; flex-wrap: wrap; gap: 6px; }
.v2 .v2-button { position: static; width: auto !important; height: 30px; padding: 0 12px; font-size: 12.5px; }
.v2 .v2-budgetsummary, .v2 .v2-certtree, .v2 .v2-tesoreriatree, .v2 .v2-piefin { position: static; min-height: 260px; }
.v2 .v2-image { position: relative; height: 120px; }            /* relative: los iconos 📁 ✕ van en su esquina */
.v2 .v2-image.c-img-foto { width: 120px; height: 150px; }
.v2 .v2-image .c-img-acc { opacity: .85; }

/* pestaña «Archivos asociados» (opciones.js pintaArchivos): lista a la izquierda, vista previa a la derecha */
.c-archivos { display: flex; flex-direction: column; gap: 10px; border: 1px dashed transparent; border-radius: 6px; padding: 2px; }
.c-archivos.drop { border-color: var(--accent); background: var(--accent-soft); }
.arch-zona { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.arch-zona > button { padding: 6px 12px; }
.arch-cuerpo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; min-height: 320px; }
.arch-lista { overflow: auto; max-height: 520px; border: 1px solid var(--line-soft); border-radius: 4px; background: var(--panel); }
.arch-lista .arch-vacio { padding: 16px; margin: 0; }
table.arch-tabla { width: 100%; border-collapse: separate; border-spacing: 0; }
.arch-tabla th { position: sticky; top: 0; background: #f1f3f6; text-align: left; font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.arch-tabla th.num, .arch-tabla td.num { text-align: right; font-variant-numeric: tabular-nums; }
.arch-tabla td { padding: 5px 8px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; vertical-align: middle; }
.arch-tabla td:first-child { white-space: normal; word-break: break-word; }
.arch-tabla tbody tr { cursor: pointer; }
.arch-tabla tbody tr:hover { background: #f6f7f9; }
.arch-tabla tbody tr.sel { background: var(--accent-soft); }
.arch-tabla tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.arch-acc { text-align: right; width: 1%; }
.arch-acc .ico { display: inline-grid; place-items: center; text-decoration: none; margin-left: 2px; vertical-align: middle; }
.arch-vista { border: 1px solid var(--line-soft); border-radius: 4px; background: #f6f7f9; display: grid; place-items: center; min-height: 320px; max-height: 520px; overflow: hidden; }
.arch-vista img { max-width: 100%; max-height: 516px; object-fit: contain; }
.arch-vista iframe { width: 100%; height: 516px; border: 0; background: #fff; }
.arch-vista > p { margin: 0; }
.arch-sinvista { text-align: center; color: var(--muted); }
.arch-sinvista .arch-ico { font-size: 40px; }
.arch-sinvista .btn { display: inline-block; padding: 5px 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); color: var(--accent); text-decoration: none; }
@media (max-width: 900px) { .arch-cuerpo { grid-template-columns: 1fr; } }

/* imagen de la ficha (unidad de obra, recurso real, albarán) */
.c-img { position: relative; }
.c-img:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.c-img.soltar { border-color: var(--accent); border-style: dashed; background-color: var(--accent-soft); }
.c-img-txt { padding: 0 8px; text-align: center; }
.v2 .v2-image.c-img-imagen { width: 100%; height: 220px; }

/* caja de texto con formato (textoformato.js): barra de formato arriba y el texto debajo; sustituye a los RichTextBox de Darby */
.c-rich { display: flex; flex-direction: column; padding: 0; overflow: hidden; min-height: 0; }
.c-rich .rt-barra { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 3px 4px; border-bottom: 1px solid var(--line-soft); background: #f6f7f9; flex: none; }
.c-rich.ro .rt-barra { display: none; }
.rt-b { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 24px; padding: 0 5px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--text); font-size: 12px; line-height: 1; cursor: pointer; }
.rt-b:hover { background: #fff; border-color: var(--line); }
.rt-b small { font-size: 9px; }
.rt-sep { width: 1px; height: 18px; background: var(--line); margin: 0 3px; }
.rt-sel { height: 24px; font-size: 12px; border: 1px solid var(--line); border-radius: 4px; background: #fff; padding: 0 2px; }
.rt-color { width: 26px; height: 24px; padding: 1px; border: 1px solid var(--line); border-radius: 4px; background: #fff; cursor: pointer; }
.c-rich .rt-ed { flex: 1; min-height: 60px; overflow: auto; padding: 6px 8px; outline: none; font-size: 13px; line-height: 1.4; background: #fff; cursor: text; overflow-wrap: anywhere; }
.c-rich.ro .rt-ed { background: var(--input-ro); cursor: default; }
.c-rich .rt-ed p { margin: 0; }
.c-rich .rt-ed ul, .c-rich .rt-ed ol { margin: 0; padding-left: 24px; }
.c-rich .rt-ed blockquote { margin: 0 0 0 28px; }
/* descripción con formato de capítulos y unidades de obra (presupuesto.js textoLargo) */
.bw-rich { width: 100%; border: 1px solid var(--line); border-radius: 4px; height: 170px; resize: vertical; }
.c-rich:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.v2 .v2-memo.c-rich { min-height: 160px; height: 260px; resize: vertical; }

/* Empresa actual › «Precios propuestos» (precioscfg.js) */
.c-precioscfg { display: flex; flex-direction: column; gap: 12px; max-width: 1100px; }
.c-precioscfg .pc-intro { margin: 0; line-height: 1.5; }
.pc-tabla { border-collapse: collapse; width: 100%; }
.pc-tabla th, .pc-tabla td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.pc-tabla thead th { background: #f1f3f6; font-weight: 600; font-size: 12px; }
.pc-tabla tbody th { font-weight: 600; white-space: nowrap; }
.pc-tabla select { width: 100%; max-width: 420px; height: 30px; border: 1px solid var(--line); border-radius: 4px; background: var(--input); padding: 0 6px; }
.pc-det { border: 1px solid var(--line-soft); border-radius: 6px; padding: 8px 12px; background: #fafbfc; }
.pc-det summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.pc-det ol { margin: 8px 0 0; padding-left: 20px; line-height: 1.5; }
.pc-det ol > li { margin-bottom: 6px; }
.pc-det ul { margin: 4px 0 0; padding-left: 18px; }
@media (max-width: 800px) { .pc-tabla thead { display: none; } .pc-tabla tr { display: grid; } .pc-tabla tbody th { padding-top: 10px; border: 0; } }

/* copiar / cortar / pegar y arrastrar en el árbol del presupuesto y el importador (portapapeles.js) */
.win.budget:focus, .win.imp:focus { outline: none; }
.bw-grid tr[draggable="true"], .imp-n[draggable="true"] { cursor: grab; }
.bw-grid tr.drop > td, .bw-grid tr.drop > th, .imp-n.drop { background: var(--accent-soft) !important; box-shadow: inset 0 -2px 0 var(--accent); }
.bw-grid tr.cortado > td { opacity: .5; font-style: italic; }
.imp-como { margin: 4px 0 2px; padding: 6px 8px; border-radius: 4px; background: #f6f7f9; font-size: 12px; color: var(--text-soft, #555); }

/* Configuración › Empresa actual › Impuestos (impuestos.js) */
.c-impuestoscfg { max-width: none; }
.imp-cfg-cab { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; }
.imp-cfg-f { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted, #6b7280); }
.imp-cfg-f select { min-width: 200px; }
.imp-cfg-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.imp-cfg-pend { color: #b45309; font-weight: 600; font-size: 12px; }
.imp-cfg-tabla { overflow-x: auto; border: 1px solid var(--line-soft); border-radius: 6px; }
.imp-cfg-tabla table { min-width: 1900px; }
.imp-cfg-tabla td { padding: 3px 4px; }
.imp-cfg-tabla td.ck { text-align: center; width: 60px; min-width: 60px; }
.imp-cfg-tabla input[type=checkbox] { width: auto; }
.imp-cfg-tabla input[type=text], .imp-cfg-tabla select { width: 100%; min-width: 0; padding: 3px 5px; }
.imp-cfg-tabla input[type=date] { width: 135px; padding: 3px 5px; }
.imp-cfg-tabla select { min-width: 80px; }
.imp-cfg-tabla input.cod { width: 80px; } .imp-cfg-tabla input.nom { min-width: 150px; } .imp-cfg-tabla input.n { width: 60px; text-align: right; }
.imp-cfg-tabla input.men { min-width: 220px; }
.imp-cfg-tabla tr.inactivo td { background: #f6f6f6; color: #777; }

/* barra de botones con menús y desbordamiento (barra.js) */
.barra { display: flex; flex-wrap: nowrap; gap: 4px; align-items: center; overflow: hidden; flex: 1 1 auto; min-width: 0; }
.barra > button { height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; white-space: nowrap; flex: none; }
.barra > button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.barra > button:disabled { opacity: .45; cursor: default; }
.barra > button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.barra > button.primary:hover:not(:disabled) { color: #fff; filter: brightness(1.08); }
.barra > select { height: 30px; border: 1px solid var(--line); border-radius: 6px; background: #fff; max-width: 280px; flex: 0 1 auto; min-width: 120px; }
.barra > .seg { flex: none; }   /* Listado | Ficha del navegador del presupuesto, como en las fichas */
.barra > .seg button { height: 28px; padding: 0 10px; background: #fff; white-space: nowrap; }
.barra > .seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.barra > .pos { flex: none; }
.barra > button.danger:hover:not(:disabled) { border-color: var(--danger); color: var(--danger); }
.barra > .sep { width: 1px; height: 22px; background: var(--line-soft); margin: 0 4px; flex: none; }
.barra-menu { position: fixed; z-index: 1000; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 22px rgba(0,0,0,.14); padding: 4px 0; min-width: 220px; max-height: 70vh; overflow: auto; }
.barra-menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 14px; font: inherit; cursor: pointer; white-space: nowrap; }
.barra-menu button:hover:not(:disabled), .barra-menu button:focus { background: var(--accent-soft); outline: none; }
.barra-menu button:disabled { opacity: .45; cursor: default; }
.barra-menu .sep { border-top: 1px solid var(--line-soft); margin: 4px 0; }
.barra-menu .cab { padding: 6px 14px 2px; font-size: 11px; font-weight: 700; color: var(--muted, #6b7280); text-transform: uppercase; letter-spacing: .03em; }
.budget .win-head .barra { flex: 1 0 100%; }   /* la barra, en su propia fila bajo el título */
.budget .win-head .bw-ver { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* presupuesto (propuesta A): árbol arriba a todo el ancho y la ficha debajo, en pestañas */
.bw-split.bw-vertical { display: flex; flex-direction: column; min-height: 0; }
.bw-split.bw-vertical .bw-tree { border-right: 0; border-bottom: 2px solid var(--line); height: 40vh; min-height: 140px; max-height: none; resize: vertical; overflow: auto; }
.bw-split.bw-vertical .bw-detail { max-height: none; overflow: visible; }
.bw-ptabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 6px 0 10px; flex-wrap: wrap; }
.bw-ptabs button { border: 1px solid transparent; border-bottom: 0; background: none; padding: 7px 14px; border-radius: 6px 6px 0 0; font: inherit; font-weight: 600; color: var(--muted, #6b7280); cursor: pointer; }
.bw-ptabs button.on { border-color: var(--line); background: #fff; color: var(--accent); margin-bottom: -1px; }
.bw-ptabs button.falta { color: #b45309; }
.bw-ppanel { min-height: 120px; }
.bw-falta { color: #b45309; font-weight: 600; margin: 6px 0 0; }
/* Presupuesto, propuesta B: árbol a la izquierda con el descompuesto desplegable y ficha de la unidad de obra por pasos */
.bw-grid .tg-hueco { display: inline-block; width: 16px; }
.bw-grid tr.tar td { color: #4b5563; font-size: 12px; cursor: pointer; background: #fcfcfd; }
.bw-grid tr.tar.auto td { font-style: italic; color: var(--muted); }
.bw-pasos { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 12px; }
.bw-paso { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 8px 12px 10px; }
.bw-paso > header { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 6px; }
.bw-paso .nro { width: 22px; height: 22px; border-radius: 50%; background: #9aa3b1; color: #fff; display: inline-grid; place-items: center; font-size: 12px; flex: none; }
.bw-paso.ok .nro { background: #16a34a; }
.bw-paso.falta .nro { background: #d97706; }
.bw-paso .estado { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--muted); }
.bw-paso.ok .estado { color: #15803d; }
.bw-paso.falta { border-color: #f3c48a; }
.bw-paso.falta .estado { color: #b45309; }
.bw-paso .cuerpo > .bw-sub { margin-top: 0; }
/* árbol del presupuesto: «Resumen» con ancho ajustable (--ancho-nm) y cortado con «…»; casillas editables compactas */
.bw-arbol th.nm { position: sticky; width: var(--ancho-nm, 260px); }   /* sticky (como las demás cabeceras) y a la vez contenedor del asa de ancho */
.bw-arbol td.nm { width: var(--ancho-nm, 260px); max-width: var(--ancho-nm, 260px); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bw-arbol tr.cap td.nm { display: table-cell; }
.bw-asa { position: absolute; top: 0; right: -3px; width: 7px; height: 100%; cursor: col-resize; z-index: 2; }
.bw-asa:hover { background: var(--accent-soft); }
.bw-arbol td input.num { width: 78px; min-width: 0; height: 22px; }
.bw-arbol td.venta { white-space: nowrap; }
.bw-arbol td.venta .ck-fija { margin: 0 4px 0 0; vertical-align: middle; width: auto; height: auto; }
.bw-arbol td.venta input.num { width: 72px; display: inline-block; vertical-align: middle; }
.bw-arbol tr.tar td input.num { font-size: 12px; }
/* presupuesto: franja con la versión y la unidad de ejecución en las que se está */
.budget .win-head .bw-ctx { flex: 1 0 100%; display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: center; padding: 6px 10px; margin-top: 2px; background: #f6f8fb; border: 1px solid var(--line-soft); border-radius: 8px; }
.bw-ctx-g { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bw-ctx-l { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.bw-ctx select { height: 30px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-weight: 600; max-width: 420px; }
.bw-ctx button { height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; font: inherit; }
.bw-ctx button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.bw-ctx button:disabled { opacity: .45; cursor: default; }
.bw-ctx .chip { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: #e5e7eb; color: #374151; }
.bw-ctx .chip.warn { background: #fef3c7; color: #92400e; }
.bw-ctx .chip.ok { background: #dcfce7; color: #166534; }
/* barra de navegación de la obra (navobra.js): fija arriba e igual en la obra, la versión y el presupuesto */
.navobra { position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 6px 10px; background: #1f2937; color: #e5e7eb; border-radius: 8px 8px 0 0; }
.navobra[hidden] { display: none; }
.navobra-obra { font-size: 12px; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-right: 6px; color: #f9fafb; }
.navobra-obra b { color: #fbbf24; text-transform: uppercase; font-size: 11px; letter-spacing: .04em; margin-right: 2px; }
/* incidencia n.º 202: en la barra de la obra (oferta y ejecución, en todas sus pantallas) el nombre de la obra va en su propia fila, del
   tamaño del distintivo de la versión y la unidad de ejecución («IC», «01 EMD»); las barras de sección y de menú lo siguen llevando pequeño */
.navobra:not(.navseccion) > .navobra-obra { flex: 1 0 100%; max-width: none; white-space: normal; overflow-wrap: anywhere; margin: 0 0 2px;
  font: 800 26px/1.15 var(--font-brand); letter-spacing: .02em; color: #fff; }
.navobra:not(.navseccion) > .navobra-obra b { font-size: 15px; vertical-align: middle; margin-right: 8px; }
/* capítulo de la unidad de obra en la cabecera de la pantalla completa (incidencia n.º 203) */
.bw-full-cap { padding: 2px 8px; border-radius: 6px; background: #e0e7ff; color: var(--navy); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; }
.navobra-b { height: 28px; padding: 0 9px; border: 1px solid #4b5563; border-radius: 6px; background: #374151; color: #f3f4f6; font: inherit; font-size: 13px; cursor: pointer; }
.navobra-b:hover { background: #4b5563; }
.navobra-b.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.navobra-sep { width: 1px; height: 22px; background: #4b5563; margin: 0 4px; }
.navobra-l { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #d1d5db; }
.navobra-ver { height: 28px; max-width: 240px; border: 1px solid #4b5563; border-radius: 6px; background: #fff; color: #111827; font-weight: 600; }
.bw-ctx-ver { font-weight: 600; }
/* presupuesto: unidad de obra a pantalla completa (pasos a la izquierda, mediciones/estadillos a la derecha) */
.bw-cardh { display: flex; align-items: center; gap: 10px; }
.bw-cardh h3 { flex: 1; margin: 0; }
/* encima de la pantalla completa (z-index 60) van sus diálogos: los .bw-modal suben a 70 (incidencia n.º 205) */
.bw-modal { z-index: 70; }
/* desplegables: primera línea «solo lo escrito» de las cajas que admiten texto libre (incidencia n.º 209) */
.dropdown tr.solo-texto td { font-style: italic; color: var(--muted); border-bottom: 1px solid var(--line-soft); }
.bw-full { position: fixed; inset: 0; z-index: 60; background: var(--bg, #eef1f5); display: flex; flex-direction: column; }
.bw-full-h { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: #1f2937; color: #f3f4f6; }
.bw-full-h .muted { color: #9ca3af; }
.bw-full-h .bw-btn { background: #374151; color: #f3f4f6; border-color: #4b5563; }
.bw-full-h .bw-btn:disabled { opacity: .4; }
.bw-full-b { flex: 1; overflow: auto; padding: 12px 16px; }
.bw-full-b .bw-card { max-width: none; }
/* mejora n.º 80: tres columnas, la de en medio es la barra para cambiar el reparto (--full-izq, en px, al arrastrarla) */
/* 31/10/2026: sin desplazar la página. Izquierda («Qué es» compacto + «Recursos» con todo el alto), asa, derecha (pestañas Medición / Origen en
   la C + precio de venta fijo abajo); cada panel se desplaza por dentro */
.bw-full-b > .bw-card { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.bw-pasos.full { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(420px, var(--full-izq, 1.5fr)) 7px minmax(420px, 1fr);
  grid-template-rows: minmax(0, 1fr); align-items: stretch; gap: 0 8px; }
.bw-full-izq { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.bw-full-izq > .bw-paso.p1 { flex: none; }
.bw-full-izq > .bw-paso.p1 .bw-rich { height: 92px; min-height: 60px; resize: vertical; }
.bw-full-izq > .bw-paso.p2 { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.bw-full-izq > .bw-paso.p2 > .cuerpo { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.bw-full-izq > .bw-paso.p2 > .cuerpo > .bw-sub { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.bw-full-izq > .bw-paso.p2 > .cuerpo > .bw-sub > .gscroll { flex: 1; min-height: 0; overflow: auto; }
.bw-full-der { grid-column: 3; grid-row: 1; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.bw-full-der > .bw-utabs { flex: none; }
.bw-full-pest { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.bw-full-pest > .bw-paso { flex: 1; min-height: 0; overflow: auto; position: static; }
.bw-full-pest > .bw-paso[hidden] { display: none !important; }
.bw-full-der:has(> .bw-utabs) .bw-full-pest > .bw-paso { border-top-left-radius: 0; border-top-right-radius: 0; }
.bw-full-der > .bw-paso.p4 { flex: none; }
.bw-full-der > .bw-paso.p4 > .cuerpo > p.muted { display: none; }
.bw-fullasa { grid-column: 2; grid-row: 1; align-self: stretch; min-height: 200px; cursor: col-resize; border-radius: 3px; background: var(--line-soft); border: 1px solid var(--line); touch-action: none; }
.bw-fullasa:hover, body.bw-arrastrando .bw-fullasa { background: var(--accent); }
.bw-full-pest .bw-paso.p3 .bw-meds { max-height: none; }
/* pantallas estrechas: una columna, con desplazamiento de la página, como antes */
@media (max-width: 1150px) {
  .bw-full-b > .bw-card { height: auto; display: block; }
  .bw-pasos.full { display: flex; flex-direction: column; gap: 10px; }
  .bw-full-izq, .bw-full-der, .bw-full-pest, .bw-full-izq > .bw-paso.p2, .bw-full-izq > .bw-paso.p2 > .cuerpo, .bw-full-izq > .bw-paso.p2 > .cuerpo > .bw-sub { display: block; }
  .bw-full-pest > .bw-paso, .bw-full-izq > .bw-paso.p2 > .cuerpo > .bw-sub > .gscroll { overflow: visible; }
  .bw-fullasa { display: none; }
}
.bw-meds-dentro { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.bw-med-pend { color: #b45309; font-weight: 600; margin-left: 10px; }
/* mediciones: árbol tipo de medición → estadillo → líneas (como certificarTAG de Darby) */
.med-arbol { width: 100%; }
.med-arbol tr.med-tipo td { background: #eef2f7; font-weight: 700; }
.med-arbol tr.med-tipo.ro td { background: #f4f4f5; color: var(--muted); }
.med-arbol tr.med-tipo.drop td { background: var(--accent-soft); box-shadow: inset 0 -2px 0 var(--accent); }
.med-arbol tr.med-est td { background: #fff; }
.med-arbol tr.med-est td.tw { padding-left: 20px; white-space: nowrap; }
.med-arbol tr.med-est[draggable="true"] { cursor: grab; }
.med-arbol tr.med-est.ro td { color: var(--muted); }
.med-arbol tr.med-est input[type=date] { width: 140px; }
.med-arbol tr.med-lin > td { padding: 2px 6px 8px 40px; background: #fbfcfd; }
.med-arbol select.med-acc { height: 24px; border: 1px solid var(--line); border-radius: 4px; }
.med-arbol tr.med-lin:hover > td { background: #fbfcfd; }
.med-arbol tr.med-lin:hover td td { background: transparent; }
.med-arbol tr.med-lin tr:hover td { background: var(--row-hover); }
.bw-grid tr.tmed td { font-size: 12px; color: #374151; background: #f8fafc; cursor: pointer; }
.bw-grid tr.tmed.est td { background: #fdfdfe; }
.bw-grid tr.tmed.lin td { color: #6b7280; background: #fff; }
.bw-autograba { font-size: 12px; white-space: nowrap; }

/* menú del botón derecho (menucontextual.js) */
.ctxmenu { position: fixed; z-index: 200; min-width: 230px; max-width: 360px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
           box-shadow: 0 10px 28px rgba(0,0,0,.18); padding: 4px; font-size: 13px; color: var(--text); }
.ctxmenu button { display: flex; align-items: center; gap: 16px; width: 100%; text-align: left; background: none; border: 0; border-radius: 5px;
                  padding: 6px 10px; font: inherit; color: inherit; cursor: pointer; }
.ctxmenu button span { flex: 1; }
.ctxmenu button kbd { font: 11.5px/1 inherit; color: var(--muted); background: none; border: 0; }
.ctxmenu button:hover:not(:disabled), .ctxmenu button:focus-visible { background: var(--accent-soft); outline: none; }
.ctxmenu button:disabled { color: var(--muted); cursor: default; }
.ctxmenu-sep { height: 1px; background: var(--line-soft); margin: 4px 6px; }

/* árbol del presupuesto: tipos de medición y estadillos seleccionables (copiar / pegar estadillos) */
.bw-grid tr.tmed.tipo td { background: #f3f6fa; font-weight: 600; }
.bw-grid tr.tmed.sel td, .bw-grid tr.tmed.tipo.sel td { background: var(--accent-soft); }
.bw-grid tr.tmed.sel td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.bw-grid tr.tmed.cortado td { opacity: .55; font-style: italic; }

/* barra «+ Capítulo · + Subcapítulo · + Unidad de obra» sobre el árbol del presupuesto: fija arriba al desplazar el árbol */
.bw-tree > .bw-treebar { position: sticky; top: 0; z-index: 3; height: 44px; box-sizing: border-box; flex-wrap: nowrap; overflow: hidden; }
.bw-tree > .bw-treebar .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; font-size: 12px; }
.bw-tree:has(> .bw-treebar) .bw-arbol th { top: 44px; }
.bw-pide { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; font-size: 12px; color: var(--muted); }
.bw-pide input { height: 32px; padding: 0 8px; font-size: 14px; color: var(--text); border: 1px solid var(--line); border-radius: 6px; min-width: 420px; }
/* importador: recursos de las unidades de obra del presupuesto de destino (de consulta) */
.imp-dest .imp-n.n-tar { cursor: default; color: #4b5563; font-size: 12px; background: #fff; }
.imp-dest .imp-n.n-tar:hover { background: #fafbfc; }
/* árbol de mediciones (ficha, pantalla completa y cuadro «Mediciones»): botones de cada tipo sin montarse y casillas de las líneas a la vista */
.med-arbol td.act { width: auto; white-space: nowrap; text-align: right; }
.med-arbol td.act > .bw-btn, .med-arbol td.act > button.bw-btn { width: auto; height: 24px; padding: 0 8px; margin-left: 4px; border: 1px solid var(--line); border-radius: 5px;
  background: #fff; color: var(--text); font-size: 12px; font-weight: 400; }
.med-arbol td.act > .bw-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.med-arbol td.act > .bw-btn:disabled { color: var(--muted); background: #f7f8fa; cursor: default; }
.med-arbol tr.med-lin input, .med-arbol tr.med-est input[type=text] { border: 1px solid var(--line); background: #fff; border-radius: 4px; height: 26px; padding: 0 6px; }
.med-arbol tr.med-lin input:focus, .med-arbol tr.med-est input[type=text]:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 2px var(--accent-soft); }
.bw-tree > .bw-treebar button { white-space: nowrap; flex: none; }

/* ficha de la unidad de obra en pestañas (Qué es · Descripción · Recursos · Medición · Precio de venta) */
.bw-utabs { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 2px solid var(--line); margin: 4px 0 0; }
.bw-utab { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid transparent; border-bottom: 0;
  border-radius: 7px 7px 0 0; background: #f3f5f8; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; margin-bottom: -2px; }
.bw-utab:hover { background: #e9edf3; }
.bw-utab.on { background: #fff; border-color: var(--line); border-bottom: 2px solid #fff; font-weight: 600; }
.bw-utab .nro { width: 18px; height: 18px; border-radius: 50%; background: #9aa3b1; color: #fff; display: inline-grid; place-items: center; font-size: 11px; flex: none; }
.bw-utab.ok .nro { background: #16a34a; }
.bw-utab.falta .nro { background: #d97706; }
.bw-utab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.bw-pasos.entabs > .bw-paso { border-top: 0; border-radius: 0 0 8px 8px; }
.bw-pasos.entabs > .bw-paso > header .nro { display: none; }
.bw-pasos.entabs > .bw-paso[hidden] { display: none !important; }
.bw-pasos.entabs { margin-top: 0; }
/* ficha de la unidad de obra en pestañas: cada pestaña ocupa el alto de la ficha; la descripción y la rejilla de recursos crecen hacia abajo */
/* la ficha ocupa justo el alto del panel (sin barra de desplazamiento): la pestaña elegida se estira y lo que crece es la descripción
   o la rejilla de recursos, cada una con su propio desplazamiento interior */
.bw-split:not(.bw-vertical) > .bw-detail:has(> .bw-card > .bw-pasos.entabs) { height: calc(100vh - 230px - var(--top2)); display: flex; flex-direction: column; overflow: hidden; }
.bw-detail > .bw-card:has(> .bw-pasos.entabs) { flex: 1; min-height: 0; gap: 8px; }
.bw-detail > .bw-card > .bw-pasos.entabs { flex: 1; min-height: 0; display: flex; flex-direction: column; margin-bottom: 0; }
.bw-detail > .bw-card > .bw-pasos.entabs > .bw-paso { flex: 1; min-height: 0; overflow: auto; }
.bw-detail > .bw-card > .bw-navuo, .bw-detail > .bw-card > .bw-cardh, .bw-detail > .bw-card > .bw-utabs, .bw-detail > .bw-card > .tb { flex: none; }
.bw-detail > .bw-card > .bw-navuo { margin-bottom: 0; }
.bw-pasos.entabs > .bw-paso { display: flex; flex-direction: column; }
.bw-pasos.entabs > .bw-paso > .cuerpo { flex: 1; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.bw-pasos.entabs > .bw-paso.p1 > .cuerpo > .bw-f.grow { flex: 1; }
.bw-pasos.entabs > .bw-paso.p1 .bw-rich { flex: 1; height: auto; min-height: 120px; resize: none; }
.bw-pasos.entabs > .bw-paso.p2 > .cuerpo > .bw-sub { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.bw-pasos.entabs > .bw-paso.p2 > .cuerpo > .bw-sub > .gscroll { flex: 1; min-height: 100px; }
.bw-pasos.entabs > .bw-paso.p2 .gscroll thead th { position: sticky; top: 0; z-index: 1; }
/* navegador de la ficha de la unidad de obra (◀ n de N ▶ · Ir a…) */
.bw-navuo { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.bw-navuo .bw-btn { min-width: 32px; }
.bw-navuo-n { font-size: 12px; color: var(--muted); min-width: 80px; text-align: center; font-variant-numeric: tabular-nums; }
.bw-navuo-ir { flex: 1; max-width: 360px; height: 26px; border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; background: var(--input-key); }
/* unidad de ejecución (coeficiente K) en pestañas */
.bw-k .bw-utabs { align-items: flex-end; }
.bw-k .bw-ktit { margin-left: auto; padding: 0 4px 6px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bw-kcuerpo { border: 1px solid var(--line); border-top: 0; border-radius: 0 0 8px 8px; background: #fff; padding: 10px 12px; margin-bottom: 8px; }
.bw-kcuerpo > .bw-row { margin: 0; }

/* recursos del presupuesto: recurso real (R) o texto libre (T, nombre en rojo como en compras); descripción larga (¶) y acciones */
.bw-rr { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 3px; font-size: 9px; font-weight: 700; margin-right: 4px; vertical-align: middle; flex: none; cursor: default; }
.bw-rr.real { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.bw-rr.txt { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.bw-grid td.nm.txtlibre, .bw-grid td.nm.txtlibre input { color: var(--danger); }
.bw-grid.small td.nm:has(> .bw-rr) { white-space: nowrap; }
.bw-grid.small td.nm > .bw-rr + input { width: calc(100% - 40px); }
.bw-desc { border: 0; background: transparent; color: var(--accent); font-weight: 700; cursor: pointer; padding: 0 3px; }
.bw-grid td.act > button + button { margin-left: 2px; }
.bw-taracc { flex-wrap: wrap; gap: 6px; margin: 0 0 6px; align-items: center; }
.bw-taracc .bw-leyenda { margin-left: auto; font-size: 11px; display: inline-flex; align-items: center; gap: 2px; }
.bw-dialog.bw-dialog-desc { width: min(760px, 94vw); }
.bw-rich.bw-rich-dlg { height: 50vh; min-height: 240px; display: flex; flex-direction: column; }

.bw-pasos.entabs > .bw-paso.p2 .bw-grid.small td.nm { min-width: 220px; }

/* utilidades del presupuesto (utilpresupuesto.js): ajustar precios, precios de los recursos, agrupar, limpiar capítulos */
.bw-dialog.ut-dlg { width: min(720px, 96vw); }
.ut-cuerpo { display: flex; flex-direction: column; gap: 10px; }
.ut-cuerpo p { margin: 0; }
.ut-amb { max-width: 100%; height: 30px; }
.ut-tot { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); background: #f6f7f9; border: 1px solid var(--line-soft); border-radius: 6px; padding: 6px 10px; }
.ut-tot b { color: var(--text); font-variant-numeric: tabular-nums; }
.ut-ops { display: flex; flex-direction: column; gap: 4px; }
.ut-op { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 6px 8px; border-radius: 6px; border: 1px solid transparent; }
.ut-op:has(input[type=radio]:checked) { background: var(--accent-soft, #eef4ff); border-color: var(--line); }
.ut-op > label { font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.ut-op .ut-ayuda { flex-basis: 100%; font-size: 11px; margin-left: 24px; }
.ut-extra { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ut-extra input[type=text], .ut-par input { height: 26px; border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; text-align: right; }
.ut-extra select { height: 26px; }
.ut-par { display: inline-flex; align-items: center; gap: 6px; }
.ut-cuerpo input.w8 { width: 80px; } .ut-cuerpo input.w12 { width: 120px; }
.bw-dialog.ut-dlgrec { width: min(1250px, 98vw); height: calc(100vh - 80px); }
.ut-recursos { flex: 1; min-height: 0; }
.ut-filtro { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 14px; }
.ut-filtro input[type=search] { height: 28px; border: 1px solid var(--line); border-radius: 4px; padding: 0 8px; min-width: 260px; }
.ut-recscroll { flex: 1; min-height: 0; border: 1px solid var(--line-soft); border-radius: 6px; }
.ut-rec thead th { position: sticky; top: 0; z-index: 1; background: var(--panel); }
.ut-rec tr.ut-g td { background: #f7f9fc; font-weight: 600; border-top: 1px solid var(--line); }
.ut-rec tr.ut-g.ab td { background: #eef3fa; }
.ut-rec tr.ut-l td { font-weight: 400; }
.ut-rec tr.ut-l td.nm { padding-left: 22px; }
.ut-rec td.nm { min-width: 260px; }
.ut-rec td.act { white-space: nowrap; }
.ut-rec td.act button { border: 0; background: none; cursor: pointer; padding: 0 4px; }
.ut-rec input.num::placeholder { color: #b45309; font-style: italic; }
.ut-link { cursor: pointer; } .ut-link:hover td { background: var(--accent-soft, #eef4ff); }
.bw-uoextra { align-items: flex-end; }
.ut-rec input[type=checkbox] { width: auto; height: auto; min-width: 0; }
/* cambios masivos y texto libre → recursos reales (22/10/2026) */
.ut-masivo { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 10px; border: 1px solid var(--accent); border-radius: 6px; background: var(--accent-soft); }
.ut-masivo .link { border: 0; background: none; color: var(--accent); cursor: pointer; text-decoration: underline; }
.ut-rec tr.ut-g.marc td { background: #fff4ea; }
.ut-rec td.tw input[type=checkbox] { margin-right: 4px; vertical-align: middle; }
.ut-libres input[type=checkbox] { width: auto; height: auto; min-width: 0; }
.ut-libres td.tw { width: 28px; text-align: center; }
.ut-libres tr.marc td { background: #fff4ea; }
.ut-libres select { max-width: 520px; width: 100%; }
.ut-libres .ut-motivo { display: block; margin-top: 2px; }
.ut-libres thead th { position: sticky; top: 0; z-index: 1; background: var(--panel); }
.ut-op .ut-extra:has(select[aria-label="IVA actual"]) { flex-basis: 100%; margin-left: 24px; }
/* deshacer / rehacer (arriba a la derecha) */
.deshacer-btns { display: inline-flex; gap: 2px; margin-right: 8px; }
.deshacer-btn { width: 34px; height: 30px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: 18px; line-height: 1; cursor: pointer; color: var(--text); }
.deshacer-btn:hover:not(:disabled) { background: var(--accent-soft); border-color: var(--accent); }
.deshacer-btn:disabled { opacity: .35; cursor: default; }
.deshacer-grupo { display: inline-flex; }
.deshacer-grupo .deshacer-btn:first-child { border-radius: 6px 0 0 6px; }
.deshacer-btn.deshacer-flecha { width: 18px; font-size: 11px; border-left: 0; border-radius: 0 6px 6px 0; padding: 0; }
.deshacer-lista { position: fixed; z-index: 3000; width: 380px; max-width: calc(100vw - 16px); background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.18); font-size: 13px; overflow: hidden; }
.deshacer-cab { padding: 6px 10px; font-size: 11px; color: var(--muted, #667); border-bottom: 1px solid var(--line); }
.deshacer-ops { max-height: 360px; overflow-y: auto; }
.deshacer-op { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; padding: 5px 10px; border: 0; background: none; text-align: left; cursor: pointer; font: inherit; }
.deshacer-op.on { background: var(--accent-soft); }
.deshacer-op:focus { outline: none; }
.deshacer-op-t { color: var(--text); }
.deshacer-op-h { font-size: 11px; color: var(--muted, #667); }
.deshacer-pie { padding: 6px 10px; border-top: 1px solid var(--line); font-weight: 600; text-align: center; }
/* Necesidades de recursos en pestañas (compras.js) */
.nec-tabs { margin-top: 8px; }
.nec-tabs .bw-utab { max-width: 340px; }
.nec-tabt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.nec-tabt small { font-weight: 400; color: var(--muted, #6b7280); font-size: 11px; }
/* proceso guiado (22/10/2026): pasos numerados; las consultas, a la derecha y más discretas */
.nec-tabs .bw-utab.nec-step { display: inline-flex; align-items: center; gap: 8px; }
.nec-num { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid currentColor; font-size: 12px; font-weight: 700; flex: none; }
.nec-tabs .bw-utab.nec-step.ok .nec-num { background: #16a34a; border-color: #16a34a; color: #fff; }
.nec-tabs .bw-utab.nec-step + .bw-utab.nec-step::before { content: "→"; margin-right: 6px; color: var(--muted, #9ca3af); }
.nec-tabs .bw-utab.nec-cons { opacity: .85; }
.nec-tabs .bw-utab.nec-cons:first-of-type, .nec-tabs .bw-utab.nec-step + .bw-utab.nec-cons { margin-left: auto; }
.nec-paso { margin: 0 0 6px; color: var(--muted, #4b5563); font-size: 12px; }
.nec-sig { margin-top: 6px; flex-wrap: nowrap; }
/* mejora n.º 11 (25/10/2026): Necesidades de recursos más compacta; el alto que se gana es para el árbol de recursos */
.nec .cmpr-body { padding: 4px 10px 6px; }
.nec .cmp-cab { gap: 2px 18px; font-size: 12px; }
.nec .cmp-cab .nec-exp { margin-left: auto; }
.nec .cmp-cab .nec-exp button { height: 26px; }
.nec .nec-filtro { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 3px 0; border-bottom: 0; }
.nec .nec-filtro-t { font-weight: 600; font-size: 12px; }
.nec .nec-filtro .an-acciones { display: inline-flex; gap: 6px; padding: 0; }
.nec .nec-filtro .an-acciones button { height: 26px; }
.nec .nec-tabs { margin-top: 4px; }
.nec .nec-tabs .bw-utab { height: 30px; }
.nec .nec-paneles { padding: 6px 8px; }
.nec .nec-sig .nec-paso { flex: 1; min-width: 0; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nec .nec-sig .nec-aviso { color: #b45309; white-space: normal; }
/* problema n.º 18: la fecha de entrega se ve como caja (las cajas de la rejilla no llevan borde hasta tener el foco) */
.cmpr-body table.dl td input.iv-date { width: 96px; border-color: var(--line); background: #fff; }
.nec .nec-fecall { display: inline-flex; gap: 6px; align-items: center; }
.nec .nec-fecall button { height: 26px; }
/* mejora n.º 22: «No se pide» y cuenta de lo que queda por pedir */
.nec .nec-cuenta { display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: baseline; padding: 2px 2px 6px; font-size: 12.5px; }
.nec .nec-cuenta .nec-quedan b { color: #b45309; font-size: 14px; }
.nec .nec-cuenta .nec-hecho b { color: #15803d; font-size: 14px; }
.nec-tabla tr.nec-padre.nec-nopedir > td { color: var(--muted, #6b7280); font-weight: 400; background: #f3f4f6; }
.nec-ef-t tr.nec-provh > td { background: #eef3fa; }
.nec-ef-t tr.nec-hijo td.nec-ud { padding-left: 22px; }
.nec-paneles { border: 1px solid var(--line); border-top: 0; border-radius: 0 0 8px 8px; background: #fff; padding: 8px 10px; min-height: 240px; }
.nec-panel[hidden] { display: none !important; }
.nec-panel > .nec-grid1 { max-height: calc(100vh - 262px - var(--top2)); min-height: 200px; overflow: auto; }
.nec-provt { max-width: 900px; }
.nec-provt input.lk { height: 26px; border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; background: var(--input-req); }
.nec-provt input.w8 { width: 110px; } .nec-provt input.w100 { width: 100%; min-width: 260px; }
.nec-provt tr.nueva td { background: #fafbfc; }
.cmp-cab { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; }
table.dl.nec-tabla td { max-width: none; }
table.dl.nec-tabla td.nec-nom { max-width: 280px; }
.nec-tabla td input.num { width: 90px; text-align: right; }
/* incidencia n.º 147 / 161: sumas de cantidades por unidad en el pie */
.nec-tabla tfoot tr.nec-ud td { font-weight: 400; color: var(--muted, #6b7280); background: #fafbfc; }
.nec-tabla tfoot tr.nec-tot td { font-weight: 600; border-top: 1px solid var(--line, #d0d5dd); }
.nec-tabla td input[aria-label="Descripción"] { width: 160px; }
.nec-tabla td.nec-carpeta { min-width: 24px; }

/* barra de la sección (compras, registrar e imputar): las pantallas de la sección, la actual encendida */
.navobra.navseccion { position: static; border-radius: 0; background: #2b3647; padding: 4px 10px; }
.navobra + .navobra.navseccion { border-top: 1px solid #111827; }
.navseccion-t { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #fbbf24; margin-right: 2px; }

/* cajas de fecha (fechas.js): icono del calendario a la derecha y calendario desplegable */
/* el placeholder va traducido (web.po: «dd/mm/aaaa»): español, catalán y portugués; inglés; francés */
input[placeholder="dd/mm/aaaa"]:not([readonly]):not(:disabled), input[placeholder="dd/mm/yyyy"]:not([readonly]):not(:disabled),
input[placeholder="jj/mm/aaaa"]:not([readonly]):not(:disabled) {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%236b7280' stroke-width='1.4'%3E%3Crect x='2' y='3' width='12' height='11' rx='1.5'/%3E%3Cpath d='M2 6.5h12M5.5 1.5v3M10.5 1.5v3'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important; background-position: right 4px center !important; background-size: 14px 14px !important; padding-right: 22px !important; }
/* incidencia n.º 189: la fecha entera (dd/mm/aaaa) se veía cortada en dos caracteres porque el icono ocupa 22 px y las cajas tenían el
   ancho de antes del icono: ancho mínimo para 10 cifras más el icono (en las fichas clásicas, posición fija de Darby: las ensancha
   ventana-lienzo.js si hay sitio, y aquí el icono es algo más pequeño) */
input[placeholder="dd/mm/aaaa"], input[placeholder="dd/mm/yyyy"], input[placeholder="jj/mm/aaaa"] { font-variant-numeric: tabular-nums; }
:is(input[placeholder="dd/mm/aaaa"], input[placeholder="dd/mm/yyyy"], input[placeholder="jj/mm/aaaa"]):not(.c-field) { min-width: calc(10ch + 32px); }
:is(input[placeholder="dd/mm/aaaa"], input[placeholder="dd/mm/yyyy"], input[placeholder="jj/mm/aaaa"]).c-field:not([readonly]):not(:disabled) {
  padding-left: 3px !important; padding-right: 18px !important; background-position: right 3px center !important; background-size: 12px 12px !important; }
.cal-pop { position: fixed; z-index: 3100; width: 248px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 8px; font-size: 13px; }
.cal-cab { display: flex; align-items: center; gap: 2px; margin-bottom: 6px; }
.cal-cab b { flex: 1; text-align: center; text-transform: capitalize; }
.cal-nav { width: 26px; height: 26px; border: 0; background: none; border-radius: 4px; cursor: pointer; font-size: 15px; color: var(--text); }
.cal-nav:hover, .cal-dia:hover, .cal-hoy:hover { background: var(--accent-soft); }
.cal-dias { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-sem { text-align: center; font-size: 11px; color: var(--muted, #667); padding: 2px 0; }
.cal-dia { height: 28px; border: 0; background: none; border-radius: 4px; cursor: pointer; font: inherit; color: var(--text); }
.cal-dia.finde { color: #9a3412; }
.cal-dia.hoy { box-shadow: inset 0 0 0 1px var(--accent); }
.cal-dia.sel { background: var(--accent); color: #fff; font-weight: 600; }
.cal-pie { display: flex; justify-content: space-between; margin-top: 6px; border-top: 1px solid var(--line); padding-top: 6px; }
.cal-hoy { border: 0; background: none; color: var(--accent); cursor: pointer; font: inherit; padding: 2px 8px; border-radius: 4px; }
/* rejillas: celda de búsqueda cuyo valor tiene que existir (recurso real, recurso a imputar…), en rosa como en Darby */
.c-grid td.lk.req input { background-color: var(--input-req); }

/* editor de texto largo de las celdas de rejilla (doble clic o F2) */
.txt-pop { position: fixed; z-index: 3100; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.txt-pop-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; }
.txt-pop-ta { width: 100%; min-height: 140px; height: 180px; resize: vertical; font: inherit; font-size: 13px; line-height: 1.4; padding: 6px 8px; border: 1px solid var(--line); border-radius: 4px; box-sizing: border-box; }
.txt-pop-b { display: flex; align-items: center; justify-content: flex-end; gap: 6px; font-size: 12px; }
.txt-pop-b .muted { margin-right: auto; }
.c-grid input.multilinea, .ac-tabla input.multilinea { font-style: italic; }

/* fichas por secciones: memo bajo (p. ej. descripción del recurso real de la línea, solo consulta) */
.v2 .v2-item.bajo .v2-memo, .v2 .v2-item.bajo .v2-memo.c-rich { min-height: 48px; height: 84px; }
/* celda de rejilla bloqueada por la lógica de la fila (P venta sin fórmula 5 y M) */
.c-grid td input[readonly] { background-color: var(--input-ro); color: #44505f; }

/* papelera de versiones (papelera.js) */
.papelera .pap-scroll { overflow: auto; max-height: calc(100vh - 230px); margin-top: 8px; }
table.dl.pap-tabla td { max-width: none; vertical-align: top; }
.pap-tabla .pap-acc { white-space: nowrap; }
.pap-tabla .pap-acc button { margin-left: 4px; }

/* desplegable de búsqueda: unidad de obra de un recurso del presupuesto */
.dropdown td.uo { color: var(--muted, #667); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* parte de obra multioperario (partemulti.js) */
.c-partemulti { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.c-partemulti .pm-cab { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.c-partemulti .pm-h { margin: 8px 0 2px; font-size: 13px; }
.c-partemulti .pm-scroll { overflow-x: auto; }
table.dl.pm-tabla { width: 100%; }
table.dl.pm-tabla td { max-width: none; padding: 1px 3px; }
table.dl.pm-tabla .c-in { width: 100%; height: 24px; border: 1px solid var(--line); border-radius: 3px; padding: 0 5px; box-sizing: border-box; font: inherit; }
table.dl.pm-tabla .c-in.lk { background: var(--input-key); }
table.dl.pm-tabla .c-in.lk.req { background: var(--input-req); }
table.dl.pm-tabla .c-in.num { text-align: right; width: 80px; }
table.dl.pm-tabla .c-in[readonly] { background: var(--input-ro); }
table.dl.pm-tabla td.ro { color: var(--muted, #667); white-space: nowrap; }
table.dl.pm-tabla td.uo { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
table.dl.pm-tabla td.act .x { border: 0; background: none; cursor: pointer; color: var(--muted, #667); font-size: 15px; }
table.dl.pm-tabla tfoot td { font-weight: 600; border-top: 1px solid var(--line); }
.c-partemulti .pm-estado { margin: 6px 0 2px; padding: 5px 9px; border-radius: 4px; font-size: 13px; }
.c-partemulti .pm-estado.ok { background: #e8f5ec; color: #1f6b3a; }
.c-partemulti .pm-estado.err { background: #fdecea; color: #a12a1c; }
.c-partemulti .pm-chips { display: flex; flex-wrap: wrap; gap: 3px; }
.c-partemulti .pm-chip { font: inherit; font-size: 12px; line-height: 18px; padding: 0 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--input-ro, #f4f4f5); color: var(--muted, #667); cursor: pointer; }
.c-partemulti .pm-chip.on { background: var(--accent, #e8743b); border-color: var(--accent, #e8743b); color: #fff; }
.c-partemulti .pm-chip:disabled { cursor: default; }
table.dl.pm-tabla td.pm-desc { min-width: 260px; }
table.dl.pm-tabla.pm-rep td { padding: 3px 6px; }

/* Configuración › Usuarios y permisos (usuarios.js) */
.modal.usr-modal { width: min(1180px, 100%); }
.usr-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.usr-tabs button { border: 1px solid transparent; border-bottom: 0; background: none; padding: 6px 14px; border-radius: 6px 6px 0 0; color: var(--muted); }
.usr-tabs button.on { border-color: var(--line); background: var(--panel); color: inherit; font-weight: 600; margin-bottom: -1px; }
.usr-cuerpo { display: flex; flex-direction: column; gap: 8px; }
.usr-cuerpo > div { display: flex; flex-direction: column; gap: 8px; }
table.dl.usr-tabla td { max-width: none; white-space: normal; vertical-align: top; cursor: default; }
table.dl.usr-tabla tbody tr:hover td { cursor: default; }
table.dl.usr-tabla select { max-width: 100%; }
table.dl.usr-tabla td.usr-acc { white-space: nowrap; }
table.dl.usr-tabla td.usr-acc button + button { margin-left: 8px; }
.usr-roles { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; max-height: 50vh; overflow: auto; }
.usr-rol { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; }
.usr-rol.ya { opacity: .6; }
table.dl.usr-tabla input.lk { background: var(--input-req, #fde8ec); }
table.dl.usr-tabla input.lk:disabled { background: var(--input-ro); }
table.dl.usr-tabla input.req { border-color: #e11d48; box-shadow: 0 0 0 1px #e11d48; }
.usr-sub { font-size: 12px; color: var(--muted); }
.usr-yo, .usr-def { font-size: 12px; color: var(--accent); }
tr.usr-inactivo td { opacity: .55; }
th.usr-mod { white-space: normal; font-size: 12px; min-width: 70px; }
td.usr-niv { font-size: 12px; text-align: center; }
td.usr-niv.n0 { color: var(--muted); }
td.usr-niv.n1 { color: #1f5fae; }
td.usr-niv.n2 { color: #8a5a00; }
td.usr-niv.n3 { color: #1e7a3c; font-weight: 600; }
.usr-modal button.link { background: none; border: 0; padding: 0 4px; color: var(--accent); cursor: pointer; }
.usr-modal button.link:hover:not(:disabled) { text-decoration: underline; }
.usr-modal button.link:disabled { color: var(--muted); cursor: default; }
.modal-f button.danger { border-color: var(--danger, #b3261e); color: var(--danger, #b3261e); }
/* «Acerca de GESSO ERP» (acerca.js) */
.usuario .acerca-btn { margin-left: auto; width: 26px; padding: 0; justify-content: center; font: italic 700 13px Georgia, serif; }
.usuario .acerca-btn + button { margin-left: 0; }
.modal.acerca-modal { width: min(560px, 100%); }
.acerca-ver { font-size: 15px; margin: 0; }
.acerca-tabla { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.acerca-tabla th { text-align: left; font-weight: 600; color: #34465f; padding: 3px 10px 3px 0; white-space: nowrap; vertical-align: top; width: 38%; }
.acerca-tabla td { padding: 3px 0; word-break: break-all; font-family: Consolas, "Courier New", monospace; }
.acerca-tit { margin: 6px 0 0; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

/* cuenta (cuenta.js): nombre del usuario = cambiar contraseña; «Cuadros de mando» (Grafana con la sesión de GESSO ERP) */
.usuario button.u { margin-left: 0; border: 0; padding: 0; height: auto; background: none; color: inherit; font: inherit; cursor: pointer; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.usuario button.u:hover { color: #fff; text-decoration: underline; }
.grafana-btn { display: flex; align-items: center; gap: 7px; width: 100%; margin: 6px 0; height: 30px; padding: 0 10px; border: 1px solid var(--navy-3); border-radius: 6px; background: none; color: var(--side-fg); font-size: 12.5px; cursor: pointer; }
.grafana-btn:hover { color: #fff; border-color: var(--side-muted); }
.shell.mini .grafana-btn span { display: none; }
.usr-emp-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 14px; max-height: 220px; overflow: auto; padding: 4px 0; }
.usr-emp-lista label { display: flex; gap: 6px; align-items: center; font-size: 13px; }
.usr-emp-inactiva { color: var(--muted, #888); }
.c-partemulti .pm-nota { margin: 0 0 4px; font-size: 12px; }
table.dl.pm-tabla tfoot td.pm-faltan { color: #a12a1c; font-weight: 600; }
.c-partemulti .pm-tabs { display: flex; gap: 2px; margin: 8px 0 0; border-bottom: 1px solid var(--line); }
.c-partemulti .pm-tab { font: inherit; font-size: 13px; padding: 5px 12px; border: 1px solid transparent; border-bottom: 0; border-radius: 5px 5px 0 0; background: none; cursor: pointer; color: var(--muted, #667); display: flex; gap: 6px; align-items: baseline; }
.c-partemulti .pm-tab small { font-size: 11px; color: var(--muted, #667); }
.c-partemulti .pm-tab.on { background: var(--panel, #fff); border-color: var(--line); color: inherit; font-weight: 600; margin-bottom: -1px; box-shadow: inset 0 2px 0 var(--accent, #e8743b); }
.c-partemulti .pm-tab.mal { color: #a12a1c; }
.c-partemulti .pm-tab.mal::after { content: "●"; font-size: 9px; color: #e11d48; }
.c-partemulti .pm-panel { padding-top: 6px; }
table.dl.pm-tabla .c-in.oblig:placeholder-shown { border-color: #e11d48; }

/* Partes del móvil (partesmovil.js): lista a la izquierda, el parte elegido a la derecha */
.partesmovil .pmv-body { padding: 8px 12px; }
.partesmovil .tb button.on { background: var(--accent, #e8743b); color: #fff; border-color: var(--accent, #e8743b); }
.partesmovil .pmv-cuerpo { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.partesmovil .pmv-tabla tr { cursor: pointer; }
.partesmovil .pmv-tabla tr.sel td { background: #fdeee4; }
.partesmovil .pmv-trab { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.partesmovil .pmv-det { background: var(--panel, #fff); border: 1px solid var(--line-soft, #e5e7eb); border-radius: 10px; padding: 10px 14px; }
.partesmovil .pmv-det h3 { margin: 2px 0 4px; font-size: 15px; }
.partesmovil .pmv-det h4 { margin: 10px 0 3px; font-size: 13px; }
.partesmovil .pmv-mini { width: 100%; }
.partesmovil .pmv-fotos { display: flex; flex-wrap: wrap; gap: 8px; }
.partesmovil .pmv-fotos img { width: 120px; height: 90px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line, #ddd); }
.partesmovil .pmv-cod { white-space: nowrap; font-variant-numeric: tabular-nums; }
.partesmovil .pmv-pdf { font-weight: 600; }
.partesmovil .pmv-obs { white-space: pre-line; }
@media (max-width: 1000px) { .partesmovil .pmv-cuerpo { grid-template-columns: 1fr; } }

/* generar factura de proveedor (ejecucion.js crearFactura) */
.modal input.ajena { background: var(--input-req); }
/* filtros crema de los diálogos (se elige de la lista o se escribe un trozo: «contiene»), 29/10/2026 */
.modal input.libre { background: var(--input-free); }
.modal.fp-modal { width: min(1800px, 99vw); max-height: 98vh; }
.fp-modal .modal-b { max-height: calc(98vh - 120px); }
/* incidencia n.º 121: «Asociar costes» de la certificación casi a pantalla completa; las columnas a su ancho (los textos largos, hasta
   260 px con «…» y el texto entero al pasar el ratón) y barra horizontal si no caben */
.modal.asoc-modal { width: min(1860px, 99vw); max-height: 98vh; }
/* incidencia n.º 124: la certificación de destino, bien a la vista; sumas de lo marcado y de todo lo encontrado */
.asoc-dest { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; padding: 8px 12px; border: 1px solid var(--accent); border-left-width: 5px; border-radius: 6px; background: var(--accent-soft); }
.asoc-dest-t { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); }
.asoc-dest-n { font-size: 17px; }
.asoc-modal .asoc-suma { display: inline-block; margin-right: 22px; color: var(--text); }
.asoc-modal .asoc-suma.sel { background: var(--row-sel); padding: 2px 8px; border-radius: 4px; }
.asoc-modal .modal-b { max-height: calc(98vh - 120px); }
.asoc-modal .tablewrap.dlg { max-height: calc(98vh - 400px); min-height: 240px; }
.asoc-modal table.dl { width: max-content; min-width: 100%; }
.asoc-modal table.dl td { max-width: 260px; }
.fp-der { max-height: calc(98vh - 150px); overflow: auto; padding-right: 4px; }
.fp-der label.row { flex-wrap: nowrap; }
.fp-der fieldset { min-width: 0; }
.fp-der label.row > :not(.lbl) { flex: 1 1 auto; min-width: 0; }
.fp-der label.row input:not([type=checkbox]) { width: 100%; box-sizing: border-box; min-width: 0; }
.fp-oculta { display: none; }
.fp-msg:empty { display: none; }
.fp-gridhost > * { position: static !important; left: auto !important; top: auto !important; width: auto !important; height: auto !important; }
.fp-gridhost .gscroll { max-height: 30vh; }
.fp-cuerpo { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 12px; }
.fp-izq { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.fp-filtro .row { gap: 10px; flex-wrap: wrap; }
.fp-filtro input.ajena { min-width: 260px; }
.fp-ajenas { flex-wrap: nowrap !important; }
.fp-ajenas > label { flex: 1 1 0; min-width: 0; }
.fp-ajenas input.ajena { flex: 1 1 auto; width: auto; min-width: 0; }
.fp-acc { gap: 8px; align-items: center; }
.fp-sub { font-weight: 600; font-size: 13px; }
.fp-lista .tablewrap { max-height: 28vh; }
.fp-lineas .tablewrap { max-height: 24vh; }
.fp-lista tr.sel td { background: #fde3d0 !important; }
.fp-lista tr.fp-revisar td, .fp-lineas tr.fp-revisar td { background: #fff7e0; }
.fp-aviso { color: #8a5a00; font-size: 12px; }
.fp-der fieldset { border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px 10px; margin: 0 0 10px; }
.fp-der legend { font-weight: 600; font-size: 13px; padding: 0 4px; }
table.fp-tot { width: 100%; border-collapse: collapse; font-size: 13px; }
table.fp-tot td { padding: 2px 0; }
table.fp-tot td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.fp-tot tr.b td { font-weight: 700; border-top: 1px solid var(--line); }
table.fp-tot tr.sub td { color: var(--muted); font-size: 12px; padding-left: 10px; }
.fp-pct { width: 52px; text-align: right; }
.fp-cuadra { margin-top: 8px; gap: 6px; }
.fp-cuadra input { width: 110px; text-align: right; }
.fp-cuadre { margin: 6px 0 0; font-weight: 600; padding: 3px 8px; border-radius: 4px; }
.fp-cuadre.ok { background: #e8f5ec; color: #1f6b3a; }
.fp-cuadre.err { background: #fdecea; color: #a12a1c; }
.fp-nota { font-size: 12px; margin: 6px 0 0; }
.fp-der .row .lbl { min-width: 110px; }
.fp-obs { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.fp-obs textarea { width: 100%; box-sizing: border-box; }
@media (max-width: 1000px) { .fp-cuerpo { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- Asistente IA (asistente.js, asistentecfg.js) */
.asis-btn.aviso { border-color: var(--gesso); box-shadow: inset 0 -2px 0 var(--gesso); }
.asis-btn[aria-expanded="true"] { background: var(--pressed); border-color: var(--pressed-line); }
.asis-panel { position: fixed; top: 46px; right: 0; bottom: 0; width: min(400px, 100vw); background: var(--panel); border-left: 1px solid var(--line);
  box-shadow: -8px 0 24px rgba(16,24,40,.12); display: flex; flex-direction: column; z-index: 60; }
body.asis-abierto .desk { padding-right: 412px; }
@media (max-width: 1100px) { body.asis-abierto .desk { padding-right: 12px; } }
@media (max-width: 900px) { .asis-panel { top: 0; width: 100vw; z-index: 70; } }
.asis-h { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); border-top: 3px solid var(--gesso); }
.asis-h b { font: 700 15px/1 var(--font-brand); }
.asis-beta { font: 800 10px/1 var(--font-brand); letter-spacing: .1em; color: #fff; background: var(--gesso); border-radius: 3px; padding: 3px 5px 2px; }
.asis-sp { flex: 1; }
.asis-h .x { border: 0; background: none; font-size: 20px; line-height: 1; color: var(--muted); padding: 0 2px; }
.asis-ctx { padding: 6px 12px; font-size: 12px; color: var(--muted); background: var(--face); border-bottom: 1px solid var(--line-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asis-ctx b { color: var(--text); font-weight: 600; }
.asis-lista { flex: 1; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.asis-m { max-width: 92%; padding: 8px 11px; border-radius: 10px; line-height: 1.45; overflow-wrap: anywhere; }
.asis-m.usr { align-self: flex-end; background: var(--accent-soft); white-space: pre-wrap; border-bottom-right-radius: 3px; }
.asis-m.ia { align-self: flex-start; background: var(--face); border: 1px solid var(--line-soft); border-bottom-left-radius: 3px; }
.asis-m.err { align-self: stretch; background: #fdecea; color: var(--danger); border: 1px solid #f5c2bd; }
.asis-m p { margin: 0 0 6px; } .asis-m p:last-child { margin-bottom: 0; }
.asis-m ul, .asis-m ol { margin: 4px 0 6px; padding-left: 20px; } .asis-m li { margin: 2px 0; }
.asis-m code { background: #fff; border: 1px solid var(--line-soft); border-radius: 3px; padding: 0 3px; font-size: 12px; }
.asis-m .asis-t { font-weight: 700; }
.asis-tabla { overflow: auto; margin: 4px 0 6px; }
.asis-tabla table { border-collapse: collapse; font-size: 12px; }
.asis-tabla th, .asis-tabla td { border: 1px solid var(--line-soft); padding: 3px 6px; text-align: left; vertical-align: top; }
.asis-tabla th { background: #fff; }
.asis-acc { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.asis-acc button { border: 1px solid var(--accent); color: var(--accent); background: #fff; border-radius: 6px; padding: 4px 10px; font-weight: 600; }
.asis-acc button:hover { background: var(--accent-soft); }
.asis-val { display: flex; align-items: center; gap: 8px; margin-top: 6px; color: var(--muted); }
.asis-m.esperando { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.asis-puntos { width: 26px; height: 8px; background: radial-gradient(circle, var(--gesso) 3px, transparent 3.5px) 0 0 / 9px 8px repeat-x; animation: asis-p 1s steps(3) infinite; }
@keyframes asis-p { from { width: 8px; } to { width: 27px; } }
.asis-vacio { color: var(--muted); }
.asis-vacio p { margin: 4px 0 10px; }
.asis-sug { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.asis-sug button { border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 5px 11px; text-align: left; }
.asis-sug button:hover { border-color: var(--accent); color: var(--accent); }
.asis-hist { display: flex; flex-direction: column; gap: 4px; }
.asis-hfila { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line-soft); }
.asis-hfila .link { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asis-hfila .x { border: 0; background: none; color: var(--muted); font-size: 16px; }
.asis-pie { border-top: 1px solid var(--line-soft); padding: 8px 12px 10px; }
.asis-estado:empty { display: none; }
.asis-in { display: flex; gap: 8px; align-items: flex-end; }
.asis-in textarea { flex: 1; resize: none; border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; min-height: 38px; max-height: 160px; }
.asis-in textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.asis-enviar { height: 38px; }
.asis-nota { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; }
.asis-cfg .asis-dpa p { margin: 4px 0 6px; font-size: 12px; color: var(--muted); }
.asis-cfg .asis-chk { padding-left: 0; margin: 6px 0; }
.asis-cfg .asis-ayuda { display: block; margin: 0 0 4px; }
.asis-uso .tablewrap { max-height: 220px; overflow: auto; }
.asis-uso td.n { text-align: right; }
.asis-pie-m { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.asis-pie-m .asis-val { margin-top: 0; }
.asis-pdf { font-weight: 600; }
.asis-tabla td.n { text-align: right; white-space: nowrap; }
/* asistente, fase 3: fichas preparadas y campo señalado */
.asis-prop { margin-top: 8px; border: 1px solid var(--accent); border-left-width: 4px; border-radius: 8px; background: #fff; padding: 8px 10px; }
.asis-prop p { margin: 4px 0; }
.asis-prop table { border-collapse: collapse; font-size: 12px; margin: 4px 0 6px; }
.asis-prop td { padding: 2px 8px 2px 0; vertical-align: top; }
.asis-prop td:first-child { color: var(--muted); }
.asis-prop-b { display: flex; align-items: center; gap: 8px; }
.asis-prop-est { color: var(--muted); font-size: 12px; }
.asis-prop[data-estado="confirmada"] { border-color: var(--ok); }
.asis-prop[data-estado="descartada"], .asis-prop[data-estado="caducada"] { opacity: .6; border-color: var(--line); }
.asis-senal { outline: 3px solid var(--gesso) !important; outline-offset: 2px; box-shadow: 0 0 0 6px rgba(243,103,27,.25) !important; transition: outline-color .3s; }
/* «Adaptar descompuestos (IA)» (adaptabc3.js) */
.bw-dialog.ad-dlg { width: min(1280px, 97vw); }
.ad-barra { width: 100%; height: 10px; }
.ad-barra-f { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ad-fil { border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 3px 10px; }
.ad-fil.on { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.ad-tabla { max-height: 62vh; overflow: auto; border: 1px solid var(--line-soft); border-radius: 6px; }
.ad-tabla td { vertical-align: top; }
.ad-tabla td.n { text-align: right; white-space: nowrap; }
.ad-tabla select { max-width: 520px; width: 100%; }
.ad-motivo { font-size: 12px; margin-top: 2px; }
.ad-sinref { font-size: 12px; color: #8a5a00; margin-top: 2px; }
.ad-sin td { background: #fffaf0; }
.ad-conf { display: inline-block; border-radius: 10px; padding: 1px 8px; font-size: 12px; font-weight: 600; }
.ad-conf.alta { background: #e3f4e8; color: var(--ok); }
.ad-conf.media { background: #fff4d6; color: #8a5a00; }
.ad-conf.baja { background: #fdecea; color: var(--danger); }
/* certificar presupuesto: árbol de estadillos (tipos → estadillos → líneas) y su editor */
.cp-barra { gap: 4px; }
.cp-barra button { padding: 2px 10px; font-size: 12px; }
.cp-panel:focus { outline: none; }
.cp-esttabla tr { cursor: default; }
.cp-esttabla tr.cp-grp td { background: #eef2f6; font-size: 12px; }
.cp-esttabla tr.cp-est td { font-weight: 600; background: #f6f8fa; font-size: 12px; }
.cp-esttabla tr.cp-l td:nth-child(2) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 380px; }
.cp-esttabla tr.cp-grp.drop td { background: var(--accent-soft); box-shadow: inset 0 -2px 0 var(--accent); }
.cp-esttabla tr[draggable="true"] { cursor: grab; }
.cp-esttabla tr.sel td { background: var(--sel, #dbeafe) !important; }
.cp-edmodal { width: min(1100px, 96vw); }
.cp-ed { max-height: 52vh; }
.cp-ed td input { box-sizing: border-box; }
/* ficha por secciones: rejilla pequeña (p. ej. el desglose de IVA de la certificación) */
.v2 .v2-item.bajo .v2-grid { height: 92px; }
/* fichas.json: "compacta" (ficha) = menos aire en cabecera y pestañas; "alto" (rejilla) = la rejilla ocupa el alto que queda en la ventana.
   Compras (petición, oferta y pedido), incidencia n.º 12 (25/10/2026): «queda muy poco espacio para ver las líneas». */
.v2.compacta { padding: 8px 12px 10px; }
.v2.compacta .v2-cab { gap: 6px 14px; padding: 8px 12px; }
.v2.compacta .v2-panel { gap: 6px 14px; padding: 8px 12px; }
.v2.compacta .v2-item { gap: 2px; }
.v2.compacta .v2-field { height: 28px; }
.v2.compacta .v2-checks { padding-top: 2px; gap: 2px 14px; }
.v2.compacta .v2-tabs { margin-top: 8px; }
.v2.compacta .v2-tab { padding: 6px 12px; }
.v2 .v2-item.alto .v2-grid { height: max(240px, calc(100vh - 440px - var(--top2))); }
/* Tutor de presupuestos (asistente.js): cabecera del panel con el paso del método */
.asis-ctx.asis-tutor { display: flex; flex-direction: column; gap: 4px; background: #fff7f0; border-bottom: 1px solid var(--line); }
.asis-tutor-t { font-size: 13px; }
.asis-tutor-paso { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.asis-tutor-barra { flex: 0 0 90px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.asis-tutor-barra > span { display: block; height: 100%; background: var(--gesso); }
.asis-tutor-b { display: flex; gap: 12px; font-size: 12px; }
.asis-tutor-estilo { display: inline-flex; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; align-self: flex-start; }
.asis-tutor-estilo > button { border: 0; background: #fff; padding: 2px 10px; font-size: 12px; }
.asis-tutor-estilo > button.on { background: var(--gesso); color: #fff; font-weight: 600; }
.ad-tabla td.ad-desv { color: var(--danger); font-weight: 600; }
/* barras de arriba de la ventana fijas al bajar (fijaBarras, app.js); en pantallas de poca altura se van con la ficha */
.win > .win-fija { position: sticky !important; z-index: 25; }
.win-head.win-fija { background: var(--panel); box-shadow: 0 1px 0 var(--line-soft); }
@media (max-height: 620px) { .win > .win-fija { position: static !important; } }
/* certificación: panel de la derecha (totales, capítulo, unidad de obra) */
.ct-kvt { font-weight: 600; font-size: 13px; padding: 2px 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-kvt.ct-sub { padding-top: 10px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
table.ct-kv { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.ct-kv th { text-align: left; font-weight: 400; color: var(--muted); padding: 3px 8px 3px 0; white-space: nowrap; }
table.ct-kv td { padding: 3px 0; font-variant-numeric: tabular-nums; }
table.ct-kv tr + tr th, table.ct-kv tr + tr td { border-top: 1px solid var(--line-soft); }
table.ct-kv tr.fuerte th, table.ct-kv tr.fuerte td { font-weight: 700; color: inherit; }
.ct-nota { font-size: 11.5px; margin: 8px 0 0; }
.ct-cuerpo { overflow: auto; }
/* certificación: valoración en cascada (pintaValCert, ejecucion.js), como el pie de una factura */
.v2 .v2-item.v2-en { display: none !important; }
.vc { display: flex; flex-direction: column; border: 1px solid var(--line-soft); border-radius: 8px; overflow: hidden; }
.vc-fila { display: grid; grid-template-columns: minmax(200px, 1.3fr) minmax(0, 200px) 22px minmax(120px, 170px); align-items: center; gap: 8px; padding: 4px 10px; }
.vc-fila + .vc-fila { border-top: 1px solid var(--line-soft); }
.vc-fila[hidden] { display: none; }
.vc-con { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vc-en { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vc-en .vc-pct { display: inline-flex; align-items: center; gap: 4px; }
.vc-en input[type=text] { width: 86px; text-align: right; }
.vc-en .c-check { white-space: nowrap; font-size: 12px; }
.vc-op { text-align: center; color: var(--muted); font-weight: 600; }
.vc-imp input { width: 100%; text-align: right; }
.vc-fila.sub { background: #fafbfc; }
.vc-fila.sub .vc-con { font-weight: 600; }
.vc-fila.total { background: #f3f6f9; }
.vc-fila.total .vc-con, .vc-fila.total .vc-imp input { font-weight: 700; }
.vc-fila.final { background: #fff4ea; }
.vc-fila.final .vc-con, .vc-fila.final .vc-imp input { font-weight: 700; font-size: 14px; }
@media (max-width: 900px) { .vc-fila { grid-template-columns: 1fr auto; } .vc-op { display: none; } }
table.ct-kv td.op { width: 18px; text-align: center; color: var(--muted); font-weight: 600; padding: 3px 4px; }
table.ct-kv tr.final th, table.ct-kv tr.final td { background: #fff4ea; }
.ct-bar select.ct-ver { height: 24px; font-size: 12px; padding: 0 4px; margin: 0 6px; width: auto; }
/* árbol de la certificación: no certificadas (vista «Todas») y aviso del filtro «con movimiento» */
.ct-tbl tr.ct-nocert td { color: #9aa3ad; font-style: italic; }
.ct-aviso { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12px; padding: 5px 10px; margin-bottom: 4px;
  background: #fff7e6; border: 1px solid #f3c27a; border-radius: 6px; color: #7a4b00; }
.ct-aviso button { font-size: 12px; padding: 1px 8px; }
.ct-tbl.ct-filtrada thead th { background: #fff3dc; }
.ct-descuadre { margin-left: 10px; color: var(--danger); font-weight: 600; font-size: 12px; }
/* servicios generales y planificación: la barra de botones fija también tapa lo que pasa por debajo */
.sgw > .win-fija:not(.navobra), .plw > .win-fija:not(.navobra) { background: var(--panel); }
.fac-libres { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 12px; margin: 0 0 4px 2px; }
.fac-libres .lk-mini { font-size: 12px; padding: 0 6px; }
/* análisis (analisis.js): claves ajenas del filtro en rosa; E-0 en pestañas con gráficos */
.anw .an-campo input.an-lk { height: 26px; border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; background: var(--input-req); font: inherit; width: 230px; max-width: 300px; }
.anw .an-campo.ancho input.an-lk { width: 300px; }
.anw .an-pests { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 0 10px; flex-wrap: wrap; }
.anw .an-pest { border: 1px solid transparent; border-bottom: 0; border-radius: 6px 6px 0 0; background: none; padding: 6px 14px; cursor: pointer; color: var(--muted); font: inherit; margin-bottom: -1px; }
.anw .an-pest:hover { color: var(--text); background: var(--row-alt); }
.anw .an-pest.on { color: var(--accent); border-color: var(--line); background: var(--panel); font-weight: 600; }
.anw .an-e0.an-pct .an-card { background: #fffdf0; }
.anw .an-e0 .an-cuadro { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }
.anw .an-col { display: flex; flex-direction: column; gap: 10px; }
.anw .an-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin-bottom: 10px; }
.anw .an-kpi { border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; background: var(--panel); display: flex; flex-direction: column; gap: 2px; }
.anw .an-kpi small { color: var(--muted); font-size: 11px; }
.anw .an-kpi b { font-size: 17px; font-variant-numeric: tabular-nums; }
.anw .an-kpi.neg b { color: var(--danger); }
.anw .an-kpi.an-kpi-res { border-color: var(--accent); }
.anw .an-kpi.an-kpi-warn { background: var(--warn-bg); }
.anw .an-modo { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; font-size: 12px; }
.anw .an-modo .an-nota { margin: 0; }
.anw .an-aviso { margin: 0 0 10px; cursor: pointer; }
.an-svg .lab { fill: var(--text); }
.an-svg .val { fill: var(--text); font-variant-numeric: tabular-nums; }
.an-svg .val.dentro { fill: #fff; }
.an-svg .val.dentro.osc { fill: var(--text); }
.an-bars, .an-cascada { font-size: 12px; }
.an-svg .guia { stroke: #8a96a8; stroke-dasharray: 3 3; }
.an-svg .s1, .an-svg .bar.s1 { fill: var(--accent); opacity: .85; }
.an-svg .s2, .an-svg .bar.s2 { fill: #4a6fa5; opacity: .85; }
.an-svg .s3, .an-svg .bar.s3 { fill: #a7b0bf; }
.an-svg .s4, .an-svg .bar.s4 { fill: var(--ok); opacity: .85; }
.an-svg .bar.neg { fill: var(--danger); opacity: .8; }
.an-svg .bar.tot { fill: #4a6fa5; }
.an-svg .bar.sube { fill: var(--ok); opacity: .8; }
.an-svg .bar.baja { fill: var(--accent); opacity: .8; }
.anw .an-graf { overflow: hidden; }
/* «Imputar y desimputar unidad de obra homogénea» (uohomogenea.js): mismo filtro que los análisis; rejilla con claves ajenas en rosa */
.uohw .an-filtro { border-bottom: 1px solid var(--line-soft); padding: 4px 10px; }
.uohw .an-filtro summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.uohw .an-campos { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; padding: 4px 0; }
.uohw .an-campo { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.uohw .an-campo > span:first-child { color: var(--muted); }
.uohw .an-campo input[type=text] { height: 26px; border: 1px solid var(--line); border-radius: 4px; background: #fff; font: inherit; padding: 0 6px; }
.uohw input.an-lk { height: 26px; border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; background: var(--input-req); font: inherit; width: 210px; }
.uohw .an-campo.ancho input.an-lk { width: 300px; }
.uohw .an-acciones { display: flex; gap: 6px; padding: 4px 0 6px; }
.uohw .an-tabs { display: inline-flex; gap: 2px; }
.uohw .an-tabs button.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.uohw .uoh-tb { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--line-soft); }
.uohw .uoh-grupo { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; flex-wrap: wrap; }
.uohw .uoh-grupo input.an-lk { width: 170px; } .uohw .uoh-grupo input.an-lk.uoh-ancha { width: 250px; }
.uohw .uoh-pend { color: var(--danger); font-size: 12px; font-weight: 600; }
.uohw .uoh-body { padding: 6px 10px; }
.uohw .uoh-info { font-size: 12px; margin: 2px 0 6px; }
.uohw .uoh-wrap { max-height: calc(100vh - 330px); overflow: auto; }
table.dl.uoh-tabla { font-size: 12px; }
table.dl.uoh-tabla th { position: sticky; top: 0; z-index: 1; }
table.dl.uoh-tabla td { padding: 2px 6px; white-space: nowrap; }
table.dl.uoh-tabla td.uoh-nom { white-space: normal; min-width: 220px; max-width: 420px; }
table.dl.uoh-tabla td.uoh-cap, table.dl.uoh-tabla td.uoh-obra { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
table.dl.uoh-tabla td.lk { padding: 1px 3px; }
table.dl.uoh-tabla input.an-lk.uoh-celda { width: 200px; height: 24px; }
table.dl.uoh-tabla input.an-lk.uoh-clase { width: 120px; }
table.dl.uoh-tabla tr.marc td { background: var(--row-sel); }
table.dl.uoh-tabla tr.camb td { background: #fff7d6; }
table.dl.uoh-tabla tr.camb.marc td { background: #fbe3b8; }
table.dl.uoh-tabla td.uoh-ud-mal { color: var(--danger); font-weight: 600; }
table.dl.uoh-tabla { table-layout: auto; width: max-content; min-width: 100%; }
table.dl.uoh-tabla td.uoh-cap { max-width: 170px; } table.dl.uoh-tabla td.uoh-obra { max-width: 190px; }
table.dl.uoh-tabla td { max-width: none; }
table.dl.uoh-tabla td.uoh-nom { max-width: 420px; } table.dl.uoh-tabla td.uoh-cap { max-width: 170px; } table.dl.uoh-tabla td.uoh-obra { max-width: 190px; }
/* inicio · «Abiertos recientemente»: tipo en etiqueta de ancho fijo, texto a la izquierda (se corta con elipsis) y cuándo se abrió */
.ini-tab.ini-rec { table-layout: fixed; }
.ini-tab.ini-rec td { text-align: left; }
.ini-tab.ini-rec td.ini-rtipo { width: 78px; max-width: none; overflow: visible; padding-right: 4px; }
.ini-tab.ini-rec td.ini-rtipo span { display: inline-block; min-width: 64px; padding: 1px 6px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 600; text-align: center; white-space: nowrap; }
.ini-tab.ini-rec td.ini-rtxt { max-width: none; width: auto; }
.ini-tab.ini-rec td.ini-rhace { width: 82px; max-width: none; text-align: right; color: var(--muted); font-size: 11px; }
.ini-porden { max-height: 220px; overflow: auto; }
.ini-porden > * { flex: none; }
.modal-b > .ini-porden, .modal-b > .ini-plist { flex: none; }
/* «Exportar ▾» (exportar.js): menú Excel (.xlsx) / CSV y aviso propio */
.exp-menu { position: fixed; z-index: 120; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 28px rgba(0,0,0,.18); padding: 4px; display: flex; flex-direction: column; min-width: 220px; }
.exp-menu button { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; border: 0; background: none; padding: 7px 10px; border-radius: 6px; cursor: pointer; text-align: left; font: inherit; color: var(--text); }
.exp-menu button small { color: var(--muted); font-size: 11px; }
.exp-menu button:hover, .exp-menu button:focus { background: var(--accent-soft); outline: none; }
.exp-toast { position: fixed; right: 16px; bottom: 16px; z-index: 130; background: #1d2633; color: #fff; padding: 9px 14px; border-radius: 8px; font-size: 13px; box-shadow: var(--shadow); max-width: 420px; }
.exp-toast.err { background: var(--danger); }
/* modelos de exportación (modelos.js): menú, lista y editor */
.exp-menu .exp-sep { font-size: 11px; color: var(--muted); padding: 6px 10px 2px; border-top: 1px solid var(--line-soft); margin-top: 2px; text-transform: uppercase; letter-spacing: .3px; }
.exp-menu .exp-modelos { display: flex; flex-direction: column; }
.modal.mdl { width: min(1400px, 96vw); max-height: 94vh; display: flex; flex-direction: column; }
.modal.mdl .mdl-b { overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.mdl-lista td { vertical-align: middle; } .mdl-lista td.mdl-acc { display: flex; gap: 4px; flex-wrap: wrap; }
.mdl-lista td { max-width: none; }
.mdl-pie { display: flex; gap: 6px; margin-top: 8px; }
.mdl-barra { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.mdl-barra input[type=text] { width: 320px; height: 30px; border: 1px solid var(--line); border-radius: 6px; padding: 0 8px; font: inherit; }
.mdl-barra select { height: 30px; }
.mdl-ed { display: grid; grid-template-columns: 220px 1fr; gap: 12px; align-items: start; }
.mdl-ed h4 { margin: 4px 0 6px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.mdl-disp { display: flex; flex-direction: column; gap: 2px; max-height: 360px; overflow: auto; margin-bottom: 6px; }
.mdl-disp button { text-align: left; border: 1px solid var(--line-soft); background: #fff; border-radius: 4px; padding: 3px 6px; cursor: pointer; font-size: 12px; }
.mdl-disp button:hover { background: var(--accent-soft); } .mdl-disp button.usada { color: var(--muted); background: var(--row-alt); }
.mdl-calc { width: 100%; }
table.mdl-cols { border-collapse: collapse; width: 100%; font-size: 12px; }
table.mdl-cols th { text-align: left; color: var(--muted); font-weight: 600; padding: 2px 4px; border-bottom: 1px solid var(--line); }
table.mdl-cols td { padding: 2px 4px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.mdl-cols input[type=text], table.mdl-cols select, table.mdl-cols input[type=number] { height: 26px; border: 1px solid var(--line); border-radius: 4px; font: inherit; padding: 0 4px; }
.mdl-tit { width: 170px; } .mdl-for { width: 230px; } .mdl-dec { width: 54px; }
.mdl-mov { white-space: nowrap; } .mdl-cond { display: inline-flex; gap: 4px; }
.mdl-dos { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; }
.mdl-fila { display: flex; gap: 6px; align-items: center; margin-bottom: 4px; font-size: 12px; }
.mdl-fila select { height: 26px; }
.mdl-chk { display: flex; gap: 6px; align-items: center; font-size: 12px; margin: 6px 0; }
.mdl-vista { border-top: 1px solid var(--line); padding-top: 6px; }
.mdl-nota { font-size: 11px; margin-bottom: 4px; }
.mdl-tabla { max-height: 320px; overflow: auto; border: 1px solid var(--line-soft); border-radius: 6px; }
.mdl-tabla table.dl td { max-width: 260px; font-size: 12px; padding: 2px 6px; }
.mdl-tabla tr.mdl-grupo td { font-weight: 700; background: var(--accent-soft); }
.mdl-tabla tr.mdl-grupo.n2 td, .mdl-tabla tr.mdl-grupo.n3 td { background: #e6eaf0; }
.mdl-tabla tr.mdl-subtotal td { font-weight: 700; background: #f3f4f7; border-top: 1px solid #c8ced8; }
.mdl-tabla tfoot tr td { font-weight: 800; background: #eef0f4; }
.mdl-tabla td.neg { color: var(--danger); }
.mdl-colsw { max-height: 300px; overflow: auto; border: 1px solid var(--line-soft); border-radius: 6px; }
.mdl-colsw table.mdl-cols th { position: sticky; top: 0; background: var(--panel); z-index: 1; }

/* ---------------------------------------------------------------- indicadores de las fichas (indicadores.js, IF-1) */
.ind-kpi { position: relative; display: grid; gap: 2px; align-content: start; text-align: left; background: var(--panel); border: 1px solid var(--line-soft);
  border-left: 4px solid #a7b0bf; border-radius: 8px; padding: 9px 12px; color: inherit; }
.ind-kpi.ir { cursor: pointer; }
.ind-kpi.ir:hover { border-color: var(--accent); }
.ind-kpi.est-verde { border-left-color: var(--ok); }
.ind-kpi.est-ambar { border-left-color: #c98a00; }
.ind-kpi.est-rojo { border-left-color: var(--danger); }
.ind-kpi.est-rojo .v { color: var(--danger); }
.ind-kpi .ind-cab { display: flex; align-items: center; gap: 6px; }
.ind-kpi .l { flex: 1; font-size: 12px; color: var(--muted); font-weight: 600; }
.ind-kpi .v { font: 700 18px/1.2 var(--font-brand); font-variant-numeric: tabular-nums; }
.ind-kpi.grande .v { font-size: 21px; }
.ind-kpi .s { font-size: 11.5px; color: var(--muted); }
.ind-sem { width: 10px; height: 10px; border-radius: 50%; background: #c3c9d3; flex: none; }
.est-verde .ind-sem { background: var(--ok); }
.est-ambar .ind-sem { background: #e0a100; }
.est-rojo .ind-sem { background: var(--danger); }
.ind-q { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--muted);
  font: 700 11px/1 var(--font); cursor: pointer; padding: 0; }
.ind-q:hover, .ind-q[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.ind-ayuda { font-size: 12px; line-height: 1.45; color: var(--text); background: var(--face); border: 1px solid var(--line-soft); border-radius: 6px; padding: 8px 10px; margin-top: 4px; }
.ind-ayuda p { margin: 0 0 4px; }
.ind-ayuda p:last-child { margin-bottom: 0; }
.ind-ayuda .ideal { color: var(--ok); }
.ind-pest { width: 100%; }
.ind-pest.cargando { opacity: .55; }
.ind-barra { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 10px; }
.ind-barra .btn { margin-left: auto; }
.ind-per select { margin-left: 4px; }
.ind-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-bottom: 14px; }
.ind-grafs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 12px; }
.ind-graf { margin: 0; background: var(--panel); border: 1px solid var(--line-soft); border-radius: 8px; padding: 10px 12px; min-width: 0; }
.ind-graf figcaption { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.ind-graf figcaption span { flex: 1; }
.ind-cargando { color: var(--muted); font-size: 12px; padding: 30px 0; text-align: center; }
.ind-nota { font-size: 11.5px; margin-top: 10px; }
.an-svg .linea { fill: none; stroke-width: 2.2; }
.an-svg .linea.s1 { stroke: var(--accent); }
.an-svg .linea.s2 { stroke: #4a6fa5; }
.an-svg .linea.s3 { stroke: #a7b0bf; }
.an-svg .linea.disc { stroke-dasharray: 6 4; stroke-width: 1.6; opacity: .8; }
.an-svg .pto { stroke: #fff; stroke-width: 1.5; }
.an-svg .pto.s1 { fill: var(--accent); }
.an-svg .pto.s2 { fill: #4a6fa5; }
.an-svg .venc, .an-svg .bar.venc { fill: var(--danger); opacity: .85; }
.an-svg .vacio { fill: none; stroke: #e6ebf2; }
@media (max-width: 600px) { .ind-kpis { grid-template-columns: 1fr; } }
.ind-kpis { align-items: start; }
.ind-kpi .ind-ayuda { position: absolute; z-index: 20; left: -1px; right: -1px; top: calc(100% + 4px); background: var(--panel); box-shadow: var(--shadow), 0 8px 24px rgba(16,24,40,.14); margin: 0; }

/* ---------------------------------------------------------------- Configuración › Bancos de precios (bancos.js, presupuesto asistido PA-0) */
.modal.cor-modal.bp-modal { max-width: none; width: min(1100px, 96vw); }
.modal.cor-modal.bp-form { max-width: none; width: min(680px, 96vw); }
.bp-sec { margin-top: 16px; border-top: 1px solid var(--line-soft); padding-top: 10px; }
.bp-sec h4 { margin: 0 0 6px; }
.bp-fila { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.bp-tabla td { vertical-align: top; }
table.dl.bp-tabla td { max-width: 260px; }
table.dl.bp-tabla td:last-child { max-width: none; width: 1%; overflow: visible; }
table.dl.bp-tabla tbody tr:hover td { cursor: default; }
.bp-tabla tr.bp-off td { color: var(--muted); }
.bp-ind { margin: 6px 0; padding-left: 18px; }
.bp-prov { max-height: 260px; overflow: auto; }
.bp-res details { border: 1px solid var(--line-soft); border-radius: 6px; padding: 6px 10px; margin: 6px 0; background: var(--panel); }
.bp-res summary { cursor: pointer; }
.bp-pre { font-weight: 700; color: var(--accent); }
.bp-form textarea, .bp-sec textarea { width: 100%; box-sizing: border-box; font: inherit; }

/* ---------------------------------------------------------------- presupuesto asistido por IA (presasistido.js, PA-1) */
.modal.cor-modal.pa-modal { max-width: none; width: min(1200px, 97vw); }
.pa-modal .modal-b { max-height: calc(100vh - 150px); overflow: auto; }
.pa textarea { width: 100%; box-sizing: border-box; font: inherit; }
.pa h4 { margin: 12px 0 6px; }
.pa-fila { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.pa-acciones { position: sticky; top: -12px; background: var(--panel); z-index: 2; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.pa-chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 10px; padding: 0 7px; font-size: 12px; white-space: nowrap; background: var(--panel); }
.pa-chip i, .pa-leyenda i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; }
.pa-c-alta { background: #e6f4ea; } .pa-c-media { background: var(--warn-bg); } .pa-c-baja { background: #fde3e1; }
.pa-est-borrador, .pa-est-aceptado { background: #e6f4ea; } .pa-est-preguntas { background: var(--warn-bg); } .pa-est-trabajando { background: var(--accent-soft); }
.pa-o-propio { background: #2e7d32; } .pa-o-banco { background: #1565c0; } .pa-o-web { background: #8e24aa; } .pa-o-ia { background: #ef6c00; }
.pa-o-empresa { background: #00897b; } .pa-o-usuario { background: #6d4c41; }
.pa-barra { display: flex; height: 14px; border-radius: 4px; overflow: hidden; border: 1px solid var(--line); background: var(--line-soft); }
.pa-leyenda { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; margin-top: 4px; }
.pa-leyenda span { display: inline-flex; align-items: center; gap: 5px; }
.pa-perso { margin: 10px 0; }
.pa-totales { display: flex; flex-wrap: wrap; gap: 10px 24px; margin: 10px 0; }
.pa-totales div { display: flex; flex-direction: column; } .pa-totales b { font-size: 16px; }
.pa-trabajando { border: 1px solid var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 8px 12px; margin-bottom: 10px; }
.pa-prog { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.pa-spin { width: 14px; height: 14px; border: 2px solid var(--accent); border-right-color: transparent; border-radius: 50%; animation: pa-gira .9s linear infinite; }
@keyframes pa-gira { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pa-spin { animation: none; } }
.pa-prog-caps { margin: 6px 0 0; padding-left: 20px; font-size: 13px; }
.pa-preguntas { border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 6px; padding: 8px 12px; margin: 10px 0; background: var(--panel); }
.pa-preg { margin: 10px 0; } .pa-preg-t { font-weight: 600; display: block; } .pa-preg small { display: block; }
.pa-preg input[type=text]:not([style*="9em"]) { max-width: 520px; }
.pa-estima { font-size: 13px; color: var(--muted); }
.pa-log { border-left: 3px solid var(--line); padding: 2px 10px; margin: 8px 0; font-size: 13px; }
.pa-log p { margin: 4px 0; white-space: pre-wrap; } .pa-log-error { color: var(--danger); } .pa-log-usuario { font-style: italic; } .pa-log-coste { color: var(--muted); }
.pa-cap { border: 1px solid var(--line-soft); border-radius: 6px; margin: 6px 0; padding: 4px 8px; background: var(--panel); }
.pa-cap > summary { cursor: pointer; padding: 4px 0; } .pa-imp { float: right; color: var(--muted); }
.pa-tabla tbody tr.pa-ud td { cursor: pointer; vertical-align: top; white-space: normal; max-width: none; }
.pa-tabla tbody tr.pa-ud:focus-visible td { outline: 2px solid var(--accent); outline-offset: -2px; }
.pa-tabla tbody tr.pa-rev td:first-child { box-shadow: inset 3px 0 0 #ef6c00; }
.pa-tabla tbody tr.pa-det td { background: #fafbfc; cursor: default; white-space: normal; max-width: none; }
.pa-tabla small { display: block; }
.pa-detalle p { margin: 4px 0; } .pa-larga { white-space: pre-wrap; }
.pa-recs { width: auto; min-width: 70%; margin: 4px 0; } .pa-recs td { white-space: normal; max-width: none; } .pa-nota { display: block; }
.pa-sup, .pa-avisos, .pa-planos { margin: 10px 0; } .pa-sup summary, .pa-avisos summary, .pa-planos summary { cursor: pointer; font-weight: 600; }
.pa-desc, .pa-resumen { margin: 6px 0; } .pa-resumen { white-space: pre-line; }
.pa-lista td { white-space: normal; max-width: none; }
.pa-marcas { display: inline-flex; gap: 4px; margin-left: 4px; flex-wrap: wrap; }
.pa-propia { background: #e6f4ea; border-color: #2e7d32; } .pa-revisada { background: #e3f2fd; } .pa-corregida { background: #fff4d6; }
.pa-pers { font-weight: 600; background: #e6f4ea; }
.pa-detalle > .pa-fila { margin-top: 2px; }
/* PA-3: pedir sobre una unidad o un capítulo; comparar con lo real */
.pa-real { background: #fdecea; border-color: #c62828; margin-left: 4px; }
.pa-reales { border-left: 3px solid #c62828; background: #fff8f7; padding: 4px 10px; margin: 6px 0; font-size: 13px; }
.pa-reales ul { margin: 4px 0; padding-left: 18px; } .pa-reales .link { margin-left: 8px; }
.pa-pedir-z { margin: 4px 0; } .pa-pedir-b { font-size: 12px; }
.pa-pedir { margin: 4px 0; max-width: 720px; } .pa-pedir textarea { width: 100%; box-sizing: border-box; }
.ini-ia { margin-right: 8px; }
/* widget «Asistente IA» de la pantalla de inicio (inicio.js, pintaIA) */
.ini-iab { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.ini-iab button { display: flex; flex-direction: column; gap: 3px; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 9px 11px; cursor: pointer; }
.ini-iab button b { color: var(--accent); font-size: 13.5px; }
.ini-iab button small { color: var(--muted); font-size: 11.5px; line-height: 1.3; }
.ini-iab button:hover { background: var(--accent-soft); border-color: var(--accent); }
.ini-iab button.ppal { border-color: var(--accent); }
.ini-iaq { display: flex; flex-wrap: wrap; gap: 6px; }
.ini-iaq button { border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 5px 11px; text-align: left; cursor: pointer; font-size: 12.5px; }
.ini-iaq button:hover { border-color: var(--accent); color: var(--accent); }
/* PA-4: condiciones de venta, planos y fotos, avisos del tutor */
.pa-aviso { background: #fff4d6; border-color: #ef6c00; margin-left: 4px; }
.pa-condiciones { border: 1px solid var(--line-soft); border-radius: 6px; padding: 6px 10px; margin: 6px 0; background: var(--panel); }
.pa-condiciones .pa-fila { flex-wrap: wrap; gap: 10px; }
.pa-adj { margin: 8px 0; } .pa-adj input[type=file] { display: block; margin: 4px 0; }
.pa-planos ul { margin: 4px 0; padding-left: 18px; }
/* accesos: ayuda del borrador y aviso «Volver al borrador» en el presupuesto */
.pa-ayuda { margin: 6px 0; font-size: 13px; } .pa-ayuda summary { cursor: pointer; color: var(--accent); }
.pa-ayuda ol { margin: 4px 0; padding-left: 20px; } .pa-ayuda li { margin: 3px 0; }
.bw-pa { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- Configuración › Copias de seguridad (copias.js) */
.modal.cop-modal { width: min(1100px, 96vw); }
.cop-estado { padding: 8px 12px; border-radius: 6px; margin-bottom: 10px; border: 1px solid var(--line); }
.cop-estado.cop-ok { background: #e8f5ec; border-color: #b7dcc3; color: var(--ok); }
.cop-estado.cop-aviso { background: var(--warn-bg); border-color: #ecd391; }
.cop-estado.cop-error { background: #fdecea; border-color: #f0b9b4; color: var(--danger); }
.cop-datos { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 6px 18px; margin-bottom: 8px; }
.cop-dato { display: flex; flex-direction: column; }
.cop-lab { color: var(--muted); font-size: 12px; }
.cop-tabla { max-height: 50vh; overflow: auto; }
.cop-tabla td { white-space: nowrap; }
.cop-tabla td.cop-arch { white-space: normal; word-break: break-all; }
.cop-tabla td.cop-donde { white-space: normal; }
.cop-ruta { color: var(--muted); font-size: 11px; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cop-tabla td.cop-acc { text-align: right; }
.cop-tabla td.cop-acc button { padding: 2px 10px; }
.cop-nota { background: var(--warn-bg); border: 1px solid #ecd391; border-radius: 6px; padding: 6px 10px; }
.cop-tabla tr.cop-error td { color: var(--danger); }

/* «Pasar versiones a ejecución» (pasoejecucion.js) */
.modal.pasoej { width: min(980px, 100%); }
.pasoej-t { width: 100%; border-collapse: collapse; font-size: 13px; }
.pasoej-t th { text-align: left; font-weight: 600; color: #34465f; padding: 6px 8px; border-bottom: 1px solid var(--line-soft); }
.pasoej-t td { padding: 8px; vertical-align: top; border-bottom: 1px solid var(--line-soft); }
.pasoej-t td.c { width: 28px; text-align: center; }
.pasoej-t tr.off td:not(.c) { opacity: .5; }
.pasoej-t select { max-width: 100%; }
.pasoej-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.pasoej-nota { color: var(--muted); font-size: 12px; margin-top: 4px; }
.pasoej-nota.err, .pasoej-err { color: var(--danger); }
.toast { white-space: pre-line; }
.pasoej-compras { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
/* Partes del móvil: estados, lo enviado por el operario y lo corregido (23/10/2026) */
.pmv-est.aceptado { color: #2c4a8a; font-weight: 600; }
.pmv-est.validado { color: #1e7a3c; }
.pmv-est.rechazado { color: #b3261e; }
.pmv-original:empty { display: none; }
.pmv-original { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; margin: 8px 0; background: #fafbfc; }
.pmv-orig h4 { margin: 8px 0 2px; }
.pmv-dif { margin: 4px 0 8px; color: #9a3412; }
.pmv-dif.ok { color: #1e7a3c; }
.pmv-dif ul { margin: 4px 0 0 18px; padding: 0; }

/* ◀ ▶ «n de m» junto a los desplegables de registros asociados (barra.js conFlechas): versiones, unidades de ejecución, acopios… */
.nav-flechas { display: inline-flex; align-items: center; gap: 4px; }
.nav-flecha { min-width: 26px; padding: 2px 6px; line-height: 1.2; }
.nav-pos { font-size: 12px; color: var(--muted); white-space: nowrap; margin-left: 2px; }
.navobra .nav-pos { color: var(--side-fg); }
/* unidad de ejecución en la que se está (presupuesto): código y tipo, junto al tipo / número de la versión */
.tipo-version.ue { background: var(--navy); }
.tipo-version.ue-cgo { background: #2f5d9e; }
.tipo-version.ue-ogo { background: #6b4fa0; }

/* incidencia n.º 39: ventana «Pasar a pedido · recurso (o concepto) real de las líneas»: botones a la vista, sin desbordar */
.rrp-wrap { max-height: 55vh; overflow: auto; border: 1px solid var(--line); border-radius: 4px; }
.rrp-tabla { width: 100%; border-collapse: collapse; font-size: 13px; }
.rrp-tabla th { position: sticky; top: 0; background: #f4f7fb; text-align: left; font-weight: 600; padding: 6px 8px; white-space: nowrap; }
.rrp-tabla td { padding: 5px 8px; border-top: 1px solid #eef1f5; vertical-align: middle; }
.rrp-tabla td.num { text-align: right; white-space: nowrap; }
.rrp-tabla td.rrp-acc { white-space: nowrap; }
.rrp-tabla td.rrp-acc button + button { margin-left: 6px; }
.rrp-tabla td.rrp-nom { color: var(--danger); min-width: 160px; }

/* incidencias de la beta 59, 56, 52 y 53 (27/10/2026) */
/* n.º 59: «＋» en la casilla del recurso (o concepto) real de las líneas: crear el recurso real con lo escrito y traerlo a la línea */
.c-grid td.lk-con-mas { position: relative; }
.c-grid td.lk-con-mas input { padding-right: 22px; }
.c-grid td .lk-mas { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; padding: 0; border: 0; border-radius: 3px;
  background: transparent; color: var(--accent); font-size: 13px; line-height: 18px; cursor: pointer; opacity: .35; }
.c-grid td.lk-con-mas:hover .lk-mas, .c-grid td.lk-con-mas:focus-within .lk-mas, .c-grid td.huerfano .lk-mas { opacity: 1; }
.c-grid td .lk-mas:hover { background: var(--accent-soft); }
/* n.º 56: cajas de % de «Añadir a certificación» enteras (antes la columna era más estrecha que la caja y se cortaba el número) */
.cp-tabla th.cp-colpct, .cp-tabla td.cp-tdpct { min-width: 104px; width: 104px; }
.cp-tabla th.cp-colmed, .cp-tabla td.cp-tdmed { min-width: 124px; }
.cp-tabla td input.cp-pct, .cp-tabla td input.cp-med { box-sizing: border-box; max-width: none; }
.cp-tabla td input.cp-pct { width: 84px !important; }
.cp-tabla td input.cp-med { width: 104px !important; }
.cp-tabla td input.cp-pct:disabled { background: #f1f4f8; color: #6b7280; border-color: transparent; }
.cp-tabla td input::placeholder { color: #9aa3b2; font-style: italic; }
/* n.º 52 y 53: obra asociada como enlace (rejilla «Ofertas asociadas» de la ejecución y cajas de la ejecución asociada de la oferta) */
.c-grid td.golink-celda { color: var(--accent); text-decoration: underline dotted; text-underline-offset: 2px; cursor: pointer; }
.c-grid td.golink-celda:hover { text-decoration-style: solid; }
input.golink-val { color: var(--accent) !important; text-decoration: underline dotted; text-underline-offset: 2px; cursor: pointer; }
/* n.º 51: Empresa › Compras › Comparaciones de ofertas */
.modal.cmpemp-modal { width: min(1250px, 97vw); }
.cmpemp-modal .tablewrap { max-height: 64vh; }
.cmpemp-modal tr.it:hover td, .cmpemp-modal tr.it:focus td { background: var(--row-hover); }

/* incidencia n.º 64: el asistente se abre desde «Ayuda ▾» (el botón queda para asistente.js y F1, sin verse) y el menú Empresa por grupos plegables */
#asis-btn.asis-oculto { display: none !important; }
.barra-menu button.plg { font-weight: 600; color: var(--text); }
.barra-menu button.plg::before { content: "▸"; display: inline-block; width: 14px; color: var(--muted, #6b7280); transition: transform .12s; }
.barra-menu button.plg.abierto::before { transform: rotate(90deg); }
.barra-menu .plg-items button { padding-left: 32px; }
.bw-ktab tr.bw-k-emd th, .bw-ktab tr.bw-k-emd td.num { font-weight: 600; }

/* incidencia n.º 74: destino del importador en cajas (obra, versión, unidad de ejecución) y desplegable para cambiarlo */
.imp-destino { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; flex: 1; min-width: 0; margin-left: 12px; }
.imp-dest-t { align-self: center; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted, #6b7280); }
.imp-dcajas { display: flex; gap: 8px; flex-wrap: wrap; min-width: 0; }
.imp-dcaja { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.imp-dcaja > span { font-size: 11px; color: var(--muted, #6b7280); }
.imp-dcaja input { height: 26px; border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; font: inherit; background: var(--input-ro, #f1f4f8); color: var(--text); text-overflow: ellipsis; }
.imp-dcaja.obra input { width: 300px; }
.imp-dcaja.ver input { width: 260px; }
.imp-dcaja.ue input { width: 220px; }
.imp-cambiar { height: 26px; max-width: 170px; }
.pm-porlineas { margin-bottom: 8px; }
/* incidencia n.º 77: listado de comparaciones como el de las demás pantallas (ocupa la pantalla) */
.cmpo-enlista .cmpo-grid { max-height: calc(100vh - 230px - var(--top2)); min-height: 320px; }
.cmpo-docbar .seg button { height: 28px; padding: 0 10px; background: #fff; }
.cmpo-docbar .seg button.on { background: var(--accent-soft, #e8f0fe); color: var(--accent); font-weight: 600; border-color: transparent; }
.cmpo-lista-n { margin: 2px 0 6px; font-size: 12.5px; }
.cmpo-lista tbody tr { cursor: pointer; }
/* mejora n.º 76: pasos del importador */
.imp-pasos ol { margin: 6px 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; line-height: 1.4; }
/* mejora n.º 70: barra para repartir el ancho entre el árbol y la ficha del presupuesto; nombre del recurso más ancho */
.bw-split.bw-split3 { grid-template-columns: minmax(300px, var(--bw-izq, 1.25fr)) 7px minmax(380px, 1fr); }
.bw-split3 > .bw-tree { border-right: 0; }
/* incidencia n.º 79: clase propia (con «bw-asa», que ya era el asa de la columna Resumen y va en posición absoluta, la ficha caía en la columna de 7 px) */
.bw-splitasa { cursor: col-resize; background: var(--line-soft); border-left: 1px solid var(--line); border-right: 1px solid var(--line); touch-action: none; }
.bw-splitasa:hover, body.bw-arrastrando .bw-splitasa { background: var(--accent); }
body.bw-arrastrando { cursor: col-resize; user-select: none; }
.bw-split.bw-vertical > .bw-splitasa { display: none; }
@media (max-width: 1100px) { .bw-split.bw-split3 { grid-template-columns: 1fr; } .bw-split3 > .bw-splitasa { display: none; } }
.bw-detail .bw-grid.small td.nm { min-width: 200px; }
/* mejora n.º 81: enlace a la ejecución de obra asociada, junto al botón de la pestaña «Paso a ejecución» de la versión PO */
.v2-botones .pe-enlace { align-self: center; margin-left: 12px; color: var(--accent); text-decoration: underline dotted; text-underline-offset: 2px; font-size: 12.5px; }
.v2-botones .pe-enlace:hover { text-decoration-style: solid; }
/* incidencia n.º 84: en el multioperario, las columnas de números al ancho de su caja (la tabla al 100 % las ensanchaba y la casilla
   parecía partida en dos) */
table.dl.pm-tabla td.num { width: 1%; white-space: nowrap; }
table.dl.pm-tabla td.num .c-in.num { width: 90px; }
/* incidencia n.º 86: la casilla de un gasto es la cantidad, no horas */
table.dl.pm-tabla td.pm-gasto .c-in.num { border-style: dashed; }
/* mejora n.º 97: gasto sin precio para el operario */
table.dl.pm-tabla td.pm-sinprecio .c-in.num { border-color: #d97706; background: #fff7ed; }
/* mejora n.º 85: número de paso en cada pestaña del multioperario (✓ hecho, naranja falta, rojo no cuadra, gris opcional) */
.c-partemulti .pm-nro { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; font-size: 11px; font-weight: 700; color: #fff; background: #f59e0b; align-self: center; }
.c-partemulti .pm-nro.ok { background: #16a34a; }
.c-partemulti .pm-nro.mal { background: #e11d48; }
.c-partemulti .pm-nro.opc { background: #cbd5e1; color: #475569; }
.c-partemulti .pm-tab.mal::after { content: none; }
/* mejora n.º 92: hora o gasto, a la vista en la fila del multioperario y en la lista de la búsqueda */
table.dl.pm-tabla .pm-tipo-in { display: flex; align-items: center; gap: 4px; }
table.dl.pm-tabla .pm-tipo-in .c-in { flex: 1; min-width: 0; }
.c-partemulti .pm-hg { flex: none; font-size: 11px; line-height: 18px; padding: 0 6px; border-radius: 9px; font-weight: 600; }
.c-partemulti .pm-hg.hora { background: #e0ecfb; color: #1d4f91; }
.c-partemulti .pm-hg.gasto { background: #fdecc8; color: #8a5300; }
.dropdown td.hg { font-weight: 600; color: #475569; }

/* ---- aprobación de facturas de proveedor (aprobfac.js, 28/10/2026) ---- */
.af-chip { align-self: flex-start; border: 1px solid transparent; border-radius: 12px; padding: 2px 10px; font-size: 12px; font-weight: 600; cursor: pointer; margin: 0 0 6px; grid-column: 1 / -1; justify-self: start; }
.af-chip[data-e=aprobada] { background: #e3f4e8; color: var(--ok); border-color: #b9e1c5; }
.af-chip[data-e=pendiente] { background: var(--warn-bg); color: #8a5300; border-color: #f0d48a; }
.af-chip[data-e=rechazada], .af-chip[data-e=retenida] { background: #fde8e7; color: var(--danger); border-color: #f2b8b5; }
.af-estado { display: inline-block; border-radius: 10px; padding: 1px 8px; font-size: 12px; font-weight: 600; background: #eef1f5; color: var(--muted); }
.af-estado.grande { font-size: 14px; padding: 3px 12px; }
.af-estado[data-e=aprobada] { background: #e3f4e8; color: var(--ok); }
.af-estado[data-e=pendiente] { background: var(--warn-bg); color: #8a5300; }
.af-estado[data-e=rechazada], .af-estado[data-e=retenida] { background: #fde8e7; color: var(--danger); }
.af-panel { display: flex; flex-direction: column; gap: 10px; }
.af-cab { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.af-aviso { margin: 0; font-size: 13px; }
.af-aviso[data-e=rechazada], .af-aviso[data-e=retenida] { color: var(--danger); }
.af-tabla { overflow-x: auto; border: 1px solid var(--line-soft); border-radius: 6px; }
.af-tabla tr.af-nivel th { background: #f7f8fa; font-size: 12px; }
.af-tabla tr.af-nivel.actual th { background: var(--accent-soft); }
.af-tabla tr.af-l.mia td { font-weight: 600; }
.af-tabla td.af-com { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.af-tabla select { max-width: 220px; }
.af-turno { margin-left: 8px; font-size: 11px; color: var(--accent); font-weight: 600; }
.af-acc { display: flex; flex-direction: column; gap: 6px; }
.af-acc .af-texto { width: 100%; max-width: 720px; resize: vertical; }
.af-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.af-btns button.danger { border-color: var(--danger); color: var(--danger); }
.af-hist summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.af-hist td.af-f { white-space: nowrap; }
.af-cfg { display: flex; flex-direction: column; gap: 12px; }
.af-modos { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.af-modo { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--line-soft); border-radius: 6px; padding: 8px 10px; cursor: pointer; }
.af-modo.on { border-color: var(--accent); background: var(--accent-soft); }
.af-modo span { display: flex; flex-direction: column; gap: 3px; }
.af-modo small { color: var(--muted); line-height: 1.4; }
.af-ck { gap: 6px; align-items: center; font-size: 13px; color: inherit; }
.af-regla { border: 1px solid var(--line-soft); border-radius: 6px; padding: 8px 10px; display: flex; flex-direction: column; gap: 8px; }
.af-regla.inactiva { opacity: .6; }
.af-regla legend { font-weight: 600; font-size: 12px; padding: 0 4px; }
.af-niveles input[type=text], .af-niveles select { width: 100%; }
.af-reglas, .af-subs { display: flex; flex-direction: column; gap: 8px; }
.af-reglas h4, .af-subs h4 { margin: 4px 0 0; }
.af-subs-t table { min-width: 900px; }
.af-bandeja { min-height: 120px; }
table.dl.iv tr.sinaprobar td { color: #8a5300; }

/* certificación (mejoras de la beta n.º 102, 103 y 104, 28/10/2026): cabecera con más columnas (fichas.json "columnasCab"),
   pestañas con algo pendiente (vencimientos, costes asociados) y pestaña «Ramas de certificación» */
.v2-cab { grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); }
@media (max-width: 900px) { .v2-cab { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* incidencia n.º 111: obligatorio sin rellenar al grabar */
.v2-item.falta .v2-lab { color: var(--danger); }
.v2-item.falta input:not([type=checkbox]):not([type=radio]), .v2-item.falta select, .v2-item.falta textarea { border-color: var(--danger) !important; box-shadow: 0 0 0 1px var(--danger); }
/* mejora n.º 112: pestaña con algo pendiente, iluminada (sin etiqueta) */
.v2-tab.pend { background: var(--warn-bg); color: var(--danger); border-color: #f0b4a8; }
.v2-tab.pend:hover { color: var(--danger); filter: brightness(.97); }
.v2-tab.pend.on { background: var(--warn-bg); }
.v2-tab .v2-pend { display: inline-block; margin-left: 6px; padding: 2px 6px; border-radius: 9px; background: var(--warn-bg); color: var(--danger); font: 700 10.5px/1 var(--font); vertical-align: 1px; }
.v2-aviso-pend { grid-column: 1 / -1; background: var(--warn-bg); border: 1px solid var(--line); border-left: 4px solid var(--danger); border-radius: 6px; padding: 8px 12px; font-size: 13px; }
.v2 .v2-ramascert { position: static; }
.rc-barra { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.rc-ver { border: 1px solid var(--line); background: var(--face); border-radius: 6px; padding: 5px 10px; font-size: 12.5px; cursor: pointer; }
.rc-ver.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.rc-wrap { max-height: max(260px, calc(100vh - 420px - var(--top2, 0px))); overflow: auto; }
.rc-tbl td, .rc-tbl th { white-space: nowrap; font-size: 12.5px; padding-top: 3px; padding-bottom: 3px; }
.rc-tbl tr.rc-rama td { background: var(--face); font-weight: 400; cursor: pointer; border-top: 1px solid var(--line); }
/* incidencia n.º 115: la raya de «es la suya» solo en la primera casilla (salía en todas las de importes) */
.rc-tbl tr.rc-rama.rc-suya td:first-child, .rc-tbl tr.rc-ue.rc-suya td:first-child { box-shadow: inset 4px 0 0 var(--gesso); }
/* incidencia n.º 114: primer nivel, la unidad de ejecución (suma de sus ramas); las ramas, un poco metidas */
.rc-tbl tr.rc-ue td { background: #eef3f8; font-weight: 600; cursor: pointer; border-top: 2px solid var(--line); }
.rc-tbl tr.rc-ue .rc-tog { display: inline-block; width: 16px; color: var(--muted); }
.rc-tbl tr.rc-rama td.rc-rot { padding-left: 22px; }
table.dl.rc-tbl td { max-width: none; }
.rc-tbl tr.rc-rama .rc-tog { display: inline-block; width: 16px; color: var(--muted); }
/* incidencia n.º 108: títulos de las columnas de números a la derecha, como los números; en la cabecera de la rama, sus importes */
table.dl.rc-tbl th.num { text-align: right; }
.rc-tbl tr.rc-rama td.num { font-weight: 600; }
.rc-tbl tr.rc-rama.rc-sueltas td { background: #f6f3ee; }
/* mejora n.º 122: la rama (o el grupo «sin rama») de la certificación abierta, bien señalada aunque esté plegada: fondo de fila elegida,
   raya de color y nombre en el color de la marca */
.rc-tbl tr.rc-rama.rc-suya td { background: var(--row-sel); border-top-color: var(--gesso); }
.rc-tbl tr.rc-rama.rc-suya td.rc-rot b { color: var(--accent); }
.rc-tbl tr.rc-rama.rc-suya td:first-child { box-shadow: inset 5px 0 0 var(--gesso); }
.rc-tbl tr.rc-cert { cursor: default; }
.rc-tbl tr.rc-cert:hover td { background: var(--row-hover); }
.rc-tbl tr.rc-esta td { font-weight: 600; }
.rc-tbl tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* incidencia n.º 105 (29/10/2026): la cabecera de 6 columnas (fichas.json "columnasCab") solo en pantallas anchas; entre 901 y 1.400 px
   vuelve a 4 columnas y lo que ocupaba 5 o 6 (botones, descripciones) pasa a todo el ancho */
@media (min-width: 901px) and (max-width: 1400px) {
  .v2-cab { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .v2-cab > [data-span="5"], .v2-cab > [data-span="6"] { grid-column: 1 / -1 !important; }
}

/* certificación · pestaña «Evolución» (mejora de la beta n.º 117): los dos gráficos lado a lado (uno debajo de otro en pantallas estrechas) */
.ev-grafs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 10px; }
.ev-graf .an-svg { max-height: 300px; }
.ev-nota { font-size: 12px; margin: 0 0 8px; }
.ev-tbl tr.rc-rama td { cursor: default; font-weight: 600; }
@media (max-width: 1100px) { .ev-grafs { grid-template-columns: 1fr; } }
/* incidencia n.º 126: pestaña con un dato obligatorio sin rellenar (fichas.json «pestanasObligatorias», o tras un intento de grabar
   fallido), iluminada como las pendientes de la certificación (mejora n.º 112) */
.v2-tab.oblig { background: var(--warn-bg); color: var(--danger); border-color: #f0b4a8; }
.v2-tab.oblig:hover { color: var(--danger); filter: brightness(.97); }
.v2-tab.oblig.on { background: var(--warn-bg); }
/* incidencia n.º 129: cobro, pago o traspaso ya grabado (protegido): aviso con el botón para desbloquearlo.
   Incidencia n.º 135: aviso en color de aviso, candado, botón grande y destacado; parpadea si se intenta escribir en una caja bloqueada */
.v2-aviso-bloq { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--warn-bg); border: 1px solid #f0c9a0; border-left: 5px solid var(--gesso); border-radius: 8px; padding: 10px 14px; margin-bottom: 10px; font-size: 13.5px; }
.v2-aviso-bloq > span:not(.aviso-bloq-ico) { flex: 1 1 320px; }
.aviso-bloq-ico { width: 22px; height: 22px; flex: 0 0 22px; background: var(--gesso);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1a5 5 0 0 0-5 5v4H6a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-9a2 2 0 0 0-2-2h-1V6a5 5 0 0 0-5-5zm-3 9V6a3 3 0 0 1 6 0v4H9z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1a5 5 0 0 0-5 5v4H6a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-9a2 2 0 0 0-2-2h-1V6a5 5 0 0 0-5-5zm-3 9V6a3 3 0 0 1 6 0v4H9z'/%3E%3C/svg%3E") center / contain no-repeat; }
.aviso-bloq-btn { background: var(--gesso); color: #fff; border: 1px solid var(--gesso); border-radius: 6px; padding: 8px 16px; font: 600 13.5px/1.1 var(--font-brand, inherit); cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.15); white-space: nowrap; }
.aviso-bloq-btn:hover { filter: brightness(1.08); }
.aviso-bloq-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.v2-aviso-bloq.avisa { animation: aviso-bloq-pulso .9s ease-out 2; }
.v2-aviso-bloq.avisa .aviso-bloq-btn { box-shadow: 0 0 0 4px rgba(232, 93, 4, .35); }
@keyframes aviso-bloq-pulso { 0% { transform: translateX(0); } 15% { transform: translateX(-4px); } 30% { transform: translateX(4px); } 45% { transform: translateX(-2px); } 60% { transform: translateX(2px); } 100% { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) { .v2-aviso-bloq.avisa { animation: none; } }
/* incidencia n.º 133: caja del campo al que se refiere un error del servidor al grabar (p. ej. «ya existe un documento con este número»);
   también en el diseño completo, fuera de la ficha por secciones */
.falta-campo:is(input, select, textarea), .falta-campo :is(input:not([type=checkbox]):not([type=radio]), select, textarea) { border-color: var(--danger) !important; box-shadow: 0 0 0 1px var(--danger); }
.falta-campo input[type=checkbox] { outline: 2px solid var(--danger); outline-offset: 1px; }
/* incidencias n.º 136 y 137: documento en un periodo bancario conciliado (no se puede desbloquear ni borrar) */
.v2-aviso-bloq.conciliado { border-left-color: var(--danger); background: var(--warn-bg); }
.v2-aviso-bloq.conciliado .aviso-bloq-ico { background: var(--danger); }
/* incidencia n.º 137: vencimiento de factura o certificación cobrado o pagado en un periodo bancario conciliado (no se puede tocar) */
tr.vto-conc > td { background: #f1f2f4 !important; color: var(--muted); }
tr.vto-conc > td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
/* mejora n.º 142: sumas del listado (junto al número de registros) */
.list-bar .list-sumas { margin-left: 12px; color: var(--text); }
.list-bar .list-sumas b { font-variant-numeric: tabular-nums; }
/* mejora n.º 141: filtros del listado (botón «Filtros» y su panel) */
.list-bar .flt-btn { border: 1px solid var(--line); background: var(--face); border-radius: 6px; padding: 5px 10px; font-size: 12.5px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.list-bar .flt-btn.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.flt-btn .flt-n { background: var(--accent); color: #fff; border-radius: 9px; padding: 1px 6px; font-size: 11px; }
.flt-btn .flt-ar { font-size: 10px; opacity: .7; }
.flt-panel { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); padding: 8px 10px; margin: 0 0 8px; display: flex; flex-direction: column; gap: 6px; }
.flt-campos { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.flt-campo { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; padding: 3px 6px; border-radius: 6px; border: 1px solid transparent; }
.flt-campo.on { border-color: var(--accent); background: var(--accent-soft); }
.flt-campo .flt-l { color: var(--muted); font-weight: 600; }
.flt-campo input[type=date], .flt-campo select { font-size: 12.5px; padding: 2px 4px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.flt-campo input.c-field { width: 150px; height: 24px; font-size: 12.5px; }
.flt-chip { display: inline-flex; align-items: center; gap: 3px; background: #fff; border: 1px solid var(--accent); border-radius: 10px; padding: 1px 4px 1px 8px; font-size: 12px; }
.flt-chip button { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 13px; line-height: 1; }
.flt-acciones { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border-top: 1px dashed var(--line); padding-top: 6px; }
.flt-acciones select, .flt-acciones .flt-acc { font-size: 12px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--face); cursor: pointer; }
.flt-acciones .flt-acc:disabled { opacity: .5; cursor: default; }

/* ---------------------------------------------------------------- versión I desde la C (versioni.js) */
.modal.vi-modal { width: 98vw; height: 95vh; max-width: none; max-height: none; resize: both; overflow: hidden; min-width: 640px; min-height: 420px; }
.vi-body { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 10px 12px; gap: 8px; overflow: auto; }
.vi-inicio { display: flex; flex-direction: column; gap: 10px; max-width: 900px; }
.vi-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.vi-form > label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.vi-form .vi-ancho { grid-column: 1 / -1; }
.vi-ues { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.vi-ues .bw-ck { height: auto; font-size: 13px; }
.vi-uesbox { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.vi-fila { display: flex; gap: 6px; align-items: center; }
.vi-fila select { flex: 1; min-width: 0; }
.vi-body { position: relative; }
.vi-flota { position: absolute; top: 8px; right: 12px; bottom: 8px; width: min(620px, 60%); overflow: auto; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.2); padding: 8px; display: flex; flex-direction: column; gap: 4px; z-index: 5; }
.vi-retomar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.vi-aviso { background: var(--warn-bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-size: 13px; }
.vi-pie { gap: 6px; flex-wrap: wrap; }
.vi-tres { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(240px, 1fr) minmax(360px, 1.6fr) minmax(320px, 1.4fr); gap: 10px; }
.vi-col { min-height: 0; overflow: auto; border: 1px solid var(--line-soft); border-radius: 8px; padding: 8px; background: var(--panel); display: flex; flex-direction: column; gap: 6px; }
.vi-tit { display: flex; align-items: center; gap: 8px; justify-content: space-between; position: sticky; top: -8px; background: var(--panel); padding: 2px 0; z-index: 1; }
.vi-plante { font-size: 12px; color: var(--muted); white-space: pre-wrap; margin: 0; }
.vi-chat { display: flex; flex-direction: column; gap: 6px; flex: 1; min-height: 120px; overflow: auto; }
.vi-msg { border-radius: 8px; padding: 6px 8px; font-size: 13px; white-space: pre-wrap; background: var(--row-alt); }
.vi-msg small { display: block; color: var(--muted); font-size: 11px; }
.vi-msg.vi-usuario { background: var(--accent-soft); align-self: flex-end; max-width: 92%; }
.vi-msg.vi-error { border: 1px solid var(--danger); }
.vi-preg { font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.vi-ops { display: flex; flex-wrap: wrap; gap: 4px; }
.vi-envio { display: flex; flex-direction: column; gap: 4px; }
.vi-cap { border: 1px solid var(--line-soft); border-radius: 6px; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.vi-caph, .vi-uoh { display: flex; gap: 6px; align-items: center; }
.vi-caph input { flex: 1; font-weight: 600; }
.vi-uo { border-left: 3px solid transparent; padding: 4px 6px; border-radius: 4px; cursor: pointer; }
.vi-uo.sel { border-left-color: var(--accent); background: var(--row-sel); }
.vi-uoh input:first-child { flex: 1; }
.vi-ud { width: 56px; }
.vi-num { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.vi-orig { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.vi-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; background: var(--row-alt); border: 1px solid var(--line-soft); border-radius: 12px; padding: 1px 4px 1px 8px; }
.vi-chip input { width: 64px; }
.vi-cue { display: flex; flex-direction: column; gap: 2px; }
.vi-cueh { font-weight: 600; font-size: 12px; color: var(--muted); }
.vi-ccap > summary { font-weight: 600; font-size: 13px; cursor: pointer; }
.vi-cuo { margin-left: 8px; border-left: 3px solid var(--line); padding-left: 6px; }
.vi-cuo.ok { border-left-color: var(--ok); }
.vi-cuo.parte { border-left-color: #d9a400; }
.vi-cuo.no { border-left-color: var(--danger); }
.vi-cuo > summary { display: flex; gap: 6px; align-items: center; font-size: 12px; cursor: pointer; }
.vi-cod { font-variant-numeric: tabular-nums; color: var(--muted); }
.vi-nom { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vi-cdes { display: flex; gap: 6px; align-items: center; font-size: 12px; margin-left: 18px; }
.vi-cuo button, .vi-cdes button, .vi-chip button { padding: 0 6px; min-height: 0; line-height: 1.4; }
.vi-pie2 { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; border-top: 1px solid var(--line-soft); padding-top: 8px; }
.vi-resumen { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.vi-err { color: var(--danger); }
.vi-avi { color: var(--muted); }
.vi-ok { color: var(--ok); font-weight: 600; }
.vi-trab { color: var(--accent-text); }
.vi-k { width: 100%; border-collapse: collapse; font-size: 13px; }
.vi-k th, .vi-k td { padding: 5px 8px; border-bottom: 1px solid var(--line-soft); text-align: left; }
.vi-k tr.vi-cambiada td { background: var(--warn-bg); }
@media (max-width: 1000px) { .vi-tres { grid-template-columns: 1fr; } .vi-form { grid-template-columns: 1fr; } }

/* panel «Certificaciones del mes» (certmes.js, mejora n.º 145) */
.modal.cm-modal { width: min(1700px, 98vw); max-width: 98vw; }
.cm-barra { gap: 16px; align-items: center; margin-bottom: 8px; }
.cm-wrap { max-height: calc(100vh - 330px); overflow: auto; }
.cm-tbl td, .cm-tbl th { white-space: nowrap; font-size: 12.5px; }
table.dl.cm-tbl td { max-width: none; }
table.dl.cm-tbl td.cm-txt { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.cm-estado { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11.5px; font-weight: 600; background: var(--face); }
.cm-estado.cm-falta { background: var(--warn-bg); color: var(--danger); }
.cm-estado.cm-aviso { background: #fff3dc; color: #8a5a00; }
.cm-estado.cm-ok { background: #e3f4e8; color: #1f6b3a; }
.cm-informe { margin-top: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); font-size: 12.5px; max-height: 180px; overflow: auto; }
.cm-informe ul { margin: 4px 0; padding-left: 18px; }
.cm-informe .cm-mal li { color: var(--danger); }
.cm-modal .modal-f { flex-wrap: wrap; gap: 8px; align-items: center; }
table.dl.cm-tbl th.num { text-align: right; }

/* certificación: envío al cliente y aceptación, en la cabecera de la ficha (mejora n.º 145) */
.v2-cab > .cert-envio { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); border-top: 1px dashed var(--line-soft); padding-top: 6px; }
.v2-cab > .cert-envio.env { color: #8a5a00; }
.v2-cab > .cert-envio.ok { color: #1f6b3a; }
.cm-tbl td.cm-env { color: var(--muted); }

/* incidencia n.º 168: en todas las pantallas, la etiqueta de una casilla (o una opción) marcada va en negrita y en color, para que no se confunda con
   las de al lado (también si está bloqueada) */
label:has(> input[type="checkbox"]:checked), label:has(> input[type="radio"]:checked) { font-weight: 700; color: var(--accent); }
label:has(> input[type="checkbox"]:checked:disabled), label:has(> input[type="radio"]:checked:disabled) { opacity: 1; }
/* incidencia n.º 176: unidad de medida (desplegable) y descripción larga de las unidades de obra de la I */
.vi-uoh select.vi-ud { width: 92px; }
.vi-uoh select.vi-mal { border-color: var(--danger); }
.vi-con { font-weight: 700; }
.vi-desc { width: calc(100% - 24px); margin: 2px 0 0 24px; font: inherit; font-size: 12px; resize: vertical; min-height: 24px; }
/* incidencia n.º 177: lo repartido de la C, también por descompuesto, y la medición de la I */
.vi-cdes { border-left: 3px solid transparent; padding-left: 4px; }
.vi-cdes.ok { border-left-color: var(--ok); }
.vi-cdes.parte { border-left-color: #d9a400; }
.vi-cdes.no { border-left-color: var(--danger); }
/* incidencia n.º 180: lo repartido del todo, en verde (fondo, texto y el botón ✓) */
.vi-cuo.ok > summary, .vi-cdes.ok { background: color-mix(in srgb, var(--ok) 12%, transparent); border-radius: 3px; }
.vi-cuo.ok > summary .vi-nom, .vi-cuo.ok > summary .vi-num, .vi-cuo.ok > summary .vi-cod, .vi-cdes.ok .vi-nom, .vi-cdes.ok .vi-num { color: var(--ok); }
.vi-cuo.ok > summary button, .vi-cdes.ok button { background: var(--ok); border-color: var(--ok); color: #fff; }
.vi-chip .vi-suma { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.vi-chip .vi-suma input { width: auto; margin: 0; }
/* incidencias n.º 178 y 179: borradores a medias al volver a entrar */
.vi-borr { border: 1px solid var(--line-soft); border-left: 4px solid var(--accent, #d4600a); border-radius: 6px; padding: 8px 12px; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.vi-borrt { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.vi-borrn { display: flex; gap: 14px; flex-wrap: wrap; }
.vi-borrp.ok { color: var(--ok); font-weight: 600; }
.vi-borrp.parte { color: #b38600; font-weight: 600; }
.vi-borrp.no { color: var(--danger); font-weight: 600; }
.vi-borr .tb { margin-top: 4px; }
.vi-ayuda { margin: 0 0 4px 18px; padding: 0; font-size: 13px; display: flex; flex-direction: column; gap: 2px; }
.vi-donde { font-size: 11px; color: var(--muted); margin-left: 18px; }
.vi-ley { font-size: 11px; }
.vi-uoh input.vi-med { width: 84px; }
/* mejora n.º 181: pestaña «Origen en la C» / «En la I» de la unidad de obra */
.oc { display: flex; flex-direction: column; gap: 8px; }
.oc h4 { margin: 6px 0 2px; font-size: 13px; }
.oc-t tbody tr.ut-link { cursor: pointer; }
.oc-t tbody tr.ut-link:hover td { background: var(--row-alt); }
.oc-t tfoot td { font-weight: 600; border-top: 1px solid var(--line); }
.oc-k { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 13px; padding: 6px 10px; border: 1px solid var(--line-soft); border-radius: 6px; }
.oc-k.cambio { border-color: #d9a400; background: color-mix(in srgb, #d9a400 10%, transparent); }
/* n.º 180 (revisada): el centro es el árbol de la I (capítulos → unidades de obra → descompuestos) */
.vi-uoh input[data-vi] { flex: 1; min-width: 120px; }
.vi-pleg { border: 0; background: none; padding: 0 2px; min-height: 0; cursor: pointer; color: var(--muted); }
.vi-arbcod { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; white-space: nowrap; }
.vi-uo { margin-left: 14px; }
.vi-orig { margin-left: 24px; align-items: center; }
.vi-de { font-size: 11px; color: var(--muted); }
table.vi-des { margin: 4px 0 2px 24px; width: calc(100% - 24px); border-collapse: collapse; font-size: 12px; }
table.vi-des th { text-align: left; font-weight: 500; color: var(--muted); border-bottom: 1px solid var(--line-soft); padding: 1px 6px; }
table.vi-des td { padding: 1px 6px; border-bottom: 1px dotted var(--line-soft); }
table.vi-des .num { text-align: right; font-variant-numeric: tabular-nums; }
table.vi-des tfoot td { color: var(--muted); border-bottom: 0; }
.vi-cuo > summary .vi-suma { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; white-space: nowrap; color: var(--ok); cursor: pointer; }
.vi-cuo > summary .vi-suma input { margin: 0; }
/* árbol de la C con filtros (presupuestos de miles de partidas) */
.vi-filtros { display: flex; gap: 4px; margin: 4px 0; }
.vi-filtros input { flex: 1; min-width: 0; }
.vi-filtros button { padding: 0 8px; }
.vi-ccap > summary { display: flex; gap: 8px; align-items: baseline; }
.vi-ccap > summary .vi-num { margin-left: auto; font-size: 11px; color: var(--muted); font-weight: 400; }
.vi-cabc { position: sticky; top: -8px; z-index: 1; background: var(--panel, #fff); padding-bottom: 2px; }
.vi-tit .vi-releer { padding: 0 6px; min-height: 0; }
/* incidencia n.º 182: ventana a pantalla completa, paneles de ancho ajustable, recursos de la unidad de la I */
.modal.vi-modal.max { position: fixed; inset: 0; width: 100vw; height: 100vh; border-radius: 0; resize: none; }
.modal-h .vi-max { margin-left: auto; }
.vi-tres { gap: 0; }
.vi-sep { cursor: col-resize; background: transparent; border-radius: 3px; touch-action: none; }
.vi-sep:hover, .vi-sep.on, .vi-sep:focus-visible { background: var(--line); outline: none; }
@media (max-width: 1000px) { .vi-tres { grid-template-columns: 1fr !important; } .vi-sep { display: none; } }
.vi-modos { display: flex; gap: 4px; align-items: center; margin: 4px 0 0 24px; flex-wrap: wrap; }
.vi-modos button { padding: 1px 8px; min-height: 0; font-size: 12px; }
.vi-modos button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.vi-ccap > summary button { padding: 0 6px; min-height: 0; line-height: 1.4; }
/* 31/10/2026 · relación C ↔ I sin borradores: elegir la UE de la I, lo que ya está en la I y lo nuevo, cambios sin aplicar */
.vi-ueslist { display: flex; flex-direction: column; gap: 6px; }
button.vi-borr { text-align: left; cursor: pointer; background: var(--panel); }
button.vi-borr:hover { border-color: var(--accent); }
.vi-pend { color: var(--accent); font-weight: 600; }
.vi-arbcod.vi-nueva { color: var(--accent); font-style: italic; }
/* incidencia n.º 184: UE nueva aún no creada en la I (no es la I) */
.vi-sincrear { border-style: dashed !important; }
div.vi-aviso.vi-sincrear { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border: 1px dashed var(--accent); padding: 6px 8px; border-radius: 6px; }
/* 31/10/2026: botón de la C según la unidad seleccionada de la I (✓ verde = está en ella, pulsar la quita; ✓ gris = en otras; → = añadir) */
.vi-cuo > summary button.vi-bt.en, .vi-cdes button.vi-bt.en { background: var(--ok); border-color: var(--ok); color: #fff; }
.vi-cuo > summary button.vi-bt.lleno, .vi-cdes button.vi-bt.lleno, .vi-cuo.ok > summary button.vi-bt.lleno, .vi-cdes.ok button.vi-bt.lleno { background: transparent; border-color: var(--line); color: var(--muted); }
.vi-cuo.vi-ensel > summary, .vi-cdes.vi-ensel { box-shadow: inset 3px 0 0 var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
/* plegar / desplegar todo en los dos árboles */
.vi-plegar { display: inline-flex; gap: 2px; margin-left: 6px; }
.vi-plegar button { padding: 0 5px; min-height: 0; font-size: 11px; line-height: 1.5; }
/* n.º 185: Ud en caja rosa (tiene que existir), nombre en caja crema (texto libre o del diccionario), partes de la C en tabla */
.vi-uoh input.vi-ud { width: 64px; flex: none; }
input.vi-rosa { background: var(--input-req); }
input.vi-crema { background: var(--input-free); }
input.vi-mal { border-color: var(--danger); }
table.vi-detab { margin: 4px 0 2px 24px; width: calc(100% - 24px); border-collapse: collapse; font-size: 12px; }
table.vi-detab th { text-align: left; font-weight: 500; color: var(--muted); border-bottom: 1px solid var(--line-soft); padding: 1px 6px; }
table.vi-detab td { padding: 1px 6px; border-bottom: 1px dotted var(--line-soft); }
table.vi-detab .num { text-align: right; width: 80px; }
table.vi-detab input { width: 64px; text-align: right; }
table.vi-detab button { padding: 0 6px; min-height: 0; line-height: 1.3; }
/* partes de la C de la unidad de la I, plegables */
button.vi-verc { display: flex; gap: 6px; align-items: center; margin: 4px 0 0 24px; border: 0; background: none; padding: 1px 4px; font-size: 12px; color: var(--muted); cursor: pointer; }
button.vi-verc:hover { color: var(--accent); }
/* incidencia n.º 185: en la pestaña «Origen en la C» / «En la I» se desplaza la rejilla, no la pestaña: cabecera, total y K fija siempre a la vista */
.bw-pasos.entabs > .bw-paso.p5, .bw-full-pest > .bw-paso.p5 { overflow: hidden; display: flex; flex-direction: column; }
.bw-pasos.entabs > .bw-paso.p5 > .cuerpo, .bw-full-pest > .bw-paso.p5 > .cuerpo { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.bw-paso.p5 .oc { flex: 1; min-height: 0; }
.bw-paso.p5 .oc > p, .bw-paso.p5 .oc > .oc-k, .bw-paso.p5 .oc > div > h4 { flex: none; }
.bw-paso.p5 .oc > .gscroll, .bw-paso.p5 .oc > div > .gscroll { flex: 1 1 auto; min-height: 70px; overflow: auto; }
.bw-paso.p5 .oc > div:has(> .gscroll) { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.oc-t thead th { position: sticky; top: 0; z-index: 1; background: var(--panel); }
.oc-t tfoot td { position: sticky; bottom: 0; z-index: 1; background: var(--panel); }
/* n.º 214: semáforo de imputación en tiempo y forma y sus ajustes */
.pyo-tab td.pyo-imp { text-align: center; }
.ini-kpi.clic { cursor: pointer; }
.ini-kpi.clic:hover { filter: brightness(0.96); }
.pyo-aj-modal { width: min(640px, calc(100vw - 32px)); }
.pyo-aj { border-collapse: collapse; width: 100%; }
.pyo-aj th { text-align: left; font-weight: 600; padding: 6px 10px 6px 0; vertical-align: middle; white-space: nowrap; }
.pyo-aj td { padding: 6px 0; line-height: 2; }
.pyo-aj-num input { width: 5.5em; text-align: right; }
.pyo-aj select { max-width: 100%; }
/* Copias de seguridad › restaurar y subir (copias.js, 02/11/2026) */
.cop-acc button + button { margin-left: 6px; }
.cop-subidas { margin-top: 6px; }
.cop-subidas h4 { margin: 4px 0; font-size: 13px; }
.rst-aviso { padding: 8px 12px; border-radius: 6px; background: var(--warn-bg); border: 1px solid #ecd391; }
.rst-grupo { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line-soft); border-radius: 6px; padding: 8px 10px; }
.rst-grupo label { display: flex; align-items: center; gap: 6px; }
.rst-grupo label input { accent-color: var(--accent); }
/* eliminar una empresa (Usuarios y permisos › Empresas, 03/11/2026) */
button.link.usr-peligro { color: var(--danger); }
button.primary.usr-peligro-b { background: var(--danger); border-color: var(--danger); }
/* restaurar una empresa de la copia sobre otra de este equipo (03/11/2026) */
.rst-mapa { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 2px 0; }
.rst-mapa select, .rst-mapa .rst-num { height: 30px; padding: 0 6px; border: 1px solid var(--line); border-radius: 6px; }
.rst-mapa .rst-num { width: 90px; }
.rst-campo { display: flex; flex-direction: column; gap: 3px; }
.rst-campo input { height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; }
.rst-token { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rst-token img { border: 1px solid var(--line); border-radius: 6px; max-width: 100%; height: auto; background: #fafaf7; }
.rst-token-in { font: 600 16px/1 ui-monospace, Consolas, monospace; letter-spacing: .12em; text-transform: uppercase; }
.rst-err { color: var(--danger); min-height: 18px; }
.rst-barra { height: 14px; border-radius: 7px; background: var(--line-soft); overflow: hidden; }
.rst-barra > div { height: 100%; background: var(--accent); width: 0; transition: width .6s ease; }
.rst-barra.rst-ok > div { background: var(--ok); }
.rst-barra.rst-mal > div { background: var(--danger); }
.rst-paso { font-weight: 600; }
.rst-msgs { margin: 0; padding-left: 18px; max-height: 30vh; overflow: auto; font-size: 12px; }
.rst-msgs li.aviso { color: #8a5a00; }
.rst-msgs li.error { color: var(--danger); }
.rst-msgs li.ok { color: var(--ok); }

/* perfiles de margen (margenperfiles.js, margenrecursos.js) */
.mg-panel { display: flex; flex-direction: column; gap: 8px; }
.mg-intro, .mg-nota { margin: 0; max-width: 1000px; }
.mg-scroll { overflow-x: auto; max-width: 100%; }
.mg-tabla input.mg-nombre { width: 180px; text-align: left; }
.mg-tabla input.num, .mg-panel input.mg-pct { width: 64px; }
.mg-tabla th.mg-grupo { text-align: center; border-bottom: 1px solid var(--line-soft); }
.mg-tabla td.mg-sub { text-align: center; }
.mg-tabla td.mg-k { font-weight: 600; min-width: 64px; }
.mg-editor { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.mg-quitar { height: 24px; padding: 0 8px; }
.mg-panel .bw-btn.primary, .c-margencfg .bw-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.mg-panel .bw-btn.primary:disabled, .c-margencfg .bw-btn.primary:disabled { opacity: .45; }
.mg-resumen tbody th { font-weight: 400; }
.mg-kr { gap: 10px; }
.mg-kr-filtros { flex-wrap: wrap; gap: 8px; align-items: center; }
.mg-kr-filtros input[type=search] { flex: 1 1 280px; height: 30px; border: 1px solid var(--line); border-radius: 6px; padding: 0 8px; }
.mg-kr-filtros select, .mg-kr-tabla select { height: 26px; border: 1px solid var(--line); border-radius: 4px; max-width: 240px; }
.mg-kr-masivo { display: inline-flex; gap: 6px; margin-left: auto; }
.mg-kr-scroll { max-height: 60vh; overflow: auto; border: 1px solid var(--line-soft); border-radius: 6px; }
.mg-kr-tabla { width: 100%; }
.mg-kr-tabla thead th { position: sticky; top: 0; background: var(--panel); z-index: 1; }
.mg-kr-tabla tfoot th, .mg-kr-tabla tfoot td { position: sticky; bottom: 0; background: var(--panel); }
.mg-kr-tabla td { text-align: left; }
.mg-kr-tabla td.num { text-align: right; }
.mg-kr-tabla td.mg-uo, .mg-kr-tabla td.mg-rec { max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg-kr-tabla tr.mg-mano td { background: #fff8e6; }
/* mejora n.º 244: de dónde sale cada K y por qué la lleva cada recurso */
.mg-kr-expl { margin: 0; padding-left: 18px; font-size: 12px; line-height: 1.5; }
.mg-kr-expl li.muted { list-style: none; margin-left: -18px; }
.mg-kr-tabla td.mg-motivo { font-size: 12px; color: var(--muted); white-space: nowrap; }
/* mejora n.º 246: K y venta reales (con los precios de venta fijados a mano) */
.bw-ktab td.mg-real { background: #f6f8fb; }
.bw-ktab td.mg-real.dif { color: #b45309; font-weight: 600; }
.mg-fija { display: inline-block; margin-right: 4px; padding: 0 4px; border-radius: 3px; background: #eef2ff; color: #3730a3; font-size: 11px; }
.bw-grid td.bw-tark { color: var(--muted); }
.bw-grid td.bw-tark.mg { color: #b45309; font-weight: 600; }
.mg-kr-tabla input[type=checkbox], .mg-tabla input[type=checkbox] { width: auto; height: auto; }
.mg-kr-tabla thead th { text-align: left; }
@media (max-width: 700px) { .mg-kr-masivo { margin-left: 0; } .mg-kr-tabla td.mg-uo, .mg-kr-tabla td.mg-rec { max-width: 140px; } }

/* incidencias n.º 238 y 239 (05/11/2026): con poco alto (pantalla pequeña o el coeficiente K abierto encima) las secciones de la ficha de la
   unidad de obra se encogían hasta no verse (la rejilla de recursos quedaba en la cabecera). Cada sección tiene un alto mínimo y, por debajo,
   se desplaza el panel que las contiene (ficha, o cada columna de la pantalla completa) */
.bw-split:not(.bw-vertical) > .bw-detail:has(> .bw-card > .bw-pasos.entabs) { overflow-x: hidden; overflow-y: auto; }
.bw-detail > .bw-card:has(> .bw-pasos.entabs) { min-height: auto; }
.bw-detail > .bw-card > .bw-pasos.entabs { min-height: auto; }
.bw-detail > .bw-card > .bw-pasos.entabs > .bw-paso { min-height: 300px; }
.bw-full-izq, .bw-full-der { overflow-y: auto; overflow-x: hidden; }
.bw-full-izq > .bw-paso.p1, .bw-full-der > .bw-paso.p4 { flex-shrink: 0; }
.bw-full-izq > .bw-paso.p2 { flex-shrink: 1; min-height: 280px; }
.bw-full-izq > .bw-paso.p2 > .cuerpo > .bw-sub > .gscroll { min-height: 120px; }
.bw-full-pest { min-height: 240px; }

/* mejora n.º 247: precio de venta de la unidad de obra teórico (K general / K corregida) y real */
.bw-pteos { gap: 8px; flex-wrap: wrap; }
.bw-pteo { display: flex; flex-direction: column; gap: 1px; min-width: 150px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: #f8fafc; }
.bw-pteo .lbl { font-size: 11px; color: var(--muted); }
.bw-pteo b { font-size: 14px; font-variant-numeric: tabular-nums; }
.bw-pteo .k { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bw-pteo.dif b { color: #b45309; }
/* incidencia n.º 249: «por %» de CGO / OGO en su fila del coeficiente K */
.bw-ktab th .bw-ck { font-weight: 400; font-size: 11px; margin-left: 4px; white-space: nowrap; }
.bw-ktab th .bw-ck input { width: auto; height: auto; }
