/* Bitácora — negro, grises y un amarillo apagado. */

:root {
  --bg: #0E0E0D;
  --panel: #151514;
  --panel-2: #1B1B19;
  --hover: #1E1E1C;
  --linea: #252523;
  --linea-2: #34332F;
  --texto: #ECEAE3;
  --texto-2: #A6A49B;
  --texto-3: #6F6D66;
  --acento: #E2CD7C;
  --acento-texto: #E2CD7C;
  --acento-suave: rgba(226, 205, 124, .11);
  --acento-medio: rgba(226, 205, 124, .38);
  --sobre-acento: #17150C;
  --alerta: #D39479;
  --velo: rgba(0, 0, 0, .45);
  --sombra: 0 24px 70px rgba(0, 0, 0, .55);
  --r: 6px;
  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  color-scheme: dark;
}

:root[data-tema="claro"] {
  --bg: #ECECE9;
  --panel: #F6F6F4;
  --panel-2: #FFFFFF;
  --hover: #EFEFEC;
  --linea: #DEDDD8;
  --linea-2: #CBCAC3;
  --texto: #161614;
  --texto-2: #5E5D56;
  --texto-3: #96948B;
  --acento: #DCC25C;
  --acento-texto: #8A7317;
  --acento-suave: rgba(214, 186, 72, .17);
  --acento-medio: rgba(190, 160, 50, .5);
  --sobre-acento: #1A1708;
  --alerta: #B05A3E;
  --velo: rgba(30, 30, 25, .22);
  --sombra: 0 24px 70px rgba(30, 30, 20, .16);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--texto);
  font: 14px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.mono { font-family: var(--mono); font-feature-settings: 'tnum'; }
::selection { background: var(--acento-medio); }

input, select, textarea {
  background: var(--panel-2);
  border: 1px solid var(--linea);
  border-radius: var(--r);
  padding: 7px 10px;
  outline: none;
  transition: border-color .15s, background .15s;
  min-width: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--acento-medio); }
input::placeholder, textarea::placeholder { color: var(--texto-3); }
input[type="date"] { font-family: var(--mono); font-size: 12.5px; }
::-webkit-calendar-picker-indicator { opacity: .5; cursor: pointer; }
input[list]::-webkit-calendar-picker-indicator { display: none !important; }
:root:not([data-tema="claro"]) ::-webkit-calendar-picker-indicator { filter: invert(1); }
select { appearance: none; padding-right: 26px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--texto-3) 50%), linear-gradient(135deg, var(--texto-3) 50%, transparent 50%);
  background-position: calc(100% - 13px) 50%, calc(100% - 9px) 50%;
  background-size: 4px 4px; background-repeat: no-repeat;
}

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--r);
  border: 1px solid var(--linea-2); color: var(--texto);
  font-weight: 500; white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--hover); }
.btn.primario { background: var(--acento); border-color: var(--acento); color: var(--sobre-acento); }
.btn.primario:hover { filter: brightness(1.06); }
.btn.peligro { border-color: transparent; color: var(--texto-3); padding-left: 0; }
.btn.peligro:hover { color: var(--alerta); background: none; }

.icono {
  width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: var(--r); color: var(--texto-2);
}
.icono:hover { background: var(--hover); color: var(--texto); }

.punto {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--c, var(--texto-3)); flex: none;
}

/* ── barra superior ─────────────────────────────────────── */

