:root {
  color-scheme: dark;
  --bg: #050914;
  --panel: rgba(12, 18, 34, 0.38);
  --panel-strong: rgba(14, 22, 42, 0.54);
  --glass: rgba(255, 255, 255, 0.11);
  --glass-strong: rgba(255, 255, 255, 0.18);
  --line: rgba(255, 255, 255, 0.24);
  --line-soft: rgba(255, 255, 255, 0.14);
  --text: #f4f8ff;
  --muted: #9fb0c8;
  --muted-2: #72839d;
  --cyan: #22e6ff;
  --mint: #48ffbd;
  --pink: #ff4fd8;
  --amber: #ffd166;
  --blue: #73a7ff;
  --danger: #ff6678;
  --ok: #6cff9d;
  --radius-sm: 16px;
  --radius-md: 20px;
  --radius-lg: 26px;
  --radius-xl: 32px;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.34), 0 8px 34px rgba(34, 230, 255, 0.07);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  background:
    radial-gradient(ellipse at 12% 8%, rgba(34, 230, 255, 0.24), transparent 34rem),
    radial-gradient(ellipse at 88% 16%, rgba(255, 79, 216, 0.2), transparent 36rem),
    radial-gradient(ellipse at 46% 92%, rgba(72, 255, 189, 0.16), transparent 34rem),
    linear-gradient(135deg, #040711 0%, #091526 46%, #090b16 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: -20%;
  pointer-events: none;
  background:
    conic-gradient(from 180deg at 50% 50%, rgba(34, 230, 255, 0.08), rgba(255, 79, 216, 0.11), rgba(72, 255, 189, 0.08), rgba(34, 230, 255, 0.08));
  filter: blur(112px);
  opacity: 0.62;
  animation: drift 18s ease-in-out infinite alternate;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, black 0%, transparent 100%);
}

.app-root {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  gap: 18px;
  align-content: center;
}

.boot-orbit {
  width: 58px;
  height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--cyan);
  border-right-color: var(--pink);
  border-radius: 50%;
  box-shadow: 0 0 38px rgba(34, 230, 255, 0.28);
  animation: spin 1s linear infinite;
}

.boot-text {
  color: var(--muted);
  font-size: 14px;
}

.glass {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.055) 42%, rgba(255, 255, 255, 0.09)),
    var(--panel);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.32), inset 0 -1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(36px) saturate(180%);
  -webkit-backdrop-filter: blur(36px) saturate(180%);
}

.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.3), transparent 24%, transparent 68%, rgba(255, 255, 255, 0.1)),
    radial-gradient(ellipse at 12% 0%, rgba(34, 230, 255, 0.16), transparent 42%),
    radial-gradient(ellipse at 92% 18%, rgba(255, 79, 216, 0.14), transparent 38%);
  opacity: 0.76;
}

.glass > * {
  position: relative;
  z-index: 1;
}

.auth-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1.08fr);
  gap: 22px;
  align-items: center;
  padding: 34px 0;
}

.login-panel,
.auth-preview,
.topbar,
.panel,
.lesson,
.day-column,
.admin-row,
.modal-like {
  border-radius: var(--radius-xl);
}

.login-panel {
  padding: clamp(26px, 4vw, 44px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 30px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(34, 230, 255, 0.95), rgba(255, 79, 216, 0.86));
  color: #02101d;
  box-shadow: 0 0 32px rgba(34, 230, 255, 0.35);
  font-weight: 900;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 620px;
  margin-bottom: 18px;
  font-size: clamp(42px, 7vw, 84px);
  line-height: 0.94;
  font-weight: 850;
}

