/* ============================================================
   Estudio Dirigido Glera — sistema de diseño del prototipo.
   Mobile-first, sin compilación. Verde marca #1f6b47.
   ============================================================ */
:root {
  color-scheme: light dark;
  --bg:#f4f6f1; --surface:#fff; --surface-2:#edf1ea; --surface-3:#e4eae0;
  --ink:#17241b; --muted:#5d6a60; --line:#dce3d9;
  --brand:#1f6b47; --brand-2:#175239;
  --brand-soft:#dceee3; --accent:#ee8a3b; --accent-soft:#fff0df;
  --danger:#c2493d; --danger-soft:#fae6e3;
  --blue:#2f6fab; --blue-soft:#e4eff9;
  --shadow:0 20px 55px rgba(29,52,36,.12);
  --r-lg:24px; --r-md:16px; --r-sm:11px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg:#101612; --surface:#18211b; --surface-2:#202c24; --surface-3:#29372d;
    --ink:#f1f6f1; --muted:#aab8ad; --line:#344339;
    --brand:#67bf8d; --brand-2:#8dd3aa;
    --brand-soft:#203c2d; --accent:#ffad68; --accent-soft:#452f20;
    --danger:#ff958a; --danger-soft:#472a28;
    --blue:#88b8e5; --blue-soft:#203346;
    --shadow:0 22px 58px rgba(0,0,0,.3);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh; min-height: 100dvh;
  background: var(--bg); color: var(--ink);
  font-family: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { font-family: "Manrope", "Source Sans 3", system-ui, sans-serif; }
svg { display: block; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- Estructura: shell, rail, topbar, contenido ---------- */
.app-shell { min-height: 100vh; min-height: 100dvh; }
.rail { display: none; }
.main { min-width: 0; background: var(--bg); min-height: 100vh; min-height: 100dvh; padding-bottom: 92px; }

.topbar {
  height: 68px; padding: 12px 18px;
  display: flex; align-items: center; justify-content: space-between;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 15;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.page-title { font: 800 20px/1.1 "Manrope"; margin: 0; letter-spacing: -.02em; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.bell-btn {
  position: relative; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
}
.bell-btn svg { width: 20px; height: 20px; }
.notification-count {
  position: absolute; right: -4px; top: -5px; min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff;
  border: 2px solid var(--surface); display: grid; place-items: center;
  font: 800 10px "Manrope";
}
.notification-count.hidden { display: none; }
.avatar-btn {
  border: 0; background: var(--brand); color: #fff;
  width: 40px; height: 40px; border-radius: 50%;
  font: 800 14px "Manrope";
}

.content { padding: 22px 16px 30px; max-width: 930px; margin: 0 auto; }
.screen { display: none; animation: appear .2s ease; }
.screen.active { display: block; }
@keyframes appear { from { opacity: .25; transform: translateY(4px); } to { opacity: 1; transform: none; } }

body.logged-out .app-shell,
body.logged-out .bottom-nav { display: none; }

/* ---------- Navegación inferior (móvil) ---------- */
.bottom-nav {
  position: fixed; z-index: 50; left: 0; right: 0; bottom: 0;
  display: grid; height: 72px;
  padding: 7px max(6px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.bottom-btn {
  border: 0; background: transparent; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 10px; font-weight: 700; min-width: 0;
}
.bottom-btn span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bottom-btn.active { color: var(--brand); }
.bottom-btn .ico { width: 23px; height: 23px; display: grid; place-items: center; }
.bottom-btn .ico svg { width: 23px; height: 23px; }

/* ---------- Login ---------- */
.login-overlay {
  position: fixed; inset: 0; background: var(--bg); z-index: 100;
  display: grid; place-items: center; padding: 24px;
}
.login-overlay.hidden { display: none; }
.login-card {
  width: min(100%, 480px); background: var(--surface);
  border: 1px solid var(--line); border-radius: 30px;
  padding: 34px; box-shadow: var(--shadow);
}
.login-mark {
  display: grid; place-items: center; margin-bottom: 24px;
}
.login-mark img { display: block; }
.login-card h1 { font-size: 30px; line-height: 1.12; letter-spacing: -.03em; margin: 0 0 9px; }
.login-card > p { color: var(--muted); font-size: 17px; margin: 0 0 25px; }
.google-btn {
  width: 100%; margin-top: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); border-radius: 11px;
  padding: 12px 14px; display: flex; align-items: center; justify-content: center;
  gap: 9px; font-weight: 750;
}
.google-btn:hover { background: var(--surface-2); }
.demo-note { font-size: 12px !important; text-align: center !important; margin: 15px 0 0 !important; color: var(--muted) !important; }
.warning {
  background: var(--accent-soft); border: 1px solid var(--line);
  color: color-mix(in srgb, var(--accent) 78%, var(--ink));
  border-radius: 12px; padding: 12px; font-size: 13px; margin: 0 0 6px;
}

/* ---------- Tarjetas, listas, cabeceras ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 20px; margin-bottom: 12px;
  box-shadow: 0 3px 12px rgba(36,60,43,.035);
}
.card h3 { margin: 0 0 6px; font-size: 16px; }
.card p { margin: 6px 0; font-size: 14px; line-height: 1.55; }
.content h2 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; margin: 4px 0 14px; }
.content h3 { font-size: 17px; font-weight: 800; margin: 18px 0 8px; }
.screen-head, .section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin: 4px 0 14px;
}
.screen-head h2, .section-head h3 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.section-head p { margin: 5px 0 0; color: var(--muted); font-size: 14px; }
.text-btn { border: 0; background: transparent; color: var(--brand); padding: 5px 0; font-weight: 750; }
.back { background: none; border: none; color: var(--brand); font-size: 15px; font-weight: 700; padding: 4px 0; margin-bottom: 6px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.meta { font-size: 12px; color: var(--muted); }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.divider { border: none; border-top: 1px solid var(--line); margin: 14px 0; }
.pinned-tag {
  display: inline-block; background: var(--accent-soft);
  color: color-mix(in srgb, var(--accent) 78%, var(--ink));
  font: 750 11px "Manrope"; border-radius: 999px; padding: 4px 10px; margin-bottom: 8px;
}
.item-list { display: flex; flex-direction: column; gap: 10px; }
.list-item {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 17px;
  display: flex; gap: 14px; align-items: flex-start;
}
.item-icon {
  width: 42px; height: 42px; border-radius: 13px; background: var(--surface-2);
  display: grid; place-items: center; color: var(--brand); flex: 0 0 auto; font-size: 20px;
}
.item-main { min-width: 0; flex: 1; }
.item-main h4 { font: 750 16px/1.25 "Manrope"; margin: 0 0 5px; }
.item-main p { margin: 0; color: var(--muted); line-height: 1.35; }
.item-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.item-side select { width: auto; min-width: 130px; }

/* ---------- Botones ---------- */
.btn, .primary {
  border: 0; border-radius: 11px; padding: 11px 16px;
  font-weight: 750; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--brand); color: #fff; text-decoration: none; text-align: center; font-size: 15px;
}
.btn:hover, .primary:hover { background: var(--brand-2); }
.btn.block, .primary.block { display: flex; width: 100%; margin-top: 12px; }
.btn.secondary, .secondary {
  border: 0; border-radius: 11px; padding: 11px 16px; font-weight: 750;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--surface-2); color: var(--ink); font-size: 15px;
}
.btn.secondary:hover, .secondary:hover { background: var(--surface-3); }
.btn.secondary.block, .secondary.block { display: flex; width: 100%; margin-top: 12px; }
.btn.danger, .danger-btn {
  border: 0; border-radius: 11px; padding: 10px 14px; font-weight: 750;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--danger-soft); color: var(--danger); font-size: 14px;
}
.btn.small { padding: 8px 13px; font-size: 13px; }

/* ---------- Etiquetas de estado ---------- */
.badge, .tag {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 999px; padding: 6px 10px;
  font: 750 12px/1 "Manrope";
  background: var(--surface-2); color: var(--muted);
}
.badge.pending, .tag.pending, .tag.justificado {
  background: var(--accent-soft);
  color: color-mix(in srgb, var(--accent) 78%, var(--ink));
}
.badge.ok, .tag.presente, .tag.signed { background: var(--brand-soft); color: var(--brand); }
.badge.info { background: var(--blue-soft); color: var(--blue); }
.tag.ausente { background: var(--danger-soft); color: var(--danger); }

/* ---------- Estado vacío ---------- */
.empty { text-align: center; color: var(--muted); padding: 28px 20px; font-size: 14px; }
.empty .big { font-size: 40px; display: block; margin-bottom: 10px; }

/* ---------- Formularios ---------- */
label { display: block; font-size: 14px; font-weight: 700; margin: 14px 0 6px; }
input[type="text"], input[type="date"], input[type="month"], input[type="time"],
select, textarea {
  width: 100%; border: 1px solid var(--line); background: var(--surface-2);
  color: var(--ink); border-radius: 11px; padding: 11px 12px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); }
textarea { min-height: 100px; resize: vertical; }
input[type="checkbox"] { width: auto; accent-color: var(--brand); }
label.check { display: flex; align-items: center; gap: 10px; font-weight: 600; margin: 8px 0; }

/* ---------- Segmentado (presente/ausente/justificado, escala 1-3) ---------- */
.seg { display: flex; background: var(--surface-2); padding: 3px; border-radius: 11px; gap: 2px; margin-top: 6px; }
.seg button {
  flex: 1; border: 0; background: transparent; color: var(--muted);
  border-radius: 8px; padding: 9px 6px; font-weight: 700; font-size: 13px;
}
.seg button.on { background: var(--brand); color: #fff; }
.seg button.on.no { background: var(--danger); color: #fff; }
.seg button.on.maybe { background: var(--accent); color: #251508; }

/* ---------- Chat ---------- */
.chat-list-item { cursor: pointer; }
.chat-view {
  display: flex; flex-direction: column; min-width: 0;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden; background: var(--surface);
  height: calc(100dvh - 260px); min-height: 340px;
}
.messages {
  padding: 20px; display: flex; flex-direction: column; gap: 11px;
  flex: 1; overflow-y: auto;
  background: color-mix(in srgb, var(--surface-2) 55%, var(--surface));
}
.msg {
  max-width: 78%; padding: 10px 13px; line-height: 1.35; font-size: 14px;
  border-radius: 14px 14px 14px 4px;
  background: var(--surface); border: 1px solid var(--line);
}
.msg.mine {
  align-self: flex-end; background: var(--brand); color: #fff; border: 0;
  border-radius: 14px 14px 4px 14px;
}
.msg.theirs { align-self: flex-start; }
.msg .who { display: block; font-size: 11px; opacity: .75; margin-bottom: 2px; }
.msg .when { display: block; font-size: 10px; opacity: .6; margin-top: 4px; text-align: right; }
.msg.pending { opacity: .65; }
.chat-input { border-top: 1px solid var(--line); padding: 13px; display: flex; gap: 8px; background: var(--surface); }
.chat-input input { min-width: 0; flex: 1; }

/* ---------- Notificaciones ---------- */
.notif { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.notif .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand); margin-top: 6px; flex: 0 0 auto;
}
.notif.read { opacity: .75; }
.notif.read .dot { background: var(--line); }

/* ---------- Tarjetas de notificaciones ---------- */
.notif-card {
  display: flex; gap: 12px; align-items: flex-start;
  cursor: pointer; position: relative;
}
.notif-card.read { opacity: .8; }
.notif-ico {
  font-size: 26px; flex: 0 0 auto;
  width: 44px; height: 44px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-soft);
}
.notif-main { flex: 1; min-width: 0; }
.notif-main h4 { margin: 8px 0 4px; font-size: 16px; }
.notif-main p { margin: 0 0 6px; }
.notif-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag-unread { background: var(--accent-soft); color: var(--accent); }
.tag-read { background: var(--brand-soft); color: var(--brand); }
.unread-dot {
  position: absolute; left: 10px; top: 18px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand);
}
.notif-card .text-btn { flex: 0 0 auto; margin-top: 2px; }

/* ---------- Calendario de asistencia ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 4px; text-align: center;
}
.cal-wd { font: 700 12px "Manrope"; color: var(--muted); padding: 6px 0; }
.cal-day {
  position: relative; padding: 10px 0 14px; border-radius: 12px;
  font: 600 14px "Manrope";
}
.cal-day.other { color: var(--muted); opacity: .45; }
.cal-day.today { background: var(--brand); color: #fff; font-weight: 800; }
.cal-dot {
  position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%);
  width: 6px; height: 6px; border-radius: 50%;
}
.cal-dot.presente { background: var(--brand); }
.cal-dot.ausente { background: var(--danger); }
.cal-dot.justificado { background: var(--accent); }
.cal-day.today .cal-dot { background: #fff; }
.cal-legend {
  display: flex; gap: 16px; justify-content: center;
  margin-top: 12px; font-size: 13px; color: var(--muted);
}
.cal-legend .cal-dot { position: static; transform: none; display: inline-block; margin-right: 5px; }
.att-summary { text-align: left; }
.att-pct { font: 800 40px/1 "Manrope"; margin: 8px 0 4px; }

/* ---------- Chat dos paneles ---------- */
.chat-layout {
  display: grid; grid-template-columns: 320px 1fr; gap: 16px;
  min-height: 60vh;
}
.chat-sidebar {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; padding: 12px; align-self: start;
}
.chat-sidebar input[type="search"] { margin-bottom: 8px; }
#conv-list { display: flex; flex-direction: column; gap: 4px; }
.conv-item {
  display: flex; gap: 10px; align-items: center;
  padding: 10px; border-radius: 12px; cursor: pointer;
}
.conv-item:hover { background: var(--surface-2); }
.conv-item.active { background: var(--brand-soft); }
.conv-main { flex: 1; min-width: 0; }
.conv-main p { margin: 2px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar-sm {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font: 800 14px "Manrope";
}
.chat-main {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; padding: 16px;
  display: flex; flex-direction: column; min-height: 60vh;
}
.chat-header {
  display: flex; gap: 10px; align-items: center;
  padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 12px;
}
.chat-header .meta { margin: 2px 0 0; }
.messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 0; }
.msg {
  max-width: 75%; padding: 10px 14px; border-radius: 16px;
  background: var(--surface-2); align-self: flex-start;
}
.msg.mine { background: var(--brand); color: #fff; align-self: flex-end; }
.msg .when { display: block; font-size: 11px; opacity: .7; margin-top: 4px; }
.msg .who { display: block; font-size: 12px; font-weight: 700; margin-bottom: 2px; }
.chat-input { display: flex; gap: 8px; margin-top: 12px; }
.chat-input input { flex: 1; }
.send-btn {
  flex: 0 0 auto; width: 48px; height: 48px; border-radius: 14px;
  background: var(--brand); color: #fff; border: none;
  font-size: 20px; cursor: pointer;
}
@media (max-width: 900px) {
  .chat-layout { grid-template-columns: 1fr; }
  .chat-sidebar { order: 0; }
  .chat-main { display: none; }
}

/* ---------- Tarjetas de avisos ---------- */
.notice-card {
  display: flex; gap: 12px; align-items: flex-start;
  position: relative;
}
.notice-card.pinned { border-color: var(--brand); }
.notice-card .notif-main h4 { margin: 8px 0 4px; font-size: 16px; }
.notice-card .notif-main p { margin: 0 0 6px; }
.notice-side {
  flex: 0 0 auto; display: flex; flex-direction: column;
  gap: 8px; align-items: flex-end;
}

/* ---------- Tarjetas de informes ---------- */
.report-card { padding: 0; overflow: hidden; }
.report-head {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 16px; cursor: pointer;
}
.report-main { flex: 1; min-width: 0; }
.report-main h4 { margin: 8px 0 0; font-size: 16px; }
.date-block {
  flex: 0 0 auto; width: 52px; height: 52px; border-radius: 14px;
  background: var(--brand-soft); color: var(--brand);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.date-block b { font: 800 20px/1 "Manrope"; }
.date-block small { font: 700 10px/1 "Manrope"; margin-top: 2px; }
.expand-btn {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface);
  font: 700 18px/1 "Manrope"; color: var(--ink); cursor: pointer;
}
.report-body { padding: 0 16px 16px 80px; border-top: 1px solid var(--line); padding-top: 12px; }
.report-body h5 { margin: 12px 0 6px; font-size: 14px; }
.report-body h5:first-child { margin-top: 0; }
.tag-diario { background: var(--brand-soft); color: var(--brand); }
.tag-info { background: var(--blue-soft); color: var(--blue); }
.attach-link {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 8px 0; padding: 8px 12px; border-radius: 10px;
  background: var(--surface-2); color: var(--brand);
  font-weight: 700; text-decoration: none; font-size: 14px;
}

/* ---------- Cobertura de alertas ---------- */
.coverage-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); border-radius: 999px;
  padding: 8px 14px; font: 700 13px "Manrope"; cursor: pointer;
}
.pill.on {
  background: var(--brand-soft); border-color: var(--brand-soft);
  color: var(--brand);
}

