@font-face {
  font-family: system-persian;
  src: local('Vazirmatn'), local('Vazir'), local('Tahoma');
}
/* Theme colors and shared element defaults */
:root {
  --bg: #f5f7f8;
  --ink: #233c39;
  --muted: #85918f;
  --line: #e7eceb;
  --green: #1d7766;
  --navy: #123b36;
  --accent: #d5e9b8;
  --red: #c65556;
  --yellow: #bf8e29;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-persian, Tahoma, Arial, sans-serif;
  font-size: 13px;
  line-height: 1.8;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  border: 0;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
a {
  color: inherit;
  text-decoration: none;
}
input,
select {
  border: 1px solid #dce4e1;
  background: white;
  color: var(--ink);
  border-radius: 9px;
  padding: 10px 12px;
  min-width: 0;
  outline: none;
}
input:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px #1d77661b;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #80bfae;
  outline-offset: 3px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 26px;
  letter-spacing: -0.7px;
  line-height: 1.5;
  margin-bottom: 7px;
}
h2 {
  font-size: 16px;
  margin-bottom: 0;
}
h3 {
  font-size: 16px;
}
p {
  color: var(--muted);
}
small {
  font-size: 11px;
}
strong {
  font-weight: 700;
}
.initial,
.loading {
  padding: 80px;
  text-align: center;
}
.layout {
  display: flex;
  min-height: 100vh;
}
/* Application sidebar and profile */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--navy);
  color: #e5ede7;
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  z-index: 10;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}
.brand-mark {
  height: 43px;
  width: 43px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--navy);
  border-radius: 13px;
  font-size: 29px;
  line-height: 1;
}
.brand strong {
  font-size: 27px;
  line-height: 1.25;
}
.brand strong span {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: #a9c5bc;
  margin-top: 5px;
}
.school-label {
  font-size: 10px;
  color: #80a59a;
  margin: 38px 14px 16px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: transparent;
  color: #abc2ba;
  padding: 12px 15px;
  border-radius: 10px;
  width: 100%;
  text-align: right;
  margin-bottom: 6px;
  font-size: 12px;
  position: relative;
}
.nav-item > span {
  font-size: 21px;
  min-width: 22px;
  line-height: 1;
}
.nav-item:hover {
  background: #ffffff0b;
  color: white;
}
.nav-item.active {
  background: var(--accent);
  color: var(--navy);
  font-weight: bold;
}
.nav-item i {
  width: 5px;
  height: 5px;
  background: var(--navy);
  border-radius: 50%;
  margin-right: auto;
}
.sidebar-bottom {
  margin-top: auto;
  padding-top: 36px;
}
.profile {
  border-top: 1px solid #ffffff12;
  padding-top: 20px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.avatar {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: #43655b;
  color: #e1eed8;
  display: grid;
  place-items: center;
  font-size: 16px;
  flex-shrink: 0;
}
.avatar.light {
  color: #547762;
  background: #e6eddf;
}
.avatar.large {
  width: 52px;
  height: 52px;
  margin-bottom: 15px;
  font-size: 22px;
}
.profile strong {
  font-size: 10px;
  display: block;
}
.profile small {
  font-size: 9px;
  color: #8fad9e;
  display: block;
}
.logout {
  margin-right: auto;
  background: none;
  color: #b7cdc1;
  font-size: 23px;
}
.workspace {
  width: calc(100% - 240px);
  margin-right: 240px;
}
.topbar {
  height: 86px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 0 35px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.topbar-label,
.topbar-end {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-label strong {
  font-size: 13px;
}
.topbar-label strong span {
  display: block;
  font-weight: 400;
  font-size: 9px;
  color: var(--muted);
}
.school-icon {
  height: 36px;
  width: 36px;
  display: grid;
  place-items: center;
  background: #f2f5f0;
  border-radius: 11px;
  color: #789269;
  font-size: 22px;
}
.date-label {
  color: #83908b;
  font-size: 11px;
}
.topbar select {
  font-size: 11px;
  border-color: #e9eeeb;
  padding: 8px 10px;
}
.mobile-menu {
  display: none;
}
#content {
  padding: 30px 35px 25px;
  max-width: 1700px;
  margin: auto;
  min-height: calc(100vh - 150px);
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 25px;
}
.eyebrow {
  font-size: 10px;
  color: #93a09b;
  margin-bottom: 9px;
}
.page-heading p {
  font-size: 11px;
  margin: 0;
  max-width: 650px;
}
.heading-actions {
  display: flex;
  gap: 9px;
  flex-shrink: 0;
}
.primary,
.secondary {
  padding: 10px 16px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  min-height: 40px;
}
.primary {
  background: var(--green);
  color: white;
  box-shadow: 0 3px 6px #145f5020;
}
.primary:hover {
  background: #185d51;
}
.secondary {
  border: 1px solid #dce4df;
  background: white;
  color: #536960;
}
.secondary:hover {
  background: #f7faf7;
}
.wide {
  width: 100%;
}
.text-button {
  background: none;
  color: var(--green);
  font-size: 11px;
  padding: 4px 7px;
}
.danger {
  color: var(--red);
}
.icon-button {
  background: none;
  color: #8b9b94;
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 19px;
}
.overview-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #e8eee0;
  border: 1px solid #e2e8d9;
  min-height: 145px;
  border-radius: 14px;
  padding: 23px 30px;
  margin-bottom: 22px;
  overflow: hidden;
  position: relative;
}
.banner-kicker {
  font-size: 10px;
  color: #729067;
}
.overview-banner h2 {
  font-size: 21px;
  margin: 8px 0 5px;
  color: #34533b;
  letter-spacing: -0.6px;
}
.overview-banner p {
  color: #7c8e70;
  font-size: 11px;
  margin: 0;
}
.banner-symbol {
  position: relative;
  height: 100px;
  width: 120px;
  margin-left: 25px;
}
.banner-symbol > span {
  position: absolute;
  left: 10px;
  top: 8px;
  display: grid;
  place-items: center;
  width: 73px;
  height: 82px;
  transform: rotate(-12deg);
  border-radius: 15px;
  background: #fffdf6;
  border: 1px solid #d8dec9;
  box-shadow: 8px 8px 0 #dae2c8;
  font-size: 45px;
  color: #638754;
  z-index: 1;
}
.banner-symbol i {
  position: absolute;
  width: 130px;
  height: 130px;
  border: 1px dashed #b5c49d;
  border-radius: 50%;
  left: -20px;
  top: -10px;
}
/* Dashboard statistics and overview cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 23px;
}
.stat-card {
  background: white;
  border: 1px solid var(--line);
  padding: 20px 23px;
  border-radius: 12px;
}
.stat-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #7b8a83;
}
.stat-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 21px;
}
.stat-icon.neutral {
  background: #eef1e9;
  color: #7a8968;
}
.stat-icon.present {
  background: #e7f5ed;
  color: #318563;
}
.stat-icon.absent {
  background: #fbecec;
  color: #c76c6c;
}
.stat-icon.late {
  background: #fff5de;
  color: #c39c47;
}
.stat-card > strong {
  font-size: 30px;
  font-family: Tahoma, sans-serif;
  line-height: 1.6;
  margin-top: 7px;
  display: block;
  font-weight: 500;
}
.stat-card > small {
  color: #a1aaa6;
  font-size: 9px;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 22px;
  margin-bottom: 23px;
}
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
}
.card-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 22px 23px;
  border-bottom: 1px solid #f0f3f1;
}
.card-heading p {
  font-size: 10px;
  margin: 3px 0 0;
}
.lesson-row {
  display: flex;
  gap: 11px;
  align-items: center;
  margin: 0 21px;
  padding: 19px 0;
  border-bottom: 1px solid #f0f3f1;
}
.lesson-row:last-child {
  border: 0;
}
.period-number {
  width: 34px;
  height: 38px;
  background: #f4f6f2;
  border: 1px solid #e9ece4;
  border-radius: 8px;
  color: #869279;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 16px;
}
.lesson-info {
  min-width: 0;
  flex: 1;
}
.lesson-info strong {
  font-size: 11px;
}
.lesson-info small {
  display: block;
  color: #96a199;
  font-size: 9px;
  margin-top: 3px;
}
.lesson-time {
  color: #87958c;
  font-size: 10px;
}
.badge {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  white-space: nowrap;
  font-size: 9px;
  padding: 3px 9px;
  border-radius: 6px;
  line-height: 1.9;
}
.badge i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.badge.present {
  background: #eaf5ee;
  color: #3a8c66;
}
.badge.absent {
  background: #fbeeee;
  color: #bf595e;
}
.badge.late {
  background: #fff5df;
  color: #ae8533;
}
.badge.pending {
  background: #f4f5f2;
  color: #9da394;
}
.small-tag {
  display: inline-block;
  font-size: 9px;
  background: #f3f6f2;
  color: #8c9d85;
  border-radius: 5px;
  padding: 3px 8px;
  font-weight: 400;
}
.chart-legend {
  display: flex;
  gap: 17px;
  font-size: 9px;
  color: #939d94;
  margin: 17px 23px 0;
}
.chart-legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.chart-legend i {
  height: 6px;
  width: 6px;
  border-radius: 2px;
}
.present {
  --status-color: #a5c6aa;
}
.absent {
  --status-color: #e7a2a2;
}
.late {
  --status-color: #ead197;
}
.chart-legend i,
.bar-stack > div {
  background: var(--status-color);
}
.bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 10px;
  padding: 20px 23px 10px;
  direction: rtl;
  height: 194px;
  background: repeating-linear-gradient(
    to top,
    transparent,
    transparent 42px,
    #f6f8f5 43px,
    #f6f8f5 44px
  );
  background-clip: content-box;
}
.bar-col {
  text-align: center;
  flex: 1;
  max-width: 44px;
  font-size: 9px;
}
.bar-col small {
  font-size: 8px;
  color: #9ba69e;
  white-space: nowrap;
}
.bar-value {
  font-size: 9px;
  color: #8d9c90;
  margin-bottom: 5px;
}
.bar-track {
  height: 113px;
  display: flex;
  align-items: flex-end;
}
.bar-stack {
  width: 100%;
  height: var(--height);
  display: flex;
  flex-direction: column;
  border-radius: 5px 5px 0 0;
  overflow: hidden;
  min-height: 2px;
}
.bar-stack > div {
  height: var(--height);
  min-height: 0;
}
.chart-footer {
  margin: 12px 23px 20px;
  border-top: 1px solid #f0f3f1;
  padding-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #91a087;
  font-size: 10px;
  gap: 8px;
}
.chart-footer strong {
  color: #58794e;
  margin-right: 9px;
  font-size: 14px;
}
.chart-footer small {
  font-size: 8px;
  color: #a1aa9b;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  white-space: nowrap;
}
th {
  background: #fafbf9;
  color: #8e9a90;
  font-size: 10px;
  font-weight: 400;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 17px 22px;
  border-bottom: 1px solid #f1f3f0;
  font-size: 11px;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: #fcfdfb;
}
.cell-sub {
  display: block;
  color: #9ba69e;
  font-size: 9px;
  margin-top: 2px;
}
.text-absent {
  color: #c87878;
}
.text-late {
  color: #b69650;
}
.empty {
  padding: 42px 20px;
  text-align: center;
}
.empty > span {
  color: #b3bfb4;
  font-size: 30px;
}
.empty p {
  margin: 9px 0;
  font-size: 12px;
}
.alerts-card {
  margin-top: 20px;
}
footer {
  font-size: 9px;
  color: #a6b0a8;
  padding: 15px 35px;
  border-top: 1px solid #e9eee8;
  margin-top: 15px;
}
footer > span {
  margin: 0 8px;
}
.footer-left {
  float: left;
}
/* Attendance filters, roster and status controls */
.attendance-controls {
  display: flex;
  gap: 22px;
  align-items: flex-end;
  padding: 22px;
  margin-bottom: 20px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 11px;
  color: #768b7e;
}
.field input,
.field select {
  width: 100%;
  min-height: 42px;
}
.attendance-controls .field:first-child {
  width: 170px;
}
.attendance-controls .field:nth-child(2) {
  flex: 1;
}
.attendance-context {
  font-size: 11px;
  color: #6f8576;
  text-align: left;
  padding-bottom: 5px;
}
.attendance-context small {
  display: block;
  color: #a1ac9e;
}
.roster-legend {
  display: flex;
  gap: 8px;
}
.roster-toolbar,
.list-toolbar {
  padding: 18px 23px;
  display: flex;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid #f0f3ef;
}
.search {
  background: #f9fbf8;
  min-width: 220px;
  font-size: 11px;
}
.save-state {
  font-size: 9px;
  color: #99a691;
  margin-right: auto;
}
.status-picker {
  display: flex;
  border: 1px solid #e6ece5;
  border-radius: 8px;
  padding: 3px;
  background: #fafbf9;
  gap: 3px;
  width: max-content;
}
.status-picker button {
  padding: 5px 15px;
  border-radius: 6px;
  color: #9fa89f;
  font-size: 10px;
  background: none;
  min-width: 55px;
}
.status-picker button.selected.present {
  background: #dfeee2;
  color: #4a8157;
}
.status-picker button.selected.absent {
  background: #f7e4e4;
  color: #b85d62;
}
.status-picker button.selected.late {
  background: #faf0d7;
  color: #b39340;
}
.minutes-input {
  width: 80px;
  padding: 6px;
  text-align: center;
}
.row-number {
  color: #aab4a7;
}
.save-bar {
  position: sticky;
  bottom: 15px;
  background: #fff;
  border: 1px solid #e3e9de;
  box-shadow: 0 5px 25px #24403412;
  margin-top: 20px;
  padding: 18px 23px;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  z-index: 2;
}
.save-bar strong {
  font-size: 12px;
}
.save-bar small {
  display: block;
  color: #9fa899;
  font-size: 9px;
  margin-top: 4px;
}
.save-bar > div:last-child {
  display: flex;
  gap: 8px;
}
.user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}
.week-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.week-tabs button {
  background: #fff;
  border: 1px solid #e5ebe2;
  color: #9aa692;
  padding: 9px 25px;
  border-radius: 9px;
  font-size: 11px;
}
.week-tabs button.active {
  background: #e7eedf;
  border-color: #d5dfca;
  color: #567448;
}
.class-list {
  margin-top: 24px;
}
.class-chips {
  padding: 22px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.class-chips > div {
  border: 1px solid #e8ece3;
  display: grid;
  grid-template-columns: 35px 1fr;
  gap: 5px 12px;
  border-radius: 10px;
  padding: 15px 20px;
  min-width: 240px;
}
.class-chips .stat-icon {
  grid-row: span 2;
}
.class-chips strong {
  font-size: 11px;
}
.class-chips small {
  font-size: 9px;
  color: #9da992;
}
.check-label {
  font-size: 10px;
  color: #9ba68e;
  margin-right: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}
/* Report filters and results */
.report-filters {
  display: flex;
  gap: 18px;
  padding: 22px;
  align-items: flex-end;
  margin-bottom: 20px;
}
.report-filters .field {
  flex: 1;
}
.report-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0;
  font-size: 13px;
}
.report-summary small {
  margin-right: auto;
  color: #9aa58f;
}
.message-cell {
  white-space: normal;
  min-width: 250px;
  max-width: 330px;
  color: #8e9a83;
  font-size: 10px;
}
.details-card {
  margin-top: 22px;
}
/* Settings panels and form dialogs */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 22px;
}
.settings-body {
  padding: 25px;
}
.settings-body p {
  font-size: 11px;
  margin: 10px 0 20px;
}
.muted {
  font-size: 11px;
  color: #98a48e;
}
.year-row {
  padding: 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #eef1e9;
}
.year-row strong {
  font-size: 12px;
}
.full {
  grid-column: 1/-1;
}
.period-settings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.period-form {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  border: 1px solid #e6eade;
  border-radius: 10px;
  padding: 15px;
}
.period-form > strong {
  align-self: center;
  white-space: nowrap;
  font-size: 11px;
}
.period-form input {
  padding: 7px;
}
.period-form .field {
  flex: 1;
}
dialog {
  border: 0;
  border-radius: 16px;
  padding: 0;
  width: min(620px, calc(100vw - 28px));
  color: var(--ink);
  box-shadow: 0 20px 80px #132e3133;
  max-height: 90vh;
}
dialog::backdrop {
  background: #133c3655;
  backdrop-filter: blur(3px);
}
.modal-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 21px 25px;
  border-bottom: 1px solid var(--line);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 25px;
}
.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 20px 25px;
  background: #f8faf5;
  border-top: 1px solid var(--line);
}
.form-error {
  color: var(--red);
  font-size: 11px;
  margin: 0 25px 15px;
  white-space: normal;
}
.form-error:empty {
  display: none;
}
.notice {
  background: #f2f6e9;
  border: 1px solid #e0e9cd;
  border-radius: 10px;
  padding: 15px;
  font-size: 11px;
  color: #748660;
  line-height: 2;
}
.notice code {
  display: block;
  word-break: break-word;
}
.class-checks {
  border: 1px solid #e3e9da;
  border-radius: 9px;
  padding: 15px;
}
.class-checks legend {
  font-size: 10px;
  color: #8fa080;
}
.class-checks label {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 7px 0;
  font-size: 11px;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 30px;
  border: 1px solid #d7e7cf;
  background: #eef6e9;
  padding: 15px 22px;
  border-radius: 12px;
  color: #427142;
  z-index: 100;
  box-shadow: 0 4px 25px #21401a14;
  opacity: 0;
  transform: translateY(15px);
  transition: 0.2s;
  pointer-events: none;
  max-width: calc(100vw - 45px);
  font-size: 12px;
}
#toast.show {
  opacity: 1;
  transform: translateY(0);
}
#toast.error {
  background: #fff0ef;
  color: #b44e50;
  border-color: #f1d8d5;
}
.setup-error {
  max-width: 700px;
  margin: 100px auto;
  padding: 30px;
  text-align: center;
}
@media (min-width: 1450px) {
  .sidebar {
    width: 260px;
    padding: 32px 25px;
  }
  .workspace {
    width: calc(100% - 260px);
    margin-right: 260px;
  }
  #content {
    padding: 35px 45px;
  }
  .topbar {
    padding: 0 45px;
  }
  .lesson-row {
    padding: 22px 0;
  }
  .stat-card {
    padding: 24px;
  }
}
@media (max-width: 1150px) {
  .sidebar {
    width: 210px;
    padding: 25px 15px;
  }
  .workspace {
    width: calc(100% - 210px);
    margin-right: 210px;
  }
  #content {
    padding: 25px 22px;
  }
  .topbar {
    padding: 0 22px;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .stat-card {
    padding: 17px 15px;
  }
  .stats-grid {
    gap: 12px;
  }
  .lesson-info {
    flex: 1;
  }
  .page-heading {
    align-items: flex-start;
  }
  .heading-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 240px;
  }
  .page-heading h1 {
    font-size: 23px;
  }
  .date-label {
    display: none;
  }
  .report-filters {
    flex-wrap: wrap;
  }
  .report-filters .field {
    flex: 1 1 150px;
  }
  .period-settings {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  .sidebar {
    transform: translateX(100%);
    transition: transform 0.2s;
    width: 235px;
    box-shadow: -10px 0 30px #163b3520;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .workspace {
    width: 100%;
    margin: 0;
  }
  .mobile-menu {
    display: block;
  }
  .topbar {
    height: 72px;
    padding: 0 15px;
  }
  .topbar-label {
    gap: 6px;
  }
  .school-icon {
    display: none;
  }
  .topbar select {
    max-width: 125px;
    font-size: 9px;
  }
  .topbar-label strong {
    font-size: 11px;
  }
  .topbar-label strong span {
    font-size: 8px;
  }
  #content {
    padding: 22px 15px;
  }
  .page-heading {
    display: block;
    margin-bottom: 20px;
  }
  .page-heading h1 {
    font-size: 22px;
  }
  .page-heading p {
    font-size: 10px;
  }
  .heading-actions {
    margin-top: 16px;
    justify-content: flex-start;
    max-width: none;
  }
  .overview-banner {
    padding: 20px;
    min-height: 135px;
  }
  .overview-banner h2 {
    font-size: 17px;
    max-width: 270px;
  }
  .banner-symbol {
    width: 60px;
    margin-left: 10px;
  }
  .banner-symbol > span {
    width: 50px;
    height: 62px;
    font-size: 30px;
  }
  .banner-symbol i {
    width: 90px;
    height: 90px;
    top: 0;
    left: -10px;
  }
  .overview-banner p {
    font-size: 9px;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .stat-card {
    padding: 16px;
  }
  .stat-card > strong {
    font-size: 27px;
  }
  .stat-top {
    font-size: 10px;
  }
  .stat-icon {
    width: 30px;
    height: 30px;
  }
  .dashboard-grid {
    gap: 18px;
  }
  .card-heading {
    padding: 18px 16px;
  }
  .card-heading h2 {
    font-size: 14px;
  }
  .card-heading .text-button {
    font-size: 9px;
  }
  .lesson-row {
    margin: 0 15px;
    gap: 8px;
  }
  .lesson-time {
    display: none;
  }
  .lesson-info small {
    font-size: 8px;
  }
  .lesson-row .badge {
    font-size: 8px;
  }
  .lesson-info strong {
    font-size: 10px;
  }
  th {
    padding: 12px 16px;
    font-size: 9px;
  }
  td {
    padding: 14px 16px;
    font-size: 10px;
  }
  .attendance-controls {
    flex-wrap: wrap;
    gap: 15px;
    padding: 18px;
  }
  .attendance-controls .field:first-child {
    width: 100%;
  }
  .attendance-controls .field:nth-child(2) {
    flex-basis: 100%;
  }
  .attendance-context {
    display: none;
  }
  .roster-toolbar {
    padding: 15px;
    flex-wrap: wrap;
    gap: 10px;
  }
  .search {
    min-width: 0;
    flex: 1;
    width: 100%;
  }
  .save-state {
    width: 100%;
    margin: 0;
  }
  .roster-legend {
    gap: 4px;
  }
  .roster-legend .badge {
    font-size: 8px;
    padding: 2px 5px;
  }
  .save-bar {
    bottom: 8px;
    padding: 15px;
    flex-wrap: wrap;
  }
  .save-bar > div:last-child {
    width: 100%;
  }
  .save-bar .primary {
    flex: 1;
  }
  .save-bar strong {
    font-size: 11px;
  }
  .save-bar small {
    font-size: 8px;
  }
  .week-tabs {
    overflow: auto;
    gap: 6px;
    padding-bottom: 5px;
  }
  .week-tabs button {
    padding: 8px 18px;
    flex-shrink: 0;
    font-size: 10px;
  }
  .class-chips > div {
    width: 100%;
  }
  .list-toolbar {
    flex-wrap: wrap;
    padding: 15px;
  }
  .check-label {
    margin: 0;
  }
  .report-filters {
    gap: 12px;
    padding: 15px;
  }
  .report-filters .field {
    flex-basis: 100%;
  }
  .report-filters button {
    flex: 1;
  }
  .report-summary {
    flex-wrap: wrap;
    gap: 6px;
  }
  .report-summary small {
    width: 100%;
    margin-top: 8px;
    font-size: 9px;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .period-form {
    flex-wrap: wrap;
  }
  .period-form > strong {
    width: 100%;
  }
  .form-grid {
    padding: 20px;
    gap: 15px;
    grid-template-columns: 1fr;
  }
  .full {
    grid-column: 1;
  }
  .modal-heading {
    padding: 18px 20px;
  }
  .modal-footer {
    padding: 15px 20px;
  }
  footer {
    padding: 15px;
    font-size: 8px;
  }
  .footer-left {
    display: none;
  }
}

.close-sidebar {
  display: none;
}
@media (max-width: 760px) {
  .close-sidebar {
    display: block;
    position: absolute;
    top: 12px;
    left: 8px;
    color: #c8d8c7;
  }
}

/* Login page */
.login {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background: var(--bg);
}
.login-box {
  width: 100%;
  max-width: 390px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 8px 32px #123b3606;
}
.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 22px;
}
.login-brand .brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  font-size: 25px;
}
.login-brand strong {
  font-size: 24px;
  color: var(--navy);
}
.login-box h1 {
  text-align: center;
  font-size: 22px;
  margin-bottom: 4px;
  letter-spacing: 0;
}
.login-description {
  text-align: center;
  font-size: 11px;
  margin-bottom: 26px;
}
.login-box .field {
  margin-bottom: 18px;
  font-size: 12px;
}
.login-box .field input {
  padding: 12px 14px;
  font-size: 13px;
}
.login-box .primary {
  min-height: 45px;
  font-size: 13px;
  margin-top: 4px;
}
.login-box .form-error {
  margin: 0 0 15px;
}
.login-note {
  text-align: center;
  font-size: 10px;
  margin: 20px 0 0;
  line-height: 2;
}
.login-demo {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  font-size: 10px;
  color: var(--muted);
}
.login-demo summary {
  cursor: pointer;
  text-align: center;
}
.login-demo p {
  margin: 12px 0 0;
  text-align: center;
  line-height: 2.2;
}
@media (max-width: 480px) {
  .login {
    padding: 24px 16px;
  }
  .login-box {
    padding: 28px 24px;
  }
}
.date-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fff;
  border: 1px solid #dce4e1;
  border-radius: 9px;
  padding: 10px 12px;
  color: var(--ink);
  min-height: 42px;
  width: 100%;
  font-size: 13px;
}
.date-trigger > span:last-child {
  color: var(--green);
  font-size: 18px;
}
.date-trigger:hover {
  border-color: var(--green);
}
/* Persian calendar and time picker */
.persian-calendar {
  width: min(340px, calc(100vw - 28px));
  padding: 18px;
  overflow: auto;
}
.calendar-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.calendar-heading h2 {
  font-size: 14px;
}
.calendar-navigation {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 16px;
}
.calendar-navigation select {
  padding: 7px 8px;
  flex: 1;
  font-size: 12px;
}
.calendar-navigation .icon-button {
  padding: 4px 7px;
}
.calendar-weekdays,
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  text-align: center;
}
.calendar-weekdays {
  font-size: 11px;
  color: var(--muted);
  padding-bottom: 10px;
}
.calendar-days button {
  aspect-ratio: 1;
  border-radius: 9px;
  background: none;
  color: var(--ink);
  font-size: 13px;
  border: 1px solid transparent;
}
.calendar-days button:hover {
  background: #edf5ee;
}
.calendar-days button.today {
  border-color: #91bbae;
}
.calendar-days button.selected {
  background: var(--green);
  color: #fff;
}
.calendar-days button:disabled {
  color: #c5cdca;
  cursor: default;
  opacity: 0.6;
}
.calendar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}
.calendar-help {
  font-size: 9px;
  margin: 10px 0 0;
  text-align: center;
}
.time-selects {
  display: flex;
  align-items: center;
  gap: 5px;
}
.time-selects select {
  padding: 8px;
  min-width: 52px;
  text-align: center;
}
.time-selects > span {
  color: var(--muted);
}
#local-clock {
  display: inline-block;
  direction: ltr;
  margin-right: 8px;
  color: var(--green);
  font-variant-numeric: tabular-nums;
}

