/* King's Training · Hub de clases flexibles
   Sistema visual: DM Sans + azul marino de marca. Contrastes verificados para WCAG 2.1 AA. */

@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/dm-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-style: italic; font-weight: 400; font-display: swap; src: url('/fonts/dm-sans-latin-400-italic.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/dm-sans-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/dm-sans-latin-700-normal.woff2') format('woff2'); }

:root {
  --navy-950: #0b1a3a;
  --navy-900: #0e2149;
  --navy-800: #112954;
  --navy-700: #19326b;
  --navy-600: #24438a;
  --blue-700: #2448ae;
  --blue-600: #2f55c4;
  --blue-500: #3859d0;
  --blue-100: #dbe4fa;
  --blue-50: #eef2fc;
  --cyan-500: #01c2cb;
  --cyan-700: #00777d;
  --cyan-50: #e2f8f9;
  /* Acento como texto o icono sobre fondo oscuro (la imagen corporativa lo aclara si no contrasta) */
  --accent-on-dark: var(--cyan-500);
  --ink-900: #0f1b33;
  --ink-700: #33415c;
  --ink-500: #56627c;
  --ink-400: #7a859c;
  --line: #dde3ee;
  --line-strong: #c4ccdc;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --green-700: #0f6b45;
  --green-100: #d3f0e1;
  --green-50: #e9f7f0;
  --amber-700: #7f5300;
  --amber-100: #ffe7b3;
  --amber-50: #fff6e0;
  --red-700: #b42318;
  --red-100: #fbd5d1;
  --red-50: #fdeeec;
  --violet-700: #5b3fc4;
  --violet-50: #f1edfd;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 27, 51, 0.06);
  --shadow: 0 1px 3px rgba(15, 27, 51, 0.06), 0 6px 18px rgba(15, 27, 51, 0.06);
  --shadow-lg: 0 18px 50px rgba(11, 26, 58, 0.18);
  --focus: 0 0 0 3px #ffffff, 0 0 0 5px var(--blue-600);
  --sidebar-w: 256px;
  --font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink-900);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--blue-700); text-underline-offset: 2px; }
