/* =====================================================================
   sched-unify.css — ЕДИНЫЙ вид всех расписаний платформы (t11, 23.09.2026).
   Амир: «везде, где есть расписания, надо чтобы выглядело как у ученика».

   Эталон — /me/schedule (student/schedule.html). Эти стили были скопированы
   в 3 шаблона (student/schedule.html, teach/schedule.html, teach/day.html),
   местами по два раза в одном файле. Здесь — одна копия для всех.

   Контракт разметки задаётся макросами app/templates/_sched_grid.html:
     .su-week  > table.bz-tt.tt-color   — недельная сетка (десктоп)
       th[data-day] + .th-date          — день недели + дата
       .tt-today                        — колонка «сегодня»
       tr.tt-slot-row[data-start/-end]  — строка слота
       td.sticky-col > b + .bz-time     — «УРОК» + время звонков
       td.bz-cell > .tt-chip.tt-cat-X   — карточка урока
       .tt-lunch-cell                   — полосатая плашка «🍽 Обед»
     .su-lane                           — мобильная лента дня
       .daytabs > .daytab               — вкладки дней
       .mrow.tt-cat-X                   — строка урока (время слева)
       .mlunch / .mrow-free / .mempty
     .now-block > .now-card.tt-cat-X    — карточка «Сейчас / Дальше»

   ⚠ Файл подключается в base.html ВСЕМ ролям. Локальные правила страницы
   кладутся в сам шаблон ПОСЛЕ — они перебивают этот файл.
   ===================================================================== */

