/*
 * Loaded after bootstrap.min.css (alphabetical order of the :app bundle),
 * so these rules can refine Bootstrap without !important.
 */
:root {
  --ui-green: var(--app-primary, #22a33a);
  --ui-green-rgb: var(--app-primary-rgb, 34, 163, 58);
  --ui-sidebar: #0e1712;
  --ui-sidebar-2: #15211a;
  --ui-bg: #f3f5f4;
  --ui-surface: #ffffff;
  --ui-text: #18211c;
  --ui-muted: #6b7570;
  --ui-border: #e6eae8;
  --ui-radius: 1rem;
  --ui-shadow: 0 1px 2px rgba(16, 24, 20, 0.04), 0 8px 24px rgba(16, 24, 20, 0.05);
  --ui-sidebar-width: 260px;
  --ui-topbar-height: 80px;
}

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background-color: var(--ui-bg);
  color: var(--ui-text);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  font-weight: 700;
  color: var(--ui-text);
  letter-spacing: -0.01em;
}

.min-w-0 { min-width: 0; }

/* ---------- Shell ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.app-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-content {
  flex: 1 1 auto;
  padding-bottom: 2rem;
}

.app-content > .container,
.app-content > .container-fluid,
.app-content > div > .container {
  max-width: 1320px;
}

/* ---------- Sidebar ---------- */
.app-sidebar {
  --bs-offcanvas-width: var(--ui-sidebar-width);
  --bs-offcanvas-bg: var(--ui-sidebar);
  --bs-offcanvas-color: #fff;
  background-color: var(--ui-sidebar);
  color: #fff;
}

@media (min-width: 992px) {
  .app-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    width: var(--ui-sidebar-width);
    flex: 0 0 var(--ui-sidebar-width);
    transition: width 0.2s ease, flex-basis 0.2s ease;
  }

  .sidebar-collapsed .app-sidebar {
    width: 84px;
    flex-basis: 84px;
  }

  .sidebar-collapsed .app-sidebar-inner { overflow-x: hidden; }

  .sidebar-collapsed .app-sidebar .app-brand-text,
  .sidebar-collapsed .app-sidebar .app-nav-link span,
  .sidebar-collapsed .app-sidebar .app-sidebar-footer {
    display: none;
  }

  .sidebar-collapsed .app-sidebar .app-brand { margin-inline: auto; }

  .sidebar-collapsed .app-sidebar .app-nav-link {
    justify-content: center;
    padding: 0.75rem 0;
  }
}

@media (min-width: 992px) and (prefers-reduced-motion: reduce) {
  .app-sidebar { transition: none; }
}

.app-sidebar-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  overflow-y: auto;
  background:
    linear-gradient(180deg, var(--ui-sidebar) 35%, rgba(14, 23, 18, 0.55) 70%, var(--ui-sidebar) 100%),
    var(--sidebar-bg-image) center bottom / cover no-repeat,
    var(--ui-sidebar);
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
  text-decoration: none;
  min-width: 0;
}

.app-brand:hover { color: #fff; }

.app-brand-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.app-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.1;
}

.app-brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-brand-tag {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 0.2rem;
}

.app-nav { margin-top: 0.75rem; }

.app-nav-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 1rem;
  border-radius: 0.6rem;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.app-nav-link .bi { font-size: 1.2rem; width: 1.25rem; text-align: center; }

.app-nav-link:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.07);
}

.app-nav-link.active {
  color: #fff;
  background-color: var(--ui-green);
  box-shadow: 0 6px 18px rgba(var(--ui-green-rgb), 0.35);
}

.app-nav-link:focus-visible {
  outline: 2px solid var(--ui-green);
  outline-offset: 2px;
}

.app-sidebar-footer { margin-top: auto; padding-top: 6rem; }

.app-slogan {
  display: flex;
  flex-direction: column;
  font-size: 1.3rem;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fff;
  font-weight: 500;
}

