/* ==========================================================================
   DFC Student Portal — modern UI layer on top of the existing dashforge theme.
   All classes are prefixed `dfc-` to avoid clashing with Bootstrap/dashforge.
   Fonts are loaded from index.html (no blocking CSS @import).
   ========================================================================== */

:root {
  --dfc-primary: #220070;
  --dfc-primary-light: #dad3eb;
  --dfc-secondary: #a454f7;
  --dfc-sec-accent: #3d3ff2;
  --dfc-hover: #903fe8;

  --dfc-accent-1: #e6e7fa;
  --dfc-accent-2: #d7d7fa;
  --dfc-accent-3: #b8b8e5;
  --dfc-accent-4: #d2c7ff;

  --dfc-bg-app: #f8f9fe;
  --dfc-surface: #ffffff;
  --dfc-surface-soft: #f2eefb;
  --dfc-text: #1c1c1c;
  --dfc-muted: #737373;
  --dfc-border: #e6e6e6;
  --dfc-border-subtle: #ece8f6;

  --dfc-success-bg: #e8f8ea;
  --dfc-success: #048402;
  --dfc-danger-bg: #fcced2;
  --dfc-danger: #ea1928;
  --dfc-warning-bg: #fff8e1;
  --dfc-warning: #aa9d0f;

  --dfc-shadow: 0 4px 20px rgba(34, 0, 112, 0.06);
  --dfc-shadow-hover: 0 8px 30px rgba(34, 0, 112, 0.12);
  --dfc-shadow-elevated: 0 12px 40px rgba(34, 0, 112, 0.15);

  --dfc-radius-sm: 8px;
  --dfc-radius: 14px;
  --dfc-radius-lg: 20px;
  --dfc-pill: 9999px;

  --dfc-heading-font: "Plus Jakarta Sans", "Inter", sans-serif;
  --dfc-body-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.dfc-scope {
  font-family: var(--dfc-body-font);
  color: var(--dfc-text);
}
.dfc-scope h1,
.dfc-scope h2,
.dfc-scope h3,
.dfc-scope h4,
.dfc-scope h5 {
  font-family: var(--dfc-heading-font);
  letter-spacing: -0.01em;
}
.dfc-num {
  font-variant-numeric: tabular-nums;
}

/* ------------------------------- Page header ----------------------------- */
.dfc-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.dfc-page-title {
  font-size: 22px;
  font-weight: 800;
  margin: 0;
  color: var(--dfc-primary);
}
.dfc-page-sub {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--dfc-muted);
}

