@import url("https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&family=Lora:wght@400;600;700&display=swap");
:root {
  --primary: #003A35;
  --secondary: #719A73;
  --accent: #1F73C2;
  --text: #001F27;
  --sage: var(--secondary);
  --evergreen: var(--primary);
  --ink: var(--text);
  --marine: var(--accent);
  --sage-pale: #eef4ee;
  --sage-soft: #dce8dd;
  --sage-mid: #b8cdb9;
  --marine-soft: #d4e5f6;
  --bg: #eef4ee;
  --panel: #003A35;
  --muted: #d4e0d5;
  --panel-text: #eef4ee;
  --accent-2: #003A35;
  --danger: #c7522a;
  --warning: #d97706;
  --header-height: 96px;
  --sb-track-color: #d4e0d5;
  --sb-thumb-color: var(--secondary);
  --sb-size: 13px;
  --table-font-size: 12px;
  --table-head-font-size: 11px;
  --table-cell-pad-y: 5px;
  --table-cell-pad-x: 6px;
  --table-line-height: 1.28;
}

/* Per-tabel tekstgroottes (A− / A+), gezet via data-table-size op .table-wrap */
.table-wrap[data-table-size="0"] {
  --table-font-size: 12px;
  --table-head-font-size: 11px;
  --table-cell-pad-y: 5px;
  --table-cell-pad-x: 6px;
  --table-line-height: 1.28;
}
.table-wrap[data-table-size="1"] {
  --table-font-size: 13px;
  --table-head-font-size: 12px;
  --table-cell-pad-y: 6px;
  --table-cell-pad-x: 7px;
  --table-line-height: 1.3;
}
.table-wrap[data-table-size="2"] {
  --table-font-size: 15px;
  --table-head-font-size: 14px;
  --table-cell-pad-y: 8px;
  --table-cell-pad-x: 9px;
  --table-line-height: 1.34;
}
.table-wrap[data-table-size="3"] {
  --table-font-size: 17px;
  --table-head-font-size: 16px;
  --table-cell-pad-y: 10px;
  --table-cell-pad-x: 11px;
  --table-line-height: 1.38;
}

.table-size-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
  margin: 0;
  padding: 0 0 8px 0;
}
.table-size-btn {
  min-width: 44px;
  min-height: 40px;
  padding: 6px 12px;
  font-weight: 800;
  font-size: 15px;
  line-height: 1.1;
}

/* A+/A− naast bestaande knoppen (zelfde flex-rij) */
.controls > .table-size-toolbar,
.filters > .table-size-toolbar,
.students-toolbar > .table-size-toolbar {
  margin-left: auto;
  margin-bottom: 0;
  padding: 0;
  align-self: center;
}

* {
  box-sizing: border-box;
}
html {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  height: 100%;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family:
    "Cairo",
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Noto Sans",
    Arial,
    sans-serif;
}

/* Ensure Cairo is used on all common UI elements */
body,
input,
select,
textarea,
button,
a,
th,
td,
label,
.card,
.header,
.nav,
.footer,
.login-card,
.login-fields,
.container {
  font-family:
    "Cairo",
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Noto Sans",
    Arial,
    sans-serif;
}
/* Accessible visually-hidden helper */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link visible on focus */
.skip-link {
  position: absolute;
  left: 8px;
  top: 8px;
  background: #003A35;
  color: #eef4ee;
  padding: 8px 12px;
  border-radius: 6px;
  z-index: 999;
  transform: translateY(-110%);
  transition: transform 0.18s ease;
}
.skip-link:focus {
  transform: translateY(0);
}
.container {
  width: 100%;
  margin: 0 auto;
  padding:  0 2%;
}

/* Alle Leerlingen: toolbar + popup formulier */
.students-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-bottom: 12px;
}
.students-import-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.students-import-status {
  font-size: 13px;
  color: #003A35;
  min-width: 0;
}

.students-add-modal {
  position: fixed;
  inset: 0;
  z-index: 3200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}
.students-add-modal:not([hidden]) {
  display: flex;
}
.students-add-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 31, 39, 0.5);
  cursor: pointer;
}
.students-add-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: min(92vh, 900px);
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid rgba(0, 31, 39, 0.12);
  border-radius: 14px;
  box-shadow: 0 22px 60px rgba(0, 31, 39, 0.28);
  overflow: hidden;
}
.students-add-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(0, 31, 39, 0.08);
  background: #dce8dd;
}
.students-add-panel-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #001F27;
}
.students-add-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
  padding: 16px 18px 8px 18px;
}
.students-add-form--scroll {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}
.students-add-section-title {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0 0 4px 0;
  font-size: 14px;
  font-weight: 700;
  color: #001F27;
  border-bottom: 1px solid rgba(0, 58, 53, 0.12);
}
.students-add-section-title:not(:first-of-type) {
  margin-top: 8px;
  padding-top: 0;
}
.students-add-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.students-add-field label {
  font-size: 13px;
  font-weight: 600;
  color: #001F27;
}
.students-add-field input {
  width: 100%;
  margin: 0;
}
.students-add-field--full {
  grid-column: 1 / -1;
}
.students-add-fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.students-add-fieldset-legend {
  font-size: 13px;
  font-weight: 600;
  color: #001F27;
  padding: 0;
  margin-bottom: 4px;
}
.students-gender-radios {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  align-items: center;
}
.students-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  color: #001F27;
}
.students-radio-label input {
  width: auto;
  margin: 0;
  accent-color: #003A35;
}
.students-add-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 18px 18px 18px;
  flex-shrink: 0;
  border-top: 1px solid rgba(0, 31, 39, 0.06);
  padding-top: 16px;
  background: #ffffff;
}
@media (max-width: 640px) {
  .students-add-form {
    grid-template-columns: 1fr;
  }
  .students-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .students-import-inline {
    flex-direction: column;
    align-items: stretch;
  }
  .students-add-modal-dialog {
    max-height: 100%;
  }
}

#pageContent,
.page-scroll,
.container,
.layout,
.content,
.table-wrap {
  min-width: 0;
  max-width: 100%;
}
#appHeader {
  flex: 0 0 auto;
  padding: 14px 18px 10px;
  background: var(--bg);
  z-index: 100;
}
.header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 0;
  background: transparent;
  border: none;
  flex: 0 0 auto;
  position: relative;
  z-index: 100;
  gap: 14px;
  box-shadow: none;
  flex-wrap: nowrap;
  width: 100%;
}

/* Main scroll area below header: scrollbar does not extend into the header strip */
.page-scroll {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}

/* main.container grows to fill .page-scroll so .footer always sits at the bottom,
   even when page content is short (e.g. teacher view with sections hidden) */
.page-scroll > main.container {
  flex: 1 0 auto;
}

.page-scroll::-webkit-scrollbar {
  width: var(--sb-size);
}

.page-scroll::-webkit-scrollbar-track {
  background: var(--sb-track-color);
  border-radius: 15px;
}

.page-scroll::-webkit-scrollbar-thumb {
  background: var(--sb-thumb-color);
  border-radius: 15px;
  border: 3px solid var(--sb-track-color);
}

@supports not selector(::-webkit-scrollbar) {
  .page-scroll {
    scrollbar-color: var(--sb-thumb-color) var(--sb-track-color);
  }
}

.header-brand {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 72px;
  padding: 8px 22px 8px 10px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 12px 28px rgba(0, 58, 53, 0.22);
}
.header .title {
  font-size: 20px;
  font-weight: 700;
  color: var(--panel-text);
  flex: 0 0 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
  letter-spacing: -0.02em;
}

/* Hamburger menu button */
.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin: 0;
  border-radius: 6px;
  transition: background 160ms ease;
  order: 0;
  overflow: visible;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  flex-shrink: 0;
}

.hamburger:hover {
  background: rgba(255, 255, 255, 0.15);
}

.hamburger:focus {
  outline: 2px solid rgba(255, 255, 255, 0.3);
  outline-offset: 2px;
}

.hamburger-line {
  width: 24px;
  height: 3px;
  background: var(--panel-text);
  transition:
    transform 300ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
    opacity 300ms ease,
    background-color 300ms ease;
  border-radius: 2px;
  transform-origin: center center;
  flex-shrink: 0;
}

.hamburger.active .hamburger-line:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
  width: 24px;
}

.hamburger.active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: translateX(-10px);
  width: 24px;
}

.hamburger.active .hamburger-line:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
  width: 24px;
}

.nav-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 200;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  width: min(320px, calc(100vw - 36px));
  max-height: min(70vh, 560px);
  overflow-x: hidden;
  overflow-y: auto;
  background: #fff;
  border-radius: 18px;
  padding: 8px;
  box-shadow: 0 16px 40px rgba(0, 31, 39, 0.16);
}

.nav-menu.open {
  display: flex;
}

body.nav-open .page-scroll {
  overflow: auto;
}

.nav-menu a,
.nav-menu a.nav-tab {
  color: #001F27;
  text-decoration: none;
  padding: 8px 10px;
  border: none;
  background: transparent;
  transition: background 160ms ease, color 160ms ease;
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  border-left: none;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-width: 0;
  width: 100%;
  border-radius: 12px;
}

.nav-tab-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid rgba(0, 31, 39, 0.06);
  box-shadow: 0 4px 12px rgba(0, 31, 39, 0.08);
  font-size: 18px;
  line-height: 1;
  overflow: hidden;
}
.app-icon,
.nav-tab-svg {
  width: 22px;
  height: 22px;
  display: inline-block;
  vertical-align: middle;
  pointer-events: none;
  background-color: var(--panel);
  -webkit-mask-image: var(--icon);
  mask-image: var(--icon);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center 28%;
  mask-position: center 28%;
  -webkit-mask-size: cover;
  mask-size: cover;
}
.app-icon--inline {
  width: 16px;
  height: 16px;
  margin-right: 4px;
}
h1[data-app-icon],
h2[data-app-icon],
h3[data-app-icon] {
  display: flex;
  align-items: center;
  gap: 10px;
}
h1[data-app-icon] .app-icon,
h2[data-app-icon] .app-icon {
  width: 26px;
  height: 26px;
}
button .app-icon {
  width: 16px;
  height: 16px;
  margin-right: 4px;
}

