:root {
  --navy: #0a2750;
  --navy-2: #123c70;
  --ink: #101b34;
  --muted: #5c6b86;
  --line: #e7ecf5;
  --bg: #f4f8fc;
  --orange: #ff653c;
  --orange-2: #ff7e5f;
  --blue: #2f7cf6;
  --green: #17a957;
  --card-radius: 22px;
  --sidebar-w: 248px;
  --sidebar-w-collapsed: 78px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Cairo", "Tajawal", "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  direction: rtl;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- Layout shell ---------- */
.app {
  min-height: 100vh;
}

.main {
  margin-right: calc(var(--sidebar-w) + 16px);
  padding: 16px 22px 40px;
  min-width: 0;
  transition: margin 0.2s;
}
.app.is-collapsed .main {
  margin-right: calc(var(--sidebar-w-collapsed) + 16px);
}

/* ---------- Sidebar (white floating card, right side) ---------- */
.sidebar {
  position: fixed;
  top: 8px;
  bottom: 8px;
  right: 8px;
  width: var(--sidebar-w);
  background: #fff;
  border: 1px solid #e8edf5;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(28, 43, 72, 0.08);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 30;
  transition: width 0.2s;
}
.app.is-collapsed .sidebar {
  width: var(--sidebar-w-collapsed);
  padding: 16px 10px;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-direction: row-reverse;
  padding: 2px 6px 16px;
}
.app.is-collapsed .sidebar__brand {
  justify-content: center;
  padding-inline: 0;
}
.sidebar__brand-logo {
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 22px;
  overflow: hidden;
  box-shadow: 0 12px 24px rgba(255, 101, 60, 0.25);
}
.sidebar__brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sidebar__brand-text {
  min-width: 0;
}
.sidebar__brand h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 900;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar__brand span {
  font-size: 12px;
  color: #64748b;
  font-weight: 700;
}
.app.is-collapsed .sidebar__brand-text {
  display: none;
}

.sidebar__collapse {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  border: 1px solid #eef2f7;
  background: #fff;
  border-radius: 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  color: #64748b;
  cursor: pointer;
  margin-bottom: 12px;
  transition: 0.2s;
}
.sidebar__collapse:hover {
  background: #f7f9fc;
  color: var(--ink);
}

.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  border-top: 1px solid #eef2f7;
  padding-top: 12px;
}
.sidebar__nav::-webkit-scrollbar {
  width: 6px;
}
.sidebar__nav::-webkit-scrollbar-thumb {
  background: #e2e8f0;
  border-radius: 6px;
}

.sidebar__group {
  margin-bottom: 6px;
}
.sidebar__group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: row-reverse;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 900;
  color: #94a3b8;
  cursor: pointer;
  list-style: none;
  transition: 0.2s;
}
.sidebar__group > summary::-webkit-details-marker {
  display: none;
}
.sidebar__group > summary:hover {
  background: #f7f9fc;
  color: #64748b;
}
.sidebar__group > summary .chev {
  transition: transform 0.2s;
  font-size: 10px;
}
.sidebar__group[open] > summary .chev {
  transform: rotate(180deg);
}
.app.is-collapsed .sidebar__group > summary .lbl,
.app.is-collapsed .sidebar__group > summary .chev {
  display: none;
}

.sidebar__items {
  display: grid;
  gap: 5px;
  padding-top: 4px;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-direction: row-reverse;
  justify-content: space-between;
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  color: #475569;
  transition: 0.2s;
}
.sidebar__link:hover {
  background: #f7f9fc;
  color: var(--ink);
}
.sidebar__link.is-active {
  background: linear-gradient(to left, var(--orange), var(--orange-2));
  color: #fff;
  box-shadow: 0 14px 28px rgba(255, 101, 60, 0.26);
}
.sidebar__link-ico {
  width: 20px;
  text-align: center;
  flex: none;
}
.app.is-collapsed .sidebar__link {
  justify-content: center;
}
.app.is-collapsed .sidebar__link .lbl {
  display: none;
}

.sidebar__support {
  margin-top: 10px;
  border-radius: 14px;
  background: #eef6ff;
  padding: 12px;
}
.sidebar__support .ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #fff;
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(28, 43, 72, 0.06);
  margin-bottom: 8px;
}
.sidebar__support b {
  display: block;
  font-size: 14px;
  color: var(--blue);
}
.sidebar__support span {
  font-size: 12px;
  color: #4a74a8;
  font-weight: 700;
}
.app.is-collapsed .sidebar__support b,
.app.is-collapsed .sidebar__support span {
  display: none;
}
.app.is-collapsed .sidebar__support .ico {
  margin: 0 auto;
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 12px 18px;
  box-shadow: 0 16px 45px rgba(28, 43, 72, 0.06);
}
.topbar__left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-direction: row-reverse;
}
.lang-switch {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-direction: row-reverse;
  border: 1px solid var(--line);
  background: #fafbfd;
  border-radius: 999px;
  padding: 4px;
}
.lang-switch span.globe {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
}
.lang-switch button,
.lang-switch a {
  height: 30px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  border-radius: 999px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 900;
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
.lang-switch button.is-active,
.lang-switch a.is-active {
  background: var(--orange);
  color: #fff;
  box-shadow: 0 8px 18px rgba(255, 101, 60, 0.22);
}
.topbar__bell {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #475569;
}
.topbar__bell-btn {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
}
.notif-menu {
  position: absolute;
  top: calc(100% + 12px);
  inset-inline-start: 0;
  width: 280px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 22px 55px rgba(16, 27, 52, 0.16);
  padding: 8px;
  z-index: 60;
  display: none;
}
.notif-menu.open {
  display: flex;
  flex-direction: column;
  max-height: min(420px, 70vh);
}
/* Items scroll inside; header + "show all" footer stay pinned. */
.notif-menu__list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.notif-menu__head {
  padding: 8px 12px 10px;
  font-size: 14px;
  font-weight: 900;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.notif-menu__empty {
  padding: 18px 12px;
  text-align: center;
  color: #94a3b8;
  font-weight: 700;
  font-size: 13px;
}
.notif-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 800;
  color: #475569;
  transition: 0.15s;
}
.notif-item:hover {
  background: #f7f9fc;
  color: var(--ink);
}
.notif-item__ico {
  font-size: 18px;
  flex: 0 0 auto;
}
.notif-item__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.notif-item__text {
  flex: 1;
  white-space: normal;
  line-height: 1.35;
}
.notif-item__meta {
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
}
.notif-menu__all {
  display: block;
  margin-top: 6px;
  padding: 10px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 13px;
  font-weight: 900;
  color: var(--violet, #7c4dff);
}
.notif-menu__all:hover {
  background: #f7f9fc;
  border-radius: 0 0 12px 12px;
}
/* Full notifications page */
.notif-page-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}
.notif-page-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  transition: 0.15s;
}
.notif-page-item:hover {
  background: #f7f9fc;
  border-color: var(--panel-border, #ded2ff);
}
.notif-page-item__ico {
  font-size: 22px;
  flex: 0 0 auto;
}
.notif-page-item__body {
  flex: 1;
  min-width: 0;
}
.notif-page-item__body b {
  display: block;
  color: var(--deep-navy, #071f45);
  font-weight: 800;
  font-size: 14px;
}
.notif-page-item__body span {
  color: var(--soft-navy, #94a3b8);
  font-weight: 700;
  font-size: 12px;
}
.notif-item__count {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--orange);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.topbar__bell .badge {
  position: absolute;
  top: -2px;
  inset-inline-start: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--orange);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.topbar__user {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-direction: row-reverse;
  border-inline-end: 1px solid var(--line);
  padding-inline-end: 14px;
}
.topbar__avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1f2e4d, #6b7893);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}
.topbar__user-name {
  font-weight: 900;
  font-size: 14px;
}
.topbar__user-role {
  font-size: 12px;
  color: var(--muted);
}

.topbar__search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  flex: 1;
  max-width: 340px;
  border: 1px solid var(--line);
  background: #fafbfd;
  border-radius: 999px;
  padding: 0 16px;
  color: #94a3b8;
}
.topbar__search input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  color: #475569;
}

.topbar__welcome {
  text-align: right;
}
.topbar__welcome h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
}
.topbar__welcome p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Profile dropdown ---------- */
.topbar__user {
  position: relative;
}
.topbar__user-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-direction: row-reverse;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}
.topbar__chev {
  color: #94a3b8;
  font-size: 14px;
}
.app.is-ltr .topbar__user-btn {
  flex-direction: row;
}
.profile-menu {
  position: absolute;
  top: calc(100% + 12px);
  inset-inline-start: 0;
  width: 220px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 22px 55px rgba(16, 27, 52, 0.16);
  padding: 8px;
  z-index: 60;
  display: none;
}
.profile-menu.open {
  display: block;
}
.profile-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 800;
  color: #475569;
  transition: 0.15s;
}
.profile-menu a:hover {
  background: #f7f9fc;
  color: var(--ink);
}
.profile-menu__danger {
  color: #ef4444 !important;
}
.profile-menu__danger:hover {
  background: #fdecec !important;
}