/* --------------------------------- Cards --------------------------------- */
.dfc-card {
  background: var(--dfc-surface);
  border: 1px solid var(--dfc-border-subtle);
  border-radius: var(--dfc-radius);
  overflow: hidden;
}
/* One elevated surface per screen — reserved for the primary focus. */
.dfc-card--elevated {
  box-shadow: var(--dfc-shadow-hover);
  border-color: transparent;
}
.dfc-card.hoverable {
  transition: border-color 0.18s ease;
}
.dfc-card.hoverable:hover {
  border-color: var(--dfc-accent-3);
}
.dfc-glass {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.55);
}
.dfc-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--dfc-border-subtle);
  flex-wrap: wrap;
}
.dfc-card-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.dfc-card-title i,
.dfc-card-title [data-feather] {
  width: 16px;
  height: 16px;
  color: var(--dfc-secondary);
}
.dfc-card-body {
  padding: 18px;
}
.dfc-card-foot {
  padding: 14px 18px;
  border-top: 1px solid var(--dfc-border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

/* --------------------------------- Grid ---------------------------------- */
.dfc-grid {
  display: grid;
  gap: 16px;
}
.dfc-grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.dfc-grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.dfc-grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* -------------------------------- Buttons -------------------------------- */
.dfc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: var(--dfc-pill);
  padding: 9px 18px;
  font-family: var(--dfc-body-font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease,
    color 0.2s ease, box-shadow 0.2s ease;
  touch-action: manipulation;
  white-space: nowrap;
  line-height: 1;
}
.dfc-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.dfc-btn i,
.dfc-btn [data-feather] {
  width: 15px;
  height: 15px;
}
.dfc-btn-primary {
  background: var(--dfc-sec-accent);
  color: #fff;
}
.dfc-btn-primary:hover:not(:disabled) {
  background: #2f31d6;
}
.dfc-btn-ghost {
  background: var(--dfc-surface);
  border-color: var(--dfc-border);
  color: var(--dfc-primary);
}
.dfc-btn-ghost:hover:not(:disabled) {
  background: var(--dfc-surface-soft);
  border-color: var(--dfc-accent-3);
}
.dfc-btn-sm {
  padding: 6px 13px;
  font-size: 12px;
}

/* --------------------------------- Tabs ---------------------------------- */
.dfc-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  background: var(--dfc-surface-soft);
  border-radius: var(--dfc-pill);
}
.dfc-tab {
  border: none;
  background: transparent;
  border-radius: var(--dfc-pill);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--dfc-muted);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease,
    box-shadow 0.2s ease;
  touch-action: manipulation;
}
.dfc-tab:hover {
  color: var(--dfc-primary);
}
.dfc-tab.active {
  background: var(--dfc-surface);
  color: var(--dfc-primary);
  box-shadow: var(--dfc-shadow);
}

/* -------------------------------- Badges --------------------------------- */
.dfc-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: var(--dfc-pill);
  padding: 4px 11px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.dfc-badge-score {
  margin-left: 5px;
  font-variant-numeric: tabular-nums;
}
.dfc-badge-pending {
  background: var(--dfc-surface-soft);
  color: var(--dfc-primary);
  border: 1.5px solid var(--dfc-secondary);
}
.dfc-badge-attempted {
  background: var(--dfc-success-bg);
  color: var(--dfc-success);
}
.dfc-badge-info {
  background: var(--dfc-accent-1);
  color: var(--dfc-sec-accent);
}
.dfc-badge-warn {
  background: var(--dfc-warning-bg);
  color: var(--dfc-warning);
}
.dfc-badge-danger {
  background: var(--dfc-danger-bg);
  color: var(--dfc-danger);
}

/* -------------------------------- Stats ---------------------------------- */
.dfc-stat-value {
  font-family: var(--dfc-heading-font);
  font-size: 26px;
  font-weight: 800;
  color: var(--dfc-primary);
  font-variant-numeric: tabular-nums;
}
.dfc-stat-label {
  font-size: 12px;
  color: var(--dfc-muted);
  margin-top: 2px;
}
/* Inline metric line — several related numbers read as one unit, not a row
   of identical boxes. */
.dfc-metricstrip {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
}
.dfc-metric {
  padding: 0 16px;
  border-left: 1px solid var(--dfc-border-subtle);
}
.dfc-metric:first-child {
  padding-left: 0;
  border-left: none;
}
.dfc-metric b {
  font-family: var(--dfc-heading-font);
  font-size: 20px;
  font-weight: 800;
  color: var(--dfc-primary);
  font-variant-numeric: tabular-nums;
}
.dfc-metric span {
  display: block;
  font-size: 12px;
  color: var(--dfc-muted);
}
.dfc-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--dfc-pill);
  padding: 6px 13px;
  font-size: 12px;
  font-weight: 600;
  background: var(--dfc-surface-soft);
  color: var(--dfc-primary);
}
.dfc-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

/* ------------------------------- Progress -------------------------------- */
.dfc-progress {
  height: 8px;
  border-radius: var(--dfc-pill);
  background: var(--dfc-surface-soft);
  overflow: hidden;
}
.dfc-progress-bar {
  height: 100%;
  border-radius: var(--dfc-pill);
  background: var(--dfc-secondary);
  transition: width 0.4s ease;
}

