:root {
  --bg: #0f1419;
  --surface: #1a222d;
  --surface2: #232d3b;
  --border: #2e3a4d;
  --text: #e8eef5;
  --muted: #8b9cb3;
  --accent: #ff3399;
  --accent-dim: #cc1f77;
  --success: #3ecf8e;
  --slot: rgba(255, 51, 153, 0.14);
  --font: "DM Sans", system-ui, sans-serif;
  --font-display: "Outfit", var(--font);
  --time-gutter-width: 112px;
  --wc-head-h: 44px;
  /* Título compacto del calendario («Programación semanal»); el slogan de cabecera va +30 % */
  --header-compact-title-size: 1.2rem;
  --nav-slogan-size: calc(var(--header-compact-title-size) * 1.3);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  background: var(--theme-page-bg, var(--bg));
  color: var(--text);
  line-height: 1.45;
}

.btn-sm {
  padding: 0.35rem 0.55rem;
  font-size: 0.8rem;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

/* Login */
.login-body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--theme-page-bg, var(--bg));
}

.login-main {
  width: 100%;
  max-width: 400px;
}

.login-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.75rem 1.5rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.login-brand {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
}

.login-brand-rest {
  font-weight: 600;
  color: var(--muted);
}

.login-lead {
  margin: 0 0 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.login-hint {
  margin: 0 0 1rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: #fcd34d;
  font-size: 0.85rem;
  line-height: 1.4;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.login-field input {
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
}

.login-error {
  margin: 0;
  font-size: 0.85rem;
  color: #f87171;
}

.login-forgot-wrap {
  margin: 1rem 0 0;
  text-align: center;
}

.login-forgot-link {
  font-size: 0.88rem;
  color: var(--accent);
  text-decoration: none;
}

.login-forgot-link:hover {
  text-decoration: underline;
}

.login-hint.login-success {
  color: #86efac;
}

/* Barra: usuario y salir */
.nav-auth-slot {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 0.35rem;
  padding-left: 0.65rem;
  border-left: 1px solid var(--border);
}

.nav-user-name {
  font-size: 0.8rem;
  color: var(--muted);
  max-width: 8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-btn-logout {
  padding: 0.3rem 0.55rem;
  font-size: 0.78rem;
}

/* Usuarios / perfiles */
.usuarios-card h3.usuarios-subh {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  color: var(--text);
}

.usuarios-subh--spaced {
  margin-top: 1.25rem !important;
}

.usuarios-two-col {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 768px) {
  .usuarios-two-col {
    grid-template-columns: 1fr;
  }
}

.usuarios-lista {
  list-style: none;
  margin: 0 0 0.65rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.usuarios-list-btn {
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.88rem;
  cursor: pointer;
}

.usuarios-list-btn:hover {
  border-color: var(--accent);
}

.usuarios-list-btn.is-active {
  border-color: var(--accent);
  background: rgba(255, 51, 153, 0.1);
}

.usuarios-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-width: 520px;
}

.usuarios-input,
.usuarios-form select {
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
}

.usuarios-perm-fieldset {
  margin: 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.usuarios-perm-legend {
  padding: 0 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.usuarios-perm-grid {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.5rem;
}

.usuarios-perm-row {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) repeat(3, auto);
  align-items: center;
  gap: 0.35rem 0.65rem;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.12);
  border: 1px solid var(--border);
}

@media (max-width: 640px) {
  .usuarios-perm-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}

.usuarios-perm-row-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.usuarios-perm-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}

.usuarios-perm-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
}

.usuarios-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.usuarios-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.usuarios-table th,
.usuarios-table td {
  padding: 0.5rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.usuarios-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.usuarios-td-actions {
  text-align: right;
  white-space: nowrap;
}

.usuarios-inline {
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem;
}

.usuarios-inline input,
.usuarios-inline select {
  min-width: 140px;
}

.usuarios-form-nuevo-wrap .config-field-label {
  display: block;
  margin-top: 0.85rem;
}

.usuarios-select-instructora {
  max-width: 22rem;
}

.usuarios-instructora-hint {
  max-width: 48rem;
  margin-bottom: 1rem;
}

.usuarios-edit-panel {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.empty-state a,
.hint a {
  color: var(--accent);
  font-weight: 600;
}

.empty-state a:hover,
.hint a:hover {
  color: #ff66b3;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.975rem 1.25rem;
  min-height: calc(3.1rem + 1.95rem);
  background: var(--theme-header-bg, var(--surface));
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.nav-brand-group {
  display: flex;
  align-items: center;
  gap: 0.75rem 1.15rem;
  flex: 1 1 auto;
  min-width: 0;
}

.nav-slogan {
  font-family: var(--font-display);
  font-size: var(--nav-slogan-size);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
  max-width: min(28rem, 50vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1.2;
}

.nav-brand .brand-mark {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
}

.nav-brand .nav-logo {
  display: block;
  max-height: 3.35rem;
  max-width: min(220px, 42vw);
  width: auto;
  height: auto;
  object-fit: contain;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.25rem;
}

.nav-link {
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: calc(0.85rem * 0.8);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface2);
}

.nav-link.is-active {
  color: #fff;
  background: var(--accent);
}

.is-hidden {
  display: none !important;
}

.logo-upload-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

.btn-file {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.btn-file input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.logo-file-name {
  margin: 0;
}

.logo-preview-wrap {
  margin: 0.75rem 0 1rem;
}

.logo-preview-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  padding: 0.6rem 1rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: calc(3.1rem + 1.2rem);
}

.logo-preview-bar .nav-logo {
  max-height: 3.35rem;
}

.logo-preview-bar .nav-slogan-preview {
  font-family: var(--font-display);
  font-size: var(--nav-slogan-size);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
}

.slogan-form-row {
  margin-top: 0.35rem;
}

.slogan-form-row input[type="text"] {
  width: 100%;
  max-width: 36rem;
  box-sizing: border-box;
}

.config-field-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0.5rem 0 0.25rem;
}

.slogan-size-preview {
  padding: 0.65rem 1rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  max-width: 36rem;
}

.nav-slogan--preview {
  white-space: normal;
  max-width: none;
  text-overflow: unset;
  overflow: visible;
  display: inline;
}

.slogan-card-actions {
  margin-top: 1rem;
}

.theme-color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem 1.25rem;
  margin: 0.75rem 0 1rem;
}

.theme-color-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  cursor: pointer;
}

.theme-color-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.theme-color-field input[type="color"] {
  width: 100%;
  max-width: 8rem;
  height: 2.5rem;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  cursor: pointer;
}

.theme-color-field input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.theme-color-field input[type="color"]::-webkit-color-swatch {
  border-radius: 6px;
  border: none;
}

.logo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
}

