/* Profile dashboard */
.profile-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dashboard-page {
  min-height: calc(100vh - 78px);
  padding: 48px 0 70px;
  background:
    radial-gradient(circle at top left, rgba(125, 151, 184, 0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(193, 219, 232, 0.16), transparent 25%),
    #fff1b5;
}

.dashboard-shell {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 28px;
  align-items: start;
}

.dashboard-sidebar,
.dashboard-content,
.dashboard-panel,
.profile-info-card,
.course-dashboard-card,
.progress-card,
.settings-card {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(107, 70, 52, 0.08);
  box-shadow: var(--shadow-soft);
}

.dashboard-sidebar {
  position: sticky;
  top: 104px;
  border-radius: 28px;
  padding: 22px;
}

.dashboard-user-card {
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(135deg, #355c88, #6f8fb4);
  color: var(--white);
  text-align: center;
}

.dashboard-avatar {
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.18);
  color: var(--white);
  font-size: 1.8rem;
  font-weight: 800;
}

.dashboard-user-card strong,
.dashboard-user-card span {
  display: block;
}

.dashboard-user-card span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.9rem;
}

.dashboard-tabs {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.dashboard-tab {
  width: 100%;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--soft-brown);
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.dashboard-tab:hover,
.dashboard-tab.active {
  background: var(--cream-dark);
  color: var(--brown);
  transform: translateX(3px);
}

.dashboard-content {
  min-height: 590px;
  border-radius: 32px;
  padding: 34px;
}

.dashboard-panel {
  display: none;
  border: 0;
  box-shadow: none;
  background: transparent;
}

.dashboard-panel.active {
  display: block;
}

.dashboard-panel h1 {
  font-size: clamp(2.4rem, 5vw, 4.6rem);
}

.dashboard-lead {
  max-width: 650px;
  margin: 18px 0 28px;
  color: var(--muted);
}

.profile-info-grid,
.progress-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.profile-info-card,
.progress-card,
.settings-card {
  border-radius: 20px;
  padding: 24px;
}

.profile-info-card span,
.progress-card span,
.course-tag {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.profile-info-card strong {
  display: block;
  margin-top: 8px;
  color: var(--brown);
  font-size: 1.1rem;
  overflow-wrap: anywhere;
}

.course-dashboard-card {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  border-radius: 24px;
  padding: 30px;
}

.course-dashboard-card h2,
.settings-card h2 {
  margin: 8px 0 12px;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.course-dashboard-card p,
.settings-card p {
  color: var(--muted);
}

.course-tag {
  width: max-content;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--cream-dark);
  color: var(--coral);
}

.progress-grid {
  grid-template-columns: repeat(3, 1fr);
}

.progress-card strong {
  display: block;
  color: var(--brown);
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: 10px;
}

.settings-card {
  max-width: 520px;
}

.chat-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
}

.chat-contact-list,
.chat-window {
  min-height: 520px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(107, 70, 52, 0.08);
  box-shadow: var(--shadow-soft);
}

.chat-contact-list {
  padding: 20px;
}

.chat-contact-list h2 {
  margin-bottom: 16px;
  color: var(--brown);
  font-size: 1.25rem;
}

.chat-contact-items {
  display: grid;
  gap: 10px;
}

.chat-contact-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--brown);
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.chat-contact-button:hover,
.chat-contact-button.active {
  background: var(--cream-dark);
  transform: translateX(3px);
}

.chat-contact-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #355c88, #6f8fb4);
  color: var(--white);
  font-weight: 800;
}

.chat-contact-button strong,
.chat-contact-button small {
  display: block;
}