/* --------------------------------- Table --------------------------------- */
.dfc-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.dfc-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--dfc-muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--dfc-border-subtle);
}
.dfc-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--dfc-border-subtle);
}
.dfc-table tbody tr:hover {
  background: var(--dfc-surface-soft);
}
.dfc-table tr.is-me {
  background: var(--dfc-accent-1);
}

/* ------------------------------ Accordion -------------------------------- */
.dfc-acc {
  border: 1px solid var(--dfc-border-subtle);
  border-radius: var(--dfc-radius);
  overflow: hidden;
  margin-bottom: 10px;
  background: var(--dfc-surface);
}
.dfc-acc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 14px 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--dfc-heading-font);
  font-size: 14px;
  font-weight: 700;
  color: var(--dfc-text);
  text-align: left;
}
.dfc-acc-head:hover {
  background: var(--dfc-surface-soft);
}
.dfc-acc-body {
  padding: 4px 16px 16px;
  border-top: 1px solid var(--dfc-border-subtle);
}

/* ----------------------------- Question grid ----------------------------- */
.dfc-qgrid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.dfc-qchip {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1.5px solid var(--dfc-border);
  background: var(--dfc-surface);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  color: var(--dfc-text);
  transition: background-color 0.15s ease, border-color 0.15s ease,
    color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.dfc-qchip:hover {
  border-color: var(--dfc-secondary);
  transform: translateY(-1px);
}
.dfc-qchip.correct {
  background: var(--dfc-success-bg);
  border-color: var(--dfc-success);
  color: var(--dfc-success);
}
.dfc-qchip.wrong {
  background: var(--dfc-danger-bg);
  border-color: var(--dfc-danger);
  color: var(--dfc-danger);
}
.dfc-qchip.slow {
  box-shadow: 0 0 0 2px var(--dfc-secondary);
}

/* --------------------------------- Modal --------------------------------- */
.dfc-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(28, 28, 28, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 3000;
  animation: dfc-fade 0.15s ease;
  overscroll-behavior: contain;
}
.dfc-modal {
  position: relative;
  z-index: 1;
  background: var(--dfc-surface);
  border-radius: var(--dfc-radius-lg);
  box-shadow: var(--dfc-shadow-elevated);
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.dfc-modal.lg {
  max-width: 900px;
}
.dfc-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--dfc-border-subtle);
}
.dfc-modal-body {
  padding: 20px;
  overflow: auto;
  overscroll-behavior: contain;
}

.dfc-modal-backdrop-close {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: default;
  -webkit-appearance: none;
  appearance: none;
}
.dfc-modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--dfc-border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.dfc-modal-x {
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--dfc-muted);
}

/* ------------------------------ Quiz option ------------------------------ */
.dfc-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 13px 15px;
  border: 1.5px solid var(--dfc-border);
  border-radius: var(--dfc-radius-sm);
  background: var(--dfc-surface);
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease,
    color 0.18s ease, box-shadow 0.18s ease;
  margin-bottom: 9px;
  font-size: 14px;
}
.dfc-option:hover:not(:disabled) {
  border-color: var(--dfc-secondary);
  background: var(--dfc-surface-soft);
}
.dfc-option.selected {
  border-color: var(--dfc-sec-accent);
  background: var(--dfc-accent-1);
}
.dfc-option.correct {
  border-color: var(--dfc-success);
  background: var(--dfc-success-bg);
}
.dfc-option.wrong {
  border-color: var(--dfc-danger);
  background: var(--dfc-danger-bg);
}
.dfc-option-key {
  flex: 0 0 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--dfc-surface-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
}

/* --------------------------- Composition bar ----------------------------- */
/* Splits a whole into its parts — information, not decoration. */
.dfc-bucket-bar {
  display: flex;
  height: 10px;
  border-radius: var(--dfc-pill);
  overflow: hidden;
  background: var(--dfc-surface-soft);
}
.dfc-bucket-seg {
  height: 100%;
  transition: width 0.3s ease;
}

