/* ============================================================
   AMSKU portal redesign layer — loaded AFTER style.css.
   App shell (left sidebar + top bar), and component restyling to
   match the approved design proposal. Mobile: the sidebar becomes
   a slide-in drawer behind a hamburger button.
   ============================================================ */

/* ---------- base type tweaks ---------- */
h1 {
  font-size: 26px;
  margin-bottom: 14px;
}
h2 {
  font-size: 18px;
}
h3 {
  color: var(--dark);
}
*:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 8px;
}

/* ---------- app shell ---------- */
.shell {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: var(--card);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 16px 12px 20px;
  z-index: 120;
}
.sidebar-logo {
  display: block;
  padding: 6px 8px 16px;
}
.sidebar-logo img {
  display: block;
  width: 100%;
  max-width: 170px;
  height: auto;
}
.navgrp {
  margin: 10px 0 6px;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.navitem {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--text);
  font-weight: 500;
  font-size: 14.5px;
  position: relative;
  margin-bottom: 2px;
}
.navitem .icon {
  width: 18px;
  height: 18px;
  color: var(--text-mid);
  flex: none;
}
.navitem:hover {
  background: var(--panel-2);
  color: var(--text);
}
.navitem.on {
  background: var(--blue-tint);
  color: var(--primary);
  font-weight: 700;
}
.navitem.on .icon {
  color: var(--primary);
}
.navitem.on::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--primary);
}
.navitem.sub {
  font-size: 13.5px;
  padding: 7px 12px;
}
.navitem.sub .icon {
  width: 16px;
  height: 16px;
}

.content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.menubtn {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-mid);
  align-items: center;
  justify-content: center;
  flex: none;
}
.menubtn:hover {
  background: var(--panel-2);
  color: var(--text);
  transform: none;
  box-shadow: none;
}
.menubtn .icon {
  width: 18px;
  height: 18px;
}
.topsearch {
  flex: 0 1 400px;
  min-width: 0;
  position: relative;
  margin: 0;
}
.topsearch .icon {
  position: absolute;
  left: 13px;
  top: 12px;
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}
.topsearch input {
  width: 100%;
  height: 40px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--card);
  padding: 0 14px 0 38px;
  font: inherit;
  font-size: 14px;
  color: var(--text);
}
.topsearch input::placeholder {
  color: var(--muted);
}
.topsearch input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--focus);
}
.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.iconbtn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-mid);
  position: relative;
  flex: none;
}
.iconbtn:hover {
  background: var(--panel-2);
  color: var(--text);
}
.iconbtn .icon {
  width: 17px;
  height: 17px;
}
.topnav-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
}
.userchip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
}
.userchip:hover {
  background: var(--panel-2);
  color: var(--text);
}
.chip-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.chip-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.chip-name {
  font-weight: 700;
  font-size: 13px;
}
.chip-sub {
  font-size: 11.5px;
  color: var(--muted);
  text-transform: capitalize;
}
.sidebar-scrim {
  display: none;
}

.shell .container {
  margin: 0;
  max-width: none;
  width: 100%;
  padding: 24px 24px 60px;
}
.shell .container:not(.wide) > * {
  max-width: 880px;
}
.shell .container:not(.wide) > .lesson-layout,
.shell .container:not(.wide) > .cal-grid,
.shell .container:not(.wide) > .cal-toolbar,
.shell .container:not(.wide) > .me-grid,
.shell .container:not(.wide) > .withrail {
  max-width: 1200px;
}

/* ---------- buttons ---------- */
button,
.btn {
  font-size: 13.5px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 999px;
}
button:hover,
.btn:hover {
  transform: none;
  box-shadow: none;
}
.secondary-btn {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
}
.secondary-btn:hover {
  background: var(--panel-2);
  border-color: var(--border);
  color: var(--text);
}

/* ---------- inputs ---------- */
input[type="file"] {
  border: 0;
  padding: 6px 0;
  background: transparent;
  box-shadow: none;
  width: auto;
  max-width: 100%;
  font-size: 13px;
  color: var(--text-mid);
}
input[type="checkbox"],
input[type="radio"] {
  width: auto;
  accent-color: var(--primary);
}

