html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  background: #f5f7fb;
  color: #182230;
}

.footer-separator {
  margin: 0 8px;
}

.page-wrap {
  margin: 0 auto;
  width: min(1180px, calc(100% - 32px));
}

.navbar .container {
  max-width: 1320px;
}

.navbar-nav .nav-link {
  white-space: nowrap;
}

.platform-product-switcher > .nav-link {
  color: #0d6efd !important;
  font-weight: 800;
}

.platform-product-switcher .dropdown-menu {
  min-width: 230px;
}

.platform-product-switcher .dropdown-item {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.platform-product-switcher .dropdown-item small {
  color: #6c7a89;
  font-size: 0.72rem;
  font-weight: 700;
  margin-left: 16px;
}

.platform-identity-match {
  align-items: center;
  background: #f5f8ff;
  border: 1px solid #dbe5ff;
  border-radius: 14px;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-top: 1rem;
  padding: 1rem 1.1rem;
}

.platform-identity-match > div {
  display: grid;
  gap: 0.15rem;
}

.platform-identity-match span,
.platform-identity-match small {
  color: #64748b;
}

.platform-identity-match.is-linked {
  background: #f1faf6;
  border-color: #ccebdc;
  margin-bottom: 1.25rem;
}

.platform-identity-message {
  background: #fff8e8;
  border: 1px solid #f4deb0;
  border-radius: 12px;
  color: #76551b;
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
}

@media (max-width: 640px) {
  .platform-identity-match {
    align-items: stretch;
    flex-direction: column;
  }
}

.platform-account-nav {
  align-items: center;
}

.user-role-label {
  display: grid;
  line-height: 1.15;
  min-width: max-content;
}

.user-role-label strong {
  font-size: 0.92rem;
}

.user-role-label small {
  color: #637083;
  font-size: 0.78rem;
  font-weight: 700;
}

.school-switcher {
  margin: 0.25rem 0.75rem 0.25rem 0;
  min-width: 190px;
}

.dh-brand {
  align-items: center;
  display: inline-flex;
  font-weight: 800;
  gap: 10px;
}

.brand-kicker,
.section-heading span,
.metric-label,
.dashboard-card span,
.status-pill-list span {
  color: #6c7a89;
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.drive-hero-shell {
  align-items: stretch;
  background: linear-gradient(135deg, #0d6efd, #0d3a70);
  border-radius: 8px;
  color: #fff;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  margin: 24px 0 34px;
  padding: 44px;
}

.drive-hero-shell .brand-kicker,
.drive-hero-shell .metric-label {
  color: rgba(255, 255, 255, 0.72);
}

.hero-copy h1 {
  font-size: 3.4rem;
  font-weight: 800;
  line-height: 1.02;
  margin: 8px 0 16px;
}

.hero-copy p {
  color: rgba(255, 255, 255, 0.84);
  font-size: 1.15rem;
  max-width: 680px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.hero-panel {
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  display: grid;
  gap: 16px;
  padding: 22px;
}

.hero-panel strong {
  display: block;
  font-size: 1.25rem;
  margin-top: 4px;
}

.overview-action-grid,
.dashboard-grid,
.platform-principles,
.status-pill-list {
  display: grid;
  gap: 14px;
}

.overview-action-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 28px;
}

.dashboard-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 28px;
}

.overview-action-grid article,
.dashboard-card,
.content-band,
.plan-preview,
.data-table-shell,
.timeline-shell {
  background: #fff;
  border: 1px solid #dce5ef;
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(24, 34, 48, 0.06);
}

.overview-action-grid article,
.dashboard-card,
.content-band,
.plan-preview {
  padding: 20px;
}

.overview-action-grid h2,
.dashboard-card h2 {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 6px 0 8px;
}

.overview-action-grid p,
.dashboard-card p,
.platform-principles p,
.page-title-band p,
.module-list p,
.timeline-shell p {
  color: #637083;
}

.overview-action-grid p {
  min-height: 72px;
}

.dashboard-card strong {
  color: #0d6efd;
  display: block;
  font-size: 1.9rem;
  margin: 6px 0;
}

.content-band {
  margin-bottom: 28px;
  padding: 28px;
}

.section-heading {
  margin-bottom: 20px;
}

.section-heading h2 {
  font-size: 1.55rem;
  font-weight: 750;
  margin: 4px 0 0;
}

.platform-principles {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.platform-principles article {
  background: #f8fbff;
  border: 1px solid #dce5ef;
  border-radius: 8px;
  padding: 18px;
}

.platform-principles strong,
.module-list strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.page-title-band {
  align-items: center;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin: 24px 0 22px;
}

.page-title-band h1 {
  font-size: 2rem;
  font-weight: 800;
  margin: 4px 0 6px;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.data-table-shell {
  margin-bottom: 28px;
  overflow: hidden;
}

.data-row {
  align-items: center;
  border-bottom: 1px solid #e5edf5;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(180px, 1.2fr) 130px 150px minmax(180px, 1fr) 120px;
  padding: 14px 16px;
}

.data-row-link {
  color: inherit;
  text-decoration: none;
}

.data-row-link:hover {
  background: #f8fbff;
  color: inherit;
}

.data-row:last-child {
  border-bottom: 0;
}

.data-row-head {
  background: #f3f7fb;
  color: #637083;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.data-row strong,
.data-row small {
  display: block;
}

.data-row small {
  color: #637083;
}

.status-pill,
.type-pill {
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.8rem;
  font-weight: 800;
  justify-content: center;
  padding: 5px 10px;
  width: fit-content;
}

.status-pill {
  background: #e9f8ef;
  color: #227647;
}

.status-pill.is-paused {
  background: #fff5da;
  color: #684310;
}

.status-pill.is-archived {
  background: #eef3f8;
  color: #425466;
}

.type-pill {
  background: #eef7ff;
  color: #194a7a;
}

.module-list {
  display: grid;
  gap: 12px;
}

.drive-form {
  align-items: end;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.drive-form label:not(.form-check) {
  display: grid;
  gap: 0.35rem;
  font-weight: 700;
  margin: 0;
}

.drive-form label span:first-child {
  color: #374151;
  font-size: 0.88rem;
}

.drive-check {
  align-items: center;
  display: flex;
  gap: 8px;
  margin: 0;
  min-height: 38px;
}

.drive-check .form-check-input {
  margin: 0;
}

.form-grid-wide {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.module-plan-toolbar {
  align-items: end;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.module-plan-toolbar h2 {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 4px 0 0;
}

.module-plan-toolbar label {
  display: grid;
  gap: 0.35rem;
  min-width: 260px;
}

.module-plan-toolbar label span {
  color: #374151;
  font-size: 0.88rem;
  font-weight: 700;
}

.student-filter-row {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.student-finance-grid,
.student-finance-ledgers {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.student-finance-summary .dashboard-card strong {
  font-size: 1.55rem;
}

.student-finance-form {
  align-items: end;
  background: #f8fbff;
  border: 1px solid #dce5ef;
  border-radius: 8px;
  padding: 16px;
}

.finance-row {
  align-items: center;
  border-bottom: 1px solid #e5edf5;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) 120px 130px;
  padding: 14px 16px;
}

.finance-row:last-child {
  border-bottom: 0;
}

.finance-row strong,
.finance-row small {
  display: block;
}

.finance-row small,
.finance-row span {
  color: #637083;
}

.finance-row.is-archived {
  background: #f8fbff;
  opacity: 0.72;
}

.finance-row-actions {
  align-items: flex-end;
  display: grid;
  gap: 8px;
  justify-items: end;
}

.finance-row-actions form {
  margin: 0;
}

.branch-create-form {
  grid-template-columns: minmax(220px, 1fr) auto;
}

.branch-row {
  align-items: center;
  border-bottom: 1px solid #e5edf5;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(220px, 1fr) 120px 90px 130px;
  padding: 14px 16px;
}

.branch-row:last-child {
  border-bottom: 0;
}

.branch-row-head {
  background: #f3f7fb;
  color: #637083;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.branch-name-form {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(160px, 1fr) auto;
  margin: 0;
}

.branch-row form {
  margin: 0;
}

.branch-access-shell {
  overflow-x: auto;
}

.branch-access-row {
  align-items: center;
  border-bottom: 1px solid #e5edf5;
  display: grid;
  gap: 12px;
  grid-auto-columns: minmax(120px, auto);
  grid-auto-flow: column;
  grid-template-columns: minmax(260px, 1fr);
  min-width: max-content;
  padding: 14px 16px;
}

.branch-access-row:last-child {
  border-bottom: 0;
}

.branch-access-head {
  background: #f3f7fb;
  color: #637083;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.branch-access-row strong,
.branch-access-row small {
  display: block;
}

.branch-access-row small {
  color: #637083;
}

.branch-access-row form {
  margin: 0;
}

.branch-access-row .btn {
  min-width: 94px;
}

.calendar-create-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.calendar-event-row {
  grid-template-columns: 120px minmax(0, 1fr) 140px auto;
}

.calendar-event-row small {
  color: #637083;
  display: block;
  font-weight: 700;
  margin-top: 6px;
}

.calendar-event-row form {
  margin: 0;
}

.calendar-status-stack,
.calendar-event-actions {
  align-items: stretch;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.calendar-event-actions .btn {
  width: 100%;
}

.module-plan-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 28px;
}

.module-plan-card {
  background: #fff;
  border: 1px solid #dce5ef;
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(24, 34, 48, 0.06);
  display: grid;
  gap: 18px;
  padding: 20px;
}

.module-plan-card.is-inactive,
.module-editor-item.is-inactive {
  opacity: 0.64;
}

.module-plan-card span:first-child {
  color: #6c7a89;
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.module-plan-card h2 {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 6px 0 8px;
}

.module-plan-card p {
  color: #637083;
  margin: 0;
  min-height: 68px;
}

.module-plan-meta,
.module-plan-actions,
.module-editor-actions,
.module-editor-side-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.module-plan-meta strong {
  color: #253244;
  font-size: 0.95rem;
}

.module-plan-actions form,
.module-editor-side-actions form {
  margin: 0;
}

.module-item-form {
  grid-template-columns: minmax(220px, 1fr) 180px;
}

.module-editor-list {
  display: grid;
  gap: 14px;
}

.module-editor-item {
  align-items: start;
  border: 1px solid #dce5ef;
  border-radius: 8px;
  display: grid;
  gap: 14px;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  padding: 14px;
}

.module-editor-form {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(220px, 1fr) 170px;
}

.module-editor-form label:not(.form-check) {
  display: grid;
  gap: 0.35rem;
  margin: 0;
}

.module-editor-form label span:first-child {
  color: #637083;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.module-editor-side-actions {
  align-items: stretch;
  flex-direction: column;
}

.module-editor-side-actions .btn {
  min-width: 92px;
  width: 100%;
}

.module-item {
  align-items: center;
  border: 1px solid #dce5ef;
  border-radius: 8px;
  display: grid;
  gap: 14px;
  grid-template-columns: 54px minmax(0, 1fr) 120px 100px;
  padding: 14px;
}

.student-progress-band {
  display: grid;
  gap: 12px;
}

.student-status-form {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.student-progress-track {
  background: #eef3f8;
  border-radius: 999px;
  height: 14px;
  overflow: hidden;
}

.student-progress-track span {
  background: linear-gradient(90deg, #0d6efd, #28a7ff);
  display: block;
  height: 100%;
}

.student-module-item {
  align-items: start;
  border: 1px solid #dce5ef;
  border-radius: 8px;
  display: grid;
  gap: 14px;
  grid-template-columns: 54px minmax(0, 1fr) 120px 110px auto;
  padding: 14px;
}

.student-module-item.is-completed {
  border-color: #bde9cf;
  background: #fbfffd;
}

.student-module-item small {
  color: #637083;
  display: block;
  font-weight: 700;
  margin-top: 6px;
}

.student-module-item form {
  margin: 0;
}

.student-module-notes {
  display: grid;
  gap: 8px;
  grid-column: 2 / -1;
}

.student-module-booking {
  align-items: end;
  border-top: 1px solid #e5edf5;
  display: grid;
  gap: 10px;
  grid-column: 2 / -1;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  padding-top: 12px;
}

.student-module-notes label {
  display: grid;
  gap: 0.35rem;
  margin: 0;
}

.student-module-booking label,
.student-module-notes label {
  display: grid;
  gap: 0.35rem;
  margin: 0;
}

.student-module-booking label span,
.student-module-notes label span {
  color: #637083;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.module-order {
  align-items: center;
  background: #e8f1ff;
  border-radius: 8px;
  color: #0d6efd;
  display: flex;
  font-weight: 850;
  height: 44px;
  justify-content: center;
  width: 54px;
}

.status-pill-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.status-pill-list article {
  background: #f8fbff;
  border: 1px solid #dce5ef;
  border-radius: 8px;
  padding: 14px;
}

.timeline-shell {
  display: grid;
  gap: 0;
  margin-bottom: 28px;
}

.timeline-event {
  align-items: center;
  border-bottom: 1px solid #e5edf5;
  display: grid;
  gap: 14px;
  grid-template-columns: 110px minmax(0, 1fr) 140px;
  padding: 16px;
}

.timeline-event:last-child {
  border-bottom: 0;
}

.timeline-event time {
  color: #0d6efd;
  font-size: 1.25rem;
  font-weight: 850;
}

.privacy-page {
  margin-top: 24px;
}

@media (max-width: 860px) {
  .drive-hero-shell,
  .overview-action-grid,
  .dashboard-grid,
  .platform-principles,
  .status-pill-list,
  .drive-form,
  .student-finance-grid,
  .student-finance-ledgers,
  .module-plan-grid,
  .module-item-form,
  .module-editor-item,
  .module-editor-form,
  .student-module-item,
  .student-module-booking,
  .branch-create-form,
  .branch-row,
  .branch-name-form,
  .calendar-create-form,
  .calendar-event-row,
  .data-row,
  .finance-row,
  .module-item,
  .timeline-event {
    grid-template-columns: 1fr;
  }

  .drive-hero-shell {
    padding: 28px;
  }

  .hero-copy h1 {
    font-size: 2.4rem;
  }

  .page-title-band {
    align-items: stretch;
    flex-direction: column;
  }

  .page-actions {
    justify-content: flex-start;
  }

  .form-actions,
  .module-plan-toolbar,
  .module-plan-actions,
  .module-editor-actions,
  .module-editor-side-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .module-plan-toolbar label {
    min-width: 0;
  }

  .student-filter-row {
    align-items: stretch;
    flex-direction: column;
  }

  .data-row-head,
  .branch-row-head {
    display: none;
  }

  .student-module-notes {
    grid-column: auto;
  }

  .student-module-booking {
    grid-column: auto;
  }
}
