/* ==========================================================================
   ПУБЛИЧНЫЕ СТРАНИЦЫ: hero, карточки, обо мне, расписание, материалы,
   кадрирование обложек.
   Подключать ПОСЛЕ layout.css.
   ========================================================================== */

/* ==========================================================================
   1. Hero (index.html)
   ========================================================================== */
.hero {
  --hero-x: 0.5;
  --hero-overlay: 0.5;
  --hero-align: center;
  --hero-text-color: #ffffff;
  --hero-content-max: 1000px;

  position: relative;
  display: flex;
  align-items: center;
  min-height: clamp(360px, 60vh, 620px);
  padding: clamp(40px, 6vw, 80px) clamp(20px, 6vw, 80px);
  color: var(--hero-text-color, #ffffff);
  background-image: var(--hero-bg-desktop, url('../images/bg-main.jpg'));
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
  max-width: 100vw;
}
.hero::before {
  content: '';
  flex: var(--hero-x, 0.5) 1 0;
  min-width: 0;
  align-self: stretch;
}
.hero::after {
  content: '';
  flex: calc(1 - var(--hero-x, 0.5)) 1 0;
  min-width: 0;
  align-self: stretch;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(91, 42, 86, var(--hero-overlay, 0.5));
}
.hero-content {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  width: fit-content;
  max-width: min(var(--hero-content-max), 100%);
  text-align: var(--hero-align, center);
}
.hero-content h1 {
  font-family: var(--hero-title-ff, 'Playfair Display', serif);
  font-size: var(--hero-title-fs, var(--fs-hero));
  letter-spacing: clamp(1px, 0.2vw, 2px);
  line-height: 1.05;
  margin-bottom: clamp(8px, 1vw, 15px);
  overflow-wrap: break-word;
  word-break: break-word;
}
.hero-content h3 {
  font-family: var(--hero-subtitle-ff, 'Montserrat', sans-serif);
  font-size: var(--hero-subtitle-fs, clamp(13px, 1.1vw, 18px));
  font-weight: 300;
  letter-spacing: clamp(1px, 0.3vw, 3px);
  margin-bottom: clamp(8px, 1vw, 15px);
  overflow-wrap: break-word;
  word-break: break-word;
}
.slogan {
  font-family: var(--hero-slogan-ff, 'Playfair Display', serif);
  font-size: var(--hero-slogan-fs, clamp(15px, 1.6vw, 24px));
  font-style: italic;
  margin-bottom: clamp(10px, 1.2vw, 15px);
  overflow-wrap: break-word;
  word-break: break-word;
}
.btn-hero {
  font-family: var(--hero-button-ff, 'Montserrat', sans-serif);
  font-size: var(--hero-button-fs, inherit);
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid currentColor;
  backdrop-filter: blur(4px);
}
.btn-hero:hover { background: rgba(255, 255, 255, 0.9); color: var(--primary); }

@media (max-width: 1024px) {
  .hero {
    background-image: var(
      --hero-bg-mobile,
      var(--hero-bg-desktop, url('../images/bg-main-mob.png'))
    );
  }
  .hero-overlay {
    background: rgba(91, 42, 86, var(--hero-overlay-mobile, var(--hero-overlay, 0.5)));
  }
  .hero::before { flex: var(--hero-x-mobile, var(--hero-x, 0.5)) 1 0; }
  .hero::after { flex: calc(1 - var(--hero-x-mobile, var(--hero-x, 0.5))) 1 0; }
  .hero-content {
    text-align: var(--hero-align-mobile, var(--hero-align, center));
  }
}
@media (max-height: 800px) {
  .hero { min-height: clamp(300px, 50vh, 500px); }
}

/* ==========================================================================
   2. Карточки (index.html)
   ========================================================================== */
.cards {
  position: relative;
  z-index: 10;
  margin-top: clamp(-60px, -5vw, -40px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: clamp(14px, 1.5vw, 22px);
  padding: 0 clamp(16px, 4vw, 50px);
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}
.card {
  background: var(--surface);
  padding: clamp(20px, 2.2vw, 30px);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  text-align: center;
  border-bottom: 3px solid var(--primary);
  transition: var(--transition), background-color 0.25s ease;
}
.card:hover { transform: translateY(-10px); box-shadow: var(--shadow-hover); }
.card-icon {
  width: clamp(38px, 4vw, 50px);
  height: clamp(38px, 4vw, 50px);
  margin: 0 auto clamp(12px, 1.5vw, 20px);
  color: var(--primary);
  display: block;
  font-size: clamp(30px, 3.5vw, 40px);
  font-weight: 800;
}
.card h4 {
  font-family: var(--card-title-ff, 'Montserrat', sans-serif);
  font-size: var(--card-title-fs, clamp(15px, 1.3vw, 18px));
  color: var(--primary);
  margin-bottom: clamp(10px, 1.2vw, 15px);
}
.card p {
  font-family: var(--card-text-ff, 'Montserrat', sans-serif);
  font-size: var(--card-text-fs, var(--fs-sm));
  line-height: 1.6;
  margin-bottom: clamp(12px, 1.5vw, 20px);
  color: var(--text-light);
}
.card a {
  font-family: var(--card-link-ff, 'Montserrat', sans-serif);
  font-size: var(--card-link-fs, var(--fs-sm));
  color: var(--primary);
  font-weight: 600;
}

/* ==========================================================================
   3. Обо мне (index.html)
   ========================================================================== */
.about-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: clamp(20px, 2.5vw, 40px);
  padding: var(--sp-xl) clamp(16px, 4vw, 50px);
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
}
.about-text, .about-news, .quote {
  background: var(--surface);
  padding: clamp(22px, 2.5vw, 40px);
  border-radius: var(--border-radius);
  min-width: 0;
  transition: background-color 0.25s ease;
}
.about-text h2, .news-header h3 {
  font-size: var(--fs-xl);
  color: var(--primary);
  margin-bottom: clamp(14px, 1.5vw, 20px);
}
.about-text h2 {
  font-family: var(--about-title-ff, 'Montserrat', sans-serif);
  font-size: var(--about-title-fs, var(--fs-xl));
}
.about-text p {
  font-family: var(--about-text-ff, 'Montserrat', sans-serif);
  font-size: var(--about-text-fs, inherit);
  margin-bottom: clamp(20px, 2vw, 30px);
  line-height: 1.7;
}
.about-text .btn {
  font-family: var(--about-button-ff, 'Montserrat', sans-serif);
  font-size: var(--about-button-fs, inherit);
}
.news-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: clamp(16px, 2vw, 30px);
  flex-wrap: wrap;
}
.news-header a { font-size: var(--fs-xs); color: var(--primary); white-space: nowrap; }
.news-item { display: flex; gap: 15px; margin-bottom: 20px; min-width: 0; }
.news-item img {
  width: clamp(60px, 6vw, 80px);
  height: clamp(60px, 6vw, 80px);
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.news-content { min-width: 0; }
.news-content .date { font-size: var(--fs-xs); color: var(--text-light); display: block; margin-bottom: 5px; }
.news-content h5 { font-size: var(--fs-md); margin-bottom: 5px; color: var(--text); }
.news-content p { font-size: var(--fs-xs); color: var(--text-light); }
.quote { background: var(--tint-bg); position: relative; }
.quote-icon {
  font-size: clamp(60px, 6vw, 80px);
  color: var(--primary);
  position: absolute;
  top: 10px; left: 20px;
  font-family: 'Playfair Display', serif;
  line-height: 1;
  opacity: 0.35;
}
.quote p {
  font-family: var(--quote-text-ff, 'Playfair Display', serif);
  font-size: var(--quote-text-fs, var(--fs-lg));
  font-style: italic;
  position: relative;
  z-index: 1;
  margin-top: 30px;
  margin-bottom: 20px;
}
.quote span {
  font-family: var(--quote-author-ff, 'Montserrat', sans-serif);
  font-size: var(--quote-author-fs, var(--fs-sm));
  display: block;
  text-align: right;
  color: var(--text-light);
}

.about-full {
  display: flex;
  gap: clamp(24px, 3vw, 50px);
  align-items: center;
  padding: var(--sp-xl) clamp(16px, 4vw, 50px);
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: wrap;
}
.about-full-img, .about-full-text { flex: 1 1 320px; min-width: 0; }
.about-full-img img { border-radius: 15px; box-shadow: var(--shadow); }
.about-full-text h2 { color: var(--primary); margin-bottom: 20px; font-size: var(--fs-2xl); }
.about-full-text p { margin-bottom: 20px; line-height: 1.8; }
.news-icon { font-size: 40px; color: var(--primary); width: 80px; text-align: center; }
.news-img { width: 80px; height: 80px; border-radius: 8px; object-fit: cover; }

/* ==========================================================================
   4. Расписание — контейнер
   ========================================================================== */
.schedule-container {
  max-width: 80vw;
  margin: clamp(20px, 3vw, 40px) auto;
  padding: 0 clamp(14px, 2vw, 20px);
  box-sizing: border-box;
}
@media (max-width: 1200px) {
  .schedule-container { max-width: 100%; }
}

.schedule-status {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-light);
  min-height: 18px;
}