.nav-tab-label {
  max-width: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-menu a:hover {
  background: #eef4ee;
  padding-left: 10px;
  border-left-color: transparent;
  color: #003A35;
}

.nav-menu a:hover .nav-tab-icon {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(0, 31, 39, 0.12);
}

.nav-menu a:active {
  background: #eef4ee;
}

.nav-menu a.active,
.nav-menu a[aria-current="page"] {
  background: #eef4ee;
  border-left: none;
  padding-left: 10px;
  font-weight: 700;
  color: #003A35;
}

.nav-menu a.active .nav-tab-icon,
.nav-menu a[aria-current="page"] .nav-tab-icon {
  background: #003A35;
  border-color: #003A35;
  color: #eef4ee;
  box-shadow: 0 8px 18px rgba(0, 58, 53, 0.28);
}
.nav-menu a.active .nav-tab-svg,
.nav-menu a[aria-current="page"] .nav-tab-svg,
.nav-menu a.active .app-icon,
.nav-menu a[aria-current="page"] .app-icon {
  background-color: #eef4ee;
}

.nav-menu a.disabled {
  opacity: 1;
  cursor: default;
}

.nav-menu a:nth-child(8n)::after {
  content: none;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.card {
  background: var(--primary);
  padding: 20px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 8px 30px rgba(0, 31, 39, 0.06);
  cursor: pointer;
  color: var(--panel-text);
}
.card h3 {
  margin: 0 0 8px 0;
}
.card p {
  margin: 0;
  color: #719A73;
}

.card h3,
.card p {
  color: var(--panel-text) !important; /* light text on dark panel */
}

.card,
.card:visited,
.card:hover,
.card:active {
  text-decoration: none !important;
  color: inherit;
}

.card:hover {
  background: var(--secondary);
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  table-layout: fixed;
}
.table th,
.table td {
  padding: var(--table-cell-pad-y) var(--table-cell-pad-x);
  border-bottom: 1px solid rgba(0, 58, 53, 0.04);
  text-align: left;
  font-size: var(--table-font-size);
  line-height: var(--table-line-height);
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  min-width: 0;
  vertical-align: middle;
}
.table th {
  background: #eef4ee;
  color: #001F27;
  font-weight: 700;
  font-size: var(--table-head-font-size);
  letter-spacing: 0.02em;
  text-transform: none;
}
.table tr:hover td {
  background: #dce8dd;
}
.table input,
.table select,
.table textarea,
.table button {
  max-width: 100%;
  font-size: inherit;
}
.table button.secondary,
.table button.primary {
  padding: 4px 8px;
  font-size: var(--table-font-size);
  line-height: 1.25;
}
.table select.att-status {
  padding: 3px 8px;
  min-height: calc(var(--table-font-size) * 2.1);
  font-size: var(--table-font-size);
  font-weight: 700;
}

/* Keep all data tables in LTR even when the page is RTL (e.g., Arabic). */
html[dir="rtl"] .table-wrap,
html[dir="rtl"] .table,
html[dir="rtl"] table {
  direction: ltr;
}
html[dir="rtl"] .table th,
html[dir="rtl"] .table td,
html[dir="rtl"] table th,
html[dir="rtl"] table td {
  text-align: left;
}
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}
.controls > * {
  min-width: 0;
  max-width: 100%;
}
input,
select,
button {
  background: #ffffff;
  color: var(--text);
  border: 1px solid rgba(0, 31, 39, 0.06);
  border-radius: 10px;
  padding: 10px 12px;
  transition:
    box-shadow 180ms ease,
    border-color 180ms ease,
    transform 120ms ease;
}

/* Attendance status colors (Klassen): color the select box itself */
select.att-status {
  font-weight: 700;
  border-width: 2px;
}
select.att-status.att-status--aanwezig {
  background: #dce8dd;
  border-color: #719A73;
}
select.att-status.att-status--afwezig {
  background: #fee2e2;
  border-color: #dc2626;
}
select.att-status.att-status--afwezig-gemeld {
  background: #ffedd5;
  border-color: #f97316;
}
select.att-status.att-status--te-laat {
  background: #fef9c3;
  border-color: #ca8a04;
}
select.att-status.att-status--vakantie {
  background: var(--marine-soft);
  border-color: var(--marine);
}
button.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  font-weight: 700;
  padding: 10px 16px;
  box-shadow: 0 10px 24px rgba(0, 58, 53, 0.18);
}
button.secondary {
  background: #ffffff;
  border-color: rgba(0, 31, 39, 0.12);
  color: var(--accent-2);
  font-weight: 600;
}
button.danger {
  background: var(--danger);
  border-color: #b91c1c;
  color: #ffffff;
}
.badge {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
}
.badge.present {
  background: #003A35;
  color: #dce8dd;
}
.badge.absent {
  background: #3f1d1d;
  color: #fecaca;
}
.badge.late {
  background: #422006;
  color: #fed7aa;
}
.footer {
  text-align: center;
  padding: 14px 24px;
  color: #719A73;
  font-size: 13px;
  border-top: 1px solid rgba(0, 31, 39, 0.06);
}
/* Login overlay styles */
.login-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  background: rgba(0, 31, 39, 0.55);
}
.login-overlay[aria-hidden="true"] {
  display: none;
}
.login-card {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 14px;
  padding: 24px;
  width: 320px;
  max-width: 92%;
  text-align: center;
  box-shadow: 0 14px 50px rgba(0, 31, 39, 0.45);
}
.login-card .school-name {
  font-weight: 700;
  margin: 8px 0 8px 0;
  font-size: 15px;
  color: var(--text);
}
.logo {
  width: 110px;
  height: 110px;
  margin: 0 auto 12px auto;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 40px;
  box-shadow: 0 8px 30px rgba(0, 58, 53, 0.12);
  position: relative;
  overflow: hidden;
}
.logo img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0;
  filter: drop-shadow(0 6px 18px rgba(0, 58, 53, 0.18));
}
.login-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: center;
  max-width: 260px;
  margin: 0 auto;
}
.login-fields input {
  width: 100%;
  margin: 6px 0;
}
.login-fields button {
  width: 100%;
  flex: 0;
}

@keyframes logoPop {
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* blur page content when overlay active */
#pageContent.blurred {
  filter: blur(6px) grayscale(0.02);
  pointer-events: none;
  user-select: none;
}

/* Layout for Classes and Grades pages */
.layout {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  gap: 16px;
}
.side {
  background: #dce8dd;
  border-radius: 12px;
  padding: 12px 0;
  border: 1px solid var(--muted);
  max-height: 600px;
  overflow-y: auto;
  min-width: 0;
}
.side > div:first-child {
  padding: 8px 12px;
  opacity: 0.7;
  font-size: 13px;
}
.item {
  cursor: pointer;
  padding: 8px 16px;
  border-left: 3px solid transparent;
  color: var(--text);
  transition: 0.15s;
}
.item:hover {
  background: #e6eee9;
}
.item.active {
  border-left-color: var(--secondary);
  background: #dce8dd;
  font-weight: 600;
  color: var(--text);
}
.side .item {
  display: block;
  width: 100%;
  box-sizing: border-box;
}
.content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Header user info area */
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex: 0 0 auto;
  min-width: 0;
  order: 4;
}

.presence-link {
  display: inline-flex;
  align-items: center;
  background: #fff;
  color: #003A35;
  border: 1px solid rgba(0, 31, 39, 0.06);
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 31, 39, 0.06);
  white-space: nowrap;
}
.presence-link:hover {
  background: #eef4ee;
}
.presence-link[hidden] {
  display: none !important;
}

.user-chip {
  max-width: 140px;
  background: #fff;
  color: #003A35;
  border: 1px solid rgba(0, 31, 39, 0.06);
  box-shadow: 0 4px 12px rgba(0, 31, 39, 0.06);
}

#logoutBtn {
  background: #003A35;
  color: #eef4ee;
  border: none;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-block;
  box-shadow: 0 6px 16px rgba(0, 58, 53, 0.2);
}
#logoutBtn:hover {
  background: #001F27;
}
#langSelect.lang-select {
  background: #fff;
  color: #003A35;
  border: 1px solid rgba(0, 31, 39, 0.08);
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 12px;
  min-width: 62px;
  box-shadow: 0 4px 12px rgba(0, 31, 39, 0.06);
}
#langSelect.lang-select option {
  color: #001F27;
}

@media (max-width: 900px) {
  .container {
    padding: 12px;
  }
  .card-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

@media (max-width: 640px) {
  .layout {
    grid-template-columns: 1fr;
  }
  /* When on mobile, use the transposed layout — hide the original table so header/body aren't duplicated */
  #gradesTable {
    display: none !important;
  }
  #gradesTransposed {
    display: flex !important;
  }
  .side {
    max-height: 160px;
    overflow-x: auto;
    display: flex;
    gap: 6px;
    padding: 8px;
  }
  .side .item {
    flex: 0 0 auto;
    padding: 8px 10px;
    white-space: nowrap;
  }
  .item {
    padding: 10px 12px;
  }

  /* Ensure teacher select (mobile) doesn't force horizontal scrolling */
  .side select {
    width: 100%;
    min-width: 0;
  }

  /* Truncate long inline labels to avoid breaking layout */
  .side .item {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Make tables fit on small screens and avoid forcing wide min-width */
  .table-wrap .table {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  /* Mobile day selector wrapper styling */
  .mobile-day-wrap {
    display: flex;
    width: 100%;
    gap: 8px;
    align-items: center;
  }
  .mobile-day-wrap span {
    min-width: 48px;
    font-weight: 600;
    color: var(--text);
  }
  .mobile-day-wrap select {
    flex: 1;
    min-width: 0;
  }

  /* Controls: stack inputs full width and increase tap targets */
  .controls {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .controls input,
  .controls select,
  .controls button {
    width: 100%;
    min-height: 44px;
  }
  button.primary,
  .controls .primary {
    padding: 12px 16px;
    font-size: 15px;
  }

  /* Tables: scroll alleen binnen .table-scroll */
  .table-wrap {
    max-height: 60vh;
    overflow: hidden;
  }
  .table-wrap > .table-scroll {
    -webkit-overflow-scrolling: touch;
  }
  .table-wrap .table {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
  .table {
    display: table;
    width: 100%;
  }
  .table-wrap .table thead th {
    font-size: var(--table-head-font-size);
  }

  /* Niveau mobile: align site header and table header closely */
  #gradesTable {
    margin-top: 0;
  }
  #gradesTable th,
  #gradesTable td {
    font-size: var(--table-font-size);
    padding: var(--table-cell-pad-y) var(--table-cell-pad-x);
  }
  #gradesTable thead th {
    font-size: var(--table-head-font-size);
  }
  /* Sticky row at top of scroll area (site header is outside .page-scroll) */
  #gradesTable thead tr:first-child th {
    position: sticky;
    top: 0;
    z-index: 6;
  }
  #gradesTable thead tr:not(:first-child) th {
    position: static;
    top: auto;
    z-index: auto;
  }
  /* remove extra top padding in the table wrapper on mobile */
  .table-wrap {
    padding-top: 0;
  }
  /* transposed view: ensure left-headers start below the header */
  .grades-transposed {
    margin-top: 0;
  }
  .grades-transposed .left-headers {
    padding-top: 8px;
  }

  /* Login overlay and card better on small screens */
  .login-card {
    width: calc(100% - 32px);
    padding: 18px;
  }
  .logo {
    width: 92px;
    height: 92px;
    font-size: 32px;
  }
  .logo img {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
  }

  /* Reduce paddings — gebruik zelfde schaalvariabelen als A+/A− */
  .table-wrap .table th,
  .table-wrap .table td {
    padding: var(--table-cell-pad-y) var(--table-cell-pad-x);
    font-size: var(--table-font-size);
  }
  .table-wrap .table thead th {
    font-size: var(--table-head-font-size);
  }
  .card {
    padding: 12px;
  }
}