.app-slogan-accent {
  font-weight: 800;
  color: var(--ui-green);
}

/* ---------- Topbar ---------- */
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  min-height: var(--ui-topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--ui-border);
}

@media (min-width: 992px) {
  .app-topbar { padding: 0.75rem 2rem; }
}

.app-topbar-divider {
  width: 1px;
  height: 36px;
  background-color: var(--ui-border);
  margin-right: 0.25rem;
}

.app-topbar-title { font-size: 1.15rem; font-weight: 700; }
.app-topbar-subtitle { font-size: 0.85rem; color: var(--ui-muted); }

.app-icon-btn {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.6rem;
  color: var(--ui-text);
  border: 1px solid var(--ui-border);
  background: #fff;
}

.app-icon-btn:hover { background: var(--ui-bg); }

.app-user-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 0;
  padding: 0.25rem 0.5rem;
  border-radius: 0.75rem;
  color: var(--ui-text);
}

.app-user-btn:hover,
.app-user-btn.show { background-color: var(--ui-bg); }

.app-user-email {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
}

.app-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--ui-green), #0f5f22);
  flex-shrink: 0;
}

.dropdown-menu {
  --bs-dropdown-border-radius: 0.75rem;
  --bs-dropdown-bg: #fff;
  --bs-dropdown-link-active-bg: rgba(var(--ui-green-rgb), 0.12);
  --bs-dropdown-link-active-color: var(--ui-text);
  background-color: #fff;
}

/* ---------- Page header ---------- */
.app-content h1.h3,
.app-content h1.h4 {
  font-size: 1.5rem;
  font-weight: 700;
}

/* ---------- Cards ---------- */
.card {
  --bs-card-border-radius: var(--ui-radius);
  --bs-card-inner-border-radius: calc(var(--ui-radius) - 1px);
  --bs-card-border-color: var(--ui-border);
  --bs-card-cap-bg: transparent;
  border: 1px solid var(--ui-border);
  background-color: #fff;
  box-shadow: var(--ui-shadow);
}

.card.border-0 { border: 1px solid var(--ui-border) !important; }
.card.shadow-sm { box-shadow: var(--ui-shadow) !important; }

.card-header {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--ui-border);
  font-weight: 600;
}

.card-body { padding: 1.25rem; }
.card-title { font-weight: 700; }

/* ---------- Tables ---------- */
.table {
  --bs-table-bg: #fff;
  --bs-table-hover-bg: rgba(var(--ui-green-rgb), 0.04);
  --bs-table-border-color: var(--ui-border);
  margin-bottom: 0;
  font-size: 0.92rem;
  background-color: #fff;
}

.table > thead > tr > th,
.table thead.table-light th {
  background-color: #fff;
  color: var(--ui-text);
  font-weight: 600;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--ui-border);
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
  white-space: nowrap;
}

.table > :not(caption) > * > * {
  padding: 0.9rem 1rem;
}

.table > tbody > tr:last-child > * { border-bottom: 0; }

.table td .text-muted,
.table td small { color: var(--ui-muted) !important; }

/* ---------- Badges (status pills) ---------- */
.badge {
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.4em 0.85em;
  border-radius: 999px;
}

