/* ZemGuru modular styles 03/16. Original cascade order preserved. */
/* Patch: рабочий drawer обращений и более плотные отступы страниц */
.page-head {
  margin-top: 0;
  margin-bottom: 18px;
}
.dashboard-page, .content, main {
  scroll-padding-top: 90px;
}
.ticket-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.32);
  z-index: 1800;
  display: flex;
  justify-content: flex-end;
}
.ticket-drawer {
  position: relative;
  height: 100vh;
  width: min(720px, 100vw);
  background: #fff;
  z-index: 1900;
  overflow-y: auto;
  padding: 22px;
  box-shadow: -24px 0 60px rgba(15, 23, 42, 0.24);
}
.ticket-drawer .ticket-detail {
  border: 0;
  box-shadow: none;
  padding: 0;
}
.drawer-close {
  position: sticky;
  top: 0;
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  z-index: 2;
}

.support-queue-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.support-queue-grid button {
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfb;
  text-align: left;
  padding: 12px;
  cursor: pointer;
}
.support-queue-grid button:hover {
  border-color: rgba(36, 115, 56, .32);
  background: #f1f8f2;
}
.support-queue-grid b,
.support-queue-grid span {
  display: block;
}
.support-queue-grid b {
  font-size: 24px;
  margin-bottom: 4px;
}
.support-queue-grid span {
  color: var(--muted);
  font-size: 13px;
}
@media (max-width: 760px) {
  .ticket-drawer { width: 100vw; padding: 16px; }
  .ticket-summary, .ticket-actions-bar { grid-template-columns: 1fr; }
}

/* Batch fixes by ChatGPT: layout, filters, drawers, action buttons */
.content { padding-top: 20px; }
.page-head { margin-bottom: 20px; }
.dashboard-grid,
.teacher-students-layout,
.teacher-homeworks-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
}
.main-column,
.teacher-students-main,
.teacher-homeworks-main { min-width: 0; }
.right-rail,
.teacher-students-sidebar,
.teacher-homeworks-sidebar,
.calls-sidebar {
  position: static;
  min-width: 0;
  display: grid;
  gap: 16px;
  align-content: start;
}
.teacher-students-filters,
.homework-review-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 180px)) minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.homework-review-filters { grid-template-columns: repeat(4, minmax(130px, 170px)) minmax(220px, 1fr) auto; }

body[data-role="admin"][data-active="homework"] .admin-homework-search-wrap {
  position: relative;
  min-width: 0;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

body[data-role="admin"][data-active="homework"] .admin-homework-search-wrap .animated-hint-search__input {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
}

body[data-role="admin"][data-active="homework"] .admin-homework-search-wrap:not(.is-filled) .animated-hint-search__input {
  color: transparent;
  caret-color: var(--ink);
}

body[data-role="admin"][data-active="homework"] .admin-homework-search-wrap .animated-hint-search__hint {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  color: #7a8680;
  font-weight: 500;
  line-height: 42px;
  padding: 0 13px;
}

body[data-role="admin"][data-active="homework"] .admin-homework-search-wrap .animated-hint-search__hint-inner {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  will-change: transform;
}

body[data-role="admin"][data-active="homework"] .admin-homework-search-wrap.is-filled .animated-hint-search__hint {
  opacity: 0;
  visibility: hidden;
}

body[data-role="admin"][data-active="homework"] .admin-homework-search-wrap.is-hint-animated:not(.is-filled) .animated-hint-search__hint-inner {
  display: inline-block;
  width: auto;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  animation: admin-homework-search-hint-marquee 4.8s ease-in-out 1 forwards;
}

@keyframes admin-homework-search-hint-marquee {
  0%, 12% { transform: translateX(0); }
  88%, 100% { transform: translateX(var(--hint-marquee-end, 0px)); }
}

body[data-theme="dark"][data-role="admin"][data-active="homework"] .admin-homework-search-wrap {
  background: #121c17;
  border-color: var(--line);
}

body[data-theme="dark"][data-role="admin"][data-active="homework"] .admin-homework-search-wrap .animated-hint-search__input {
  color: var(--ink);
}

body[data-theme="dark"][data-role="admin"][data-active="homework"] .admin-homework-search-wrap:not(.is-filled) .animated-hint-search__input {
  color: transparent;
  caret-color: var(--ink);
}

body[data-theme="dark"][data-role="admin"][data-active="homework"] .admin-homework-search-wrap .animated-hint-search__hint {
  color: #8a968f;
}

.teacher-students-filters select,
.homework-review-filters select,
.support-extra-filters select,
.filters select.filter {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  padding: 8px 12px;
  color: #26302a;
  font-weight: 700;
}
.compact-actions,
.mentor-actions,
.help-actions,
.ask-card .row-actions,
.mentor-card .row-actions {
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: center;
  flex-wrap: nowrap;
}
.compact-actions .btn,
.mentor-actions .btn,
.help-actions .btn,
.ask-card .row-actions .btn,
.mentor-card .row-actions .btn {
  flex: 1 1 0;
  min-height: 42px;
  white-space: nowrap;
}
.teacher-student-row {
  grid-template-columns: 34px minmax(180px, 1.2fr) minmax(130px, 1fr) minmax(160px, 1fr) minmax(160px, 1fr) minmax(120px, .8fr) minmax(260px, auto);
}
.teacher-student-row .compact-actions { justify-content: flex-end; }
.review-row {
  grid-template-columns: minmax(180px, 1fr) minmax(260px, 1.5fr) auto minmax(120px, auto);
}
.ticket-drawer-overlay,
.modal-backdrop {
  z-index: 1800;
}
.ticket-drawer {
  width: min(720px, 100vw);
  z-index: 1900;
}
.ticket-drawer .ticket-summary {
  margin: 14px 0;
}
.student-drawer .tabs,
.review-drawer .tabs { margin-top: 12px; }
.support-queue-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.support-queue-grid button {
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
}
.support-queue-grid button:hover,
.rail-row.action-row:hover {
  border-color: var(--green);
  background: rgba(34, 122, 55, 0.06);
}
.rail-row.action-row.active,
.user-row.active,
.ticket-card.active {
  border-color: var(--green);
  box-shadow: 0 0 0 1px rgba(34, 122, 55, .18);
}
.active-filter {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(34, 122, 55, .08);
  color: var(--green);
  font-weight: 800;
  margin-bottom: 12px;
}
.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0;
}
.profile-stats-grid span {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}
.profile-stats-grid b { display: block; font-size: 22px; color: var(--green); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 1200px) {
  .dashboard-grid,
  .teacher-students-layout,
  .teacher-homeworks-layout {
    grid-template-columns: 1fr;
  }
  .teacher-students-filters,
  .homework-review-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 700px) {
  .teacher-students-filters,
  .homework-review-filters,
  .teacher-student-row,
  .review-row,
  .profile-stats-grid {
    grid-template-columns: 1fr;
  }
  .compact-actions,
  .mentor-actions,
  .help-actions,
  .ask-card .row-actions,
  .mentor-card .row-actions {
    flex-direction: column;
  }
  .toast-host {
    top: 78px;
    right: 16px;
    left: auto;
    max-width: calc(100vw - 32px);
  }
  .toast {
    max-width: none;
  }
}