/* ==========================================================================
   5. Расписание — недельная сетка
   ========================================================================== */
.week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.week-nav-title {
  font-size: clamp(16px, 1.4vw, 20px);
  font-weight: 600;
  color: var(--primary);
  text-align: center;
  flex: 1 1 auto;
  min-width: 200px;
}
.week-nav-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--divider);
  background: var(--surface);
  color: var(--primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background 0.2s;
  flex-shrink: 0;
}
.week-nav-btn:hover { background: var(--hover-tint); }
.week-nav-today {
  padding: 10px 20px;
  border-radius: 24px;
  border: 1px solid var(--primary);
  background: var(--surface);
  color: var(--primary);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}
.week-nav-today:hover { background: var(--primary); color: var(--surface); }

.week-grid-wrap {
  overflow: auto;
  max-height: 72vh;
  border-radius: 14px;
  box-shadow: var(--shadow);
  background: var(--surface);
  margin-bottom: 20px;
  position: relative;
  max-width: 100%;
  box-sizing: border-box;
}
.week-grid {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}
.week-grid thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--primary);
  color: var(--surface);
  padding: 12px 6px;
  font-weight: 500;
  font-size: 13px;
  text-align: center;
  border-right: 1px solid rgba(255,255,255,0.12);
  box-sizing: border-box;
}
.week-grid thead th:last-child { border-right: none; }
.week-grid thead th.week-grid-time-head {
  left: 0;
  z-index: 6;
  width: 72px;
  background: var(--primary-dark);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.95;
}
.week-grid thead th.is-today { background: var(--primary-dark); }
.week-grid thead th.is-today::after {
  content: 'сегодня';
  display: block;
  font-size: 10px;
  font-weight: 400;
  opacity: 0.75;
  margin-top: 3px;
  letter-spacing: 0.5px;
}
.week-grid tbody tr { height: 64px; }
.week-grid tbody td {
  border-bottom: 1px solid var(--divider);
  border-right: 1px solid var(--divider);
  padding: 3px 4px;
  vertical-align: top;
  height: 64px;
  box-sizing: border-box;
  overflow: visible;
}
.week-grid tbody td:last-child { border-right: none; }
.week-grid tbody tr:last-child td { border-bottom: none; }
.week-grid tbody td.week-grid-time {
  position: sticky;
  left: 0;
  z-index: 4;
  background: var(--bg);
  font-size: 11px;
  color: var(--text-light);
  font-weight: 600;
  text-align: center;
  vertical-align: middle;
  width: 72px;
  padding: 0 4px;
  border-right: 1px solid var(--divider);
  letter-spacing: 0.3px;
}
.week-grid tbody tr:nth-child(even) td:not(.week-grid-time) { background: var(--tint-bg); }
.week-grid tbody td.is-today { background: var(--hover-tint); }
.week-grid tbody tr:nth-child(even) td.is-today { background: var(--hover-tint); }