/* Niveau mobile adjustments: hide student number and inschrijvings columns on small screens */
@media (max-width: 640px) {
  #gradesTable th:nth-child(1),
  #gradesTable th:nth-child(2),
  #gradesTable td:nth-child(1),
  #gradesTable td:nth-child(2) {
    display: none;
  }
  /* surat header volgt tabel-schaal */
  #gradesTable thead th {
    font-size: var(--table-head-font-size);
  }
  /* ensure table wraps nicely on mobile */
  #gradesTable {
    min-width: 100%;
  }
}

/* UI polish: cards, buttons, inputs, ripples, toasts and subtle motion */
.login-card {
  border-radius: 12px;
  background: #ffffff;
  box-shadow:
    0 10px 30px rgba(0, 31, 39, 0.12),
    0 2px 6px rgba(0, 31, 39, 0.06);
}
.login-card .school-name {
  font-size: 15px;
  color: var(--text);
  font-weight: 700;
}
.logo img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  transition: transform 260ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

button.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 58, 53, 0.18);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}
button.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 58, 53, 0.16);
}
button.secondary {
  background: #fff;
  color: var(--primary);
  border: 1px solid rgba(0, 31, 39, 0.06);
}

.ripple {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  transform: scale(1);
  background: rgba(255, 255, 255, 0.38);
  opacity: 0.95;
  transition:
    transform 520ms cubic-bezier(0.2, 0.9, 0.2, 1),
    opacity 520ms ease;
  will-change: transform, opacity;
}
.ripple[style] {
  transform: scale(1.05);
  opacity: 0;
}

.card {
  background: var(--panel);
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--muted);
  box-shadow: 0 2px 8px rgba(0, 31, 39, 0.2);
  color: var(--panel-text);
}

input,
select,
textarea {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(0, 31, 39, 0.08);
  transition:
    box-shadow 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(31, 115, 194, 0.45);
  box-shadow: 0 0 0 3px rgba(31, 115, 194, 0.12), 0 4px 12px rgba(0, 31, 39, 0.04);
}

/* Keyboard focus for interactive elements */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 4px rgba(31, 115, 194, 0.12);
  border-color: rgba(31, 115, 194, 0.28);
}
.nav-menu a[aria-current="page"],
.nav-menu a.active {
  outline: none;
}

.login-overlay {
  backdrop-filter: blur(6px);
  background: rgba(0, 31, 39, 0.58);
}

.ui_toast {
  background: rgba(0, 31, 39, 0.98);
  color: #fff;
  padding: 10px 14px;
  margin-top: 8px;
  border-radius: 10px;
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 260ms cubic-bezier(0.2, 0.9, 0.2, 1),
    transform 260ms cubic-bezier(0.2, 0.9, 0.2, 1);
  box-shadow: 0 10px 30px rgba(0, 31, 39, 0.18);
}
.ui_toast.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Column sorting styles */
th.sortable {
  cursor: pointer;
  position: relative;
}
th.sortable .sort-indicator {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  opacity: 0.7;
}
th.sortable[data-sort="asc"] .sort-indicator::after {
  content: "▲";
}
th.sortable[data-sort="desc"] .sort-indicator::after {
  content: "▼";
}
th.sortable:not([data-sort="none"]) {
  background: #eef4ee;
}

/* small helpers */
.card-grid .card {
  transition:
    transform 260ms cubic-bezier(0.2, 0.9, 0.2, 1),
    box-shadow 260ms cubic-bezier(0.2, 0.9, 0.2, 1);
}
.card-grid .card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 31, 39, 0.06);
}

/* Payments page styles */
.filters {
  margin: 20px 0;
  display: flex;
  gap: 12px;
}
.search-input {
  flex: 1;
  min-width: 200px;
  padding: 10px 14px;
  border: 1px solid rgba(0, 31, 39, 0.12);
  border-radius: 8px;
  font-size: 14px;
}
.search-input::placeholder {
  color: rgba(0, 31, 39, 0.4);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  box-shadow: 0 2px 8px rgba(0, 31, 39, 0.08);
  border-radius: 8px;
  overflow: hidden;
}
.data-table thead {
  background: var(--primary);
  color: white;
}
.data-table thead th {
  padding: var(--table-cell-pad-y) 10px;
  text-align: left;
  font-weight: 600;
  border: none;
  font-size: var(--table-head-font-size);
}
.data-table tbody tr {
  border-bottom: 1px solid rgba(0, 31, 39, 0.08);
  transition: background 180ms ease;
}
.data-table tbody tr:hover {
  background: rgba(31, 115, 194, 0.05);
}
.data-table tbody td {
  padding: var(--table-cell-pad-y) 10px;
  text-align: left;
  font-size: var(--table-font-size);
  line-height: var(--table-line-height);
}
.data-table .total-cell {
  color: var(--accent);
  font-weight: 600;
}

.summary-section {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 2px solid rgba(0, 31, 39, 0.12);
}
.summary-section h2 {
  margin-bottom: 20px;
  color: var(--text);
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}
.summary-card {
  background: #dce8dd;
  border: 1px solid rgba(31, 115, 194, 0.2);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(31, 115, 194, 0.08);
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.summary-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(31, 115, 194, 0.12);
}
.summary-label {
  font-size: 13px;
  color: rgba(0, 31, 39, 0.6);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 8px 0;
}
.summary-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--panel);
  margin: 0;
}

/* Checkbox and input styling for payments */
.checkbox-cell {
  text-align: center;
  padding: 12px !important;
}
.payment-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--accent);
}
.payment-checkbox:disabled {
  cursor: not-allowed;
  opacity: 0.4;
  accent-color: rgba(0, 31, 39, 0.3);
}
.amount-paid-input {
  width: 100%;
  max-width: 120px;
  padding: 8px 10px;
  border: 1px solid rgba(0, 31, 39, 0.12);
  border-radius: 6px;
  font-size: 14px;
}
.amount-paid-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 115, 194, 0.1);
}
.rest-cell {
  padding: 14px 16px;
  text-align: right;
}

/* Children modal styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 31, 39, 0.5);
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 31, 39, 0.2);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid rgba(0, 31, 39, 0.12);
}
.modal-header h2 {
  margin: 0;
  color: var(--panel);
  font-size: 20px;
}
.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: rgba(0, 31, 39, 0.6);
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 180ms ease;
}
.modal-close:hover {
  color: var(--text);
}
.modal-body {
  padding: 20px;
}
.children-btn {
  background: #dce8dd;
  border: 1px solid rgba(31, 115, 194, 0.3);
  color: var(--panel);
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 180ms ease;
}
.children-btn:hover {
  background: #dce8dd;
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(31, 115, 194, 0.2);
}
.children-table {
  width: 100%;
  border-collapse: collapse;
}
.children-table thead {
  background: var(--primary);
  color: white;
}
.children-table thead th {
  padding: 12px;
  text-align: left;
  font-weight: 600;
}
.children-table tbody tr {
  border-bottom: 1px solid rgba(0, 31, 39, 0.08);
  transition: background 180ms ease;
}
.children-table tbody tr:hover {
  background: rgba(31, 115, 194, 0.05);
}
.children-table tbody td {
  padding: 12px;
  text-align: left;
}

.weekend-feed {
  margin-top: 22px;
  background: #ffffff;
  border: 1px solid rgba(0, 31, 39, 0.08);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 8px 24px rgba(0, 31, 39, 0.06);
}
.weekend-feed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.weekend-feed-head h3 {
  margin: 0;
  color: #001F27;
}
.weekend-feed-sub {
  margin: 6px 0 10px 0;
  opacity: 0.8;
  font-size: 14px;
}
.weekend-feed-scroller {
  max-height: 260px;
  overflow: auto;
  border: 1px solid rgba(0, 31, 39, 0.06);
  border-radius: 10px;
  background: #ffffff;
  padding: 8px;
}
.weekend-feed-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.weekend-feed-item {
  background: #ffffff;
  border: 1px solid rgba(0, 31, 39, 0.06);
  border-left: 4px solid #1F73C2;
  border-radius: 10px;
  padding: 8px 10px;
}
.weekend-feed-item.absence {
  border-left-color: #ef4444;
}
.weekend-feed-item.late {
  border-left-color: #f59e0b;
}
.weekend-feed-item.remark {
  border-left-color: #1F73C2;
}
.weekend-feed-meta {
  font-size: 12px;
  opacity: 0.75;
  margin-bottom: 2px;
}
.weekend-feed-msg {
  font-size: 14px;
  color: #001F27;
}

@media (max-width: 640px) {
  .weekend-feed-scroller {
    max-height: 220px;
  }
  .weekend-feed-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Home analytics overview */
.home-analytics {
  margin-top: 6px;
}

.analytics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  margin: 14px 0 12px 0;
}

.analytics-kpi-card {
  background: var(--primary);
  color: #eef4ee;
  border: none;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 4px 14px rgba(0, 58, 53, 0.18);
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.analytics-kpi-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 58, 53, 0.24);
}