.chat-contact-button small {
  margin-top: 3px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.chat-window {
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.chat-window-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(107, 70, 52, 0.08);
}

.chat-window-header span,
.chat-message time,
.chat-empty {
  color: var(--muted);
  font-size: 0.9rem;
}

.chat-window-header strong {
  display: block;
  margin-top: 4px;
  color: var(--brown);
  font-size: 1.25rem;
}

.chat-messages {
  height: 360px;
  overflow-y: auto;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-message {
  max-width: 72%;
  padding: 12px 14px;
  border-radius: 18px;
  background: var(--cream-dark);
}

.chat-message.mine {
  align-self: flex-end;
  background: #d2dfed;
}

.chat-message.theirs {
  align-self: flex-start;
}

.chat-message p {
  color: var(--brown);
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}

.chat-message time {
  display: block;
  text-align: right;
  font-size: 0.75rem;
}

.chat-compose {
  display: flex;
  gap: 10px;
  padding: 18px;
  border-top: 1px solid rgba(107, 70, 52, 0.08);
}

.chat-compose input {
  flex: 1;
}

.chat-compose button:disabled,
.chat-compose input:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.settings-card .btn {
  margin-top: 22px;
}

@media (max-width: 900px) {
  .dashboard-shell {
    grid-template-columns: 1fr;
  }

  .dashboard-sidebar {
    position: static;
  }

  .dashboard-tabs {
    grid-template-columns: repeat(2, 1fr);
  }

  .course-dashboard-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .chat-shell {
    grid-template-columns: 1fr;
  }

  .chat-contact-list,
  .chat-window {
    min-height: auto;
  }
}

@media (max-width: 680px) {
  .profile-header-actions {
    gap: 8px;
  }

  .profile-header-actions .btn {
    padding: 0 12px;
  }

  .dashboard-page {
    padding: 30px 0 50px;
  }

  .dashboard-content,
  .dashboard-sidebar {
    padding: 18px;
    border-radius: 24px;
  }

  .dashboard-tabs,
  .profile-info-grid,
  .progress-grid {
    grid-template-columns: 1fr;
  }

  .chat-messages {
    height: 320px;
    padding: 16px;
  }

  .chat-compose {
    flex-direction: column;
  }

  .chat-compose .btn {
    width: 100%;
  }

  .chat-message {
    max-width: 88%;
  }
}

/* Profile editing */
.profile-circle:empty,
.dashboard-avatar:empty {
  visibility: hidden;
}

.editable-profile-card {
  position: relative;
  padding-right: 64px;
}

.profile-edit-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: var(--cream-dark);
  color: var(--brown);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.profile-edit-btn:hover {
  transform: translateY(-2px);
  background: #d2dfed;
  box-shadow: var(--shadow-soft);
}

.profile-edit-form {
  display: none;
  margin-top: 22px;
  padding: 24px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(107, 70, 52, 0.08);
  box-shadow: var(--shadow-soft);
}

.profile-edit-form.active {
  display: block;
}

.profile-edit-form-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 20px;
}

.profile-edit-form-header h2 {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
}

.profile-edit-close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--cream-dark);
  color: var(--brown);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.profile-edit-fields {
  display: grid;
  gap: 18px;
}

.profile-edit-fields small {
  color: var(--muted);
  font-size: 0.82rem;
}

.profile-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}

@media (max-width: 680px) {
  .profile-edit-actions .btn {
    width: 100%;
  }
}

/* Course cards in profile */
.course-card-grid {
  display: grid;
  gap: 18px;
}

.clickable-course-card {
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.clickable-course-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.add-course-card {
  min-height: 190px;
  width: 100%;
  border: 1px dashed rgba(193, 219, 232, 0.36);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--brown);
  cursor: pointer;
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 28px;
  font: inherit;
  text-align: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.add-course-card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-soft);
}

.add-course-card span {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--cream-dark);
  color: var(--coral);
  font-size: 2rem;
  font-weight: 800;
}

.add-course-card strong {
  font-size: 1.2rem;
}

.add-course-card small {
  color: var(--muted);
}

.join-course-card {
  min-height: 220px;
}


/* === THICHA PAGE STYLE OVERRIDES === */
.dashboard-page {
  background:
    linear-gradient(135deg, rgba(193, 219, 232, 0.38), transparent 34%),
    #c1dbe8;
}

.dashboard-sidebar,
.dashboard-content,
.profile-info-card,
.course-dashboard-card,
.progress-card,
.settings-card,
.chat-contact-list,
.chat-window,
.profile-edit-form,
.add-course-card {
  background: var(--white);
  border: 1px solid var(--line-strong);
  box-shadow: none;
}

.dashboard-user-card {
  background: var(--coral);
  color: var(--brown);
  border: 1px solid var(--brown);
}

.dashboard-user-card span {
  color: var(--soft-brown);
}

.dashboard-tab {
  color: var(--brown);
  font-weight: 900;
  border: 1px solid transparent;
}