/* Step fix 2026-06-12: teacher students right rail overlap */
body[data-role="mentor"] .teacher-students-layout {
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
}
body[data-role="mentor"] .teacher-students-main,
body[data-role="mentor"] .teacher-students-main .panel,
body[data-role="mentor"] .teacher-students-main .table-panel {
  min-width: 0;
  overflow: hidden;
}
body[data-role="mentor"] .teacher-students-sidebar,
body[data-role="mentor"] .right-rail.teacher-students-sidebar {
  position: static;
  width: 320px;
  min-width: 0;
  max-width: 320px;
  z-index: 1;
  align-self: start;
}
body[data-role="mentor"] .teacher-students-filters {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
}
body[data-role="mentor"] .teacher-students-filters .search {
  grid-column: 1 / 3;
  width: 100%;
}
body[data-role="mentor"] .teacher-student-row {
  grid-template-columns: 34px minmax(150px, 1.15fr) minmax(95px, .7fr) minmax(135px, 1fr) minmax(115px, .85fr) minmax(105px, .75fr) minmax(150px, auto);
  gap: 10px;
  min-width: 0;
}
body[data-role="mentor"] .teacher-student-row > * {
  min-width: 0;
  overflow-wrap: anywhere;
}
body[data-role="mentor"] .teacher-student-row .compact-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}
body[data-role="mentor"] .teacher-student-row .compact-actions .btn {
  flex: 0 1 auto;
  min-height: 36px;
  padding: 8px 10px;
  font-size: 13px;
}
body[data-role="mentor"] .teacher-students-sidebar .panel {
  width: 100%;
  box-sizing: border-box;
}
body[data-role="mentor"] .teacher-students-sidebar .stats-mini {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
body[data-role="mentor"] .teacher-students-sidebar .rail-row {
  width: 100%;
  box-sizing: border-box;
}
@media (max-width: 1320px) {
  body[data-role="mentor"] .teacher-students-layout {
    grid-template-columns: 1fr;
  }
  body[data-role="mentor"] .teacher-students-sidebar,
  body[data-role="mentor"] .right-rail.teacher-students-sidebar {
    width: 100%;
    max-width: none;
  }
}
@media (max-width: 900px) {
  body[data-role="mentor"] .teacher-students-filters,
  body[data-role="mentor"] .teacher-students-filters .search,
  body[data-role="mentor"] .teacher-student-row {
    grid-template-columns: 1fr;
    grid-column: auto;
  }
  body[data-role="mentor"] .teacher-student-row .compact-actions {
    justify-content: stretch;
  }
  body[data-role="mentor"] .teacher-student-row .compact-actions .btn {
    flex: 1 1 120px;
  }
}

/* Step fix 2026-06-12: student group page header and responsibility block */
body[data-role="student"][data-active="groups"] .content {
  padding-top: 10px;
}
body[data-role="student"][data-active="groups"] .page-head {
  margin-bottom: 14px;
}
body[data-role="student"][data-active="groups"] .page-head h1 {
  margin-bottom: 4px;
}
.student-group-responsibility {
  display: grid;
  gap: 14px;
}
.student-group-responsibility .muted {
  margin: -4px 0 0;
  line-height: 1.4;
}
.responsibility-list {
  display: grid;
  gap: 10px;
}
.responsibility-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 12px;
  background: #fbfcfb;
}
.responsibility-item > span {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(34, 122, 55, .08);
  color: var(--green);
  font-weight: 900;
}
.responsibility-item strong {
  display: block;
  margin-bottom: 2px;
  color: #111827;
}
.responsibility-item small {
  display: block;
  color: var(--muted);
  line-height: 1.35;
}
.responsibility-actions {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
}
.responsibility-actions .btn {
  flex: 1 1 0;
  min-height: 42px;
  white-space: nowrap;
}
@media (max-width: 420px) {
  .responsibility-actions {
    flex-direction: column;
  }
}