.badge.bg-success, .badge.text-bg-success { background-color: rgba(34, 163, 58, 0.14) !important; color: #157a2a !important; }
.badge.bg-primary, .badge.text-bg-primary { background-color: rgba(var(--ui-green-rgb), 0.14) !important; color: var(--ui-green) !important; }
.badge.bg-info, .badge.text-bg-info { background-color: rgba(37, 99, 235, 0.12) !important; color: #1d4ed8 !important; }
.badge.bg-warning, .badge.text-bg-warning { background-color: rgba(245, 158, 11, 0.16) !important; color: #b45309 !important; }
.badge.bg-danger, .badge.text-bg-danger { background-color: rgba(220, 38, 38, 0.12) !important; color: #b91c1c !important; }
.badge.bg-secondary, .badge.text-bg-secondary { background-color: #eef1ef !important; color: #4b5550 !important; }
.badge.bg-light, .badge.text-bg-light { background-color: #f3f5f4 !important; color: #4b5550 !important; }
.badge.bg-dark, .badge.text-bg-dark { background-color: var(--ui-sidebar) !important; color: #fff !important; }

/* ---------- Buttons ---------- */
.btn {
  --bs-btn-font-weight: 600;
  --bs-btn-border-radius: 0.6rem;
  --bs-btn-padding-x: 1rem;
  --bs-btn-padding-y: 0.55rem;
  --bs-btn-font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.btn-sm {
  --bs-btn-padding-x: 0.75rem;
  --bs-btn-padding-y: 0.35rem;
  --bs-btn-font-size: 0.82rem;
  --bs-btn-border-radius: 0.5rem;
}

.btn-lg {
  --bs-btn-padding-y: 0.8rem;
  --bs-btn-font-size: 1rem;
  --bs-btn-border-radius: 0.75rem;
}

.btn-link { display: inline; }
.btn-close { display: inline-block; }
.btn.dropdown-toggle::after { margin-left: 0.35rem; }

.btn-primary {
  --bs-btn-bg: var(--ui-green);
  --bs-btn-border-color: var(--ui-green);
  --bs-btn-hover-bg: rgba(var(--ui-green-rgb), 0.88);
  --bs-btn-hover-border-color: rgba(var(--ui-green-rgb), 0.88);
  --bs-btn-color: #fff;
  --bs-btn-hover-color: #fff;
  --bs-btn-active-color: #fff;
  box-shadow: 0 4px 14px rgba(var(--ui-green-rgb), 0.25);
}

.enrollment-actions .btn {
  min-height: 2.15rem;
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
}

/* Completa los botones sólidos heredados que todavía no tienen icono en el markup. */
.btn-primary:not(:has(i))::before,
.btn-secondary:not(.btn-back):not(.btn-cancel):not(:has(i))::before,
.btn-danger:not(:has(i))::before,
.btn-success:not(:has(i))::before,
.btn-warning:not(:has(i))::before {
  line-height: 1;
}

.btn-primary:not(:has(i))::before { content: "+"; }
.btn-secondary:not(.btn-back):not(.btn-cancel):not(:has(i))::before { content: "•"; }
.btn-danger:not(:has(i))::before { content: "×"; }
.btn-success:not(:has(i))::before { content: "+"; }
.btn-warning:not(:has(i))::before { content: "!"; }
.btn-back:not(:has(i))::before { content: "←"; }
.btn-cancel:not(:has(i))::before { content: "×"; }

.btn-outline-primary {
  --bs-btn-border-width: 1.5px;
}

.btn-outline-danger {
  --bs-btn-border-width: 1.5px;
}

.btn-outline-secondary {
  --bs-btn-color: var(--ui-text);
  --bs-btn-border-color: var(--ui-border);
  --bs-btn-hover-bg: var(--ui-bg);
  --bs-btn-hover-color: var(--ui-text);
  --bs-btn-hover-border-color: #d4dad7;
  --bs-btn-active-bg: #e9edeb;
  --bs-btn-active-color: var(--ui-text);
  --bs-btn-active-border-color: #d4dad7;
  background-color: #fff;
}

.btn-light {
  --bs-btn-bg: #fff;
  --bs-btn-border-color: var(--ui-border);
  --bs-btn-hover-bg: var(--ui-bg);
  --bs-btn-hover-border-color: var(--ui-border);
}

/* ---------- Forms ---------- */
.form-label {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--ui-text);
  margin-bottom: 0.4rem;
}

.form-control,
.form-select {
  border-radius: 0.6rem;
  border-color: var(--ui-border);
  padding: 0.6rem 0.85rem;
  font-size: 0.92rem;
  background-color: #fff;
}

.form-select { padding-right: 2.25rem; }

.form-control::placeholder { color: #a1aaa5; }

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: var(--ui-green);
  box-shadow: 0 0 0 0.2rem rgba(var(--ui-green-rgb), 0.15);
}

.form-control.is-invalid,
.form-select.is-invalid {
  border-color: #dc3545 !important;
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 0.2rem rgba(var(--bs-danger-rgb), 0.15);
}

.form-check-input:checked {
  background-color: var(--ui-green);
  border-color: var(--ui-green);
}

.form-text { color: var(--ui-muted); }

.input-group-text {
  background-color: #fff;
  border-color: var(--ui-border);
  color: var(--ui-muted);
}

/* ---------- Alerts ---------- */
.alert {
  border-radius: 0.75rem;
  border: 1px solid transparent;
  font-size: 0.92rem;
}

.alert-success { background: rgba(34, 163, 58, 0.08); border-color: rgba(34, 163, 58, 0.25); color: #145c22; }
.alert-danger { background: rgba(220, 38, 38, 0.06); border-color: rgba(220, 38, 38, 0.22); color: #8f1d1d; }
.alert-warning { background: rgba(245, 158, 11, 0.08); border-color: rgba(245, 158, 11, 0.28); color: #7a4a06; }
.alert-info { background: rgba(37, 99, 235, 0.06); border-color: rgba(37, 99, 235, 0.2); color: #1e3a8a; }

/* ---------- Progress ---------- */
.progress {
  --bs-progress-height: 0.55rem;
  --bs-progress-border-radius: 999px;
  --bs-progress-bg: #e9edeb;
  --bs-progress-bar-bg: var(--ui-green);
}

/* ---------- Nav tabs / pills ---------- */
.nav-pills {
  --bs-nav-pills-border-radius: 999px;
  --bs-nav-pills-link-active-bg: var(--ui-green);
  gap: 0.5rem;
}

.nav-pills .nav-link {
  border: 1px solid var(--ui-border);
  color: var(--ui-text);
  font-weight: 500;
  font-size: 0.88rem;
  padding: 0.4rem 1rem;
  background: #fff;
}

.nav-pills .nav-link.active { border-color: var(--ui-green); color: #fff; }

.nav-tabs {
  --bs-nav-tabs-border-color: var(--ui-border);
  --bs-nav-tabs-link-active-color: var(--ui-green);
  --bs-nav-tabs-link-active-border-color: transparent transparent var(--ui-green);
}

.nav-tabs .nav-link {
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--ui-muted);
  font-weight: 600;
}

.nav-tabs .nav-link.active { border-bottom-color: var(--ui-green); background: transparent; }

/* ---------- List groups ---------- */
.list-group {
  --bs-list-group-border-color: var(--ui-border);
  --bs-list-group-border-radius: 0.75rem;
  --bs-list-group-active-bg: var(--ui-green);
  --bs-list-group-active-border-color: var(--ui-green);
}

/* ---------- Pagination ---------- */
.pagination {
  --bs-pagination-border-radius: 0.6rem;
  --bs-pagination-border-color: var(--ui-border);
  --bs-pagination-color: var(--ui-text);
  --bs-pagination-hover-bg: var(--ui-bg);
  --bs-pagination-hover-color: var(--ui-text);
  --bs-pagination-active-bg: var(--ui-green);
  --bs-pagination-active-border-color: var(--ui-green);
  --bs-pagination-focus-box-shadow: 0 0 0 0.2rem rgba(var(--ui-green-rgb), 0.15);
  gap: 0.35rem;
}

.pagination .page-link { border-radius: 0.6rem !important; font-weight: 500; }

.students-pagination-footer,
.attendance-pagination-footer {
  overflow: hidden;
}

.students-pagination,
.students-pagination nav,
.students-pagination .pagination,
.attendance-pagination,
.attendance-pagination nav,
.attendance-pagination .pagination {
  max-width: 100%;
}

.students-pagination .pagination,
.attendance-pagination .pagination {
  flex-wrap: wrap;
}

@media (max-width: 575.98px) {
  .students-pagination .pagination,
  .attendance-pagination .pagination {
    gap: 0.2rem;
  }

  .students-pagination .page-link,
  .attendance-pagination .page-link {
    min-width: 2.25rem;
    padding: 0.4rem 0.55rem;
    text-align: center;
  }

  .students-pagination .page-link-first,
  .students-pagination .page-link-last,
  .attendance-pagination .page-link-first,
  .attendance-pagination .page-link-last {
    display: none;
  }

  .students-pagination .page-link-prev,
  .students-pagination .page-link-next,
  .attendance-pagination .page-link-prev,
  .attendance-pagination .page-link-next {
    padding-inline: 0.65rem;
    white-space: nowrap;
  }
}

/* ---------- Modals ---------- */
.modal-content { border: 0; border-radius: var(--ui-radius); box-shadow: 0 24px 60px rgba(16, 24, 20, 0.18); }
.modal-header, .modal-footer { border-color: var(--ui-border); }

/* ---------- Page header ---------- */
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.btn .bi + span,
.btn span + .bi { margin-left: 0.15rem; }

/* ---------- Search inputs with icon ---------- */
.input-icon { position: relative; }
.input-icon > .bi {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ui-muted);
  pointer-events: none;
}
.input-icon > .form-control { padding-left: 2.5rem; }

/* ---------- People ---------- */
.person-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ui-green);
  background-color: rgba(var(--ui-green-rgb), 0.12);
}

.student-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.student-profile-photo {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px rgba(var(--ui-green-rgb), 0.35);
}

.student-profile-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--ui-green);
  background-color: rgba(var(--ui-green-rgb), 0.12);
}

.info-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--ui-border);
}

.info-list > li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--ui-border);
}

.info-list-label {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ui-muted);
  font-size: 0.88rem;
  flex-shrink: 0;
}

.info-list-label .bi { color: var(--ui-text); font-size: 1rem; }
.info-list-value { font-weight: 600; text-align: right; min-width: 0; }

.student-photo-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  border: 1px dashed var(--ui-border);
  border-radius: 0.75rem;
  color: var(--ui-muted);
  font-size: 0.9rem;
  background-color: var(--ui-bg);
}

