:root {
  --bg: #f5f8fb;
  --ink: #192333;
  --muted: #6d7786;
  --card: #ffffff;
  --line: #dbe5ee;
  --green: #24a47f;
  --green-dark: #14775d;
  --blue: #3478f6;
  --amber: #f5a524;
  --red: #e45252;
  --shadow: 0 22px 55px rgba(25, 35, 51, .13);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Tajawal", Arial, sans-serif;
  direction: rtl;
  background:
    radial-gradient(circle at 14% 12%, rgba(52, 120, 246, .13), transparent 28%),
    radial-gradient(circle at 88% 20%, rgba(36, 164, 127, .15), transparent 26%),
    linear-gradient(135deg, #eef5f8 0%, #fbfcff 44%, #eef7f1 100%);
}

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

.program-admin-notice {
  display: grid;
  gap: 7px;
  margin-bottom: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(52, 120, 246, .22);
  border-radius: 19px;
  background: linear-gradient(135deg, rgba(52, 120, 246, .10), rgba(35, 167, 131, .09)), #fff;
  box-shadow: 0 14px 30px rgba(25, 35, 51, .08);
}

.program-admin-notice > span {
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 900;
}

.program-admin-notice strong {
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
}

.program-admin-notice p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.7;
}

.program-admin-notice small {
  color: var(--muted);
  font-weight: 700;
}

.shell,
.page {
  position: relative;
  width: min(100% - 32px, 1360px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0 42px;
}

.shell {
  display: grid;
  align-content: center;
  gap: 30px;
}

.shell::before,
.page::before {
  content: "د";
  position: fixed;
  inset-inline-start: 50%;
  top: 18px;
  translate: -50% 0;
  color: rgba(36, 164, 127, .08);
  font-size: min(40vw, 430px);
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
  z-index: 0;
}

.shell > *,
.page > * {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 24px;
  text-align: center;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--blue));
  box-shadow: 0 16px 36px rgba(36, 164, 127, .28);
  font-size: 30px;
  font-weight: 900;
}

.brand-photo-mark {
  overflow: hidden;
  padding: 0;
  border: 3px solid rgba(255,255,255,.92);
  background: #fff;
}

.brand-photo-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 54px);
  font-weight: 900;
  letter-spacing: 0;
}

.brand p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 20px;
  font-weight: 700;
}

.top-actions,
.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}

.top-nav a,
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 18px;
  border: 1px solid rgba(36, 164, 127, .24);
  border-radius: 17px;
  color: var(--green-dark);
  background: rgba(255, 255, 255, .72);
  font-weight: 900;
  box-shadow: 0 10px 28px rgba(25, 35, 51, .08);
}

.top-nav a img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex: 0 0 auto;
}

.top-nav a.top-nav-full {
  flex: 1 1 calc(50% - 5px);
}

.hero,
.panel,
.auth-panel {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .86);
  border-radius: 30px;
  background: rgba(255, 255, 255, .82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero {
  position: relative;
  padding: clamp(22px, 4vw, 42px);
}

.hero::before {
  content: "";
  position: absolute;
  inset-inline-start: -80px;
  top: -95px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(245, 165, 36, .16);
}

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

.hero-head {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-bottom: 28px;
  text-align: center;
}

.hero-head h2,
.hero h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 42px);
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: 0;
}

.hero-head p,
.hero p {
  max-width: 760px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.7;
  font-weight: 600;
  text-align: center;
}

.actions,
.stats-grid,
.groups-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.tool-card,
.stat,
.group-card,
.mini-card {
  display: grid;
  align-items: center;
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,255,255,.82)),
    var(--card);
  box-shadow: 0 18px 34px rgba(25, 35, 51, .09);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.tool-card {
  min-height: 190px;
  justify-items: center;
  text-align: center;
}

.tool-card:hover,
.group-card:hover {
  transform: translateY(-5px);
  border-color: rgba(36, 164, 127, .46);
  box-shadow: 0 26px 46px rgba(25, 35, 51, .14);
}

.tool-icon {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  border-radius: 24px;
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--blue));
  box-shadow: 0 18px 34px rgba(35, 167, 131, .25);
  font-size: 42px;
  font-weight: 900;
}

.tool-card strong,
.stat strong,
.mini-card strong {
  display: block;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 900;
}

.tool-card span,
.stat span,
.mini-card span,
.group-card p {
  display: block;
  color: var(--muted);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.6;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 22px 0;
  gap: 16px;
}

.stat {
  min-height: 126px;
}

.stat-action-btn {
  width: 100%;
  min-height: 82px;
  display: grid;
  place-items: center;
  gap: 4px;
  border: 0;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--blue));
  font: inherit;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 14px 30px rgba(35, 167, 131, .20);
}

.stat-actions-stack {
  width: 100%;
  display: grid;
  gap: 10px;
}

.stat-actions-stack .stat-action-btn {
  min-height: 66px;
  font-size: 19px;
}

.stat-action-btn.is-danger {
  background: linear-gradient(135deg, #d94d4d, #a51f3f);
  box-shadow: 0 14px 30px rgba(217, 77, 77, .18);
}

.stat-action-btn small {
  color: rgba(255,255,255,.86);
  font-size: 14px;
  font-weight: 900;
}

.workspace-grid,
.dashboard-grid,
.auth-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(330px, .85fr);
  gap: 20px;
  align-items: start;
}

[hidden] {
  display: none !important;
}

.dashboard-grid {
  margin-top: 20px;
}

.panel {
  padding: clamp(20px, 3vw, 34px);
}

.panel-head,
.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.panel-head h2,
.panel-header h2 {
  margin: 0 0 8px;
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 900;
}

.panel-head p,
.panel-header p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 700;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

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

.compact-form + .compact-form {
  margin-top: 22px;
}

.payment-type-form {
  align-items: end;
  margin-bottom: 18px;
}

.panel-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.existing-student-modal-panel {
  width: min(680px, calc(100% - 24px));
}

.existing-student-form,
.existing-student-list {
  display: grid;
  gap: 12px;
}

.existing-student-list {
  max-height: min(52vh, 480px);
  overflow-y: auto;
  padding: 4px;
}

.existing-student-option {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
}

.existing-student-option:has(input:checked) {
  border-color: rgba(35, 167, 131, .7);
  background: rgba(35, 167, 131, .08);
}

.existing-student-option input {
  width: 20px;
  height: 20px;
  accent-color: var(--green);
}

.existing-student-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.existing-student-copy strong {
  font-size: 17px;
  font-weight: 900;
}

.existing-student-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-form .full {
  grid-column: 1 / -1;
}

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

.time-selects {
  display: grid;
  grid-template-columns: .8fr .8fr 1fr;
  gap: 8px;
}

.current-schedules {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px dashed #cbd8e4;
  border-radius: 18px;
  background: rgba(255, 255, 255, .62);
}

.current-schedules > strong {
  font-size: 15px;
  font-weight: 900;
}

.current-schedules-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.current-schedules-list span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--green-dark);
  background: rgba(35, 167, 131, .10);
  font-size: 14px;
  font-weight: 900;
}

.schedule-edit-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.schedule-edit-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .72);
}

.schedule-edit-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.schedule-edit-actions .btn {
  min-width: 82px;
}

.group-settings-heading {
  margin-bottom: 20px;
}

.group-settings-heading .panel-header {
  margin-bottom: 0;
}

.group-settings-schedules-panel {
  grid-column: 1 / -1;
}

.group-settings-page .payment-type-form + .payment-type-form {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.field input,
.field select {
  width: 100%;
  min-height: 58px;
  padding: 0 16px;
  border: 2px solid #d8e5ee;
  border-radius: 18px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-size: 17px;
  font-weight: 800;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.6), 0 12px 24px rgba(25, 35, 51, .05);
}

.field input:focus,
.field select:focus {
  border-color: rgba(35, 167, 131, .72);
  box-shadow: 0 0 0 5px rgba(35, 167, 131, .12), 0 14px 28px rgba(25, 35, 51, .08);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 0 22px;
  border: 0;
  border-radius: 18px;
  font: inherit;
  font-size: 17px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: .52;
  box-shadow: none;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--blue));
  box-shadow: 0 18px 34px rgba(35, 167, 131, .25);
}

.btn-danger {
  color: #fff;
  background: linear-gradient(135deg, var(--red), #f29a3f);
  box-shadow: 0 18px 34px rgba(228, 82, 82, .22);
}

.btn-soft,
.btn-light {
  color: var(--green-dark);
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(35, 167, 131, .24);
  box-shadow: 0 10px 28px rgba(25, 35, 51, .08);
}

.badge {
  display: inline-flex;
  width: fit-content;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--blue);
  background: rgba(52, 120, 246, .1);
  font-size: 15px;
  font-weight: 900;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(25, 35, 51, .08);
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
}

.status-badge.is-connected {
  color: var(--green-dark);
  background: rgba(35, 167, 131, .12);
}

