:root {
  --bg: #f6f8fc;
  --text: #172033;
  --card: rgba(255, 255, 255, 0.18);
  --card-strong: rgba(255, 255, 255, 0.28);
  --accent: #2f6fed;
  --accent-2: #7a5cff;
  --accent-3: #4dd0ff;
  --muted: #5c677d;
  --border: rgba(255, 255, 255, 0.24);
  --shadow: 0 18px 50px rgba(18, 28, 60, 0.14);
  --glass-blur: blur(18px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(47, 111, 237, 0.20), transparent 30%),
    radial-gradient(circle at top right, rgba(122, 92, 255, 0.22), transparent 28%),
    linear-gradient(135deg, #eef4ff 0%, #f7f8ff 42%, #eef3ff 100%);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(255,255,255,0.16), rgba(255,255,255,0)),
    radial-gradient(circle at 20% 20%, rgba(77, 208, 255, 0.12), transparent 24%),
    radial-gradient(circle at 80% 30%, rgba(122, 92, 255, 0.12), transparent 22%);
  z-index: 0;
}

.wrap {
  width: min(100% - 32px, 1440px);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.topbar,
.footer {
  background: rgba(255, 255, 255, 0.58);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(255, 255, 255, 0.32);
  box-shadow: 0 8px 30px rgba(31, 52, 104, 0.08);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  border-left: none;
  border-right: none;
  border-top: none;
}

.footer {
  border-left: none;
  border-right: none;
  border-bottom: none;
  margin-top: 32px;
  padding: 20px 0;
  color: var(--muted);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  gap: 16px;
}

.nav nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.nav a {
  text-decoration: none;
  color: var(--text);
  padding: 10px 14px;
  border-radius: 999px;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.nav a:hover,
.nav a:focus {
  background: rgba(47, 111, 237, 0.10);
  color: var(--accent);
  transform: translateY(-1px);
}

.logo {
  font-weight: 800;
  color: #fff !important;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 24px rgba(47, 111, 237, 0.28);
}

.logo:hover,
.logo:focus {
  color: #fff !important;
  background: linear-gradient(135deg, #3d7dff, #8b6bff);
}

/* Контейнер всей поисковой системы */
.search-container {
    position: relative;
    margin: 0;
    display: flex;
    align-items: center;
}

.search-form {
    margin: 0;
    display: flex;
    align-items: center;
    position: relative;
}

/* Строка ввода */
.header-search-input {
    padding: 6px 12px 6px 32px;
    font-size: 13px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2)); /* Полупрозрачный фон */
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    color: #ffffff !important; /* Вводимый пользователем текст теперь СТРОГО БЕЛЫЙ */
    width: 200px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Мягкая тень */
}

/* Изменение размера и подсветка при клике */
.header-search-input:focus {
    width: 240px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    outline: none;
}

/* Стиль текста подсказки (Найти по ФИО...) — делаем его тоже белым, но слегка прозрачным */
.header-search-input::placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* Иконка лупы */
.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 0.7;
    pointer-events: none;
}

/* Выпадающий список результатов (Подстроен под стеклянный стиль) */
.search-dropdown {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    width: 240px;
    background: rgba(27, 27, 59, 0.85); /* Темное стекло */
    backdrop-filter: blur(10px); /* Размытие заднего плана */
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5); /* Глубокая тень */
    z-index: 2000;
    padding: 6px 0;
    margin-top: 8px;
    max-height: 250px;
    overflow-y: auto;
}

/* Стилизация полосы прокрутки внутри выпадающего списка */
.search-dropdown::-webkit-scrollbar {
    width: 5px;
}
.search-dropdown::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.hero {
  padding: 46px 0 24px;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 12px;
  letter-spacing: -0.03em;
}

