/* ZemGuru modular styles 05/16. Original cascade order preserved. */
/* Step 23: structured document base */
.docs-view-tabs {
  margin: 0 0 14px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.docs-structure-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
  padding: 16px;
}

.docs-structure-filters .field {
  margin: 0;
  min-width: 0;
}

.docs-structure-filters select,
.course-modal select[data-doc-module],
.course-modal select[data-doc-lesson] {
  width: 100%;
  min-width: 0;
}

.doc-relation {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8faf8;
  color: #4c5850;
  font-size: 12px;
  line-height: 1.35;
}

.doc-relation span {
  overflow-wrap: anywhere;
}

.doc-file-field input[type="file"] {
  width: 100%;
  max-width: 100%;
}

.doc-file-preview {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8faf8;
  font-size: 13px;
  color: #4c5850;
  overflow-wrap: anywhere;
}

.doc-structure-fields {
  display: contents;
}

.doc-optional-structure {
  display: grid;
  gap: 6px;
}

.doc-bind-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  cursor: pointer;
}

.doc-bind-toggle input {
  width: auto;
  margin: 0;
}

.doc-scope-field[hidden],
.doc-structure-fields[hidden],
.doc-optional-structure[hidden] {
  display: none !important;
}

.doc-category-custom {
  margin-top: 8px;
}

.doc-category-custom[hidden] {
  display: none !important;
}

.course-modal select[data-doc-category-select] {
  width: 100%;
  min-width: 0;
}

.doc-current-file {
  margin-top: 8px;
}

.docs-structure {
  display: grid;
  gap: 16px;
}

.docs-structure-course {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.docs-module-block {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfcfb;
}

.docs-module-title {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.docs-module-title strong {
  display: block;
  font-size: 16px;
}

.docs-module-title span:not(.badge) {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.docs-structure-list {
  display: grid;
  gap: 8px;
}

.doc-structure-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
}

.doc-structure-row > div:nth-child(2) {
  min-width: 0;
}

.doc-structure-row strong,
.doc-structure-row span {
  display: block;
  overflow-wrap: anywhere;
}

.doc-structure-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.small-doc-icon {
  width: 44px;
  height: 44px;
  font-size: 12px;
}

@media (max-width: 1180px) {
  .docs-structure-filters {
    grid-template-columns: 1fr;
  }
  .docs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .docs-grid {
    grid-template-columns: 1fr;
  }
  .docs-module-title,
  .doc-structure-row {
    grid-template-columns: 1fr;
  }
  .doc-structure-row .btn {
    width: 100%;
  }
}

/* Step 24: admin docs title moved into topbar */
body[data-role="admin"][data-active="docs"] .content {
  padding-top: 18px;
}

body[data-role="admin"][data-active="docs"] .docs-upload-head {
  justify-content: flex-end;
  align-items: center;
  margin: 0 0 14px;
}

body[data-role="admin"][data-active="docs"] .docs-upload-head > div {
  display: none;
}

body[data-role="admin"][data-active="docs"] .docs-upload-head .btn {
  min-width: 176px;
}

@media (max-width: 760px) {
  body[data-role="admin"][data-active="docs"] .docs-upload-head .btn {
    width: 100%;
  }
}

/* Step 25: admin home title moved into topbar */
body[data-role="admin"][data-active="home"] .content {
  padding-top: 18px;
}

body[data-role="admin"][data-active="home"] .admin-home-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin: 0 0 14px;
  min-width: 0;
}

body[data-role="admin"][data-active="home"] .admin-home-actions .btn {
  min-width: 220px;
}

@media (max-width: 760px) {
  body[data-role="admin"][data-active="home"] .admin-home-actions .btn {
    width: 100%;
    min-width: 0;
  }
}

/* Step 26: page titles moved to topbar across all roles */
body[data-active] .content {
  padding-top: 18px;
}

.page-head.page-head-actions-only {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  min-width: 0;
}

.page-head.page-head-actions-only > div:first-child {
  display: none;
}

.page-head.page-head-actions-only .row-actions {
  justify-content: flex-end;
  min-width: 0;
  flex-wrap: wrap;
}

@media (max-width: 760px) {
  .page-head.page-head-actions-only,
  .page-head.page-head-actions-only .row-actions,
  .page-head.page-head-actions-only .btn {
    width: 100%;
  }
}

/* Step 27: fixed full-height sidebar for all roles */
@media (min-width: 1101px) {
  .shell {
    display: block;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 240px;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 40;
    box-sizing: border-box;
    padding-bottom: 110px;
  }

  .main {
    margin-left: 240px;
    width: calc(100% - 240px);
    min-height: 100vh;
    min-height: 100dvh;
  }

  .shell.compact-sidebar .sidebar {
    width: 88px;
  }

  .shell.compact-sidebar .main {
    margin-left: 88px;
    width: calc(100% - 88px);
  }
}


/* Step 28: remove decorative settings right rail */
.settings-layout {
  grid-template-columns: minmax(0, 1fr) !important;
}

.settings-layout .settings-main {
  width: 100%;
  max-width: 100%;
}


/* Step 29: settings cleanup + header account/notification polish */
.profile-chip,
.top-icon {
  cursor: pointer;
}

.top-icon {
  display: grid;
  place-items: center;
  line-height: 1;
  font-size: 20px;
}

.profile-menu button[data-profile-action="logout"] {
  color: #b42318;
}

.profile-menu button[data-profile-action="logout"]:hover {
  background: #fff1f0;
  color: #b42318;
}

.settings-main > .panel:first-child {
  margin-top: 0;
}

.accent-palette-note {
  margin: 0 0 4px;
  max-width: 760px;
}

.accent-palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.accent-palette-card {
  display: grid;
  gap: 10px;
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.accent-palette-card:hover {
  border-color: var(--accent-border);
}

.accent-palette-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.accent-palette-card strong {
  font-size: 15px;
}

.accent-palette-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.accent-palette-swatches i {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--swatch);
  border: 1px solid rgba(0, 0, 0, .08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
}

body[data-theme="dark"] .accent-palette-swatches i {
  border-color: rgba(255, 255, 255, .12);
}

/* Step 31: unified semantic icons for right sidebar cards */
.right-rail .rail-row > .rail-icon,
.right-rail .notice-task > .rail-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(34, 122, 55, 0.10);
  color: var(--green);
  font-size: 16px;
  line-height: 1;
  flex: 0 0 32px;
}

.right-rail .notice-task > .rail-icon {
  grid-row: 1 / span 2;
}

.right-rail .rail-row > span:not(.avatar):not(.rail-icon),
.right-rail .notice-task > span:not(.rail-icon) {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(34, 122, 55, 0.10);
  color: var(--green);
  font-size: 16px;
  line-height: 1;
}

/* Step 32: make header profile dropdown visible and usable across all roles/pages */
.topbar {
  overflow: visible !important;
}

.profile-menu {
  position: fixed !important;
  top: 66px !important;
  right: 24px !important;
  z-index: 9999 !important;
  width: 240px;
  max-width: calc(100vw - 32px);
}

.profile-chip {
  cursor: pointer;
  flex-shrink: 0;
}

.profile-chip .avatar,
.profile-chip strong,
.profile-chip small {
  pointer-events: none;
}

/* Step 33: move call host/platform block to the right side of hero cards */
.event-hero-side {
  min-width: 190px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 14px;
}

.event-hero-side .hero-host-card {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 12px;
  background: rgba(255, 255, 255, .1);
  backdrop-filter: blur(2px);
}

.event-hero-side .hero-host-card b {
  display: block;
  color: #fff;
  line-height: 1.15;
}

.event-hero-side .hero-host-card small {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, .78);
  line-height: 1.2;
}