/* ── 1. Палитра предметов (один источник для всех расписаний) ────────── */
.tt-cat-exact   { --tt-bg:#eef1fd; --tt-bd:#c9d2f7; --tt-ac:#5856d6; --tt-tx:#2c2f6b; }
.tt-cat-lang    { --tt-bg:#fdf3e7; --tt-bd:#f5dfbf; --tt-ac:#d98324; --tt-tx:#7a4a12; }
.tt-cat-science { --tt-bg:#e9f7ef; --tt-bd:#c3e9d3; --tt-ac:#2f9e44; --tt-tx:#1c5e2a; }
.tt-cat-social  { --tt-bg:#fdeef0; --tt-bd:#f6ccd3; --tt-ac:#c2385a; --tt-tx:#7a1f34; }
.tt-cat-art     { --tt-bg:#f4eefe; --tt-bd:#ddc9f6; --tt-ac:#8b5cf6; --tt-tx:#4a2c7a; }
.tt-cat-sport   { --tt-bg:#e6f6f7; --tt-bd:#bce6ea; --tt-ac:#0e9aa8; --tt-tx:#0a5b64; }
.tt-cat-labor   { --tt-bg:#eef0f3; --tt-bd:#d3d9e2; --tt-ac:#64748b; --tt-tx:#3a4557; }
.tt-cat-other   { --tt-bg:#f0f1f3; --tt-bd:#dcdfe4; --tt-ac:#8e8e93; --tt-tx:#4a4a4f; }

:root:not([data-theme="light"]) .tt-cat-exact,   :root[data-theme="dark"] .tt-cat-exact   { --tt-bg:rgba(88,86,214,.18);  --tt-bd:rgba(88,86,214,.35);  --tt-ac:#8f8df0; --tt-tx:#c9c8fb; }
:root:not([data-theme="light"]) .tt-cat-lang,    :root[data-theme="dark"] .tt-cat-lang    { --tt-bg:rgba(217,131,36,.18); --tt-bd:rgba(217,131,36,.35); --tt-ac:#e5a45a; --tt-tx:#f2d3a8; }
:root:not([data-theme="light"]) .tt-cat-science, :root[data-theme="dark"] .tt-cat-science { --tt-bg:rgba(47,158,68,.18);  --tt-bd:rgba(47,158,68,.35);  --tt-ac:#5cc274; --tt-tx:#b6e8c4; }
:root:not([data-theme="light"]) .tt-cat-social,  :root[data-theme="dark"] .tt-cat-social  { --tt-bg:rgba(194,56,90,.18);  --tt-bd:rgba(194,56,90,.35);  --tt-ac:#e0708c; --tt-tx:#f2c2ce; }
:root:not([data-theme="light"]) .tt-cat-art,     :root[data-theme="dark"] .tt-cat-art     { --tt-bg:rgba(139,92,246,.18); --tt-bd:rgba(139,92,246,.35); --tt-ac:#a983f7; --tt-tx:#d9c6fb; }
:root:not([data-theme="light"]) .tt-cat-sport,   :root[data-theme="dark"] .tt-cat-sport   { --tt-bg:rgba(14,154,168,.18); --tt-bd:rgba(14,154,168,.35); --tt-ac:#3cc3d0; --tt-tx:#a6e6ec; }
:root:not([data-theme="light"]) .tt-cat-labor,   :root[data-theme="dark"] .tt-cat-labor   { --tt-bg:rgba(100,116,139,.2); --tt-bd:rgba(100,116,139,.4); --tt-ac:#9aa6b8; --tt-tx:#cbd3df; }
:root:not([data-theme="light"]) .tt-cat-other,   :root[data-theme="dark"] .tt-cat-other   { --tt-bg:rgba(142,142,147,.18);--tt-bd:rgba(142,142,147,.35);--tt-ac:#adadb3; --tt-tx:#d6d6da; }

/* ── 2. Недельная сетка ──────────────────────────────────────────────── */
.tt-color { border-collapse: separate; border-spacing: 0; width: 100%; table-layout: fixed; }
.tt-color th { font-weight: 700; text-align: left; padding: 8px 10px; font-size: 13px; }
.tt-color th .th-date { display: block; margin-top: 3px; font-size: 11px;
  font-weight: 500; color: var(--muted); text-transform: none; letter-spacing: 0; }
.tt-color td.bz-cell { padding: 4px; vertical-align: top; height: 1px; }
.tt-color .sticky-col { white-space: nowrap; padding: 8px 10px; width: 92px; }
.tt-color .bz-time { display: block; font-size: 11px; color: var(--muted); }
.tt-color .bz-dash { color: var(--muted); opacity: .5;
  display: flex; align-items: center; justify-content: center; height: 58px; }

/* Карточка урока: левая толстая цветная кромка + пастельный фон + скругление */
.tt-chip { border-radius: 10px; padding: 7px 9px; border: 1px solid transparent;
  background: var(--tt-bg, rgba(0,0,0,.04)); border-color: var(--tt-bd, rgba(0,0,0,.08));
  box-shadow: inset 3px 0 0 var(--tt-ac, transparent);
  min-height: 58px; height: auto; display: flex; flex-direction: column; justify-content: center;
  box-sizing: border-box; overflow: hidden; }
/* f5d (25.09, Амир: «название предмета обрезано») — полное название в 2 строки,
   плитка растёт по контенту (min-height вместо жёсткой height), не переносим слова. */
.tt-chip .bz-subj { font-weight: 600; font-size: 13px; line-height: 1.2;
  color: var(--tt-tx, inherit);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  white-space: normal; overflow-wrap: anywhere; }
.tt-chip .bz-who { font-size: 11px; color: var(--muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-extra { font-weight: 400; opacity: .6; font-size: 11.5px; }
.tt-subj-link { color: inherit; text-decoration: none; }
.tt-subj-link:hover { text-decoration: underline; text-underline-offset: 2px; }
/* кликабельные плашки */
.tt-chip-click, .mrow-click { cursor: pointer; }
.tt-chip-click:hover, .mrow-click:hover { filter: brightness(.97); }
.tt-chip-click:focus-visible, .mrow-click:focus-visible {
  outline: 2px solid var(--accent, #2f6df6); outline-offset: 2px; }

/* Обед — полосатая плашка на всю ячейку */
.tt-lunch-cell { display:flex; align-items:center; justify-content:center; height:58px;
  font-size:12px; font-weight:600; color:#d98324;
  background: repeating-linear-gradient(135deg, color-mix(in srgb,#d98324 8%,transparent) 0 8px, transparent 8px 16px);
  border-radius:8px; }
.tt-lunch-tag { display:block; font-size:11px; font-weight:600; color:#d98324; margin-top:2px; }
.tt-lunch-row { background: repeating-linear-gradient(135deg,
  color-mix(in srgb, #d98324 7%, transparent) 0 12px, transparent 12px 24px); }

/* «Сегодня» — приподнятая колонка */
.tt-today { background: var(--surface, #fff);
  box-shadow: -6px 0 12px -8px rgba(0,0,0,.22), 6px 0 12px -8px rgba(0,0,0,.22);
  position: relative; z-index: 1; }
:root:not([data-theme="light"]) .tt-today,
:root[data-theme="dark"] .tt-today { background: color-mix(in srgb, var(--surface,#1c1c1e) 60%, #fff 6%);
  box-shadow: -6px 0 14px -8px rgba(0,0,0,.5), 6px 0 14px -8px rgba(0,0,0,.5); }
thead th.tt-today { border-top-left-radius: 10px; border-top-right-radius: 10px; font-weight: 800; }

/* Текущий урок (по Алматы) */
.tt-now td { position: relative; }
.tt-now .sticky-col { box-shadow: inset 3px 0 0 #e5484d; }
.tt-now-badge { display:inline-block; margin-left:6px; width:7px; height:7px;
  border-radius:50%; background:#e5484d; box-shadow:0 0 0 3px rgba(229,72,77,.2);
  animation: su-ttpulse 1.6s ease-in-out infinite; vertical-align:middle; }
@keyframes su-ttpulse { 50% { opacity:.4; } }
@media (prefers-reduced-motion: reduce) { .tt-now-badge { animation: none; } }

/* выходные с уроками — зелёные */
.tt-color th.th-we { color: #1F6B3A; background: #E6F5EA; }

/* ── 3. Карточка «Сейчас / Дальше» ───────────────────────────────────── */
.now-block { margin: 4px 0 18px; }
/* nowcard (Амир 10.09): без дублей «Сейчас идёт» — всё в одной карточке */
.now-sub, .now-title { display: none !important; }
.now-card { border: 1px solid var(--tt-bd, var(--line)); border-radius: 16px;
  padding: 16px 18px; background: var(--tt-bg, var(--surface)); }
.now-card.now-lunch { background: #FFF6E0; border-color: #F1DCB0; }
.now-card.now-lunch .now-label, .now-card.now-lunch .now-name { color: #8A5200; }
.now-label { font-size: 12px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--tt-ac, var(--accent)); }
.now-name { font-size: 26px; font-weight: 800; margin: 6px 0 8px;
  color: var(--tt-tx, inherit); line-height: 1.15; }
.now-meta { font-size: 14px; color: var(--muted); }
.now-meta .nm-sep { display:inline-block; width: 18px; }

/* ── 4. Мобильная лента дня ──────────────────────────────────────────── */
.su-lane, .sched-mobile, .tsched-mobile { display: none; }
.daytabs, .td-daytabs { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; }
.daytab, .td-daytab { flex: 1; min-width: 44px; min-height: 44px; padding: 9px 0;
  border-radius: 11px; border: 1px solid var(--line);
  background: var(--surface-2, rgba(0,0,0,.03));
  color: inherit; font-weight: 700; font-size: 14px; cursor: pointer; }
.daytab.on, .td-daytab.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.daytab:has(.daytab-date), .td-daytab:has(.daytab-date) { display: flex; flex-direction: column;
  align-items: center; justify-content: center; line-height: 1.15; }
.daytab .daytab-date, .td-daytab .daytab-date { display: block; font-size: 12px;
  font-weight: 500; opacity: .75; margin-top: 1px; }
/* выходные с уроками — зелёные */
.daytab.daytab-we { background: #E6F5EA; color: #1F6B3A; border-color: #CDEBD6; }
.daytab.daytab-we .daytab-date { color: #4E9A68; }
.daytab.daytab-we.on { background: #1F8A4C; color: #fff; border-color: #1F8A4C; }
.daytab.daytab-we.on .daytab-date { color: rgba(255,255,255,.8); }
html[data-ui="v2"] .daytabs > .daytab.daytab-we { background: #E6F5EA; color: #1F6B3A; }
html[data-ui="v2"] .daytabs > .daytab.daytab-we.on { background: #1F8A4C; color: #fff; }

/* строка урока: колонка времени слева + цветная карточка */
.mrow { display: flex; gap: 12px; align-items: stretch; padding: 10px 12px;
  border-radius: 12px; margin-bottom: 8px; background: var(--tt-bg, rgba(0,0,0,.04));
  border: 1px solid var(--tt-bd, var(--line)); box-shadow: inset 4px 0 0 var(--tt-ac, transparent); }
.mrow-time { display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-width: 44px; }
.mrow-time b { font-size: 16px; }
.mrow-time span { font-size: 11px; color: var(--muted); }
.mrow-body { flex: 1; min-width: 0; }
.mrow-subj { font-weight: 700; font-size: 15px; color: var(--tt-tx, inherit);
  overflow-wrap: anywhere; }
.mrow-who { font-size: 12px; color: var(--muted); margin-top: 2px; }
.mrow-free { opacity: .6; }
.mrow-free .mrow-subj { color: var(--muted); font-weight: 500; }
.mlunch { text-align: center; font-weight: 600; color: #d98324; font-size: 12.5px;
  padding: 6px; margin-bottom: 8px; border-radius: 10px;
  background: repeating-linear-gradient(135deg, color-mix(in srgb, #d98324 8%, transparent) 0 10px, transparent 10px 20px); }
.mempty { text-align: center; padding: 24px 0; }

/* ── 5. Переключение десктоп / телефон ───────────────────────────────── */
@media (max-width: 640px) {
  .su-week, .sched-week, .tsched-week { display: none; }
  .su-lane, .sched-mobile, .tsched-mobile { display: block; }
  .now-name { font-size: 22px; }
}

/* 24.09 (Амир: «плитки кликабельны целиком, а не только текст урока»):
   растянутая ссылка — вся карточка/строка ведёт туда же, куда ссылка предмета.
   Не трогаем карточки со шторкой урока (tt-chip-click / mrow-click) — у них свой клик. */
.tt-chip:not(.tt-chip-click), .mrow:not(.mrow-click) { position: relative; }
.tt-chip:not(.tt-chip-click) .tt-subj-link::after,
.mrow:not(.mrow-click) .tt-subj-link::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.tt-chip:not(.tt-chip-click):has(.tt-subj-link) { cursor: pointer; }
.tt-chip:not(.tt-chip-click):has(.tt-subj-link:hover) { filter: brightness(.97); }
