:root {
  --bg: #f4efe7;
  --paper: #fffdf9;
  --ink: #1e293b;
  --muted: #64748b;
  --accent: #146c94;
  --accent-dark: #0f4c75;
  --border: #dfd5c8;
  --success: #d8f3dc;
  --success-ink: #1b4332;
  --error: #fde2e4;
  --error-ink: #9d0208;
  --body-font: "Segoe UI", sans-serif;
  --base-font-size: 16px;
  --radius-card: 20px;
  --radius-control: 12px;
  --radius-medium: 14px;
  --radius-panel: 16px;
  --radius-pill: 999px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-size: var(--base-font-size);
  font-family: var(--body-font);
  color: var(--ink);
  background:
    radial-gradient(circle at top right, #dbeafe 0, transparent 28%),
    linear-gradient(180deg, #f9f6f1 0%, #f1e8db 100%);
}

body[data-color-theme="arena"] {
  --bg: #f4efe7;
  --paper: #fffdf9;
  --ink: #1e293b;
  --muted: #64748b;
  --accent: #146c94;
  --accent-dark: #0f4c75;
  --border: #dfd5c8;
  --success: #d8f3dc;
  --success-ink: #1b4332;
  --error: #fde2e4;
  --error-ink: #9d0208;
}

body[data-color-theme="oceano"] {
  --bg: #eaf4fb;
  --paper: #fdfefe;
  --ink: #12324a;
  --muted: #51748d;
  --accent: #0b6e99;
  --accent-dark: #084c6d;
  --border: #c8dce7;
  --success: #daf5ee;
  --success-ink: #155e63;
  --error: #fde7ea;
  --error-ink: #a11d33;
}

body[data-color-theme="bosque"] {
  --bg: #edf3ea;
  --paper: #fcfdf9;
  --ink: #20352a;
  --muted: #62796b;
  --accent: #2f7d4d;
  --accent-dark: #1f5c38;
  --border: #d4dfd0;
  --success: #d8f0dd;
  --success-ink: #1f5130;
  --error: #fbe3df;
  --error-ink: #8f2d1e;
}

body[data-color-theme="coral"] {
  --bg: #f8eee9;
  --paper: #fffdfb;
  --ink: #3d2b2b;
  --muted: #806362;
  --accent: #d46a4c;
  --accent-dark: #a84b33;
  --border: #e7d1c8;
  --success: #e0f1df;
  --success-ink: #2e5c37;
  --error: #ffe1dc;
  --error-ink: #a33422;
}

body[data-font-theme="segoe"] {
  --body-font: "Segoe UI", sans-serif;
}

body[data-font-theme="georgia"] {
  --body-font: "Bitter", Georgia, serif;
}

body[data-font-theme="trebuchet"] {
  --body-font: "Nunito", "Trebuchet MS", sans-serif;
}

body[data-font-theme="courier"] {
  --body-font: "IBM Plex Mono", "Courier New", monospace;
}

body[data-font-size-theme="small"] {
  --base-font-size: 14px;
}

body[data-font-size-theme="normal"] {
  --base-font-size: 16px;
}

body[data-font-size-theme="large"] {
  --base-font-size: 18px;
}

body[data-shape-theme="soft"] {
  --radius-card: 20px;
  --radius-control: 12px;
  --radius-medium: 14px;
  --radius-panel: 16px;
  --radius-pill: 999px;
}

body[data-shape-theme="square"] {
  --radius-card: 4px;
  --radius-control: 4px;
  --radius-medium: 4px;
  --radius-panel: 5px;
  --radius-pill: 4px;
}

a {
  color: var(--accent-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 2rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
}

.site-header nav {
  display: flex;
  gap: 1rem;
}

.brand {
  font-size: 1.4rem;
  font-weight: 700;
}

.subtitle,
.muted {
  color: var(--muted);
}

.container {
  width: min(1320px, calc(100% - 2rem));
  margin: 2rem auto 3rem;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.25rem;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.05);
}

.narrow {
  max-width: 480px;
  margin: 3rem auto;
}

.login-version-wrap {
  display: flex;
  justify-content: center;
  margin-top: 1.35rem;
  padding-top: 1rem;
  border-top: 1px solid #ece7df;
}

.version-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5.5rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(30, 41, 59, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(241, 245, 249, 0.95) 100%);
  color: var(--accent-dark);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}

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

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

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.settings-layout {
  display: grid;
  gap: 1rem;
}

.course-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.65fr) minmax(0, 4.6fr) minmax(240px, 0.75fr);
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: start;
}