.lesson-card {
  background: var(--hover-tint);
  border-left: 3px solid var(--primary);
  border-radius: 5px;
  padding: 4px 6px;
  margin-bottom: 3px;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
  line-height: 1.25;
}
.lesson-card:hover {
  background: color-mix(in srgb, var(--primary) 15%, var(--surface));
  filter: none;
}
.lesson-card:last-child { margin-bottom: 0; }
.lesson-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 1px;
}
.lesson-card-time { font-weight: 700; color: var(--primary); font-size: 11px; }
.lesson-card-student {
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lesson-card-subject {
  color: var(--text-light);
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lesson-card-actions {
  display: flex;
  gap: 3px;
  opacity: 0;
  transition: opacity 0.15s;
  flex-shrink: 0;
}
.lesson-card:hover .lesson-card-actions { opacity: 1; }
.lesson-card-actions button {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  border: none;
  cursor: pointer;
  font-size: 9px;
  color: #fff;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.lesson-card-btn-edit { background: var(--icon-btn-primary-bg); }
.lesson-card-btn-edit:hover { background: var(--icon-btn-primary-hover); }
.lesson-card-btn-del { background: var(--icon-btn-danger-bg); }
.lesson-card-btn-del:hover { background: var(--icon-btn-danger-hover); }

.week-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
  font-style: italic;
  background: var(--tint-bg);
  border-radius: 12px;
}

@media (max-width: 768px) {
  .week-nav-title { font-size: 15px; }
  .week-nav-btn { width: 36px; height: 36px; font-size: 14px; }
  .week-nav-today { padding: 8px 14px; font-size: 12px; }
  .week-grid thead th.week-grid-time-head,
  .week-grid tbody td.week-grid-time { width: 56px; font-size: 10px; }
  .week-grid tbody tr { height: 56px; }
  .week-grid tbody td { height: 56px; padding: 2px 3px; }
  .lesson-card { padding: 3px 5px; font-size: 10px; }
  .lesson-card-actions { opacity: 1; }
}

/* ==========================================================================
   6. Расписание — оффгрид и панель действий
   ========================================================================== */
.week-nav-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
.week-nav-action {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--divider);
  background: var(--surface);
  color: var(--primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: background 0.2s;
  flex-shrink: 0;
}
.week-nav-action:hover { background: var(--hover-tint); }
.week-grid tbody td[data-date][data-slot] { cursor: pointer; transition: background 0.15s; }
.admin-role .week-grid tbody td[data-date][data-slot]:hover {
  background: var(--hover-tint);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--primary) 15%, transparent);
}
.lesson-card--offgrid {
  border-left-color: var(--sem-warning);
  background: var(--sem-warning-bg);
  border-top: 2px dashed var(--sem-warning);
}
.lesson-card--offgrid:hover {
  background: color-mix(in srgb, var(--sem-warning) 20%, var(--surface));
}
.lesson-card--offgrid .lesson-card-time { color: var(--sem-warning-text); }
.lesson-card--offgrid::before {
  content: '!';
  position: absolute;
  top: 3px;
  right: 4px;
  color: var(--sem-warning);
  font-weight: 700;
  font-size: 11px;
  line-height: 1;
  pointer-events: none;
}
.lesson-card--offgrid .lesson-card-actions { padding-right: 14px; }
@media (max-width: 768px) {
  .week-nav-action { width: 36px; height: 36px; font-size: 13px; }
  .week-nav-actions { gap: 6px; }
}

/* ==========================================================================
   7. Lesson — контейнер страницы занятия
   ========================================================================== */
.lesson-container {
  max-width: 1000px;
  margin: clamp(20px, 3vw, 40px) auto;
  padding: 0 clamp(14px, 2vw, 20px);
}
.admin-role .btn-enroll { display: none !important; }
.children-container { padding-left: 20px; border-left: 2px dashed var(--divider); }

.lesson-card-panel {
  background: var(--surface);
  border-radius: 10px;
  padding: 30px;
  box-shadow: var(--shadow);
}
.lesson-panel-title {
  color: var(--primary);
  margin: 0 0 20px;
}
.lesson-panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 20px 0;
}
.lesson-panel-actions {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}
.lesson-btn-cancel {
  background: var(--sem-error) !important;
  color: #fff !important;
}
.lesson-btn-cancel:hover {
  background: color-mix(in srgb, var(--sem-error) 80%, black) !important;
}
.lesson-error {
  color: var(--sem-error-text);
  text-align: center;
  padding: 20px;
}

