/* ===========================================
   SIMMED Registration System – Portal UI
   Applies to both student & teacher portals
   =========================================== */

/* ---- Brand base & CSS variables ---- */

:root {
  /* Brand colors - Enhanced */
  --simmed-primary: #f85b42;
  /* More vibrant coral */
  --simmed-primary-dark: #d64a33;
  --simmed-secondary: #09a29d;
  --simmed-soft: #4b5563;
  --simmed-bg: #f8fafc;

  /* Generic text / border / accent */
  --text-dark: #111827;
  --text-grey: #667085;
  --border: #e5e7eb;
  --border-strong: #d8dde6;
  --primary: #6366f1;
  --primary-dark: #4f46e5;

  /* Generic radius / shadow - Enhanced depth */
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 4px 10px rgba(15, 23, 42, 0.03);
  --shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 18px 36px rgba(15, 23, 42, 0.08);
  --card-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
  --hover-shadow: 0 18px 34px rgba(15, 23, 42, 0.08);
  --glass: rgba(255, 255, 255, 0.96);
  --glass-border: rgba(226, 232, 240, 0.95);
  --surface: #ffffff;
  --surface-muted: #f8fafc;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
}

/* ---- Portal container ---- */

.sim-portal {
  max-width: 1140px;
  margin: var(--space-5) auto calc(var(--space-5) * 1.5);
  padding: calc(var(--space-4) + 0.2rem);
  border-radius: 20px;
  background:
    radial-gradient(circle at top right, rgba(248, 91, 66, 0.08) 0%, transparent 40%),
    radial-gradient(circle at bottom left, rgba(99, 102, 241, 0.06) 0%, transparent 40%),
    var(--surface);
  box-shadow: var(--shadow-lg);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-dark);
}

.sim-has-welcome-splash {
  overflow: hidden;
}

.sim-welcome-splash {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: grid;
  place-items: center;
  padding: 2rem;
  overflow: hidden;
  text-align: center;
  color: #ffffff;
  background:
    radial-gradient(circle at 18% 18%, rgba(255,255,255,0.16), transparent 24%),
    radial-gradient(circle at 82% 24%, rgba(255,255,255,0.1), transparent 30%),
    linear-gradient(135deg, #f85b42 0%, #0f766e 38%, #2563eb 68%, #6d28d9 100%);
  animation: sim-welcome-bg 11.45s linear forwards;
}

.sim-welcome-splash.is-leaving {
  animation: sim-welcome-fade 0.45s ease forwards;
}

.sim-welcome-splash-inner {
  width: min(100%, 860px);
  max-height: calc(100vh - 4rem);
  display: grid;
  gap: clamp(0.75rem, 1.3vh, 1.05rem);
  justify-items: center;
  align-content: center;
  padding: clamp(0.75rem, 2.2vh, 1.5rem) clamp(0.35rem, 2vw, 1rem);
}

.sim-welcome-title-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: min(90vw, 620px);
  min-height: clamp(7.25rem, 17vh, 9.4rem);
  margin-bottom: 0.35rem;
  transform: translateY(0.95rem);
  perspective: 1200px;
  isolation: isolate;
}

.sim-welcome-title-stage::before {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: min(92vw, 560px);
  aspect-ratio: 1;
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.92) 0, rgba(255, 255, 255, 0.3) 12%, rgba(147, 197, 253, 0.28) 24%, rgba(96, 165, 250, 0.18) 38%, rgba(96, 165, 250, 0) 68%);
  transform: translate(-50%, -50%) scale(0.24);
  opacity: 0;
  filter: blur(22px);
  animation: sim-welcome-title-aura 2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: none;
}

.sim-welcome-title-stage::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: min(96vw, 720px);
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.94), transparent);
  transform: translate(-50%, -50%) rotate(-7deg) scaleX(0.18);
  opacity: 0;
  filter: blur(1.4px);
  animation: sim-welcome-title-flare 1.15s cubic-bezier(0.22, 1, 0.36, 1) forwards 0.2s;
  pointer-events: none;
}

.sim-welcome-title-ring {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 100%;
  transform-style: preserve-3d;
  animation: sim-welcome-title-ring 2.05s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.sim-welcome-title-ring > span {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  font-size: clamp(1.4rem, 5.2vw, 3.35rem);
  line-height: 0.9;
  font-weight: 900;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.09);
  text-shadow:
    0 18px 34px rgba(0, 0, 0, 0.24),
    0 0 14px rgba(255, 255, 255, 0.06);
  transform:
    translate(-50%, -50%)
    rotateX(calc(var(--i) * 30deg))
    translateZ(108px);
  filter: blur(0.4px);
  text-transform: uppercase;
  white-space: nowrap;
  will-change: transform, opacity;
}

.sim-welcome-title-core {
  position: relative;
  z-index: 2;
  display: inline-block;
  font-size: clamp(3rem, 10.2vw, 6.7rem);
  line-height: 0.9;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: transparent;
  background: linear-gradient(180deg, #ffffff 0%, #ffffff 38%, #edf6ff 68%, #bfdbfe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow:
    0 22px 44px rgba(0, 0, 0, 0.32),
    0 0 22px rgba(255, 255, 255, 0.14);
  opacity: 0;
  transform: scale(0.72) translateY(1.2rem);
  animation: sim-welcome-title-core 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.1s;
  will-change: transform, opacity, filter;
}

.sim-welcome-title-core::before {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  z-index: -1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.38);
  text-shadow:
    0 0 18px rgba(255, 255, 255, 0.28),
    0 0 42px rgba(96, 165, 250, 0.24);
  opacity: 0;
  transform: scale(0.88);
  filter: blur(8px);
  animation: sim-welcome-title-core-echo 1.25s ease-out forwards 0.08s;
  pointer-events: none;
}

.sim-welcome-title-core::after {
  content: "";
  position: absolute;
  inset: -16% -10%;
  z-index: 3;
  background: linear-gradient(108deg, transparent 28%, rgba(255, 255, 255, 0.96) 48%, rgba(255, 255, 255, 0.34) 55%, transparent 72%);
  opacity: 0;
  transform: translateX(-84%) skewX(-18deg);
  filter: blur(2px);
  mix-blend-mode: screen;
  animation: sim-welcome-title-sheen 0.92s ease-out forwards 0.95s;
  pointer-events: none;
}

.sim-welcome-splash-eyebrow {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(0.8rem);
  animation: sim-welcome-copy-in 0.7s ease forwards 1.7s;
}

.sim-welcome-splash-title {
  margin: 0;
  max-width: min(100%, 12ch);
  font-size: clamp(1.45rem, 3.2vw, 2.7rem);
  line-height: 0.98;
  font-weight: 800;
  letter-spacing: -0.04em;
  opacity: 0;
  transform: translateY(1rem);
  animation: sim-welcome-copy-in 0.8s ease forwards 1.95s;
  text-wrap: balance;
}

.sim-welcome-splash-tagline {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  width: min(100%, 30rem);
  min-height: 4rem;
  margin-top: 0.45rem;
  opacity: 0;
  transform: translateY(1rem);
  animation: sim-welcome-copy-in 0.8s ease forwards 2.15s;
}

.sim-welcome-splash-copy-label {
  margin: 0;
  font-size: clamp(0.95rem, 1.6vw, 1.2rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.88;
}

.sim-welcome-dropping-texts {
  position: relative;
  display: inline-block;
  width: min(90vw, 520px);
  height: 1.35em;
  text-align: center;
  vertical-align: top;
  font-size: clamp(1.2rem, 2.5vw, 2.05rem);
  line-height: 1.15;
}

.sim-welcome-dropping-texts > span {
  position: absolute;
  top: 0;
  left: 50%;
  width: 100%;
  font-size: inherit;
  opacity: 0;
  font-weight: 700;
  white-space: nowrap;
  transform: translateX(-50%) translateY(-0.85rem) rotate(-10deg);
  text-shadow: 0 28px 40px rgba(0, 0, 0, 0.22);
}

.sim-welcome-dropping-texts > span:nth-child(1) {
  animation: sim-welcome-segment 3s ease forwards 2s;
}

.sim-welcome-dropping-texts > span:nth-child(2) {
  animation: sim-welcome-segment 2s ease forwards 5s;
}

.sim-welcome-dropping-texts > span:nth-child(3) {
  animation: sim-welcome-segment 2s ease forwards 7s;
}

.sim-welcome-dropping-texts > span:nth-child(4) {
  animation: sim-welcome-segment-hold 2s ease forwards 9s;
}

.sim-welcome-splash-logos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1.4rem;
}

.sim-welcome-splash-brand-block {
  display: grid;
  justify-items: center;
  gap: 1rem;
  width: min(100%, 460px);
  margin-top: 0.95rem;
  padding-top: 1.15rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  opacity: 0;
  transform: translateY(1rem);
  animation: sim-welcome-copy-in 0.8s ease forwards 2.45s;
}

.sim-welcome-splash-eyebrow,
.sim-welcome-splash-title,
.sim-welcome-splash-copy-label,
.sim-welcome-splash-brand-block {
  position: relative;
  isolation: isolate;
}

.sim-welcome-splash-eyebrow::after,
.sim-welcome-splash-title::after,
.sim-welcome-splash-copy-label::after,
.sim-welcome-splash-brand-block::after {
  content: "";
  position: absolute;
  inset: -0.8rem -1rem;
  background:
    radial-gradient(circle at 10% 35%, rgba(255, 255, 255, 0.95) 0 1.1px, transparent 1.9px),
    radial-gradient(circle at 20% 72%, rgba(191, 219, 254, 0.84) 0 1px, transparent 1.8px),
    radial-gradient(circle at 34% 16%, rgba(255, 255, 255, 0.78) 0 1.15px, transparent 1.95px),
    radial-gradient(circle at 51% 82%, rgba(255, 255, 255, 0.88) 0 1.2px, transparent 2px),
    radial-gradient(circle at 66% 24%, rgba(147, 197, 253, 0.76) 0 1px, transparent 1.85px),
    radial-gradient(circle at 79% 68%, rgba(255, 255, 255, 0.94) 0 1.1px, transparent 1.9px),
    radial-gradient(circle at 92% 38%, rgba(255, 255, 255, 0.72) 0 0.95px, transparent 1.7px);
  opacity: 0;
  transform: scale(0.5) translateY(0);
  filter: blur(0.4px);
  pointer-events: none;
}

.sim-welcome-splash.is-finale .sim-welcome-splash-eyebrow,
.sim-welcome-splash.is-finale .sim-welcome-splash-title,
.sim-welcome-splash.is-finale .sim-welcome-splash-copy-label,
.sim-welcome-splash.is-finale .sim-welcome-splash-brand-block {
  animation: sim-welcome-stardust-collapse 1.25s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.sim-welcome-splash.is-finale .sim-welcome-dropping-texts > span:not(:last-child) {
  opacity: 0 !important;
  animation: none !important;
}

.sim-welcome-splash.is-finale .sim-welcome-dropping-texts > span:last-child {
  animation: sim-welcome-stardust-collapse 1s cubic-bezier(0.22, 1, 0.36, 1) forwards !important;
}

.sim-welcome-splash.is-finale .sim-welcome-splash-eyebrow::after,
.sim-welcome-splash.is-finale .sim-welcome-splash-title::after,
.sim-welcome-splash.is-finale .sim-welcome-splash-copy-label::after,
.sim-welcome-splash.is-finale .sim-welcome-splash-brand-block::after {
  animation: sim-welcome-dust-burst 1.15s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.sim-welcome-splash.is-finale .sim-welcome-title-stage::before {
  animation: sim-welcome-aura-fall 1.2s ease-in forwards;
}

.sim-welcome-splash.is-finale .sim-welcome-title-stage::after {
  animation: sim-welcome-flare-fall 0.95s ease-in forwards;
}

.sim-welcome-splash.is-finale .sim-welcome-title-ring > span {
  animation: sim-welcome-ring-dust 0.95s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--i) * 0.028s);
}

.sim-welcome-splash.is-finale .sim-welcome-title-core {
  animation: sim-welcome-core-dust 1.18s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.sim-welcome-splash.is-finale .sim-welcome-title-core::before {
  animation: sim-welcome-core-echo-dust 1.1s ease-out forwards;
}

.sim-welcome-splash.is-finale .sim-welcome-title-core::after {
  animation: sim-welcome-title-sheen-out 0.95s ease-out forwards;
}

.sim-welcome-splash-logo-frame {
  display: grid;
  place-items: center;
  width: clamp(94px, 11vw, 112px);
  height: clamp(72px, 8vw, 88px);
  padding: 0;
}

.sim-welcome-splash-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: none;
}

.sim-welcome-splash-logo-brand {
  transform: scale(0.76);
}

.sim-welcome-splash-org-name {
  margin: 0;
  max-width: 28rem;
  font-size: clamp(0.8rem, 1.08vw, 0.92rem);
  line-height: 1.42;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-align: center;
  text-wrap: balance;
  opacity: 0.82;
}

@keyframes sim-welcome-segment {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-0.85rem) rotate(-10deg) scale(0.92);
  }
  18% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) rotate(0deg) scale(1);
  }
  64% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) rotate(0deg) scale(1);
  }
  82% {
    opacity: 0;
    transform: translateX(-50%) translateY(0.8rem) rotate(8deg) scale(1.02);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(0.8rem) rotate(8deg) scale(1.02);
  }
}

@keyframes sim-welcome-segment-hold {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-0.85rem) rotate(-10deg) scale(0.92);
  }
  18% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) rotate(0deg) scale(1);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) rotate(0deg) scale(1);
  }
}

@keyframes sim-welcome-title-ring {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotateX(-102deg) rotateZ(-18deg) scale(0.38);
  }
  18% {
    opacity: 0.92;
  }
  46% {
    opacity: 0.42;
    transform: translate(-50%, -50%) rotateX(318deg) rotateZ(-12deg) scale(1.16);
  }
  74% {
    opacity: 0.18;
    transform: translate(-50%, -54%) rotateX(392deg) rotateZ(-8deg) scale(0.96);
  }
  100% {
    opacity: 0.06;
    transform: translate(-50%, -58%) rotateX(430deg) rotateZ(-4deg) scale(0.84);
  }
}

@keyframes sim-welcome-title-core {
  0% {
    opacity: 0;
    transform: perspective(900px) rotateX(-72deg) scale(0.26) translateY(1.7rem);
    filter: blur(18px);
    letter-spacing: 0.34em;
  }
  18% {
    opacity: 1;
  }
  44% {
    opacity: 1;
    transform: perspective(900px) rotateX(0deg) scale(1.12) translateY(-0.14rem);
    filter: blur(0);
    letter-spacing: 0.16em;
  }
  68% {
    opacity: 1;
    transform: perspective(900px) rotateX(0deg) scale(0.97) translateY(0.05rem);
    filter: blur(0);
    letter-spacing: 0.14em;
  }
  100% {
    opacity: 1;
    transform: perspective(900px) rotateX(0deg) scale(1) translateY(0);
    filter: blur(0);
    letter-spacing: 0.14em;
  }
}

@keyframes sim-welcome-title-aura {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.16);
    filter: blur(30px);
  }
  24% {
    opacity: 0.95;
  }
  55% {
    opacity: 0.42;
    transform: translate(-50%, -49%) scale(1.08);
    filter: blur(20px);
  }
  100% {
    opacity: 0.16;
    transform: translate(-50%, -52%) scale(1.24);
    filter: blur(24px);
  }
}

