/* ==========================================================================
   MOBILE-FIRST DESIGN SYSTEM (Reserva de Aulas TIC)
   ========================================================================== */

:root {
  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  
  /* Primary Identity */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-subtle: #eff6ff;

  /* Neutrals */
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --border-subtle: #e2e8f0;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;
  
  --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sheet: 0 -4px 20px rgba(0,0,0,0.15);
  --shadow-fab: 0 4px 14px rgba(37, 99, 235, 0.38);

  --min-touch-target: 44px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.45;
  font-size: 15px;
  padding-bottom: 110px;
  overflow-x: hidden;
  max-width: 100vw;
}

.app-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  min-height: 100vh;
}

/* Appbar */
.mobile-appbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
}

.appbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.appbar-logo {
  width: 38px;
  height: 38px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  padding: 2px;
}

.appbar-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.appbar-title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.appbar-subtitle {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.appbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.view-mode-toggle {
  display: flex;
  background: var(--bg-subtle);
  padding: 3px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
}

.view-toggle-btn {
  border: none;
  background: transparent;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.view-toggle-btn.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.appbar-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.appbar-icon-btn.is-admin {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

.btn-install-subtle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-install-subtle:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: var(--text-primary);
}

.btn-install-subtle svg {
  color: var(--primary);
  flex-shrink: 0;
}

/* Barra de Filtros de Aulas (Fila 1) */
.rooms-nav-bar {
  padding: 8px 16px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
}

.rooms-scroll-nav {
  padding: 0;
  background: transparent;
  overflow-x: auto;
  scrollbar-width: none;
}

.rooms-scroll-nav::-webkit-scrollbar {
  display: none;
}

.rooms-pills-list {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: max-content;
}

.room-pill {
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.room-pill.active {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}

.room-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.room-pill-count {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.room-pill.active .room-pill-count {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* Barra de Identidad del Profesor (Fila 2 propia, amplia y sin cortes) */
.teacher-identity-strip {
  padding: 6px 16px;
  background: #f1f5f9;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.teacher-identity-strip.hidden {
  display: none !important;
}

.teacher-strip-left {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: #1e293b;
  min-width: 0;
  flex: 1;
}

.teacher-title-name {
  font-size: 0.9rem;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
}

.teacher-title-dept {
  color: #475569;
  font-weight: 500;
  white-space: nowrap;
}

.teacher-strip-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.user-chip {
  background: #e2e8f0;
  color: #334155;
  font-weight: 800;
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.btn-my-reservations {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.25);
  transition: all 0.15s ease;
}

.btn-my-reservations:hover {
  background: var(--primary-hover);
}

.btn-change-identity {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.78rem;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-change-identity:hover {
  background: #f8fafc;
  color: var(--text-primary);
}



/* Resaltado especial para reservas del profesor actual (Paleta Índigo/Violeta) */
.occupied-room-card.is-mine-reservation {
  background: #f5f3ff !important;
  border: 2px solid #6366f1 !important;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
}

.grid-card.is-mine-reservation {
  border: 2px solid #4f46e5 !important;
  box-shadow: 0 0 0 1px #4f46e5, 0 3px 8px rgba(79, 70, 229, 0.28) !important;
  position: relative;
}

.mine-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #4f46e5;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

/* Modal Mis Reservas */
.my-res-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.15s ease;
}

.my-res-card:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.my-res-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.my-res-room-tag {
  font-weight: 800;
  font-size: 0.78rem;
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 4px;
}

.my-res-date-tag {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.my-res-card-details {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.my-res-comments {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-subtle);
  padding: 4px 8px;
  border-radius: 4px;
}

.my-res-empty {
  text-align: center;
  padding: 30px 16px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* Calendar Toolbar */
.cal-nav-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
}

.cal-nav-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-nav-arrow {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  cursor: pointer;
}

.btn-today-pill {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text-primary);
  cursor: pointer;
}

.cal-title-box {
  text-align: right;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.cal-title-sub {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* Days Strip */
.days-strip-container {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 4px 16px 12px 16px;
}

.days-strip-container.hidden {
  display: none;
}

.day-chip-btn {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.day-chip-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.day-chip-name {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.8;
}

.day-chip-num {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.2;
}

.day-chip-btn.is-today:not(.active) .day-chip-num {
  color: var(--primary);
}

/* Day Timeline */
.main-schedule-area {
  padding: 0 16px 20px 16px;
}

.day-timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.period-block {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-card);
}

.period-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
}

.period-title-group {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.period-block-name {
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--text-primary);
}

.period-block-time {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.period-block-rooms {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.period-block-recreo {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  text-align: center;
  padding: 10px;
  border-radius: var(--radius-md);
  color: #64748b;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

.room-row-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
}

.room-row-badge {
  font-weight: 800;
  font-size: 0.78rem;
  padding: 3px 8px;
  border-radius: 4px;
  min-width: 50px;
  text-align: center;
  color: #ffffff;
}

.occupied-room-card {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-left: 10px;
  cursor: pointer;
}

.occupied-main-info {
  display: flex;
  flex-direction: column;
}

.occupied-group {
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--text-primary);
}

.occupied-teacher {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.occupied-right-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-free-room {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-left: 10px;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
}

.btn-free-room:hover {
  background: var(--primary-subtle);
  color: var(--primary);
}

.btn-free-room span.free-label {
  font-weight: 500;
  font-style: italic;
}

.btn-free-room span.add-action {
  font-weight: 700;
  color: var(--primary);
  background: #ffffff;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
}

/* Main schedule area y scroll fluido */
.main-schedule-area {
  flex: 1;
  width: 100%;
  padding: 8px 12px 140px 12px;
}

#scheduleContainer {
  width: 100%;
}

/* Weekly Grid */
.desktop-grid-scroll {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  box-shadow: var(--shadow-card);
  width: 100%;
}

.week-timetable-grid {
  display: grid;
  grid-template-columns: 46px repeat(5, minmax(0, 1fr));
  width: 100%;
  min-width: 0;
}

.grid-cell-header {
  background: #f8fafc;
  padding: 6px 2px;
  text-align: center;
  border-bottom: 2px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
}

.grid-cell-header.is-today {
  background: #eff6ff;
  border-top: 3px solid var(--primary);
}

.grid-period-label {
  padding: 4px 2px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-subtle);
  border-right: 2px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.grid-slot {
  padding: 3px 2px;
  border-bottom: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  min-height: 58px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: #ffffff;
}

.grid-card {
  padding: 3px 4px;
  border-radius: 4px;
  font-size: 0.70rem;
  cursor: pointer;
  border-left-width: 3px;
  border-left-style: solid;
  color: #0f172a;
}

/* Micro pastilla móvil vs Tarjeta completa PC */
.mobile-micro-card {
  display: flex;
  align-items: center;
  gap: 3px;
  font-weight: 700;
  font-size: 0.68rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.micro-room-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.micro-group {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.micro-mine-indicator {
  font-size: 0.65rem;
  margin-left: auto;
}

.desktop-full-card {
  display: none;
}

.grid-free-btn {
  margin: 0;
  padding: 1px 2px;
  min-height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.micro-add-btn {
  font-weight: 800;
  font-size: 0.8rem;
  color: var(--primary);
  opacity: 0.7;
}

/* En tablets y ordenadores (>= 768px): restaurar vista extendida amplia */
@media (min-width: 768px) {
  .week-timetable-grid {
    grid-template-columns: 110px repeat(5, minmax(170px, 1fr));
    min-width: 960px;
  }
  .grid-cell-header {
    padding: 10px;
  }
  .grid-period-label {
    padding: 10px;
    align-items: flex-start;
    text-align: left;
  }
  .grid-slot {
    padding: 6px;
    min-height: 90px;
    gap: 4px;
  }
  .grid-card {
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    border-left-width: 4px;
  }
  .mobile-micro-card {
    display: none;
  }
  .desktop-full-card {
    display: block;
  }
  .grid-free-btn {
    padding: 2px 4px;
    min-height: auto;
  }
}

/* FAB */
.fab-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 14px 22px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: var(--shadow-fab);
  cursor: pointer;
}

/* Bottom Sheet Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.modal-sheet {
  background: #ffffff;
  width: 100%;
  max-width: 580px;
  max-height: 92vh;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  overflow-y: auto;
  box-shadow: var(--shadow-sheet);
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.modal-backdrop.is-open .modal-sheet {
  transform: translateY(0);
}

.sheet-handle-bar {
  display: flex;
  justify-content: center;
  padding: 10px 0 4px 0;
}

.sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: #cbd5e1;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.sheet-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
}

.sheet-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.sheet-form {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sheet-form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sheet-form-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sheet-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.label-opt {
  font-weight: 400;
  color: var(--text-muted);
}

.sheet-input, .sheet-select {
  font-family: inherit;
  font-size: 16px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  color: var(--text-primary);
  width: 100%;
}

.sheet-input:focus, .sheet-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.sheet-room-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
}

.room-card-radio {
  position: relative;
}

.room-card-radio input[type="radio"] {
  position: absolute;
  opacity: 0;
}

.room-card-box {
  display: flex;
  flex-direction: column;
  padding: 8px 6px;
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  text-align: center;
  cursor: pointer;
}

.room-card-box strong {
  font-size: 0.85rem;
  font-weight: 800;
}

.room-card-box span {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.room-card-radio input[type="radio"]:checked + .room-card-box {
  border-color: var(--primary);
  background: var(--primary-subtle);
}

.room-card-radio.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.room-card-radio.is-disabled .room-card-box {
  background: #f1f5f9;
  border-color: #cbd5e1;
  border-style: dashed;
}

.room-card-box .occupied-tag {
  font-size: 0.62rem;
  font-weight: 700;
  color: #dc2626;
  margin-top: 2px;
}

/* Banner fijo de bloque seleccionado (+Reservar) */
.slot-fixed-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 2px;
}

.slot-fixed-icon {
  width: 28px;
  height: 28px;
  background: #eff6ff;
  color: #2563eb;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.slot-fixed-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-primary);
  line-height: 1.2;
}

.slot-fixed-sub {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 1px;
}

/* Tarjeta de profesor en modal de reserva */
.modal-teacher-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  gap: 8px;
}

.modal-teacher-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-change-teacher-link {
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  padding: 2px 4px;
  flex-shrink: 0;
  transition: opacity 0.15s ease;
}

.btn-change-teacher-link:hover {
  opacity: 0.8;
}

.admin-sheet-box {
  background: #fefce8;
  border: 1px dashed #fde047;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}

.admin-box-title {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #854d0e;
  font-size: 0.82rem;
}

.sheet-actions {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
  background: #ffffff;
}

.sheet-actions.column-on-mobile {
  flex-direction: column;
}

.btn-full-width-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.btn-row-group {
  display: flex;
  gap: 10px;
  width: 100%;
}

.btn-sheet-primary {
  flex: 1;
  background: var(--primary);
  color: #ffffff;
  border: none;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-height: var(--min-touch-target);
}

.btn-sheet-secondary {
  flex: 1;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-height: var(--min-touch-target);
}

.btn-sheet-danger {
  width: 100%;
  background: #ef4444;
  color: #ffffff;
  border: none;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--min-touch-target);
}

.btn-sheet-danger-outline {
  width: 100%;
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--min-touch-target);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-sheet-danger-outline:hover {
  background: #ffe4e6;
  border-color: #fda4af;
}

.view-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.view-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
}

.view-lbl {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.view-val {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: right;
}

/* ==========================================================================
   Admin Tabs & Management (Aulas y Profesores)
   ========================================================================== */
.admin-tabs-nav {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  background: #f8fafc;
}

.admin-tab-btn {
  flex: 1;
  padding: 12px 8px;
  background: transparent;
  border: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.admin-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: #ffffff;
}

.admin-tabs-content {
  flex: 1;
  overflow-y: auto;
}

.admin-tab-pane {
  display: none;
}

.admin-tab-pane.active {
  display: block;
}

.admin-management-box {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-top-row h4 {
  font-size: 0.92rem;
  font-weight: 800;
}

.admin-items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.teachers-scroll-list {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px;
  background: #ffffff;
}

.admin-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.admin-item-meta {
  display: flex;
  flex-direction: column;
}

.admin-item-name {
  font-weight: 700;
  font-size: 0.88rem;
}

.admin-item-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.btn-del-item {
  background: #fee2e2;
  border: none;
  color: #dc2626;
  padding: 6px 10px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.75rem;
  cursor: pointer;
}

.btn-del-item:hover {
  background: #fca5a5;
}

.add-item-card {
  background: #f1f5f9;
  border: 1px dashed #cbd5e1;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.add-item-card h5 {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-secondary);
}

.color-picker {
  padding: 2px 4px;
  height: 42px;
  cursor: pointer;
}

.search-filter-box {
  margin-bottom: 4px;
}

/* Toast */
.toast-notification {
  position: fixed;
  bottom: 84px;
  left: 16px;
  right: 16px;
  margin: 0 auto;
  max-width: 400px;
  background: #0f172a;
  color: #ffffff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.25s ease;
  z-index: 2000;
  text-align: center;
}

.toast-notification.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-notification.error { background: #dc2626; }
.toast-notification.success { background: #16a34a; }

.direct-link-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.link-copy-row {
  display: flex;
  gap: 6px;
}

.btn-copy {
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
}

.text-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

@media (min-width: 640px) {
  .sheet-form-row {
    flex-direction: row;
  }
  .flex-1 {
    flex: 1;
  }
  .modal-backdrop {
    align-items: center;
  }
  .modal-sheet {
    border-radius: var(--radius-lg);
    transform: translateY(20px) scale(0.97);
  }
  .modal-backdrop.is-open .modal-sheet {
    transform: translateY(0) scale(1);
  }
  .sheet-handle-bar {
    display: none;
  }
}

@media (max-width: 480px) {
  .teacher-identity-strip {
    padding: 6px 12px;
  }
  .teacher-strip-left {
    flex-wrap: wrap;
    gap: 4px;
  }
}