.barra {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: 240px minmax(0, 1fr) auto; align-items: center; gap: 24px;
  height: 60px; padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--linea);
}
.marca { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 6px; min-width: 0; }
/* Logo oficial de LaFama BanX: letras blancas sobre oscuro, negras sobre claro; la X siempre amarilla */
.logo-lafama { display: block; height: 19px; width: auto; aspect-ratio: 3756.8 / 489; flex: none; fill: currentColor; stroke: none; color: #FFFFFF; }
:root[data-tema="claro"] .logo-lafama { color: #0A0A0A; }
.marca small { display: block; font: 500 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--texto-3); }

.buscar {
  display: flex; align-items: center; gap: 8px; max-width: 520px; width: 100%;
  background: var(--panel); border: 1px solid var(--linea); border-radius: var(--r);
  padding: 0 10px; color: var(--texto-3);
}
.buscar:focus-within { border-color: var(--acento-medio); }
.buscar input { border: 0; background: none; padding: 8px 0; flex: 1; }
.buscar input::-webkit-search-cancel-button { filter: grayscale(1); opacity: .5; }
kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--linea-2); border-radius: 4px; padding: 0 5px; color: var(--texto-3); }

.barra-der { display: flex; align-items: center; gap: 14px; }
.sync { display: inline-flex; align-items: center; gap: 7px; font: 11.5px var(--mono); color: var(--texto-3); white-space: nowrap; }
.sync i { width: 6px; height: 6px; border-radius: 50%; background: var(--texto-3); }
.sync[data-estado="ok"] i { background: var(--acento); }
.sync[data-estado="guardando"] i { background: var(--acento); animation: latido 1s infinite; }
.sync[data-estado="error"], .sync[data-estado="disco"] { color: var(--alerta); }
.sync[data-estado="error"] i, .sync[data-estado="disco"] i { background: var(--alerta); }
@keyframes latido { 50% { opacity: .25; } }

/* ── estructura ─────────────────────────────────────────── */

.cuerpo {
  display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px;
  padding: 24px; max-width: 1480px; margin: 0 auto;
}
.lateral { position: sticky; top: 84px; align-self: start; display: flex; flex-direction: column; gap: 26px; max-height: calc(100vh - 108px); overflow: auto; scrollbar-width: none; }
.sec-cab {
  display: flex; align-items: center; justify-content: space-between;
  font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase;
  color: var(--texto-3); margin-bottom: 8px; padding: 0 8px;
}
.mini {
  font: 500 11px var(--mono); letter-spacing: .02em; text-transform: none; color: var(--acento-texto);
  padding: 3px 8px; border-radius: 4px; border: 1px solid color-mix(in srgb, var(--acento) 35%, transparent);
}
.mini:hover { background: var(--acento-suave); }

