:root {
  --app-primary: #1f5fae;
  --app-primary-dark: #174a88;
  --app-primary-soft: #eaf2fc;
  --app-accent: #0f766e;
  --app-bg: #f4f7fb;
  --app-surface: #ffffff;
  --app-text: #1f2937;
  --app-muted: #64748b;
  --app-border: #dbe4ef;
  --app-danger: #b42318;
  --app-radius: 0.875rem;
  --app-shadow: 0 8px 24px rgba(31, 73, 125, 0.08);
  --app-shadow-hover: 0 12px 30px rgba(31, 73, 125, 0.13);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  background: var(--app-bg);
  color: var(--app-text);
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  text-underline-offset: 0.18em;
}

.container,
.container-md,
.container-lg,
.container-xl {
  --bs-gutter-x: 2rem;
}

/* Shared masthead */
.app-header,
.bgg {
  position: relative;
  overflow: hidden;
  margin-bottom: 0 !important;
  padding: clamp(1.15rem, 2.5vw, 1.8rem) 1rem !important;
  color: #fff;
  background:
    radial-gradient(circle at 82% 20%, rgba(255, 255, 255, 0.2), transparent 24%),
    linear-gradient(125deg, var(--app-primary-dark), #2e78cb 72%, #4e91d8) !important;
  box-shadow: 0 8px 24px rgba(23, 74, 136, 0.18) !important;
}

.app-header::after,
.bgg::after {
  content: "";
  position: absolute;
  right: -3rem;
  bottom: -5rem;
  width: 12rem;
  height: 12rem;
  border: 1.5rem solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  pointer-events: none;
}

.app-header__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  max-width: 1200px;
  margin: 0 auto;
}

.app-header__icon {
  display: inline-grid;
  flex: 0 0 auto;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.14);
  font-size: 1.35rem;
  backdrop-filter: blur(6px);
}

.app-header__copy {
  min-width: 0;
  text-align: left;
}

.app-header h1,
.app-header h2,
.app-header h3,
.bgg h1,
.bgg h2,
.bgg h3 {
  margin: 0;
  color: inherit;
  font-size: clamp(1.05rem, 2.1vw, 1.45rem);
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: 0.015em;
}

.app-header__subtitle {
  margin: 0.2rem 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.86rem;
}

/* Navigation */
.navbar {
  --bs-navbar-padding-y: 0.65rem;
  z-index: 1020;
  border-bottom: 1px solid var(--app-border);
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: 0 4px 16px rgba(30, 64, 104, 0.06) !important;
}

.navbar > .container-fluid {
  max-width: 1440px;
  padding-inline: clamp(1rem, 3vw, 2.5rem);
}

.app-navbar .navbar-collapse,
.app-navbar .navbar-nav,
.app-navbar .app-user {
  min-width: 0;
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.75rem;
  color: var(--app-primary-dark);
  font-size: 0.94rem;
  font-weight: 750 !important;
}

.navbar-nav {
  gap: 0.15rem;
}

.navbar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  min-height: 2.65rem;
  padding: 0.55rem 0.7rem !important;
  border-radius: 0.65rem;
  color: #475569;
  font-size: 0.875rem !important;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus-visible,
.navbar-nav .nav-link.active {
  color: var(--app-primary-dark);
  background: var(--app-primary-soft);
}

.navbar-nav .nav-link.active {
  box-shadow: inset 0 -2px 0 var(--app-primary);
}

.navbar-toggler {
  min-width: 2.75rem;
  min-height: 2.75rem;
  border-color: var(--app-border);
}

.app-user {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: #334155;
  font-size: 0.86rem;
}

.app-user__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.65rem;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  background: #fff;
  max-width: 18rem;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Admin and teacher sidebar */
body.has-app-sidebar {
  --app-sidebar-width: 17.5rem;
  box-sizing: border-box;
  padding-left: var(--app-sidebar-width);
  transition: padding-left 0.22s ease;
}