.dashboard-tab:hover,
.dashboard-tab.active {
  background: var(--cream-dark);
  color: var(--brown);
  border-color: var(--brown);
  transform: none;
}

.dashboard-panel h1,
.course-dashboard-card h2,
.settings-card h2,
.profile-edit-form-header h2 {
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 900;
}

.profile-info-card strong,
.progress-card strong,
.chat-window-header strong {
  color: var(--brown);
}

.course-tag {
  background: var(--cream-dark);
  color: var(--brown);
  border: 1px solid var(--line);
}

.clickable-course-card:hover,
.add-course-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 0 rgba(67, 48, 46, 0.12);
}

.add-course-card span {
  background: var(--coral);
  color: var(--brown);
  border: 1px solid var(--brown);
}

.chat-contact-button:hover,
.chat-contact-button.active,
.chat-message.mine {
  background: var(--cream-dark);
}

.chat-message.theirs,
.chat-message {
  background: var(--coral);
  color: var(--brown);
}

.profile-edit-btn,
.profile-edit-close {
  background: var(--cream-dark);
  color: var(--brown);
  border: 1px solid var(--brown);
}

.site-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
}
/* Ebook dashboard */
.ebook-card-grid {
  display: grid;
  gap: 22px;
}

.ebook-dashboard-card {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  padding: 28px;
  border-radius: 24px;
  background: var(--white);
  border: 1px solid var(--line-strong);
}

.ebook-main-preview,
.ebook-card-body {
  min-width: 0;
}

.ebook-cover-preview,
.ebook-sample-preview {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--cream-dark);
  color: var(--brown);
  text-align: center;
  font-weight: 900;
}

.ebook-cover-preview {
  min-height: 300px;
  border-radius: 20px;
}

.ebook-cover-preview img,
.ebook-sample-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ebook-cover-preview span,
.ebook-sample-preview span {
  display: none;
  padding: 12px;
}

.ebook-cover-preview.image-missing span,
.ebook-sample-preview.image-missing span {
  display: block;
}

.ebook-card-body h2 {
  margin: 8px 0 12px;
  font-family: "Inter", system-ui, sans-serif;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 900;
}

.ebook-card-body p {
  color: var(--muted);
}

.ebook-price {
  display: block;
  margin: 14px 0 18px;
  color: var(--brown);
  font-size: 1.1rem;
}

.ebook-sample-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}

.ebook-sample-preview {
  min-height: 120px;
  border-radius: 16px;
  font-size: 0.82rem;
}

.ebook-buy-btn {
  width: 100%;
}

.ebook-pdf-area {
  display: grid;
  gap: 12px;
}

.ebook-pdf-title {
  margin: 0;
  color: var(--brown) !important;
  font-weight: 900;
}

.ebook-pdf-list {
  display: grid;
  gap: 10px;
}

.ebook-pdf-link {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 18px;
  border: 1px solid var(--brown);
  border-radius: 18px;
  background: var(--cream-dark);
  color: var(--brown);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ebook-pdf-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 rgba(67, 48, 46, 0.12);
}

.ebook-pdf-link span {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  min-width: 52px;
  min-height: 38px;
  border-radius: 12px;
  background: var(--brown);
  color: var(--cream-dark);
  font-size: 0.82rem;
  font-weight: 900;
}

.ebook-pdf-link strong {
  color: var(--brown);
  font-size: 1rem;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .ebook-dashboard-card {
    grid-template-columns: 1fr;
  }

  .ebook-cover-preview {
    min-height: 260px;
  }
}

@media (max-width: 680px) {
  .ebook-dashboard-card {
    padding: 20px;
  }

  .ebook-sample-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* Ebook full-size preview */
.ebook-preview-trigger {
  cursor: zoom-in;
  padding: 0;
  border: 1px solid var(--line);
  font: inherit;
}

.ebook-preview-trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 rgba(67, 48, 46, 0.10);
}

.ebook-preview-trigger:disabled {
  cursor: default;
}

body.ebook-preview-open {
  overflow: hidden;
}

.ebook-lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  place-items: center;
  padding: 24px;
}

.ebook-lightbox.active {
  display: grid;
}

.ebook-lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.72);
  cursor: zoom-out;
}