/* ----------------------------- Study surface ----------------------------- */
/* The one bold surface: the card a student is currently studying. */
.dfc-study {
  padding: 30px 28px;
}
.dfc-study .dfc-study-q {
  font-size: 17px;
  line-height: 1.65;
  font-weight: 500;
  margin-bottom: 18px;
}

/* ------------------------------- Podium ---------------------------------- */
.dfc-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 14px;
  padding: 10px 0 0;
}
.dfc-podium-item {
  text-align: center;
  flex: 0 1 140px;
}
.dfc-podium-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  margin: 0 auto 8px;
  background: var(--dfc-secondary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 20px;
}
.dfc-podium-bar {
  border-radius: 12px 12px 0 0;
  background: var(--dfc-accent-1);
  color: var(--dfc-primary);
  font-weight: 800;
  padding: 8px 6px;
}
.dfc-podium-item.rank-1 .dfc-podium-bar {
  height: 96px;
  background: #ffd95d;
}
.dfc-podium-item.rank-2 .dfc-podium-bar {
  height: 74px;
}
.dfc-podium-item.rank-3 .dfc-podium-bar {
  height: 58px;
}

/* ------------------------------- Loader ---------------------------------- */
.dfc-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 46px 0;
  color: var(--dfc-muted);
  gap: 12px;
  font-size: 13px;
}
.dfc-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--dfc-accent-2);
  border-top-color: var(--dfc-secondary);
  animation: dfc-spin 0.8s linear infinite;
}

/* ----------------------------- Empty state ------------------------------- */
.dfc-empty {
  text-align: center;
  padding: 44px 16px;
  color: var(--dfc-muted);
}
.dfc-empty img {
  width: 160px;
  max-width: 60%;
  opacity: 0.9;
  margin-bottom: 10px;
}

/* ------------------------------- Ring ------------------------------------ */
.dfc-ring {
  --size: 92px;
  --pct: 0;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: conic-gradient(
    var(--dfc-secondary) calc(var(--pct) * 1%),
    var(--dfc-surface-soft) 0
  );
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}
.dfc-ring-inner {
  width: calc(var(--size) - 18px);
  height: calc(var(--size) - 18px);
  border-radius: 50%;
  background: var(--dfc-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  color: var(--dfc-primary);
}

/* -------------------------------- Misc ----------------------------------- */
.dfc-insight {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--dfc-warning-bg);
  border: 1px solid #f3e7b0;
  border-radius: var(--dfc-radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  color: #6b6410;
}
.dfc-insight i,
.dfc-insight [data-feather] {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin-top: 1px;
}
.dfc-divider {
  height: 1px;
  background: var(--dfc-border-subtle);
  margin: 16px 0;
}
.dfc-muted {
  color: var(--dfc-muted);
}
.dfc-tiny {
  font-size: 11.5px;
}
.dfc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}
.dfc-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
}

@keyframes dfc-spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes dfc-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ==========================================================================
   Legacy bridge — themes the pre-existing dashforge/Bootstrap student pages to
   match the new portal. Everything is scoped under `.dfc-scope`, a marker only
   applied to student-facing roots, so admin/faculty pages are untouched.
   ========================================================================== */
.dfc-scope .breadcrumb {
  background: transparent;
  padding: 0;
  margin-bottom: 6px;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
}
.dfc-scope ol.breadcrumb .breadcrumb-item,
.dfc-scope ol.breadcrumb .breadcrumb-item a {
  color: var(--dfc-muted);
  text-decoration: none;
  text-transform: none;
  letter-spacing: 0;
}
.dfc-scope .breadcrumb-item.active {
  color: var(--dfc-primary);
}
.dfc-scope .breadcrumb-item + .breadcrumb-item::before {
  color: var(--dfc-accent-3);
}
.dfc-scope h4.mg-b-0 {
  font-family: var(--dfc-heading-font);
  font-weight: 800;
  color: var(--dfc-primary);
  font-size: 22px;
  letter-spacing: -0.01em;
}
.dfc-scope hr.full-width {
  border: 0;
  border-top: 1px solid var(--dfc-border-subtle);
  margin: 16px 0;
}