.lista-lat { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.lista-lat li { position: relative; }
.item {
  width: 100%; display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; column-gap: 10px;
  padding: 7px 8px; border-radius: var(--r); text-align: left; color: var(--texto-2);
}
.item:hover { background: var(--hover); color: var(--texto); }
.item.activo { background: var(--panel-2); color: var(--texto); box-shadow: inset 0 0 0 1px var(--linea); }
.item .nombre { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .cnt { font: 11.5px var(--mono); color: var(--texto-3); }
.item .punto.todas { background: none; box-shadow: inset 0 0 0 1.5px var(--texto-3); }
.item .punto.nadie { background: none; box-shadow: inset 0 0 0 1.5px var(--linea-2); }
.item .punto.cuadro { border-radius: 2px; background: var(--linea-2); }
.mini-barra { grid-column: 2 / 4; height: 2px; background: var(--linea); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.mini-barra i { display: block; height: 100%; background: var(--c); border-radius: 2px; }

.persona .item { padding-right: 38px; }
.persona .editar {
  position: absolute; right: 4px; top: 4px; width: 26px; height: 26px; display: grid; place-items: center;
  border-radius: 5px; color: var(--texto-3); background: var(--panel-2); opacity: .55;
  transition: opacity .12s;
}
.persona:hover .editar, .persona .editar:focus-visible { opacity: 1; }
.agregar-persona {
  width: 100%; margin-top: 6px; padding: 7px 8px; border: 1px dashed var(--linea-2); border-radius: var(--r);
  color: var(--texto-3); font-size: 13px; text-align: left; display: flex; align-items: center; gap: 8px;
}
.agregar-persona:hover { color: var(--acento-texto); border-color: var(--acento-medio); }
.agregar-persona svg { width: 14px; height: 14px; }
.persona .editar:hover { color: var(--texto); }
.persona .editar svg { width: 14px; height: 14px; }

.sec-datos { display: flex; flex-direction: column; gap: 2px; }
.enlace-lat { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: var(--r); color: var(--texto-2); text-align: left; font-size: 13px; }
.enlace-lat:hover { background: var(--hover); color: var(--texto); }
.enlace-lat svg { width: 14px; height: 14px; color: var(--texto-3); }

.principal { min-width: 0; display: flex; flex-direction: column; gap: 16px; }

/* ── resumen ────────────────────────────────────────────── */

.resumen {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.5fr);
  border: 1px solid var(--linea); border-radius: 8px; background: var(--panel); overflow: hidden;
}
.stat {
  display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; text-align: left;
  border-right: 1px solid var(--linea); position: relative; transition: background .15s;
}
.stat:hover { background: var(--hover); }
.stat::after { content: ''; position: absolute; left: 18px; right: 18px; bottom: 0; height: 2px; background: transparent; }
.stat.activo::after { background: var(--acento); }
.stat-n { font: 500 26px/1 var(--mono); letter-spacing: -.03em; }
.stat-l { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--texto-2); }
.stat-l svg { width: 13px; height: 13px; }
.st-pendiente .stat-l svg { color: var(--texto-3); }
.st-proceso .stat-l svg, .st-completo .stat-l svg { color: var(--acento); }
.avance { padding: 16px 18px; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.avance-cab { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; color: var(--texto-2); }
.avance-cab .mono { font-size: 20px; color: var(--texto); letter-spacing: -.03em; }
.barra-seg { display: flex; gap: 2px; height: 6px; border-radius: 3px; overflow: hidden; background: var(--linea); }
.barra-seg i { display: block; min-width: 0; }
.seg-completo { background: var(--acento); }
.seg-proceso { background: var(--acento-medio); }
.seg-pendiente { background: var(--linea-2); }
.avance-ley { display: flex; gap: 14px; font: 11px var(--mono); color: var(--texto-3); }
.avance-ley span { display: inline-flex; align-items: center; gap: 5px; }
.avance-ley i { width: 7px; height: 7px; border-radius: 2px; }

/* ── alta rápida ────────────────────────────────────────── */

.rapida {
  display: grid; grid-template-columns: auto minmax(0, 1fr) 170px 150px 142px auto; gap: 8px; align-items: center;
  padding: 8px; border: 1px solid var(--linea); border-radius: 8px; background: var(--panel);
}
.rapida:focus-within { border-color: var(--linea-2); }
.r-titulo { border-color: transparent; background: transparent; font-size: 14.5px; padding-left: 6px; }
.r-titulo:focus { border-color: transparent; }
.r-persona, .sel-persona { position: relative; display: block; }
.r-persona .punto, .sel-persona .punto { position: absolute; left: 11px; top: 50%; margin-top: -4px; pointer-events: none; }
.r-persona select, .sel-persona select { width: 100%; padding-left: 27px; }

/* ── pastillas de estado ────────────────────────────────── */

.pastilla {
  display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 10px 0 8px;
  border-radius: 5px; font-size: 12.5px; font-weight: 500; white-space: nowrap;
  border: 1px solid var(--linea-2); color: var(--texto-2); background: transparent;
  transition: background .15s, border-color .15s, color .15s;
}
.pastilla svg { width: 14px; height: 14px; }
.pastilla:hover { border-color: var(--texto-3); }
.p-proceso { background: var(--acento-suave); border-color: var(--acento-medio); color: var(--acento-texto); }
.p-proceso:hover { border-color: var(--acento); }
.p-completo { background: var(--acento); border-color: var(--acento); color: var(--sobre-acento); }
.p-completo:hover { border-color: var(--acento); filter: brightness(1.05); }
.ic-ok { stroke: var(--ic-ok, var(--panel)); }
.p-completo { --ic-ok: var(--acento); }

/* ── controles ──────────────────────────────────────────── */

.controles { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; min-height: 32px; }
.seg { display: inline-flex; padding: 2px; gap: 2px; border: 1px solid var(--linea); border-radius: 7px; background: var(--panel); }
.seg button { padding: 5px 12px; border-radius: 5px; color: var(--texto-3); font-size: 13px; }
.seg button:hover { color: var(--texto); }
.seg button.activo { background: var(--panel-2); color: var(--texto); box-shadow: 0 0 0 1px var(--linea-2); }
.agrupar { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--texto-3); }
.agrupar select { padding-top: 5px; padding-bottom: 5px; font-size: 13px; }
.filtros { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; align-items: center; }
.filtro {
  display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 6px 0 9px;
  border: 1px solid var(--linea-2); border-radius: 5px; font-size: 12.5px; color: var(--texto-2);
}
.filtro:hover { color: var(--texto); border-color: var(--texto-3); }
.filtro svg { width: 12px; height: 12px; color: var(--texto-3); }
.limpiar { font: 12px var(--mono); color: var(--texto-3); padding: 4px 6px; }
.limpiar:hover { color: var(--texto); }

/* ── lista ──────────────────────────────────────────────── */

.grupo { margin-bottom: 22px; }
.grupo-cab {
  display: flex; align-items: center; gap: 9px; padding: 0 2px 8px;
  font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--texto-2);
}
.grupo-cab .regla { flex: 1; height: 1px; background: var(--linea); }
.grupo-cab .meta { color: var(--texto-3); letter-spacing: .02em; text-transform: none; }
.grupo-cab svg { width: 13px; height: 13px; }

