:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #f5f6f8;
  --surface-strong: #e9edf2;
  --ink: #182134;
  --muted: #5b6575;
  --line: #dde2ea;
  --primary: #c83273;
  --primary-strong: #ae1f62;
  --accent: #1e83a8;
  --success: #22865e;
  --warning: #e2af32;
  --danger: #c0402a;
  --shadow: 0 8px 20px rgba(24, 33, 52, 0.08);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --focus: 0 0 0 3px rgba(30, 131, 168, 0.22);
  font-family: "din-lin-next", "DIN Next LT Arabic", Tahoma, Arial, sans-serif;
}

@font-face {
  font-family: "din-lin-next";
  src: url("./fonts/ArbFONTS-DINNextLTArabic-Regular-4.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "din-lin-next";
  src: url("./fonts/ArbFONTS-DINNextLTArabic-Medium-2.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "din-lin-next";
  src: url("./fonts/ArbFONTS-DINNextLTArabic-Bold-2.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "din-lin-next";
  src: url("./fonts/ArbFONTS-DINNextLTArabic-Bold-2.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "din-lin-next";
  src: url("./fonts/ArbFONTS-DINNextLTArabic-Heavy2-2.ttf") format("truetype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@supports (color: oklch(1 0 0)) {
  :root {
    --bg: oklch(1 0 0);
    --surface: oklch(0.972 0.004 245);
    --surface-strong: oklch(0.936 0.008 245);
    --ink: oklch(0.18 0.025 255);
    --muted: oklch(0.43 0.03 255);
    --line: oklch(0.88 0.01 250);
    --primary: oklch(0.58 0.18 353);
    --primary-strong: oklch(0.5 0.2 353);
    --accent: oklch(0.57 0.13 205);
    --success: oklch(0.58 0.13 150);
    --warning: oklch(0.76 0.14 80);
    --danger: oklch(0.58 0.18 28);
    --shadow: 0 8px 20px oklch(0.18 0.025 255 / 0.08);
    --focus: 0 0 0 3px oklch(0.57 0.13 205 / 0.22);
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: inherit;
  direction: rtl;
  overscroll-behavior: none;
}

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select {
  outline: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  box-shadow: var(--focus);
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
}

.app-shell[data-view="screen"] {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 4vw, 48px);
  background: rgba(255, 255, 255, 0.92);
  background: oklch(1 0 0 / 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.topbar h1,
.panel h2 {
  margin: 0;
  color: var(--ink);
}

.topbar h1 {
  font-size: 1.25rem;
  line-height: 1.2;
}

.eyeline,
.section-label {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.view-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.view-tab {
  min-width: 104px;
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
  transition: background 160ms ease, color 160ms ease;
}

[data-view="screen"] [data-view-link="screen"],
[data-view="dashboard"] [data-view-link="dashboard"] {
  background: var(--ink);
  color: var(--bg);
}

.dashboard-view,
.screen-view {
  display: none;
}

[data-view="dashboard"] .dashboard-view,
[data-view="screen"] .screen-view {
  display: block;
}

[data-view="screen"] .topbar {
  display: none;
}

.screen-view {
  min-height: 100vh;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #121826;
  background: linear-gradient(140deg, #182134, #121826 58%, #2b1731);
}

[data-tv-mode="true"] .screen-view {
  background: #111827;
}

.presentation-shell {
  position: relative;
  display: grid;
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  place-items: center;
  padding: 0;
}

.screen-toolbar {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 30;
  display: flex;
  gap: 8px;
  opacity: 0;
  transition: opacity 160ms ease;
}

.screen-toolbar:hover,
.screen-toolbar:focus-within {
  opacity: 1;
}

.stage-wrap {
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
}

.stage {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100%;
  border-radius: 0;
  background: #121826;
  background: oklch(0.12 0.02 255);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.34);
  isolation: isolate;
  direction: ltr;
  --slide-white: #ffffff;
  --slide-mint: #00e7ad;
  --slide-muted: rgba(255, 255, 255, 0.78);
}

[data-tv-mode="true"] .stage {
  box-shadow: none;
}

.template-image,
.template-fallback,
.slide-layer {
  position: absolute;
  inset: 0;
}

.template-image {
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.template-image[data-fit="contain"] {
  object-fit: contain;
  background: #111111;
  background: oklch(0.08 0 0);
}

.template-image[data-fit="fill"] {
  object-fit: fill;
}

.template-image[src=""] {
  display: none;
}

.template-fallback {
  z-index: 0;
  background: linear-gradient(100deg, #fbfbfb 0 52%, #e9edf2 52%);
  background:
    linear-gradient(100deg, oklch(0.98 0 0) 0 52%, oklch(0.92 0.012 245) 52%),
    var(--bg);
}

.fallback-band {
  position: absolute;
  inset: auto -6% 9% 34%;
  height: 24%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: skewX(-14deg);
}

.fallback-ring {
  position: absolute;
  right: 8%;
  top: 10%;
  width: 28%;
  aspect-ratio: 1;
  border: 26px solid rgba(200, 50, 115, 0.13);
  border: 26px solid oklch(0.58 0.18 353 / 0.13);
  border-radius: 50%;
}

.slide-layer {
  z-index: 2;
  color: var(--ink);
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(18px) scale(0.992);
  transition: opacity 260ms ease, transform 260ms ease;
  will-change: opacity, transform;
}

.slide.is-active {
  opacity: 1;
  transform: translateY(0) scale(1);
}

[data-tv-mode="true"] .slide {
  transform: none;
  transition: opacity 220ms linear;
  will-change: opacity;
}

[data-tv-mode="true"] .slide.is-active {
  transform: none;
}

.field {
  position: absolute;
  display: flex;
  align-items: center;
  min-width: 0;
  direction: rtl;
}

.field-photo {
  direction: ltr;
}

.teacher-photo {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: visible;
  background: transparent;
  box-shadow: none;
}

.teacher-photo img,
.teacher-cutout {
  width: auto;
  height: 100%;
  max-width: none;
  object-fit: contain;
  object-position: bottom center;
  transform: none;
}

.photo-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: var(--slide-white);
  font-size: 128px;
  font-weight: 800;
}

.teacher-name {
  color: var(--slide-white);
  font-size: var(--name-size);
  font-weight: 850;
  line-height: 1.02;
  text-align: right;
  overflow: visible;
  text-wrap: nowrap;
  white-space: nowrap;
  width: 100%;
}

.teacher-subject {
  display: block;
  margin-top: 18px;
  color: var(--slide-muted);
  font-size: calc(var(--name-size) * 0.33);
  font-weight: 650;
  line-height: 1.2;
}

.variable-number {
  color: var(--slide-mint);
  font-size: var(--number-size);
  font-weight: 900;
  line-height: 0.88;
  letter-spacing: 0;
  width: 100%;
  text-align: right;
}

.class-name {
  color: var(--slide-white);
  font-size: var(--class-size);
  font-weight: 800;
  line-height: 1.08;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.lecture-time {
  margin-top: 8px;
  color: var(--slide-white);
  font-size: var(--time-size);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 22px;
  direction: rtl;
  white-space: nowrap;
}

.time-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.time-label {
  color: var(--slide-muted);
  font-weight: 500;
}

.time-value {
  color: var(--slide-white);
  font-weight: 650;
}

.time-icon {
  position: relative;
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 2px solid var(--slide-mint);
  border-radius: 50%;
  background: rgba(0, 231, 173, 0.12);
}

.time-icon-start::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 10px solid var(--slide-mint);
  transform: translateX(-1px);
}

.time-icon-end::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--slide-mint);
}

.countdown {
  align-items: flex-start;
  flex-direction: column;
  justify-content: center;
  padding: 10px 0;
  border-radius: 0;
  background: transparent;
  color: var(--slide-white);
  box-shadow: none;
}

.countdown strong {
  font-size: var(--countdown-size);
  line-height: 1;
  color: var(--slide-mint);
}

.countdown span {
  margin-top: 8px;
  color: var(--slide-muted);
  font-size: calc(var(--countdown-size) * 0.42);
  font-weight: 750;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--slide-white);
  color: #12004f;
  direction: rtl;
  font-size: 0.95rem;
  font-weight: 900;
}

.status-chip.is-upcoming {
  background: var(--warning);
  color: #12004f;
}

.status-chip.is-live {
  background: var(--slide-mint);
  color: #12004f;
}

.empty-slide .status-chip {
  background: var(--accent);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 800;
}

.progress-track {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 4;
  height: 8px;
  background: rgba(24, 33, 52, 0.12);
  background: oklch(0.18 0.025 255 / 0.12);
  display: block;
}

.progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.empty-slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 10%;
  text-align: center;
}

.empty-slide h2 {
  margin: 0;
  font-size: 64px;
}

.empty-slide p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 28px;
  line-height: 1.35;
}

.dashboard-view {
  padding: 28px clamp(16px, 4vw, 48px) 48px;
  background: var(--surface);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
  max-width: 1440px;
  margin: 0 auto;
  min-width: 0;
}

.dashboard-column {
  display: grid;
  gap: 18px;
  align-content: start;
  min-width: 0;
}

.panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg);
}

.panel-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  min-width: 0;
}

.panel h2 {
  font-size: 1.08rem;
}

.form-grid,
.lecture-form {
  display: grid;
  gap: 12px;
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lecture-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

input,
select {
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  padding: 9px 10px;
  text-align: right;
}

input[type="url"] {
  direction: ltr;
  text-align: left;
}

input::placeholder {
  color: #6b7484;
  color: oklch(0.48 0.03 255);
}

.input-with-unit {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.input-with-unit input {
  border: 0;
}

.input-with-unit span {
  padding: 0 12px;
  color: var(--muted);
}

.toggle-row,
.template-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  color: var(--ink);
}

.checkbox-label input {
  min-height: auto;
}

.helper-text {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.upload-zone {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1.3fr;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px dashed #92a5b8;
  border: 1px dashed oklch(0.7 0.05 245);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.upload-zone p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.compact-form {
  display: grid;
  grid-template-columns: 1fr 0.8fr 0.7fr;
  gap: 10px;
}

.compact-form input[type="file"],
.compact-form button {
  grid-column: span 1;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.file-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0 14px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 120ms ease, background 160ms ease, color 160ms ease;
}

.primary-button {
  background: var(--primary);
  color: #ffffff;
}

.secondary-button,
.file-button {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
}

.ghost-button {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border: 1px solid oklch(1 0 0 / 0.2);
  background: rgba(255, 255, 255, 0.9);
  background: oklch(1 0 0 / 0.9);
  color: var(--ink);
}

.danger-button {
  background: #f7dfdb;
  background: oklch(0.96 0.03 28);
  color: var(--danger);
}

.icon-button {
  width: 40px;
  padding: 0;
  background: rgba(255, 255, 255, 0.9);
  background: oklch(1 0 0 / 0.9);
  color: var(--ink);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.danger-button:hover,
.file-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.teacher-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.teacher-row {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.teacher-row img,
.teacher-row .avatar-fallback {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-fallback {
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #ffffff;
  font-weight: 900;
}

.teacher-row strong {
  display: block;
}

.teacher-row span {
  color: var(--muted);
  font-size: 0.88rem;
}

.row-actions {
  display: inline-flex;
  gap: 6px;
}

.mini-button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: middle;
  font-size: 0.9rem;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
}

td input[type="checkbox"] {
  min-height: auto;
}

.layout-controls {
  display: grid;
  gap: 14px;
}

.layout-group {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.layout-group h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

.layout-fields {
  display: grid;
  grid-template-columns: repeat(5, minmax(74px, 1fr));
  gap: 8px;
}

.layout-fields label {
  gap: 4px;
}

.layout-fields input {
  min-height: 34px;
  padding: 6px 8px;
}

.is-hidden {
  display: none !important;
}

@media (max-width: 1020px) {
  .dashboard-grid,
  .form-grid,
  .lecture-form {
    grid-template-columns: 1fr;
  }

  .compact-form {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .view-tabs {
    width: 100%;
  }

  .view-tab {
    flex: 1;
  }
}

@media (max-width: 640px) {
  .upload-zone {
    grid-template-columns: 1fr;
  }

  .layout-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
  }

  .slide {
    transform: none;
  }
}
.dashboard-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 16px;
}

.quick-setting {
  width: 142px;
}

.quick-setting input,
.quick-setting select {
  width: 100%;
  min-height: 38px;
  background: var(--bg);
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.live-status-container {
  display: grid;
  gap: 10px;
  min-height: 118px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.live-preview-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  text-align: right;
}

.live-preview-header,
.live-preview-details {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.live-preview-details {
  color: var(--muted);
  font-size: 0.9rem;
}

.mini-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
}

.mini-status.is-live {
  background: #d9f7e8;
  background: oklch(0.94 0.055 150);
  color: #10623f;
}

.mini-status.is-upcoming {
  background: #fbefd0;
  background: oklch(0.94 0.06 80);
  color: #6d4a00;
}

.teacher-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 124px;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  padding: 4px 2px 14px;
  scroll-snap-type: inline proximity;
}

.teacher-card-btn {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 146px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  scroll-snap-align: start;
  transition: border-color 160ms ease, background 160ms ease, transform 120ms ease;
}

.teacher-card-btn:hover,
.teacher-card-btn.is-active {
  border-color: var(--primary);
  background: #fff5fa;
  background: oklch(0.975 0.018 353);
  transform: translateY(-1px);
}

.teacher-card-img {
  width: 76px;
  height: 76px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background-color: var(--surface-strong);
  background-position: top center;
  background-size: cover;
}

.teacher-card-meta {
  display: grid;
  gap: 2px;
  width: 100%;
  text-align: center;
}

.teacher-card-name {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.teacher-card-meta small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-input {
  width: min(240px, 100%);
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
}

.weekly-grid-container {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.weekly-grid {
  min-width: 900px;
  border-collapse: separate;
  border-spacing: 0;
}

.weekly-grid th,
.weekly-grid td {
  border-bottom: 1px solid var(--line);
  border-inline-end: 1px solid var(--line);
  text-align: center;
}

.weekly-grid th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-strong);
  color: var(--ink);
  font-weight: 800;
}

.weekly-day {
  width: 92px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 900;
}

.grid-cell {
  min-width: 128px;
  min-height: 92px;
  padding: 8px;
  vertical-align: top;
  transition: background 160ms ease;
}

.grid-cell:hover {
  background: var(--surface);
}

.grid-cell-stack {
  display: grid;
  gap: 6px;
  min-height: 74px;
}

.grid-item {
  position: relative;
  display: grid;
  gap: 2px;
  margin-bottom: 6px;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #ffffff;
  text-align: right;
}

.grid-item + .grid-item {
  margin-top: 0;
}

.grid-item strong,
.grid-item span,
.grid-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grid-item small {
  opacity: 0.9;
}

.grid-del-btn {
  position: absolute;
  top: 5px;
  left: 5px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  color: #ffffff;
  cursor: pointer;
  font-weight: 900;
}

.cell-add-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  width: 100%;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
}

.cell-add-button:hover,
.cell-add-button:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--surface);
}

.cell-add-button.is-empty {
  min-height: 74px;
  font-size: 1rem;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lecture-state-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.lecture-state-badge.is-live {
  background: #d9f7e8;
  background: oklch(0.94 0.055 150);
  color: #10623f;
}

.lecture-state-badge.is-upcoming {
  background: #fbefd0;
  background: oklch(0.94 0.06 80);
  color: #6d4a00;
}

.muted-cell,
.muted-text {
  color: var(--muted);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 14, 24, 0.55);
}

.modal-content {
  width: min(440px, 100%);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg);
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.modal-header h3 {
  margin: 0;
  font-size: 1.05rem;
}

.activation-form {
  display: grid;
  gap: 12px;
}

.activation-form input,
.activation-form select {
  width: 100%;
}

.modal-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
}


.auth-overlay {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.8); z-index: 9999;
  display: flex; align-items: center; justify-content: center;
}
.auth-modal {
  background: var(--surface); padding: 40px; border-radius: 12px; width: 400px; max-width: 90vw;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  color: var(--text);
}
.auth-modal h2 { margin-bottom: 20px; font-size: 1.5rem; text-align: center; color: var(--text); }
