:root {
  --teo-bg: #f8f6f4;
  --teo-sidebar: #1e1a17;
  --teo-sidebar-border: rgba(255, 255, 255, 0.05);
  --teo-accent: #cb1e31;
  --teo-accent-soft: rgba(203, 30, 49, 0.2);
  --teo-text: #1e1a17;
  --teo-muted: #8a8178;
  --teo-card: #ffffff;
  --teo-radius: 14px;
  --teo-shadow: 0 1px 2px rgba(30, 26, 23, 0.04), 0 8px 24px rgba(30, 26, 23, 0.06);
  --teo-sidebar-w: 210px;
  --teo-topbar-h: 64px;
  --teo-green: #2f9e6a;
  --teo-yellow: #c9a227;
  --teo-blue: #3b6ea5;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: "Geist", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--teo-bg);
  color: var(--teo-text);
}

a { color: inherit; text-decoration: none; }

.admin-app {
  display: flex;
  min-height: 100vh;
  background: var(--teo-bg);
}

.admin-sidebar {
  width: var(--teo-sidebar-w);
  background: var(--teo-sidebar);
  color: #fff;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--teo-sidebar-border);
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
}

.sidebar-brand {
  height: var(--teo-topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--teo-sidebar-border);
}

.sidebar-brand img.logo { height: 28px; width: auto; display: block; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px;
}

.nav-section {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.2);
  padding: 8px 12px 4px;
  margin-bottom: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  margin: 2px 0;
  border-radius: var(--teo-radius);
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  font-weight: 500;
  transition: background .15s ease, color .15s ease;
}

.nav-link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }

.nav-link.active {
  background: var(--teo-accent-soft);
  color: #fff;
}

.nav-link img.nav-icon {
  width: 17px;
  height: 17px;
  object-fit: contain;
  flex-shrink: 0;
  filter: brightness(0) invert(1);
  opacity: 0.75;
}

.nav-link.active img.nav-icon { opacity: 1; }

.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--teo-accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-footer {
  border-top: 1px solid var(--teo-sidebar-border);
  padding: 13px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-footer img.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.sidebar-footer .meta { flex: 1; min-width: 0; }
.sidebar-footer .name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-footer .role { font-size: 11px; color: rgba(255,255,255,0.45); }

.admin-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  height: var(--teo-topbar-h);
  background: var(--teo-bg);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.admin-topbar h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #6d5f5a;
  flex: 1;
}

.admin-topbar.is-builder {
  background: #fff;
  border-bottom: 1px solid #f3f4f6;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.topbar-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #99a1af;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.topbar-back:hover { color: #6d5f5a; }

.topbar-builder-title {
  margin: 0 !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  color: #6d5f5a;
  flex: 1;
}

.top-search {
  width: 208px;
  height: 38px;
  background: #fff;
  border: 1px solid rgba(30, 26, 23, 0.08);
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
}

.top-search input {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  font-size: 13px;
  color: var(--teo-text);
}

.top-search input::placeholder { color: var(--teo-muted); }

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 0;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: var(--teo-shadow);
  text-decoration: none;
  color: inherit;
}

.icon-btn .dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teo-accent);
}

