* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Tajawal', sans-serif;
  background-color: #FAFAFA;
  color: #1E1E1E;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  direction: rtl;
  text-align: right;
}

.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 107px 40px 107px;
  min-height: 100vh;
  position: relative;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 40px 107px;
  /* background-color: #FFFFFF; */
  margin-bottom: 40px;
  /* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); */
}

.logo-container {
  display: flex;
  justify-content: flex-end;
}

.main-logo {
  height: 117px;
  width: auto;
}

.school-logo {
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.school-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.welcome-message {
  text-align: center;
  margin-bottom: 32px;
}

.welcome-message h1 {
  font-size: 31px;
  font-weight: 700;
  line-height: 1.2;
  color: #1E1E1E;
  max-width: 922px;
  margin: 0 auto;
}

.student-form {
  margin-bottom: 16px;
}

.form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 16px;
  align-items: flex-end;
}

.form-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.form-row .form-group {
  width: 395px;
}

.form-group.full-width {
  width: 100%;
  margin-bottom: 16px;
}

.form-group label {
  font-size: 16px;
  font-weight: 500;
  color: #1E1E1E;
  text-align: right;
  display: block;
  width: 100%;
  margin-bottom: 8px;
  font-weight: 500;
  color: #1E1E1E;
  text-align: right;
  direction: rtl;
}

.input-container,
.select-container {
  width: 100%;
  height: 59px;
  background-color: #FFFFFF;
  border-radius: 8px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  border: 1px solid #E5E5E5;
}

.input-container input,
.select-container select {
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-family: 'Tajawal', sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: #1E1E1E;
  text-align: right;
  padding-right: 8px;
}

.input-container input::placeholder,
.select-container select option:first-child {
  color: #939393;
}

.select-container select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  color: #939393;
}

.select-container select:focus,
.select-container select:valid {
  color: #1E1E1E;
}

.dropdown-arrow {
  position: absolute;
  left: 8px;
  width: 16px;
  height: 8px;
  pointer-events: none;
}

.search-button {
  width: 500px;
  height: 48px;
  background-color: #04273F;
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  font-family: 'Tajawal', sans-serif;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin: 0 auto;
  display: block;
  transition: background-color 0.3s ease;
}

.search-button:hover {
  background-color: #062840;
}

.cards-container {
  display: flex;
  gap: 20px;
  margin-bottom: 301px;
  justify-content: stretch;
}

.card {
  flex: 1;
  max-width: 291.25px;
  height: 104px;
  background-color: #FFFFFF;
  border: 1px solid #B1BCC3;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.card-content {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-direction: row-reverse;
}

.card-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.card-text {
  font-size: 16px;
  font-weight: 500;
  color: #1E1E1E;
  text-align: center;
}

.footer {
  position: absolute;
  /* bottom: 44px; */
  right: 107px;
}

.footer p {
  font-size: 20px;
  line-height: 24px;
  color: #04273F;
  text-align: center;
}

/* Responsive design */
@media (max-width: 1200px) {
  .header {
    padding: 30px 50px;
  }
  
  .container {
    padding: 0 50px 40px 50px;
  }
  
  .form-row {
    flex-direction: column;
    gap: 16px;
  }
  
  .form-row .form-group {
    width: 100%;
  }
  
  .cards-container {
    flex-wrap: wrap;
  }
  
  .card {
    max-width: calc(50% - 10px);
  }
  
  .footer {
    right: 50px;
  }
}

@media (max-width: 768px) {
  .header {
    padding: 20px;
    flex-direction: column;
    gap: 20px;
    align-items: center;
  }
  
  .school-logo {
    width: 60px;
    height: 60px;
  }
  
  .main-logo {
    height: 80px;
  }
  
  .logo-container {
    justify-content: center;
  }
  
  .container {
    padding: 0 20px 40px 20px;
  }
  
  .welcome-message h1 {
    font-size: 24px;
  }
  
  .search-button {
    width: 100%;
  }
  
  .cards-container {
    flex-direction: column;
  }
  
  .card {
    max-width: 100%;
  }
  
  .footer {
    position: static;
    text-align: center;
    margin-top: 40px;
  }
}

/* Teacher form styles */
.teacher-form {
  margin-bottom: 32px;
}

.form-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
}