.analytics-kpi-label {
  margin: 0;
  font-size: 12px;
  color: #dce8dd;
  opacity: 0.9;
}

.analytics-kpi-value {
  margin: 6px 0 0 0;
  font-size: 30px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
}

.analytics-panel {
  background: #ffffff;
  border: 1px solid rgba(0, 31, 39, 0.07);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0, 31, 39, 0.06), 0 1px 3px rgba(0, 31, 39, 0.04);
  transition: box-shadow 200ms ease;
}

.analytics-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}

.analytics-panel-head h3 {
  margin: 0;
  color: #001F27;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.analytics-panel-sub {
  font-size: 12px;
  opacity: 0.7;
}

.analytics-panel--trend {
  grid-column: span 6;
}

.analytics-panel--donut {
  grid-column: span 3;
}

.analytics-panel--alerts {
  grid-column: span 3;
}

.analytics-panel--weekend {
  grid-column: span 5;
}

.analytics-panel--classes {
  grid-column: span 7;
}

.analytics-panel--contacts {
  grid-column: span 4;
}

.analytics-panel--weekend .weekend-feed {
  margin-top: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.line-chart {
  width: 100%;
  height: 160px;
  border-radius: 10px;
  background: #eef4ee;
  border: 1px solid rgba(0, 31, 39, 0.05);
}

.line-chart-grid {
  fill: none;
  stroke: rgba(0, 58, 53, 0.2);
  stroke-width: 0.8;
}

.line-chart-line {
  fill: none;
  stroke: #1F73C2;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line-chart-labels {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  font-size: 12px;
  opacity: 0.82;
}

.donut-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
}

.donut-chart {
  width: 102px;
  height: 102px;
  border-radius: 50%;
  background: conic-gradient(#719A73 0deg 0deg, #dce8dd 0deg 360deg);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  color: #001F27;
  font-weight: 700;
}

.donut-chart::before {
  content: "";
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: #ffffff;
  position: absolute;
}

.donut-chart span {
  position: relative;
  z-index: 1;
}

.donut-legend p {
  margin: 0 0 6px 0;
  font-size: 13px;
}

.dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 999px;
  margin-right: 6px;
}

.dot--ok {
  background: #719A73;
}

.dot--missing {
  background: #b8cdb9;
}

.analytics-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.analytics-bar-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 8px;
  align-items: center;
}

.analytics-bar-label {
  font-size: 12px;
  color: #001F27;
  opacity: 0.82;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.analytics-bar-track {
  width: 100%;
  background: #eef4ee;
  border-radius: 999px;
  height: 20px;
  overflow: hidden;
}

.analytics-bar-fill {
  height: 100%;
  background: var(--secondary);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  border-radius: 999px;
  min-width: 24px;
}

.analytics-empty {
  margin: 0;
  font-size: 13px;
  opacity: 0.75;
}

.contact-search-wrap {
  margin-bottom: 8px;
}

.contact-search-wrap input {
  width: 100%;
}

.contact-student-list {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 300px;
  overflow: auto;
  border: 1px solid rgba(0, 31, 39, 0.06);
  border-radius: 10px;
  background: #ffffff;
}

.contact-student-item {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0, 31, 39, 0.06);
  cursor: pointer;
}

.contact-student-item:last-child {
  border-bottom: none;
}

.contact-student-item:hover {
  background: #dce8dd;
}

.contact-student-item--empty {
  cursor: default;
  opacity: 0.8;
}

.contact-student-item--empty:hover {
  background: transparent;
}

.contact-student-name {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #001F27;
}

.contact-student-sub {
  margin: 2px 0 0 0;
  font-size: 12px;
  opacity: 0.78;
}

/* Click name to show Inschrijving # / Leerling # (numbers hidden in table) */
.table-hide-id-cols thead th:nth-child(1),
.table-hide-id-cols thead th:nth-child(2),
.table-hide-id-cols tbody td:nth-child(1),
.table-hide-id-cols tbody td:nth-child(2) {
  display: none;
}
.table-hide-id-cols.table-show-id-cols thead th:nth-child(1),
.table-hide-id-cols.table-show-id-cols thead th:nth-child(2),
.table-hide-id-cols.table-show-id-cols tbody td:nth-child(1),
.table-hide-id-cols.table-show-id-cols tbody td:nth-child(2) {
  display: table-cell;
}
.table-hide-id-cols--her thead th:nth-child(1),
.table-hide-id-cols--her tbody td:nth-child(1) {
  display: none;
}
.grades-transposed.grades-transposed--hide-ids .left-headers .hdr:nth-child(1),
.grades-transposed.grades-transposed--hide-ids .left-headers .hdr:nth-child(2) {
  display: none;
}
.grades-transposed.grades-transposed--hide-ids .student-col .cell:nth-child(1),
.grades-transposed.grades-transposed--hide-ids .student-col .cell:nth-child(2) {
  display: none;
}

.student-name-link {
  font: inherit;
  font-weight: 900;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  color: #001F27;
  text-decoration: none;
  text-underline-offset: 2px;
  text-align: inherit;

}
.student-name-link:hover {
  color: #003A35;
}
.student-name-link--flagged {
  color: #b91c1c;
  font-weight: 700;
}

.student-numbers-modal {
  position: fixed;
  inset: 0;
  z-index: 3001;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.student-numbers-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 31, 39, 0.45);
}
.student-numbers-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(400px, 100%);
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid rgba(0, 31, 39, 0.1);
  box-shadow: 0 18px 44px rgba(0, 31, 39, 0.24);
  padding: 18px 20px;
}
.student-numbers-modal-title {
  margin: 0 0 14px 0;
  font-size: 18px;
  color: #001F27;
}
.student-numbers-modal-dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 12px;
  align-items: baseline;
}
.student-numbers-modal-dl dt {
  margin: 0;
  font-weight: 600;
  color: #003A35;
  font-size: 14px;
}
.student-numbers-modal-dl dd {
  margin: 0;
  font-size: 15px;
  color: #001F27;
}
.student-numbers-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  justify-content: flex-end;
  align-items: center;
}

.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 3001;
  display: none;
}

.contact-modal.open {
  display: block;
}

.contact-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 31, 39, 0.45);
}

.contact-modal-dialog {
  position: relative;
  width: min(760px, calc(100% - 24px));
  margin: 58px auto 0 auto;
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid rgba(0, 31, 39, 0.1);
  box-shadow: 0 18px 44px rgba(0, 31, 39, 0.24);
}

.contact-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0, 31, 39, 0.08);
}

.contact-modal-head h3 {
  margin: 0;
  color: #001F27;
}

.contact-modal-body {
  padding: 14px 16px 18px 16px;
}

.contact-meta {
  margin: 0 0 10px 0;
  font-size: 13px;
  opacity: 0.75;
}

.contact-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.contact-detail-grid h4 {
  margin: 0 0 6px 0;
  color: #001F27;
  font-size: 14px;
}

.contact-detail-grid p {
  margin: 0 0 6px 0;
  font-size: 13px;
}

@media (max-width: 1024px) {
  .analytics-kpi-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }
  .analytics-panel--trend,
  .analytics-panel--donut,
  .analytics-panel--alerts,
  .analytics-panel--weekend,
  .analytics-panel--classes,
  .analytics-panel--contacts {
    grid-column: span 6;
  }
}

@media (max-width: 700px) {
  .analytics-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
  .analytics-panel--trend,
  .analytics-panel--donut,
  .analytics-panel--alerts,
  .analytics-panel--weekend,
  .analytics-panel--classes,
  .analytics-panel--contacts {
    grid-column: span 1;
  }
  .analytics-bar-row {
    grid-template-columns: 1fr;
  }
  .contact-detail-grid {
    grid-template-columns: 1fr;
  }
  .contact-modal-dialog {
    margin-top: 20px;
  }
}

/* keep mobile tweaks but slightly tighter spacings */
@media (max-width: 640px) {
  .login-card {
    width: calc(100% - 32px);
    padding: 18px;
  }
  .logo img {
    width: 100%;
    height: 100%;
  }
}

/* Table wrapper: A+/A− buiten scroll; alleen .table-scroll scrollt */
.table-wrap {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  max-height: min(78vh, calc(100dvh - 180px));
  min-height: 0;
  overflow: hidden;
  border-radius: 12px;
  background: transparent;
  padding: 0;
  /* default = niveau 0; JS zet data-table-size voor leesbare schaal */
  --table-font-size: 12px;
  --table-head-font-size: 11px;
  --table-cell-pad-y: 5px;
  --table-cell-pad-x: 6px;
  --table-line-height: 1.28;
}
.table-wrap > .table-scroll {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.table-wrap .table {
  margin: 0;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
.table thead tr:first-child th {
  position: sticky;
  top: 0;
  background: #dce8dd;
  z-index: 3;
}
.table thead tr:not(:first-child) th {
  position: static;
  top: auto;
  z-index: auto;
}

/* App shell: header full width; only .page-scroll scrolls */
#pageContent {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  width: 100%;
  overflow: hidden;
  transition:
    opacity 220ms ease,
    transform 220ms ease;
}

/* flagged name style */
.flagged-name {
  color: #b91c1c;
  font-weight: 700;
}

@media (max-width: 900px) {
  .header-brand { padding: 6px 16px 6px 6px; min-height: 64px; }
  .header .title { max-width: 130px; font-size: 16px; }
  .user-chip { display: none; }
}

@media (max-width: 480px) {
  /* Tighter header and controls for small phones */
  #appHeader { padding: 10px 10px 6px; }
  .header { gap: 8px; }
  .header .title {
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
  }
  .nav-menu { width: min(320px, calc(100vw - 20px)); }
  .nav-menu a.nav-tab { min-width: 0; width: 100%; padding: 8px 10px; }
  .nav-tab-label { font-size: 14px; max-width: none; }
  #logoutBtn {
    display: block;
  }
  .header-right {
    gap: 8px;
  }
  .container {
    padding: 10px;
  }
  .card-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
  }
  /* Make tables fit and enable natural wrapping where possible */
  .table-wrap {
    max-height: min(62vh, calc(100dvh - 200px));
  }
  .table-wrap .table {
    min-width: 0;
    width: 100%;
  }
  .table-wrap .table thead th,
  .table-wrap .table th,
  .table-wrap .table td {
    font-size: var(--table-font-size);
    padding: var(--table-cell-pad-y) var(--table-cell-pad-x);
    min-width: 0;
  }
  .table-wrap .table thead th {
    font-size: var(--table-head-font-size);
  }
  /* Increase touch targets for form controls */
  .controls input,
  .controls select,
  .controls button {
    min-height: 48px;
    font-size: 15px;
  }
  /* Side menu becomes a horizontal scroller */
  .side {
    max-height: 120px;
    padding: 6px;
  }
}

