/* Finanzas Grupo RyF · blanco minimalista estilo Apple, con el naranja de agenciaryf.com como acento */
:root {
  color-scheme: light;
  --marca: #FF6D1F;
  --marca-hover: #F0600F;
  --marca-suave: rgba(255, 109, 31, 0.12);
  --marca-texto: #D9520B;
  --fondo: #FFFFFF;
  --lateral: #FBFBFD;
  --superficie: #FFFFFF;
  --superficie-2: #FAFAFB;
  --relleno: rgba(118, 118, 128, 0.10);
  --relleno-2: rgba(118, 118, 128, 0.06);
  --linea: #EDEDF0;
  --linea-fuerte: #DCDCE1;
  --texto: #1D1D1F;
  --texto-2: #6E6E73;
  --texto-3: #8E8E93;
  --tinta: #1D1D1F;
  --verde: #248A3D;  --verde-bg: rgba(52, 199, 89, 0.14);
  --ambar: #B25000;  --ambar-bg: rgba(255, 149, 0, 0.15);
  --azul: #0062CC;   --azul-bg: rgba(0, 122, 255, 0.12);
  --rojo: #D70015;   --rojo-bg: rgba(255, 59, 48, 0.12);
  --sombra: 0 0 0 1px #EBEBEF;
  --sombra-alta: 0 20px 60px rgba(0, 0, 0, 0.08), 0 0 0 1px #EBEBEF;
  --radio: 18px;
  --radio-sm: 10px;
  --fuente: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--fuente);
  font-feature-settings: "cv11", "ss01";
  background: var(--fondo);
  color: var(--texto);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--marca-texto); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 32px; font-weight: 600; margin: 0; letter-spacing: -0.035em; line-height: 1.12; }
h2 { font-size: 18px; font-weight: 600; margin: 0 0 12px; letter-spacing: -0.01em; color: var(--texto); }
.num, td.num, th.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.muted, td .muted { color: var(--texto-2); font-size: 12px; }
svg.ic { width: 18px; height: 18px; flex: 0 0 auto; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- estructura ---------- */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.lateral {
  background: var(--lateral);
  border-right: 1px solid var(--linea);
  padding: 18px 12px;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 2px;
}
.marca { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; }
.marca .logo { font-weight: 900; font-size: 22px; letter-spacing: -0.04em; color: var(--texto); line-height: 1; }
.marca .logo b { color: var(--marca); font-weight: 900; }
.marca .app-nombre { font-size: 12px; color: var(--texto-2); border-left: 1px solid var(--linea-fuerte); padding-left: 10px; line-height: 1.2; }
.lateral .grupo { font-size: 11px; font-weight: 600; color: var(--texto-3); padding: 14px 10px 6px; }
.lateral a.nav {
  color: var(--texto); padding: 7px 10px; border-radius: 8px; display: flex; gap: 10px; align-items: center; font-weight: 500; font-size: 13.5px;
}
.lateral a.nav svg { color: var(--texto-3); }
.lateral a.nav.activo svg { color: var(--marca); }
.lateral a.nav:hover { background: var(--relleno-2); text-decoration: none; }
.lateral a.nav.activo { background: var(--relleno); font-weight: 600; }
.lateral .pie { margin-top: auto; display: flex; gap: 10px; align-items: center; padding: 12px 8px 4px; border-top: 1px solid var(--linea); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--marca); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: 0 0 auto; }
.pie .quien { min-width: 0; font-size: 12px; color: var(--texto-2); line-height: 1.3; }
.pie .quien strong { display: block; color: var(--texto); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pie .quien a, .pie .quien button { color: var(--texto-2); background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.pie .quien a:hover, .pie .quien button:hover { color: var(--marca-texto); text-decoration: none; }
.pie form { display: inline; }

main { padding: 44px 56px 80px; max-width: 1320px; width: 100%; }
.cabecera { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 32px; }
.cabecera .sub { color: var(--texto-2); margin-top: 4px; font-size: 14px; }

/* ---------- selector de mes ---------- */
.meses { display: flex; align-items: center; gap: 4px; background: var(--relleno-2); border-radius: var(--radio-sm); padding: 3px; }
.meses select { border: 0; background: transparent; font: inherit; font-weight: 600; color: var(--texto); padding: 5px 8px; width: auto; cursor: pointer; }
.meses select:focus { outline: none; }
.meses .flecha { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; color: var(--texto); font-size: 15px; }
.meses .flecha:hover { background: var(--superficie); box-shadow: var(--sombra); text-decoration: none; }

/* ---------- tarjetas y kpis ---------- */
.tarjeta { background: var(--superficie); border-radius: var(--radio); padding: 24px; box-shadow: var(--sombra); }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid > .tarjeta { align-self: start; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi { background: var(--superficie); border-radius: var(--radio); padding: 20px 22px; box-shadow: var(--sombra); }
.kpi .etq { color: var(--texto-2); font-size: 12.5px; font-weight: 500; }
.kpi .val { font-size: 28px; font-weight: 600; margin-top: 6px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi .det { font-size: 12px; color: var(--texto-2); margin-top: 6px; }
.kpi.destacado .etq::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--marca); margin-right: 7px; vertical-align: 1px; }
.kpi.destacado .etq { color: var(--marca-texto); font-weight: 600; }
.sube { color: var(--verde); font-weight: 600; } .baja { color: var(--rojo); font-weight: 600; }

/* ---------- tablas ---------- */
.tabla-wrap { overflow-x: auto; background: var(--superficie); border-radius: var(--radio); box-shadow: var(--sombra); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--texto-2); font-weight: 600; padding: 12px 14px 10px; border-bottom: 1px solid var(--linea); background: var(--superficie); position: sticky; top: 0; white-space: nowrap; }
th.ordenable { cursor: pointer; user-select: none; }
th.ordenable:hover { color: var(--texto); }
th.ordenable::after { content: " ↕"; opacity: .3; font-size: 11px; }
th[data-dir="asc"] { color: var(--marca-texto); }
th[data-dir="desc"] { color: var(--marca-texto); }
th[data-dir="asc"]::after { content: " ▲"; opacity: 1; font-size: 9px; }
th[data-dir="desc"]::after { content: " ▼"; opacity: 1; font-size: 9px; }
td { padding: 10px 12px; border-bottom: 1px solid var(--linea); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--superficie-2); }
tfoot td { font-weight: 700; border-top: 1px solid var(--linea-fuerte); border-bottom: 0; }
tr.inactivo td { opacity: 0.45; }