@keyframes sim-welcome-title-flare {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-7deg) scaleX(0.14) scaleY(0.32);
  }
  24% {
    opacity: 1;
  }
  66% {
    opacity: 0.32;
    transform: translate(-50%, -50%) rotate(-7deg) scaleX(1.16) scaleY(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-7deg) scaleX(1.42) scaleY(1.3);
  }
}

@keyframes sim-welcome-title-core-echo {
  0% {
    opacity: 0;
    transform: scale(0.7);
    filter: blur(18px);
  }
  36% {
    opacity: 0.78;
  }
  100% {
    opacity: 0;
    transform: scale(1.18);
    filter: blur(12px);
  }
}

@keyframes sim-welcome-title-sheen {
  0% {
    opacity: 0;
    transform: translateX(-84%) skewX(-18deg);
  }
  30% {
    opacity: 0.92;
  }
  100% {
    opacity: 0;
    transform: translateX(86%) skewX(-18deg);
  }
}

@keyframes sim-welcome-stardust-collapse {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
  28% {
    opacity: 0.95;
    transform: translateY(0.15rem) scale(1.02);
  }
  100% {
    opacity: 0;
    transform: translateY(2rem) scale(0.84) rotate(4deg);
    filter: blur(10px);
  }
}

@keyframes sim-welcome-dust-burst {
  0% {
    opacity: 0;
    transform: scale(0.45) translateY(0);
    filter: blur(0.4px);
  }
  22% {
    opacity: 0.95;
  }
  100% {
    opacity: 0;
    transform: scale(1.5) translateY(1.2rem);
    filter: blur(1.1px);
  }
}

@keyframes sim-welcome-aura-fall {
  0% {
    opacity: 0.16;
    transform: translate(-50%, -52%) scale(1.24);
    filter: blur(24px);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -18%) scale(0.72);
    filter: blur(34px);
  }
}

@keyframes sim-welcome-flare-fall {
  0% {
    opacity: 0.3;
    transform: translate(-50%, -50%) rotate(-7deg) scaleX(0.8) scaleY(0.9);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, 120%) rotate(6deg) scaleX(0.24) scaleY(0.42);
  }
}

@keyframes sim-welcome-ring-dust {
  0% {
    opacity: 0.08;
    transform:
      translate(-50%, -50%)
      rotateX(calc(var(--i) * 30deg))
      translateZ(108px)
      scale(1);
    filter: blur(0.4px);
  }
  100% {
    opacity: 0;
    transform:
      translate(-50%, 150%)
      rotateX(calc(var(--i) * 30deg))
      translateZ(8px)
      scale(0.22);
    filter: blur(2px);
  }
}

@keyframes sim-welcome-core-dust {
  0% {
    opacity: 1;
    transform: perspective(900px) rotateX(0deg) scale(1) translateY(0);
    filter: blur(0);
    letter-spacing: 0.14em;
  }
  100% {
    opacity: 0;
    transform: perspective(900px) rotateX(18deg) scale(0.64) translateY(2rem);
    filter: blur(12px);
    letter-spacing: 0.24em;
  }
}

@keyframes sim-welcome-core-echo-dust {
  0% {
    opacity: 0.32;
    transform: scale(1);
    filter: blur(8px);
  }
  100% {
    opacity: 0;
    transform: scale(1.42);
    filter: blur(18px);
  }
}

@keyframes sim-welcome-title-sheen-out {
  0% {
    opacity: 0.4;
    transform: translateX(0%) skewX(-18deg);
  }
  100% {
    opacity: 0;
    transform: translateX(96%) skewX(-18deg);
  }
}

@keyframes sim-welcome-copy-in {
  0% {
    opacity: 0;
    transform: translateY(1rem);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sim-welcome-bg {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(28deg); }
}

@keyframes sim-welcome-fade {
  from { opacity: 1; }
  to {
    opacity: 0;
    visibility: hidden;
  }
}

/* Root layout wrapper inside portal */
.sim-portal-root {
  width: 100%;
  margin-inline: auto;
  max-width: 1200px;
}

.sim-portal-app {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: calc(var(--space-3) + var(--space-1)) var(--space-4);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

@media (max-width: 768px) {
  .sim-portal-app {
    padding: var(--space-3);
  }
}

/* Top heading + subtle header bar */

.sim-portal h2 {
  font-size: 2rem;
  margin: 0 0 var(--space-2);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.sim-portal>h2 {
  padding-bottom: var(--space-2);
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.sim-portal h3 {
  font-size: 1.1rem;
  margin: 0 0 0.6rem;
  font-weight: 600;
}

.sim-portal-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 var(--space-1) 0;
}

.sim-portal-subtitle,
.sim-portal-meta {
  margin: 0;
  font-size: 0.9rem;
  color: #6b7280;
}

.sim-small-note {
  font-size: 0.8rem;
  color: #6b7280;
}

.sim-muted {
  color: #9ca3af;
  font-size: 0.8rem;
}

/* Header layout */

.sim-portal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.sim-portal-header-auth {
  justify-content: center;
  text-align: center;
}

@media (max-width: 600px) {
  .sim-portal-header {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ---- Layout (2-column app feel – legacy panels) ---- */

.sim-student-layout,
.sim-teacher-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr);
  gap: 1.6rem;
  margin-top: 1rem;
}

@media (max-width: 960px) {

  .sim-student-layout,
  .sim-teacher-layout {
    grid-template-columns: 1fr;
    gap: 1.1rem;
  }
}

/* ---- Panels / Cards ---- */

.sim-card,
.sim-student-panel,
.sim-teacher-panel {
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  padding: calc(var(--space-3) + 0.1rem);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.sim-card:hover,
.sim-student-panel:hover,
.sim-teacher-panel:hover {
  box-shadow: var(--hover-shadow);
  transform: translateY(-2px);
}

.sim-student-panel+.sim-student-panel,
.sim-teacher-panel+.sim-teacher-panel {
  margin-top: var(--space-2);
}

/* Panel headers small line */

.sim-student-panel h3,
.sim-teacher-panel h3 {
  padding-bottom: 0.3rem;
  border-bottom: 1px solid rgba(229, 231, 235, 0.9);
}

/* ---- Tables ---- */

.sim-student-table,
.sim-teacher-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 0.3rem;
}

.sim-student-table th,
.sim-student-table td,
.sim-teacher-table th,
.sim-teacher-table td {
  border: 1px solid #e5e7eb;
  padding: 0.55rem 0.65rem;
  text-align: left;
  vertical-align: top;
  word-break: break-word;
}

.sim-student-table th,
.sim-teacher-table th {
  background: #f8fafc;
  font-weight: 600;
  color: #344054;
  font-size: 0.8rem;
}

/* Zebra rows */

.sim-student-table tbody tr:nth-child(odd),
.sim-teacher-table tbody tr:nth-child(odd) {
  background: #f9fafb;
}

/* Tighten header cells on compact screens */

@media (max-width: 768px) {

  .sim-student-table,
  .sim-teacher-table,
  .sim-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .sim-student-table th,
  .sim-teacher-table th {
    font-size: 0.78rem;
  }
}

/* Generic table styling (teacher dashboard etc.) */

.sim-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.sim-table th,
.sim-table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--border);
  word-break: break-word;
}

.sim-table th {
  text-align: left;
  font-weight: 600;
  background: #f8fafc;
  color: var(--text-dark);
}

.sim-table tbody tr:nth-child(odd) {
  background: #fcfcfd;
}

.sim-table tbody tr:hover {
  background: #f1f5ff;
}

.sim-table-compact th,
.sim-table-compact td {
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
}

/* ---- Buttons & links ---- */

.sim-portal button,
.sim-portal input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.5rem 1.05rem;
  border-radius: 9999px;
  border: 1px solid transparent;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, var(--simmed-primary), var(--simmed-primary-dark));
  color: #ffffff;
  transition:
    background 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.2s ease;
}

.sim-portal button:hover,
.sim-portal input[type="submit"]:hover {
  background: linear-gradient(135deg, var(--simmed-primary-dark), #e53e3e);
  border-color: rgba(248, 91, 66, 0.4);
  box-shadow: 0 8px 20px rgba(248, 91, 66, 0.3);
  transform: translateY(-2px);
}

.sim-portal button:active,
.sim-portal input[type="submit"]:active {
  transform: translateY(1px);
  box-shadow: none;
}

.sim-portal button:focus-visible,
.sim-portal input[type="submit"]:focus-visible,
.sim-portal .sim-btn:focus-visible,
.sim-portal a:focus-visible,
.sim-portal input:focus-visible,
.sim-portal select:focus-visible,
.sim-portal textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18);
}

@media (prefers-reduced-motion: reduce) {

  .sim-portal *,
  .sim-portal *::before,
  .sim-portal *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .sim-welcome-splash,
  .sim-welcome-dropping-texts > span {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}


/* Generic button classes (used in PHP) */

.sim-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.45rem 0.95rem;
  min-height: 2rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  background: #f3f4f6;
  color: #111827;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

.sim-btn:hover {
  background: #d1d5db;
  transform: translateY(-0.5px);
}

.sim-btn-primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border-color: #4f46e5;
  color: #ffffff;
}

.sim-btn-primary:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  border-color: #4338ca;
}

.sim-btn-secondary {
  background: #ffffff;
  border-color: #d1d5db;
  color: #111827;
}

.sim-btn-secondary:hover {
  background: #f3f4f6;
}

/* Ghost variant (used for calendar Prev/Next) */
.sim-btn-ghost {
  background: transparent;
  border-color: #d1d5db;
  color: #374151;
}

.sim-btn-ghost:hover {
  background: #e5e7eb;
}

.sim-btn-ghost-small {
  background: transparent;
  border-color: #d1d5db;
  color: #374151;
  font-size: 0.78rem;
  padding: 0.25rem 0.6rem;
  min-height: 1.75rem;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.sim-btn-ghost-small:hover {
  background: #e5e7eb;
}

/* Danger actions */

.sim-portal .btn-danger,
.sim-portal button[style*="b91c1c"],
.sim-portal button[style*="#b91c1c"],
.sim-portal a[style*="b91c1c"] {
  background: #fee2e2 !important;
  color: #b91c1c !important;
  border-color: #fecaca !important;
}

.sim-portal .btn-danger:hover {
  background: #fecaca !important;
  box-shadow: 0 6px 16px rgba(185, 28, 28, 0.2);
  transform: translateY(-1px);
}

/* Danger-style button class */

.sim-btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius);
  border: 1px solid #fecaca;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.sim-btn-danger:hover {
  background: #dc2626;
  border-color: #b91c1c;
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.3);
  transform: translateY(-2px);
}

.sim-btn-danger:active {
  transform: translateY(1px);
  box-shadow: none;
}

/* Text links */

.sim-portal a {
  color: var(--simmed-secondary);
  text-decoration: none;
}

.sim-portal a:hover {
  text-decoration: underline;
}

/* Logout button margin */
.sim-portal>form[method="post"] {
  margin: 0.3rem 0 0.9rem;
}

/* Logout & small utility buttons inside forms */
.sim-portal form[method="post"]>button {
  margin-top: 0.25rem;
}

/* ---- Form fields ---- */

.sim-portal input,
.sim-portal select,
.sim-portal textarea {
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  font-size: 0.86rem;
  line-height: 1.3;
  background: var(--surface-muted);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    background 0.2s ease;
}

.sim-portal input:focus,
.sim-portal select:focus,
.sim-portal textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
  background: #ffffff;
}

.sim-portal input[type="text"],
.sim-portal input[type="email"],
.sim-portal input[type="password"],
.sim-portal input[type="number"],
.sim-portal input[type="date"],
.sim-portal input[type="time"],
.sim-portal select,
.sim-portal textarea {
  width: 100%;
  max-width: 340px;
}

@media (max-width: 768px) {

  .sim-portal input[type="text"],
  .sim-portal input[type="email"],
  .sim-portal input[type="password"],
  .sim-portal input[type="number"],
  .sim-portal input[type="date"],
  .sim-portal input[type="time"],
  .sim-portal select,
  .sim-portal textarea {
    max-width: 100%;
  }
}

.sim-portal textarea {
  max-width: 100%;
}


/* Label spacing */

.sim-portal label {
  font-size: 0.82rem;
  color: #374151;
}

.sim-form-label {
  font-weight: 600;
}

.sim-form-grid-2 label,
.sim-form-grid-3 label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* Forms – vertical layout helpers */

.sim-form-row {
  margin-bottom: 0.75rem;
}

.sim-form-row:last-child {
  margin-bottom: 0;
}

.sim-form-help {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.75rem;
  color: var(--text-grey);
}

.sim-form-vertical label {
  display: block;
  font-size: 0.82rem;
  color: #374151;
  margin-bottom: 0.35rem;
}

.sim-form-vertical textarea {
  resize: vertical;
}

.sim-form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.sim-form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

@media (max-width: 768px) {

  .sim-form-grid-2,
  .sim-form-grid-3 {
    grid-template-columns: 1fr;
  }
}

.sim-checkbox-inline {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.4rem;
}

/* ---- Messages (success/error) ---- */

