:root {
  --tc-navy: #172c52;
  --tc-navy-deep: #10213f;
  --tc-gold: #b3893b;
  --tc-gold-soft: #fbf7ef;
  --tc-ink: #182230;
  --tc-muted: #667085;
  --tc-line: #e6eaf0;
  --tc-surface: #ffffff;
  --tc-bg: #f7f9fc;
  --tc-success: #16835d;
  --tc-warning: #a26408;
  --tc-danger: #a23a43;
  --tc-radius: 18px;
  --tc-shadow: 0 12px 32px rgba(23, 44, 82, .07);
}

html { overflow-x: hidden; }

.tc-page,
.tc-page * { box-sizing: border-box; }

.tc-page {
  min-height: 70vh;
  overflow: hidden;
  direction: rtl;
  color: var(--tc-ink);
  background: var(--tc-bg);
  font-family: "Cairo", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.tc-shell {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

/* رأس خفيف يعرّف الصفحة من دون استهلاك مساحة الشاشة */
.tc-hero {
  position: relative;
  padding: 38px 0 34px;
  border-bottom: 1px solid var(--tc-line);
  background:
    radial-gradient(circle at 8% 0, rgba(179, 137, 59, .08), transparent 18rem),
    linear-gradient(135deg, #fff 0%, #f8fafc 100%);
}

.tc-hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 310px);
  align-items: center;
  gap: clamp(28px, 5vw, 64px);
}

.tc-hero-copy { min-width: 0; }

.tc-eyebrow,
.tc-section-kicker,
.tc-program-name {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--tc-gold);
  font-size: 11px;
  font-weight: 800;
}

.tc-eyebrow {
  padding: 6px 10px;
  border: 1px solid #eadfc9;
  border-radius: 999px;
  background: var(--tc-gold-soft);
}

.tc-eyebrow svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.tc-hero h1 {
  max-width: 680px;
  margin: 13px 0 7px;
  color: var(--tc-navy);
  font-size: clamp(27px, 3vw, 36px);
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -.025em;
}

.tc-hero-copy > p {
  max-width: 700px;
  margin: 0;
  color: var(--tc-muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.9;
}

.tc-hero-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
}

.tc-hero-stats > div {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.tc-hero-stats strong {
  color: var(--tc-navy);
  font-size: 18px;
  font-weight: 800;
}

.tc-hero-stats span {
  color: #7a8495;
  font-size: 10px;
  font-weight: 700;
}

.tc-stats-separator {
  width: 1px;
  height: 20px;
  background: #d9dee7;
}

.tc-hero-note {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--tc-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .84);
  box-shadow: 0 8px 24px rgba(23, 44, 82, .05);
}

.tc-hero-note-icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border-radius: 12px;
  color: var(--tc-navy);
  background: #eef2f8;
}

.tc-hero-note-icon svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.tc-hero-note > span:last-child { min-width: 0; }

.tc-hero-note strong {
  display: block;
  color: var(--tc-navy);
  font-size: 12px;
  font-weight: 800;
}

.tc-hero-note small {
  display: block;
  margin-top: 3px;
  color: var(--tc-muted);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.7;
}

.tc-content { padding: 34px 0 74px; }

.tc-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.tc-section-kicker { margin-bottom: 4px; }

.tc-section-head h2 {
  margin: 0;
  color: var(--tc-navy);
  font-size: clamp(22px, 2.4vw, 27px);
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: -.02em;
}

.tc-section-head > p {
  max-width: 390px;
  margin: 0;
  color: var(--tc-muted);
  font-size: 11px;
  line-height: 1.8;
}

.tc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.tc-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 100%;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--tc-line);
  border-radius: var(--tc-radius);
  background: var(--tc-surface);
  box-shadow: 0 5px 18px rgba(23, 44, 82, .04);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.tc-card:hover {
  transform: translateY(-2px);
  border-color: #d8dee8;
  box-shadow: var(--tc-shadow);
}

.tc-card-accent {
  height: 3px;
  background: #e3e7ed;
}

