: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; }
.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); }
.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); }
/* 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; }
  .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); }
.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 .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 */
.list { display: flex; flex-direction: column; height: calc(100vh - 140px - var(--top2)); 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)); 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 { border-left: 4px solid var(--ok); }
.tt tr.tt-grupo.tt-p td { 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; }
.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; }
.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; }
/* 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); }
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; }
.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; }
.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; }
.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; }
@media (max-width: 1250px) { .imp-body { grid-template-columns: 1fr 1fr; } .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; }
table.dl.cmp thead tr:nth-child(2) th { top: 23px; }
table.dl.cmp th { cursor: default; font-size: 11.5px; }
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; }
/* 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; }
.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; }
.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; }
.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 > .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; }
.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; }
.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; }
.bw-pasos.full { display: grid; grid-template-columns: minmax(460px, 1fr) minmax(560px, 1.35fr); align-items: start; gap: 12px; }
.bw-pasos.full .bw-paso { grid-column: 1; }
.bw-pasos.full .bw-paso.p3 { grid-column: 2; grid-row: 1 / span 4; position: sticky; top: 0; }
.bw-pasos.full .bw-paso.p3 .bw-meds { max-height: calc(100vh - 290px); }
@media (max-width: 1150px) { .bw-pasos.full { grid-template-columns: 1fr; } .bw-pasos.full .bw-paso.p3 { grid-column: 1; grid-row: auto; position: static; } }
.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 8px; color: var(--muted, #4b5563); }
.nec-sig { margin-top: 10px; }
.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 - 380px); 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; }
.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 */
input[placeholder="dd/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; }
.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); }
.modal.fp-modal { width: min(1800px, 99vw); max-height: 98vh; }
.fp-modal .modal-b { max-height: calc(98vh - 120px); }
.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; }
/* 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(980px, 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:last-child { white-space: normal; word-break: break-all; }
.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; }