.filas { border: 1px solid var(--linea); border-radius: 8px; background: var(--panel); overflow: hidden; }
.fila {
  display: grid; grid-template-columns: 124px minmax(0, 1fr) 150px 132px; align-items: center; gap: 14px;
  padding: 9px 14px 9px 12px; border-top: 1px solid var(--linea); cursor: pointer;
  box-shadow: inset 3px 0 0 var(--c, transparent);
  background-image: linear-gradient(90deg, color-mix(in srgb, var(--c, transparent) 10%, transparent), transparent 60%);
  transition: background-color .12s;
}
.fila:first-child { border-top: 0; }
.fila:hover, .fila.abierta { background-color: var(--hover); }
.fila:focus-visible { outline: 1px solid var(--acento-medio); outline-offset: -1px; }
.f-titulo { display: flex; align-items: center; gap: 9px; min-width: 0; }
.f-titulo .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fila.hecha .f-titulo .t { color: var(--texto-2); }
.sin-titulo { color: var(--texto-3); }
.tag {
  flex: none; font: 500 10.5px var(--mono); letter-spacing: .05em; text-transform: uppercase;
  color: var(--texto-3); border: 1px solid var(--linea-2); border-radius: 4px; padding: 1px 6px; max-width: 160px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nota-ic { color: var(--texto-3); display: inline-flex; }
.nota-ic svg { width: 13px; height: 13px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; min-width: 0; max-width: 100%;
  font-size: 12.5px; color: var(--texto-2);
}
.chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.lleno {
  padding: 2px 9px 2px 7px; border-radius: 5px;
  background: color-mix(in srgb, var(--c) 20%, transparent); color: var(--texto);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 30%, transparent);
}
.nadie { color: var(--texto-3); font-size: 12.5px; }
.f-fecha { font-size: 12px; color: var(--texto-2); text-align: right; white-space: nowrap; }
.vencida { color: var(--alerta); }

.vacio {
  border: 1px dashed var(--linea-2); border-radius: 8px; padding: 48px 24px; text-align: center; color: var(--texto-3);
}
.vacio strong { display: block; color: var(--texto); font-weight: 500; font-size: 15px; margin-bottom: 6px; }
.vacio p { margin: 0 auto; max-width: 420px; }
.vacio .btn { margin-top: 16px; }

/* ── tablero ────────────────────────────────────────────── */