/* Modal for opmerkingen mobile editing */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 31, 39, 0.45);
  z-index: 3000;
  padding: 16px;
}

/* Tighten transposed (mobile) header font and make container corners circular */
@media (max-width: 640px) {
  .grades-transposed {
    display: flex;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 26px rgba(0, 31, 39, 0.06);
    margin: 8px 0;
  }
  /* remove extra top spacing so header aligns with content */
  .grades-transposed {
    margin: 0;
  }
  .grades-transposed .left-headers {
    background: #eef4ee;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-width: 140px;
    box-sizing: border-box;
  }
  .grades-transposed .left-headers .hdr {
    font-size: 15px;
    padding: 12px 10px;
    color: #001F27;
    font-weight: 700;
    line-height: 1.1;
    display: flex;
    align-items: center;
    min-height: 48px;
    box-sizing: border-box;
  }
  .grades-transposed .scroll {
    display: flex;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0;
    align-items: stretch;
  }
  .grades-transposed .student-col {
    display: flex;
    flex-direction: column;
    min-width: 120px;
    border-left: 1px solid rgba(0, 31, 39, 0.04);
    background: #fff;
  }
  .grades-transposed .student-col .cell {
    padding: 10px 12px;
    font-size: 13px;
    border-bottom: 1px solid rgba(0, 31, 39, 0.03);
    line-height: 1.2;
    display: flex;
    align-items: center;
    min-height: 48px;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Mobile-only: tighten and round the Niveau table header so it matches the table */
@media (max-width: 640px) {
  /* inset table slightly so rounded corners are visible and aligned with page edges */
  #gradesTable {
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    border: 1px solid rgba(0, 31, 39, 0.04);
    box-shadow: 0 6px 18px rgba(0, 31, 39, 0.04);
    margin: 8px;
  }
  /* consistent header height and reduced padding */
  #gradesTable thead th {
    background: #eef4ee;
    color: #001F27;
    padding: 6px 8px;
    font-size: 12px;
    height: 44px;
    vertical-align: middle;
  }
  /* round the top corners of header cells */
  #gradesTable thead th:first-child {
    border-top-left-radius: 12px;
  }
  #gradesTable thead th:last-child {
    border-top-right-radius: 12px;
  }
  /* reduce body cell padding so rows align with header height */
  #gradesTable tbody td {
    padding: 8px 8px;
    font-size: 12px;
  }
  /* transposed left-headers alignment */
  .grades-transposed .left-headers {
    margin-left: 8px;
    margin-right: 8px;
  }
}
.modal.open,
.modal[aria-hidden="false"] {
  display: flex;
}
.modal .modal-dialog {
  background: #ffffff;
  border-radius: 12px;
  max-width: 520px;
  width: 100%;
  padding: 16px;
  box-shadow: 0 18px 48px rgba(0, 31, 39, 0.36);
}
.modal .form-row {
  margin-bottom: 10px;
}
.modal .form-row label {
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal .form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}
.modal .form-actions button {
  padding: 8px 12px;
  border-radius: 8px;
}
.modal .form-actions #modalSave {
  background: var(--primary);
  border: none;
  color: #ffffff;
  font-weight: 700;
}
.modal .form-actions #modalCancel {
  background: #eef4ee;
  border: 1px solid rgba(0, 31, 39, 0.06);
}
.edit-btn {
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--accent-2);
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: 700;
}

@media (max-width: 640px) {
  /* hide wide columns (Agenda .. Opmerking) to avoid horizontal scrolling on phones; keep the edit column visible */
  .table th:nth-child(n + 5):nth-child(-n + 10),
  .table td:nth-child(n + 5):nth-child(-n + 10) {
    display: none;
  }
  .edit-btn {
    display: inline-block;
  }
  /* Ensure table doesn't force horizontal scrolling due to hidden columns */
  .table-wrap .table {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  /* Teacher mobile opmerkingen view: show only Naam + action button */
  body.opm-mobile-teacher #opmerkingenTable th:nth-child(1),
  body.opm-mobile-teacher #opmerkingenTable th:nth-child(2),
  body.opm-mobile-teacher #opmerkingenTable th:nth-child(4),
  body.opm-mobile-teacher #opmerkingenTable td:nth-child(1),
  body.opm-mobile-teacher #opmerkingenTable td:nth-child(2),
  body.opm-mobile-teacher #opmerkingenTable td:nth-child(4) {
    display: none;
  }
}

/* Grades transposed layout for mobile: left column of headers, right side scrolls student columns */
@media (max-width: 640px) {
  .grades-transposed {
    display: flex;
    gap: 0;
    align-items: flex-start;
    width: 100%;
  }
  .grades-transposed .left-headers {
    flex: 0 0 140px;
    background: #eef4ee;
    border-right: 1px solid rgba(0, 31, 39, 0.04);
    padding: 0;
  }
  .grades-transposed .left-headers .hdr {
    padding: 12px 10px;
    font-weight: 700;
    color: #001F27;
    border-bottom: 1px solid rgba(0, 31, 39, 0.03);
    min-height: 48px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
  }
  .grades-transposed .scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    gap: 8px;
    padding: 0;
    align-items: stretch;
  }
  .grades-transposed .student-col {
    min-width: 220px;
    background: #fff;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 6px 18px rgba(0, 31, 39, 0.04);
    border: 1px solid rgba(0, 31, 39, 0.04);
    display: flex;
    flex-direction: column;
  }
  .grades-transposed .student-col .cell {
    padding: 12px 10px;
    border-bottom: 1px dashed rgba(0, 31, 39, 0.03);
    font-size: 13px;
    min-height: 48px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
  }
  .grades-transposed .term-pair {
    display: flex;
    gap: 8px;
    align-items: center;
  }
  .grades-transposed .term-pair select,
  .grades-transposed .term-pair input {
    min-width: 44px;
    max-width: 120px;
  }
  /* show transposed and hide regular table on mobile */
  #gradesTransposed[aria-hidden="false"],
  .grades-transposed[aria-hidden="false"] {
    display: flex !important;
  }
  #gradesTable {
    display: none;
  }
}

/* Make the grades table use the standard light table header (reverted for Niveau) */
#gradesTable {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 31, 39, 0.04);
  border: 1px solid rgba(0, 31, 39, 0.04);
}
#gradesTable thead th {
  background: #eef4ee;
  color: #001F27;
  border-bottom: 1px solid rgba(0, 58, 53, 0.04);
}

/* Make transposed left headers match the site header for cohesion */
@media (max-width: 640px) {
  .grades-transposed .left-headers {
    background: #eef4ee;
    color: #001F27;
  }
  .grades-transposed .left-headers .hdr {
    color: #001F27;
    font-weight: 700;
  }
  .grades-transposed .student-col {
    background: #ffffff;
  }
}

/* Slightly reduce the vertical gap between header and content on grades page */
@media (min-width: 0) {
  .header + .page-scroll {
    margin-top: 0;
  }
}

/* Agenda page styles */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 31, 39, 0.5);
  z-index: 2999;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  padding: 16px;
}

.modal.open {
  display: flex;
}

.modal-content {
  background: #ffffff;
  border-radius: 12px;
  max-width: 600px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 31, 39, 0.3);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid #dce8dd;
  position: relative;
}

.modal-header h3 {
  margin: 0;
  font-size: 20px;
  color: #001F27;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid #dce8dd;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.modal-footer button {
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid #b8cdb9;
  cursor: pointer;
  font-weight: 600;
}

.modal-footer .primary {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.modal-footer .secondary {
  background: #eef4ee;
  color: #001F27;
}

.modal-footer .danger {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

fieldset {
  border: 1px solid #dce8dd;
  border-radius: 8px;
  padding: 16px;
  margin: 0;
}

.agenda-day-tooltip {
  position: absolute;
  z-index: 60;
  min-width: 250px;
  max-width: 340px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(0, 58, 53, 0.25);
  background: #dce8dd;
  color: #001F27;
  box-shadow: 0 12px 26px rgba(0, 58, 53, 0.18);
  pointer-events: none;
}

.agenda-day-tooltip__header {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0, 58, 53, 0.15);
}

.agenda-day-tooltip__section-title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 6px;
}

.agenda-day-tooltip__slot {
  font-size: 15px;
  line-height: 1.45;
}

.weekend-feed-item--none {
  border-left: 4px solid #fca5a5;
}

.weekend-feed-item--contact {
  border-left: 4px solid #fde68a;
}

.weekend-feed-item--event,
.weekend-feed-item--addon-event {
  border-left: 4px solid #1F73C2;
}

.weekend-feed-item--trip {
  border-left: 4px solid #fdba74;
}

@media (max-width: 700px) {
  .agenda-day-tooltip {
    min-width: 230px;
    max-width: 300px;
  }
}

legend {
  padding: 0 8px;
  font-weight: 600;
  color: #001F27;
}

.radio-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
}

.radio-group input[type="radio"] {
  cursor: pointer;
  margin: 0;
}

textarea {
  width: 100%;
  min-height: 80px;
  padding: 8px 12px;
  border: 1px solid #b8cdb9;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
}

select {
  padding: 6px 8px;
  border: 1px solid #b8cdb9;
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
  background: white;
}

.time-slot-input {
  padding: 6px 8px;
  border: 1px solid #b8cdb9;
  border-radius: 4px;
}

