.public-home {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.public-hero {
  min-height: min(620px, calc(100vh - 180px));
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 20px;
  align-items: stretch;
}

.public-hero-copy,
.public-hero-visual {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 252, 248, 0.92);
  box-shadow: var(--shadow);
}

.public-hero-copy {
  padding: clamp(28px, 5vw, 58px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}

.public-home-logo {
  width: min(240px, 72%);
  height: auto;
  margin-bottom: 10px;
}

.public-hero-copy h2 {
  max-width: 720px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 500;
  line-height: 1.03;
}

.public-hero-copy p:not(.eyebrow) {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.public-hero-visual {
  position: relative;
  overflow: hidden;
  min-height: 420px;
  isolation: isolate;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='760' height='680' viewBox='0 0 760 680'%3E%3Crect width='760' height='680' fill='%23e4d5c7'/%3E%3Cpath d='M66 88 h114 M66 142 h114 M66 196 h114 M66 250 h114 M122 88 v226' stroke='%23f7f2ec' stroke-width='13' stroke-linecap='round' opacity='.38'/%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
}

/* Degradado que tiñe el fondo y la onda animada (los sellos van encima, sin teñir) */
.public-hero-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(140deg, rgba(45, 42, 37, 0.76), rgba(157, 151, 140, 0.28));
  pointer-events: none;
}

/* Onda del río: deriva lenta con un leve vaivén vertical para simular el agua */
.hero-wave,
.login-wave {
  position: absolute;
  left: -20%;
  bottom: 0;
  width: 140%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  will-change: transform;
  animation: heroWaveDrift 13s ease-in-out infinite alternate;
}
.hero-wave path {
  fill: #c7b29e;
  opacity: 0.9;
}
.login-wave path {
  fill: #cbb39d;
}

.public-sello {
  position: absolute;
  inset: 8% auto auto 7%;
  width: min(520px, 88%);
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 22px 34px rgba(41, 37, 31, 0.28));
  transform-origin: 54% 50%;
  z-index: 3;
}

.public-sello.core {
  opacity: 0.66;
  animation: ryoLogoSettle 1.5s cubic-bezier(0.34, 1.3, 0.64, 1) 0.1s both, ryoLogoFloat 10s ease-in-out 1.6s infinite;
}

.public-sello.echo-a {
  opacity: 0.1;
  transform: translate(-26px, 18px) scale(0.96) rotate(-4deg);
  animation: ryoLogoTraceA 1.25s ease-out both;
}

.public-sello.echo-b {
  opacity: 0.08;
  transform: translate(28px, -18px) scale(1.02) rotate(4deg);
  animation: ryoLogoTraceB 1.35s ease-out 0.1s both;
}

.public-section,
.public-contact {
  margin-top: 2px;
}

.section-heading {
  margin-bottom: 14px;
}

.section-heading h2 {
  margin: 0;
  font-size: 26px;
}

.public-class-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.public-class-card {
  min-height: 170px;
}

.public-class-card span {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--sage-2);
  color: #3f513b;
  font-weight: 800;
  font-size: 12px;
  margin-bottom: 18px;
}

.public-contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.public-contact h2,
.public-contact p {
  margin: 0;
}

.public-contact p:not(.eyebrow) {
  max-width: 620px;
  color: var(--muted);
}

.login-panel {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
  gap: 20px;
  align-items: stretch;
}

.login-copy {
  position: relative;
  overflow: hidden;
  min-height: 420px;
  border-radius: 8px;
  padding: 34px;
  color: #fffdf8;
  isolation: isolate;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='520' viewBox='0 0 900 520'%3E%3Crect width='900' height='520' fill='%23ddc9b6'/%3E%3Crect x='0' y='0' width='900' height='520' fill='%23f4eee7' opacity='.32'/%3E%3Crect x='70' y='58' width='132' height='288' rx='8' fill='%23fffaf4' opacity='.65'/%3E%3Cpath d='M90 82 h92 M90 132 h92 M90 182 h92 M90 232 h92 M90 282 h92 M136 82 v242' stroke='%23a9998a' stroke-width='5' opacity='.52'/%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

/* Degradado que tiñe el fondo y la onda animada del login (el texto va encima) */
.login-copy::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(110deg, rgba(45, 42, 37, 0.82), rgba(157, 151, 140, 0.34));
  pointer-events: none;
}
.login-copy h2,
.login-copy p {
  position: relative;
  z-index: 3;
}