/* ==========================================================================
   8. Материалы — публичная страница
   ========================================================================== */
.materials-page {
  max-width: 1400px; margin: 0 auto;
  padding: clamp(20px, 3vw, 40px) clamp(14px, 3vw, 24px);
}
.mat-loading {
  text-align: center; padding: 60px 20px;
  color: var(--text-light); font-style: italic; grid-column: 1 / -1;
}
.mat-layout {
  display: grid; grid-template-columns: 260px minmax(0, 1fr);
  gap: clamp(18px, 2vw, 28px); align-items: start;
}
.mat-sidebar {
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow);
  padding: 16px 14px; position: sticky; top: 20px;
  transition: background-color 0.25s ease;
}
.mat-sidebar-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-light);
  padding: 0 8px 10px; border-bottom: 1px solid var(--divider); margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}
.mat-cat-tree { display: flex; flex-direction: column; gap: 2px; }
.mat-cat-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 8px;
  border: none; background: transparent; cursor: pointer;
  font-family: inherit; font-size: 14px; color: var(--text);
  text-align: left; width: 100%;
  transition: background 0.15s, color 0.15s;
}
.mat-cat-item:hover { background: var(--hover-tint); color: var(--primary); }
.mat-cat-item.active { background: var(--primary); color: var(--surface); font-weight: 500; }
.mat-cat-item i { color: var(--cat-color, var(--primary)); width: 16px; text-align: center; font-size: 14px; }
.mat-cat-item.active i { color: var(--surface); }
.mat-cat-name { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mat-cat-count {
  font-size: 11px; background: var(--hover-tint); color: var(--primary);
  padding: 1px 7px; border-radius: 10px; font-weight: 600; flex-shrink: 0;
}
.mat-cat-item.active .mat-cat-count { background: rgba(255, 255, 255, 0.25); color: var(--surface); }
.mat-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.mat-admin-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mat-admin-actions .btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; font-size: 13px; }
.mat-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.mat-search {
  flex: 1 1 260px; min-width: 0; position: relative;
  background: var(--surface); border-radius: 26px; box-shadow: var(--shadow);
  padding: 0 18px; display: flex; align-items: center; gap: 10px;
}
.mat-search i { color: var(--text-light); font-size: 14px; }
.mat-search input {
  flex: 1 1 auto; min-width: 0; border: none; background: transparent;
  padding: 13px 0; font-family: inherit; font-size: 14px; outline: none; color: var(--text);
}
.mat-sort {
  padding: 12px 18px; border-radius: 26px;
  border: 1px solid var(--input-border); background: var(--input-bg);
  font-family: inherit; font-size: 13px; cursor: pointer; outline: none;
  color: var(--input-text);
}
.mat-sort:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent); }
.mat-active-filter { display: flex; gap: 8px; flex-wrap: wrap; min-height: 0; }
.mat-filter-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--hover-tint); color: var(--primary);
  padding: 6px 8px 6px 14px; border-radius: 20px;
  font-size: 13px; font-weight: 500;
}
.mat-filter-chip button {
  background: var(--hover-tint); border: none;
  width: 20px; height: 20px; border-radius: 50%;
  cursor: pointer; color: var(--primary);
  font-size: 14px; line-height: 1; padding: 0;
}
.mat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.mat-card {
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow);
  overflow: hidden; cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background-color 0.25s ease;
  display: flex; flex-direction: column;
  position: relative; min-height: 260px;
}
.mat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.mat-card-cover {
  height: 140px;
  background-size: cover; background-position: center; background-color: var(--hover-tint);
}
.mat-card-cover--empty {
  display: flex; align-items: center; justify-content: center;
  color: var(--primary); font-size: 40px;
  background: var(--hover-tint); opacity: 0.8;
}
.mat-card-cover--icon {
  display: flex !important; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  background: var(--hover-tint);
  color: var(--icon-color, var(--primary));
}
.mat-card-cover--icon i { font-size: 44px; line-height: 1; }
.mat-card-cover-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.8px; opacity: 0.75;
}
.mat-card-body {
  padding: 14px 16px 16px;
  display: flex; flex-direction: column; gap: 8px;
  flex: 1 1 auto; min-width: 0;
}
.mat-card-top { display: flex; gap: 6px; flex-wrap: wrap; }
.mat-cat-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600;
  color: var(--cat-color, var(--primary));
  background: var(--hover-tint);
  padding: 3px 9px; border-radius: 10px;
  max-width: 100%;
}
.mat-cat-badge i { font-size: 10px; }
.mat-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--text-light); background: var(--tint-bg);
  padding: 2px 8px; border-radius: 10px;
}
.mat-badge--draft {
  background: var(--sem-warning-bg);
  color: var(--sem-warning-text);
  font-weight: 600;
}
.mat-card-title {
  font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.35; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mat-card-desc {
  font-size: 13px; color: var(--text-light); line-height: 1.45; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mat-card-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.mat-tag {
  font-size: 11px; color: var(--primary); background: var(--hover-tint);
  padding: 2px 8px; border-radius: 10px;
}
.mat-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-top: auto; padding-top: 8px;
  border-top: 1px dashed var(--divider);
}
.mat-card-badges { display: flex; gap: 5px; flex-wrap: wrap; }
.mat-card-date { font-size: 11px; color: var(--text-light); white-space: nowrap; }
.mat-card-actions {
  position: absolute; top: 8px; right: 8px;
  display: flex; gap: 4px; opacity: 0;
  transition: opacity 0.2s; z-index: 2;
}
.mat-card:hover .mat-card-actions { opacity: 1; }
.mat-card-actions button {
  width: 30px; height: 30px; border-radius: 50%;
  border: none; cursor: pointer;
  color: var(--icon-btn-color);
  background: var(--icon-btn-primary-bg);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; padding: 0;
  transition: background 0.15s, transform 0.15s;
}
.mat-card-actions button[data-action="delete"] {
  background: var(--icon-btn-danger-bg);
}
.mat-card-actions button:hover {
  transform: scale(1.1);
  background: var(--icon-btn-primary-hover);
}
.mat-card-actions button[data-action="delete"]:hover {
  background: var(--icon-btn-danger-hover);
}
.mat-empty { text-align: center; padding: 60px 20px; color: var(--text-light); font-style: italic; }
.mat-pagination { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.mat-page {
  min-width: 38px; height: 38px; padding: 0 12px;
  border-radius: 20px; border: 1px solid var(--divider);
  background: var(--surface); color: var(--primary);
  font-family: inherit; font-size: 13px; cursor: pointer;
  transition: all 0.15s;
}
.mat-page:hover { background: var(--hover-tint); }
.mat-page.active { background: var(--primary); color: var(--surface); border-color: var(--primary); }

.mat-breadcrumbs {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  font-size: 13px; color: var(--text-light); padding: 4px 0 8px;
}
.mat-crumb {
  background: none; border: none; padding: 4px 10px; border-radius: 8px;
  font-family: inherit; font-size: 13px; color: var(--primary);
  cursor: pointer; transition: background 0.15s;
}
.mat-crumb:hover { background: var(--hover-tint); }
.mat-crumb.is-current {
  color: var(--text); font-weight: 600; cursor: default; background: var(--hover-tint);
}
.mat-crumb.is-current:hover { background: var(--hover-tint); }
.mat-crumb-sep { color: var(--text-light); opacity: 0.5; user-select: none; font-size: 12px; }

.mat-folder-card {
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow);
  overflow: hidden; cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background-color 0.25s ease;
  display: flex; flex-direction: column;
  min-height: 260px; position: relative;
}
.mat-folder-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.mat-folder-cover {
  height: 200px; display: flex;
  align-items: center; justify-content: center;
  position: relative; overflow: hidden; background: transparent;
}
.mat-folder-cover > i { font-size: 160px; line-height: 1; color: var(--cat-color, var(--primary)); }
.mat-folder-badge {
  position: absolute; top: 14px; right: 14px;
  min-width: 30px; height: 30px; padding: 0 10px;
  border-radius: 15px; background: var(--hover-tint);
  color: var(--cat-color, var(--primary));
  font-size: 13px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--divider); z-index: 2;
}
.mat-folder-info {
  padding: 0 18px 18px;
  display: flex; flex-direction: column; gap: 8px;
  flex: 1 1 auto; min-width: 0;
}
.mat-folder-name {
  font-size: 16px; font-weight: 700; color: var(--text); margin: 0; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  word-break: break-word; text-align: center;
}
.mat-folder-meta {
  font-size: 13px; color: var(--text-light);
  margin-top: auto; padding-top: 12px;
  border-top: 1px dashed var(--divider);
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.mat-folder-meta::before {
  content: '';
  display: inline-block; width: 13px; height: 13px;
  background-color: var(--cat-color, var(--primary)); opacity: 0.6;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M64 480H448c35.3 0 64-28.7 64-64V160c0-35.3-28.7-64-64-64H298.5c-17 0-33.3-6.7-45.3-18.7L226.7 50.7c-12-12-28.3-18.7-45.3-18.7H64C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M64 480H448c35.3 0 64-28.7 64-64V160c0-35.3-28.7-64-64-64H298.5c-17 0-33.3-6.7-45.3-18.7L226.7 50.7c-12-12-28.3-18.7-45.3-18.7H64C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64z'/%3E%3C/svg%3E");
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  flex-shrink: 0;
}

/* --- Массовый выбор материалов --- */
.mat-card-checkbox {
  position: absolute; top: 10px; left: 10px;
  z-index: 5;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(4px);
  border: 1px solid var(--divider);
}
.mat-card-checkbox input {
  position: absolute; opacity: 0; pointer-events: none;
}
.mat-card-checkbox-box {
  width: 16px; height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--divider);
  background: transparent;
  position: relative;
  transition: border-color 0.15s, background 0.15s;
}
.mat-card-checkbox-box::after {
  content: '';
  position: absolute; left: 4px; top: 1px;
  width: 5px; height: 9px;
  border: 2px solid #fff;
  border-top: 0; border-left: 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.15s;
}
.mat-card-checkbox input:checked ~ .mat-card-checkbox-box {
  background: var(--primary);
  border-color: var(--primary);
}
.mat-card-checkbox input:checked ~ .mat-card-checkbox-box::after {
  transform: rotate(45deg) scale(1);
}