/* Mobile fix: round and align the Niveau table header so it visually matches the table */
@media (max-width: 640px) {
  /* inset the table a bit so rounded corners are visible on narrow screens */
  #gradesTable {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(0, 31, 39, 0.04);
    box-shadow: 0 6px 18px rgba(0, 31, 39, 0.04);
    margin-left: 8px;
    margin-right: 8px;
  }
  /* set a consistent header height and reduced padding so header and rows align */
  #gradesTable thead th {
    background: #eef4ee;
    color: #001F27;
    padding: 8px 8px;
    font-size: 12px;
    height: 44px;
    vertical-align: middle;
  }
  /* round top corners of the first and last header cells */
  #gradesTable thead th:first-child {
    border-top-left-radius: 12px;
  }
  #gradesTable thead th:last-child {
    border-top-right-radius: 12px;
  }
  /* tighten body cell spacing */
  #gradesTable tbody td {
    padding: 8px 8px;
    font-size: 12px;
  }
  /* transposed left-headers: ensure top corner matches */
  .grades-transposed .left-headers .hdr:first-child {
    border-top-left-radius: 12px;
  }
}

/* FINAL: authoritative consolidated transposed/mobile rules (appended) */
@media (max-width: 640px) {
  /* force hide original table and show transposed */
  #gradesTable {
    display: none !important;
  }
  #gradesTransposed {
    display: flex !important;
    box-sizing: border-box !important;
  }

  .grades-transposed {
    display: flex !important;
    gap: 0 !important;
    align-items: flex-start !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 8px 0 !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    background: #ffffff !important;
    box-shadow: 0 8px 26px rgba(0, 31, 39, 0.06) !important;
  }

  .grades-transposed .left-headers {
    flex: 0 0 140px !important;
    background: #eef4ee !important;
    border-right: 1px solid rgba(0, 31, 39, 0.04) !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }
  /* Linked row height for header and content — change this value to adjust all row heights */
  .grades-transposed {
    --grades-row-height: 48px;
  }
  .grades-transposed .left-headers .hdr {
    padding: 12px 10px !important;
    font-weight: 700 !important;
    color: #001F27 !important;
    border-bottom: 1px solid rgba(0, 31, 39, 0.03) !important;
    height: var(--grades-row-height) !important;
    display: flex !important;
    align-items: center !important;
    box-sizing: border-box !important;
  }

  .grades-transposed .scroll {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    display: flex !important;
    gap: 8px !important;
    padding: 0 !important;
    align-items: stretch !important;
  }
  .grades-transposed .student-col {
    min-width: 220px !important;
    background: #fff !important;
    border-radius: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: 0 !important;
    display: flex !important;
    flex-direction: column !important;
  }
  .grades-transposed .student-col .cell {
    padding: 12px 10px !important;
    border-bottom: 1px dashed rgba(0, 31, 39, 0.03) !important;
    font-size: 13px !important;
    height: var(--grades-row-height) !important;
    display: flex !important;
    align-items: center !important;
    box-sizing: border-box !important;
  }

  .grades-transposed .term-pair {
    display: flex !important;
    gap: 8px !important;
    align-items: center !important;
  }
  .grades-transposed .term-pair select,
  .grades-transposed .term-pair input {
    min-width: 44px !important;
    max-width: 120px !important;
  }

  #gradesTransposed[aria-hidden="false"] {
    display: flex !important;
  }
}

/* Secretary alert state */
.alert-row td {
  background: #fee2e2 !important;
}
.alert-row .cell {
  background: #fee2e2 !important;
}
.alert-row-absence td {
  background: #fee2e2 !important;
}
.alert-row-absence .cell {
  background: #fee2e2 !important;
}
.alert-row-remarks td {
  background: #fed7aa !important;
}
.alert-row-remarks .cell {
  background: #fed7aa !important;
}
.alert-badge {
  display: inline-block;
  margin-right: 6px;
  color: #dc2626;
  font-size: 14px;
  line-height: 1;
  cursor: help;
  vertical-align: middle;
}

.attendance-reminder {
  margin: 8px 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: #fff7d6;
  color: #7a5200;
  font-weight: 700;
  font-size: 14px;
}

@media (max-width: 640px) {
  .attendance-reminder {
    font-size: 13px;
    padding: 9px 10px;
  }
}

/* ══════════════════════════════════════════════════════════════════════
   COMPLETE REDESIGN — masgidannasr.com stijl
   Behouden: Cairo font, groen kleurenpalet
   Gewijzigd: layout, kaart-stijl, knop-vorm, kalender, footer, spacing
   ══════════════════════════════════════════════════════════════════════ */

/* ── 1. Pill-knoppen (zoals mosque website: border-radius:100px) ─── */
button.primary,
button.secondary,
button.danger,
.edit-btn,
.children-btn {
  border-radius: 999px;
}
button.primary {
  padding: 10px 22px;
  font-size: 14px;
  letter-spacing: 0.02em;
}
button.secondary {
  padding: 9px 18px;
  font-size: 14px;
}
button.danger {
  padding: 9px 18px;
}
.table button.primary,
.table button.secondary {
  padding: 5px 12px;
  font-size: 12px;
}

/* ── 2. Container: ruimere padding en max-breedte ──────────────────── */
.container {
  padding: 28px 32px;
  max-width: 1440px;
  margin-left: auto;
  margin-right: auto;
}
@media (max-width: 900px) {
  .container { padding: 16px 16px; }
}
@media (max-width: 480px) {
  .container { padding: 12px 12px; }
}

/* ── 3. Sectie-koppen: groot en met accent-balk ────────────────────── */
.container h1,
.container h2,
.container h3:not(.analytics-panel-head h3):not(.contact-modal-head h3):not(.students-add-panel-title):not(.modal-header h3),
main > h1,
main > h2 {
  font-weight: 700;
  letter-spacing: -0.01em;
}
.container > h1,
.container > h2,
.container > a + h1,
.container > a + h2 {
  font-size: 26px;
  margin: 0 0 24px 0;
  padding-bottom: 14px;
  border-bottom: 3px solid var(--primary);
  display: block;
  color: var(--text);
}

/* ── 4. Kaarten: primaire achtergrond, lichte tekst */
.card {
  background: var(--primary);
  color: #eef4ee;
  border: none;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 58, 53, 0.18), 0 1px 4px rgba(0, 58, 53, 0.08);
  padding: 22px;
  transition: transform 220ms ease, box-shadow 220ms ease;
}
.card h3 {
  color: #ffffff !important;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}
.card p {
  color: #dce8dd !important;
  font-size: 14px;
}
.card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 58, 53, 0.24);
  background: var(--primary);
}
.card-grid {
  gap: 20px;
  margin-top: 28px;
}
.card-grid .card {
  transition: transform 220ms ease, box-shadow 220ms ease;
}
.card-grid .card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 58, 53, 0.13);
}

/* ── 5. Analytics panelen: meer ruimte ─────────────────────────────── */
.analytics-panel {
  border-radius: 16px;
  padding: 22px;
  border: none;
  box-shadow: 0 4px 18px rgba(0, 58, 53, 0.07), 0 1px 4px rgba(0, 58, 53, 0.04);
}
.analytics-kpi-card {
  border-radius: 16px;
  border: none;
  box-shadow: 0 4px 18px rgba(0, 58, 53, 0.18);
  padding: 22px;
}
.analytics-kpi-value {
  font-size: 38px;
  margin-top: 8px;
  color: #ffffff;
}
.analytics-kpi-label {
  font-size: 13px;
  font-weight: 600;
  color: #dce8dd;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.analytics-kpi-grid {
  gap: 16px;
  margin: 20px 0 16px 0;
}
.analytics-grid {
  gap: 16px;
}

/* ── 6. Zij-paneel (klassen/niveau): kaart-stijl ───────────────────── */
.side {
  border-radius: 16px;
  box-shadow: 0 4px 18px rgba(0, 58, 53, 0.06);
  border: none;
  background: #ffffff;
}

/* ── 7. Tabellen: schoner en meer ademruimte ───────────────────────── */
.table {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0, 58, 53, 0.06);
}
.table th {
  background: #dce8dd;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--panel);
  padding: 13px 10px;
}
.table td {
  padding: 11px 10px;
}

/* ── 8. Footer: donkergroen (zoals mosque's donkere footer) ─────────── */
.footer {
  background: var(--panel);
  color: var(--panel-text);
  padding: 20px 32px;
  font-size: 13px;
  border-top: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  letter-spacing: 0.01em;
  opacity: 0.98;
}

/* ── 9. Kalender: CSS-klassen (aangemaakt door agenda.js) ──────────── */
.cal-day-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 20px;
}
.cal-day-header {
  text-align: center;
  padding: 10px 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--panel);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: transparent;
  border: none;
}
.cal-day {
  min-height: 78px;
  border: 1px solid rgba(0, 31, 39, 0.09);
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: transform 150ms ease, box-shadow 150ms ease;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 8px 10px;
  background: #ffffff;
  color: var(--text);
  text-align: left;
  line-height: 1.2;
}
.cal-day-num {
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
}
.cal-day-label {
  font-size: 10px;
  font-weight: 600;
  margin-top: auto;
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.cal-day:hover {
  box-shadow: 0 2px 8px rgba(0, 58, 53, 0.14);
  transform: translateY(-1px);
  border-color: var(--secondary);
  z-index: 1;
}
/* Vandaag */
.cal-day--today {
  border: 2px solid var(--primary);
  background: #dce8dd;
}
.cal-day--today .cal-day-num {
  background: var(--primary);
  color: #ffffff;
}
/* Lesdag */
.cal-day--lesson {
  background: #eef4ee;
  border-color: #dce8dd;
}
.cal-day--lesson .cal-day-label {
  color: #003A35;
  background: #dce8dd;
}
/* Geen les */
.cal-day--no-lesson {
  background: #fff8f8;
  border-color: #fca5a5;
}
.cal-day--no-lesson .cal-day-label {
  color: #991b1b;
  background: #fee2e2;
}
/* Evenement */
.cal-day--event {
  background: #d4e5f6;
  border-color: #1F73C2;
}
.cal-day--event .cal-day-label {
  color: #1F73C2;
  background: #d4e5f6;
}
/* Uitstap */
.cal-day--trip {
  background: #fffbf0;
  border-color: #fcd34d;
}
.cal-day--trip .cal-day-label {
  color: #92400e;
  background: #fef3c7;
}
/* Oudercontact */
.cal-day--contact {
  background: #fffbeb;
  border-color: #fde68a;
}
.cal-day--contact .cal-day-label {
  color: #78350f;
  background: #fef9c3;
}
/* Weekend (standaard lesdag) */
.cal-day--weekend {
  background: #eef4ee;
  border-color: #dce8dd;
}
.cal-day--weekend .cal-day-label {
  color: #003A35;
  background: #dce8dd;
}
/* Leeg (opvulcel) */
.cal-day--empty {
  background: transparent;
  border: none;
  cursor: default;
  pointer-events: none;
  box-shadow: none;
}
.cal-day--empty:hover {
  transform: none;
  box-shadow: none;
  border-color: transparent;
}

@media (max-width: 640px) {
  .cal-day { min-height: 52px; padding: 5px 6px; border-radius: 8px; }
  .cal-day-num { font-size: 13px; width: 22px; height: 22px; }
  .cal-day-label { display: none; }
  .cal-day-grid { gap: 3px; }
}

/* ── 10. Kalender navigatie controls ───────────────────────────────── */
.cal-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 18px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(0, 58, 53, 0.06);
}
.cal-month-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--panel);
  margin: 0;
}
.cal-view-btns {
  display: flex;
  gap: 6px;
}

