/* EITI · estilos. Sobrio: grises neutros, un solo acento (verde petróleo), tipografía compacta, filas de un renglón. */
:root {
  --fondo: #f4f5f7;
  --sup: #ffffff;
  --sup-2: #f9fafb;
  --sup-3: #f1f3f5;
  --linea: #e4e7eb;
  --linea-2: #d2d6dc;
  --texto: #15202b;
  --texto-2: #5c6773;
  --texto-3: #98a2ad;
  --acento: #0f6b5e;
  --acento-2: #0b5449;
  --acento-suave: #e7f3f1;
  --foco: rgba(15, 107, 94, .2);
  --lateral: #14202a;
  --lateral-2: #1d2b37;
  --lateral-tx: #b9c4ce;
  --peligro: #b42318;
  --sombra-1: 0 1px 2px rgba(16, 24, 40, .05);
  --sombra-2: 0 8px 24px rgba(16, 24, 40, .12), 0 2px 6px rgba(16, 24, 40, .06);
  --r: 6px;
  --r-chico: 4px;
  --fila: 36px;
  --fuente: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Etiquetas: tonos apagados */
  --c-default-bg: #f0f2f4; --c-default-tx: #4b5563;
  --c-gray-bg: #eceff2;    --c-gray-tx: #4b5563;
  --c-brown-bg: #f3ebe6;   --c-brown-tx: #6b4a37;
  --c-orange-bg: #fcede0;  --c-orange-tx: #8a4b16;
  --c-yellow-bg: #faf2d7;  --c-yellow-tx: #6f5512;
  --c-green-bg: #e3f2e8;   --c-green-tx: #24663d;
  --c-blue-bg: #e5eef8;    --c-blue-tx: #234d7d;
  --c-purple-bg: #eee9f7;  --c-purple-tx: #54407f;
  --c-pink-bg: #f8e9ef;    --c-pink-tx: #833a5b;
  --c-red-bg: #fbe7e5;     --c-red-tx: #9a3029;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 13.5px/1.45 var(--fuente); color: var(--texto); background: var(--fondo); -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1, "cv11" 1; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
svg.ic { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.cargando { display: grid; place-items: center; height: 100vh; color: var(--texto-2); }
.oculto { display: none !important; }
.gris { color: var(--texto-3); }

/* ── Botones ─────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--linea-2);
  border-radius: var(--r); background: var(--sup); cursor: pointer; white-space: nowrap; font-size: 13px; font-weight: 500;
  box-shadow: var(--sombra-1); }
.btn:hover { background: var(--sup-2); }
.btn.primario { background: var(--acento); border-color: var(--acento); color: #fff; }
.btn.primario:hover { background: var(--acento-2); }
.btn.suave { background: var(--sup); color: var(--acento-2); border-color: #b9d6d1; }
.btn.suave:hover { background: var(--acento-suave); }
.btn.chico { height: 26px; padding: 0 9px; font-size: 12.5px; }
.btn.plano { border-color: transparent; background: transparent; color: var(--texto-2); box-shadow: none; }
.btn.plano:hover { background: var(--sup-3); color: var(--texto); }
.btn:disabled { opacity: .5; cursor: default; }
.icono-btn { width: 30px; height: 30px; display: inline-grid; place-items: center; border: 0; background: transparent;
  border-radius: var(--r); cursor: pointer; color: var(--texto-2); }
.icono-btn:hover { background: var(--sup-3); color: var(--texto); }

/* ── Estructura: barra lateral + contenido ───────────────────────────── */
.app { display: grid; grid-template-columns: 220px 1fr; height: 100vh; transition: grid-template-columns .15s; }
.app.plegada { grid-template-columns: 58px 1fr; }
.lateral { background: var(--lateral); color: var(--lateral-tx); display: flex; flex-direction: column; padding: 14px 10px; gap: 2px; overflow: hidden; }
.marca { display: flex; align-items: center; gap: 10px; padding: 2px 6px 16px; color: #fff; min-width: 0; }
.marca i { width: 30px; height: 30px; border-radius: 7px; background: var(--acento); display: grid; place-items: center;
  font-style: normal; font-weight: 700; font-size: 14px; color: #fff; flex: none; }
.marca b { font-size: 15px; letter-spacing: .06em; }
.marca small { display: block; font-size: 11px; color: #8796a3; font-weight: 400; letter-spacing: 0; white-space: nowrap; }
.marca .plegar { margin-left: auto; color: #8796a3; }
.marca .plegar:hover { background: var(--lateral-2); color: #fff; }
.nav-tit { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: #6f7f8c; padding: 12px 10px 4px; white-space: nowrap; }
.lateral a.mod { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r); text-decoration: none; color: var(--lateral-tx);
  font-weight: 500; position: relative; white-space: nowrap; }
.lateral a.mod:hover { background: var(--lateral-2); color: #fff; }
.lateral a.mod.activo { background: var(--lateral-2); color: #fff; }
.lateral a.mod.activo::before { content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 2px 2px 0; background: #3fb3a0; }
.lateral a.mod .n { margin-left: auto; font-size: 11.5px; color: #7d8b97; font-weight: 500; }
.lateral a.mod.prox { opacity: .4; pointer-events: none; }
.lateral .pie { margin-top: auto; border-top: 1px solid rgba(255,255,255,.07); padding-top: 10px; }
.usuario-btn { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; cursor: pointer; padding: 6px;
  border-radius: var(--r); color: var(--lateral-tx); text-align: left; white-space: nowrap; }
.usuario-btn:hover { background: var(--lateral-2); }
.usuario-btn .nom { font-weight: 500; color: #fff; display: block; font-size: 13px; }
.usuario-btn small { color: #7d8b97; font-size: 11.5px; }
.app.plegada .marca > div, .app.plegada .nav-tit, .app.plegada a.mod span, .app.plegada .usuario-btn .txt { display: none; }
.app.plegada .marca { flex-direction: column; gap: 10px; padding-bottom: 10px; }
.app.plegada .marca .plegar { margin: 0; transform: rotate(180deg); }
.app.plegada a.mod { justify-content: center; padding: 9px 0; }
.app.plegada .usuario-btn { justify-content: center; }
.avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--sup-3); color: var(--texto-2); display: inline-grid; place-items: center;
  font-size: 10.5px; font-weight: 600; flex: none; }
.lateral .avatar { background: #2a3b48; color: #dde5ec; width: 30px; height: 30px; }

.contenido { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.cabecera { display: flex; align-items: center; gap: 16px; padding: 14px 22px 10px; }
.cabecera h1 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
.cabecera .sub { color: var(--texto-2); font-size: 12.5px; }
.buscador-global { position: relative; margin-left: auto; width: min(400px, 40vw); }
.buscador-global input { width: 100%; height: 34px; padding: 0 60px 0 34px; border: 1px solid var(--linea-2); border-radius: var(--r); background: var(--sup);
  outline: none; }
.buscador-global input:focus { border-color: var(--acento); box-shadow: 0 0 0 3px var(--foco); }
.buscador-global .ic { position: absolute; left: 11px; top: 9px; color: var(--texto-3); }
.buscador-global kbd { position: absolute; right: 9px; top: 8px; font: 11px var(--fuente); color: var(--texto-3); border: 1px solid var(--linea-2);
  border-radius: 4px; padding: 0 5px; background: var(--sup-2); }
.resultados { position: absolute; top: 40px; left: 0; right: 0; background: var(--sup); border-radius: 8px; box-shadow: var(--sombra-2);
  max-height: 70vh; overflow: auto; padding: 4px; z-index: 50; border: 1px solid var(--linea); }
.resultado { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r); cursor: pointer; }
.resultado.activo, .resultado:hover { background: var(--sup-3); }
.resultado .r-tit { font-weight: 550; }
.resultado .r-sub { color: var(--texto-2); font-size: 12px; margin-left: auto; text-align: right; }
.resultado .r-tipo { font-size: 10.5px; color: var(--texto-3); text-transform: uppercase; letter-spacing: .06em; width: 62px; flex: none; }
.sync { font-size: 12px; color: var(--texto-3); white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.sync::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #34a37a; }
.sync.guardando::before { background: #d99a0b; }
.sync.error { color: var(--peligro); }
.sync.error::before { background: var(--peligro); }

/* ── Pestañas y herramientas ─────────────────────────────────────────── */
.pestanas { display: flex; gap: 2px; padding: 0 22px; overflow-x: auto; scrollbar-width: none; flex: none; border-bottom: 1px solid var(--linea); }
.pestanas button { border: 0; background: transparent; padding: 8px 12px 9px; cursor: pointer; color: var(--texto-2); white-space: nowrap;
  font-weight: 500; font-size: 13px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.pestanas button:hover { color: var(--texto); }
.pestanas button.activo { color: var(--acento-2); border-bottom-color: var(--acento); font-weight: 600; }
.panel { margin: 14px 22px 18px; background: var(--sup); border: 1px solid var(--linea); border-radius: 8px; box-shadow: var(--sombra-1);
  display: flex; flex-direction: column; min-height: 0; flex: 1; overflow: hidden; }
.herramientas { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--linea); }
.busca-vista { position: relative; }
.busca-vista input { height: 32px; width: 240px; padding: 0 10px 0 31px; border: 1px solid var(--linea-2); border-radius: var(--r); outline: none; }
.busca-vista input:focus { border-color: var(--acento); box-shadow: 0 0 0 3px var(--foco); }
.busca-vista .ic { position: absolute; left: 10px; top: 8px; color: var(--texto-3); }
.filtro-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border-radius: var(--r); border: 1px solid var(--linea-2);
  background: var(--sup); cursor: pointer; font-size: 13px; color: var(--texto-2); max-width: 340px; }
.filtro-btn:hover { background: var(--sup-2); color: var(--texto); }
.filtro-btn.con-valor { border-color: #9fc9c2; background: var(--acento-suave); color: var(--acento-2); }
.filtro-btn b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.separador { width: 1px; height: 22px; background: var(--linea); margin: 0 4px; }
.cuenta { margin-left: auto; color: var(--texto-2); font-size: 12.5px; white-space: nowrap; }

/* ── Tabla: filas de un renglón, columnas con ancho ajustable ────────── */
.tabla-scroll { flex: 1; overflow: auto; position: relative; }
table.tabla { border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 13px; }
.tabla th, .tabla td { border-bottom: 1px solid var(--linea); border-right: 1px solid #eef0f3; padding: 0; text-align: left; overflow: hidden; }
.tabla th { position: sticky; top: 0; z-index: 3; background: var(--sup-2); color: var(--texto-2); font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: .05em; height: 34px; padding: 0 10px; white-space: nowrap; text-overflow: ellipsis; cursor: pointer;
  user-select: none; border-bottom-color: var(--linea-2); }
.tabla th:hover { color: var(--texto); background: var(--sup-3); }
.tabla th .flecha { color: var(--acento); margin-left: 4px; }
.tabla th .candado { margin-left: 5px; vertical-align: -2px; }
.tabla th .candado svg.ic { width: 11px; height: 11px; }
.tabla th .ajuste { position: absolute; top: 0; right: 0; width: 10px; height: 100%; cursor: col-resize; z-index: 5; }
.tabla th .ajuste:hover, .tabla th .ajuste.activo { background: linear-gradient(90deg, transparent 6px, var(--acento) 6px, var(--acento) 8px, transparent 8px); }
.tabla th:first-child, .tabla td:first-child { position: sticky; left: 0; z-index: 2; background: var(--sup); box-shadow: 1px 0 0 var(--linea-2); }
.tabla th:first-child { z-index: 4; background: var(--sup-2); }
.tabla tbody tr:hover td { background: #f8fafb; }
.tabla td .cel { height: var(--fila); padding: 0 10px; display: flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; cursor: text; }
.tabla td .cel > .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tabla td.t-seleccion .cel, .tabla td.t-multiple .cel, .tabla td.t-estado .cel, .tabla td.t-persona .cel, .tabla td.t-relacion .cel,
.tabla td.t-fecha .cel, .tabla td.t-archivo .cel { cursor: pointer; }
.tabla td.no-edit .cel { cursor: default; }
.tabla td.no-edit { color: #46515c; background: #fcfcfd; }
.tabla td:not(.no-edit) .cel:hover { box-shadow: inset 0 0 0 1px #c5ced6; }
.tabla td .cel.editando { height: auto; min-height: var(--fila); white-space: normal; padding: 8px 10px; display: block; box-shadow: inset 0 0 0 2px var(--acento); background: var(--sup); }
.tabla td .cel.activa { box-shadow: inset 0 0 0 2px var(--acento); }
.tabla td.t-titulo .cel { font-weight: 600; }
.tabla td.t-titulo .cel > .nombre { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.abrir { flex: none; display: inline-flex; align-items: center; gap: 3px; border: 1px solid var(--linea-2); background: var(--sup); border-radius: 4px;
  padding: 0 6px; height: 22px; font-size: 11.5px; font-weight: 500; color: var(--texto-2); cursor: pointer; opacity: 0; }
.abrir svg.ic { width: 12px; height: 12px; }
tr:hover .abrir { opacity: 1; }
.abrir:hover { border-color: var(--acento); color: var(--acento-2); }
.tabla tr.grupo td { position: static; background: var(--sup-3); font-weight: 600; padding: 0 12px; height: 34px; cursor: pointer; border-right: 0; white-space: nowrap; }
.tabla tr.grupo td span.n { color: var(--texto-3); font-weight: 500; margin-left: 8px; }
.tabla tr.grupo .tri { display: inline-block; width: 16px; color: var(--texto-2); font-size: 12px; }
.vacio-tabla { padding: 48px 16px; color: var(--texto-2); text-align: center; }
textarea.inline, input.inline { width: 100%; border: 0; outline: none; resize: none; padding: 0; margin: 0; background: transparent; font: inherit;
  line-height: inherit; color: inherit; display: block; overflow: hidden; }
input.inline[type=date] { height: 22px; }
.pista { font-size: 11px; color: var(--texto-3); margin-top: 4px; font-weight: 400; white-space: normal; }

/* ── Etiquetas ───────────────────────────────────────────────────────── */
.chip { display: inline-flex; align-items: center; max-width: 100%; height: 20px; padding: 0 7px; border-radius: 4px; font-size: 12px;
  font-weight: 500; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0 4px 0 0; flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 3px 0; }
.tabla .chips { flex-wrap: nowrap; overflow: hidden; }
.c-default { background: var(--c-default-bg); color: var(--c-default-tx); }
.c-gray { background: var(--c-gray-bg); color: var(--c-gray-tx); }
.c-brown { background: var(--c-brown-bg); color: var(--c-brown-tx); }
.c-orange { background: var(--c-orange-bg); color: var(--c-orange-tx); }
.c-yellow { background: var(--c-yellow-bg); color: var(--c-yellow-tx); }
.c-green { background: var(--c-green-bg); color: var(--c-green-tx); }
.c-blue { background: var(--c-blue-bg); color: var(--c-blue-tx); }
.c-purple { background: var(--c-purple-bg); color: var(--c-purple-tx); }
.c-pink { background: var(--c-pink-bg); color: var(--c-pink-tx); }
.c-red { background: var(--c-red-bg); color: var(--c-red-tx); }
.chip.estado::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 6px; flex: none; }
.vinculo { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 0 7px; height: 22px; margin: 0 4px 0 0; border-radius: 4px;
  border: 1px solid var(--linea); background: var(--sup); text-decoration: none; cursor: pointer; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; font-size: 12.5px; flex: none; }
.vinculo:hover { border-color: #9fc9c2; color: var(--acento-2); }
.vinculo .punto { width: 7px; height: 7px; border-radius: 50%; flex: none; background: currentColor; }
.pendiente { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 4px; background: #fdf3e3; color: #8a5300;
  font-size: 12px; font-weight: 600; cursor: pointer; text-decoration: none; border: 1px solid #f0d8a8; white-space: nowrap; flex: none; }
.pendiente::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #d98300; }
.pendiente:hover { background: #fbe9c8; }
.mini-btn { display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 8px; border-radius: 4px; border: 1px solid var(--linea-2);
  background: var(--sup); color: var(--texto-2); font-size: 12px; font-weight: 500; cursor: pointer; white-space: nowrap; flex: none; }
.mini-btn:hover { border-color: var(--acento); color: var(--acento-2); background: var(--acento-suave); }
.mini-btn.mas { border-style: dashed; }
.persona { display: inline-flex; align-items: center; gap: 6px; margin-right: 8px; white-space: nowrap; }
.persona .avatar { width: 20px; height: 20px; font-size: 9.5px; }
.adjunto { display: inline-flex; align-items: center; gap: 4px; margin-right: 8px; white-space: nowrap; }
.candado { color: var(--texto-3); display: inline-flex; }

/* ── Menús desplegables ──────────────────────────────────────────────── */
.pop { position: fixed; z-index: 80; background: var(--sup); border-radius: 8px; box-shadow: var(--sombra-2); border: 1px solid var(--linea);
  min-width: 240px; max-width: min(560px, 96vw); display: flex; flex-direction: column; }
.pop .pop-cab { padding: 10px 12px 4px; font-size: 11px; color: var(--texto-3); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.pop .pop-pie { display: flex; gap: 6px; justify-content: flex-end; align-items: center; padding: 8px; border-top: 1px solid var(--linea); }
.pop .pop-pie .ayuda { margin-right: auto; font-size: 12px; color: var(--texto-3); }
.pop input.filtro { margin: 6px 8px 8px; height: 30px; padding: 0 9px; border: 1px solid var(--linea-2); border-radius: var(--r); outline: none; }
.pop input.filtro:focus { border-color: var(--acento); }
.pop .lista { max-height: 360px; overflow: auto; padding: 0 6px 6px; }
.pop .op { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: var(--r-chico); cursor: pointer; min-height: 30px; }
.pop .op:hover, .pop .op.activo { background: var(--sup-3); }
.pop .op .tilde { width: 16px; color: var(--acento); flex: none; text-align: center; font-weight: 700; }
.pop .op .sub { margin-left: auto; color: var(--texto-3); font-size: 12px; white-space: nowrap; }
.pop .op .mover { margin-left: auto; display: flex; gap: 0; }
.pop .op .mover button { width: 24px; height: 24px; border: 0; background: transparent; border-radius: 4px; cursor: pointer; color: var(--texto-3); }
.pop .op .mover button:hover { background: var(--linea); color: var(--texto); }
.pop .op input[type=checkbox] { accent-color: var(--acento); margin: 0; }
.pop .titulo-grupo { padding: 8px 10px 2px; font-size: 10.5px; color: var(--texto-3); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.pop .simple { margin: 10px; height: 32px; padding: 0 10px; border: 1px solid var(--linea-2); border-radius: var(--r); outline: none; }
.pop .simple:focus { border-color: var(--acento); }
.pop .seleccionados { padding: 2px 10px 0; display: flex; flex-wrap: wrap; gap: 3px; }
.menu .op { padding: 6px 10px; }
.menu .op.peligro { color: var(--peligro); }

/* ── Ficha ───────────────────────────────────────────────────────────── */
.velo { position: fixed; inset: 0; background: rgba(16, 24, 40, .3); z-index: 40; }
.ficha { position: fixed; top: 0; right: 0; bottom: 0; width: min(920px, 100vw); background: var(--fondo); z-index: 41; box-shadow: var(--sombra-2);
  display: flex; flex-direction: column; border-left: 1px solid var(--linea); }
.ficha.animar { animation: entra .16s ease-out; }
@keyframes entra { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.ficha-barra { display: flex; align-items: center; gap: 6px; height: 46px; padding: 0 12px; background: var(--sup); border-bottom: 1px solid var(--linea);
  color: var(--texto-2); font-size: 12.5px; flex: none; }
.ficha-barra .migas { display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; }
.ficha-barra .migas a { cursor: pointer; text-decoration: none; }
.ficha-barra .migas a:hover { color: var(--acento-2); text-decoration: underline; }
.ficha-barra .der { margin-left: auto; display: flex; gap: 2px; }
.ficha-cuerpo { flex: 1; overflow: auto; padding: 0 0 60px; }
.ficha-cab { background: var(--sup); border-bottom: 1px solid var(--linea); padding: 20px 28px 16px; display: grid; grid-template-columns: auto 1fr; gap: 2px 16px; align-items: center; }
.ficha-cab .grande { width: 48px; height: 48px; border-radius: 10px; background: var(--acento); color: #fff; display: grid;
  place-items: center; font-size: 17px; font-weight: 650; grid-row: span 2; letter-spacing: .02em; }
.ficha-cab .tipo { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--texto-3); font-weight: 600; align-self: end; }
.ficha h2.titulo { font-size: 22px; line-height: 1.25; font-weight: 650; margin: 0 0 0 -6px; padding: 2px 6px; border-radius: var(--r);
  cursor: text; letter-spacing: -.01em; align-self: start; }
.ficha h2.titulo:hover { background: var(--sup-3); }
.ficha h2.titulo.editando { box-shadow: 0 0 0 2px var(--acento); background: var(--sup); }
.fijos { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0; margin-top: 14px; border: 1px solid var(--linea); border-radius: 8px; overflow: hidden; }
.fijo { display: flex; flex-direction: column; flex: 1; min-width: 130px; padding: 8px 12px; background: var(--sup-2); border-right: 1px solid var(--linea); }
.fijo:last-child { border-right: 0; }
.fijo .etq { font-size: 10.5px; color: var(--texto-3); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.fijo .val { padding: 2px 0 0; min-height: 24px; font-weight: 600; cursor: text; border-radius: 4px; }
.fijo .val.sel { cursor: pointer; }
.fijo .val.no-edit { cursor: default; }
.fijo .val.editando, .fijo .val.activa { box-shadow: 0 0 0 2px var(--acento); background: var(--sup); padding: 2px 4px; }
.ficha-zona { padding: 16px 28px 0; display: flex; flex-direction: column; gap: 12px; }
.tarjeta { background: var(--sup); border: 1px solid var(--linea); border-radius: 8px; box-shadow: var(--sombra-1); overflow: hidden; }
.tarjeta-cab { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 44px; border-bottom: 1px solid var(--linea); }
.tarjeta-cab h3 { margin: 0; font-size: 13.5px; font-weight: 650; }
.tarjeta-cab .n { color: var(--texto-3); font-size: 12.5px; }
.tarjeta-cab .btn { margin-left: auto; }
.tarjeta-cab.plegable { cursor: pointer; user-select: none; }
.tarjeta-cab .tri { color: var(--texto-3); width: 14px; font-size: 12px; }
.tarjeta.cerrada .tarjeta-cab { border-bottom: 0; }
.tarjeta-vacia { padding: 14px; color: var(--texto-3); }
.mini { display: grid; grid-template-columns: minmax(170px, 2.2fr) 140px 1fr 1fr 92px 48px; gap: 10px; align-items: center; padding: 0 14px; height: 40px;
  border-bottom: 1px solid var(--linea); cursor: pointer; }
.mini:last-child { border-bottom: 0; }
.mini:hover { background: var(--sup-2); }
.mini .m-tit { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini .m-sub { color: var(--texto-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.mini.cerrada { opacity: .6; }
.mini.tarea-mini { grid-template-columns: minmax(170px, 2.5fr) 120px 1fr 90px 92px; }
.ver-mas { padding: 10px 14px; color: var(--texto-2); cursor: pointer; font-size: 12.5px; }
.ver-mas:hover { background: var(--sup-2); color: var(--acento-2); }
.filas { padding: 4px 6px 6px; }
.fila { display: grid; grid-template-columns: 210px 1fr; gap: 6px; align-items: start; border-bottom: 1px solid #f1f3f5; }
.fila:last-child { border-bottom: 0; }
.fila .etq { padding: 8px 8px; color: var(--texto-2); font-size: 12.5px; display: flex; gap: 5px; align-items: flex-start; }
.fila .etq .info { cursor: help; color: var(--texto-3); }
.fila .val { padding: 7px 10px; border-radius: var(--r-chico); min-height: 34px; cursor: text; white-space: pre-line; word-break: break-word; }
.fila .val.sel { cursor: pointer; }
.fila .val:not(.no-edit):hover { background: var(--sup-3); }
.fila .val.no-edit { cursor: default; color: #46515c; }
.fila .val.editando, .fila .val.activa { box-shadow: 0 0 0 2px var(--acento); background: var(--sup); }
.archivos-lista { display: flex; flex-direction: column; gap: 3px; }
.archivos-lista .arch { display: flex; align-items: center; gap: 8px; }
.archivos-lista .arch a { text-decoration: none; color: var(--acento-2); }
.archivos-lista .arch a:hover { text-decoration: underline; }
.archivos-lista .arch .tam { color: var(--texto-3); font-size: 12px; }
.historial { font-size: 12.5px; padding: 2px 14px 8px; }
.historial .h { display: grid; grid-template-columns: 124px 150px 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--linea); }
.historial .h:last-child { border-bottom: 0; }
.historial .h .cuando { color: var(--texto-2); }
.historial .h .que { white-space: pre-line; word-break: break-word; }
.historial .h del { color: var(--texto-3); }
.pie-ficha { color: var(--texto-3); font-size: 12px; padding: 14px 30px 0; }

/* ── Modales ─────────────────────────────────────────────────────────── */
.modal-velo { position: fixed; inset: 0; background: rgba(16, 24, 40, .4); z-index: 90; display: grid; place-items: start center; padding: 8vh 12px; overflow: auto; }
.modal { background: var(--sup); border-radius: 10px; box-shadow: var(--sombra-2); width: min(540px, 100%); }
.modal.ancho { width: min(880px, 100%); }
.modal h3 { margin: 0; padding: 18px 20px 4px; font-size: 16px; font-weight: 650; }
.modal .m-sub { padding: 0 20px; color: var(--texto-2); font-size: 12.5px; margin: 0; }
.modal .m-cuerpo { padding: 12px 20px 4px; }
.modal .m-pie { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--linea); margin-top: 6px; }
.campo-form { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; position: relative; }
.campo-form label { font-size: 12px; color: var(--texto-2); font-weight: 600; }
.campo-form input, .campo-form select, .campo-form textarea { height: 36px; padding: 0 10px; border: 1px solid var(--linea-2); border-radius: var(--r);
  outline: none; background: var(--sup); width: 100%; }
.campo-form textarea { height: 80px; padding: 8px 10px; resize: vertical; }
.campo-form input:focus, .campo-form select:focus, .campo-form textarea:focus { border-color: var(--acento); box-shadow: 0 0 0 3px var(--foco); }
.dos { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.aviso { padding: 9px 12px; border-radius: var(--r); background: #fdf3e3; color: #7a4a00; font-size: 12.5px; margin-bottom: 12px; border: 1px solid #f0d8a8; }
.aviso.error { background: #fdecea; color: #8e2a22; border-color: #f3c4bf; }
.aviso a { font-weight: 600; cursor: pointer; text-decoration: underline; }
.autocomp { position: absolute; top: 100%; margin-top: 4px; left: 0; right: 0; background: var(--sup); box-shadow: var(--sombra-2); border-radius: 8px; z-index: 5;
  max-height: 230px; overflow: auto; padding: 4px; border: 1px solid var(--linea); }
.autocomp div { padding: 7px 9px; border-radius: var(--r-chico); cursor: pointer; }
.autocomp div:hover, .autocomp div.activo { background: var(--sup-3); }
.elegidos { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.elegidos:empty { display: none; }
.elegido { display: inline-flex; align-items: center; gap: 2px; padding: 2px 3px 2px 9px; border-radius: 4px; background: var(--acento-suave);
  color: var(--acento-2); font-size: 12.5px; font-weight: 500; }
.elegido button { border: 0; background: transparent; cursor: pointer; color: inherit; width: 20px; height: 20px; border-radius: 4px; padding: 0; }
.elegido button:hover { background: rgba(0,0,0,.08); }
.tabla-simple { width: 100%; border-collapse: collapse; font-size: 13px; }
.tabla-simple th, .tabla-simple td { text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--linea); }
.tabla-simple th { color: var(--texto-2); font-weight: 600; font-size: 11.5px; }
.tabla-simple input, .tabla-simple select { height: 30px; border: 1px solid var(--linea-2); border-radius: var(--r); padding: 0 8px; width: 100%; }
.clave-temp { font: 600 18px ui-monospace, Menlo, monospace; background: var(--sup-3); padding: 10px 12px; border-radius: var(--r); letter-spacing: .06em; user-select: all; }

/* ── Ingreso ─────────────────────────────────────────────────────────── */
.ingreso { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--fondo); }
.ingreso form { width: min(380px, 100%); background: var(--sup); padding: 28px 26px 22px; border-radius: 10px; box-shadow: var(--sombra-2); border: 1px solid var(--linea); }
.ingreso .marca { padding: 0 0 16px; color: var(--texto); }
.ingreso .marca small { color: var(--texto-3); }
.ingreso p { margin: 0 0 18px; color: var(--texto-2); }
.ingreso .btn { width: 100%; justify-content: center; height: 38px; }

/* ── Avisos ──────────────────────────────────────────────────────────── */
#toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--lateral); color: #fff; padding: 9px 14px; border-radius: 8px; font-size: 13px; box-shadow: var(--sombra-2); max-width: 90vw; }
.toast.error { background: #9a3029; }

@media (max-width: 860px) {
  .app, .app.plegada { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: auto; }
  .lateral { flex-direction: row; align-items: center; padding: 8px 10px; gap: 2px; overflow-x: auto; }
  .marca { padding: 0 8px 0 0; }
  .marca small, .marca .plegar, .nav-tit, .lateral a.mod .n, .usuario-btn .txt { display: none; }
  .lateral .pie { margin: 0 0 0 auto; border: 0; padding: 0; }
  .lateral a.mod.activo::before { display: none; }
  .contenido { height: calc(100vh - 52px); }
  .cabecera { flex-wrap: wrap; padding: 12px 14px; gap: 10px; }
  .buscador-global { width: 100%; margin: 0; order: 3; }
  .buscador-global kbd { display: none; }
  .pestanas { padding: 0 14px; }
  .panel { margin: 10px 8px; }
  .busca-vista input { width: 170px; }
  .ficha-cab { padding: 16px; }
  .ficha-zona { padding: 14px 10px 0; }
  .fila { grid-template-columns: 1fr; gap: 0; }
  .fila .etq { padding-bottom: 0; }
  .mini { grid-template-columns: 1fr 120px; }
  .mini .m-sub { display: none; }
  .dos { grid-template-columns: 1fr; }
  .historial .h { grid-template-columns: 1fr; gap: 0; }
}

.pop .solo-lectura { padding: 6px 12px 10px; white-space: pre-line; word-break: break-word; max-height: 55vh; overflow: auto; font-size: 13px; line-height: 1.55; }
.tabla td.no-edit .cel { cursor: zoom-in; }