a:hover { color: var(--navy-700); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.5em; color: var(--ink-900); letter-spacing: -0.01em; }
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 1em; }
small, .small { font-size: 0.875rem; }
.muted { color: var(--ink-500); }
.nowrap { white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--navy-700); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm); font-weight: 700; }
.skip-link:focus { top: 12px; color: #fff; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 28px; height: 28px; }

/* ------------------------------ App layout ------------------------------ */

.app { min-height: 100vh; display: flex; }
@media (min-width: 1024px) { .app { background: linear-gradient(90deg, var(--navy-950) 0, var(--navy-950) var(--sidebar-w), var(--bg) var(--sidebar-w)); } }
.sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: linear-gradient(180deg, var(--navy-800) 0%, var(--navy-950) 100%);
  color: #dbe4fa;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar__brand { padding: 24px 22px 18px; display: block; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.sidebar__brand img { width: 150px; height: auto; }
.sidebar__brand span { display: block; margin-top: 8px; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-on-dark); font-weight: 700; }
.nav { padding: 14px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav__label { font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: #8fa2cf; padding: 14px 12px 6px; font-weight: 700; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 8px;
  color: #dbe4fa; text-decoration: none; font-weight: 500; font-size: 0.95rem;
}
.nav a:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.nav a[aria-current='page'] { background: rgba(255, 255, 255, 0.12); color: #fff; box-shadow: inset 3px 0 0 var(--cyan-500); }
.nav a .count { margin-left: auto; background: var(--cyan-500); color: var(--navy-950); font-size: 0.75rem; font-weight: 700; border-radius: 99px; padding: 1px 8px; }
.nav a .icon { opacity: 0.9; }
.sidebar__cta { margin: 6px 12px 0; }
.sidebar__user { margin-top: auto; padding: 16px 18px; border-top: 1px solid rgba(255, 255, 255, 0.08); display: flex; align-items: center; gap: 12px; }
.sidebar__user .who { min-width: 0; flex: 1; }
.sidebar__user strong { display: block; color: #fff; font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__user small { color: #a9b8dd; }
.sidebar__user form { margin: 0; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 8px; border: 0; background: transparent; color: inherit; cursor: pointer; }
.icon-btn:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

.avatar {
  width: 38px; height: 38px; flex: none; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--blue-100); color: var(--navy-700); font-weight: 700; font-size: 0.85rem;
}
.sidebar .avatar { background: var(--cyan-500); color: var(--navy-950); }
.avatar--lg { width: 56px; height: 56px; font-size: 1.1rem; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.content { width: 100%; max-width: 1240px; margin: 0 auto; padding: 32px 36px 64px; }
.content--narrow { max-width: 880px; }

.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-header h1 { margin: 0; }
.page-header p { margin: 6px 0 0; color: var(--ink-500); }
.page-header__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.eyebrow { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--cyan-700); font-weight: 700; margin-bottom: 6px; display: block; }
.breadcrumbs { font-size: 0.875rem; margin-bottom: 10px; color: var(--ink-500); }
.breadcrumbs a { color: var(--ink-500); }

@media (max-width: 1023px) {
  .app { display: block; }
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 50; transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: var(--shadow-lg); }
  .nav-open .sidebar { transform: none; }
  .nav-open .scrim { display: block; }
  .scrim { display: none; position: fixed; inset: 0; background: rgba(11, 26, 58, 0.45); z-index: 40; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 30;
    background: var(--navy-800); color: #fff; padding: 10px 16px;
  }
  .topbar img { width: 120px; }
  .content { padding: 22px 16px 56px; }
  h1 { font-size: 1.45rem; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }

/* -------------------------------- Buttons ------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 9px 18px;
  border-radius: 8px; border: 1px solid transparent;
  font: inherit; font-weight: 700; font-size: 0.95rem; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  background: var(--blue-600); color: #fff;
}
.btn:hover { background: var(--blue-700); color: #fff; }
.btn--secondary { background: var(--surface); color: var(--navy-700); border-color: var(--line-strong); }
.btn--secondary:hover { background: var(--blue-50); color: var(--navy-700); border-color: var(--blue-100); }
.btn--ghost { background: transparent; color: var(--blue-700); }
.btn--ghost:hover { background: var(--blue-50); color: var(--navy-700); }
.btn--danger { background: var(--red-700); }
.btn--danger:hover { background: #8f1c13; }
.btn--danger-outline { background: var(--surface); color: var(--red-700); border-color: #efb4ad; }
.btn--danger-outline:hover { background: var(--red-50); color: var(--red-700); }
.btn--accent { background: var(--cyan-500); color: var(--navy-950); }
.btn--accent:hover { background: #00aab2; color: var(--navy-950); }
.btn--sm { min-height: 34px; padding: 6px 12px; font-size: 0.875rem; }
.btn--lg { min-height: 50px; padding: 12px 24px; font-size: 1.02rem; }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled='true'] { opacity: 0.55; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn-row--end { justify-content: flex-end; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--blue-700); text-decoration: underline; cursor: pointer; }
.inline-form { display: inline; margin: 0; }

/* -------------------------------- Cards --------------------------------- */

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card__body { padding: 24px; }
.card__header { padding: 18px 24px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card__header h2, .card__header h3 { margin: 0; }
.card__footer { padding: 16px 24px; border-top: 1px solid var(--line); background: #fafbfe; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.stack > * + * { margin-top: 20px; }
.grid > * + * { margin-top: 0; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main-side { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); align-items: start; }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-main-side { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } .card__body { padding: 18px; } .card__header { padding: 14px 18px; } }

.stat { padding: 20px 22px; display: flex; flex-direction: column; gap: 4px; }
.stat__label { color: var(--ink-500); font-size: 0.875rem; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.stat__value { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat__meta { font-size: 0.85rem; color: var(--ink-500); }
.stat__icon { width: 34px; height: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--blue-50); color: var(--blue-700); }
.stat__icon--cyan { background: var(--cyan-50); color: var(--cyan-700); }
.stat__icon--green { background: var(--green-50); color: var(--green-700); }
.stat__icon--amber { background: var(--amber-50); color: var(--amber-700); }

/* -------------------------------- Badges -------------------------------- */

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 0.8rem; font-weight: 700; line-height: 1.4; white-space: nowrap; background: var(--blue-50); color: var(--navy-700); }
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.badge--plain::before { display: none; }
.badge--green { background: var(--green-50); color: var(--green-700); }
.badge--amber { background: var(--amber-50); color: var(--amber-700); }
.badge--red { background: var(--red-50); color: var(--red-700); }
.badge--grey { background: #eef0f4; color: var(--ink-700); }
.badge--violet { background: var(--violet-50); color: var(--violet-700); }
.badge--cyan { background: var(--cyan-50); color: var(--cyan-700); }
.tag { display: inline-block; padding: 2px 9px; border-radius: 6px; background: #eef0f4; color: var(--ink-700); font-size: 0.82rem; font-weight: 500; }

/* -------------------------------- Tables -------------------------------- */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.table th { text-align: left; font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-500); padding: 12px 16px; border-bottom: 1px solid var(--line); background: #fafbfe; white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafbff; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
a.row-link { color: var(--ink-900); font-weight: 700; text-decoration: none; }
a.row-link:hover { color: var(--blue-700); text-decoration: underline; }
a.badge { text-decoration: none; }
a.badge:hover { filter: brightness(0.96); }
.cell-person { display: flex; align-items: center; gap: 12px; min-width: 180px; }
.cell-person small { display: block; color: var(--ink-500); }
@media (max-width: 760px) {
  .table--stack thead { display: none; }
  .table--stack tr { display: block; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .table--stack td { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border: 0; text-align: right; }
  .table--stack td::before { content: attr(data-label); font-weight: 700; color: var(--ink-500); font-size: 0.8rem; text-align: left; }
  .table--stack td.cell-main { display: block; text-align: left; }
  .table--stack td.cell-main::before { display: none; }
}

/* --------------------------------- Forms -------------------------------- */

.form { display: grid; gap: 18px; }
.form-grid { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-all { grid-column: 1 / -1; }
@media (max-width: 760px) { .form-grid, .form-grid--3 { grid-template-columns: 1fr; } .form-grid .span-2 { grid-column: auto; } }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-weight: 700; font-size: 0.92rem; color: var(--ink-900); }
.field .req { color: var(--red-700); margin-left: 2px; }
.hint { font-size: 0.85rem; color: var(--ink-500); }
.field-error { font-size: 0.86rem; color: var(--red-700); font-weight: 500; display: flex; gap: 6px; align-items: flex-start; }
.input, .select, .textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink-900);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 10px 12px; min-height: 44px;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2356627c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-400); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(47, 85, 196, 0.22); }
.input[aria-invalid='true'], .select[aria-invalid='true'], .textarea[aria-invalid='true'] { border-color: var(--red-700); }
.input--code { font-size: 1.4rem; letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--blue-600); flex: none; }
.check small { display: block; color: var(--ink-500); font-weight: 400; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 700; padding: 0; margin-bottom: 8px; }
.form-section { padding-top: 6px; }
.form-section + .form-section { border-top: 1px solid var(--line); padding-top: 22px; }
.form-section__title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.form-section__title h2, .form-section__title h3 { margin: 0; }

.choice-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 760px) { .choice-cards { grid-template-columns: 1fr; } }
.choice-card { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1.5px solid var(--line-strong); border-radius: 12px; background: var(--surface); cursor: pointer; }
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card__dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-strong); flex: none; margin-top: 2px; }
.choice-card strong { display: block; }
.choice-card small { color: var(--ink-500); }
.choice-card:hover { border-color: var(--blue-500); }
.choice-card:has(input:checked) { border-color: var(--blue-600); background: var(--blue-50); }
.choice-card:has(input:checked) .choice-card__dot { border-color: var(--blue-600); background: radial-gradient(circle, var(--blue-600) 45%, transparent 50%); }
.choice-card:has(input:focus-visible) { box-shadow: var(--focus); }

.rows { display: grid; gap: 10px; }
.row-item { display: grid; grid-template-columns: 28px repeat(2, minmax(0, 1fr)) 40px; gap: 10px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcff; }
.row-item > .field:nth-of-type(3) { grid-column: 2 / 4; grid-row: 2; }
.row-item > .row-item__remove { grid-column: 4; grid-row: 1; }
.row-item__n { width: 28px; height: 28px; border-radius: 50%; background: var(--blue-50); color: var(--navy-700); font-weight: 700; font-size: 0.85rem; display: flex; align-items: center; justify-content: center; margin-top: 30px; }
.row-item .field > label { font-size: 0.82rem; font-weight: 500; color: var(--ink-500); }
.row-item .input { min-height: 40px; padding: 8px 10px; font-size: 0.95rem; }
.row-item__remove { margin-top: 26px; color: var(--ink-500); }
.row-item__remove:hover { color: var(--red-700); background: var(--red-50); }
@media (max-width: 760px) {
  .row-item { grid-template-columns: 1fr; }
  .row-item > .field:nth-of-type(3), .row-item > .row-item__remove { grid-column: auto; grid-row: auto; }
  .row-item__n { margin-top: 0; }
  .row-item__remove { margin-top: 0; justify-self: end; }
}

