:root {
  --mg-purple-950: #28113f;
  --mg-purple-900: #351550;
  --mg-purple-800: #542176;
  --mg-purple-700: #71269a;
  --mg-purple-600: #8a2db4;
  --mg-green: #42c83e;
  --mg-surface: #f7f5fa;
  --mg-border: #e7e1ec;
}

html,
body,
.app-wrapper,
button,
input,
select,
textarea,
.tabulator {
  font-family: "Rubik", system-ui, -apple-system, "Segoe UI", sans-serif;
}

body {
  direction: rtl;
  text-align: right;
}

.app-sidebar {
  --lte-sidebar-bg: var(--mg-purple-900);
  background: linear-gradient(180deg, var(--mg-purple-950), var(--mg-purple-800)) !important;
}

.app-sidebar .sidebar-brand {
  min-height: 82px;
  padding: 0.75rem;
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

.brand-logo-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  padding: 0.45rem 0.75rem;
  border-radius: 0.8rem;
  background: #fff;
  box-shadow: 0 4px 14px rgba(20, 5, 35, 0.18);
}

.brand-logo-shell img {
  display: block;
  width: 100%;
  max-width: 185px;
  height: 43px;
  object-fit: contain;
}

.sidebar-menu .nav-header {
  color: #d8c9e4;
  font-size: 0.73rem;
  letter-spacing: 0.04em;
}

.sidebar-menu .nav-link {
  color: #f7effc;
  border-radius: 0.45rem;
  margin: 0.08rem 0.55rem;
}

.sidebar-menu .nav-link:hover,
.sidebar-menu .nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
}

.sidebar-menu .nav-link.active {
  box-shadow: inset -3px 0 var(--mg-green);
}

.sidebar-menu .nav-icon {
  color: #dfbdf0;
}

.app-header {
  border-bottom: 1px solid var(--mg-border);
}

.topbar-user-cluster {
  flex: 0 0 auto;
}

.global-search {
  width: min(38vw, 430px);
}

.global-search .form-control {
  border-start-start-radius: 0.6rem;
  border-end-start-radius: 0.6rem;
}

.app-main {
  background: var(--mg-surface);
}

.app-content-header h1 {
  font-size: 1.45rem;
  font-weight: 650;
}

.page-subtitle {
  color: #756c7d;
  font-size: 0.9rem;
}

.card {
  border: 1px solid var(--mg-border);
  box-shadow: 0 0.25rem 0.9rem rgba(46, 22, 61, 0.055);
}

.card-header {
  border-bottom-color: var(--mg-border);
}

.entity-header {
  overflow: hidden;
  border: 0;
  background: linear-gradient(135deg, #fff, #f5eef9);
}

.avatar-placeholder {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 68px;
  height: 68px;
  border: 3px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: var(--mg-purple-700);
  box-shadow: 0 3px 12px rgba(54, 20, 78, 0.22);
  font-size: 1.9rem;
}

.metric-tile {
  min-height: 82px;
  border: 1px solid var(--mg-border);
  border-radius: 0.75rem;
  background: #fff;
  text-align: center;
}

.metric-tile .metric-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--mg-purple-800);
}

.temporary-note {
  color: #c22b42;
  font-size: 0.82rem;
}

.login-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 20%, rgba(138, 45, 180, 0.14), transparent 34%),
    linear-gradient(135deg, #f8f5fa, #eee5f3);
}

.login-box {
  width: min(420px, calc(100vw - 2rem));
}

.login-box .card-outline.card-primary {
  border-top-color: var(--mg-purple-700);
}

.login-brand-logo {
  width: min(230px, 78%);
  height: 70px;
  object-fit: contain;
}

.level-badge {
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  font-weight: 600;
}

.data-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.data-toolbar .quick-search {
  min-width: 220px;
  flex: 1 1 260px;
  max-width: 420px;
}

.toolbar-result-count {
  margin-inline-start: auto;
  white-space: nowrap;
}

.page-view-switch {
  display: inline-flex;
  gap: 0.35rem;
  padding: 0.2rem;
  border: 1px solid var(--mg-border);
  border-radius: 0.65rem;
  background: #fff;
}