.status-badge.is-processing {
  color: var(--blue);
  background: rgba(52, 120, 246, .10);
}

.status-badge.is-error,
.status-badge.is-disconnected {
  color: #9b3636;
  background: rgba(228, 82, 82, .10);
}

.group-card h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 900;
}

.group-card.is-selected {
  border-color: rgba(35, 167, 131, .58);
  background:
    linear-gradient(135deg, rgba(35, 167, 131, .10), rgba(52, 120, 246, .08)),
    #fff;
}

.danger-panel {
  border-color: rgba(228, 82, 82, .22);
}

.settings-security-panel {
  margin: 22px 0;
}

.group-description-settings-panel {
  grid-column: 1 / -1;
}

.security-status {
  flex: 0 0 auto;
  padding: 10px 14px;
  border-radius: 999px;
  color: #a51f3f;
  background: rgba(217, 77, 77, .10);
  font-size: 15px;
  font-weight: 900;
}

.security-status.is-set {
  color: var(--green-dark);
  background: rgba(35, 167, 131, .12);
}

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

.booking-mode-option {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 2px solid #d8e5ee;
  border-radius: 20px;
  background: rgba(255,255,255,.82);
  cursor: pointer;
}

.booking-mode-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.booking-mode-option strong {
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
}

.booking-mode-option span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.6;
}

.booking-mode-option:has(input:checked),
.booking-mode-option.is-selected {
  border-color: rgba(35, 167, 131, .74);
  background: linear-gradient(135deg, rgba(35, 167, 131, .12), rgba(52, 120, 246, .08)), #fff;
}

.btn-count {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  margin-inline-start: 8px;
  padding: 0 7px;
  border-radius: 999px;
  color: #fff;
  background: var(--green-dark);
  font-size: 13px;
  font-weight: 900;
}

.pending-bookings-panel {
  margin-top: 22px;
}

.pending-groups {
  display: grid;
  gap: 18px;
}

.pending-group-card {
  overflow: hidden;
  border: 1px solid rgba(35, 167, 131, .20);
  border-radius: 22px;
  background: rgba(255,255,255,.74);
}

.pending-group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(216, 229, 238, .9);
}

.pending-group-head h3 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 900;
}

.pending-group-head p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
}

.pending-group-head span {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--green-dark);
  background: rgba(35, 167, 131, .12);
  font-size: 14px;
  font-weight: 900;
}

.pending-table-wrap {
  padding-top: 16px;
}

.logout-footer {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.account-delete-panel {
  margin-top: 22px;
}

.logout-footer .btn {
  min-width: 220px;
}

.manage-group-card.is-selected {
  outline: 3px solid rgba(35, 167, 131, .58);
  outline-offset: 4px;
}

.schedule-list,
.chart {
  display: grid;
  gap: 12px;
}

.schedule-item {
  display: grid;
  grid-template-columns: 76px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(25, 35, 51, .06);
}

.bar-row {
  display: grid;
  grid-template-columns: 72px 1fr 42px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 800;
}

.bar-track {
  height: 14px;
  border-radius: 999px;
  background: #e3ebf2;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--green), var(--blue));
}

.week-panel {
  margin-top: 20px;
}

.week-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding-bottom: 6px;
}

.week-grid-hero {
  margin-top: 24px;
}

.day-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,255,255,.84)),
    var(--card);
  box-shadow: 0 14px 28px rgba(25, 35, 51, .08);
}

.day-card.is-today {
  border-color: rgba(35, 167, 131, .56);
  background:
    linear-gradient(135deg, rgba(35, 167, 131, .13), rgba(52, 120, 246, .10)),
    rgba(255, 255, 255, .92);
  box-shadow: 0 20px 38px rgba(35, 167, 131, .15);
}

.day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.day-head strong {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-size: 25px;
  font-weight: 900;
}

.day-head strong small {
  color: var(--muted);
  font-size: 16px;
  font-weight: 900;
}

.day-head span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--green-dark);
  background: rgba(35, 167, 131, .10);
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.day-groups {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 10px;
  align-items: start;
  justify-content: stretch;
}

.day-groups.is-empty {
  grid-template-columns: 1fr;
}

.week-group {
  display: grid;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  grid-template-columns: 96px 86px 1fr;
  gap: 12px;
  align-items: center;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: transparent;
  box-shadow: none;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.stage-card {
  position: relative;
  min-height: 150px;
  aspect-ratio: 2.47 / 1;
  display: block;
  overflow: hidden;
  background: transparent;
}

.day-groups .stage-card {
  min-height: 130px;
}

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

.stage-card-image {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.week-group:hover {
  transform: translateY(-3px);
  box-shadow: none;
}

.time-pill {
  display: grid;
  place-items: center;
  min-height: 58px;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--blue));
  font-size: 19px;
  font-weight: 900;
  direction: ltr;
}

.time-pill.start-only {
  position: absolute;
  top: 16px;
  left: 22px;
  z-index: 3;
  min-width: auto;
  min-height: auto;
  padding: 0;
  color: #6b3e02;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  text-shadow: none;
  font-size: 22px;
}

.stage-card-name {
  position: absolute;
  right: 22px;
  top: 16px;
  z-index: 2;
  color: #6b3e02;
  max-width: 42%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 22px;
  font-weight: 900;
  text-shadow: none;
}

.stage-card-bottom {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 16px;
  z-index: 2;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.stage-card-students {
  position: static;
  flex: 0 0 auto;
  color: #6b3e02;
  font-size: 20px;
  font-weight: 900;
  text-align: left;
  white-space: nowrap;
}

.stage-card-description {
  position: static;
  flex: 1 1 auto;
  min-width: 0;
  transform: translateY(-5px);
  overflow: hidden;
  color: #6b3e02;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.15;
  text-overflow: clip;
  white-space: normal;
  text-align: right;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.time-pill small {
  color: rgba(255, 255, 255, .82);
  font-size: 13px;
  font-weight: 800;
}

.week-group h3 {
  margin: 0 0 5px;
  font-size: 19px;
  font-weight: 900;
}

.week-group p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.5;
  max-width: none;
  text-align: start;
}

.week-group.is-today-lesson {
  background: transparent;
}

.week-group.is-finished {
  background: transparent;
  opacity: 1;
}

.week-group.is-finished .time-pill {
  background: transparent;
  box-shadow: none;
}

.week-group.is-finished {
  filter: none;
}

.week-group.is-completed {
  opacity: 1;
  filter: grayscale(1);
}

.week-group.is-holiday {
  opacity: 1;
  filter: grayscale(1);
}

.week-group.is-completed:hover {
  transform: none;
}

.week-group.is-holiday:hover {
  transform: none;
}

.week-group.is-completed .stage-card-image,
.week-group.is-holiday .stage-card-image {
  opacity: .48;
}

.week-group.is-completed .time-pill,
.week-group.is-completed .stage-card-name,
.week-group.is-completed .stage-card-number,
.week-group.is-completed .stage-card-description,
.week-group.is-completed .stage-card-students,
.week-group.is-holiday .time-pill,
.week-group.is-holiday .stage-card-name,
.week-group.is-holiday .stage-card-number,
.week-group.is-holiday .stage-card-description,
.week-group.is-holiday .stage-card-students {
  color: #5f6873;
}

.lesson-completed-label {
  position: absolute;
  left: 50%;
  top: 78%;
  z-index: 4;
  padding: 7px 14px;
  border-radius: 999px;
  color: #fff;
  background: rgba(89, 99, 110, .92);
  box-shadow: 0 12px 26px rgba(70, 78, 88, .18);
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  transform: translate(-50%, -50%);
}

.lesson-holiday-label {
  background: rgba(38, 117, 94, .92);
}

.lesson-state {
  display: inline-flex;
  width: fit-content;
  margin-top: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--green-dark);
  background: rgba(35, 167, 131, .11);
  font-size: 13px;
  font-weight: 900;
}

.week-group.is-finished .lesson-state {
  color: #667085;
  background: #e8eef3;
}

.day-empty {
  margin-top: 0;
  padding: 18px 12px;
  font-size: 15px;
  width: 100%;
  grid-column: 1 / -1;
  justify-self: stretch;
}

.session-panel {
  padding: 0;
}

.session-panel .panel-header {
  margin-bottom: 0;
  padding: clamp(20px, 3vw, 34px);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(35, 167, 131, .10), rgba(52, 120, 246, .08)),
    rgba(255,255,255,.66);
}

.session-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
}

.session-header-actions .btn {
  width: auto;
  justify-content: center;
  white-space: nowrap;
}

.session-header-actions form {
  margin: 0;
}

.session-notice {
  margin: 18px clamp(18px, 3vw, 34px) 0;
}

.session-date-form {
  display: grid;
  gap: 7px;
  min-width: 180px;
}

.session-date-form label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.session-date-form input {
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  outline: none;
}

.session-date-form input:focus {
  border-color: rgba(35, 167, 131, .72);
  box-shadow: 0 0 0 4px rgba(35, 167, 131, .12);
}