.ebook-lightbox-content {
  position: relative;
  z-index: 1;
  width: min(94vw, 1100px);
  max-height: 92vh;
  display: grid;
  place-items: center;
  gap: 14px;
}

.ebook-lightbox-content > img {
  display: block;
  max-width: 100%;
  max-height: min(72vh, 760px);
  object-fit: contain;
  border-radius: 18px;
  background: var(--white);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.ebook-lightbox-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid var(--brown);
  background: var(--white);
  color: var(--brown);
  font: inherit;
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
}

.ebook-lightbox-arrow:hover,
.ebook-lightbox-close:hover,
.ebook-lightbox-thumb:hover,
.ebook-lightbox-thumb.active {
  box-shadow: 0 6px 0 rgba(67, 48, 46, 0.18);
}

.ebook-lightbox-prev {
  left: -70px;
}

.ebook-lightbox-next {
  right: -70px;
}

.ebook-lightbox-footer {
  width: min(100%, 720px);
  display: grid;
  gap: 10px;
  justify-items: center;
}

.ebook-lightbox-counter {
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--white);
  color: var(--brown);
  border: 1px solid var(--brown);
  font-weight: 900;
}

.ebook-lightbox-thumbnails {
  display: flex;
  justify-content: center;
  gap: 10px;
  max-width: 100%;
  overflow-x: auto;
  padding: 4px 4px 10px;
}

.ebook-lightbox-thumb {
  width: 70px;
  height: 86px;
  flex: 0 0 auto;
  padding: 0;
  overflow: hidden;
  border-radius: 12px;
  border: 2px solid transparent;
  background: var(--white);
  cursor: pointer;
}

.ebook-lightbox-thumb.active {
  border-color: var(--brown);
}

.ebook-lightbox-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ebook-lightbox-close {
  position: absolute;
  top: -18px;
  right: -18px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--brown);
  background: var(--white);
  color: var(--brown);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 680px) {
  .ebook-lightbox {
    padding: 16px;
  }

  .ebook-lightbox-content > img {
    max-height: 68vh;
  }

  .ebook-lightbox-close {
    top: 8px;
    right: 8px;
  }

  .ebook-lightbox-arrow {
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
  }

  .ebook-lightbox-prev {
    left: 8px;
  }

  .ebook-lightbox-next {
    right: 8px;
  }

  .ebook-lightbox-thumb {
    width: 56px;
    height: 70px;
  }
}


/* Ebook delete button */
.ebook-delete-btn {
  margin-top: 12px;
  width: 100%;
  border-color: #b43636;
  color: #b43636;
}

.ebook-delete-btn:hover {
  background: #fff3f3;
}


@media (max-width:900px){
.profile-header-actions{display:none!important;}
.profile-header-actions.active{display:flex!important;}
}

/* Teacher student access manager */
.teacher-only-tab[hidden],
.teacher-only-panel[hidden] {
  display: none !important;
}

.students-manager-card {
  padding: 26px;
  border-radius: 24px;
  background: var(--white);
  border: 1px solid var(--line-strong);
}

.students-manager-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 22px;
}

.students-manager-header h2 {
  margin-bottom: 6px;
  font-family: "Inter", system-ui, sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 900;
}

.students-manager-header p {
  color: var(--muted);
}

.students-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--white);
}

.students-access-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  color: var(--brown);
}

.students-access-table th,
.students-access-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.students-access-table th {
  background: var(--cream-dark);
  font-weight: 900;
}

.students-access-table tbody tr:last-child td {
  border-bottom: 0;
}

.students-access-table td:nth-child(n + 3),
.students-access-table th:nth-child(n + 3) {
  text-align: center;
}

.students-table-empty {
  color: var(--muted);
  text-align: center !important;
  font-weight: 800;
}

.student-access-checkbox {
  width: 22px;
  height: 22px;
  accent-color: var(--brown);
  cursor: pointer;
}

@media (max-width: 680px) {
  .students-manager-card {
    padding: 20px;
  }

  .students-manager-header {
    flex-direction: column;
  }

  .students-manager-header .btn {
    width: 100%;
  }
}

/* Pass 2: dynamic student access table */
.students-access-product {
  min-width: 180px;
}

.students-table-name,
.students-table-username {
  display: block;
}

