/* LicitAI · tema claro (fondo blanco) y oscuro (fondo negro) con los colores del logo:
   azul marino #0B2E54 y turquesa #00B0A8. Sin preferencia guardada, sigue al sistema. */
:root {
  --brand: #0b2e54;
  --teal: #00b0a8;
  --header: #ffffff;
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f0f3f7;
  --hover: #f6f8fb;
  --border: #e2e7ee;
  --border-strong: #cfd7e2;
  --text: #0e1f33;
  --muted: #5d6c7f;
  --accent: #00827b;           /* turquesa con contraste suficiente para texto */
  --accent-soft: #e2f5f3;
  --primary: #0b2e54;          /* botón principal: azul marino */
  --primary-text: #ffffff;
  --accion: #0b8f88;            /* botones de acción de la marca (Agregar, Guardar, Restaurar…) */
  --accion-fuerte: #00a39b;     /* botón Ejecutar bot ahora */
  --danger: #c0352b;
  --danger-soft: #fdeceb;
  --warn: #9a5b00;
  --warn-soft: #fff3da;
  --yellow: #e6b800;           /* grado Confiable */
  --yellow-soft: #fff4b8;
  --yellow-text: #6b5400;
  --rel: #2563eb;              /* relación presupuesto ↔ origen */
  --rel-soft: #e8f0fe;
  --rel-hover: color-mix(in srgb, var(--rel) 22%, var(--surface));   /* pestaña y cabecera del presupuesto al pasar el mouse */
  --rel-text: #1d4ed8;
  --ok: #0f7a4a;
  --ok-soft: #e1f4ea;
  --info: #0b5cad;
  --info-soft: #e5effa;
  --star: #e3a008;
  --log-bg: #0b1117;
  --log-text: #c9d4de;
  --shadow: 0 1px 2px rgba(11, 46, 84, .06), 0 1px 3px rgba(11, 46, 84, .04);
  --radius: 10px;
  --radius-sm: 7px;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #ffffff;
    --header: #000000;
    --bg: #000000;
    --surface: #0b0f14;
    --surface-2: #131a22;
    --hover: #0f151c;
    --border: #1d252f;
    --border-strong: #2a3542;
    --text: #e8eef4;
    --muted: #8796a7;
    --accent: #2fd2c8;
    --accent-soft: #052a28;
    --primary: #00b0a8;
    --primary-text: #001312;
    --danger: #ff7b70;
    --danger-soft: #2e1210;
    --warn: #f3b552;
    --warn-soft: #2b2010;
    --yellow: #ffd43b;
    --yellow-soft: #2e2700;
    --yellow-text: #ffd43b;
    --rel: #60a5fa;
    --rel-soft: #0f1d33;
    --rel-text: #93c5fd;
    --ok: #4fd18f;
    --ok-soft: #0c2618;
    --info: #6fb0f5;
    --info-soft: #0c1d31;
    --star: #f5bf2c;
    --log-bg: #05080b;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #ffffff;
  --header: #000000;
  --bg: #000000;
  --surface: #0b0f14;
  --surface-2: #131a22;
  --hover: #0f151c;
  --border: #1d252f;
  --border-strong: #2a3542;
  --text: #e8eef4;
  --muted: #8796a7;
  --accent: #2fd2c8;
  --accent-soft: #052a28;
  --primary: #00b0a8;
  --primary-text: #001312;
  --danger: #ff7b70;
  --danger-soft: #2e1210;
  --warn: #f3b552;
  --warn-soft: #2b2010;
  --yellow: #ffd43b;
  --yellow-soft: #2e2700;
  --yellow-text: #ffd43b;
  --rel: #60a5fa;
  --rel-soft: #0f1d33;
  --rel-text: #93c5fd;
  --ok: #4fd18f;
  --ok-soft: #0c2618;
  --info: #6fb0f5;
  --info-soft: #0c1d31;
  --star: #f5bf2c;
  --log-bg: #05080b;
  --shadow: none;
  color-scheme: dark;
}