.sim-message {
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  font-size: 0.85rem;
  margin-bottom: 0.8rem;
  border: 1px solid transparent;
  box-shadow: var(--shadow-sm);
  animation: sim-slide-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.sim-toast-stack {
  position: fixed;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: min(450px, 92vw);
}

.sim-toast {
  margin-bottom: 0;
  border-radius: var(--radius);
  padding: 0.8rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  transform-origin: top center;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sim-toast-hidden {
  opacity: 0;
  transform: translateY(-20px) scale(0.95);
  pointer-events: none;
}

@keyframes sim-slide-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sim-message-success,
.sim-portal .sim-message-success {
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  color: #166534;
  border-left: 4px solid #22c55e;
}

.sim-message-error,
.sim-portal .sim-message-error {
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #991b1b;
  border-left: 4px solid #ef4444;
}

/* Map existing inline color usage to nice boxes */

.sim-portal div[style*="color:#15803d"],
.sim-portal div[style*="color: #15803d"] {
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  background: #ecfdf3;
  border: 1px solid #bbf7d0;
  color: #166534 !important;
  margin-bottom: 0.8rem;
  font-size: 0.85rem;
}

.sim-portal div[style*="color:#b91c1c"],
.sim-portal div[style*="color: #b91c1c"] {
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c !important;
  margin-bottom: 0.8rem;
  font-size: 0.85rem;
}

/* Utility text */

.sim-text-danger {
  color: #b91c1c;
}

/* Make section dividers gentle */
.sim-portal hr,
.sim-section-divider {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 0.8rem 0;
}

/* ---- STUDENT PORTAL – tabs & panels ---- */

.sim-student-tabs {
  margin-bottom: 0.8rem;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.sim-student-tab-btn {
  border: none;
  background: transparent;
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  cursor: pointer;
  border-radius: 999px;
  color: #475467;
  border: 1px solid transparent;
}

.sim-student-tab-btn:hover {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.sim-student-tab-btn-active {
  background: linear-gradient(135deg, var(--simmed-primary), var(--simmed-primary-dark));
  color: #ffffff;
  border-color: var(--simmed-primary-dark);
  box-shadow: 0 4px 12px rgba(248, 91, 66, 0.2);
}

.sim-student-tab {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sim-student-tab.active {
  opacity: 1;
}

/* Student panel (overrides generic one if needed) */
.sim-student-panel {
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  padding: 0.8rem 0.85rem;
}

/* ---- Auth tabs (login/register switch) ---- */

.sim-auth-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.sim-auth-shell .sim-portal-subtitle {
  max-width: 520px;
}

.sim-auth-hero {
  width: min(520px, 100%);
  padding: 1.25rem;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background:
    radial-gradient(circle at var(--auth-glow-x, 30%) var(--auth-glow-y, 20%), rgba(147, 197, 253, 0.28), transparent 52%),
    linear-gradient(140deg, rgba(255, 255, 255, 0.96), rgba(219, 234, 254, 0.9));
  box-shadow:
    0 18px 40px rgba(15, 23, 42, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  position: relative;
  overflow: hidden;
  transform:
    perspective(900px) rotateX(var(--auth-tilt-x, 0deg)) rotateY(var(--auth-tilt-y, 0deg));
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sim-auth-hero::before,
.sim-auth-hero::after {
  content: "";
  position: absolute;
  inset: -30%;
  background: radial-gradient(circle, rgba(147, 197, 253, 0.2), transparent 60%);
  opacity: 0.6;
  pointer-events: none;
  transform: translate3d(0, 0, 0);
  animation: sim-auth-glow 12s ease-in-out infinite;
}

.sim-auth-hero::after {
  background: radial-gradient(circle, rgba(186, 230, 253, 0.35), transparent 55%);
  animation-delay: -6s;
}

.sim-auth-orb {
  position: absolute;
  width: var(--orb-size, 120px);
  height: var(--orb-size, 120px);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.85), rgba(147, 197, 253, 0.35), transparent 70%);
  opacity: 0.55;
  filter: blur(1px);
  mix-blend-mode: screen;
  animation: sim-auth-orb 14s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.sim-auth-tabs,
.sim-auth-forms {
  position: relative;
  z-index: 1;
}

.sim-auth-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  justify-content: center;
}

.sim-auth-tab-button {
  padding: 0.4rem 0.8rem;
  border-radius: 10px 10px 0 0;
  border: 1px solid #d1d5db;
  border-bottom: none;
  background: #f8fafc;
  cursor: pointer;
  font-size: 0.86rem;
  color: #475467;
  transition:
    color 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease;
}

.sim-auth-tab-button-active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(14, 165, 233, 0.18));
  font-weight: 600;
  color: #1e3a8a;
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 10px 18px rgba(59, 130, 246, 0.18);
  position: relative;
}

.sim-auth-tab-button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.sim-auth-support-panel {
  margin-top: 1.5rem;
  padding-top: 1.15rem;
  border-top: 1px solid rgba(148, 163, 184, 0.28);
}

.sim-auth-support-panel h4 {
  margin: 0 0 0.4rem;
  font-size: 0.98rem;
  color: var(--text-dark);
}

.sim-auth-form {
  width: min(460px, 100%);
  margin: 0 auto;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 16px;
  padding: 1.4rem;
  background: #ffffff;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
}

.sim-auth-form form {
  display: grid;
  gap: 0.7rem;
}

.sim-auth-form .sim-form-row {
  margin: 0;
}

.sim-teacher-auth-shell {
  width: 100%;
}

.sim-teacher-auth-shell .sim-lang-switcher-auth {
  display: inline-flex;
  margin: 0.9rem auto 0;
}

.sim-teacher-auth-hero {
  width: min(560px, 100%);
}

.sim-teacher-auth-form {
  width: min(440px, 100%);
}

.sim-teacher-auth-form h3 {
  margin-bottom: 0.35rem;
}

.sim-teacher-auth-note {
  margin: 0 0 1rem 0;
  font-size: 0.88rem;
  color: #5b6b83;
}

.sim-teacher-auth-note-secondary {
  margin: 0.85rem 0 0 0;
  color: #667085;
}

@keyframes sim-auth-glow {
  0% {
    transform: translate3d(-12%, -8%, 0);
  }

  50% {
    transform: translate3d(8%, 12%, 0);
  }

  100% {
    transform: translate3d(-12%, -8%, 0);
  }
}

@keyframes sim-auth-orb {
  0% {
    transform: translate3d(-15%, -10%, 0) scale(1);
  }

  50% {
    transform: translate3d(15%, 10%, 0) scale(1.05);
  }

  100% {
    transform: translate3d(-15%, -10%, 0) scale(1);
  }
}

/* ---- Student calendar ---- */

/* Toolbar above calendar */
.sim-calendar-toolbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.sim-calendar-month-label {
  font-size: 0.95rem;
  font-weight: 600;
}

/* Make date legend nice */
.sim-calendar-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

/* Main calendar container */
.sim-student-calendar {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  /* 🔹 horizontal scroll on mobile */
  display: block;
}

/* If .sim-student-calendar wraps a table, style that table. */
.sim-student-calendar table {
  width: 100%;
  min-width: 640px;
  /* 🔹 keeps columns readable */
  border-collapse: collapse;
  table-layout: fixed;
}

.sim-student-calendar th {
  background: #f8fafc;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #4b5563;
  padding: 0.65rem 0.6rem;
  vertical-align: top;
}

.sim-student-calendar td {
  font-size: 0.8rem;
  padding: 0.5rem;
  vertical-align: top;
  height: 140px;
  box-sizing: border-box;
}

.sim-calendar-cell {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Pills inside calendar (registered/waitlisted) */

.sim-calendar-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 1.6rem;
  margin-bottom: 0.35rem;
}

.sim-calendar-day-number,
.sim-calendar-date-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4rem;
  height: 1.4rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.sim-calendar-date-label {
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.sim-calendar-no-events {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  font-size: 0.75rem;
  color: #9ca3af;
}

.sim-calendar-day-events {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-right: 0.25rem;
  /* space for scrollbar */
}

/* Custom scrollbar for day events for premium feel */
.sim-calendar-day-events::-webkit-scrollbar {
  width: 4px;
}

.sim-calendar-day-events::-webkit-scrollbar-track {
  background: transparent;
}

.sim-calendar-day-events::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.sim-calendar-day-events::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.sim-calendar-pill {
  width: 100%;
  max-width: 100%;
  display: flex;
  appearance: none;
  -webkit-appearance: none;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0.3rem 0.5rem;
  border-radius: 12px;
  border: 1px solid transparent;
  border-left: 4px solid #d1d5db;
  font-size: 0.74rem;
  cursor: pointer;
  background: #eef2f7;
  color: var(--text-dark);
  text-align: left;
  font: inherit;
  position: relative;
  box-sizing: border-box;
  transition:
    background 0.2s ease,
    transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.2s ease;
}

.sim-calendar-pill:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
  z-index: 10;
}

.sim-calendar-pill-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
}

.sim-calendar-pill-title {
  font-weight: 600;
  color: var(--text-dark);
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: break-word;
}

.sim-calendar-pill-time {
  font-size: 0.7rem;
  color: var(--text-grey);
  white-space: normal;
  word-break: break-word;
}

.sim-calendar-pill-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 0;
}

.sim-calendar-pill-badge {
  font-size: 0.68rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--text-dark);
}

.sim-calendar-pill-badge-muted {
  background: rgba(148, 163, 184, 0.25);
  color: #4b5563;
}

.sim-calendar-pill-note {
  font-size: 0.64rem;
  font-weight: 700;
  color: #4b5563;
}

/* Status colors */

.sim-calendar-pill-status-registered {
  background: #dcfce7;
  border-color: #bbf7d0;
  border-left-color: #22c55e;
}

.sim-calendar-pill-status-registered .sim-calendar-pill-badge {
  background: rgba(22, 163, 74, 0.15);
  color: #166534;
}

.sim-calendar-pill-status-waitlisted {
  background: #fef3c7;
  border-color: #fde68a;
  border-left-color: #f59e0b;
}

.sim-calendar-pill-status-waitlisted .sim-calendar-pill-badge {
  background: rgba(217, 119, 6, 0.18);
  color: #92400e;
}

.sim-calendar-pill-status-none {
  background: #e5e7eb;
  border-color: #d1d5db;
}

.sim-calendar-pill-full {
  background: #e5e7eb;
  border-color: #cbd5e1;
  border-left-color: #94a3b8;
  color: #1f2937;
}

.sim-calendar-pill-full .sim-calendar-pill-badge {
  background: rgba(100, 116, 139, 0.14);
  color: #334155;
}

.sim-calendar-pill-full .sim-calendar-pill-note {
  color: #475569;
  font-weight: 700;
}

.sim-calendar-pill-teacher {
  align-items: flex-start;
  gap: 0.45rem;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  border-left-width: 4px;
  text-align: left;
}

.sim-calendar-pill-teacher:hover {
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

.sim-calendar-pill-teacher .sim-calendar-pill-main {
  gap: 0.15rem;
}

.sim-calendar-pill-teacher .sim-calendar-pill-title {
  font-size: 0.76rem;
  line-height: 1.25;
}

.sim-calendar-pill-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.32rem;
  color: #b45309;
  font-weight: 800;
  line-height: 1;
}

.sim-calendar-pill-teacher .sim-calendar-pill-time {
  font-size: 0.66rem;
  color: #64748b;
}

.sim-calendar-pill-teacher .sim-calendar-pill-meta {
  width: 100%;
  justify-content: space-between;
}

.sim-calendar-pill-teacher .sim-calendar-pill-badge {
  padding: 0.14rem 0.46rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
}

@media (max-width: 780px) {
  .sim-calendar-toolbar .sim-calendar-month-label,
  .sim-calendar-toolbar .sim-month-label {
    color: var(--text-dark);
  }
}

/* Legend pills */

.sim-legend-pill {
  display: inline-block;
  width: 16px;
  height: 8px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.sim-legend-pill-registered {
  background: #dcfce7;
  border-color: #bbf7d0;
}

.sim-legend-pill-waitlisted {
  background: #fef3c7;
  border-color: #fde68a;
}

.sim-legend-pill-none {
  background: #e5e7eb;
  border-color: #d1d5db;
}

.sim-legend-pill-full {
  background: #e5e7eb;
  border-color: #94a3b8;
}

/* 🔹 Mobile calendar tweaks */

@media (max-width: 640px) {
  .sim-student-calendar td {
    font-size: 0.78rem;
    padding: 0.3rem;
    min-height: auto;
  }

  .sim-calendar-pill {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
  }

  .sim-calendar-pill-meta {
    align-self: flex-start;
  }

  .sim-calendar-toolbar {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .sim-calendar-toolbar .sim-btn {
    width: 100%;
    justify-content: center;
  }

  .sim-portal {
    margin: 1.5rem 0 2rem;
    padding: 1rem 0.9rem;
    border-radius: 0;
    box-shadow: none;
    background: #f9fafb;
  }

  .sim-student-panel,
  .sim-teacher-panel {
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
  }
}

/* ---- Event modal ---- */

.sim-event-modal[aria-hidden="true"] {
  display: none;
}

.sim-event-modal.sim-modal-fading-out .sim-event-modal-backdrop {
  opacity: 0;
}

.sim-event-modal.sim-modal-fading-out .sim-event-modal-dialog {
  opacity: 0;
  transform: scale(0.95) translateY(10px);
}

/* Mobile-only list views */

.sim-mobile-only {
  display: none;
}

.sim-desktop-only {
  display: block;
}

@media (max-width: 700px) {
  .sim-welcome-splash {
    padding: 1.35rem;
  }

  .sim-welcome-splash-inner {
    max-height: calc(100vh - 2.7rem);
    gap: 0.7rem;
    padding: 0.45rem 0.15rem;
  }

  .sim-welcome-title-stage {
    width: min(90vw, 420px);
    min-height: 7rem;
    margin-bottom: 0.05rem;
  }

  .sim-welcome-title-ring > span {
    letter-spacing: 0.14em;
    transform:
      translate(-50%, -50%)
      rotateX(calc(var(--i) * 30deg))
      translateZ(86px);
  }

  .sim-welcome-title-core {
    letter-spacing: 0.1em;
  }

  .sim-welcome-splash-eyebrow {
    letter-spacing: 0.16em;
    font-size: 0.72rem;
  }

  .sim-welcome-splash-title {
    max-width: 11ch;
    font-size: clamp(1.55rem, 8vw, 2.45rem);
  }

  .sim-welcome-splash-tagline {
    width: min(100%, 17rem);
    min-height: 3.5rem;
    margin-top: 0.25rem;
  }

  .sim-welcome-dropping-texts {
    width: min(84vw, 260px);
    font-size: clamp(1rem, 5vw, 1.32rem);
    text-align: center;
  }

  .sim-welcome-dropping-texts > span {
    transform-origin: center;
    white-space: normal;
  }

  .sim-welcome-splash-brand-block {
    width: min(100%, 300px);
    gap: 1.2rem;
    margin-top: 0.6rem;
    padding-top: 0.8rem;
  }

  .sim-welcome-splash-logos {
    gap: 0.75rem;
  }

  .sim-welcome-splash-logo-frame {
    width: min(94px, 25vw);
    height: min(70px, 18vw);
  }

  .sim-welcome-splash-org-name {
    max-width: 17rem;
    font-size: 0.8rem;
    line-height: 1.35;
  }

  .sim-mobile-only {
    display: block;
  }

  .sim-desktop-only {
    display: none;
  }

  .sim-stack-mobile-table thead {
    display: none;
  }

  .sim-stack-mobile-table,
  .sim-stack-mobile-table tbody,
  .sim-stack-mobile-table tr,
  .sim-stack-mobile-table td {
    display: block;
    width: 100%;
  }

  .sim-stack-mobile-table {
    overflow: visible;
  }

  .sim-stack-mobile-table tbody {
    display: grid;
    gap: 0.85rem;
  }

  .sim-stack-mobile-table tr {
    padding: 0.9rem 0.95rem;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  }

  .sim-stack-mobile-table td {
    border: 0;
    padding: 0.28rem 0;
  }

  .sim-stack-mobile-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.12rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #64748b;
  }

  .sim-stack-mobile-table td[colspan] {
    padding: 0;
  }

  .sim-stack-mobile-table td[colspan]::before {
    display: none;
  }
}

.sim-mobile-event-list {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.6rem;
}

.sim-mobile-event-card {
  display: flex;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
  appearance: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.sim-mobile-event-card-full {
  background: #e5e7eb;
  border-color: #cbd5e1;
  box-shadow: none;
}

.sim-mobile-event-card:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.45);
  outline-offset: 2px;
}

.sim-message-event-pill-mobile {
  width: 100%;
  align-items: center;
  border-radius: 14px;
}

.sim-message-event-pill-mobile .sim-message-event-checkbox {
  margin-top: 0;
}

.sim-mobile-event-date {
  min-width: 86px;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-weight: 600;
}

.sim-mobile-event-day {
  font-size: 0.9rem;
  color: var(--text-dark);
}

.sim-mobile-event-time {
  font-size: 0.75rem;
  color: var(--text-grey);
}

.sim-mobile-event-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sim-mobile-event-title {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-dark);
}

