/* ==========================================================================
   Lemon Tree — sistema de diseño
   Neutros cálidos + los colores del logo (verde hoja, lima, naranja, limón).
   Sin dependencias: este archivo estiliza también los elementos "sueltos"
   (formularios, tablas) para que las pantallas de allauth se vean igual.
   ========================================================================== */

@font-face {
  font-family: "Nunito";
  src: url("../fonts/nunito-latin-var.134e5a79e891.woff2") format("woff2");
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  /* Marca (del logo) */
  --green: #79b22a;
  --green-700: #4f7a17;
  --green-600: #639a1f;
  --green-100: #e4f1cf;
  --green-50: #f2f8e8;
  --lime: #94c122;
  --orange: #ee7335;
  --orange-700: #c2521a;
  --orange-50: #fdefe7;
  --yellow: #fecc17;
  --yellow-50: #fff8dc;
  --ink: #1d1e1c;

  /* Neutros cálidos */
  --bg: #f6f4ee;
  --surface: #ffffff;
  --surface-2: #fbfaf6;
  --line: #e9e5da;
  --line-strong: #d9d3c4;
  --text: #2a2b28;
  --muted: #6f6c64;
  --faint: #9a968c;

  --red: #d14343;
  --red-50: #fdecec;
  --blue: #3b82c4;
  --blue-50: #eaf3fb;
  --blue-700: #2a6399;
  --purple: #8b5cc7;
  --purple-700: #6a3fa6;
  --purple-50: #f3edfb;
  --pink: #d6457f;
  --pink-700: #ad2a5f;
  --pink-50: #fcebf2;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(29, 30, 28, .06);
  --shadow: 0 1px 2px rgba(29, 30, 28, .05), 0 8px 24px -12px rgba(29, 30, 28, .12);
  --shadow-lg: 0 24px 60px -20px rgba(29, 30, 28, .28);
  --ring: 0 0 0 4px rgba(121, 178, 42, .22);
  --sidebar: 264px;
  --font: "Nunito", ui-rounded, "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--green-700); text-decoration: none; font-weight: 600; }
a:hover { color: var(--green-600); text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 2.4vw, 2.1rem); font-weight: 850; }
h2 { font-size: 1.25rem; font-weight: 800; }
h3 { font-size: 1.05rem; font-weight: 800; }
p { margin: 0 0 1rem; }
small, .small { font-size: .85rem; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: .02em; }
.upper { text-transform: uppercase; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.i { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.25em; }
.i-sm { width: 1em; height: 1em; }
.i-lg { width: 1.6em; height: 1.6em; }

/* ------------------------------------------------------------ Layout */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: .25rem;
  padding: 1.25rem .9rem 1rem;
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.sidebar .logo { display: block; padding: .25rem .6rem 1.1rem; }
.sidebar .logo img { width: 128px; height: auto; }
.nav-label { font-size: .72rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); padding: .8rem .8rem .3rem; }
.nav a, .nav span {
  display: flex; align-items: center; gap: .75rem;
  padding: .5rem .8rem; border-radius: 12px;
  color: var(--text); font-weight: 700; font-size: .94rem;
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav a .i { color: var(--muted); transition: color .15s; }
.nav a.active { background: var(--green-50); color: var(--green-700); }
.nav a.active .i { color: var(--green); }
.nav span.soon { color: var(--faint); cursor: default; }
.nav span.soon .i { color: var(--line-strong); }
/* Áreas de color del menú y de Inicio (D-042): acordeón con <details> */
.area-naranja { --c: var(--orange); --c700: var(--orange-700); --c50: var(--orange-50); }
.area-verde { --c: var(--green); --c700: var(--green-700); --c50: var(--green-50); }
.area-azul { --c: var(--blue); --c700: var(--blue-700); --c50: var(--blue-50); }
.area-morado { --c: var(--purple); --c700: var(--purple-700); --c50: var(--purple-50); }
.area-rosa { --c: var(--pink); --c700: var(--pink-700); --c50: var(--pink-50); }
.area-dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--c); flex: none; }
.nav .area-dot { display: block; padding: 0; }
details > summary.nav-label { display: flex; align-items: center; gap: .55rem; user-select: none; }
details > summary.nav-label::after, .launch-area .chev {
  content: ""; margin-left: auto; width: .42rem; height: .42rem; flex: none;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s;
}
details[open] > summary.nav-label::after, .launch-area[open] .chev { transform: rotate(45deg); }
.nav-area { margin-top: .2rem; }
.nav-area > summary.nav-label { color: var(--c700); padding: .55rem .8rem; border-radius: 10px; }
.nav-area > summary.nav-label:hover { background: var(--c50); }
.nav-area > a, .nav-area > span.soon { margin-left: .55rem; }
.nav-area > a.active { background: var(--c50); color: var(--c700); }
.nav-area > a.active .i { color: var(--c); }
/* Inicio: 5 cuadrados que ocupan el ancho de la página, cerrados, título centrado; al abrir crecen hacia abajo */
.areas { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1rem; align-items: start; }
@media (max-width: 700px) { .areas { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.launch-area { background: var(--surface); border: 1px solid var(--line); border-top: 6px solid var(--c); border-radius: 16px; overflow: hidden; }
.launch-area > summary { display: block; user-select: none; background: linear-gradient(180deg, var(--c50), var(--surface) 90%); }
.launch-area > summary:hover { background: var(--c50); }
.area-cuadro { position: relative; container-type: inline-size; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; text-align: center; padding: .6rem .4rem 1.6rem; }
.launch-area h2 { margin: 0; font-size: clamp(1rem, 10.4cqi, 1.75rem); font-weight: 1000; line-height: 1.15; color: var(--c700); overflow-wrap: normal; hyphens: none; }
.area-foot { position: absolute; left: 0; right: 0; bottom: .9rem; display: flex; justify-content: center; align-items: center; gap: .4rem;
  color: var(--c700); font-weight: 800; font-size: .82rem; }
.area-foot .chev { margin-left: 0; }
.launch-area[open] .area-cuadro { aspect-ratio: auto; flex-direction: column; gap: .4rem; padding: .8rem .6rem .6rem; }
.launch-area[open] .area-foot { position: static; }
.launch-area .cerrar, .launch-area[open] .ver { display: none; }
.launch-area[open] .cerrar { display: inline; }
/* Abiertas: todas del mismo alto, caben 5 secciones; las demás con scroll dentro del rectángulo */
.area-items { --card-h: 4.6rem; --gap: .4rem; display: grid; grid-auto-rows: var(--card-h); gap: var(--gap); padding: .3rem .6rem .6rem;
  height: calc(5 * var(--card-h) + 4 * var(--gap) + .9rem); overflow-y: auto; overscroll-behavior: contain; }
.area-items .launch { gap: .5rem; padding: .5rem; border-radius: 12px; box-shadow: none; overflow: hidden; }
.area-items .launch:hover { transform: none; box-shadow: none; border-color: var(--c); background: var(--c50); }
.area-items .launch > span:last-child { min-width: 0; }
.area-items .launch strong, .area-items .launch small { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.area-items .launch strong { font-size: .86rem; line-height: 1.2; -webkit-line-clamp: 2; }
.area-items .launch small { font-size: .74rem; line-height: 1.25; -webkit-line-clamp: 2; }
.launch-area .area-items .launch .launch-ico { width: 1.7rem; height: 1.7rem; border-radius: 8px; background: var(--c50); color: var(--c); }
.area-items .launch .launch-ico .i { width: .95rem; height: .95rem; }
.area-items .launch.soon { opacity: .6; cursor: default; }
.area-items .launch.soon:hover { border-color: var(--line); background: var(--surface); }
.nav .pill-soon { margin-left: auto; font-size: .66rem; font-weight: 800; padding: .1rem .45rem; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); color: var(--faint); }
.sidebar-foot { margin-top: auto; padding-top: 1rem; }
.user-card { display: flex; align-items: center; gap: .7rem; padding: .7rem; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.user-card .who { min-width: 0; flex: 1; }
.user-card .who strong { display: block; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card .who small { color: var(--muted); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: .75rem;
  padding: .8rem clamp(1rem, 3vw, 2rem);
  background: rgba(246, 244, 238, .85);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.content { padding: clamp(1rem, 3vw, 2rem); padding-top: .75rem; max-width: 1320px; width: 100%; }
.menu-btn { display: inline-flex; }
@media (min-width: 901px) {
  body.nav-collapsed .app { grid-template-columns: 0 1fr; }
  body.nav-collapsed .sidebar { visibility: hidden; padding: 0; border: 0; overflow: hidden; }
}
.app { transition: grid-template-columns .25s var(--ease); }

.site-footer { margin-top: auto; padding: 1.5rem clamp(1rem, 3vw, 2rem); color: var(--faint); font-size: .85rem; }

.env-banner { text-align: center; font-weight: 800; font-size: .8rem; letter-spacing: .03em; padding: .3rem; color: var(--ink); }
.env-dev { background: repeating-linear-gradient(45deg, var(--yellow), var(--yellow) 12px, #ffd84a 12px, #ffd84a 24px); }
.env-staging { background: #ffb27a; }

/* Buscador global */
.search { position: relative; flex: 1; max-width: 560px; }
.search .i { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
#global-search { padding-left: 2.6rem; background: var(--surface); border-color: var(--line); border-radius: 999px; box-shadow: var(--shadow-sm); }
.search kbd { position: absolute; right: .8rem; top: 50%; transform: translateY(-50%); }
.search-results {
  position: absolute; top: calc(100% + .5rem); left: 0; right: 0; z-index: 30;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: .5rem; max-height: 70vh; overflow-y: auto;
}
.search-results:empty { display: none; }
.search-results h4 { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin: .5rem .6rem .3rem; }
.search-results a { display: flex; align-items: center; gap: .7rem; padding: .5rem .6rem; border-radius: 10px; color: var(--text); }
.search-results a:hover, .search-results a:focus { background: var(--surface-2); text-decoration: none; outline: none; }
.search-results .empty { padding: 1rem; color: var(--muted); text-align: center; }
kbd { font-family: var(--font); font-size: .72rem; font-weight: 800; color: var(--faint); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: .05rem .4rem; background: var(--surface-2); }

.topbar-actions { display: flex; align-items: center; gap: .4rem; margin-left: auto; }

/* ------------------------------------------------------------ Encabezado de página */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: .5rem 0 1.5rem; }
.page-head p { margin: .2rem 0 0; color: var(--muted); }
.page-head .actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .9rem; margin-bottom: .6rem; }
.eyebrow { font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--green-600); margin-bottom: .3rem; }

/* ------------------------------------------------------------ Botones */
button, .btn, [role="button"] {
  font: inherit; font-weight: 800; font-size: .95rem;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 2.75rem; padding: .6rem 1.15rem;
  border-radius: 12px; border: 1px solid transparent;
  background: var(--green); color: #fff; cursor: pointer;
  box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 6px 16px -8px rgba(99, 154, 31, .8);
  transition: transform .12s var(--ease), background .15s, box-shadow .15s;
  text-decoration: none !important; white-space: nowrap;
}
button:hover, .btn:hover, [role="button"]:hover { background: var(--green-600); color: #fff; }
button:active, .btn:active { transform: translateY(1px) scale(.99); }
button:focus-visible, .btn:focus-visible, a:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-secondary, button.secondary, .secondary[role="button"] { background: var(--surface); color: var(--ink); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.btn-secondary:hover, button.secondary:hover { background: var(--surface-2); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--text); box-shadow: none; border-color: transparent; }
.btn-ghost:hover { background: rgba(29,30,28,.05); color: var(--ink); }
.btn-orange { background: var(--orange); box-shadow: 0 6px 16px -8px rgba(238, 115, 53, .9); }
.btn-orange:hover { background: var(--orange-700); }
.btn-danger { background: var(--surface); color: var(--red); border-color: #f1c4c4; box-shadow: none; }
.btn-danger:hover { background: var(--red-50); color: var(--red); }
.btn-sm { min-height: 2.1rem; padding: .35rem .75rem; font-size: .85rem; border-radius: 10px; }
.btn-icon { padding: 0; width: 2.5rem; min-height: 2.5rem; }
.btn-block { width: 100%; }
button.link { background: none; border: 0; box-shadow: none; color: var(--green-700); padding: 0; min-height: 0; font-weight: 700; }
button.link:hover { text-decoration: underline; background: none; color: var(--green-600); }

/* ------------------------------------------------------------ Formularios */
label { display: block; font-weight: 700; font-size: .9rem; color: var(--ink); margin-bottom: .35rem; }
input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]), select, textarea {
  font: inherit; width: 100%; color: var(--text);
  padding: .65rem .85rem; min-height: 2.75rem;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px;
  transition: border-color .15s, box-shadow .15s; appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236f6c64' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .8rem center; padding-right: 2.4rem;
}
textarea { min-height: 5rem; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: var(--ring); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type="checkbox"], input[type="radio"] { width: 1.2rem; height: 1.2rem; accent-color: var(--green); vertical-align: -.2rem; margin: 0 .45rem 0 0; }
input[type="color"] { width: 4rem; height: 2.75rem; padding: .2rem; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); }
input[type="file"] { font: inherit; font-size: .9rem; }
input[type="file"]::file-selector-button { font: inherit; font-weight: 700; margin-right: .75rem; padding: .45rem .9rem; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface-2); cursor: pointer; }
.field { margin-bottom: 1.1rem; }
.field .help, .helptext { display: block; color: var(--muted); font-size: .82rem; margin-top: .3rem; font-weight: 500; }
.field.check label { display: flex; align-items: center; font-weight: 700; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--red); }
.errorlist { list-style: none; padding: 0; margin: .35rem 0 0; color: var(--red); font-size: .85rem; font-weight: 700; }
.errorlist.nonfield { background: var(--red-50); border-radius: 12px; padding: .75rem 1rem; margin-bottom: 1rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1.1rem; }
.form-grid .span-2 { grid-column: span 2; }
.form-actions { display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; padding-top: .5rem; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
form { margin: 0; }
.curp-hint { min-height: 1.3rem; margin-top: .35rem; font-size: .85rem; font-weight: 700; }
.curp-hint.ok { color: var(--green-700); }
.curp-hint.bad { color: var(--orange-700); }

/* ------------------------------------------------------------ Tarjetas y secciones */
.card, article {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.35rem; margin: 0 0 1.25rem;
}
.card > h2:first-child, .card-head { margin-bottom: 1rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.card-head h2, .card-head h3 { margin: 0; display: flex; align-items: center; gap: .55rem; }
.card-head h2 .i, .card-head h3 .i { color: var(--green); }
.card.flat { box-shadow: none; }
.card.tight { padding: 1rem; }
.section-title { display: flex; align-items: center; gap: .55rem; font-size: 1.05rem; margin: 0 0 .9rem; }
.section-title .i { color: var(--green); }

.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid > .card, .grid > article { margin: 0; }
.stack > * + * { margin-top: 1.25rem; }

/* KPIs */
.kpi { position: relative; overflow: hidden; }
.kpi .kpi-label { display: flex; align-items: center; gap: .45rem; color: var(--muted); font-weight: 700; font-size: .88rem; }
.kpi .kpi-value { font-size: 2.3rem; font-weight: 900; color: var(--ink); letter-spacing: -.03em; line-height: 1.1; margin: .35rem 0 .1rem; font-variant-numeric: tabular-nums; }
.kpi .kpi-sub { color: var(--muted); font-size: .85rem; font-weight: 600; }
.kpi .kpi-icon { position: absolute; right: 1.1rem; top: 1.1rem; width: 2.6rem; height: 2.6rem; border-radius: 14px; display: grid; place-items: center; }
.kpi .kpi-icon .i { width: 1.35rem; height: 1.35rem; }
.tone-green .kpi-icon { background: var(--green-50); color: var(--green-600); }
.tone-orange .kpi-icon { background: var(--orange-50); color: var(--orange); }
.tone-yellow .kpi-icon { background: var(--yellow-50); color: #b38a00; }
.tone-blue .kpi-icon { background: var(--blue-50); color: var(--blue); }

/* Héroe del inicio */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(120deg, #fff 0%, #fff 45%, var(--green-50) 100%);
  border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow);
  padding: clamp(1.4rem, 3vw, 2.2rem); margin-bottom: 1.5rem;
}
.hero h1 { font-size: clamp(1.7rem, 3vw, 2.4rem); margin-bottom: .35rem; }
.hero p { color: var(--muted); font-size: 1.05rem; margin: 0; max-width: 46ch; }
.hero .tree { position: absolute; right: clamp(-2rem, 2vw, 2rem); bottom: -1.5rem; width: clamp(140px, 22vw, 230px); opacity: .95; pointer-events: none; transform-origin: bottom center; animation: sway 7s ease-in-out infinite; }
.hero .hero-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.25rem; position: relative; }
.hero .dot { display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; background: var(--yellow); margin: 0 .4rem .15rem; }
@keyframes sway { 0%, 100% { transform: rotate(-1.5deg); } 50% { transform: rotate(1.5deg); } }

/* ------------------------------------------------------------ Avatares, chips, badges */
.avatar {
  --c: var(--green);
  width: 2.6rem; height: 2.6rem; flex: none; border-radius: 50%;
  display: grid; place-items: center; overflow: hidden;
  font-weight: 900; font-size: .9rem; color: #fff; letter-spacing: .02em;
  background: var(--c);
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px color-mix(in srgb, var(--c) 35%, transparent);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 2rem; height: 2rem; font-size: .72rem; }
.avatar-lg { width: 5.5rem; height: 5.5rem; font-size: 1.8rem; box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px color-mix(in srgb, var(--c) 40%, transparent); }
.avatar-stack { display: flex; flex-wrap: wrap; gap: .35rem; }
.avatar-stack .avatar { margin-left: 0; box-shadow: none; }
.avatar-stack .avatar:first-child { margin-left: 0; }

.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .76rem; font-weight: 800; line-height: 1;
  padding: .32rem .6rem; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
  white-space: nowrap;
}
.badge .i { width: .95em; height: .95em; }
.badge-green { background: var(--green-50); color: var(--green-700); border-color: var(--green-100); }
.badge-orange { background: var(--orange-50); color: var(--orange-700); border-color: #f8d5c2; }
.badge-yellow { background: var(--yellow-50); color: #8a6a00; border-color: #fbe7a0; }
.badge-red { background: var(--red-50); color: var(--red); border-color: #f5caca; }
.badge-blue { background: var(--blue-50); color: var(--blue); border-color: #cfe2f3; }
.group-chip { --c: var(--green); display: inline-flex; align-items: center; gap: .4rem; font-weight: 800; font-size: .82rem; padding: .28rem .65rem .28rem .45rem; border-radius: 999px; background: color-mix(in srgb, var(--c) 13%, white); color: color-mix(in srgb, var(--c) 70%, black); }
.group-chip::before { content: ""; width: .65rem; height: .65rem; border-radius: 50%; background: var(--c); }

/* ------------------------------------------------------------ Tarjetas de alumno */
.student-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.student-card {
  --c: var(--green);
  position: relative; display: flex; flex-direction: column; gap: .8rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem; color: var(--text); box-shadow: var(--shadow-sm);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s;
}
.student-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; border-radius: var(--radius) var(--radius) 0 0; background: var(--c); opacity: .85; }
.student-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); text-decoration: none; color: var(--text); }
.student-card .top { display: flex; align-items: center; gap: .8rem; }
.student-card .name { font-weight: 800; color: var(--ink); line-height: 1.2; }
.student-card .meta { font-size: .85rem; color: var(--muted); font-weight: 600; }
.student-card .tags { display: flex; flex-wrap: wrap; gap: .35rem; }

/* ------------------------------------------------------------ Tablas */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th { text-align: left; font-size: .75rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); background: var(--surface-2); padding: .75rem 1rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: .7rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-person { display: flex; align-items: center; gap: .7rem; }
.cell-person a { color: var(--ink); font-weight: 800; }

/* ------------------------------------------------------------ Filtros */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: 1.25rem; }
.toolbar .grow { flex: 1 1 240px; }
.toolbar select { width: auto; min-width: 11rem; }
.toolbar .check { display: flex; align-items: center; margin: 0; font-weight: 700; font-size: .9rem; padding: 0 .4rem; }
.segmented { display: inline-flex; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; padding: 3px; }
.segmented a { display: grid; place-items: center; width: 2.4rem; height: 2.1rem; border-radius: 9px; color: var(--muted); }
.segmented a.on { background: var(--green-50); color: var(--green-700); }
.count { color: var(--muted); font-weight: 700; font-size: .9rem; margin: 0 0 .8rem; }

/* ------------------------------------------------------------ Perfil */
.profile {
  --c: var(--green);
  display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap;
  padding: 1.6rem; border-radius: 22px; margin-bottom: 1.5rem;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 12%, white), #fff 70%);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.profile h1 { margin: 0 0 .35rem; }
.profile .facts { display: flex; flex-wrap: wrap; gap: .45rem; }
.profile .actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }

.dl { display: grid; grid-template-columns: minmax(8rem, 38%) 1fr; gap: .55rem 1rem; margin: 0; }
.dl dt { color: var(--muted); font-weight: 700; font-size: .88rem; }
.dl dd { margin: 0; font-weight: 600; word-break: break-word; }
.dl dd.empty { color: var(--faint); font-weight: 500; font-style: italic; }

.contact { display: flex; align-items: flex-start; gap: .85rem; padding: .85rem 0; border-bottom: 1px dashed var(--line); }
.contact:last-child { border-bottom: 0; padding-bottom: 0; }
.contact:first-child { padding-top: 0; }
.contact .body { flex: 1; min-width: 0; }
.contact .name { font-weight: 800; color: var(--ink); }
.contact .links { display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin-top: .25rem; font-size: .9rem; }
.contact .links a { display: inline-flex; align-items: center; gap: .3rem; font-weight: 700; }
.contact .row-actions { display: flex; gap: .2rem; }

.alert-box { display: flex; gap: .8rem; align-items: flex-start; padding: 1rem 1.1rem; border-radius: 14px; margin-bottom: 1.25rem; font-weight: 600; }
.alert-box .i { flex: none; margin-top: .1rem; }
.alert-box.health { background: var(--red-50); color: #8f2a2a; border: 1px solid #f5caca; }
.alert-box.missing { background: var(--yellow-50); color: #6b5300; border: 1px solid #fbe7a0; }
.alert-box strong { display: block; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 1rem 1.4rem; border-left: 2px solid var(--line); margin-left: .4rem; }
.timeline li:last-child { padding-bottom: 0; border-left-color: transparent; }
.timeline li::before { content: ""; position: absolute; left: -.42rem; top: .25rem; width: .7rem; height: .7rem; border-radius: 50%; background: var(--surface); border: 2px solid var(--green); }
.timeline .when { font-size: .8rem; color: var(--faint); font-weight: 700; }
.timeline .what { font-size: .9rem; }

/* ------------------------------------------------------------ Grupos */
.group-card { --c: var(--green); padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.group-card .band { padding: 1.1rem 1.25rem; background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 70%, white)); color: #fff; }
.group-card .band h3 { color: #fff; font-size: 1.25rem; margin: 0; text-shadow: 0 1px 2px rgba(0,0,0,.15); }
.group-card .band small { opacity: .92; font-weight: 700; }
.group-card .body { padding: 1.1rem 1.25rem 1.25rem; display: flex; flex-direction: column; gap: .9rem; flex: 1; }
.meter { height: .65rem; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 99px; background: var(--c, var(--green)); width: 0; transition: width 1s var(--ease); }
.meter-row { display: flex; justify-content: space-between; font-size: .85rem; font-weight: 700; color: var(--muted); margin-bottom: .35rem; }
.meter-row strong { color: var(--ink); }

.occupancy { display: grid; gap: .9rem; }
.occupancy .row { display: grid; grid-template-columns: 7.5rem 1fr 3.5rem; gap: .8rem; align-items: center; font-weight: 700; font-size: .9rem; }
.occupancy .row .num { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

.donut { --p: 0; --c: var(--green); width: 8.5rem; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-2) 0); position: relative; }
.donut::after { content: ""; position: absolute; inset: 14px; border-radius: 50%; background: var(--surface); }
.donut span { position: relative; z-index: 1; font-weight: 900; font-size: 1.5rem; color: var(--ink); }

.birthday-list { list-style: none; margin: 0; padding: 0; }
.birthday-list li { display: flex; align-items: center; gap: .75rem; padding: .55rem 0; border-bottom: 1px dashed var(--line); }
.birthday-list li:last-child { border-bottom: 0; }
.birthday-list .date { margin-left: auto; text-align: right; font-size: .8rem; font-weight: 800; color: var(--orange); white-space: nowrap; }
.birthday-list .today { background: var(--yellow-50); border-radius: 12px; padding-inline: .5rem; }

.roadmap { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .75rem; }
.roadmap .item { display: flex; align-items: center; gap: .7rem; padding: .85rem 1rem; border-radius: 14px; border: 1px dashed var(--line-strong); color: var(--muted); font-weight: 700; font-size: .9rem; background: var(--surface-2); }
.roadmap .item .i { color: var(--faint); }
.roadmap .item.ready { border-style: solid; background: var(--green-50); border-color: var(--green-100); color: var(--green-700); }
.roadmap .item.ready .i { color: var(--green); }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-state img { width: 120px; margin: 0 auto 1rem; opacity: .9; }
.empty-state h3 { color: var(--ink); }

/* ------------------------------------------------------------ Mensajes */
.messages { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 60; display: grid; gap: .6rem; max-width: min(420px, calc(100vw - 2.5rem)); }
.toast {
  display: flex; align-items: center; gap: .75rem;
  padding: .9rem 1rem .9rem 1.1rem; border-radius: 14px;
  background: var(--ink); color: #fff; font-weight: 700; box-shadow: var(--shadow-lg);
  animation: toast-in .45s var(--ease) both;
}
.toast .i { flex: none; }
.toast.success .i { color: var(--lime); }
.toast.warning .i, .toast.error .i { color: var(--orange); }
.toast.info .i { color: var(--yellow); }
.toast button { margin-left: auto; background: transparent; box-shadow: none; min-height: 0; padding: .2rem; color: rgba(255,255,255,.7); }
.toast.leaving { animation: toast-out .35s var(--ease) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.97); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }
/* Mensajes dentro de páginas de allauth */
.msg { padding: .9rem 1.1rem; border-radius: 12px; margin-bottom: 1rem; font-weight: 700; box-shadow: none; }
.msg-warning, .msg-error { background: var(--orange-50); color: var(--orange-700); border: 1px solid #f8d5c2; }
.msg-success, .msg-info { background: var(--green-50); color: var(--green-700); border: 1px solid var(--green-100); }

/* ------------------------------------------------------------ Animación de entrada */
.reveal { animation: rise .5s var(--ease) both; }
.reveal:nth-child(2) { animation-delay: .05s; }
.reveal:nth-child(3) { animation-delay: .1s; }
.reveal:nth-child(4) { animation-delay: .15s; }
.reveal:nth-child(5) { animation-delay: .2s; }
.reveal:nth-child(6) { animation-delay: .25s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.htmx-request .spin, .spin.htmx-request { opacity: 1; }
.htmx-indicator { opacity: 0; transition: opacity .2s; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
#resultados { transition: opacity .15s; }
#resultados.htmx-request { opacity: .55; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ------------------------------------------------------------ Pantallas de acceso (allauth) */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art {
  position: relative; overflow: hidden;
  background:
    radial-gradient(circle at 20% 20%, rgba(254, 204, 23, .35), transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(254, 204, 23, .18), transparent 40%),
    linear-gradient(160deg, #8fc13a, var(--green) 45%, var(--green-700));
  display: flex; flex-direction: column; justify-content: flex-start; padding: 4rem 3rem; color: #fff;
}
.auth-art h2 { color: #fff; font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 900; max-width: 14ch; line-height: 1.1; }
.auth-art p { opacity: .92; font-weight: 600; max-width: 34ch; }
.auth-art .tree { position: absolute; right: -40px; bottom: -30px; width: 62%; max-width: 440px; filter: drop-shadow(0 20px 40px rgba(0,0,0,.18)); transform-origin: bottom center; animation: sway 8s ease-in-out infinite; }
.auth-art .bubbles span { position: absolute; border-radius: 50%; background: rgba(255,255,255,.14); animation: float 9s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-18px); } }
.auth-panel { display: flex; flex-direction: column; justify-content: center; padding: clamp(1.5rem, 5vw, 4rem); background: var(--surface); }
.auth-panel .inner { width: 100%; max-width: 420px; margin: 0 auto; }
.auth-panel .logo { width: 170px; margin-bottom: 2rem; }
.auth-panel h1 { font-size: 1.8rem; }
.auth-panel article { box-shadow: none; border: 0; padding: 0; }
.auth-panel form button[type="submit"] { width: 100%; margin-top: .5rem; }
.auth-panel .lang { margin-top: 2rem; display: flex; justify-content: center; }

/* ------------------------------------------------------------ Impresión */
.print-only { display: none; }
@media print {
  @page { margin: 12mm; }
  body { background: #fff; font-size: 11pt; }
  .app { display: block; }
  .sidebar, .topbar, .no-print, .messages, .site-footer, .env-banner { display: none !important; }
  .content { padding: 0; max-width: none; }
  .card, article, .table-wrap { box-shadow: none; border-color: #ccc; }
  .print-only { display: block; }
  td, th { padding: .35rem .5rem; }
  a { color: inherit; }
}

/* ------------------------------------------------------------ Responsivo */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(84vw, 300px); z-index: 50;
    transform: translateX(-105%); transition: transform .3s var(--ease); box-shadow: var(--shadow-lg);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(29,30,28,.35); z-index: 40; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { min-height: 220px; padding: 2rem; }
  .auth-art .tree { width: 45%; }
  .search kbd { display: none; }
}
@media (max-width: 560px) {
  .grid-4 { grid-template-columns: 1fr 1fr; gap: .75rem; }
  .kpi .kpi-value { font-size: 1.8rem; }
  .kpi .kpi-icon { display: none; }
  .form-grid .span-2 { grid-column: auto; }
  .profile { padding: 1.2rem; }
  .profile .actions { margin-left: 0; width: 100%; }
  .dl { grid-template-columns: 1fr; gap: .1rem; }
  .dl dd { margin-bottom: .6rem; }
  .topbar-actions .hide-sm { display: none; }
}

details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
.print-col { display: none; }
@media print {
  .print-col { display: table-cell; width: 2.4rem; text-align: center; border-left: 1px solid #ccc; }
  .avatar { box-shadow: none; }
}

.meter.over > span { background: var(--red); }
.num.over, .meter-row strong.over { color: var(--red); }

/* ------------------------------------------------------------ Cobranza */
.money { font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; }
.kpi .kpi-value.money { font-size: clamp(1.5rem, 2.2vw, 2rem); }
.bars { display: grid; grid-template-columns: repeat(6, 1fr); gap: .75rem; align-items: end; height: 220px; }
.bar-col { display: flex; flex-direction: column; align-items: center; gap: .4rem; height: 100%; justify-content: flex-end; }
.bar { width: 100%; max-width: 56px; flex: 1; display: flex; align-items: flex-end; }
.bar > span { display: block; width: 100%; height: 0; border-radius: 10px 10px 4px 4px; background: linear-gradient(180deg, var(--lime), var(--green)); transition: height 1s var(--ease); }
.bar-col.current .bar > span { background: linear-gradient(180deg, #ffd84a, var(--orange)); }
.bar-val { font-size: .72rem; font-weight: 800; color: var(--muted); white-space: nowrap; }
.bar-label { font-size: .8rem; font-weight: 800; color: var(--faint); text-transform: uppercase; }
.forma-efectivo { --c: var(--green); } .forma-hsbc { --c: #db0011; } .forma-santander { --c: #ec0000; } .forma-tarjeta { --c: var(--blue); }
.forma-hsbc > span { background: #c9302c; } .forma-santander > span { background: #e8604c; }
.list-row { display: flex; align-items: center; gap: .8rem; padding: .7rem .5rem; border-radius: 12px; color: var(--text); border-bottom: 1px dashed var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.list-row .grow { flex: 1; min-width: 0; }
.dot-level { width: .8rem; height: .8rem; border-radius: 50%; flex: none; }
.dot-level.rojo, .lvl-rojo { background: var(--red); } .dot-level.naranja, .lvl-naranja { background: var(--orange); }
.dot-level.amarillo, .lvl-amarillo { background: var(--yellow); } .dot-level.verde, .lvl-verde { background: var(--green); }
.quick-links { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin-top: .5rem; }
.quick-links a, .quick-links button.link { display: inline-flex; align-items: center; gap: .4rem; font-weight: 800; }

/* Mapa de pagos (alumnos × meses) */
.pay-map td.cell { padding: .35rem .2rem; text-align: center; }
.pay-map th.m { text-align: center; padding: .6rem .2rem; }
.pm { display: inline-grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 9px; font-size: .7rem; font-weight: 900; color: #fff; }
.pm-pagado { background: var(--green); }
.pm-parcial { background: var(--yellow); color: #6b5300; }
.pm-vencido { background: var(--red); }
.pm-pendiente { background: var(--surface-2); border: 1px dashed var(--line-strong); color: var(--faint); }
.pm-cancelado, .pm-sin { background: transparent; border: 1px dashed var(--line); color: var(--line-strong); }
.legend { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; font-size: .85rem; font-weight: 700; color: var(--muted); margin: .75rem 0 1rem; }
.legend span { display: inline-flex; align-items: center; gap: .4rem; }
.legend .pm { width: 1rem; height: 1rem; border-radius: 4px; }

/* Cobrar */
.pay-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 1.25rem; align-items: start; }
.pay-summary { position: sticky; top: 5rem; }
.charge { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .8rem; padding: .75rem .5rem; border-bottom: 1px dashed var(--line); border-radius: 12px; transition: background .12s; }
.charge:last-child { border-bottom: 0; }
.charge.on { background: var(--green-50); }
.charge .what strong { display: block; color: var(--ink); }
.charge .what small { color: var(--muted); font-weight: 600; }
.charge input[type="number"] { width: 8.5rem; text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.charge .late { color: var(--red); font-weight: 800; }
.child-head { display: flex; align-items: center; gap: .6rem; margin: .5rem 0 .25rem; font-weight: 800; }
.big-money, input.big-money { font-size: 1.8rem !important; font-weight: 900 !important; text-align: right; letter-spacing: -.02em; min-height: 3.6rem !important; }
.total-line { display: flex; justify-content: space-between; align-items: baseline; padding: .4rem 0; font-weight: 700; color: var(--muted); }
.total-line strong { color: var(--ink); font-size: 1.1rem; }
.total-line.grand strong { font-size: 1.6rem; }
.total-line.change strong { color: var(--green-700); }
ul.pills, div.pills { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.pills label { display: flex; align-items: center; gap: .4rem; margin: 0; padding: .65rem .75rem; border: 1px solid var(--line-strong); border-radius: 12px; cursor: pointer; font-size: .88rem; background: var(--surface); }
.pills label:has(input:checked) { border-color: var(--green); background: var(--green-50); color: var(--green-700); box-shadow: var(--ring); }
.pills input { margin: 0; }

/* Recibo */
.receipt { max-width: 760px; margin: 0 auto; position: relative; overflow: hidden; }
.receipt-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding-bottom: 1rem; border-bottom: 2px dashed var(--line); margin-bottom: 1rem; }
.receipt-head img { width: 130px; }
.receipt .folio { text-align: right; }
.receipt .folio strong { display: block; font-size: 1.6rem; font-weight: 900; color: var(--orange); font-family: var(--mono); }
.receipt .amount { font-size: 2.4rem; font-weight: 900; color: var(--ink); letter-spacing: -.02em; }
.receipt .letras { font-size: .85rem; font-weight: 800; color: var(--muted); letter-spacing: .02em; }
.stamp { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%) rotate(-18deg); font-size: 4.5rem; font-weight: 900; color: rgba(209, 67, 67, .18); border: 8px solid rgba(209, 67, 67, .18); border-radius: 20px; padding: .2rem 1.5rem; pointer-events: none; letter-spacing: .1em; }
.receipt-actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin: 1.25rem 0; }

@media (max-width: 900px) {
  .pay-layout { grid-template-columns: 1fr; }
  .pay-summary { position: static; }
  .bars { height: 180px; gap: .4rem; }
  .bar-val { display: none; }
}
@media (max-width: 560px) {
  .charge { grid-template-columns: auto 1fr; }
  .charge input[type="number"] { grid-column: 2; width: 100%; }
}
.total-line.warn strong, .total-line.warn span { color: var(--red); }
.big-search { font-size: 1.2rem !important; min-height: 3.4rem !important; border-radius: 16px !important; }
details.adelantar { margin: .25rem 0 .75rem; }
details.adelantar > summary { display: inline-flex; align-items: center; gap: .4rem; font-weight: 800; font-size: .88rem; color: var(--green-700); padding: .4rem .6rem; border-radius: 10px; }
details.adelantar > summary:hover { background: var(--green-50); }
details.adelantar[open] > summary { margin-bottom: .25rem; }

/* ------------------------------------------------------------ Caja */
.accounts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.account { --c: var(--green); position: relative; overflow: hidden; display: flex; flex-direction: column; gap: .2rem; padding: 1.2rem 1.3rem; border-radius: 20px; color: #fff !important; text-decoration: none !important;
  background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 65%, black)); box-shadow: 0 14px 30px -16px color-mix(in srgb, var(--c) 80%, black); transition: transform .18s var(--ease); }
.account:hover { transform: translateY(-3px); }
.account::after { content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: rgba(255,255,255,.12); }
.account.total { --c: var(--ink); background: linear-gradient(135deg, #2f312c, var(--ink)); }
.account-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.account-name { display: inline-flex; align-items: center; gap: .45rem; font-weight: 800; }
.account .badge { background: rgba(255,255,255,.18); color: #fff; border-color: rgba(255,255,255,.25); }
.account-balance { font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 900; letter-spacing: -.02em; margin-top: .6rem; }
.account small { opacity: .85; font-weight: 700; }
.mov-ico { width: 2.1rem; height: 2.1rem; border-radius: 10px; display: grid; place-items: center; flex: none; }
.mov-ingreso { background: var(--green-50); color: var(--green-600); }
.mov-egreso { background: var(--orange-50); color: var(--orange); }
.mov-traspaso { background: var(--blue-50); color: var(--blue); }
.money.pos { color: var(--green-700); } .money.neg { color: var(--orange-700); }
.bars.dual .bar.pair { gap: 4px; max-width: 64px; }
.bars.dual .bar.pair > span { flex: 1; }
.bars.dual .bar.pair > span.out { background: linear-gradient(180deg, #ffb27a, var(--orange)); }
.denoms { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.denom { display: grid; grid-template-columns: 4.2rem 1fr; align-items: center; gap: .5rem; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.denom .face { display: grid; place-items: center; height: 2.4rem; border-radius: 8px; font-weight: 900; font-size: .9rem; color: #fff; }
.denom .face.billete { background: linear-gradient(135deg, #6aa84f, #3d7a2f); }
.denom .face.moneda { background: radial-gradient(circle at 35% 35%, #f3d57a, #b8912c); border-radius: 50%; width: 2.4rem; justify-self: center; font-size: .75rem; }
.denom input { text-align: center; font-weight: 800; }
.denom .sub { grid-column: 1 / -1; text-align: right; font-size: .78rem; color: var(--muted); font-weight: 700; }
.cuadre { font-size: 1.05rem; }
.cuadre .ok { color: var(--green-700); } .cuadre .bad { color: var(--red); }
.vale-firmas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 2.5rem; text-align: center; font-size: .85rem; color: var(--muted); }
.vale-firmas span { display: block; border-top: 1px solid var(--line-strong); padding-top: .4rem; }
.ticket-thumb { max-width: 280px; border-radius: 12px; border: 1px solid var(--line); }
.month-nav { display: flex; align-items: center; gap: .3rem; }
.chip-picker { display: grid; gap: .6rem; margin-bottom: .6rem; }
.chip-group small { display: block; font-weight: 800; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; font-size: .7rem; margin-bottom: .3rem; }
.chip { min-height: 0; padding: .4rem .75rem; margin: 0 .3rem .35rem 0; border-radius: 999px; font-size: .85rem; font-weight: 700; background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); box-shadow: none; }
.chip:hover { background: var(--surface-2); color: var(--ink); }
.chip.on { background: var(--orange-50); border-color: var(--orange); color: var(--orange-700); box-shadow: 0 0 0 3px rgba(238,115,53,.18); }
.chip-picker + select { position: absolute; opacity: 0; width: 1px !important; height: 1px; min-height: 0 !important; padding: 0 !important; pointer-events: none; }

/* ------------------------------------------------------------ Prospectos */
.kanban { display: grid; grid-template-columns: repeat(6, minmax(168px, 1fr)); gap: .6rem; overflow-x: auto; padding-bottom: 1rem; align-items: start; }
.kcol { background: rgba(29,30,28,.035); border-radius: 18px; padding: .6rem; min-height: 320px; transition: background .15s, box-shadow .15s; }
.kcol header { display: flex; justify-content: space-between; align-items: center; padding: .35rem .5rem .7rem; font-weight: 800; color: var(--ink); font-size: .92rem; }
.kcol header::before { content: ""; width: .6rem; height: .6rem; border-radius: 50%; margin-right: .5rem; background: var(--kc, var(--faint)); flex: none; }
.kcol header span:first-child { flex: 1; }
.kcount { font-size: .75rem; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: .05rem .5rem; color: var(--muted); }
.kcol-nuevo { --kc: var(--blue); } .kcol-contactado { --kc: var(--yellow); } .kcol-visita { --kc: var(--orange); }
.kcol-visito { --kc: #8b5cc7; } .kcol-inscrito { --kc: var(--green); } .kcol-perdido { --kc: var(--faint); }
.kcol.over { background: var(--green-50); box-shadow: inset 0 0 0 2px var(--green); }
.kitems { display: grid; gap: .55rem; }
.kempty { text-align: center; color: var(--faint); font-size: .85rem; padding: 1.5rem 0; margin: 0; }
.lead-card { display: flex; flex-direction: column; gap: .3rem; padding: .7rem .75rem; border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); color: var(--text); border-left: 4px solid var(--kc, var(--line)); cursor: grab; transition: transform .12s, box-shadow .12s; }
.lead-card:hover { text-decoration: none; color: var(--text); box-shadow: var(--shadow); transform: translateY(-1px); }
.lead-card strong { color: var(--ink); font-size: .95rem; }
.lead-card.late { background: #fff7f7; } .lead-card.today { background: #fffcef; }
.lead-card.dragging { opacity: .45; }
.lead-meta { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .2rem; }
.lead-meta .badge { font-size: .7rem; padding: .22rem .45rem; }
.funnel { display: grid; gap: .45rem; }
.funnel-step { display: grid; grid-template-columns: 9rem 1fr 4rem; align-items: center; gap: .8rem; font-weight: 700; font-size: .9rem; }
.funnel-bar { height: 2.2rem; border-radius: 10px; background: var(--surface-2); overflow: hidden; }
.funnel-bar > span { display: flex; align-items: center; justify-content: flex-end; padding-right: .6rem; height: 100%; color: #fff; font-weight: 900; font-size: .85rem;
  background: linear-gradient(90deg, var(--lime), var(--green)); border-radius: 10px; width: 0; transition: width 1s var(--ease); min-width: 2.2rem; }
.wa-list { display: grid; gap: .5rem; }
.wa-item { display: flex; align-items: center; gap: .7rem; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 12px; color: var(--text); }
.wa-item:hover { background: #effaf0; border-color: #bfe5c4; text-decoration: none; color: var(--text); }
.wa-item .i { color: #25d366; }
.wa-item small { display: block; color: var(--muted); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 36ch; }
@media (max-width: 900px) { .kanban { grid-template-columns: repeat(6, 78vw); scroll-snap-type: x mandatory; } .kcol { scroll-snap-align: start; } }

/* ------------------------------------------------------------ Páginas públicas */
.pub { min-height: 100vh; background: radial-gradient(circle at 10% 0%, var(--yellow-50), transparent 45%), radial-gradient(circle at 100% 30%, var(--green-50), transparent 50%), var(--bg); }
.pub-head { display: flex; justify-content: center; padding: 1.5rem 1rem .5rem; }
.pub-head img { width: 150px; }
.pub-main { max-width: 880px; margin: 0 auto; padding: 1rem clamp(1rem, 4vw, 2rem) 2rem; }
.pub-hero { position: relative; display: grid; grid-template-columns: 1fr 220px; gap: 1rem; align-items: center; margin: 1rem 0 1.5rem; }
.pub-hero h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 900; line-height: 1.05; }
.pub-hero p { font-size: 1.1rem; color: var(--muted); max-width: 48ch; }
.pub-hero .tree { width: 100%; transform-origin: bottom center; animation: sway 7s ease-in-out infinite; }
.pub-points { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.pub-points li { display: inline-flex; align-items: center; gap: .4rem; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .4rem .8rem; font-weight: 700; font-size: .9rem; }
.pub-points .i { color: var(--orange); }
.pub-card { background: var(--surface); border-radius: 24px; padding: clamp(1.25rem, 4vw, 2.25rem); box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.pub-foot { text-align: center; color: var(--faint); font-size: .85rem; padding: 1rem 1rem 2rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sway { transform-origin: bottom center; animation: sway 7s ease-in-out infinite; }
.prose h2 { margin-top: 1.5rem; }
@media (max-width: 700px) { .pub-hero { grid-template-columns: 1fr; } .pub-hero > div { position: relative; z-index: 1; } .pub-hero .tree { width: 120px; position: absolute; right: -14px; top: -52px; opacity: .22; } }

/* ------------------------------------------------------------ Permisos */
.perm-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.perm { display: inline-flex; align-items: center; font-size: .76rem; font-weight: 800; padding: .3rem .6rem; border-radius: 999px; font-style: normal; }
.perm-2 { background: var(--green-50); color: var(--green-700); border: 1px solid var(--green-100); }
.perm-1 { background: var(--blue-50); color: var(--blue); border: 1px solid #cfe2f3; }
.perm-0 { background: var(--surface-2); color: var(--faint); border: 1px dashed var(--line-strong); text-decoration: line-through; }
.legend .perm { width: auto; height: auto; padding: .1rem .5rem; text-decoration: none; }
.perm-table { display: grid; }
.perm-row { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center; padding: .85rem 0; border-bottom: 1px dashed var(--line); }
.perm-row:last-child { border-bottom: 0; }
.perm-row small { display: block; font-weight: 500; font-size: .82rem; margin-top: .15rem; }
.seg3 { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 12px; padding: 3px; gap: 2px; }
.seg3 label { display: inline-flex; align-items: center; margin: 0; padding: .45rem .8rem; border-radius: 9px; cursor: pointer; font-size: .85rem; font-weight: 800; color: var(--muted); white-space: nowrap; }
.seg3 input { position: absolute; opacity: 0; pointer-events: none; }
.seg3 label:has(input:checked).lvl-0 { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.seg3 label:has(input:checked).lvl-1 { background: var(--blue); color: #fff; }
.seg3 label:has(input:checked).lvl-2 { background: var(--green); color: #fff; }
.seg3 label:has(input:focus-visible) { box-shadow: var(--ring); }
@media (max-width: 560px) { .perm-row { grid-template-columns: 1fr; gap: .5rem; } }
.price-grid td, .price-grid th { vertical-align: middle; }
.price-grid input.money-in { max-width: 9rem; min-height: 2.4rem; padding: .4rem .6rem; text-align: right; font-weight: 800; margin-left: auto; display: block; }
.field.especial input { border-color: var(--orange); background: var(--orange-50); }
.field.especial .lista::after { content: " · tarifa especial"; color: var(--orange-700); font-weight: 800; }
html[lang="en"] .field.especial .lista::after { content: " · special rate"; }
.afterschool-row { border-bottom: 1px dashed var(--line); margin-bottom: .6rem; }
fieldset[disabled] input, fieldset[disabled] select { background: var(--surface-2); }

/* ------------------------------------------------------------ Inicio (tarjetas sin cifras) */
.hero-sm { padding-block: 1.4rem; }
.hero-sm .tree { width: clamp(110px, 14vw, 160px); bottom: -1rem; }
.launcher { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.launch { display: flex; align-items: center; gap: 1rem; padding: 1.2rem; border-radius: 18px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); color: var(--text); transition: transform .15s var(--ease), box-shadow .15s, border-color .15s; }
.launch:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--green-100); text-decoration: none; color: var(--text); }
.launch strong { display: block; color: var(--ink); font-size: 1.02rem; }
.launch small { color: var(--muted); font-weight: 600; }
.launch-ico { width: 3rem; height: 3rem; border-radius: 14px; display: grid; place-items: center; flex: none; background: var(--green-50); color: var(--green-600); }
.launch-ico .i { width: 1.5rem; height: 1.5rem; }
.launch:nth-child(4n+2) .launch-ico { background: var(--orange-50); color: var(--orange); }
.launch:nth-child(4n+3) .launch-ico { background: var(--yellow-50); color: #b38a00; }
.launch:nth-child(4n+4) .launch-ico { background: var(--blue-50); color: var(--blue); }
.table-wrap table:not([data-nosort]) th { cursor: pointer; user-select: none; }
.table-wrap table:not([data-nosort]) th:hover { color: var(--ink); }
.table-wrap th.asc::after { content: " ▲"; font-size: .7em; color: var(--green); }
.table-wrap th.desc::after { content: " ▼"; font-size: .7em; color: var(--green); }