/* ---------- badges → pills ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--panel-2);
  color: var(--text-mid);
  border: 1px solid var(--border);
}
.badge.free {
  background: var(--success-bg);
  color: var(--success);
  border: 0;
}
.badge.paid {
  background: var(--blue-tint);
  color: var(--primary);
  border: 0;
}
.badge.recurring {
  background: var(--violet-tint);
  color: var(--violet);
  border: 0;
}
.badge.audience {
  background: var(--amber-tint);
  color: var(--amber);
  border: 0;
}

/* ---------- page heads / breadcrumbs ---------- */
.classroom-head {
  text-align: left;
  margin-bottom: 16px;
}
.classroom-head .course-badges {
  justify-content: flex-start;
}
.page-breadcrumb {
  margin: 0 0 12px;
  font-size: 13px;
}
.page-breadcrumb a {
  color: var(--primary);
  font-weight: 600;
}
.page-breadcrumb a:hover {
  color: var(--primary-dark);
}

/* ---------- course / bundle cards ---------- */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}
.course-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.12s, box-shadow 0.12s;
}
.course-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.course-card-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--line-2);
}
.course-card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}
.course-card-body h2 {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
}
.course-card-desc {
  color: var(--text-mid);
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.course-meta {
  color: var(--muted);
  font-size: 12.5px;
  margin: auto 0 0;
  padding-top: 6px;
}
.course-card-cta {
  margin-top: 4px;
}
.course-open-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}
.course-open-btn:hover {
  background: var(--primary-dark);
  color: #fff;
}
.course-progress {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--success);
  margin: 0;
}
.course-hero {
  width: 100%;
  max-width: 980px;
  border-radius: var(--radius);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-sm);
}
.bundle-gate {
  background: var(--blue-tint);
  border: 1px solid var(--blue-tint-2);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 18px;
}

/* ---------- generic card blocks ---------- */
.event-card,
.admin-form,
.syllabus-block,
.syllabus-contact,
.post,
.profile-head,
.bundle-admin {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
}
.upgrade-note {
  background: var(--yellow-tint);
  border: 0;
  border-left: 3px solid var(--yellow);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text-mid);
  font-size: 13.5px;
}

/* ---------- calendar ---------- */
.cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.cal-title {
  margin: 0;
  font-size: 18px;
}
.cal-nav {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
}
.cal-nav:hover {
  background: var(--panel-2);
  color: var(--text);
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.cal-dow {
  padding: 9px 0;
  text-align: center;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
}
.cal-cell {
  min-height: 92px;
  padding: 8px 10px;
  border-right: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
  font-size: 12.5px;
  background: var(--card);
}
.cal-cell:nth-child(7n) {
  border-right: 0;
}
.cal-cell.muted {
  background: var(--panel-2);
}
.cal-date {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-weight: 700;
  color: var(--text);
}
.cal-cell.muted .cal-date {
  color: var(--muted);
}
.cal-cell.today .cal-date {
  background: var(--primary);
  color: #fff;
}
.cal-event {
  display: block;
  margin-top: 6px;
  background: var(--blue-tint);
  color: var(--primary);
  border-left: 3px solid var(--primary);
  border-radius: 4px;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-event .icon {
  width: 11px;
  height: 11px;
  vertical-align: -1px;
}
.cal-list-title {
  margin: 22px 0 12px;
}
.event-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.event-card h2 {
  font-size: 16.5px;
  margin: 8px 0 4px;
}
.event-time {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-mid);
  font-size: 13.5px;
  margin: 0 0 6px;
}
.event-time .icon {
  width: 15px;
  height: 15px;
  color: var(--muted);
}
.event-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.event-join {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
}

/* ---------- community ---------- */
.community-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.community-tab {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
}
.community-tab:hover {
  background: var(--panel-2);
  color: var(--text);
}
.community-tab.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.search-form {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.search-form input {
  flex: 1;
  height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
}
.post-form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.feed {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.post {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
}
.post-author {
  font-weight: 700;
  color: var(--text);
}
.post-category {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--blue-tint);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}
.post-title {
  font-size: 16px;
  margin: 0;
}
.post-title a {
  color: var(--text);
}
.post-title a:hover {
  color: var(--primary);
}
.post-body {
  margin: 0;
}
.post-image {
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  max-width: 100%;
}
.post-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.like-btn,
.like-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-mid);
  font-weight: 700;
  font-size: 13px;
}
.like-btn:hover {
  background: var(--panel-2);
  color: var(--text-mid);
}
.like-btn.liked {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--red-tint);
}
.like-btn.liked:hover {
  background: var(--red-tint);
  color: var(--danger);
}
.like-btn .icon,
.like-count .icon {
  width: 15px;
  height: 15px;
}
.post-comments-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
}
.post-comments-link:hover {
  background: var(--panel-2);
  color: var(--text);
}
.post-comments-link .icon {
  width: 15px;
  height: 15px;
}
.avatar {
  border-radius: 50%;
  object-fit: cover;
}
.avatar-sm {
  width: 28px;
  height: 28px;
}
.avatar-lg {
  width: 72px;
  height: 72px;
}