/* ---------- Accordions ---------- */
.accordion {
  --bs-accordion-border-color: var(--ui-border);
  --bs-accordion-border-radius: 0.85rem;
  --bs-accordion-inner-border-radius: 0.85rem;
  --bs-accordion-active-bg: rgba(var(--ui-green-rgb), 0.06);
  --bs-accordion-active-color: var(--ui-text);
  --bs-accordion-btn-focus-box-shadow: 0 0 0 0.2rem rgba(var(--ui-green-rgb), 0.18);
}

.accordion-item + .accordion-item { margin-top: 0.75rem; }
.accordion-item { border-radius: 0.85rem !important; overflow: hidden; border-top: 1px solid var(--ui-border) !important; }
.accordion-button { border-radius: 0 !important; }

/* ---------- Dashboard ---------- */
.dash-stat {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 100%;
  padding: 1.35rem;
  color: var(--ui-text);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

a.dash-stat:hover {
  color: var(--ui-text);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(16, 24, 20, 0.08) !important;
}

.dash-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #fff;
  background-color: var(--ui-green);
  flex-shrink: 0;
}

.dash-icon-amber { background-color: #f5a40b; }
.dash-icon-dark { background-color: var(--ui-sidebar-2); }

.dash-stat-label { font-size: 0.88rem; color: var(--ui-muted); }
.dash-stat-value { font-size: 1.35rem; font-weight: 700; line-height: 1.2; }

.dash-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--ui-radius);
  min-height: 190px;
  display: flex;
  align-items: center;
  padding: 1.75rem;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(10, 16, 12, 0.92) 0%, rgba(10, 16, 12, 0.6) 55%, rgba(10, 16, 12, 0.1) 100%),
    var(--hero-image) center / cover no-repeat,
    var(--ui-sidebar);
  box-shadow: var(--ui-shadow);
}