.tablero { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.columna {
  border: 1px solid var(--linea); border-radius: 8px; background: var(--panel);
  display: flex; flex-direction: column; min-height: 160px; transition: border-color .15s, background .15s;
}
.columna.encima { border-color: var(--acento-medio); background: var(--acento-suave); }
.col-cab {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--linea);
  font-weight: 500; font-size: 13px;
}
.col-cab .mono { margin-left: auto; color: var(--texto-3); font-size: 12px; }
.col-pendiente .col-cab svg { color: var(--texto-3); }
.col-proceso .col-cab svg, .col-completo .col-cab svg { color: var(--acento); }
.col-cuerpo { padding: 8px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.col-vacia { margin: 0; padding: 22px 8px; text-align: center; font-size: 12.5px; color: var(--texto-3); }
.tarjeta {
  background: var(--panel-2); border: 1px solid var(--linea); border-radius: 6px; padding: 10px 12px 10px 13px;
  box-shadow: inset 3px 0 0 var(--c, transparent); cursor: grab;
  background-image: linear-gradient(90deg, color-mix(in srgb, var(--c, transparent) 10%, transparent), transparent 70%); display: flex; flex-direction: column; gap: 8px;
}
.tarjeta:hover { border-color: var(--linea-2); }
.tarjeta.abierta { border-color: var(--acento-medio); }
.tarjeta.arrastrando { opacity: .4; }
.tarjeta .t { line-height: 1.35; }
.tarjeta.hecha .t { color: var(--texto-2); }
.tarjeta-pie { display: flex; align-items: center; gap: 8px; justify-content: space-between; min-width: 0; }
.tarjeta-pie .f-fecha { font-size: 11.5px; }
.tarjeta .tag { align-self: flex-start; }

/* ── panel lateral (detalle) ────────────────────────────── */

.velo { position: fixed; inset: 0; z-index: 30; background: var(--velo); opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; }
.velo.visible { opacity: 1; visibility: visible; }
.panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 31; width: min(520px, 100vw);
  background: var(--panel); border-left: 1px solid var(--linea); box-shadow: var(--sombra);
  display: flex; flex-direction: column;
  transform: translateX(104%); visibility: hidden; transition: transform .24s cubic-bezier(.2, .8, .2, 1), visibility .24s;
}
.panel.visible { transform: none; visibility: visible; }
.panel-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--linea); }
.panel-cab .mono { font-size: 11.5px; color: var(--texto-3); }
.panel-cuerpo { flex: 1; overflow: auto; padding: 18px 22px 28px; display: flex; flex-direction: column; gap: 18px; }
.panel-cuerpo > * { flex: none; }
.seg-estado { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
.seg-estado button { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 7px 8px; color: var(--texto-2); }
.seg-estado button svg { width: 14px; height: 14px; }
.seg-estado button.activo.e-pendiente { background: var(--panel-2); color: var(--texto); }
.seg-estado button.activo.e-proceso { background: var(--acento-suave); color: var(--acento-texto); box-shadow: 0 0 0 1px var(--acento-medio); }
.seg-estado button.activo.e-completo { background: var(--acento); color: var(--sobre-acento); box-shadow: none; --ic-ok: var(--acento); }
.seg-estado button.e-proceso svg, .seg-estado button.e-completo svg { color: var(--acento); }
.seg-estado button.activo.e-completo svg { color: inherit; }
.p-titulo {
  width: 100%; resize: none; overflow: hidden; border: 0; background: none; padding: 0;
  font-size: 21px; font-weight: 600; letter-spacing: -.015em; line-height: 1.3;
}
.campos { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.campo dd { margin: 0; }
.campo input, .campo select { width: 100%; }
.etiqueta, .campo dt {
  display: block; font: 500 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--texto-3);
}
.p-notas { width: 100%; min-height: 180px; resize: vertical; line-height: 1.55; padding: 10px 12px; }
.bloque { display: flex; flex-direction: column; gap: 8px; }
.enlaces { display: flex; flex-direction: column; gap: 4px; }
.enlaces a {
  display: flex; align-items: center; gap: 8px; color: var(--acento-texto); text-decoration: none; font-size: 12.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.enlaces a:hover { text-decoration: underline; }
.enlaces svg { width: 13px; height: 13px; }
.historial { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 1px solid var(--linea-2); display: flex; flex-direction: column; gap: 10px; }
.historial li { position: relative; font-size: 13px; color: var(--texto-2); }
.historial li::before {
  content: ''; position: absolute; left: -18px; top: 6px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--panel); box-shadow: inset 0 0 0 1.5px var(--texto-3);
}
.historial li.h-estado::before { box-shadow: inset 0 0 0 1.5px var(--acento); }
.historial li.h-completo::before { background: var(--acento); box-shadow: none; }
.historial b { color: var(--texto); font-weight: 500; }
.historial time { display: block; font: 11px var(--mono); color: var(--texto-3); margin-bottom: 1px; }
.panel-pie { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--linea); font-size: 11.5px; color: var(--texto-3); }
.borrar { color: var(--texto-3); font-size: 12.5px; padding: 6px 8px; border-radius: 5px; display: inline-flex; gap: 6px; align-items: center; }
.borrar svg { width: 14px; height: 14px; }
.borrar:hover { color: var(--alerta); }
.borrar.confirmar { color: var(--sobre-acento); background: var(--alerta); }