body.has-app-sidebar.sidebar-collapsed {
  padding-left: 0;
}

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1045;
  display: flex;
  width: var(--app-sidebar-width);
  min-width: 0;
  flex-direction: column;
  color: #dbeafe;
  background: linear-gradient(180deg, #123a6b 0%, #174a88 52%, #12365f 100%);
  box-shadow: 8px 0 28px rgba(15, 43, 78, 0.18);
  transition: width 0.22s ease, transform 0.22s ease;
}

.app-sidebar__brand {
  display: flex;
  min-height: 4.75rem;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  text-decoration: none;
}

.app-sidebar__brand:hover,
.app-sidebar__brand:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.app-sidebar__brand-icon,
.app-sidebar__avatar {
  display: inline-grid;
  flex: 0 0 2.65rem;
  width: 2.65rem;
  height: 2.65rem;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.12);
  font-size: 1.25rem;
}

.app-sidebar__brand-copy,
.app-sidebar__profile-copy {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  line-height: 1.25;
}

.app-sidebar__brand-copy strong {
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.app-sidebar__brand-copy small,
.app-sidebar__profile-copy small {
  color: #bfdbfe;
  font-size: 0.76rem;
}

.app-sidebar__nav {
  flex: 1 1 auto;
  padding: 0.8rem 0.65rem;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.app-sidebar__section {
  margin: 0.85rem 0.7rem 0.35rem;
  color: #93c5fd;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  white-space: nowrap;
}

.app-sidebar__section:first-child {
  margin-top: 0.1rem;
}

.app-sidebar__link {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 2.75rem;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.2rem;
  padding: 0.58rem 0.75rem;
  border-radius: 0.7rem;
  color: #dbeafe;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.16s ease, background-color 0.16s ease, transform 0.16s ease;
}

.app-sidebar__link > i {
  flex: 0 0 1.35rem;
  width: 1.35rem;
  text-align: center;
  font-size: 1.08rem;
}

.app-sidebar__label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.app-sidebar__link:hover,
.app-sidebar__link:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.app-sidebar__link.active {
  color: #123a6b;
  background: #fff;
  box-shadow: 0 6px 18px rgba(5, 26, 53, 0.2);
}

.app-sidebar__link.active::before {
  content: "";
  position: absolute;
  inset: 0.65rem auto 0.65rem -0.65rem;
  width: 0.22rem;
  border-radius: 999px;
  background: #60a5fa;
}

.app-sidebar__footer {
  flex: 0 0 auto;
  padding: 0.75rem 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(6, 29, 56, 0.18);
}

.app-sidebar__profile {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.7rem;
  padding: 0.45rem 0.65rem 0.7rem;
}

.app-sidebar__avatar {
  flex-basis: 2.3rem;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 50%;
  font-size: 1rem;
}

.app-sidebar__profile-copy strong {
  overflow: hidden;
  color: #fff;
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-sidebar__logout {
  color: #fecaca;
}

.app-sidebar__logout:hover,
.app-sidebar__logout:focus-visible {
  color: #fff;
  background: rgba(220, 38, 38, 0.22);
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  display: flex;
  min-height: 4.75rem;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem clamp(1rem, 2.5vw, 2rem);
  border-bottom: 1px solid var(--app-border);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 5px 18px rgba(30, 64, 104, 0.08);
  backdrop-filter: blur(10px);
}

.app-topbar__toggle {
  display: inline-grid;
  flex: 0 0 2.75rem;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border: 1px solid #cbd7e5;
  border-radius: 0.72rem;
  color: var(--app-primary-dark);
  background: #fff;
  font-size: 1.25rem;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.06);
}

.app-topbar__toggle:hover,
.app-topbar__toggle:focus-visible {
  color: #fff;
  background: var(--app-primary);
}

.app-topbar__title {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  line-height: 1.25;
}

.app-topbar__title strong {
  overflow: hidden;
  color: #183b65;
  font-size: clamp(0.95rem, 1.5vw, 1.12rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-topbar__title small {
  color: var(--app-muted);
  font-size: 0.78rem;
}

.app-topbar__role {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.65rem;
  border: 1px solid #cfe0f3;
  border-radius: 999px;
  color: #245381;
  background: #eef6ff;
  font-size: 0.8rem;
  font-weight: 700;
}

.app-sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1040;
  background: rgba(15, 23, 42, 0.52);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

body.sidebar-collapsed .app-sidebar {
  transform: translateX(-105%);
}

body.has-app-sidebar .table-scroll-tools {
  top: 5.35rem;
}

body.has-app-sidebar .position-fixed.bottom-0.start-0.btn {
  left: calc(var(--app-sidebar-width) + 0.85rem) !important;
  bottom: 0.85rem !important;
  transition: left 0.22s ease;
}

body.has-app-sidebar.sidebar-collapsed .position-fixed.bottom-0.start-0.btn {
  left: 0.85rem !important;
}

/* Page structure */
body > .container-fluid.py-3.text-center,
.page-heading {
  padding-top: clamp(1.6rem, 3vw, 2.5rem) !important;
  padding-bottom: 0.85rem !important;
}

body > .container-fluid.py-3.text-center h3,
.page-heading h1,
.page-heading h2,
.page-heading h3,
.container > .text-center h3,
.container > .text-center h4 {
  color: #183b65;
  font-size: clamp(1.35rem, 2.4vw, 1.8rem);
  font-weight: 750;
  letter-spacing: -0.015em;
}

.text-muted {
  color: var(--app-muted) !important;
}

.small,
small {
  font-size: 0.84rem;
}

hr {
  border-color: var(--app-border);
  opacity: 1;
}

/* Cards and panels */
.card,
.container-md.bg-light,
.container-md.bg-white,
.container.bg-light {
  border: 1px solid var(--app-border) !important;
  border-radius: var(--app-radius) !important;
  background: var(--app-surface) !important;
  box-shadow: var(--app-shadow) !important;
}

.card {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.card-body {
  min-width: 0;
  padding: clamp(1.1rem, 2.5vw, 1.5rem);
  overflow-wrap: anywhere;
}

.card-header {
  padding: 0.9rem 1.25rem;
  border-bottom-color: var(--app-border);
  font-weight: 700;
}

.card-title {
  color: #1f4f82;
  font-weight: 750;
}

.shadow-sm,
.shadow {
  box-shadow: var(--app-shadow) !important;
}

.border,
.border-primary,
.border-info {
  border-color: var(--app-border) !important;
}

.rounded {
  border-radius: var(--app-radius) !important;
}

/* Forms */
.form-label {
  margin-bottom: 0.45rem;
  color: #334155;
  font-size: 0.9rem;
  font-weight: 650;
}

.form-control,
.form-select {
  min-width: 0;
  max-width: 100%;
  min-height: 2.85rem;
  border-color: #cbd7e5;
  border-radius: 0.7rem;
  background-color: #fff;
  color: var(--app-text);
  font-size: 1rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

textarea.form-control {
  min-height: 6.5rem;
  line-height: 1.5;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: #4d8cd0;
  box-shadow: 0 0 0 0.22rem rgba(31, 95, 174, 0.16);
}

.form-check-input {
  width: 1.15rem;
  height: 1.15rem;
  border-color: #9fb0c5;
}

.form-text {
  margin-top: 0.42rem;
  color: var(--app-muted) !important;
  font-size: 0.82rem;
}

input[type="file"].form-control {
  padding: 0.45rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.65rem;
  padding: 0.55rem 1rem;
  border-radius: 0.68rem;
  font-weight: 650;
  line-height: 1.2;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.06);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.row > * {
  min-width: 0;
}

.app-actions,
.page-toolbar {
  display: flex;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  gap: 0.65rem;
}

.app-actions {
  flex-wrap: wrap;
}

.app-actions .btn {
  flex: 0 1 auto;
  margin: 0 !important;
}

.page-toolbar {
  flex-wrap: wrap;
  justify-content: space-between;
}

.page-toolbar > :first-child {
  min-width: 0;
}

.page-toolbar > .btn {
  flex: 0 1 auto;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 5px 12px rgba(15, 23, 42, 0.12);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn-sm {
  min-height: 2.35rem;
  padding: 0.45rem 0.72rem;
  font-size: 0.84rem;
}

.btn-primary {
  --bs-btn-bg: var(--app-primary);
  --bs-btn-border-color: var(--app-primary);
  --bs-btn-hover-bg: var(--app-primary-dark);
  --bs-btn-hover-border-color: var(--app-primary-dark);
  --bs-btn-active-bg: var(--app-primary-dark);
  --bs-btn-active-border-color: var(--app-primary-dark);
}

.btn-info {
  --bs-btn-bg: #dbeafe;
  --bs-btn-border-color: #bfdbfe;
  --bs-btn-color: #174a88;
  --bs-btn-hover-bg: #bfdbfe;
  --bs-btn-hover-border-color: #93c5fd;
  --bs-btn-hover-color: #123a6b;
}

.btn-warning {
  --bs-btn-bg: #f5c451;
  --bs-btn-border-color: #f5c451;
  --bs-btn-color: #4a3505;
  --bs-btn-hover-bg: #eab53b;
  --bs-btn-hover-border-color: #eab53b;
  --bs-btn-hover-color: #342400;
}

.btn-danger {
  --bs-btn-bg: var(--app-danger);
  --bs-btn-border-color: var(--app-danger);
  --bs-btn-hover-bg: #8f1c13;
  --bs-btn-hover-border-color: #8f1c13;
}

.btn:focus-visible,
.nav-link:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(31, 95, 174, 0.32);
  outline-offset: 2px;
}

/* Tables */
.table-responsive {
  overflow-x: auto;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: #fff;
  box-shadow: var(--app-shadow);
  scrollbar-color: #a9bbce transparent;
}

.table-scroll-shell {
  position: relative;
  min-width: 0;
}

.table-scroll-tools {
  position: sticky;
  top: 0.65rem;
  z-index: 1015;
  display: grid;
  grid-template-columns: auto minmax(10rem, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  width: min(100%, var(--table-scroll-width, 100%));
  margin: 0 auto 0.65rem;
  padding: 0.6rem;
  border: 1px solid #cbd9e8;
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 22px rgba(31, 73, 125, 0.16);
  backdrop-filter: blur(8px);
}

.table-scroll-tools[hidden] {
  display: none !important;
}

.table-scroll-range-wrap {
  display: grid;
  grid-template-columns: auto minmax(6rem, 1fr);
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  color: #40556d;
  font-size: 0.82rem;
  font-weight: 700;
}

.table-scroll-range {
  width: 100%;
  min-height: 2rem;
  accent-color: var(--app-primary);
  cursor: grab;
}

.table-scroll-range:active {
  cursor: grabbing;
}

.table-responsive.has-horizontal-overflow .table > thead > tr > *:last-child,
.table-responsive.has-horizontal-overflow .table > tbody > tr > *:last-child {
  position: sticky;
  right: 0;
  z-index: 3;
  background-color: #fff;
  box-shadow: -8px 0 12px -12px rgba(15, 23, 42, 0.65);
}

.table-responsive.has-horizontal-overflow .table > thead > tr > *:last-child {
  z-index: 4;
  background-color: #e9f1fb;
}

.table-responsive.has-horizontal-overflow .table-striped > tbody > tr:nth-of-type(odd) > *:last-child {
  background-color: #f7f9fc;
}

.table-responsive > .table {
  min-width: 720px;
  margin-bottom: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.table-responsive > .table:has(th:nth-child(8)) {
  min-width: 1100px;
}

.table {
  --bs-table-bg: transparent;
  --bs-table-striped-bg: #f7f9fc;
  --bs-table-hover-bg: #edf4fc;
  margin-bottom: 0;
  color: #24364b;
  font-size: 0.875rem !important;
  vertical-align: middle;
}

.table > :not(caption) > * > * {
  padding: 0.72rem 0.75rem;
  border-color: #e3eaf2;
}

.table thead,
.table-primary {
  --bs-table-bg: #e9f1fb;
  --bs-table-color: #1d456f;
  --bs-table-border-color: #d2dfed;
}

.table thead th {
  font-size: 0.8rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  vertical-align: middle;
  white-space: nowrap;
}

.table tbody tr {
  transition: background-color 0.15s ease;
}

.table td,
.table th {
  max-width: 20rem;
  overflow-wrap: normal;
  word-break: normal;
}

.badge {
  padding: 0.45em 0.65em;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}

/* Verification status colours */
.status-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  color: var(--app-muted);
  font-size: 0.82rem;
}

.status-legend__label {
  margin-right: 0.2rem;
  font-weight: 700;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.8rem;
  padding: 0.32rem 0.65rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
}

.status-badge--success {
  border-color: #9fd8b5;
  color: #166534;
  background: #dcfce7;
}

.status-badge--warning {
  border-color: #e9cf76;
  color: #795500;
  background: #fff5c2;
}

.status-badge--info {
  border-color: #9cccf0;
  color: #155b8d;
  background: #e0f2fe;
}

.status-badge--danger {
  border-color: #efb0aa;
  color: #991b1b;
  background: #fee2e2;
}

.status-badge--neutral {
  border-color: #cbd5e1;
  color: #475569;
  background: #f1f5f9;
}

.table > tbody > tr.status-row--success {
  --status-row-bg: #e7f7ed;
  --status-row-hover: #d7f0e0;
}

.table > tbody > tr.status-row--warning {
  --status-row-bg: #fff7d6;
  --status-row-hover: #ffefb3;
}

.table > tbody > tr.status-row--info {
  --status-row-bg: #e8f6ff;
  --status-row-hover: #d4edff;
}

.table > tbody > tr.status-row--danger {
  --status-row-bg: #ffebe9;
  --status-row-hover: #ffdad6;
}

.table > tbody > tr.status-row--neutral {
  --status-row-bg: #f1f5f9;
  --status-row-hover: #e5ebf1;
}

.table > tbody > tr.status-row > * {
  --bs-table-bg-type: var(--status-row-bg);
  --bs-table-bg-state: var(--status-row-bg);
  background-color: var(--status-row-bg) !important;
  box-shadow: inset 0 0 0 9999px var(--status-row-bg) !important;
}

.table > tbody > tr.status-row:hover > * {
  --bs-table-bg-type: var(--status-row-hover);
  --bs-table-bg-state: var(--status-row-hover);
  background-color: var(--status-row-hover) !important;
  box-shadow: inset 0 0 0 9999px var(--status-row-hover) !important;
}

/* Alerts and dialogs */
.alert {
  border-width: 1px;
  border-radius: 0.8rem;
}

.alert-danger {
  color: #7a271a;
  border-color: #f4c7c3;
  background: #fff2f0;
}

.alert-warning {
  color: #694c00;
  border-color: #f2d694;
  background: #fff8e6;
}

.modal-content {
  overflow: hidden;
  border: 1px solid var(--app-border);
  border-radius: 1rem;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
}

.modal-header,
.modal-footer {
  border-color: var(--app-border);
}

/* Progress/timeline cards */
.timeline {
  border-color: var(--app-border) !important;
  border-radius: var(--app-radius) !important;
  box-shadow: var(--app-shadow);
}

.timeline .card {
  box-shadow: none !important;
}

.timeline .card.border-success {
  border-color: #5ab39b !important;
  box-shadow: inset 0 3px 0 #2f9b7e !important;
}

.timeline > .d-flex.flex-md-row {
  flex-wrap: wrap;
}

.timeline > .d-flex.flex-md-row > .flex-fill {
  flex: 1 1 15rem !important;
}

.progress {
  overflow: hidden;
  border-radius: 999px;
  background: #e4ebf3;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
}

.progress-bar {
  background: linear-gradient(90deg, var(--app-primary), #2f8cce);
  font-size: 0.76rem;
  font-weight: 750;
}

/* Long data-entry pages */
body > div.container.my-4 > form,
body > div.container.my-5 > form {
  padding: clamp(1rem, 3vw, 1.75rem);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: #fff;
  box-shadow: var(--app-shadow);
}

body > div.container.my-4 > h4,
body > div.container.my-5 > h2,
body > div.container.my-5 > h3 {
  color: #183b65;
  font-weight: 750;
}

.section-icon {
  display: inline-grid;
  width: 2rem;
  height: 2rem;
  margin-right: 0.35rem !important;
  place-items: center;
  border-radius: 0.55rem;
  background: var(--app-primary-soft);
  font-size: 1rem !important;
}

.input-group-text {
  min-width: 2.85rem;
  justify-content: center;
  border-color: #cbd7e5;
  border-radius: 0.7rem 0 0 0.7rem;
}

/* Persistent list filter */
.filter-panel {
  padding: clamp(1rem, 2.5vw, 1.4rem);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: #fff;
  box-shadow: var(--app-shadow);
}

.filter-panel__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.filter-panel__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.2rem;
  color: #183b65;
  font-size: 1rem;
  font-weight: 750;
}

.filter-panel__help {
  color: var(--app-muted);
  font-size: 0.84rem;
}

.filter-panel__status {
  flex: 0 0 auto;
  padding: 0.38rem 0.65rem;
  border: 1px solid var(--app-border);
  border-radius: 999px;
  color: #526579;
  background: #f7f9fc;
  font-size: 0.78rem;
  font-weight: 700;
}

.filter-panel__status.is-active {
  border-color: #9ec5ee;
  color: var(--app-primary-dark);
  background: var(--app-primary-soft);
}

.filter-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.filter-panel__actions .btn {
  flex: 1 1 10rem;
}

.filter-panel__selection {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1rem;
  padding: 0.65rem 0.8rem;
  border-radius: 0.65rem;
  color: #315879;
  background: #eef5fc;
  font-size: 0.86rem;
}

/* Footer */
footer {
  margin-top: 3rem !important;
  padding: 1.25rem 1rem !important;
  border-top: 1px solid var(--app-border);
  color: var(--app-muted);
  background: rgba(255, 255, 255, 0.7);
}

footer small {
  font-size: 0.8rem;
}

@media (max-width: 1199.98px) {
  body.has-app-sidebar,
  body.has-app-sidebar.sidebar-collapsed {
    padding-left: 0;
  }

  .app-sidebar,
  body.sidebar-collapsed .app-sidebar {
    width: min(86vw, 18rem);
    transform: translateX(-105%);
    box-shadow: 12px 0 34px rgba(15, 23, 42, 0.28);
  }

  body.sidebar-mobile-open {
    overflow: hidden;
  }

  body.sidebar-mobile-open .app-sidebar {
    transform: translateX(0);
  }

  body.sidebar-mobile-open .app-sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .app-topbar {
    min-height: 4.25rem;
  }

  body.has-app-sidebar .position-fixed.bottom-0.start-0.btn,
  body.has-app-sidebar.sidebar-collapsed .position-fixed.bottom-0.start-0.btn {
    left: 0.85rem !important;
  }

}

@media (max-width: 991.98px) {
  .app-navbar--staff .navbar-collapse {
    margin-top: 0.65rem;
    padding: 0.8rem;
    border: 1px solid var(--app-border);
    border-radius: 0.8rem;
    background: #fff;
    box-shadow: var(--app-shadow);
  }

  .app-navbar--staff .app-user {
    flex-wrap: wrap;
    margin-top: 0.55rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--app-border);
  }
}

@media (max-width: 767.98px) {
  .app-navbar--student .navbar-collapse {
    margin-top: 0.65rem;
    padding: 0.8rem;
    border: 1px solid var(--app-border);
    border-radius: 0.8rem;
    background: #fff;
    box-shadow: var(--app-shadow);
  }

  .app-navbar--student .app-user {
    flex-wrap: wrap;
    margin-top: 0.55rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--app-border);
  }
}

.bulk-column-guide {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.bulk-column-guide span {
  padding: 0.35rem 0.65rem;
  color: #334155;
  background: #f1f5f9;
  border: 1px solid #dbe3ed;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

#dataPukal {
  min-height: 14rem;
  white-space: pre;
  overflow: auto;
}

@media (max-width: 767.98px) {
  .container,
  .container-md,
  .container-lg,
  .container-xl {
    --bs-gutter-x: 1.25rem;
  }

  .app-header__inner {
    justify-content: flex-start;
  }

  .app-header__icon {
    width: 2.45rem;
    height: 2.45rem;
    font-size: 1.15rem;
  }

  .app-header h1,
  .app-header h2,
  .app-header h3,
  .bgg h1,
  .bgg h2,
  .bgg h3 {
    font-size: 1rem;
  }

  .app-header__subtitle {
    font-size: 0.78rem;
  }

  .card-body {
    padding: 1rem;
  }

  .container-md.bg-light,
  .container-md.bg-white,
  .container.bg-light {
    padding: 1rem !important;
  }

  .table {
    font-size: 0.84rem !important;
  }

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

  .btn {
    min-height: 2.75rem;
  }

  .d-flex.justify-content-between:not(.navbar .d-flex) {
    gap: 0.7rem;
  }

  .position-fixed.bottom-0.start-0.btn,
  body.has-app-sidebar .position-fixed.bottom-0.start-0.btn,
  body.has-app-sidebar.sidebar-collapsed .position-fixed.bottom-0.start-0.btn {
    position: relative !important;
    inset: auto !important;
    width: calc(100% - 1.5rem);
    margin: 0.75rem !important;
  }

  .timeline > .d-flex.flex-md-row > .flex-fill {
    flex-basis: 100% !important;
  }

  .filter-panel__heading {
    align-items: stretch;
    flex-direction: column;
    gap: 0.65rem;
  }

  .filter-panel__status {
    align-self: flex-start;
  }

  .filter-panel__actions {
    flex-direction: column;
  }

  .app-actions,
  .page-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .app-actions .btn,
  .page-toolbar > .btn {
    width: 100%;
  }

  .filter-panel__selection {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .table-scroll-tools {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    padding: 0.5rem;
  }

  .table-scroll-range-wrap {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .table-scroll-tools .btn {
    min-height: 2.35rem;
  }

  .status-legend {
    align-items: flex-start;
  }

  form .btn.ms-2 {
    margin-top: 0.6rem;
    margin-left: 0 !important;
  }

  footer {
    margin-top: 2rem !important;
  }
}

@media (max-width: 575.98px) {
  .app-topbar {
    gap: 0.65rem;
    padding-inline: 0.75rem;
  }

  .app-topbar__role {
    display: none;
  }

  .app-topbar__title strong {
    font-size: 0.9rem;
  }

  .app-user {
    align-items: stretch;
  }

  .app-user__chip {
    flex: 1 1 100%;
    border-radius: 0.65rem;
  }

  form .btn:not(.btn-sm),
  .card-body > .text-center .btn,
  .mt-4.d-flex.justify-content-between .btn {
    width: 100%;
  }

  .mt-4.d-flex.justify-content-between {
    flex-direction: column-reverse;
  }
}

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

@media print {
  .navbar,
  .app-header,
  .bgg,
  .app-sidebar,
  .app-sidebar-backdrop,
  .app-topbar,
  footer,
  .btn {
    display: none !important;
  }

  body {
    padding-left: 0 !important;
    background: #fff !important;
  }

  .card,
  .table-responsive {
    border: 0 !important;
    box-shadow: none !important;
  }
}