.dash-hero-title {
  font-size: 1.6rem;
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1.1;
  color: #fff;
  max-width: 14ch;
  margin-bottom: 0.9rem;
}

.dash-hero-bar {
  display: block;
  width: 80px;
  height: 4px;
  border-radius: 4px;
  background-color: var(--ui-green);
}

.dash-quick {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  height: 100%;
  padding: 1rem;
  border: 1px solid var(--ui-border);
  border-radius: 0.75rem;
  background: #fff;
  color: var(--ui-text);
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dash-quick:hover {
  color: var(--ui-text);
  border-color: rgba(var(--ui-green-rgb), 0.5);
  box-shadow: 0 8px 20px rgba(var(--ui-green-rgb), 0.1);
}

.dash-quick .bi { font-size: 1.6rem; color: var(--ui-green); }
.dash-quick-title { font-weight: 600; font-size: 0.92rem; }
.dash-quick-desc { font-size: 0.8rem; color: var(--ui-muted); }

/* ---------- Guest (login) ---------- */
.app-guest {
  background:
    radial-gradient(1200px 600px at 100% 0%, rgba(var(--ui-green-rgb), 0.12), transparent 60%),
    var(--ui-bg);
}

.app-guest .card { border-radius: 1.25rem; }

/* Student photos & course vehicle icons */
.person-avatar-photo {
  object-fit: cover;
  padding: 0;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(var(--ui-green-rgb), 0.35);
}

.student-photo-zoom {
  position: relative;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 50%;
  cursor: zoom-in;
  flex-shrink: 0;
}
.student-photo-zoom:focus-visible {
  outline: 3px solid rgba(var(--ui-green-rgb), 0.5);
  outline-offset: 3px;
}
.student-photo-zoom .student-profile-photo { transition: transform .2s ease, filter .2s ease; }
.student-photo-zoom:hover .student-profile-photo { transform: scale(1.04); filter: brightness(.92); }
.student-photo-zoom-badge {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ui-green);
  color: #fff;
  font-size: .8rem;
  border: 2px solid #fff;
}
.course-vehicle-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.15rem;
  background: rgba(var(--ui-green-rgb), 0.12);
  color: var(--ui-green);
}
.course-vehicle-moto { background: rgba(13, 110, 253, 0.1); color: #0d6efd; }
.course-vehicle-theory { background: rgba(245, 158, 11, 0.14); color: #b45309; }
.course-vehicle-sm { width: 24px; height: 24px; border-radius: 7px; font-size: .8rem; }


/* ---------- Student detail refresh ---------- */
.student-show-page {
  --student-card-radius: 1.25rem;
}

.student-show-header {
  margin-bottom: 1.75rem;
  align-items: flex-end;
}

.student-show-kicker {
  color: var(--ui-green);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.student-show-back {
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.8);
}

.student-show-actions {
  flex-shrink: 0;
}

.student-show-actions .btn {
  min-height: 42px;
}

.student-show-profile-card,
.student-show-content .card {
  border-radius: var(--student-card-radius);
  overflow: hidden;
}

.student-show-profile-card {
  position: relative;
  overflow: visible;
}

.student-show-profile-card::before {
  content: "";
  display: block;
  height: 5px;
  background: linear-gradient(90deg, var(--ui-green), rgba(var(--ui-green-rgb), 0.32));
}

.student-show-profile-card .card-body {
  padding: 1.5rem;
}

.student-show-sidebar {
  align-self: flex-start;
}

.student-metric-card {
  min-height: 112px;
  border-radius: 1rem !important;
  padding: 1.15rem 1.25rem;
  background: rgba(255, 255, 255, 0.86);
}

.student-metric-card .dash-icon {
  width: 48px;
  height: 48px;
  font-size: 1.2rem;
}

.student-course-card {
  position: relative;
  background:
    radial-gradient(circle at 100% 0%, rgba(var(--ui-green-rgb), 0.13), transparent 40%),
    #fff;
}

.student-course-card .card-body {
  padding: 1.5rem;
}

.student-course-card h2 {
  letter-spacing: -0.02em;
}

.student-course-card .bi-journal-bookmark {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.65rem;
  background: rgba(var(--ui-green-rgb), 0.12);
}

@media (min-width: 1200px) {
  .student-show-sidebar {
    position: sticky;
    top: calc(var(--ui-topbar-height) + 1.25rem);
  }
}

@media (max-width: 575.98px) {
  .student-show-page { padding-top: 1rem !important; }
  .student-show-header {
    align-items: stretch;
    margin-bottom: 1.25rem;
  }
  .student-show-actions {
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }
  .student-show-actions form,
  .student-show-actions .btn {
    width: 100%;
  }
  .student-show-actions form:last-child {
    grid-column: 1 / -1;
  }
  .student-show-profile-card .card-body,
  .student-course-card .card-body {
    padding: 1.15rem;
  }
  .student-show-metrics {
    --bs-gutter-y: 0.65rem;
  }
  .student-metric-card {
    min-height: 96px;
    padding: 1rem;
  }
}


/* White information surfaces keep content distinct from the page background. */
.card,
.list-group-item,
.accordion-item,
.table-responsive,
.table thead.table-light,
.table thead.table-light th {
  background-color: #fff;
}

.table > tbody > tr > td,
.table > tbody > tr > th {
  background-color: #fff;
}

.table-hover > tbody > tr:hover > td,
.table-hover > tbody > tr:hover > th {
  background-color: rgba(var(--ui-green-rgb), 0.04);
}


/* Profile photo lightbox lives above the whole application shell. */
body.photo-lightbox-open {
  overflow: hidden;
}

.student-photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.student-photo-lightbox[hidden] {
  display: none;
}

.student-photo-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 12, 9, 0.78);
  backdrop-filter: blur(5px);
}