/* ── diálogos ───────────────────────────────────────────── */

.dialogo {
  width: min(400px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--linea-2); border-radius: 10px;
  background: var(--panel); color: var(--texto); box-shadow: var(--sombra);
}
.dialogo::backdrop { background: var(--velo); }
.dialogo form { padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.dialogo h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.dialogo p { margin: 0; color: var(--texto-2); }
.dialogo.chico { width: min(380px, calc(100vw - 32px)); }
.dialogo .etiqueta { margin-top: 4px; }
.muestras { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.dp-ayuda { font-size: 12.5px; color: var(--texto-3) !important; }
.muestra {
  aspect-ratio: 1; border-radius: 6px; background: var(--c); position: relative;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15);
}
.muestra.activa { box-shadow: 0 0 0 2px var(--panel), 0 0 0 3.5px var(--texto); }
.muestra.libre {
  display: grid; place-items: center; background: var(--panel-2); color: var(--texto-2); overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--linea-2);
}
.muestra.libre.activa { background: var(--c); color: var(--sobre-acento); box-shadow: 0 0 0 2px var(--panel), 0 0 0 3.5px var(--texto); }
.muestra.libre input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; padding: 0; border: 0; }
.dp-vista { padding-top: 6px; }
.dlg-acciones { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.hueco { flex: 1; }

/* ── aviso ──────────────────────────────────────────────── */

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 50; transform: translate(-50%, 16px);
  display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 16px;
  background: var(--texto); color: var(--bg); border-radius: 7px; font-size: 13px; box-shadow: var(--sombra);
  opacity: 0; visibility: hidden; transition: opacity .2s, transform .2s, visibility .2s;
}
.toast.visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.toast button { font: 500 12.5px var(--mono); color: var(--bg); padding: 4px 8px; border-radius: 5px; background: color-mix(in srgb, var(--bg) 14%, transparent); }

/* ── contraseña (versión en la nube) ────────────────────── */

.entrar {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px;
  background: var(--bg);
}
.entrar-caja { width: min(340px, 100%); display: flex; flex-direction: column; gap: 12px; text-align: center; margin-top: -6vh; }
.entrar-caja h1 { margin: 0; line-height: 0; display: flex; justify-content: center; }
.entrar-caja .logo-lafama { height: 32px; }
.entrar-sub { font: 500 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--texto-3); margin: 2px 0 22px; }
.entrar-caja p { margin: 0 0 6px; color: var(--texto-2); text-wrap: balance; }
.entrar-caja input { padding: 10px 12px; }
.entrar-caja .btn { justify-content: center; padding: 10px 14px; }
.entrar-caja .btn:disabled { opacity: .6; cursor: default; }
.e-error { color: var(--alerta) !important; font-size: 12.5px; margin: -2px 0 0 !important; }