/* Cards */
.dfc-scope .card {
  background: var(--dfc-surface);
  border: 1px solid var(--dfc-border-subtle);
  border-radius: var(--dfc-radius);
  box-shadow: none;
}
.dfc-scope .card-header,
.dfc-scope .card-footer {
  background: transparent;
  border-color: var(--dfc-border-subtle);
}
.dfc-scope .card-header { padding: 14px 18px; }
.dfc-scope .card-body { padding: 18px; }
.dfc-scope .card-footer { padding: 14px 18px; }
.dfc-scope .card-title {
  font-family: var(--dfc-heading-font);
  font-weight: 700;
  color: var(--dfc-text);
  font-size: 15px;
}
.dfc-scope .card-text {
  color: var(--dfc-muted);
  font-size: 13px;
}

/* BS4 masonry class that BS5 dropped — make it a responsive grid instead. */
.dfc-scope .card-columns {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  column-count: initial;
  column-gap: 0;
}
.dfc-scope .card-columns > .card {
  margin: 0;
}

/* Tables */
.dfc-scope .table {
  font-size: 13px;
  color: var(--dfc-text);
  --bs-table-border-color: var(--dfc-border-subtle);
}
.dfc-scope .table > :not(caption) > * > * {
  padding: 11px 12px;
  border-bottom-color: var(--dfc-border-subtle);
}
.dfc-scope .table thead th {
  font-size: 12px;
  font-weight: 600;
  color: var(--dfc-muted);
  border-bottom: 1px solid var(--dfc-border-subtle);
}
.dfc-scope .table-striped > tbody > tr:nth-of-type(odd) > * {
  --bs-table-accent-bg: var(--dfc-surface-soft);
  color: var(--dfc-text);
}
.dfc-scope .table-hover > tbody > tr:hover > * {
  --bs-table-accent-bg: var(--dfc-accent-1);
  color: var(--dfc-text);
}

/* DataTables chrome */
.dfc-scope .dataTables_wrapper {
  overflow-x: auto;
}
.dfc-scope .dataTables_wrapper .dataTables_filter input,
.dfc-scope .dataTables_wrapper .dataTables_length select {
  border: 1px solid var(--dfc-border);
  border-radius: var(--dfc-radius-sm);
  padding: 6px 10px;
  font-size: 13px;
}
.dfc-scope .dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: var(--dfc-pill) !important;
  border: 1px solid transparent !important;
  color: var(--dfc-primary) !important;
}
.dfc-scope .dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--dfc-sec-accent) !important;
  border-color: var(--dfc-sec-accent) !important;
  color: #fff !important;
}

/* Buttons */
.dfc-scope .btn {
  border-radius: var(--dfc-pill);
  border-width: 1px;
  font-weight: 600;
  font-size: 13px;
}
.dfc-scope .btn-uppercase {
  text-transform: none;
  letter-spacing: 0;
}
.dfc-scope .btn-primary {
  background: var(--dfc-sec-accent);
  border-color: var(--dfc-sec-accent);
  color: #fff;
}
.dfc-scope .btn-primary:hover:not(:disabled) {
  background: #2f31d6;
  border-color: #2f31d6;
}
.dfc-scope .btn-secondary {
  background: var(--dfc-surface);
  border-color: var(--dfc-border);
  color: var(--dfc-primary);
}
.dfc-scope .btn-secondary:hover:not(:disabled) {
  background: var(--dfc-surface-soft);
  border-color: var(--dfc-accent-3);
}
.dfc-scope .btn-outline-primary {
  background: transparent;
  border-color: var(--dfc-accent-3);
  color: var(--dfc-sec-accent);
}
.dfc-scope .btn-outline-primary:hover:not(:disabled) {
  background: var(--dfc-accent-1);
  border-color: var(--dfc-sec-accent);
  color: var(--dfc-sec-accent);
}
.dfc-scope .btn-sm {
  padding: 6px 13px;
  font-size: 12px;
}

