/* ═══ Сетка дней ══════════════════════════════════════════════════════════════ */
.t-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 900px) { .t-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 580px) { .t-grid { grid-template-columns: 1fr; } }

/* ═══ Карточка дня ═══════════════════════════════════════════════════════════ */
.t-day-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.t-day-card.today { border-color: var(--green); }
.t-day-card-head {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  display: flex;
  align-items: center;
  gap: 8px;
}
.t-day-card-head.today { background: var(--mint); }
.t-day-name { font-size: 13px; font-weight: 600; }
.t-day-date { margin-left: auto; font-size: 11.5px; color: var(--muted); font-family: var(--mono); }

/* ═══ Слот расписания ════════════════════════════════════════════════════════ */
.t-slot {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 10px;
  cursor: pointer;
  transition: background .1s;
}
.t-slot:last-of-type { border-bottom: none; }
.t-slot:hover { background: var(--surface2); }
.t-slot.open { background: var(--surface2); }

.t-slot-time {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  min-width: 66px;
  padding-top: 2px;
  line-height: 1.4;
  flex-shrink: 0;
}
.t-slot-body { flex: 1; min-width: 0; overflow: hidden; }
.t-slot-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.t-slot-room {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.t-slot-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.t-slot-edit-controls { display: none; gap: 2px; }
body.edit-mode .t-slot-edit-controls { display: flex; }

/* Стрелка разворота */
.t-chevron {
  font-size: 10px;
  color: #ccc;
  transition: transform .2s;
  line-height: 1;
}
.t-slot.open .t-chevron { transform: rotate(180deg); }

/* ═══ Детали слота ════════════════════════════════════════════════════════════ */
.t-slot-detail {
  display: none;
  padding: 10px 14px 12px 90px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.t-slot.open + .t-slot-detail { display: block; }
.t-slot-teacher {
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Группа слотов — все предметы сразу видны */
.t-slot-group {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
}
.t-slot-group-time {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.t-slot-group-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1px 7px;
  white-space: nowrap;
}
.t-slot-group-items {
  border-left: 2px solid var(--border);
  margin-left: 7px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.t-slot-group-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0 5px 10px;
  transition: background .1s;
  border-radius: 0 6px 6px 0;
}
.t-slot-group-item:hover { background: var(--surface2); }
.flex-1 { flex: 1; }
.t-slot-time-mono { font-size: 11px; font-family: var(--mono); }

/* ═══ Детали слота — описание и трекеры ══════════════════════════════════════ */
.t-slot-desc {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
  line-height: 1.5;
}
.t-slot-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.t-slot-metric-link {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .12s, color .12s;
  text-decoration: none;
}
.t-slot-metric-link:hover {
  border-color: var(--green);
  color: var(--green);
}

/* Кнопка СДО в детали слота */
.t-slot-sdo-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--surface);
  text-decoration: none;
  transition: border-color .12s, color .12s;
}
.t-slot-sdo-btn:hover { border-color: var(--accent, #6366f1); color: var(--accent, #6366f1); }

/* Бейдж «Завершён» в детали слота */
.t-slot-completed-badge {
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(34, 197, 94, .12);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, .3);
  margin-left: 4px;
}
[data-theme="dark"] .t-slot-completed-badge {
  color: #4ade80;
  background: rgba(34, 197, 94, .18);
  border-color: rgba(34, 197, 94, .35);
}

/* ═══ Дэшборд ═════════════════════════════════════════════════════════════════ */
/* Использует общий .t-metrics-grid из metrics.css */

.t-dash-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 32px;
  margin-bottom: 12px;
}
.t-dash-title-actions { display: flex; align-items: center; gap: 8px; }

/* Заполненные трекеры — скрыты по умолчанию, показываются по кнопке. */
.t-metric.metric-filled-hidden { display: none !important; }

/* Промт AI-трекера: заголовок кликабельный */
.t-metric-title-clickable {
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}
.t-metric-title-clickable:hover { opacity: .8; }

/* Блок отображения промта в модальном окне */
.t-ai-prompt-display {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  margin-top: 8px;
  min-height: 40px;
}

/* ═══ Карточки расписаний (профиль) ══════════════════════════════════════════ */
.t-sched-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 900px) { .t-sched-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 580px) { .t-sched-grid { grid-template-columns: 1fr; } }

.t-sched-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow .15s, border-color .15s;
}
.t-sched-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.15); border-color: var(--muted); }
.t-sched-card-title { font-size: 15px; font-weight: 700; }
.t-sched-card-meta { font-size: 11.5px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; }
.t-sched-card-meta span { display: flex; align-items: center; gap: 3px; }
.t-sched-card-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.t-sched-card-footer { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 4px; }

/* Объединение расписаний */
.t-merge-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}
.t-merge-title { margin-bottom: 12px; }