.sim-mobile-event-meta {
  font-size: 0.75rem;
  color: var(--text-grey);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.sim-mobile-event-meta .sim-link-small {
  margin-left: auto;
}

.sim-calendar-toolbar .sim-section-header-title {
  justify-self: center;
  text-align: center;
}

/* Student-only calendar redesign */
.sim-portal-student .sim-teacher-section-calendar .sim-section-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 28px;
  background:
    radial-gradient(circle at top left, rgba(14, 165, 233, 0.14), transparent 30%),
    radial-gradient(circle at top right, rgba(99, 102, 241, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
  box-shadow:
    0 24px 56px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.sim-portal-student .sim-teacher-section-calendar .sim-section-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.5), transparent 42%),
    repeating-linear-gradient(
      135deg,
      rgba(148, 163, 184, 0.045) 0,
      rgba(148, 163, 184, 0.045) 1px,
      transparent 1px,
      transparent 18px
    );
  pointer-events: none;
}

.sim-portal-student .sim-teacher-section-calendar .sim-section-header-row,
.sim-portal-student .sim-teacher-section-calendar .sim-calendar-legend,
.sim-portal-student .sim-teacher-section-calendar .sim-student-calendar,
.sim-portal-student .sim-teacher-section-calendar .sim-mobile-only {
  position: relative;
  z-index: 1;
}

.sim-portal-student .sim-teacher-section-calendar .sim-section-header-row {
  margin-bottom: 1rem;
}

.sim-portal-student .sim-teacher-section-calendar .sim-section-header-controls {
  gap: 0.9rem;
}

.sim-portal-student .sim-teacher-section-calendar .sim-calendar-month-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  padding: 0.8rem 1.25rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #0f172a;
}

.sim-portal-student .sim-teacher-section-calendar .sim-calendar-legend {
  margin: 0 0 1.15rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  color: #475569;
}

.sim-portal-student .sim-teacher-section-calendar .sim-student-calendar {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow:
    0 16px 40px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(12px);
}

.sim-portal-student .sim-teacher-section-calendar .sim-student-calendar table {
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
}

.sim-portal-student .sim-teacher-section-calendar .sim-student-calendar th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0.95rem 0.75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.92));
  color: #334155;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
}

.sim-portal-student .sim-teacher-section-calendar .sim-student-calendar td {
  height: 176px;
  padding: 0.55rem;
  border-right: 1px solid rgba(226, 232, 240, 0.78);
  border-bottom: 1px solid rgba(226, 232, 240, 0.82);
  background: rgba(255, 255, 255, 0.46);
}

.sim-portal-student .sim-teacher-section-calendar .sim-student-calendar tr:last-child td {
  border-bottom: none;
}

.sim-portal-student .sim-teacher-section-calendar .sim-student-calendar td:last-child,
.sim-portal-student .sim-teacher-section-calendar .sim-student-calendar th:last-child {
  border-right: none;
}

.sim-portal-student .sim-teacher-section-calendar .sim-calendar-empty {
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.82), rgba(241, 245, 249, 0.72));
}

.sim-portal-student .sim-teacher-section-calendar .sim-calendar-day {
  position: relative;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.sim-portal-student .sim-teacher-section-calendar .sim-calendar-today {
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.96), rgba(248, 250, 252, 0.96));
  box-shadow:
    inset 0 0 0 1px rgba(59, 130, 246, 0.16),
    0 14px 30px rgba(59, 130, 246, 0.12);
}

.sim-portal-student .sim-teacher-section-calendar .sim-calendar-day-header {
  margin-bottom: 0.6rem;
}

.sim-portal-student .sim-teacher-section-calendar .sim-calendar-day-number {
  min-width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.14);
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
}

.sim-portal-student .sim-teacher-section-calendar .sim-calendar-today-pill {
  padding: 0.28rem 0.72rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.24);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffffff;
}

.sim-portal-student .sim-teacher-section-calendar .sim-calendar-day-events {
  gap: 0.5rem;
  padding-right: 0.15rem;
}