.accent-text {
  color: transparent;
  background: linear-gradient(90deg, var(--cyan), var(--mint), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
}

.lead {
  max-width: 560px;
  color: var(--muted);
  font-size: clamp(16px, 2.2vw, 19px);
  line-height: 1.55;
  margin-bottom: 28px;
}

.telegram-box {
  min-height: 52px;
  display: flex;
  align-items: center;
}

.auth-error,
.config-warning,
.notice {
  border: 1px solid rgba(255, 209, 102, 0.34);
  background: rgba(255, 209, 102, 0.1);
  color: #ffe6a0;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  margin-top: 14px;
}

.auth-preview {
  min-height: 560px;
  padding: 22px;
  display: grid;
  align-content: space-between;
}

.preview-phone {
  width: min(390px, 100%);
  margin: 0 auto;
  padding: 14px;
  border-radius: 34px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(3, 9, 20, 0.68);
  box-shadow: inset 0 0 0 7px rgba(255, 255, 255, 0.045), 0 30px 90px rgba(0, 0, 0, 0.38);
}

.preview-screen {
  min-height: 500px;
  border-radius: 28px;
  padding: 18px;
  background:
    radial-gradient(circle at 24% 8%, rgba(34, 230, 255, 0.22), transparent 13rem),
    radial-gradient(circle at 92% 64%, rgba(255, 79, 216, 0.18), transparent 15rem),
    rgba(7, 14, 28, 0.92);
}

.preview-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  margin-bottom: 26px;
  font-size: 13px;
}

.preview-pill {
  width: 76px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.preview-title {
  font-size: 28px;
  line-height: 1.02;
  font-weight: 800;
  margin-bottom: 22px;
}

.preview-lesson {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 86px;
  padding: 12px;
  margin-bottom: 10px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.085);
}

.preview-num {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #03111a;
  background: linear-gradient(135deg, var(--cyan), var(--mint));
  font-weight: 900;
}

.preview-line {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  margin: 8px 0;
}

.preview-line.short {
  width: 54%;
}