/* ---------- Menú "Más" ---------- */
.menu-list { display: flex; flex-direction: column; padding: 6px 20px; }
.menu-row {
  width: 100%; border: 0; border-bottom: 1px solid var(--line);
  background: transparent; color: var(--ink);
  padding: 15px 3px; display: flex; align-items: center; justify-content: space-between;
  text-align: left; font-weight: 700; font-size: 15px;
}
.menu-row:last-child { border: 0; }
.menu-row span { display: flex; align-items: center; gap: 12px; }
.menu-row .ico { width: 21px; height: 21px; display: grid; place-items: center; color: var(--brand); }
.menu-row .ico svg { width: 21px; height: 21px; }
.menu-row b { color: var(--muted); }
.menu-row.big { padding: 18px 3px; }
.menu-row.big .menu-ico {
  width: 44px; height: 44px; display: grid; place-items: center;
  color: var(--brand); flex: 0 0 auto;
}
.menu-row.big .menu-ico svg { width: 34px; height: 34px; }
.menu-row.big .menu-label { flex: 1; font-size: 16px; }
.avatar-lg {
  width: 84px; height: 84px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font: 800 30px "Manrope";
}

/* ---------- Pasar lista ---------- */
.att-row {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.att-row:last-child { border-bottom: none; }
.seg-att { display: flex; gap: 4px; background: var(--surface-2); border-radius: 12px; padding: 4px; }
.seg-att button {
  border: none; background: transparent; padding: 8px 12px; border-radius: 8px;
  font: 700 13px "Manrope"; color: var(--muted); cursor: pointer;
}
.seg-att button.on { background: var(--brand); color: #fff; }
.seg-att button.on.no { background: var(--danger); }
.seg-att button.on.maybe { background: var(--accent); }

/* ---------- Evaluación diaria ---------- */
.eval-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.eval-label { font-weight: 700; }
.seg-nums { display: flex; gap: 6px; }
.seg-nums button {
  width: 44px; height: 44px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface);
  font: 700 16px "Manrope"; cursor: pointer;
}
.seg-nums button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.progress {
  height: 8px; border-radius: 4px; background: var(--surface-2);
  margin-top: 12px; overflow: hidden;
}
.progress-bar { height: 100%; background: var(--brand); border-radius: 4px; transition: width .3s; }
.auth-card-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.auth-card-head h3 { font-size: 16px; }

/* ---------- Toast ---------- */
.toast, #toast {
  position: fixed; left: 50%; bottom: 96px;
  transform: translate(-50%, 20px);
  background: var(--ink); color: var(--surface);
  padding: 11px 18px; border-radius: 11px; font-weight: 700; font-size: 14px;
  opacity: 0; pointer-events: none; z-index: 200;
  transition: opacity .2s, transform .2s;
  box-shadow: var(--shadow); white-space: nowrap; max-width: 92vw;
  overflow: hidden; text-overflow: ellipsis;
}
.toast.show, #toast.show { opacity: 1; transform: translate(-50%, 0); }