/* Forms */
.dfc-scope .form-control,
.dfc-scope .custom-select {
  border: 1px solid var(--dfc-border);
  border-radius: var(--dfc-radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  color: var(--dfc-text);
}
.dfc-scope .form-control:focus,
.dfc-scope .custom-select:focus {
  border-color: var(--dfc-sec-accent);
  box-shadow: 0 0 0 3px var(--dfc-accent-1);
}
.dfc-scope label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--dfc-muted);
}
.dfc-scope .parsley-errors-list {
  color: var(--dfc-danger);
  font-size: 12px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

/* Misc */
.dfc-scope .badge {
  border-radius: var(--dfc-pill);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: none;
}
.dfc-scope .df-example {
  border: 0;
  padding: 0;
  margin: 0;
}
.dfc-scope .search-form {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   Student home dashboard
   ========================================================================== */
.dfc-home-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  border-radius: var(--dfc-radius-lg);
  background: linear-gradient(135deg, var(--dfc-primary), var(--dfc-sec-accent));
  color: #fff;
  margin-bottom: 24px;
}
.dfc-home-hero img {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.55);
}
.dfc-home-hero h1 {
  margin: 0;
  font-family: var(--dfc-heading-font);
  font-size: 22px;
  font-weight: 800;
  color: #fff;
}
.dfc-home-hero p {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.82);
}

.dfc-section {
  margin-bottom: 26px;
  /* Skip layout/paint for below-the-fold home sections until they approach the
     viewport. The intrinsic size keeps the scrollbar stable. */
  content-visibility: auto;
  contain-intrinsic-size: auto 360px;
}
.dfc-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.dfc-section-head h2 {
  margin: 0;
  font-family: var(--dfc-heading-font);
  font-size: 16px;
  font-weight: 700;
  color: var(--dfc-primary);
}
.dfc-seeall {
  border: 0;
  background: transparent;
  color: var(--dfc-sec-accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
}
.dfc-seeall:hover {
  text-decoration: underline;
}

/* Horizontal card row on small screens, grid from tablet up. */
.dfc-hscroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(270px, 1fr);
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.dfc-hscroll > * {
  scroll-snap-align: start;
}
@media (min-width: 1024px) {
  .dfc-hscroll {
    grid-auto-flow: row;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    overflow: visible;
  }
}

.dfc-entry-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 768px) {
  .dfc-entry-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.dfc-entry-badge {
  display: inline-flex;
  align-items: center;
  border-radius: var(--dfc-pill);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  background: var(--dfc-warning-bg);
  color: var(--dfc-warning-dark);
}
.dfc-entry-badge.info {
  background: var(--dfc-accent-1);
  color: var(--dfc-sec-accent);
}

.dfc-lecture-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 50%;
  background: var(--dfc-danger-bg);
  color: var(--dfc-danger);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dfc-lecture-icon [data-feather] {
  width: 18px;
  height: 18px;
  color: inherit;
}

.dfc-progress-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--dfc-border-subtle);
}
.dfc-progress-row:last-child {
  border-bottom: 0;
}

/* ------------------------------- Responsive ------------------------------ */
/* Wide tables scroll inside their own container rather than crushing. */
.dfc-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.dfc-table-scroll .dfc-table {
  min-width: 480px;
}