.logo-msg {
  margin-top: 0.75rem;
  margin-bottom: 0;
}

.admin-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.admin-body .admin-main {
  flex: 1 0 auto;
}

.admin-main {
  max-width: 52rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.admin-main--wide {
  max-width: min(96rem, 100%);
}

.admin-main--narrow {
  max-width: 38rem;
}

.admin-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.65rem;
}

.admin-lead {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 40rem;
}

.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.25rem;
}

.admin-card h2 {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.admin-form-row {
  margin-bottom: 0;
}

.admin-field-block {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 320px;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table th,
.data-table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.col-acciones {
  white-space: nowrap;
  width: 1%;
}

.table-empty {
  color: var(--muted);
  text-align: center;
  padding: 1.25rem !important;
}

.col-color {
  width: 3rem;
  vertical-align: middle;
}

.color-swatch {
  display: inline-block;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 8px;
  border: 2px solid var(--border);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.color-field-label input[type="color"] {
  width: 100%;
  max-width: 120px;
  height: 42px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  cursor: pointer;
}

.color-field-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.color-field-hint {
  margin: 0;
  flex: 1 1 160px;
}

.header-compact {
  grid-column: 1 / -1;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.header-compact h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--header-compact-title-size);
  font-weight: 600;
}

.header-compact .tagline {
  margin: 0.4rem 0 0;
  max-width: 48rem;
}

.panel-palette-only .panel-section h2 {
  margin-bottom: 0.35rem;
}

/* Misma rejilla que el admin: el panel de disciplinas sigue visible en solo consulta */
.app-calendario .panel-left.is-auth-readonly {
  opacity: 0.97;
}

.app-calendario .panel-left.is-auth-readonly .palette-card {
  cursor: default;
  user-select: none;
}

/* Menú completo: enlaces sin permiso de ver se muestran atenuados */
.site-nav a.nav-link.nav-link--no-access {
  opacity: 0.42;
  cursor: not-allowed;
  pointer-events: auto;
}

.admin-card--readonly {
  opacity: 0.96;
}

.app {
  display: grid;
  grid-template-columns: minmax(280px, 320px) 1fr;
  grid-template-rows: auto auto;
  min-height: 100vh;
  gap: 0;
  align-items: start;
}

.app-calendario {
  grid-template-columns: minmax(240px, 280px) 1fr;
}

.header {
  grid-column: 1 / -1;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, var(--surface) 0%, #151c26 100%);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.brand-mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
}

.tagline {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 52rem;
}

.panel {
  background: var(--theme-panel-bg, var(--surface));
  border-right: 1px solid var(--border);
  padding: 1.25rem 1.25rem 2rem;
}

.panel-section {
  margin-bottom: 1.75rem;
}

.panel-section h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.inline-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.inline-form input {
  flex: 1;
  min-width: 0;
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
}

input:focus,
select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

input.readonly {
  opacity: 0.85;
  cursor: not-allowed;
}

.btn {
  padding: 0.55rem 1rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-dim);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: #ff66b3;
  border-color: #ff66b3;
}

.chip-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.6rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8rem;
}