/* ---------- residency hub + training panel ---------- */
.residency-hub-head {
  margin-bottom: 18px;
}
.residency-hub-head h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.residency-hub-head h1 .icon {
  width: 24px;
  height: 24px;
  color: var(--primary);
}
.residency-progress {
  margin-bottom: 22px;
}
.dm-heading {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin: 14px 0;
}
.admin-stat {
  display: flex;
  flex-direction: column;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-align: left;
}
.admin-stat strong {
  order: 2;
  display: block;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
}
.admin-stat span {
  order: 1;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.admin-stat .stat-links {
  order: 3;
  margin-top: 8px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
.admin-stat .stat-links a {
  color: var(--primary);
}
.residency-orientation {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--yellow);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 14px 18px;
  font-size: 13.5px;
}
.residency-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.residency-item {
  display: flex;
  gap: 14px;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  transition: transform 0.12s, box-shadow 0.12s;
}
.residency-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: var(--text);
}
.residency-item-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--blue-tint);
  color: var(--primary);
  display: grid;
  place-items: center;
  flex: none;
}
.residency-item-icon .icon {
  width: 18px;
  height: 18px;
}
.residency-item-text strong {
  display: block;
  font-size: 14.5px;
  color: var(--dark);
  margin-bottom: 3px;
}
.residency-item-text small {
  color: var(--text-mid);
  font-size: 13px;
  line-height: 1.45;
}
.residency-next-event {
  margin-bottom: 22px;
}

/* ---------- course page (modules / lessons) ---------- */
.module.module-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 0;
  overflow: hidden;
  margin-bottom: 14px;
}
.module-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-2);
  margin-bottom: 0;
}
.module-head .module-title {
  font-size: 15px;
}
.module-meta {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0;
  padding: 0 18px 10px;
}
.quiz-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}
.quiz-cta:hover {
  background: var(--primary-dark);
  color: #fff;
}
.quiz-cta .icon {
  width: 15px;
  height: 15px;
}
.module.module-card .lesson-list {
  gap: 0;
  padding: 4px 8px 8px;
}
.module.module-card .lesson-list li {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line-2);
  border-radius: 8px;
  box-shadow: none;
  padding: 12px 10px;
}
.module.module-card .lesson-list li:first-child {
  border-top: 0;
}
.module.module-card .lesson-list li:hover {
  background: var(--panel-2);
}
.lesson-check {
  color: var(--success);
}
.lesson-check .icon {
  width: 18px;
  height: 18px;
}
.module.module-card > .muted {
  padding: 12px 18px;
}
.module.module-card .admin-form,
.module.module-card .module-quiz {
  margin: 10px 18px 16px;
}
.progress {
  margin: 4px 0 18px;
}
.progress-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-mid);
  margin-bottom: 6px;
}
.progress-bar {
  width: 100%;
  max-width: 420px;
  height: 6px;
  accent-color: var(--primary);
}
.course-certificate {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  margin-top: 18px;
}
.cert-download {
  font-weight: 700;
}
.reorder-form button {
  padding: 2px 8px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

/* ---------- lesson page ---------- */
.lesson-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 22px;
  align-items: start;
}
.video-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-sm);
}
.lesson-content {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px;
  margin-top: 14px;
}
.complete-form {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}
.complete-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.complete-btn.done {
  background: var(--card);
  color: var(--success);
  border: 1px solid var(--success-bg);
}
.complete-btn.done:hover {
  background: var(--success-bg);
}
.lesson-sidebar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px;
  position: sticky;
  top: 90px;
}
.lesson-sidebar-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}
.ls-module-title {
  font-weight: 700;
  font-size: 13.5px;
  margin: 10px 0 6px;
}
.ls-lessons {
  list-style: none;
  padding: 0;
  margin: 0;
}
.ls-lessons li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13.5px;
}
.ls-lessons li:hover {
  background: var(--panel-2);
}
.ls-lessons li.current {
  background: var(--blue-tint);
}
.ls-current-title {
  color: var(--primary);
  font-weight: 700;
}
.ls-quiz {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  font-weight: 700;
  font-size: 13px;
}