.call-hero .event-hero-side {
  justify-items: stretch;
  align-content: center;
  min-width: 220px;
}

.call-hero .event-hero-side .row-actions {
  display: grid;
  gap: 10px;
  margin-top: 0;
}

.call-hero .event-hero-side .row-actions .btn {
  width: 100%;
}

@media (max-width: 900px) {
  .event-hero-side,
  .call-hero .event-hero-side {
    min-width: 0;
    justify-items: stretch;
  }
  .event-hero-side .telemost-badge {
    justify-self: start;
  }
}

/* Step 34: unified role/user avatars across accounts */
.avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  background: linear-gradient(135deg, var(--avatar-from, #dcefe1), var(--avatar-to, #aecaB7));
  color: var(--avatar-ink, #0f5f2a);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.avatar::after {
  content: attr(data-initials);
  display: block;
  letter-spacing: .02em;
}

.avatar-student { --avatar-from: #eaf5ec; --avatar-to: #b8dac2; --avatar-ink: #176b31; }
.avatar-teacher { --avatar-from: #eef6ff; --avatar-to: #b9d6ff; --avatar-ink: #185b9e; }
.avatar-admin { --avatar-from: #fff3dc; --avatar-to: #f3c56d; --avatar-ink: #8a5200; }
.avatar-current { --avatar-from: #e8f6ea; --avatar-to: #c0ddc8; --avatar-ink: #176b31; }

.small-avatar::after { font-size: 11px; }
.teacher-avatar-large .avatar::after { font-size: 22px; }
.profile-chip .avatar::after { font-size: 12px; }

[data-call-teacher-modal] .avatar,
.avatar[data-call-teacher-modal] {
  cursor: pointer;
}

.mentor-profile-button {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.mentor-profile-button:hover strong,
.rail-row.action-row:hover strong,
.group-teacher-strip .avatar[data-call-teacher-modal]:hover + div strong,
.plot-mentor-note .avatar[data-call-teacher-modal]:hover + div strong {
  color: var(--green);
}

.hero-host-card[data-call-teacher-modal] {
  cursor: pointer;
}

.hero-host-card[data-call-teacher-modal]:hover {
  background: rgba(255, 255, 255, .16);
}

.ticket-summary .avatar {
  vertical-align: middle;
}


/* Step 35: remove extra Telemost logo and lift call host card */
.event-hero:not(.call-hero) .event-hero-side {
  align-self: start;
  align-content: start;
  padding-top: 18px;
}

.event-hero:not(.call-hero) .event-hero-side .hero-host-card {
  max-width: 210px;
}

@media (max-width: 900px) {
  .event-hero:not(.call-hero) .event-hero-side {
    padding-top: 0;
  }
}

/* Step 36: student lessons progress alignment */
body[data-role="student"][data-active="lessons"] .lesson-module-head {
  grid-template-columns: 58px minmax(0, 1fr) 220px 112px;
  gap: 18px;
  align-items: center;
}

body[data-role="student"][data-active="lessons"] .lesson-module-head > div:nth-child(2) {
  min-width: 0;
}

body[data-role="student"][data-active="lessons"] .lesson-module-progress {
  min-width: 0;
  width: 100%;
  display: grid;
  gap: 8px;
  align-items: center;
}

body[data-role="student"][data-active="lessons"] .lesson-module-progress .module-stat-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

body[data-role="student"][data-active="lessons"] .lesson-module-progress .module-stat-top strong {
  font-size: 17px;
  line-height: 1;
  color: var(--text);
  white-space: nowrap;
}

body[data-role="student"][data-active="lessons"] .lesson-module-progress .module-stat-top span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  text-align: right;
  white-space: nowrap;
}

body[data-role="student"][data-active="lessons"] .lesson-module-progress .progress {
  width: 100%;
  height: 9px;
}

body[data-role="student"][data-active="lessons"] .lesson-progress-card {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 12px;
}

body[data-role="student"][data-active="lessons"] .lesson-progress-card h2 {
  margin-bottom: 2px;
}

body[data-role="student"][data-active="lessons"] .lesson-progress-card .ring {
  --size: 132px;
  margin: 4px auto 8px;
}

body[data-role="student"][data-active="lessons"] .lesson-progress-card .ring strong {
  top: 55%;
  font-size: 28px;
  line-height: 1;
}

body[data-role="student"][data-active="lessons"] .lesson-progress-card .ring span {
  top: 34%;
  width: 64px;
  font-size: 10px;
  line-height: 1.05;
  text-align: center;
  white-space: normal;
  overflow: visible;
}

body[data-role="student"][data-active="lessons"] .lesson-progress-card .lesson-progress-legend {
  width: 100%;
  display: grid;
  gap: 8px;
  margin: 2px 0 0;
  text-align: left;
}

body[data-role="student"][data-active="lessons"] .lesson-progress-card .lesson-progress-legend span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  line-height: 1.25;
}

body[data-role="student"][data-active="lessons"] .lesson-progress-card .btn {
  margin-top: 8px;
}

@media (max-width: 900px) {
  body[data-role="student"][data-active="lessons"] .lesson-module-head {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  body[data-role="student"][data-active="lessons"] .lesson-module-progress,
  body[data-role="student"][data-active="lessons"] .lesson-module-head .round-btn {
    grid-column: 1 / -1;
  }

  body[data-role="student"][data-active="lessons"] .lesson-module-head .round-btn {
    width: 100%;
  }
}

/* Step fix 2026-06-13: mentor card buttons never overflow in any role/page */
.right-rail .mentor-card .row-actions,
.dashboard-sidebar .mentor-card .row-actions,
.support-rail .mentor-card .row-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  width: 100%;
  min-width: 0;
  align-items: stretch;
}

.right-rail .mentor-card .row-actions .btn,
.dashboard-sidebar .mentor-card .row-actions .btn,
.support-rail .mentor-card .row-actions .btn {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  justify-content: center;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}

.right-rail .mentor-card,
.dashboard-sidebar .mentor-card,
.support-rail .mentor-card {
  overflow: hidden;
}

/* Step 39: teacher profile modal alignment */
.teacher-profile-modal .ticket-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  justify-content: center;
  align-items: stretch;
  gap: 12px;
  margin: 18px auto;
  width: 100%;
}

.teacher-profile-modal .ticket-summary span {
  min-height: 96px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
}

.teacher-profile-modal .teacher-profile-actions {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(220px, 1.25fr);
  gap: 12px;
  align-items: center;
  margin-top: 14px;
}

.teacher-profile-modal .teacher-profile-actions .btn {
  width: 100%;
  min-width: 0;
}

@media (max-width: 760px) {
  .teacher-profile-modal .ticket-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .teacher-profile-modal .teacher-profile-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .teacher-profile-modal .ticket-summary {
    grid-template-columns: 1fr;
  }
}