.page-view-switch-button {
  display: inline-grid;
  width: 2.45rem;
  height: 2.25rem;
  place-items: center;
  border: 0;
  border-radius: 0.45rem;
  background: transparent;
  color: var(--mg-purple-700);
  font-size: 1.25rem;
}

.page-view-switch-button:hover,
.page-view-switch-button:focus-visible {
  background: #f2e8f7;
  outline: 0;
}

.page-view-switch-button.active {
  background: var(--mg-purple-700);
  color: #fff;
  box-shadow: 0 0.12rem 0.3rem rgba(65, 19, 88, 0.2);
}

.topbar-counter-badge {
  top: 0.12rem;
  left: 0.08rem;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.25rem;
  transform: none;
  font-size: 0.625rem;
  line-height: 1rem;
}

.standard-data-list {
  padding: 0.75rem;
}

.standard-data-list.operational-data-list {
  padding: 0;
}

.operational-list-toolbar {
  padding: 0.75rem;
}

.operational-list-toolbar .toolbar-result-count {
  margin-inline-start: 0;
}

.operational-date-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-inline-start: auto;
}

.operational-column-menu {
  min-width: 13rem;
  max-height: min(24rem, 70vh);
  overflow-y: auto;
}

.operational-filter-menu {
  min-width: 15rem;
}

.operational-selection-limit {
  white-space: nowrap;
}

.standard-data-list .card-title {
  min-width: max-content;
}

.makeup-tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.9rem;
}

.makeup-tile {
  padding: 1rem;
  border: 1px solid var(--mg-border);
  border-inline-start: 0.35rem solid #c74b54;
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 0.15rem 0.5rem rgba(65, 19, 88, 0.08);
}