/* Logo según el tema */
.logo-oscuro { display: none; }
:root[data-theme="dark"] .logo-claro { display: none; }
:root[data-theme="dark"] .logo-oscuro { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-claro { display: none; }
  :root:not([data-theme="light"]) .logo-oscuro { display: block; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
kbd { font: 600 .72rem var(--mono); padding: 1px 6px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; color: var(--muted); }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h2 { font-size: 1rem; font-weight: 650; color: var(--brand); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

/* ---------- Encabezado ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px;
  height: 56px; padding: 0 clamp(12px, 1.6vw, 32px);
  background: var(--header); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; flex: none; }
.logo { height: 30px; width: auto; }
.tabs { display: flex; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; white-space: nowrap; padding: 8px 12px; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--muted); font-weight: 550;
}
.tab { display: inline-flex; align-items: center; gap: 7px; }
.tab-ico { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.tab.active .tab-ico { stroke: var(--teal); opacity: 1; }
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.active { color: var(--brand); }
.tab { transition: color .15s, background .15s; }
.tab::after {
  content: ''; position: absolute; left: 12px; right: 12px; bottom: -9px; height: 3px;
  border-radius: 3px 3px 0 0; background: var(--teal);
  transform: scaleX(0); opacity: 0; transition: transform .25s cubic-bezier(.2, .7, .2, 1), opacity .2s;
}
.tab:hover::after { transform: scaleX(.35); opacity: .45; }
.tab.active::after { transform: scaleX(1); opacity: 1; }
.tab-ico { transition: transform .2s cubic-bezier(.3, 1.6, .5, 1), stroke .15s; }
.tab:hover .tab-ico { transform: translateY(-2px) scale(1.08); }
.tab[data-tab="config"]:hover .tab-ico { transform: rotate(60deg) scale(1.08); }
.tab:active { transform: translateY(1px); }

/* Cambio de vista y aparición de filas */
.view:not([hidden]) { animation: vistaEntra .28s cubic-bezier(.2, .7, .2, 1); }
@keyframes vistaEntra { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.fila-main { transition: background .15s; }
details > summary { transition: color .15s; }
details > summary::marker { color: var(--teal); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.tab-count {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 3px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: .7rem; font-weight: 700; text-align: center; line-height: 18px;
}
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 0; }
.run-pill {
  display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 380px;
  padding: 5px 12px; border: 1px solid var(--border); border-radius: 999px;
  color: var(--muted); text-decoration: none; font-size: .82rem;
}
.run-pill:hover { border-color: var(--border-strong); color: var(--text); }
#run-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.on { background: var(--teal); box-shadow: 0 0 0 0 var(--teal); animation: pulse 1.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(0, 176, 168, .55); } 100% { box-shadow: 0 0 0 7px rgba(0, 176, 168, 0); } }
.icon-btn {
  display: grid; place-items: center; width: 34px; height: 34px; flex: none;
  border: 1px solid var(--border); border-radius: 999px; background: transparent; color: var(--muted);
  cursor: pointer; font-size: 1rem; line-height: 1;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }

/* Ocupa todo el ancho de la ventana; el margen lateral crece con la pantalla */
main { --gutter: clamp(12px, 1.6vw, 32px); width: 100%; margin: 0; padding: 14px var(--gutter) 48px; }

/* ---------- Botones y campos ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; padding: 7px 14px; border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid var(--border-strong); border-bottom-color: color-mix(in srgb, var(--border-strong) 70%, var(--text));
  background: linear-gradient(var(--surface), var(--surface-2)); color: var(--text); text-decoration: none;
  box-shadow: 0 1px 2px rgba(11, 46, 84, .10);
  transition: background .12s, border-color .12s, filter .12s, transform .08s, box-shadow .12s;
}
.btn:hover { border-color: var(--teal); color: var(--accent); box-shadow: 0 2px 6px rgba(11, 46, 84, .14); }
.btn:active:not(:disabled) { transform: translateY(1px); box-shadow: none; }
.btn:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); box-shadow: 0 2px 6px color-mix(in srgb, var(--primary) 35%, transparent); }
.btn.primary:hover { filter: brightness(1.15); color: var(--primary-text); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 55%, transparent); background: var(--surface); }
.btn.danger:not(.ghost):hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.btn.ghost { background: transparent; border-color: color-mix(in srgb, var(--border-strong) 70%, transparent); box-shadow: none; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); border-color: var(--teal); }
.btn.ghost.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn.ghost.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn.sm { padding: 3px 9px; font-size: .8rem; border-radius: 6px; }
input, select {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 7px 10px; width: 100%;
}
input:focus, select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 22%, transparent); }
input[type=checkbox] { width: auto; accent-color: var(--teal); }
label { display: block; font-weight: 550; font-size: .85rem; }
label input, label select { margin-top: 4px; font-weight: 400; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.check input { margin: 0; }
.check.inline { align-self: end; padding-bottom: 9px; }
.hint { color: var(--muted); font-size: .8rem; font-weight: 400; display: block; margin-top: 4px; }
.muted { color: var(--muted); }
.spacer { flex: 1; }

/* ---------- Barra de filtros ---------- */
.toolbar {
  position: sticky; top: 56px; z-index: 10;
  display: grid; grid-template-columns: minmax(220px, 1fr) repeat(2, auto) auto; gap: 8px; align-items: center;
  margin: -14px calc(-1 * var(--gutter)) 0; padding: 10px var(--gutter); background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.toolbar select { width: auto; max-width: 190px; }
.search { position: relative; }
.search svg { position: absolute; left: 10px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; }
.search input { padding-left: 32px; padding-right: 34px; }
.search kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.search input:focus + kbd, .search input:not(:placeholder-shown) + kbd { display: none; }
.toggle { position: relative; display: inline-flex; font-weight: 550; }
.toggle input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.toggle span {
  padding: 7px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: linear-gradient(var(--surface), var(--surface-2)); color: var(--text); white-space: nowrap; user-select: none;
  box-shadow: 0 1px 2px rgba(11, 46, 84, .10); cursor: pointer;
}
.toggle:hover span { border-color: var(--teal); }
.toggle input:checked + span { background: color-mix(in srgb, var(--star) 16%, var(--surface)); border-color: var(--star); color: var(--text); }
.toggle input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 2px; }

/* ---------- Panel KPI ---------- */
.kpis { margin: 8px 0 10px; display: grid; gap: 8px; }
.kpi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.5fr) repeat(2, minmax(0, 1fr)); gap: 8px; }
.kpi-card {
  display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 12px; text-align: left;
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
button.kpi-card { cursor: pointer; transition: border-color .12s, transform .12s, box-shadow .12s; }
button.kpi-card:hover { border-color: var(--teal); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(11, 46, 84, .10); }
.kpi-card.activo { border-color: var(--teal); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--teal); }
.kpi-ico { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 9px; background: var(--accent-soft); color: var(--accent); }
.kpi-ico svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.kpi-card.alerta .kpi-ico { background: var(--danger-soft); color: var(--danger); }
.kpi-card.alerta b { color: var(--danger); }
.kpi-card.fav .kpi-ico { background: color-mix(in srgb, var(--star) 16%, var(--surface)); color: var(--star); }
.kpi-body { display: grid; min-width: 0; line-height: 1.2; }
.kpi-body b { font-size: 1.2rem; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-body > span { font-size: .78rem; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-body small { font-size: .7rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.kpi-conf { padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.kpi-conf-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .8rem; font-weight: 650; }
.kpi-conf-head > span { margin-right: auto; }
.kpi-conf-head small { color: var(--muted); font-weight: 400; }
.conf-bar { display: flex; height: 8px; margin: 8px 0; border-radius: 999px; overflow: hidden; background: var(--surface-2); gap: 2px; }
.seg, .sw { background: var(--muted); }
.seg.ok, .sw.ok { background: var(--ok); }
.seg.warn, .sw.warn { background: var(--warn); }
.seg.yellow, .sw.yellow { background: var(--yellow); }
.seg.danger, .sw.danger { background: var(--danger); }
.seg.info, .sw.info { background: var(--info); }
.seg.teal, .sw.teal { background: var(--teal); }
.seg.muted, .sw.muted { background: var(--border-strong); }
.conf-leyenda { display: flex; flex-wrap: wrap; gap: 6px; }
.conf-item {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; font: inherit; font-size: .76rem;
  color: var(--muted); background: var(--surface-2); border: 1px solid transparent; border-radius: 999px; cursor: pointer;
}
.conf-item b { color: var(--text); font-variant-numeric: tabular-nums; }
.conf-item:hover { border-color: var(--border-strong); color: var(--text); }
.conf-item.activo { border-color: var(--teal); background: var(--accent-soft); color: var(--text); }
.sw { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.kpi-conf-head .contador { margin-left: 0; font-weight: 400; }
/* Botón "Revisar con IA" (solo con revisiones pendientes) */
.ia-btn { align-self: center; background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 45%, transparent); color: var(--info); background: var(--info-soft); font-weight: 650; padding: 5px 10px; }
.ia-btn:hover:not(:disabled) { background: var(--info-soft); border-color: var(--info); filter: brightness(1.05); }
.ia-btn:hover:not(:disabled) { color: var(--info); }
.ia-btn:disabled { opacity: .8; cursor: progress; }
.ia-btn svg { width: 15px; height: 15px; fill: currentColor; flex: none; }
.ia-btn:disabled svg { animation: girar 1.6s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }
.ia-count { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--info); color: var(--surface); font-size: .72rem; font-weight: 700; line-height: 18px; text-align: center; }
.contador { margin-left: auto; align-self: center; padding-right: 4px; color: var(--muted); font-size: .8rem; }

/* ---------- Avisos ---------- */
.aviso-papelera {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 8px 12px; margin: 10px 0 0; border-radius: var(--radius);
  background: var(--warn-soft); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent);
}
.flash { padding: 9px 13px; border-radius: var(--radius-sm); margin-bottom: 12px; background: var(--ok-soft); color: var(--ok); }
.flash.err { background: var(--danger-soft); color: var(--danger); }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }

/* ---------- Lista compacta de licitaciones ---------- */
:root { --cols-fila: 24px 26px minmax(0, 1fr) 200px 108px 120px 140px 34px; }   /* columnas de la lista (también las usa el detalle) */
.lista-head, .fila-main {
  display: grid;
  grid-template-columns: var(--cols-fila);
  gap: 12px; align-items: center;
}
.lista-head {
  padding: 6px 12px; margin-bottom: 6px; color: var(--muted); font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.lista-head svg { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lista-head .h-star { justify-self: center; display: grid; color: var(--star); }
.lista-head .h-star svg { fill: var(--star); stroke: none; }
.lista-head button {
  all: unset; cursor: pointer; justify-self: start; display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 8px; margin-left: -8px; border-radius: 6px; transition: background .15s, color .15s;
}
.lista-head .h-lbl { justify-self: start; display: inline-flex; align-items: center; gap: 5px; padding: 4px 0; }
.lista-head button.num { justify-self: end; margin: 0 -8px 0 0; }
.lista-head button:hover { color: var(--text); background: var(--surface-2); }
.lista-head button.activo { color: var(--accent); background: var(--accent-soft); }
.lista-head .orden { display: none; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; }
.lista-head button.activo .orden { display: inline-block; }
/* ▼ descendente (de mayor a menor, más reciente primero), ▲ ascendente; .asc lo pone app.js */
.lista-head button.activo .orden { border-left-width: 5px; border-right-width: 5px; border-top-width: 6px; transition: transform .15s; }
.lista-head button.activo.asc .orden { transform: rotate(180deg); }

.lista { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.lista:empty { display: none; }
.fila { border-top: 1px solid var(--border); content-visibility: auto; contain-intrinsic-size: auto 51px; }
.fila.open { content-visibility: visible; }
.fila:first-child { border-top: none; }
.fila-main { padding: 7px 12px; cursor: pointer; min-height: 50px; }
.fila-main:hover { background: var(--hover); }
.fila.open > .fila-main { background: var(--surface-2); }
.fila.urgente > .fila-main { box-shadow: inset 3px 0 0 var(--danger); }
.fila.fav > .fila-main { box-shadow: inset 3px 0 0 var(--star); }
.star { all: unset; cursor: pointer; justify-self: center; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; color: var(--muted); transition: background .15s, transform .15s; }
.star svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; transition: fill .15s, stroke .15s, transform .2s cubic-bezier(.3, 1.6, .5, 1); }
.star:hover { background: color-mix(in srgb, var(--star) 16%, transparent); color: var(--star); }
.star:hover svg { transform: scale(1.15); }
.star.on { color: var(--star); }
.star.on svg { fill: var(--star); stroke: color-mix(in srgb, var(--star) 70%, #000); filter: drop-shadow(0 1px 2px color-mix(in srgb, var(--star) 55%, transparent)); }
.star:focus-visible { outline: 2px solid var(--teal); }
.tit { min-width: 0; }
.tit .l1 { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.lic-id { flex: none; font: 600 .76rem var(--mono); color: var(--accent); }
.nombre { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.tit .l2 { display: flex; gap: 6px; align-items: center; min-width: 0; margin-top: 1px; color: var(--muted); font-size: .78rem; }
.tit .org { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { flex: none; padding: 0 7px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: .7rem; line-height: 16px; color: var(--muted); }
.col-ppto { text-align: right; min-width: 0; }
.ppto-val { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ppto-src > * { flex-shrink: 0; }
.ppto-src { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 3px 4px; align-items: center; margin-top: 2px; font-size: .7rem; color: var(--muted); white-space: nowrap; }
.col-pub { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 1px; justify-self: center; font-variant-numeric: tabular-nums; }
.col-pub b { font-size: .84rem; font-weight: 650; white-space: nowrap; }
.col-pub small { color: var(--muted); font-size: .72rem; white-space: nowrap; }
.lista-head button[data-orden="publicacion"] { justify-self: center; margin-left: 0; }
.col-cierre, .col-estado { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.col-cierre small, .col-estado small { color: var(--muted); font-size: .72rem; white-space: nowrap; padding-left: 2px; }
/* Píldoras de igual ancho en Cierre y Estado, para que la información quede alineada */
.pill {
  display: inline-flex; align-items: center; gap: 4px; min-width: 76px; padding: 1px 8px 1px 6px; border-radius: 999px;
  font-size: .74rem; font-weight: 700; white-space: nowrap; background: var(--surface-2); color: var(--muted);
}
.pill svg { width: 13px; height: 13px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.info { background: var(--info-soft); color: var(--info); }
.col-estado .pill { min-width: 96px; }
.docs-prog { display: inline-flex; align-items: center; gap: 6px; }
.prog { width: 44px; height: 5px; border-radius: 999px; background: var(--border); overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--info); border-radius: inherit; }
.prog.lleno i { background: var(--ok); }
/* Indicador de fila desplegable: flecha a la izquierda que gira al abrir */
.chev {
  display: grid; place-items: center; width: 22px; height: 22px; justify-self: center; border-radius: 6px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted);
  transition: transform .15s, color .12s, border-color .12s, background .12s;
}
.chev svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.fila-main:hover .chev { color: var(--accent); border-color: var(--teal); }
.fila.open .chev { transform: rotate(90deg); color: var(--primary-text); background: var(--teal); border-color: var(--teal); }

.badge {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%;
  font-size: .72rem; font-weight: 650; line-height: 18px; padding: 0 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.yellow { background: var(--yellow-soft); color: var(--yellow-text); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.teal { background: var(--accent-soft); color: var(--accent); }

/* Detalle desplegado */
.fila-det {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 14px;
  padding: 4px 12px 14px 54px; background: var(--surface-2);
}
.det-col { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.det-desc { margin: 0; color: var(--text); }
.det-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; margin: 0; }
.det-meta dt { color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; }
.det-meta dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; }
.det-links { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.caja { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.caja > h4 { padding: 8px 12px 0; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

.ppto-box { padding: 4px 12px 10px; }
.ppto-box p { margin: 4px 0; }
.ppto-box blockquote { margin: 8px 0; padding: 7px 11px; line-height: 1.5; border-left: 3px solid var(--rel); background: var(--surface-2); font-size: .82rem; color: var(--muted); border-radius: 0 4px 4px 0; }
.ppto-box details { margin: 6px 0; }
.ppto-box summary { cursor: pointer; color: var(--accent); font-size: .82rem; }
.cand { display: flex; gap: 10px; justify-content: space-between; align-items: flex-start; padding: 6px 0; border-top: 1px solid var(--border); }
.cand .hint { margin: 0; overflow-wrap: anywhere; }
.ppto-edit { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.ppto-edit input { flex: 1; min-width: 150px; width: auto; padding: 4px 8px; }
.ppto-edit select { width: auto; padding: 4px 8px; }

/* Ficha y Documentos: mismo marco que la descripción del proyecto, igual altura (llegan al fondo de su columna)
   y el título fijo arriba; solo la lista de adentro hace scroll */
.detalle, .docs {
  position: relative; flex: 1 1 auto; height: 0; min-height: 240px; display: flex; flex-direction: column; overflow: hidden;
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.detalle::before, .docs::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; z-index: 1; background: linear-gradient(var(--teal), var(--brand)); }
.caja:is(.detalle, .docs) > h4 {
  flex: none; margin: 0; padding: 12px 14px 8px; border-bottom: 1px solid var(--border);
  font-size: .68rem; font-weight: 700; letter-spacing: .06em; color: var(--accent);
}
.caja-scroll { position: relative; flex: 1 1 auto; min-height: 0; overflow: auto; }
.doc { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 14px; border-top: 1px solid var(--border); }
.docs .caja-scroll > .doc:first-child { border-top: none; }
.ext { font: 700 .62rem var(--mono); text-transform: uppercase; text-align: center; padding: 3px 0; border-radius: 4px; background: var(--info-soft); color: var(--info); }
.ext.pdf { background: var(--danger-soft); color: var(--danger); }
.ext.xls, .ext.xlsx { background: var(--ok-soft); color: var(--ok); }
.ext.zip, .ext.rar { background: var(--warn-soft); color: var(--warn); }
.doc-name { font-weight: 550; overflow-wrap: anywhere; font-size: .85rem; }
.doc-sub { color: var(--muted); font-size: .74rem; }
.doc-links { display: flex; gap: 4px; }
.doc-err { color: var(--danger); font-size: .78rem; margin: 0; }

.detalle table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.detalle td { padding: 4px 14px; border-top: 1px solid var(--border); vertical-align: top; }
.detalle td:first-child { color: var(--muted); width: 40%; }
.detalle tr:first-child td { border-top: none; }

.mas { display: flex; justify-content: center; padding: 12px; }

/* ---------- Paneles (Buscador, Papelera, Configuración) ---------- */
.view:not(#view-licitaciones) { padding-top: 4px; }
.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.panel > .hint:first-of-type { margin-bottom: 6px; }
.panel > label { margin-top: 10px; }
.grid2, .grid3 { display: grid; gap: 10px 14px; margin-top: 10px; }
.grid2 { grid-template-columns: 1fr 1fr; }
.grid3 { grid-template-columns: repeat(3, 1fr); }
.grid2 > *, .grid3 > * { min-width: 0; }
.actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.actions.tight { margin-top: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: .8rem; padding: 1px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.chip button { background: none; border: none; color: inherit; opacity: .7; cursor: pointer; padding: 0 0 0 4px; font-size: .95rem; }
.chips-input {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 5px 8px; background: var(--surface);
}
.chips-input:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 22%, transparent); }
.chips-input input { border: none; flex: 1; min-width: 200px; padding: 3px; box-shadow: none; }
.chips-input .chip { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: 600; }
.drive-status { padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface-2); margin: 6px 0 8px; }
.drive-status.ok { background: var(--ok-soft); color: var(--ok); }
.howto { margin: 8px 0; }
.howto summary { cursor: pointer; color: var(--accent); font-weight: 550; }
.howto ol { padding-left: 20px; color: var(--muted); }
.livelog {
  margin: 0; max-height: 280px; overflow: auto; padding: 10px 12px;
  background: var(--log-bg); color: var(--log-text); border-radius: var(--radius-sm); border: 1px solid var(--border);
  font: 12px/1.5 var(--mono); white-space: pre-wrap;
}
.livelog.panel-log { margin-top: 8px; max-height: 420px; }
.log-row td { padding: 0 10px 10px; white-space: normal; }
.log-row .livelog { overflow-wrap: anywhere; }
.dic-form { display: flex; gap: 8px; margin: 10px 0; }
.dic-form input { flex: 1; min-width: 0; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.table th, .table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th { color: var(--muted); font-weight: 650; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.table tbody tr:hover { background: var(--hover); }
#tabla-dic td:first-child { white-space: normal; font-weight: 550; }
#tabla-ejecuciones td:nth-child(5) { white-space: normal; min-width: 240px; }
#tabla-papelera input[type=checkbox] { margin: 0; }
#tabla-papelera .org { color: var(--muted); font-size: .78rem; }
#tabla-papelera .star-on { color: var(--star); }
@media (min-width: 821px) { #tabla-papelera td:nth-child(2) { white-space: normal; min-width: 260px; } }

/* ---------- Pantallas medianas ---------- */
@media (max-width: 1080px) {
  .lista-head, .fila-main { grid-template-columns: 24px 26px minmax(0, 1fr) 210px 112px 34px; }
  .col-estado, .lista-head button[data-orden="docs"], .col-pub, .lista-head button[data-orden="publicacion"] { display: none; }
  .run-pill { max-width: 240px; }
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Teléfonos ---------- */
@media (max-width: 820px) {
  .topbar { height: auto; flex-wrap: wrap; gap: 4px 10px; padding: 8px 12px 0; }
  .logo { height: 26px; }
  .tabs { order: 3; width: 100%; padding-bottom: 6px; }
  .tab::after { bottom: -6px; }
  .run-pill { max-width: 150px; padding: 4px 10px; }
  main { --gutter: 12px; padding: 10px 12px 40px; }
  .toolbar { position: static; margin: -10px calc(-1 * var(--gutter)) 0; padding: 10px var(--gutter); grid-template-columns: 1fr 1fr; }
  .toolbar .search { grid-column: 1 / -1; }
  .toolbar select { width: 100%; max-width: none; }
  .search kbd { display: none; }
  .lista-head { display: none; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-card.ancha { grid-column: span 2; order: -1; }
  .kpi-card:last-child { grid-column: span 2; }
  .kpi-card { padding: 8px 10px; gap: 8px; }
  .kpi-ico { width: 30px; height: 30px; }
  .kpi-body b { font-size: 1.05rem; }
  .fila-main { grid-template-columns: 22px 22px minmax(0, 1fr) auto; grid-template-areas: 'chev star tit del' '. . ppto cierre'; gap: 4px 6px; padding: 8px 10px; }
  .fila-main .fila-del { grid-area: del; align-self: start; }
  .fila-main .star { grid-area: star; align-self: start; }
  .fila-main .tit { grid-area: tit; }
  .fila-main .col-ppto { grid-area: ppto; text-align: left; display: flex; gap: 6px; align-items: baseline; }
  .fila-main .ppto-src { justify-content: flex-start; }
  .fila-main .col-cierre { grid-area: cierre; align-items: flex-end; }
  .fila-main .chev { grid-area: chev; align-self: start; width: 20px; height: 20px; }
  .nombre { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .tit .l1 { flex-direction: column; gap: 0; }
  .fila-det { grid-template-columns: 1fr; padding: 4px 10px 12px; }
  .detalle, .docs { height: auto; max-height: 320px; min-height: 0; }
  .det-meta { grid-template-columns: 1fr 1fr; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .doc { grid-template-columns: 34px minmax(0, 1fr); }
  .doc-links { grid-column: 2; }

  /* Papelera: cada licitación como tarjeta */
  #tabla-papelera, #tabla-papelera tbody, #tabla-papelera td, #tabla-papelera thead, #tabla-papelera thead tr { display: block; }
  #tabla-papelera thead th:not(:first-child) { display: none; }
  #tabla-papelera thead th:first-child { display: flex; align-items: center; padding: 8px 0; }
  #tabla-papelera thead th:first-child::after { content: 'Seleccionar todas'; margin-left: 8px; font-weight: 500; text-transform: none; letter-spacing: 0; font-size: .82rem; }
  #tabla-papelera tbody tr { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
  #tabla-papelera tbody td { padding: 0; border: none; white-space: normal; min-width: 0; }
  #tabla-papelera tbody td:first-child { grid-row: span 7; }
  #tabla-papelera tbody td:nth-child(n+4) { font-size: .8rem; color: var(--muted); }
  #tabla-papelera tbody td:nth-child(4)::before { content: 'Cierre: '; }
  #tabla-papelera tbody td:nth-child(5)::before { content: 'Presupuesto: '; }
  #tabla-papelera tbody td:nth-child(6)::before { content: 'Documentos: '; }
  #tabla-papelera tbody td:nth-child(7)::before { content: 'En papelera desde: '; }
  #tabla-papelera tbody td.pap-acc { text-align: left; margin-top: 4px; }
  #tabla-papelera tbody td[colspan] { grid-column: 1 / -1; }

  /* Diccionario */
  #tabla-dic :is(th, td):is(:nth-child(3), :nth-child(5)) { display: none; }
  #tabla-dic :is(th, td) { padding: 7px 5px; }

  /* Historial: cada ejecución como tarjeta */
  #tabla-ejecuciones, #tabla-ejecuciones tbody, #tabla-ejecuciones td { display: block; }
  #tabla-ejecuciones thead { display: none; }
  #tabla-ejecuciones tr:not(.log-row) { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
  #tabla-ejecuciones tr:not(.log-row) > td { padding: 0; border: none; white-space: normal; min-width: 0; }
  #tabla-ejecuciones tr:not(.log-row) > :is(:nth-child(1), :nth-child(3)) { display: none; }
  #tabla-ejecuciones tr:not(.log-row) > :is(:nth-child(5), :nth-child(6)) { grid-column: 1 / -1; }
  #tabla-ejecuciones tr.log-row { display: block; }
  #tabla-ejecuciones tr.log-row > td { padding: 0 0 10px; }
}
@media (max-width: 480px) {
  .run-pill #run-text { display: none; }
  .run-pill { padding: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Conexión entre el presupuesto y su origen ---------- */
.col-ppto[data-act] { cursor: pointer; border-radius: 6px; margin: -3px -6px; padding: 3px 6px; transition: background .15s; }
.col-ppto[data-act]:hover .ppto-val { color: var(--rel-text); text-decoration: underline dotted; text-underline-offset: 3px; }
.link-fuente { cursor: pointer; color: var(--rel-text); text-decoration: underline dotted; text-underline-offset: 3px; overflow-wrap: anywhere; }
.link-fuente:hover { text-decoration-style: solid; }
.link-fuente:focus-visible { outline: 2px solid var(--rel); border-radius: 3px; }
.doc.es-fuente { background: var(--rel-soft); box-shadow: inset 3px 0 0 var(--rel); }
tr.es-fuente td { background: var(--rel-soft); }
tr.es-fuente td:first-child { box-shadow: inset 3px 0 0 var(--rel); color: var(--text); font-weight: 600; }
.fuente-tag {
  display: inline-block; margin-top: 2px; padding: 0 6px; border-radius: 999px; font-size: .68rem; font-weight: 700;
  background: var(--rel); color: var(--surface); letter-spacing: .01em; white-space: nowrap;
}
.resalta { animation: resalta 1.6s ease-out; }
@keyframes resalta {
  0%, 30% { box-shadow: 0 0 0 3px var(--rel), 0 0 18px color-mix(in srgb, var(--rel) 45%, transparent); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.doc.es-fuente.resalta, tr.es-fuente.resalta td { animation: resaltaFondo 1.6s ease-out; }
@keyframes resaltaFondo { 0%, 35% { background: color-mix(in srgb, var(--rel) 30%, var(--surface)); } }

/* ---------- Submódulo de presupuesto (se despliega desde el monto de la cabecera) ---------- */
.ppto-caja.sub { overflow: hidden; border-color: color-mix(in srgb, var(--rel) 55%, var(--border)); }
.sub-head {
  display: flex; align-items: flex-start; gap: 9px; padding: 9px 12px; cursor: pointer;
  background: var(--rel-soft); border-bottom: 1px solid color-mix(in srgb, var(--rel) 35%, transparent);
  transition: background .15s;
}
.sub-head:hover, .col-ppto[data-act]:hover { background: var(--rel-hover); }
.sub-head:focus-visible { outline: 2px solid var(--rel); outline-offset: -2px; }
.ppto-caja.plegado .sub-head { border-bottom-color: transparent; }
.sub-tit { min-width: 0; flex: 1; display: grid; gap: 3px; line-height: 1.4; }
.sub-linea { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.sub-monto { font-size: 1.02rem; font-variant-numeric: tabular-nums; }
.sub-origen { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; font-size: .84rem; color: var(--muted); min-width: 0; }
.sub-origen .sub-ico { width: 15px; height: 15px; flex: none; fill: none; stroke: var(--rel-text); stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.sub-fuente { font-weight: 650; color: var(--text); }
.sub-sep { color: var(--muted); }
.chip-iva { padding: 0 7px; border-radius: 999px; font-size: .72rem; font-weight: 650; line-height: 1.6; color: var(--rel-text); background: var(--surface); border: 1px solid color-mix(in srgb, var(--rel) 35%, transparent); }
.ppto-ficha { display: grid; gap: 6px; margin: 8px 0; padding: 8px 11px; border-left: 3px solid var(--rel); background: var(--surface-2); border-radius: 0 4px 4px 0; font-size: .82rem; }
.ppto-ficha > div { display: grid; grid-template-columns: minmax(120px, 34%) minmax(0, 1fr); gap: 10px; align-items: baseline; }
.ppto-ficha dt { color: var(--muted); }
.ppto-ficha dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.ppto-ficha b { font-variant-numeric: tabular-nums; }
.ppto-nota { display: flex; gap: 7px; align-items: flex-start; padding: 6px 10px; border-radius: 6px; background: var(--warn-soft); color: var(--warn); font-size: .8rem; line-height: 1.4; }
.ppto-nota svg { width: 15px; height: 15px; flex: none; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.ppto-cita mark { background: color-mix(in srgb, var(--rel) 22%, transparent); color: var(--text); font-weight: 700; padding: 0 2px; border-radius: 3px; }
.sub-tit small { display: block; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--rel-text); }
.sub-chev {
  display: grid; place-items: center; width: 20px; height: 20px; margin-top: 2px; flex: none; border-radius: 5px;
  background: var(--rel); color: var(--surface); transform: rotate(90deg); transition: transform .2s;
}
.sub-chev svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.ppto-caja.plegado .sub-chev { transform: none; background: var(--surface); color: var(--rel-text); box-shadow: inset 0 0 0 1px var(--rel); }

/* El monto de la cabecera queda "unido" al submódulo cuando la fila está abierta */
.fila.open .col-ppto[data-act] { background: var(--rel-soft); box-shadow: inset 0 0 0 1.5px var(--rel); position: relative; }
.fila.open .col-ppto[data-act]::after {   /* pantallas medianas; en las grandes el monto es una pestaña */
  /* Flecha azul que une el monto de la cabecera con el submódulo Presupuesto */
  content: ''; position: absolute; z-index: 2; left: 50%; bottom: -22px; transform: translateX(-50%);
  width: 28px; height: 24px; background: var(--rel);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 24'%3E%3Cpath d='M8.5 0h11v11H28L14 24 0 11h8.5z'/%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 2px 2px color-mix(in srgb, var(--rel) 35%, transparent));
}

/* ---------- Botones de acción homologados (documentos y detalle) ----------
   Cada uno define su color con --c: fondo suave de ese color, borde y texto; al pasar el mouse se rellena. */
.accion {
  --c: var(--teal);
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 9px 0 6px;
  font: inherit; font-size: .76rem; font-weight: 700; text-decoration: none; white-space: nowrap; cursor: pointer;
  color: color-mix(in srgb, var(--c) 82%, var(--text));
  background: color-mix(in srgb, var(--c) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); border-radius: 7px;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--c) 25%, transparent);
  transition: background .15s, color .15s, transform .12s, box-shadow .15s, border-color .15s;
}
.accion:hover { background: var(--c); border-color: var(--c); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px color-mix(in srgb, var(--c) 40%, transparent); }
.accion:active { transform: translateY(0); box-shadow: none; }
.accion:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }
.accion:disabled { opacity: .55; cursor: progress; transform: none; }
.accion svg { width: 17px; height: 17px; flex: none; transition: transform .2s cubic-bezier(.3, 1.6, .5, 1); }
.accion:hover svg { transform: scale(1.12) rotate(-4deg); }
.accion .ico-linea { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.doc-links { gap: 5px; }
.doc-links .accion { min-width: 0; }
@media (max-width: 820px) { .accion { height: 28px; } }
.ext-ico { display: grid; place-items: center; }
.ext-ico svg { width: 30px; height: 30px; }
.ppto-edit .accion { height: 32px; }

/* ---------- Buscador ---------- */
.bus-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.bus-panel { margin-bottom: 12px; }
.bus-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 4px; }
.bus-head .hint { margin-top: 2px; }
.bus-ico {
  display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent);
}
.bus-ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bus-sec { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
.bus-sec-tit { display: flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.bus-sec .grid2 { margin-top: 8px; }
.kw-count { min-width: 18px; padding: 0 6px; border-radius: 999px; background: var(--teal); color: #fff; font-size: .68rem; line-height: 17px; text-align: center; letter-spacing: 0; }
.kw-count:empty { display: none; }
.chips-input { padding: 6px 6px 6px 8px; }
.chips-input .chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 9px; font-size: .82rem; animation: chipEntra .2s ease-out; }
.chips-input .chip svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.chips-input .chip button { display: grid; place-items: center; width: 18px; height: 18px; padding: 0; border-radius: 50%; font-size: .9rem; line-height: 1; }
/* Cada palabra con el color de su pestaña en Licitaciones */
.chips-input .chip[style*="--kc"] {
  background: color-mix(in srgb, var(--kc) 14%, var(--surface)); border-color: color-mix(in srgb, var(--kc) 45%, transparent);
  color: color-mix(in srgb, var(--kc) 75%, var(--text));
}
.chips-input .chip button:hover { background: var(--danger); color: #fff; opacity: 1; }
@keyframes chipEntra { from { transform: scale(.8); opacity: 0; } }
.chips-input input { min-width: 160px; }

/* Campo numérico con unidad */
.campo { position: relative; display: block; }
.campo input { padding-right: 52px; }
.campo i { position: absolute; right: 10px; top: calc(50% + 2px); transform: translateY(-50%); font-style: normal; font-size: .75rem; color: var(--muted); pointer-events: none; }
label small.hint { margin-top: 3px; }

/* Interruptores */
.switch { display: flex; align-items: center; gap: 10px; margin-top: 10px; cursor: pointer; font-weight: 400; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sw-track { position: relative; width: 38px; height: 22px; flex: none; border-radius: 999px; background: var(--border-strong); transition: background .2s; }
.sw-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s cubic-bezier(.3, 1.4, .5, 1); }
.switch input:checked + .sw-track { background: var(--teal); }
.switch input:checked + .sw-track::after { transform: translateX(16px); }
.switch input:focus-visible + .sw-track { outline: 2px solid var(--teal); outline-offset: 2px; }
.switch b { display: block; font-weight: 600; font-size: .86rem; }
.switch small { display: block; color: var(--muted); font-size: .76rem; }

.accion.grande { height: 38px; padding: 0 16px 0 12px; font-size: .88rem; border-radius: 9px; }
.accion.grande svg { width: 18px; height: 18px; }
.accion.activo { background: var(--c); color: #fff; border-color: var(--c); }

/* Panel de ejecución */
.run-panel { position: relative; }
.run-estado { display: flex; align-items: center; gap: 7px; margin: 3px 0 0; font-size: .82rem; color: var(--muted); }
.run-ico { background: color-mix(in srgb, var(--teal) 16%, var(--surface)); color: var(--teal); }
.run-ico svg { fill: currentColor; stroke: none; }
.run-panel.corriendo .run-ico { animation: latido 1.4s ease-in-out infinite; }
@keyframes latido { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--teal) 18%, transparent); } }
.run-acciones { display: flex; gap: 8px; margin: 12px 0 10px; }
.run-acciones .accion { flex: 1; justify-content: center; }
.run-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 6px; margin-bottom: 10px; }
.run-stats:empty { display: none; }
.rs { padding: 7px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); }
.rs b { display: block; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.rs span { font-size: .72rem; color: var(--muted); }
.rs.mal b { color: var(--danger); }
.rs.aviso b { color: var(--warn); }
.log-head { display: flex; justify-content: space-between; align-items: baseline; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.log-head .hint { text-transform: none; letter-spacing: 0; font-weight: 400; margin: 0; }
.run-panel .livelog.panel-log { margin-top: 6px; height: 330px; max-height: none; }

/* Historial */
.table.hist td { vertical-align: middle; }
.h-num { color: var(--muted); font-variant-numeric: tabular-nums; }
.badge.est { display: inline-flex; align-items: center; gap: 4px; }
.badge.est svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.res-wrap { display: flex; flex-wrap: wrap; gap: 4px; }
.res-chip { display: inline-flex; gap: 3px; padding: 1px 8px; border-radius: 999px; font-size: .76rem; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.res-chip b { color: var(--text); }
.res-chip.mal { background: var(--danger-soft); color: var(--danger); }
.res-chip.mal b { color: var(--danger); }
.res-chip.aviso { background: var(--warn-soft); color: var(--warn); }
.res-chip.aviso b { color: var(--warn); }
.res-err { color: var(--danger); font-size: .8rem; }

@media (max-width: 1080px) {
  .bus-grid { grid-template-columns: 1fr; }
  .run-panel { position: static; }
  .run-panel .livelog.panel-log { height: 260px; }
}

.accion.solido { background: var(--c); border-color: var(--c); color: #fff; box-shadow: 0 3px 10px color-mix(in srgb, var(--c) 35%, transparent); }
.accion.solido:hover { filter: brightness(1.1); }
:root[data-theme="dark"] .accion.solido[style*="--primary"] { color: var(--primary-text); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .accion.solido[style*="--primary"] { color: var(--primary-text); } }
.campo i { font-weight: 500; }
#run-stats-tit { margin-bottom: 6px; }
@media (max-width: 1080px) { .run-panel { order: -1; } }
#run-stats-tit[hidden] { display: none; }

/* Pantallas anchas: columnas de la lista más holgadas */
@media (min-width: 1700px) {
  :root { --cols-fila: 24px 26px minmax(0, 1fr) 210px 124px 140px 170px 34px; }
}

/* ---------- Marco del proyecto (descripción y fechas) ---------- */
.proyecto {
  position: relative; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.proyecto::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: linear-gradient(var(--teal), var(--brand)); }
.proy-tit { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin-bottom: 4px; }
.proyecto .det-desc { font-size: .8rem; line-height: 1.5; }
.fechas { display: grid; grid-template-columns: auto minmax(60px, 1fr) auto; align-items: center; gap: 10px; margin: 12px 0; padding: 10px; border-radius: 9px; background: var(--surface-2); }
.fecha { display: flex; align-items: center; gap: 9px; min-width: 0; }
.fecha small { display: block; font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.fecha b { display: block; font-size: .9rem; font-weight: 700; white-space: nowrap; }
.fecha span:not(.f-ico) { display: block; font-size: .72rem; color: var(--muted); white-space: nowrap; }
.fecha.cie { text-align: right; flex-direction: row-reverse; }
.f-ico { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.f-ico svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fecha.cie .f-ico { background: var(--ok-soft); color: var(--ok); }
.fecha.cie.warn .f-ico { background: var(--warn-soft); color: var(--warn); }
.fecha.cie.danger .f-ico { background: var(--danger-soft); color: var(--danger); }
.fecha.cie.danger b { color: var(--danger); }
.f-linea { display: grid; justify-items: center; gap: 6px; min-width: 0; }
.f-barra { width: 100%; height: 6px; border-radius: 999px; background: var(--border); overflow: hidden; }
.f-barra i { display: block; height: 100%; border-radius: inherit; background: var(--ok); transition: width .6s ease; }
.f-barra.warn i { background: var(--warn); }
.f-barra.danger i { background: var(--danger); }
.proyecto .det-meta { padding-top: 8px; border-top: 1px dashed var(--border); }
.proyecto .det-meta dd { font-size: .8rem; }
.proyecto .det-meta dt { font-size: .66rem; }
.f-ico { width: 32px; height: 32px; }
.f-ico svg { width: 17px; height: 17px; }
.fechas { margin: 10px 0; padding: 8px 10px; }
/* Según el ancho del propio marco (columna del detalle), no de la ventana */
.proyecto { container-type: inline-size; }
@container (max-width: 470px) {
  .fechas { grid-template-columns: 1fr; gap: 8px; }
  .fecha.cie { flex-direction: row; text-align: left; }
}

/* Fila desplegada: un tono más oscuro y un borde turquesa agrupan la cabecera con todo su detalle */
:root { --abierta: color-mix(in srgb, var(--brand) 7%, var(--surface-2)); }
:root[data-theme="dark"] { --abierta: color-mix(in srgb, #ffffff 5%, var(--surface)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --abierta: color-mix(in srgb, #ffffff 5%, var(--surface)); } }
.fila { transition: background .2s, box-shadow .2s; }
.fila.open { position: relative; z-index: 1; background: var(--abierta); box-shadow: inset 3px 0 0 var(--teal), 0 0 0 1px color-mix(in srgb, var(--teal) 40%, transparent), 0 6px 18px rgba(11, 46, 84, .12); }
.fila.open > .fila-main, .fila.open > .fila-det { background: transparent; }
.fila.open + .fila { border-top-color: transparent; }

/* Cierre: la fecha queda alineada a la derecha, bajo el borde derecho de la píldora */
.fila-main .col-cierre { align-items: flex-end; width: max-content; max-width: 100%; }
.fila-main .col-cierre small { padding: 0 2px 0 0; }
@media (max-width: 820px) { .fila-main .col-cierre { justify-self: end; } }
/* Cierre centrado en su columna (y su título), separado del presupuesto */
@media (min-width: 821px) {
  .fila-main .col-cierre { justify-self: center; }
  .lista-head button[data-orden="cierre"] { justify-self: center; margin-left: 0; }
}

/* ---------- Bot del encabezado: gris y durmiendo (zZz) cuando está detenido, verde con luz cuando trabaja ---------- */
.run-pill { padding: 3px 12px 3px 6px; }
.bot { position: relative; display: grid; place-items: center; width: 26px; height: 26px; flex: none; color: #8a96a6; transition: color .3s; }
.bot svg { width: 26px; height: 26px; overflow: visible; }
.bot-cuerpo { fill: currentColor; }
.bot-visor { fill: var(--surface); }
.bot-luz { fill: currentColor; transition: fill .3s; }
.ojos-cerrados path { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.ojos-abiertos { display: none; }
.zzz { position: absolute; left: 19px; top: -9px; pointer-events: none; font: 800 9px/1 system-ui, sans-serif; color: #8a96a6; }
.zzz i { position: absolute; font-style: normal; opacity: 0; animation: zzz 3s ease-in-out infinite; }
.zzz i:nth-child(1) { left: 0; top: 10px; font-size: 7px; }
.zzz i:nth-child(2) { left: 5px; top: 4px; font-size: 9px; animation-delay: 1s; }
.zzz i:nth-child(3) { left: 11px; top: -2px; font-size: 7px; animation-delay: 2s; }
@keyframes zzz { 0% { opacity: 0; transform: translate(0, 4px) scale(.7); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(4px, -6px) scale(1.1); } }
.bot { animation: respira 3.5s ease-in-out infinite; }
@keyframes respira { 50% { transform: translateY(1px) rotate(-3deg); } }

.bot.on { color: #16a34a; animation: none; }
.bot.on .ojos-abiertos { display: inline; }
.bot.on .ojos-cerrados, .bot.on .zzz { display: none; }
.bot.on .bot-luz { fill: #4ade80; animation: luzBot 1s ease-in-out infinite; }
.bot.on .ojos-abiertos { animation: mirar 2.4s ease-in-out infinite; }
@keyframes luzBot { 0%, 100% { filter: drop-shadow(0 0 1px #4ade80); opacity: 1; } 50% { filter: drop-shadow(0 0 5px #22c55e) drop-shadow(0 0 2px #4ade80); opacity: .65; } }
@keyframes mirar { 0%, 100% { transform: translateX(0); } 30% { transform: translateX(-1.5px); } 65% { transform: translateX(1.5px); } }
.run-pill:has(.bot.on) { border-color: color-mix(in srgb, #16a34a 50%, var(--border)); color: #16a34a; background: color-mix(in srgb, #16a34a 8%, var(--surface)); }
@media (prefers-reduced-motion: reduce) { .zzz { display: none; } }

/* ---------- Pestañas de búsqueda (una por palabra clave, cada una con su color) ---------- */
/* La barra de pestañas se monta 2px sobre el borde del marco: así la pestaña activa lo tapa (sin línea que la cruce) */
.busq-tabs { display: flex; align-items: flex-end; gap: 4px; margin: 0; padding: 4px 0 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; position: relative; z-index: 2; }
.busq-tabs:empty { display: none; }
.btab {
  --tc: var(--teal);
  position: relative; display: flex; align-items: stretch; flex: none; border-radius: 10px 10px 0 0;
  background: color-mix(in srgb, var(--tc) 7%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--tc) 22%, var(--border)); border-bottom: none;
  box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--tc) 45%, transparent);
  transition: background .15s, box-shadow .15s, transform .15s;
}
.btab:hover { background: color-mix(in srgb, var(--tc) 13%, var(--surface)); }
.btab.activa { background: color-mix(in srgb, var(--tc) 16%, var(--surface)); box-shadow: inset 0 -3px 0 var(--tc), 0 -2px 8px color-mix(in srgb, var(--tc) 18%, transparent); }
.btab-main { all: unset; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 7px 8px 9px 10px; }
.btab-main:focus-visible { outline: 2px solid var(--tc); outline-offset: -2px; border-radius: 8px; }
.btab-ico { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: color-mix(in srgb, var(--tc) 18%, var(--surface)); color: var(--tc); transition: background .15s, color .15s; }
.btab-ico svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.btab.activa .btab-ico { background: var(--tc); color: #fff; box-shadow: 0 2px 6px color-mix(in srgb, var(--tc) 45%, transparent); }
.btab-txt { display: grid; line-height: 1.2; }
.btab-txt b { display: flex; align-items: center; gap: 6px; font-size: .86rem; font-weight: 700; color: var(--text); text-transform: capitalize; }
.btab.activa .btab-txt b { color: color-mix(in srgb, var(--tc) 75%, var(--text)); }
.btab-txt em { font-style: normal; font-size: .68rem; font-weight: 700; min-width: 18px; padding: 0 6px; border-radius: 999px; text-align: center; line-height: 16px; background: color-mix(in srgb, var(--tc) 20%, var(--surface)); color: color-mix(in srgb, var(--tc) 80%, var(--text)); }
.btab-txt small { font-size: .68rem; color: var(--muted); white-space: nowrap; }
.btab.inactiva .btab-txt b { font-style: italic; opacity: .8; }
.btab-x {
  all: unset; cursor: pointer; align-self: center; display: grid; place-items: center; width: 20px; height: 20px; margin-right: 6px;
  border-radius: 6px; font-size: 1rem; line-height: 1; color: var(--muted); opacity: .55; transition: background .15s, color .15s, opacity .15s;
}
.btab:hover .btab-x, .btab.activa .btab-x { opacity: 1; }
.btab-x:hover { background: var(--danger); color: #fff; }
.btab-x:focus-visible { outline: 2px solid var(--danger); opacity: 1; }

/* ---------- Mensaje emergente ---------- */
.dlg { border: none; padding: 0; border-radius: 14px; width: min(440px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
.dlg::backdrop { background: rgba(8, 15, 25, .55); backdrop-filter: blur(3px); }
.dlg[open] { animation: dlgEntra .22s cubic-bezier(.2, .9, .3, 1.2); }
.dlg[open]::backdrop { animation: fundido .2s ease-out; }
@keyframes dlgEntra { from { opacity: 0; transform: translateY(10px) scale(.96); } }
@keyframes fundido { from { opacity: 0; } }
.dlg form { padding: 20px 22px 18px; }
.dlg-ico { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--danger-soft); color: var(--danger); margin-bottom: 10px; }
.dlg-ico svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dlg h3 { margin: 0 0 8px; font-size: 1.05rem; }
.dlg-msg { font-size: .86rem; color: var(--text); }
.dlg-msg p { margin: 6px 0; }
.dlg-msg ul { margin: 6px 0; padding-left: 18px; color: var(--muted); }
.dlg-msg li { margin: 3px 0; }
.dlg-acciones { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
/* Con tres opciones, la principal ocupa la fila de abajo completa */
.dlg-acciones:has(#dlg-alt:not([hidden])) #dlg-ok { flex-basis: 100%; justify-content: center; }
.dlg-acciones:has(#dlg-alt:not([hidden])) > :not(#dlg-ok) { flex: 1; justify-content: center; }

/* ---------- Carpeta: la pestaña activa y su contenido forman una sola pieza ---------- */
.tab-panel { --tc: var(--accion); }
.tab-panel.con-tabs {
  position: relative; margin-top: -2px; padding: 0 14px 14px;
  background: color-mix(in srgb, var(--tc) 6%, var(--bg));
  border: 2px solid color-mix(in srgb, var(--tc) 55%, var(--border));
  border-radius: 0 12px 12px 12px;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--tc) 12%, transparent);
  transition: background .25s, border-color .25s;
}
.tab-panel.con-tabs:not(.primera) { border-top-left-radius: 12px; }
.tab-panel.con-tabs .toolbar {
  margin: 0 -14px; padding: 12px 14px 10px; border-radius: 10px 10px 0 0;
  background: color-mix(in srgb, color-mix(in srgb, var(--tc) 6%, var(--bg)) 90%, transparent);
}
/* La pestaña activa se funde con el marco: mismo fondo y borde, sin línea inferior */
.btab.activa {
  background: color-mix(in srgb, var(--tc) 6%, var(--bg));
  border: 2px solid color-mix(in srgb, var(--tc) 55%, var(--border)); border-bottom: none;
  box-shadow: inset 0 3px 0 var(--tc);
  z-index: 3;
}
.btab:not(.activa) { margin-bottom: 2px; opacity: .92; }
.btab:not(.activa):hover { opacity: 1; }
.btab.activa .btab-main { padding-bottom: 11px; }
@media (max-width: 820px) {
  .tab-panel.con-tabs { padding: 0 8px 10px; margin-left: -4px; margin-right: -4px; }
  .tab-panel.con-tabs .toolbar { margin: 0 -8px; padding: 10px 8px; }
}

/* Aviso destacado de Drive dentro del mensaje de eliminación */
.dlg-drive {
  display: flex; gap: 10px; align-items: flex-start; margin-top: 10px; padding: 10px 12px; border-radius: 10px;
  background: var(--danger-soft); border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent); color: var(--text); font-size: .83rem;
}
.dlg-drive svg { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--danger); stroke-width: 1.8; stroke-linejoin: round; }
.dlg-drive b { display: block; color: var(--danger); margin-bottom: 2px; }

.flash.toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 50; max-width: min(460px, calc(100vw - 40px)); margin: 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2); animation: dlgEntra .25s ease-out;
}

/* ---------- Buscador: paneles movibles y ajustables ---------- */
.bus-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
.bus-layout > .bus-panel { position: relative; margin: 0; display: flex; flex-direction: column; min-width: 0; }
.bus-layout > .ancho { grid-column: 1 / -1; }
.bus-layout .run-panel { position: relative; top: auto; }
.bus-head { position: relative; }
.panel-tools { margin-left: auto; display: flex; gap: 4px; align-self: flex-start; opacity: .45; transition: opacity .15s; }
.bus-panel:hover .panel-tools { opacity: 1; }
.pt-btn {
  all: unset; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; cursor: pointer;
  color: var(--muted); border: 1px solid transparent; transition: background .15s, color .15s, border-color .15s;
}
.pt-btn:hover { background: var(--surface-2); color: var(--accent); border-color: var(--border); }
.pt-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pt-grip { cursor: grab; touch-action: none; }
.pt-grip svg { fill: currentColor; stroke: none; }
.bus-panel.ancho .pt-ancho svg { transform: scaleX(-1); }
/* Tirador de alto (esquina inferior) */
.pt-resize {
  position: absolute; left: 50%; bottom: 3px; width: 46px; height: 8px; transform: translateX(-50%); cursor: ns-resize; touch-action: none;
  border-radius: 999px; background: repeating-linear-gradient(90deg, var(--border-strong) 0 2px, transparent 2px 5px); opacity: 0; transition: opacity .15s;
}
.bus-panel:hover .pt-resize, .bus-panel.redimensionando .pt-resize { opacity: .9; }
.bus-panel.redimensionando { box-shadow: 0 0 0 2px var(--teal); }
/* El log ocupa el alto disponible del panel de ejecución sin agrandarlo: `contain: size` hace que su
   contenido no cuente para el alto de la fila, que lo fija el panel vecino; las líneas nuevas hacen scroll */
.run-panel .livelog.panel-log { flex: 1 1 0; height: auto; min-height: 220px; contain: size; }
.bus-panel[data-panel="hist"] .table-wrap { flex: 1 1 auto; overflow: auto; }
/* Arrastre */
.bus-panel.arrastrando {
  position: fixed; z-index: 60; pointer-events: none; margin: 0; overflow: hidden;
  transform: rotate(.8deg) scale(1.02); box-shadow: 0 24px 50px rgba(8, 20, 40, .28), 0 0 0 2px var(--teal);
  opacity: .96;
}
.bus-hueco { border: 2px dashed color-mix(in srgb, var(--teal) 60%, transparent); border-radius: var(--radius); background: color-mix(in srgb, var(--teal) 7%, transparent); }
.bus-hueco.ancho { grid-column: 1 / -1; }
body.moviendo-panel, body.moviendo-panel * { cursor: grabbing !important; user-select: none; }
@media (max-width: 1080px) {
  .bus-layout { grid-template-columns: 1fr; }
  .bus-layout > .bus-panel { grid-column: auto; }
  .run-panel .livelog.panel-log { flex: none; height: 360px; }   /* en una columna no hay panel vecino */
}

/* Robot grande del panel de ejecución */
.run-ico { background: color-mix(in srgb, #8a96a6 14%, var(--surface)); }
.run-panel.corriendo .run-ico { background: color-mix(in srgb, #16a34a 14%, var(--surface)); }
.bot.bot-grande { width: 30px; height: 30px; }
.bot.bot-grande svg { width: 30px; height: 30px; }
.bot.bot-grande .zzz { left: 22px; top: -12px; font-size: 11px; }

/* Avance de la ejecución */
.run-prog { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; }
.rp-barra { flex: 1; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.rp-barra i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #16a34a, var(--teal)); transition: width .5s ease; }
.rp-txt { font-size: .78rem; color: var(--muted); white-space: nowrap; }
.rp-txt b { color: var(--text); font-variant-numeric: tabular-nums; }

/* Cuota de IA */
.ia-cuota { margin: 0 0 10px; padding: 9px 11px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); }
.iac-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .78rem; }
.iac-head span { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-size: .7rem; }
.iac-head svg { width: 14px; height: 14px; fill: var(--info); }
.iac-head b { font-variant-numeric: tabular-nums; }
.iac-head small { font-weight: 400; color: var(--muted); }
.iac-barra { height: 7px; margin: 7px 0 5px; border-radius: 999px; background: var(--border); overflow: hidden; }
.iac-barra i { display: block; height: 100%; border-radius: inherit; background: var(--info); transition: width .5s ease; }
.ia-cuota.alta .iac-barra i { background: var(--warn); }
.ia-cuota.agotada { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); background: var(--danger-soft); }
.ia-cuota.agotada .iac-barra i { background: var(--danger); }
.iac-pie { font-size: .75rem; color: var(--muted); }
.ia-cuota.agotada .iac-pie { color: var(--danger); }

/* Botón "enviar a la papelera" en la cabecera de cada fila */
.fila-del {
  all: unset; cursor: pointer; justify-self: center; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px;
  color: var(--muted); opacity: .55; transition: background .15s, color .15s, opacity .15s, transform .15s;
}
.fila-del svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.fila-main:hover .fila-del, .fila.open .fila-del { opacity: 1; }
.fila-del:hover { background: var(--danger-soft); color: var(--danger); transform: scale(1.08); }
.fila-del:focus-visible { outline: 2px solid var(--danger); opacity: 1; }
.tab-count.cero { background: var(--border-strong); color: var(--muted); }

/* ---------- Papelera ---------- */
.pap-ico { background: var(--danger-soft); color: var(--danger); }
.pap-total { display: inline-block; min-width: 22px; padding: 0 7px; margin-left: 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .75rem; line-height: 20px; text-align: center; vertical-align: middle; }
.pap-barra { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 10px 0 6px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.pap-masivas .accion em {
  font-style: normal; min-width: 18px; padding: 0 6px; margin-left: 2px; border-radius: 999px; font-size: .7rem; line-height: 17px; text-align: center;
  background: color-mix(in srgb, var(--c) 18%, var(--surface)); color: var(--c);
}
.pap-masivas .accion.solido em, .pap-masivas .accion:hover em { background: rgba(255, 255, 255, .25); color: #fff; }
.pap-masivas .accion em.salta { animation: salta .3s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes salta { 40% { transform: scale(1.35); } }
#tabla-papelera td { vertical-align: middle; }
#tabla-papelera tbody tr[data-id] { cursor: pointer; transition: background .15s; }
#tabla-papelera tbody tr.sel { background: color-mix(in srgb, var(--teal) 9%, var(--surface)); box-shadow: inset 3px 0 0 var(--teal); }
#tabla-papelera input[type=checkbox] { width: 17px; height: 17px; cursor: pointer; }
.pap-check { width: 34px; }
.pap-lic { white-space: normal !important; min-width: 260px; }
.pap-acc { text-align: right; white-space: nowrap; }
.pap-acc .accion { margin-left: 4px; }
.pap-vacia { text-align: center; color: var(--muted); padding: 30px !important; }
.dlg[data-tipo="aviso"] .dlg-ico { background: var(--warn-soft); color: var(--warn); }

/* "Revisar con IA" toma el color de la pestaña activa */
.tab-panel .ia-btn {
  color: color-mix(in srgb, var(--tc) 80%, var(--text)); background: color-mix(in srgb, var(--tc) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--tc) 45%, transparent);
}
.tab-panel .ia-btn:hover:not(:disabled) { background: var(--tc); border-color: var(--tc); color: #fff; }
.tab-panel .ia-count { background: var(--tc); color: #fff; }
.tab-panel .ia-btn:hover .ia-count { background: #fff; color: var(--tc); }

/* ---------- Encabezado: papelera y menú de usuario a la derecha ---------- */
.hdr-btn {
  position: relative; display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted); text-decoration: none; transition: color .15s, border-color .15s, background .15s;
}
.hdr-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.hdr-btn:hover { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); background: var(--danger-soft); }
.hdr-btn.active { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }
.hdr-btn .tab-count { position: absolute; top: -6px; right: -7px; margin: 0; min-width: 18px; line-height: 17px; font-size: .64rem; border: 2px solid var(--header); }

.usr { position: relative; }
.usr-btn { all: unset; cursor: pointer; display: flex; align-items: center; gap: 2px; padding: 2px 4px 2px 2px; border-radius: 999px; border: 1px solid var(--border); transition: border-color .15s, background .15s; }
.usr-btn:hover, .usr-btn[aria-expanded="true"] { border-color: var(--teal); background: var(--accent-soft); }
.usr-btn:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.usr-avatar {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-size: .74rem; font-weight: 800; letter-spacing: .02em;
  color: #fff; background: linear-gradient(135deg, var(--teal), #0b2e54);
}
.usr-avatar.grande { width: 40px; height: 40px; font-size: .9rem; }
.usr-caret { width: 14px; height: 14px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.usr-btn[aria-expanded="true"] .usr-caret { transform: rotate(180deg); }
.usr-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 70; min-width: 240px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 16px 40px rgba(8, 20, 40, .2);
  animation: menuEntra .16s ease-out; transform-origin: top right;
}
@keyframes menuEntra { from { opacity: 0; transform: translateY(-4px) scale(.97); } }
.usr-info { display: flex; align-items: center; gap: 10px; padding: 8px 8px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.usr-info b { display: block; font-size: .9rem; }
.usr-info small { color: var(--muted); font-size: .76rem; }
.usr-item {
  all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px;
  font-size: .86rem; color: var(--text); text-decoration: none;
}
.usr-item svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; color: var(--muted); }
.usr-item:hover, .usr-item:focus-visible, .usr-item.active { background: var(--accent-soft); color: var(--accent); }
.usr-item:hover svg, .usr-item.active svg { color: var(--accent); }
.usr-item.salir:hover { background: var(--danger-soft); color: var(--danger); }
.usr-item.salir:hover svg { color: var(--danger); }
.dlg-ico.ok { background: var(--accent-soft); color: var(--accent); }
.dlg-campos { display: grid; gap: 10px; margin-top: 6px; }
@media (max-width: 820px) { .usr-caret { display: none; } .hdr-btn { width: 30px; height: 30px; } }

/* ---------- Pantalla de acceso: tarjeta centrada sobre fondo de marca animado ---------- */
.login-body {
  min-height: 100vh; margin: 0; overflow-x: hidden; display: grid; place-items: center;
  background: radial-gradient(1200px 700px at 50% -10%, #0e4a74 0%, transparent 60%), linear-gradient(160deg, #0b2e54 0%, #061a31 55%, #020b16 100%);
}
.login-fondo { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.login-fondo::before {   /* cuadrícula sutil */
  content: ''; position: absolute; inset: -50%; opacity: .07; transform: perspective(600px) rotateX(55deg);
  background-image: linear-gradient(rgba(255,255,255,.7) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.7) 1px, transparent 1px);
  background-size: 48px 48px; animation: rejilla 20s linear infinite;
}
@keyframes rejilla { to { background-position: 0 48px, 48px 0; } }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; animation: deriva 18s ease-in-out infinite; }
.blob.b1 { width: 520px; height: 520px; left: -140px; top: -120px; background: #00b0a8; }
.blob.b2 { width: 460px; height: 460px; right: -120px; bottom: -160px; background: #1d6fd1; animation-delay: -6s; }
.blob.b3 { width: 300px; height: 300px; right: 18%; top: 12%; background: #10b981; opacity: .3; animation-delay: -12s; }
@keyframes deriva { 50% { transform: translate(40px, 30px) scale(1.08); } }
/* sin z-index: así el logo puede fundir su fondo negro con el fondo de la página (mix-blend-mode) */
.login-centro { position: relative; width: min(420px, calc(100vw - 32px)); padding: 40px 0; display: grid; justify-items: center; gap: 18px; }
.login-cabecera { display: grid; justify-items: center; gap: 8px; text-align: center; color: #d6e9f0; }
.login-logo { width: 190px; height: auto; mix-blend-mode: screen; }
.login-cabecera p { margin: 0; font-size: .9rem; color: #a9c6d3; }
.login-bot { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 20px; margin-bottom: 2px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); backdrop-filter: blur(6px); animation: flotar 5s ease-in-out infinite; }
.login-bot svg { width: 40px; height: 40px; fill: #e6f6f5; }
.login-bot .visor { fill: #0b2e54; }
.login-bot .luz { fill: #3de0d6; animation: luzBot 1.6s ease-in-out infinite; }
@keyframes flotar { 50% { transform: translateY(-8px); } }
.login-form {
  width: 100%; box-sizing: border-box; display: grid; gap: 14px; padding: 28px 28px 24px;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid rgba(255,255,255,.18); border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45), 0 0 0 1px rgba(0, 176, 168, .15);
  animation: dlgEntra .45s cubic-bezier(.2, .9, .3, 1.1);
}
.login-form h2 { margin: 0; font-size: 1.3rem; text-align: center; }
.login-form > .hint { margin: -8px 0 4px; text-align: center; }
.clave { position: relative; display: block; }
.clave input { padding-right: 42px; }
.ver-clave { all: unset; cursor: pointer; position: absolute; right: 8px; top: calc(50% + 2px); transform: translateY(-50%); padding: 4px; opacity: .55; display: grid; color: var(--muted); }
.ver-clave:hover { opacity: 1; }
.ver-clave svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.login-btn { width: 100%; justify-content: center; height: 46px; font-size: .96rem; margin-top: 4px; border-radius: 12px;
  background: linear-gradient(135deg, #00b0a8, #0b6fb0) !important; border: none !important; color: #fff !important; box-shadow: 0 10px 24px rgba(0, 176, 168, .35); }
.login-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.login-btn.cargando span::after { content: '…'; }
.login-error { margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--danger-soft); color: var(--danger); font-size: .84rem; }
.login-puntos { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; font-size: .78rem; color: #a9c6d3; }
.login-puntos li { display: inline-flex; align-items: center; gap: 6px; }
.login-puntos svg { width: 15px; height: 15px; fill: none; stroke: #3de0d6; stroke-width: 1.9; stroke-linecap: round; }
.login-pie { color: #7d9aab; font-size: .74rem; margin: 0; }
@media (prefers-reduced-motion: reduce) { .blob, .login-fondo::before, .login-bot { animation: none; } }

body:not(.es-admin) .solo-admin { display: none !important; }

/* ---------- Usuarios ---------- */
#panel-usuarios .bus-head > .accion, #panel-plan .bus-head > .accion, #view-empresas .bus-head > .accion { margin-left: auto; align-self: center; }
.usr-celda { display: flex; align-items: center; gap: 10px; }
.usr-celda b { display: block; font-size: .88rem; }
.usr-celda small { color: var(--muted); font-size: .76rem; }
.usr-avatar.normal { background: linear-gradient(135deg, #64748b, #334155); }
#tabla-usuarios td { vertical-align: middle; }
#tabla-usuarios tr.inactivo .usr-celda { opacity: .55; }
.usr-rol { display: inline-block; margin-top: 3px; font-size: .68rem; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; }
.clave-temporal { display: flex; align-items: center; gap: 8px; margin: 12px 0 6px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--border-strong); }
.clave-temporal code { flex: 1; font: 700 1.15rem var(--mono); letter-spacing: .06em; user-select: all; }

/* ---------- Plan y suscripción ---------- */
.plan-actual { display: grid; grid-template-columns: minmax(180px, 240px) minmax(0, 1fr); gap: 16px; margin: 12px 0; padding: 14px; border-radius: 12px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--teal) 10%, var(--surface)), var(--surface)); border: 1px solid color-mix(in srgb, var(--teal) 35%, var(--border)); }
.pa-nombre { display: grid; align-content: start; gap: 4px; }
.pa-nombre small { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.pa-nombre b { font-size: 1.5rem; color: var(--accent); }
.pa-nombre .pill { justify-self: start; }
.pa-usos { display: grid; gap: 10px; }
.pu-txt { display: flex; justify-content: space-between; font-size: .82rem; }
.pu-txt small { color: var(--muted); font-weight: 400; }
.plan-uso .iac-barra { margin: 5px 0 0; }
.plan-uso .iac-barra i { background: var(--teal); }
.plan-uso .iac-barra.alto i { background: var(--warn); }
.plan-uso .iac-barra.lleno i { background: var(--danger); }
.planes { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.plan-card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); transition: transform .15s, box-shadow .15s; }
.plan-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(11, 46, 84, .1); }
.plan-card.actual { border: 2px solid var(--teal); box-shadow: 0 8px 22px color-mix(in srgb, var(--teal) 18%, transparent); }
.plan-card h3 { margin: 0; font-size: 1.05rem; }
.pc-precio { font-size: 1.4rem; font-weight: 800; }
.pc-precio small { font-size: .78rem; font-weight: 400; color: var(--muted); }
.plan-card ul { margin: 4px 0 8px; padding-left: 18px; font-size: .84rem; display: grid; gap: 3px; }
.plan-card .accion { margin-top: auto; justify-content: center; }
.pc-actual { position: absolute; top: -10px; right: 12px; padding: 1px 9px; border-radius: 999px; background: var(--teal); color: #fff; font-size: .7rem; font-weight: 700; }
@media (max-width: 820px) { .plan-actual { grid-template-columns: 1fr; } }

/* ---------- Propietario del servicio ---------- */
body:not(.es-propietario) .solo-propietario { display: none !important; }
.usr-org { display: block; margin-top: 2px; color: var(--muted); font-size: .72rem; }
.emp-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 12px 0; }
#tabla-empresas td { vertical-align: middle; }
.e-admin { border: 1px dashed var(--border-strong); border-radius: 10px; padding: 8px 12px 10px; margin: 0; display: grid; gap: 8px; }
.e-admin legend { font-size: .76rem; font-weight: 700; color: var(--accent); padding: 0 4px; }
.pc-pronto { margin-top: auto; text-align: center; font-size: .76rem; color: var(--muted); padding: 6px; border: 1px dashed var(--border-strong); border-radius: 8px; }
#dlg-empresa { width: min(560px, calc(100vw - 32px)); }

/* Acceso: enlaces, avisos y vistas de registro / recuperación */
.login-aviso { margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--ok-soft); color: var(--ok); font-size: .84rem; }
.login-link { all: unset; cursor: pointer; color: var(--accent); font-size: .84rem; text-decoration: none; }
.login-link:hover { text-decoration: underline; }
.login-link.fuerte { font-weight: 700; }
.login-enlaces { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: .84rem; color: var(--muted); }
.login-form .grid2 { margin-top: 0; gap: 10px; }
.login-mensaje { text-align: center; justify-items: center; }
.login-mensaje p { margin: 0; }
.lm-ico { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 1.6rem; }
.turnstile:empty { display: none; }
.login-centro { width: min(460px, calc(100vw - 32px)); }

/* Aviso del plan en la app (prueba / vencida) */
.aviso-plan { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 10px; padding: 9px 14px; border-radius: 10px; font-size: .86rem;
  background: var(--info-soft); color: var(--info); border: 1px solid color-mix(in srgb, var(--info) 30%, transparent); }
.aviso-plan.vencida { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.aviso-plan b { font-weight: 800; }
.aviso-plan .accion { margin-left: auto; }
.correo-ult { margin-top: 10px; }
.sub-tit-panel { margin: 16px 0 4px; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* Columna Presupuesto centrada (título y monto), para que el monto no se mueva al abrir la fila y volverse pestaña */
@media (min-width: 821px) {
  .col-ppto { text-align: center; }
  .col-ppto .ppto-src { justify-content: center; }
  .lista-head button[data-orden="presupuesto"] { justify-self: center; margin: 0; }
}

/* ---------- Pantallas grandes: el monto abierto es la pestaña (tipo fichero) del submódulo Presupuesto ----------
   El detalle usa las mismas columnas que la fila, así que su columna derecha empieza justo bajo la columna
   Presupuesto. La celda del monto baja hasta tapar el borde superior del submódulo y se funde con él. */
@media (min-width: 1081px) {
  .fila-det { grid-template-columns: var(--cols-fila); column-gap: 12px; padding: 4px 12px 14px; }
  .fila-det > .det-col:first-child { grid-column: 2 / 4; }
  .fila-det > .det-col:nth-child(2) { grid-column: 4 / -1; }
  .fila-det > .det-links { grid-column: 2 / 4; }
  .fila.open .col-ppto[data-act] {
    --borde-ficha: color-mix(in srgb, var(--rel) 55%, var(--border));
    align-self: stretch; display: flex; flex-direction: column; justify-content: center;
    margin: -3px 0 -12px; padding: 3px 6px 15px; position: relative; z-index: 2;
    background: var(--rel-soft); border: 1px solid var(--borde-ficha); border-bottom: 0; border-radius: 10px 10px 0 0; box-shadow: none;
  }
  .fila.open .col-ppto[data-act]::after { content: none; }
  .fila.open .ppto-caja.sub { border-top-left-radius: 0; }
  /* monto y confianza ya están en la pestaña: la cabecera muestra solo el origen */
  .fila-det .sub-linea { display: none; }
  /* la pestaña y la cabecera del submódulo son una sola pieza: se resaltan juntas */
  .fila.open:has(.col-ppto[data-act]:hover, .sub-head:hover) :is(.col-ppto[data-act], .sub-head) { background: var(--rel-hover); }
  .fila.open .col-ppto[data-act]:hover .ppto-val { color: inherit; text-decoration: none; }
  .fila.open .col-ppto[data-act] { align-items: center; }   /* centrado, igual que con la fila cerrada */
}

/* Instalación de una sola empresa (MULTIEMPRESA=false): sin empresas clientes, planes ni registro público */
.una-empresa .solo-multiempresa { display: none !important; }
#panel-usuarios { scroll-margin-top: 84px; }   /* al llegar desde Menú › Usuarios, el título no queda bajo la cabecera */

/* ---------- Crédito "Desarrollado por OmniSoft" (mismo diseño que las otras apps de OmniSoft) ---------- */
:root { --omni-1: #15304f; --omni-2: #348a8a; }
:root[data-theme="dark"], .login-body { --omni-1: #dfe7f1; --omni-2: #4fb8b8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --omni-1: #dfe7f1; --omni-2: #4fb8b8; } }
.pie-app { display: flex; justify-content: center; padding: 18px 16px 26px; }
.omni-sign { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.omni-brand { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; }
.omni-brand b { font: 700 15px/1 Poppins, Montserrat, "Segoe UI", system-ui, sans-serif; letter-spacing: -.2px; }
.omni-1 { color: var(--omni-1); } .omni-2 { color: var(--omni-2); }
.omni-mark { flex: none; }
.omni-web { display: inline-flex; align-items: center; gap: 4px; padding-left: 8px; border-left: 1px solid var(--border-strong); color: var(--muted); font-weight: 600; text-decoration: none; }
.omni-web svg { fill: none; stroke: currentColor; stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.omni-web:hover, .omni-brand:hover b { text-decoration: underline; }
.omni-web:hover { color: #2e9a9c; }
.omni-sign.on-auth { justify-content: center; margin: 14px 0 0; color: #a9b4bf; }
.omni-sign.on-auth .omni-web { color: #a9b4bf; border-left-color: rgba(255, 255, 255, .25); }
@media (max-width: 640px) { .omni-sign { flex-wrap: wrap; justify-content: center; row-gap: 4px; white-space: normal; } }