/* ── pantallas táctiles ─────────────────────────────────── */

@media (hover: none) {
  .persona .editar { opacity: 1; }
  .buscar kbd { display: none; }
}

/* ── pantallas medianas y teléfono ──────────────────────── */

@media (max-width: 1180px) {
  .rapida { grid-template-columns: auto minmax(0, 1fr) 150px 142px auto; }
  .rapida .r-titulo { grid-column: 2 / 6; }
  .rapida .r-persona { grid-row: 2; grid-column: 1 / 3; }
  .rapida .r-proyecto { grid-row: 2; grid-column: 3; }
  .rapida #r-fecha { grid-row: 2; grid-column: 4; }
  .rapida .btn { grid-row: 2; grid-column: 5; }
  .resumen { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .avance { grid-column: 1 / -1; border-top: 1px solid var(--linea); }
  .stat:nth-child(4) { border-right: 0; }
}

@media (max-width: 900px) {
  .barra { grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; padding: 0 16px; }
  .marca small, .buscar kbd, .sync span { display: none; }
  .sync:is([data-estado="error"], [data-estado="disco"]) span { display: inline; }
  .cuerpo { grid-template-columns: minmax(0, 1fr); padding: 16px; gap: 16px; }
  .lateral { display: contents; }
  .lateral > section { order: 1; min-width: 0; }
  .principal { order: 2; }
  .lateral > .sec-datos { order: 3; padding-top: 8px; border-top: 1px solid var(--linea); }
  .lista-lat { flex-direction: row; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
  .lista-lat li { flex: none; }
  .item { grid-template-columns: 8px auto auto; border: 1px solid var(--linea); padding: 5px 10px; }
  .mini-barra { display: none; }
  .persona .editar { display: none; }
  .persona .item { padding-right: 10px; }
  .agregar-li { display: none; }
  /* en el celular el lápiz aparece al lado de la persona elegida */
  .persona:has(.item.activo) { display: flex; gap: 4px; }
  .persona:has(.item.activo) .editar { display: grid; position: static; width: 32px; height: auto; opacity: 1; border: 1px solid var(--linea); }
  .sec-datos { flex-direction: row; flex-wrap: wrap; }
  .sec-datos .sec-cab { width: 100%; }
  .fila { grid-template-columns: auto minmax(0, 1fr) auto; row-gap: 6px; padding: 11px 14px 11px 12px; }
  .fila .pastilla span { display: none; }
  .fila .pastilla { padding: 0 6px; }
  .fila .f-titulo { flex-wrap: wrap; row-gap: 4px; }
  .fila .f-titulo .t { white-space: normal; }
  .fila .f-persona { grid-column: 2; grid-row: 2; }
  .fila .f-fecha { grid-column: 3; grid-row: 2; }
  .tablero { grid-template-columns: minmax(0, 1fr); }
  .filtros { margin-left: 0; width: 100%; }
}

@media (max-width: 560px) {
  .logo-lafama { height: 14px; }
  .resumen { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--linea); }
  .stat:nth-child(4) { border-right: 0; }
  .rapida { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rapida .r-titulo { grid-column: 1 / 3; grid-row: 1; border-bottom: 1px solid var(--linea); border-radius: 0; padding: 10px 6px; }
  .rapida #r-estado { grid-column: 1; grid-row: 2; height: 36px; justify-content: center; }
  .rapida .r-persona { grid-column: 2; grid-row: 2; }
  .rapida .r-proyecto { grid-column: 1; grid-row: 3; }
  .rapida #r-fecha { grid-column: 2; grid-row: 3; }
  .rapida .btn { grid-column: 1 / 3; grid-row: 4; justify-content: center; }
  .campos { grid-template-columns: 1fr; }
  .panel-cuerpo { padding: 16px; }
}
