/* ============================================================
   Colegio Activo — sistema visual
   ============================================================ */
:root {
  --ink: #0d1b2a;
  --ink-2: #33415c;
  --muted: #5c6b80;
  --line: #e3e6ea;
  --line-2: #d3d8df;
  --paper: #f6f5f1;
  --surface: #ffffff;
  --accent: #1d4ed8;
  --accent-ink: #163ea9;
  --accent-soft: #e8eefc;
  --sand: #c9a66b;
  --ok: #157a4a;
  --ok-soft: #e4f4ec;
  --warn: #9a5b00;
  --warn-soft: #fdf1dc;
  --danger: #b42318;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(13,27,42,.05), 0 8px 24px -12px rgba(13,27,42,.18);
  --shadow-lg: 0 30px 60px -30px rgba(13,27,42,.35);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--sans); font-size: 16px; line-height: 1.6;
  color: var(--ink); background: var(--paper);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-ink); }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.12; letter-spacing: -.015em; margin: 0 0 .5em; font-optical-sizing: auto; }
h1 { font-size: clamp(2.4rem, 5.4vw, 4.3rem); font-weight: 500; }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.75rem); font-weight: 500; }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }
.eyebrow { display: inline-flex; align-items: center; gap: .5rem; font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 1rem; }
.eyebrow::before { content: ""; width: 22px; height: 1.5px; background: currentColor; }
.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 62ch; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Botones ---------- */
.btn {
  --b: var(--accent); display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  padding: .82rem 1.35rem; border-radius: 999px; border: 1.5px solid var(--b);
  background: var(--b); color: #fff; font: 600 .95rem/1 var(--sans); cursor: pointer;
  transition: transform .15s ease, background .15s, box-shadow .15s; white-space: nowrap;
}
.btn:hover { color: #fff; background: var(--accent-ink); border-color: var(--accent-ink); transform: translateY(-1px); box-shadow: 0 10px 20px -10px rgba(29,78,216,.6); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn.ghost:hover { border-color: var(--ink); background: transparent; color: var(--ink); box-shadow: none; }
.btn.light { background: #fff; color: var(--ink); border-color: #fff; }
.btn.light:hover { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--ink); }
.btn.sm { padding: .55rem .95rem; font-size: .86rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .6; pointer-events: none; }
.btn svg { width: 18px; height: 18px; }

/* ---------- Marca ---------- */
.brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark { width: 40px; height: 40px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text b { font-family: "Alegreya", Georgia, serif; font-size: 1.75rem; font-weight: 500; letter-spacing: 0; line-height: 1; }
.brand-text small { font-family: "Alegreya", Georgia, serif; font-size: .86rem; letter-spacing: .4em; color: var(--ink-2); margin-top: 3px; }
.brand-full { display: block; }
.brand-logo { display: block; width: auto; height: 150px; }
.site-footer .brand-logo { height: 120px; }
.sidebar .brand-full { padding: 0 8px 18px; }
.sidebar .brand-logo { height: 118px; }

/* ---------- Header público ---------- */
.site-header { --hh: 156px; position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.site-header.scrolled { --hh: 74px; border-color: var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: var(--hh); gap: 1rem; transition: height .25s ease; }
/* Escritorio: logo completo arriba; al bajar, la barra se achica y queda el nombre */
.brand-header { position: relative; margin-right: auto; min-width: 0; }
.brand-header .logo-top { height: calc(var(--hh) - 16px); width: auto; transition: height .25s ease, opacity .2s ease; }
.brand-header .brand-text { position: absolute; left: 0; top: 50%; transform: translateY(-50%); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.site-header.scrolled .logo-top { height: 0; opacity: 0; }
.site-header.scrolled .brand-header .brand-text { position: static; transform: none; opacity: 1; }
.nav { display: flex; align-items: center; gap: 1.8rem; }
.nav a:not(.btn) { color: var(--ink-2); font-size: .94rem; font-weight: 500; }
.nav a:not(.btn):hover { color: var(--ink); }
.nav-cta { display: none; }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; margin-right: -8px; cursor: pointer; color: var(--ink); }
.nav-toggle svg { width: 26px; height: 26px; display: block; }
@media (max-width: 900px) {
  /* Celular y tablet: siempre barra baja con el nombre */
  .site-header, .site-header.scrolled { --hh: 64px; border-color: var(--line); }
  .brand-header .logo-top { display: none; }
  .brand-header .brand-text, .site-header.scrolled .brand-header .brand-text { position: static; transform: none; opacity: 1; }
  .site-header .wrap { gap: .5rem; padding: 0 16px; }
  .brand-header .brand-text b { font-size: 1.25rem; }
  .brand-header .brand-text small { font-size: .58rem; letter-spacing: .26em; text-transform: uppercase; }
  .nav-cta { display: inline-flex; flex: none; white-space: nowrap; }
  .nav-toggle { display: block; flex: none; }
  .nav { position: fixed; inset: var(--hh) 0 auto 0; flex-direction: column; align-items: stretch; gap: 0; padding: 4px 16px 12px; background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); transform: translateY(-8px); opacity: 0; visibility: hidden; transition: .2s; }
  .nav.open { transform: none; opacity: 1; visibility: visible; }
  .nav a:not(.btn) { padding: 14px 4px; border-bottom: 1px solid var(--line); font-size: 1rem; }
  .nav a:nth-last-child(2) { border-bottom: 0; }
  .nav .nav-desk { display: none; }
}
/* Portada en celular: menos aire y botones a lo ancho */
@media (max-width: 560px) {
  .hero { padding-top: 24px; }
  .hero .eyebrow { font-size: .68rem; letter-spacing: .1em; }
  .hero-grid .eyebrow::before { display: none; }
  .hero h1 { font-size: clamp(2.1rem, 10vw, 2.6rem); }
  .hero .lead { margin: 1rem 0 1.4rem; font-size: 1.05rem; }
  .hero-cta .btn { width: 100%; justify-content: center; }
}

/* ---------- Hero ---------- */
.hero { position: relative; padding: clamp(28px, 5vw, 64px) 0 clamp(56px, 8vw, 96px); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero .lead { margin: 1.4rem 0 2rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; }
.hero-ring { position: absolute; right: -180px; top: -140px; width: 620px; height: 620px; border: 1.5px solid var(--ink); border-radius: 50%; opacity: .08; pointer-events: none; }
.hero-card { position: relative; background: var(--ink); color: #fff; border-radius: 22px; padding: 30px; box-shadow: var(--shadow-lg); }
.hero-card .eyebrow { color: var(--sand); }
.hero-card h3 { font-size: 1.55rem; font-weight: 500; margin-bottom: 1.2rem; }
.rep-mini { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.rep-mini figure { margin: 0; display: flex; gap: 10px; align-items: center; }
.rep-mini img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,.15); }
.rep-mini figcaption { font-size: .86rem; line-height: 1.25; }
.rep-mini figcaption span { display: block; color: #9fb0c8; font-size: .76rem; }
.hero-card .stat { display: flex; align-items: baseline; gap: .6rem; padding-top: 1.2rem; margin-top: 1.4rem; border-top: 1px solid rgba(255,255,255,.12); color: #c7d2e2; font-size: .9rem; }
.hero-card .stat b { font-family: var(--serif); font-size: 2.6rem; color: #fff; font-weight: 500; line-height: 1; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } .hero-ring { width: 420px; height: 420px; right: -220px; } }
@media (max-width: 420px) { .rep-mini { grid-template-columns: 1fr; } }

/* ---------- Secciones ---------- */
.section { padding: clamp(64px, 9vw, 112px) 0; scroll-margin-top: 60px; }
.section.alt { background: var(--surface); border-block: 1px solid var(--line); }
.section.dark { background: var(--ink); color: #e6ebf2; }
.section.dark h2 { color: #fff; }
.section.dark .eyebrow { color: var(--sand); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 2rem; margin-bottom: clamp(32px, 5vw, 56px); flex-wrap: wrap; }
.section-head h2 { margin: 0; max-width: 20ch; }
.section-head p { max-width: 46ch; margin: 0; color: var(--muted); }
.section.dark .section-head p { color: #9fb0c8; }

/* Compromisos */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.pillar { background: var(--surface); padding: 30px 28px 32px; transition: background .2s; }
.pillar:hover { background: #fbfbf9; }
.pillar .num { font-family: var(--serif); font-size: .95rem; color: var(--sand); font-weight: 600; }
.pillar h3 { margin: .7rem 0 .55rem; font-size: 1.28rem; }
.pillar p { color: var(--muted); font-size: .96rem; margin: 0; }
@media (max-width: 900px) { .pillars { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .pillars { grid-template-columns: 1fr; } }

/* Herramientas (teaser área privada) */
.tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tool { position: relative; border: 1px solid rgba(255,255,255,.1); border-radius: var(--radius); padding: 26px 22px; background: rgba(255,255,255,.03); transition: border-color .2s, background .2s; }
.tool:hover { border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.06); }
.tool .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(201,166,107,.14); color: var(--sand); margin-bottom: 18px; }
.tool .ico svg { width: 22px; height: 22px; }
.tool h3 { color: #fff; font-size: 1.12rem; font-family: var(--sans); font-weight: 600; letter-spacing: 0; }
.tool p { color: #9fb0c8; font-size: .92rem; margin: 0; }
.tool .lock { position: absolute; top: 20px; right: 20px; color: #6d7f99; width: 16px; height: 16px; }
.tools-cta { margin-top: 40px; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.tools-cta p { margin: 0; color: #9fb0c8; }
@media (max-width: 800px) { .tools { grid-template-columns: 1fr; } }

/* Novedades */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.news { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; transition: transform .2s, box-shadow .2s; }
.news:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.news .meta { display: flex; gap: .6rem; align-items: center; font-size: .8rem; color: var(--muted); margin-bottom: 14px; flex-wrap: wrap; }
.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: .74rem; font-weight: 600; letter-spacing: .02em; }
.tag.sand { background: #f4ecdd; color: #7a5a22; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.news h3 { font-size: 1.2rem; margin-bottom: .5rem; }
.news p { color: var(--muted); font-size: .95rem; flex: 1; }
@media (max-width: 900px) { .news-grid { grid-template-columns: 1fr; } }

/* Representantes */
.reps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; }
.rep { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.rep { text-align: center; }
.rep img, .rep .initials { width: calc(100% - 56px); margin: 28px auto 0; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 50%; box-shadow: 0 0 0 6px var(--paper); }
.rep img { transform: scale(1); }
.rep div { padding: 18px 20px 22px; }
.initials { display: grid; place-items: center; background: #e9e4d8; color: var(--ink); font-family: var(--serif); font-weight: 500; }
.rep .initials { font-size: 3.4rem; }
.rep-mini .initials { width: 46px; height: 46px; border-radius: 50%; flex: none; font-size: 1rem; background: var(--sand); }
.rep h3 { font-size: 1.15rem; margin: 0 0 .2rem; }
.rep p { margin: 0; font-size: .88rem; color: var(--muted); }
@media (max-width: 1000px) { .reps { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .reps { grid-template-columns: 1fr 1fr; } }


/* Contacto */
.contact-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(32px, 6vw, 72px); align-items: start; }
.contact-list { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 14px; }
.contact-list a { display: inline-flex; align-items: center; gap: .7rem; color: var(--ink); font-weight: 500; }
.contact-list svg { width: 20px; height: 20px; color: var(--accent); }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }

/* ---------- Formularios ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(22px, 3.5vw, 34px); box-shadow: var(--shadow); }
.form { display: grid; gap: 16px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .form .row { grid-template-columns: 1fr; } }
.field label { display: block; font-size: .85rem; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field .hint { font-size: .8rem; color: var(--muted); margin-top: 5px; }
.input, select.input, textarea.input {
  width: 100%; padding: .78rem .9rem; font: 400 1rem/1.4 var(--sans); color: var(--ink);
  background: #fff; border: 1.5px solid var(--line-2); border-radius: var(--radius-sm); transition: border-color .15s, box-shadow .15s;
}
textarea.input { min-height: 130px; resize: vertical; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .88rem; color: var(--ink-2); }
.check input { margin-top: 4px; accent-color: var(--accent); }
.alert { padding: 12px 14px; border-radius: var(--radius-sm); font-size: .9rem; display: none; }
.alert.show { display: block; }
.alert.error { background: #fdecea; color: var(--danger); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.info { background: var(--accent-soft); color: var(--accent-ink); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #9fb0c8; padding: 56px 0 34px; font-size: .9rem; }
.site-footer .brand { color: #fff; }
.site-footer .brand-text small { color: #9fb0c8; }
.foot-grid { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; padding-bottom: 32px; border-bottom: 1px solid rgba(255,255,255,.1); }
.foot-links { display: flex; gap: 1.6rem; flex-wrap: wrap; align-items: center; }
.foot-links a { color: #c7d2e2; }
.foot-links a:hover { color: #fff; }
.foot-legal { padding-top: 22px; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .8rem; }

/* ---------- Banner modo demo ---------- */
.demo-bar { background: #fff6e0; color: #7a5200; font-size: .82rem; text-align: center; padding: 7px 16px; border-bottom: 1px solid #f1deb0; }

/* ---------- Página de acceso ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { position: relative; background: var(--ink); color: #c7d2e2; padding: 48px clamp(28px, 5vw, 64px); display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.auth-side .brand { color: #fff; }
.auth-side .brand-text small { color: #9fb0c8; }
.auth-side h2 { color: #fff; font-size: clamp(2rem, 3.2vw, 2.8rem); max-width: 16ch; }
.auth-side ul { list-style: none; padding: 0; margin: 1.6rem 0 0; display: grid; gap: 12px; }
.auth-side li { display: flex; gap: .7rem; align-items: center; }
.auth-side li svg { width: 18px; height: 18px; color: var(--sand); flex: none; }
.auth-side .ring { position: absolute; width: 520px; height: 520px; border: 1.5px solid #fff; border-radius: 50%; opacity: .07; right: -200px; bottom: -200px; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-box { width: 100%; max-width: 460px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: #eceae4; border-radius: 999px; padding: 4px; margin-bottom: 26px; }
.tabs button { border: 0; background: none; padding: .7rem; border-radius: 999px; font: 600 .92rem var(--sans); color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.auth-box h1 { font-size: 2rem; margin-bottom: .3rem; }
.auth-back { display: inline-flex; gap: .4rem; align-items: center; font-size: .88rem; color: var(--muted); margin-bottom: 30px; }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth-side { display: none; } .auth-main { align-items: flex-start; } }

/* ---------- Panel privado ---------- */
.app { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--ink); color: #c7d2e2; display: flex; flex-direction: column; padding: 24px 16px; }
.sidebar .brand { color: #fff; padding: 0 8px 24px; }
.sidebar .brand-text small { color: #9fb0c8; }
.side-nav { display: grid; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: .75rem; padding: .68rem .8rem; border-radius: 10px; color: #b4c1d4; font-size: .93rem; font-weight: 500; }
.side-nav a svg { width: 19px; height: 19px; opacity: .85; }
.side-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-nav a.active { background: rgba(255,255,255,.1); color: #fff; }
.side-nav .sep { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: #6d7f99; padding: 18px .8rem 6px; }
.side-user { margin-top: auto; display: flex; align-items: center; gap: .7rem; padding: 14px 8px 0; border-top: 1px solid rgba(255,255,255,.1); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--sand); color: var(--ink); display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex: none; }
.side-user .who { min-width: 0; flex: 1; font-size: .85rem; line-height: 1.3; }
.side-user .who b { color: #fff; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user button { background: none; border: 0; color: #9fb0c8; cursor: pointer; padding: 6px; border-radius: 8px; }
.side-user button:hover { color: #fff; background: rgba(255,255,255,.08); }
.side-user svg { width: 18px; height: 18px; }

.main { min-width: 0; }
.pass-box { position: relative; }
.pass-box .input { padding-right: 48px; }
.pass-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; display: grid; place-items: center; background: none; border: 0; border-radius: 8px; color: var(--muted); cursor: pointer; }
.pass-eye:hover { color: var(--ink); }
.pass-eye svg { width: 20px; height: 20px; }
.btn.sm.wa { background: #0f7a4d; border-color: #0f7a4d; color: #fff; }
.btn.sm.wa:hover { background: #0b623e; color: #fff; }
.toolbar select.con-partido { flex: 0 1 220px; width: auto; }
.form [hidden] { display: none; }
.solo-cel { display: none; }
.scrim { display: none; }
[hidden] { display: none !important; }
.topbar { display: none; }
.content { padding: clamp(24px, 4vw, 48px); max-width: 1120px; }
.view { display: none; animation: fade .25s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.view-head { margin-bottom: 28px; }
.view-head h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 500; margin-bottom: .3rem; }
.view-head p { color: var(--muted); margin: 0; max-width: 64ch; }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 32px; }
.tile { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; color: var(--ink); transition: border-color .15s, transform .15s, box-shadow .15s; }
.tile:hover { color: var(--ink); border-color: var(--line-2); transform: translateY(-2px); box-shadow: var(--shadow); }
.tile .ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 14px; }
.tile .ico svg { width: 20px; height: 20px; }
.tile h3 { font-family: var(--sans); font-size: 1rem; font-weight: 600; letter-spacing: 0; margin: 0 0 .25rem; }
.tile p { margin: 0; color: var(--muted); font-size: .88rem; }
@media (max-width: 1000px) { .tiles { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .tiles { grid-template-columns: 1fr; } }

.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }
@media (max-width: 1000px) { .two-col { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-family: var(--sans); font-size: 1rem; font-weight: 600; letter-spacing: 0; margin: 0; }
.panel-head a { font-size: .86rem; font-weight: 600; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 16px 22px; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .t { font-weight: 600; margin-bottom: 2px; }
.list .s { color: var(--muted); font-size: .88rem; }

.event { display: flex; gap: 16px; align-items: center; position: relative; }
/* Toda la fila abre el detalle del curso; el botón queda por encima */
.ev-link { color: inherit; }
.ev-link::after { content: ""; position: absolute; inset: 0; }
.event:hover { background: var(--paper); }
.event:hover .ev-link { color: var(--accent); }
.ev-ver { color: var(--accent); font-weight: 600; white-space: nowrap; }
.event > .btn { position: relative; z-index: 1; }
.date-chip { width: 54px; flex: none; text-align: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.date-chip b { display: block; font-family: var(--serif); font-size: 1.4rem; line-height: 1.5; }
.date-chip span { display: block; background: var(--ink); color: #fff; font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; padding: 2px 0; }

.article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 28px; margin-bottom: 16px; }
.article h2 { font-size: 1.45rem; font-weight: 500; margin: .7rem 0 .5rem; }
.article p { color: var(--ink-2); margin: 0; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .input { max-width: 320px; }
.chip { border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: .45rem .95rem; font: 500 .86rem var(--sans); color: var(--ink-2); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 12px 22px; border-bottom: 1px solid var(--line); }
.table td { padding: 15px 22px; border-bottom: 1px solid var(--line); font-size: .94rem; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.doc-name { display: flex; align-items: center; gap: .8rem; font-weight: 600; }
.doc-name svg { width: 22px; height: 22px; color: var(--accent); flex: none; }
@media (max-width: 700px) {
  .table thead { display: none; }
  .table tr { display: block; padding: 12px 18px; border-bottom: 1px solid var(--line); }
  .table td { display: block; padding: 3px 0; border: 0; }
  .table td.hide-sm { display: none; }
}

.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.calc-col { display: grid; gap: 20px; min-width: 0; }
.form { align-content: start; }
.form .row > * { min-width: 0; }
.form .row .field { display: flex; flex-direction: column; justify-content: flex-end; }
.form > .hint { font-size: .8rem; line-height: 1.5; color: var(--muted); margin-top: -8px; }
.calc .result { margin-top: 0; }
.result div > b { white-space: nowrap; }
.adm-acc .perfil-sel { width: auto; padding-top: 6px; padding-bottom: 6px; font-size: .86rem; }
details.mas summary { cursor: pointer; font-size: .88rem; font-weight: 600; color: var(--accent); }
details.mas > .form { margin-top: 14px; }
@media (max-width: 1000px) { .calc-grid { grid-template-columns: 1fr; } }
.calc { padding: 24px; }
.calc h2 { font-family: var(--sans); font-size: 1.08rem; font-weight: 600; letter-spacing: 0; margin-bottom: .2rem; }
.calc h2 + p { color: var(--muted); font-size: .9rem; margin: 0; }
.demo-bar.float { position: fixed; right: 14px; bottom: 14px; z-index: 70; border: 1px solid #f1deb0; border-radius: 999px; padding: 6px 14px; box-shadow: var(--shadow); }
.result { margin-top: 18px; background: var(--paper); border-radius: var(--radius-sm); padding: 16px 18px; display: grid; gap: 8px; }
.result div { display: flex; justify-content: space-between; gap: 1rem; font-size: .93rem; }
.result div.total { border-top: 1px solid var(--line-2); padding-top: 10px; font-weight: 700; font-size: 1.05rem; }
.note { font-size: .8rem; color: var(--muted); margin-top: 12px; }

.status-card { max-width: 560px; margin: 10vh auto; text-align: center; }
.status-card .ico { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 20px; background: var(--warn-soft); color: var(--warn); }
.status-card .ico svg { width: 30px; height: 30px; }

.empty { padding: 34px 22px; text-align: center; color: var(--muted); font-size: .92rem; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 60; left: 0; top: 0; width: 280px; transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .topbar { display: flex; align-items: center; justify-content: space-between; height: 64px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
  .topbar button { background: none; border: 0; padding: 8px; color: var(--ink); cursor: pointer; }
  .topbar svg { width: 24px; height: 24px; }
  .topbar .top-logout { display: flex; align-items: center; gap: .35rem; font: inherit; font-size: .88rem; font-weight: 600; }
  .topbar .top-logout svg { width: 20px; height: 20px; }
  /* El menú entra en la pantalla del teléfono y se puede deslizar */
  .sidebar { height: 100vh; height: 100dvh; overflow-y: auto; overscroll-behavior: contain; padding-bottom: max(24px, env(safe-area-inset-bottom, 0px)); }
  .sidebar > * { flex-shrink: 0; }
  .sidebar .brand-logo { height: 84px; }
  .side-user button { display: flex; align-items: center; gap: .35rem; font: inherit; font-size: .88rem; }
  .side-user .solo-cel { display: inline; }
  .scrim { position: fixed; inset: 0; background: rgba(13,27,42,.4); z-index: 55; display: none; }
  .scrim.show { display: block; }
}

/* Aparición suave al hacer scroll */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

/* ---------- Administración ---------- */
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: #d97706; color: #fff; font-size: .72rem; font-weight: 700; line-height: 1; }
.side-nav a .count { margin-left: auto; }
.adm-row { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.adm-row.nuevo { background: #fffbf2; }
.adm-main { flex: 1 1 320px; min-width: 0; }
.adm-main .t { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.adm-main .s { margin-top: 3px; word-break: break-word; }
.adm-acc { display: flex; gap: 8px; flex-wrap: wrap; }
.adm-msg { margin: 10px 0 0; padding: 12px 14px; background: var(--paper); border-radius: var(--radius-sm); font-size: .94rem; color: var(--ink-2); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); color: var(--danger); }
.toolbar .input { flex: 1 1 260px; }

.dlg { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 0; border-radius: 18px; box-shadow: var(--shadow-lg); color: var(--ink); background: var(--surface); }
.dlg::backdrop { background: rgba(13,27,42,.45); backdrop-filter: blur(2px); }
.dlg form { padding: 24px 26px; }
.dlg-head { display: flex; justify-content: space-between; align-items: center; }
.dlg-head h2 { font-size: 1.5rem; font-weight: 500; margin: 0; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 10px; padding-top: 6px; }
.icon-btn { background: none; border: 0; padding: 6px; border-radius: 8px; cursor: pointer; color: var(--muted); }
.icon-btn:hover { background: var(--paper); color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; display: block; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: .92rem; box-shadow: var(--shadow-lg); transition: opacity .3s, transform .3s; max-width: calc(100vw - 32px); }
.toast.error { background: var(--danger); }
.toast.out { opacity: 0; transform: translate(-50%, 8px); }
.chip[aria-pressed="true"] .muted { color: #c7d2e2; }
.dlg textarea.input { min-height: 0; }

/* ---------- Inscripción a cursos ---------- */
.curso { max-width: 760px; padding: 0; overflow: hidden; }
.curso-img { display: block; width: 100%; height: auto; max-height: 420px; object-fit: contain; background: var(--paper); }
.curso-cuerpo { padding: clamp(18px, 4vw, 32px); }
.curso-cuerpo h1 { margin: 0 0 8px; font-size: clamp(1.5rem, 4vw, 2rem); }
.curso-datos { color: var(--ink-2); font-weight: 500; }
.curso-texto { white-space: pre-line; }
.curso-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 18px; }
.curso-form .field { margin: 0; }
.curso-form .ancho { grid-column: 1 / -1; }
.curso-form [readonly] { background: var(--paper); color: var(--ink-2); }
.curso-volver { display: inline-flex; align-items: center; gap: 6px; }
.curso-volver svg { width: 18px; height: 18px; }
.curso-mini { display: block; max-width: 200px; max-height: 120px; border-radius: var(--radius-sm); margin-bottom: 8px; }
.insc-titulo { font-size: 1.2rem; margin: 0 0 12px; }
.insc-faltan { margin-top: 28px; }

/* Portada: cómo trabajamos */
.hero-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 14px; }
.hero-list li { display: flex; gap: 12px; align-items: flex-start; line-height: 1.45; }
.hero-list svg { width: 22px; height: 22px; flex: none; color: var(--sand); }
.hero-list li { color: #c7d2e2; }
.hero-list b { color: #fff; }
