:root {
  --d2-primary: var(--primary, #4f46e5);
  --d2-primary-dark: var(--primary-hover, #4338ca);
  --d2-primary-soft: var(--gray-100, #eef2ff);
  --d2-accent: var(--accent, #06b6d4);
  --d2-success: var(--success, #10b981);
  --d2-warning: var(--warning, #f59e0b);
  --d2-danger: var(--danger, #ef4444);
  --d2-info: var(--info, #3b82f6);
  --d2-text: var(--text-color, #1f2937);
  --d2-text-muted: var(--gray-500, #6b7280);
  --d2-heading: var(--dark, #111827);
  --d2-bg: var(--section-bg, #f3f4f6);
  --d2-surface: var(--white, #ffffff);
  --d2-border: var(--gray-200, #e5e7eb);
  --d2-border-strong: var(--gray-300, #d1d5db);
  --d2-radius-sm: 8px;
  --d2-radius: 12px;
  --d2-radius-lg: 16px;
  --d2-radius-xl: 24px;
  --d2-shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.06);
  --d2-shadow: 0 4px 16px rgba(17, 24, 39, 0.08);
  --d2-shadow-lg: 0 12px 32px rgba(17, 24, 39, 0.12);
  --d2-font: var(--font-family-base, "Segoe UI", Tahoma, Arial, sans-serif);
  --d2-header-height: 68px;
  --d2-container-max: 1240px;
}

.d2-bundle-content__arrow--rtl {
  display: none;
}

.rtl .d2-bundle-content__arrow--ltr {
  display: none;
}
.rtl .d2-bundle-content__arrow--rtl {
  display: inline-flex;
}

.d2-bundle-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  color: var(--d2-text);
}

.d2-bundle-content__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.d2-bundle-content__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--d2-heading);
}

.d2-bundle-content__hint {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--d2-text-muted);
}

.d2-bundle-content__segments {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.d2-bundle-section {
  background: var(--d2-surface);
  border: 1px solid var(--d2-border);
  border-radius: var(--d2-radius-lg);
  box-shadow: var(--d2-shadow-sm);
  padding: 20px;
  overflow: hidden;
}

.d2-bundle-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--d2-border);
}

.d2-bundle-section__title-area {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.d2-bundle-section__icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--d2-radius);
  background: rgba(79, 70, 229, 0.12);
  color: var(--d2-primary);
}

.d2-bundle-section__title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--d2-heading);
}

.d2-bundle-section__count {
  font-size: 12px;
  color: var(--d2-text-muted);
}

.d2-bundle-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  white-space: nowrap;
}

.d2-bundle-badge--required {
  background: rgba(239, 68, 68, 0.12);
  color: var(--d2-danger);
}

.d2-bundle-badge--optional {
  background: var(--d2-border-strong);
  color: var(--d2-text-muted);
}

.d2-bundle-section__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding-top: 16px;
}

.d2-bundle-section__empty {
  margin-top: 16px;
  padding: 16px;
  border: 1px dashed var(--d2-border-strong);
  border-radius: var(--d2-radius);
  font-size: 13px;
  color: var(--d2-text-muted);
  text-align: center;
}

.d2-progress-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--d2-surface);
  border: 1px solid var(--d2-border);
  border-radius: var(--d2-radius);
  padding: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  min-height: 100%;
}
.d2-progress-card:hover {
  border-color: var(--d2-primary);
  box-shadow: var(--d2-shadow);
  transform: translateY(-2px);
}

.d2-progress-card__head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.d2-progress-card__icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--d2-radius-sm);
  background: var(--d2-bg);
  color: var(--d2-primary);
}

.d2-progress-card__title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--d2-heading);
}
.d2-progress-card__title a {
  color: inherit;
  text-decoration: none;
}
.d2-progress-card__title a:hover {
  color: var(--d2-primary);
}

.d2-progress-card__teacher {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.d2-progress-card__teacher-avatar {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  -o-object-fit: cover;
     object-fit: cover;
}

.d2-progress-card__teacher-name {
  font-size: 12px;
  color: var(--d2-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.d2-progress-card__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--d2-text-muted);
}

.d2-progress-card__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.d2-progress-card__progress {
  margin-top: auto;
}

.d2-progress-card__progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--d2-text-muted);
}

.d2-progress-card__progress-value {
  font-weight: 700;
  color: var(--d2-heading);
}

.d2-progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--d2-bg);
  overflow: hidden;
}

.d2-progress-track__bar {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--d2-primary), var(--d2-accent));
  transition: width 0.3s ease;
}

.d2-progress-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.d2-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  white-space: nowrap;
}

.d2-status-badge--completed {
  background: rgba(16, 185, 129, 0.14);
  color: var(--d2-success);
}

.d2-status-badge--in-progress {
  background: rgba(79, 70, 229, 0.12);
  color: var(--d2-primary);
}

.d2-status-badge--not-started {
  background: var(--d2-bg);
  color: var(--d2-text-muted);
}

.d2-progress-card__action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--d2-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease;
}
.d2-progress-card__action:hover {
  background: var(--d2-primary-dark);
  color: #fff;
}

.d2-bundle-content__empty {
  background: var(--d2-surface);
  border: 1px solid var(--d2-border);
  border-radius: var(--d2-radius-lg);
  padding: 40px 20px;
  text-align: center;
}

.d2-bundle-content__empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: var(--d2-radius);
  background: var(--d2-bg);
  color: var(--d2-text-muted);
}

.d2-bundle-content__empty-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--d2-heading);
}

.d2-bundle-content__empty-hint {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--d2-text-muted);
}

@media (max-width: 991px) {
  .d2-bundle-section__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 575px) {
  .d2-bundle-section {
    padding: 16px;
  }
  .d2-bundle-section__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