.hero p {
  color: var(--muted);
  max-width: 760px;
  line-height: 1.7;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-radius: 14px;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 14px 28px rgba(47, 111, 237, 0.22);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.btn:hover,
.btn:focus {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(47, 111, 237, 0.28);
  outline: none;
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.30);
  color: var(--accent);
  border: 1px solid rgba(255, 255, 255, 0.40);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.btn.danger {
  background: linear-gradient(135deg, #ff5f6d, #ff7a59);
  color: #fff;
}

.btn.small {
  padding: 8px 12px;
  font-size: 0.85rem;
  border-radius: 12px;
}

.cards,
.info-grid,
.note-grid,
.content-grid,
.roadmap-columns,
.book-grid {
  display: grid;
  gap: 16px;
}

.cards {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin: 24px 0;
}

.content-grid,
.info-grid,
.note-grid,
.roadmap-columns {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin: 24px 0;
}

.book-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin-top: 16px;
}

.card,
.step,
.topic,
.info-card,
.note-card,
.auth-card,
.question-card,
.theory-content,
.table-section table,
.wide-image-card {
  background: var(--card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.card,
.step,
.topic,
.info-card,
.note-card,
.auth-card,
.question-card {
  padding: 18px;
}

.card:hover,
.info-card:hover,
.note-card:hover,
.step:hover,
.topic:hover {
  transform: translateY(-2px);
  transition: transform 0.18s ease;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(47, 111, 237, 0.14), rgba(122, 92, 255, 0.14));
  color: var(--accent);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.30);
}

.timeline {
  display: grid;
  gap: 14px;
  margin: 20px 0;
}

.table-section {
  margin: 28px 0;
}

.table-section table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
}

.table-section th,
.table-section td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.20);
  vertical-align: top;
}

.table-section th {
  background: linear-gradient(135deg, rgba(47, 111, 237, 0.16), rgba(122, 92, 255, 0.14));
  color: var(--text);
  text-align: left;
}

.image-section {
  margin: 28px 0;
}

.image-placeholder {
  border: 2px dashed rgba(255,255,255,0.35);
  border-radius: 16px;
  padding: 28px;
  text-align: center;
  color: var(--muted);
  background: rgba(255,255,255,0.18);
  margin-top: 12px;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.page-image,
.stage-image {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.28);
  box-shadow: 0 10px 30px rgba(17, 24, 39, 0.12);
  object-fit: cover;
}

.page-image {
  max-width: 700px;
  display: block;
  margin: 16px auto;
}

.stage-image {
  height: 180px;
  margin: 12px 0;
}

.wide-image-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
  align-items: center;
  overflow: hidden;
}

.wide-image-card img {
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
}

.wide-image-text {
  padding: 18px;
}

.book-card {
  display: block;
  text-decoration: none;
  color: var(--text);
  background: rgba(255,255,255,0.20);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: var(--shadow);
}

.book-card:hover,
.book-card:focus {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(18, 28, 60, 0.18);
}

.book-card img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
  background: #eef2f7;
}

.book-card span {
  display: block;
  padding: 12px;
  font-size: 0.95rem;
  font-weight: 700;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.card-head i,
.note-card h2 i,
.hero h1 i,
.table-section h2 i,
.books-section h2 i,
.image-section h2 i {
  color: var(--accent);
}

.books-section {
  margin: 30px 0;
}

.auth-card {
  max-width: 520px;
  margin: 30px auto;
}

.auth-form,
.profile-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.auth-form label,
.profile-form label {
  display: grid;
  gap: 6px;
  font-weight: 600;
}

.auth-form input,
.auth-form select,
.auth-form textarea,
.profile-form input,
.profile-form select,
.profile-form textarea,
.quiz-form input,
.quiz-form select,
.quiz-form textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid rgba(255,255,255,0.34);
  border-radius: 14px;
  background: rgba(255,255,255,0.42);
  color: var(--text);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22);
}

.auth-form input:focus,
.auth-form select:focus,
.auth-form textarea:focus,
.profile-form input:focus,
.profile-form select:focus,
.profile-form textarea:focus,
.quiz-form input:focus,
.quiz-form select:focus,
.quiz-form textarea:focus {
  border-color: rgba(47, 111, 237, 0.5);
  box-shadow: 0 0 0 4px rgba(47, 111, 237, 0.12);
}

.auth-form textarea,
.profile-form textarea,
.quiz-form textarea {
  min-height: 120px;
  resize: vertical;
}

.flash-list {
  margin-bottom: 16px;
}

.flash {
  padding: 12px 14px;
  border-radius: 14px;
  margin-bottom: 10px;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(255,255,255,0.28);
}