.notif-admin-list {
  padding: 8px 18px;
  overflow: hidden;
}
.notif-admin-list .notif-admin-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(30,26,23,0.06);
  width: 100%;
}
.notif-admin-list .notif-admin-item:last-child { border-bottom: 0; }
.notif-admin-list .notif-admin-item.is-unread {
  background: rgba(196, 92, 38, 0.04);
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
  border-radius: 10px;
}
.notif-admin-type {
  flex-shrink: 0;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 5px 8px;
  border-radius: 8px;
  background: #f0ebe6;
  color: #5c534c;
}
.notif-admin-type--enrollment,
.notif-admin-type--payment { background: rgba(47,158,106,0.12); color: #1f6b47; }
.notif-admin-type--coupon { background: rgba(196,92,38,0.12); color: #8f3d14; }
.notif-admin-body { flex: 1; min-width: 0; }
.notif-admin-body strong { display: block; font-size: 14px; margin-bottom: 4px; }
.notif-admin-body p { margin: 0 0 6px; font-size: 13px; color: #4a433c; line-height: 1.45; }
.notif-admin-body .time { color: var(--teo-muted); font-size: 11px; }

.topbar-avatar {
  width: 32px;
  height: 32px;
  max-width: 32px;
  max-height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.admin-content {
  padding: 32px;
  flex: 1;
}

.teo-card {
  background: var(--teo-card);
  border-radius: var(--teo-radius);
  box-shadow: var(--teo-shadow);
  border: 1px solid rgba(30, 26, 23, 0.04);
}

.welcome-banner {
  background: linear-gradient(135deg, #2a231e 0%, #1e1a17 100%);
  color: #fff;
  border-radius: 18px;
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  overflow: hidden;
  position: relative;
}

.welcome-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../images/banner-texture.jpg") center/cover no-repeat;
  opacity: 0.18;
  pointer-events: none;
}

.welcome-banner > * { position: relative; z-index: 1; }

.welcome-banner .eyebrow {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin-bottom: 4px;
}

.welcome-banner h2 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 34px;
  font-weight: 600;
  line-height: 1.15;
}

.welcome-banner p {
  margin: 8px 0 0;
  color: rgba(255,255,255,0.7);
  font-size: 14px;
}

.btn-teo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--teo-accent);
  color: #fff !important;
  border: 0;
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: filter .15s ease, transform .15s ease;
}

.btn-teo:hover { filter: brightness(1.05); color: #fff; }

.btn-teo-outline {
  background: transparent;
  color: var(--teo-text) !important;
  border: 1px solid rgba(30, 26, 23, 0.12);
  border-radius: 12px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  padding: 21px;
  min-height: 150px;
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.stat-icon img { width: 18px; height: 18px; }
.stat-icon.blue { background: rgba(59, 110, 165, 0.12); }
.stat-icon.brown { background: rgba(140, 98, 57, 0.12); }
.stat-icon.green { background: rgba(47, 158, 106, 0.12); }
.stat-icon.yellow { background: rgba(201, 162, 39, 0.15); }

.stat-value {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}

.stat-label {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--teo-muted);
}

.stat-sub {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--teo-muted);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.9fr;
  gap: 16px;
}

.panel {
  padding: 24px;
}

.panel h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.panel .sub {
  margin: 2px 0 16px;
  font-size: 12px;
  color: var(--teo-muted);
}

.legend {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--teo-muted);
}

.legend span::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.legend .rev::before { background: var(--teo-accent); }
.legend .stu::before { background: #b7aea4; }

.completion-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  font-size: 13px;
}

.dot-g, .dot-r, .dot-x {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
}
.dot-g { background: var(--teo-green); }
.dot-r { background: var(--teo-accent); }
.dot-x { background: #cfc7bf; }

.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(30,26,23,0.06);
  font-size: 13px;
}

.activity-item:last-child { border-bottom: 0; }

.activity-item .time {
  color: var(--teo-muted);
  font-size: 11px;
  margin-top: 2px;
}

.course-row, .student-row, .table-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(30,26,23,0.06);
}

.course-thumb {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}

/* Figma course card (node 101:944) */
.course-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.course-card {
  display: flex;
  align-items: stretch;
  background: #fff;
  border: 1px solid #f3f4f6;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
}

.course-card__media {
  position: relative;
  width: 144px;
  min-width: 144px;
  min-height: 157px;
  flex-shrink: 0;
  align-self: stretch;
  overflow: hidden;
  background: #e8e4e0;
}

.course-card__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.course-card__media-shade {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  pointer-events: none;
}

.course-card__body {
  flex: 1;
  min-width: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.course-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.course-card__titles {
  min-width: 0;
}

.course-card__title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 22.5px;
  color: #6d5f5a;
}

.course-card__meta {
  margin: 2px 0 0;
  font-size: 11px;
  font-weight: 400;
  line-height: 16.5px;
  color: #99a1af;
}

.course-card__badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  line-height: 15px;
  white-space: nowrap;
  flex-shrink: 0;
}

.course-card__badge.is-published {
  background: #ecfdf5;
  border: 1px solid #d0fae5;
  color: #007a55;
}

.course-card__badge.is-draft {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  color: #6a7282;
}

.course-card__stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  margin-top: 8px;
}

.course-card__stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  line-height: 18px;
  color: #6a7282;
}

.course-card__stat img {
  width: 12px;
  height: 12px;
  display: block;
  flex-shrink: 0;
}

.course-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.course-card__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}

.course-card__btn img {
  width: 12px;
  height: 12px;
  display: block;
  flex-shrink: 0;
}

.course-card__btn--edit {
  padding: 8px 16px;
  background: rgba(109, 95, 90, 0.08);
  color: #6d5f5a;
}