/* ---------- controles ---------- */
input, select, textarea {
  font: inherit; color: inherit; border: 1px solid transparent; border-radius: 8px; padding: 7px 10px;
  background: var(--relleno-2); width: 100%; transition: box-shadow .15s, background .15s;
}
input:hover, select:hover, textarea:hover { background: var(--relleno); }
input:focus, select:focus, textarea:focus { outline: none; background: var(--superficie); box-shadow: 0 0 0 3px var(--marca-suave), 0 0 0 1px var(--marca); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--marca); padding: 0; }
td input, td select { padding: 6px 9px; min-width: 0; }
td input.monto { width: 116px; text-align: right; font-variant-numeric: tabular-nums; }
td input.corto, td select.corto { width: 112px; }
td input[type=date] { width: 142px; }
td input:not(.monto):not(.corto):not([type=checkbox]):not([type=date]) { min-width: 160px; }
td .etiqueta-fijo { display: block; margin-top: 3px; }
label { display: block; font-size: 12.5px; color: var(--texto-2); margin-bottom: 5px; font-weight: 500; }
.campo { margin-bottom: 16px; }
.fila-campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--texto); font-size: 14px; }
.check input { width: 18px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: var(--marca); color: #fff;
  border-radius: 980px; padding: 8px 18px; font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap;
  transition: background .15s, transform .05s;
}
.btn:hover { background: var(--marca-hover); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn.sec { background: var(--relleno); color: var(--texto); }
.btn.sec:hover { background: var(--relleno-2); box-shadow: inset 0 0 0 1px var(--linea-fuerte); }
.btn.peq { padding: 4px 11px; font-size: 12px; font-weight: 500; }
.btn.peligro { background: none; color: var(--texto-3); padding: 4px 8px; }
.btn.peligro:hover { background: var(--rojo-bg); color: var(--rojo); box-shadow: none; }
.celda-factura { display: flex; align-items: center; gap: 6px; }
.celda-factura input.corto { width: 80px; }
.celda-factura form { margin: 0; }
.subir-pdf label.btn { margin: 0; color: var(--texto); font-size: 12px; cursor: pointer; }
.subir-pdf label.btn svg, .pdf-adjunto svg { color: var(--marca); }
.pdf-adjunto { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 980px; background: var(--marca-suave); color: var(--marca-texto); font-size: 12px; font-weight: 600; white-space: nowrap; }
.pdf-adjunto:hover { text-decoration: none; background: rgba(255, 109, 31, 0.2); }
.acciones { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* estados (selects tipo cápsula) */
select.estado {
  font-weight: 600; font-size: 12px; border-radius: 980px; padding: 4px 26px 4px 11px; width: auto; border: 0;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
select.estado.e-Pagado, select.estado.e-Entregado { background-color: var(--verde-bg); color: var(--verde); }
select.estado.e-Facturado, select.estado[class*="e-En"] { background-color: var(--azul-bg); color: var(--azul); }
select.estado.e-Pendiente { background-color: var(--ambar-bg); color: var(--ambar); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 980px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.chip.verde { background: var(--verde-bg); color: var(--verde); }
.chip.ambar { background: var(--ambar-bg); color: var(--ambar); }
.chip.rojo { background: var(--rojo-bg); color: var(--rojo); }
.chip.gris { background: var(--relleno); color: var(--texto-2); }

.barra { height: 6px; background: var(--relleno); border-radius: 99px; overflow: hidden; }
.barra > div { height: 100%; background: var(--marca); border-radius: 99px; }

.avisos { margin-bottom: 18px; display: grid; gap: 8px; }
.aviso { padding: 11px 16px; border-radius: 12px; background: var(--verde-bg); color: var(--verde); font-weight: 500; }
.aviso.error { background: var(--rojo-bg); color: var(--rojo); }
.guardado { animation: guardado 1.1s ease; }
@keyframes guardado { 0% { box-shadow: 0 0 0 3px rgba(52, 199, 89, .45); } 100% { box-shadow: 0 0 0 0 transparent; } }
.error-campo { box-shadow: 0 0 0 2px var(--rojo) !important; }

.lista-simple { list-style: none; margin: 0; padding: 0; }
.lista-simple li { padding: 8px 0; border-bottom: 1px solid var(--linea); display: flex; justify-content: space-between; gap: 10px; }
.lista-simple li:last-child { border-bottom: 0; }

details.panel-form { background: var(--superficie); border-radius: var(--radio); padding: 14px 18px; margin-bottom: 16px; box-shadow: var(--sombra); }
details.panel-form summary { cursor: pointer; font-weight: 600; color: var(--marca-texto); list-style: none; }
details.panel-form summary::-webkit-details-marker { display: none; }
details.panel-form[open] summary { margin-bottom: 16px; }

/* control segmentado (pestañas, filtros) */
.tabs, .segmentado { display: inline-flex; gap: 2px; padding: 3px; background: var(--relleno-2); border-radius: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs a, .segmentado button {
  padding: 5px 13px; border-radius: 8px; color: var(--texto); font-weight: 500; font-size: 13px; border: 0; background: none; font-family: inherit; cursor: pointer;
}
.tabs a:hover, .segmentado button:hover { text-decoration: none; background: var(--relleno-2); }
.tabs a.activo, .segmentado button.activo { background: var(--superficie); box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 0 0 .5px rgba(0,0,0,.04); font-weight: 600; }
.segmentado { margin-bottom: 0; }

/* ---------- gráfico ---------- */
.grafico-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.grafico-cab h2 { margin: 0; }
.grafico-cab .sub { color: var(--texto-2); font-size: 12.5px; margin-top: 2px; }
.filtros { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.leyenda { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 10px; }
.leyenda button {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 980px; border: 0;
  background: var(--relleno-2); color: var(--texto); font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer;
}
.leyenda button .punto { width: 10px; height: 10px; border-radius: 3px; }
.leyenda button.linea .punto { height: 3px; border-radius: 2px; width: 14px; }
.leyenda button.apagado { opacity: .4; }
.leyenda button.apagado .punto { background: var(--texto-3) !important; }
.leyenda button:hover { background: var(--relleno); }
.grafico-caja { position: relative; height: 300px; }
.tabla-grafico { margin-top: 12px; max-height: 320px; overflow: auto; }
.tabla-grafico[hidden] { display: none; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: #FBFBFD; }
.login .caja { position: relative; background: var(--superficie); border-radius: 24px; padding: 44px 40px; width: 100%; max-width: 380px; box-shadow: var(--sombra-alta); }
.login .marca { padding: 0 0 24px; }
.login h1 { font-size: 22px; margin-bottom: 4px; }

/* ---------- celular ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .lateral { position: sticky; top: 0; z-index: 10; height: auto; flex-direction: row; overflow-x: auto; padding: 8px 10px; gap: 2px; align-items: center; border-right: 0; border-bottom: 1px solid var(--linea); }
  .marca { padding: 0 8px 0 4px; }
  .marca .app-nombre, .lateral .grupo { display: none; }
  .lateral a.nav { white-space: nowrap; padding: 6px 10px; }
  .lateral a.nav svg { display: none; }
  .lateral .pie { margin: 0 0 0 auto; border: 0; padding: 0 0 0 8px; }
  .pie .quien { display: none; }
  main { padding: 24px 16px 56px; }
  h1 { font-size: 26px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .kpi { padding: 14px; }
  .kpi .val { font-size: 19px; }
  .grafico-caja { height: 240px; }
}

/* Tablas que en pantallas angostas se ven como tarjetas (una por cliente) */
@media (max-width: 760px) {
  table.tarjetas thead { display: none; }
  table.tarjetas, table.tarjetas tbody, table.tarjetas tr, table.tarjetas td { display: block; width: 100%; }
  table.tarjetas tr { padding: 14px 16px; border-bottom: 1px solid var(--linea); }
  table.tarjetas tr:last-child { border-bottom: 0; }
  table.tarjetas td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  table.tarjetas td:first-child { display: block; padding-bottom: 6px; font-size: 15px; }
  table.tarjetas td[data-label]::before { content: attr(data-label); color: var(--texto-2); font-size: 12px; flex: 0 0 auto; }
  table.tarjetas td[data-label] > * { text-align: right; }
  table.tarjetas td input, table.tarjetas td select { max-width: 60%; min-width: 0 !important; }
  table.tarjetas td[data-label="Entrega"] { justify-content: flex-start; flex-wrap: wrap; }
  table.tarjetas td[data-label="Entrega"]::before { margin-right: auto; }
  table.tarjetas td[data-label="Entrega"] .muted { display: inline; margin-left: 4px; }
}

/* ---------- flujo de caja ---------- */
.segmentado a { padding: 5px 13px; border-radius: 8px; color: var(--texto); font-weight: 500; font-size: 13px; }
.segmentado a:hover { text-decoration: none; background: var(--relleno-2); }
.segmentado a.activo { background: var(--superficie); box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 0 0 .5px rgba(0,0,0,.04); font-weight: 600; }
.alerta-flujo { padding: 12px 16px; border-radius: 12px; background: var(--ambar-bg); color: #7A4100; margin-bottom: 14px; font-size: 13.5px; }
.alerta-flujo.roja { background: var(--rojo-bg); color: #9B0010; }
.alerta-flujo a { color: inherit; text-decoration: underline; font-weight: 600; }
.periodos { display: grid; gap: 10px; }
.periodo-cab, .periodo > summary { display: grid; grid-template-columns: minmax(180px, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 16px; align-items: center; }
.periodo-cab { padding: 0 22px; font-size: 12px; color: var(--texto-2); font-weight: 600; }
.periodo { background: var(--superficie); border-radius: var(--radio); box-shadow: var(--sombra); }
.periodo > summary { list-style: none; cursor: pointer; padding: 16px 22px; border-radius: var(--radio); }
.periodo > summary::-webkit-details-marker { display: none; }
.periodo > summary:hover { background: var(--superficie-2); }
.periodo[open] > summary { border-bottom: 1px solid var(--linea); border-radius: var(--radio) var(--radio) 0 0; }
.periodo.actual { box-shadow: 0 0 0 1.5px var(--marca); }
.periodo.bajo { box-shadow: 0 0 0 1.5px var(--rojo); }
.p-nombre { font-weight: 600; display: flex; flex-direction: column; gap: 2px; }
.p-nombre::before { content: "›"; display: none; }
.p-nombre small, .p-cifra small { font-weight: 400; font-size: 12px; color: var(--texto-2); }
.p-cifra { display: flex; flex-direction: column; gap: 2px; align-items: flex-end; text-align: right; }
.p-cifra b { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.tabla-wrap.interna { box-shadow: none; border-radius: 0 0 var(--radio) var(--radio); }
.flecha-mov { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: 11px; font-weight: 700; margin-right: 4px; }
.flecha-mov.entrada { background: var(--verde-bg); color: var(--verde); }
.flecha-mov.salida { background: var(--relleno); color: var(--texto-2); }
.dia-semanal[hidden], .dia-mensual[hidden], .dia-anual[hidden] { display: none; }
td input.dia { width: 64px; min-width: 0 !important; text-align: center; }
.alertas-panel { display: grid; gap: 10px; margin-bottom: 20px; }
@media (max-width: 760px) {
  .periodo-cab { display: none; }
  .periodo > summary { grid-template-columns: 1fr 1fr; gap: 10px 14px; padding: 14px 16px; }
  .p-nombre { grid-column: 1 / -1; }
  .p-cifra { align-items: flex-start; }
  .p-cifra:nth-child(2)::before { content: "Entradas"; font-size: 11px; color: var(--texto-3); }
  .p-cifra:nth-child(3)::before { content: "Salidas"; font-size: 11px; color: var(--texto-3); }
  .p-cifra:nth-child(4)::before { content: "Saldo al cierre"; font-size: 11px; color: var(--texto-3); }
}

label.envio { display: flex; align-items: center; gap: 6px; margin: 6px 0 0; font-size: 11px; color: var(--texto-3); font-weight: 500; }
label.envio input { width: 128px; padding: 3px 6px; font-size: 12px; }

.celda-estado { min-width: 150px; }
.celda-estado .muted, .celda-estado .chip { margin-top: 4px; }

.acciones-fila { display: flex; gap: 12px; margin-top: 5px; }
.acciones-fila form { margin: 0; }
.link-accion { background: none; border: 0; padding: 0; font: inherit; font-size: 12px; color: var(--texto-3); cursor: pointer; white-space: nowrap; }
.link-accion:hover { color: var(--marca-texto); text-decoration: underline; }
.link-accion.peligro:hover { color: var(--rojo); }

/* ---------- planilla (tabla tipo Excel) ---------- */
main.ancho { max-width: none; }
.barra-hoja { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.barra-hoja input[type=search] { width: 280px; }
.barra-hoja .segmentado { margin: 0; }
.barra-hoja .contador { margin-left: auto; color: var(--texto-2); font-size: 12.5px; }
.hoja-wrap { overflow: auto; max-height: calc(100vh - 210px); background: var(--superficie); border-radius: 12px; box-shadow: var(--sombra); }
table.hoja { border-collapse: separate; border-spacing: 0; font-size: 13px; width: max-content; min-width: 100%; }
table.hoja th, table.hoja td { border-right: 1px solid var(--linea); border-bottom: 1px solid var(--linea); padding: 0; height: 34px; white-space: nowrap; vertical-align: middle; }
table.hoja th:last-child, table.hoja td:last-child { border-right: 0; }
table.hoja th { position: sticky; top: 0; z-index: 2; background: #F5F5F7; padding: 0 8px; height: 32px; font-size: 11.5px; color: var(--texto-2); text-transform: none; }
table.hoja td.txt { padding: 0 8px; }
table.hoja td.calc { padding: 0 8px; color: var(--texto-2); background-image: linear-gradient(rgba(0,0,0,.015), rgba(0,0,0,.015)); }
table.hoja .fija { position: sticky; left: 0; z-index: 1; background: var(--superficie); box-shadow: 1px 0 0 var(--linea-fuerte); }
table.hoja th.fija { z-index: 3; background: #F5F5F7; }
table.hoja tbody tr:nth-child(even) td { background-color: #FBFBFC; }
table.hoja tbody tr:hover td { background-color: #FFF6F0; }
table.hoja td input, table.hoja td select {
  border: 0 !important; border-radius: 0 !important; background-color: transparent; height: 33px; padding: 0 8px;
  width: 100% !important; min-width: 0 !important; font-size: 13px; box-shadow: none;
}
table.hoja td input.monto { text-align: right; }
table.hoja td input:hover, table.hoja td select:hover { background-color: rgba(255, 109, 31, 0.06); }
table.hoja td input:focus, table.hoja td select:focus { box-shadow: inset 0 0 0 2px var(--marca) !important; background-color: #fff; outline: none; }
table.hoja td input::placeholder { color: var(--texto-3); }
table.hoja select.estado { font-size: 12.5px; padding: 0 24px 0 8px; background-position: right 8px center; }
table.hoja select.estado.e-Pagado { background-color: var(--verde-bg); }
table.hoja select.estado.e-Facturado { background-color: var(--azul-bg); }
table.hoja select.estado.e-Pendiente { background-color: var(--ambar-bg); }
table.hoja tfoot td { position: sticky; bottom: 0; z-index: 1; background: #F5F5F7; font-weight: 700; padding: 0 8px; border-top: 1px solid var(--linea-fuerte); }
table.hoja tfoot td.fija { z-index: 3; }
table.hoja .nombre { font-weight: 600; display: inline-block; max-width: 210px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
table.hoja .marca-fila { font-size: 10.5px; padding: 1px 6px; margin-left: 4px; vertical-align: middle; }
table.hoja .pdf-celda { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 0 6px; }
table.hoja .pdf-celda form { margin: 0; }
table.hoja .pdf-celda label { cursor: pointer; color: var(--texto-3); font-size: 12px; white-space: nowrap; }
table.hoja .pdf-celda label:hover { color: var(--marca-texto); }
table.hoja .pdf-adjunto { padding: 2px 8px; font-size: 11.5px; }
table.hoja .acciones-celda { display: flex; gap: 10px; padding: 0 8px; }
table.hoja .acciones-celda form { margin: 0; }
table.hoja tr.oculta { display: none; }

/* ---------- ocultar montos (compartir pantalla) ---------- */
.lateral .boton-montos { margin-top: auto; border: 0; background: none; font: inherit; cursor: pointer; text-align: left; width: 100%; }
.lateral .boton-montos + .pie { margin-top: 6px; }
html.sin-montos .lateral .boton-montos { background: var(--marca-suave); color: var(--marca-texto); font-weight: 600; }
html.sin-montos .dinero, html.sin-montos input.monto, html.sin-montos #grafico {
  filter: blur(7px); user-select: none; pointer-events: none;
}
html.sin-montos input.monto { color: transparent; text-shadow: 0 0 9px rgba(0, 0, 0, .55); filter: none; }
table.hoja td input.sin-dato::placeholder { color: var(--rojo); font-weight: 600; }

/* ---------- panel lateral del cliente ---------- */
.chip.azul { background: var(--azul-bg); color: var(--azul); }
.cajon-fondo { position: fixed; inset: 0; background: rgba(0, 0, 0, .18); z-index: 40; }
.cajon { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--superficie); z-index: 41;
  box-shadow: -12px 0 40px rgba(0, 0, 0, .12); overflow-y: auto; animation: entra-cajon .18s ease-out; }
@keyframes entra-cajon { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.cajon-contenido { padding: 26px 28px 40px; }
.cajon-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.cajon-cab h2 { font-size: 22px; margin: 0 0 6px; letter-spacing: -0.02em; }
.cajon-cerrar { border: 0; background: var(--relleno-2); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 14px; color: var(--texto-2); flex: 0 0 auto; }
.cajon-cerrar:hover { background: var(--relleno); color: var(--texto); }
.cajon-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.cajon-kpis > div { background: var(--superficie-2); border-radius: 12px; padding: 12px 14px; box-shadow: 0 0 0 1px var(--linea); display: flex; flex-direction: column; gap: 2px; }
.cajon-kpis > div > span { font-size: 12px; color: var(--texto-2); }
.cajon-kpis strong { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.cajon-kpis small { font-size: 11.5px; color: var(--texto-3); }
.cajon-datos { margin-bottom: 18px; }
.cajon-datos li span:first-child { color: var(--texto-2); }
.cajon-sub { font-size: 15px; margin: 0 0 10px; }
table.hoja .ver-cliente { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--texto); cursor: pointer; text-align: left; }
table.hoja .ver-cliente:hover { color: var(--marca-texto); text-decoration: underline; }

/* ---------- la ganancia es primero ---------- */
.s-ganancia { --c: #FF6D1F; }  .s-dueno { --c: #046BD2; }  .s-impuestos { --c: #1BAF7A; }  .s-operacion { --c: #C98500; }
.reparto { display: grid; gap: 12px; margin-top: 6px; }
.reparto-fila { display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 12px; }
.reparto-etq { font-weight: 600; color: var(--texto-2); font-size: 13px; }
.reparto-barra { display: flex; height: 40px; border-radius: 10px; overflow: hidden; background: var(--relleno-2); gap: 2px; }
.reparto-barra .seg { background: var(--c); color: #fff; display: flex; align-items: center; padding: 0 10px; min-width: 0; }
.reparto-barra .seg span { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.punto { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); margin-right: 6px; vertical-align: 0; }
.sobre .etq-sobre { font-size: 13px; color: var(--texto-2); font-weight: 600; display: flex; align-items: center; }
.sobre-pct { font-size: 34px; font-weight: 600; letter-spacing: -0.03em; margin: 6px 0 10px; }
.sobre-pct small { font-size: 13px; font-weight: 500; color: var(--texto-2); letter-spacing: 0; }
@media (max-width: 900px) {
  .grid[style*="repeat(3"] { grid-template-columns: minmax(0, 1fr) !important; }
}

/* ---------- recuadro para registrar un pago ---------- */
dialog.dialogo { border: 0; border-radius: 18px; padding: 26px 28px 22px; width: min(400px, calc(100vw - 32px)); box-shadow: var(--sombra-alta); }
dialog.dialogo::backdrop { background: rgba(0, 0, 0, .25); }
dialog.dialogo h3 { margin: 0 0 4px; font-size: 19px; letter-spacing: -0.01em; }
dialog.dialogo p { margin: 0 0 16px; }
td input.sin-dato::placeholder { color: var(--rojo); font-weight: 600; }

/* Barra de cambios sin guardar (Guardar / Deshacer) */
.modificado { background-color: #FFF8E1 !important; box-shadow: inset 0 0 0 1.5px #F5B800 !important; }
.barra-cambios { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 18px; border-radius: 14px;
  background: rgba(255,255,255,.96); box-shadow: 0 8px 30px rgba(0,0,0,.16), 0 0 0 1px rgba(0,0,0,.06);
  backdrop-filter: blur(12px); font-size: 14px; max-width: calc(100vw - 32px); }
.barra-cambios[hidden] { display: none; }
.barra-cambios .bc-texto { font-weight: 600; margin-right: 6px; white-space: nowrap; }
.barra-cambios.guardada .bc-texto { color: var(--verde); }
.barra-cambios button[hidden] { display: none; }

/* Abonos de gastos */
details.abonos summary { cursor: pointer; list-style: none; white-space: nowrap; font-size: 13px; }
details.abonos summary::-webkit-details-marker { display: none; }
details.abonos[open] summary { margin-bottom: 6px; }
.abonos-caja { display: grid; gap: 6px; min-width: 260px; padding: 8px; border-radius: 10px; background: var(--relleno); }
.abono-fila { display: grid; grid-template-columns: 56px 1fr auto auto; align-items: center; gap: 8px; font-size: 13px; }
.abono-fila form { margin: 0; }
.abono-nuevo { display: flex; gap: 6px; align-items: center; margin: 0; }
.abono-nuevo input { min-width: 0 !important; width: 100px; padding: 4px 8px; font-size: 13px; }
.abono-nuevo input[type=date] { width: 130px; }
.peq { font-size: 12px; }

/* Conciliación (pestañas, tarjetas, sugerencias) */
.tarjetas-conc { margin-bottom: 22px; }
.kpi-conc { padding: 20px 24px; }
.kpi-conc .kpi-valor { font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.kpi-conc .kpi-etiqueta { margin-top: 4px; font-size: 13.5px; }
.kpi-conc .muted { font-size: 11.5px; }
.caja-conc { background: var(--superficie); border-radius: var(--radio); box-shadow: var(--sombra); overflow: hidden; }
.pestanas-conc { display: flex; align-items: center; gap: 4px; padding: 10px 14px 0; border-bottom: 1px solid var(--linea); flex-wrap: wrap; }
.pestanas-conc > a { position: relative; padding: 10px 16px 12px; color: var(--texto-2); font-size: 14px; border-bottom: 2px solid transparent; text-decoration: none; }
.pestanas-conc > a:hover { color: var(--texto); text-decoration: none; }
.pestanas-conc > a.activo { color: var(--texto); font-weight: 600; border-bottom-color: var(--marca); }
.pestanas-conc .globo { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px;
  border-radius: 9px; background: var(--rojo); color: #fff; font-size: 11px; font-weight: 700; vertical-align: 1px; }
.pestanas-conc .rayo { color: #F5B800; }
.pestanas-conc .filtro-pend { display: inline-flex; align-items: center; gap: 8px; margin-left: 10px; }
.pestanas-conc .casilla { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 5px;
  border: 1.5px solid var(--linea-fuerte); font-size: 12px; color: #fff; }
.pestanas-conc .casilla.marcada { background: var(--marca); border-color: var(--marca); }
.pestanas-conc .derecha { margin: 0 0 8px auto; }
.tabla-conc-wrap { border-radius: 0; box-shadow: none; }
.tabla-conc { width: 100%; }
.tabla-conc td { vertical-align: middle; padding-top: 12px; padding-bottom: 12px; }
.tabla-conc .desc-conc { display: inline-block; max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.tabla-conc tfoot td { background: var(--relleno); }
.estado-conc { min-width: 200px; }
.conc-acciones { display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; }
.rayo-sug { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: #FFF4CC; font-size: 12px; cursor: help; }
.vinculo-conc { max-width: 260px; margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
details.conciliar, details.subir-cartola { position: relative; display: inline-block; text-align: left; }
details.conciliar > summary, details.subir-cartola > summary { list-style: none; }
details.conciliar > summary::-webkit-details-marker, details.subir-cartola > summary::-webkit-details-marker { display: none; }
details > .pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 380px; display: grid; gap: 8px; padding: 14px;
  background: var(--superficie); border-radius: 12px; box-shadow: 0 10px 34px rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.05); }
details > .pop select { width: 100%; }
.sugerencias { padding: 8px 20px 20px; }
.sug-cabecera { display: grid; grid-template-columns: 1fr 34px 1fr 190px; gap: 12px; padding: 12px 4px 4px; font-weight: 600; font-size: 13.5px; }
.sug-par { display: grid; grid-template-columns: 1fr 34px 1fr 190px; gap: 12px; align-items: center; padding: 14px; margin-top: 12px;
  border: 1px solid var(--linea); border-radius: 14px; }
.sug-lado { min-width: 0; display: grid; gap: 6px; padding: 14px 16px; border: 1px solid var(--linea); border-radius: 10px; }
.sug-top { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 14px; }
.sug-fila { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.sug-fila.muted { font-size: 12px; }
.sug-desc { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sug-flecha { text-align: center; color: var(--texto-3); font-size: 18px; }
.sug-acc { display: grid; gap: 6px; justify-items: center; text-align: center; }
.sug-acc form { margin: 0; }
.sug-acc .btn { min-width: 140px; }
@media (max-width: 900px) {
  .sug-cabecera { display: none; }
  .sug-par { grid-template-columns: 1fr; }
  .sug-flecha { transform: rotate(90deg); }
}


/* Flujo de caja tipo planilla */
.barra-matriz { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 10px; }
.leyenda-proy { color: var(--texto-3); font-style: italic; }
.matriz-wrap { overflow-x: auto; }
table.matriz { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.matriz th, table.matriz td { padding: 9px 14px; border-bottom: 1px solid var(--linea); white-space: nowrap; }
table.matriz th { font-weight: 600; font-size: 12.5px; color: var(--texto-2); background: var(--superficie); position: sticky; top: 0; }
table.matriz th small { display: block; font-weight: 500; color: var(--marca-texto, var(--marca)); font-size: 11px; }
table.matriz th.pasado { color: var(--texto-3); }
table.matriz .concepto { position: sticky; left: 0; background: var(--superficie); min-width: 240px; max-width: 320px; overflow: hidden; text-overflow: ellipsis; z-index: 1; }
table.matriz td.actual, table.matriz th.actual { background: rgba(255, 109, 31, .05); }
table.matriz .total { font-weight: 600; background: var(--relleno); }
table.matriz .cero { color: var(--texto-3); opacity: .55; }
table.matriz .proy { color: var(--texto-3); font-style: italic; }
table.matriz tr[data-toggle] { cursor: pointer; }
table.matriz tr[data-toggle]:hover td { background: var(--relleno); }
table.matriz .flechita { display: inline-block; width: 14px; color: var(--texto-3); }
table.matriz .fila-total td { font-weight: 700; background: var(--relleno); }
table.matriz .fila-total.salida td.num span:not(.cero) { color: var(--rojo); }
table.matriz .fila-total.entrada td.num span:not(.cero):not(.proy) { color: var(--verde); }
table.matriz .fila-cat td { font-weight: 600; }
table.matriz .fila-cat td.concepto { padding-left: 26px; }
table.matriz .fila-concepto td.concepto { padding-left: 52px; color: var(--texto-2); }
table.matriz .fila-saldo td { font-weight: 600; color: var(--texto-2); }
table.matriz .fila-saldo.final td { border-top: 2px solid var(--linea-fuerte); color: var(--texto); }
table.matriz .neto td { border-top: 2px solid var(--linea-fuerte); }
table.matriz td.baja { color: var(--rojo); }
table.matriz td.bajo-min { box-shadow: inset 0 -2px 0 var(--rojo); }
.celda-btn { background: none; border: 0; padding: 2px 4px; margin: -2px -4px; font: inherit; color: inherit; cursor: pointer; border-radius: 6px; }
.celda-btn:hover { background: var(--azul-bg); color: var(--azul); }
dialog.dialogo-detalle { border: 0; border-radius: 16px; padding: 22px; width: min(860px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog.dialogo-detalle::backdrop { background: rgba(0,0,0,.25); }
dialog.dialogo-detalle h3 { margin: 0 0 12px; font-size: 17px; }
.dialogo-pie { display: flex; justify-content: flex-end; margin: 14px 0 0; }

table.matriz .fila-seccion td { padding-top: 22px; font-weight: 700; border-bottom: 1px solid var(--linea-fuerte); background: var(--superficie); }
table.matriz .fila-proy td { color: var(--texto-3); font-style: italic; }
table.matriz .fila-proy td.concepto { font-style: normal; color: var(--texto-2); padding-left: 26px; }
table.matriz .fila-proy.saldo td { font-weight: 600; }
.celda-btn.proy { color: var(--texto-3); font-style: italic; }

/* Clientes: nombre editable con acceso a la ficha */
.celda-nombre { display: flex; align-items: center; gap: 4px; }
.celda-nombre input.fuerte { font-weight: 600; }
.ir-ficha { padding: 2px 8px; border-radius: 6px; color: var(--texto-3); font-size: 18px; line-height: 1; text-decoration: none; }
.ir-ficha:hover { background: var(--relleno); color: var(--marca); text-decoration: none; }

table.matriz .fila-dif td { color: var(--ambar); font-style: italic; }
table.matriz .fila-dif td a { color: inherit; }
table.matriz .fila-saldo.final td span.proy { color: var(--texto); font-style: normal; }

/* Panel: pestañas y vistas anual / clientes */
.panel-tabs { margin: -4px 0 20px; }
.kpi-anio .anio-cab { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kpi-anio h2 { margin: 0; }
.kpi-anio .kpi-valor { font-size: 28px; font-weight: 600; letter-spacing: -.02em; margin-top: 8px; }
details.tramo { border-bottom: 1px solid var(--linea); }
details.tramo summary { display: grid; grid-template-columns: 130px 1fr 40px 110px; align-items: center; gap: 12px; padding: 10px 2px; cursor: pointer; list-style: none; }
details.tramo summary::-webkit-details-marker { display: none; }
details.tramo summary:hover { background: var(--relleno); }
.tramo-barra { height: 10px; border-radius: 5px; background: var(--relleno); overflow: hidden; }
.tramo-barra span { display: block; height: 100%; border-radius: 5px; background: var(--marca); }
.tramo-monto { text-align: right; font-size: 12.5px; }
details.tramo .lista-simple { margin: 0 0 10px; }
td.quienes { white-space: normal; font-size: 12.5px; max-width: 420px; }
.kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .kpis-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.delta { font-size: 12px; font-weight: 600; white-space: nowrap; }
.analisis ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.analisis li { padding: 10px 14px 10px 16px; border-radius: 10px; background: var(--relleno); border-left: 3px solid var(--texto-3); font-size: 14px; }
.analisis li.bueno { border-left-color: var(--verde); }
.analisis li.malo { border-left-color: var(--rojo); }
.analisis li.info { border-left-color: var(--azul); }
.puente li.total { border-top: 2px solid var(--linea-fuerte); padding-top: 10px; }
.pago-editable { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.pago-editable label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--texto-2); margin: 0; }
.pago-editable input { width: 130px; min-width: 0 !important; padding: 4px 8px; font-size: 13px; }
.pago-editable input.monto { width: 100px; }

/* Adeudados: antigüedad de la deuda */
.globo-tab { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px;
  border-radius: 9px; background: var(--rojo); color: #fff; font-size: 11px; font-weight: 700; }
.barra-antiguedad { display: flex; height: 14px; border-radius: 7px; overflow: hidden; margin-top: 22px; gap: 2px; }
.leyenda-antiguedad { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 10px; font-size: 13px; color: var(--texto-2); }
.leyenda-antiguedad i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.ba-por_vencer { background: #C7C7CC; }
.ba-t30 { background: #F5B800; }
.ba-t60 { background: #FF8A3D; }
.ba-t90 { background: #E5484D; }
.ba-t90mas { background: #9B0010; }
.tabla-deuda td { vertical-align: top; }
details.deuda-detalle summary { cursor: pointer; list-style: none; }
details.deuda-detalle summary::-webkit-details-marker { display: none; }
details.deuda-detalle[open] summary { margin-bottom: 8px; }
table.mini { width: 100%; font-size: 12.5px; background: var(--relleno); border-radius: 10px; }
table.mini td, table.mini th { padding: 5px 8px; }
table.mini select.estado { font-size: 12px; padding: 2px 6px; }
td.recordatorio { white-space: nowrap; }

.sug-acc details.conciliar > .pop { right: 0; }
.sug-acc details.conciliar > summary { min-width: 140px; }
.caja-conc { overflow: visible; }  /* los menús "Conciliar ▾" no se cortan en la última fila */

/* Ganancia primero: proyección y palancas */
.proy-pf td { vertical-align: middle; }
.arreglo-mal { box-shadow: var(--sombra), inset 4px 0 0 var(--rojo); }
.arreglo-ok { box-shadow: var(--sombra), inset 4px 0 0 var(--verde); }
.palancas .palanca { padding: 14px 16px; border-radius: 12px; background: var(--relleno); }
.palanca .etq { font-weight: 600; font-size: 13px; color: var(--texto-2); }
.palanca .val { font-size: 22px; font-weight: 700; margin: 4px 0; }

/* Barra de periodo (arriba de todas las pantallas): Mes / Año */
.barra-periodo { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: -8px 0 18px; padding: 10px 14px; border-radius: 14px; background: rgba(255,255,255,.92); backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--linea), 0 4px 18px rgba(0,0,0,.05); }
.barra-periodo .segmentado { margin: 0; }
.barra-periodo .meses { margin: 0; }
.barra-periodo .nota-periodo { margin-left: auto; }
@media (max-width: 700px) { .barra-periodo .nota-periodo { margin-left: 0; width: 100%; } }

/* Inicio */
.kpi-link { color: inherit; text-decoration: none; display: block; transition: transform .12s, box-shadow .12s; }
.kpi-link:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 6px 22px rgba(0,0,0,.08); }
.kpi-alerta { box-shadow: inset 0 0 0 1.5px var(--rojo); }
.inicio-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; }
@media (max-width: 1000px) { .inicio-grid { grid-template-columns: 1fr; } }
.lista-tareas { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tarea { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  background: var(--relleno); border-left: 3px solid var(--texto-3); font-size: 13.5px; }
.tarea.alta { border-left-color: var(--rojo); }
.tarea.media { border-left-color: #F5B800; }
.tarea.baja { border-left-color: var(--azul); }
.tarea .btn { flex-shrink: 0; }
.medidor { margin-top: 6px; }
.medidor-barra { height: 12px; border-radius: 6px; background: var(--relleno); overflow: hidden; }
.medidor-barra span { display: block; height: 100%; border-radius: 6px; }
.medidor-barra span.ok { background: var(--verde); }
.medidor-barra span.mal { background: #FF8A3D; }
.medidor-txt { margin-top: 8px; font-size: 14px; }
/* Botón + Registrar */
details.registrar { position: relative; }
details.registrar > summary { list-style: none; }
details.registrar > summary::-webkit-details-marker { display: none; }
details.registrar .ic { width: 15px; height: 15px; }
.menu-registrar { position: absolute; left: 0; top: calc(100% + 6px); z-index: 60; width: 270px; padding: 6px; border-radius: 12px;
  background: var(--superficie); box-shadow: 0 12px 34px rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.05); display: grid; }
.menu-registrar a, .menu-registrar button { display: block; text-align: left; padding: 9px 12px; border-radius: 8px; border: 0; background: none;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--texto); cursor: pointer; text-decoration: none; }
.menu-registrar a:hover, .menu-registrar button:hover { background: var(--relleno); text-decoration: none; }
.menu-registrar small { display: block; font-weight: 400; font-size: 12px; color: var(--texto-3); }
.meses-cartola { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

table.matriz .fila-sobre td { color: var(--texto-2); }
table.matriz .fila-sobre td.concepto { padding-left: 26px; }
table.matriz .fila-total.disponible td { background: rgba(4,107,210,.06); }
/* Inicio: resultado del mes */
.mes-resultado .mes-titulo { font-weight: 700; font-size: 15px; margin: 0 0 8px 2px; }
.kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .kpis-3 { grid-template-columns: 1fr; } }
.kpi-grande .val { font-size: 34px; }
.cobro-avance { margin-top: 10px; }
.cobro-barra { height: 8px; border-radius: 4px; background: var(--relleno-2); overflow: hidden; }
.cobro-barra span { display: block; height: 100%; border-radius: 4px; background: var(--verde); }
.cobro-txt { margin-top: 6px; font-size: 12.5px; color: var(--texto-2); }

button.ir-ficha { border: 0; background: none; cursor: pointer; font: inherit; font-size: 18px; }
.link-nombre { border: 0; background: none; padding: 0 8px; font: inherit; font-weight: 600; color: var(--texto); cursor: pointer; text-align: left; }
.link-nombre:hover { color: var(--marca); text-decoration: underline; }

/* Cobrar desde el cliente */
.cobrar-cliente { margin: 4px 0 16px; padding: 12px 14px; border-radius: 12px; background: #FFF4F0; box-shadow: inset 0 0 0 1px rgba(255,109,31,.25); }
.cobrar-cab { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.cobrar-cliente .lista-simple li { align-items: center; }
.cobrar-cliente .btn.peq { margin-left: 8px; }
.cobrar-ok { margin: 4px 0 14px; font-size: 13px; color: var(--texto-2); }
table.hoja.tabla-entregas tr.fila-atrasada td.fija { box-shadow: inset 3px 0 0 var(--rojo), 1px 0 0 var(--linea-fuerte); }

/* Administración: tablero de clientes */
.tablero { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.columna { flex: 0 0 260px; background: var(--relleno); border-radius: 14px; padding: 10px; min-height: 120px; transition: box-shadow .12s; }
.columna.sobre { box-shadow: inset 0 0 0 2px var(--marca); }
.columna.col-sin { background: #FFF4F0; }
.columna header { display: flex; align-items: baseline; gap: 6px; padding: 4px 6px 10px; }
.col-nombre { font-weight: 700; font-size: 13.5px; }
.col-n { margin-left: auto; font-size: 12px; color: var(--texto-3); }
.col-tarjetas { display: grid; gap: 8px; min-height: 40px; }
.tarjeta-cliente { display: block; background: var(--superficie); border-radius: 10px; padding: 10px 12px; color: inherit; text-decoration: none;
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 0 0 1px rgba(0,0,0,.04); cursor: grab; }
.tarjeta-cliente:hover { text-decoration: none; box-shadow: 0 4px 14px rgba(0,0,0,.1), 0 0 0 1px rgba(0,0,0,.04); }
.tarjeta-cliente.arrastrando { opacity: .4; }
.tc-nombre { font-weight: 600; font-size: 14px; }
.tc-meta, .tc-alertas { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.tc-horas { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.tc-barra { flex: 1; height: 6px; border-radius: 3px; background: var(--relleno-2); overflow: hidden; }
.tc-barra span { display: block; height: 100%; background: var(--verde); border-radius: 3px; }
.tc-barra span.pasado { background: var(--rojo); }
/* Administración: ficha y bitácora */
.admin-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 18px; align-items: start; }
@media (max-width: 1000px) { .admin-grid { grid-template-columns: 1fr; } }
.ficha-campos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 14px; }
@media (max-width: 600px) { .ficha-campos { grid-template-columns: 1fr; } }
.campo-link { display: flex; gap: 6px; align-items: center; }
.campo-link a { text-decoration: none; font-size: 16px; }
.bitacora .nota-nueva textarea { width: 100%; }
.nota-acciones { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.mes-bitacora { margin: 22px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--texto-3); }
.nota { padding: 12px 14px; border-radius: 12px; background: var(--relleno); margin-bottom: 10px; }
.nota-cab { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.nota-cab form { margin: 0; }
.nota-texto { font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.nota-img { display: block; max-width: 100%; max-height: 420px; border-radius: 8px; margin: 8px 0; box-shadow: 0 0 0 1px var(--linea); }
.nota-archivo { display: inline-block; margin: 4px 0; }
/* Estado de resultados y presupuesto */
.tabla-resultados .r-ingreso td { background: rgba(27,175,122,.06) !important; }
.tabla-resultados .r-subtotal td { border-top: 2px solid var(--linea-fuerte); background: #F7F7F9 !important; }
.tabla-resultados .r-total td { border-top: 2px solid var(--linea-fuerte); background: rgba(4,107,210,.06) !important; }
.uso-pres { display: flex; align-items: center; gap: 8px; }
.uso-barra { flex: 1; height: 8px; border-radius: 4px; background: var(--relleno-2); overflow: hidden; }
.uso-barra span { display: block; height: 100%; background: var(--verde); }
.uso-barra span.alerta { background: #F5B800; }
.uso-barra span.pasado { background: var(--rojo); }

/* Simulador */
.sim-grid { grid-template-columns: 320px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1000px) { .sim-grid { grid-template-columns: 1fr; } }
.palancas-sim .campo input { width: 100%; }
.sim-lista { display: grid; gap: 4px; max-height: 280px; overflow: auto; margin-top: 8px; }
.sim-quitar summary { cursor: pointer; font-weight: 600; font-size: 13.5px; margin-top: 6px; }
/* Reporte mensual (pantalla e impresión) */
.reporte { background: #fff; max-width: 900px; padding: 28px 34px; border-radius: 14px; box-shadow: var(--sombra); }
.rep-cab { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid var(--marca); padding-bottom: 10px; margin-bottom: 18px; }
.rep-bloque { margin-bottom: 22px; break-inside: avoid; }
.rep-bloque h2 { font-size: 17px; margin: 0 0 10px; }
.rep-bloque h3 { font-size: 13.5px; margin: 0 0 6px; }
.rep-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.rep-kpis div { padding: 10px 12px; border-radius: 10px; background: var(--relleno); display: grid; gap: 2px; }
.rep-kpis span { font-size: 12px; color: var(--texto-2); }
.rep-kpis strong { font-size: 19px; }
.rep-kpis small { font-size: 11.5px; color: var(--texto-2); }
.rep-tabla { width: 100%; border-collapse: collapse; font-size: 13px; }
.rep-tabla td { padding: 5px 4px; border-bottom: 1px solid var(--linea); }
.rep-tabla tr.sub td { font-weight: 600; border-top: 1.5px solid var(--linea-fuerte); }
.rep-tabla tr.tot td { font-weight: 700; border-top: 2px solid var(--texto); }
.rep-dos { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.rep-pie { border-top: 1px solid var(--linea); padding-top: 10px; margin-top: 10px; }
@media print {
  .lateral, .barra-periodo, .no-imprimir, .avisos, .barra-cambios { display: none !important; }
  .app, main { display: block !important; margin: 0 !important; padding: 0 !important; }
  .reporte { box-shadow: none; padding: 0; max-width: none; }
  body { background: #fff !important; }
  html.sin-montos .dinero { filter: none !important; }
}
/* Registro de horas */
.form-horas { display: grid; grid-template-columns: 140px 170px 200px 200px minmax(200px, 1fr) 90px auto; gap: 10px; align-items: end; }
.form-horas .campo { margin: 0; }
@media (max-width: 1100px) { .form-horas { grid-template-columns: 1fr 1fr; } .form-horas .ancho-2 { grid-column: span 2; } }
td.detalle-horas { max-width: 420px; overflow: hidden; text-overflow: ellipsis; }
tr.horas-amarillo td { background: #FFF8E1; }
tr.horas-rojo td { background: #FDECEC; }
input.horas-input { width: 70px; min-width: 0 !important; text-align: right; }

.txt-fijo { padding: 9px 12px; border-radius: 10px; background: var(--relleno); font-weight: 600; }

/* Registro de horas: "qué se hizo" grande, con capturas */
.form-horas .campo-que-se-hizo { grid-column: 1 / -1; }
.form-horas .campo-que-se-hizo textarea { width: 100%; min-height: 150px; resize: vertical; }
.form-horas .campo-que-se-hizo .nota-acciones { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.detalle-horas .nota-texto { white-space: normal; }
.detalle-horas .nota-img { max-width: 260px; max-height: 160px; }
.form-horas { grid-template-columns: 150px minmax(160px, 1fr) minmax(180px, 1fr) minmax(180px, 1fr) 100px; }
@media (max-width: 1100px) { .form-horas { grid-template-columns: 1fr 1fr; } }

/* Panel lateral del cliente (estilo Notion) */
.cajon.ancho { width: min(720px, 100vw); }
.pp-titulo { font-size: 30px !important; font-weight: 800; }
.props { display: grid; gap: 2px; }
.prop { display: grid; grid-template-columns: 200px minmax(0, 1fr); align-items: center; min-height: 36px; border-radius: 8px; padding: 0 6px; }
.prop:hover { background: var(--relleno); }
.prop-alta { align-items: start; padding-top: 6px; padding-bottom: 6px; }
.prop-etq { display: flex; align-items: center; gap: 8px; color: var(--texto-2); font-size: 14px; }
.pp-ic { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.prop-val { display: flex; align-items: center; gap: 8px; font-size: 14px; min-width: 0; }
.prop-val input, .prop-val select, .prop-val textarea { border: 1px solid transparent; background: transparent; padding: 6px 8px; border-radius: 6px; width: 100%; font: inherit; box-shadow: none; }
.prop-val input:hover, .prop-val select:hover, .prop-val textarea:hover { background: var(--superficie); border-color: var(--linea); }
.prop-val input:focus, .prop-val select:focus, .prop-val textarea:focus { background: var(--superficie); border-color: var(--marca); outline: none; }
.prop-val input::placeholder, .prop-val textarea::placeholder, .vacio { color: var(--texto-3); }
.prop-val .chip-select { width: auto; font-weight: 600; padding: 3px 8px; }
.pp-link { text-decoration: none; font-weight: 700; flex: 0 0 auto; }
.prop-agregar { color: var(--texto-3); font-size: 14px; padding: 8px 6px; text-decoration: none; }
.prop-agregar:hover { color: var(--texto); }
.anillo { --p: 0; width: 18px; height: 18px; border-radius: 50%; background: conic-gradient(var(--verde, #1f9d55) calc(var(--p) * 1%), var(--relleno-2) 0); display: inline-block; position: relative; }
.anillo::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--superficie); }
.anillo.pasado { background: conic-gradient(var(--rojo, #d64545) 100%, transparent 0); }
.accesos-ocultos { filter: blur(5px); user-select: none; pointer-events: none; flex: 1; }
.accesos-ocultos.visible { filter: none; user-select: auto; pointer-events: auto; }
/* colores por responsable */
.resp-0 { background: #eceff3 !important; color: #3d4350 !important; }
.resp-1 { background: #dbe7fb !important; color: #1d4f9c !important; }
.resp-2 { background: #dce9ff !important; color: #24508f !important; }
.resp-3 { background: #f7e1d2 !important; color: #8a4a1e !important; }
.resp-4 { background: #dff3e4 !important; color: #23673a !important; }
.resp-5 { background: #efe0f7 !important; color: #6b2f8a !important; }

/* Checklist de la Fase 1 */
.checklist .ck-cab { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.ck-barra { height: 8px; margin-bottom: 8px; }
.ck-falta { margin: 0 0 10px; }
.ck-etapa { border-top: 1px solid var(--linea); padding: 6px 0; }
.ck-etapa summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; font-weight: 600; font-size: 14px; padding: 4px 0; list-style: none; }
.ck-etapa summary::-webkit-details-marker { display: none; }
.ck-etapa ul { list-style: none; margin: 4px 0 6px; padding: 0; display: grid; gap: 2px; }
.ck-etapa li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 4px 6px; border-radius: 8px; }
.ck-etapa li:hover { background: var(--relleno); }
.ck-etapa label { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; margin: 0; }
.ck-etapa input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--verde, #1f9d55); flex: 0 0 auto; }
.ck-etapa li.hecho label span { color: var(--texto-3); text-decoration: line-through; }
.ck-quien { white-space: nowrap; }
.tc-fase1 { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.tc-fase1 .tc-barra { flex: 1; }
.tc-barra.fase1 span { background: #6d5bd0; }
.tc-falta { font-size: 12px; color: var(--texto-2); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Tarjeta del tablero: limpia (nombre, URL, encargado) */
.tarjeta-cliente { cursor: pointer; padding: 12px 14px; }
.tarjeta-cliente .tc-nombre { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14.5px; }
.tarjeta-cliente .tc-nombre a { color: var(--texto); text-decoration: none; }
.tc-url { display: block; margin-top: 4px; font-size: 12.5px; color: var(--texto-2); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-url:hover { color: var(--marca-texto); text-decoration: underline; }
.tc-resp { display: flex; align-items: center; gap: 7px; margin-top: 10px; font-size: 12.5px; font-weight: 600; color: var(--texto-2); }
.avatar-mini { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; flex: 0 0 auto; }
/* Salud */
.salud-punto { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.salud-punto.verde { background: #22a05b; }
.salud-punto.ambar { background: #e0a020; }
.salud-punto.rojo { background: #d64545; }
.salud-bloque { margin-top: 22px; }
.salud-senales { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.salud-senales li { display: grid; grid-template-columns: 12px 90px minmax(0, 1fr); align-items: center; gap: 8px; font-size: 14px; }

/* =====================================================================
   Estilo Apple: blanco y negro, minimalista. El negro es el acento.
   (va al final: reemplaza el naranja y los colores anteriores)
   ===================================================================== */
:root {
  --marca: #1D1D1F;
  --marca-hover: #000000;
  --marca-suave: rgba(0, 0, 0, 0.06);
  --marca-texto: #1D1D1F;
  --fondo: #FFFFFF;
  --lateral: #F5F5F7;
  --superficie-2: #F5F5F7;
  --relleno: rgba(0, 0, 0, 0.05);
  --relleno-2: rgba(0, 0, 0, 0.03);
  --linea: #E8E8ED;
  --linea-fuerte: #D2D2D7;
  --texto: #1D1D1F;
  --texto-2: #6E6E73;
  --texto-3: #86868B;
  --sombra: 0 0 0 1px #E8E8ED;
  --sombra-alta: 0 24px 70px rgba(0, 0, 0, 0.10), 0 0 0 1px rgba(0, 0, 0, 0.05);
  --fuente: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Segoe UI", system-ui, sans-serif;
}
body { letter-spacing: -0.01em; }
a { color: var(--texto); }
a:hover { text-decoration: none; opacity: .7; }
h1 { font-weight: 700; letter-spacing: -0.04em; }

/* menú lateral: gris claro tipo macOS, activo en negro */
.lateral { background: var(--lateral); border-right: 0; }
.marca { padding: 6px 10px 26px; }
.marca .logo-img { width: 30px; height: 30px; border-radius: 50%; display: block; }
.marca .app-nombre { border-left: 0; padding-left: 0; font-size: 15px; font-weight: 700; color: var(--texto); letter-spacing: -0.02em; }
.lateral .grupo { text-transform: none; font-size: 11.5px; color: var(--texto-3); }
.lateral a.nav { border-radius: 9px; }
.lateral a.nav:hover { background: rgba(0, 0, 0, .04); opacity: 1; }
.lateral a.nav.activo { background: #1D1D1F; color: #fff; }
.lateral a.nav.activo svg { color: #fff; }
.avatar { background: #1D1D1F; }

/* botones: píldora negra / gris */
.btn { background: #1D1D1F; color: #fff; border-radius: 980px; box-shadow: none; }
.btn:hover { background: #000; opacity: 1; }
.btn.sec { background: rgba(0, 0, 0, .05); color: var(--texto); }
.btn.sec:hover { background: rgba(0, 0, 0, .09); box-shadow: none; }
.btn.peligro { background: transparent; color: var(--rojo); box-shadow: inset 0 0 0 1px rgba(215, 0, 21, .25); }

/* tarjetas y tablas: borde finísimo, sin sombras pesadas */
.tarjeta, .kpi { box-shadow: 0 0 0 1px var(--linea); }
input:focus, select:focus, textarea:focus { outline: none; box-shadow: 0 0 0 3px rgba(0, 0, 0, .10); border-color: #1D1D1F; }

/* tablero: columnas neutras */
.columna, .columna.col-sin { background: #F5F5F7; border-radius: 16px; }
.columna.sobre { box-shadow: inset 0 0 0 2px #1D1D1F; }
.columna header .col-nombre { font-weight: 600; }
.tarjeta-cliente { border-radius: 12px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .04); }
.tarjeta-cliente:hover { box-shadow: 0 0 0 1px rgba(0, 0, 0, .08), 0 8px 24px rgba(0, 0, 0, .08); }

/* encargado: avatar negro con su inicial (monocromo) */
.avatar-mini, .resp-0, .resp-1, .resp-2, .resp-3, .resp-4, .resp-5 { background: #1D1D1F !important; color: #fff !important; }
.prop-val .chip-select { background: rgba(0, 0, 0, .05) !important; color: var(--texto) !important; border-radius: 980px; }
.chip.resp-0, .chip.resp-1, .chip.resp-2, .chip.resp-3, .chip.resp-4, .chip.resp-5 { background: rgba(0, 0, 0, .06) !important; color: var(--texto) !important; }

/* barras de avance en negro */
.tc-barra span, .ck-barra span, .tc-barra.fase1 span { background: #1D1D1F; }
.anillo { background: conic-gradient(#1D1D1F calc(var(--p) * 1%), rgba(0, 0, 0, .08) 0); }
.ck-etapa input[type=checkbox] { accent-color: #1D1D1F; }

/* panel lateral: más aire, fondo translúcido detrás */
.cajon-fondo { background: rgba(0, 0, 0, .12); backdrop-filter: blur(2px); }
.cajon { box-shadow: -24px 0 60px rgba(0, 0, 0, .10); }
.prop:hover { background: rgba(0, 0, 0, .03); }

/* Panel del cliente: todos los valores parten en la misma línea (texto fijo, casillas y listas) */
.prop-val { padding-left: 9px; }
.prop-val > input, .prop-val > select, .prop-val > textarea,
.prop-val > .accesos-ocultos > textarea { margin-left: -9px; }
.prop-val > .chip, .prop-val > .chip-select { margin-left: 0; }
.prop-val .chip-select { margin-left: -9px !important; }
.prop-etq { padding-left: 2px; }
.prop-val > select { padding-left: 4px; }
.prop-val .chip-select { margin-left: 0 !important; }
.prop-alta .prop-val { align-items: flex-start; }
.prop-alta .prop-val > .link-accion { margin-top: 6px; flex: 0 0 auto; }
.prop-alta textarea { min-height: 0; }

/* Bitácora (Fase 2): módulo grande a todo el ancho, por mes */
.bitacora-modulo { margin-top: 28px; background: var(--superficie); border-radius: 20px; box-shadow: 0 0 0 1px var(--linea); overflow: hidden; }
.bm-cab { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding: 22px 28px 18px; border-bottom: 1px solid var(--linea); }
.bm-cab h2 { font-size: 24px; margin: 2px 0 0; letter-spacing: -0.03em; }
.bm-fase { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--texto-3); }
.bm-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 520px; }
.bm-meses { background: #F5F5F7; padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; max-height: 900px; overflow-y: auto; }
.bm-meses a { display: flex; flex-direction: column; gap: 1px; padding: 9px 12px; border-radius: 10px; color: var(--texto); text-decoration: none; }
.bm-meses a strong { font-size: 14px; font-weight: 600; }
.bm-meses a span { font-size: 12px; color: var(--texto-2); }
.bm-meses a:hover { background: rgba(0, 0, 0, .04); opacity: 1; }
.bm-meses a.activo { background: #1D1D1F; color: #fff; }
.bm-meses a.activo span { color: rgba(255, 255, 255, .7); }
.bm-sep { height: 1px; background: var(--linea-fuerte); margin: 8px 6px; }
.bm-contenido { padding: 26px 32px 36px; min-width: 0; }
.bm-titulo { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.bm-titulo h3 { font-size: 22px; margin: 0 0 4px; letter-spacing: -0.02em; }
.bm-editor { margin-bottom: 26px; }
.bm-editor textarea { width: 100%; min-height: 240px; font-size: 15px; line-height: 1.6; padding: 16px 18px; border-radius: 14px; resize: vertical; }
.nota-grande { padding: 18px 22px; border-radius: 14px; background: #F5F5F7; margin-bottom: 14px; }
.nota-grande .nota-texto { font-size: 15px; line-height: 1.65; }
.nota-grande .nota-img { max-height: 640px; border-radius: 10px; }
.bm-vacio { padding: 30px 0; text-align: center; }
.bm-mes-resumen { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--linea); }
.bm-mes-resumen:last-child { border-bottom: 0; }
.bm-mes-cab { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.bm-mes-cab h4 { font-size: 17px; margin: 0; letter-spacing: -0.01em; }
@media (max-width: 900px) { .bm-grid { grid-template-columns: 1fr; } .bm-meses { flex-direction: row; overflow-x: auto; max-height: none; } .bm-meses a { flex: 0 0 auto; } .bm-sep { display: none; } }
@media print { .bm-meses, .bm-editor, .cabecera .acciones, .admin-grid { display: none !important; } .bitacora-modulo { box-shadow: none; } .bm-grid { display: block; } }

/* =====================================================================
   TODAS las tablas con formato planilla (Excel): cuadrícula, filas compactas,
   encabezado gris fijo, filas alternadas y casillas que llenan la celda.
   ===================================================================== */
.tabla-wrap { border-radius: 12px; box-shadow: 0 0 0 1px var(--linea-fuerte); }
.tabla-wrap table, table.hoja { border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tabla-wrap table th, .tabla-wrap table td { border-right: 1px solid var(--linea); border-bottom: 1px solid var(--linea); }
.tabla-wrap table th:last-child, .tabla-wrap table td:last-child { border-right: 0; }
.tabla-wrap table th { background: #F5F5F7; height: 32px; padding: 0 10px; font-size: 11.5px; font-weight: 600; color: var(--texto-2); z-index: 2; }
.tabla-wrap table td { height: 34px; padding: 0 10px; white-space: nowrap; }
.tabla-wrap table tbody tr:nth-child(even) td { background-color: #FBFBFC; }
.tabla-wrap table tbody tr:hover td, table.hoja tbody tr:hover td { background-color: #F0F0F3; }
.tabla-wrap table tbody tr:last-child td { border-bottom: 0; }
.tabla-wrap table td:has(> input:not([type=checkbox])), .tabla-wrap table td:has(> select),
.tabla-wrap table td:has(> .celda-nombre) { padding: 0; }
.tabla-wrap table td > input:not([type=checkbox]), .tabla-wrap table td > select,
.tabla-wrap table td .celda-nombre input {
  border: 0 !important; border-radius: 0 !important; background-color: transparent; height: 33px; padding: 0 10px;
  width: 100%; box-shadow: none; font-size: 13px;
}
.tabla-wrap table td > input:focus, .tabla-wrap table td > select:focus, .tabla-wrap table td .celda-nombre input:focus {
  box-shadow: inset 0 0 0 2px #1D1D1F !important; background-color: #fff;
}
.tabla-wrap table td input.monto { text-align: right; }
.tabla-wrap table td.num { font-variant-numeric: tabular-nums; }
th[data-dir="asc"], th[data-dir="desc"] { color: var(--texto); }

/* Página del cliente: pestañas Proyecto / Ficha */
.pc-barra { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: -8px 0 18px; }
.pc-barra .tabs { margin: 0; }
.pc-estado { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.bitacora-modulo.arriba { margin-top: 0; }
.bm-etq { font-style: normal; font-size: 11px; font-weight: 600; color: var(--texto-2); }
.bm-meses a.activo .bm-etq { color: rgba(255, 255, 255, .8); }
.bm-etq.f1 { color: #1D1D1F; }
.bm-etq.grande { display: inline-block; vertical-align: middle; margin-left: 8px; padding: 3px 10px; border-radius: 980px; background: rgba(0, 0, 0, .06); font-size: 12px; letter-spacing: 0; }
.bm-etq.grande.f1 { background: #1D1D1F; color: #fff; }
.bm-checklist { background: #F5F5F7; border-radius: 14px; padding: 16px 18px; margin-bottom: 22px; }
.bm-checklist .ck-etapa { border-top-color: var(--linea-fuerte); }
/* miniaturas de imágenes pegadas */
.adj-vista { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.adj-vista img { height: 84px; max-width: 160px; object-fit: cover; border-radius: 8px; box-shadow: 0 0 0 1px var(--linea); display: block; }

/* Informe del mes (en el proyecto del cliente) */
.informe-mes { border-radius: 14px; box-shadow: 0 0 0 1px var(--linea-fuerte); padding: 16px 18px; margin-bottom: 26px; }
.im-cab { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.im-cab h4 { font-size: 16px; margin: 0; }
.im-pdf { width: 100%; height: 640px; border: 0; border-radius: 10px; background: #F5F5F7; box-shadow: 0 0 0 1px var(--linea); }
.im-link { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 12px; background: #F5F5F7; color: var(--texto); text-decoration: none; }
.im-link span { font-size: 12.5px; color: var(--texto-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.im-subir { margin-top: 12px; }
.im-subir summary { cursor: pointer; font-weight: 600; font-size: 13.5px; }
.im-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; }
.im-form input[name=url] { flex: 1; min-width: 240px; }

/* Selector de proyecto (página del cliente) */
.selector-proyecto { position: relative; margin-top: 4px; }
.sp-boton { display: inline-flex; align-items: center; gap: 10px; border: 0; background: none; padding: 2px 8px 2px 0; border-radius: 10px; cursor: pointer; color: var(--texto); }
.sp-boton h1 { margin: 0; }
.sp-boton:hover { background: rgba(0, 0, 0, .04); }
.sp-flecha { font-size: 18px; color: var(--texto-3); }
.sp-panel { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; width: 380px; max-width: calc(100vw - 32px); background: var(--superficie);
  border-radius: 14px; box-shadow: 0 18px 50px rgba(0, 0, 0, .14), 0 0 0 1px rgba(0, 0, 0, .06); padding: 10px; }
.sp-buscar { width: 100%; margin-bottom: 8px; }
.sp-lista { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow-y: auto; }
.sp-lista li { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.sp-lista li strong { font-size: 14px; font-weight: 600; }
.sp-lista li span { font-size: 12px; color: var(--texto-2); }
.sp-lista li:hover, .sp-lista li.activo { background: rgba(0, 0, 0, .05); }
.sp-lista li.actual strong::after { content: " · actual"; font-weight: 400; color: var(--texto-3); }
.sp-vacio { margin: 6px 4px; }
.sp-lista li[hidden] { display: none; }
/* Bitácora con formato: barra y estilos de títulos/listas */
.fmt-barra { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 6px; margin-bottom: 6px; border-radius: 12px; background: #F5F5F7; }
.fmt-barra button { border: 0; background: transparent; padding: 6px 10px; border-radius: 8px; font: inherit; font-size: 13px; cursor: pointer; color: var(--texto); }
.fmt-barra button:hover { background: #fff; box-shadow: 0 0 0 1px var(--linea); }
.fmt-barra .muted { margin-left: auto; }
.nota-texto p { margin: 0 0 8px; }
.nota-texto .nt-tit { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; margin: 18px 0 8px; }
.nota-texto .nt-sub { font-size: 15.5px; font-weight: 650; margin: 14px 0 6px; }
.nota-texto > :first-child { margin-top: 0; }
.nota-texto ul, .nota-texto ol { margin: 0 0 10px; padding-left: 22px; }
.nota-texto li { margin: 2px 0; }
.nota-texto strong { font-weight: 650; }

/* Accesos: cuadro grande y links clicables */
.campo-accesos { grid-column: 1 / -1; }
.campo-accesos textarea { width: 100%; min-height: 170px; font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 13px; line-height: 1.55; resize: vertical; }
.accesos-texto { white-space: pre-wrap; font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 13px; }
.accesos-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.accesos-links a { padding: 4px 10px; border-radius: 980px; background: #F5F5F7; font-size: 12.5px; text-decoration: none; color: var(--texto); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.accesos-links a:hover { background: #E8E8ED; opacity: 1; }

/* Tablero tipo Notion: ocupa el alto de la pantalla, cada columna baja con su propio scroll
   y la barra horizontal queda siempre visible abajo (no hay que ir al final de la página) */
.tablero { height: calc(100vh - 250px); min-height: 360px; overflow-x: auto; overflow-y: hidden; align-items: flex-start; padding-bottom: 8px; }
.tablero .columna { display: flex; flex-direction: column; max-height: 100%; }
.tablero .columna header { flex: 0 0 auto; }
.tablero .col-tarjetas { overflow-y: auto; flex: 1 1 auto; min-height: 60px; padding: 2px 2px 6px; margin: 0 -2px; align-content: start; }
.tablero::-webkit-scrollbar { height: 12px; }
.tablero::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, .22); border-radius: 980px; border: 3px solid transparent; background-clip: padding-box; }
.tablero::-webkit-scrollbar-track { background: rgba(0, 0, 0, .04); border-radius: 980px; }

/* Tablero como Notion (corrige lo anterior): un solo scroll para todo el tablero.
   Baja completo con una barra vertical, la horizontal queda fija abajo y los títulos de columna quedan arriba. */
.tablero { overflow: auto; align-items: flex-start; }
.tablero .columna { display: block; max-height: none; }
.tablero .col-tarjetas { overflow: visible; flex: none; margin: 0; padding: 0; }
.tablero .columna header { position: sticky; top: 0; z-index: 2; background: #F5F5F7; margin: -10px -10px 0; padding: 14px 16px 10px; border-radius: 16px 16px 0 0; }
.tablero::-webkit-scrollbar { width: 12px; height: 12px; }
.tablero::-webkit-scrollbar-corner { background: transparent; }

/* Editar nota / kickoff */
.nota-editar textarea { width: 100%; min-height: 220px; font-size: 14.5px; line-height: 1.6; padding: 14px 16px; border-radius: 12px; resize: vertical; }
.nota-editar .nota-acciones { margin-top: 8px; }
.kickoff-ver { max-height: 640px; overflow: auto; }

/* Leyenda del gráfico: ayuda para ocultar / mostrar series */
.leyenda .leyenda-ayuda { align-self: center; margin-left: 6px; font-size: 12px; color: var(--texto-3); }
.leyenda .leyenda-ayuda .link-accion { font-size: 12px; padding: 0; }
.leyenda button.apagado { text-decoration: line-through; }
.leyenda .leyenda-ayuda button { background: none; padding: 0; border-radius: 0; text-decoration: underline; color: var(--texto-2); }
.leyenda .leyenda-ayuda button:hover { background: none; color: var(--texto); }