.sim-portal-student .sim-teacher-section-calendar .sim-calendar-pill {
  position: relative;
  overflow: hidden;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.7rem 0.82rem;
  border: 1px solid color-mix(in srgb, var(--sim-event-color, #4f46e5) 20%, rgba(15, 23, 42, 0.06)) !important;
  border-left: 1px solid color-mix(in srgb, var(--sim-event-color, #4f46e5) 20%, rgba(15, 23, 42, 0.06)) !important;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), color-mix(in srgb, var(--sim-event-color, #4f46e5) 12%, white)) !important;
  box-shadow:
    0 10px 24px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.sim-portal-student .sim-teacher-section-calendar .sim-calendar-pill::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, var(--sim-event-color, #4f46e5), color-mix(in srgb, var(--sim-event-color, #4f46e5) 50%, #ffffff));
}

.sim-portal-student .sim-teacher-section-calendar .sim-calendar-pill::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 17px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.3), transparent 45%);
  pointer-events: none;
}

.sim-portal-student .sim-teacher-section-calendar .sim-calendar-pill:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--sim-event-color, #4f46e5) 42%, rgba(37, 99, 235, 0.18)) !important;
  box-shadow:
    0 18px 36px color-mix(in srgb, var(--sim-event-color, #4f46e5) 20%, transparent),
    0 10px 24px rgba(15, 23, 42, 0.1);
}

.sim-portal-student .sim-teacher-section-calendar .sim-calendar-pill:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--sim-event-color, #4f46e5) 56%, rgba(37, 99, 235, 0.32)) !important;
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--sim-event-color, #4f46e5) 18%, transparent),
    0 16px 32px rgba(15, 23, 42, 0.12);
}

.sim-portal-student .sim-teacher-section-calendar .sim-calendar-pill-title {
  position: relative;
  z-index: 1;
  font-size: 0.79rem;
  font-weight: 700;
  line-height: 1.35;
  color: #0f172a;
}

.sim-portal-student .sim-teacher-section-calendar .sim-calendar-pill-time {
  position: relative;
  z-index: 1;
  font-size: 0.67rem;
  color: #475569;
}

.sim-portal-student .sim-teacher-section-calendar .sim-calendar-pill-meta {
  position: relative;
  z-index: 1;
  width: 100%;
  justify-content: space-between;
  gap: 0.45rem;
}

.sim-portal-student .sim-teacher-section-calendar .sim-calendar-pill-badge {
  padding: 0.22rem 0.56rem;
  border: 1px solid color-mix(in srgb, var(--sim-event-color, #4f46e5) 16%, rgba(148, 163, 184, 0.28));
  background: color-mix(in srgb, var(--sim-event-color, #4f46e5) 14%, rgba(255, 255, 255, 0.84));
  font-size: 0.65rem;
  font-weight: 700;
  color: #0f172a;
}

.sim-portal-student .sim-teacher-section-calendar .sim-calendar-pill-status-registered {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), color-mix(in srgb, var(--sim-event-color, #10b981) 14%, #ecfdf5)) !important;
}

.sim-portal-student .sim-teacher-section-calendar .sim-calendar-pill-status-registered .sim-calendar-pill-badge {
  border-color: rgba(34, 197, 94, 0.2);
  background: rgba(34, 197, 94, 0.14);
  color: #166534;
}

.sim-portal-student .sim-teacher-section-calendar .sim-calendar-pill-status-waitlisted {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), color-mix(in srgb, var(--sim-event-color, #f59e0b) 16%, #fff7ed)) !important;
}

.sim-portal-student .sim-teacher-section-calendar .sim-calendar-pill-status-waitlisted .sim-calendar-pill-badge {
  border-color: rgba(245, 158, 11, 0.2);
  background: rgba(245, 158, 11, 0.14);
  color: #9a3412;
}

.sim-portal-student .sim-teacher-section-calendar .sim-calendar-pill-status-none {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), color-mix(in srgb, var(--sim-event-color, #6366f1) 10%, #f8fafc)) !important;
}

.sim-portal-student .sim-teacher-section-calendar .sim-calendar-pill-full {
  border-color: rgba(148, 163, 184, 0.34) !important;
  border-left: 1px solid rgba(148, 163, 184, 0.34) !important;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), #e5e7eb) !important;
  box-shadow:
    0 10px 24px rgba(15, 23, 42, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.sim-portal-student .sim-teacher-section-calendar .sim-calendar-pill-full::before {
  background: linear-gradient(180deg, #94a3b8, #cbd5e1);
}

.sim-portal-student .sim-teacher-section-calendar .sim-calendar-pill-full:hover {
  border-color: rgba(148, 163, 184, 0.5) !important;
  box-shadow:
    0 16px 28px rgba(100, 116, 139, 0.14),
    0 8px 18px rgba(15, 23, 42, 0.08);
}

.sim-portal-student .sim-teacher-section-calendar .sim-calendar-pill-full:focus-visible {
  border-color: rgba(100, 116, 139, 0.56) !important;
  box-shadow:
    0 0 0 4px rgba(148, 163, 184, 0.18),
    0 16px 30px rgba(15, 23, 42, 0.1);
}

.sim-portal-student .sim-teacher-section-calendar .sim-calendar-pill-full .sim-calendar-pill-badge {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(226, 232, 240, 0.88);
  color: #334155;
}

.sim-portal-student .sim-teacher-section-calendar .sim-calendar-pill-full .sim-calendar-pill-note,
.sim-portal-student .sim-teacher-section-calendar .sim-calendar-pill-full .sim-calendar-pill-time {
  color: #475569;
}

.sim-portal-student .sim-teacher-section-calendar .sim-calendar-pill-full .sim-link-small {
  color: #475569;
}

.sim-portal-student .sim-teacher-section-calendar .sim-link-small {
  color: color-mix(in srgb, var(--sim-event-color, #4f46e5) 78%, #0f172a);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sim-portal-student .sim-teacher-section-calendar .sim-mobile-event-card {
  position: relative;
  overflow: hidden;
  gap: 0.95rem;
  padding: 0.95rem;
  border: 1px solid color-mix(in srgb, var(--sim-event-color, #4f46e5) 18%, rgba(148, 163, 184, 0.24)) !important;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), color-mix(in srgb, var(--sim-event-color, #4f46e5) 10%, #ffffff)) !important;
  box-shadow:
    0 18px 34px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.sim-portal-student .sim-teacher-section-calendar .sim-mobile-event-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: linear-gradient(180deg, var(--sim-event-color, #4f46e5), color-mix(in srgb, var(--sim-event-color, #4f46e5) 48%, #ffffff));
}

.sim-portal-student .sim-teacher-section-calendar .sim-mobile-event-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 24px 42px color-mix(in srgb, var(--sim-event-color, #4f46e5) 16%, transparent),
    0 14px 28px rgba(15, 23, 42, 0.1);
}

.sim-portal-student .sim-teacher-section-calendar .sim-mobile-event-card:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--sim-event-color, #4f46e5) 56%, rgba(37, 99, 235, 0.32)) !important;
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--sim-event-color, #4f46e5) 18%, transparent),
    0 20px 36px rgba(15, 23, 42, 0.12);
}

.sim-portal-student .sim-teacher-section-calendar .sim-mobile-event-card-full {
  border-color: rgba(148, 163, 184, 0.34) !important;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), #e5e7eb) !important;
  box-shadow:
    0 14px 28px rgba(15, 23, 42, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.sim-portal-student .sim-teacher-section-calendar .sim-mobile-event-card-full::before {
  background: linear-gradient(180deg, #94a3b8, #cbd5e1);
}

.sim-portal-student .sim-teacher-section-calendar .sim-mobile-event-card-full:hover {
  box-shadow:
    0 20px 34px rgba(100, 116, 139, 0.14),
    0 10px 20px rgba(15, 23, 42, 0.08);
}

.sim-portal-student .sim-teacher-section-calendar .sim-mobile-event-card-full:focus-visible {
  border-color: rgba(100, 116, 139, 0.56) !important;
  box-shadow:
    0 0 0 4px rgba(148, 163, 184, 0.18),
    0 18px 30px rgba(15, 23, 42, 0.1);
}

.sim-portal-student .sim-teacher-section-calendar .sim-mobile-event-date {
  min-width: 92px;
  padding: 0.1rem 0.15rem 0.1rem 0.35rem;
}

.sim-portal-student .sim-teacher-section-calendar .sim-mobile-event-day {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.sim-portal-student .sim-teacher-section-calendar .sim-mobile-event-time {
  color: #475569;
}

.sim-portal-student .sim-teacher-section-calendar .sim-mobile-event-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
}

.sim-portal-student .sim-teacher-section-calendar .sim-mobile-event-meta {
  color: #526173;
}

@media (max-width: 640px) {
  .sim-portal-student .sim-teacher-section-calendar .sim-section-card {
    border-radius: 24px;
  }

  .sim-portal-student .sim-teacher-section-calendar .sim-calendar-month-label {
    min-width: 0;
    width: 100%;
  }

  .sim-portal-student .sim-teacher-section-calendar .sim-mobile-event-card {
    border-radius: 18px;
  }
}

.sim-calendar-toolbar .sim-section-header-controls:first-child {
  justify-content: flex-start;
}

.sim-calendar-toolbar .sim-section-header-controls:last-child {
  justify-content: flex-end;
}

.sim-teacher-section-calendar .sim-section-header-controls {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  flex: 1;
  width: 100%;
}

.sim-teacher-section-calendar .sim-section-header-controls .sim-month-label {
  justify-self: center;
}

/* Info panels & checklists */

.sim-info-panel {
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-size: 0.83rem;
  margin-top: 0.6rem;
}

.sim-info-panel::before {
  content: "ℹ️";
  font-size: 0.95rem;
  line-height: 1;
  margin-top: 0.1rem;
}

.sim-checklist {
  list-style: none;
  padding: 0;
  margin: 0.4rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  font-size: 0.75rem;
  color: var(--text-grey);
}

.sim-checklist li {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.sim-checklist li::before {
  content: "✓";
  color: #10b981;
  font-weight: 700;
}

.sim-calendar-checklist {
  display: none;
  margin-top: 0.25rem;
}

@media (max-width: 700px) {
  .sim-calendar-checklist {
    display: flex;
  }
}

.sim-event-modal[aria-hidden="false"] {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  /* vertical center */
  justify-content: center;
  /* horizontal center */
  padding: 1rem;
  /* ensures margin auto doesn't hit absolute screen edges on small devices */
}

.sim-event-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  /* slightly darker for better contrast */
  backdrop-filter: blur(8px);
  /* increased blur for stronger glass effect */
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 0.3s ease;
}

.sim-event-modal-dialog {
  position: relative;
  z-index: 1;
  /* perfectly trimmed width ratio based on screen size, capped at a sensible max */
  width: clamp(320px, 92vw, 600px);
  max-width: 100%;
  max-height: 90vh;
  margin: 0;
  /* Removed margin: auto so flex container perfectly centers without scrollbar jumping */
  border-radius: 24px;
  /* strongly rounded frames as requested */
  background: var(--surface);
  padding: 2rem 2.2rem;
  box-shadow:
    0 25px 50px -12px rgba(15, 23, 42, 0.25),
    0 10px 15px -3px rgba(15, 23, 42, 0.1),
    inset 0 0 0 1px rgba(255, 255, 255, 0.75);
  overflow: auto;
  border: 1px solid var(--glass-border);
  animation: sim-modal-pop 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.sim-teacher-event-modal-dialog {
  width: clamp(360px, 95vw, 980px);
}

@keyframes sim-modal-pop {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* 🔹 Visible focus for accessibility */
.sim-event-modal-dialog:focus {
  outline: 2px solid var(--simmed-primary);
  outline-offset: 4px;
}

.sim-event-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.sim-event-modal-title {
  font-size: 1.15rem;
  /* slightly larger */
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-dark);
  margin: 0;
}

.sim-event-modal-close {
  border: none;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-grey);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.sim-event-modal-close:hover {
  color: var(--text-dark);
  background-color: #f1f5f9;
  transform: scale(1.05);
  /* subtle pop on hover */
}

.sim-event-modal-body {
  font-size: 0.88rem;
  color: var(--text-dark);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sim-event-modal-datetime,
.sim-event-modal-location {
  font-weight: 500;
}

.sim-event-modal-location {
  color: var(--text-grey);
}

.sim-event-modal-description {
  margin-top: 0.25rem;
  color: var(--text-grey);
}

.sim-event-modal-description-label {
  margin-top: 0.7rem;
  margin-bottom: 0.1rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
}

.sim-event-modal-spots {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--text-grey);
}

.sim-event-modal-form {
  margin-top: 0.6rem;
  display: flex;
  justify-content: flex-end;
}

body.sim-modal-open {
  overflow: hidden;
}

/* ---- TEACHER DASHBOARD – layout & cards ---- */

.sim-teacher-shell {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (max-width: 900px) {
  .sim-teacher-shell {
    gap: 0.75rem;
  }
}

/* Sidebar */
.sim-teacher-sidebar {
  position: relative;
  z-index: 5;
  background: linear-gradient(145deg, #172033, #0f172a 72%);
  color: #e5e7eb;
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.3rem 1rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.95rem;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sim-teacher-sidebar-header {
  margin-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  width: auto;
  flex: 0 0 auto;
  position: relative;
  z-index: 20;
  padding-bottom: 0;
  border-bottom: none;
}

.sim-teacher-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  min-width: 0;
}

.sim-teacher-sidebar-logo {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  padding: 0.32rem;
  flex: 0 0 auto;
}

.sim-teacher-sidebar-heading {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.sim-teacher-sidebar-title {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #dde7ff;
  line-height: 1.35;
  max-width: 48rem;
}

.sim-teacher-sidebar-subtitle {
  font-size: 0.8rem;
  color: rgba(226, 232, 240, 0.68);
}

.sim-teacher-nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0;
  flex-wrap: nowrap;
  min-width: 0;
  overflow: visible;
  scrollbar-width: none;
}

.sim-teacher-nav::-webkit-scrollbar {
  display: none;
}

.sim-student-shell .sim-teacher-nav {
  justify-content: flex-start;
  width: auto;
}

.sim-teacher-sidebar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: nowrap;
  margin-left: 0;
  flex: 0 0 auto;
}

.sim-teacher-logout-form {
  margin: 0;
}

.sim-teacher-sidebar-actions form {
  margin: 0;
  display: flex;
}

.sim-teacher-sidebar-actions form > .sim-teacher-nav-link {
  margin-top: 0;
}

.sim-help-modal .sim-report-inline-note {
  display: inline-flex;
  flex-direction: column;
  gap: 0.15rem;
  align-items: flex-start;
}

.sim-help-modal .sim-report-inline-note a {
  word-break: break-word;
}

.sim-policy-card,
.sim-settings-group-card,
.sim-manage-cancelled-block {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 1rem 1.05rem;
  background: #f8fafc;
}

.sim-policy-card {
  margin-top: 0.85rem;
}

.sim-policy-card-head {
  margin-bottom: 0.7rem;
}

.sim-policy-checkbox {
  min-height: 44px;
  align-items: center;
}

.sim-settings-grid {
  align-items: start;
}

.sim-settings-group-stack {
  display: grid;
  gap: 1rem;
}

.sim-settings-group-card {
  display: grid;
  gap: 0.75rem;
}

.sim-settings-group-title {
  margin: 0 0 0.25rem;
  font-size: 0.96rem;
}

.sim-settings-group-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sim-settings-group-meta {
  display: grid;
  gap: 0.45rem;
}

.sim-settings-recipient-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.sim-settings-recipient-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #ffffff;
  color: var(--text-dark);
  font-size: 0.8rem;
  line-height: 1;
}

.sim-settings-group-delete {
  margin-top: -0.45rem;
}

.sim-settings-template-manager {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-soft);
  display: grid;
  gap: 1rem;
}

.sim-settings-template-variable-box,
.sim-settings-template-card,
.sim-settings-template-language-card {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: #f8fafc;
}

.sim-settings-template-variable-box,
.sim-settings-template-card {
  padding: 1rem 1.05rem;
}

.sim-settings-variable-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.sim-settings-variable-disclosure summary {
  list-style: none;
}

.sim-settings-variable-disclosure summary::-webkit-details-marker {
  display: none;
}

.sim-settings-variable-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
}

.sim-settings-variable-summary > span {
  display: grid;
  gap: 0.2rem;
}

.sim-settings-variable-summary::after {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #ffffff;
  color: var(--text-dark);
  font-weight: 700;
  flex-shrink: 0;
}

.sim-settings-variable-disclosure[open] .sim-settings-variable-summary::after {
  content: "-";
}

.sim-settings-template-disclosure {
  padding-bottom: 1rem;
}

.sim-settings-template-summary {
  padding-bottom: 0.15rem;
}

.sim-settings-template-disclosure .sim-settings-template-language-grid,
.sim-settings-template-disclosure .sim-settings-template-actions {
  margin-top: 1rem;
}

.sim-settings-variable-item {
  display: grid;
  gap: 0.35rem;
  padding: 0.8rem;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.sim-settings-variable-item code {
  font-size: 0.82rem;
}

.sim-settings-template-stack {
  display: grid;
  gap: 1rem;
}

.sim-settings-template-card {
  display: grid;
  gap: 1rem;
}

.sim-settings-template-language-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.sim-settings-template-language-card {
  padding: 0.95rem;
  display: grid;
  gap: 0.8rem;
}

.sim-settings-template-language-title {
  margin: 0;
  font-size: 0.92rem;
}

.sim-settings-template-field {
  display: grid;
  gap: 0.35rem;
}

.sim-settings-template-field textarea {
  min-height: 240px;
  resize: vertical;
}

.sim-settings-template-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
  padding-top: 0.35rem;
}

.sim-settings-template-card-actions {
  margin-top: 0.2rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.sim-settings-signature-box .sim-settings-template-actions {
  margin-top: 0.85rem;
  padding-top: 0.6rem;
}

.sim-manage-participant-note {
  margin-top: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.78rem;
  color: var(--text-grey);
}

.sim-manage-cancelled-block {
  margin-top: 1rem;
}

.sim-student-event-modal-late {
  margin-top: 0.85rem;
  padding: 1rem 1.1rem;
  border-radius: 16px;
  border: 1px solid rgba(248, 91, 66, 0.14);
  background: linear-gradient(180deg, rgba(248, 91, 66, 0.08), rgba(255, 255, 255, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.sim-student-event-modal-late-title {
  margin: 0 0 0.3rem;
  font-size: 0.95rem;
}

.sim-student-event-modal-late-copy,
.sim-student-event-modal-late-message {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-grey);
}

.sim-student-event-modal-late-message {
  margin-top: 0.45rem;
  color: var(--text-dark);
  font-weight: 600;
}

.sim-student-event-modal-reason {
  width: 100%;
}

.sim-student-event-modal-reason textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
}

.sim-form-error-message {
  margin: 0.55rem 0 0;
  color: #b42318;
  font-size: 0.84rem;
  font-weight: 600;
}

.sim-student-late-cancel-dialog {
  max-width: 680px;
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sim-student-late-cancel-header {
  align-items: flex-start;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.sim-student-late-cancel-eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--simmed-primary-dark);
}

.sim-student-late-cancel-body {
  display: grid;
  gap: 1.15rem;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.2rem;
  max-height: calc(90vh - 6.5rem);
}

.sim-student-late-cancel-body::-webkit-scrollbar {
  width: 10px;
}

.sim-student-late-cancel-body::-webkit-scrollbar-track {
  background: transparent;
}

.sim-student-late-cancel-body::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.55);
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.9);
}

.sim-student-late-cancel-body::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.72);
}

.sim-student-late-cancel-summary {
  display: grid;
  gap: 0.65rem;
  padding: 1.1rem 1.15rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(255, 255, 255, 1));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.sim-student-late-cancel-label {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--text-grey);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sim-student-late-cancel-title {
  display: block;
  font-size: 1.06rem;
  line-height: 1.35;
}

.sim-student-late-cancel-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  color: var(--text-grey);
  font-size: 0.88rem;
}

.sim-student-late-cancel-panel {
  display: grid;
  gap: 0.65rem;
  padding: 1rem 1.1rem;
  border-radius: 18px;
  border: 1px solid rgba(248, 91, 66, 0.16);
  background: linear-gradient(180deg, rgba(248, 91, 66, 0.07), rgba(255, 255, 255, 0.99));
}

.sim-student-late-cancel-copy,
.sim-student-late-cancel-note {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
}

.sim-student-late-cancel-note {
  color: var(--text-dark);
  font-weight: 600;
}

.sim-student-late-cancel-form {
  display: grid;
  gap: 0.9rem;
  padding: 1.1rem 1.15rem 1rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.sim-student-late-cancel-field textarea {
  width: 100%;
  min-height: 160px;
  resize: vertical;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 16px;
  background: #fbfdff;
  font: inherit;
  color: var(--text-dark);
}

.sim-student-late-cancel-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  align-items: center;
  padding-top: 0.3rem;
}

.sim-student-late-cancel-actions .sim-btn {
  min-width: 180px;
  min-height: 2.75rem;
  padding: 0.75rem 1.2rem;
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: 700;
}

.sim-student-late-cancel-actions [data-late-cancel-back] {
  border-color: rgba(148, 163, 184, 0.35);
  background: #ffffff;
  color: var(--text-dark);
}

.sim-student-late-cancel-actions [data-late-cancel-back]:hover {
  background: #f8fafc;
  border-color: rgba(148, 163, 184, 0.55);
}

.sim-student-late-cancel-actions [data-late-cancel-submit] {
  border-color: #dc2626;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(220, 38, 38, 0.18);
}

.sim-student-late-cancel-actions [data-late-cancel-submit]:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  border-color: #b91c1c;
  box-shadow: 0 16px 30px rgba(185, 28, 28, 0.22);
}

.sim-student-late-cancel-actions [data-late-cancel-submit]:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.sim-manage-message-card,
.sim-message-compose-card,
.sim-message-selection-panel,
.sim-message-footer-card {
  display: grid;
  gap: 0.9rem;
  padding: 1.1rem 1.15rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.sim-message-section-head {
  margin-bottom: 0.75rem;
}

.sim-manage-message-head,
.sim-message-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.sim-manage-message-form,
.sim-message-workspace,
.sim-message-compose-card,
.sim-message-footer-card {
  display: grid;
  gap: 1rem;
}

.sim-message-workspace {
  gap: 0.9rem;
}

.sim-message-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: start;
}

.sim-message-compose-panel {
  order: 1;
}

.sim-message-selection-panel {
  order: 2;
}

.sim-message-footer-card {
  order: 3;
}

.sim-message-compose-card textarea {
  min-height: 8.5rem;
  resize: vertical;
}

.sim-message-week-toolbar {
  align-items: center;
  padding-bottom: 0.15rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.sim-message-week-controls {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.sim-message-week-range {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.05);
  border: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
}

.sim-message-calendar-wrapper {
  overflow-x: auto;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
  padding: 0.35rem;
}

.sim-teacher-section-messaging .sim-calendar-table.sim-teacher-calendar {
  width: 100%;
  min-width: 960px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.sim-teacher-section-messaging .sim-calendar-table.sim-teacher-calendar thead th {
  padding: 0.85rem 0.7rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(226, 232, 240, 0.38);
  color: #334155;
  font-size: 0.84rem;
  font-weight: 800;
  text-align: left;
}

.sim-teacher-section-messaging .sim-calendar-table.sim-teacher-calendar td {
  width: 14.2857%;
  padding: 0;
  vertical-align: top;
  border-right: 1px solid rgba(15, 23, 42, 0.06);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(255, 255, 255, 0.94);
}

.sim-teacher-section-messaging .sim-calendar-table.sim-teacher-calendar td:last-child,
.sim-teacher-section-messaging .sim-calendar-table.sim-teacher-calendar th:last-child {
  border-right: none;
}

.sim-message-calendar-day-frame {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  min-height: 12rem;
  padding: 0.8rem;
}

.sim-message-calendar-day-frame.is-padding {
  background: rgba(248, 250, 252, 0.72);
}

.sim-message-day-counter {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: #475569;
  font-size: 0.72rem;
  font-weight: 700;
}

.sim-message-week-list {
  display: grid;
  gap: 0.85rem;
}

.sim-message-week-card {
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.04);
}

.sim-message-week-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.sim-message-week-head h5 {
  margin: 0;
  font-size: 1rem;
}

.sim-message-week-events {
  display: grid;
  gap: 0.6rem;
}

.sim-message-calendar-day {
  vertical-align: top;
}

.sim-message-day-events {
  display: grid;
  gap: 0.45rem;
  align-content: start;
}

.sim-message-day-empty {
  margin: 0;
  padding: 0.85rem 0.9rem;
  border: 1px dashed rgba(148, 163, 184, 0.45);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.9);
  color: #64748b;
  font-size: 0.8rem;
}

.sim-message-event-pill {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.9rem 0.95rem;
  border: 1px solid color-mix(in srgb, var(--sim-event-color, #4f46e5) 28%, rgba(15, 23, 42, 0.08));
  border-radius: 16px;
  background: color-mix(in srgb, var(--sim-event-color, #4f46e5) 12%, white);
  cursor: pointer;
  align-items: flex-start;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.sim-message-event-pill:hover {
  border-color: color-mix(in srgb, var(--sim-event-color, #4f46e5) 46%, rgba(99, 102, 241, 0.32));
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.sim-message-event-pill-title,
.sim-message-event-pill-time,
.sim-message-event-pill-tags {
  overflow-wrap: anywhere;
}

.sim-message-event-pill.is-selected {
  border-color: color-mix(in srgb, var(--sim-event-color, #4f46e5) 72%, rgba(79, 70, 229, 0.6));
  box-shadow: 0 12px 24px color-mix(in srgb, var(--sim-event-color, #4f46e5) 24%, transparent);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--sim-event-color, #4f46e5) 18%, white),
    color-mix(in srgb, var(--sim-event-color, #4f46e5) 10%, white)
  );
}

.sim-message-event-checkbox {
  position: relative;
  inset: auto;
  opacity: 1;
  cursor: pointer;
  width: 1.05rem;
  height: 1.05rem;
  margin: 0.2rem 0 0;
  accent-color: var(--sim-event-color, #4f46e5);
  z-index: 1;
}

.sim-message-event-pill-content {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.sim-message-event-pill-main,
.sim-message-event-pill-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.6rem;
  align-items: flex-start;
}

.sim-message-event-pill-title {
  font-weight: 700;
  color: var(--text-dark);
  min-width: 0;
}

.sim-message-event-pill-time,
.sim-message-event-pill-meta {
  font-size: 0.78rem;
  color: var(--text-grey);
}

.sim-message-event-pill-time {
  white-space: normal;
  overflow-wrap: anywhere;
}

.sim-message-event-pill-meta span:first-child {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.sim-message-event-pill-tags {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: #475569;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.2;
}

.sim-message-selection-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.sim-message-selection-stat {
  display: grid;
  gap: 0.2rem;
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #ffffff;
}

.sim-message-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.sim-message-selection-label {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-grey);
  font-weight: 700;
}

.sim-message-selected-events {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  min-height: 2rem;
}

.sim-message-field {
  display: grid;
  gap: 0.4rem;
}

.sim-message-field textarea {
  width: 100%;
  min-height: 180px;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 16px;
  background: #fbfdff;
  resize: vertical;
  font: inherit;
  color: var(--text-dark);
}

.sim-message-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.sim-message-actions .sim-btn {
  min-width: 210px;
}

.sim-message-actions .sim-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

@media (max-width: 640px) {
  .sim-student-late-cancel-actions {
    flex-direction: column-reverse;
  }

  .sim-student-late-cancel-actions .sim-btn {
    width: 100%;
  }
}

@media (max-width: 960px) {
  .sim-message-selection-summary {
    grid-template-columns: 1fr;
  }

  .sim-manage-message-head,
  .sim-message-panel-head {
    flex-direction: column;
  }
}

.sim-shell-nav-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem 1rem;
  width: 100%;
  min-width: 0;
  padding-top: 0;
}

.sim-teacher-sidebar .sim-shell-nav-panel {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.sim-portal-teacher .sim-teacher-sidebar {
  flex-direction: column;
  align-items: stretch;
}

.sim-portal-teacher .sim-teacher-sidebar-header {
  width: 100%;
  justify-content: space-between;
  align-items: center;
  gap: 1rem 1.25rem;
}

.sim-portal-teacher .sim-teacher-sidebar .sim-shell-nav-panel {
  display: grid;
  width: 100%;
}

.sim-portal-teacher .sim-teacher-sidebar .sim-teacher-nav {
  flex-wrap: wrap;
  overflow: visible;
  align-items: center;
  gap: 0.7rem;
}

.sim-portal-teacher .sim-teacher-sidebar .sim-teacher-sidebar-actions {
  width: auto;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding-top: 0;
  border-top: none;
  min-width: 0;
  margin-left: auto;
}

.sim-portal-teacher .sim-teacher-sidebar .sim-teacher-sidebar-actions > * {
  align-self: center;
}

.sim-portal-teacher .sim-teacher-sidebar .sim-teacher-sidebar-actions form {
  flex: 0 0 auto;
  align-self: center;
}

.sim-portal-teacher .sim-teacher-sidebar .sim-lang-switcher-inline {
  order: 0;
  margin-left: 0;
  padding: 0.28rem 0.35rem;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.sim-portal-teacher .sim-teacher-sidebar .sim-lang-switcher-inline .sim-lang-switcher-caption {
  color: rgba(226, 232, 240, 0.78);
}

.sim-portal-teacher .sim-teacher-sidebar .sim-lang-switcher-inline .sim-lang-switcher-link {
  min-width: 2rem;
  height: 2.1rem;
  color: rgba(226, 232, 240, 0.9);
}

.sim-portal-teacher .sim-teacher-sidebar .sim-lang-switcher-inline .sim-lang-switcher-link:hover {
  background: rgba(255, 255, 255, 0.14);
}

.sim-portal-teacher .sim-teacher-sidebar .sim-lang-switcher-inline .sim-lang-switcher-link.is-active {
  background: #f8fafc;
  color: #0f172a;
}

.sim-shell-menu-toggle {
  display: none !important;
  position: relative;
  z-index: 12;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.08));
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.22);
  color: #ffffff;
  border-radius: 999px;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.sim-shell-menu-toggle::before {
  content: "";
  width: 1rem;
  height: 0.72rem;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  box-sizing: border-box;
  opacity: 0.96;
}

.sim-shell-menu-toggle::after {
  content: "";
  position: absolute;
  left: 0.875rem;
  width: 1rem;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
  opacity: 0.96;
}

.sim-shell-menu-toggle:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.12));
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.28);
  transform: translateY(-1px);
}

.sim-shell-menu-toggle[aria-expanded="true"] {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.14));
  border-color: rgba(255, 255, 255, 0.3);
}

.sim-teacher-sidebar .sim-teacher-nav-link {
  width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  appearance: none;
  font-family: inherit;
  border-radius: 999px;
  min-height: 42px;
  padding: 0.5rem 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
  font-size: 0.81rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.01em;
  line-height: 1;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: none;
  white-space: nowrap;
}

.sim-portal-teacher .sim-teacher-sidebar .sim-teacher-nav-link {
  min-height: 44px;
  padding: 0.56rem 1rem;
  font-size: 0.84rem;
}

.sim-teacher-sidebar .sim-teacher-nav-link-technical-aid {
  font-size: 0.74rem;
  letter-spacing: 0;
}

.sim-student-shell .sim-teacher-sidebar .sim-teacher-nav-link-technical-aid {
  font-size: 0.8rem;
}

.sim-student-shell .sim-teacher-sidebar {
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.14), transparent 34%),
    linear-gradient(130deg, #0f172a 0%, #111f43 55%, #0f254a 100%);
  box-shadow: 0 24px 44px rgba(15, 23, 42, 0.2);
  flex-direction: column;
  align-items: stretch;
}

.sim-student-shell .sim-teacher-sidebar-header {
  width: 100%;
  justify-content: space-between;
}

.sim-student-shell .sim-teacher-sidebar .sim-shell-nav-panel {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 0.9rem;
  width: 100%;
}

.sim-student-shell .sim-student-sidebar-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem 1.25rem;
  width: 100%;
}

.sim-student-shell .sim-teacher-sidebar .sim-teacher-sidebar-title {
  font-size: 0.84rem;
  letter-spacing: 0.12em;
  color: #f8fbff;
}

.sim-student-shell .sim-teacher-sidebar .sim-teacher-sidebar-subtitle {
  color: rgba(191, 219, 254, 0.82);
}

.sim-student-shell .sim-teacher-sidebar .sim-teacher-nav {
  gap: 0.65rem;
  align-items: center;
}

.sim-student-shell .sim-teacher-sidebar .sim-teacher-nav-link {
  min-height: 48px;
  padding: 0.68rem 1.15rem;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.sim-student-shell .sim-teacher-sidebar .sim-teacher-nav-link:hover {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.18);
}

.sim-student-shell .sim-teacher-sidebar .sim-teacher-nav-link.active {
  background: linear-gradient(180deg, #ffffff 0%, #e8edf8 100%);
  border-color: rgba(255, 255, 255, 0.92);
  color: #0f172a;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.2);
}

.sim-student-shell .sim-teacher-sidebar .sim-teacher-sidebar-actions {
  justify-content: flex-end;
  gap: 0.6rem;
  min-width: max-content;
}

.sim-student-shell .sim-student-sidebar-language-row {
  display: flex;
  justify-content: flex-end;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sim-student-shell .sim-teacher-sidebar .sim-lang-switcher-inline {
  padding: 0.32rem 0.42rem;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
}

.sim-student-shell .sim-teacher-sidebar .sim-lang-switcher-inline .sim-lang-switcher-caption {
  color: #475569;
}

.sim-student-shell .sim-teacher-sidebar .sim-lang-switcher-inline .sim-lang-switcher-link {
  min-width: 2.15rem;
  height: 2.2rem;
}

.sim-teacher-sidebar .sim-teacher-nav-link:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
  text-decoration: none;
}

.sim-teacher-sidebar .sim-teacher-nav-link.active {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(255, 255, 255, 0.96);
  color: #0f172a;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}

.sim-teacher-sidebar .sim-teacher-nav {
  justify-content: flex-start;
  flex-wrap: nowrap;
  overflow: auto;
  min-width: 0;
  gap: 0.4rem 0.5rem;
}

.sim-teacher-sidebar .sim-teacher-sidebar-actions {
  width: auto;
  justify-content: flex-end;
  flex-wrap: nowrap;
  min-width: 0;
}

.sim-student-shell .sim-shell-nav-panel {
  gap: 0.85rem;
}

@media (min-width: 961px) {
  .sim-shell-menu-toggle {
    display: none !important;
  }
}

/* Teacher main */

.sim-teacher-main {
  min-width: 0;
  position: relative;
  z-index: 1;
}

.sim-teacher-section {
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  margin-bottom: 1rem;
}

.sim-teacher-section.active {
  display: block;
  opacity: 1;
}

.sim-section-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  padding: 1rem 1.1rem;
  margin-bottom: 0.9rem;
}

.sim-section-card h3 {
  margin: 0 0 0.4rem 0;
  font-size: 1rem;
}

/* Section header row with prev/next */
.sim-section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}

.sim-section-header-row-centered {
  justify-content: center;
}

.sim-section-header-row-centered .sim-section-header-controls {
  justify-content: center;
}

@media (max-width: 960px) {
  .sim-portal-teacher .sim-teacher-sidebar .sim-teacher-sidebar-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .sim-shell-menu-toggle {
    display: inline-flex !important;
    align-self: flex-start;
  }

  .sim-shell-nav-panel {
    display: flex;
    position: relative;
    z-index: 11;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding-top: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transition: max-height 0.28s ease, opacity 0.22s ease, padding-top 0.22s ease;
  }

  .sim-shell-nav-panel[hidden] {
    display: none !important;
  }

  .sim-shell-nav-panel.is-open {
    max-height: min(45rem, 85vh);
    overflow-y: auto;
    opacity: 1;
    pointer-events: auto;
    padding-top: 0.75rem;
  }

  .sim-teacher-sidebar.is-nav-open,
  .sim-student-shell .sim-teacher-sidebar.is-nav-open {
    overflow: visible;
  }

  .sim-teacher-nav,
  .sim-teacher-sidebar-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    margin-left: 0;
    overflow: visible;
  }

  .sim-teacher-sidebar-actions form,
  .sim-teacher-sidebar-actions .sim-teacher-nav-link,
  .sim-teacher-sidebar-actions .sim-btn,
  .sim-teacher-nav .sim-teacher-nav-link {
    width: 100%;
  }

  .sim-portal-teacher .sim-teacher-sidebar .sim-shell-nav-panel {
    display: flex;
  }

  .sim-portal-teacher .sim-teacher-sidebar .sim-teacher-sidebar-actions {
    order: 3;
  }
}

@media (max-width: 700px) {
  .sim-student-detail-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .sim-student-detail-export-form {
    width: 100%;
    min-width: 0;
  }

  .sim-student-detail-export-fields {
    grid-template-columns: 1fr;
  }

  .sim-message-week-toolbar,
  .sim-message-panel-head {
    flex-direction: column;
    align-items: stretch;
  }

  .sim-message-week-controls {
    justify-content: flex-start;
  }

  .sim-message-selection-summary {
    grid-template-columns: 1fr;
  }

  .sim-teacher-sidebar {
    padding: 1rem;
    flex-direction: column;
    align-items: stretch;
  }

  .sim-teacher-sidebar-header {
    width: 100%;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .sim-teacher-nav {
    flex-wrap: wrap;
  }

  .sim-teacher-sidebar-actions {
    flex-wrap: wrap;
  }

  .sim-portal-teacher .sim-teacher-sidebar .sim-lang-switcher-inline {
    width: 100%;
    justify-content: flex-end;
    margin-left: 0;
    order: 0;
  }

  .sim-student-shell .sim-teacher-sidebar .sim-shell-nav-panel,
  .sim-portal-teacher .sim-teacher-sidebar .sim-shell-nav-panel {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .sim-student-shell .sim-student-sidebar-topbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .sim-student-shell .sim-teacher-sidebar .sim-teacher-sidebar-actions,
  .sim-portal-teacher .sim-teacher-sidebar .sim-teacher-sidebar-actions {
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .sim-student-shell .sim-teacher-sidebar .sim-lang-switcher-inline,
  .sim-portal-teacher .sim-teacher-sidebar .sim-lang-switcher-inline {
    width: 100%;
    justify-content: flex-end;
  }

  .sim-teacher-sidebar-header {
    align-items: center;
  }

  .sim-teacher-sidebar-brand {
    gap: 0.75rem;
  }

  .sim-teacher-sidebar-logo {
    width: 50px;
    height: 50px;
    border-radius: 16px;
  }

  .sim-teacher-sidebar-title {
    font-size: 0.76rem;
    letter-spacing: 0.12em;
  }

  .sim-section-header-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .sim-section-header-controls {
    width: 100%;
    justify-content: space-between;
  }

  .sim-section-header-row-centered .sim-section-header-controls {
    justify-content: center;
  }

  .sim-teacher-sidebar-actions .sim-teacher-nav-link,
  .sim-teacher-sidebar-actions .sim-btn,
  .sim-teacher-nav .sim-teacher-nav-link {
    justify-content: center;
    text-align: center;
  }
}

.sim-section-header-title {
  min-width: 0;
}

.sim-section-header-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.sim-month-label {
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}

/* Teacher dashboard cards */

.sim-teacher-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
  margin-top: 0.5rem;
}

.sim-teacher-dashboard-grid-secondary {
  margin-top: 1rem;
}

.sim-teacher-dashboard-grid-programs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

  .sim-teacher-dashboard-grid-programs {
    grid-template-columns: 1fr;
  }
}

.sim-teacher-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.15rem 1.2rem;
  border: 1px solid var(--border-strong);
}

.sim-teacher-card-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-grey);
  margin-bottom: 0.25rem;
}

.sim-teacher-card-value {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text-dark);
}

.sim-teacher-card-value-meta {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-grey);
}

.sim-teacher-card-note {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-grey);
}

.sim-overview-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}

.sim-overview-heading {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sim-overview-heading h3 {
  margin: 0;
}

.sim-overview-heading-note {
  margin: 0;
}

.sim-overview-subsection-card {
  margin-top: 1rem;
  margin-bottom: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.sim-overview-subsection-title {
  margin: 0 0 0.35rem 0;
  font-size: 1rem;
}

.sim-overview-scope-switch {
  display: inline-flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin: 0.2rem 0 0.85rem;
}

.sim-overview-scope-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 600;
}

.sim-overview-scope-link.is-active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.sim-overview-month-switch {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.sim-overview-log-filter {
  width: 100%;
}

.sim-overview-log-filter-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas:
    "time time"
    "event action";
  align-items: end;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.sim-overview-log-filter-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sim-overview-log-filter-section:first-child {
  grid-area: time;
}

.sim-overview-log-filter-section-side {
  grid-area: event;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.sim-overview-log-filter-caption {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-grey);
}

.sim-overview-log-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1rem;
  row-gap: 0.85rem;
}

.sim-overview-log-filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  align-items: flex-start;
}

.sim-overview-log-filter-field-wide {
  min-width: 0;
  max-width: 28rem;
}

.sim-overview-log-filter-inputs {
  display: grid;
  grid-template-columns: minmax(12rem, 16rem) minmax(8.5rem, 9rem);
  gap: 0.5rem;
  align-items: center;
  width: fit-content;
  max-width: 100%;
}

.sim-overview-log-filter-inputs .sim-overview-month-switch-input {
  min-width: 0;
  width: 100%;
}

.sim-overview-log-select {
  min-width: 100%;
}

.sim-overview-log-submit {
  grid-area: action;
  align-self: end;
  justify-self: start;
  min-width: 12rem;
  min-height: 3rem;
  padding-inline: 1.6rem;
}

.sim-overview-scope-switch {
  margin: 0.55rem 0 1rem;
}

.sim-overview-month-switch-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-grey);
}

.sim-overview-month-switch-input {
  min-width: 11rem;
  border: 1px solid var(--border-strong);
  border-radius: 0.75rem;
  background: #ffffff;
  color: var(--text-dark);
  padding: 0.55rem 0.7rem;
}

.sim-overview-month-switch-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(12, 74, 110, 0.12);
}

.sim-overview-log-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.sim-overview-log-card {
  padding: 1rem;
}

.sim-overview-log-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.sim-overview-log-count {
  min-width: 2rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(12, 74, 110, 0.08);
  color: var(--primary);
  font-weight: 700;
  text-align: center;
}

.sim-overview-log-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sim-overview-log-entry {
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: #ffffff;
}

.sim-overview-log-entry-head,
.sim-overview-log-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.sim-overview-log-row {
  margin-top: 0.4rem;
}

.sim-overview-log-timestamp,
.sim-overview-log-meta {
  color: var(--text-grey);
  font-size: 0.85rem;
}

.sim-overview-log-meta {
  margin-top: 0.22rem;
}

.sim-overview-log-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: #e2e8f0;
  color: #0f172a;
}

.sim-overview-log-badge-simulation_registered {
  background: #dcfce7;
  color: #166534;
}

.sim-overview-log-badge-simulation_waitlisted {
  background: #fef3c7;
  color: #92400e;
}

.sim-overview-log-badge-simulation_cancelled_by_student,
.sim-overview-log-badge-simulation_cancelled_by_teacher {
  background: #fee2e2;
  color: #991b1b;
}

@media (max-width: 980px) {
  .sim-overview-log-filter-panel {
    grid-template-columns: 1fr;
    grid-template-areas:
      "time"
      "event"
      "action";
  }

  .sim-overview-log-filter-grid {
    grid-template-columns: 1fr;
  }

  .sim-overview-log-filter-inputs {
    grid-template-columns: 1fr;
  }

  .sim-overview-log-submit {
    justify-self: start;
    width: 100%;
  }

  .sim-overview-log-grid {
    grid-template-columns: 1fr;
  }
}

/* Teacher calendar pills (in teacher tables) */

.sim-calendar-teacher-pill {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.6rem;
  border-radius: 0.5rem;
  background: #ffffff;
  border: 1px solid var(--border);
  margin-bottom: 0.35rem;
  gap: 0.4rem;
}

.sim-calendar-teacher-pill-main {
  min-width: 0;
}

.sim-calendar-teacher-pill-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dark);
  display: block;
}

.sim-calendar-teacher-pill-meta {
  font-size: 0.78rem;
  color: var(--text-grey);
  display: block;
}

.sim-calendar-teacher-pill-side {
  text-align: right;
  flex-shrink: 0;
}

.sim-calendar-teacher-pill-stats {
  font-size: 0.78rem;
  color: var(--text-dark);
  margin-bottom: 0.15rem;
}

/* Small links & badges */

.sim-link-small {
  font-size: 0.78rem;
  text-decoration: underline;
  color: var(--primary);
}

.sim-link-small:hover {
  text-decoration: none;
}

.sim-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  font-size: 0.7rem;
  border: 1px solid var(--border);
}

.sim-badge-muted {
  background: #f3f4f6;
  color: var(--text-grey);
}

/* Messages / notes */

.sim-student-detail-card h4,
.sim-student-detail-card h5 {
  margin-top: 0.5rem;
  margin-bottom: 0.35rem;
}

.sim-report-toolbar {
  margin-top: 1rem;
}

.sim-report-filter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
}

.sim-report-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
}

.sim-report-filter-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 150px;
}

.sim-report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.sim-report-card {
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1rem;
}

.sim-report-card h4 {
  margin: 0 0 0.45rem 0;
}

.sim-report-card-compact {
  margin-bottom: 1rem;
}

.sim-report-helper {
  margin: 0 0 1rem;
  color: #64748b;
  font-size: 0.92rem;
  line-height: 1.55;
}

.sim-report-helper-inline {
  margin-top: 0.4rem;
}

.sim-report-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.sim-report-table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.sim-link-button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.sim-report-stats-grid {
  margin-bottom: 1rem;
}

.sim-inline-export-form {
  display: inline-flex;
}

.sim-tag-multiselect {
  min-height: 132px;
}

.sim-tag-editor-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #fafbfc;
}