.table-wrap {
  padding: 24px clamp(18px, 3vw, 34px) 34px;
  overflow-x: auto;
}

.session-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 22px clamp(18px, 3vw, 34px) 0;
}

.group-students-tools {
  grid-template-columns: minmax(0, 1fr);
}

.search-box {
  position: relative;
}

.search-box input {
  width: 100%;
  min-height: 64px;
  padding: 0 58px 0 18px;
  border: 2px solid #d8e5ee;
  border-radius: 22px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-size: 20px;
  font-weight: 800;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.6), 0 12px 24px rgba(25, 35, 51, .07);
}

.search-box input:focus {
  border-color: rgba(35, 167, 131, .72);
  box-shadow: 0 0 0 5px rgba(35, 167, 131, .12), 0 14px 28px rgba(25, 35, 51, .08);
}

.search-icon {
  position: absolute;
  top: 50%;
  right: 22px;
  width: 22px;
  height: 22px;
  border: 3px solid var(--green-dark);
  border-radius: 50%;
  transform: translateY(-50%);
}

.search-icon::after {
  content: "";
  position: absolute;
  left: -8px;
  bottom: -7px;
  width: 11px;
  height: 3px;
  border-radius: 8px;
  background: var(--green-dark);
  transform: rotate(-45deg);
}

.filter-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.filter-tab {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(35, 167, 131, .20);
  border-radius: 16px;
  color: var(--green-dark);
  background: rgba(255,255,255,.78);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.filter-tab.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--blue));
  box-shadow: 0 12px 24px rgba(35, 167, 131, .18);
}

.data-table {
  width: 100%;
  min-width: 720px;
  border-collapse: separate;
  border-spacing: 0 12px;
  table-layout: fixed;
}

.data-table th {
  padding: 0 18px 8px;
  color: var(--muted);
  font-size: 24px;
  font-weight: 900;
  text-align: right;
}

.stage-card.is-description-title .stage-card-name {
  left: 24px;
  right: 24px;
  top: 50%;
  max-width: none;
  transform: translateY(-50%);
  color: #6b3e02;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.2;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}

.stage-card.is-description-title .stage-card-description {
  display: none;
}

.stage-card.is-description-title .stage-card-bottom {
  justify-content: flex-end;
}

.stage-card-number {
  position: absolute;
  right: 22px;
  top: 16px;
  z-index: 3;
  max-width: 42%;
  color: #6b3e02;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.2;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.students-table th:first-child,
.students-table td:first-child {
  width: 28%;
  text-align: right;
}

.students-table th:nth-child(2),
.students-table th:nth-child(3),
.students-table th:nth-child(4),
.students-table th:nth-child(5),
.students-table td:nth-child(2),
.students-table td:nth-child(3),
.students-table td:nth-child(4),
.students-table td:nth-child(5) {
  width: 18%;
  text-align: center;
}

/* Teacher session workspace: keep every active tool readable on desktop. */
@media (min-width: 901px) {
  .group-session-page .page {
    width: min(1560px, calc(100% - 32px));
  }

  .group-session-page .session-panel .panel-header {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto minmax(420px, auto);
    gap: 18px;
    align-items: center;
    padding: 22px 26px;
  }

  .group-session-page .session-panel .panel-header h2 {
    margin-bottom: 5px;
  }

  .group-session-page .session-header-actions {
    gap: 8px;
  }

  .group-session-page .session-header-actions .btn {
    min-height: 42px;
    padding: 0 13px;
    font-size: 14px;
    border-radius: 12px;
  }

  .group-session-page .session-tools {
    padding: 18px 24px 0;
  }

  .group-session-page .session-search input {
    min-height: 52px;
    border-radius: 16px;
    font-size: 17px;
  }

  .group-session-page .filter-tab {
    min-height: 42px;
    padding-inline: 13px;
    border-radius: 12px;
    font-size: 14px;
  }

  .group-session-page .session-table-wrap {
    padding: 14px 16px 28px;
  }

  .group-session-page .session-students-table {
    min-width: 1120px;
    table-layout: auto;
    border-spacing: 0 8px;
  }

  .group-session-page .session-students-table th {
    width: auto;
    padding: 0 8px 7px;
    font-size: 15px;
    line-height: 1.3;
    text-align: center;
    white-space: nowrap;
  }

  .group-session-page .session-students-table td {
    width: auto;
    height: 68px;
    padding: 9px 8px;
    font-size: 18px;
    text-align: center;
  }

  .group-session-page .session-students-table .session-col-student {
    width: 24%;
    min-width: 210px;
    text-align: right;
  }

  .group-session-page .session-students-table .session-col-attendance {
    width: 170px;
    min-width: 170px;
  }

  .group-session-page .session-students-table .session-col-lateness {
    width: 140px;
    min-width: 132px;
  }

  .group-session-page .session-students-table .session-col-score {
    width: 118px;
    min-width: 108px;
  }

  .group-session-page .session-students-table .session-col-payment {
    width: 130px;
    min-width: 120px;
  }

  .group-session-page .session-students-table .student-name-with-id {
    gap: 7px;
    width: 100%;
  }

  .group-session-page .session-students-table .student-name-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .group-session-page .session-students-table .attendance-choice {
    width: 154px;
    min-height: 44px;
    border-radius: 13px;
  }

  .group-session-page .session-students-table .attendance-choice-btn {
    font-size: 14px;
  }

  .group-session-page .session-students-table .lateness-control {
    width: 124px;
  }

  .group-session-page .session-students-table .lateness-toggle {
    min-height: 38px;
    border-radius: 12px;
    font-size: 13px;
  }

  .group-session-page .session-students-table .arrival-time-field input {
    min-height: 34px;
    font-size: 13px;
  }

  .group-session-page .session-students-table .score-input {
    width: 92px;
    min-height: 44px;
    padding-inline: 7px;
    border-radius: 13px;
    font-size: 16px;
  }

  .group-session-page .session-students-table .table-action {
    width: 100%;
    min-height: 44px;
    padding-inline: 9px;
    border-radius: 13px;
    font-size: 14px;
    white-space: nowrap;
  }

  .group-session-page .session-students-table tbody tr:hover {
    transform: translateY(-1px);
  }
}

.student-id-button {
  border: 0;
  font-family: inherit;
  cursor: pointer;
  transition: color .18s ease, background .18s ease, transform .18s ease;
}

.student-id-button:hover,
.student-id-button:focus-visible {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--green));
  transform: translateY(-1px);
  outline: none;
}

.student-summary-modal-panel {
  width: min(520px, calc(100% - 28px));
}

.student-summary-grid {
  display: grid;
  gap: 12px;
  margin: 20px 0;
}

.student-summary-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 62px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fbfd;
}

.student-summary-item span {
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
}

.student-summary-item strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.session-summary-options {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(52, 120, 246, .18);
  border-radius: 16px;
  background: rgba(52, 120, 246, .05);
}

.session-summary-options > strong {
  color: var(--ink);
  font-size: 15px;
}

.session-summary-options > div {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.session-summary-options label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.session-summary-options input {
  width: 17px;
  height: 17px;
  accent-color: var(--green);
}

.invalid-number-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 24px;
  padding-inline: 6px;
  margin-inline-start: 5px;
  border-radius: 999px;
  color: #fff;
  background: var(--red);
  font-size: 12px;
}

.invalid-numbers-modal-panel {
  width: min(820px, calc(100% - 28px));
  max-height: min(82vh, 760px);
  overflow: auto;
}

.invalid-numbers-list {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.invalid-number-card {
  display: grid;
  grid-template-columns: minmax(190px, .7fr) minmax(260px, 1.3fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid rgba(228, 82, 82, .20);
  border-radius: 16px;
  background: rgba(228, 82, 82, .05);
}

.invalid-number-card > div {
  display: grid;
  gap: 5px;
}

.invalid-number-card strong {
  width: fit-content;
  color: #9b3636;
  font-size: 18px;
  font-weight: 900;
}

.invalid-number-card span,
.invalid-number-card small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.invalid-number-card p {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.whatsapp-connection-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.whatsapp-connection-notice .btn {
  flex: 0 0 auto;
  width: auto;
}

.whatsapp-policy-notice {
  align-items: flex-start;
  background: #f0f9ff;
  border-color: #bae6fd;
  color: #0c4a6e;
  display: flex;
  gap: 8px;
  line-height: 1.8;
  margin-bottom: 22px;
}

.whatsapp-policy-notice strong {
  flex: 0 0 auto;
}

@media (max-width: 640px) {
  .whatsapp-connection-notice {
    align-items: stretch;
    flex-direction: column;
  }

  .whatsapp-policy-notice {
    flex-direction: column;
  }

  .invalid-number-card {
    grid-template-columns: 1fr;
    gap: 9px;
  }
}

.data-table td {
  padding: 18px;
  background: #fff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 30px;
  font-weight: 800;
}

.data-table td:first-child {
  border-right: 1px solid var(--line);
  border-radius: 0 18px 18px 0;
}

.data-table td:last-child {
  border-left: 1px solid var(--line);
  border-radius: 18px 0 0 18px;
}

.data-table tbody tr {
  box-shadow: 0 12px 24px rgba(25, 35, 51, .06);
  transition: transform .18s ease, box-shadow .18s ease;
}

.data-table tbody tr:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 34px rgba(35, 167, 131, .18);
}

.data-table tbody tr:hover td {
  border-color: rgba(35, 167, 131, .58);
  background: #f7fffc;
}

.ltr-value {
  display: inline-block;
  direction: ltr;
  unicode-bidi: isolate;
  color: var(--green-dark);
  font-weight: 900;
}

.table-empty {
  margin: 0 clamp(18px, 3vw, 34px) 34px;
}

.table-message {
  margin: 18px clamp(18px, 3vw, 34px) 0;
}

#ajaxMessage.table-message {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  width: min(360px, calc(100% - 36px));
  margin: 0;
  box-shadow: 0 18px 42px rgba(25, 35, 51, .18);
}

.table-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 190px);
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 16px;
  font: inherit;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}