.mat-card.is-selected {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 60%, transparent), var(--shadow);
}

.mat-bulk-bar {
  position: fixed;
  left: 50%; bottom: 24px;
  transform: translateX(-50%);
  z-index: 800;
  display: flex; align-items: center; gap: 20px;
  padding: 12px 20px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--divider);
  max-width: calc(100vw - 32px);
  animation: mat-bulk-in 0.2s ease;
}
.mat-bulk-bar[hidden] { display: none !important; }
@keyframes mat-bulk-in {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.mat-bulk-info {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--text);
  font-weight: 500;
}
.mat-bulk-info i { color: var(--primary); }
.mat-bulk-count { color: var(--primary); }
.mat-bulk-actions { display: flex; gap: 8px; }

#mat-bulk-toggle.active {
  background: var(--primary);
  color: var(--surface);
  border-color: var(--primary);
}

/* Модалка деталей материала */
.swal2-popup.mat-detail-modal {
  width: min(720px, 94vw) !important;
  padding: 32px 32px 26px !important;
  border-radius: 18px !important;
  text-align: left;
}
.swal2-popup.mat-detail-modal .swal2-title {
  display: none !important; padding: 0 !important; margin: 0 !important;
}
.mat-detail { text-align: left; }
.mat-detail-title {
  margin: 0 0 14px;
  font-family: 'Montserrat', sans-serif;
  font-size: 22px; line-height: 1.3; font-weight: 700;
  color: var(--primary);
  padding-right: 44px;
}
.mat-detail-cat {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600;
  color: var(--cat-color, var(--primary));
  background: var(--hover-tint);
  padding: 4px 12px; border-radius: 12px; margin-bottom: 14px;
}
.mat-detail-cover { margin: 0 0 16px; border-radius: 12px; overflow: hidden; max-height: 300px; }
.mat-detail-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mat-detail-desc { font-size: 15px; color: var(--text); line-height: 1.55; margin: 0 0 14px; }
.mat-detail-content { font-size: 14px; color: var(--text); line-height: 1.6; margin: 0 0 16px; }
.mat-detail-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.mat-detail-file {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; background: var(--tint-bg);
  border: 1px solid var(--divider); border-radius: 12px;
  text-decoration: none; color: var(--primary);
  margin-bottom: 12px; transition: background 0.2s;
}
.mat-detail-file:hover { background: var(--hover-tint); }
.mat-detail-file > i:first-child { font-size: 22px; flex-shrink: 0; }
.mat-detail-file-text { flex: 1 1 auto; min-width: 0; }
.mat-detail-file-name {
  font-weight: 600; font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mat-detail-file-size { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.mat-detail-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; background: var(--primary); color: var(--surface);
  border-radius: 22px; text-decoration: none;
  font-size: 13px; font-weight: 500; margin-bottom: 12px;
}
.mat-detail-link:hover { background: var(--primary-dark); }
.mat-detail-meta {
  font-size: 12px; color: var(--text-light); text-align: right;
  border-top: 1px dashed var(--divider); padding-top: 12px; margin-top: 6px;
}
.swal2-html-container .mat-detail-content ul,
.swal2-html-container .mat-detail-content ol {
  display: block !important; padding-left: 28px !important; margin: 10px 0 !important;
}
.swal2-html-container .mat-detail-content li { display: list-item !important; }

@media (max-width: 900px) {
  .mat-layout { grid-template-columns: 1fr; }
  .mat-sidebar { position: static; }
  .mat-cat-tree { max-height: 240px; overflow-y: auto; }
}
@media (max-width: 640px) {
  .mat-grid { grid-template-columns: 1fr; }
  .mat-toolbar { flex-direction: column; align-items: stretch; }
  .mat-sort { width: 100%; }
  .swal2-popup.mat-detail-modal { padding: 24px 20px 20px !important; }
  .mat-folder-card { min-height: 220px; }
  .mat-folder-cover { height: 150px; }
  .mat-folder-cover > i { font-size: 110px; }
}

/* ==========================================================================
   9. Шаблоны материалов
   ========================================================================== */
.mat-template-row { display: flex; gap: 8px; align-items: stretch; width: 100%; }
.mat-template-row > select { flex: 1 1 auto; min-width: 0; }
.mat-template-row > .btn { flex: 0 0 auto; padding: 8px 14px; }
.mtpl-search {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; background: var(--tint-bg);
  border: 1px solid var(--divider); border-radius: 10px;
}
.mtpl-search i { color: var(--text-light); font-size: 14px; }
.mtpl-search input {
  flex: 1 1 auto; border: none; background: transparent;
  outline: none; padding: 4px 0; font-family: inherit;
  font-size: 14px; color: var(--text);
}
.mtpl-thumb {
  width: 56px; height: 40px; flex-shrink: 0;
  border-radius: 8px; background-size: cover;
  background-position: center; background-color: var(--hover-tint);
  border: 1px solid var(--divider);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-light); opacity: 0.5; font-size: 16px;
}
.mtpl-thumb--empty { background: var(--hover-tint); }