/* Custom RTL selects: dedicated arrow space and menus above dialogs/cards. */
.custom-select {
  position: relative;
  display: inline-flex;
  min-width: 0;
  vertical-align: middle;
  width: 100%;
}
.select-source {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}
.select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #dce4e1;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  text-align: start;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.select-trigger:hover {
  border-color: #8bad9f;
}
.select-trigger:focus-visible,
.select-trigger[aria-expanded='true'] {
  outline: 0;
  border-color: var(--green);
  box-shadow: 0 0 0 3px #1d77661b;
}
.select-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.select-arrow {
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  flex: 0 0 8px;
  margin-inline: 3px;
  transition: transform 0.15s;
  color: #63847b;
}
.select-trigger[aria-expanded='true'] .select-arrow {
  transform: rotate(225deg) translate(-2px, -1px);
}
.select-trigger:disabled {
  cursor: default;
  background: #f4f7f5;
}
.select-menu {
  position: fixed;
  inset: auto;
  margin: 0;
  padding: 5px;
  border: 1px solid #dce8e2;
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 12px 36px #123b3626;
  z-index: 1000;
  overflow-y: auto;
  overscroll-behavior: contain;
  direction: rtl;
  font: inherit;
  max-height: 280px;
}
.select-menu[hidden] {
  display: none !important;
}
.select-option {
  position: relative;
  padding: 9px 12px 9px 30px;
  border-radius: 7px;
  cursor: pointer;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.select-option:hover,
.select-option.active {
  background: #edf5f0;
}
.select-option[aria-selected='true'] {
  color: var(--green);
  font-weight: 700;
  background: #eaf4ec;
}
.select-option[aria-selected='true']::after {
  content: '✓';
  position: absolute;
  left: 10px;
  top: 9px;
}
.select-option[aria-disabled='true'] {
  opacity: 0.45;
  cursor: default;
}
.topbar-end > .custom-select {
  width: 170px;
}
.topbar-end .select-trigger {
  font-size: 11px;
}
.time-selects > .custom-select {
  width: 76px;
  flex: 0 1 76px;
}
.time-selects .select-trigger {
  padding: 8px 10px;
  gap: 12px;
}
.time-selects .select-value {
  flex: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.calendar-navigation > .custom-select {
  flex: 1;
  width: 0;
}
.calendar-navigation .select-trigger {
  padding: 7px 9px;
  gap: 9px;
  font-size: 12px;
  min-height: 36px;
}
@media (max-width: 760px) {
  .topbar-end > .custom-select {
    width: 125px;
  }
  .topbar-end .select-trigger {
    font-size: 9px;
    padding: 8px;
    gap: 8px;
  }
  .time-selects > .custom-select {
    width: 76px;
  }
}

/* Period cards leave room for add/remove controls at every screen size. */
.period-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.period-form > strong {
  grid-column: 1 / -1;
}
.period-form .field {
  min-width: 0;
}
.period-form button:disabled {
  cursor: not-allowed;
}