.flash.success {
  background: rgba(233, 255, 241, 0.72);
  color: #146b2d;
}

.flash.error {
  background: rgba(255, 236, 236, 0.74);
  color: #9b1c1c;
}

.profile-card {
  grid-column: 1 / -1;
}

.profile-header {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.avatar-img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.46);
  box-shadow: 0 8px 20px rgba(18, 28, 60, 0.10);
}

.profile-name h3 {
  margin: 0;
  font-size: 1.1rem;
}

.profile-name p {
  color: var(--muted);
  margin: 4px 0 0;
}

.hidden {
  display: none;
}

.support-widget {
  position: fixed;
  right: 16px;
  bottom: 16px;
  background: rgba(255, 255, 255, 0.58);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(255,255,255,0.34);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  z-index: 1000;
  max-width: 280px;
}

.support-title {
  font-weight: 800;
  margin-bottom: 6px;
}

.support-contact {
  margin-top: 4px;
  white-space: nowrap;
}

.support-contact a {
  color: var(--accent);
  text-decoration: none;
}

.support-contact a:hover,
.support-contact a:focus {
  text-decoration: underline;
}

.support-action {
  margin-top: 10px;
}

.topics-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.topics-list li {
  margin-bottom: 8px;
}

.topics-list a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.topics-list a:hover,
.topics-list a:focus {
  text-decoration: underline;
}

.theory-content {
  padding: 18px;
  margin-bottom: 16px;
  line-height: 1.7;
}

.theory-content p {
  margin: 12px 0;
}

.theory-content img {
  max-width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.28);
  margin: 12px 0;
}

.theory-content blockquote {
  border-left: 4px solid var(--accent);
  padding-left: 12px;
  margin: 12px 0;
  color: #334;
}

.quiz-form {
  display: grid;
  gap: 16px;
  margin: 20px 0;
}

.option {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
  cursor: pointer;
}

.option input[type="radio"],
.option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.match-row,
.order-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 6px 0;
  gap: 10px;
}

.match-row select,
.order-row input {
  width: 160px;
  padding: 8px 10px;
  border-radius: 12px;
}

.quiz-fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

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

@media (max-width: 800px) {
  .wide-image-card {
    grid-template-columns: 1fr;
  }

  .nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav nav {
    justify-content: flex-start;
  }
}

@media (max-width: 600px) {
  .support-widget {
    right: 8px;
    bottom: 8px;
    max-width: calc(100% - 16px);
  }

  .wrap {
    width: min(1100px, calc(100% - 20px));
  }
}

.section-head {
  margin-bottom: 16px;
}

.section-head h2 {
  margin: 0 0 8px;
  font-size: 1.6rem;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.programming-env {
  margin: 28px 0 8px;
}

.programming-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.programming-card {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: var(--text);
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 16px 40px rgba(20, 30, 70, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.programming-card:hover,
.programming-card:focus {
  transform: translateY(-3px);
  box-shadow: 0 20px 50px rgba(20, 30, 70, 0.18);
}

.programming-icon {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(47, 111, 237, 0.18), rgba(122, 92, 255, 0.18));
  flex: 0 0 68px;
}

.programming-icon img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  display: block;
}

.python-icon {
  box-shadow: inset 0 0 0 1px rgba(47, 111, 237, 0.18);
}

.pascal-icon {
  box-shadow: inset 0 0 0 1px rgba(122, 92, 255, 0.18);
}

.programming-content h3 {
  margin: 0 0 6px;
  font-size: 1.15rem;
}

.programming-content p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.ide-shell {
  display: grid;
  gap: 18px;
}

.ide-shell .card {
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 18px 48px rgba(18, 28, 60, 0.16);
  overflow: hidden;
}

.ide-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.ide-toolbar h2 {
  margin: 0;
}

.ide-form {
  margin-top: 8px;
}

.ide-editor {
  width: 100%;
  min-height: 520px;
  border-radius: 18px;
  overflow: hidden;
}

.CodeMirror {
  height: 520px;
  border-radius: 18px;
  background: rgba(13, 18, 35, 0.82) !important;
  color: #eef2ff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 12px 30px rgba(9, 14, 28, 0.25);
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 15px;
  line-height: 1.6;
}

.CodeMirror-scroll {
  padding: 12px 0;
}

.CodeMirror-gutters {
  background: rgba(255, 255, 255, 0.04) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.10) !important;
}