/* Step 3 fix: реально поднять заголовок на странице ученика «Моя группа» */
body[data-role="student"][data-active="groups"] .content {
  padding-top: 0 !important;
}
body[data-role="student"][data-active="groups"] .page-head {
  margin-top: 0 !important;
  margin-bottom: 10px !important;
  transform: translateY(-6px);
}
body[data-role="student"][data-active="groups"] .page-head h1 {
  margin: 0 0 2px !important;
  line-height: 1.05;
}
body[data-role="student"][data-active="groups"] .page-head p {
  margin: 0 !important;
  line-height: 1.25;
}
body[data-role="student"][data-active="groups"] .groups-layout {
  margin-top: -2px;
}

/* Step 4 fix: заголовок «Моя группа» именно в верхней шапке, как на стрелке */
.topbar.has-page-title {
  grid-template-columns: auto minmax(260px, 1fr) minmax(320px, 520px) auto auto;
  justify-content: stretch;
}
.topbar-page-title {
  min-width: 0;
  align-self: center;
  padding-left: 4px;
}
.topbar-page-title strong {
  display: block;
  font-size: 26px;
  line-height: 1.05;
  font-weight: 900;
  color: #111827;
  letter-spacing: -0.02em;
}
.topbar-page-title small {
  display: block;
  margin-top: 3px;
  font-size: 14px;
  line-height: 1.1;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body[data-role="student"][data-active="groups"] .content > .page-head {
  display: none !important;
}
body[data-role="student"][data-active="groups"] .content {
  padding-top: 18px !important;
}
@media (max-width: 1100px) {
  .topbar.has-page-title {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
  }
  .topbar.has-page-title .top-search {
    display: none;
  }
}
@media (max-width: 760px) {
  .topbar-page-title strong { font-size: 20px; }
  .topbar-page-title small { display: none; }
}


/* Step 5 fix: student group card overflow + highlight ближайший созвон */
body[data-role="student"][data-active="groups"] .group-card {
  max-width: 560px;
}
body[data-role="student"][data-active="groups"] .group-meta {
  grid-template-columns: repeat(3, minmax(118px, 1fr));
  gap: 10px;
}
body[data-role="student"][data-active="groups"] .group-meta span {
  min-width: 0;
  min-height: 58px;
  align-content: start;
  overflow: hidden;
}
body[data-role="student"][data-active="groups"] .group-meta b {
  font-size: 15px;
  line-height: 1.12;
  letter-spacing: -0.03em;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}
body[data-role="student"][data-active="groups"] .group-meta span {
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
body[data-role="student"][data-active="groups"] .group-meta .teacher {
  border-color: var(--line);
  background: #fbfcfb;
}
body[data-role="student"][data-active="groups"] .group-meta .teacher b {
  color: #111827;
}
body[data-role="student"][data-active="groups"] .group-next-call-hero {
  margin-top: 16px;
  margin-bottom: 16px;
  min-height: 210px;
  border-radius: 18px;
}
body[data-role="student"][data-active="groups"] .group-next-call-hero h2 {
  color: #fff;
  margin: 6px 0 12px;
}
body[data-role="student"][data-active="groups"] .group-next-call-hero p {
  color: rgba(255,255,255,.88);
  margin: 0 0 10px;
}
body[data-role="student"][data-active="groups"] .group-next-call-hero .row-actions {
  margin-top: 14px;
}
@media (max-width: 760px) {
  body[data-role="student"][data-active="groups"] .group-meta {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 480px) {
  body[data-role="student"][data-active="groups"] .group-meta {
    grid-template-columns: 1fr;
  }
}