.swal2-popup.cm-modal { width: min(640px, 94vw) !important; text-align: left; }
.cm-container { text-align: left; }
.cm-toolbar { margin-bottom: 12px; }
.cm-tree {
  display: flex; flex-direction: column; gap: 2px;
  max-height: 60vh; overflow-y: auto; padding-right: 4px;
}
.cm-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px; transition: background 0.15s;
}
.cm-item:hover { background: var(--tint-bg); }
.cm-name { flex: 1 1 auto; min-width: 0; }
.cm-count {
  font-size: 11px; background: var(--hover-tint); color: var(--primary);
  padding: 1px 8px; border-radius: 10px; font-weight: 600;
}
.cm-actions { display: flex; gap: 4px; opacity: 0; transition: opacity 0.15s; }
.cm-item:hover .cm-actions { opacity: 1; }
.cm-btn {
  width: 28px; height: 28px; border-radius: 50%;
  border: none; background: var(--primary); color: #fff;
  cursor: pointer; font-size: 11px; padding: 0;
}
.cm-btn:hover { background: var(--primary-dark); }
.cm-btn-danger { background: var(--sem-error); }
.cm-btn-danger:hover { background: color-mix(in srgb, var(--sem-error) 80%, black); }

/* Пикер шаблонов */
.tp-overlay {
  position: fixed; inset: 0;
  background: rgba(20, 10, 35, 0.6);
  z-index: var(--z-prompt-modal);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; backdrop-filter: blur(2px);
  animation: ip-fade 0.12s ease;
}
.tp-modal {
  background: var(--surface); border-radius: 16px;
  padding: 20px 22px 16px;
  width: min(560px, 96vw); max-height: 90vh;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  animation: ip-pop 0.15s ease;
  color: var(--text);
}
.tp-header { display: flex; align-items: center; justify-content: space-between; }
.tp-title { margin: 0; font-size: 18px; font-weight: 700; color: var(--primary); }
.tp-close {
  width: 34px; height: 34px; border-radius: 50%;
  border: none; background: var(--hover-tint); color: var(--primary);
  font-size: 20px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.tp-search {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; background: var(--tint-bg);
  border: 1px solid var(--divider); border-radius: 10px;
}
.tp-search i { color: var(--text-light); font-size: 14px; }
.tp-search input {
  flex: 1 1 auto; border: none; background: transparent;
  outline: none; padding: 6px 0; font-family: inherit;
  font-size: 14px; color: var(--text);
}
.tp-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 55vh; overflow-y: auto; padding: 4px 2px;
}
.tp-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; background: var(--tint-bg);
  border: 1px solid transparent; border-radius: 10px;
  cursor: pointer; text-align: left; font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}