.table-action:disabled {
  opacity: .6;
  cursor: wait;
}

.score-input {
  width: min(100%, 150px);
  min-height: 50px;
  padding: 0 12px;
  border: 1px solid rgba(52, 120, 246, .22);
  border-radius: 16px;
  background: rgba(52, 120, 246, .08);
  color: var(--ink);
  font: inherit;
  font-size: 18px;
  font-weight: 900;
  text-align: center;
  outline: none;
}

.score-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(52, 120, 246, .12);
}

.attendance-choice {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(100%, 210px);
  min-height: 50px;
  overflow: hidden;
  border: 1px solid rgba(216, 229, 238, .96);
  border-radius: 16px;
  background: #fff;
}

.attendance-choice-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
}

.attendance-choice-btn + .attendance-choice-btn {
  border-right: 1px solid rgba(216, 229, 238, .96);
}

.attendance-choice-btn.is-present.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--blue));
}

.attendance-choice-btn.is-absent.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--red), #f29a3f);
}

.attendance-choice-btn:disabled {
  opacity: .65;
  cursor: wait;
}

.lateness-control {
  display: inline-grid;
  gap: 6px;
  width: min(100%, 160px);
}

.lateness-toggle {
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid rgba(242, 154, 63, .38);
  border-radius: 14px;
  background: rgba(242, 154, 63, .08);
  color: #9a5c12;
  font: inherit;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  transition: color .18s ease, background .18s ease, border-color .18s ease;
}

.lateness-toggle.is-active {
  border-color: transparent;
  background: linear-gradient(135deg, #f29a3f, var(--red));
  color: #fff;
}

.lateness-toggle:disabled,
.arrival-time-field input:disabled {
  opacity: .65;
  cursor: wait;
}

.arrival-time-field {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.arrival-time-field[hidden] {
  display: none;
}

.arrival-time-field input {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 0 6px;
  border: 1px solid rgba(52, 120, 246, .22);
  border-radius: 11px;
  background: rgba(52, 120, 246, .07);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  direction: ltr;
  outline: none;
}

.arrival-time-field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(52, 120, 246, .1);
}

.row-actions-split {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(100%, 210px);
  min-height: 50px;
  overflow: hidden;
  border: 1px solid rgba(216, 229, 238, .96);
  border-radius: 16px;
  background: #fff;
}

.row-actions-split form {
  display: contents;
}

.row-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 17px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.row-action-link + form .row-action-link,
.row-actions-split form + .row-action-link {
  border-right: 1px solid rgba(216, 229, 238, .96);
}

.row-action-link.is-view {
  color: var(--blue);
  background: rgba(52, 120, 246, .10);
}

.row-action-link.is-delete {
  color: #9b3636;
  background: rgba(228, 82, 82, .08);
}

.table-action.is-present {
  color: var(--green-dark);
  background: rgba(35, 167, 131, .10);
  border-color: rgba(35, 167, 131, .20);
}

.table-action.is-absent {
  color: #9b3636;
  background: rgba(228, 82, 82, .08);
  border-color: rgba(228, 82, 82, .18);
}

.table-action.is-view {
  color: var(--blue);
  background: rgba(52, 120, 246, .10);
  border-color: rgba(52, 120, 246, .18);
}

.table-action.is-payment {
  color: #6b3e02;
  background: rgba(255, 190, 72, .14);
  border-color: rgba(255, 190, 72, .34);
}

.table-action.is-score {
  color: var(--blue);
  background: rgba(52, 120, 246, .10);
  border-color: rgba(52, 120, 246, .20);
}

.table-action.is-delete {
  color: #9b3636;
  background: rgba(228, 82, 82, .08);
  border-color: rgba(228, 82, 82, .18);
}

.table-action.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--blue));
  box-shadow: 0 12px 24px rgba(35, 167, 131, .22);
}

.table-action.is-absent.is-active {
  background: linear-gradient(135deg, var(--red), #f29a3f);
}

.table-action.is-payment.is-active {
  background: linear-gradient(135deg, #c98718, #23a783);
}

.table-action.is-score.is-active {
  background: linear-gradient(135deg, var(--blue), var(--green));
}

.student-id-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 9px;
  margin-inline-end: 7px;
  border-radius: 999px;
  background: rgba(52, 120, 246, .12);
  color: #2563eb;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  direction: ltr;
  vertical-align: middle;
}

.student-name-with-id {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.student-name-with-id .student-id-chip {
  margin-inline-end: 0;
  flex: 0 0 auto;
}

.student-name-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.student-hero .stats-grid {
  margin-bottom: 0;
}

.student-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

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

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

.lesson-report-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
  padding: 22px clamp(18px, 3vw, 34px) 0;
}

.lesson-report-select {
  display: grid;
  gap: 8px;
}

.lesson-report-select label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.lesson-report-select select {
  width: 100%;
  min-height: 54px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 900;
  outline: none;
}

.lesson-report-select select:focus {
  border-color: rgba(35, 167, 131, .72);
  box-shadow: 0 0 0 4px rgba(35, 167, 131, .12);
}

.lesson-report-submit {
  width: min(100%, 260px);
}

.lesson-report-submit:disabled {
  cursor: wait;
  opacity: .65;
}

.student-contact-grid {
  width: min(100%, 620px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px auto 0;
}

.student-contact-item {
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  border: 1px solid rgba(35, 167, 131, .18);
  border-radius: 18px;
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 10px 22px rgba(25, 35, 51, .06);
  text-align: center;
}

.student-contact-item span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.student-contact-item strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  direction: ltr;
}

.student-contact-value {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.contact-edit-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(35, 167, 131, .22);
  border-radius: 12px;
  color: var(--green-dark);
  background: #fff;
  cursor: pointer;
}

.contact-edit-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.student-contact-edit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 4px;
}

.student-contact-edit[hidden] {
  display: none;
}

.student-contact-edit input {
  min-width: 0;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  direction: ltr;
  outline: none;
}

.student-contact-edit input:focus {
  border-color: rgba(35, 167, 131, .72);
  box-shadow: 0 0 0 4px rgba(35, 167, 131, .12);
}

.field textarea {
  width: 100%;
  resize: vertical;
  min-height: 128px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  line-height: 1.7;
  outline: none;
}

.field textarea:focus {
  border-color: rgba(35, 167, 131, .72);
  box-shadow: 0 0 0 4px rgba(35, 167, 131, .12);
}

.whatsapp-contact-btn {
  width: 100%;
  min-height: 42px;
  margin-top: 10px;
  border: 1px solid rgba(35, 167, 131, .24);
  border-radius: 12px;
  background: rgba(35, 167, 131, .10);
  color: var(--green-dark);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.whatsapp-contact-btn:hover {
  background: rgba(35, 167, 131, .16);
}

.bulk-whatsapp-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.qr-attendance-body {
  min-height: 100vh;
  margin: 0;
  background: #05070b;
  overflow: hidden;
}

.qr-attendance-page {
  position: relative;
  width: 100vw;
  height: 100vh;
  color: #fff;
  font-family: "Tajawal", system-ui, sans-serif;
}

.qr-attendance-page video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #080b10;
}

.qr-scan-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  background:
    linear-gradient(rgba(0, 0, 0, .48), rgba(0, 0, 0, .48));
}

.qr-scan-box {
  width: min(72vw, 360px);
  aspect-ratio: 1;
  border: 4px solid rgba(35, 167, 131, .95);
  border-radius: 28px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, .36), 0 0 42px rgba(35, 167, 131, .34);
}