.add-teacher-button {
  width: 500px;
  height: 48px;
  background-color: #04273F;
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  font-family: 'Tajawal', sans-serif;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.add-teacher-button:hover {
  background-color: #062840;
}

.upload-excel-button {
  height: 48px;
  padding: 0 24px;
  background-color: #FFFFFF;
  color: #1E1E1E;
  border: 1px solid #E5E5E5;
  border-radius: 8px;
  font-family: 'Tajawal', sans-serif;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.upload-excel-button:hover {
  background-color: #F5F5F5;
  border-color: #B1BCC3;
}

/* Teachers table styles */
.table-container {
  width: 100%;
  background-color: #FFFFFF;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 100px;
  border: 1px solid #E5E5E5;
}

.teachers-table {
  width: 100%;
  border-collapse: collapse;
}

.teachers-table thead {
  background-color: #F5F5F5;
}

.teachers-table th {
  padding: 16px;
  text-align: right;
  font-size: 16px;
  font-weight: 700;
  color: #1E1E1E;
  border-bottom: 1px solid #E5E5E5;
}

.teachers-table td {
  padding: 16px;
  text-align: right;
  font-size: 16px;
  font-weight: 400;
  color: #1E1E1E;
  border-bottom: 1px solid #E5E5E5;
}

.teachers-table tbody tr:last-child td {
  border-bottom: none;
}

.teachers-table tbody tr:hover {
  background-color: #FAFAFA;
}

.table-select {
  height: 40px;
  min-width: 150px;
}

.table-select-field {
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-family: 'Tajawal', sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: #1E1E1E;
  text-align: right;
  padding-right: 8px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  color: #939393;
}

.table-select-field:focus,
.table-select-field:valid {
  color: #1E1E1E;
}

.teacher-name {
  font-weight: 500;
}

.username-cell,
.password-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  direction: rtl;
}

.user-icon,
.eye-icon {
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Responsive design for teacher page */
@media (max-width: 1200px) {
  .form-buttons {
    flex-direction: column;
    align-items: stretch;
  }
  
  .add-teacher-button,
  .upload-excel-button {
    width: 100%;
  }
  
  .table-container {
    overflow-x: auto;
  }
  
  .teachers-table {
    min-width: 800px;
  }
}

@media (max-width: 768px) {
  .form-row {
    flex-direction: column;
  }
  
  .form-row .form-group {
    width: 100%;
  }
  
  .table-container {
    margin-bottom: 60px;
  }
}

/* Add Student form styles */
.add-student-button {
  height: 59px;
  padding: 0 32px;
  background-color: #04273F;
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  font-family: 'Tajawal', sans-serif;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.3s ease;
  white-space: nowrap;
  align-self: flex-end;
}

.add-student-button:hover {
  background-color: #062840;
}

/* Students table styles */
.students-table {
  width: 100%;
  border-collapse: collapse;
}

.students-table thead {
  background-color: #F5F5F5;
}

.students-table th {
  padding: 16px;
  text-align: right;
  font-size: 16px;
  font-weight: 700;
  color: #1E1E1E;
  border-bottom: 1px solid #E5E5E5;
}

.students-table td {
  padding: 16px;
  text-align: right;
  font-size: 16px;
  font-weight: 400;
  color: #1E1E1E;
  border-bottom: 1px solid #E5E5E5;
}

.students-table tbody tr:last-child td {
  border-bottom: none;
}

.students-table tbody tr:hover {
  background-color: #FAFAFA;
}

.student-name {
  font-weight: 500;
}

.student-class,
.student-section,
.student-average {
  font-weight: 400;
}

/* Responsive design for add student page */
@media (max-width: 1200px) {
  .form-row {
    flex-wrap: wrap;
  }
  
  .add-student-button {
    width: 100%;
    margin-top: 16px;
  }
  
  .table-container {
    overflow-x: auto;
  }
  
  .students-table {
    min-width: 600px;
  }
}

@media (max-width: 768px) {
  .add-student-button {
    width: 100%;
    margin-top: 16px;
  }
  
  .form-buttons {
    margin-top: 16px;
  }
}

/* Parent/Student Page Styles */
.parent-page {
  background-color: #04273F;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.parent-header {
  background-color: #04273F;
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.parent-header-left {
  flex: 1;
}

.parent-page-title {
  color: #FFFFFF;
  font-size: 20px;
  font-weight: 700;
  text-transform: uppercase;
}

.parent-header-right {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

.menu-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 5px;
}

.menu-toggle span {
  width: 25px;
  height: 3px;
  background-color: #FFFFFF;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.parent-container {
  flex: 1;
  padding: 40px 20px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.parent-content-wrapper {
  background-color: #FFFFFF;
  border-radius: 16px;
  padding: 40px;
  max-width: 1200px;
  width: 100%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.parent-logos {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.parent-logo-container {
  flex: 1;
}

.parent-main-logo {
  height: 117px;
  width: auto;
}

.parent-school-logo {
  width: 76px;
  height: 76px;
}

.parent-school-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.parent-welcome-message {
  text-align: center;
  margin-bottom: 32px;
}

.parent-welcome-message h1 {
  font-size: 31px;
  font-weight: 700;
  line-height: 1.2;
  color: #1E1E1E;
  max-width: 922px;
  margin: 0 auto;
}

.parent-student-form {
  margin-bottom: 32px;
}

.parent-form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 16px;
  align-items: flex-end;
}

.parent-form-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.parent-form-row .parent-form-group {
  flex: 1;
}

.parent-form-group.parent-full-width {
  width: 100%;
  margin-bottom: 16px;
}

.parent-form-group label {
  font-size: 16px;
  font-weight: 500;
  color: #1E1E1E;
  text-align: right;
}
.classes-sections-container{
  width: 100%;
}
.parent-input-container,
.parent-select-container {
  width: 100%;
  height: 59px;
  background-color: #F5F5F5;
  border-radius: 8px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  border: 1px solid #E5E5E5;
}

.parent-input-container input,
.parent-select-container select {
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-family: 'Tajawal', sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: #1E1E1E;
  text-align: right;
  padding-right: 8px;
}

.parent-input-container input::placeholder,
.parent-select-container select option:first-child {
  color: #939393;
}

.parent-select-container select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  color: #939393;
}

.parent-select-container select:focus,
.parent-select-container select:valid {
  color: #1E1E1E;
}

.parent-dropdown-arrow {
  position: absolute;
  left: 8px;
  width: 16px;
  height: 8px;
  pointer-events: none;
}

.parent-search-button {
  width: 500px;
  height: 48px;
  background-color: #04273F;
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  font-family: 'Tajawal', sans-serif;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin: 0 auto;
  display: block;
  transition: background-color 0.3s ease;
}

.parent-search-button:hover {
  background-color: #062840;
}

.parent-cards-container {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  justify-content: stretch;
}

.parent-card {
  flex: 1;
  max-width: 291.25px;
  height: 104px;
  background-color: #FFFFFF;
  border: 1px solid #B1BCC3;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.parent-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.parent-card-content {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-direction: row-reverse;
}

.parent-card-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.parent-card-text {
  font-size: 16px;
  font-weight: 500;
  color: #1E1E1E;
  text-align: center;
}

.parent-footer {
  background-color: #04273F;
  padding: 20px 40px;
  text-align: right;
}

.parent-footer p {
  font-size: 20px;
  line-height: 24px;
  color: #FFFFFF;
  margin: 0;
}

/* Responsive design for parent page */
@media (max-width: 1200px) {
  .parent-content-wrapper {
    padding: 30px;
  }
  
  .parent-form-row {
    flex-direction: column;
    gap: 16px;
  }
  
  .parent-form-row .parent-form-group {
    width: 100%;
  }
  
  .parent-cards-container {
    flex-wrap: wrap;
  }
  
  .parent-card {
    max-width: calc(50% - 10px);
  }
  
  .parent-search-button {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .parent-header {
    padding: 15px 20px;
  }
  
  .parent-container {
    padding: 20px 10px;
  }
  
  .parent-content-wrapper {
    padding: 20px;
    border-radius: 12px;
  }
  
  .parent-welcome-message h1 {
    font-size: 24px;
  }
  
  .parent-logos {
    flex-direction: column;
    gap: 20px;
    align-items: center;
  }
  
  .parent-main-logo {
    height: 80px;
  }
  
  .parent-cards-container {
    flex-direction: column;
  }
  
  .parent-card {
    max-width: 100%;
  }
  
  .parent-footer {
    padding: 15px 20px;
  }
  
  .parent-footer p {
    font-size: 16px;
  }
}

/* Login Page Styles */
.login-page {
  background: linear-gradient(135deg, #04273F 0%, #062840 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-container {
  width: 100%;
  max-width: 500px;
}

.login-card {
  background-color: #FFFFFF;
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.login-logo-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid #E5E5E5;
}

.login-logo-container {
  flex: 1;
}

.login-main-logo {
  height: 80px;
  width: auto;
}

.login-school-logo {
  width: 60px;
  height: 60px;
}

.login-school-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.login-welcome {
  text-align: center;
  margin-bottom: 32px;
}

.login-welcome h1 {
  font-size: 28px;
  font-weight: 700;
  color: #04273F;
  margin-bottom: 8px;
}

.login-welcome p {
  font-size: 16px;
  font-weight: 400;
  color: #666666;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-form-group label {
  font-size: 16px;
  font-weight: 500;
  color: #1E1E1E;
  text-align: right;
}

.login-input-container {
  position: relative;
  width: 100%;
  height: 59px;
  background-color: #F5F5F5;
  border-radius: 8px;
  border: 1px solid #E5E5E5;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 8px;
  transition: border-color 0.3s ease;
}

.login-input-container:focus-within {
  border-color: #04273F;
  background-color: #FFFFFF;
}

.login-input-container input {
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-family: 'Tajawal', sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: #1E1E1E;
  text-align: right;
  padding-right: 8px;
  padding-left: 40px;
}

.login-input-container input::placeholder {
  color: #939393;
}

.password-toggle {
  position: absolute;
  left: 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle .eye-icon {
  font-size: 20px;
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.password-toggle:hover .eye-icon {
  opacity: 1;
}

.login-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #666666;
}

.remember-me input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #04273F;
}

.forgot-password {
  font-size: 14px;
  color: #04273F;
  text-decoration: none;
  transition: color 0.3s ease;
}

.forgot-password:hover {
  color: #062840;
  text-decoration: underline;
}

.login-button {
  width: 100%;
  height: 48px;
  background-color: #04273F;
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  font-family: 'Tajawal', sans-serif;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  transition: background-color 0.3s ease;
}

.login-button:hover {
  background-color: #062840;
}

.login-button:active {
  transform: scale(0.98);
}

.login-footer {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #E5E5E5;
  text-align: center;
}

.login-footer p {
  font-size: 14px;
  color: #666666;
  margin: 0;
}

/* Parent Login Page Specific Styles */
.parent-login-page {
  background: linear-gradient(135deg, #04273F 0%, #062840 100%);
}

.parent-login-card {
  background-color: #FFFFFF;
}

/* Responsive design for login pages */
@media (max-width: 768px) {
  .login-card {
    padding: 30px 20px;
    border-radius: 12px;
  }

  .login-logo-section {
    flex-direction: column;
    gap: 20px;
    align-items: center;
  }

  .login-main-logo {
    height: 60px;
  }

  .login-school-logo {
    width: 50px;
    height: 50px;
  }

  .login-welcome h1 {
    font-size: 24px;
  }

  .login-welcome p {
    font-size: 14px;
  }

  .login-options {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
}

/* Admin Pages Styles */
.admin-nav {
  display: flex;
  gap: 20px;
  margin-bottom: 32px;
  padding: 16px;
  background-color: #FFFFFF;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-link {
  padding: 12px 24px;
  background-color: #04273F;
  color: #FFFFFF;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.nav-link:hover {
  background-color: #062840;
}

.admin-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.admin-page-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: #1E1E1E;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-family: 'Tajawal', sans-serif;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.3s ease;
}

.btn-primary {
  background-color: #04273F;
  color: #FFFFFF;
}

.btn-primary:hover {
  background-color: #062840;
}

.btn-secondary {
  background-color: #6c757d;
  color: #FFFFFF;
}

.btn-secondary:hover {
  background-color: #5a6268;
}

.btn-success {
  background-color: #28a745;
  color: #FFFFFF;
}

.btn-success:hover {
  background-color: #218838;
}

.btn-danger {
  background-color: #dc3545;
  color: #FFFFFF;
}

.btn-danger:hover {
  background-color: #c82333;
}

.btn-warning {
  background-color: #ffc107;
  color: #1E1E1E;
}

.btn-warning:hover {
  background-color: #e0a800;
}

.btn-info {
  background-color: #17a2b8;
  color: #FFFFFF;
}

.btn-info:hover {
  background-color: #138496;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 14px;
}

.alert {
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 24px;
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-danger {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.alert-danger ul {
  margin: 0;
  padding-right: 20px;
}

/* Select2 Custom Styles */
.select2-container--bootstrap-5 .select2-selection {
  min-height: 59px;
  border: 1px solid #E5E5E5;
  border-radius: 8px;
  background-color: #F5F5F5;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
  line-height: 59px;
  padding-right: 8px;
  color: #1E1E1E;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow {
  height: 57px;
  left: 8px;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__placeholder {
  color: #939393;
}

.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5.select2-container--open .select2-selection {
  border-color: #04273F;
  background-color: #FFFFFF;
}

.select2-dropdown {
  border: 1px solid #E5E5E5;
  border-radius: 8px;
}

.select2-results__option {
  padding: 8px 12px;
  text-align: right;
}

.select2-results__option--highlighted {
  background-color: #04273F;
  color: #FFFFFF;
}

.admin-form {
  background-color: #FFFFFF;
  padding: 32px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  direction: rtl;
  text-align: right;
}

.admin-form .form-group {
  margin-bottom: 24px;
}

.admin-form label {
  display: block;
  width: 100%;
  margin-bottom: 8px;
  font-weight: 500;
  color: #1E1E1E;
  text-align: right;
  direction: rtl;
}

.form-control {
  width: 100%;
  padding: 12px;
  border: 1px solid #E5E5E5;
  border-radius: 8px;
  font-family: 'Tajawal', sans-serif;
  font-size: 16px;
  transition: border-color 0.3s ease;
  text-align: right;
  direction: rtl;
}

.form-control:focus {
  outline: none;
  border-color: #04273F;
}

.subject-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  align-items: flex-end;
  direction: rtl;
  flex-direction: row-reverse;
}

.subject-row select {
  flex: 1;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background-color: #FFFFFF;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.admin-table thead {
  background-color: #04273F;
}

.admin-table th {
  padding: 16px;
  text-align: right;
  color: #FFFFFF;
  font-weight: 700;
}

.admin-table td {
  padding: 16px;
  text-align: right;
  border-bottom: 1px solid #E5E5E5;
}

.admin-table tbody tr:hover {
  background-color: #F5F5F5;
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  background-color: #E5E5E5;
  border-radius: 4px;
  font-size: 12px;
  margin: 2px;
}

.text-center {
  text-align: center;
}

.pagination {
  margin-top: 24px;
  display: flex;
  justify-content: center;
}

/* Responsive design for admin pages */
@media (max-width: 768px) {
  .admin-page-header {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }
  
  .admin-nav {
    flex-direction: column;
  }
  
  .subject-row {
    flex-direction: column;
  }
  
  .admin-table {
    font-size: 14px;
  }
  
  .admin-table th,
  .admin-table td {
    padding: 8px;
  }
}

/* Teacher Dashboard Styles */
.teacher-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.info-card {
  background-color: #FFFFFF;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.info-card h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  color: #04273F;
}

.subjects-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.subject-item {
  padding: 8px;
  background-color: #F5F5F5;
  border-radius: 4px;
}

.recent-grades {
  margin-top: 32px;
}

.recent-grades h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 16px;
  color: #1E1E1E;
}

.students-list h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
  color: #1E1E1E;
}

.student-card {
  cursor: pointer;
  min-height: 150px;
}

.student-card h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #04273F;
}

.student-card p {
  margin: 4px 0;
  color: #666666;
}

.grades-section {
  margin-top: 32px;
}

.grades-section h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
  color: #1E1E1E;
}

.subject-grades {
  margin-bottom: 32px;
  background-color: #FFFFFF;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.subject-grades h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  color: #04273F;
}

.subject-average {
  margin-top: 16px;
  padding: 12px;
  background-color: #F5F5F5;
  border-radius: 4px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: #04273F;
}

.alert-info {
  background-color: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
  padding: 16px;
  border-radius: 8px;
  margin: 24px 0;
}

/* Teacher Cards Styles */
.teacher-cards-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.teacher-card {
  background-color: #FFFFFF;
  border: 1px solid #B1BCC3;
  border-radius: 16px;
  padding: 20px;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.3s ease;
  width: 100%;
}

.grades-cards-row .teacher-card {
  width: 100%;
  min-width: 0;
}

.teacher-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.clickable-card {
  cursor: pointer;
}

.editable-card {
  cursor: default;
}

.card-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  position: relative;
  padding: 8px;
}

.card-main-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.card-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}

.card-text {
  font-size: 16px;
  font-weight: 500;
  color: #1E1E1E;
  text-align: right;
  flex: 1;
}

.card-content-vertical .card-header .card-text {
  text-align: right;
  flex: 1;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-input {
  width: 80px;
  padding: 8px;
  border: 1px solid #E5E5E5;
  border-radius: 4px;
  text-align: center;
  font-size: 16px;
  font-weight: 500;
}

/* Grades Cards Row - 3 cards in one row, each taking col-4 (1/3 of width) */
.grades-cards-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 30px;
  width: 100%;
}

.grades-cards-row .teacher-card {
  width: 100%;
  min-width: 0;
  flex: 1 1 calc(33.333% - 14px);
}

.card-content-vertical {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 100%;
  padding: 16px;
  position: relative;
}

.card-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: flex-start;
}

.card-icon-small {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}

.card-input-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.card-input-small {
  width: 100%;
  max-width: 120px;
  padding: 10px;
  border: 1px solid #E5E5E5;
  border-radius: 8px;
  background-color: #FFFFFF;
  text-align: center;
  font-size: 16px;
  font-weight: 500;
}

.card-input-small[readonly],
.notes-textarea[readonly] {
  background-color: #F5F5F5;
  cursor: not-allowed;
  opacity: 0.8;
}

.save-btn-small {
  padding: 6px 12px;
  background-color: #28a745;
  color: #FFFFFF;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  flex: 0 0 auto;
  height: fit-content;
}

.save-btn-small:hover {
  background-color: #218838;
}

.card-edit-icon-bottom {
  position: absolute;
  bottom: 8px;
  left: 8px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.card-edit-icon-bottom:hover {
  opacity: 1;
}

.card-edit-icon-img-small {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.save-btn {
  padding: 6px 12px;
  background-color: #28a745;
  color: #FFFFFF;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.save-btn:hover {
  background-color: #218838;
}

.save-btn:active {
  transform: scale(0.95);
}

.card-edit-icon {
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.3s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-edit-icon:hover {
  opacity: 1;
}

.card-edit-icon-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* Notes Section */
.notes-section {
  position: relative;
  margin-bottom: 24px;
}

.notes-section label {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 500;
  color: #1E1E1E;
}

.notes-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notes-textarea {
  width: 100%;
  min-height: 120px;
  padding: 16px;
  border: 1px solid #E5E5E5;
  border-radius: 8px;
  font-family: 'Tajawal', sans-serif;
  font-size: 16px;
  resize: vertical;
}

.notes-wrapper .save-btn {
  align-self: flex-end;
}

.notes-edit-icon {
  position: absolute;
  bottom: 16px;
  left: 16px;
  font-size: 18px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.notes-edit-icon:hover {
  opacity: 1;
}

/* Download Section */
.download-section {
  margin-bottom: 32px;
  display: flex;
  justify-content: flex-end;
}

.download-excel-button {
  padding: 12px 24px;
  background-color: #E3F2FD;
  color: #04273F;
  border: 1px solid #04273F;
  border-radius: 8px;
  font-family: 'Tajawal', sans-serif;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.download-excel-button:hover {
  background-color: #BBDEFB;
}

/* Students Table Styles */
.students-table {
  width: 100%;
  border-collapse: collapse;
  background-color: #FFFFFF;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.students-table thead {
  background-color: #F5F5F5;
}

.students-table th {
  padding: 16px;
  text-align: right;
  font-size: 16px;
  font-weight: 700;
  color: #1E1E1E;
  border-bottom: 1px solid #E5E5E5;
}

.students-table td {
  padding: 16px;
  text-align: right;
  font-size: 16px;
  font-weight: 400;
  color: #1E1E1E;
  border-bottom: 1px solid #E5E5E5;
}

.students-table tbody tr:nth-child(even) {
  background-color: #FAFAFA;
}

.students-table tbody tr:hover {
  background-color: #F0F0F0;
}

.students-table tbody tr.selected {
  background-color: #E3F2FD !important;
  border: 2px solid #04273F;
}

.students-table tbody tr:last-child td {
  border-bottom: none;
}

.student-name {
  font-weight: 500;
}

/* Responsive design for teacher page */
@media (max-width: 1200px) {
  .teacher-cards-container {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .card-content {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .card-main-content {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 768px) {
  .teacher-cards-container {
    grid-template-columns: 1fr;
  }
  
  .grades-cards-row {
    grid-template-columns: 1fr;
  }
  
  .download-section {
    justify-content: center;
  }
  
  .students-table {
    font-size: 14px;
  }
  
  .students-table th,
  .students-table td {
    padding: 8px;
  }
}