.hidden { display: none !important; }

/* ---------- Escritorio (≥900px): rail lateral ---------- */
@media (min-width: 900px) {
  .app-shell {
    display: grid; grid-template-columns: 240px minmax(0, 1fr);
    max-width: 1180px; margin: 0 auto;
    background: var(--surface); box-shadow: var(--shadow);
    min-height: 100vh; min-height: 100dvh;
  }
  .rail {
    background: var(--brand-2); color: #fff;
    padding: 30px 18px 24px;
    display: flex; flex-direction: column; gap: 28px;
    position: sticky; top: 0; height: 100vh; height: 100dvh;
  }
  .rail-head { padding: 0 10px; }
  .rail-head .eyebrow {
    font: 700 12px/1 "Manrope"; letter-spacing: .08em;
    text-transform: uppercase; color: #b8dac6;
  }
  .rail-head strong { display: block; font: 800 24px/1.15 "Manrope"; margin-top: 9px; }
  .role-mini {
    margin-top: 14px; display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 10px; border-radius: 999px;
    background: rgba(255,255,255,.13); font-weight: 700; font-size: 13px;
  }
  .nav-list { display: flex; flex-direction: column; gap: 5px; }
  .nav-list .nav-btn {
    border: 0; background: transparent; color: #cde0d4;
    display: flex; align-items: center; gap: 12px;
    padding: 12px; border-radius: 12px; text-align: left;
    font-weight: 650; font-size: 15px; width: 100%;
  }
  .nav-list .nav-btn:hover, .nav-list .nav-btn.active { background: #fff; color: #174c35; }
  .nav-list .nav-btn .ico { width: 21px; height: 21px; display: grid; place-items: center; flex: 0 0 auto; }
  .nav-list .nav-btn .ico svg { width: 21px; height: 21px; }
  .rail-foot { margin-top: auto; padding: 0 10px; color: #b8dac6; font-size: 13px; line-height: 1.35; }
  .rail-foot b { color: #fff; }
  .main { padding-bottom: 40px; }
  .topbar { height: 82px; padding: 16px clamp(20px, 4vw, 48px); }
  .page-title { font-size: clamp(21px, 3vw, 28px); }
  .content { padding: 30px clamp(20px, 4vw, 48px); }
  .bottom-nav { display: none; }
  .toast, #toast { bottom: 28px; }
}
@media (max-width: 899px) {
  .rail { display: none !important; }
}

/* ---------- Dashboard (del prototipo): saludo, rejilla, métricas ---------- */
.greeting { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.greeting h2 { font: 800 clamp(27px, 5vw, 42px)/1.08 "Manrope"; letter-spacing: -.035em; margin: 0 0 7px; }
.greeting p { margin: 0; color: var(--muted); font-size: 17px; }
.date-chip { white-space: nowrap; color: var(--muted); font-weight: 650; text-transform: capitalize; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.col-12 { grid-column: span 12; } .col-8 { grid-column: span 8; }
.col-7 { grid-column: span 7; } .col-6 { grid-column: span 6; }
.col-5 { grid-column: span 5; } .col-4 { grid-column: span 4; }
.card.clickable { transition: transform .18s, border-color .18s; cursor: pointer; }
.card.clickable:hover { transform: translateY(-2px); border-color: var(--brand); }
.metric { min-height: 138px; display: flex; flex-direction: column; justify-content: space-between; }
.metric-top { display: flex; align-items: center; justify-content: space-between; }
.metric-ico {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand);
}
.metric-ico.orange { background: var(--accent-soft); color: var(--accent); }
.metric-ico.blue { background: var(--blue-soft); color: var(--blue); }
.metric-ico svg { width: 20px; height: 20px; }
.metric b { font: 800 30px/1 "Manrope"; }
.metric span { color: var(--muted); font-weight: 600; }
.metric small { color: var(--muted); }
.notice-feature {
  background: var(--brand-2); color: #fff; border: 0;
  position: relative; overflow: hidden; min-height: 214px; padding: 25px;
}
.notice-feature:after {
  content: ""; position: absolute; width: 180px; height: 180px; border-radius: 50%;
  right: -72px; bottom: -90px; background: rgba(255, 255, 255, .08);
}
.notice-feature .badge { background: var(--accent); color: #271507; }
.notice-feature h3 { font: 800 25px/1.22 "Manrope"; max-width: 520px; margin: 35px 0 10px; color: #fff; }
.notice-feature p { color: #d8e8de; margin: 0; max-width: 550px; font-size: 16px; }
.notice-meta { display: flex; gap: 12px; align-items: center; margin-top: 21px; color: #d8e8de; font-size: 13px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.filter {
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  border-radius: 999px; padding: 8px 13px; font-weight: 700;
}
.filter.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.history-line { display: flex; justify-content: space-between; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); }
.history-line:last-child { border: 0; }
.history-line b { font-weight: 700; }
.icon-btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  width: 35px; height: 35px; border-radius: 10px; display: grid; place-items: center; font-size: 17px;
}
.icon-btn:disabled { opacity: .35; cursor: default; }
.rating-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.child-hero { display: flex; align-items: center; gap: 16px; }
.child-hero h2 { font: 800 24px/1.15 "Manrope"; margin: 8px 0 0; }
.child-hero .btn { margin-left: auto; white-space: nowrap; }
.child-avatar {
  width: 64px; height: 64px; border-radius: 50%; flex: 0 0 auto;
  background: var(--brand); color: #fff;
  display: grid; place-items: center;
  font: 800 22px "Manrope";
}
.detail-grid { display: flex; flex-direction: column; }
.detail-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px;
}
.detail-row:last-child { border-bottom: 0; }
.detail-row span { color: var(--muted); }
.detail-row b { font-weight: 700; }
.rating-box { background: var(--surface-2); border-radius: 12px; padding: 12px 8px; text-align: center; }
.rating-box b { display: block; font: 800 19px "Manrope"; color: var(--brand); }
.rating-box small { color: var(--muted); line-height: 1.15; display: block; margin-top: 3px; }
@media (max-width: 899px) {
  .grid { gap: 12px; }
  .col-8, .col-7, .col-6, .col-5, .col-4 { grid-column: span 12; }
  .metrics-mobile { grid-column: span 6; }
  .metric { min-height: 118px; }
  .date-chip { display: none; }
  .greeting { align-items: flex-start; }
  .greeting h2 { font-size: 29px; }
  .greeting p { font-size: 15px; }
  .notice-feature h3 { font-size: 22px; margin-top: 26px; }
  .rating-summary { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 390px) {
  .metrics-mobile { grid-column: span 12; }
}