.qr-scan-top {
  position: absolute;
  top: 18px;
  left: 18px;
  right: 18px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.qr-scan-top > div {
  display: grid;
  gap: 2px;
  text-align: left;
}

.qr-scan-top strong,
.qr-result-panel strong {
  font-size: 20px;
  font-weight: 900;
}

.qr-scan-top span,
.qr-result-panel small {
  color: rgba(255, 255, 255, .78);
  font-weight: 800;
}

.qr-back-btn {
  min-height: 42px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, .16);
  text-decoration: none;
  font-weight: 900;
  backdrop-filter: blur(12px);
}

.qr-result-panel {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 94px;
  z-index: 3;
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 18px;
  background: rgba(5, 10, 17, .72);
  backdrop-filter: blur(14px);
  text-align: center;
}

.qr-result-panel span {
  color: #9ff1d8;
  font-weight: 900;
}

.qr-manual-form {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 10px;
}

.qr-manual-form input,
.qr-manual-form button {
  min-height: 52px;
  border: 0;
  border-radius: 16px;
  font: inherit;
  font-weight: 900;
}

.qr-manual-form input {
  padding: 0 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, .94);
  outline: none;
}

.qr-manual-form button {
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--blue));
  cursor: pointer;
}

.contact-save-btn {
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--blue));
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.score-month-card {
  gap: 10px;
  cursor: default;
}

.score-month-card.is-scored {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--green));
  box-shadow: 0 12px 24px rgba(52, 120, 246, .18);
}

.score-month-card.is-scored span,
.score-month-card.is-scored strong {
  color: #fff;
}

.student-progress-chart {
  width: min(100%, 760px);
  display: grid;
  gap: 16px;
  margin: 22px auto 0;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid rgba(216, 229, 238, .96);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(35, 167, 131, .08), rgba(52, 120, 246, .06)),
    rgba(255,255,255,.86);
  box-shadow: 0 18px 34px rgba(25, 35, 51, .08);
}

.student-progress-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.student-progress-chart h3 {
  margin: 0 0 5px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
}

.student-progress-chart p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
}

.student-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.student-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.student-chart-legend span::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: currentColor;
}

.student-chart-legend .is-score {
  color: var(--blue);
}

.student-chart-legend .is-present {
  color: var(--green-dark);
}

.student-chart-legend .is-absent {
  color: #9b3636;
}

.student-progress-chart canvas {
  width: 100%;
  min-height: 220px;
  border-radius: 18px;
  background: rgba(255,255,255,.72);
}

.reservation-form {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: clamp(18px, 3vw, 34px);
  align-items: start;
}

.teacher-photo-preview {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(25, 35, 51, .10);
}

.teacher-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.reservation-cover-preview {
  min-height: 150px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(25, 35, 51, .08);
}

.reservation-cover-preview img {
  width: 100%;
  height: 100%;
  min-height: 150px;
  object-fit: cover;
  display: block;
}

.reservation-cover-preview.is-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 900;
  border-style: dashed;
  background: rgba(255,255,255,.68);
}

.reservation-link {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid rgba(35, 167, 131, .20);
  border-radius: 18px;
  background: rgba(35, 167, 131, .08);
}

.reservation-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.reservation-link span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.reservation-link a {
  direction: ltr;
  color: var(--green-dark);
  font-weight: 900;
  word-break: break-all;
  text-decoration: none;
}

.copy-link-btn {
  min-height: 44px;
  padding-inline: 16px;
  white-space: nowrap;
}

.booking-actions {
  min-width: 180px;
}

.reservation-subject {
  display: grid;
  gap: 6px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.70);
}

.reservation-subject span,
.field-status {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.reservation-subject strong {
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
}

.field-status {
  min-height: 20px;
  margin: 8px 0 0;
}

.field-status:empty {
  display: none;
  min-height: 0;
  margin: 0;
}

.field-status.is-available {
  color: var(--green-dark);
}

.field-status.is-taken {
  color: #9b3636;
}

.whatsapp-settings-panel {
  margin-top: 22px;
  overflow: hidden;
}

.whatsapp-settings-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(340px, 440px);
  gap: clamp(18px, 3vw, 34px);
  align-items: stretch;
}

.whatsapp-settings-form {
  align-content: start;
}

.whatsapp-setup-card {
  align-self: stretch;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid rgba(35, 167, 131, .16);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(35, 167, 131, .08), rgba(52, 120, 246, .06)),
    rgba(255,255,255,.76);
}

.whatsapp-step {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.whatsapp-step > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--blue));
  font-size: 20px;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(35, 167, 131, .18);
}

.whatsapp-step strong {
  display: block;
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
}

.whatsapp-step p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.6;
}

.whatsapp-save-btn {
  min-height: 64px;
}

.whatsapp-number-type-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 6px;
  border: 1px solid rgba(35, 167, 131, .14);
  border-radius: 16px;
  background: rgba(255, 255, 255, .68);
}

.whatsapp-number-type-switch .btn {
  min-height: 48px;
}

.whatsapp-number-type-switch .btn.is-active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--green), var(--blue));
  box-shadow: 0 10px 22px rgba(35, 167, 131, .18);
}

.sms-settings-card {
  display: grid;
  gap: 18px;
  margin-top: 18px;
  padding: clamp(18px, 3vw, 26px);
  border: 1px solid rgba(52, 120, 246, .16);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(35, 167, 131, .07), rgba(52, 120, 246, .07));
}

.sms-settings-card[hidden] {
  display: none;
}

.sms-settings-card p {
  margin: 6px 0 0;
  color: var(--muted);
}

.sms-api-key-box {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid rgba(35, 167, 131, .18);
  border-radius: 16px;
  background: rgba(255, 255, 255, .82);
}

.sms-api-key-box strong {
  font-size: clamp(24px, 4vw, 34px);
  letter-spacing: .14em;
}

.sms-settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sms-settings-actions form {
  margin: 0;
}

.whatsapp-qr-panel {
  display: grid;
  gap: 16px;
  justify-items: stretch;
  padding: clamp(18px, 3vw, 26px);
  border: 1px solid rgba(52, 120, 246, .16);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.95), rgba(247, 251, 255, .92)),
    #fff;
  box-shadow: 0 22px 52px rgba(25, 35, 51, .11);
}

.whatsapp-qr-frame {
  width: min(100%, 320px);
  justify-self: center;
  padding: 16px;
  border: 1px solid rgba(25, 35, 51, .08);
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 18px 36px rgba(25, 35, 51, .10);
}

.whatsapp-qr-frame img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  display: block;
  border-radius: 12px;
}

.whatsapp-qr-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.6;
}

.whatsapp-qr-empty {
  min-height: 320px;
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 18px;
  border: 1px dashed #cbd8e4;
  border-radius: 18px;
  background: rgba(255,255,255,.68);
  text-align: center;
}

.whatsapp-qr-empty strong {
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
}

.whatsapp-qr-empty span {
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
}

.whatsapp-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.whatsapp-actions form,
.whatsapp-actions .btn {
  width: 100%;
}

.whatsapp-connected-wrap {
  min-height: 420px;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 44px);
}

.whatsapp-connected-card {
  width: min(560px, 100%);
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: clamp(24px, 5vw, 46px);
  border: 1px solid rgba(35, 167, 131, .20);
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(35, 167, 131, .10), rgba(52, 120, 246, .06)),
    rgba(255,255,255,.92);
  text-align: center;
  box-shadow: 0 24px 58px rgba(25, 35, 51, .12);
}

.whatsapp-connected-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  color: var(--green-dark);
  background: rgba(35, 167, 131, .14);
  font-size: 16px;
  font-weight: 900;
}

.whatsapp-connected-card strong {
  direction: ltr;
  color: var(--ink);
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 900;
  line-height: 1.1;
}

.whatsapp-connected-card p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  font-weight: 800;
}

.whatsapp-connected-actions {
  width: min(420px, 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.whatsapp-connected-actions form,
.whatsapp-connected-actions .btn {
  width: 100%;
}

.whatsapp-preferences-panel {
  margin-top: 26px;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid rgba(25, 35, 51, .08);
  border-radius: 28px;
  background: rgba(255,255,255,.82);
  box-shadow: 0 18px 44px rgba(25, 35, 51, .08);
}

.whatsapp-preferences-head {
  align-items: center;
}

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

.whatsapp-preference-group {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(35, 167, 131, .14);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(35, 167, 131, .05), rgba(52, 120, 246, .04)),
    rgba(255,255,255,.78);
}

.whatsapp-preference-group h3 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
}

.whatsapp-preference-group > p {
  margin: -4px 0 2px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.6;
}

.whatsapp-toggle-list {
  display: grid;
  gap: 9px;
}

.whatsapp-toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid rgba(25, 35, 51, .10);
  border-radius: 16px;
  background: rgba(255,255,255,.76);
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
}

.whatsapp-toggle-card input {
  order: 2;
  width: 22px;
  height: 22px;
  accent-color: var(--green);
}

.whatsapp-toggle-card span {
  min-width: 0;
}

.whatsapp-template-card {
  display: grid;
  gap: 8px;
}