.ryo-welcome-mark {
  position: absolute;
  inset: 12px 10px auto auto;
  width: min(430px, 72%);
  aspect-ratio: 1.25;
  pointer-events: none;
  z-index: 3;
}

.ryo-welcome-mark img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: 54% 50%;
}

.ryo-mark-core {
  opacity: 0;
  filter: drop-shadow(0 18px 26px rgba(41, 37, 31, 0.22));
  transform: translateY(18px) scale(0.92) rotate(-2deg);
  animation: ryoLogoSettle 1.2s ease-out 0.28s forwards;
}

.ryo-mark-echo {
  opacity: 0;
  filter: blur(0.2px) drop-shadow(0 18px 28px rgba(41, 37, 31, 0.16));
  mix-blend-mode: multiply;
}

.ryo-mark-echo.echo-a {
  transform: translate(-42px, 18px) scale(0.84) rotate(-8deg);
  animation: ryoLogoTraceA 1.25s ease-out 0.02s forwards;
}

.ryo-mark-echo.echo-b {
  transform: translate(32px, -14px) scale(0.9) rotate(7deg);
  animation: ryoLogoTraceB 1.35s ease-out 0.12s forwards;
}

.login-copy h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 46px;
  font-weight: 500;
  letter-spacing: 0.04em;
  margin: 0 0 10px;
}

.login-copy p {
  max-width: 560px;
  margin: 0;
  color: rgba(255, 250, 244, 0.86);
}

.login-form {
  display: grid;
  align-content: center;
  gap: 14px;
}

.login-error {
  display: none;
  color: #8a3f32;
  background: #f7dfd8;
  border-radius: 8px;
  padding: 10px 12px;
}

.login-error.visible {
  display: block;
}

.loading-state,
.error-state {
  width: min(760px, 100%);
  min-height: 260px;
  margin: 8vh auto 0;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 252, 248, 0.94);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 18px;
}

.loading-state h2,
.error-state h2 {
  margin: 0 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}

.loading-state p,
.error-state p {
  margin: 0;
  color: var(--muted);
}

.error-state {
  align-items: flex-start;
  flex-direction: column;
}

.error-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.spinner {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 4px solid #e7ded5;
  border-top-color: var(--taupe);
  animation: spin 0.9s linear infinite;
  flex: 0 0 auto;
}

.mode-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  border-radius: 999px;
  padding: 0 11px;
  background: var(--sage-2);
  color: #3f513b;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

.status-dot.ok {
  color: var(--green);
}

.status-dot.bad {
  color: #9a4438;
}

.status-separator {
  color: var(--muted);
}


.grid {
  display: grid;
  gap: 16px;
}

.notice-section {
  margin-bottom: 16px;
}

.notice {
  display: grid;
  gap: 4px;
  border-radius: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--sage-2);
  color: #3f513b;
}

.notice.warn {
  background: #fff2d8;
  color: #73521a;
  border-color: #ead3a5;
}

.muted {
  color: var(--muted);
  margin: 4px 0 0;
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cols-4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}