.course-card__btn--edit:hover {
  background: rgba(109, 95, 90, 0.14);
  color: #6d5f5a;
}

.course-card__btn--preview {
  padding: 8px 12px;
  background: transparent;
  color: #99a1af;
}

.course-card__btn--preview:hover {
  color: #6d5f5a;
  background: rgba(109, 95, 90, 0.06);
}

@media (max-width: 520px) {
  .course-card { flex-direction: column; }
  .course-card__media {
    width: 100%;
    min-width: 0;
    height: 160px;
    min-height: 160px;
  }
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.badge-published { background: #ecfdf5; border: 1px solid #d0fae5; color: #007a55; }
.badge-draft { background: #f3f4f6; border: 1px solid #e5e7eb; color: #6a7282; }
.badge-pending { background: rgba(201,162,39,0.18); color: #9a7a12; }
.badge-active { background: rgba(47,158,106,0.12); color: var(--teo-green); }
.badge-open { background: rgba(203,30,49,0.12); color: var(--teo-accent); }
.badge-answered, .badge-reviewed { background: rgba(47,158,106,0.12); color: var(--teo-green); }

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.page-head p { margin: 4px 0 0; color: var(--teo-muted); font-size: 14px; }

.form-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-control, .form-select, textarea.form-control {
  width: 100%;
  border: 1px solid rgba(30,26,23,0.12);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  background: #fff;
  color: var(--teo-text);
  outline: none;
}

.form-control:focus, .form-select:focus, textarea.form-control:focus {
  border-color: rgba(203,30,49,0.45);
  box-shadow: 0 0 0 3px rgba(203,30,49,0.12);
}

.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-3 { margin-top: 1rem; }
.gap-2 { gap: .5rem; }
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }

.alert-teo {
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 14px;
}
.alert-success { background: rgba(47,158,106,0.12); color: #1f6b47; }
.alert-danger { background: rgba(203,30,49,0.12); color: #8f1422; }

.table-teo {
  width: 100%;
  border-collapse: collapse;
}

.table-teo th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--teo-muted);
  padding: 10px 12px;
  border-bottom: 1px solid rgba(30,26,23,0.08);
}

.table-teo td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(30,26,23,0.06);
  font-size: 14px;
  vertical-align: middle;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-cell img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.progress-bar-wrap {
  width: 90px;
  height: 6px;
  background: rgba(30,26,23,0.08);
  border-radius: 999px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--teo-accent);
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.quick-action {
  padding: 16px;
  border-radius: 14px;
  background: #faf8f6;
  border: 1px solid rgba(30,26,23,0.06);
  min-height: 96px;
}

.quick-action strong { display: block; font-size: 13px; margin-top: 8px; }
.quick-action span { font-size: 12px; color: var(--teo-muted); }

.payment-guide .guide-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.payment-guide .guide-flow-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #faf8f6;
  border: 1px solid rgba(30,26,23,0.06);
  font-size: 13px;
  font-weight: 600;
  color: #2c2621;
}
.payment-guide .guide-flow-step span {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--teo-accent, #c45c26);
  color: #fff;
  font-size: 12px;
  flex-shrink: 0;
}
.payment-guide .guide-block {
  padding: 18px 18px 8px;
  border-radius: 14px;
  background: #faf8f6;
  border: 1px solid rgba(30,26,23,0.06);
  height: 100%;
}
.payment-guide .guide-block h4 {
  margin: 0 0 12px;
  font-size: 15px;
}
.payment-guide .guide-steps,
.payment-guide .guide-checklist {
  margin: 0;
  padding-left: 18px;
  color: #3a332e;
}
.payment-guide .guide-steps li,
.payment-guide .guide-checklist li {
  margin-bottom: 10px;
  font-size: 13px;
  line-height: 1.55;
}
.payment-guide .guide-steps ul {
  margin: 8px 0 0;
  padding-left: 18px;
}
.payment-guide .guide-steps code,
.payment-guide code {
  font-size: 12px;
  word-break: break-all;
}
.payment-guide .fee-guide-table td,
.payment-guide .fee-guide-table th {
  vertical-align: top;
}
@media (max-width: 900px) {
  .payment-guide .guide-flow {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 560px) {
  .payment-guide .guide-flow {
    grid-template-columns: 1fr;
  }
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #1e1a17 0%, #3a2f28 45%, #f8f6f4 45%);
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 20px;
  padding: 36px;
  box-shadow: var(--teo-shadow);
}

.login-card .logo { height: 36px; margin-bottom: 20px; }
.login-card h1 { font-family: "Cormorant Garamond", Georgia, serif; font-size: 32px; margin: 0 0 8px; }
.login-card .lead { color: var(--teo-muted); margin-bottom: 24px; font-size: 14px; }

.upload-box {
  border: 1.5px dashed rgba(30,26,23,0.18);
  border-radius: 14px;
  padding: 32px;
  text-align: center;
  color: var(--teo-muted);
  background: #faf8f6;
}

/* Course Builder (Figma 101:1693) */
.course-builder { max-width: 1200px; }

.cb-crumb {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  font-size: 12px;
  color: #99a1af;
}

.cb-crumb strong {
  font-weight: 500;
  color: #6d5f5a;
}

.cb-layout {
  display: grid;
  grid-template-columns: minmax(320px, 445px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.cb-col-left,
.cb-col-right {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.cb-card {
  background: #fff;
  border: 1px solid #f3f4f6;
  border-radius: 16px;
  padding: 21px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
}

.cb-card-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 19.5px;
  color: #6d5f5a;
}

.cb-card-sub {
  margin: 4px 0 0;
  font-size: 11px;
  line-height: 16.5px;
  color: #99a1af;
}

.cb-field { margin-top: 12px; }
.cb-field:first-of-type { margin-top: 16px; }

.cb-label {
  display: block;
  margin-bottom: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #99a1af;
  line-height: 15px;
}

.cb-label-soft { font-weight: 400; }

.cb-input {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 11px 17px;
  font-size: 13px;
  color: #364153;
  background: #fff;
  outline: none;
}

.cb-input::placeholder { color: rgba(54, 65, 83, 0.5); }
.cb-input:focus { border-color: rgba(203, 30, 49, 0.35); box-shadow: 0 0 0 3px rgba(203, 30, 49, 0.08); }

.cb-textarea {
  min-height: 80px;
  resize: vertical;
  line-height: 19.5px;
}

.cb-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.cb-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  border: 2px dashed #e5e7eb;
  border-radius: 14px;
  color: #99a1af;
  font-size: 11px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}

.cb-upload:hover { border-color: #d1d5dc; background: #fafafa; }
.cb-upload--thumb {
  margin-top: 12px;
  height: 144px;
  background: #f9fafb;
}

.cb-upload--resource { padding: 18px; margin-top: 12px; }

.cb-upload--video {
  flex-direction: row;
  justify-content: flex-start;
  gap: 12px;
  padding: 18px;
  margin-top: 6px;
}

.cb-upload--video span {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cb-upload--video strong {
  font-size: 12px;
  font-weight: 500;
  color: #4a5565;
  line-height: 18px;
}

.cb-upload--video small {
  font-size: 10px;
  color: #99a1af;
  line-height: 15px;
}

.cb-upload--video.is-busy {
  opacity: 0.7;
  pointer-events: none;
}

.cb-video-current {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 6px 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f0fdf4;
  border: 1px solid #d0fae5;
}

.cb-video-file-label {
  font-size: 12px;
  font-weight: 600;
  color: #007a55;
  word-break: break-all;
}

.cb-video-file-meta {
  font-size: 11px;
  color: #6a7282;
}

.cb-video-progress {
  margin-top: 10px;
}

.cb-video-progress__bar {
  height: 6px;
  border-radius: 999px;
  background: #f3f4f6;
  overflow: hidden;
}

.cb-video-progress__bar span {
  display: block;
  height: 100%;
  width: 0;
  background: #cb1e31;
  border-radius: 999px;
  transition: width .2s ease;
}

.cb-video-progress.is-done .cb-video-progress__bar span { background: #00bc7d; }
.cb-video-progress.is-error .cb-video-progress__bar span { background: #cb1e31; width: 100% !important; }

.cb-video-progress__label {
  margin: 6px 0 0;
  font-size: 11px;
  color: #6a7282;
}

.cb-video-progress.is-error .cb-video-progress__label { color: #cb1e31; }
.cb-video-progress.is-done .cb-video-progress__label { color: #007a55; }

.teo-upload-dock {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1200;
  width: min(360px, calc(100vw - 32px));
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(30, 26, 23, 0.16);
  overflow: hidden;
}

.teo-upload-dock.is-collapsed .teo-upload-dock__body { display: none; }

.teo-upload-dock__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #4d4130;
  color: #fff;
}

.teo-upload-dock__head strong {
  font-size: 13px;
  font-weight: 600;
}

.teo-upload-dock__toggle {
  border: 0;
  background: rgba(255,255,255,0.12);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1;
}

.teo-upload-dock__body {
  max-height: 280px;
  overflow: auto;
  padding: 10px;
}

.teo-upload-row {
  padding: 10px;
  border-radius: 10px;
  background: #f9fafb;
  margin-bottom: 8px;
}

.teo-upload-row:last-child { margin-bottom: 0; }

.teo-upload-row__top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  margin-bottom: 6px;
}

.teo-upload-row__name {
  font-weight: 600;
  color: #1e1a17;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.teo-upload-row__pct { color: #cb1e31; font-weight: 700; }
.teo-upload-row.is-done .teo-upload-row__pct { color: #007a55; }
.teo-upload-row.is-error .teo-upload-row__pct { color: #cb1e31; }

.teo-upload-row__bar {
  height: 5px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.teo-upload-row__bar span {
  display: block;
  height: 100%;
  background: #cb1e31;
  border-radius: 999px;
}

.teo-upload-row.is-done .teo-upload-row__bar span { background: #00bc7d; }

.teo-upload-row__meta {
  margin-top: 6px;
  font-size: 11px;
  color: #6a7282;
}

.cb-status {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.cb-status-btn {
  flex: 1;
  height: 36px;
  border-radius: 14px;
  border: 1px solid #f3f4f6;
  background: #f9fafb;
  color: #99a1af;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.cb-status-btn.is-active-draft {
  background: #fffbeb;
  border-color: #fee685;
  color: #bb4d00;
}

.cb-status-btn.is-active-published {
  background: #ecfdf5;
  border-color: #d0fae5;
  color: #007a55;
}

.cb-actions {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.cb-btn-save {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 45.5px;
  border: 0;
  border-radius: 999px;
  background: #cb1e31;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  cursor: pointer;
}

.cb-btn-save:hover { filter: brightness(1.05); color: #fff; }

.cb-btn-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 21px;
  height: 45.5px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  color: #6a7282;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  background: #fff;
}

.cb-btn-preview:hover { color: #6d5f5a; background: #f9fafb; }

.cb-episodes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cb-episodes-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 21px;
  color: #6d5f5a;
}

.cb-episodes-meta {
  margin: 0;
  font-size: 11px;
  line-height: 16.5px;
  color: #99a1af;
}

.cb-add-episode {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: #fef2f2;
  color: #cb1e31;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.cb-add-episode:hover { background: #fee2e2; }

.cb-episodes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: -4px;
}

.cb-episode {
  background: #fff;
  border: 1px solid #f3f4f6;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.cb-episode.is-focus { border-color: rgba(203, 30, 49, 0.3); }

.cb-episode-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

.cb-drag { opacity: 0.55; cursor: grab; flex-shrink: 0; }

.cb-ep-num {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #99a1af;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cb-ep-label {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 500;
  color: #d1d5dc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cb-episode.is-open .cb-ep-label,
.cb-ep-label:not(:empty) {
  color: #d1d5dc;
}

.cb-icon-btn {
  border: 0;
  background: transparent;
  padding: 0;
  display: inline-flex;
  cursor: pointer;
  opacity: 0.7;
}

.cb-icon-btn:hover { opacity: 1; }

.cb-episode-body {
  display: none;
  border-top: 1px solid #f9fafb;
  padding: 17px 20px 16px;
}

.cb-episode.is-open .cb-episode-body { display: block; }

.cb-attach {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30.5px;
  padding: 0 13px;
  border: 1px dashed #e5e7eb;
  border-radius: 10px;
  background: #fff;
  color: #99a1af;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.cb-access {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 17px;
  border-radius: 14px;
  background: rgba(255, 251, 235, 0.6);
  border: 1px solid #fef3c6;
}

.cb-access.is-locked {
  background: rgba(243, 244, 246, 0.8);
  border-color: #e5e7eb;
}

.cb-access-title {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #6d5f5a;
  line-height: 18px;
}

.cb-access-sub {
  margin: 2px 0 0;
  font-size: 10px;
  color: #99a1af;
  line-height: 15px;
}

.cb-access-toggle {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.cb-add-episode-dashed {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 51.5px;
  border: 2px dashed #e5e7eb;
  border-radius: 16px;
  background: transparent;
  color: #99a1af;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.cb-add-episode-dashed:hover { background: #fafafa; border-color: #d1d5dc; }

/* Assignments & Feedback (Figma 101:2523) */
.asg-page { max-width: 1149px; }

.asg-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.asg-filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #6a7282;
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  text-decoration: none;
}

.asg-filter:hover { color: #6d5f5a; background: #f9fafb; }

.asg-filter.is-active {
  background: #cb1e31;
  border-color: #cb1e31;
  color: #fff;
}

.asg-filter.is-active:hover { color: #fff; filter: brightness(1.05); }

.asg-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.asg-empty {
  padding: 32px;
  text-align: center;
  color: #99a1af;
  font-size: 13px;
  background: #fff;
  border: 1px solid #f3f4f6;
  border-radius: 16px;
}

.asg-card {
  background: #fff;
  border: 1px solid #f3f4f6;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.asg-card.is-dimmed { opacity: 0.75; }

.asg-card-head {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 20px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.asg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}

.asg-avatar--sm {
  width: 28px;
  height: 28px;
}

.asg-avatar--initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(109, 95, 90, 0.15);
  color: #6d5f5a;
  font-size: 13px;
  font-weight: 700;
  line-height: 19.5px;
}

.asg-head-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.asg-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.asg-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 19.5px;
  color: #6d5f5a;
}

.asg-dot { color: #d1d5dc; font-size: 16px; line-height: 24px; }

.asg-assignment {
  font-size: 11px;
  line-height: 16.5px;
  color: #99a1af;
}

.asg-meta {
  margin-top: 2px;
  font-size: 11px;
  line-height: 16.5px;
  color: #99a1af;
}

.asg-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  line-height: 15px;
  white-space: nowrap;
  flex-shrink: 0;
}

.asg-badge.is-answered {
  background: #ecfdf5;
  border: 1px solid #d0fae5;
  color: #007a55;
}

.asg-badge.is-awaiting {
  background: #fffbeb;
  border: 1px solid #fef3c6;
  color: #bb4d00;
}

.asg-badge.is-closed {
  background: #fef2f2;
  border: 1px solid #ffe2e2;
  color: #cb1e31;
}

.asg-chevron {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  margin-top: 4px;
  opacity: 0.7;
}

.asg-card-body { display: none; }
.asg-card.is-open .asg-card-body { display: block; }

.asg-thread {
  border-top: 1px solid #f9fafb;
  padding: 21px 20px 20px;
}

.asg-msg {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.asg-msg + .asg-msg { margin-top: 16px; }

.asg-bubble {
  flex: 1;
  min-width: 0;
  background: #f9fafb;
  border-radius: 6px 14px 14px 14px;
  padding: 12px 16px;
}

.asg-bubble--teacher {
  background: #fff;
  border: 1px solid #f3f4f6;
}

.asg-bubble-label {
  font-size: 10px;
  font-weight: 600;
  line-height: 15px;
  color: #99a1af;
}

.asg-bubble-text {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 21px;
  color: #364153;
}

.asg-reply {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 16px;
}

.asg-reply-main { flex: 1; min-width: 0; }

.asg-textarea {
  width: 100%;
  min-height: 84px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 13px 17px;
  font-size: 13px;
  line-height: 19.5px;
  color: #364153;
  resize: vertical;
  outline: none;
}

.asg-textarea::placeholder { color: #d1d5dc; }
.asg-textarea:focus {
  border-color: rgba(203, 30, 49, 0.35);
  box-shadow: 0 0 0 3px rgba(203, 30, 49, 0.08);
}

.asg-btn-send {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  height: 34px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: #cb1e31;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.asg-btn-send:hover { filter: brightness(1.05); color: #fff; }

.asg-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 9px;
  border-top: 1px solid #f9fafb;
}

.asg-btn-close {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 17px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  color: #99a1af;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.asg-btn-close:hover { color: #6d5f5a; background: #f9fafb; }

.qa-question {
  display: block;
  font-size: 13px;
  font-weight: 600;
  line-height: 17.875px;
  color: #6d5f5a;
  white-space: normal;
}

.qa-page .asg-meta { margin-top: 4px; }

@media (max-width: 720px) {
  .asg-card-head { flex-wrap: wrap; }
  .asg-badge { order: 3; }
  .asg-chevron { margin-left: auto; }
}

@media (max-width: 1200px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3, .form-grid { grid-template-columns: 1fr; }
  .cb-layout { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .admin-sidebar { display: none; }
  .admin-content { padding: 20px; }
}

@media (max-width: 560px) {
  .cb-row-2 { grid-template-columns: 1fr; }
  .cb-actions { flex-direction: column; }
  .cb-btn-preview { width: 100%; }
}