.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 16px 20px; border-bottom: 1px solid var(--line); background: #fafbfe; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.filters .field { min-width: 150px; flex: 1 1 150px; }
.filters .field--search { flex: 2 1 240px; }
.filters .field > label { font-size: 0.8rem; color: var(--ink-500); font-weight: 700; }
.filters .input, .filters .select { min-height: 40px; padding-top: 8px; padding-bottom: 8px; font-size: 0.95rem; }
.filters .btn-row { flex: 0 0 auto; }
.search-input { position: relative; }
.search-input .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-400); pointer-events: none; }
.search-input .input { padding-left: 40px; }

/* ----------------------------- Flash & notes ---------------------------- */

.flash-stack { display: grid; gap: 10px; margin-bottom: 20px; }
.flash { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 10px; border: 1px solid; font-weight: 500; }
.flash .icon { margin-top: 1px; }
.flash--success { background: var(--green-50); border-color: #a8dcc2; color: var(--green-700); }
.flash--error { background: var(--red-50); border-color: #f2b8b1; color: var(--red-700); }
.flash--info { background: var(--blue-50); border-color: var(--blue-100); color: var(--navy-700); }
.flash--warning { background: var(--amber-50); border-color: #f2d48a; color: var(--amber-700); }
.flash p { margin: 0; }
.note { padding: 14px 16px; border-radius: 10px; background: var(--blue-50); color: var(--navy-700); font-size: 0.93rem; }
.note .icon, .choice-card strong .icon { display: inline-block; vertical-align: -3px; }
.note--amber { background: var(--amber-50); color: var(--amber-700); }
.note--internal { background: var(--violet-50); color: var(--violet-700); border-left: 4px solid var(--violet-700); }

.empty { text-align: center; padding: 48px 20px; color: var(--ink-500); }
.empty .icon { width: 40px; height: 40px; margin: 0 auto 12px; color: var(--ink-400); }
.empty strong { display: block; color: var(--ink-900); font-size: 1.05rem; margin-bottom: 4px; }

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line); font-size: 0.9rem; color: var(--ink-500); flex-wrap: wrap; }

/* ------------------------------- Key/value ------------------------------ */

.kv { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 10px 20px; margin: 0; }
.kv dt { color: var(--ink-500); font-weight: 500; font-size: 0.92rem; }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-divided > li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.list-divided > li:last-child { border-bottom: 0; }
.list-plain.card__body { padding: 6px 24px; }
@media (max-width: 760px) { .list-plain.card__body { padding: 4px 18px; } }
.list-divided > li.flex-between { flex-wrap: nowrap; align-items: flex-start; }
.list-divided > li.flex-between > :first-child { flex: 1; min-width: 0; }
.list-divided > li.flex-between > :last-child { flex: none; }

/* -------------------------------- Meter --------------------------------- */

.meter { display: grid; gap: 8px; }
.meter__bar { height: 10px; background: #e7ebf3; border-radius: 99px; overflow: hidden; }
.meter__fill { height: 100%; background: linear-gradient(90deg, var(--blue-600), var(--cyan-500)); border-radius: 99px; width: 0; }
.meter__fill--amber { background: linear-gradient(90deg, #d68a00, #f2b233); }
.meter__fill--red { background: var(--red-700); }
.meter__legend { display: flex; justify-content: space-between; font-size: 0.86rem; color: var(--ink-500); }
.meter__big { font-size: 2.1rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }

/* -------------------------------- Tabs ---------------------------------- */

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--ink-500); font-weight: 700; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--navy-700); }
.tabs a[aria-current='page'] { color: var(--navy-700); border-bottom-color: var(--blue-600); }

.segmented { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; background: var(--surface); }
.segmented a, .segmented button { padding: 7px 14px; font: inherit; font-weight: 700; font-size: 0.88rem; color: var(--ink-500); text-decoration: none; border: 0; background: none; cursor: pointer; }
.segmented [aria-current='true'], .segmented [aria-pressed='true'] { background: var(--navy-700); color: #fff; }

/* ------------------------------- Auth pages ----------------------------- */

.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth__brand {
  position: relative; overflow: hidden;
  background: radial-gradient(1200px 600px at -10% 110%, rgba(1, 194, 203, 0.28), transparent 60%), linear-gradient(160deg, var(--navy-700), var(--navy-950));
  color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between;
}
.auth__brand img { width: 190px; }
.auth__brand h2 { color: #fff; font-size: 2.3rem; line-height: 1.12; max-width: 14ch; margin: 0 0 16px; letter-spacing: -0.02em; }
.auth__brand p { color: #c8d4f2; max-width: 44ch; font-size: 1.05rem; }
.auth__features { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
.auth__features li { display: flex; gap: 12px; align-items: flex-start; color: #e3eaff; }
.auth__features .icon { color: var(--accent-on-dark); margin-top: 2px; }
.auth__brand small { color: #8fa2cf; }
.auth__panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--surface); }
.auth__box { width: 100%; max-width: 420px; }
.auth__box h1 { font-size: 1.7rem; margin-bottom: 6px; }
.auth__box > p { color: var(--ink-500); }
.auth__logo-mobile { display: none; }
.auth__switch { display: flex; justify-content: flex-end; margin-bottom: 28px; }
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth__brand { display: none; }
  .auth__logo-mobile { display: block; width: 160px; margin-bottom: 28px; }
  .auth__panel { align-items: flex-start; padding-top: 32px; }
}
.divider-text { display: flex; align-items: center; gap: 12px; color: var(--ink-400); font-size: 0.85rem; margin: 22px 0; }
.divider-text::before, .divider-text::after { content: ''; flex: 1; border-top: 1px solid var(--line); }

.steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 28px; counter-reset: step; }
.steps li { flex: 1; font-size: 0.8rem; font-weight: 700; color: var(--ink-400); padding-top: 10px; border-top: 3px solid var(--line); }
.steps li[aria-current='step'] { color: var(--navy-700); border-color: var(--blue-600); }
.steps li.done { color: var(--green-700); border-color: var(--green-700); }

.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.checks li { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 8px; background: #f7f9fd; font-weight: 500; }
.checks .ok { color: var(--green-700); }
.checks li > span:first-child { flex: none; display: inline-flex; }
.checks .ko { color: var(--red-700); }

.code-box { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: #f3f5fa; border: 1px dashed var(--line-strong); border-radius: 8px; padding: 12px 14px; overflow-wrap: anywhere; font-size: 0.92rem; }
.qr { width: 200px; height: 200px; border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: #fff; }

/* ---------------------------- Report preview ---------------------------- */

.report { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 36px 40px; box-shadow: var(--shadow); }
.report__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; border-bottom: 3px solid var(--navy-700); padding-bottom: 18px; margin-bottom: 22px; }
.report__head img { width: 150px; }
.report__title { font-size: 1.25rem; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; color: var(--navy-700); margin: 0; }
.report__meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 26px; }
.report__meta div { background: var(--blue-50); border-radius: 10px; padding: 10px 14px; }
.report__meta dt { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-500); font-weight: 700; }
.report__meta dd { margin: 2px 0 0; font-weight: 700; }
.report h2 { font-size: 1.02rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--navy-700); margin: 28px 0 10px; display: flex; align-items: center; gap: 10px; }
.report h2::before { content: ''; width: 4px; height: 18px; background: var(--cyan-500); border-radius: 2px; }
.report .table { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; border-collapse: separate; border-spacing: 0; }
.report .table th { background: var(--navy-700); color: #fff; }
.report .table td { vertical-align: top; }
.report .wrong { color: var(--red-700); text-decoration: line-through; text-decoration-thickness: 1px; }
.report .right { color: var(--green-700); font-weight: 700; }
.report .why { display: block; color: var(--ink-500); font-size: 0.87rem; margin-top: 4px; }
.report .prompt { font-style: italic; background: var(--cyan-50); border-left: 4px solid var(--cyan-500); padding: 14px 16px; border-radius: 0 10px 10px 0; color: var(--ink-900); }
.report .rating-row { display: flex; gap: 10px; flex-wrap: wrap; }
.report .pillset span, .rating-row a, .rating-row span { display: inline-block; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line-strong); font-weight: 700; font-size: 0.9rem; text-decoration: none; color: var(--navy-700); }
.rating-row .is-selected { background: var(--navy-700); color: #fff; border-color: var(--navy-700); }
.report .tasks { margin: 0; padding-left: 20px; }
@media (max-width: 760px) {
  .report .table thead { display: none; }
  .report .table, .report .table tbody, .report .table tr, .report .table td { display: block; width: 100%; }
  .report .table tr { border-bottom: 1px solid var(--line); padding: 10px 12px; }
  .report .table tr:last-child { border-bottom: 0; }
  .report .table td { border: 0; padding: 2px 0; }
}
@media (max-width: 760px) { .report { padding: 22px 18px; } .report__meta { grid-template-columns: 1fr; } .report__head { flex-direction: column-reverse; } }

/* -------------------------------- Timeline ------------------------------ */

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 15px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline > li { position: relative; padding: 0 0 22px 48px; }
.timeline__dot { position: absolute; left: 6px; top: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--blue-600); border: 4px solid var(--blue-100); }
.timeline__dot--amber { background: #d68a00; border-color: var(--amber-100); }
.timeline__dot--grey { background: var(--ink-400); border-color: #e4e8f0; }
.timeline__head { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline; }
.timeline__head strong { font-size: 1rem; }
.timeline__body { margin-top: 8px; padding: 14px 16px; background: #fafbfe; border: 1px solid var(--line); border-radius: 10px; font-size: 0.94rem; }
.timeline__body p:last-child { margin-bottom: 0; }

/* -------------------------------- Charts -------------------------------- */

.chart { width: 100%; height: auto; }
.chart text { font-family: var(--font); font-size: 11px; fill: var(--ink-500); }
.chart .bar { fill: var(--blue-600); }
.chart .bar--alt { fill: var(--cyan-500); }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .value { fill: var(--ink-700); font-weight: 700; }
.legend { display: flex; gap: 16px; font-size: 0.85rem; color: var(--ink-500); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--blue-600); display: inline-block; }
.legend i.alt { background: var(--cyan-500); }

.ratings { display: grid; gap: 10px; }
.ratings__row { display: grid; grid-template-columns: 110px 1fr 44px; gap: 10px; align-items: center; font-size: 0.9rem; }
.ratings__bar { height: 8px; border-radius: 99px; background: #e7ebf3; overflow: hidden; }
.ratings__bar span { display: block; height: 100%; background: var(--blue-600); border-radius: 99px; width: 0; }
.ratings__row:nth-child(1) .ratings__bar span { background: var(--green-700); }
.ratings__row:nth-child(2) .ratings__bar span { background: var(--cyan-500); }
.ratings__row:nth-child(3) .ratings__bar span { background: #e0a100; }
.ratings__row:nth-child(4) .ratings__bar span { background: var(--red-700); }

/* ------------------------------- Errors --------------------------------- */

.error-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.error-page .card { max-width: 520px; width: 100%; text-align: center; }
.error-page__logo { margin: 0 auto 20px; }
.btn-row--center { justify-content: center; }
.error-page .code { font-size: 3.2rem; font-weight: 700; color: var(--blue-600); line-height: 1; margin-bottom: 8px; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: 16px; }
.text-right { text-align: right; }
.flex { display: flex; gap: 12px; align-items: center; }
.flex-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.hidden { display: none !important; }

@media print {
  .sidebar, .topbar, .page-header__actions, .no-print { display: none !important; }
  body { background: #fff; }
  .content { padding: 0; }
  .report { border: 0; box-shadow: none; padding: 0; }
}
.choice-cards--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice-cards--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .choice-cards--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pre-line { white-space: pre-line; }
.rating-row .btn.is-selected { background: var(--navy-700); color: #fff; border-color: var(--navy-700); }
.wrong-inline { color: var(--red-700); text-decoration: line-through; }
.right-inline { color: var(--green-700); }
details > summary { cursor: pointer; }
details > summary.btn { list-style: none; }
details > summary.btn::-webkit-details-marker { display: none; }
.field--internal .textarea { border-color: #cbbcf3; background: #fcfbff; }
.list-edit { flex: 1; min-width: 0; flex-wrap: wrap; }
.list-edit .input[type='number'] { width: 76px; }
.list-edit .input:not([type='number']) { flex: 1; min-width: 180px; }
.list-edit .select { width: auto; min-width: 140px; }

.input[type='file'] { padding: 8px; }
.content--narrow { max-width: 960px; }
.content--form { max-width: 1080px; }
.doc-card__text { align-items: flex-start; flex: 1; min-width: 260px; }
.doc-card__text .stat__icon { flex: none; margin-top: 2px; }
@media (max-width: 760px) {
  .doc-card .btn-row { width: 100%; }
  .doc-card .btn { width: 100%; white-space: normal; justify-content: flex-start; text-align: left; }
}
.stat__value--sm { font-size: 1.15rem; line-height: 1.3; }
.checks .warn { color: var(--amber-700); }
.checks li.check-warning { background: var(--amber-50); }
.checks li.check-error { background: var(--red-50); }
pre.code-box { white-space: pre-wrap; margin: 6px 0 0; max-height: 240px; overflow: auto; }
tr.log-error td:first-child { box-shadow: inset 3px 0 0 var(--red-700); }
tr.log-warning td:first-child { box-shadow: inset 3px 0 0 #d68a00; }
.acuity-note { display: flex; gap: 8px; align-items: flex-start; }
.acuity-note .icon { margin-top: 3px; }

/* ------------------------------ Reservas ------------------------------ */
.public { background: var(--bg); }
.public-bar { background: var(--surface); border-bottom: 3px solid var(--navy-700); }
.public-bar__inner { max-width: 1180px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; gap: 14px; }
.public-bar__inner img { height: 36px; width: auto; }
.public-bar__label { color: var(--ink-500); font-weight: 600; border-left: 1px solid var(--line); padding-left: 14px; margin-right: auto; text-decoration: none; }
.public-bar__label:hover { color: var(--navy-700); }
.public-bar__home { display: inline-flex; }
.public-bar__nav { display: flex; gap: 6px; flex-wrap: wrap; }
.public-main { max-width: 1180px; margin: 0 auto; padding: 28px 20px 40px; }
.public-main:focus { outline: none; }
.public-card { max-width: 560px; margin: 40px auto; }
.public-foot { max-width: 1180px; margin: 0 auto; padding: 0 20px 32px; color: var(--ink-500); font-size: 13px; }
.public-foot p { margin: 0 0 4px; }
@media (max-width: 640px) { .public-bar__label { display: none; } .public-main { padding: 18px 12px 32px; } }

.booking-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
@media (max-width: 1020px) { .booking-layout { grid-template-columns: 1fr; } }
.week-nav { display: flex; align-items: center; gap: 8px; }
.week-nav__label { font-weight: 600; font-size: 14px; min-width: 150px; text-align: center; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.day { padding: 12px 8px; border-right: 1px solid var(--line); min-height: 140px; }
.day:last-child { border-right: 0; }
.day--today { background: var(--blue-50); }
.day__title { font-size: 13px; margin: 0 0 10px; text-align: center; font-weight: 600; color: var(--ink-700); }
.day__title span { display: block; text-transform: capitalize; color: var(--ink-900); font-size: 14px; }
.day__none { text-align: center; margin: 0; }
.slots { display: flex; flex-direction: column; gap: 6px; }
.slot { display: block; text-align: center; padding: 8px 4px; border: 1px solid var(--blue-100); background: var(--surface); color: var(--blue-700); font-weight: 700; border-radius: var(--radius-sm); text-decoration: none; font-variant-numeric: tabular-nums; }
.slot:hover { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }
.slot:focus-visible { box-shadow: var(--focus); outline: none; }
@media (max-width: 900px) {
  .week { grid-template-columns: 1fr; }
  .day { border-right: 0; border-bottom: 1px solid var(--line); min-height: 0; display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: start; }
  .day--empty { display: none; }
  .day__title { text-align: left; margin: 4px 0 0; }
  .slots { flex-direction: row; flex-wrap: wrap; }
  .slot { min-width: 70px; }
}
.booking-item { display: flex; flex-direction: column; gap: 8px; }
.booking-item .btn-row form { display: inline; }
.confirm-card { max-width: 620px; margin: 0 auto; }
.confirm-card__when { font-size: 26px; line-height: 1.25; }
.confirm-card__when::first-letter { text-transform: uppercase; }
.confirm-card__when span { color: var(--blue-700); }

.avail { display: grid; grid-template-columns: 1fr; border-top: 1px solid var(--line); }
.avail__day { border: 0; border-bottom: 1px solid var(--line); margin: 0; padding: 12px 20px; display: grid; grid-template-columns: 110px 1fr; gap: 12px; align-items: center; }
.avail__day legend { float: left; font-weight: 700; padding: 0; }
.avail__ranges { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
.avail__range { display: flex; align-items: center; gap: 6px; }
.input--time { max-width: 120px; }
@media (max-width: 760px) { .avail__day { grid-template-columns: 1fr; } .avail__ranges { grid-template-columns: 1fr; } }

.agenda-item { display: grid; grid-template-columns: 70px 1fr auto; gap: 12px; align-items: start; }
.agenda-item__time { font-weight: 700; font-size: 16px; display: flex; flex-direction: column; }
.agenda-item__actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.agenda-item__cancel form { display: flex; flex-direction: column; gap: 6px; min-width: 220px; }
@media (max-width: 640px) { .agenda-item { grid-template-columns: 60px 1fr; } .agenda-item__actions { grid-column: 1 / -1; align-items: flex-start; flex-direction: row; flex-wrap: wrap; } }

.hours-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.hours-summary > div { display: flex; flex-direction: column; }
.hours-summary__label { font-size: 13px; color: var(--ink-500); }
.hours-summary__value { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.hours-summary__main .hours-summary__value { color: var(--blue-700); }
@media (max-width: 640px) { .hours-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.meter--stack .meter__bar { display: flex; }
.meter__fill--reserved { background: repeating-linear-gradient(45deg, var(--cyan-500), var(--cyan-500) 4px, #5fd9df 4px, #5fd9df 8px); }
.text-green { color: var(--green-700); font-weight: 600; }
.stat--link { text-decoration: none; color: inherit; }
.stat--link:hover { border-color: var(--blue-100); box-shadow: var(--shadow); }
.input-suffix { display: flex; align-items: center; gap: 8px; }
.input-suffix .input { max-width: 120px; }
.input-suffix span { color: var(--ink-500); }
.icon-btn--light { color: var(--ink-500); background: transparent; }
.icon-btn--light:hover { color: var(--red-700); background: var(--red-50); }
.meter--stack .meter__fill { border-radius: 0; }
.week--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.week--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 900px) { .week--5, .week--6 { grid-template-columns: 1fr; } }
.form-narrow .form-grid { grid-template-columns: 1fr; }

/* ------------------------------ Programas, profesorado y formulario de reserva ------------------------------ */
.pt-0 { padding-top: 0; }
.teacher-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.teacher-card { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.teacher-card:hover { border-color: var(--blue-100); box-shadow: var(--shadow-sm); }
.teacher-card.is-selected { border-color: var(--blue-600); box-shadow: 0 0 0 1px var(--blue-600); background: var(--blue-50); }
.teacher-card:focus-visible { box-shadow: var(--focus); outline: none; }
.teacher-card--static { cursor: default; }
.teacher-card__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.teacher-card__body small { color: var(--ink-500); font-size: 13px; line-height: 1.4; }
.teacher-card__bio { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.teacher-card.is-selected .teacher-card__bio { -webkit-line-clamp: unset; display: block; }
.teacher-photo { flex: none; border-radius: 50%; object-fit: cover; background: var(--blue-50); display: inline-flex; align-items: center; justify-content: center; }
.teacher-photo--sm { width: 36px; height: 36px; font-size: 13px; }
.teacher-photo--md { width: 64px; height: 64px; font-size: 20px; }
.teacher-photo--lg { width: 112px; height: 112px; font-size: 34px; }
.teacher-photo--initials { background: var(--navy-700); color: #fff; font-weight: 700; }
.teacher-photo--any { background: var(--cyan-50); color: var(--cyan-700); }
.teacher-photo--any .icon { width: 28px; height: 28px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border: 1px solid var(--line-strong); border-radius: 99px; background: var(--surface); color: var(--ink-700); font-weight: 600; text-decoration: none; cursor: pointer; }
.chip:hover { border-color: var(--blue-600); color: var(--blue-700); }
.chip.is-selected, .chips--check .chip:has(input:checked) { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }
.choice-list { display: grid; gap: 8px; }
.choice-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; background: var(--surface); }
.choice-row:hover { border-color: var(--blue-100); }
.choice-row:has(input:checked) { border-color: var(--blue-600); background: var(--blue-50); }
.choice-row input { margin-top: 4px; accent-color: var(--blue-600); }
.choice-row span { display: flex; flex-direction: column; }
.choice-row small { color: var(--ink-500); }
[hidden] { display: none !important; }
.profile-edit { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
.profile-edit__photo { display: flex; flex-direction: column; align-items: flex-start; }
@media (max-width: 760px) { .profile-edit { grid-template-columns: 1fr; } }
.week-plan { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.week-plan__day { padding: 12px 10px; border-right: 1px solid var(--line); min-height: 120px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.week-plan__day:last-child { border-right: 0; }
.week-plan__day h3 { font-size: 13px; margin: 0 0 4px; font-weight: 600; color: var(--ink-700); }
.week-plan__day h3 span { display: block; color: var(--ink-900); font-size: 14px; }
.week-plan__day.is-today { background: var(--blue-50); }
.week-plan__day.is-past { opacity: .55; }
@media (max-width: 1100px) { .week-plan { grid-template-columns: repeat(2, minmax(0, 1fr)); } .week-plan__day { border-bottom: 1px solid var(--line); } }
@media (max-width: 560px) { .week-plan { grid-template-columns: 1fr; } }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pill form { display: inline; }
.pill--avail { background: var(--green-50); color: var(--green-700); }
.pill--extra { background: var(--cyan-50); color: var(--cyan-700); }
.pill--off { background: var(--amber-50); color: var(--amber-700); }
.pill__x { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; }
.form-inline-grid { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; border-top: 1px solid var(--line); }
.form-inline-grid > strong { flex-basis: 100%; }
.form-inline-grid .field { margin: 0; min-width: 130px; }
.program-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.program-card { color: inherit; text-decoration: none; }
.program-card:hover { border-color: var(--blue-100); box-shadow: var(--shadow); }
.program-card__stats { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--ink-500); }
.program-card__stats strong { color: var(--ink-900); font-size: 15px; }
.teacher-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.teacher-pick__item { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.teacher-pick__item:has(input:checked) { border-color: var(--blue-600); background: var(--blue-50); }
.teacher-pick__item span { display: flex; flex-direction: column; }
.teacher-pick__item small { color: var(--ink-500); font-size: 12px; }
.meter--sm .meter__bar { height: 6px; }
.meter--sm .meter__legend { font-size: 12px; }
.intake { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sheet-list .list-edit .input { min-width: 260px; }
.table .meter--sm { min-width: 130px; }

/* ------------------------------ Videollamada ------------------------------ */
.block { display: block; }
.text-warn { color: var(--amber-700); }
.vtag { display: inline-flex; align-items: center; gap: 5px; align-self: flex-start; margin-top: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1.4; background: var(--cyan-50); color: var(--cyan-700); }
.vtag .icon { width: 14px; height: 14px; }
.vtag--teams { background: #ecebfa; color: #464eb8; }
.vtag--zoom, .vtag--meet, .vtag--webex, .vtag--link { background: var(--blue-50); color: var(--blue-700); }
.vtag--mixed { background: var(--violet-50); color: var(--violet-700); }
.vtag--none { background: var(--amber-50); color: var(--amber-700); }
.call-btn.is-live { position: relative; box-shadow: 0 0 0 0 rgba(1, 194, 203, 0.5); animation: call-live 1.8s ease-out infinite; }
@keyframes call-live { 70% { box-shadow: 0 0 0 10px rgba(1, 194, 203, 0); } 100% { box-shadow: 0 0 0 0 rgba(1, 194, 203, 0); } }
@media (prefers-reduced-motion: reduce) { .call-btn.is-live { animation: none; } }
.next-class { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.attendance { display: inline-flex; flex-wrap: wrap; gap: 6px 14px; }
.attendance__item { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-500); }
.attendance__item::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.attendance__item.is-in::before { background: #1f9d63; }
.vconn { display: inline-flex; align-items: center; gap: 4px; color: var(--cyan-700); }
.vconn .icon { width: 14px; height: 14px; }
.video-mode { border: 0; padding: 0; margin: 0; }
.video-mode legend { font-weight: 700; margin-bottom: 8px; }
.video-mode .choice-card .icon { color: var(--blue-600); margin-right: 2px; }
.video-mode .check { margin-top: 12px; }
.ice-test { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.ice-test__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.ice-test__list li { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.ice-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
[data-state='running'] .ice-dot { background: var(--cyan-500); animation: call-live 1.2s infinite; }
[data-state='ok'] .ice-dot { background: #1f9d63; }
[data-state='fail'] .ice-dot { background: var(--red-700); }
@media (max-width: 760px) { .choice-cards--4 { grid-template-columns: 1fr; } }

/* ------------------------------ Programas del alumno ------------------------------ */
.enrol-list { display: grid; gap: 10px; }
.enrol { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface); transition: border-color 0.15s, background 0.15s; }
.enrol.is-on { border-color: var(--blue-600); background: var(--blue-50); }
.enrol__head { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.enrol__head input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.enrol__head strong { font-size: 1rem; }
.enrol__head small { display: block; color: var(--ink-500); }
.enrol__fields { display: none; grid-template-columns: 140px minmax(0, 1fr) auto; gap: 12px; align-items: end; margin: 12px 0 0 30px; }
.enrol.is-on .enrol__fields { display: grid; }
.enrol__fields .field { margin: 0; }
.enrol__bono { margin: 0 0 10px; }
.enrol__bono a { display: inline-flex; align-items: center; gap: 4px; }
@media (max-width: 640px) { .enrol__fields { grid-template-columns: 1fr; margin-left: 0; } }

/* Enlaces de las tablas que llevan a un detalle (que se vea que se pueden pulsar) */
a.link-strong { color: var(--blue-700); font-weight: 700; text-decoration: underline; text-decoration-color: var(--blue-100); text-underline-offset: 3px; }
a.link-strong:hover { text-decoration-color: currentColor; }
.cell-actions { text-align: right; white-space: nowrap; width: 1%; }
@media (max-width: 760px) { .table--stack .cell-actions { text-align: left; width: auto; } }

/* ------------------------------ Campus online del alumno ------------------------------ */
.campus { display: grid; gap: 20px; }
.campus--both { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); align-items: stretch; }
.campus-courses { overflow: hidden; background: linear-gradient(135deg, var(--navy-700), var(--navy-950)); color: #fff; border: 0; position: relative; }
.campus-courses::after { content: ''; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(1, 194, 203, 0.35), transparent 70%); pointer-events: none; }
.campus-courses__body { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 24px; height: 100%; }
.campus-courses__icon { width: 48px; height: 48px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; background: rgba(1, 194, 203, 0.18); color: var(--accent-on-dark); }
.campus-courses__icon .icon { width: 26px; height: 26px; }
.campus-courses .eyebrow { color: var(--accent-on-dark); }
.campus-courses h2 { color: #fff; margin: 0 0 6px; }
.campus-courses p { margin: 0; color: #c9d4ef; }
.campus-courses__cta { margin-top: auto; }
.campus-courses .badge--grey { background: rgba(255, 255, 255, 0.14); color: #fff; }
.event-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.event-link { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1.5px solid var(--line); border-radius: 12px; color: var(--ink-900); text-decoration: none; background: var(--surface); transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
.event-link:hover { border-color: var(--blue-600); box-shadow: var(--shadow); color: var(--ink-900); transform: translateY(-1px); }
.event-link:focus-visible { box-shadow: var(--focus); outline: none; }
.event-link__icon { width: 40px; height: 40px; flex: none; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; background: var(--cyan-50); color: var(--cyan-700); }
.event-link:nth-child(3n+2) .event-link__icon { background: var(--violet-50); color: var(--violet-700); }
.event-link:nth-child(3n) .event-link__icon { background: var(--blue-50); color: var(--blue-700); }
.event-link__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.event-link__text small { color: var(--ink-500); margin-top: 2px; }
.event-link__go { margin-left: auto; color: var(--ink-400); display: inline-flex; }
@media (max-width: 900px) { .campus--both { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .event-link { transition: none; } .event-link:hover { transform: none; } }

/* Ajustes y fichas: campus online */
.events-edit { display: grid; gap: 10px; }
.events-edit__row { display: grid; grid-template-columns: 70px minmax(0, 1fr) minmax(0, 1.6fr) 150px; gap: 10px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.events-edit__row .field { margin: 0; }
.events-edit__row--new { border-style: dashed; background: transparent; }
.events-edit__row .span-2 { grid-column: 2 / -1; }
.events-edit__row > .field-error, .events-edit__row > .error { grid-column: 1 / -1; }
@media (max-width: 900px) { .events-edit__row { grid-template-columns: 1fr 1fr; } .events-edit__row .span-2 { grid-column: 1 / -1; } }
.lock-note { display: flex; gap: 8px; align-items: flex-start; font-size: 0.88rem; color: var(--ink-500); }
.lock-note .icon { width: 16px; height: 16px; margin-top: 2px; flex: none; color: var(--blue-600); }
.field--end { display: flex; align-items: flex-end; }

/* Imagen corporativa de la empresa del alumno (logo junto al de King's Training) */
.cobrand { display: flex; align-items: center; justify-content: center; margin-top: 14px; padding: 8px 12px; border-radius: 10px; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15); max-width: 100%; }
.cobrand img { display: block; width: auto !important; max-width: 100%; max-height: 44px; object-fit: contain; }
.sidebar__brand .cobrand { font-style: normal; }
.cobrand--sm { display: inline-flex; margin: 0 0 0 10px; padding: 4px 8px; border-radius: 8px; vertical-align: middle; }
.cobrand--sm img { max-height: 26px; max-width: 110px; }
.cobrand--light { display: inline-flex; margin: 0; padding: 0 0 0 14px; border-radius: 0; background: none; box-shadow: none; border-left: 1px solid var(--line); }
.cobrand--light img { max-height: 36px; max-width: 160px; }
.topbar__brand { display: inline-flex; align-items: center; }
.room-brand { align-items: center; }
.brand-preview { display: grid; grid-template-columns: 180px minmax(0, 1fr); border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--bg); min-height: 210px; }
.brand-preview__side { background: linear-gradient(180deg, var(--bp-side-1, var(--navy-800)), var(--bp-side-2, var(--navy-950))); padding: 16px 12px; color: #dbe4fa; display: flex; flex-direction: column; gap: 6px; }
.brand-preview__side img.kt { width: 110px; height: auto; }
.brand-preview__side .cobrand { margin-top: 8px; padding: 6px 8px; }
.brand-preview__side .cobrand img { max-height: 30px; }
.brand-preview__nav { margin-top: 10px; padding: 7px 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.12); box-shadow: inset 3px 0 0 var(--bp-accent, var(--cyan-500)); color: #fff; font-size: 0.85rem; font-weight: 500; }
.brand-preview__main { padding: 18px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.brand-preview__eyebrow { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; color: var(--bp-accent-dark, var(--cyan-700)); }
.brand-preview__btn { padding: 8px 14px; border-radius: 9px; background: var(--bp-primary, var(--blue-600)); color: #fff; font-weight: 700; font-size: 0.85rem; }
.brand-preview__btn--accent { background: var(--bp-accent, var(--cyan-500)); color: var(--bp-accent-text, var(--navy-950)); }
.brand-colors { display: flex; gap: 16px; flex-wrap: wrap; }
.brand-colors .field { margin: 0; }
.color-field { display: flex; align-items: center; gap: 8px; }
.color-field input[type='color'] { width: 44px; height: 40px; padding: 2px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); cursor: pointer; }
.color-field .input { width: 110px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
@media (max-width: 760px) { .brand-preview { grid-template-columns: 1fr; } }
.choice-cards--stack { grid-template-columns: 1fr; }

/* Ajustes → Avisos y avisos por empresa */
.notice-list { display: grid; gap: 8px; }
.notice-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.notice-row__check { margin: 0; flex: 1; }
.notice-row__check small { display: block; }
.notice-row__extra { flex: none; }
.notice-row__extra .input { width: 96px; }
.notice-row__extra input[type='time'] { width: 120px; }
.notice-row select { min-width: 190px; }
@media (max-width: 760px) { .notice-row { flex-direction: column; align-items: stretch; } }

/* Confirmación de la reserva */
.booked-card__ok { width: 56px; height: 56px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--green-50); color: var(--green-700); }
.booked-card__ok .icon { width: 30px; height: 30px; }
.booked-card__sheet { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px; background: var(--cyan-50); }
.booked-card__sheet > span:nth-child(2) { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.booked-card__sheet small { color: var(--ink-500); }
.booked-card__sheet-icon { width: 40px; height: 40px; flex: none; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface); color: var(--cyan-700); }
@media (max-width: 640px) { .booked-card__sheet { flex-direction: column; align-items: flex-start; } }

/* Dinamización */
.dyn-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.dyn-table tr.is-current td { background: var(--cyan-50); }
.dyn-table input[type='checkbox'] { width: 18px; height: 18px; }
.dyn-preview { position: sticky; top: 16px; overflow: hidden; }
.mail-frame { display: block; width: 100%; height: min(78vh, 980px); border: 0; border-top: 1px solid var(--line); background: #f4f6fb; }
.dyn-rules li, .dyn-fields li { padding: 4px 0; }
.dyn-rules li { padding-left: 14px; position: relative; }
.dyn-rules li::before { content: ''; position: absolute; left: 0; top: 12px; width: 5px; height: 5px; border-radius: 50%; background: var(--cyan-500); }
.dyn-fields code { font-size: 0.8rem; padding: 1px 6px; border-radius: 6px; background: var(--surface-2, #f1f4fa); }
.textarea--code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.82rem; line-height: 1.55; }
@media (max-width: 1100px) { .dyn-layout { grid-template-columns: minmax(0, 1fr); } .dyn-preview { position: static; } }

/* Fichas de clase: título a todo el ancho y acciones compactas */
.sheet-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 14px; }
.sheet-row__main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sheet-row__main .input { flex: 1 1 auto; min-width: 0; }
.sheet-row__tags { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.sheet-row__actions { display: inline-flex; align-items: center; gap: 2px; flex-wrap: nowrap; }
.sheet-row__actions .btn--sm { min-height: 34px; padding: 6px 9px; }
@media (max-width: 720px) { .sheet-row { grid-template-columns: minmax(0, 1fr); } .sheet-row__main { flex-wrap: wrap; } }

/* Alertas */
.banner { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 12px; }
.banner > div { flex: 1; min-width: 0; }
.banner--critical { background: var(--red-50); color: var(--red-700); border: 1px solid rgba(180, 35, 24, 0.18); }
.alert-group__count { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 22px; padding: 0 7px; margin-left: 6px; border-radius: 11px; background: var(--blue-50); color: var(--navy-700); font-size: 0.8rem; vertical-align: 2px; }
.alert-item { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.alert-item__main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.alert-item__head { margin: 0 0 4px; }
.alert-item__text { margin: 0 0 6px; }
.alert-item__meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; color: var(--ink-500); }
.alert-item__meta > span { display: inline-flex; align-items: center; gap: 5px; }
.alert-item__why { margin: 6px 0 0; }
.alert-item__tech { margin-top: 4px; color: var(--ink-500); }
.alert-item__tech code { display: block; margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2, #f1f4fa); white-space: pre-wrap; word-break: break-word; font-size: 0.78rem; }
.alert-item__note { margin: 8px 0 0; padding: 8px 12px; border-left: 3px solid var(--cyan-500); background: var(--cyan-50); border-radius: 0 8px 8px 0; white-space: pre-line; }
.alert-item__closed { margin: 6px 0 0; color: var(--green-700); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.alert-item__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: flex-start; gap: 6px; flex: 0 0 auto; max-width: 46%; }
.alert-item__actions form { margin: 0; }
.dismiss { position: relative; }
.dismiss > summary { list-style: none; cursor: pointer; }
.dismiss > summary::-webkit-details-marker { display: none; }
.dismiss__form { display: flex; gap: 6px; margin-top: 6px; }
.input--sm { min-height: 34px; padding: 6px 10px; font-size: 0.875rem; }
@media (max-width: 760px) { .alert-item { flex-direction: column; } .alert-item__actions { max-width: none; justify-content: flex-start; } }
.alert-list--compact .alert-item { flex-direction: column; gap: 8px; }
.alert-list--compact .alert-item__actions { max-width: none; justify-content: flex-start; }