.surface,
.table-wrap {
  background: rgba(255, 252, 248, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.surface {
  padding: 18px;
}

.surface h2,
.surface h3 {
  margin: 0 0 14px;
}

.stat {
  min-height: 118px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat span {
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}

.stat strong {
  font-size: 30px;
}

.stat small {
  color: var(--muted);
}

.portal-summary-grid {
  grid-template-columns: repeat(2, minmax(120px, 190px));
  max-width: 430px;
  gap: 10px;
}

.portal-summary-grid .stat {
  min-height: 86px;
  padding: 12px;
}

.portal-summary-grid .stat strong {
  font-size: 24px;
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.toolbar-group {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.agenda-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto minmax(260px, 1fr);
  gap: 12px;
  align-items: center;
}

.agenda-views,
.agenda-period,
.agenda-actions {
  flex-wrap: nowrap;
}

.agenda-period {
  justify-content: center;
}

.agenda-actions {
  justify-content: flex-end;
}

.agenda-toolbar .mode-button,
.agenda-toolbar .soft-button,
.agenda-toolbar .primary-button,
.agenda-toolbar .icon-button,
.agenda-toolbar input,
.agenda-toolbar select {
  min-height: 34px;
}

.agenda-toolbar .mode-button,
.agenda-toolbar .soft-button,
.agenda-toolbar .primary-button {
  padding: 0 11px;
}

.agenda-nav {
  width: 34px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

.agenda-date {
  width: 150px;
  padding: 6px 9px;
}

.agenda-teacher-filter {
  width: 220px;
  padding: 6px 9px;
}

.primary-button {
  background: var(--taupe);
  color: white;
  padding: 0 16px;
}

.soft-button {
  background: var(--sage-2);
  color: #3f513b;
  padding: 0 14px;
}

.whatsapp-button {
  background: #4f7d5f;
  color: #fff;
  border-color: #446b52;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.whatsapp-button:hover {
  background: #456d54;
  border-color: #3b5d48;
  color: #fff;
}

.danger-button {
  background: #f7dfd8;
  color: #8a3f32;
  padding: 0 14px;
}

.icon-button {
  width: 38px;
  background: var(--soft);
  color: var(--ink);
}

.field,
.field-row {
  display: grid;
  gap: 7px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  min-height: 42px;
  padding: 9px 11px;
  color: var(--ink);
}

input[type="radio"],
input[type="checkbox"] {
  width: auto;
  min-height: auto;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 0;
}

textarea {
  resize: vertical;
}

.field-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.enrollment-layout {
  display: grid;
  grid-template-columns: minmax(0, 760px);
  gap: 16px;
  align-items: start;
  justify-content: center;
  max-width: 820px;
  margin: 0 auto;
}

.enrollment-side,
.enrollment-layout > .surface {
  width: 100%;
}

.enrollment-side {
  max-width: 760px;
  margin: 0 auto;
}

.enrollment-intro,
.enrollment-prices {
  max-width: 100%;
}

.enrollment-form-card {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.stack-form {
  display: grid;
  gap: 14px;
  max-width: 760px;
  width: 100%;
}

.stack-form textarea {
  min-height: 92px;
}

.stack-form h2 {
  margin-top: 10px;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.checkbox-grid.compact-options {
  grid-template-columns: repeat(auto-fit, minmax(190px, max-content));
  column-gap: 26px;
  row-gap: 10px;
  justify-content: start;
}

.price-option-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 12px;
}

.price-option-grid .item {
  min-height: 94px;
  padding: 12px 13px;
  display: grid;
  align-content: start;
  gap: 4px;
}

.price-option-grid .item strong {
  line-height: 1.2;
}

.price-option-grid .item p {
  font-size: 14px;
  line-height: 1.35;
}

.info-accordion-stack {
  display: grid;
  gap: 10px;
}

.info-accordion {
  padding: 0;
}

.info-accordion summary {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
}

.info-accordion summary::-webkit-details-marker {
  display: none;
}

.info-accordion summary::after {
  content: "v";
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--sage-2);
  color: #3f513b;
  font-size: 14px;
  line-height: 1;
  transition: transform 0.16s ease;
}

.info-accordion[open] summary::after {
  transform: rotate(180deg);
}

.info-accordion summary span {
  display: grid;
  gap: 3px;
}

.info-accordion summary strong {
  font-size: 18px;
}

.info-accordion summary small {
  color: var(--muted);
  line-height: 1.35;
}

.info-accordion .mini-list,
.info-accordion .actions {
  margin-left: 18px;
  margin-right: 18px;
}

.info-accordion .mini-list {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.info-accordion .actions {
  padding-bottom: 18px;
}

.checkbox-grid label,
.consent-line {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: var(--ink);
  line-height: 1.35;
}

.checkbox-grid input,
.consent-line input {
  width: auto;
  min-height: auto;
  margin-top: 3px;
}

.soft-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: 0 14px;
  color: #3f513b;
  background: var(--sage-2);
  text-decoration: none;
  font-weight: 700;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  padding: 13px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

tr:last-child td {
  border-bottom: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.pill.ok {
  background: #e2ecd9;
  color: var(--green);
}

.pill.warn {
  background: #fff0cf;
  color: #8a6400;
}

.pill.bad {
  background: #f7dfd8;
  color: #8a3f32;
}

.pill.info {
  background: #e6edf1;
  color: var(--blue);
}

.class-list,
.student-list,
.mini-list {
  display: grid;
  gap: 10px;
}

.item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--paper);
}

.student-card {
  cursor: pointer;
}

.student-card:hover {
  border-color: var(--taupe);
}

.clickable-head {
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.13s;
}

.clickable-head:hover {
  background: var(--sage-2);
}

.session-detail-label {
  margin: 16px 0 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.item h3,
.item h4,
.item p {
  margin: 0;
}

.item p {
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.profile-details {
  display: grid;
  gap: 12px;
}

.profile-details summary {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  list-style: none;
}

.profile-details summary::-webkit-details-marker {
  display: none;
}

.profile-details summary::after {
  content: "⌄";
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--sage-2);
  color: #3f513b;
  font-size: 18px;
  line-height: 1;
  transition: transform 0.16s ease;
}

.profile-details[open] summary::after {
  transform: rotate(180deg);
}

.profile-details summary span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.profile-details summary strong {
  font-size: 20px;
}

.profile-details summary small {
  color: var(--muted);
  line-height: 1.35;
}

.profile-details-body {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.student-accordion-stack {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.section-details {
  overflow: hidden;
}

.surface.section-details,
.profile-section-surface {
  padding: 0;
}

.teacher-nav-details {
  position: sticky;
  top: 0;
  z-index: 20;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.section-details summary {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
}

.section-details summary::-webkit-details-marker {
  display: none;
}

.section-details summary::after {
  content: "v";
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--sage-2);
  color: #3f513b;
  font-size: 14px;
  line-height: 1;
  transition: transform 0.16s ease;
}

.section-details[open] summary::after {
  transform: rotate(180deg);
}

.section-details summary span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.section-details summary strong {
  font-size: 20px;
}

.section-details summary small {
  color: var(--muted);
  line-height: 1.35;
}

.section-details-body {
  border-top: 1px solid var(--line);
  padding: 16px 18px 18px;
}

.compact-info .item {
  padding: 12px;
}

.compact-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.teacher-portal {
  display: grid;
  gap: 16px;
}

.teacher-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: var(--shadow);
}

.teacher-nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: 0 12px;
  background: var(--sage-2);
  color: #3f513b;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}

.teacher-nav-details .teacher-nav {
  position: static;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  padding: 12px 18px 18px;
  border-top: 1px solid var(--line);
}

.teacher-portal > .surface,
.teacher-portal > .section-details,
.teacher-portal #teacher-summary {
  scroll-margin-top: 84px;
}

.calendar-day.is-muted {
  opacity: 0.48;
}

.teacher-calendar-grid .calendar-day {
  min-height: 102px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(110px, 1fr));
  gap: 8px;
}

.calendar-header-cell {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  text-align: center;
  padding: 4px 4px 8px;
}

.tpl-grid { width: 100%; border-collapse: separate; border-spacing: 6px; min-width: 640px; }
.tpl-grid th { font-size: 12px; color: var(--muted); font-weight: 600; text-align: center; padding: 4px; }
.tpl-grid th.tpl-time { text-align: right; white-space: nowrap; width: 56px; color: var(--ink); vertical-align: top; padding-top: 12px; }
.tpl-cell { background: var(--sage-2); border-radius: 8px; padding: 8px 10px; cursor: grab; vertical-align: top; transition: background .12s; }
.tpl-cell:active { cursor: grabbing; }
.tpl-cell.tpl-dragging { opacity: .4; }
.tpl-empty.tpl-drop-target .tpl-add { border-style: solid; border-color: var(--sage); background: var(--sage-2); color: var(--sage); }
.tpl-cell:hover { background: var(--sage); color: #fff; }
.tpl-cell:hover .tpl-meta, .tpl-cell:hover .tpl-level { color: #fff !important; }
.tpl-type { font-weight: 600; font-size: 13px; line-height: 1.2; }
.tpl-level { font-size: 11px; font-weight: 600; line-height: 1.3; }
.tpl-meta { font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.3; }
.tpl-empty { text-align: center; }
.tpl-add { width: 100%; min-height: 44px; border: 1px dashed var(--line); background: transparent; border-radius: 8px; color: var(--muted); font-size: 18px; cursor: pointer; }
.tpl-add:hover { border-color: var(--sage); color: var(--sage); background: var(--sage-2); }

.config-collapse > summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 17px;
  padding: 2px 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.config-collapse > summary::-webkit-details-marker { display: none; }

.config-collapse > summary::before {
  content: "▸";
  color: var(--muted);
  font-size: 13px;
  transition: transform 0.12s;
}

.config-collapse[open] > summary::before {
  content: "▾";
}

.calendar-day {
  height: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--paper);
  cursor: pointer;
  transition: border-color 0.13s, background 0.13s;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.calendar-events {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.calendar-more {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--sage);
  cursor: pointer;
}

.calendar-more:hover {
  text-decoration: underline;
}

.calendar-day:hover {
  border-color: var(--taupe);
  background: var(--soft);
}

.calendar-day.is-today {
  border-color: var(--sage);
}

.calendar-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: 4px;
}

.calendar-day-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: lowercase;
  font-weight: 400;
}

.calendar-day-num {
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  flex-shrink: 0;
}

.calendar-day-num.is-today-num {
  background: var(--sage);
  color: #fff;
}

.calendar-event {
  display: block;
  background: var(--sage-2);
  color: #3f513b;
  border-radius: 6px;
  padding: 5px 7px;
  font-size: 12px;
  margin-top: 5px;
  cursor: pointer;
  transition: background 0.12s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.calendar-event:hover {
  background: var(--sage);
  color: #fff;
}

.monthly-bars {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: 48px 1fr 96px;
  gap: 10px;
  align-items: center;
}

.bar {
  height: 12px;
  border-radius: 999px;
  background: #e8ece9;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--sage), var(--taupe));
}

.portal-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 22px;
  align-items: stretch;
}

.student-shell .portal-hero {
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
}

.student-shell .portal-hero .surface {
  order: -1;
}

.portal-banner {
  min-height: 280px;
  border-radius: 8px;
  padding: 28px;
  color: white;
  background:
    linear-gradient(110deg, rgba(63, 51, 43, 0.78), rgba(156, 136, 117, 0.42)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='520' viewBox='0 0 900 520'%3E%3Crect width='900' height='520' fill='%23ddc9b6'/%3E%3Crect x='0' y='0' width='900' height='520' fill='%23f4eee7' opacity='.38'/%3E%3Cpath d='M0 390 C190 290 315 435 490 306 C642 194 730 274 900 184 L900 520 L0 520 Z' fill='%23cbb39d'/%3E%3Crect x='68' y='58' width='132' height='288' rx='8' fill='%23fffaf4' opacity='.68'/%3E%3Cpath d='M88 82 h92 M88 132 h92 M88 182 h92 M88 232 h92 M88 282 h92 M134 82 v242' stroke='%23a9998a' stroke-width='5' opacity='.52'/%3E%3Ccircle cx='720' cy='134' r='86' fill='%23fff6ea' opacity='.82'/%3E%3Cpath d='M724 256 c-42 4-82 48-86 112 M724 256 c56 8 92 46 98 118 M724 256 c-28-58-15-108 26-154 M724 256 c-52-38-94-84-118-142' fill='none' stroke='%235d754f' stroke-width='15' stroke-linecap='round' opacity='.78'/%3E%3Cpath d='M274 362 c64-118 169-128 225-46 30 44 73 66 135 64' fill='none' stroke='%233d463d' stroke-width='18' stroke-linecap='round' opacity='.72'/%3E%3Cpath d='M302 290 c58 30 120 24 176-18' fill='none' stroke='%23ffffff' stroke-width='12' stroke-linecap='round' opacity='.72'/%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.portal-banner h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 36px;
  font-weight: 500;
  margin: 0 0 8px;
}

.portal-banner p {
  max-width: 620px;
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
}

.student-shell .content > .surface,
.student-shell .content > .grid,
.student-shell .content > .notice,
.student-shell .student-accordion-stack {
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
}

.student-shell .content > .surface .grid.cols-3 {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.student-shell .profile-details-body {
  max-width: 760px;
}

dialog {
  border: 0;
  border-radius: 8px;
  padding: 0;
  width: min(720px, calc(100vw - 28px));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
}

dialog::backdrop {
  background: rgba(24, 35, 40, 0.42);
}

.dialog-content {
  padding: 18px;
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.dialog-head h2 {
  margin: 0;
}

.empty {
  color: var(--muted);
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
}

/* ── Recibo / Ticket ───────────────────────────────── */
.receipt {
  font-family: var(--font-body, inherit);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.receipt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--accent, #5c6b5a);
  color: #fff;
  padding: 14px 18px;
}
.receipt-brand {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
}
.receipt-folio {
  font-size: 12px;
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
}
.receipt-body {
  padding: 16px 18px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.receipt-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 14px;
}
.receipt-row span:first-child {
  color: var(--muted);
  white-space: nowrap;
}
.receipt-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  border-top: 1px dashed var(--line);
  margin-top: 4px;
  padding-top: 12px;
  font-size: 18px;
  font-weight: 700;
}
.receipt-total span:first-child {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}
.receipt-footer {
  padding: 12px 18px;
  background: var(--surface, #f6f4f0);
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}


/* ── Mail enable row ── */
.mail-enable-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}

.mail-enable-row label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

.mail-enable-row input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--sage);
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
}

.mail-enable-row .mail-enable-desc {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
  max-width: 200px;
  line-height: 1.4;
}

/* ── Caja ledger ── */
.ledger-head,
.ledger-row {
  display: grid;
  grid-template-columns: 46px 88px minmax(0, 1fr) minmax(0, 1fr) 74px 52px 90px;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
}

.ledger-head {
  border-bottom: 2px solid var(--line);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ledger-row {
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.1s;
  font-size: 13px;
}

.ledger-row:hover {
  background: var(--soft);
}

.ledger-row:last-child {
  border-bottom: none;
}

.ledger-row .l-date {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.ledger-row .l-folio,
.ledger-row .l-method {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ledger-row .l-concept,
.ledger-row .l-party {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ledger-row .l-party {
  color: var(--muted);
}

.ledger-row .l-amount {
  text-align: right;
  font-weight: 600;
  white-space: nowrap;
  font-size: 13px;
}

/* Botones deshabilitados: grises y sin interacción (ej. "Cancelar pack" sin pack). */
button:disabled,
.primary-button:disabled,
.soft-button:disabled,
.danger-button:disabled {
  opacity: .45;
  cursor: not-allowed;
  filter: grayscale(1);
  box-shadow: none;
}
button:disabled:hover {
  background: inherit;
  border-color: inherit;
}

/* ═══════════ Tutorial guiado de la alumna (coach-marks) ═══════════ */
#studentTour { position: fixed; inset: 0; z-index: 9998; }
#tourSpot {
  position: fixed; border-radius: 12px; border: 2px solid #fff;
  box-shadow: 0 0 0 9999px rgba(20, 25, 20, .62); pointer-events: none;
  transition: all .18s ease; display: none;
}
#tourCard {
  position: fixed; z-index: 10000; background: #fff; border-radius: 14px;
  padding: 16px 16px 14px; box-shadow: 0 14px 44px rgba(0,0,0,.32);
  max-width: 340px; box-sizing: border-box;
}
.tour-step-count { font-size: 11px; color: var(--sage); font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.tour-title { margin: 4px 0 6px; font-size: 18px; color: var(--ink, #333); }
.tour-text { margin: 0 0 14px; font-size: 14px; line-height: 1.5; color: #555; }
.tour-text b { color: #333; }
.tour-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tour-actions button { border-radius: 8px; font-size: 14px; padding: 8px 16px; cursor: pointer; border: none; }
.tour-next { background: var(--sage); color: #fff; font-weight: 600; }
.tour-back { background: #eee; color: #555; }
.tour-skip { background: transparent; color: #999; padding: 8px 4px; }
/* Mismo look plano que "Salir" (antes tenía su propio borde y quedaba
   desparejo dentro de .topbar-actions: una caja oscura con OTRA caja adentro). */
#studentHelpBtn { background: transparent; margin-right: 2px; }

/* Pantalla "¿Cómo funciona?" */
.help-lead { font-size: 14px; color: #555; margin: 0 0 14px; line-height: 1.5; }
.help-item { display: flex; gap: 11px; align-items: flex-start; padding: 8px 0; }
.help-emoji { font-size: 20px; flex-shrink: 0; line-height: 1.3; }
.help-item strong { display: block; font-size: 14px; color: #333; margin-bottom: 1px; }
.help-item p { margin: 0; font-size: 13px; color: #666; line-height: 1.5; }
.help-item b { color: #444; }
.help-sep { border: none; border-top: 1px solid var(--line); margin: 10px 0; }

.tour-x { position: absolute; top: 8px; right: 10px; background: none; border: none; font-size: 15px; color: #bbb; cursor: pointer; padding: 4px; line-height: 1; }
.tour-x:hover { color: #666; }
#tourCard { position: relative; }

/* ── Procesando: evita el doble clic ──────────────────────────────────────────
   Cuando una acción está trabajando, su botón queda deshabilitado y girando.
   Sirve tanto de aviso ("ya te escuché, esperá") como de freno: un segundo clic
   sobre el mismo botón llegaba a duplicar la operación (dos comprobantes de un
   mismo cobro). Funciona en botones y también en filas clicables. */
[data-action].is-busy,
[data-submit].is-busy {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
  cursor: progress;
}

/* El texto se corre para dejarle lugar al girito, sin que salte el ancho. */
[data-action].is-busy > *,
[data-submit].is-busy > * { opacity: 0.45; }

[data-action].is-busy::after,
[data-submit].is-busy::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 15px;
  height: 15px;
  margin: -8px 0 0 -8px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: ryo-girar 0.7s linear infinite;
}


/* Barra fina arriba de todo: dice que el sistema está haciendo algo, aunque el
   botón que lo disparó ya no esté en pantalla (muchas acciones redibujan). */
body.ryo-procesando::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 9999;
  background: linear-gradient(90deg, transparent, var(--sage, #5c7a63), transparent);
  background-size: 45% 100%;
  background-repeat: no-repeat;
  animation: ryo-barra 1.05s ease-in-out infinite;
}


body.ryo-procesando { cursor: progress; }

