
*, *::before, *::after {
    box-sizing: border-box !important;
}

.form-group select {
    height: 48px;
    line-height: 1.5;
    cursor: pointer;
}

@font-face {
  font-family: "IRANSansX";
  src: url("../font/IRANSansXDemiBold.woff") format("woff");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SidebarFont";
  src: url("../font/Kendburg-Regular.woff2") format("woff2"),
    url("../font/Kendburg-Regular.woff") format("woff");
  font-weight: bold;
  font-style: normal;
}

html {
    overflow-x: hidden;
    overflow-y: auto;
    height: 100%;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
    width: 8px !important;
    height: 8px !important;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track,
*::-webkit-scrollbar-track {
    background: #0f172a !important;
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb,
*::-webkit-scrollbar-thumb {
    background: #6c63ff !important;
    border-radius: 4px !important;
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover,
*::-webkit-scrollbar-thumb:hover {
    background: #5a52d5 !important;
}

html,
body,
* {
    scrollbar-width: thin !important;
    scrollbar-color: #6c63ff #0f172a !important;
}

body {
  background-color: #f0f2f5;
  color: #2c3e50;
  direction: rtl;
  min-height: 100vh;

  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  font-family: "IRANSansX", "Tahoma", "Segoe UI", sans-serif;
  font-weight: 600;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="date"],
input[type="time"],
input[type="file"],
input:not([type]),
select,
textarea {
  font-family: "IRANSansX", "Tahoma", "Segoe UI", sans-serif !important;
}

button,
input[type="submit"],
input[type="button"],
input[type="reset"],
a.btn,
.btn {
  font-family: "IRANSansX", "Tahoma", "Segoe UI", sans-serif !important;
}

body.auth-page {
  background: linear-gradient(-45deg, #667eea, #764ba2, #6c63ff, #06b6d4);
  background-size: 400% 400%;
  animation: gradientMove 12s ease infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

@keyframes gradientMove {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.container {
  background: rgba(255, 255, 255, 0.97);
  border-radius: 24px;
  padding: 45px 40px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.container .logo {
  text-align: center;
  margin-bottom: 20px;
}
.container .logo h1 {
  font-size: 32px;
  color: #2c3e50;
}
.container .logo .subtitle {
  color: #7f8c8d;
  font-size: 15px;
  margin-top: 5px;
}

.role-selector {
  display: flex;
  gap: 10px;
  margin: 25px 0 30px;
  justify-content: center;
}
.role-btn {
  flex: 1;
  padding: 12px 10px;
  border: 2.5px solid #e0e0e0;
  border-radius: 12px;
  background: #f8f9fa;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: bold;
  color: #555;
  text-align: center;
}
.role-btn:hover {
  border-color: #6c63ff;
  background: #f0eeff;
}
.role-btn.active {
  border-color: #6c63ff;
  background: #6c63ff;
  color: #fff;
  box-shadow: 0 4px 15px rgba(108, 99, 255, 0.3);
}

.auth-footer {
  text-align: center;
  margin-top: 25px;
  color: #7f8c8d;
  font-size: 14px;
}
.auth-footer a {
  color: #6c63ff;
  text-decoration: none;
  font-weight: bold;
}
.auth-footer a:hover {
  text-decoration: underline;
}

.sidebar {
  width: 260px;
  background: linear-gradient(180deg, #1a2332 0%, #0f1724 100%);
  color: #fff;
  height: 100vh;

  height: 100dvh;
  position: fixed;
  right: 0;
  top: 0;
  padding: 25px 15px;
  padding-bottom: max(25px, env(safe-area-inset-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
  z-index: 100;
  transition: all 0.3s ease;
}

.sidebar:not(.animating) {
  transition: none !important;
}

.sidebar-school-name {
  padding: 0 15px 10px;
  color: #a5b4fc;
  font-size: 13px;
  font-weight: 600;
}

.sidebar .logo {
  font-size: 24px;
  font-weight: bold;
  text-align: center;
  padding-bottom: 25px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 15px;
}
.sidebar .logo span {
  color: #6c63ff;
}

.sidebar a {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #b0b8c5;
  padding: 12px 16px;
  text-decoration: none;
  border-radius: 10px;
  margin: 4px 0;
  transition: all 0.3s ease;
  font-size: 14px;
  font-weight: 500;
}
.sidebar a:hover {
  background: rgba(108, 99, 255, 0.15);
  color: #fff;
  transform: translateX(-4px);
}
.sidebar a.active {
  background: #6c63ff;
  color: #fff;
  box-shadow: 0 4px 15px rgba(108, 99, 255, 0.3);
}
.sidebar .logout {
  margin-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
}
.sidebar .logout a {
  color: #e74c3c;
}
.sidebar .logout a:hover {
  background: rgba(231, 76, 60, 0.2);
  color: #ff6b6b;
}

.sidebar-toggle {
  display: none;
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 1001;
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 14px;
  background: #6c63ff;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(108, 99, 255, 0.45);
}
.sidebar-toggle:active {
  transform: scale(0.94);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 36, 0.5);
  backdrop-filter: blur(2px);
  z-index: 99;
}

.sidebar-close {
  display: none;
  position: absolute;
  top: 14px;
  left: 14px;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.sidebar-close:hover {
  background: rgba(231, 76, 60, 0.5);
}

.main {
  margin-right: 260px;
  padding: 25px 35px;
  transition: all 0.3s ease;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  padding: 18px 25px;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  margin-bottom: 25px;
}
.header h1 {
  font-size: 22px;
  color: #1a2332;
  display: flex;
  align-items: center;
  gap: 10px;
}
.header h1 span {
  background: #6c63ff;
  color: #fff;
  font-size: 14px;
  padding: 2px 14px;
  border-radius: 20px;
}
.header .user-info {
  color: #7f8c8d;
  font-size: 14px;
  background: #f8f9fa;
  padding: 8px 18px;
  border-radius: 30px;
}
.header .user-info strong {
  color: #6c63ff;
}

.card {
  background: #fff;
  border-radius: 16px;
  padding: 25px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  margin-bottom: 25px;
}
.card h3,
.card-header h3 {
  margin-bottom: 20px;
  color: #2c3e50;
  border-bottom: 2px solid #f0f2f5;
  padding-bottom: 12px;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.stats-row,
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 25px;
}
.stat-card,
.stat-box {
  background: #fff;
  padding: 22px;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  text-align: center;
  transition: transform 0.3s;
}
.stat-card:hover,
.stat-box:hover {
  transform: translateY(-5px);
}
.stat-card.clickable {
  cursor: pointer;
  position: relative;
}
.stat-card.clickable::after {
  content: "\F138";
  font-family: "bootstrap-icons";
  position: absolute;
  top: 10px;
  left: 12px;
  font-size: 13px;
  color: #b0b8c4;
  opacity: 0;
  transition: opacity 0.2s;
}
.stat-card.clickable:hover::after {
  opacity: 1;
}
.stat-card .number,
.stat-box .number {
  font-size: 32px;
  font-weight: bold;
  color: #2c3e50;
}
.stat-card .label,
.stat-box .label {
  color: #7f8c8d;
  font-size: 14px;
  margin-top: 8px;
}
.stat-card .icon {
  font-size: 24px;
  margin-bottom: 5px;
}

.stats-row.stat-cards-3 {
  grid-template-columns: repeat(3, 1fr);
}

.license-stat {
  background: #ffffff;
  border: 1px solid #e9e8ff;
  border-radius: 16px;
  padding: 22px 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(108, 99, 255, 0.07);
  transition: transform 0.25s cubic-bezier(0.3, 0.7, 0.4, 1),
    box-shadow 0.25s ease, border-color 0.25s ease;
}
.license-stat::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #8b5cf6, #6c63ff, #6366f1);
}
.license-stat:hover {
  transform: translateY(-5px);
  border-color: #c7c3ff;
  box-shadow: 0 12px 26px rgba(108, 99, 255, 0.16);
}
.license-stat .icon {
  font-size: 34px;
  margin-bottom: 4px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.license-stat:hover .icon {
  transform: scale(1.15) rotate(5deg);
}
.license-stat .label {
  color: #7c8db5;
  font-size: 13px;
  font-weight: 600;
}
.license-stat .value {
  font-size: 18px;
  font-weight: 700;
  color: #2c3e50;
  word-break: break-all;
  line-height: 1.4;
}
.license-stat .sub {
  font-size: 12px;
  color: #95a5a6;
  margin-top: 2px;
}

.info-row {
  margin-top: 15px;
  padding: 12px 15px;
  background: #f8f9fa;
  border-radius: 10px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 14px;
  color: #2c3e50;
}

.device-id {
  margin-top: 12px;
  font-size: 12px;
  color: #95a5a6;
  word-break: break-all;
  padding: 10px 12px;
  background: #f8f9fa;
  border-radius: 8px;
  font-family: monospace;
}

.license-input {
  font-family: monospace;
  letter-spacing: 1px;
  text-align: left !important;
  font-size: 15px !important;
}

.form-hint {
  font-size: 12px;
  color: #95a5a6;
  margin-top: 5px;
}

.license-actions {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #eef0f3;
}

.info-list {
  list-style: none;
  padding: 0;
  margin: 0;
  line-height: 2.2;
  color: #2c3e50;
}

.stat-card.blue .number {
  color: #3498db;
}
.stat-card.green .number {
  color: #2ecc71;
}
.stat-card.orange .number {
  color: #f39c12;
}
.stat-card.red .number {
  color: #e74c3c;
}
.stat-card.purple .number {
  color: #9b59b6;
}

.attendance-today {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 25px;
}
.attendance-item {
  background: #fff;
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  text-align: center;
  transition: transform 0.3s;
  border-top: 4px solid #95a5a6;
}
.attendance-item:hover {
  transform: translateY(-5px);
}
.attendance-item .number {
  font-size: 32px;
  font-weight: bold;
  color: #2c3e50;
  margin-bottom: 8px;
}
.attendance-item .label {
  color: #7f8c8d;
  font-size: 14px;
}
.attendance-item.present {
  border-top-color: #2ecc71;
}
.attendance-item.present .number {
  color: #2ecc71;
}
.attendance-item.absent {
  border-top-color: #e74c3c;
}
.attendance-item.absent .number {
  color: #e74c3c;
}
.attendance-item.late {
  border-top-color: #f39c12;
}
.attendance-item.late .number {
  color: #f39c12;
}

.row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 25px;
}
.row .card {
  flex: 1;
  min-width: 280px;
}

.btn {
  position: relative;
  padding: 10px 24px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  font-family: "IRANSansX", "Tahoma", "Segoe UI", sans-serif;
  color: #fff;
  background: linear-gradient(to bottom, #7a73ff 0%, #6c63ff 55%, #605ad6 100%);

  box-shadow: 0 4px 0 #4f48b8, 0 8px 14px rgba(66, 53, 168, 0.35);
  transform: translateY(0);
  transition: transform 0.2s cubic-bezier(0.3, 0.7, 0.4, 1),
    box-shadow 0.2s cubic-bezier(0.3, 0.7, 0.4, 1), filter 0.2s ease;
}

.btn-primary,
.btn-success,
.btn-danger,
.btn-warning,
.btn-info,
.btn-secondary {
  background: linear-gradient(to bottom, #7a73ff 0%, #6c63ff 55%, #605ad6 100%);
  color: #fff;
}
.btn:hover {
  filter: brightness(1.06);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #4f48b8, 0 11px 20px rgba(66, 53, 168, 0.42);
  transition: transform 0.25s cubic-bezier(0.3, 0.7, 0.4, 1.5),
    box-shadow 0.25s cubic-bezier(0.3, 0.7, 0.4, 1.5), filter 0.2s ease;
}
.btn:active {
  filter: brightness(0.97);
  transform: translateY(2px);
  box-shadow: 0 1px 0 #4f48b8, 0 2px 6px rgba(66, 53, 168, 0.3);
  transition: transform 0.04s, box-shadow 0.04s;
}
.btn:focus-visible {
  outline: 3px solid #b3aeff;
  outline-offset: 3px;
}
.auto-save-status {
  font-size: 13px;
  font-weight: bold;
  padding: 4px 10px;
  border-radius: 8px;
  white-space: nowrap;
}
.auto-save-status.saved {
  color: #1e7e34;
  background: #e6f7ec;
}
.auto-save-status.saving {
  color: #b8860b;
  background: #fff8e1;
}
.auto-save-status.error {
  color: #c0392b;
  background: #fdecea;
}
.btn-sm {
  padding: 6px 14px;
  font-size: 14px;
  font-family: "IRANSansX", "Tahoma", "Segoe UI", sans-serif;
  border-radius: 8px;
}

.finance-action-btn,
.iran-sans-demi {
  font-family: "IRANSansX", "Tahoma", "Segoe UI", sans-serif !important;
  font-weight: 700 !important;
}

.badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
  display: inline-block;
}
.badge-active,
.badge-present,
.badge-reward,
.badge-success {
  background: #e0fbf0;
  color: #2ecc71;
  border: 1px solid #2ecc71;
}
.badge-inactive,
.badge-absent,
.badge-danger {
  background: #fbe6e6;
  color: #e74c3c;
  border: 1px solid #e74c3c;
}
.badge-info,
.badge-male,
.badge-excused {
  background: #e3f2fd;
  color: #3498db;
  border: 1px solid #3498db;
}
.badge-warning,
.badge-late {
  background: #fdf3e8;
  color: #f39c12;
  border: 1px solid #f39c12;
}
.badge-female {
  background: #fce7f3;
  color: #db2777;
  border: 1px solid #ec4899;
}
.badge-purple {
  background: #f3e8fd;
  color: #8e44ad;
  border: 1px solid #8e44ad;
}

.att-day-group {
  border: 1px solid #eaecef;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: #fff;
}
.att-day-header {
  font-weight: bold;
  color: #2c3e50;
  margin-bottom: 10px;
  font-size: 14px;
}
.att-period-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.att-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.att-chip.att-present {
  background: #e0fbf0;
  color: #2ecc71;
  border: 1px solid #2ecc71;
}
.att-chip.att-absent {
  background: #fbe6e6;
  color: #e74c3c;
  border: 1px solid #e74c3c;
}
.att-chip.att-excused {
  background: #e3f2fd;
  color: #3498db;
  border: 1px solid #3498db;
}
.att-chip.att-late {
  background: #fdf3e8;
  color: #f39c12;
  border: 1px solid #f39c12;
}
.att-reason-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}
.att-reason-indicator:hover {
  opacity: 1;
}
.att-chip:hover .att-reason-indicator {
  opacity: 1;
}
.att-reason-text {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
  transition: opacity 0.2s, max-width 0.2s;
}
.att-chip:hover .att-reason-text {
  opacity: 1;
  max-width: 250px;
}
.badge-count {
  background: #6c63ff;
  color: #fff;
  padding: 2px 12px;
  border-radius: 20px;
  font-size: 13px;
}

.card-header .count {
  margin-right: auto;
  color: #7f8c8d;
  font-size: 14px;
  font-weight: normal;
}

.hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #95a5a6;
}

.step-badge {
  background: #6c63ff;
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  padding: 2px 12px;
  border-radius: 20px;
}

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-wrapper::-webkit-scrollbar {
  height: 6px;
}
.table-wrapper::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 3px;
}
.table,
.table-mini {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}
.table th,
.table td,
.table-mini th,
.table-mini td {
  padding: 14px 16px;
  text-align: right;
  border-bottom: 1px solid #f0f2f5;
}
.table th,
.table-mini th {
  background: #f8f9fa;
  color: #2c3e50;
  font-weight: bold;
  border-bottom: 2px solid #e9ecef;
}
.table tr:hover td,
.table-mini tr:hover td {
  background: #f8f9fa;
}

.perm-table {
  min-width: 0;
}
.perm-table th,
.perm-table td {
  padding: 10px 8px;
  text-align: center;
  white-space: nowrap;
}
.perm-table thead th:first-child,
.perm-table tbody td:first-child {
  text-align: right;
  white-space: normal;
}
.perm-table input[type="checkbox"].perm-full,
.perm-table input[type="checkbox"].perm-action {
  transform: scale(1.3);
  cursor: pointer;
  margin: 0;
}
.actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.table-scores input[type="number"] {
  width: 80px;
  padding: 8px 10px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 15px;
  font-family: "IRANSansX", "Tahoma", "Segoe UI", sans-serif;
  text-align: center;
}
.table-scores input[type="number"]:focus {
  outline: none;
  border-color: #6c63ff;
}
.table-scores input[type="number"].has-score {
  border-color: #2ecc71;
  background: #f0fff4;
}
.score-display {
  font-weight: bold;
  font-size: 16px;
}
.score-high {
  color: #2ecc71;
}
.score-mid {
  color: #f39c12;
}
.score-low {
  color: #e74c3c;
}

.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-weight: bold;
  margin-bottom: 8px;
  font-size: 14px;
  color: #2c3e50;
}
.form-group label .required {
  color: #e74c3c;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e8ecf1;
  border-radius: 10px;
  font-size: 15px;
  font-family: "IRANSansX", "Tahoma", "Segoe UI", sans-serif;

  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
  background: #fafbfc;
  color: #2c3e50;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #6c63ff;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.1);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.modal .form-row > .form-group:only-child {
  grid-column: 1 / -1;
}
.checkbox-group {
  display: flex;
  align-items: center;
  gap: 10px;
}
.checkbox-group input {
  width: auto;
  transform: scale(1.2);
  cursor: pointer;
}
.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 2px solid #f0f2f5;
}
.search-box {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.search-box input,
.search-box select {
  padding: 10px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 15px;
  font-family: "IRANSansX", "Tahoma", "Segoe UI", sans-serif;

  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
  flex: 1;
  min-width: 150px;
}

.list-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  align-items: center;
}
.list-toolbar .list-search {
  flex: 1;
  min-width: 200px;
  padding: 10px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  background: #fff
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239aa0a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><path d='m21 21-4.3-4.3'/></svg>")
    no-repeat right 12px center;
  padding-right: 38px;
  direction: rtl;
  text-align: right;
}
.list-toolbar .list-filter {
  padding: 10px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  min-width: 150px;
  background: #fff;
  cursor: pointer;
  direction: rtl;
  text-align: right;
}
.list-toolbar .list-search:focus,
.list-toolbar .list-filter:focus {
  outline: none;
  border-color: var(--primary, #4361ee);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.12);
}
.list-toolbar .list-count {
  font-size: 13px;
  color: #7f8c8d;
  white-space: nowrap;
}
.list-toolbar .list-clear {
  padding: 8px 14px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  color: #e74c3c;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.list-toolbar .list-clear:hover {
  background: #fdecea;
  border-color: #e74c3c;
}

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  z-index: 9999;
  justify-content: center;
  align-items: center;
  padding: 20px;
}
.modal-overlay.active {
  display: flex !important;
}
.modal {
  background: #ffffff !important;
  border-radius: 20px;
  padding: 30px;
  max-width: 650px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
  border: 1px solid #e2e8f0;

  transform: translateZ(0) !important;
  will-change: transform, opacity;
  contain: content;
}

.modal input,
.modal select,
.modal textarea {
  transition: border-color 0.1s ease !important;
  box-shadow: none !important;
  transform: none !important;
}

.modal input:focus,
.modal select:focus,
.modal textarea:focus {
  border-color: #6c63ff !important;
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15) !important;
}

.modal::-webkit-scrollbar-thumb {
  box-shadow: none !important;
}
.modal .modal-header,
.modal h2 {
  margin-bottom: 25px;
  color: #2c3e50;
  border-bottom: 2px solid #f0f2f5;
  padding-bottom: 15px;
  display: flex;
  justify-content: space-between;
}
.modal .close-btn {
  background: none;
  border: none;
  font-size: 28px;
  color: #95a5a6;
  cursor: pointer;
  transition: 0.3s;
  padding: 0 8px;
}
.modal .close-btn:hover {
  color: #e74c3c;
  transform: rotate(90deg);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.alert {
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 25px;
  font-weight: bold;
  font-size: 14px;
}
.alert-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}
.alert-danger {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.empty,
.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: #b0b8c5;
}
.empty-state .icon {
  font-size: 50px;
  margin-bottom: 15px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
  font-size: 14px;
  flex-wrap: wrap;
}
.breadcrumb a {
  color: #6c63ff;
  text-decoration: none;
  font-weight: bold;
}
.breadcrumb a:hover {
  text-decoration: underline;
}

.step-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.step-indicator .step {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: bold;
}
.step-indicator .step.active {
  background: #6c63ff;
  color: #fff;
  box-shadow: 0 4px 10px rgba(108, 99, 255, 0.3);
}
.step-indicator .step.done {
  background: #2ecc71;
  color: #fff;
}
.step-indicator .step.inactive {
  background: #fff;
  color: #95a5a6;
  border: 1px solid #e0e0e0;
}
.step-indicator .arrow {
  color: #95a5a6;
  font-size: 18px;
}

.grid-classes,
.grid-subjects,
.grid-exams {
  display: grid;
  gap: 15px;
}
.grid-classes {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.grid-subjects {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.grid-exams {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.class-card,
.subject-card,
.exam-card {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  border: 2px solid transparent;
  transition: 0.3s;
  cursor: pointer;
  text-decoration: none;
  color: #2c3e50;
  display: block;
  position: relative;
}
.class-card:hover,
.subject-card:hover,
.exam-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  border-color: #6c63ff;
}
.exam-card.active {
  border-color: #2ecc71;
  background: #f0fff4;
}
.exam-card.custom {
  border-style: dashed;
  border-color: #f39c12;
}
.class-card .icon,
.subject-card .icon,
.exam-card .icon {
  font-size: 32px;
}
.class-card .name,
.subject-card .name,
.exam-card .name {
  font-weight: bold;
  margin-top: 8px;
}
.class-card .info,
.subject-card .code,
.exam-card .group {
  font-size: 12px;
  color: #95a5a6;
  margin-top: 4px;
}

.delete-exam-type,
.edit-exam-type {
  position: absolute;
  top: 4px;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: 0.3s;
  color: #fff;
}
.delete-exam-type {
  left: 4px;
  background: #e74c3c;
}
.edit-exam-type {
  left: 30px;
  background: #3498db;
}
.exam-card.custom:hover .delete-exam-type,
.exam-card.custom:hover .edit-exam-type {
  opacity: 1;
}

.exam-section.hidden,
.no-exam-result {
  display: none;
}
.no-exam-result.visible {
  display: block;
  text-align: center;
  padding: 20px;
  color: #b0b8c5;
}

.profile-header {
  display: flex;
  gap: 25px;
  align-items: flex-start;
  flex-wrap: wrap;
  padding-bottom: 20px;
  border-bottom: 2px solid #f0f2f5;
  margin-bottom: 20px;
}
.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: #6c63ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: #fff;
  flex-shrink: 0;
}
.profile-info {
  flex: 1;
  min-width: 200px;
}
.profile-info h2 {
  font-size: 24px;
  color: #2c3e50;
  margin-bottom: 5px;
}
.profile-info .subtitle {
  color: #7f8c8d;
  font-size: 14px;
}
.profile-info .details {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px 20px;
  margin-top: 10px;
}
.profile-info .details .item {
  font-size: 14px;
  color: #2c3e50;
}
.profile-info .details .item strong {
  color: #7f8c8d;
  font-weight: normal;
}

.tab-section {
  margin-top: 15px;
}
.tab-buttons {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  border-bottom: 2px solid #e9ecef;
  padding-bottom: 5px;
  margin-bottom: 15px;
}
.tab-btn {
  padding: 8px 20px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  color: #95a5a6;
  border-radius: 8px 8px 0 0;
  transition: 0.3s;
}
.tab-btn:hover {
  background: #f8f9fa;
  color: #2c3e50;
}
.tab-btn.active {
  color: #6c63ff;
  border-bottom: 3px solid #6c63ff;
}
.tab-content {
  display: none;
  padding: 10px 0;
}
.tab-content.active {
  display: block;
}

.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 15px;
}

.report-container {
  max-width: 900px;
  margin: 0 auto;
  background: #fff;
  padding: 30px 35px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}
.report-container .header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  text-align: center;
}
.report-container .header-top .logo {
  width: 80px;
  height: 80px;
}
.report-container .header-top .logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.student-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 30px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 20px;
}
.student-info .item {
  display: flex;
  gap: 8px;
  font-size: 14px;
}
.student-info .item .label {
  color: #7f8c8d;
  min-width: 100px;
}
.student-info .item .value {
  color: #2c3e50;
  font-weight: bold;
}

.scores-table {
  width: 100%;
  border-collapse: collapse;
  margin: 15px 0;
  font-size: 14px;
}
.scores-table th {
  background: #2c3e50;
  color: #fff;
  padding: 10px 12px;
  text-align: center;
}
.scores-table td {
  padding: 8px 12px;
  text-align: center;
  border-bottom: 1px solid #eee;
}
.scores-table tr:nth-child(even) {
  background: #f8f9fa;
}
.scores-table .pass {
  color: #2ecc71;
  font-weight: bold;
}
.scores-table .fail {
  color: #e74c3c;
  font-weight: bold;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin: 20px 0;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
}
.stats-grid .stat {
  text-align: center;
}
.stats-grid .stat .number {
  font-size: 22px;
  font-weight: bold;
  color: #2c3e50;
}
.stats-grid .stat .label {
  font-size: 12px;
  color: #7f8c8d;
}

.discipline-box {
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  margin: 15px 0;
}
.teacher-notes {
  margin: 15px 0;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
}
.signatures {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 2px solid #2c3e50;
}
.signatures .sign {
  text-align: center;
  font-size: 13px;
}
.signatures .sign .line {
  border-bottom: 1px solid #2c3e50;
  padding: 5px 0;
  margin: 10px 0;
  min-height: 40px;
}

@media print {
  body {
    background: #fff;
    padding: 0;
    margin: 0;
  }
  .report-container {
    box-shadow: none;
    padding: 10px 15px;
    margin: 0;
    max-width: 100%;
  }
  .print-btn,
  .print-btn-pdf,
  .print-btn-back,
  .sidebar,
  .header {
    display: none !important;
  }
  .main {
    margin: 0;
    padding: 0;
  }

  .report-container .header-top .logo {
    width: 40px;
    height: 40px;
  }
  .student-info {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 3px 15px;
    padding: 8px 12px;
    font-size: 11px;
    background: transparent;
    border: 1px solid #ddd;
  }
  .scores-table {
    font-size: 11px;
  }
  .scores-table th,
  .scores-table td {
    padding: 4px 6px;
    border: 1px solid #ddd;
  }
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
    padding: 8px;
    margin: 8px 0;
    border: 1px solid #ddd;
  }
  .stats-grid .stat .number {
    font-size: 14px;
  }
  .stats-grid .stat .label {
    font-size: 10px;
  }
  .discipline-box,
  .teacher-notes {
    padding: 8px;
    font-size: 11px;
    margin: 8px 0;
    border: 1px solid #ddd;
  }
  .signatures {
    gap: 10px;
    margin-top: 12px;
    padding-top: 10px;
  }
}

@media (max-width: 992px) {
  .stats-row,
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .form-row,
  .modal .form-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar-toggle {
    display: flex;
  }
  .sidebar {
    width: 280px;
    max-width: 85vw;
    right: 0;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 100;
    padding-top: 60px;
  }

  .sidebar:not(.open) {
    transition: transform 0s !important;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.3);
    z-index: 1002;
    transition: transform 0.3s ease;
  }
  .sidebar-close {
    display: flex;
  }
  .sidebar-overlay.active {
    display: block;
  }
  .sidebar a {
    font-size: 14px;
    padding: 12px 16px;
    justify-content: flex-start;
    gap: 12px;
  }
  .sidebar a span {
    display: inline;
  }
  .sidebar a .icon {
    font-size: 18px;
  }

  .main {
    margin-right: 0;
    padding: 70px 14px 20px;
  }

  .header {
    flex-direction: column;
    text-align: center;
    gap: 12px;
    padding: 14px 16px;
    direction: rtl;
  }
  .header h1 {
    font-size: 18px;
    width: 100%;
    justify-content: center;
  }
  .header .user-info {
    text-align: center;
  }

  .stats-row,
  .stats {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .attendance-today {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .stats-row.stat-cards-3 {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .info-row {
    flex-direction: column;
    gap: 8px;
  }
  .stat-card,
  .stat-box {
    padding: 15px;
  }
  .stat-card .number,
  .stat-box .number {
    font-size: 24px;
  }
  .stat-card .icon {
    font-size: 20px;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    font-size: 16px;
    padding: 12px 14px;
    font-family: "IRANSansX", "Tahoma", "Segoe UI", sans-serif;
  }
  .btn {
    width: 100%;
    margin-bottom: 10px;
    justify-content: center;
  }
  .form-actions,
  .search-box {
    flex-direction: column;
  }
  .search-box input,
  .search-box select {
    width: 100%;
    flex: none;
  }
  .actions {
    justify-content: center;
    gap: 8px;
  }

  td .actions .btn,
  .table .actions .btn,
  .table td .btn.btn-sm {
    width: auto;
    margin-bottom: 0;
  }

  .modal-overlay {
    padding: 10px;
  }
  .modal {
    padding: 20px 16px;
    max-height: 92vh;
    border-radius: 16px;
    will-change: auto;
    contain: none;
  }
  .modal h2 {
    font-size: 18px;
  }

  .table-wrapper {
    margin: 0 -5px;
  }

  .table-wrapper.responsive table,
  table.responsive {
    min-width: 0;
  }
  .table-wrapper.responsive thead,
  table.responsive thead {
    display: none;
  }
  .table-wrapper.responsive tr,
  table.responsive tbody tr {
    display: block;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    margin-bottom: 12px;
    padding: 6px 4px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
  }
  .table-wrapper.responsive td,
  table.responsive td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-bottom: 1px solid #f0f2f5;
    white-space: normal;
    text-align: right;
    direction: rtl;
  }
  .table-wrapper.responsive tr td:last-child,
  table.responsive tbody tr td:last-child {
    border-bottom: none;
  }
  .table-wrapper.responsive td::before,
  table.responsive td::before {
    content: attr(data-label);
    font-weight: bold;
    color: #7f8c8d;
    font-size: 12px;
    flex-shrink: 0;
  }

  .table-wrapper.responsive td[data-label="عملیات"],
  table.responsive td[data-label="عملیات"] {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .table-wrapper.responsive td[data-label="عملیات"] .actions,
  table.responsive td[data-label="عملیات"] .actions {
    justify-content: flex-start;
  }

  .table th,
  .table td,
  .table-mini th,
  .table-mini td {
    padding: 10px;
    font-size: 13px;
    white-space: nowrap;
  }

  .perm-table {
    min-width: 0;
  }
  .perm-table th,
  .perm-table td {
    padding: 8px 4px;
    font-size: 11px;
  }
  .perm-table thead th {
    font-size: 10px;
    padding: 8px 3px;
  }
  .perm-table thead th:first-child,
  .perm-table tbody td:first-child {
    white-space: normal;
    font-size: 12px;
    min-width: 84px;
  }
  .perm-table input[type="checkbox"].perm-full,
  .perm-table input[type="checkbox"].perm-action {
    transform: scale(1.5);
    margin: 2px;
  }

  .grid-classes,
  .grid-subjects,
  .grid-exams {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .profile-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .profile-info .details {
    grid-template-columns: 1fr 1fr;
  }
  .stat-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .student-info {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .signatures {
    grid-template-columns: repeat(2, 1fr);
  }
  .report-container .header-top {
    flex-direction: column;
  }
  .report-container {
    padding: 20px 16px;
  }

  .container {
    padding: 30px 20px;
    border-radius: 18px;
  }
  .container .logo h1 {
    font-size: 24px;
  }
  .role-selector {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .stats-row,
  .stats {
    grid-template-columns: 1fr;
  }
  .attendance-today {
    grid-template-columns: 1fr;
  }

  .stat-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .main {
    padding: 12px 10px;
  }
  .card {
    padding: 18px 14px;
  }

  .grid-classes {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }
  .grid-subjects {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }
  .grid-exams {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .profile-info .details {
    grid-template-columns: 1fr;
  }
  .signatures {
    grid-template-columns: 1fr;
  }

  .header h1 {
    font-size: 16px;
  }
  .table th,
  .table td,
  .table-mini th,
  .table-mini td {
    font-size: 12px;
    padding: 8px;
  }
}

@media (hover: none) {
  .stat-card:hover,
  .stat-box:hover,
  .attendance-item:hover,
  .class-card:hover,
  .subject-card:hover,
  .exam-card:hover,
  .sidebar a:hover {
    transform: none;
  }
}

.step-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.step-indicator .step {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: bold;
}
.step-indicator .step.active {
  background: #6c63ff;
  color: #fff;
}
.step-indicator .step.done {
  background: #2ecc71;
  color: #fff;
}
.step-indicator .step.inactive {
  background: #e9ecef;
  color: #95a5a6;
}
.step-indicator .arrow {
  color: #95a5a6;
  font-size: 18px;
}

.grid-classes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
}
.class-card {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  border: 2px solid transparent;
  transition: 0.3s;
  cursor: pointer;
  text-decoration: none;
  color: #2c3e50;
}
.class-card:hover {
  border-color: #6c63ff;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}
.class-card .icon {
  font-size: 32px;
}
.class-card .name {
  font-weight: bold;
  margin-top: 8px;
}
.class-card .info {
  font-size: 12px;
  color: #95a5a6;
  margin-top: 4px;
}

.grid-teachers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.teacher-card {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 15px;
  text-align: center;
  border: 2px solid transparent;
  transition: 0.3s;
  cursor: pointer;
  text-decoration: none;
  color: #2c3e50;
  display: block;
}
.teacher-card:hover {
  border-color: #3498db;
  transform: translateY(-2px);
}
.teacher-card .icon {
  font-size: 28px;
}
.teacher-card .name {
  font-weight: bold;
  margin-top: 6px;
  font-size: 15px;
}
.teacher-card .code {
  font-size: 12px;
  color: #95a5a6;
}

.grid-periods {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.period-card {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  border: 2px solid transparent;
  transition: 0.3s;
  cursor: pointer;
  text-decoration: none;
  color: #2c3e50;
  display: block;
}
.period-card:hover {
  border-color: #2ecc71;
  transform: translateY(-2px);
}
.period-card .icon {
  font-size: 24px;
}
.period-card .name {
  font-weight: bold;
  margin-top: 4px;
  font-size: 14px;
}

.table-attendance {
  width: 100%;
  border-collapse: collapse;
}
.table-attendance th,
.table-attendance td {
  padding: 12px 15px;
  text-align: right;
  border-bottom: 1px solid #eee;
}
.table-attendance th {
  background: #f8f9fa;
  font-weight: bold;
  color: #2c3e50;
}
.table-attendance tr:hover td {
  background: #f8f9fa;
}
.table-attendance select {
  padding: 6px 10px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  font-family: "IRANSansX", "Tahoma", "Segoe UI", sans-serif;
  background: #fff;
}
.table-attendance select:focus {
  outline: none;
  border-color: #6c63ff;
}

.date-input {
  padding: 8px 14px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  font-family: "IRANSansX", "Tahoma", "Segoe UI", sans-serif;
}
.date-input:focus {
  outline: none;
  border-color: #6c63ff;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #b0b8c5;
}
.empty-state .icon {
  font-size: 48px;
  margin-bottom: 10px;
}

@media (max-width: 768px) {
  .grid-classes {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  .grid-teachers {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
  .grid-periods {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
  .table-attendance {
    font-size: 13px;
  }
  .table-attendance th,
  .table-attendance td {
    padding: 8px 10px;
  }
  .step-indicator .step {
    padding: 4px 10px;
    font-size: 11px;
  }
  .step-indicator .arrow {
    font-size: 14px;
  }

  .table-wrapper.responsive .table-attendance thead {
    display: none;
  }
  .table-wrapper.responsive .table-attendance tbody tr {
    display: block;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    margin-bottom: 12px;
    padding: 6px 4px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
  }
  .table-wrapper.responsive .table-attendance tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-bottom: 1px solid #f0f2f5;
    white-space: normal;
    text-align: left;
  }
  .table-wrapper.responsive .table-attendance tbody tr td:last-child {
    border-bottom: none;
  }
  .table-wrapper.responsive .table-attendance tbody td::before {
    content: attr(data-label);
    font-weight: bold;
    color: #7f8c8d;
    font-size: 12px;
    flex-shrink: 0;
  }

  .table-wrapper.responsive .table-attendance tbody td[data-label="وضعیت"] {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .table-wrapper.responsive
    .table-attendance
    tbody
    td[data-label="وضعیت"]::before {
    width: 100%;
  }
  .table-wrapper.responsive
    .table-attendance
    tbody
    td[data-label="وضعیت"]
    select {
    width: 100%;
    padding: 10px 12px;
    font-size: 16px;
  }

  .card form > div[style*="margin-bottom:15px"] {
    flex-direction: column;
    align-items: stretch !important;
  }
  .date-input {
    width: 100%;
    font-size: 16px;
    padding: 12px 14px;
  }
  .card form > div[style*="margin-bottom:15px"] .btn,
  .card form > div[style*="margin-bottom:15px"] a.btn {
    width: 100%;
    margin-bottom: 8px;
  }
}

.grid-students {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
}
.student-card {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  border: 2px solid transparent;
  transition: 0.3s;
  cursor: pointer;
  text-decoration: none;
  color: #2c3e50;
}
.student-card:hover {
  border-color: #6c63ff;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}
.student-card .icon {
  font-size: 32px;
}
.student-card .name {
  font-weight: bold;
  margin-top: 8px;
}
.student-card .code {
  font-size: 12px;
  color: #95a5a6;
  margin-top: 4px;
}

.badge-reward {
  background: #2ecc71;
  color: #fff;
}
.badge-warning {
  background: #f39c12;
  color: #fff;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.form-row.three-cols {
  grid-template-columns: repeat(3, 1fr);
}
.form-row.four-cols {
  grid-template-columns: repeat(4, 1fr);
}
.form-row.two-cols {
  grid-template-columns: repeat(2, 1fr);
}
.form-row.auto-cols {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.form-group {
  margin-bottom: 15px;
}
.form-group label {
  display: block;
  font-weight: bold;
  margin-bottom: 5px;
  font-size: 14px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 15px;
  font-family: "IRANSansX", "Tahoma", "Segoe UI", sans-serif;

  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #6c63ff;
}

@media (max-width: 768px) {
  .grid-students {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .form-row.three-cols,
  .form-row.four-cols,
  .form-row.auto-cols {
    grid-template-columns: 1fr;
  }
}

.license-readonly-banner {
  background: linear-gradient(90deg, #f39c12, #d35400);
  color: #fff;
  text-align: center;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: bold;
  position: sticky;
  top: 0;
  z-index: 99999;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  direction: rtl;
  font-family: "IRANSansX", sans-serif;
  line-height: 1.8;
}

.license-readonly-banner .license-grace-badge {
  background: #fff;
  color: #d35400;
  padding: 2px 10px;
  border-radius: 20px;
  margin: 0 6px;
}

.license-readonly-banner .license-renew-link {
  color: #fff;
  text-decoration: underline;
  margin-right: 10px;
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
}

.license-readonly-banner .license-renew-link:hover {
  background: rgba(255, 255, 255, 0.35);
}

body.license-readonly .btn-success,
body.license-readonly .btn-primary,
body.license-readonly button[type="submit"],
body.license-readonly input[type="submit"],
body.license-readonly .btn-danger,
body.license-readonly .btn-warning,
body.license-readonly button[onclick*="openModal"],
body.license-readonly button[onclick*="edit"] {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

body.license-readonly a[href*="logout.php"],
body.license-readonly a[href*="license.php"],
body.license-readonly .btn-info,
body.license-readonly .btn-secondary,
body.license-readonly a[href*="view"],
body.license-readonly a[href*="report"] {
  opacity: 1 !important;
  cursor: pointer !important;
  pointer-events: auto !important;
}

.jalali-datepicker-container {
  display: none;
  position: absolute;
  z-index: 9999;
  background: #fff;
  border: none;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
  padding: 20px;
  width: 320px;
  direction: rtl;
  font-family: "IRANSansX", "Tahoma", "Segoe UI", sans-serif;
  user-select: none;
  animation: jdpFadeIn 0.2s ease-out;
}

@keyframes jdpFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.jdp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f0f2f5;
}

.jdp-header .jdp-title {
  font-size: 16px;
  font-weight: bold;
  color: #2c3e50;
  flex: 1;
  text-align: center;
}

.jdp-header .jdp-nav {
  background: #f8f9fa;
  border: 2px solid transparent;
  border-radius: 10px;
  width: 38px;
  height: 38px;
  cursor: pointer;
  font-size: 18px;
  color: #6c63ff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s;
}

.jdp-header .jdp-nav:hover {
  background: #6c63ff;
  color: #fff;
  border-color: #6c63ff;
  transform: scale(1.05);
}

.jdp-header .jdp-nav:active {
  transform: scale(0.95);
}

.jdp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}

.jdp-weekdays span {
  text-align: center;
  font-size: 11px;
  color: #95a5a6;
  font-weight: bold;
  padding: 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.jdp-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.jdp-day {
  text-align: center;
  padding: 10px 0;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  color: #2c3e50;
  transition: all 0.2s;
  position: relative;
  font-weight: 500;
}

.jdp-day:hover {
  background: #f0eeff;
  color: #6c63ff;
  transform: scale(1.08);
}

.jdp-day:active {
  transform: scale(0.95);
}

.jdp-day.jdp-today {
  border: 2px solid #6c63ff;
  font-weight: bold;
  color: #6c63ff;
}

.jdp-day.jdp-today:hover {
  background: #6c63ff;
  color: #fff;
}

.jdp-day.jdp-selected {
  background: linear-gradient(135deg, #6c63ff, #5a52d5);
  color: #fff;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(108, 99, 255, 0.4);
  transform: scale(1.05);
}

.jdp-day.jdp-selected:hover {
  background: linear-gradient(135deg, #5a52d5, #4a42c5);
  color: #fff;
}

.jdp-day.jdp-other-month {
  color: #b0b8c5;
  opacity: 0.5;
}

.jdp-day.jdp-other-month:hover {
  color: #95a5a6;
  opacity: 0.8;
}

.jdp-empty {
  padding: 10px 0;
}

.jdp-footer {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 2px solid #f0f2f5;
}

.jdp-footer button {
  flex: 1;
  padding: 10px 8px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-family: "IRANSansX", "Tahoma", "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: bold;
  transition: all 0.25s;
}

.jdp-today-btn {
  background: #eef0ff;
  color: #6c63ff;
  border: 2px solid transparent;
}

.jdp-today-btn:hover {
  background: #6c63ff;
  color: #fff;
  border-color: #6c63ff;
  box-shadow: 0 4px 12px rgba(108, 99, 255, 0.3);
}

.jdp-clear-btn {
  background: #fff5f5;
  color: #e74c3c;
  border: 2px solid transparent;
}

.jdp-clear-btn:hover {
  background: #e74c3c;
  color: #fff;
  border-color: #e74c3c;
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.jdp-confirm-btn {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  color: #fff;
  box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

.jdp-confirm-btn:hover {
  background: linear-gradient(135deg, #27ae60, #219a52);
  box-shadow: 0 6px 16px rgba(46, 204, 113, 0.4);
  transform: translateY(-1px);
}

.jdp-confirm-btn:active {
  transform: translateY(0);
}

input[readonly].jalali-date-input,
input[readonly][id="recorded_at"] {
  cursor: pointer !important;
  background: #fff !important;
  transition: all 0.25s;
}

input[readonly].jalali-date-input:hover,
input[readonly][id="recorded_at"]:hover {
  border-color: #6c63ff !important;
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1);
}

input[readonly].jalali-date-input:focus,
input[readonly][id="recorded_at"]:focus {
  outline: none !important;
  border-color: #6c63ff !important;
  box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.15);
}

@media (max-width: 480px) {
  .jalali-datepicker-container {
    width: 280px;
    padding: 16px;
    border-radius: 12px;
  }

  .jdp-day {
    padding: 8px 0;
    font-size: 13px;
  }

  .jdp-header .jdp-nav {
    width: 34px;
    height: 34px;
  }

  .jdp-footer button {
    padding: 8px 6px;
    font-size: 12px;
  }
}

.jalali-datepicker-container.jdp-dark {
  background: #1a2332;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  font-family: "IRANSansX", "Tahoma", "Segoe UI", sans-serif;
}

.jdp-dark .jdp-header {
  border-bottom-color: #2d3a4e;
}

.jdp-dark .jdp-header .jdp-title {
  color: #fff;
}

.jdp-dark .jdp-header .jdp-nav {
  background: #2d3a4e;
  color: #b0b8c5;
}

.jdp-dark .jdp-header .jdp-nav:hover {
  background: #6c63ff;
  color: #fff;
}

.jdp-dark .jdp-weekdays span {
  color: #7f8c8d;
}

.jdp-dark .jdp-day {
  color: #b0b8c5;
}

.jdp-dark .jdp-day:hover {
  background: #2d3a4e;
  color: #fff;
}

.jdp-dark .jdp-day.jdp-today {
  border-color: #6c63ff;
  color: #6c63ff;
}

.jdp-dark .jdp-day.jdp-other-month {
  color: #4a5568;
}

.jdp-dark .jdp-footer {
  border-top-color: #2d3a4e;
}

.jdp-dark .jdp-today-btn {
  background: #2d3a4e;
  color: #6c63ff;
}

.jdp-dark .jdp-clear-btn {
  background: #2d3a4e;
  color: #e74c3c;
}

.date-slider-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #4e4d4d;
  border-radius: 24px;
  padding: 15px 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  max-width: 650px;
  margin: 20px auto;
  user-select: none;
  direction: rtl;
}

.date-slider-arrow {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #f1f5f9;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #1e293b;
  font-size: 18px;
  text-decoration: none;
  outline: none;
}

.date-slider-arrow:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
  color: #6c63ff;
  background: #f8fafc;
}

.date-slider-arrow:active {
  transform: scale(0.95);
}

.date-slider-cards {
  display: flex;
  gap: 15px;
  flex: 1;
  justify-content: center;
  margin: 0 15px;
}

.date-slider-card {
  flex: 1;
  max-width: 160px;
  height: 90px;
  border-radius: 16px;
  background: #ffffff;
  border: 2px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  color: #334155;
  position: relative;
  outline: none;
}

.date-slider-card .weekday {
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 6px;
  font-weight: 500;
}

.date-slider-card .date-val {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.date-slider-card:not(.active):hover {
  border-color: #cbd5e1;
  transform: translateY(-2px);
}

.date-slider-card.active {
  background: linear-gradient(135deg, #6c63ff, #3b82f6);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(108, 99, 255, 0.25);
  transform: scale(1.05);
  z-index: 2;
  cursor: default;
}

.date-slider-card.active .weekday {
  color: rgba(255, 255, 255, 0.9);
}

.date-slider-card.active::after {
  content: "";
  position: absolute;
  bottom: 10px;
  width: 32px;
  height: 4px;
  background: #ffffff;
  border-radius: 20px;
}

@media (max-width: 600px) {
  .date-slider-container {
    padding: 10px;
  }
  .date-slider-arrow {
    width: 38px;
    height: 38px;
    font-size: 14px;
  }
  .date-slider-cards {
    gap: 8px;
    margin: 0 8px;
  }
  .date-slider-card {
    height: 75px;
    border-radius: 12px;
  }
  .date-slider-card .weekday {
    font-size: 11px;
    margin-bottom: 4px;
  }
  .date-slider-card .date-val {
    font-size: 13px;
  }
  .date-slider-card.active::after {
    bottom: 6px;
    width: 20px;
    height: 3px;
  }
}

.date-slider-wrapper {
  position: relative;
  display: inline-block;
  direction: rtl;
  user-select: none;
  z-index: 50;
}

.date-slider-trigger {
  background: #6c63ff;
  color: #ffffff !important;
  border: none;
  border-radius: 12px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(108, 99, 255, 0.2);
  outline: none;
}

.date-slider-trigger:hover {
  background: #5a52d5;
  box-shadow: 0 6px 16px rgba(108, 99, 255, 0.3);
}

.date-slider-trigger span {
  color: #ffffff !important;
  font-weight: bold;
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: 6px;
  margin: 0 2px;
  display: inline-block;
}

.date-slider-trigger::after {
  content: "▾";
  font-size: 12px;
  margin-inline-start: 4px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.date-slider-wrapper.active .date-slider-trigger::after {
  transform: rotate(180deg);
}

.date-slider-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: -8rem;
  width: 440px;
  max-width: 92vw;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
  padding: 18px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px) scale(0.94);
  transform-origin: top right;
  transition: opacity 0.28s ease,
    transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), visibility 0.28s;
  z-index: 100;
}

.date-slider-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.date-slider-dropdown .date-slider-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  max-width: 100%;
  margin: 0;
  user-select: none;
  direction: rtl;
}

.date-slider-dropdown .date-slider-arrow {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #1e293b;
  font-size: 16px;
  text-decoration: none;
  outline: none;
  flex-shrink: 0;
}

.date-slider-dropdown .date-slider-arrow:hover {
  transform: scale(1.08);
  color: #6c63ff;
  background: #eef2ff;
}

.date-slider-dropdown .date-slider-arrow:active {
  transform: scale(0.92);
}

.date-slider-dropdown .date-slider-cards {
  display: flex;
  gap: 10px;
  flex: 1;
  justify-content: center;
  margin: 0 10px;
}

.date-slider-dropdown .date-slider-card {
  flex: 1;
  max-width: 105px;
  height: 75px;
  border-radius: 14px;
  background: #ffffff;
  border: 2px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-decoration: none;
  color: #334155;
  position: relative;
  outline: none;
}

.date-slider-dropdown .date-slider-card.not-today {
  opacity: 0.5;
  background: #f8f9fa;
  border-color: #e9ecef;
  cursor: not-allowed;
}
.date-slider-dropdown .date-slider-card.not-today .weekday {
  color: #adb5bd;
}
.date-slider-dropdown .date-slider-card.not-today .date-val {
  color: #adb5bd;
}
.date-slider-dropdown .date-slider-card.not-today:hover {
  border-color: #e9ecef;
  transform: none;
}

.date-slider-dropdown .date-slider-card.today {
  border-color: #28a745;
  box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.15);
}
.date-slider-dropdown .date-slider-card.today::before {
  content: "📍";
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 10px;
}

.date-slider-dropdown .date-slider-card .weekday {
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 5px;
  font-weight: 500;
}

.date-slider-dropdown .date-slider-card .date-val {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.date-slider-dropdown .date-slider-card:not(.active):hover {
  border-color: #cbd5e1;
  transform: translateY(-2px);
}

.date-slider-dropdown .date-slider-card.active {
  background: linear-gradient(135deg, #6c63ff, #3b82f6);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(108, 99, 255, 0.25);
  transform: scale(1.05);
  z-index: 2;
}

.date-slider-dropdown .date-slider-card.active .weekday {
  color: rgba(255, 255, 255, 0.9);
}

.date-slider-cards-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.date-slider-footer {
  display: flex;
  justify-content: center;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
}

.date-slider-footer .confirm-btn {
  background: linear-gradient(135deg, #6c63ff, #3b82f6);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 11px 34px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(108, 99, 255, 0.25);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.25s ease;
  outline: none;
}

.date-slider-footer .confirm-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(108, 99, 255, 0.35);
}

.date-slider-footer .confirm-btn:active {
  transform: translateY(0);
}

@media (max-width: 480px) {
  .date-slider-dropdown {
    width: 340px;
    max-width: 92vw;
    right: 0;
    transform-origin: top left;
    padding: 14px;
  }
  .date-slider-dropdown .date-slider-arrow {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
  .date-slider-dropdown .date-slider-cards {
    gap: 6px;
    margin: 0 6px;
  }
  .date-slider-dropdown .date-slider-card {
    height: 66px;
    max-width: 90px;
    border-radius: 12px;
  }
  .date-slider-dropdown .date-slider-card .weekday {
    font-size: 10px;
    margin-bottom: 3px;
  }
  .date-slider-dropdown .date-slider-card .date-val {
    font-size: 12px;
  }
  .date-slider-footer .confirm-btn {
    padding: 10px 26px;
    font-size: 14px;
  }
}

.form-guideline-banner {
  background: #fffdf5;
  border-right: 4px solid #f39c12;
  border-left: 1px solid #fef0db;
  border-top: 1px solid #fef0db;
  border-bottom: 1px solid #fef0db;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 12px;
  color: #b27300;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.6;
}

.form-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 15px;
  flex-wrap: wrap;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 15px;
}

.form-header-bar h3 {
  margin-bottom: 0 !important;
  border-bottom: none !important;
  padding-bottom: 0 !important;
}

.form-actions-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.form-actions-toolbar .btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.form-actions-toolbar .btn-group .btn {
  margin-bottom: 0 !important;
  padding: 8px 16px;
  font-size: 13px;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .form-header-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .date-slider-wrapper {
    margin: 5px 0;
  }
  .form-actions-toolbar {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .form-actions-toolbar .btn-group {
    flex-direction: column;
  }
  .form-actions-toolbar .btn-group .btn {
    width: 100%;
  }
}

.stat-card,
.attendance-item {
  background: #ffffff;
  border-radius: 20px !important;
  padding: 24px !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.02) !important;
  border: 1px solid #f1f5f9 !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  text-decoration: none !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.stat-card:hover,
.attendance-item:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 15px 35px rgba(108, 99, 255, 0.08) !important;
  background: #fafbfc !important;
}

.stat-card::before,
.attendance-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  transition: height 0.3s ease;
}

.stat-card.blue::before {
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
}
.stat-card.green::before,
.attendance-item.present::before {
  background: linear-gradient(90deg, #10b981, #059669);
}
.stat-card.orange::before,
.attendance-item.late::before {
  background: linear-gradient(90deg, #f59e0b, #d97706);
}
.stat-card.purple::before {
  background: linear-gradient(90deg, #8b5cf6, #6366f1);
}
.stat-card.red::before {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}
.attendance-item.absent::before {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}

.stat-card:hover::before,
.attendance-item:hover::before {
  height: 6px;
}

.stat-card .icon,
.attendance-item .icon {
  font-size: 38px !important;
  margin-bottom: 12px !important;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.stat-card:hover .icon,
.attendance-item:hover .icon {
  transform: scale(1.2) rotate(6deg);
}

.stat-card .number,
.attendance-item .number {
  font-size: 36px !important;
  font-weight: 800 !important;
  color: #1e293b !important;
  line-height: 1.2;
  margin-bottom: 6px;
}

.stat-card .label,
.attendance-item .label {
  font-size: 13px !important;
  color: #64748b !important;
  font-weight: 600 !important;
  letter-spacing: 0.2px;
}

.dashboard-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
  margin-top: 15px;
}

.dashboard-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  padding: 12px 18px;
  transition: all 0.25s ease;
  text-decoration: none !important;
}

.dashboard-list-item:hover {
  background: #ffffff;
  border-color: #6c63ff;
  transform: translateX(-5px);
  box-shadow: 0 4px 15px rgba(108, 99, 255, 0.05);
}

.dashboard-list-item .user-details {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dashboard-list-item .user-avatar-mini {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #eef2ff;
  color: #6c63ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
}

.dashboard-list-item .user-name {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
}

.dashboard-list-item .meta-badge {
  font-size: 12px;
  font-weight: bold;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.meta-badge.national-code {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.meta-badge.role-teacher {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.meta-badge.role-assistant {
  background: #e0e7ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
}

.stat-card .bi,
.attendance-item .bi {
  font-size: 38px !important;
  margin-bottom: 12px !important;
  display: inline-block;
  color: #64748b;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.3s ease !important;
}

.stat-card.blue:hover .bi {
  color: #3b82f6 !important;
  transform: scale(1.18) rotate(5deg);
}
.stat-card.green:hover .bi,
.attendance-item.present:hover .bi {
  color: #10b981 !important;
  transform: scale(1.18) rotate(5deg);
}
.stat-card.orange:hover .bi,
.attendance-item.late:hover .bi {
  color: #f59e0b !important;
  transform: scale(1.18) rotate(5deg);
}
.stat-card.purple:hover .bi {
  color: #8b5cf6 !important;
  transform: scale(1.18) rotate(5deg);
}
.attendance-item.absent:hover .bi {
  color: #ef4444 !important;
  transform: scale(1.18) rotate(5deg);
}

.sidebar a .bi {
  vertical-align: middle;
  margin-left: 12px;
  font-size: 18px !important;
  transition: transform 0.3s ease;
  display: inline-block;
}

.sidebar a:hover .bi,
.sidebar a.active .bi {
  transform: scale(1.12);
}

.bi {
  line-height: 1;
}
h1 .bi,
h2 .bi,
h3 .bi,
h4 .bi,
.btn .bi,
.breadcrumb .bi,
.badge .bi,
.user-info .bi,
.step .bi,
.exam-section h4 .bi,
.form-guideline-banner .bi,
label .bi {
  margin-left: 6px;
  vertical-align: -0.06em;
  display: inline-block;
}

.class-card .icon .bi,
.subject-card .icon .bi,
.exam-card .icon .bi,
.empty-state .icon .bi,
.icon > .bi {
  font-size: 34px;
  display: inline-block;
  line-height: 1;
}
.empty-state .icon .bi {
  font-size: 46px;
  color: #cbd5e1;
}

.user-avatar-mini .bi {
  font-size: 18px;
  display: inline-block;
}

.bi-check-circle-fill,
.bi-check-circle,
.bi-check-lg {
  color: #10b981;
}
.bi-x-circle-fill,
.bi-x-circle,
.bi-exclamation-octagon-fill {
  color: #ef4444;
}
.bi-exclamation-triangle-fill,
.bi-exclamation-triangle {
  color: #f59e0b;
}
.bi-info-circle-fill,
.bi-info-circle,
.bi-lightbulb-fill {
  color: #3b82f6;
}

.alert .bi {
  margin-left: 6px;
  vertical-align: -0.06em;
}

.auto-save-status .bi {
  margin-left: 5px;
  vertical-align: -0.06em;
}

.sidebar .logo {
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  font-size: 15px !important;
  font-weight: bold;
  padding-bottom: 30px;
  border-bottom: 1px solid rgba(255, 0, 0, 0.1);
  margin-bottom: 20px;
}

.sidebar .logo .sidebar-logo-img {
  width: 128px !important;
  height: 128px !important;
  object-fit: contain;
  border-radius: 2rem;
  padding: 0px;
  border: 3px solid transparent;
  background: linear-gradient(
      -45deg,
      #eb2525,
      #06b6d4,
      #011941,
      #000000,
      #ee2222
    )
    border-box;
  background-size: 400% 400%;
  animation: gradientMove 12s ease infinite;
  background-clip: border-box;
}

@keyframes gradientMove {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}
.sidebar .logo span {
  color: #ffffff !important;
  font-weight: bold;
  letter-spacing: 0.5px;
  background: transparent !important;
}

.sidebar .logo span.title {
  font-family: "SidebarFont";
  font-size: 15px;
  font-weight: bold;
  color: #ffffff;
  display: inline-block;
  vertical-align: middle;
  margin-right: 5px;
  letter-spacing: 10px;
  word-spacing: 15px;
}

.sidebar .logo span.title2 {
  font-family: "IRANSansX";
  font-size: 15px;
  font-weight: bold;
  color: red;
  display: inline-block;
  vertical-align: middle;
  margin-right: 5px;
  letter-spacing: 10px;
  word-spacing: 15px;
}

@media (max-width: 768px) {
  .sidebar .logo {
    padding-bottom: 15px;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .sidebar .logo .sidebar-logo-img {
    width: 76px !important;
    height: 76px !important;
    border-radius: 12px !important;
    border-width: 2px !important;
  }

  .sidebar .logo small {
    display: none;
  }
}

@media (max-width: 768px) {

  .stats-row[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .row {
    flex-direction: column;
    gap: 15px;
  }
  .row .card {
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
  }

  .license-stat {
    padding: 16px 12px;
  }
  .license-stat .value {
    font-size: 15px;
  }

  .card > div[style*="flex"] {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 10px;
  }

  .license-input,
  input[type="file"] {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .card {
    padding: 18px 16px;
  }
}

@media (max-width: 992px) and (min-width: 769px) {
  .stats-row[style*="grid-template-columns"] {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 12px !important;
  }
  .row {
    flex-direction: column;
  }
  .row .card {
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
  }
}

#toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: calc(100vw - 32px);
  width: 100%;
}

.toast {
  position: relative;
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  min-width: 280px;
  max-width: 480px;
  width: 100%;
  box-sizing: border-box;

  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.12),
    0 4px 12px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);

  animation: toast-slide-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  opacity: 0;
  transform: translateY(60px) scale(0.95);
}

.toast:last-child {
  margin-bottom: 0;
}

html[dir="rtl"] .toast {
  flex-direction: row-reverse;
}

.toast-success {
  border-right: 4px solid #10b981;
}
.toast-error {
  border-right: 4px solid #ef4444;
}
.toast-warning {
  border-right: 4px solid #f59e0b;
}
.toast-info {
  border-right: 4px solid #3b82f6;
}

html[dir="rtl"] .toast-success { border-right: 4px solid #10b981; border-left: none; }
html[dir="rtl"] .toast-error { border-right: 4px solid #ef4444; border-left: none; }
html[dir="rtl"] .toast-warning { border-right: 4px solid #f59e0b; border-left: none; }
html[dir="rtl"] .toast-info { border-right: 4px solid #3b82f6; border-left: none; }

.toast-icon {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 14px;
}
.toast-success .toast-icon { background: rgba(16, 185, 129, 0.15); color: #059669; }
.toast-error .toast-icon { background: rgba(239, 68, 68, 0.15); color: #dc2626; }
.toast-warning .toast-icon { background: rgba(245, 158, 11, 0.15); color: #d97706; }
.toast-info .toast-icon { background: rgba(59, 130, 246, 0.15); color: #2563eb; }

.toast-icon i {
  display: block;
}

.toast-content {
  flex: 1;
  min-width: 0;
}
.toast-message {
  font-family: "IRANSansX", "Tahoma", sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: #1e293b;
  word-break: break-word;
}

.toast-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.15s ease;
  padding: 0;
  margin-left: -4px;
}
html[dir="rtl"] .toast-close {
  margin-left: 0;
  margin-right: -4px;
}
.toast-close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #475569;
}
.toast-close i {
  font-size: 16px;
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 0 0 14px 14px;
  background: currentColor;
  opacity: 0.6;
  transform-origin: left center;
  animation: toast-progress linear forwards;
}
.toast-success .toast-progress { color: #10b981; }
.toast-error .toast-progress { color: #ef4444; }
.toast-warning .toast-progress { color: #f59e0b; }
.toast-info .toast-progress { color: #3b82f6; }

.toast.hiding {
  animation: toast-slide-out 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
}
.toast.hiding .toast-progress {
  animation: none !important;
}

@keyframes toast-slide-in {
  0% {
    opacity: 0;
    transform: translateY(60px) scale(0.95);
  }
  60% {
    transform: translateY(-4px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-slide-out {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
}

@keyframes toast-progress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .toast {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
  .toast.hiding {
    animation: none !important;
    display: none;
  }
  .toast-progress {
    animation: none !important;
    display: none;
  }
}

@media (max-width: 480px) {
  #toast-container {
    bottom: 16px;
    left: 12px;
    right: 12px;
    transform: none;
    max-width: none;
  }
  .toast {
    min-width: 0;
    max-width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
  }
  .toast-message {
    font-size: 13px;
  }
  .toast-icon {
    width: 24px;
    height: 24px;
    font-size: 13px;
  }
  .toast-close {
    width: 26px;
    height: 26px;
  }
}

:root {
    --scrollbar-track: #0d1117;
    --scrollbar-thumb-hover: #00ffff;
    --scrollbar-thumb-glow: rgba(0, 212, 255, 0.6);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 10px;
    border: 2px solid var(--scrollbar-track);
    box-shadow:
        0 0 10px var(--scrollbar-thumb-glow),
        0 0 20px var(--scrollbar-thumb-glow),
        inset 0 0 10px rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
    box-shadow:
        0 0 15px var(--scrollbar-thumb-glow),
        0 0 30px var(--scrollbar-thumb-glow),
        inset 0 0 15px rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

::-webkit-scrollbar-thumb:active {
    background: #fff;
    box-shadow:
        0 0 20px var(--scrollbar-thumb-glow),
        0 0 40px var(--scrollbar-thumb-glow),
        inset 0 0 20px rgba(255, 255, 255, 0.4);
}

::-webkit-scrollbar-corner {
    background: var(--scrollbar-track);
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 10px;
    border: none;
    box-shadow:
        0 0 8px var(--scrollbar-thumb-glow),
        0 0 16px var(--scrollbar-thumb-glow);
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
    box-shadow:
        0 0 12px var(--scrollbar-thumb-glow),
        0 0 24px var(--scrollbar-thumb-glow);
    width: 8px;
}

html {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

.sidebar {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) transparent;
}

.table-wrapper.responsive td[data-label*="ارزشیابی"],
table.responsive td[data-label*="ارزشیابی"] {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

.table-wrapper.responsive td[data-label*="ارزشیابی"]::before,
table.responsive td[data-label*="ارزشیابی"]::before {
    margin-bottom: 4px;
    align-self: flex-start;
}

@media (max-width: 992px) {
  .sidebar-toggle {
    display: flex !important;
  }
  .sidebar {
    width: 280px !important;
    max-width: 85vw !important;
    right: 0 !important;
    transform: translateX(100%) !important;
    transition: transform 0.3s ease !important;
    z-index: 1002 !important;
  }
  .sidebar.open {
    transform: translateX(0) !important;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.4) !important;
  }
  .sidebar-close {
    display: flex !important;
  }
  .sidebar-overlay.active {
    display: block !important;
  }
  .main {
    margin-right: 0 !important;
    width: 100% !important;
    padding: 75px 15px 25px 15px !important;
  }
}