/* Nítida CRM */
:root {
  color-scheme: light;
  --bg: #EEF5F8;
  --surface: #fff;
  --ink: #06262F;
  --muted: #49636C;
  --accent: #17C3BD;
  --link: #0A7C82;
  --control: #65818B;
  --line: #D2E0E6;
  --danger: #9C2635;
  --soft: #E4F5FB;
  font: 1rem/1.52 "Albert Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, h3 { margin-block: 0; font-family: Sora, system-ui, sans-serif; font-weight: 600; line-height: 1.17; letter-spacing: -.031em; overflow-wrap: anywhere; }
h1 { font-size: clamp(2rem,5vw,3.5rem); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.07rem; }
p { margin-block: 0; overflow-wrap: anywhere; }
a { color: var(--link); text-underline-offset: .2em; }
button, input, select, textarea { font: inherit; color: inherit; }
button, .boton, input, select, textarea { min-height: 44px; border-radius: 8px; }
button, .boton { display: inline-flex; align-items: center; justify-content: center; background: var(--surface); border: 1px solid var(--control); padding: .5rem .82rem; text-decoration: none; cursor: pointer; color: var(--ink); }
button:hover, .boton:hover { background: var(--soft); }
button:disabled { cursor: wait; opacity: .75; }
.principal { background: var(--accent); border-color: var(--ink); font-weight: 650; }
.principal:hover { background: #A9DEF5; }
.peligro { color: var(--danger); }
input, select, textarea { border: 1px solid var(--control); width: 100%; padding: .52rem .65rem; background: var(--surface); }
input[type=checkbox] { width: 1.4rem; min-height: 1.4rem; accent-color: var(--link); margin: .5rem 0; }
textarea { min-height: 6.75rem; resize: vertical; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; }
.salto { position: absolute; top: .5rem; left: .5rem; background: var(--surface); padding: .65rem; z-index: 5; transform: translateY(-200%); }
.salto:focus { transform: none; }
.app { min-height: 100vh; animation: enfocar .4s ease-out both; }
@keyframes enfocar { from { opacity: .6; filter: blur(5px); } to { opacity: 1; filter: blur(0); } }
@media (prefers-reduced-motion:reduce) { .app { animation: none; } }
.lateral { background: var(--surface); border-bottom: 1px solid var(--line); padding: .9rem 1rem .6rem; }
.marca { display: inline-flex; align-items: center; gap: .8rem; text-decoration: none; color: var(--ink); min-height: 44px; margin-bottom: .6rem; }
.marca img { object-fit: contain; }
.marca span { border-left: 1px solid var(--line); padding-left: .8rem; font-size: .8rem; font-weight: 650; }
nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(7rem,1fr)); gap: .2rem; }
nav a { display: flex; align-items: center; min-height: 44px; padding: .3rem .55rem; color: var(--ink); border-radius: 7px; text-decoration: none; font-size: .91rem; border-left: 3px solid transparent; }
nav a:hover { background: var(--bg); }
nav a[aria-current=page] { background: var(--soft); border-color: var(--link); font-weight: 650; }
.cuenta { color: var(--muted); font-size: .9rem; padding: .65rem .55rem 0; }
main { padding: clamp(1rem,4vw,3.25rem); min-width: 0; width: 100%; max-width: 100rem; }
.cabecera { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: .85rem; margin-block-end: 1.25rem; }
.descrip { color: var(--muted); margin-top: .45rem; }
.pila { display: grid; align-content: start; gap: 1rem; min-width: 0; }
.acciones { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; }
.tarjeta { padding: clamp(.85rem,2vw,1.35rem); border: 1px solid var(--line); border-radius: 14px; background: var(--surface); min-width: 0; }
.lista { display: grid; gap: .6rem; padding: 0; margin: 0; list-style: none; }
.lista > li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem 1rem; border-bottom: 1px solid var(--line); padding-bottom: .55rem; min-width: 0; }
.lista > li:last-child { border-bottom: 0; padding-bottom: 0; }
.lista > li > div { min-width: 0; }
.lista > li > div:first-child { flex: 1 1 12rem; }
.rejilla, .campos { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%, 15rem),1fr)); gap: .85rem; align-content: start; }
.campo { display: grid; align-content: start; gap: .25rem; min-width: 0; }
.campo > span { font-size: .91rem; font-weight: 650; }
.ancho { grid-column: 1 / -1; }
.login { max-width: 28rem; margin: clamp(1rem,8vw,5rem) auto 0; }
.login h1 { font-size: 2rem; }
.error { color: var(--danger); font-weight: 600; }
.etiqueta { display: inline-block; padding: .21rem .55rem; background: var(--soft); color: var(--ink); border-radius: 4px; font-size: .86rem; }
.dato { font-size: clamp(1.7rem,4vw,2.85rem); font-weight: 650; line-height: 1.15; margin: .2rem 0; font-variant-numeric: tabular-nums; }
.ingresos { background: var(--ink); color: var(--surface); }
.ingresos .descrip { color: var(--soft); }
progress { accent-color: var(--accent); width: 100%; }
.tablero { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit,minmax(min(100%, 14.25rem),1fr)); align-items: start; }
.columna { border-top: 4px solid var(--accent); background: var(--soft); }
.columna .lista > li { display: grid; padding: .65rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.columna .lista .acciones { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,7rem),1fr)); }
dialog { width: min(calc(100% - 1.4rem), 46rem); max-height: calc(100% - 1.4rem); padding: clamp(1rem,3vw,1.65rem); border: 1px solid var(--control); background: var(--surface); color: var(--ink); border-radius: 12px; }
dialog::backdrop { background: rgb(6 38 47 / 65%); }
.aviso { position: fixed; z-index: 2; bottom: .65rem; right: .65rem; max-width: min(28rem,calc(100% - 1.3rem)); border-radius: 9px; background: var(--ink); color: var(--surface); padding: .7rem 1rem; }
pre { white-space: pre-wrap; font-size: .9rem; margin: 0; overflow-wrap: anywhere; }
dl { margin: 0; }
dt { font-size: .91rem; font-weight: 650; }
dd { margin: .2rem 0 0; overflow-wrap: anywhere; }
@media(min-width: 58rem) {
  .app:has(nav:not([hidden])) { display: grid; grid-template-columns: 13.5rem minmax(0,1fr); align-items: start; }
  .app:has(nav:not([hidden])) .lateral { position: sticky; top: 0; height: 100vh; overflow: auto; border-right: 1px solid var(--line); border-bottom: 0; padding: 1.4rem 1rem; }
  nav { grid-template-columns: 1fr; }
  .marca { margin-bottom: 1.15rem; }
}