.chip button {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0 0.15rem;
  font-size: 1rem;
  line-height: 1;
}

.chip button:hover {
  color: #ff66b3;
}

.hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0.25rem 0 0.65rem;
}

.franja-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.franja-list-empty {
  font-size: 0.8rem;
  color: var(--muted);
  padding: 0.35rem 0;
}

.franja-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.8rem;
}

.franja-item-range {
  font-variant-numeric: tabular-nums;
}

.btn-mini {
  padding: 0.3rem 0.55rem;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.label-inline {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.disciplina-panel-list {
  list-style: none;
  margin: 0.65rem 0 0.75rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.disciplina-panel-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.5rem;
  padding: 0.45rem 0.5rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.78rem;
}

.disciplina-panel-nombre {
  font-weight: 600;
  flex: 1 1 100px;
  min-width: 0;
}

.disciplina-panel-asignar select {
  min-width: 100px;
  max-width: 140px;
  padding: 0.35rem 0.45rem;
  font-size: 0.78rem;
}

.palette-hint {
  margin-top: 0.5rem;
  margin-bottom: 0.35rem;
}

.palette {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.palette-card {
  padding: 0.65rem 0.75rem;
  background: linear-gradient(145deg, var(--surface2), #1e2835);
  border: 1px dashed var(--border);
  border-radius: 10px;
  cursor: grab;
  transition: border-color 0.15s, transform 0.15s;
}

.palette-card:hover {
  border-color: var(--accent);
}

.palette-card:active {
  cursor: grabbing;
}

.palette-card .title {
  font-weight: 600;
  font-size: 0.9rem;
}

.palette-card .sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.palette-card.disc-tone {
  border-style: solid;
}

.palette-card.disc-tone .title {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.palette-card.disc-tone .sub {
  color: rgba(255, 255, 255, 0.88);
}

.palette-card.disc-tone:hover {
  filter: brightness(1.07);
}

.main {
  padding: 1rem 1.25rem 2rem;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

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

.toolbar-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.toolbar-field select {
  min-width: 180px;
}

.toolbar-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.timeline-wrap {
  overflow-x: auto;
  overflow-y: visible;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  min-height: 200px;
}

.calendar-root {
  min-width: min(100%, 720px);
}

.week-calendar {
  display: flex;
  flex-direction: column;
  min-width: max-content;
}

.wc-head {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  min-height: var(--wc-head-h);
}

.wc-corner {
  flex: 0 0 var(--time-gutter-width);
  width: var(--time-gutter-width);
  min-width: var(--time-gutter-width);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-right: 1px solid var(--border);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.wc-days {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, minmax(88px, 1fr));
  min-width: 0;
}

.wc-day-head {
  padding: 0.55rem 0.35rem;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.78rem;
  border-right: 1px solid var(--border);
  color: var(--text);
}

.wc-day-head:last-child {
  border-right: none;
}

.wc-day-head.is-weekend {
  background: rgba(255, 51, 153, 0.08);
  color: #ffb3d9;
}

.wc-franja-body {
  display: flex;
  flex-direction: column;
}

.wc-franja-row {
  display: flex;
  border-bottom: 1px solid var(--border);
  min-height: 58px;
}

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

.wc-franja-label {
  flex: 0 0 var(--time-gutter-width);
  width: var(--time-gutter-width);
  padding: 0.45rem 0.5rem;
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  border-right: 1px solid var(--border);
  background: var(--surface2);
  display: flex;
  align-items: center;
  color: var(--muted);
}

.wc-franja-cells {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, minmax(80px, 1fr));
  min-width: 0;
}

.cell-track {
  position: relative;
  border-right: 1px solid var(--border);
  min-height: 58px;
  background-color: rgba(0, 0, 0, 0.1);
}

.wc-franja-cells .cell-track:last-child {
  border-right: none;
}

.cell-track.is-weekend {
  background-color: rgba(255, 51, 153, 0.05);
}

.cell-track.drag-over {
  background-color: var(--slot);
  outline: 2px dashed var(--accent);
  outline-offset: -3px;
  z-index: 1;
}

.session-block {
  position: absolute;
  left: 4px;
  right: 4px;
  top: 4px;
  bottom: 4px;
  border-radius: 8px;
  padding: 0.3rem 0.45rem;
  overflow: hidden;
  cursor: pointer;
  background: linear-gradient(145deg, #4a2a45, #2d1a35);
  border: 1px solid rgba(255, 51, 153, 0.25);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  font-size: 0.68rem;
  line-height: 1.2;
  user-select: none;
  transition: box-shadow 0.15s, transform 0.1s;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.session-block:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  z-index: 2;
}

.session-block.dragging {
  opacity: 0.85;
  z-index: 10;
  cursor: grabbing;
}

.session-block--readonly {
  cursor: default;
  user-select: none;
}

.session-block--readonly:hover {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  z-index: 1;
}

.clases-alert {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.12);
  color: #fcd34d;
  font-size: 0.875rem;
  line-height: 1.4;
}

.clases-toolbar-card {
  margin-bottom: 1rem;
}

.clases-select-row {
  max-width: 22rem;
}

.clases-pdf-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 1rem;
}

.clases-pdf-hint {
  font-size: 0.8rem;
  color: var(--muted, #888);
  max-width: 22rem;
  line-height: 1.35;
}

.clases-select-instructora {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 0.9rem;
}

.clases-select-instructora:disabled {
  opacity: 0.88;
  cursor: not-allowed;
}

.clases-scope-hint {
  max-width: 44rem;
  margin-top: -0.75rem;
  margin-bottom: 0.5rem;
}

.clases-timeline {
  margin-top: 0;
}

/* Calendario Clases: filas más altas y texto que puede partir en varias líneas */
.week-calendar--clases .wc-franja-row {
  min-height: 92px;
  align-items: stretch;
}

.week-calendar--clases .cell-track.clases-cell {
  min-height: 92px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 5px 3px;
  justify-content: flex-start;
}

.week-calendar--clases .session-block.session-block--readonly {
  position: relative;
  left: auto;
  right: auto;
  top: auto;
  bottom: auto;
  flex: 0 0 auto;
  min-height: 4.25rem;
  padding: 0.4rem 0.5rem;
  justify-content: flex-start;
}

.week-calendar--clases .session-block .sb-title,
.week-calendar--clases .session-block .sb-sub {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  line-height: 1.25;
  word-break: break-word;
}

.week-calendar--clases .session-block .sb-title {
  font-size: 0.72rem;
}

.week-calendar--clases .session-block .sb-sub {
  font-size: 0.68rem;
}

.week-calendar--clases .session-block .sb-time {
  font-size: 0.62rem;
  margin-top: 0.2rem;
}

.week-calendar--clases .wc-franja-label {
  font-size: 0.72rem;
  line-height: 1.3;
  align-items: flex-start;
  padding-top: 0.55rem;
}

.clases-horas-section {
  margin-top: 1.15rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
}

.clases-horas-section.is-hidden {
  display: none;
}

.clases-horas-total {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.45;
}

.clases-horas-total strong {
  color: var(--accent);
  font-weight: 600;
}

.clases-horas-hint {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 400;
}

.session-block .sb-title {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-block .sb-sub {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.68rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-block .sb-time {
  margin-top: 0.15rem;
  font-size: 0.65rem;
  opacity: 0.85;
}

.session-block.disc-tone .sb-title {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.session-block.disc-tone .sb-sub,
.session-block.disc-tone .sb-time {
  color: rgba(255, 255, 255, 0.9);
  opacity: 1;
}

.empty-state {
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.modal {
  border: none;
  border-radius: 14px;
  padding: 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  max-width: 400px;
  width: calc(100% - 2rem);
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.65);
}

.modal-form {
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.modal-form h3 {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
}

.modal-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.row-times {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.panel-ryd .ryd-intro {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.ryd-step {
  margin-bottom: 1.35rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.ryd-step:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.ryd-step-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ryd-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

.ryd-step-hint {
  margin: 0 0 0.65rem;
}

.ryd-bloqueo {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.75rem;
  background: rgba(255, 51, 153, 0.1);
  border: 1px solid rgba(255, 51, 153, 0.25);
  border-radius: 8px;
  color: #ffb3d9;
}

.ryd-bloqueo.is-hidden {
  display: none;
}

.disciplina-form-wrap.is-disabled {
  opacity: 0.45;
  pointer-events: none;
  user-select: none;
}

.disciplina-form-wrap.is-disabled .hint {
  opacity: 0.8;
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
  }

  .panel {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}

/* Calendario (index): pie al fondo cuando hay poco contenido */
body:not(.admin-body) {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body:not(.admin-body) > .app {
  flex: 1 0 auto;
}

/* Pie de página global */
.site-footer {
  margin-top: auto;
  padding: 1rem 1.25rem 1.35rem;
  border-top: 1px solid var(--border);
  background: var(--theme-footer-bg, var(--surface));
}

.site-footer.site-footer--empty {
  display: none;
}

.site-footer-inner {
  max-width: 52rem;
  margin: 0 auto;
  text-align: center;
}

.site-footer-line {
  margin: 0.2rem 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

.site-footer-line:empty {
  display: none;
}

/* PDF (html2canvas): mismo tema que la app — vars se copian en calendario-pdf.js al contenedor */
.pdf-export-surface {
  font-family: var(--font);
}

.pdf-export-surface .pdf-doc-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

.pdf-export-surface .pdf-doc-header-brand {
  flex-shrink: 0;
}

.pdf-export-surface .pdf-doc-logo-img {
  max-height: 52px;
  max-width: 200px;
  object-fit: contain;
  display: block;
}

.pdf-export-surface .pdf-doc-logo-fallback {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text);
}

.pdf-export-surface .pdf-doc-logo-accent {
  color: var(--accent-dim);
}

.pdf-export-surface .pdf-doc-header-text {
  flex: 1;
  min-width: 0;
}

.pdf-export-surface .pdf-doc-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text);
}

.pdf-export-surface .pdf-doc-slogan {
  margin: 6px 0 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.pdf-export-surface .pdf-doc-meta {
  margin: 8px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.pdf-export-surface .pdf-doc-meta strong {
  color: var(--text);
  font-weight: 600;
}

.pdf-export-surface .pdf-doc-meta--secondary {
  margin-top: 4px;
}

.pdf-export-surface .pdf-doc-generated {
  margin: 4px 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.pdf-export-surface .pdf-calendar-frame {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
  min-width: min-content;
}

.pdf-export-surface .pdf-calendar-clone {
  min-width: min-content;
}

/* Sticky del calendario puede cortarse mal en captura; en PDF va estático */
.pdf-export-surface .week-calendar--pdf-capture .wc-head {
  position: relative;
  top: auto;
  z-index: auto;
}

.pdf-export-surface .pdf-ins-section {
  margin-top: 14px;
}

.pdf-export-surface .pdf-ins-title {
  margin: 0 0 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.pdf-export-surface .pdf-ins-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: center;
}

.pdf-export-surface .pdf-ins-chip {
  display: inline-block;
  padding: 6px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--text);
}

.pdf-export-surface .pdf-ins-chip strong {
  font-weight: 600;
  color: var(--text);
}

.pdf-export-surface .pdf-ins-hours {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.pdf-export-surface .pdf-doc-footer {
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.pdf-export-surface .pdf-doc-footer-line {
  margin: 2px 0;
  font-size: 0.72rem;
  color: var(--muted);
}

/* Calendario: resumen instructoras + acciones */
.cal-below {
  margin-top: 1.25rem;
  padding: 0 0 1.5rem;
}

.instructoras-horas-row {
  margin-bottom: 0.85rem;
}

.instructoras-horas-title {
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

/* Cuadrados fijos: cada instructora en un tile cuadrado (no pastilla horizontal) */
.instructoras-horas-chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, 6.75rem);
  gap: 0.55rem;
  justify-content: start;
}

.instructora-hora-chip {
  box-sizing: border-box;
  width: 100%;
  aspect-ratio: 1 / 1;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.45rem 0.35rem;
  text-align: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.instructora-hora-chip .ih-nombre {
  font-weight: 600;
  color: var(--text);
  font-size: 0.72rem;
  line-height: 1.2;
  max-height: 2.6em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  word-break: break-word;
  hyphens: auto;
}

.instructora-hora-chip .ih-tiempo {
  flex-shrink: 0;
  max-width: 100%;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-size: 1.014rem; /* ~30% más que 0.78rem */
  line-height: 1.15;
  font-weight: 600;
  text-align: center;
  word-break: break-word;
}

.instructoras-horas-empty {
  margin: 0;
}

.cal-below-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
}

.cal-btn-reset {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.35);
}

.cal-btn-reset:hover {
  color: #fecaca;
  border-color: #f87171;
  background: rgba(248, 113, 113, 0.08);
}

.admin-card--danger-zone {
  border-color: rgba(248, 113, 113, 0.25);
  background: rgba(248, 113, 113, 0.04);
}

.admin-card--danger-zone h2 {
  color: #f87171;
}

/* Cabecera solo al imprimir calendario */
.print-header-cal {
  display: none;
}

.print-header-cal__row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.print-header-cal__logo {
  max-height: 48px;
  max-width: 180px;
  object-fit: contain;
}

.print-header-cal__brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
}

.print-header-cal__one {
  color: var(--accent);
}

.print-header-cal__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
}

.print-header-cal__slogan {
  margin: 0.35rem 0 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.print-header-cal__sala {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

@media print {
  @page {
    margin: 12mm;
  }

  body {
    background: #fff !important;
  }

  body:not(.admin-body) {
    display: block !important;
    min-height: 0 !important;
  }

  body:not(.admin-body) > .app {
    flex: none !important;
  }

  .no-print,
  .site-nav,
  dialog,
  .cal-below-actions {
    display: none !important;
  }

  .header.header-compact {
    display: none !important;
  }

  .app-calendario .panel-left {
    display: none !important;
  }

  .app-calendario {
    display: block !important;
    min-height: 0 !important;
  }

  .print-header-cal {
    display: block !important;
    margin-bottom: 0.75rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid #ccc;
    break-inside: avoid;
  }

  .print-header-cal,
  .print-header-cal__slogan,
  .print-header-cal__sala,
  .print-header-cal__title {
    color: #111 !important;
  }

  .timeline-wrap {
    border-color: #ccc !important;
    background: #f9fafb !important;
    break-inside: auto;
  }

  .site-footer {
    break-inside: avoid;
    border-top-color: #ccc !important;
    background: #fff !important;
  }

  .site-footer-line {
    color: #555 !important;
  }

  .instructora-hora-chip {
    border-color: #ddd !important;
    background: #f3f4f6 !important;
  }

  .instructora-hora-chip .ih-nombre {
    color: #111 !important;
  }
}