.course-layout:has(.course-side-panel:not([open])) {
  grid-template-columns: 4.2rem minmax(0, 4.6fr) minmax(240px, 0.75fr);
}

.stack {
  display: grid;
  gap: 0.9rem;
}

.student-course-tools,
.student-course-search {
  margin-bottom: 1rem;
}

.student-course-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.student-course-search {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid #d7dee8;
  border-radius: var(--radius-card);
  background: #f8fafc;
}

.student-course-search-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.editor-label {
  font-weight: 600;
}

label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
}

.checkbox-row {
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 0.75rem;
}

.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 0.2rem;
}

.section-divider {
  width: 100%;
  height: 1px;
  margin: 0.5rem 0;
  border: 0;
  background: #e2e8f0;
}

.top-gap {
  margin-top: 1rem;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border-radius: var(--radius-control);
  border: 1px solid #cbd5e1;
  background: white;
}

button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: none;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-control);
  background: var(--accent);
  color: white;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.button-link.secondary {
  background: #475569;
}

.actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.simple-list,
.course-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.9rem;
}

.course-list li,
.simple-list li {
  padding-bottom: 0.9rem;
  border-bottom: 1px solid #ece7df;
}

.course-list li:last-child,
.simple-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.student-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.presence-list-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.presence-list-item > div {
  display: grid;
  gap: 0.2rem;
}

.presence-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 132px;
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-control);
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}

.presence-badge.is-online {
  background: #dcfce7;
  color: #166534;
}

.presence-badge.is-offline {
  background: #e2e8f0;
  color: #334155;
}

.stats-filter-form {
  display: flex;
  align-items: end;
  gap: 1rem;
  flex-wrap: wrap;
}

.stats-filter-actions {
  display: flex;
  gap: 0.75rem;
}

.stats-summary-card h2 {
  margin: 0 0 0.35rem;
  font-size: 2rem;
}

.stats-summary-card p {
  margin: 0;
}

.stats-chart-list {
  display: grid;
  gap: 0.9rem;
}

.stats-chart-row {
  display: grid;
  gap: 0.45rem;
}

.stats-chart-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.stats-bar-track {
  width: 100%;
  height: 14px;
  border-radius: var(--radius-pill);
  background: #e6edf3;
  overflow: hidden;
}

.stats-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--accent-dark) 0%, var(--accent) 100%);
}