/* ── 11. Hamburger + sidebar: volledig intact op alle schermgroottes ── */
/* Geen wijzigingen aan het navigatiegedrag — hamburger werkt overal   */

/* ── 12. Modal dialogen: meer afgerond ─────────────────────────────── */
.students-add-modal-dialog,
.contact-modal-dialog,
.student-numbers-modal-dialog,
.modal .modal-dialog,
.modal-content {
  border-radius: 20px;
}

/* ── 13. Inschrijvingen page header fix ─────────────────────────────── */
.container > div > h2[style*="margin:0"] {
  font-size: 26px !important;
  margin: 0 0 24px 0 !important;
  padding-bottom: 14px !important;
  border-bottom: 3px solid var(--primary) !important;
}

/* ══ 14. Home page — modern redesign ════════════════════════════════ */

/* Hero banner */
.home-hero {
  background: var(--primary);
  border-radius: 20px;
  padding: 36px 40px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  position: relative;
  overflow: hidden;
}
.home-hero::before {
  content: '';
  position: absolute;
  right: -50px;
  top: -50px;
  width: 220px;
  height: 220px;
  background: rgba(113, 154, 115, 0.28);
  border-radius: 50%;
  pointer-events: none;
}
.home-hero::after {
  content: '';
  position: absolute;
  right: 80px;
  bottom: -70px;
  width: 180px;
  height: 180px;
  background: rgba(31, 115, 194, 0.16);
  border-radius: 50%;
  pointer-events: none;
}
.home-hero-left { position: relative; z-index: 1; }
.home-hero h1 {
  font-size: 32px !important;
  font-weight: 800 !important;
  color: #ffffff !important;
  margin: 0 0 8px 0 !important;
  padding: 0 !important;
  border: none !important;
  line-height: 1.15 !important;
}
.home-hero-sub {
  font-size: 15px;
  color: #dce8dd;
  margin: 0;
  line-height: 1.5;
}
.home-hero-right {
  text-align: right;
  position: relative;
  z-index: 1;
}
.home-hero-dayname {
  font-size: 13px;
  color: #dce8dd;
  margin: 0 0 2px 0;
  text-transform: capitalize;
  letter-spacing: 0.02em;
}
.home-hero-datestr {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

/* Section dividers */
.home-section-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--panel);
  margin: 36px 0 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.home-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(0, 58, 53, 0.15);
}

/* KPI icon */
.kpi-icon {
  font-size: 22px;
  width: 46px;
  height: 46px;
  background: #eef4ee;
  color: var(--primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

/* Quick-nav widgets */
.home-nav-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 18px !important;
}
.widget-card,
.home-nav-card {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 0 !important;
  padding: 12px !important;
  min-height: 220px;
  text-decoration: none !important;
  background: var(--primary) !important;
  color: #eef4ee !important;
  border: none !important;
  border-radius: 28px !important;
  box-shadow: 0 12px 32px rgba(0, 58, 53, 0.18), 0 2px 6px rgba(0, 58, 53, 0.08);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.widget-card:hover,
.home-nav-card:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 16px 36px rgba(0, 58, 53, 0.26) !important;
  background: var(--primary) !important;
  text-decoration: none !important;
}
.widget-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 10px 8px;
}
.widget-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.widget-nav:hover,
.widget-nav:visited,
.widget-nav:active,
.widget-nav:focus {
  color: inherit;
  text-decoration: none;
}
.widget-title,
.home-nav-card h3,
.widget-card h3 {
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.widget-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 8px 4px 8px;
}
.widget-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 11px;
  border-radius: 999px;
  border: none;
  background: #eef4ee;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}
.widget-action:visited {
  color: var(--primary);
  background: #eef4ee;
}
.widget-action:hover,
.widget-action:focus {
  color: #ffffff;
  text-decoration: none;
  background: var(--secondary);
}
.widget-icon,
.home-nav-icon-wrap {
  font-size: 16px;
  width: 28px;
  height: 28px;
  min-width: 28px;
  background: transparent;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.home-nav-icon-wrap .app-icon,
.kpi-icon .app-icon,
.widget-icon .app-icon {
  width: 18px;
  height: 18px;
}
.widget-icon .app-icon,
.home-nav-icon-wrap .app-icon {
  background-color: #eef4ee;
}
.kpi-icon .app-icon {
  background-color: var(--primary);
}
.widget-body {
  flex: 1;
  border-radius: 22px;
  padding: 16px 18px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  background: transparent;
  color: #eef4ee;
}
.widget-card--peach .widget-body,
.widget-card--mint .widget-body,
.widget-card--lime .widget-body,
.widget-card--sky .widget-body,
.widget-card--cream .widget-body,
.widget-card--sage .widget-body,
.widget-card--gold .widget-body,
.widget-card--sand .widget-body,
.widget-card--blue .widget-body {
  background: transparent;
}
.widget-card--wide {
  grid-column: span 2;
}
.widget-kicker {
  margin: 0;
  font-size: 12px;
  color: #dce8dd;
}
.widget-stat {
  margin: 6px 0 8px 0;
  font-size: 34px;
  line-height: 1.05;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.04em;
}
.widget-stat--sm {
  font-size: 24px;
}
.widget-note {
  margin: 0;
  font-size: 12px;
  color: #dce8dd;
  line-height: 1.4;
}
.widget-spark {
  width: 100%;
  height: 42px;
  margin: 4px 0 8px 0;
}
.widget-spark polyline {
  fill: none;
  stroke: #eef4ee;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.widget-split {
  display: flex;
  gap: 14px;
  margin: 0 0 8px 0;
  font-size: 12px;
  color: #dce8dd;
}
#widgetAttendancePresent {
  color: #719A73;
}
#widgetAttendanceAbsent {
  color: #fecaca;
}
.widget-log-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.widget-log-list li {
  font-size: 12px;
  color: #eef4ee;
  line-height: 1.35;
}
.widget-body--lookup {
  min-height: 220px;
}
.widget-card--static {
  cursor: default;
}
.widget-card--static:hover {
  transform: none !important;
}
.lookup-filters {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.9fr 0.9fr;
  gap: 8px;
  margin: 8px 0 10px 0;
}
.lookup-filters--simple {
  grid-template-columns: 1.6fr 0.8fr;
}
.lookup-filters input,
.lookup-filters select {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 10px;
  border: none;
  background: #ffffff;
  color: #001F27;
  font-size: 12px;
}
.lookup-results {
  max-height: 180px;
  overflow: auto;
  margin: 0;
  padding: 0;
  list-style: none;
  border: none;
  background: transparent;
}
.lookup-results--tall {
  max-height: 260px;
  margin-top: 8px;
}
.lookup-results .contact-student-item {
  background: #eef4ee;
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 6px;
  cursor: pointer;
  color: #001F27;
}