.student-photo-lightbox-dialog {
  position: relative;
  z-index: 1;
  width: min(92vw, 900px);
  max-height: 92vh;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 1rem;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
}

.student-photo-lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--ui-border);
}

.student-photo-lightbox-header h2 {
  margin: 0;
  font-size: 1rem;
}

.student-photo-lightbox-close {
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ui-border);
  border-radius: 0.65rem;
  background: #fff;
  color: var(--ui-text);
  cursor: pointer;
}

.student-photo-lightbox-close:hover {
  background: var(--ui-bg);
}

.student-photo-lightbox-close:focus-visible {
  outline: 3px solid rgba(var(--ui-green-rgb), 0.35);
  outline-offset: 2px;
}

.student-photo-lightbox-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: #f8faf9;
}

.student-photo-lightbox-image {
  display: block;
  max-width: 100%;
  max-height: calc(92vh - 5.5rem);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0.7rem;
}

@media (max-width: 575.98px) {
  .student-photo-lightbox {
    padding: 0.5rem;
  }

  .student-photo-lightbox-dialog {
    width: 100%;
    max-height: 94vh;
    border-radius: 0.85rem;
  }

  .student-photo-lightbox-body {
    padding: 0.65rem;
  }

  .student-photo-lightbox-image {
    max-height: calc(94vh - 5rem);
  }
}


.student-identification-badge {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  line-height: 1.35;
}

@media (max-width: 575.98px) {
  .student-profile {
    align-items: flex-start;
  }
}