.tc-card.is-open .tc-card-accent {
  background: linear-gradient(90deg, var(--tc-gold), #d4b46d);
}

.tc-card.is-self-learning .tc-card-accent {
  background: var(--tc-navy);
}

.tc-card-top,
.tc-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.tc-card-top { padding: 16px 18px 0; }

.tc-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.tc-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.tc-status-open { color: var(--tc-success); background: #eaf8f2; }
.tc-status-soon { color: var(--tc-warning); background: #fff5e4; }
.tc-status-closed { color: #697386; background: #f0f2f5; }

.tc-course-code {
  overflow: hidden;
  color: #8a94a5;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tc-card-body {
  flex: 1;
  padding: 18px 18px 16px;
}

.tc-program-name {
  margin-bottom: 5px;
  font-size: 9px;
}

.tc-card h3 {
  margin: 0;
  color: var(--tc-navy);
  font-size: clamp(17px, 1.5vw, 20px);
  font-weight: 800;
  line-height: 1.55;
  letter-spacing: -.015em;
}

.tc-description {
  display: -webkit-box;
  min-height: 44px;
  margin: 8px 0 16px;
  overflow: hidden;
  color: var(--tc-muted);
  font-size: 11px;
  line-height: 1.9;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tc-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.tc-meta > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid #edf0f4;
  border-radius: 11px;
  background: #fbfcfd;
}

.tc-meta > div:first-child:last-child,
.tc-meta > div:first-child:nth-last-child(3) { grid-column: span 2; }

.tc-meta-icon {
  display: grid;
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  place-items: center;
  border-radius: 9px;
  color: var(--tc-navy);
  background: #eef2f7;
}

.tc-meta-icon svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.tc-meta > div > span:last-child { min-width: 0; }

.tc-meta small {
  display: block;
  color: #929aa9;
  font-size: 8px;
  font-weight: 700;
}

.tc-meta strong {
  display: block;
  overflow: hidden;
  margin-top: 1px;
  color: #344054;
  font-size: 9px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tc-card-footer {
  flex-wrap: wrap;
  padding: 13px 18px 15px;
  border-top: 1px solid #edf0f4;
  background: #fcfcfd;
}

.tc-state-note {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  color: #697386;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.5;
}

.tc-note-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
}

.tc-note-open { background: var(--tc-success); }
.tc-note-soon { background: var(--tc-warning); }
.tc-note-closed { background: #98a2b3; }
.tc-note-self { background: var(--tc-navy); }

.tc-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.tc-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 15px;
  border-radius: 11px;
  color: #fff;
  background: var(--tc-navy);
  box-shadow: 0 7px 18px rgba(23, 44, 82, .14);
  font-size: 10px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease;
}

.tc-button:hover {
  color: #fff;
  background: var(--tc-navy-deep);
  transform: translateY(-1px);
  box-shadow: 0 9px 21px rgba(23, 44, 82, .2);
}

.tc-button:focus-visible {
  outline: 3px solid rgba(179, 137, 59, .3);
  outline-offset: 3px;
}

.tc-button svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.tc-button-disabled {
  color: #8a93a3;
  background: #ebeef2;
  box-shadow: none;
  cursor: not-allowed;
}

.tc-button-self {
  color: var(--tc-navy);
  border: 1px solid #d9e0e9;
  background: #fff;
  box-shadow: none;
}

.tc-button-self:hover {
  color: #fff;
  border-color: var(--tc-navy);
  background: var(--tc-navy);
}

.tc-empty {
  display: grid;
  min-height: 220px;
  place-items: center;
  align-content: center;
  padding: 34px 20px;
  border: 1px solid var(--tc-line);
  border-radius: var(--tc-radius);
  background: #fff;
  text-align: center;
}

.tc-empty-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 14px;
  color: var(--tc-navy);
  background: #eef2f7;
}

.tc-empty-icon svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.tc-empty h3 {
  margin: 13px 0 3px;
  color: var(--tc-navy);
  font-size: 17px;
}

.tc-empty p {
  margin: 0;
  color: var(--tc-muted);
  font-size: 11px;
}

.tc-error .tc-empty-icon {
  color: var(--tc-danger);
  background: #fff0f1;
}

@media (max-width: 780px) {
  .tc-hero { padding: 30px 0 28px; }

  .tc-hero-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .tc-hero-note {
    width: min(100%, 420px);
  }

  .tc-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .tc-shell { width: min(100% - 24px, 1120px); }

  .tc-hero h1 {
    margin-top: 11px;
    font-size: 27px;
  }

  .tc-hero-copy > p {
    font-size: 12px;
    line-height: 1.8;
  }

  .tc-content { padding: 26px 0 56px; }

  .tc-section-head {
    display: block;
    margin-bottom: 16px;
  }

  .tc-section-head > p { margin-top: 7px; }

  .tc-card-top { padding: 14px 15px 0; }
  .tc-card-body { padding: 16px 15px 14px; }

  .tc-card-footer {
    align-items: stretch;
    flex-direction: column;
    padding: 12px 15px 15px;
  }

  .tc-button { width: 100%; }
  .tc-card-actions { width: 100%; flex-direction: column; }
  .tc-description { min-height: auto; -webkit-line-clamp: 3; }
}

@media (max-width: 390px) {
  .tc-shell { width: min(100% - 20px, 1120px); }

  .tc-hero-stats {
    align-items: flex-start;
    gap: 12px;
  }

  .tc-hero-stats > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 0;
  }

  .tc-meta { grid-template-columns: 1fr; }

  .tc-meta > div,
  .tc-meta > div:first-child:last-child,
  .tc-meta > div:first-child:nth-last-child(3) { grid-column: auto; }

  .tc-course-code { max-width: 42%; }
}

@media (prefers-reduced-motion: reduce) {
  .tc-card,
  .tc-button { transition: none; }
}

@media print {
  .tc-hero { padding: 24px 0; }
  .tc-hero-note { box-shadow: none; }
  .tc-content { padding: 24px 0; }
  .tc-card { break-inside: avoid; box-shadow: none; }
}