.sim-tag-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.sim-tag-editor-head h4 {
  margin: 0 0 0.25rem 0;
}

.sim-tag-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.sim-tag-selector-option {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #ffffff;
}

.sim-tag-selector-option input {
  margin-top: 0.15rem;
}

.sim-tag-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sim-tag-chip-inline {
  display: inline-flex;
  align-items: center;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.78rem;
  font-weight: 700;
}

.sim-tag-chip-slate {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #334155;
}

.sim-tag-chip-rose {
  background: #ffe4e6;
  border-color: #fecdd3;
  color: #9f1239;
}

.sim-tag-chip-blue {
  background: #dbeafe;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.sim-tag-chip-emerald {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

.sim-tag-chip-amber {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}

.sim-tag-chip-violet {
  background: #ede9fe;
  border-color: #c4b5fd;
  color: #6d28d9;
}

.sim-tag-library-modal .sim-export-modal-dialog {
  max-width: 900px;
}

.sim-tag-library-copy {
  margin-bottom: 1rem;
}

.sim-student-directory-card {
  margin-bottom: 1.5rem;
}

.sim-student-directory-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.sim-student-row-active {
  background: rgba(248, 91, 66, 0.08);
}

.sim-manage-summary {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #fafbfc;
}

.sim-manage-summary-copy {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sim-manage-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
}

.sim-manage-summary-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #ffffff;
}