@media (max-width: 767px) {
  .dfc-page-title {
    font-size: 19px;
  }
  .dfc-card-head {
    padding: 14px;
  }
  .dfc-card-body {
    padding: 15px;
  }
  .dfc-study {
    padding: 20px 16px;
  }
  .dfc-study .dfc-study-q {
    font-size: 16px;
  }
  .dfc-modal-backdrop {
    padding: 10px;
  }
  .dfc-modal-body {
    padding: 16px;
  }
  .dfc-tabs {
    max-width: 100%;
    overflow-x: auto;
  }
  .dfc-quad-cell {
    min-height: 72px;
  }
  .dfc-quad-num {
    font-size: 20px;
  }

  /* Podium: three ranks share the width instead of overflowing the viewport. */
  .dfc-podium {
    gap: 8px;
  }
  .dfc-podium-item {
    flex: 1 1 0;
    min-width: 0;
  }
  .dfc-podium-avatar {
    width: 42px;
    height: 42px;
    font-size: 16px;
  }
  .dfc-podium-item.rank-1 .dfc-podium-bar {
    height: 66px;
  }
  .dfc-podium-item.rank-2 .dfc-podium-bar {
    height: 50px;
  }
  .dfc-podium-item.rank-3 .dfc-podium-bar {
    height: 38px;
  }

  /* Metrics stack into a 2-up grid; the inline separators no longer apply. */
  .dfc-metricstrip {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
  }
  .dfc-metric {
    padding: 0;
    border-left: none;
  }

  /* Legacy bridge */
  .dfc-scope h4.mg-b-0 {
    font-size: 19px;
  }
  .dfc-scope .card-body {
    padding: 15px;
  }
  .dfc-scope .search-form {
    flex-wrap: wrap;
  }
  .dfc-scope .dataTables_wrapper {
    font-size: 12px;
  }
}

/* --------------------- Focus visibility & reduced motion ------------------ */
.dfc-scope :focus-visible {
  outline: 2px solid var(--dfc-sec-accent);
  outline-offset: 2px;
  border-radius: 4px;
}
.dfc-btn:focus-visible,
.dfc-tab:focus-visible,
.dfc-qchip:focus-visible,
.dfc-acc-head:focus-visible,
.dfc-option:focus-visible {
  outline: 2px solid var(--dfc-sec-accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .dfc-scope *,
  .dfc-scope *::before,
  .dfc-scope *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* -------------------------------- App shell ------------------------------ */
/* Below 1200px the sidebar becomes a full-label drawer opened from the header.
   dashforge.css is injected into <body> after this file, so these rules carry
   a body prefix to win on specificity rather than source order. */
@media (max-width: 1199.98px) {
  body .aside {
    width: min(288px, 86vw);
    transform: translateX(-100%);
    transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  body.show-aside .aside {
    transform: translateX(0);
    box-shadow: 14px 0 44px rgba(34, 0, 112, 0.22);
  }
  body .aside-header {
    transform: none;
  }
  body .aside-header .aside-logo {
    max-width: calc(100% - 44px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body .aside-fixed + .content {
    margin-left: 0;
  }
  body .aside-backdrop {
    display: block;
    background: rgba(19, 12, 48, 0.55);
  }
  body .aside-body {
    padding-bottom: calc(25px + env(safe-area-inset-bottom));
  }
  body.show-aside,
  body.show-aside .content,
  body.show-aside .content-body {
    overflow: hidden;
  }
  body.show-aside .content-body {
    touch-action: none;
  }
}

@media (max-width: 991.98px) {
  body .aside-body {
    height: calc(100% - 54px);
  }
}

@media (min-width: 1200px) {
  body .aside {
    transform: translateX(0);
  }
  body .aside-fixed + .content {
    margin-left: 240px;
  }
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 8px;
  z-index: 4000;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff;
  color: var(--dfc-primary);
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--dfc-shadow);
}

.skip-link:focus {
  top: 8px;
}

.dfc-btn:focus-visible,
.dfc-tab:focus-visible,
.dfc-modal-x:focus-visible,
.dfc-modal-backdrop-close:focus-visible,
.dfc-seeall:focus-visible {
  outline: 2px solid var(--dfc-sec-accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  body .aside {
    transition: none;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