.CodeMirror-linenumber {
  color: rgba(238, 242, 255, 0.55);
}

.CodeMirror-cursor {
  border-left: 2px solid #8bb4ff !important;
}

.CodeMirror-selected {
  background: rgba(122, 92, 255, 0.24) !important;
}

.cm-s-material-darker .cm-keyword {
  color: #a78bfa;
}

.cm-s-material-darker .cm-string {
  color: #7dd3fc;
}

.cm-s-material-darker .cm-number {
  color: #fbbf24;
}

.cm-s-material-darker .cm-comment {
  color: rgba(238, 242, 255, 0.38);
  font-style: italic;
}

.cm-s-material-darker .cm-def {
  color: #60a5fa;
}

.cm-s-material-darker .cm-variable {
  color: #e5e7eb;
}

.cm-s-material-darker .cm-builtin {
  color: #c084fc;
}

.ide-output {
  min-height: 170px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.28);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.26);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 12px 30px rgba(9, 14, 28, 0.10);
  white-space: pre-wrap;
  font-family: "JetBrains Mono", Consolas, monospace;
  line-height: 1.6;
}

.ide-output::selection {
  background: rgba(122, 92, 255, 0.30);
}

.ide-shell .btn {
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.ide-shell .btn.secondary {
  background: rgba(255, 255, 255, 0.14);
  color: #eef2ff;
}

.ide-shell .btn.secondary:hover,
.ide-shell .btn.secondary:focus {
  background: rgba(255, 255, 255, 0.20);
}

@media (max-width: 700px) {
  .CodeMirror {
    height: 440px;
  }

  .ide-toolbar {
    align-items: flex-start;
  }
}

.glass-card {
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
}

.app-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

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

.input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.36);
  color: var(--text);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
}

.input:focus {
  border-color: rgba(47, 111, 237, 0.5);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.12);
}

.textarea {
  min-height: 140px;
  resize: vertical;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
}

.app-table {
  width: 100%;
  border-collapse: collapse;
}

.app-table th,
.app-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  text-align: left;
  vertical-align: top;
}

.status {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 14px;
  display: inline-block;
}

.status-pending {
  background: rgba(251, 191, 36, 0.16);
  color: #fbbf24;
}

.status-approved {
  background: rgba(34, 197, 94, 0.16);
  color: #22c55e;
}

.status-rejected {
  background: rgba(239, 68, 68, 0.16);
  color: #ef4444;
}

.review-form {
  display: grid;
  gap: 8px;
  min-width: 220px;
}

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

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

.admin-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.profile-item {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 10px 24px rgba(18, 28, 60, 0.08);
}

.profile-label {
  display: block;
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 6px;
}

.profile-value {
  font-size: 16px;
  color: #111827;
  word-break: break-word;
}

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

.admin-notes-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: start;
}

.home-main {
  min-width: 0;
}

.news-sidebar {
  position: sticky;
  top: 92px;
  align-self: start;
  height: calc(100vh - 120px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
}

.news-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.news-header h2 {
  margin: 0;
}

.news-header span {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.14);
  color: #4f46e5;
}

.news-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
}

.news-card {
  display: block;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.34);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  box-shadow: 0 12px 30px rgba(18, 28, 60, 0.08);
}

.news-card:hover {
  transform: translateY(-2px);
  border-color: rgba(47, 111, 237, 0.28);
  background: rgba(255, 255, 255, 0.36);
}

.news-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 12px;
  color: rgba(238, 242, 255, 0.68);
}

.news-source {
  font-weight: 700;
  color: var(--accent);
}

.news-card h3 {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.35;
}

.news-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

* Фиксированное позиционирование поверх всего сайта в углу экрана */
.flash-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 380px;
    width: calc(100% - 40px); /* Безопасно для мобильных устройств */
}

/* Общая база для всех всплывающих карточек */
.flash-toast {
    padding: 14px 18px;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
}