.sim-manage-summary-label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, #64748b);
}

.sim-manage-summary-actions {
  display: flex;
  justify-content: flex-start;
}

.sim-attendance-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.sim-attendance-badge-present {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

.sim-attendance-badge-absent {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}

.sim-attendance-badge-pending {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #374151;
}

.sim-attendance-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.sim-attendance-form {
  margin: 0;
}

.sim-bulk-attendance-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.9rem 1rem;
  margin-bottom: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fafbfc;
}

.sim-bulk-attendance-bar h4 {
  margin: 0 0 0.2rem 0;
}

.sim-bulk-attendance-form {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.sim-manage-participants-table th:first-child,
.sim-manage-participants-table td:first-child {
  width: 52px;
  text-align: center;
}

.sim-manage-participant-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 0.75rem;
}

.sim-manage-participant-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1.5fr) auto minmax(320px, 1fr);
  gap: 1rem;
  align-items: center;
  padding: 0.95rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.sim-manage-participant-main {
  min-width: 0;
}

.sim-manage-participant-name {
  font-weight: 700;
  color: var(--foreground, #0f172a);
}

.sim-manage-participant-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.8rem;
  margin-top: 0.3rem;
  color: var(--muted, #64748b);
  font-size: 0.88rem;
}

.sim-manage-participant-status {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sim-manage-participant-status select {
  min-width: 8.25rem;
  min-height: 2.35rem;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  padding: 0.45rem 0.7rem;
  font: inherit;
  color: var(--foreground, #0f172a);
}

.sim-manage-participant-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sim-manage-participants-card {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}

.sim-manage-participant-summary {
  margin-top: 0;
}

.sim-btn-ghost-small.is-active {
  border-color: transparent;
  color: #ffffff;
}

.sim-btn-ghost-small.is-present {
  background: #16a34a;
}

.sim-btn-ghost-small.is-absent {
  background: #dc2626;
}

.sim-btn-ghost-small.is-pending {
  background: #6b7280;
}

.sim-aux-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
  background: linear-gradient(180deg, rgba(248, 91, 66, 0.05), rgba(15, 23, 42, 0.02));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
}

.sim-aux-actions h4 {
  margin: 0 0 0.25rem 0;
}

.sim-aux-actions-bottom {
  margin-top: 1.25rem;
}

.sim-export-modal-dialog {
  max-width: 760px;
}

.sim-export-modal .sim-event-modal-dialog {
  max-height: calc(100dvh - 1.5rem);
  display: flex;
  flex-direction: column;
}

.sim-export-modal .sim-event-modal-body {
  overflow-y: auto;
}

.sim-export-modal-copy {
  margin-bottom: 1rem;
}

.sim-export-modal-copy h4 {
  margin: 0 0 0.3rem 0;
}

.sim-export-modal-note {
  margin: 0.55rem 0 0 0;
  color: var(--muted, #64748b);
  font-size: 0.88rem;
  line-height: 1.45;
}

.sim-report-inline-note {
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fafbfc;
  color: var(--muted, #64748b);
}

.sim-report-export-workflow {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sim-report-emphasis {
  font-weight: 700;
  color: var(--foreground, #0f172a);
}

.sim-student-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.sim-teacher-student-modal .sim-event-modal-dialog,
.sim-student-detail-modal-dialog {
  width: min(1120px, 95vw);
  max-height: calc(100dvh - 1.5rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sim-teacher-student-modal .sim-event-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.2rem;
}

.sim-student-detail-modal-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sim-student-detail-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.sim-student-detail-export-form {
  margin: 0;
  min-width: min(100%, 430px);
}

.sim-student-detail-export-card {
  display: grid;
  gap: 0.85rem;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.sim-student-detail-export-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.sim-student-detail-export-head h4 {
  margin: 0;
}

.sim-student-detail-export-head p {
  margin: 0.25rem 0 0;
}

.sim-student-detail-export-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(2, minmax(140px, 1fr));
  gap: 0.75rem;
}

.sim-student-detail-export-fields label {
  display: grid;
  gap: 0.35rem;
}

.sim-teacher-student-modal .sim-event-modal-body::-webkit-scrollbar {
  width: 10px;
}

.sim-teacher-student-modal .sim-event-modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.sim-teacher-student-modal .sim-event-modal-body::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.55);
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.92);
}

.sim-teacher-student-modal .sim-event-modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.72);
}

.sim-student-detail-title {
  margin: 0;
  font-size: 1.5rem;
}

.sim-student-detail-copy {
  margin-top: 0.25rem;
}

.sim-student-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.sim-student-profile-header {
  margin-bottom: 1.5rem;
}

.sim-student-profile-grid {
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.9fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.sim-student-profile-side {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sim-student-profile-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0;
}

.sim-color-picker {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.sim-form-span-2 {
  grid-column: 1 / -1;
}

.sim-color-picker-select-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sim-color-picker-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 44px;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #ffffff;
  cursor: pointer;
}

.sim-color-preview {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #f85b42;
}

.sim-color-picker-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  align-items: start;
}

.sim-color-picker-library {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.sim-color-picker-section {
  min-height: 100%;
  padding: 0.95rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
}

.sim-color-picker-section-head {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.85rem;
}

.sim-color-picker-section-head strong {
  color: #0f172a;
  font-size: 0.94rem;
}

.sim-color-swatch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.sim-color-swatch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.sim-color-swatch-card {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  min-height: 72px;
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 14px;
  background: #ffffff;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.sim-color-swatch-card:hover {
  transform: translateY(-1px);
  border-color: rgba(99, 102, 241, 0.28);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
}

.sim-color-swatch-copy {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  font-size: 0.78rem;
  color: #475569;
}

.sim-color-swatch-copy strong {
  color: #0f172a;
  font-size: 0.82rem;
}

.sim-color-swatch {
  width: 30px;
  height: 30px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: var(--swatch-color);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.12);
  cursor: pointer;
}

.sim-color-picker-custom {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 100%;
  padding: 0.95rem;
}

.sim-color-picker-custom-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.sim-color-picker-custom .sim-form-label {
  margin-bottom: 0.1rem;
}

.sim-color-picker-custom label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sim-color-picker-custom input[type="color"] {
  width: 100%;
  min-height: 44px;
}

.sim-color-picker-custom input[type="number"] {
  max-width: 100%;
  min-height: 42px;
  font-size: 0.92rem;
  font-weight: 600;
  text-align: center;
  border-radius: 14px;
}

.sim-color-picker-spectrum-field {
  margin-top: 0.25rem;
}

.sim-color-picker-spectrum-field input[type="color"] {
  max-width: 100%;
  min-height: 44px;
  padding: 0.2rem;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: linear-gradient(90deg, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);
}

.sim-policy-card {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  margin-top: 1rem;
  padding: 1.25rem;
  border: 1px solid rgba(191, 219, 254, 0.72);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 252, 0.98));
  box-shadow:
    0 20px 44px rgba(15, 23, 42, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.sim-policy-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(191, 219, 254, 0.45);
}

.sim-policy-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
}

.sim-policy-grid {
  gap: 0.9rem;
}

.sim-policy-grid-section {
  padding: 1rem;
  border: 1px solid rgba(191, 219, 254, 0.8);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.sim-policy-cluster + .sim-policy-cluster {
  margin-top: 1.1rem;
}

.sim-policy-cluster-head {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  margin-bottom: 0.72rem;
}

.sim-policy-cluster-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.01em;
}

.sim-inline-field-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
}

.sim-inline-field-group select {
  min-width: 120px;
}

.sim-checkbox-inline-start {
  margin-top: 0;
}

.sim-policy-toggle {
  padding: 0.95rem 1rem;
  border: 1px solid rgba(191, 219, 254, 0.78);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
}

.sim-policy-inline-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.85rem;
  align-items: center;
  min-height: 72px;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.sim-policy-inline-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(99, 102, 241, 0.22);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.05);
}

.sim-policy-inline-control {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
}

.sim-policy-inline-control-left {
  justify-content: flex-start;
}

.sim-policy-card input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #0f766e;
}