.stats-bar-fill.alt {
  background: linear-gradient(90deg, #2563eb 0%, #60a5fa 100%);
}

.stats-bar-fill.soft {
  background: linear-gradient(90deg, #0f766e 0%, #5eead4 100%);
}

.hourly-chart {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.flash-list {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.flash {
  padding: 0.9rem 1rem;
  border-radius: var(--radius-control);
  font-weight: 600;
}

.flash.success {
  background: var(--success);
  color: var(--success-ink);
}

.flash.error {
  background: var(--error);
  color: var(--error-ink);
}

.small-text {
  font-size: 0.92rem;
}

.edit-box {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #ece7df;
}

.action-row,
.inline-delete {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.reorder-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 0.4rem 0 0.8rem;
}

.inline-delete {
  margin-top: 0.75rem;
}

.danger-button {
  background: #b42318;
}

.ghost-button {
  background: #e5ecf3;
  color: #1f2937;
}

.content-stack,
.video-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.topic-section {
  padding: 1.35rem;
  border: 1px solid #d8d1c3;
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, #fffdfa 0%, #fbf6ee 100%);
}

.topic-collapse-control {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.topic-tone-0 {
  border-color: #d8c39d;
  background: linear-gradient(180deg, #fff8eb 0%, #f9edd5 100%);
}

.topic-tone-0 .topic-header {
  border-bottom-color: #ead9b6;
}

.topic-tone-1 {
  border-color: #bfd8c2;
  background: linear-gradient(180deg, #f3fbf3 0%, #e1f2e2 100%);
}

.topic-tone-1 .topic-header {
  border-bottom-color: #cfe4d1;
}

.topic-tone-2 {
  border-color: #bfd4e6;
  background: linear-gradient(180deg, #f4f9ff 0%, #e2eefb 100%);
}

.topic-tone-2 .topic-header {
  border-bottom-color: #d3e2f1;
}

.topic-tone-3 {
  border-color: #d9c4e8;
  background: linear-gradient(180deg, #fbf6ff 0%, #eee1f8 100%);
}

.topic-tone-3 .topic-header {
  border-bottom-color: #e3d3ef;
}

.topic-tone-4 {
  border-color: #e2c3c1;
  background: linear-gradient(180deg, #fff7f6 0%, #f7e3e1 100%);
}

.topic-tone-4 .topic-header {
  border-bottom-color: #eed4d1;
}

.topic-tone-5 {
  border-color: #d2cbb8;
  background: linear-gradient(180deg, #faf8f2 0%, #efe9dc 100%);
}

.topic-tone-5 .topic-header {
  border-bottom-color: #e0d8c8;
}

.topic-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid #e9dfd0;
}

.topic-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.topic-toggle-button {
  user-select: none;
  cursor: pointer;
}

.topic-admin-toggle-button {
  margin-left: 0.35rem;
}

.topic-label-closed {
  display: none;
}

.topic-collapse-control:not(:checked) ~ .topic-header {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.topic-collapse-control:not(:checked) ~ .topic-header .topic-label-open {
  display: none;
}

.topic-collapse-control:not(:checked) ~ .topic-header .topic-label-closed {
  display: inline-flex;
}

.topic-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1 1 auto;
}

.topic-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(30, 41, 59, 0.1);
  font-size: 1rem;
  line-height: 1;
}

.topic-header h3,
.content-item h4 {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.topic-items {
  display: grid;
  gap: 1.1rem;
}

.topic-collapse-control:not(:checked) ~ .topic-items {
  display: none;
}

.content-column,
.sidebar-column,
.topic-nav-column {
  min-width: 0;
}

.content-column,
.content-stack,
.topic-section,
.topic-items,
.content-item {
  width: 100%;
  min-width: 0;
}

.topic-nav-column {
  position: sticky;
  top: 1rem;
}

.sidebar-column + .sidebar-column {
  margin-top: 1rem;
}

.course-side-panel {
  display: grid;
  gap: 1rem;
}

.course-side-panel-summary {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  list-style: none;
  cursor: pointer;
  color: var(--accent-dark);
  font-weight: 800;
}

.course-side-panel-summary::-webkit-details-marker {
  display: none;
}

.course-side-panel-summary::before {
  content: "▾";
  font-size: 0.9rem;
}

.course-side-panel:not([open]) .course-side-panel-summary::before {
  content: "▸";
}

.course-side-panel:not([open]) {
  justify-items: center;
}

.course-layout:has(.course-side-panel:not([open])) .topic-nav-column > .card {
  padding: 0.75rem 0.55rem;
}

.course-side-panel-body,
.side-panel-section {
  display: grid;
  gap: 0.85rem;
}

.side-panel-section + .side-panel-section {
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

.side-panel-section h2 {
  margin: 0;
}

.topic-nav {
  display: grid;
  gap: 0.75rem;
}

.recent-updates-list {
  display: grid;
  gap: 0.7rem;
}

.recent-update-item {
  display: grid;
  gap: 0.18rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(30, 41, 59, 0.08);
  border-radius: var(--radius-medium);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.recent-update-item:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.topic-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(30, 41, 59, 0.08);
  border-radius: var(--radius-medium);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.topic-nav-link:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.topic-nav-link.is-hidden-topic-link,
.topic-section.is-hidden-topic {
  opacity: 0.72;
}

.topic-section.is-hidden-topic {
  border-style: dashed;
}

.topic-dropzone {
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
  border: 2px dashed rgba(30, 41, 59, 0.18);
  border-radius: var(--radius-medium);
  background: rgba(255, 255, 255, 0.55);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.topic-dropzone-title {
  margin: 0;
  font-weight: 700;
}

.dropzone-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-weight: 600;
}

.dropzone-title-mode {
  width: auto;
  min-width: 5.2rem;
  padding: 0.45rem 0.7rem;
}

.topic-dropzone-status {
  min-height: 1.1rem;
  margin: 0;
}

.topic-dropzone.is-dragover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.88);
  transform: translateY(-1px);
}

.topic-dropzone.is-uploading {
  opacity: 0.8;
}

.topic-dropzone.has-error {
  border-color: #b42318;
  background: #fff3f2;
}

.course-white-test .card,
.course-white-test .topic-section,
.course-white-test .topic-header,
.course-white-test .topic-nav-link,
.course-white-test .recent-update-item,
.course-white-test .content-item,
.course-white-test .topic-dropzone,
.course-white-test .text-content-box,
.course-white-test .image-card,
.course-white-test .video-card {
  background: #fff;
}

.course-white-test .topic-section,
.course-white-test .topic-header,
.course-white-test .topic-nav-link,
.course-white-test .recent-update-item,
.course-white-test .content-item,
.course-white-test .topic-dropzone {
  border-color: #e2e8f0;
}

.course-white-test .topic-tone-0,
.course-white-test .topic-tone-1,
.course-white-test .topic-tone-2,
.course-white-test .topic-tone-3,
.course-white-test .topic-tone-4,
.course-white-test .topic-tone-5 {
  background: #fff;
  border-color: #e2e8f0;
}

.course-white-test .topic-tone-0 .topic-header,
.course-white-test .topic-tone-1 .topic-header,
.course-white-test .topic-tone-2 .topic-header,
.course-white-test .topic-tone-3 .topic-header,
.course-white-test .topic-tone-4 .topic-header,
.course-white-test .topic-tone-5 .topic-header {
  background: #fff;
}

.course-white-test .topic-icon {
  color: var(--accent-dark);
}

.course-white-test .content-column > h2,
.course-white-test .topic-header h3 {
  color: var(--accent-dark);
}

.course-white-test .content-column > h2 {
  font-size: 1.65rem;
}

.course-white-test .topic-header h3 {
  font-size: 1.45rem;
}

.course-flat-content-test .content-item {
  padding: 0.95rem 0;
  border: 0;
  border-bottom: 1px solid #d9e2ec;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.course-flat-content-test .content-item:last-child {
  border-bottom: 0;
}

.course-flat-content-test .content-item.is-hidden-content {
  border-style: solid;
  opacity: 0.62;
}

.course-flat-content-test .text-content-box,
.course-flat-content-test .image-card,
.course-flat-content-test .video-card {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.web-link {
  display: inline-block;
  margin-top: 0.25rem;
  word-break: break-word;
  font-weight: 600;
}

.text-content-box {
  margin-top: 0.25rem;
  padding: 0.95rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-medium);
  background: #fafafa;
}

.text-content-box > :first-child {
  margin-top: 0;
}

.text-content-box > :last-child {
  margin-bottom: 0;
}

.editor-toolbar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.editor-toolbar .ghost-button {
  padding: 0.55rem 0.8rem;
}

.rich-text-editor {
  min-height: 180px;
  padding: 0.9rem 1rem;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-medium);
  background: white;
  overflow-wrap: anywhere;
}

.rich-text-editor:empty::before {
  content: attr(data-placeholder);
  color: #94a3b8;
}

.content-item {
  padding: 1.15rem 1.2rem;
  border: 1px solid #ece7df;
  border-radius: var(--radius-panel);
  background: #fff;
}

.content-title-text {
  margin: 0;
}

.content-meta-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin: 0.35rem 0 0.85rem;
}

.content-meta-left {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  min-width: 0;
}

.content-meta-left .content-title-text {
  word-break: break-word;
}

.content-type-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  min-width: 2.5rem;
  height: 2.2rem;
  padding: 0 0.5rem;
  border-radius: var(--radius-control);
  line-height: 1;
}

.file-type-icon {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.video-type-icon {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.link-type-icon {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.text-type-icon {
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

.content-svg-icon {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.file-ext-label {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.file-ext-pdf {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}

.file-ext-doc,
.file-ext-docx {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.file-ext-xls,
.file-ext-xlsx {
  background: #dcfce7;
  color: #15803d;
  border-color: #bbf7d0;
}

.file-ext-ppt,
.file-ext-pptx {
  background: #ffedd5;
  color: #c2410c;
  border-color: #fed7aa;
}

.file-ext-txt {
  background: #ede9fe;
  color: #6d28d9;
  border-color: #ddd6fe;
}

.content-item.is-hidden-content {
  opacity: 0.72;
  border-style: dashed;
}

.content-badge {
  display: inline-flex;
  margin: 0;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.85rem;
  font-weight: 700;
}

.content-item h3 {
  margin-top: 0;
}

.content-item h4 {
  margin: 0;
}

.content-progress-form {
  margin: 0.2rem 0 0.9rem;
}

.content-progress-form-inline {
  margin: 0;
  margin-left: auto;
}

.content-inline-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 0.2rem 0 0.85rem;
}

.content-inline-left {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  flex: 1 1 320px;
}

.content-inline-link {
  min-width: 0;
  word-break: break-word;
}

.progress-check {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-pill);
  background: #f8fafc;
  border: 1px solid #dbe4ee;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
}

.progress-check-inline {
  padding: 0.25rem 0.7rem;
}

.progress-check input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: #15803d;
}

.video-card {
  margin-top: 0.85rem;
}

.uploaded-video {
  display: block;
  width: 100%;
  max-width: 640px;
  border-radius: var(--radius-control);
  background: #111827;
}

.image-card {
  margin-top: 0.85rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
}

.course-image-preview {
  display: block;
  min-width: 120px;
  max-width: none;
  height: auto;
  border-radius: var(--radius-control);
  border: 1px solid #e5e7eb;
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.video-frame {
  overflow: hidden;
  width: 100%;
  max-width: 640px;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-control);
  background: #e2e8f0;
}

.video-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.log-filter-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: end;
}

.student-log-actions {
  align-items: end;
}

.env-note {
  display: grid;
  gap: 0.3rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid #e5ddd2;
  border-radius: var(--radius-medium);
  background: #fffdfa;
}

.env-note p {
  margin: 0;
}

.log-table-wrap {
  overflow-x: auto;
}

.log-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

.log-table th,
.log-table td {
  padding: 0.75rem 0.8rem;
  border-bottom: 1px solid #ece7df;
  text-align: left;
  vertical-align: top;
}

.table-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  min-width: 180px;
}

.wrap-actions {
  flex-wrap: wrap;
}

.admin-toggle-card {
  grid-column: 1 / -1;
}

.table-actions form {
  margin: 0;
}

.nested-row td {
  padding: 0.9rem 0.8rem 1rem;
  background: rgba(248, 245, 239, 0.55);
}

.nested-enrollment-box {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.nested-enrollment-group {
  padding: 0.9rem 1rem;
  border: 1px solid #e5ddd2;
  border-radius: var(--radius-medium);
  background: #fffdfa;
}

.nested-enrollment-group h4 {
  margin: 0 0 0.75rem;
}

.nested-course-list {
  display: grid;
  gap: 0.65rem;
}

.nested-course-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid #ece7df;
  border-radius: var(--radius-control);
  background: #fff;
}

.nested-course-item > div {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.nested-course-item strong,
.nested-course-item .muted {
  overflow-wrap: anywhere;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
}

.inline-check input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin: 0;
}

.log-table th {
  background: #f8f5ef;
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .log-filter-form {
    grid-template-columns: 1fr;
  }

  .nested-enrollment-box {
    grid-template-columns: 1fr;
  }
}


@media (max-width: 860px) {
  .container {
    width: min(100%, calc(100% - 1rem));
    margin: 1rem auto 2rem;
  }

  .course-layout,
  .grid.two,
  .grid.three,
  .grid.four,
  .grid.five {
    grid-template-columns: 1fr;
  }

  .course-layout {
    gap: 0.85rem;
  }

  .course-layout > .card {
    padding: 1rem 0.9rem;
  }

  .student-course-search-actions {
    flex-direction: column;
  }

  .stats-filter-form,
  .stats-chart-label {
    align-items: stretch;
  }

  .hourly-chart {
    grid-template-columns: 1fr;
  }

  .topic-section {
    padding: 1rem 0.9rem;
  }

  .content-item {
    padding: 0.95rem 0.9rem;
  }

  .topic-nav-column {
    position: static;
  }

  .topic-header {
    flex-direction: column;
    align-items: stretch;
  }

  .topic-title-wrap,
  .topic-header-actions {
    width: 100%;
    align-items: flex-start;
  }

  .presence-list-item {
    flex-direction: column;
  }

  .hero,
  .site-header {
    flex-direction: column;
    align-items: start;
  }
}