/* Responsive breakpoints for nav grid */
@media (max-width: 1100px) {
  .home-nav-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .widget-card--wide { grid-column: span 2; }
  .lookup-filters { grid-template-columns: 1fr 1fr; }
  .lookup-filters--simple { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .home-hero { padding: 24px 20px; }
  .home-hero h1 { font-size: 24px !important; }
  .home-hero-datestr { font-size: 16px; }
  .home-nav-grid { grid-template-columns: 1fr !important; }
  .widget-card--wide { grid-column: span 1; }
  .lookup-filters { grid-template-columns: 1fr; }
  .lookup-filters--simple { grid-template-columns: 1fr; }
  .home-hero-right { text-align: left; }
}

/* ── Role-based visibility (CSS-first, no flash) ── */
/* Hidden for teachers by default; only shown when body has data-role="secretaris" */
.teacher-restricted { display: none !important; }
body[data-role="secretaris"] .teacher-restricted { display: flex !important; }
/* Nav links are block-level */
#navMenu .teacher-restricted { display: none !important; }
body[data-role="secretaris"] #navMenu .teacher-restricted { display: flex !important; }
/* KPI/analytics grids use CSS grid, not flex */
body[data-role="secretaris"] .analytics-kpi-grid.teacher-restricted,
body[data-role="secretaris"] .analytics-grid.teacher-restricted { display: grid !important; }

/* ── Rapport page ── */
.rapport-section {
  border: 1.5px solid var(--primary);
  border-radius: 4px;
  margin-bottom: 10px;
  overflow: hidden;
}
.rapport-section-title {
  margin: 0;
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: var(--primary);
  color: #fff;
  padding: 4px 10px;
}
.rapport-label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
  color: var(--panel-text);
  padding: 6px 8px;
}
.rapport-label .select-input,
.rapport-label .input {
  margin-top: 2px;
}
.rapport-section > *:not(.rapport-section-title) {
  padding: 6px 8px;
}
.rapport-section > .rapport-label {
  padding: 6px 8px;
}
.badge-green  { background: #dce8dd; color: #003A35; border: 1px solid #b8cdb9; padding: 1px 6px; border-radius: 9999px; font-size: 11px; white-space: nowrap; }
.badge-orange { background: #ffedd5; color: #9a3412; border: 1px solid #fdba74; padding: 1px 6px; border-radius: 9999px; font-size: 11px; white-space: nowrap; }
.badge-red    { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; padding: 1px 6px; border-radius: 9999px; font-size: 11px; white-space: nowrap; }
.btn-sm { padding: 3px 10px !important; font-size: 12px !important; }

/* ── Secretary-only elements ── */
.secretary-only { display: none !important; }
body[data-role="secretaris"] .secretary-only { display: inline-block !important; }

.contacts-page-head,
.contacts-toolbar,
.contact-family-head,
.contact-family-footer,
.contact-child-row,
.contact-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.contacts-page-head {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.contacts-page-head h1 { margin: 0; }
.contacts-page-sub { margin: 4px 0 0; opacity: .7; font-size: 13px; }
.contacts-stats { color: #003A35; font-size: 13px; font-weight: 700; white-space: nowrap; }
.contacts-toolbar { flex-wrap: wrap; margin-bottom: 12px; }
.contacts-toolbar > input { flex: 1 1 320px; min-width: 220px; }
.contacts-filter { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; }
.contacts-status { min-height: 20px; margin-bottom: 10px; font-size: 12px; opacity: .7; }
.whatsapp-composer { margin-bottom: 16px; padding: 14px; border: 1px solid #b8cdb9; border-radius: 12px; background: #dce8dd; }
.whatsapp-composer-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.whatsapp-composer-head h2 { margin: 0; font-size: 15px; }
.whatsapp-composer-head span { font-size: 11px; opacity: .7; }
.whatsapp-composer-fields { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(260px, 1.8fr); gap: 10px; }
.whatsapp-composer-fields label { display: grid; gap: 4px; font-size: 12px; font-weight: 700; }
.whatsapp-composer-fields input, .whatsapp-composer-fields textarea { width: 100%; resize: vertical; }
.whatsapp-composer-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; }
#whatsappStatus { font-size: 12px; color: #003A35; }
.contacts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.contact-family-card { padding: 16px; border: 1px solid rgba(0,31,39,.09); border-radius: 12px; background: #fff; box-shadow: 0 4px 12px rgba(0,31,39,.06); }
.contact-family-card.is-incomplete { border-color: #fdba74; background: #fffaf5; }
.contact-family-head { justify-content: space-between; margin-bottom: 12px; }
.contact-family-head h2 { margin: 0; font-size: 18px; }
.contact-incomplete-badge { padding: 4px 7px; border-radius: 999px; background: #ffedd5; color: #9a3412; font-size: 11px; font-weight: 700; }
.contact-family-parents { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.contact-parent-block { display: grid; gap: 4px; min-width: 0; padding: 10px; border-radius: 8px; background: #eef4ee; font-size: 12px; }
.contact-parent-block span { overflow-wrap: anywhere; opacity: .75; }
.contact-actions { flex-wrap: wrap; margin-top: 3px; }
.contact-action { display: inline-flex; align-items: center; min-height: 30px; padding: 5px 8px; border-radius: 6px; color: #003A35; font-size: 11px; font-weight: 700; text-decoration: none; background: #dce8dd; }
.contact-action--whatsapp { color: #003A35; background: #dce8dd; }
.contact-action--call { color: #1F73C2; background: #d4e5f6; }
.contact-phone-status { color: #9a3412; font-size: 11px; }
.contact-phone-status.is-saved { color: #003A35; }
.contact-quality-modal { display:none; position:fixed; inset:0; z-index:3300; align-items:center; justify-content:center; padding:16px; }
.contact-quality-modal.open { display:flex; }
.contact-quality-backdrop { position:absolute; inset:0; background:rgba(0,31,39,.5); }
.contact-quality-dialog { position:relative; width:min(760px,100%); max-height:88vh; display:flex; flex-direction:column; background:#fff; border-radius:12px; box-shadow:0 22px 60px rgba(0,31,39,.28); overflow:hidden; }
.contact-quality-head { display:flex; justify-content:space-between; gap:12px; padding:16px; border-bottom:1px solid #dce8dd; }
.contact-quality-head h2 { margin:0; font-size:18px; }
.contact-quality-head p { margin:4px 0 0; font-size:12px; opacity:.7; }
.contact-quality-body { overflow:auto; padding:16px; display:grid; gap:8px; }
.contact-quality-item { display:grid; gap:3px; padding:10px; border-radius:8px; border:1px solid #fed7aa; background:#fff7ed; color:#9a3412; font-size:12px; }
.contact-quality-item--duplicate,.contact-quality-item--name { border-color:#fecaca; background:#fef2f2; color:#991b1b; }
.contact-quality-item span { overflow-wrap:anywhere; }
.contact-quality-ok { margin:0; padding:12px; color:#003A35; background:#dce8dd; border-radius:8px; font-size:12px; }
.contact-family-children { margin-top: 14px; }
.contact-family-children h3 { margin: 0 0 5px; font-size: 12px; }
.contact-child-row { justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #dce8dd; font-size: 12px; }
.contact-child-row span:last-child { opacity: .65; text-align: right; }
.contact-family-footer { justify-content: space-between; margin-top: 12px; font-size: 11px; opacity: .75; }

@media (max-width: 760px) {
  .contacts-page-head { align-items: flex-start; flex-direction: column; }
  .contacts-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .whatsapp-composer-fields { grid-template-columns: 1fr; }
  .contact-family-parents { grid-template-columns: 1fr; }
  .contact-child-row { align-items: flex-start; flex-direction: column; gap: 3px; }
  .contact-child-row span:last-child { text-align: left; }
}

/* Redesign: easier scanning, clearer focus, empty/loading states */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 0 16px;
  flex-wrap: wrap;
}
.page-head h1,
.page-head h2 {
  margin: 0;
}
.page-head-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: #001F27;
}
.page-shortcut-hint {
  margin: 0;
  font-size: 12px;
  color: #003A35;
  background: #e6eee9;
  border: 1px solid #dce8dd;
  border-radius: 999px;
  padding: 6px 10px;
}
.page-shortcut-hint kbd {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 4px;
  border: 1px solid #719A73;
  background: #fff;
  font-family: inherit;
  font-weight: 700;
  text-align: center;
}

.user-chip {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff;
  color: #003A35;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(0, 31, 39, 0.06);
  box-shadow: 0 4px 12px rgba(0, 31, 39, 0.06);
}

.continue-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #fff;
  flex: 0 0 auto;
}
.continue-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--primary);
  border: none;
  box-shadow: 0 4px 18px rgba(0, 58, 53, 0.18);
}
.continue-card[hidden] { display: none !important; }
.continue-card p {
  margin: 0;
  font-size: 13px;
  color: #eef4ee;
}
.continue-card a {
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
}
.continue-card a:hover { text-decoration: underline; }

.class-search {
  width: calc(100% - 16px);
  margin: 4px 8px 10px;
}

.table-state {
  text-align: center;
  padding: 28px 16px !important;
  color: #001F27;
  font-weight: 600;
  background: #eef4ee;
}
.table-state--loading { color: #003A35; }
.table-state--empty { color: #003A35; }

.login-card label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin: 0 0 4px;
  text-align: left;
}
.login-error {
  min-height: 18px;
  margin: 0;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 700;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--marine);
  outline-offset: 2px;
}

/* Gegevens invoeren */
.entry-panel {
  background: #ffffff;
  border-radius: 16px;
  padding: 18px;
  margin: 0 0 18px 0;
  box-shadow: 0 4px 18px rgba(0, 58, 53, 0.08);
}
.entry-panel .students-add-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px 14px;
  margin: 0 0 14px 0;
}
.entry-panel .students-add-section-title {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.entry-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.entry-message {
  margin: 0;
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
}
#entryYearSwitch {
  margin-bottom: 14px;
}

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

/* ---------- Login with Google ---------- */
.login-providers { display: grid; gap: 10px; margin: 8px 0 4px; }
.login-provider {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 10px 16px; border-radius: 10px;
  font-weight: 700; font-size: 1rem; text-decoration: none; border: 2px solid #c9d1ce;
  background: #fff; color: #1f2523;
}
.login-provider:hover, .login-provider:focus-visible { border-color: #003a35; }
.login-divider { display: flex; align-items: center; gap: 10px; margin: 6px 0 0; color: #5b6562; font-size: .9rem; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: #d5dbd9; }
.login-pending { display: grid; gap: 8px; text-align: center; }
.login-pending p { margin: 0; }

/* ---------- Users page ---------- */
.users-intro { max-width: 70ch; color: #4a5451; }
.users-section { margin-top: 1.5rem; }
.users-count { color: #8a4600; }
.users-empty { color: #5b6562; }
.user-card {
  display: grid; grid-template-columns: minmax(200px, 1.5fr) auto auto auto; gap: 12px; align-items: end;
  padding: 12px 14px; margin-bottom: 10px; border: 2px solid #f0c27a; border-radius: 12px; background: #fff8ec;
}
.user-card__who { display: grid; gap: 2px; }
.user-card__who span { color: #5b6562; font-size: .9rem; word-break: break-all; }
.user-card label { display: grid; gap: 4px; font-weight: 600; font-size: .9rem; }
.user-card__actions, .user-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.user-status { display: inline-block; padding: 2px 8px; border-radius: 999px; font-weight: 700; font-size: .85rem; white-space: nowrap; }
.user-status--pending { background: #fff1d9; color: #8a4600; }
.user-status--active { background: #e2f3ea; color: #146c43; }
.user-status--disabled { background: #fde8e6; color: #b42318; }
button.danger { background: #fff; color: #b42318; border: 1px solid #b42318; }
@media (max-width: 760px) { .user-card { grid-template-columns: 1fr; } }

/* School year shown next to the page controls */
.year-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border, #d9dfd9);
  border-radius: 8px;
  font-size: 14px;
}

/* Login: choose between logging in and making an account */
.login-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin: 4px 0 14px;
  border-radius: 10px;
  background: #eef2f0;
}
.login-tab {
  min-height: 40px;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #1f2523;
  font-weight: 700;
  font-size: 14px;
  box-shadow: none;
}
.login-tab[aria-selected="true"] {
  background: #fff;
  color: var(--primary, #003a35);
  box-shadow: 0 1px 4px rgba(0, 31, 39, 0.15);
}
.login-help {
  margin: 0 0 4px;
  font-size: 13px;
  color: #4a5451;
  text-align: left;
}
.login-notice {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #dce8dd;
  color: #003a35;
  font-size: 13px;
  text-align: left;
}
.login-fields label {
  align-self: stretch;
  margin: 4px 0 -6px;
}
.login-card {
  max-height: 96vh;
  overflow-y: auto;
}
.login-switch {
  margin: 4px 0 0;
  font-size: 13px;
  color: #4a5451;
}
.link-button {
  display: inline;
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: var(--primary, #003a35);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