.whatsapp-template-editor {
  display: none;
  gap: 7px;
  padding: 12px;
  border: 1px solid rgba(52, 120, 246, .16);
  border-radius: 16px;
  background: rgba(255,255,255,.86);
}

.whatsapp-template-card.is-enabled .whatsapp-template-editor,
.whatsapp-template-card:has(.whatsapp-toggle-card input:checked) .whatsapp-template-editor {
  display: grid;
}

.whatsapp-template-editor label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.whatsapp-template-editor textarea {
  display: none;
}

.whatsapp-token-editor {
  width: 100%;
  min-height: 104px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.7;
  outline: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.whatsapp-token-editor:focus {
  border-color: rgba(35, 167, 131, .72);
  box-shadow: 0 0 0 4px rgba(35, 167, 131, .12);
}

.whatsapp-template-token {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin: 0 3px;
  padding: 0 10px;
  border: 1px solid rgba(35, 167, 131, .28);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(226, 247, 241, .96), rgba(237, 245, 255, .96));
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 900;
  vertical-align: middle;
  user-select: all;
}

.whatsapp-template-editor small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.6;
}

.whatsapp-template-vars {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.whatsapp-template-vars button {
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid rgba(52, 120, 246, .20);
  border-radius: 999px;
  color: var(--blue);
  background: rgba(52, 120, 246, .08);
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.whatsapp-template-vars button.is-required {
  color: var(--green-dark);
  background: rgba(35, 167, 131, .12);
  border-color: rgba(35, 167, 131, .28);
}

.whatsapp-evaluation-group {
  grid-column: 1 / -1;
}

.whatsapp-cadence-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.whatsapp-cadence-option {
  min-height: 54px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(25, 35, 51, .10);
  border-radius: 16px;
  background: rgba(255,255,255,.74);
  color: var(--muted);
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
}

.whatsapp-cadence-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.whatsapp-cadence-option.is-selected,
.whatsapp-cadence-option:has(input:checked) {
  border-color: rgba(35, 167, 131, .55);
  color: var(--green-dark);
  background: rgba(35, 167, 131, .10);
}

.whatsapp-preferences-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.toggle-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.74);
  color: var(--ink);
  font-weight: 900;
}

.toggle-line input {
  width: 20px;
  height: 20px;
  accent-color: var(--green);
}

.field.is-disabled {
  opacity: .55;
}

.cover-modal-panel {
  width: min(900px, 100%);
}

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

.cover-option {
  overflow: hidden;
  padding: 0;
  border: 3px solid transparent;
  border-radius: 18px;
  background: #fff;
  cursor: pointer;
  aspect-ratio: 16 / 9;
  box-shadow: 0 12px 28px rgba(25, 35, 51, .10);
}

.cover-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cover-option.is-selected {
  border-color: var(--green);
  box-shadow: 0 0 0 5px rgba(35, 167, 131, .14), 0 16px 34px rgba(25, 35, 51, .12);
}

.lesson-page {
  min-height: 100vh;
  background: #f5f8fb;
  overflow-x: hidden;
}

.lesson-hero {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background-size: cover;
  background-position: center;
}

.lesson-hero-overlay {
  width: min(680px, 100%);
  box-sizing: border-box;
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: clamp(26px, 5vw, 48px);
  border: 1px solid rgba(255,255,255,.75);
  border-radius: 30px;
  background: rgba(255,255,255,.88);
  text-align: center;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  overflow: hidden;
  container-type: inline-size;
}

.lesson-photo-wrap {
  position: relative;
}

.lesson-teacher-photo {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border: 5px solid #fff;
  border-radius: 50%;
  box-shadow: 0 18px 42px rgba(25, 35, 51, .20);
}

.verified-badge {
  position: absolute;
  right: 8px;
  bottom: 10px;
  width: 38px;
  height: 38px;
  filter: drop-shadow(0 6px 12px rgba(24, 119, 242, .28));
}

.lesson-hero h1 {
  margin: 0;
  width: 100%;
  color: var(--ink);
  max-width: 100%;
  font-size: clamp(24px, calc(128cqw / var(--name-length)), 58px);
  font-weight: 900;
  line-height: 1.15;
  white-space: nowrap;
  text-align: center;
}

.lesson-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 22px;
  font-weight: 800;
}

.lesson-booking-form {
  width: min(480px, 100%);
  display: grid;
  gap: 14px;
  margin-top: 8px;
}

.lesson-booking-form .field {
  text-align: right;
}

.lesson-student-fields {
  display: grid;
  gap: 14px;
}

.lesson-alert {
  position: static;
  width: min(480px, 100%);
  box-shadow: none;
}

@media (max-width: 640px) {
  .lesson-hero {
    min-height: 100svh;
    align-items: start;
    padding: 14px;
  }

  .lesson-hero-overlay {
    width: 100%;
    max-width: 350px;
    justify-self: center;
    margin: 0 auto;
    padding: 24px 20px;
    border-radius: 26px;
  }

  .lesson-teacher-photo {
    width: 132px;
    height: 132px;
  }

  .verified-badge {
    width: 34px;
    height: 34px;
  }

  .lesson-booking-form,
  .lesson-student-fields,
  .lesson-alert {
    width: 100%;
  }

  .lesson-booking-form .field,
  .lesson-booking-form input,
  .lesson-booking-form select,
  .lesson-booking-form button {
    width: 100%;
    box-sizing: border-box;
  }
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(25, 35, 51, .34);
  backdrop-filter: blur(6px);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(620px, 100%);
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, .86);
  border-radius: 30px;
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.modal-head h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 900;
}

.modal-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 800;
}

.modal-close {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 14px;
  color: var(--green-dark);
  background: rgba(35, 167, 131, .10);
  font-size: 28px;
  font-weight: 900;
  cursor: pointer;
}

.payment-modal-panel {
  width: min(780px, 100%);
  padding: clamp(20px, 3vw, 32px);
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(35, 167, 131, .08), rgba(52, 120, 246, .06)),
    rgba(255,255,255,.96);
}

.delete-group-modal-panel {
  border-color: rgba(217, 77, 77, .26);
  background:
    linear-gradient(135deg, rgba(217, 77, 77, .08), rgba(255,255,255,.96)),
    rgba(255,255,255,.96);
}

.payment-year-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}

.payment-year-tab {
  min-width: 92px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(35, 167, 131, .18);
  border-radius: 14px;
  background: rgba(35, 167, 131, .08);
  color: var(--green-dark);
  font: inherit;
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
}

.payment-year-tab.is-active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--green), var(--blue));
  box-shadow: 0 12px 24px rgba(35, 167, 131, .18);
}

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

.payment-month {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 7px;
  width: 100%;
  min-height: 86px;
  padding: 14px 12px;
  border: 1px solid rgba(216, 229, 238, .96);
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(25, 35, 51, .06);
}

.payment-month span {
  font-size: 18px;
  line-height: 1.2;
}

.payment-month strong {
  color: var(--muted);
  font-size: 14px;
}

.payment-month.is-paid {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--green), var(--blue));
}

.payment-month.is-paid strong {
  color: #fff;
}

.payment-month:disabled {
  opacity: .65;
  cursor: wait;
}

.empty,
.alert {
  border-radius: 18px;
  padding: 16px;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.7;
}

.empty {
  margin-top: 16px;
  text-align: center;
  color: var(--muted);
  background: rgba(255, 255, 255, .72);
  border: 1px dashed #cbd8e4;
}

.alert {
  margin-bottom: 18px;
}

.alert-error {
  color: #9b3636;
  background: rgba(228, 82, 82, .07);
  border: 1px solid rgba(228, 82, 82, .2);
}

.alert-success {
  color: var(--green-dark);
  background: rgba(35, 167, 131, .10);
  border: 1px solid rgba(35, 167, 131, .22);
}

.auth-panel {
  padding: clamp(22px, 4vw, 40px);
}

.auth-grid {
  align-items: stretch;
}

.auth-copy {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 520px;
  text-align: center;
}

.auth-copy .tool-icon {
  width: 126px;
  height: 126px;
  border-radius: 30px;
  font-size: 58px;
}

.form-title {
  margin: 26px 0 8px;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 900;
}

.form-subtitle,
.auth-switch {
  color: var(--muted);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.7;
}

.auth-switch a {
  color: var(--green-dark);
  font-weight: 900;
}

@media (max-width: 900px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-nav,
  .top-actions,
  .nav-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .workspace-grid,
  .dashboard-grid,
  .auth-grid {
    grid-template-columns: 1fr;
  }

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

}