/* ---------- profile / dashboard ---------- */
.profile-head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
}
.profile-head h1 {
  margin: 0 0 2px;
  font-size: 24px;
}
.profile-edit,
.danger-zone {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px;
  margin: 14px 0;
}
.profile-edit summary,
.danger-zone summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  color: var(--primary);
}
.danger-zone {
  background: var(--red-tint);
  border-color: rgba(196, 30, 30, 0.22);
}
.danger-zone summary {
  color: var(--danger);
}
.delete-btn:hover {
  background: var(--red-tint);
}

.profile-email {
  margin: 0 0 6px;
}
.profile-pills {
  display: flex;
  gap: 8px;
}
.profile-spacer {
  flex: 1;
}
.avatar-form label {
  margin-top: 0;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.avatar-form button {
  margin-top: 8px;
}
.me-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}
.me-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.me-grid .me-card {
  margin-bottom: 0;
}
.kv {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px 16px;
  font-size: 14px;
  margin: 0;
}
.kv dt {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}
.kv dd {
  margin: 0;
  font-weight: 500;
}
.me-card .profile-edit {
  border: 0;
  box-shadow: none;
  padding: 16px 0 0;
  margin: 16px 0 0;
  border-top: 1px solid var(--line-2);
  border-radius: 0;
}
.quicklinks {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.quicklinks a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text);
}
.quicklinks a .icon {
  width: 16px;
  height: 16px;
  color: var(--primary);
}
.quicklinks a:hover {
  background: var(--panel-2);
  color: var(--primary);
}
.navy-btn {
  background: var(--navy);
  color: #fff;
}
.navy-btn:hover {
  background: #1a3560;
}
.logout-form {
  margin-top: 16px;
}
@media (max-width: 900px) {
  .me-grid {
    grid-template-columns: 1fr;
  }
  .kv {
    grid-template-columns: 1fr;
    gap: 2px 0;
  }
  .kv dd {
    margin-bottom: 8px;
  }
}

/* ---------- syllabus / misc residency pages ---------- */
.syllabus-sub {
  color: var(--text-mid);
  margin-top: -8px;
}
.syllabus-contacts {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0;
}
.syllabus-contact {
  padding: 12px 16px;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13.5px;
}
.syllabus-contact strong {
  font-size: 14px;
  color: var(--dark);
}
.syllabus-block {
  margin-bottom: 16px;
}
.syllabus-search {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.syllabus-search input {
  flex: 1;
  height: 40px;
  padding: 0 14px;
}
.syllabus-table-wrap {
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.syllabus-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.syllabus-table th {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--panel-2);
}
.syllabus-table td {
  padding: 11px 16px;
  border-top: 1px solid var(--line-2);
  vertical-align: top;
}
.syllabus-table tr:first-child td {
  border-top: 0;
}
.syllabus-table td:first-child {
  font-weight: 700;
  white-space: nowrap;
  color: var(--dark);
}
.workdrive-frame {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  background: var(--card);
}

/* ---------- bookings ---------- */
.booking-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.booking-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  font-weight: 500;
  transition: transform 0.12s, box-shadow 0.12s;
}
.booking-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: var(--card);
  color: var(--text);
}
.booking-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  flex: none;
}
.booking-text strong {
  display: block;
  font-size: 14.5px;
  color: var(--dark);
}
.booking-text small {
  color: var(--text-mid);
  font-size: 13px;
}