.students-table-name {
  color: var(--brown);
  font-weight: 900;
}

.students-table-username {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.student-access-checkbox:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.student-access-check-label {
  display: inline-grid;
  place-items: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* Pass 3: live checkbox access updates */
.student-access-checkbox.saving {
  cursor: wait;
  opacity: 0.55;
}

.student-access-check-label:has(.student-access-checkbox.saving)::after {
  content: "Saving...";
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

/* Teacher price manager */
.prices-manager-card {
  padding: 26px;
  border-radius: 24px;
  background: var(--white);
  border: 1px solid var(--line-strong);
}

.prices-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--white);
}

.prices-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  color: var(--brown);
}

.prices-table th,
.prices-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.prices-table th {
  background: var(--cream-dark);
  font-weight: 900;
}

.prices-section-row td {
  background: rgba(193, 219, 232, 0.22);
  color: var(--brown);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.78rem;
}

.price-item-title,
.price-item-id {
  display: block;
}

.price-item-title {
  font-weight: 900;
  color: var(--brown);
}

.price-item-id {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.price-input {
  width: 160px;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--white);
  color: var(--brown);
  font: inherit;
  font-weight: 800;
}

.price-input:focus {
  outline: none;
  border-color: var(--brown);
  box-shadow: 0 0 0 4px rgba(193, 219, 232, 0.45);
}

.prices-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.price-status {
  color: var(--muted);
  font-weight: 800;
}

@media (max-width: 680px) {
  .prices-manager-card {
    padding: 20px;
  }

  .prices-actions .btn {
    width: 100%;
  }
}

/* Teacher ebook manager */
.teacher-ebook-tools {
  margin-top: 24px;
  display: grid;
  gap: 22px;
}

.teacher-ebook-tools[hidden] {
  display: none !important;
}

.add-ebook-card {
  min-height: 170px;
}

.ebook-editor-card {
  padding: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background: var(--white);
}

.ebook-editor-card[hidden] {
  display: none !important;
}

.ebook-editor-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.6fr 0.6fr;
  gap: 18px;
}

.ebook-editor-wide {
  grid-column: 1 / -1;
}

.ebook-editor-card textarea {
  width: 100%;
  min-height: 120px;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--white);
  color: var(--brown);
  font: inherit;
  resize: vertical;
}

.ebook-editor-card input[type="file"] {
  width: 100%;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: #fffaf0;
  color: var(--brown);
  font: inherit;
  font-weight: 800;
}

.ebook-editor-card small {
  color: var(--muted);
  font-weight: 700;
}

.ebook-editor-preview {
  margin-top: 22px;
  display: grid;
  gap: 18px;
}

.ebook-editor-preview-section {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fffaf0;
}

.ebook-editor-preview-section > strong {
  display: block;
  margin-bottom: 12px;
  color: var(--brown);
}

.ebook-editor-preview-section > img {
  width: min(180px, 100%);
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--white);
}

.ebook-editor-file-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.ebook-editor-file-grid img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}

.ebook-editor-pdf-list {
  display: grid;
  gap: 10px;
}

.ebook-editor-pdf-list a,
.ebook-editor-pdf-list span,
.ebook-editor-file-grid span {
  color: var(--brown);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.ebook-editor-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.ebook-editor-status {
  margin-right: auto;
  color: var(--muted);
  font-weight: 800;
}

.ebook-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.ebook-admin-id {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.ebook-published-tag {
  background: #e8f5ec;
}

.ebook-draft-tag {
  background: #fff1b5;
}

.ebook-admin-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.ebook-admin-actions .btn {
  flex: 1 1 140px;
}

.ebook-delete-btn {
  border-color: #b43636 !important;
  color: #b43636 !important;
  background: #fff3f3 !important;
}

.ebook-empty-note {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  color: var(--muted);
  font-weight: 800;
  background: #fffaf0;
}

@media (max-width: 900px) {
  .ebook-editor-grid {
    grid-template-columns: 1fr;
  }

  .ebook-editor-file-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .ebook-editor-card {
    padding: 20px;
  }

  .ebook-editor-actions .btn,
  .ebook-admin-actions .btn {
    width: 100%;
    flex-basis: 100%;
  }

  .ebook-editor-status {
    width: 100%;
  }
}