@media (max-width: 640px) {
  .shell,
  .page {
    width: min(100% - 22px, 1360px);
    padding-top: 20px;
  }

  .brand-mark {
    width: 50px;
    height: 50px;
    border-radius: 15px;
  }

  .brand h1 {
    font-size: 30px;
  }

  .topbar .brand {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .topbar .brand p {
    display: none;
  }

  .session-header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .panel-header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .session-header-actions form {
    width: 100%;
  }

  .session-header-actions .btn {
    width: 100%;
    min-height: 54px;
    padding-inline: 10px;
    white-space: normal;
    line-height: 1.35;
    text-align: center;
  }

  .actions,
  .stats-grid,
  .groups-grid,
  .compact-form,
  .time-fields {
    grid-template-columns: 1fr;
  }

  .student-stats-grid,
  .lesson-stats-grid,
  .student-contact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lesson-report-form {
    grid-template-columns: 1fr;
  }

  .lesson-report-submit {
    width: 100%;
  }

  .time-selects {
    grid-template-columns: 1fr;
  }

  .booking-mode-options {
    grid-template-columns: 1fr;
  }

  .reservation-link-row {
    grid-template-columns: 1fr;
  }

  .schedule-edit-form {
    grid-template-columns: 1fr;
  }

  .schedule-edit-actions {
    width: 100%;
  }

  .schedule-edit-actions .btn {
    flex: 1 1 0;
  }

  .schedule-item {
    grid-template-columns: 1fr;
  }

  .reservation-form {
    grid-template-columns: 1fr;
  }

  .whatsapp-settings-grid,
  .whatsapp-actions,
  .whatsapp-connected-actions,
  .whatsapp-preferences-grid,
  .whatsapp-cadence-options,
  .whatsapp-number-type-switch {
    grid-template-columns: 1fr;
  }

  .teacher-photo-preview {
    max-width: 260px;
    justify-self: center;
  }

  .cover-grid {
    grid-template-columns: 1fr;
  }

  .session-panel .panel-header {
    flex-wrap: wrap;
  }

  .session-date-form {
    width: 100%;
  }

  .week-grid {
    grid-template-columns: 1fr;
  }

  .week-group {
    grid-template-columns: 1fr;
  }

  .stage-card {
    min-height: auto;
  }

  .time-pill.start-only,
  .stage-card-name {
    top: 12px;
    font-size: 17px;
  }

  .time-pill.start-only {
    left: 18px;
  }

  .stage-card-name {
    right: 18px;
    max-width: 42%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .stage-card.is-description-title .stage-card-name {
    left: 18px;
    right: 18px;
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    font-size: 22px;
  }

  .stage-card-number {
    right: 18px;
    top: 12px;
    font-size: 17px;
  }

  .stage-card-students {
    font-size: 16px;
  }

  .stage-card-bottom {
    left: 18px;
    right: 18px;
    bottom: 12px;
    gap: 10px;
  }

  .stage-card-description {
    font-size: 16px;
  }

  .day-card {
    padding: 10px;
  }

  .week-group {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .top-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .top-nav a,
  .pill,
  .btn {
    width: 100%;
  }

  .top-nav a.top-nav-full {
    grid-column: auto;
  }

  .session-tools {
    grid-template-columns: 1fr;
  }

  .filter-tabs {
    justify-content: stretch;
  }

  .filter-tab {
    flex: 1 1 calc(50% - 8px);
  }

  .table-wrap {
    overflow: visible;
    padding: 18px 14px 26px;
  }

  .data-table {
    min-width: 0;
    border-spacing: 0;
  }

  .data-table thead {
    display: none;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100% !important;
  }

  .data-table tr {
    margin-bottom: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 12px 24px rgba(25, 35, 51, .06);
  }

  .data-table tbody tr:hover {
    transform: none;
  }

  .data-table td {
    display: grid;
    grid-template-columns: 112px 1fr;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border: 0;
    font-size: 21px;
  }

  .data-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 14px;
    font-weight: 900;
  }

  .data-table td .ltr-value {
    width: 132px;
    max-width: 100%;
    text-align: center;
    justify-self: center;
  }

  .students-table td[data-label="الطالب"] {
    align-items: flex-start;
    font-size: 20px;
    line-height: 1.45;
  }

  .students-table td[data-label="الطالب"]::before {
    padding-top: 4px;
  }

  .students-table td[data-label="الطالب"] .student-name-with-id {
    width: 100%;
    justify-content: flex-start;
    align-items: flex-start;
  }

  .students-table td[data-label="الطالب"] .student-id-chip {
    margin-top: 3px;
  }

  .data-table td:first-child,
  .data-table td:last-child {
    border: 0;
    border-radius: 0;
  }

  .table-action {
    width: 100%;
  }

  .score-input {
    width: 100%;
  }

  .attendance-choice {
    width: 100%;
  }

  .lateness-control {
    width: 100%;
  }

  .row-actions-split {
    width: 100%;
  }

  .student-records-table tr {
    padding: 16px;
    border-radius: 18px;
    background:
      linear-gradient(135deg, rgba(35, 167, 131, .05), rgba(52, 120, 246, .04)),
      #fff;
  }

  .student-records-table td {
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid rgba(216, 229, 238, .78);
    font-size: 17px;
    line-height: 1.5;
    text-align: start !important;
  }

  .student-records-table td:last-child {
    border-bottom: 0;
  }

  .student-records-table td::before {
    font-size: 13px;
    text-align: start;
  }

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

  .payment-year-tab {
    flex: 1 1 calc(50% - 8px);
  }
}

/* Lesson statistics reports use independent column sizing. */
@media (min-width: 901px) {
  .lesson-statistics-page .page {
    width: min(1560px, calc(100% - 32px));
  }

  .lesson-statistics-page .lesson-report-table-wrap {
    padding: 18px 18px 30px;
    scrollbar-gutter: stable;
  }

  .lesson-statistics-page .lesson-report-table {
    min-width: 1080px;
    table-layout: auto;
    border-spacing: 0 8px;
  }

  .lesson-statistics-page .lesson-report-table th,
  .lesson-statistics-page .lesson-report-table td {
    width: auto !important;
    text-align: center;
    vertical-align: middle;
  }

  .lesson-statistics-page .lesson-report-table th {
    padding: 0 10px 8px;
    font-size: 16px;
    line-height: 1.35;
    white-space: nowrap;
  }

  .lesson-statistics-page .lesson-report-table td {
    height: 72px;
    padding: 12px 10px;
    font-size: 17px;
    line-height: 1.45;
  }

  .lesson-statistics-page .lesson-report-table .report-col-student-name {
    width: 22% !important;
    min-width: 210px;
    text-align: right;
  }

  .lesson-statistics-page .lesson-report-table .report-col-stage {
    min-width: 100px;
  }

  .lesson-statistics-page .lesson-report-table .report-col-grade {
    width: 16% !important;
    min-width: 175px;
  }

  .lesson-statistics-page .lesson-report-table .report-col-group-name {
    width: 15% !important;
    min-width: 160px;
  }

  .lesson-statistics-page .lesson-report-table .report-col-phone,
  .lesson-statistics-page .lesson-report-table .report-col-guardian-phone {
    min-width: 145px;
    direction: ltr;
  }

  .lesson-statistics-page .lesson-report-table .report-col-action {
    width: 126px !important;
    min-width: 126px;
  }

  .lesson-statistics-page .lesson-report-table .student-name-with-id {
    width: 100%;
    gap: 7px;
  }

  .lesson-statistics-page .lesson-report-table .student-name-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .lesson-statistics-page .lesson-report-table .ltr-value {
    width: auto;
    max-width: 100%;
    font-size: 16px;
    white-space: nowrap;
  }

  .lesson-statistics-page .lesson-report-table .table-action {
    width: 100%;
    min-height: 42px;
    padding: 0 10px;
    border-radius: 12px;
    font-size: 14px;
    white-space: nowrap;
  }
}

@media (max-width: 900px) {
  .lesson-statistics-page .lesson-report-table-wrap {
    padding: 16px 14px 26px;
  }

  .lesson-statistics-page .lesson-report-table tr {
    padding: 12px 14px;
  }

  .lesson-statistics-page .lesson-report-table td {
    grid-template-columns: 105px minmax(0, 1fr);
    gap: 12px;
    padding: 9px 0;
    font-size: 17px;
    line-height: 1.45;
    text-align: start !important;
  }

  .lesson-statistics-page .lesson-report-table td .ltr-value {
    width: auto;
    justify-self: start;
  }

  .lesson-statistics-page .lesson-report-table .report-col-action .table-action {
    min-height: 44px;
  }
}

/* Comprehensive lesson statistics. */
.lesson-statistics-page .page {
  padding-bottom: 64px;
}

.lesson-statistics-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 22px;
  padding: clamp(26px, 4vw, 46px);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 30px;
  background:
    radial-gradient(circle at 12% 15%, rgba(35, 167, 131, .19), transparent 34%),
    linear-gradient(135deg, #f4fcfa, #edf4ff);
  box-shadow: 0 22px 50px rgba(25, 35, 51, .09);
}

.lesson-statistics-hero::after {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  left: -80px;
  bottom: -150px;
  border-radius: 50%;
  background: rgba(52, 120, 246, .09);
}

.lesson-statistics-hero h1 {
  margin: 6px 0 8px;
  color: var(--ink);
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 900;
}

.lesson-statistics-hero p,
.panel-heading p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.7;
}

.eyebrow {
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 900;
}

.lesson-overview-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 22px;
}