.app-shell {
  width: min(1480px, calc(100% - 28px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 0 30px;
  overflow-x: clip;
}

.topbar {
  min-height: 76px;
  padding: 13px 15px;
  display: grid;
  grid-template-columns: minmax(220px, auto) 1fr auto;
  gap: 14px;
  align-items: center;
  position: sticky;
  top: 12px;
  z-index: 20;
}

.topbar.collapsed {
  min-height: 54px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 7px 10px;
}

.topbar.collapsed .nav,
.topbar.collapsed .top-actions > :not(.topbar-toggle) {
  display: none;
}

.topbar.collapsed .top-actions {
  justify-content: flex-end;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.logo-text {
  min-width: 0;
}

.logo-title {
  font-weight: 850;
  line-height: 1.05;
}

.logo-subtitle {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

.nav-button,
.icon-button,
.primary-button,
.ghost-button,
.chip,
.day-button,
.select,
.input {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  min-height: 42px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.nav-button,
.icon-button,
.primary-button,
.ghost-button,
.chip,
.day-button,
.select,
.toggle,
.toggle input {
  cursor: pointer;
}

.input:not(.select):not([readonly]):not(.textarea) {
  cursor: text;
}

.select option {
  color: #0b1222;
  background: #f4f8ff;
}

.nav-button,
.primary-button,
.ghost-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 14px;
}

.nav-button:hover,
.icon-button:hover,
.primary-button:hover,
.ghost-button:hover,
.chip:hover,
.day-button:hover {
  transform: translateY(-1px);
  border-color: rgba(34, 230, 255, 0.5);
  background: rgba(255, 255, 255, 0.13);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18), 0 0 24px rgba(34, 230, 255, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.nav-button.active,
.day-button.active,
.chip.active {
  border-color: rgba(34, 230, 255, 0.62);
  background:
    linear-gradient(135deg, rgba(34, 230, 255, 0.26), rgba(255, 79, 216, 0.16)),
    rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 34px rgba(34, 230, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.primary-button {
  border-color: rgba(72, 255, 189, 0.5);
  background:
    linear-gradient(135deg, rgba(72, 255, 189, 0.28), rgba(34, 230, 255, 0.16)),
    rgba(255, 255, 255, 0.08);
}

.danger-button {
  border-color: rgba(255, 102, 120, 0.42);
}

.top-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.user-pill {
  max-width: 230px;
  min-height: 42px;
  display: grid;
  align-content: center;
  padding: 0 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.user-name,
.user-class {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-name {
  font-size: 13px;
  font-weight: 740;
}

.user-class {
  color: var(--muted);
  font-size: 11px;
}

.workspace {
  padding-top: 18px;
}

.schedule-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.schedule-layout > section {
  min-width: 0;
}

.panel {
  padding: 20px;
}

.panel + .panel {
  margin-top: 14px;
}

.section-title {
  margin: 0 0 14px;
  font-size: 20px;
  line-height: 1.1;
}

.small-title {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 10px;
}

.chip {
  min-width: 0;
  padding: 0 8px;
  color: var(--text);
  font-weight: 740;
}

.mode-row,
.day-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.day-button {
  min-width: 72px;
  padding: 0 10px;
  color: var(--text);
}

.hero-panel {
  padding: clamp(18px, 3vw, 28px);
  margin-bottom: 18px;
  border-radius: 34px;
}

.schedule-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 18px;
}

.eyebrow {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.schedule-title {
  margin: 0;
  font-size: clamp(34px, 4.4vw, 64px);
  line-height: 0.98;
  font-weight: 850;
}

.schedule-accent {
  color: #8df7ff;
  text-shadow: 0 0 24px rgba(34, 230, 255, 0.32);
}

.schedule-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.meta-pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--muted);
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.lessons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.lessons-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.lesson {
  min-height: 150px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05) 48%, rgba(255, 255, 255, 0.08)),
    rgba(9, 17, 32, 0.42);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(30px) saturate(170%);
  -webkit-backdrop-filter: blur(30px) saturate(170%);
}

.lessons-list .lesson {
  min-height: 88px;
  display: grid;
  grid-template-columns: 54px minmax(110px, 150px) minmax(0, 1fr) minmax(130px, auto);
  gap: 14px;
  align-items: center;
}

.lesson.remote {
  border-color: rgba(255, 209, 102, 0.58);
  background:
    linear-gradient(150deg, rgba(255, 209, 102, 0.16), rgba(255, 255, 255, 0.055)),
    rgba(9, 17, 32, 0.44);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.2), 0 0 32px rgba(255, 209, 102, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.lesson.current {
  border-color: rgba(72, 255, 189, 0.86);
  box-shadow:
    0 20px 48px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(72, 255, 189, 0.42),
    0 0 42px rgba(72, 255, 189, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.lesson.current .lesson-num {
  background: linear-gradient(135deg, var(--mint), var(--amber));
}

.lesson.window {
  opacity: 0.72;
}

.lesson-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.lessons-list .lesson-top {
  display: contents;
}

.lesson-num {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  color: #03131e;
  background: linear-gradient(135deg, var(--cyan), var(--mint));
  box-shadow: 0 0 22px rgba(34, 230, 255, 0.22);
  font-weight: 900;
}

.lesson-time {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.lesson-subject {
  min-height: 48px;
  font-size: clamp(17px, 1.35vw, 20px);
  line-height: 1.16;
  font-weight: 820;
  overflow-wrap: anywhere;
}

.lessons-list .lesson-subject {
  min-height: 0;
}

.lesson-room {
  margin-top: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.lessons-list .lesson-room {
  justify-content: flex-end;
  margin-top: 0;
  text-align: right;
}

.empty-state {
  min-height: 260px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(190px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.day-column {
  min-width: 190px;
  padding: 13px;
  border: 1px solid var(--line-soft);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.045)),
    rgba(255, 255, 255, 0.055);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.day-column.today {
  border-color: rgba(34, 230, 255, 0.45);
  box-shadow: 0 0 34px rgba(34, 230, 255, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.day-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

.mini-lesson {
  padding: 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  margin-bottom: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.mini-lesson.remote {
  border-color: rgba(255, 209, 102, 0.56);
  background:
    linear-gradient(135deg, rgba(255, 209, 102, 0.18), rgba(255, 255, 255, 0.07));
  box-shadow: 0 0 22px rgba(255, 209, 102, 0.12);
}

.mini-lesson.remote strong {
  color: #ffe08a;
}

.mini-lesson.current {
  border-color: rgba(72, 255, 189, 0.78);
  box-shadow:
    0 0 0 1px rgba(72, 255, 189, 0.28),
    0 0 24px rgba(72, 255, 189, 0.16);
}

.mini-lesson.pending {
  border-color: rgba(34, 230, 255, 0.34);
  background: rgba(34, 230, 255, 0.08);
}

.mini-lesson.day-off {
  border-color: rgba(72, 255, 189, 0.28);
  background: rgba(72, 255, 189, 0.07);
}

.mini-lesson strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  line-height: 1.22;
}

.mini-lesson span {
  color: var(--muted);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.mini-lesson span svg {
  width: 14px;
  height: 14px;
  color: var(--amber);
}

.profile-grid,
.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: 18px;
  align-items: start;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
}

.select,
.input {
  width: 100%;
  padding: 0 12px;
  outline: none;
}

.textarea {
  min-height: 120px;
  padding: 12px;
  resize: vertical;
}

.select:focus,
.input:focus {
  border-color: rgba(34, 230, 255, 0.62);
  box-shadow: 0 0 0 3px rgba(34, 230, 255, 0.1);
}

.select:hover,
.input:hover {
  border-color: rgba(34, 230, 255, 0.38);
  background: rgba(255, 255, 255, 0.1);
}

.toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.075);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.toggle > span {
  min-width: 0;
}

.toggle:hover {
  border-color: rgba(72, 255, 189, 0.42);
  background: rgba(255, 255, 255, 0.105);
  box-shadow: 0 0 0 1px rgba(72, 255, 189, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.toggle input {
  flex: 0 0 48px;
  width: 48px;
  min-width: 48px;
  max-width: 48px;
  height: 26px;
  display: block;
  margin: 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  transform: translateZ(0);
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.toggle input::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  top: 2px;
  left: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
  transform: translate3d(0, 0, 0);
  will-change: transform;
  transition: transform 0.16s ease-out, background 0.16s ease, box-shadow 0.16s ease;
}

.toggle input:checked {
  background: rgba(72, 255, 189, 0.34);
  border-color: rgba(72, 255, 189, 0.54);
  box-shadow: 0 0 20px rgba(72, 255, 189, 0.16);
}

.toggle input:checked::after {
  transform: translate3d(20px, 0, 0);
  background: var(--mint);
  box-shadow: 0 0 16px rgba(72, 255, 189, 0.42);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  min-height: 108px;
  padding: 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-soft);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.045)),
    rgba(255, 255, 255, 0.055);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.stat-value {
  font-size: 30px;
  font-weight: 850;
}

.stat-label {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.users-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 10px;
  margin-bottom: 12px;
}

.user-table {
  display: grid;
  gap: 10px;
}

.admin-row {
  display: grid;
  grid-template-columns: 120px minmax(140px, 1fr) 150px 116px;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line-soft);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.055);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

.admin-row .muted {
  color: var(--muted);
  font-size: 12px;
}

.admin-row .toggle {
  min-height: 42px;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 16px;
}

.logs {
  max-height: 340px;
  overflow: auto;
  padding: 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-soft);
  background: rgba(0, 0, 0, 0.2);
  color: #cbe4ff;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.activity-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.activity-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.065);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.activity-item span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.class-bars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.class-bar,
.issue-item {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.065);
  padding: 10px 11px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.class-bar {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.issue-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  max-height: 360px;
  overflow: auto;
}

.issue-item strong,
.issue-item span {
  display: block;
}

.issue-item span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.issue-item.error {
  border-color: rgba(255, 102, 120, 0.48);
}

.issue-item.warning {
  border-color: rgba(255, 209, 102, 0.42);
}

.skeleton {
  min-height: 150px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.055));
  background-size: 220% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
}

.muted {
  color: var(--muted);
}

.ok {
  color: var(--ok);
}

.bad {
  color: var(--danger);
}

svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shimmer {
  to {
    background-position: -220% 0;
  }
}

@keyframes activeGlow {
  0%,
  100% {
    box-shadow: 0 0 28px rgba(34, 230, 255, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }
  50% {
    box-shadow: 0 0 42px rgba(34, 230, 255, 0.26), 0 0 18px rgba(255, 79, 216, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  }
}

@keyframes drift {
  from {
    transform: rotate(0deg) scale(1);
  }
  to {
    transform: rotate(10deg) scale(1.08);
  }
}

@media (max-width: 1080px) {
  .auth-shell,
  .schedule-layout,
  .profile-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .auth-preview {
    min-height: auto;
  }

  .topbar {
    min-height: auto;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "logo actions"
      "nav nav";
    gap: 10px;
  }

  .topbar.collapsed {
    grid-template-areas: "logo actions";
  }

  .logo {
    grid-area: logo;
  }

  .nav {
    grid-area: nav;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

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

  .top-actions {
    grid-area: actions;
    justify-content: flex-end;
    flex-wrap: nowrap;
    overflow-x: visible;
  }

  .nav-button {
    flex: 0 0 auto;
  }

  .top-actions > * {
    flex: 0 0 auto;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .app-shell,
  .auth-shell {
    width: 100%;
  }

  .app-shell {
    padding: 8px 8px 18px;
    overflow-x: hidden;
  }

  .auth-shell {
    padding-top: 20px;
  }

  h1 {
    font-size: 44px;
  }

  .login-panel,
  .panel,
  .hero-panel {
    padding: 12px;
  }

  .topbar {
    top: 6px;
    padding: 8px;
    border-radius: 20px;
  }

  .topbar .brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 12px;
  }

  .logo {
    gap: 8px;
  }

  .logo-title {
    font-size: 14px;
  }

  .logo-subtitle {
    font-size: 11px;
  }

  .top-actions .user-pill {
    display: none;
  }

  .topbar .icon-button {
    width: 38px;
    min-width: 38px;
    min-height: 38px;
    padding: 0;
  }

  .topbar .icon-button span {
    display: none;
  }

  .nav {
    gap: 6px;
    padding-bottom: 1px;
  }

  .nav-button {
    flex: 1 1 0;
    min-width: 0;
    min-height: 36px;
    padding: 0 8px;
    gap: 6px;
    border-radius: 14px;
    font-size: 12px;
  }

  .nav-button span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .workspace {
    padding-top: 10px;
  }

  .schedule-layout {
    gap: 10px;
  }

  .schedule-layout > aside {
    display: grid;
    gap: 6px;
  }

  .schedule-layout > aside .panel {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    padding: 6px 8px;
    border-radius: 14px;
  }

  .schedule-layout > aside .panel + .panel {
    margin-top: 0;
  }

  .section-title {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1;
    text-transform: uppercase;
  }

  .class-grid {
    display: flex;
    grid-template-columns: none;
    gap: 6px;
    min-width: 0;
    margin: 0 -2px;
    overflow-x: auto;
    padding: 0 2px 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .class-grid::-webkit-scrollbar {
    display: none;
  }

  .mode-row,
  .day-row {
    flex-wrap: nowrap;
    gap: 6px;
    min-width: 0;
  }

  .chip,
  .day-button {
    min-height: 32px;
    border-radius: 10px;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .class-grid .chip {
    flex: 0 0 58px;
    min-width: 58px;
    padding: 0 8px;
  }

  .day-row .day-button,
  .mode-row .day-button {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 5px;
  }

  .auth-preview {
    display: none;
  }

  .hero-panel {
    margin-bottom: 12px;
    border-radius: 16px;
  }

  .schedule-layout.day-mode .hero-panel {
    padding: 10px;
  }

  .schedule-head {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 10px;
  }

  .eyebrow {
    margin-bottom: 4px;
    font-size: 12px;
  }

  .schedule-title {
    font-size: 28px;
    line-height: 1;
  }

  .schedule-meta {
    justify-content: flex-start;
    gap: 6px;
  }

  .meta-pill {
    min-height: 28px;
    padding: 0 8px;
    font-size: 11px;
  }

  .schedule-layout.day-mode .schedule-head {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    margin-bottom: 8px;
  }

  .schedule-layout.day-mode .eyebrow {
    display: none;
  }

  .schedule-layout.day-mode .schedule-title {
    font-size: 23px;
  }

  .schedule-layout.day-mode .schedule-meta {
    justify-content: flex-end;
  }

  .schedule-layout.day-mode .schedule-meta .meta-pill:first-child {
    display: none;
  }

  .lessons-grid {
    grid-template-columns: 1fr;
  }

  .lessons-list {
    gap: 6px;
  }

  .lessons-list .lesson {
    min-height: 48px;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    grid-template-areas:
      "num subject time"
      "num room room";
    gap: 2px 8px;
    padding: 7px 8px;
    border-radius: 14px;
  }

  .lessons-list .lesson-num {
    grid-area: num;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    font-size: 13px;
  }

  .lessons-list .lesson-time {
    grid-area: time;
    align-self: start;
    font-size: 11px;
    line-height: 1.15;
    white-space: nowrap;
  }

  .lessons-list .lesson-subject {
    grid-area: subject;
    min-height: 0;
    font-size: 14px;
    line-height: 1.08;
  }

  .lessons-list .lesson-room {
    grid-area: room;
    justify-content: flex-start;
    min-width: 0;
    margin-top: 0;
    text-align: left;
    font-size: 11px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .lessons-list .lesson-room svg {
    width: 13px;
    height: 13px;
  }

  .users-toolbar,
  .admin-row {
    grid-template-columns: 1fr;
  }

  .user-pill {
    max-width: none;
  }

  .week-grid {
    width: 100%;
    max-width: 100%;
    grid-template-columns: repeat(5, 152px);
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
  }

  .schedule-layout.week-mode .hero-panel {
    padding: 12px;
  }

  .day-column {
    min-width: 152px;
    padding: 10px;
    border-radius: 12px;
  }

  .day-title {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 12px;
    text-align: left;
  }

  .day-title strong,
  .day-title span {
    min-width: 0;
    overflow: hidden;
    text-overflow: clip;
    white-space: nowrap;
  }

  .day-title span {
    font-size: 10px;
  }

  .mini-lesson {
    padding: 8px;
    margin-bottom: 7px;
    border-radius: 10px;
  }

  .mini-lesson strong {
    display: -webkit-box;
    margin-bottom: 2px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 13px;
    line-height: 1.15;
  }

  .mini-lesson span {
    display: block;
    font-size: 11px;
    line-height: 1.2;
  }

  .mini-lesson span svg {
    display: none;
  }
}

@media (max-width: 440px) {
  .class-grid {
    grid-template-columns: none;
  }

  .nav-button {
    flex: 1 1 0;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .nav-button,
  .primary-button,
  .ghost-button,
  .icon-button {
    padding: 0 10px;
  }
}

@media (max-width: 1080px) and (orientation: landscape) {
  .app-shell {
    width: min(1480px, calc(100% - 20px));
    padding: 10px 0 20px;
  }

  .topbar:not(.collapsed) {
    grid-template-columns: minmax(180px, auto) 1fr auto;
    grid-template-areas: "logo nav actions";
    gap: 10px;
    top: 8px;
    padding: 10px 12px;
  }

  .topbar:not(.collapsed) .nav {
    justify-content: center;
    overflow-x: visible;
  }

  .topbar:not(.collapsed) .top-actions .user-pill {
    display: grid;
    max-width: 180px;
  }

  .topbar:not(.collapsed) .icon-button {
    width: auto;
    min-width: 38px;
    padding: 0 10px;
  }

  .topbar:not(.collapsed) .icon-button span {
    display: inline;
  }

  .topbar:not(.collapsed) .nav-button {
    flex: 0 0 auto;
  }

  .schedule-layout {
    grid-template-columns: minmax(210px, 260px) minmax(0, 1fr);
    gap: 14px;
  }

  .schedule-layout > aside {
    display: block;
  }

  .schedule-layout > aside .panel {
    padding: 14px;
  }

  .schedule-layout > aside .panel + .panel {
    margin-top: 12px;
  }

  .week-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    overflow-x: visible;
  }

  .day-column {
    min-width: 0;
    padding: 8px;
  }

  .day-title {
    display: flex;
    justify-content: space-between;
    text-align: left;
  }

  .mini-lesson {
    padding: 7px;
  }

  .mini-lesson strong,
  .mini-lesson span {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .mini-lesson span {
    display: block;
  }
}