/* ---------- Modal ---------- */
.ak-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 4vh 16px;
  overflow-y: auto;
}
.ak-modal.open {
  display: flex;
}
.ak-modal__overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 40, 0.55);
  backdrop-filter: blur(2px);
}
.ak-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(880px, 100%);
  margin: auto;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  overflow: hidden;
  animation: akPop 0.18s ease;
}
/* Body scrolls internally so the dialog never grows past the viewport. */
.ak-modal__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
@keyframes akPop {
  from {
    transform: translateY(14px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
.ak-modal__close {
  position: absolute;
  top: 10px;
  inset-inline-start: 14px;
  z-index: 3;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #475569;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 27, 52, 0.12);
}
.ak-modal__close:hover {
  background: #fff;
  color: #ef4444;
}
.ak-modal__body .card {
  margin-top: 0 !important;
  padding: 0 !important;
  overflow: hidden;
}
/* Header bar inside modal forms */
.ak-modal__body .card__head {
  margin: 0;
  padding: 20px 26px;
  background: linear-gradient(135deg, #f7f9fc, #eef3fb);
  border-bottom: 1px solid var(--line);
  padding-inline-start: 56px; /* room for the × */
}
.ak-modal__body .card__head .btn--ghost {
  display: none; /* the × handles closing */
}
.ak-modal__body form > .form-grid,
.ak-modal__body form > h3,
.ak-modal__body form > div:last-child {
  padding-inline: 26px;
}
.ak-modal__body form > .form-grid {
  margin-top: 18px;
  grid-template-columns: 1fr 1fr; /* balanced 2-col inside the modal */
  gap: 18px;
}
.ak-modal__body form > div:last-child {
  padding-bottom: 24px;
  padding-top: 4px;
}
.ak-modal__loading {
  background: #fff;
  border-radius: var(--card-radius);
  padding: 60px;
  text-align: center;
  font-size: 28px;
  color: #94a3b8;
}

/* ---------- Tabbed modal forms ---------- */
.ak-modal__body > form.card {
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}
.ak-modal__body > form.card > .card__head {
  flex: 0 0 auto;
  justify-content: center;
}
.ak-modal__body > form.card > .ak-tabs {
  flex: 0 0 auto;
}
.ak-modal__body > form.card > .ak-tabbody {
  flex: 1 1 auto;
  overflow-y: auto;
}
.ak-modal__body > form.card > .ak-form-footer {
  flex: 0 0 auto;
}

.ak-tabs {
  display: flex;
  flex-wrap: wrap;          /* Arabic tab labels are long: wrap rather than clip */
  gap: 6px;
  background: #f1f5fb;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 6px;
  margin: 18px 26px 4px;
}
.ak-tab {
  flex: 1 1 auto;
  min-width: max-content;   /* never squeeze a label past its own width */
  padding: 0 14px;
  white-space: nowrap;
  height: 46px;
  border: 0;
  background: transparent;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 900;
  font-size: 14px;
  color: #64748b;
  cursor: pointer;
  transition: 0.18s;
  white-space: nowrap;
}
.ak-tab:hover {
  color: var(--ink);
}
.ak-tab.is-active {
  background: #fff;
  color: var(--orange);
  box-shadow: 0 6px 16px rgba(28, 43, 72, 0.1);
}
.ak-tabbody {
  padding: 16px 26px 6px;
}
.ak-tabpane {
  display: none;
}
.ak-tabpane.is-active {
  display: block;
  animation: akFade 0.2s ease;
}
@keyframes akFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.ak-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 26px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.ak-form-footer .btn--primary {
  order: 2;
}
.ak-form-footer .btn--ghost {
  order: 1;
}

/* ---------- Required + inline validation ---------- */
.field label .req {
  color: #ef4444;
  margin-inline-start: 4px;
  font-weight: 900;
}
.field.has-error input,
.field.has-error select,
.field.has-error textarea {
  border-color: #ef4444 !important;
  background: #fff5f5 !important;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12) !important;
}
.field__error {
  display: none;
  color: #ef4444;
  font-weight: 800;
  font-size: 12px;
  margin-top: 6px;
}
.field.has-error .field__error {
  display: block;
}
.field input::placeholder,
.field textarea::placeholder {
  color: #aab4c4;
  font-weight: 600;
}

/* ---------- Save spinner + success panel ---------- */
.ak-spin {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: akRot 0.6s linear infinite;
  vertical-align: middle;
}
@keyframes akRot {
  to {
    transform: rotate(360deg);
  }
}
.ak-success {
  padding: 54px 30px;
  text-align: center;
  background: #fff;
}
.ak-success__check {
  width: 86px;
  height: 86px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  font-size: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 16px 36px rgba(16, 185, 129, 0.32);
  animation: akPopCheck 0.35s ease;
}
@keyframes akPopCheck {
  0% {
    transform: scale(0.4);
    opacity: 0;
  }
  60% {
    transform: scale(1.12);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
.ak-success p {
  font-size: 18px;
  font-weight: 900;
  color: #101b34;
  margin: 0;
}

/* ---------- Custom date picker ---------- */
.ak-date {
  position: relative;
}
.ak-date__field {
  cursor: pointer;
}
.ak-date__ico {
  position: absolute;
  inset-inline-start: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 16px;
  opacity: 0.7;
}
.ak-date__field {
  padding-inline-start: 38px !important;
}
.ak-cal {
  position: fixed;
  z-index: 320;
  width: 268px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(16, 27, 52, 0.22);
  padding: 12px;
  animation: akPop 0.16s ease;
}
.ak-cal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.ak-cal__head b {
  font-weight: 900;
  color: var(--ink);
  font-size: 14px;
}
.ak-cal__head button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 9px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 900;
  color: #475569;
  line-height: 1;
}
.ak-cal__head button:hover {
  background: #f7f9fc;
  color: var(--orange);
}
.ak-cal__sel {
  display: flex;
  gap: 6px;
  flex: 1;
  justify-content: center;
}
.ak-cal__sel select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 8px;
  font: inherit;
  font-weight: 800;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
  max-width: 120px;
}
.ak-cal__sel select:focus {
  outline: none;
  border-color: var(--orange, #f59e0b);
}
.ak-cal__time-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.ak-cal__time-row input[type="time"] {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  font: inherit;
  font-weight: 800;
  color: var(--ink);
}
.ak-cal__done {
  border: 0;
  border-radius: 8px;
  padding: 8px 16px;
  background: var(--orange, #f59e0b);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}
.ak-cal__done:hover {
  filter: brightness(1.05);
}
.ak-cal__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.ak-cal__dow span {
  text-align: center;
  font-size: 11px;
  font-weight: 900;
  color: #94a3b8;
  padding: 4px 0;
}
.ak-cal__day {
  height: 34px;
  border: 0;
  background: transparent;
  border-radius: 9px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  transition: 0.12s;
}
.ak-cal__day:hover {
  background: #eef3fb;
}
.ak-cal__day.is-today {
  color: var(--orange);
  box-shadow: inset 0 0 0 1.5px var(--orange);
}
.ak-cal__day.is-sel {
  background: linear-gradient(135deg, var(--orange), var(--orange-2));
  color: #fff;
  box-shadow: 0 6px 14px rgba(255, 101, 60, 0.3);
}
.ak-cal__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.ak-cal__foot button {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  color: var(--blue);
}
.ak-cal__foot button:hover {
  text-decoration: underline;
}

/* ---------- Custom select ---------- */
.ak-select {
  position: relative;
}
.ak-select > select {
  display: none;
}
.ak-select__trigger {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafbfd;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink);
  text-align: start;
}
.ak-select__trigger:hover {
  border-color: #cdd7e5;
}
.ak-select.is-open .ak-select__trigger {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(47, 124, 246, 0.14);
}
.ak-select__trigger.is-placeholder {
  color: #aab4c4;
  font-weight: 600;
}
.ak-select__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ak-select__chev {
  color: #94a3b8;
  font-size: 12px;
  transition: transform 0.2s;
  flex: none;
}
.ak-select.is-open .ak-select__chev {
  transform: rotate(180deg);
}
.ak-select__menu {
  position: fixed;
  z-index: 340;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(16, 27, 52, 0.22);
  padding: 6px;
  max-height: 340px;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* the inner list scrolls; search stays pinned */
  animation: akPop 0.16s ease;
}
.ak-select__search {
  flex: 0 0 auto;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  color: #1f2937;
  margin-bottom: 6px;
  outline: none;
}
.ak-select__search:focus {
  border-color: #2f7cf6;
  box-shadow: 0 0 0 3px rgba(47, 124, 246, 0.12);
}
.ak-select__list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
.ak-select__empty {
  padding: 12px;
  text-align: center;
  color: #94a3b8;
  font-weight: 700;
  font-size: 13px;
}
.ak-select__opt {
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  color: #334155;
  cursor: pointer;
  white-space: nowrap;
}
.ak-select__opt:hover {
  background: #eef3fb;
}
.ak-select__opt.is-sel {
  background: linear-gradient(135deg, var(--orange), var(--orange-2));
  color: #fff;
}
.field.has-error .ak-select__trigger {
  border-color: #ef4444 !important;
  background: #fff5f5 !important;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12) !important;
}

/* ---------- Multi-select (chips dropdown) ---------- */
.ak-multi {
  position: relative;
}
.ak-multi__control {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--panel-border, var(--line));
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}
.ak-multi.is-open .ak-multi__control {
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(255, 101, 60, 0.12);
}
.ak-multi__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.ak-multi__ph {
  flex: 1;
  color: #94a3b8;
  font-weight: 700;
  font-size: 14px;
}
.ak-multi__chev {
  color: #94a3b8;
  font-size: 12px;
}
.ak-multi__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 10px;
  border-radius: 999px;
  background: var(--surface-lavender, #f0eaff);
  border: 1px solid var(--panel-border, #ded2ff);
  color: var(--deep-navy, #071f45);
  font-size: 13px;
  font-weight: 800;
}
.ak-multi__x {
  border: 0;
  background: rgba(124, 77, 255, 0.16);
  color: var(--violet, #7c4dff);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ak-multi__x:hover {
  background: #ef4444;
  color: #fff;
}
.ak-multi__menu {
  position: fixed;
  z-index: 340;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(16, 27, 52, 0.22);
  padding: 6px;
  max-height: 360px;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* the inner list scrolls; search stays pinned */
  animation: akPop 0.16s ease;
}
.ak-multi__search {
  flex: 0 0 auto;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  color: #1f2937;
  margin-bottom: 6px;
  outline: none;
}
.ak-multi__search:focus {
  border-color: #2f7cf6;
  box-shadow: 0 0 0 3px rgba(47, 124, 246, 0.12);
}
.ak-multi__list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
.ak-multi__opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  color: #334155;
  cursor: pointer;
  white-space: nowrap;
}
.ak-multi__opt:hover {
  background: #eef3fb;
}
.ak-multi__opt.is-selected {
  background: #eaf2ff;
  color: #1d4ed8;
}
.ak-multi__tick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border-radius: 6px;
  border: 1.5px solid #cbd5e1;
  font-size: 12px;
  line-height: 1;
  color: #fff;
}
.ak-multi__opt.is-selected .ak-multi__tick {
  background: #2f7cf6;
  border-color: #2f7cf6;
}
.ak-multi__empty {
  padding: 12px;
  text-align: center;
  color: #94a3b8;
  font-weight: 700;
  font-size: 13px;
}

/* ---------- Form polish (modal + page) ---------- */
form.card .card__head {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
form.card h3 {
  position: relative;
  padding-inline-start: 14px;
  margin: 24px 0 12px;
  font-size: 15px;
  font-weight: 900;
  color: #101b34;
}
form.card h3::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 2px;
  bottom: 2px;
  width: 4px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--orange), var(--orange-2));
}
form.card .field label {
  color: #475569;
  margin-bottom: 7px;
}
form.card .field input,
form.card .field select,
form.card .field textarea {
  background: #fafbfd;
}
form.card .field input:focus,
form.card .field select:focus,
form.card .field textarea:focus {
  background: #fff;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  margin-top: 16px;
  border-radius: 26px;
  background: linear-gradient(135deg, #0a2750 0%, #123c70 55%, #1c4f8a 100%);
  color: #fff;
  padding: 28px 30px;
  box-shadow: 0 24px 60px rgba(11, 42, 85, 0.28);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.hero::before {
  content: "";
  position: absolute;
  right: -40px;
  top: -64px;
  width: 224px;
  height: 224px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  filter: blur(20px);
}
.hero::after {
  content: "";
  position: absolute;
  left: 40px;
  bottom: -80px;
  width: 192px;
  height: 192px;
  border-radius: 50%;
  background: rgba(255, 126, 95, 0.2);
  filter: blur(20px);
}
.hero__text {
  position: relative;
}
.hero h2 {
  margin: 12px 0 0;
  font-size: 28px;
  font-weight: 900;
}
.hero p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 600;
  max-width: 36rem;
}
.hero .chip {
  display: inline-flex;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.5px;
}
.hero__date {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 12px 18px;
  font-weight: 900;
  font-size: 14px;
  backdrop-filter: blur(4px);
}

/* ---------- Cards / stats ---------- */
.grid {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}
.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}
.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}
.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.stat {
  position: relative;
  overflow: hidden;
  background: #fff;
  border: 1px solid #eef2f8;
  border-radius: var(--card-radius);
  padding: 20px;
  box-shadow: 0 16px 45px rgba(28, 43, 72, 0.06);
  transition: 0.3s;
}
.stat:hover {
  transform: translateY(-4px);
  box-shadow: 0 26px 60px rgba(28, 43, 72, 0.13);
}
.stat::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--c, var(--blue)),
    color-mix(in srgb, var(--c, var(--blue)) 40%, transparent)
  );
}
.stat::after {
  content: "";
  position: absolute;
  right: -32px;
  top: -40px;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: var(--c, var(--blue));
  opacity: 0.14;
  filter: blur(28px);
}
.stat__top {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.stat__ico {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 24px;
  box-shadow: 0 10px 24px rgba(28, 43, 72, 0.16);
}
.stat__label {
  font-size: 12px;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
}
.stat__value {
  font-size: 32px;
  font-weight: 900;
  margin-top: 6px;
  color: var(--ink);
  line-height: 1;
}

.card {
  background: #fff;
  border: 1px solid #eef2f8;
  border-radius: var(--card-radius);
  padding: 20px;
  box-shadow: 0 16px 45px rgba(28, 43, 72, 0.06);
}
.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card__title {
  font-size: 16px;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-direction: row-reverse;
}
.card__title .ico {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: #eaf2ff;
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Donut + bars ---------- */
.donut {
  width: 168px;
  height: 168px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto;
  position: relative;
}
.donut::after {
  content: "";
  position: absolute;
  inset: 22px;
  background: #fff;
  border-radius: 50%;
}
.donut__center {
  position: relative;
  z-index: 1;
  text-align: center;
}
.donut__center b {
  display: block;
  font-size: 22px;
  font-weight: 900;
  color: var(--ink);
}
.donut__center span {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 800;
}
.bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  height: 180px;
  padding-top: 10px;
}
.bars .bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
  justify-content: flex-end;
}
.bars .bar .fill {
  width: 70%;
  max-width: 28px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #5aa0ff, #2f7cf6);
}
.bars .bar .val {
  font-size: 11px;
  font-weight: 900;
  color: #2f7cf6;
}
.bars .bar .lbl {
  font-size: 11px;
  font-weight: 800;
  color: #94a3b8;
}

/* ---------- Table ---------- */
.table-wrap {
  overflow-x: auto;
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.data th {
  background: #fafbfd;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
  text-align: right;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
table.data td {
  padding: 14px 16px;
  border-bottom: 1px solid #eef2f7;
  font-weight: 600;
  color: var(--muted);
}
table.data tr:last-child td {
  border-bottom: 0;
}
table.data tr:hover td {
  background: #fafbfd;
}
.name-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-direction: row-reverse;
}
.name-cell .av {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #eaf2ff;
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}
.name-cell b {
  color: var(--ink);
}
.pill {
  display: inline-flex;
  padding: 5px 12px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 800;
  background: #eaf2ff;
  color: var(--blue);
}
.pill.green {
  background: #e7f8ee;
  color: var(--green);
}
.pill.amber {
  background: #fff4e0;
  color: #c77c04;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 900;
  font-size: 14px;
  cursor: pointer;
  transition: 0.2s;
}
.btn--primary {
  background: linear-gradient(to left, var(--orange), var(--orange-2));
  color: #fff;
  box-shadow: 0 12px 26px rgba(255, 101, 60, 0.24);
}
.btn--primary:hover {
  transform: translateY(-2px);
}
.btn--ghost {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
}

.empty {
  text-align: center;
  color: #94a3b8;
  font-weight: 700;
  padding: 40px 0;
}

/* ---------- Login ---------- */
.login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  padding: 24px;
}
.login__card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 26px;
  padding: 34px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}
.login__logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--orange), #ffb020);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  font-size: 24px;
}
.login h1 {
  text-align: center;
  margin: 0;
  font-size: 22px;
  font-weight: 900;
}
.login p {
  text-align: center;
  color: var(--muted);
  margin: 6px 0 22px;
  font-size: 13px;
}
.field {
  margin-bottom: 14px;
}
.field label {
  display: block;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 6px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  background: #fff;
  outline: none;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(47, 124, 246, 0.14);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 860px) {
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 560px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}
.att-states {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.att-pill {
  position: relative;
  cursor: pointer;
}
.att-pill input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}
.att-pill span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  transition: 0.15s;
}
.att-pill input:checked + span {
  background: var(--c);
  color: #fff;
  border-color: var(--c);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--c) 30%, transparent);
}