.lesson-overview-grid .stat {
  min-height: 148px;
}

.lesson-overview-grid .stat small,
.lesson-metric small,
.lesson-grade-summary small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.lesson-overview-grid .stat.is-positive {
  border-color: rgba(35, 167, 131, .24);
  background: linear-gradient(145deg, #fff, rgba(35, 167, 131, .10));
}

.lesson-overview-grid .stat.is-negative {
  border-color: rgba(228, 82, 82, .20);
  background: linear-gradient(145deg, #fff, rgba(228, 82, 82, .08));
}

.lesson-overview-grid .stat.is-warning {
  border-color: rgba(226, 155, 42, .24);
  background: linear-gradient(145deg, #fff, rgba(226, 155, 42, .10));
}

.lesson-analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-bottom: 22px;
}

.lesson-stat-section {
  margin-bottom: 22px;
  overflow: hidden;
}

.lesson-analytics-grid .lesson-stat-section {
  margin-bottom: 0;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: clamp(22px, 3vw, 32px);
  border-bottom: 1px solid rgba(216, 229, 238, .78);
  background: linear-gradient(135deg, rgba(35, 167, 131, .06), rgba(52, 120, 246, .045));
}

.panel-heading h2 {
  margin: 5px 0 4px;
  color: var(--ink);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 900;
}

.lesson-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 22px;
}

.lesson-metric {
  min-height: 112px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  text-align: center;
}

.lesson-metric span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.lesson-metric strong {
  color: var(--ink);
  font-size: 30px;
  font-weight: 900;
}

.lesson-metric.is-positive strong {
  color: var(--green-dark);
}

.lesson-metric.is-negative strong {
  color: #b33b3b;
}

.lesson-metric.is-warning strong {
  color: #b77314;
}

.lesson-grade-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 22px;
}

.lesson-grade-summary > div {
  min-height: 128px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 4px;
  border: 1px solid rgba(52, 120, 246, .16);
  border-radius: 22px;
  background: linear-gradient(145deg, #fff, rgba(52, 120, 246, .06));
}

.lesson-grade-summary span {
  color: var(--muted);
  font-size: 15px;
  font-weight: 900;
}

.lesson-grade-summary strong {
  color: var(--blue);
  font-size: 36px;
  font-weight: 900;
}

.lesson-payment-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.lesson-monthly-wrap,
.lesson-report-wrap {
  padding: 18px 18px 28px;
  overflow-x: auto;
}

.lesson-monthly-table {
  min-width: 1180px !important;
}

.lesson-report-controls {
  display: grid;
  gap: 9px;
  padding: 22px 28px 4px;
}

.lesson-report-controls > label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.lesson-report-control-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 14px;
}

.lesson-report-control-row select {
  width: 100%;
  min-height: 54px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 900;
  outline: none;
}

.lesson-report-control-row select:focus {
  border-color: rgba(35, 167, 131, .72);
  box-shadow: 0 0 0 4px rgba(35, 167, 131, .12);
}

#lesson-report-result {
  min-height: 120px;
  transition: opacity .18s ease;
}

#lesson-report-result.is-loading {
  opacity: .55;
}

.report-badge {
  min-width: 92px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.report-badge.is-success {
  color: #13775e;
  background: rgba(35, 167, 131, .13);
}

.report-badge.is-danger {
  color: #a23131;
  background: rgba(228, 82, 82, .12);
}

.report-badge.is-warning {
  color: #9a620f;
  background: rgba(226, 155, 42, .15);
}

.report-badge.is-muted {
  color: var(--muted);
  background: rgba(102, 112, 133, .10);
}

.empty-state {
  margin: 22px 28px 30px;
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 20px;
  background: rgba(244, 248, 252, .7);
  color: var(--muted);
  text-align: center;
  font-weight: 900;
}

@media (max-width: 1180px) {
  .lesson-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lesson-payment-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .lesson-analytics-grid {
    grid-template-columns: 1fr;
  }

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

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

  .lesson-monthly-wrap,
  .lesson-report-wrap {
    overflow: visible;
  }

  .lesson-monthly-table {
    min-width: 0 !important;
  }
}

@media (max-width: 640px) {
  .lesson-overview-grid,
  .lesson-metric-grid,
  .lesson-payment-grid,
  .lesson-grade-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lesson-overview-grid .stat {
    min-height: 126px;
    padding: 15px 10px;
  }

  .lesson-overview-grid .stat strong {
    font-size: 29px;
  }

  .lesson-grade-summary > div:last-child {
    grid-column: 1 / -1;
  }

  .lesson-report-controls {
    padding-inline: 14px;
  }

  .lesson-report-control-row {
    grid-template-columns: 1fr;
  }
}

/* Comprehensive student profile. */
.student-profile-page .student-stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.student-profile-page .student-stats-grid .stat {
  min-height: 138px;
  align-content: center;
  justify-items: center;
  gap: 6px;
  padding: 18px 14px;
  text-align: center;
}

.student-profile-page .student-stats-grid .stat span {
  font-size: 15px;
  font-weight: 900;
}

.student-profile-page .student-stats-grid .stat small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.student-profile-page .student-stats-grid .stat.is-positive {
  background: linear-gradient(145deg, #fff, rgba(35, 167, 131, .09));
}

.student-profile-page .student-stats-grid .stat.is-negative {
  background: linear-gradient(145deg, #fff, rgba(228, 82, 82, .08));
}

.student-profile-page .student-stats-grid .stat.is-warning {
  background: linear-gradient(145deg, #fff, rgba(226, 155, 42, .10));
}

.student-profile-page .student-progress-chart {
  width: min(100%, 1180px);
}

.student-payment-overview {
  width: min(100%, 1180px);
  margin: 22px auto 0;
  overflow: hidden;
  border: 1px solid rgba(216, 229, 238, .96);
  border-radius: 24px;
  background: rgba(255, 255, 255, .76);
  box-shadow: 0 16px 32px rgba(25, 35, 51, .07);
}

.student-payment-overview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(216, 229, 238, .8);
  background: linear-gradient(135deg, rgba(255, 190, 72, .12), rgba(35, 167, 131, .07));
}

.student-payment-overview-head span {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.student-payment-overview-head small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.student-payment-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  padding: 16px;
}

.student-payment-overview-grid > div {
  min-height: 90px;
  display: grid;
  place-content: center;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  text-align: center;
}

.student-payment-overview-grid span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.student-payment-overview-grid strong {
  color: var(--ink);
  font-size: 25px;
  font-weight: 900;
}

.student-payment-overview-grid strong.is-paid {
  color: var(--green-dark);
}

.student-payment-overview-grid strong.is-unpaid {
  color: #a93636;
}

.student-chart-legend .is-exam {
  color: #3478f6;
}

.student-chart-legend .is-recitation {
  color: #8b5cf6;
}

.student-chart-legend .is-study {
  color: #f08a24;
}

.student-chart-legend .is-homework {
  color: #18a678;
}

.student-chart-legend .is-late {
  color: #c47b13;
}

.student-record-group {
  display: block;
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
}

.student-record-group + small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

@media (min-width: 901px) {
  .student-profile-page .page {
    width: min(1560px, calc(100% - 32px));
  }

  .student-profile-page .student-records-table {
    min-width: 1260px;
    table-layout: auto;
    border-spacing: 0 8px;
  }

  .student-profile-page .student-records-table th,
  .student-profile-page .student-records-table td {
    width: auto !important;
    padding: 12px 10px;
    text-align: center;
    vertical-align: middle;
  }

  .student-profile-page .student-records-table th {
    font-size: 15px;
    line-height: 1.4;
    white-space: nowrap;
  }

  .student-profile-page .student-records-table td {
    height: 74px;
    font-size: 16px;
    line-height: 1.45;
  }

  .student-profile-page .student-records-table th:first-child,
  .student-profile-page .student-records-table td:first-child {
    width: 105px !important;
    min-width: 105px;
    text-align: center;
  }

  .student-profile-page .student-records-table th:nth-child(2),
  .student-profile-page .student-records-table td:nth-child(2) {
    width: 230px !important;
    min-width: 230px;
    text-align: right;
  }

  .student-profile-page .student-records-table th:nth-child(4),
  .student-profile-page .student-records-table td:nth-child(4) {
    min-width: 150px;
  }

  .student-profile-page .student-records-table th:last-child,
  .student-profile-page .student-records-table td:last-child {
    min-width: 150px;
  }
}

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

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

@media (max-width: 640px) {
  .student-profile-page .student-progress-chart-head {
    flex-direction: column;
  }

  .student-profile-page .student-chart-legend {
    justify-content: flex-start;
  }

  .student-profile-page .student-records-table .report-badge {
    min-width: 0;
    white-space: normal;
    text-align: center;
  }

  .student-payment-overview-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