/* Стилизация обычных уведомлений под ваш старый стеклянный стиль (Glassmorphism) */
.glass-toast-alert {
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.glass-toast-alert.success {
    background: rgba(233, 255, 241, 0.85);
    color: #146b2d;
}

.glass-toast-alert.error {
    background: rgba(255, 236, 236, 0.85);
    color: #9b1c1c;
}

.glass-toast-alert .toast-message {
    color: inherit;
    font-weight: 500;
}

/* Золотой премиум стиль для наград */
.achievement-toast {
    background: linear-gradient(135deg, #fff7e6 0%, #fff1d0 100%);
}

.toast-icon {
    font-size: 24px;
    margin-right: 12px;
    display: flex;
    align-items: center;
}

.achievement-toast .toast-icon {
    font-size: 32px;
    animation: bounce 1s infinite alternate;
}

.toast-body {
    flex-grow: 1;
}

.toast-title {
    font-weight: bold;
    color: #ffb300ea;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 2px;
}

.toast-message {
    margin: 0;
    font-size: 15px;
}

.achievement-toast .toast-message {
    color: #493910;
    font-weight: 500;
}

.toast-close {
    background: none;
    border: none;
    font-size: 22px;
    color: cubic-bezier;
    cursor: pointer;
    opacity: 0.6;
    padding: 0 0 0 10px;
}

.toast-close:hover {
    opacity: 1;
}

.animate-toast {
    animation: slideIn 0.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(-120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 0.6;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 0.6;
    }
    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-3px); }
}

.achievement-card {
    padding: 5px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.08);
    text-align: center;
    transition: transform 0.3s;
}

.achievement-card:hover {
    transform: translateY(-4px);
}

.achievement-card.unlocked {
    background: rgba(72, 84, 252, 0.1);
}

.achievement-icon {
    font-size: 45px;
    margin-bottom: 5px;
}

/* Плавное включение кнопки удаления */
.btn.danger:not([disabled]) {
    opacity: 1 !important;
    cursor: pointer;
    background: #ff4d4f;
    box-shadow: 0 4px 12px rgba(255, 77, 79, 0.2);
}

.btn.danger[disabled] {
    cursor: not-allowed;
    background: #cccccc;
    color: #666666;
    border: none;
}

/* Контейнер сообщений чата */
.chat-messages-container {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
    padding-right: 8px;
}

/* Базовый стиль облачка сообщения */
.chat-bubble {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

/* Сообщения текущего пользователя (выравнивание по правому краю) */
.chat-bubble.bubble-me {
    align-self: flex-end;
    background: rgba(233, 255, 241, 0.9);
    color: #146b2d;
}

/* Сообщения собеседника (выравнивание по левому краю) */
.chat-bubble.bubble-other {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.85);
    color: #333;
}

/* Стили имени автора */
.bubble-author {
    display: block;
    font-weight: bold;
    margin-bottom: 2px;
}

.bubble-author.author-teacher {
    color: #b78103;
}

.bubble-author.author-student {
    color: #1677ff;
}

/* Текст сообщения */
.bubble-text {
    margin: 0;
    font-size: 15px;
    line-height: 1.4;
    color: inherit;
}

/* Время отправки */
.bubble-time {
    display: block;
    text-align: right;
    font-size: 10px;
    opacity: 0.6;
    margin-top: 4px;
    color: inherit;
}

.admin-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
}

.teacher-layout {
    display: grid;
    grid-template-columns: 1fr;
}

/* Классы цветов для разных типов уведомлений */
.notif-type-report {
    color: #ff5252; /* Красный */
}

.notif-type-contest {
    color: #ffca28; /* Желтый */
}

.notif-type-message {
    color: #00e676; /* Зеленый */
}

@media (max-width: 992px) {
  .home-layout {
    grid-template-columns: 1fr; /* Переключаем сетку в одну колонку */
    gap: 32px;
  }

  .news-sidebar {
    position: static; /* Отменяем sticky-позиционирование */
    height: auto; /* Сбрасываем фиксированную высоту, чтобы показать все новости */
    overflow: visible; /* Разрешаем контенту растягивать блок */
    max-height: none;
  }
}