/* ---------- mobile ---------- */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    height: 100vh;
    transform: translateX(-105%);
    transition: transform 0.2s var(--ease);
    box-shadow: var(--shadow-lg);
  }
  body.nav-open .sidebar {
    transform: translateX(0);
  }
  .sidebar-scrim {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 35, 64, 0.5);
    z-index: 110;
  }
  .sidebar-scrim[hidden] {
    display: none;
  }
  body.nav-open {
    overflow: hidden;
  }
  .menubtn {
    display: inline-flex;
  }
  .topbar {
    padding: 10px 14px;
  }
  .topsearch {
    flex: 1;
  }
  .chip-text {
    display: none;
  }
  .userchip {
    padding: 3px;
    border: 0;
  }
  .shell .container {
    padding: 16px 14px 50px;
  }
  h1 {
    font-size: 22px;
  }
  .cal-cell {
    min-height: 60px;
    padding: 6px;
  }
  .cal-event {
    display: none;
  }
  .cal-toolbar {
    flex-wrap: wrap;
  }
  .lesson-layout {
    grid-template-columns: 1fr;
  }
  .lesson-sidebar {
    position: static;
  }
  .profile-head {
    flex-wrap: wrap;
  }
  .complete-form button {
    width: 100%;
    justify-content: center;
  }
  .admin-stats {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 600px) {
  .admin-stats {
    grid-template-columns: 1fr;
  }
  .course-grid,
  .residency-items,
  .booking-list {
    grid-template-columns: 1fr;
  }
  .search-form,
  .syllabus-search {
    flex-wrap: wrap;
  }
}

/* ---------- calendar: staff Edit / Delete row ---------- */
.event-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.edit-btn {
  display: inline-block;
  font-size: 13.5px;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  text-decoration: none;
  line-height: 1.2;
}
.edit-btn:hover {
  background: var(--panel-2);
  color: var(--text);
  text-decoration: none;
}

/* ---------- community: confirmed answers ---------- */
.badge.answered {
  background: var(--success-bg);
  color: var(--success);
  border: 0;
  gap: 4px;
}
.badge.answered .icon {
  width: 12px;
  height: 12px;
}
.comment.confirmed {
  border-color: var(--success);
  box-shadow: 0 0 0 1px var(--success) inset, var(--shadow-sm);
}
.confirmed-banner {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: -14px -16px 12px;
  padding: 7px 16px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: var(--success-bg);
  color: var(--success);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.confirmed-banner .icon {
  width: 14px;
  height: 14px;
}
.comment-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.confirm-form {
  margin: 0;
}
.confirm-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--card);
  color: var(--success);
  border: 1.5px solid var(--success);
  padding: 8px 16px;
  font-size: 0.9rem;
}
.confirm-btn .icon {
  width: 14px;
  height: 14px;
}
.confirm-btn:hover {
  background: var(--success-bg);
}
.confirm-btn.is-on {
  background: var(--success);
  color: #fff;
}
.confirm-btn.is-on:hover {
  background: var(--success);
  opacity: 0.85;
}

/* ---------- welcome banner (portal shell, always shown) ---------- */
.welcome-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin: 16px 24px 0;
  max-width: 880px;
  padding: 12px 16px 12px 18px;
  background: var(--blue-tint);
  border: 1px solid rgba(11, 92, 173, 0.18);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
}
.welcome-text {
  flex: 1 1 260px;
}
.welcome-text strong {
  color: var(--primary);
  margin-right: 4px;
}
.welcome-links {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.welcome-btn {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
}
.welcome-btn:hover {
  background: var(--primary-dark, #094a8a);
  color: #fff;
  text-decoration: none;
}
.welcome-link {
  font-weight: 600;
  color: var(--primary);
}
@media (max-width: 720px) {
  .welcome-banner {
    margin: 12px 14px 0;
  }
}