/* Context heading shown when editing a sent list inside a modal */
.att-edit-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 4px 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.att-edit-head .ico {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--surface-lavender, #f0eaff);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.att-edit-head b {
  display: block;
  color: var(--deep-navy, #071f45);
  font-weight: 900;
}
.att-edit-head span {
  color: var(--soft-navy, #64748b);
  font-weight: 700;
  font-size: 13px;
}

/* Parent portal: child card hero */
.parent-child-card {
  overflow: hidden;
}
.parent-child__hero {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: -4px -4px 14px;
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(
    135deg,
    var(--surface-lavender, #f0eaff),
    #ffffff
  );
  border: 1px solid var(--panel-border, #ded2ff);
}
.parent-child__av {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    var(--violet, #7c4dff),
    var(--violet-2, #9a62ff)
  );
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 22px;
  overflow: hidden;
}
.parent-child__av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.parent-child__id {
  flex: 1;
  min-width: 0;
}
.parent-child__id h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  color: var(--deep-navy, #071f45);
}
.parent-child__id p {
  margin: 2px 0 0;
  color: var(--soft-navy, #64748b);
  font-weight: 700;
  font-size: 13px;
}
.parent-child__chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chip-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
  background: #fff;
  border: 1px solid var(--panel-border, #ded2ff);
}
.chip-stat--abs {
  color: #ef4444;
}
.chip-stat--paid {
  color: #17a957;
}

/* Parent portal: absence notifications */
.parent-notifs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.parent-notif {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
}
.parent-notif.is-absent {
  background: #fdecec;
  border-color: #f7c9c9;
}
.parent-notif.is-late {
  background: #fff7e8;
  border-color: #f3dcae;
}
.parent-notif__ico {
  font-size: 20px;
}
.parent-notif b {
  display: block;
  color: var(--deep-navy, #071f45);
  font-weight: 900;
  font-size: 14px;
}
.parent-notif span {
  color: var(--soft-navy, #64748b);
  font-weight: 700;
  font-size: 12px;
}
.parent-notif__msg {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  border: 1px dashed #f0b4b4;
  color: #b4232a;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.5;
}
.parent-notif.is-absent {
  align-items: flex-start;
}

/* ============================================================
   Parent portal — modern, parent-friendly layout
   ============================================================ */
.ph-hero__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.ph-hero__pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  backdrop-filter: blur(4px);
}
.ph-alerts {
  border-color: #f7c9c9;
  box-shadow: 0 8px 26px rgba(239, 68, 68, 0.08);
}

/* Child card */
.pc-card {
  overflow: hidden;
}
.pc-head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: -4px -4px 16px;
  padding: 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, #f1ecff, #ffffff 70%);
  border: 1px solid #e4dbff;
}
.pc-av {
  width: 60px;
  height: 60px;
  flex: 0 0 auto;
  border-radius: 18px;
  background: linear-gradient(135deg, #7c4dff, #9a62ff);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 24px;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(124, 77, 255, 0.28);
}
.pc-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pc-id {
  flex: 1;
  min-width: 0;
}
.pc-id h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 900;
  color: var(--deep-navy, #071f45);
}
.pc-id p {
  margin: 3px 0 0;
  color: var(--soft-navy, #64748b);
  font-weight: 700;
  font-size: 13px;
}
.pc-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
  background: #fff;
  border: 1px solid #e4dbff;
}
.pc-chip--abs {
  color: #ef4444;
  border-color: #f7c9c9;
  background: #fff5f5;
}
.pc-chip--ok {
  color: #17a957;
  border-color: #bce8cf;
  background: #f0fbf5;
}
.pc-chip--paid {
  color: #0e8a47;
}
.pc-chip--note {
  color: #7c4dff;
  border-color: #ddd0ff;
  background: #f6f2ff;
}

/* Sections inside a child card */
.pc-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.pc-sec {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  background: #fbfcfe;
}
.pc-sec--notes {
  margin-top: 14px;
}
.pc-sec__head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
  color: var(--deep-navy, #071f45);
  font-size: 14px;
  margin-bottom: 12px;
}
.pc-sec__ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  font-size: 15px;
}
.pc-sec__ico--abs {
  background: #fde8e8;
}
.pc-sec__ico--paid {
  background: #e7f8ee;
}
.pc-sec__ico--note {
  background: #f0e9ff;
}
.pc-sec__n {
  margin-inline-start: auto;
  padding: 3px 11px;
  border-radius: 999px;
  background: #eef2f7;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}
.pc-sec__n--paid {
  background: #e7f8ee;
  color: #0e8a47;
}
.pc-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
}
.pc-row__main {
  font-weight: 800;
  color: var(--ink, #1f2937);
  font-size: 13px;
}
.pc-row__amount {
  margin-inline-start: auto;
  font-weight: 900;
  color: #0e8a47;
  font-size: 14px;
}
.pc-row .pill {
  margin-inline-start: auto;
}
.pc-row__amount + .pill {
  margin-inline-start: 0;
}
.pc-empty {
  margin: 0;
  padding: 16px;
  text-align: center;
  border-radius: 12px;
  background: #fff;
  border: 1px dashed var(--line);
  color: #94a3b8;
  font-weight: 700;
  font-size: 13px;
}
.pc-empty--ok {
  color: #17a957;
  border-color: #bce8cf;
  background: #f4fbf7;
}

/* Contact card */
.ph-contact__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.ph-contact__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: #f7f9fc;
  border: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition:
    background 0.15s,
    border-color 0.15s;
}
a.ph-contact__item:hover {
  background: #eef4ff;
  border-color: #cfe0ff;
}
.ph-contact__item--wide {
  grid-column: 1 / -1;
}
.ph-contact__ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 19px;
}
.ph-contact__item small {
  display: block;
  color: var(--soft-navy, #94a3b8);
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 2px;
}
.ph-contact__item b {
  color: var(--deep-navy, #071f45);
  font-weight: 800;
  font-size: 14px;
  word-break: break-word;
}

@media (max-width: 760px) {
  .pc-sections,
  .ph-contact__grid {
    grid-template-columns: 1fr;
  }
  .pc-head {
    padding: 14px;
  }
}

/* Exam test-document (PDF) upload */
.exam-doc-upload {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.exam-doc-upload__drop {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border: 1.5px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  cursor: pointer;
  font-weight: 700;
  color: #475569;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.exam-doc-upload__drop:hover {
  border-color: #7c4dff;
  background: #f6f2ff;
}
.exam-doc-upload__ico {
  font-size: 18px;
}
.exam-doc-upload__current {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: 999px;
  background: #f0e9ff;
  border: 1px solid #ddd0ff;
  color: #7c4dff;
  font-weight: 800;
  font-size: 13px;
  text-decoration: none;
}

/* Monthly payment status (student profile) */
.pay-status {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pay-status__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-weight: 800;
  color: var(--soft-navy, #64748b);
  font-size: 13px;
}
.pay-status__bar b {
  color: var(--ink, #1f2937);
}
.pay-status__owed {
  color: #ef4444;
}
.pay-status__ok {
  color: #17a957;
}
.pay-months {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}
.pay-month {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 800;
  font-size: 12.5px;
  color: var(--ink, #1f2937);
}
.pay-month i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border-radius: 6px;
  font-style: normal;
  font-size: 12px;
  color: #fff;
}
.pay-month.is-paid {
  background: #f0fbf5;
  border-color: #bce8cf;
  color: #0e8a47;
}
.pay-month.is-paid i {
  background: #17a957;
}
.pay-month.is-due {
  background: #fff5f5;
  border-color: #f7c9c9;
  color: #d03333;
}
.pay-month.is-due i {
  background: #ef4444;
}
.pay-month.is-future {
  color: #94a3b8;
}
.pay-month.is-future i {
  background: #cbd5e1;
}
.pay-status__btn {
  align-self: flex-start;
}

/* Pay modal: student info + month picker */
.pay-student {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfcfe;
}
.pay-student__av {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 20px;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  overflow: hidden;
}
.pay-student__av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pay-student__grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
}
.pay-student__grid span {
  display: block;
  color: var(--soft-navy, #94a3b8);
  font-weight: 700;
  font-size: 12px;
}
.pay-student__grid b {
  color: var(--deep-navy, #071f45);
  font-weight: 800;
  font-size: 14px;
}
.pay-pick {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}
.pay-pick__month {
  position: relative;
  cursor: pointer;
}
.pay-pick__month input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}
.pay-pick__month span {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 11px 10px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: #fff;
  font-weight: 800;
  font-size: 12.5px;
  color: #475569;
  transition: 0.15s;
}
.pay-pick__month.is-on span {
  border-color: #17a957;
  background: #f0fbf5;
  color: #0e8a47;
  box-shadow: 0 6px 14px rgba(23, 169, 87, 0.18);
}
.pay-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #f0fbf5;
  border: 1px solid #bce8cf;
  font-weight: 800;
  color: #0e8a47;
}
.pay-total b {
  font-size: 20px;
}
.pay-done {
  text-align: center;
  padding: 26px 18px 30px;
}
.pay-done__check {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: #fff;
  background: linear-gradient(135deg, #17a957, #10b981);
  box-shadow: 0 14px 30px rgba(23, 169, 87, 0.3);
}
.pay-done p {
  font-weight: 900;
  color: var(--deep-navy, #071f45);
  font-size: 17px;
  margin: 0 0 18px;
}
.pay-done__actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Global navigation loading — modal overlay with a spinner */
#akNavLoader {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 20, 40, 0.45);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s;
}
#akNavLoader.is-on {
  opacity: 1;
  visibility: visible;
}
.akNavLoader__box {
  width: 84px;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(9, 18, 35, 0.3);
  animation: akPop 0.18s ease;
}
.akNavLoader__spin {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 4px solid #e6e0ff;
  border-top-color: #7c4dff;
  animation: akSpin 0.7s linear infinite;
}
@keyframes akSpin {
  to {
    transform: rotate(360deg);
  }
}

/* Table pagination (long tables) */
.ak-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  padding: 14px 8px 4px;
}
.ak-pager__btn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  font: inherit;
  font-weight: 800;
  font-size: 13px;
  color: #475569;
  cursor: pointer;
  transition: 0.15s;
}
.ak-pager__btn:hover:not(:disabled) {
  border-color: #cfe0ff;
  background: #f4f8ff;
}
.ak-pager__btn.is-active {
  background: linear-gradient(135deg, #7c4dff, #9a62ff);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 14px rgba(124, 77, 255, 0.28);
}
.ak-pager__btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.ak-pager__size {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-weight: 800;
  font-size: 13px;
  color: #475569;
  cursor: pointer;
  margin-inline-end: 6px;
}
.ak-pager__dots {
  align-self: center;
  color: #94a3b8;
  font-weight: 800;
  padding: 0 2px;
}

/* Dashboard hero period selector */
.hero__period {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.hero__period label {
  color: #fff;
  font-weight: 800;
  font-size: 14px;
}
.hero__period select {
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border-radius: 10px;
  padding: 9px 14px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  backdrop-filter: blur(4px);
}
.hero__period select option {
  color: #1f2937;
}

/* School overview page */
.ov-range {
  margin: 14px 0 10px;
  font-weight: 800;
  color: var(--soft-navy, #64748b);
}
.ov-range b {
  color: var(--ink, #1f2937);
}
.ov-cards {
  margin-top: 4px;
}
.ov-net {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  background: #f7f3ff;
  border: 1px solid #ded2ff;
  font-weight: 800;
  color: var(--deep-navy, #071f45);
}
.ov-net b {
  font-size: 18px;
}
.ov-pos {
  color: #17a957;
}
.ov-neg {
  color: #ef4444;
}

/* Manual multi-add tag input (e.g. school subjects) */
.tag-input {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}
.tag-input__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag-input__chips:empty {
  display: none;
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: #f0e9ff;
  border: 1px solid #ddd0ff;
  color: #6d28d9;
  font-weight: 800;
  font-size: 13px;
}
.tag-chip__x {
  border: 0;
  background: transparent;
  color: #6d28d9;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.tag-chip__x:hover {
  color: #ef4444;
}
.tag-input__add {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.tag-input__add input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-weight: 700;
}
.tag-input__add .btn {
  white-space: nowrap;
}

/* Class + date picker inside the attendance modal */
.ak-modal__body .attendance-card .att-modal-pick {
  margin-top: 14px;
  margin-bottom: 2px;
}

/* Weekly schedule builder (class form) */
.sched-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.sched-day {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fbfcfe;
}
.sched-day__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.sched-day__head b {
  font-weight: 900;
  color: var(--deep-navy, #071f45);
  font-size: 14px;
}
.sched-add {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
  color: #f59e0b;
  border-color: #f6d99a;
}
.sched-add:hover {
  background: #fff7e8;
}
.sched-day__rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sched-day__rows:empty {
  display: none;
}
.sched-row {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 8px;
}
.sched-row input[type="time"] {
  width: 92px;
  flex: 0 0 auto;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-weight: 700;
}
.sched-row select,
.sched-row .ak-select {
  flex: 1;
  min-width: 0;
}
.sched-row select {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-weight: 700;
  background: #fff;
}
.sched-row .ak-select__trigger {
  height: 36px;
  padding: 0 10px;
}
.sched-sep {
  color: #94a3b8;
  font-weight: 800;
}
.sched-del {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: #fde8e8;
  color: #ef4444;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.sched-del:hover {
  background: #f9d3d3;
}
/* Read-only schedule rows (class view) */
.sched-view-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
}
.sched-view-time {
  font-weight: 800;
  color: var(--ink, #1f2937);
  font-size: 13px;
}
.sched-view-teacher {
  color: var(--soft-navy, #64748b);
  font-weight: 700;
  font-size: 13px;
}
.sched-view-subject {
  color: var(--violet, #7c4dff);
  font-weight: 800;
  font-size: 13px;
}
@media (max-width: 760px) {
  .sched-grid {
    grid-template-columns: 1fr;
  }
  .sched-row {
    flex-wrap: wrap;
  }
  .sched-row select {
    flex: 1 1 45%;
  }
}

/* Director attendance tabs: all absences | lists sent by teachers */
.att-record-tabs {
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.att-tab-pane[hidden] {
  display: none;
}

/* "Already sent" banner on the attendance page */
.att-sent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 16px 0 4px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #eef6ff;
  border: 1px solid #cfe3ff;
}
.att-sent__ico {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #2f6fed;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}
.att-sent b {
  display: block;
  color: var(--deep-navy, #071f45);
  font-weight: 900;
}
.att-sent span {
  color: var(--soft-navy, #475569);
  font-weight: 700;
  font-size: 13px;
}

/* Attendance summary cards (present / absent / late counts) */
.att-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 18px 0 4px;
}
.att-summary__card {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(16, 27, 52, 0.05);
  overflow: hidden;
}
.att-summary__card::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 4px;
}
.att-summary__card--present::before {
  background: #17a957;
}
.att-summary__card--absent::before {
  background: #ef4444;
}
.att-summary__card--late::before {
  background: #c77c04;
}
.att-summary__card--total::before {
  background: var(--violet, #7c4dff);
}
.att-summary__card .att-total {
  color: var(--deep-navy, #071f45);
}
.att-summary__card b {
  display: block;
  font-size: 28px;
  font-weight: 900;
  line-height: 1.1;
}
.att-summary__card .att-present {
  color: #17a957;
}
.att-summary__card .att-absent {
  color: #ef4444;
}
.att-summary__card .att-late {
  color: #c77c04;
}
.att-summary__card span {
  color: var(--soft-navy, #64748b);
  font-weight: 800;
  font-size: 14px;
}
@media (max-width: 640px) {
  .att-summary {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* Attendance roster shown inside the edit modal: header bar + even padding */
.ak-modal__body .attendance-card {
  padding: 0 !important;
  overflow: visible !important; /* let the header stick while the body scrolls */
}
.ak-modal__body .attendance-card .att-edit-head {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 0;
  padding: 18px 26px;
  padding-inline-start: 60px; /* clear the × close button */
  background: linear-gradient(135deg, #f7f9fc, #eef3fb);
  border-bottom: 1px solid var(--line);
}
.ak-modal__body .attendance-card > *:not(.att-edit-head) {
  padding-inline: 26px;
}
.ak-modal__body .attendance-card .att-sent,
.ak-modal__body .attendance-card .att-summary {
  margin-top: 18px;
}
.ak-modal__body .attendance-card .att-form {
  padding-bottom: 6px;
}
.ak-modal__body .attendance-card .att-form > div:last-child {
  margin-top: 18px;
  padding-top: 16px;
  padding-bottom: 22px;
  border-top: 1px solid var(--line);
}
.ak-modal__body .attendance-card .table-wrap {
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-top: 4px;
  margin-bottom: 24px;
  max-height: 46vh;
  overflow-y: auto;
}
/* Keep the table header visible while the list scrolls inside the modal. */
.ak-modal__body .attendance-card .table-wrap table.data thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f3f6fb;
}

/* ---- Class-attendance modal: one clean scroll for the full modal body. ---- */
.ak-modal__body .att-mark-card {
  display: block;
  max-height: none;
  overflow: visible !important;
}
.ak-modal__body .att-mark-card .att-edit-head,
.ak-modal__body .att-mark-card .att-modal-pick,
.ak-modal__body .att-mark-card .att-summary,
.ak-modal__body .att-mark-card .att-sent,
.ak-modal__body .att-mark-card > .alert,
.ak-modal__body .att-mark-card > h3 {
  flex: 0 0 auto;
}
.ak-modal__body .att-mark-card .att-summary {
  margin-top: 16px;
}
.ak-modal__body .att-mark-card .att-form {
  display: block;
  padding-bottom: 0;
}
.ak-modal__body .att-mark-card .att-form > .table-wrap,
.ak-modal__body .att-mark-card .att-form > .att-roster {
  min-height: 0;
  max-height: none;
  margin-bottom: 0;
  overflow: visible;
}

/* Modern student roster (card list) inside the attendance modal */
.att-roster {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 0 4px;
}
.att-person {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.att-person:hover {
  border-color: #cfe0ff;
  box-shadow: 0 6px 18px rgba(16, 27, 52, 0.06);
}
.att-person__av {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 18px;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  overflow: hidden;
}
.att-person__av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.att-person__info {
  flex: 1;
  min-width: 0;
}
.att-person__info b {
  display: block;
  color: var(--deep-navy, #071f45);
  font-weight: 800;
  font-size: 15px;
}
.att-person__info span {
  display: block;
  color: var(--soft-navy, #94a3b8);
  font-weight: 700;
  font-size: 12px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.att-person .att-states {
  flex: 0 0 auto;
  margin-inline-start: auto;
}
@media (max-width: 560px) {
  .att-person {
    flex-wrap: wrap;
  }
  .att-person .att-states {
    width: 100%;
    margin-inline-start: 0;
    justify-content: stretch;
  }
  .att-person .att-pill {
    flex: 1;
  }
}
.ak-modal__body .att-mark-card .att-form > div:last-child {
  flex: 0 0 auto;
  position: sticky;
  bottom: 0;
  z-index: 6;
  margin-top: 0;
  padding-top: 14px;
  padding-bottom: 18px;
  background: #fff;
  border-top: 1px solid var(--line);
}
/* Picker row: two equal, aligned, full-width fields */
.ak-modal__body .att-mark-card .att-modal-pick {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 16px;
  align-items: start;
}
.ak-modal__body .att-mark-card .att-modal-pick .field {
  margin: 0;
  padding: 0;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: flex-start;
}
.ak-modal__body .att-mark-card .att-modal-pick .ak-select,
.ak-modal__body .att-mark-card .att-modal-pick .ak-date,
.ak-modal__body .att-mark-card .att-modal-pick .ak-select__trigger,
.ak-modal__body .att-mark-card .att-modal-pick .ak-date__field,
.ak-modal__body .att-mark-card .att-modal-pick input[type="time"] {
  width: 100%;
}
.ak-modal__body .att-mark-card .att-modal-pick .ak-select__trigger,
.ak-modal__body .att-mark-card .att-modal-pick .ak-date__field,
.ak-modal__body .att-mark-card .att-modal-pick input[type="time"] {
  min-height: 56px;
  height: 56px;
  border-radius: 16px;
}
@media (max-width: 620px) {
  .ak-modal__body .att-mark-card .att-modal-pick {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* Full-page picker: class -> subject -> date -> time on one row. */
.att-mark-card .att-pick {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
}
.att-mark-card .att-pick .field {
  margin: 0;
  min-width: 0;
}
.att-mark-card .att-pick .ak-time {
  width: 100%;
}
@media (max-width: 1100px) {
  .att-mark-card .att-pick {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}
@media (max-width: 560px) {
  .att-mark-card .att-pick {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* Declutter the roster: the class is identical for every row in this modal */
.ak-modal__body .att-mark-card table.data thead th:nth-child(3),
.ak-modal__body .att-mark-card table.data tbody td:nth-child(3) {
  display: none;
}
.ak-modal__body .att-mark-card table.data th,
.ak-modal__body .att-mark-card table.data td {
  vertical-align: middle;
}
.ak-modal__body .att-mark-card .name-cell b {
  white-space: nowrap;
}
.ak-modal__body .att-mark-card table.data tbody td {
  padding-top: 14px;
  padding-bottom: 14px;
}

/* Segmented-control look for the status toggle inside the roster modal */
.ak-modal__body .att-mark-card .att-states {
  background: #eef2f8;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}
.ak-modal__body .att-mark-card .att-pill {
  flex: 1;
}
.ak-modal__body .att-mark-card .att-pill span {
  width: 100%;
  min-width: 58px;
  height: 34px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: #64748b;
}
/* Selected status fills with its colour (higher specificity than the
   transparent base above, so the active pill is clearly highlighted). */
.ak-modal__body .att-mark-card .att-pill input:checked + span {
  background: var(--c);
  border-color: var(--c);
  color: #fff;
  box-shadow: 0 6px 14px color-mix(in srgb, var(--c) 32%, transparent);
}
.ak-modal__body .att-mark-card table.data tbody tr:hover {
  background: #f7faff;
}

/* Modern modal refresh */
.ak-modal {
  padding: 3vh 18px;
}

.ak-modal__overlay {
  background:
    radial-gradient(
      circle at 16% 18%,
      rgba(124, 77, 255, 0.2),
      transparent 34%
    ),
    rgba(9, 18, 35, 0.62);
  backdrop-filter: blur(6px);
}

.ak-modal__dialog {
  width: min(560px, 100%);
  max-height: 94vh;
  border: 1px solid rgba(222, 210, 255, 0.7);
  border-radius: 24px;
  background: #f8f9fd;
  box-shadow: 0 34px 90px rgba(9, 18, 35, 0.34);
}
/* Wider dialog only for forms that truly need it (weekly schedule grid). */
.ak-modal__dialog:has(.sched-grid),
.ak-modal__dialog:has(.finance-form-wide) {
  width: min(900px, 100%);
}

.ak-modal__body {
  background:
    linear-gradient(
      180deg,
      rgba(248, 249, 253, 0.98),
      rgba(255, 255, 255, 0.98)
    ),
    var(--surface);
  scrollbar-gutter: stable;
}

.ak-modal__body::-webkit-scrollbar {
  width: 10px;
}

.ak-modal__body::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: rgba(124, 77, 255, 0.26);
  background-clip: padding-box;
}

.ak-modal__close {
  top: 18px;
  left: 22px;
  right: auto;
  inset-inline-start: auto;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(222, 210, 255, 0.85);
  background: rgba(255, 255, 255, 0.96);
  color: #263452;
  font-size: 24px;
  z-index: 10;
  box-shadow: 0 14px 30px rgba(16, 27, 52, 0.18);
}

.ak-modal__body .att-mark-card {
  max-height: 94vh;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.ak-modal__body .att-mark-card .att-edit-head {
  min-height: 88px;
  padding: 18px 34px;
  padding-inline-start: 86px;
  background:
    radial-gradient(
      circle at 18% 20%,
      rgba(124, 77, 255, 0.12),
      transparent 32%
    ),
    linear-gradient(135deg, #f9fbff, #eef3fb);
  border-bottom: 1px solid rgba(222, 210, 255, 0.8);
}

.ak-modal__body .att-mark-card .att-edit-head .ico {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  color: var(--violet, #7c4dff);
  background: #fff;
  box-shadow: 0 16px 34px rgba(124, 77, 255, 0.12);
}

.ak-modal__body .att-mark-card .att-edit-head b {
  font-size: 22px;
  line-height: 1.25;
}

.ak-modal__body .att-mark-card .att-edit-head span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.ak-modal__body .att-mark-card > h3 {
  margin: 14px 34px 8px;
}

.ak-modal__body .att-mark-card .att-modal-pick {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  align-items: start;
  margin: 0 34px 14px;
  padding: 14px;
  border: 1px solid rgba(222, 210, 255, 0.85);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 16px 36px rgba(91, 64, 155, 0.08);
}

.ak-modal__body .att-mark-card .att-modal-pick label {
  margin-bottom: 8px;
  color: var(--deep-navy, #071f45);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
  min-height: 16px;
}

.ak-modal__body .att-mark-card .att-summary {
  margin: 0 34px 14px;
  gap: 16px;
}

.ak-modal__body .att-mark-card .att-summary__card {
  min-height: 84px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(91, 64, 155, 0.08);
}

.ak-modal__body .att-mark-card .att-form {
  padding-inline: 34px;
}

.ak-modal__body .att-mark-card .att-roster {
  padding: 12px;
  border: 1px solid rgba(222, 210, 255, 0.85);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.ak-modal__body .att-mark-card .att-person {
  border-color: rgba(222, 210, 255, 0.75);
  box-shadow: 0 10px 24px rgba(91, 64, 155, 0.05);
}

.ak-modal__body .att-mark-card .att-form > .att-roster {
  padding-inline: 12px;
}

.ak-modal__body .att-mark-card .att-form > .att-form-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px -34px 0;
  padding: 14px 34px 16px;
  background: #fff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -10px 24px rgba(16, 27, 52, 0.05);
}
/* primary on the inline-end (left in RTL), notify on the inline-start */
.ak-modal__body .att-mark-card .att-form-actions .btn--primary {
  order: 2;
}
.ak-modal__body .att-mark-card .att-form-actions .btn--ghost {
  order: 1;
}

.ak-modal__body .att-mark-card .att-form-actions .btn {
  min-height: 44px;
  border-radius: 16px;
  padding-inline: 26px;
  font-weight: 900;
}

.ak-modal__body .att-mark-card .att-form-actions .btn--primary {
  box-shadow: 0 16px 30px rgba(124, 77, 255, 0.3);
}

@media (max-width: 760px) {
  .ak-modal {
    padding: 12px;
  }

  .ak-modal__dialog {
    border-radius: 24px;
  }

  .ak-modal__close {
    top: 14px;
    left: 14px;
    right: auto;
    inset-inline-start: auto;
  }

  .ak-modal__body .att-mark-card .att-edit-head {
    padding: 22px 20px;
    padding-inline-start: 66px;
  }

  .ak-modal__body .att-mark-card .att-edit-head b {
    font-size: 19px;
  }

  .ak-modal__body .att-mark-card > h3,
  .ak-modal__body .att-mark-card .att-modal-pick,
  .ak-modal__body .att-mark-card .att-summary {
    margin-inline: 18px;
  }

  .ak-modal__body .att-mark-card .att-modal-pick {
    grid-template-columns: 1fr !important;
  }

  .ak-modal__body .att-mark-card .att-form {
    padding-inline: 18px;
  }

  .ak-modal__body .att-mark-card .att-form > .att-form-actions {
    margin-inline: -18px;
    padding-inline: 18px;
    flex-direction: column-reverse;
  }

  .ak-modal__body .att-mark-card .att-form-actions .btn {
    width: 100%;
  }
}

/* ---- General mobile pass for ALL modals & forms ---- */
@media (max-width: 600px) {
  .ak-modal {
    padding: 10px;
  }
  .ak-modal__dialog {
    width: 100%;
    max-height: 94vh;
    border-radius: 22px;
  }
  /* Single column so modal fields aren't cramped two-up on a phone */
  .ak-modal__body form > .form-grid {
    grid-template-columns: 1fr !important;
    gap: 13px;
  }
  /* Tighter side insets inside modal forms */
  .ak-modal__body form > .form-grid,
  .ak-modal__body form > h3,
  .ak-modal__body form > div:last-child {
    padding-inline: 16px;
  }
  .ak-tabbody {
    padding-inline: 16px;
  }
  /* Tabbed-modal footer: stack full-width buttons, primary on top */
  .ak-form-footer {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 10px;
    padding: 14px 16px;
  }
  .ak-form-footer .btn {
    width: 100%;
  }
  /* Plain (non-tabbed) modal action row: stack too */
  .ak-modal__body form > div:last-child {
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
  }
  .ak-modal__body form > div:last-child > .btn {
    width: 100%;
  }
  /* Page forms: comfortable single column on small phones */
  .form-grid {
    grid-template-columns: 1fr;
  }
  /* Keep inputs from overflowing their container */
  .ak-modal__body input,
  .ak-modal__body select,
  .ak-modal__body textarea {
    max-width: 100%;
  }
}

.alert {
  background: #fdecec;
  color: #d03333;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 14px;
  text-align: center;
}

/* ---------- LTR (French / English) ---------- */
.app.is-ltr .sidebar {
  right: auto;
  left: 8px;
}
.app.is-ltr .main {
  margin-right: 0;
  margin-left: calc(var(--sidebar-w) + 16px);
}
.app.is-ltr.is-collapsed .main {
  margin-left: calc(var(--sidebar-w-collapsed) + 16px);
}
.app.is-ltr .sidebar__brand,
.app.is-ltr .topbar__left,
.app.is-ltr .topbar__user,
.app.is-ltr .name-cell,
.app.is-ltr .card__title,
.app.is-ltr .sidebar__link,
.app.is-ltr .sidebar__group > summary,
.app.is-ltr .lang-switch {
  flex-direction: row;
}
.app.is-ltr .topbar__welcome,
.app.is-ltr table.data th,
.app.is-ltr table.data td {
  text-align: left;
}
/* Tables read left-to-right in French / English (natural column order). */
.app.is-ltr table.data {
  direction: ltr;
}
/* Search / text inputs align with the LTR reading direction. */
.app.is-ltr .toolbar input,
.app.is-ltr .toolbar .field,
.app.is-ltr input[type="search"],
.app.is-ltr .search input {
  direction: ltr;
  text-align: left;
}
.app.is-ltr .topbar__user {
  border-inline-end: 0;
  border-inline-start: 1px solid var(--line);
  padding-inline-end: 0;
  padding-inline-start: 14px;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .sidebar {
    position: fixed;
    inset: auto 8px 8px 8px;
    top: auto;
    width: auto;
    flex-direction: row;
    height: auto;
    padding: 8px;
    overflow-x: auto;
  }
  .sidebar__brand,
  .sidebar__collapse,
  .sidebar__support,
  .sidebar__group > summary {
    display: none;
  }
  .sidebar__nav {
    border: 0;
    padding: 0;
    display: flex;
    gap: 6px;
  }
  .sidebar__group {
    margin: 0;
  }
  .sidebar__group[open] > .sidebar__items,
  .sidebar__items {
    display: flex;
    gap: 6px;
  }
  .sidebar__link .lbl {
    display: none;
  }
  .main {
    margin: 0;
    padding: 14px 14px 90px;
  }
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* ---------- 2026 modern refresh ---------- */
:root {
  --navy: #0f2747;
  --navy-2: #173a63;
  --ink: #132033;
  --muted: #66758f;
  --line: #dde6f0;
  --bg: #f6f8fb;
  --orange: #f9734b;
  --orange-2: #ff9a62;
  --blue: #2563eb;
  --green: #16a36a;
  --card-radius: 14px;
}

body {
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.72),
      rgba(246, 248, 251, 0.94) 240px
    ),
    var(--bg);
}

.main {
  padding: 18px 24px 42px;
}

.sidebar {
  top: 10px;
  bottom: 10px;
  right: 10px;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(15, 39, 71, 0.1);
}

.sidebar__brand-logo,
.login__logo {
  border-radius: 14px;
  background: linear-gradient(135deg, var(--navy), var(--orange));
  box-shadow: 0 14px 28px rgba(249, 115, 75, 0.2);
}

.sidebar__link,
.sidebar__group > summary,
.sidebar__collapse,
.btn,
.field input,
.field select,
.field textarea,
.ak-select__trigger,
.pill {
  border-radius: 10px;
}

.sidebar__link.is-active,
.btn--primary,
.lang-switch a.is-active,
.ak-select__opt.is-sel,
.ak-cal__day.is-sel {
  background: linear-gradient(135deg, var(--orange), var(--orange-2));
}

.topbar,
.card,
.stat,
.login__card {
  border-radius: var(--card-radius);
  box-shadow: 0 14px 36px rgba(15, 39, 71, 0.07);
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 20;
  padding: 12px 16px;
}

.topbar__search,
.lang-switch {
  border-radius: 12px;
  background: #f8fafc;
}

.hero {
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(15, 39, 71, 0.96), rgba(23, 58, 99, 0.92)),
    linear-gradient(90deg, var(--navy), var(--navy-2));
  box-shadow: 0 24px 54px rgba(15, 39, 71, 0.22);
}

.hero::before,
.hero::after {
  display: none;
}

.hero .chip {
  display: none;
}

.stat {
  padding: 18px;
}

.stat:hover {
  transform: translateY(-2px);
}

.stat__ico {
  width: 48px;
  height: 48px;
  border-radius: 13px;
}

.stat__label {
  letter-spacing: 0;
  text-transform: none;
}

.stat__value {
  font-size: 30px;
}

.card {
  padding: 18px;
}

.card__head {
  gap: 12px;
}

.card__title .ico {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

table.data {
  border-collapse: separate;
  border-spacing: 0;
}

table.data th {
  background: #f8fafc;
  color: #59687f;
  padding: 12px 14px;
}

table.data td {
  padding: 12px 14px;
}

table.data tbody tr:hover td {
  background: #fbfdff;
}

.pill {
  border: 1px solid transparent;
  min-height: 30px;
  align-items: center;
}

.pill-btn {
  font-family: inherit;
  cursor: pointer;
  border: 0;
}

.metric-tile {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}

.metric-tile--green {
  background: #f1fbf6;
}

.metric-tile--red {
  background: #fff4f1;
}

.btn--ghost {
  background: #f8fafc;
}

.btn--primary:hover,
.btn:hover {
  transform: translateY(-1px);
}

form.card h3::before {
  background: linear-gradient(180deg, var(--orange), var(--blue));
}

.ak-tabs {
  border-radius: 12px;
}

.ak-tab {
  border-radius: 9px;
}

@media (max-width: 980px) {
  .topbar {
    position: relative;
    top: auto;
  }

  .sidebar {
    border-radius: 14px;
  }

  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .topbar__search {
    order: 3;
    max-width: none;
    width: 100%;
  }

  .hero {
    padding: 24px 20px;
  }

  .hero h2 {
    font-size: 22px;
  }
}

/* Final mobile shell override: keep desktop sidebar rules from leaking into small screens. */
@media (max-width: 980px) {
  .app .main,
  .app.is-collapsed .main,
  .app.is-ltr .main,
  .app.is-ltr.is-collapsed .main {
    margin: 0 !important;
    padding: 12px 10px 96px;
    max-width: 100%;
    overflow-x: hidden;
  }

  .app .sidebar,
  .app.is-collapsed .sidebar,
  .app.is-ltr .sidebar {
    position: fixed;
    inset: auto 8px 8px 8px !important;
    top: auto !important;
    right: 8px !important;
    bottom: 8px !important;
    left: 8px !important;
    width: auto !important;
    height: auto;
    max-height: 76px;
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 8px !important;
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 14px;
    z-index: 60;
  }

  .sidebar__brand,
  .sidebar__collapse,
  .sidebar__support,
  .sidebar__group > summary {
    display: none !important;
  }

  .sidebar__nav,
  .sidebar__items,
  .sidebar__group[open] > .sidebar__items {
    display: flex;
    flex-direction: row;
    gap: 6px;
    border: 0;
    padding: 0;
  }

  .sidebar__nav {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .sidebar__nav::-webkit-scrollbar {
    display: none;
  }

  .sidebar__group {
    margin: 0;
  }

  .sidebar__link {
    width: 48px;
    height: 48px;
    justify-content: center;
    padding: 0;
    flex: 0 0 48px;
  }

  .sidebar__link .lbl {
    display: none !important;
  }

  .topbar {
    position: relative;
    top: auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }

  .topbar__welcome {
    order: 1;
    text-align: right;
  }

  .topbar__search {
    order: 2;
    width: 100%;
    max-width: none;
  }

  .topbar__left {
    order: 3;
    justify-content: space-between;
    width: 100%;
    gap: 8px;
  }

  .topbar__user-role,
  .topbar__chev {
    display: none;
  }

  /* Keep the notifications bell visible on phones; its menu opens as a
     bottom sheet (a field-anchored popover would overflow the viewport). */
  .notif-menu {
    position: fixed;
    inset-inline: 12px;
    top: auto;
    bottom: 12px;
    width: auto;
    z-index: 1200;
    box-shadow: 0 -12px 44px rgba(9, 18, 35, 0.3);
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 22px 16px;
  }

  .card {
    padding: 14px;
  }

  .card__head {
    align-items: flex-start;
  }

  .table-wrap {
    overflow-x: auto;
  }

  table.data {
    min-width: 680px;
  }

  .dashboard-summary-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ---------- Reference-inspired admin redesign ---------- */
:root {
  --deep-navy: #071f45;
  --soft-navy: #45658d;
  --surface-lavender: #f7f3ff;
  --surface-lavender-2: #fbf9ff;
  --panel-border: #ded2ff;
  --panel-border-strong: #cbb9ff;
  --violet: #7c4dff;
  --violet-2: #9a62ff;
  --violet-soft: #f0eaff;
  --icon-bg: #edf4ff;
  --danger-bg: #fff0f0;
  --success-bg: #eafbf3;
  --radius-lg: 24px;
  --radius-md: 16px;
  --shadow-soft: 0 22px 54px rgba(91, 64, 155, 0.1);
  --shadow-hover: 0 28px 70px rgba(91, 64, 155, 0.16);
  --card-radius: 24px;
  --bg: var(--surface-lavender);
  --ink: var(--deep-navy);
  --muted: var(--soft-navy);
  --line: var(--panel-border);
  --orange: var(--violet);
  --orange-2: var(--violet-2);
  --blue: #377dff;
  --green: #00a65a;
}

body {
  background:
    radial-gradient(
      circle at 18% -10%,
      rgba(124, 77, 255, 0.12),
      transparent 30%
    ),
    linear-gradient(
      180deg,
      #fbf9ff 0,
      var(--surface-lavender) 360px,
      #f9fbff 100%
    );
  color: var(--deep-navy);
}

.main {
  padding: 28px 30px 54px;
}

.sidebar {
  top: 18px;
  bottom: 18px;
  right: 18px;
  padding: 18px 14px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--panel-border);
  border-radius: 26px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

.app.is-ltr .sidebar {
  left: 18px;
}

.sidebar__brand {
  padding: 8px 8px 18px;
  gap: 12px;
}

.sidebar__brand-logo,
.login__logo {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--panel-border);
  box-shadow: 0 14px 30px rgba(124, 77, 255, 0.14);
}

.sidebar__brand h1 {
  font-size: 18px;
  color: var(--deep-navy);
}

.sidebar__brand span,
.sidebar__group > summary {
  color: var(--soft-navy);
}

.sidebar__collapse {
  height: 42px;
  background: var(--surface-lavender-2);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  color: var(--soft-navy);
}

.sidebar__nav {
  border-top: 1px solid var(--panel-border);
  padding-top: 14px;
}

.sidebar__group {
  margin-bottom: 10px;
}

.sidebar__group > summary {
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 12px;
}

.sidebar__group > summary:hover {
  background: var(--violet-soft);
  color: var(--deep-navy);
}

.sidebar__items {
  gap: 7px;
}

.sidebar__link {
  min-height: 50px;
  padding: 8px 12px;
  border-radius: 16px;
  color: var(--deep-navy);
  font-weight: 900;
  letter-spacing: 0;
}

.sidebar__link-ico {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--icon-bg, #edf4ff);
  color: #377dff;
  font-size: 17px;
  box-shadow: inset 0 0 0 1px rgba(55, 125, 255, 0.08);
}

.sidebar__link:hover {
  background: #f8f4ff;
  color: var(--violet);
}

.sidebar__link.is-active {
  background: linear-gradient(135deg, var(--violet), var(--violet-2));
  color: #fff;
  box-shadow: 0 18px 30px rgba(124, 77, 255, 0.28);
}

.sidebar__link.is-active .sidebar__link-ico {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

.sidebar__support {
  background: #eef6ff;
  border: 1px solid #dbeafe;
  border-radius: 18px;
  padding: 14px;
}

.topbar {
  top: 18px;
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

.topbar__welcome h2 {
  font-size: 26px;
  color: var(--deep-navy);
  letter-spacing: 0;
}

.topbar__welcome p {
  color: var(--soft-navy);
  font-size: 14px;
  font-weight: 800;
}

.topbar__search {
  height: 50px;
  max-width: 420px;
  border: 1px solid #e7e8f2;
  border-radius: 22px;
  background: #f4f6fb;
  color: #8da0bc;
}

.topbar__search input {
  color: var(--soft-navy);
  font-size: 14px;
}

.lang-switch,
.topbar__bell,
.topbar__user-btn {
  border-color: var(--panel-border);
}

.lang-switch {
  border-radius: 18px;
  background: #fff;
  padding: 5px;
}

.lang-switch a.is-active {
  background: linear-gradient(135deg, var(--violet), var(--violet-2));
  box-shadow: 0 12px 22px rgba(124, 77, 255, 0.22);
}

.topbar__avatar {
  background: #243455;
  box-shadow: 0 12px 22px rgba(36, 52, 85, 0.18);
}

.hero,
.card,
.stat,
.login__card {
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.hero {
  color: var(--deep-navy);
  padding: 34px 36px;
}

.hero h2 {
  color: var(--deep-navy);
  font-size: 32px;
}

.hero p {
  color: var(--soft-navy);
  font-weight: 800;
}

.hero__date {
  background: var(--violet-soft);
  color: var(--deep-navy);
  border: 1px solid var(--panel-border);
}

.grid {
  gap: 22px;
  margin-top: 22px;
}

.stat {
  min-height: 150px;
  padding: 24px;
}

.stat::before,
.stat::after {
  display: none;
}

.stat:hover,
.card:hover {
  box-shadow: var(--shadow-hover);
}

.stat__top {
  flex-direction: row-reverse;
  gap: 18px;
}

.stat__ico,
.card__title .ico {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--icon-bg) !important;
  color: #377dff;
  box-shadow: none;
}

.stat__label {
  color: var(--soft-navy);
  font-size: 14px;
  line-height: 1.55;
}

.stat__value {
  color: var(--deep-navy);
  font-size: 34px;
}

.card {
  padding: 24px;
}

.card__head {
  margin: -24px -24px 20px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--panel-border);
}

.card__title {
  color: var(--deep-navy);
  font-size: 20px;
}

.btn {
  height: 52px;
  border-radius: 14px;
  padding: 0 22px;
  font-size: 15px;
}

.btn--primary {
  background: linear-gradient(135deg, var(--violet), var(--violet-2));
  color: #fff;
  box-shadow: 0 16px 32px rgba(124, 77, 255, 0.24);
}

.btn--ghost,
.pill {
  background: #fff;
  border: 1px solid var(--panel-border);
  color: var(--soft-navy);
}

.pill {
  min-height: 38px;
  border-radius: 14px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 900;
}

.pill.green {
  background: var(--success-bg);
  color: var(--green);
}

.table-wrap {
  border: 1px solid var(--panel-border);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  margin: 0 -24px -24px;
  overflow: auto;
}

table.data {
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
}

table.data th {
  background: #fafbff;
  color: var(--soft-navy);
  font-size: 14px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--panel-border);
}

table.data td {
  padding: 18px 22px;
  border-bottom: 1px solid #edf0f8;
  color: #426083;
  font-weight: 800;
}

table.data tbody tr:hover td {
  background: #fbf9ff;
}

.name-cell {
  gap: 14px;
}

.name-cell .av {
  width: 46px;
  height: 46px;
  background: #ffe7cf;
  color: var(--deep-navy);
}

.action-btn {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 14px;
  display: inline-grid;
  place-items: center;
  font-family: inherit;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease;
}

.action-btn svg,
.btn-ico svg,
.view-switch__btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.action-btn svg {
  width: 20px;
  height: 20px;
}

.btn-ico,
.view-switch__btn span {
  display: inline-grid;
  place-items: center;
}

.action-btn:hover {
  transform: translateY(-2px);
}

.action-btn--edit {
  background: #eaf2ff;
  color: #377dff;
}

.action-btn--delete {
  background: var(--danger-bg);
  color: #ff4d4f;
}

.action-btn--view {
  background: #eafbf3;
  color: #00a65a;
}

.action-btn--print {
  background: var(--surface-lavender, #f0eaff);
  color: var(--violet, #7c4dff);
}

.action-btn--note {
  background: #fff3e8;
  color: #ff7b22;
  text-decoration: none;
}

/* Teacher notes list (in the note modal) */
.note-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 34vh;
  overflow-y: auto;
  padding-bottom: 4px;
}
.note-item {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.note-item p {
  margin: 0 0 6px;
  color: var(--ink, #1f2937);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.5;
}
.note-item span {
  color: var(--soft-navy, #94a3b8);
  font-weight: 700;
  font-size: 12px;
}

.row-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
}
/* Each control keeps its size and never shrinks/stacks. The delete control is
   wrapped in a <form> (a block element) — make it inline so it stays in row. */
.row-actions > a,
.row-actions > form,
.row-actions > button,
.row-actions .action-btn {
  flex: 0 0 auto;
}
.row-actions form {
  display: inline-flex;
  align-items: center;
  margin: 0;
}
/* Keep the actions column compact and on one line in every table (LTR + RTL). */
table.data td:last-child,
table.data th:last-child {
  white-space: nowrap;
  width: 1%;
}
/* Icon-only column: center the header above its centered icon (both directions). */
table.data th.col-center,
table.data td.col-center,
.app.is-ltr table.data th.col-center,
.app.is-ltr table.data td.col-center {
  text-align: center;
}
/* Actions header sits above its buttons in LTR tables. */
.app.is-ltr table.data th:last-child {
  text-align: right;
}
.app.is-ltr table.data .row-actions {
  justify-content: flex-end;
}

.student-page-actions {
  margin-top: 24px;
  display: flex;
  justify-content: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.attendance-page-actions {
  gap: 22px;
}

.student-add-btn {
  min-height: 60px;
  padding: 0 26px;
  border-radius: 14px;
  gap: 12px;
  font-size: 16px;
  font-weight: 900;
}

.student-add-btn .btn-ico svg {
  width: 22px;
  height: 22px;
  stroke-width: 2.4;
}

.student-summary-card {
  margin-top: 22px;
  padding: 24px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.student-summary__head,
.student-summary__body,
.students-toolbar,
.students-toolbar__actions,
.students-search,
.view-switch {
  display: flex;
  align-items: center;
}

.student-summary__head {
  justify-content: space-between;
  margin-bottom: 28px;
}

.summary-pill {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  color: var(--soft-navy);
  font-weight: 900;
  background: #fff;
}

.student-summary__body {
  gap: 36px;
  align-items: stretch;
  direction: ltr;
}

.student-summary__body > * {
  direction: rtl;
}

.summary-chart {
  flex: 1;
  min-height: 220px;
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  direction: ltr;
}

.summary-chart__axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--soft-navy);
  font-size: 12px;
  font-weight: 800;
  padding-bottom: 26px;
}

.summary-chart__bars {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  align-items: end;
  padding-top: 6px;
  background:
    linear-gradient(
      to bottom,
      transparent 0 24%,
      rgba(55, 125, 255, 0.12) 24% 25%,
      transparent 25% 49%,
      rgba(55, 125, 255, 0.12) 49% 50%,
      transparent 50% 74%,
      rgba(55, 125, 255, 0.12) 74% 75%,
      transparent 75%
    ),
    linear-gradient(180deg, rgba(55, 125, 255, 0.16), rgba(55, 125, 255, 0));
  border-top: 4px solid #377dff;
}

.summary-chart__bar {
  min-height: 204px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.summary-chart__bar .bar-fill {
  width: 100%;
  max-width: 46px;
  min-height: 4px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #5b9dff, #377dff);
  opacity: 0.26;
}

.summary-chart__bar b {
  color: var(--soft-navy);
  font-size: 13px;
  direction: rtl;
}

.summary-metrics {
  width: min(44%, 650px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  direction: rtl;
}

.summary-metric {
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 28px 24px;
  background: #fff;
}

.summary-metric__icon {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 30px;
  margin-bottom: 18px;
}

.summary-metric__icon.trend,
.summary-metric__icon.bag {
  background: #eaf2ff;
  color: #377dff;
}

.summary-metric__icon.absent {
  background: #ffecec;
  color: #ff4d4f;
}

.summary-metric p,
.summary-metric small {
  margin: 0;
  color: var(--soft-navy);
  font-weight: 900;
}

.summary-metric b {
  display: block;
  margin: 8px 0 10px;
  color: var(--deep-navy);
  font-size: 34px;
  line-height: 1;
}

.summary-metric small {
  color: var(--green);
}

.students-records-card {
  overflow: hidden;
}

.students-toolbar {
  flex-direction: row;
  gap: 16px;
  flex-wrap: wrap;
}

.students-toolbar__actions {
  gap: 12px;
  flex-wrap: nowrap;
}

.students-search {
  gap: 10px;
  min-width: 320px;
}

.students-search input {
  height: 52px;
  min-width: 280px;
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: #f4f6fb;
  padding: 0 18px;
  font-family: inherit;
  font-weight: 800;
  color: var(--deep-navy);
  outline: 0;
}

.finance-date-filter {
  min-width: 0;
  flex-wrap: wrap;
  justify-content: center;
}

.finance-date-filter input[type="date"],
.finance-date-filter .ak-date__field {
  min-width: 190px;
  width: 190px;
}

.view-switch {
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: #fff;
  padding: 0;
  overflow: hidden;
}

.view-switch__btn {
  height: 52px;
  min-width: 112px;
  border: 0;
  background: transparent;
  color: var(--soft-navy);
  font-family: inherit;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.view-switch__btn.is-active {
  background: #243455;
  color: #fff;
}

.student-filter-panel {
  display: none;
  /* Adapts to however many filters a page has — the old fixed
     "1fr 1fr auto" squeezed any third field into a content-width column,
     which clipped long class names. */
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  align-items: end;
  padding: 0 24px 20px;
  border-bottom: 1px solid var(--panel-border);
}

.student-filter-panel.is-open {
  display: grid;
}

.student-filter-panel .field {
  margin: 0;
}

.student-filter-panel__submit {
  align-self: end;
}
.student-filter-panel__submit .btn {
  width: 100%;
}
/* Selects (and the widget that replaces them) fill their column. */
.student-filter-panel .field select,
.student-filter-panel .field .ak-select,
.student-filter-panel .field .ak-select__trigger,
.student-filter-panel .field input {
  width: 100%;
  box-sizing: border-box;
}

.attendance-mini-icon {
  position: relative;
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  background: #fff3e8;
  color: #ff7b22;
  font-size: 20px;
}
.attendance-mini-icon.is-present {
  background: #e7f8ee;
}
.attendance-mini-icon.is-absent {
  background: #fdecec;
}
.attendance-mini-icon__badge {
  position: absolute;
  top: -6px;
  inset-inline-end: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  font-style: normal;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
}

.status-dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 50%;
  background: #22c55e;
  margin-inline-end: 6px;
}

.students-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: 24px;
}

.students-card-grid[hidden] {
  display: none;
}

.student-card {
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  background: #fff;
  padding: 20px;
  box-shadow: 0 14px 30px rgba(91, 64, 155, 0.07);
}

.student-card__top {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-direction: row-reverse;
  margin-bottom: 16px;
}

.student-card .av,
.student-view-hero .av {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #ffe7cf;
  color: var(--deep-navy);
  display: grid;
  place-items: center;
  font-weight: 900;
}

.student-card h3,
.student-card p {
  margin: 0;
}

.student-card h3 {
  color: var(--deep-navy);
  font-size: 18px;
}

.student-card p {
  color: var(--soft-navy);
  font-weight: 800;
}

.student-card dl {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
}

.student-card dl div,
.student-view-grid div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: #fafbff;
}

.student-card dt,
.student-view-grid span {
  color: var(--soft-navy);
  font-weight: 900;
}

.student-card dd,
.student-view-grid b {
  margin: 0;
  color: var(--deep-navy);
  font-weight: 900;
}

.student-profile-page {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.student-profile-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.student-profile-toolbar .btn {
  min-height: 46px;
}

.profile-logout-btn {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
  font-weight: 900;
}
.profile-logout-btn:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: #ef4444;
}

/* Password field: show/hide toggle + strength meter */
.pw-field {
  position: relative;
}
.pw-field input {
  width: 100%;
  padding-inline-end: 46px;
}
.pw-toggle {
  position: absolute;
  inset-inline-end: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 6px;
  border-radius: 8px;
}
.pw-toggle:hover {
  background: rgba(124, 77, 255, 0.08);
}
.pw-strength {
  margin-top: 8px;
}
.pw-strength__bar {
  height: 6px;
  border-radius: 6px;
  background: #eef2f7;
  overflow: hidden;
}
.pw-strength__bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 6px;
  transition:
    width 0.25s ease,
    background 0.25s ease;
}
.pw-strength__bar.is-weak span {
  width: 33%;
  background: #ef4444;
}
.pw-strength__bar.is-medium span {
  width: 66%;
  background: #f59e0b;
}
.pw-strength__bar.is-strong span {
  width: 100%;
  background: #10b981;
}
.pw-strength small {
  display: inline-block;
  margin-top: 6px;
  color: var(--soft-navy);
  font-weight: 800;
}

.student-profile-page .student-view-card {
  border-color: rgba(222, 210, 255, 0.95);
  box-shadow: 0 20px 50px rgba(91, 64, 155, 0.1);
}

.student-view-card {
  overflow: hidden;
  padding: 0 !important;
}

.student-view-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-direction: row-reverse;
  padding: 30px 28px;
  background: linear-gradient(135deg, var(--violet), var(--violet-2));
  color: #fff;
  position: relative;
  overflow: hidden;
}
.student-view-hero::after {
  content: "";
  position: absolute;
  inset-inline-start: -50px;
  bottom: -70px;
  width: 190px;
  height: 190px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
}
.student-view-hero .av {
  width: 74px;
  height: 74px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 30px;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.25);
  position: relative;
  z-index: 1;
}
.student-view-hero > div {
  position: relative;
  z-index: 1;
}
.student-view-hero h2,
.student-view-hero p {
  margin: 0;
}
.student-view-hero h2 {
  color: #fff;
  font-size: 26px;
  font-weight: 900;
}
.student-view-hero p {
  display: inline-flex;
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.2);
  padding: 5px 16px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 14px;
  backdrop-filter: blur(4px);
}

.student-view-body {
  padding: 22px 26px 4px;
}

.student-view-body h3,
.att-page-form-card h3 {
  margin: 22px 0 12px;
  font-size: 15px;
  font-weight: 900;
  color: var(--deep-navy, var(--ink));
  padding-inline-start: 14px;
  position: relative;
}

.student-view-body h3:first-child,
.att-page-form-card h3:first-of-type {
  margin-top: 0;
}

.student-view-body h3::before,
.att-page-form-card h3::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 50%;
  width: 4px;
  height: 18px;
  border-radius: 999px;
  background: var(--violet, #7c4dff);
  transform: translateY(-50%);
}

.student-view-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin: 0;
}
.student-view-grid div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  transition: 0.16s;
}
.student-view-grid div:hover {
  border-color: var(--violet);
  box-shadow: 0 8px 22px rgba(124, 77, 255, 0.1);
}
.student-view-grid span {
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
}
.student-view-grid b {
  color: var(--ink);
  font-weight: 900;
  font-size: 15px;
  word-break: break-word;
}

.student-view-actions {
  display: flex;
  gap: 12px;
  padding: 18px 26px;
  margin-top: 16px;
  border-top: 1px solid var(--line);
  background: #fbfcff;
}

.student-profile-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 26px 0;
  background: linear-gradient(180deg, #fff, #fbfcff);
}

.student-profile-metric {
  position: relative;
  min-height: 110px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(91, 64, 155, 0.06);
}

.student-profile-metric::after {
  content: "";
  position: absolute;
  width: 72px;
  height: 72px;
  inset-inline-end: -24px;
  bottom: -30px;
  border-radius: 50%;
  background: rgba(124, 77, 255, 0.08);
}

.student-profile-metric span,
.student-profile-metric small {
  display: block;
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
}

.student-profile-metric b {
  display: block;
  margin: 8px 0 6px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 900;
  line-height: 1.15;
}

.student-profile-metric--absent b {
  color: #ef4444;
}

.student-profile-metric--late b {
  color: #c77c04;
}

.student-profile-metric--paid b {
  color: #17a957;
}

.student-history-grid > .card,
.student-profile-page > .card:not(.student-view-card) {
  border-color: rgba(222, 210, 255, 0.85);
  box-shadow: 0 16px 40px rgba(91, 64, 155, 0.08);
}

.student-profile-page .note-list {
  display: grid;
  gap: 10px;
  padding: 0 20px 20px;
}

.student-profile-page .note-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  background: #fff;
}

.student-profile-page .note-item p {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
}

.student-profile-page .note-item span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.att-page-form-card {
  padding: 0 !important;
  overflow: hidden;
}

.att-page-form-card > form,
.att-page-form-card > h3,
.att-page-form-card > .att-summary,
.att-page-form-card > .att-sent,
.att-page-form-card > .alert,
.att-page-form-card > .empty {
  margin-inline: 26px;
}

.att-page-form-card > form.form-grid {
  margin-top: 0;
}

.att-page-form-card > .att-form {
  padding-bottom: 22px;
}

.att-page-form-card .att-summary {
  margin-top: 0;
}

.att-page-form-head {
  padding: 20px 26px;
  background: linear-gradient(135deg, #f7f9fc, #eef3fb);
  border-bottom: 1px solid var(--line);
}

.attendance-mark-btn {
  box-shadow: 0 18px 36px rgba(124, 77, 255, 0.26);
}

@media (max-width: 1100px) {
  .student-profile-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .student-view-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 24px 22px;
    min-height: 0;
  }

  .student-view-hero h2 {
    font-size: 22px;
    line-height: 1.25;
  }

  .student-view-hero .av {
    width: 64px;
    height: 64px;
    font-size: 26px;
  }

  .student-profile-metrics {
    grid-template-columns: 1fr;
    padding-inline: 16px;
  }

  .att-page-form-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
  }

  .att-page-form-head .btn {
    align-self: auto;
    width: auto;
    min-height: 40px;
  }

  .att-page-form-card > form,
  .att-page-form-card > h3,
  .att-page-form-card > .att-summary,
  .att-page-form-card > .att-sent,
  .att-page-form-card > .alert,
  .att-page-form-card > .empty {
    margin-inline: 16px;
  }
}

/* ---------- Avatar upload (modern) ---------- */
.avatar-upload {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-direction: row-reverse;
  border: 1.5px dashed var(--panel-border-strong, #cbb9ff);
  border-radius: 18px;
  padding: 18px 20px;
  background: linear-gradient(135deg, #fbfbff, #f4efff);
  transition: 0.2s;
}
.avatar-upload:hover {
  border-color: var(--violet);
}
.avatar-upload__drop {
  position: relative;
  flex: none;
  cursor: pointer;
  display: block;
}
.avatar-upload__preview {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--violet), var(--violet-2));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 38px;
  box-shadow: 0 12px 28px rgba(124, 77, 255, 0.3);
}
.avatar-upload__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-upload__badge {
  position: absolute;
  bottom: 2px;
  inset-inline-start: 2px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 15px;
  box-shadow: 0 4px 10px rgba(16, 27, 52, 0.14);
}
.avatar-upload__drop:hover .avatar-upload__preview {
  filter: brightness(1.05);
  transform: translateY(-2px);
  transition: 0.2s;
}
.avatar-upload__meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
.avatar-upload__meta .btn {
  height: 40px;
}
.avatar-upload__buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.avatar-upload__hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

/* Student medical information panel */
.student-medical-panel {
  margin-top: 28px;
  border: 1px solid rgba(222, 210, 255, 0.9);
  border-radius: 22px;
  padding: 18px;
  background:
    radial-gradient(
      circle at 12% 12%,
      rgba(124, 77, 255, 0.08),
      transparent 30%
    ),
    linear-gradient(135deg, #ffffff, #f8fbff);
  box-shadow: 0 18px 46px rgba(91, 64, 155, 0.08);
}

.student-medical-panel__head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.student-medical-panel__ico {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  border-radius: 16px;
  background: #eafbf3;
  color: #17a957;
  font-size: 22px;
  font-weight: 900;
  box-shadow: 0 14px 28px rgba(23, 169, 87, 0.14);
}

form.card .student-medical-panel h3 {
  margin: 0;
  padding: 0;
  color: var(--deep-navy, #071f45);
  font-size: 17px;
}

form.card .student-medical-panel h3::before {
  display: none;
}

.student-medical-panel__head strong {
  display: block;
  color: var(--deep-navy, #071f45);
  font-size: 17px;
  font-weight: 900;
}

.student-medical-panel__head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.student-medical-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.student-medical-grid .field {
  margin-bottom: 0;
}

.student-medical-grid .medical-field--wide {
  grid-column: 1 / -1;
}

.student-medical-grid textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.65;
}

.student-medical-grid input,
.student-medical-grid select,
.student-medical-grid textarea {
  border-color: rgba(210, 222, 238, 0.95);
  border-radius: 16px;
  background: #fff;
}

.student-form-actions {
  margin-top: 22px;
  display: flex;
  justify-content: flex-start;
}

.student-form-actions .btn {
  min-height: 50px;
  border-radius: 16px;
  padding-inline: 28px;
  font-weight: 900;
}

.ak-modal__body .student-form-card > .student-medical-panel {
  margin-inline: 26px;
}

.student-form-card > h3 + .student-medical-panel,
.student-form-card .ak-tabpane > .student-medical-panel {
  margin-top: 0;
}

.ak-modal__body > form.student-form-card {
  display: block;
  max-height: none;
  overflow: visible;
}

@media (max-width: 760px) {
  .student-medical-panel {
    padding: 16px;
  }

  .student-medical-panel__head {
    align-items: flex-start;
  }

  .student-medical-grid {
    grid-template-columns: 1fr;
  }
}

/* Live camera capture */
.avatar-cam[hidden] {
  display: none !important;
}
.avatar-cam {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: #0d1626;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.avatar-cam video {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 14px;
  background: #000;
  transform: scaleX(-1); /* mirror like a selfie */
}
.avatar-cam__controls {
  display: flex;
  gap: 10px;
}

.field input,
.field select,
.field textarea,
.ak-select__trigger {
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: #fbfcff;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.ak-select.is-open .ak-select__trigger {
  border-color: var(--violet);
  box-shadow: 0 0 0 4px rgba(124, 77, 255, 0.13);
}

.ak-tabs {
  background: #f7f3ff;
  border-color: var(--panel-border);
  border-radius: 18px;
}

.ak-tab {
  border-radius: 14px;
}

.ak-tab.is-active {
  background: #243455;
  color: #fff;
}

/* Small screens: keep all modal tabs inside the dialog (shrink + wrap text
   instead of overflowing off-screen). */
@media (max-width: 560px) {
  .ak-tabs {
    margin-inline: 14px;
    gap: 4px;
    padding: 4px;
  }
  .ak-tab {
    flex: 1 1 0;
    min-width: 0;
    height: auto;
    min-height: 42px;
    padding: 7px 6px;
    font-size: 12.5px;
    line-height: 1.25;
    white-space: normal;
  }
}

.profile-menu,
.ak-select__menu,
.ak-cal {
  border-color: var(--panel-border);
  box-shadow: var(--shadow-hover);
}

/* Small screens: the JS anchors these popovers to the field, which can push
   them off the bottom of the viewport (and they can't scroll into view since
   they're position:fixed). Render them as a bottom sheet instead — always
   fully visible above the modal, with their own scroll. */
@keyframes akSheetUp {
  from {
    transform: translateY(18px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
@media (max-width: 560px) {
  .ak-cal,
  .ak-select__menu,
  .ak-multi__menu {
    position: fixed !important;
    inset-inline: 12px !important;
    left: 12px !important;
    right: 12px !important;
    top: auto !important;
    bottom: 12px !important;
    width: auto !important;
    max-width: none !important;
    max-height: 66vh;
    overflow-y: auto;
    z-index: 1200;
    border-radius: 18px;
    box-shadow: 0 -12px 44px rgba(9, 18, 35, 0.3);
    animation: akSheetUp 0.2s ease;
  }
  .ak-select__opt,
  .ak-multi__opt {
    padding: 13px 14px;
  }
  .ak-cal__day {
    height: 40px;
  }
}

@media (max-width: 980px) {
  .main {
    padding: 14px 12px 100px;
  }

  .app .sidebar,
  .app.is-collapsed .sidebar,
  .app.is-ltr .sidebar {
    background: rgba(255, 255, 255, 0.94);
    border-color: var(--panel-border);
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
  }

  .sidebar__link {
    border-radius: 16px;
  }

  .sidebar__link-ico {
    width: 40px;
    height: 40px;
  }

  .topbar {
    padding: 16px;
  }

  .topbar__welcome h2 {
    font-size: 22px;
  }

  .card__head {
    margin: -14px -14px 16px;
    padding: 16px 14px;
  }

  .card__head {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .card__head > div {
    width: 100%;
    flex-wrap: wrap;
  }

  .card__head .btn {
    height: auto !important;
    min-height: 52px;
    flex: 1 1 160px;
    justify-content: center;
    text-align: center;
    white-space: normal;
    line-height: 1.35;
  }

  .card__head.att-page-form-head {
    flex-direction: row-reverse;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 16px;
    padding: 16px;
  }

  .card__head.att-page-form-head > div {
    width: auto;
    flex-wrap: nowrap;
  }

  .card__head.att-page-form-head .btn {
    flex: 0 0 auto;
    width: auto;
    height: 40px !important;
    min-height: 40px;
    padding: 0 18px;
    white-space: nowrap;
  }

  .card__head form {
    flex: 1 1 100%;
  }

  .card__head form input {
    flex: 1 1 0;
    min-width: 0;
  }

  .table-wrap {
    margin: 0 -14px -14px;
  }

  .student-summary-card {
    padding: 18px;
  }

  .student-page-actions {
    margin-top: 16px;
  }

  .student-add-btn {
    width: 100%;
    min-height: 52px;
    justify-content: center;
  }

  .student-summary__head,
  .student-summary__body,
  .students-toolbar,
  .students-toolbar__actions,
  .students-search,
  .student-profile-toolbar,
  .student-view-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .summary-chart {
    min-height: 190px;
    grid-template-columns: 44px 1fr;
  }

  .summary-metrics,
  .students-card-grid,
  .student-view-grid {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .students-search {
    min-width: 0;
  }

  .students-search input {
    min-width: 0;
    width: 100%;
  }

  .view-switch {
    width: 100%;
  }

  .view-switch__btn {
    flex: 1;
    min-width: 0;
  }

  .student-filter-panel,
  .student-filter-panel.is-open {
    grid-template-columns: 1fr;
    padding: 0 14px 16px;
  }

  .students-card-grid {
    padding: 16px 14px;
  }

  .students-toolbar.card__head {
    gap: 12px;
  }

  .students-toolbar__actions {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
  }

  .students-toolbar__actions > .btn,
  .students-search .btn {
    min-height: 44px;
    flex: 1 1 calc(50% - 5px);
    padding: 0 14px;
    white-space: nowrap;
  }

  .students-search {
    flex-direction: row;
    gap: 8px;
  }

  .students-search input {
    min-height: 44px;
  }

  .students-search .btn {
    flex: 0 0 86px;
  }

  .view-switch {
    flex: 1 1 100%;
    min-height: 44px;
  }

  .view-switch__btn {
    min-height: 44px;
    padding: 0 12px;
  }
}

/* Modern sidebar pass: SVG icons, crisp active states, and polished mobile rail. */
.sidebar {
  overflow: hidden;
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(
      circle at 22% 4%,
      rgba(124, 77, 255, 0.12),
      transparent 30%
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.9));
  z-index: 0;
}

.sidebar > * {
  position: relative;
  z-index: 1;
}

.sidebar__brand {
  position: relative;
  margin-bottom: 10px;
}

.sidebar__brand-logo {
  color: var(--violet);
  font-weight: 900;
  font-size: 22px;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, rgba(124, 77, 255, 0.55), rgba(55, 125, 255, 0.18))
      border-box;
  border: 1px solid transparent;
}

.sidebar__brand h1 {
  line-height: 1.25;
}

.sidebar__collapse {
  position: relative;
  overflow: hidden;
  justify-content: center;
}

.sidebar__collapse::before {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--violet), var(--violet-2));
  box-shadow: 0 10px 18px rgba(124, 77, 255, 0.22);
}

.sidebar__collapse > span:first-child {
  position: absolute;
  color: #fff;
  transform: translateY(-1px);
  font-size: 13px;
  line-height: 1;
}

.sidebar__group > summary {
  min-height: 34px;
  letter-spacing: 0;
}

.sidebar__group-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.sidebar__group-ico {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background:
    linear-gradient(#f7f2ff, #f7f2ff) padding-box,
    linear-gradient(135deg, rgba(124, 77, 255, 0.24), rgba(55, 125, 255, 0.12))
      border-box;
  border: 1px solid transparent;
  color: var(--violet);
}

.sidebar__group-ico svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.15;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar__group > summary .chev {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(124, 77, 255, 0.08);
  color: var(--soft-navy);
  font-size: 9px;
}

.sidebar__link {
  position: relative;
  overflow: hidden;
  gap: 10px;
  border: 1px solid transparent;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.sidebar__link::before {
  content: "";
  position: absolute;
  inset-block: 11px;
  inset-inline-start: 8px;
  width: 4px;
  border-radius: 999px;
  background: var(--violet);
  opacity: 0;
  transform: scaleY(0.4);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.sidebar__link:hover {
  background: rgba(248, 244, 255, 0.95);
  border-color: rgba(124, 77, 255, 0.16);
  color: var(--deep-navy);
  transform: translateX(-2px);
}

.sidebar__link:hover .sidebar__link-ico {
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, rgba(124, 77, 255, 0.32), rgba(55, 125, 255, 0.18))
      border-box;
  color: var(--violet);
}

.app.is-ltr .sidebar__link:hover {
  transform: translateX(2px);
}

.sidebar__link.is-active {
  border-color: rgba(255, 255, 255, 0.52);
}

.sidebar__link.is-active,
.sidebar__link.is-active:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--violet), var(--violet-2));
  border-color: rgba(255, 255, 255, 0.52);
  box-shadow: 0 18px 30px rgba(124, 77, 255, 0.28);
}

.sidebar__link.is-active::before {
  background: #fff;
  opacity: 1;
  transform: scaleY(1);
}

.sidebar__link-ico {
  background:
    linear-gradient(#f4f8ff, #f4f8ff) padding-box,
    linear-gradient(135deg, rgba(55, 125, 255, 0.2), rgba(124, 77, 255, 0.14))
      border-box;
  border: 1px solid transparent;
  color: #377dff;
  font-size: 0;
}

.sidebar__link-ico svg,
.sidebar__support .ico svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar__link.is-active .sidebar__link-ico {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.sidebar__link.is-active:hover .sidebar__link-ico {
  background: rgba(255, 255, 255, 0.24);
  color: #fff;
}

.sidebar__support {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(#eef6ff, #eef6ff) padding-box,
    linear-gradient(135deg, rgba(55, 125, 255, 0.22), rgba(124, 77, 255, 0.18))
      border-box;
  border: 1px solid transparent;
}

.sidebar__support::after {
  content: "";
  position: absolute;
  width: 76px;
  height: 76px;
  inset-inline-end: -34px;
  bottom: -34px;
  border-radius: 50%;
  background: rgba(55, 125, 255, 0.08);
}

.sidebar__support .ico {
  position: relative;
  z-index: 1;
  font-size: 0;
  display: grid;
  place-items: center;
}

.sidebar__support .ico::before {
  content: "";
  width: 19px;
  height: 16px;
  border: 2px solid currentColor;
  border-bottom-color: transparent;
  border-radius: 14px 14px 6px 6px;
}

.sidebar__support .ico::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 8px;
  border-inline: 2px solid currentColor;
  bottom: 8px;
}

.app.is-collapsed .sidebar__link::before,
.app.is-collapsed .sidebar__collapse .lbl {
  display: none;
}

.app.is-collapsed .sidebar__group {
  display: grid;
  place-items: center;
  margin: 8px 0;
}

.app.is-collapsed .sidebar__group > summary {
  width: 48px;
  min-height: 48px;
  padding: 4px;
  justify-content: center;
  border-radius: 18px;
}

.app.is-collapsed .sidebar__group > summary:hover {
  background: rgba(248, 244, 255, 0.92);
}

.app.is-collapsed .sidebar__group-label {
  display: inline-flex;
  width: 100%;
  justify-content: center;
  gap: 0;
}

.app.is-collapsed .sidebar__group-label .lbl,
.app.is-collapsed .sidebar__group > summary .chev {
  display: none;
}

.app.is-collapsed .sidebar__group-ico {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
  border-radius: 14px;
  background:
    linear-gradient(#fbf8ff, #fbf8ff) padding-box,
    linear-gradient(135deg, rgba(124, 77, 255, 0.32), rgba(255, 126, 95, 0.18))
      border-box;
  box-shadow: 0 14px 26px rgba(124, 77, 255, 0.14);
}

.app.is-collapsed .sidebar__group > summary:hover .sidebar__group-ico {
  color: var(--violet);
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(135deg, rgba(124, 77, 255, 0.42), rgba(55, 125, 255, 0.2))
      border-box;
  box-shadow: 0 16px 28px rgba(124, 77, 255, 0.18);
}

.app.is-collapsed .sidebar__group-ico svg {
  width: 19px;
  height: 19px;
}

@media (max-width: 980px) {
  .app .sidebar,
  .app.is-collapsed .sidebar,
  .app.is-ltr .sidebar {
    max-height: 74px;
    border-radius: 22px;
    padding: 9px !important;
    border: 1px solid rgba(222, 210, 255, 0.9);
    box-shadow: 0 18px 44px rgba(91, 64, 155, 0.16);
    backdrop-filter: blur(18px);
  }

  .sidebar__nav,
  .sidebar__items,
  .sidebar__group[open] > .sidebar__items {
    gap: 8px;
  }

  .sidebar__link {
    width: 50px;
    height: 50px;
    flex-basis: 50px;
    border-radius: 16px;
  }

  .sidebar__link::before {
    display: none;
  }

  .sidebar__link:hover,
  .app.is-ltr .sidebar__link:hover {
    transform: translateY(-2px);
  }

  .sidebar__link-ico {
    width: 38px;
    height: 38px;
    border-radius: 13px;
  }
}

/* ===== Mobile: collapsible off-canvas drawer sidebar ===== */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  font-size: 20px;
  color: var(--ink);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex: none;
}
.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 40, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: 0.25s;
  z-index: 110;
}

@media (max-width: 980px) {
  .nav-toggle {
    display: inline-flex !important;
    order: -1;
    justify-self: start;
  }
  .app.nav-open .nav-backdrop {
    opacity: 1;
    visibility: visible;
  }

  /* sidebar becomes an off-canvas drawer */
  .app .sidebar,
  .app.is-collapsed .sidebar,
  .app.is-ltr .sidebar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    right: 0 !important;
    left: auto !important;
    width: 272px !important;
    max-width: 84vw;
    height: 100vh !important;
    max-height: none !important;
    flex-direction: column !important;
    align-items: stretch !important;
    border-radius: 0 !important;
    padding: 16px 14px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    z-index: 120;
    box-shadow: -20px 0 50px rgba(16, 27, 52, 0.25);
  }
  .app.is-ltr .sidebar {
    right: auto !important;
    left: 0 !important;
    transform: translateX(-100%);
  }
  .app.nav-open .sidebar {
    transform: translateX(0) !important;
  }

  /* restore the full vertical nav inside the drawer */
  .sidebar__brand {
    display: flex !important;
  }
  .sidebar__support {
    display: block !important;
  }
  .sidebar__group > summary {
    display: flex !important;
  }
  .sidebar__collapse {
    display: none !important;
  }

  .sidebar__nav {
    display: block !important;
    width: 100%;
    overflow: visible !important;
    border-top: 1px solid var(--line);
    padding-top: 12px !important;
  }
  .sidebar__items,
  .sidebar__group[open] > .sidebar__items {
    display: grid !important;
    flex-direction: column !important;
    gap: 5px;
    width: 100%;
  }
  .sidebar__group {
    margin-bottom: 6px;
  }

  .sidebar__link {
    width: 100% !important;
    height: auto !important;
    flex: none !important;
    justify-content: space-between !important;
    padding: 11px 14px !important;
    border-radius: 12px !important;
  }
  .sidebar__link .lbl {
    display: inline !important;
  }
  .sidebar__link-ico {
    width: 20px !important;
    height: auto !important;
  }
  .sidebar__group-label {
    display: inline-flex !important;
  }
  .sidebar__group-ico {
    width: 24px !important;
    height: 24px !important;
  }

  /* full-width content, no bottom-bar gap */
  .app .main,
  .app.is-collapsed .main,
  .app.is-ltr .main,
  .app.is-ltr.is-collapsed .main {
    margin: 0 !important;
    padding: 12px 12px 24px !important;
  }
}

/* ===== Mobile: compact topbar header ===== */
@media (max-width: 980px) {
  .topbar {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    padding: 12px 14px;
  }
  .nav-toggle {
    order: 0;
  }
  .topbar__welcome {
    order: 1;
    flex: 1 1 auto;
    min-width: 0;
    text-align: right;
  }
  .topbar__welcome h2 {
    font-size: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topbar__welcome p {
    display: none;
  }
  .topbar__left {
    order: 2;
    flex: 1 1 100%;
    justify-content: space-between;
    gap: 8px;
  }
  .topbar__user-name {
    font-size: 13px;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .topbar__search {
    order: 3;
    flex: 1 1 100%;
    max-width: none;
  }
}

/* ===== Mobile: spacing between header and content ===== */
@media (max-width: 980px) {
  .topbar {
    margin-bottom: 18px;
  }
  .student-page-actions {
    margin-top: 0;
  }
  .student-add-btn {
    box-shadow: 0 12px 26px rgba(124, 77, 255, 0.28);
  }
  /* keep a consistent gap before the first content card on every page */
  .student-summary-card,
  .students-records-card,
  .hero,
  .grid {
    margin-top: 18px;
  }
}

/* ===== Modern file dropzone ===== */
.ak-file {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  border: 1.5px dashed var(--panel-border-strong, #cbb9ff);
  border-radius: 16px;
  padding: 26px 18px;
  background: linear-gradient(135deg, #fbfbff, #f4efff);
  cursor: pointer;
  transition: 0.2s;
}
.ak-file:hover {
  border-color: var(--violet);
  background: #f1eaff;
}
.ak-file__icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: #fff;
  font-size: 24px;
  box-shadow: 0 8px 18px rgba(16, 27, 52, 0.08);
}
.ak-file__text {
  font-weight: 900;
  color: var(--ink);
  font-size: 15px;
}
.ak-file__text b {
  color: var(--violet);
}
.ak-file__hint {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}
.ak-file__name {
  margin-top: 4px;
  font-weight: 800;
  color: var(--violet);
  font-size: 13px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 16px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== Dashboard polish ===== */
.hero--violet {
  background: linear-gradient(
    135deg,
    var(--violet, #7c4dff),
    var(--violet-2, #9a62ff)
  ) !important;
}
.stat__foot {
  position: relative;
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  font-size: 12px;
  font-weight: 800;
  color: #94a3b8;
}
.recent-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-direction: row-reverse;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
}
.recent-row:last-child {
  border-bottom: 0;
}
.recent-row > div {
  text-align: right;
}
.recent-row b {
  color: var(--ink);
  font-weight: 900;
}
.recent-sub {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 700;
}
.recent-av {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  background: var(--violet-soft, #f0eaff);
  color: var(--violet, #7c4dff);
  display: grid;
  place-items: center;
  font-weight: 900;
  overflow: hidden;
}
.recent-av--amber {
  background: #fff4e0;
  color: #c77c04;
}
.metric-tile {
  border-radius: 14px;
  padding: 14px;
  border: 1px solid var(--line);
}
.metric-tile--green {
  background: #f3faf5;
}
.metric-tile--red {
  background: #fdf2f0;
}

/* ===== Settings palette presets ===== */
.palette-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 20px;
}
.palette-card {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 10px 16px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  font-size: 14px;
  color: var(--ink);
  transition: 0.18s;
}
.palette-card:hover {
  border-color: var(--violet, #7c4dff);
  transform: translateY(-2px);
}
.palette-card.is-active {
  border-color: var(--violet, #7c4dff);
  box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.16);
}
.palette-dots {
  display: inline-flex;
  gap: 4px;
}
.palette-dots i {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: block;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

/* ===== Dashboard quick actions ===== */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 16px;
}
.qa-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-direction: row-reverse;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow-soft, 0 16px 45px rgba(28, 43, 72, 0.06));
  transition: 0.2s;
}
.qa-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover, 0 26px 60px rgba(28, 43, 72, 0.13));
  border-color: var(--violet, #7c4dff);
}
.qa-ico {
  width: 50px;
  height: 50px;
  flex: none;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 22px;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 14%, #fff);
}
.qa-tile > div {
  text-align: right;
}
.qa-tile b {
  display: block;
  color: var(--ink);
  font-weight: 900;
}
.qa-sub {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}
.app.is-ltr .qa-tile {
  flex-direction: row;
}
.app.is-ltr .qa-tile > div {
  text-align: left;
}
@media (max-width: 980px) {
  .quick-actions {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 520px) {
  .quick-actions {
    grid-template-columns: 1fr;
  }
}

/* ===== Student profile: hero chips + history ===== */
.profile-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.profile-chip {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  backdrop-filter: blur(4px);
}
.student-history-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}
.student-history-grid .card__head {
  justify-content: space-between;
}
.student-history-grid table.data th,
.student-history-grid table.data td {
  padding: 11px 12px;
}
@media (max-width: 980px) {
  .student-history-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Roles & permissions ===== */
.role-note {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-direction: row-reverse;
  background: var(--violet-soft, #f0eaff);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  margin: 8px 0 18px;
  font-weight: 700;
  color: var(--ink);
}
.role-note > span {
  font-size: 24px;
}
.role-note b {
  color: var(--violet, #7c4dff);
}
.perm-table th {
  white-space: nowrap;
}
.perm-check {
  position: relative;
  display: inline-block;
  cursor: pointer;
}
.perm-check input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}
.perm-check span {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 2px solid var(--line);
  background: #fff;
  transition: 0.15s;
}
.perm-check input:checked + span {
  background: var(--violet, #7c4dff);
  border-color: var(--violet, #7c4dff);
  box-shadow: inset 0 0 0 3px #fff;
}
.perm-row-all {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--violet, #7c4dff);
}

/* ===== Dynamic roles management ===== */
.roles-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 16px;
}
.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--violet-soft, #f0eaff);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px 6px 6px;
  font-weight: 800;
  color: var(--ink);
}
.role-chip button {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 0;
  background: #fff;
  color: #ef4444;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.role-chip button:hover {
  background: #fdecec;
}
.role-add {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.role-add input {
  flex: 1;
  min-width: 220px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  font-family: inherit;
  font-weight: 700;
  background: #fafbff;
}

/* ===== Modern confirm dialog ===== */
.ak-confirm {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.ak-confirm.open {
  display: flex;
}
.ak-confirm__overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 40, 0.55);
  backdrop-filter: blur(2px);
}
.ak-confirm__box {
  position: relative;
  z-index: 1;
  width: min(380px, 100%);
  background: #fff;
  border-radius: 22px;
  padding: 28px 26px 22px;
  text-align: center;
  box-shadow: 0 30px 70px rgba(16, 27, 52, 0.3);
  animation: akPop 0.18s ease;
}
.ak-confirm__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: #fdecec;
  display: grid;
  place-items: center;
  font-size: 30px;
}
.ak-confirm__box h3 {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 900;
  color: var(--ink);
}
.ak-confirm__msg {
  margin: 0 0 22px;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}
.ak-confirm__actions {
  display: flex;
  gap: 10px;
}
.ak-confirm__actions .btn {
  flex: 1;
  justify-content: center;
}
.ak-confirm__yes {
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: #fff;
  box-shadow: 0 12px 26px rgba(239, 68, 68, 0.28);
}
.ak-confirm__yes:hover {
  transform: translateY(-2px);
}

/* ===== Toast notifications + loading overlay ===== */
.ak-toast-wrap {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  pointer-events: none;
  width: max-content;
  max-width: 90vw;
}
.ak-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-inline-start: 4px solid #10b981;
  border-radius: 14px;
  padding: 12px 18px;
  box-shadow: 0 16px 40px rgba(16, 27, 52, 0.2);
  font-weight: 800;
  color: var(--ink);
  opacity: 0;
  transform: translateY(-12px);
  transition: 0.3s;
}
.ak-toast.show {
  opacity: 1;
  transform: none;
}
.ak-toast__ico {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  background: #10b981;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 14px;
}
.ak-toast--err {
  border-inline-start-color: #ef4444;
}
.ak-toast--err .ak-toast__ico {
  background: #ef4444;
}

.ak-loading {
  position: fixed;
  inset: 0;
  z-index: 450;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
}
.ak-loading.show {
  display: flex;
}
.ak-loading__spin {
  width: 48px;
  height: 48px;
  border: 5px solid var(--violet-soft, #eee);
  border-top-color: var(--violet, #7c4dff);
  border-radius: 50%;
  animation: akRot 0.7s linear infinite;
}

/* ===== Grades & report cards ===== */
.grades-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.grades-filters label {
  display: grid;
  gap: 5px;
  font-size: 13px;
  font-weight: 700;
}
.grades-filters label span { color: var(--muted, #64748b); }
.grades-filters select,
.grades-filters input {
  min-width: 150px;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid var(--border, #1e293b33);
  background: #fff;
  font: inherit;
}

.report-card {
  margin-top: 18px;
  background: #fff;
  border: 1px solid #e6e8f2;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 12px 30px rgba(76, 58, 150, 0.08);
}
.report-card__head {
  text-align: center;
  border-bottom: 2px solid #0e9f6e;
  padding-bottom: 14px;
  margin-bottom: 16px;
}
.report-card__head h2 { margin: 0; font-size: 22px; font-weight: 900; }
.report-card__head p { margin: 4px 0 0; color: #64748b; font-weight: 700; }
.report-card__student {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin-bottom: 18px;
}
.report-card__student div { display: grid; gap: 3px; }
.report-card__student span { font-size: 12px; color: #64748b; font-weight: 700; }
.report-card__student b { font-size: 15px; }
.report-card__table {
  width: 100%;
  border-collapse: collapse;
}
.report-card__table th,
.report-card__table td {
  border: 1px solid #e6e8f2;
  padding: 10px 12px;
  text-align: start;
  vertical-align: middle;
}
.report-card__table thead th {
  background: #f4f5fb;
  font-weight: 900;
  font-size: 13px;
}
.rc-subject { font-weight: 800; }
.rc-items { display: flex; flex-wrap: wrap; gap: 6px; }
.rc-chip {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  background: #eef1fb;
  font-size: 12px;
  font-weight: 800;
}
.rc-avg { font-weight: 900; text-align: center; font-size: 15px; }
.rc-total-label { font-weight: 900; text-align: start; background: #f4f5fb; }
.rc-total { font-weight: 900; text-align: center; font-size: 17px; color: #0e9f6e; background: #f4f5fb; }
.report-card__foot {
  display: flex;
  justify-content: space-between;
  margin-top: 34px;
}
.report-card__foot span {
  display: inline-block;
  padding-top: 34px;
  border-top: 1px dashed #94a3b8;
  min-width: 160px;
  text-align: center;
  color: #64748b;
  font-weight: 700;
  font-size: 13px;
}

@media print {
  @page { size: A4 portrait; margin: 12mm; }
  .sidebar, .topbar, .no-print { display: none !important; }
  .app, .main { display: block !important; margin: 0 !important; padding: 0 !important; }
  .report-card { border: none; box-shadow: none; padding: 0; margin: 0; }
  body { background: #fff !important; }
}

/* ============ Grades entry modal — modern layout ============ */
.ak-modal__body .card + .card,
.ak-modal__body .card + form.card,
.ak-modal__body form.card + .card { margin-top: 12px !important; }

.ak-modal__body .grades-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 18px 24px 20px;
  align-items: end;
}
.ak-modal__body .grades-filters label { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ak-modal__body .grades-filters label > span { font-size: 12.5px; font-weight: 800; color: #64748b; }

.grades-marks-card { padding-bottom: 8px !important; overflow: visible !important; }
.grade-rows { padding: 8px 24px 0; }

/* Grades modal fills the dialog: filter + list scroll together, button is a fixed footer. */
.ak-modal__body:has(.grades-modal) { display: flex; flex-direction: column; padding: 0; }
.grades-modal { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.grades-modal-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.grades-modal-footer {
  flex: 0 0 auto;
  padding: 14px 24px calc(14px + env(safe-area-inset-bottom, 0px));
  background: #f8f9fd;
  border-top: 1px solid #e6e9f2;
  box-shadow: 0 -10px 24px rgba(9, 18, 35, 0.08);
}
.grades-modal-footer .btn { width: 100%; }
.grade-rows__head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 2px 10px; margin-bottom: 4px;
  font-weight: 800; font-size: 12.5px; color: #64748b;
  background: #fff;
  border-bottom: 1px solid #e6e9f2;
}
.grade-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding: 11px 2px; border-bottom: 1px solid #f1f3f9;
}
.grade-row:last-child { border-bottom: 0; }
.grade-row__name { font-weight: 700; color: #0f172a; min-width: 0; overflow-wrap: anywhere; }
.grade-row__mark { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.grade-row__mark input {
  width: 88px; text-align: center; font-weight: 800;
  padding: 9px 10px; border-radius: 10px; border: 1px solid #d8deec; background: #fff;
}
.grade-row__mark input:focus { border-color: var(--brand-cyan, #00d4ff); outline: none; }
.grade-row__mark em { font-style: normal; font-weight: 800; color: #94a3b8; font-size: 13px; }
.grades-marks-actions {
  position: sticky;
  bottom: 0;
  z-index: 6;
  margin-top: 8px;
  padding: 14px 24px calc(14px + env(safe-area-inset-bottom, 0px));
  background: #f8f9fd;
  border-top: 1px solid #e6e9f2;
  box-shadow: 0 -10px 24px rgba(9, 18, 35, 0.08);
}
.grades-marks-actions .btn { width: 100%; }

@media (max-width: 520px) {
  .ak-modal__body .grades-filters { grid-template-columns: 1fr; }
}

/* ---- Shared file viewer -------------------------------------------------
   Attachments (images, PDFs) open in here rather than in a new tab, so the
   raw uploads URL never reaches the address bar. */
.ak-viewer {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
}
.ak-viewer.is-open { display: flex; }
.ak-viewer__overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 12, 24, 0.72);
  backdrop-filter: blur(3px);
}
.ak-viewer__dialog {
  position: relative;
  z-index: 1;
  width: min(1000px, 100%);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 28px 70px rgba(8, 12, 24, 0.4);
}
.ak-viewer__bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}
.ak-viewer__title {
  flex: 1;
  min-width: 0;
  font-weight: 800;
  font-size: 14.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ak-viewer__tools { display: flex; align-items: center; gap: 8px; flex: none; }
.ak-viewer__btn {
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #fff;
  border-radius: 10px;
  padding: 7px 15px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  color: inherit;
}
.ak-viewer__btn:hover { background: rgba(124, 77, 255, 0.08); }
.ak-viewer__close {
  border: 0;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
  padding: 0 4px;
}
.ak-viewer__body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: #f1f0f7;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ak-viewer__body img { max-width: 100%; height: auto; display: block; }
.ak-viewer__body iframe { width: 100%; height: 78vh; border: 0; background: #fff; }

@media (max-width: 640px) {
  .ak-viewer { padding: 10px; }
  .ak-viewer__body iframe { height: 70vh; }
}

/* A button that reads as an inline link — used where an attachment link
   became a viewer trigger. */
.ak-linklike {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--primary, #7c4dff);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.ak-linklike:hover { text-decoration: underline; }

/* ---- Modal sizing & scrolling ------------------------------------------
   A tabbed form carries far more fields than a single-purpose dialog, so it
   gets more room; the panes scroll rather than the page. */
.ak-modal__dialog:has(.ak-tabs) { width: min(780px, 100%); }

/* Scrollbars inside modals: visible enough to find, quiet enough to ignore. */
.ak-modal__body,
.ak-tabbody,
.grades-modal-scroll,
.ak-viewer__body {
  scrollbar-width: thin;
  scrollbar-color: rgba(124, 77, 255, 0.45) transparent;
}
.ak-modal__body::-webkit-scrollbar,
.ak-tabbody::-webkit-scrollbar,
.grades-modal-scroll::-webkit-scrollbar,
.ak-viewer__body::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
.ak-modal__body::-webkit-scrollbar-track,
.ak-tabbody::-webkit-scrollbar-track,
.grades-modal-scroll::-webkit-scrollbar-track,
.ak-viewer__body::-webkit-scrollbar-track {
  background: transparent;
}
.ak-modal__body::-webkit-scrollbar-thumb,
.ak-tabbody::-webkit-scrollbar-thumb,
.grades-modal-scroll::-webkit-scrollbar-thumb,
.ak-viewer__body::-webkit-scrollbar-thumb {
  background: rgba(124, 77, 255, 0.35);
  border-radius: 99px;
  border: 3px solid transparent;
  background-clip: content-box;
}
.ak-modal__body::-webkit-scrollbar-thumb:hover,
.ak-tabbody::-webkit-scrollbar-thumb:hover,
.grades-modal-scroll::-webkit-scrollbar-thumb:hover,
.ak-viewer__body::-webkit-scrollbar-thumb:hover {
  background: rgba(124, 77, 255, 0.6);
  background-clip: content-box;
}

/* Give scrolling panes breathing room so the last field never hugs the footer. */
.ak-tabbody { padding-bottom: 6px; }

/* Small helper text under a field. */
.ak-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted, #64748b);
}

/* ---- Single-section modal forms: scroll the fields, pin the footer --------
   Tabbed forms already get this from .ak-tabbody/.ak-form-footer. These are
   the hand-built ones (behaviour note, timetable upload); without it the
   footer scrolls out of reach on a short screen and the save button vanishes. */
.ak-modal__body > form.card > .bh-form,
.ak-modal__body > form.card > .bs-form,
.ak-modal__body > form.card > .tt-form {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
.ak-modal__body > form.card > .bh-modal-footer,
.ak-modal__body > form.card > .bs-modal-footer,
.ak-modal__body > form.card > .tt-modal-footer {
  flex: 0 0 auto;
  background: #fff;
}

/* The date picker is swapped for .ak-date/.ak-date__field at runtime, which
   carries no styling of its own — match it to the select trigger beside it so
   the row reads as one set of controls. */
.bh-field .ak-date,
.tt-field .ak-date { width: 100%; }
.bh-field .ak-date__field,
.tt-field .ak-date__field {
  width: 100%;
  box-sizing: border-box;
  height: 50px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 12px;
  background: #fff;
  font-family: inherit;
  font-size: 14.5px;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.bh-field .ak-date__field:focus,
.tt-field .ak-date__field:focus {
  outline: none;
  border-color: var(--violet, #7c4dff);
  box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.14);
}

/* Class names are the longest values in any filter panel
   ("الملتقى الصيفي الثاني 2026 — المجموعة B"), so give that field twice the
   width of a normal one and let the control use all of it. */
/* Only span two columns where there are two to span: below 980px the panel
   collapses to a single column, and a span there would force a phantom second
   column and throw the other fields out of alignment. */
@media (min-width: 981px) {
  .student-filter-panel .field:has(select[name="class"]) {
    grid-column: span 2;
  }
}
.student-filter-panel .field:has(select[name="class"]) .ak-select__trigger {
  text-align: start;
}


/* ---- 24-hour time picker popup ---- */
.ak-clock {
  position: fixed;
  z-index: 320;
  width: 240px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(16, 27, 52, 0.22);
  animation: akPop 0.16s ease;
}
.ak-clock__preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 10px;
  padding: 10px 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #eef2ff, #f6f8ff);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.ak-clock__preview b {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 1px;
}
.ak-clock__preview i {
  font-style: normal;
  font-size: 22px;
  font-weight: 900;
  opacity: 0.45;
}
.ak-clock__cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.ak-clock__col {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
}
.ak-clock__cap {
  text-align: center;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--muted, #7b879d);
}
.ak-clock__scroll {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 186px;
  padding: 4px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcff;
  scrollbar-width: thin;
}
.ak-clock__cell {
  flex: 0 0 auto;
  padding: 8px 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.ak-clock__cell:hover {
  background: #eef2ff;
}
.ak-clock__cell.is-sel {
  background: var(--brand, #2f6fed);
  color: #fff;
}
.ak-clock__foot {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
.ak-clock__foot button {
  flex: 1 1 0;
  padding: 9px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
}
.ak-clock__foot button:hover {
  background: #f3f6ff;
}
.ak-clock__foot button.is-primary {
  border-color: transparent;
  background: var(--brand, #2f6fed);
  color: #fff;
}

.att-form-hint {
  align-self: center;
  color: var(--muted, #7b879d);
  font-size: 12.5px;
  font-weight: 700;
}


/* ---- Monthly behaviour sheet (modal form + read-only view) ---- */
.ak-modal__dialog:has(.bs-form),
.ak-modal__dialog:has(.bs-view) {
  width: min(880px, 100%);
}
.bs-form { display: grid; gap: 18px; padding: 22px 26px 6px; }
.bs-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.bs-field { display: grid; gap: 8px; min-width: 0; }
.bs-label {
  font-size: 12.5px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.bs-label i { color: #ef4444; font-style: normal; }
.bs-field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 12px;
  background: #fff;
  color: inherit;
  font-family: inherit;
  font-size: 14.5px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.bs-field select:focus {
  outline: none;
  border-color: var(--violet, #7c4dff);
  box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.14);
}
.bs-field .ak-select { width: 100%; min-width: 0; }
.bs-field .ak-select__trigger { min-width: 0; }
.bs-field .ak-select__label {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.bs-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.bs-view .bs-groups { padding: 4px 26px 22px; }
.bs-group {
  border: 1px solid var(--c);
  border-radius: 16px;
  overflow: hidden;
}
.bs-group__head {
  padding: 9px 14px;
  background: var(--c);
  color: #fff;
  font-size: 12.5px;
  font-weight: 900;
  line-height: 1.6;
}
.bs-group__body { display: grid; gap: 2px; padding: 8px; }
.bs-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.7;
}
.bs-check:hover { background: rgba(148, 163, 184, 0.1); }
.bs-check input {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--c);
  cursor: pointer;
}
.bs-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 10px;
  color: var(--c);
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.7;
}
.bs-line span { color: var(--ink, #0f172a); font-weight: 700; }
.bs-none {
  margin: 0;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 700;
  opacity: 0.45;
}
.bs-notice {
  margin: 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(124, 77, 255, 0.08);
  color: var(--violet, #7c4dff);
  font-size: 12.5px;
  font-weight: 800;
}
.bs-modal-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
  padding: 16px 26px 22px;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
}
.bs-modal-footer .btn { min-width: 170px; }

.bs-view__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  padding: 4px 26px 16px;
}
.bs-view__meta span {
  display: grid;
  gap: 3px;
  padding: 11px 14px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 14px;
  font-size: 13.5px;
  font-weight: 800;
}
.bs-view__meta b {
  font-size: 11.5px;
  font-weight: 800;
  opacity: 0.6;
}