.sim-policy-card input[type="number"],
.sim-policy-card select,
.sim-policy-card textarea {
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.sim-policy-card input[type="number"],
.sim-policy-card select {
  min-height: 48px;
}

.sim-policy-card textarea {
  min-height: 160px;
  padding: 0.9rem 1rem;
}

.sim-policy-card .sim-form-label {
  color: #334155;
  font-weight: 700;
}

.sim-policy-card .sim-form-help,
.sim-policy-cluster-head .sim-small-note,
.sim-policy-card-head .sim-small-note {
  color: #64748b;
}

.sim-checkbox-inline-start label {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

@media (max-width: 760px) {
  .sim-color-swatch-grid {
    grid-template-columns: 1fr;
  }

  .sim-color-picker-select-row {
    flex-direction: column;
    align-items: stretch;
  }

  .sim-color-picker-panel {
    grid-template-columns: 1fr;
  }

  .sim-color-picker-custom-grid {
    grid-template-columns: 1fr;
  }

  .sim-policy-inline-toggle,
  .sim-inline-field-group {
    grid-template-columns: 1fr;
  }
}

.sim-student-detail-stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sim-card-section-title {
  margin: 0 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.sim-field-span-2 {
  grid-column: span 2;
}

.sim-input-full {
  max-width: 100%;
}

.sim-form-subsection {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.sim-form-subsection-title {
  margin: 0 0 0.75rem 0;
}

.sim-form-subsection-note {
  margin-top: 0.25rem;
}

.sim-action-row {
  display: flex;
  gap: 0.75rem;
}

.sim-action-row-end {
  justify-content: flex-end;
  margin-top: 1.25rem;
}

.sim-student-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.sim-teacher-card-subtle {
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  box-shadow: none;
}

.sim-accent-value {
  color: var(--simmed-secondary);
}

.sim-danger-card {
  border-color: #fecaca;
  background: #fff7f7;
}

.sim-danger-card-title {
  color: #b91c1c;
  border-bottom: 0;
  padding-bottom: 0;
  margin-bottom: 0.5rem;
}

.sim-danger-card-copy {
  margin-bottom: 1rem;
  color: #7f1d1d;
}

.sim-btn-block {
  width: 100%;
}

.sim-table-compact-gap {
  margin-bottom: 0.5rem;
}

.sim-report-table-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.sim-tag-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.22rem 0.65rem;
  font-size: 0.74rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.sim-tag-pill-slate {
  background: #e5e7eb;
  border-color: #cbd5e1;
  color: #334155;
}

.sim-tag-pill-blue {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.sim-tag-pill-emerald {
  background: #d1fae5;
  border-color: #6ee7b7;
  color: #047857;
}

.sim-tag-pill-amber {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #b45309;
}

.sim-tag-pill-rose {
  background: #ffe4e6;
  border-color: #fda4af;
  color: #be123c;
}

.sim-tag-pill-violet {
  background: #ede9fe;
  border-color: #c4b5fd;
  color: #7c3aed;
}

.sim-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.38rem;
  margin-left: 0.45rem;
  border-radius: 999px;
  background: #f85b42;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.sim-chat-shell {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  padding: 0;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(99, 102, 241, 0.07), transparent 28%),
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.96));
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.08);
}

.sim-chat-shell-head {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 1.25rem 1.35rem 0;
}

.sim-chat-shell-eyebrow {
  margin: 0 0 0.35rem 0;
  color: #4f46e5;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sim-chat-scope-switch {
  display: inline-flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.sim-chat-search-form,
.sim-chat-open-form {
  display: flex;
  gap: 0.8rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.sim-chat-search-label,
.sim-chat-compose-label {
  display: grid;
  gap: 0.35rem;
}

.sim-chat-search-label {
  min-width: min(100%, 240px);
}

.sim-chat-layout {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  min-height: 0;
}

.sim-chat-sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: rgba(248, 250, 252, 0.9);
  border-right: 1px solid rgba(226, 232, 240, 0.95);
}

.sim-chat-sidebar-panel {
  display: grid;
  gap: 0.9rem;
  padding: 1.15rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(255, 255, 255, 0.9);
}

.sim-chat-sidebar-header h4 {
  margin: 0 0 0.18rem 0;
}

.sim-chat-thread-list {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 0.7rem;
  padding: 1rem;
  min-height: 0;
  max-height: min(72vh, 48rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.sim-chat-thread-link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.9rem;
  align-items: flex-start;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(226, 232, 240, 0.88);
  border-radius: 18px;
  color: inherit;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.94);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.sim-chat-thread-link:hover,
.sim-chat-thread-link.is-active {
  transform: translateY(-1px);
  border-color: rgba(99, 102, 241, 0.28);
  box-shadow: 0 14px 24px rgba(15, 23, 42, 0.08);
  background: linear-gradient(180deg, rgba(238, 242, 255, 0.96), rgba(255,255,255,0.98));
}

.sim-chat-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 800;
  line-height: 1;
  flex-shrink: 0;
}

.sim-chat-avatar-thread,
.sim-chat-avatar-header,
.sim-chat-avatar-message {
  color: #ffffff;
  background: linear-gradient(135deg, #6366f1 0%, #0ea5e9 100%);
  box-shadow: 0 10px 18px rgba(79, 70, 229, 0.18);
}

.sim-chat-avatar-thread {
  width: 2.7rem;
  height: 2.7rem;
  font-size: 0.88rem;
}

.sim-chat-avatar-header {
  width: 3rem;
  height: 3rem;
  font-size: 0.94rem;
}

.sim-chat-avatar-message {
  width: 2.35rem;
  height: 2.35rem;
  font-size: 0.78rem;
}

.sim-chat-thread-copy {
  min-width: 0;
}

.sim-chat-thread-link-head,
.sim-chat-thread-link-meta,
.sim-chat-message-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.sim-chat-thread-link-meta,
.sim-chat-thread-preview,
.sim-chat-message-head span {
  color: var(--text-grey);
  font-size: 0.85rem;
}

.sim-chat-thread-preview {
  margin: 0;
  line-height: 1.45;
}

.sim-chat-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 1rem;
  min-width: 0;
  min-height: 0;
  padding: 1.15rem;
  background: rgba(255, 255, 255, 0.7);
}

.sim-chat-alert-card {
  display: grid;
  gap: 0.8rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.98));
}

.sim-chat-alert-form,
.sim-chat-thread-actions,
.sim-chat-compose-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.sim-chat-header {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
}

.sim-chat-header-main {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.sim-chat-header h4 {
  margin: 0 0 0.2rem 0;
}

.sim-chat-header-subtitle {
  margin: 0;
  color: #64748b;
  font-size: 0.88rem;
}

.sim-chat-inline-status {
  display: inline-flex;
  margin-left: 0.45rem;
  font-weight: 700;
  color: #b45309;
}

.sim-chat-notice {
  display: grid;
  gap: 0.35rem;
  padding: 1rem 1.1rem;
  border-radius: 18px;
  border: 1px solid rgba(16, 185, 129, 0.22);
  background: rgba(236, 253, 245, 0.92);
}

.sim-chat-notice strong,
.sim-chat-alert-card h5 {
  margin: 0;
  color: #0f766e;
}

.sim-chat-notice p {
  margin: 0;
  color: #134e4a;
  line-height: 1.5;
}

.sim-chat-history {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 0.95rem;
  padding: 1.1rem;
  min-height: 18rem;
  max-height: min(62vh, 44rem);
  overflow-y: auto;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 22px;
  background:
    radial-gradient(circle at top left, rgba(99, 102, 241, 0.06), transparent 32%),
    linear-gradient(180deg, rgba(248,250,252,0.86), rgba(255,255,255,0.98));
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.sim-chat-message-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  max-width: 82%;
}

.sim-chat-message-row.is-outgoing {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.sim-chat-message-row.is-outgoing .sim-chat-message {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #ffffff;
  border-bottom-right-radius: 6px;
}

.sim-chat-message-row.is-outgoing .sim-chat-message-head strong,
.sim-chat-message-row.is-outgoing .sim-chat-message-head span,
.sim-chat-message-row.is-outgoing .sim-chat-message-body {
  color: #ffffff;
}

.sim-chat-message-row.is-incoming .sim-chat-message {
  background: #ffffff;
  border-bottom-left-radius: 6px;
}

.sim-chat-message {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
  padding: 0.9rem 1rem 0.75rem;
  border-radius: 20px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: 0 12px 22px rgba(15, 23, 42, 0.06);
}

.sim-chat-message-body {
  white-space: normal;
  line-height: 1.55;
}

.sim-chat-message-delete {
  margin-top: 0.15rem;
}

.sim-chat-message-row.is-outgoing .sim-chat-message-delete .sim-text-danger {
  color: rgba(255, 255, 255, 0.88) !important;
}

.sim-chat-compose-form {
  display: grid;
  gap: 0.75rem;
  width: 100%;
}

.sim-chat-compose-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.9rem;
  align-items: flex-end;
  width: 100%;
  padding: 0.85rem;
  border: 1px solid rgba(199, 210, 254, 0.92);
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(99, 102, 241, 0.08), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(241, 245, 249, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 14px 30px rgba(79, 70, 229, 0.08);
}

.sim-chat-compose-label {
  flex: 1 1 auto;
  min-width: 0;
}

.sim-chat-compose-form textarea,
.sim-chat-search-label input,
.sim-chat-search-label select {
  width: 100%;
}

.sim-chat-compose-form textarea {
  display: block;
  min-height: 120px;
  max-width: 100%;
  padding: 1rem 1.05rem;
  border: 1px solid rgba(199, 210, 254, 0.9);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(238,242,255,0.78));
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
  resize: vertical;
  color: #0f172a;
  font-size: 1rem;
  line-height: 1.65;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.sim-chat-compose-form textarea::placeholder {
  color: #94a3b8;
}

.sim-chat-compose-actions {
  flex: 0 0 auto;
  align-self: stretch;
  justify-content: flex-end;
}

.sim-chat-compose-form textarea:focus {
  outline: none;
  border-color: rgba(79, 70, 229, 0.75);
  background: #ffffff;
  box-shadow:
    0 0 0 4px rgba(99, 102, 241, 0.12),
    inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.sim-chat-empty-panel {
  display: grid;
  place-items: center;
  gap: 0.55rem;
  min-height: 420px;
  padding: 2rem 1.25rem;
  border: 1px dashed rgba(148, 163, 184, 0.5);
  border-radius: 24px;
  background: rgba(248, 250, 252, 0.7);
  text-align: center;
}

.sim-chat-empty-panel h4 {
  margin: 0 0 0.35rem 0;
}

.sim-chat-empty-art {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5rem;
  height: 5rem;
  padding: 0 1.4rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.14), rgba(14, 165, 233, 0.16));
  color: #4338ca;
  font-weight: 800;
}

.sim-chat-panel-student {
  padding-top: 0;
  background: transparent;
}

.sim-chat-entry-gate {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.54);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.sim-chat-entry-gate[hidden] {
  display: none;
}

.sim-chat-entry-gate-card {
  width: min(100%, 560px);
  display: grid;
  gap: 0.9rem;
  padding: 1.4rem 1.45rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: 0 28px 56px rgba(15, 23, 42, 0.2);
}

.sim-chat-entry-gate-card h4,
.sim-chat-entry-gate-card p {
  margin: 0;
}

.sim-chat-entry-gate-check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.95);
  border: 1px solid rgba(226, 232, 240, 0.95);
}

.sim-chat-entry-gate-check input {
  margin-top: 0.2rem;
}

.sim-chat-shell-student .sim-chat-history {
  max-height: 58vh;
}

.sim-chat-thread-link[hidden] {
  display: none;
}

@media (max-width: 900px) {
  .sim-report-section-head,
  .sim-student-directory-head,
  .sim-aux-actions,
  .sim-tag-editor-head,
  .sim-student-detail-header,
  .sim-student-detail-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .sim-aux-actions .sim-btn {
    width: 100%;
  }

  .sim-student-detail-grid,
  .sim-student-profile-grid,
  .sim-student-stat-grid,
  .sim-manage-summary-grid,
  .sim-tag-selector-grid {
    grid-template-columns: 1fr;
  }

  .sim-student-profile-stats {
    grid-template-columns: 1fr;
  }

  .sim-chat-layout {
    grid-template-columns: 1fr;
  }

  .sim-chat-sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(226, 232, 240, 0.95);
  }

  .sim-chat-message-row {
    max-width: 100%;
  }

  .sim-chat-compose-bar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .sim-chat-entry-gate {
    padding: 1rem;
  }

  .sim-settings-template-language-grid {
    grid-template-columns: 1fr;
  }

  .sim-manage-participant-row {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .sim-manage-participant-actions {
    justify-content: flex-start;
  }

  .sim-field-span-2 {
    grid-column: span 1;
  }

  .sim-bulk-attendance-form {
    width: 100%;
  }

  .sim-bulk-attendance-form .sim-btn {
    width: 100%;
  }
}

@media (max-width: 700px) {
  .sim-student-profile-header h3 {
    font-size: 1.2rem !important;
    line-height: 1.2;
  }

  .sim-student-profile-grid .sim-card {
    padding: 1rem;
    border-radius: 18px;
  }

  .sim-student-profile-form-grid {
    gap: 0.75rem;
  }

  .sim-student-profile-form-grid label,
  .sim-student-profile-password-grid label {
    padding: 0.75rem 0.85rem;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.96));
  }

  .sim-student-profile-form-grid label .sim-form-label,
  .sim-student-profile-password-grid label .sim-form-label {
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #64748b;
  }

  .sim-student-profile-form-grid input,
  .sim-student-profile-form-grid select,
  .sim-student-profile-password-grid input {
    background: #ffffff;
  }

  .sim-action-row-end {
    justify-content: stretch;
  }

  .sim-action-row-end .sim-btn {
    width: 100%;
  }

  .sim-manage-participant-status {
    flex-direction: column;
    align-items: stretch;
  }

  .sim-manage-participant-status select,
  .sim-manage-participant-status .sim-btn-ghost-small {
    width: 100%;
  }

  .sim-manage-participant-actions {
    justify-content: stretch;
  }

  .sim-manage-participant-actions form,
  .sim-manage-participant-actions .sim-btn-ghost-small {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .sim-student-event-modal .sim-event-modal-dialog {
    width: min(100%, calc(100vw - 1rem));
    max-height: calc(100vh - 1rem);
    padding: 1.15rem 1rem 1rem;
    border-radius: 24px;
  }

  .sim-student-event-modal .sim-event-modal-header {
    align-items: flex-start;
    gap: 0.85rem;
    margin-bottom: 0.9rem;
  }

  .sim-student-event-modal .sim-event-modal-title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 1.95rem;
    line-height: 1.05;
  }

  .sim-student-event-modal .sim-event-modal-close {
    width: 3.35rem;
    height: 3.35rem;
    flex: 0 0 3.35rem;
    font-size: 1.6rem;
    color: #ffffff;
    background: linear-gradient(135deg, #f97316, #ea580c);
    box-shadow: 0 16px 28px rgba(234, 88, 12, 0.28);
  }

  .sim-student-event-modal .sim-event-modal-body {
    gap: 0.85rem;
  }

  .sim-student-event-modal .sim-student-event-modal-meta,
  .sim-student-event-modal .sim-event-modal-description,
  .sim-student-event-modal .sim-event-modal-spots,
  .sim-student-event-modal .sim-student-event-modal-policy-status {
    padding: 0.95rem 1rem;
    border-radius: 18px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.94));
  }

  .sim-student-event-modal .sim-student-event-modal-meta {
    display: grid;
    gap: 0.7rem;
  }

  .sim-student-event-modal .sim-event-modal-datetime,
  .sim-student-event-modal .sim-event-modal-location,
  .sim-student-event-modal .sim-event-modal-description,
  .sim-student-event-modal .sim-student-event-modal-policy-status,
  .sim-student-event-modal .sim-event-modal-spots {
    margin: 0;
  }

  .sim-student-event-modal .sim-event-modal-description {
    font-size: 0.98rem;
    line-height: 1.55;
  }

  .sim-student-event-modal .sim-event-modal-spots {
    display: inline-flex;
    justify-content: center;
    width: fit-content;
    max-width: 100%;
    font-weight: 700;
    color: #1d4ed8;
    background: rgba(239, 246, 255, 0.96);
    border-color: rgba(147, 197, 253, 0.88);
  }

  .sim-student-event-modal .sim-event-modal-form {
    margin-top: 0.1rem;
    width: 100%;
  }

  .sim-student-event-modal .sim-event-modal-submit {
    width: 100%;
    min-height: 3.5rem;
    border-radius: 999px;
    font-size: 1.02rem;
    font-weight: 800;
  }

  .sim-chat-compose-bar {
    padding: 0.75rem;
    border-radius: 24px;
  }

  .sim-chat-compose-form textarea {
    min-height: 108px;
    padding: 0.95rem 0.95rem 1rem;
    border-radius: 18px;
    font-size: 0.98rem;
  }

  .sim-chat-compose-actions .sim-btn {
    width: 100%;
    justify-content: center;
  }
}