.makeup-tile.is-scheduled { border-inline-start-color: #d8bd2f; background: #fffdf2; }
.makeup-tile.is-frozen { border-inline-start-color: #777; background: #f4f4f4; }
.makeup-tile.is-selected { box-shadow: 0 0 0 2px var(--mg-purple-600); }
.makeup-tile-header { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.makeup-tile-status { padding: 0.2rem 0.55rem; border-radius: 999px; background: #f7c6c7; color: #5b1015; font-size: 0.75rem; font-weight: 700; }
.makeup-tile.is-scheduled .makeup-tile-status { background: #fff3a6; color: #332b00; }
.makeup-tile.is-frozen .makeup-tile-status { background: #777; color: #fff; }
.makeup-tile h4 { margin: 0.75rem 0 0.3rem; font-size: 1rem; }
.makeup-tile-school { color: var(--bs-secondary-color); font-size: 0.86rem; }
.makeup-tile dl { display: grid; gap: 0.45rem; margin: 0.85rem 0 0; }
.makeup-tile dl div { display: grid; grid-template-columns: 4rem 1fr; gap: 0.5rem; }
.makeup-tile dt { color: var(--bs-secondary-color); font-size: 0.8rem; font-weight: 500; }
.makeup-tile dd { margin: 0; font-size: 0.84rem; }

.list-date-picker {
  width: 9.5rem;
}

.list-date-presets .btn.active {
  color: #fff;
  background: var(--mg-purple-700);
  border-color: var(--mg-purple-700);
}

.calendar-card .fc-multimonth-title.is-month-drilldown {
  cursor: pointer;
  text-decoration: underline dotted rgba(113, 38, 154, 0.55);
  text-underline-offset: 0.2rem;
}

.calendar-drag-week-zones {
  position: absolute;
  inset: 0;
  z-index: 25;
  display: none;
  pointer-events: none;
}

.calendar-drag-week-zones.is-active {
  display: block;
}

.calendar-drag-week-zone {
  position: absolute;
  top: 4.3rem;
  bottom: 0.75rem;
  display: grid;
  width: 5rem;
  place-items: center;
  border: 2px dashed rgba(113, 38, 154, 0.45);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.86);
  color: var(--mg-purple-800);
  font-size: 0.75rem;
  font-weight: 700;
  opacity: 0.75;
}

.calendar-drag-week-zone.is-previous { right: 0.35rem; }
.calendar-drag-week-zone.is-next { left: 0.35rem; }
.calendar-drag-week-zone.is-hovered {
  border-color: var(--mg-purple-700);
  background: #efe1f7;
  opacity: 1;
}

.calendar-drag-week-status {
  position: absolute;
  top: 4.5rem;
  left: 50%;
  z-index: 26;
  padding: 0.35rem 0.65rem;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #27142f;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  box-shadow: 0 0.25rem 0.7rem rgba(0, 0, 0, 0.22);
}

#calendar,
#makeups-calendar {
  position: relative;
}

.saved-view-item {
  display: inline-flex;
  align-items: center;
  border-bottom: 2px solid rgba(var(--bs-primary-rgb), 0.28);
}

.saved-view-open,
.saved-view-delete {
  border: 0;
  background: transparent;
  color: var(--bs-primary);
  line-height: 1.25;
}

.saved-view-open {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.3rem;
  font-size: 0.78rem;
  font-weight: 650;
}

.saved-view-open:hover,
.saved-view-open:focus-visible {
  color: var(--bs-primary-text-emphasis);
  background: rgba(var(--bs-primary-rgb), 0.08);
}

.saved-view-delete {
  padding: 0.25rem 0.2rem;
  color: var(--bs-secondary-color);
}

.saved-view-delete:hover,
.saved-view-delete:focus-visible {
  color: var(--bs-danger);
}

.tabulator {
  border: 0;
  background: transparent;
  font-size: 0.88rem;
}

.tabulator .tabulator-header {
  border: 1px solid var(--mg-border);
  border-radius: 0.55rem 0.55rem 0 0;
  background: #f8f4fa;
}

.tabulator .tabulator-header .tabulator-col,
.tabulator .tabulator-row {
  border-color: var(--mg-border);
}

.tabulator .tabulator-row.tabulator-selected {
  background: #efe1f7;
}

.tabulator .tabulator-row.is-view-only,
.assignment-unscheduled-item.is-view-only {
  opacity: 0.42;
  filter: grayscale(0.3);
}

.tabulator .tabulator-group {
  padding: 0.65rem 0.9rem;
  color: var(--mg-purple-900);
  background: #f2e8f7;
  font-size: 0.95rem;
  font-weight: 700;
}

.students-table-shell .tabulator {
  direction: rtl;
  overflow-x: auto;
}

.students-table-shell > .card-header {
  position: relative;
  z-index: 20;
  padding: 0.55rem;
  border-bottom: 0;
  overflow: visible;
}

.student-command-bar {
  flex-wrap: nowrap;
  min-width: max-content;
  overflow: visible;
}

.student-command-bar > *,
.student-command-bar .btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.student-command-bar .quick-search {
  flex: 0 0 min(220px, 24vw);
  min-width: 190px;
}

.student-command-bar .btn {
  --bs-btn-padding-x: 0.45rem;
  font-size: 0.78rem;
}

.student-status-compact {
  position: sticky;
  left: 0;
  z-index: 2;
  flex: 0 0 112px;
  width: 112px;
  background-color: var(--bs-body-bg);
  box-shadow: 0.35rem 0 0.5rem rgba(35, 18, 45, 0.06);
}

.students-table-shell .tabulator-row,
.students-table-shell .tabulator-cell {
  min-height: 38px;
}

.students-table-shell .tabulator-cell {
  text-overflow: clip;
}

.student-body-tabs {
  min-width: max-content;
}

.student-body-tabs-shell {
  position: relative;
  z-index: 1;
  padding-inline: 0.55rem;
  border-top: 1px solid var(--mg-border);
  background: var(--bs-card-cap-bg, rgba(0, 0, 0, 0.03));
}

.student-body-tabs .nav-link {
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}

.students-table-shell .tabulator .tabulator-header {
  border-radius: 0;
}

.student-table-message {
  position: fixed;
  z-index: 1090;
  inset-block-start: 1rem;
  inset-inline-start: 1rem;
  max-width: min(460px, calc(100vw - 2rem));
  margin: 0;
  box-shadow: 0 0.5rem 1.5rem rgba(35, 18, 45, 0.18);
}

.student-info-icons,
.student-name-cell {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.entity-row-actions {
  justify-content: flex-start;
}

.entity-row-edit-button {
  display: inline-grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--mg-purple-700);
  border-radius: 0.3rem;
  color: var(--mg-purple-700);
  background: #fff;
}

.entity-row-edit-button:hover,
.entity-row-edit-button:focus-visible {
  border-color: var(--mg-purple-800);
  color: #fff;
  background: var(--mg-purple-700);
  outline: 0;
  box-shadow: 0 0 0 0.18rem rgba(113, 38, 154, 0.18);
}

.student-info-button {
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-grid;
  place-items: center;
}

.student-info-hover {
  position: fixed;
  z-index: 1100;
  width: min(360px, calc(100vw - 16px));
  max-height: min(420px, calc(100vh - 16px));
  overflow: auto;
  pointer-events: none;
  font-size: 0.9rem;
}

.student-type-icon {
  font-size: 0.98rem;
}

.student-type-cell {
  display: inline-grid;
  min-width: 1rem;
  place-items: center;
}

.student-type-header {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
}

.student-type-sort-cue {
  display: inline-block;
  color: var(--bs-secondary-color);
  font-size: 0.72rem;
  line-height: 1;
}

.student-type-continuing {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  column-gap: 0.05rem;
}

.student-type-continuing .bi-arrow-repeat {
  font-size: 0.72rem;
  margin-inline-start: -0.2rem;
  margin-block-start: -0.5rem;
}

.student-group-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  line-height: 1.15;
}

.student-group-cell a,
.student-group-label {
  display: inline-block;
  padding: 0.12rem 0.35rem;
  border: 1px solid transparent;
  border-radius: 0.35rem;
  text-decoration: none;
  white-space: nowrap;
}

.student-group-requested {
  color: var(--bs-secondary-color);
}

.student-group-assigned {
  color: var(--bs-primary);
}

.student-current-state-compact {
  flex: 0 0 190px;
  width: 190px;
  background-color: var(--bs-body-bg);
}

.student-current-state {
  max-width: 205px;
  white-space: normal;
  line-height: 1.35;
}

.student-start-date {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  padding: .2rem .45rem;
  border-radius: .45rem;
  font-weight: 600;
}

.student-start-date--actual {
  color: var(--bs-success-text-emphasis);
  background: var(--bs-success-bg-subtle);
  border: 1px solid var(--bs-success-border-subtle);
}

.student-start-date--planned {
  color: var(--bs-secondary-color);
  background: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color);
  font-weight: 500;
}

.student-group-future {
  color: #b45309;
  font-weight: 700;
}

.student-group-previous {
  color: var(--bs-secondary-color);
}

.student-command-bar .dropdown-menu {
  z-index: 1080;
}

.campaign-history-table {
  table-layout: fixed;
  min-width: 1080px;
}

.campaign-history-table .campaign-name-column {
  width: 13rem;
}

.campaign-history-table .campaign-template-column {
  width: 11rem;
}

.student-group-active {
  border-color: currentColor !important;
}

.student-inline-status {
  min-width: 132px;
  padding-block: 0.18rem;
}

.student-status-saving {
  opacity: 0.58;
  cursor: wait;
}

.preserve-line-breaks {
  white-space: pre-wrap;
}

.calendar-card .fc {
  --fc-border-color: #e4dfe7;
  --fc-button-bg-color: var(--mg-purple-700);
  --fc-button-border-color: var(--mg-purple-700);
  --fc-button-hover-bg-color: var(--mg-purple-800);
  --fc-button-hover-border-color: var(--mg-purple-800);
  --fc-today-bg-color: #f2e6f8;
}

.calendar-card .fc .fc-toolbar-title {
  font-size: 1.1rem;
}

/* Every five-minute slot remains selectable, but the time axis no longer makes
   day/week calendars several screens tall. */
.app-main .fc .fc-timegrid-slot {
  height: 4px;
  font-size: 0;
  line-height: 0;
}

.app-main .fc .fc-timegrid-slot-label,
.app-main .fc .fc-timegrid-axis-cushion,
.app-main .fc .fc-timegrid-slot-label-cushion {
  padding-inline: 1px;
  font-size: 0.56rem;
  line-height: 1;
}

.app-main .fc .fc-timegrid-event .fc-event-time {
  font-size: 0.72rem;
}

.fc .fc-prev-button .fc-icon,
.fc .fc-next-button .fc-icon {
  font-family: inherit !important;
  font-size: 0 !important;
}
.fc .fc-prev-button .fc-icon::after { content: '›'; font-size: 1.55rem; line-height: 1; }
.fc .fc-next-button .fc-icon::after { content: '‹'; font-size: 1.55rem; line-height: 1; }

.calendar-card .fc-event.is-historical {
  opacity: 0.56;
}

.calendar-card .fc-event.is-past-meeting {
  opacity: 0.48;
  filter: grayscale(0.28);
}

.fc-event.is-view-only {
  opacity: 0.38;
  filter: grayscale(0.35);
  cursor: not-allowed;
}

.calendar-card .fc-event.is-next-meeting {
  box-shadow: 0 0 0 3px rgba(66, 200, 62, 0.28);
  filter: saturate(1.2);
}

.calendar-card .fc-daygrid-day-frame {
  min-height: 92px;
}

.calendar-card .fc-daygrid-day,
.calendar-card .fc-timegrid-col {
  background: #faf8fb;
  box-shadow: inset 0 0 0 1px rgba(88, 77, 94, 0.07);
}

.calendar-card .fc-day-today {
  background: #f3e8f8 !important;
  box-shadow: inset 0 0 0 2px rgba(113, 38, 154, 0.2);
}

.calendar-card .fc-multimonth-month {
  border: 1px solid #cfc5d3;
  border-radius: 0.55rem;
  overflow: hidden;
  background: #fff;
}

.calendar-card .fc-multimonth-title {
  background: #f7f2f9;
}

.calendar-card .fc-popover {
  z-index: 1080;
  width: min(440px, calc(100vw - 2rem));
  max-height: 70vh;
  overflow: hidden;
}

.calendar-card .fc-popover-body {
  max-height: calc(70vh - 3rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.calendar-card .fc-list {
  max-height: 72vh;
  overflow-y: auto;
}

.calendar-card .fc-list-event-time,
.calendar-card .fc-event-time,
.calendar-time {
  direction: ltr;
  unicode-bidi: isolate;
}

.calendar-event-content {
  display: flex;
  gap: 0.25rem;
  align-items: flex-start;
  min-width: 0;
  overflow: hidden;
}

.calendar-event-content > span {
  min-width: 0;
  overflow: hidden;
}

.calendar-event-content .meeting-badge {
  font-size: 0.62rem;
  vertical-align: 0.08rem;
}

.calendar-drag-state {
  flex: 0 0 auto;
  font-size: 0.72rem;
  line-height: 1;
}

.teacher-chip {
  display: inline-flex;
  gap: 0.18rem;
  align-items: center;
  max-width: 100%;
  margin-top: 0.12rem;
  padding: 0.05rem 0.25rem;
  border-inline-start: 3px solid var(--teacher-color, #6c757d);
  border-radius: 0.2rem;
  background: rgba(255, 255, 255, 0.78);
  color: #2d2630;
  font-size: 0.68rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.calendar-focus-mode {
  overflow: hidden;
}

body.calendar-focus-mode .app-header,
body.calendar-focus-mode .app-sidebar,
body.calendar-focus-mode .app-content-header,
body.calendar-focus-mode .app-footer {
  display: none !important;
}

body.calendar-focus-mode .app-main {
  margin-inline-start: 0 !important;
}

body.calendar-focus-mode .app-content {
  height: 100vh;
  padding: 0.5rem;
  overflow: auto;
}

body.calendar-focus-mode .calendar-card,
body.calendar-focus-mode .assignment-week-card {
  min-height: calc(100vh - 1rem);
  margin: 0;
}

body.calendar-focus-mode .calendar-card > .card-header,
body.calendar-focus-mode .assignment-compact-controls {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #fff;
}

body.table-focus-mode { overflow: hidden; }
body.table-focus-mode .app-header,
body.table-focus-mode .app-sidebar,
body.table-focus-mode .app-content-header,
body.table-focus-mode .app-footer { display: none !important; }
body.table-focus-mode .app-main { margin-inline-start: 0 !important; }
body.table-focus-mode .app-content { padding: 0 !important; }
.table-focus-target-active {
  position: fixed !important;
  inset: 0;
  z-index: 1090;
  min-height: 100vh;
  margin: 0 !important;
  border-radius: 0 !important;
  background: #fff;
  overflow: hidden;
}
.table-focus-target-active > .card-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #fff;
}
.table-focus-target-active.students-table-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}
.table-focus-target-active.students-table-shell > .student-body-tabs-shell {
  position: relative;
  z-index: 4;
  min-width: 0;
  background: #fff;
  box-shadow: 0 0.25rem 0.55rem rgba(35, 18, 45, 0.08);
}
.table-focus-target-active.students-table-shell > .card-body {
  min-height: 0;
  overflow: hidden;
}
[data-group-multifilter] .dropdown-menu {
  min-width: 100%;
  max-height: 19rem;
  overflow: auto;
}

.assignment-choice-list {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--mg-border);
  border-radius: 0.55rem;
}

.assignment-choice {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  padding: 0.65rem 0.75rem;
  margin: 0;
  border-bottom: 1px solid var(--mg-border);
  cursor: pointer;
}

.assignment-choice:last-child { border-bottom: 0; }
.assignment-choice:hover,
.assignment-choice.is-selected { background: #f2e8f7; }
.assignment-choice.is-disabled { background: #f8f8f8; cursor: not-allowed; opacity: 0.75; }
.assignment-choice span { min-width: 0; }
.assignment-choice small { display: block; }

.assignment-icon-button {
  width: 2.15rem;
  padding-inline: 0;
}

.assignment-week-card .fc .fc-timegrid-slot {
  height: 4px;
  font-size: 0;
  line-height: 0;
}

.assignment-week-card .fc .fc-timegrid-slot-label,
.assignment-week-card .fc .fc-timegrid-axis-cushion,
.assignment-week-card .fc .fc-timegrid-slot-label-cushion {
  padding: 0;
  font-size: 0;
  line-height: 0;
}

.assignment-week-card .fc .fc-timegrid-slot-label {
  position: relative;
  overflow: visible;
}

.assignment-week-card .fc .fc-timegrid-slot-label-cushion {
  position: absolute;
  inset-inline-end: 1px;
  top: -0.28rem;
  z-index: 2;
  padding: 1px 2px;
  border-radius: 0.2rem;
  background: rgba(255, 255, 255, 0.88);
  font-size: 0.56rem;
  line-height: 1;
}

.assignment-week-card .fc-col-header-cell-cushion {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  width: 100%;
  padding: 0.25rem 0.15rem;
  color: inherit;
  text-decoration: none;
}

.assignment-weekday-name {
  font-size: 0.78rem;
  font-weight: 700;
}

.assignment-day-actions {
  display: flex;
  justify-content: center;
  gap: 0.2rem;
}

.assignment-day-actions button {
  padding: 0.05rem 0.2rem;
  border: 1px solid #c9bbcf;
  border-radius: 0.25rem;
  color: #5d2877;
  background: #fff;
  font-size: 0.56rem;
  line-height: 1.3;
}

.assignment-event-content {
  display: flex;
  gap: 0.2rem;
  align-items: flex-start;
  overflow: hidden;
  padding-inline: 0.15rem;
  font-size: 0.67rem;
  line-height: 1.05;
}

.assignment-event-content > span { min-width: 0; }
.assignment-event-content small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assignment-event-check { flex: 0 0 auto; width: 0.75rem; height: 0.75rem; margin-top: 0.05rem; }

.assignment-unscheduled-list {
  display: grid;
  gap: 0.4rem;
}

.assignment-unscheduled-item {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--mg-border);
  border-radius: 0.45rem;
  background: #fff;
  cursor: grab;
  user-select: none;
}

.assignment-unscheduled-item:active { cursor: grabbing; }
.assignment-unscheduled-item span { min-width: 0; }
.assignment-unscheduled-item small { display: block; color: #756a79; }

.meeting-badge {
  margin-inline-start: 0.2rem;
}

.simple-table th {
  color: #6b6070;
  font-weight: 600;
  background: #faf8fb;
}

.simple-table td,
.simple-table th {
  vertical-align: middle;
}

.chat-shell {
  height: min(72vh, 760px);
}

.conversation-list {
  height: 100%;
  overflow-y: auto;
  border-inline-end: 1px solid var(--mg-border);
}

.message-stream {
  height: calc(100% - 120px);
  overflow-y: auto;
  padding: 1rem;
  background: #fbfafc;
}

.message-bubble {
  max-width: 76%;
  margin-block: 0.4rem;
  padding: 0.65rem 0.8rem;
  border-radius: 0.85rem;
  background: #ede7f0;
}

.message-bubble.mine {
  margin-inline-start: auto;
  color: #fff;
  background: var(--mg-purple-700);
}

.chat-welcome {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  padding: 2rem;
  text-align: center;
  background: #fbfafc;
}

.chat-contact-avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  font-size: 1rem;
}

.severity-critical { color: #111; }
.severity-high { color: #d3263a; }
.severity-normal { color: #bd7b00; }
.severity-low { color: #367aa7; }
.severity-none { color: #a8a1aa; }

.compact-timeline {
  position: relative;
  padding-inline-start: 1.1rem;
}

.compact-timeline::before {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0.25rem;
  width: 2px;
  content: "";
  background: #e3d9e9;
}

.compact-timeline-item {
  position: relative;
  padding: 0 0 0.9rem;
}

.compact-timeline-item::before {
  position: absolute;
  inset-block-start: 0.3rem;
  inset-inline-start: -0.98rem;
  width: 0.55rem;
  height: 0.55rem;
  border: 2px solid #fff;
  border-radius: 50%;
  content: "";
  background: var(--mg-purple-600);
  box-shadow: 0 0 0 1px #cab9d4;
}

.student-guardians-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .35rem;
}

.student-guardian-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  min-height: 3.15rem;
  padding: .45rem 0;
  border-bottom: 1px solid rgba(111, 42, 142, .1);
}

.student-guardian-row:last-child { border-bottom: 0; }
.student-guardian-main { min-width: 0; }
.student-guardian-phone {
  display: block;
  width: fit-content;
  margin-top: .18rem;
  color: var(--bs-secondary-color);
  font-size: .82rem;
  text-decoration: none;
}
.student-guardian-phone:hover { color: var(--mg-purple-700); }
.student-guardian-actions { display: flex; align-items: center; gap: .3rem; }
.student-card-mini-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .22rem;
  min-height: 1.75rem;
  padding: .14rem .42rem;
  font-size: .72rem;
  line-height: 1;
  white-space: nowrap;
}

.future-module {
  opacity: 0.66;
}

@media (max-width: 991.98px) {
  .global-search { width: min(52vw, 360px); }
  .chat-shell { height: auto; }
  .conversation-list { max-height: 260px; border-inline-end: 0; border-bottom: 1px solid var(--mg-border); }
}
.academic-year-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1rem;
}

.academic-year-tile {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 128px;
  padding: 1.1rem;
  color: var(--bs-body-color);
  text-decoration: none;
  background: var(--bs-body-bg);
  border: 1px solid rgba(111, 42, 142, .2);
  border-radius: 1rem;
  box-shadow: 0 .3rem 1rem rgba(65, 36, 78, .07);
  transition: transform .15s ease, box-shadow .15s ease;
}

.academic-year-tile:hover { transform: translateY(-2px); box-shadow: 0 .55rem 1.3rem rgba(65, 36, 78, .12); }
.academic-year-calendar-icon { width: 82px; height: 82px; flex: 0 0 82px; display: grid; place-items: center; position: relative; color: #6f2a8e; }
.academic-year-calendar-icon i { font-size: 4.8rem; line-height: 1; }
.academic-year-calendar-icon strong { position: absolute; top: 39px; font-size: 1rem; }
.academic-year-tile-copy { display: flex; flex-direction: column; gap: .25rem; }
.academic-year-tile-copy strong { font-size: 1.25rem; color: #5d2576; }
.academic-year-tile-copy small, .academic-year-tile-copy span { color: var(--bs-secondary-color); }
.academic-year-preview { display: grid; grid-template-columns: 1fr auto; gap: .5rem 1rem; padding: .85rem; border-radius: .75rem; background: #f7f1fa; }
.academic-year-preview strong { color: #6f2a8e; }
.academic-year-calendar-card { overflow: hidden; }
.holiday-legend { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .65rem; border-radius: 999px; font-size: .82rem; font-weight: 600; border-inline-start: 5px solid currentColor; }
.holiday-organization { color: #8f1426 !important; background: #f7b9c1 !important; border-color: #b51f34 !important; }
.holiday-registration-body { color: #8c3543 !important; background: #f7d1d6 !important; border-color: #d86d7c !important; }
.holiday-school { color: #164f79 !important; background: #c5e6fa !important; border-color: #4ca5da !important; }
#academic-year-calendar .fc-event { border: 0; border-inline-start: 3px solid; border-radius: .35rem; padding: 1px 3px; font-size: .72rem; cursor: pointer; overflow: hidden; }
#academic-year-calendar .fc-event-title { font-weight: 600; }
#academic-year-calendar .fc-multimonth-title { color: #5d2576; font-weight: 700; }
#academic-year-calendar .fc-daygrid-day-number { color: #2456d9; text-decoration: none; }
#academic-year-calendar .fc-day-today { background: rgba(111, 42, 142, .06) !important; }
.calendar-holiday-event { border: 0 !important; border-inline-start: 3px solid currentColor !important; border-radius: .35rem !important; cursor: default !important; }
.calendar-holiday-event-copy { display: block; padding: 1px 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .7rem; font-weight: 600; }
.calendar-holiday-header { display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 2px 3px 4px; }
.calendar-holiday-tag { display: block; max-width: 100%; padding: 1px 4px; border-inline-start: 3px solid currentColor; border-radius: .3rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .66rem; font-weight: 600; line-height: 1.35; }
@media (max-width: 767px) { .academic-year-tiles { grid-template-columns: 1fr; } }

.group-meeting-card {
  min-height: 86px;
  color: inherit;
  border-color: rgba(111, 42, 142, .14);
  transition: opacity .15s ease, transform .15s ease, box-shadow .15s ease;
}

.group-meeting-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 .4rem 1rem rgba(65, 36, 78, .08);
}

.group-meeting-card--past {
  opacity: .58;
  background: var(--bs-tertiary-bg);
}

.group-meeting-card--past:hover {
  opacity: .82;
}

.group-meeting-card--next {
  border-color: rgba(220, 53, 69, .36);
  box-shadow: 0 0 0 2px rgba(220, 53, 69, .06);
}

.calendar-print-header, #calendar-print-document { display: none; }

@media print {
  body.calendar-print-mode > *:not(#calendar-print-document),
  #calendar-print-document .btn,
  #calendar-print-document select,
  #calendar-print-document input,
  #calendar-print-document .fc-button-group,
  #calendar-print-document .fc-toolbar-chunk:not(:has(.fc-toolbar-title)) {
    display: none !important;
  }
  #calendar-print-document {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    direction: rtl;
  }
  #calendar-print-document .card,
  #calendar-print-document .calendar-card {
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: 0 !important;
  }
  .calendar-print-header {
    display: block !important;
    margin-bottom: 12mm;
    direction: rtl;
  }
  .calendar-print-header h1 { font-size: 18pt; margin: 0 0 4mm; }
  .calendar-print-header p { font-size: 10pt; margin: 0; color: #444; }
  #calendar-print-document .fc { font-size: 9pt; }
  #calendar-print-document .fc-scroller { overflow: visible !important; height: auto !important; }
}