.tp-item:hover { background: var(--surface); border-color: var(--primary); }
.tp-thumb {
  width: 56px; height: 40px; flex-shrink: 0;
  border-radius: 8px; background-size: cover; background-position: center;
  background-color: var(--hover-tint); border: 1px solid var(--divider);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-light); opacity: 0.5; font-size: 16px;
}
.tp-thumb--empty { background: var(--hover-tint); }
.tp-body { min-width: 0; flex: 1 1 auto; }
.tp-name { font-weight: 600; color: var(--text); font-size: 14px; margin-bottom: 2px; }
.tp-desc {
  font-size: 12px; color: var(--text-light);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tp-actions { display: flex; justify-content: flex-end; border-top: 1px solid var(--divider); padding-top: 10px; }

/* ==========================================================================
   10. Поля обложки и файла
   ========================================================================== */
.mat-cover-field,
.mat-file-field { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.mat-cover-preview {
  width: 100%; max-width: 340px; aspect-ratio: 16 / 9;
  border: 2px dashed var(--divider); border-radius: 10px;
  background: var(--tint-bg);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-light); font-size: 13px; gap: 8px;
  overflow: hidden; position: relative;
}
.mat-cover-preview i { font-size: 26px; }
.mat-cover-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mat-cover-preview.has-image { border-style: solid; border-color: var(--divider); background: var(--surface); }
.mat-cover-controls,
.mat-file-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.mat-file-preview {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; background: var(--tint-bg);
  border: 1px dashed var(--divider); border-radius: 10px;
  color: var(--text-light); font-size: 13px; min-height: 56px;
}
.mat-file-preview > i { font-size: 24px; flex-shrink: 0; }
.mat-file-preview.has-file {
  border-style: solid; border-color: var(--divider); background: var(--surface); color: var(--text);
}
.mat-file-preview .mat-file-info { min-width: 0; flex: 1 1 auto; }
.mat-file-preview .mat-file-name {
  font-weight: 600; font-size: 14px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mat-file-preview .mat-file-meta { font-size: 12px; color: var(--text-light); margin-top: 2px; }

/* ==========================================================================
   11. Кадрирование обложки (Cropper.js)
   ========================================================================== */
.crop-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(20, 10, 35, 0.7);
  z-index: var(--z-crop-modal);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; backdrop-filter: blur(3px);
}
.crop-modal {
  background: var(--surface); border-radius: 16px;
  padding: 22px 24px 18px;
  width: min(720px, 96vw); max-height: 94vh;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  color: var(--text);
}
.crop-modal-title { margin: 0; font-size: 18px; font-weight: 700; color: var(--primary); }
.crop-modal-hint { margin: 0; font-size: 13px; color: var(--text-light); }
.crop-modal-stage {
  flex: 1 1 auto; min-height: 0; max-height: 60vh;
  background: var(--tint-bg); border-radius: 10px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.crop-modal-stage img { max-width: 100%; max-height: 60vh; display: block; }
.crop-modal-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  padding-top: 6px; border-top: 1px solid var(--divider);
}
.crop-modal .cropper-view-box,
.crop-modal .cropper-face { border-radius: 6px; }
.crop-modal .cropper-line,
.crop-modal .cropper-point { background-color: var(--primary); }
.crop-modal .cropper-view-box { outline: 2px solid var(--primary); outline-color: var(--primary); }

/* ==========================================================================
   Расписание: неполные / прошедшие / offgrid / bulk-выделение
   ========================================================================== */

/* Урок, у которого не заданы обязательные поля */
.lesson-card--incomplete {
  border-left-color: var(--sem-error);
  border-left-style: dashed;
  background: var(--sem-error-soft, rgba(198, 40, 40, 0.08));
}
.lesson-card--incomplete:hover {
  background: color-mix(in srgb, var(--sem-error) 15%, var(--surface));
}
.lesson-card--incomplete .lesson-card-time { color: var(--sem-error-text); }
.lesson-card--incomplete::after {
  content: '?';
  position: absolute;
  top: 3px;
  right: 4px;
  color: var(--sem-error);
  font-weight: 700;
  font-size: 11px;
  line-height: 1;
  pointer-events: none;
}
.lesson-card--incomplete.lesson-card--offgrid::after { content: '?'; right: 16px; }

/* Прошедший урок */
.lesson-card--past {
  opacity: 0.55;
  filter: grayscale(0.4);
}
.lesson-card--past .lesson-card-time,
.lesson-card--past .lesson-card-subject,
.lesson-card--past .lesson-card-student,
.lesson-card--past .lesson-card-topic,
.lesson-card--past .lesson-card-date {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

/* Bulk-режим: ячейки */
.week-grid-wrap.is-bulk td[data-date][data-slot] {
  cursor: crosshair;
}
.week-grid-wrap.is-bulk td[data-date][data-slot]:hover {
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}
.week-grid tbody td.is-bulk-selected {
  background: color-mix(in srgb, var(--primary) 22%, var(--surface)) !important;
  box-shadow: inset 0 0 0 2px var(--primary);
}
.week-nav-action.is-active {
  background: var(--primary);
  color: var(--surface);
  border-color: var(--primary);
}
.week-nav-action.is-active:hover {
  background: var(--primary-dark);
  color: var(--surface);
}

/* Карточка в списке «Без времени» */
.week-notime {
  margin-top: 20px;
  padding: 16px 18px;
  background: var(--tint-bg);
  border: 1px dashed var(--divider);
  border-radius: 12px;
}
.week-notime-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700;
  color: var(--sem-warning-text);
  text-transform: uppercase; letter-spacing: 0.6px;
  margin-bottom: 12px;
}
.week-notime-title i { font-size: 14px; }
.week-notime-title > span {
  margin-left: auto;
  font-weight: 500;
  color: var(--text-light);
  text-transform: none;
  letter-spacing: 0;
}
.week-notime-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
.lesson-card--list {
  padding: 8px 10px;
  margin-bottom: 0;
  font-size: 12px;
  cursor: pointer;
}
.lesson-card--list .lesson-card-topic {
  color: var(--text-light);
  font-size: 11px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lesson-card--list .lesson-card-date {
  font-size: 10.5px;
  color: var(--text-light);
  margin-top: 4px;
  font-style: italic;
}

/* ==========================================================================
   Расписание: неполные / прошедшие / offgrid / bulk-выделение
   ========================================================================== */

.lesson-card--incomplete {
  border-left-color: var(--sem-error);
  border-left-style: dashed;
  background: var(--sem-error-soft, rgba(198, 40, 40, 0.08));
}
.lesson-card--incomplete:hover {
  background: color-mix(in srgb, var(--sem-error) 15%, var(--surface));
}
.lesson-card--incomplete .lesson-card-time { color: var(--sem-error-text); }
.lesson-card--incomplete::after {
  content: '?';
  position: absolute;
  top: 3px;
  right: 4px;
  color: var(--sem-error);
  font-weight: 700;
  font-size: 11px;
  line-height: 1;
  pointer-events: none;
}
.lesson-card--incomplete.lesson-card--offgrid::after { content: '?'; right: 16px; }

.lesson-card--past {
  opacity: 0.55;
  filter: grayscale(0.4);
}
.lesson-card--past .lesson-card-time,
.lesson-card--past .lesson-card-subject,
.lesson-card--past .lesson-card-student,
.lesson-card--past .lesson-card-topic,
.lesson-card--past .lesson-card-date {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.week-grid-wrap.is-bulk td[data-date][data-slot] {
  cursor: crosshair;
}
.week-grid-wrap.is-bulk td[data-date][data-slot]:hover {
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}
.week-grid tbody td.is-bulk-selected {
  background: color-mix(in srgb, var(--primary) 22%, var(--surface)) !important;
  box-shadow: inset 0 0 0 2px var(--primary);
}
.week-nav-action.is-active {
  background: var(--primary);
  color: var(--surface);
  border-color: var(--primary);
}
.week-nav-action.is-active:hover {
  background: var(--primary-dark);
  color: var(--surface);
}

.week-notime {
  margin-top: 20px;
  padding: 16px 18px;
  background: var(--tint-bg);
  border: 1px dashed var(--divider);
  border-radius: 12px;
}
.week-notime-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700;
  color: var(--sem-warning-text);
  text-transform: uppercase; letter-spacing: 0.6px;
  margin-bottom: 12px;
}
.week-notime-title i { font-size: 14px; }
.week-notime-title > span {
  margin-left: auto;
  font-weight: 500;
  color: var(--text-light);
  text-transform: none;
  letter-spacing: 0;
}
.week-notime-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
.lesson-card--list {
  padding: 8px 10px;
  margin-bottom: 0;
  font-size: 12px;
  cursor: pointer;
}
.lesson-card--list .lesson-card-topic {
  color: var(--text-light);
  font-size: 11px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lesson-card--list .lesson-card-date {
  font-size: 10.5px;
  color: var(--text-light);
  margin-top: 4px;
  font-style: italic;
}