/* Course Builder — groups, bulk enroll, discussions, email wording (admin and student dashboard). Logical properties keep right-to-left layouts in step. */

/* Job progress */
.cbx-job { margin: 0 0 1em; }
.cbx-job-bar { height: 10px; background: #e5e7eb; border-radius: 99px; overflow: hidden; }
.cbx-job-bar span { display: block; height: 100%; background: var(--cb-accent, #4f46e5); border-radius: 99px; transition: width .3s; }
.cbx-job[data-status="done"] .cbx-job-bar span { background: #16a34a; }
.cbx-job-text { margin: .5em 0; font-weight: 600; }
.cbx-job-parts { list-style: none; margin: 0 0 .5em; padding: 0; display: flex; flex-wrap: wrap; gap: .4em 1.2em; }
.cbx-job-parts li.is-bad strong { color: #b91c1c; }
.cbx-job-parts li.is-ok strong { color: #166534; }
.cbx-job-problems ul { margin: .2em 0 .6em; padding-inline-start: 1.2em; max-height: 220px; overflow-y: auto; }
.cbx-job-problems li { overflow-wrap: anywhere; }

/* Inline "Are you sure?" */
.cbx-confirm { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .5em; background: #fef2f2; border: 1px solid #fecaca; color: #7f1d1d; border-radius: 8px; padding: .4em .6em; margin: .3em 0; max-width: 100%; }
.cbx-confirm-text { flex: 1 1 12em; }
.cbx-confirm .cbx-confirm-yes { background: #b91c1c; border-color: #b91c1c; color: #fff !important; padding: .35em .9em; font-size: .9em; }

/* Admin screens */
.cbx-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 16px; margin: 0 0 12px; }
.cbx-grid label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.cbx-grid input[type="text"] { width: 100%; }
.cbx-courses { border: 1px solid #dcdcde; border-radius: 8px; padding: 8px 12px 10px; margin: 12px 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.cbx-courses legend { font-weight: 600; padding: 0 4px; }
.cbx-check { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0; }
.cbx-bulk textarea, .cbx-bulk input[type="file"] { display: block; margin: 6px 0; max-width: 100%; }
.cbx-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 10px; }
.cbx-card-head h2, .cbx-card-head h4 { margin: 0; }
.cbx-list { margin: .3em 0; padding-inline-start: 1.2em; list-style: disc; }
.cbx-danger-zone { border-color: #fecaca; }
.cbx-quote { font-style: italic; margin: 2px 0; }
.cbx-post-text { margin-top: 4px; overflow-wrap: anywhere; }

/* Settings → Email wording */
.cbx-wording { padding-inline: 0 !important; }
.cbx-email { border: 1px solid #dcdcde; border-radius: 8px; margin: 0 0 10px; background: #fff; }
.cbx-email > summary { cursor: pointer; padding: 10px 14px; list-style-position: inside; }
.cbx-email[open] > summary { border-bottom: 1px solid #f0f0f1; }
.cbx-email-body { padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 4px; }
.cbx-email-body label { font-weight: 600; margin-top: 6px; }
.cbx-tags { background: #f6f7f7; border-radius: 6px; padding: 8px 12px; margin-top: 8px; font-size: 12px; }
.cbx-tags ul { margin: 4px 0 0; columns: 2 260px; }
.cbx-tags li { margin: 0 0 3px; break-inside: avoid; }

/* Student dashboard: My group */
.cbx-group { display: flex; flex-direction: column; gap: 1em; }
.cbx-group-pick { display: flex; flex-wrap: wrap; gap: .4em; }
.cbx-group-pick a { padding: .35em .8em; border: 1px solid var(--cb-line, #e5e7eb); border-radius: 99px; text-decoration: none; color: inherit; font-size: .9em; }
.cbx-group-pick a.is-active { background: var(--cb-accent, #4f46e5); border-color: var(--cb-accent, #4f46e5); color: #fff; }
.cbx-group-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8em; }
.cbx-group-head h3 { margin: 0; }
.cbx-seats { display: flex; flex-direction: column; align-items: flex-end; text-align: end; }
.cbx-seats strong { font-size: 1.8em; line-height: 1.1; color: var(--cb-accent, #4f46e5); }
.cbx-card { border: 1px solid var(--cb-line, #e5e7eb); border-radius: var(--cb-radius, 12px); padding: 1em; background: #fff; }
.cbx-card h4 { margin: 0 0 .6em; font-size: 1.05em; }
.cbx-card .cbx-card-head { margin-bottom: .6em; }
.cbx-invite { display: flex; flex-direction: column; gap: .5em; align-items: flex-start; }
.cbx-invite label { font-size: .95em; }
.cbx-invite textarea { width: 100%; font: inherit; border: 1px solid #d1d5db; border-radius: 10px; padding: .6em .7em; }
.cbx-notice-ok { background: #ecfdf5; color: #065f46; }
.cbx-actions { white-space: nowrap; }
.cbx-actions form { margin: 0; }
.cbx-danger { color: #b91c1c !important; }
.cbx-remove .cb-btn-ghost { background: #fff !important; border: 1px solid #fecaca !important; padding: .45em .9em; font-size: .9em; }
.cb-tag.is-none { background: #f3f4f6; color: #4b5563; }
.cbx-job-reload { display: inline-block; margin-top: .3em; }

/* The members table stacks into cards whenever its column is narrow (themes with a slim content column, phones). */
.cbx-members { container-type: inline-size; }
@container (max-width: 640px) {
  .cbx-members .cb-table thead { display: none; }
  .cbx-members .cb-table tr { display: block; border: 1px solid var(--cb-line, #e5e7eb); border-radius: 10px; margin: 0 0 .7em; padding: .3em .2em; }
  .cbx-members .cb-table td { display: block; border: 0; padding: .4em .6em; text-align: start; overflow-wrap: anywhere; }
  .cbx-members .cb-table td::before { content: attr(data-label); display: block; margin-bottom: .15em; font-weight: 600; color: var(--cb-muted, #6b7280); }
  .cbx-members .cb-table td.cbx-actions { text-align: end; }
  .cbx-members .cb-table td.cbx-actions::before { content: none; }
}
@media (max-width: 600px) {
  .cbx-seats { align-items: flex-start; text-align: start; }
  .cbx-invite .cb-btn { width: 100%; }
  .cbx-actions { white-space: normal; }
  .cbx-confirm { display: flex; }
}
@media (max-width: 782px) {
  .cbx-bulk .button-large { width: 100%; }
}

/* Course Builder — bundle pages, instructor profiles and the instructor application form. */
.cb-bundle .cb-bundle-value { margin: -.3em 0 .8em; text-decoration: none; }

/* Instructors on the course page */
.cb-instructor .cb-inst + .cb-inst { margin-block-start: 1.2em; }
.cb-inst-headline { display: block; margin-block-start: .15em; }

/* Profile page */
.cb-profile-head { display: flex; gap: 1.4em; align-items: center; margin: 0 0 1.5em; }
.cb-profile-head .cb-inst-photo { width: 140px; height: 140px; border-radius: 50%; object-fit: cover; flex: none; }
.cb-profile-id { min-width: 0; }
.cb-profile-name { font-size: 1.6em; font-weight: 800; margin: 0; line-height: 1.2; overflow-wrap: anywhere; }
.cb-profile-headline { color: var(--cb-muted); margin: .3em 0 0; font-size: 1.05em; }
.cb-profile-stats { display: flex; flex-wrap: wrap; gap: .4em 1.2em; margin: .7em 0 0; color: var(--cb-muted); font-size: .95em; }
.cb-profile-stats a { overflow-wrap: anywhere; }

/* Instructor directory */
.cb-people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1em; }
.cb-person { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .3em; padding: 1.2em 1em; border: 1px solid var(--cb-line); border-radius: var(--cb-radius); background: #fff; color: var(--cb-ink); text-decoration: none !important; transition: box-shadow .15s; }
.cb-person:hover { box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.cb-person .cb-inst-photo { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; margin-block-end: .4em; }

/* Application form */
.cb-apply { max-width: 640px; }
.cb-apply-box .cb-form textarea, .cb-apply-box .cb-form input[type=url] { width: 100%; padding: .65em .8em; border: 1px solid #d1d5db; border-radius: 8px; font: inherit; margin-block-start: .3em; }
.cb-apply-done { font-weight: 700; color: #166534; font-size: 1.1em; margin: 0 0 .3em; }

@media (max-width: 600px) {
  .cb-profile-head { flex-direction: column; text-align: center; }
  .cb-profile-stats { justify-content: center; }
  .cb-profile-head .cb-inst-photo { width: 112px; height: 112px; }
}
