@import url("https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800;900&family=Amiri:wght@400;700&display=swap");

:root {
  --navy: #1b2a4a;
  --navy-light: #2a3d66;
  --navy-dark: #111d35;

  --gold: #c5961a;
  --gold-light: #d4ad3a;
  --gold-lighter: #e8cf7a;
  --gold-bg: #f5e6b8;
  --gold-subtle: #fdf6e3;

  --teal: #1a5c5e;
  --teal-light: #247577;
  --teal-dark: #134546;

  --cream: #fbf7f0;
  --cream-dark: #f0e8d8;
  --white: #ffffff;
  --gray-100: #f7f5f2;
  --gray-200: #e8e4dd;
  --gray-300: #d4cfc5;
  --gray-400: #a09a8e;
  --gray-500: #7a7468;
  --gray-600: #5a5449;
  --gray-700: #3a352d;
  --text-primary: #2a2520;
  --text-secondary: #5a5449;

  --status-paid: #27ae60;
  --status-partial: #f39c12;
  --status-late: #e74c3c;

  --shadow-sm: 0 2px 8px rgba(27, 42, 74, 0.08);
  --shadow-md: 0 4px 16px rgba(27, 42, 74, 0.12);
  --shadow-lg: 0 8px 32px rgba(27, 42, 74, 0.16);
  --shadow-gold: 0 4px 16px rgba(197, 150, 26, 0.25);
  --shadow-teal: 0 4px 16px rgba(26, 92, 94, 0.25);

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 50px;
  --radius-full: 50%;

  --max-width: 100%;
  --content-max-width: 800px;
  --header-height: 70px;
  --nav-height: 56px;
}

[data-theme="dark"] {
  --navy: #0f1a2e;
  --navy-light: #1b2a4a;
  --navy-dark: #0a1220;
  --cream: #1a1a2e;
  --cream-dark: #16162a;
  --white: #ffffff;
  --gray-100: #1e1e36;
  --gray-200: #2a2a45;
  --gray-300: #3a3a55;
  --gray-400: #6a6a80;
  --gray-500: #9a9ab0;
  --gray-600: #bbbbd0;
  --gray-700: #dddde8;
  --text-primary: #eeeef5;
  --text-secondary: #bbbbd0;
  --gold-bg: #2a2520;
  --gold-subtle: #1f1d18;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .islamic-pattern {
  opacity: 0.03;
}

[data-theme="dark"] .mandala-overlay {
  opacity: 0.02;
}

[data-theme="dark"] .form-input {
  background: var(--gray-100);
  color: var(--text-primary);
  border-color: var(--gray-300);
}

[data-theme="dark"] .form-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(197, 150, 26, 0.1);
}

[data-theme="dark"] .form-input::placeholder {
  color: var(--gray-400);
}

[data-theme="dark"] .level-card {
  background: var(--gray-100);
  border-color: var(--gray-300);
}

[data-theme="dark"] .level-card:hover {
  border-color: var(--gold);
  background: var(--gray-200);
}

[data-theme="dark"] .fees-section,
[data-theme="dark"] .fees-table {
  background: var(--gray-100);
  border-color: var(--gray-300);
}

[data-theme="dark"] .fees-header {
  background: var(--gold-bg);
}

[data-theme="dark"] .semester-tabs,
[data-theme="dark"] .header-logo,
[data-theme="dark"] .toast {
  background: var(--gray-200);
}

[data-theme="dark"] .fees-table th {
  background: var(--gray-200);
  border-color: var(--gray-300);
}

[data-theme="dark"] .fees-table td {
  border-color: var(--gray-200);
}

[data-theme="dark"] .fees-table tbody tr:hover {
  background: var(--gray-200);
}

[data-theme="dark"] .fees-totals {
  background: var(--gold-bg);
  border-color: var(--gray-300);
}

[data-theme="dark"] .invoice-container {
  background: var(--gray-100);
  border-color: var(--gray-300);
}

[data-theme="dark"] .payment-method {
  background: var(--gray-100);
  border-color: var(--gray-300);
}

[data-theme="dark"] .payment-method:hover {
  border-color: var(--gold);
}

[data-theme="dark"] .social-btn {
  background: var(--gray-100);
  border-color: var(--gray-300);
}

[data-theme="dark"] .btn-outline {
  background: var(--gray-100);
  border-color: var(--gray-300);
  color: var(--text-secondary);
}

[data-theme="dark"] .add-student-btn {
  border-color: var(--gray-300);
  color: var(--gold);
}

[data-theme="dark"] .profile-card {
  background: var(--gold-bg);
}

[data-theme="dark"] .form-input.readonly {
  background: var(--gray-200);
  border-color: var(--gray-300);
  color: var(--gray-500);
}

[data-theme="dark"] .download-btn {
  background: var(--gray-100);
  border-color: var(--gray-300);
  color: var(--text-secondary);
}

[data-theme="dark"] .welcome-title,
[data-theme="dark"] .thankyou-text,
[data-theme="dark"] .thankyou-slogan {
  color: var(--text-primary) !important;
}

[data-theme="dark"] .welcome-slogan {
  color: var(--gold-lighter) !important;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: "Tajawal", "Segoe UI", Tahoma, sans-serif;
  background: var(--cream);
  color: var(--text-primary);
  direction: rtl;
  text-align: right;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.islamic-pattern {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'%3E%3Cdefs%3E%3Cstyle%3E.a%7Bfill:none;stroke:%23C5961A;stroke-width:1.2%7D%3C/style%3E%3C/defs%3E%3Ccircle class='a' cx='100' cy='100' r='80'/%3E%3Ccircle class='a' cx='100' cy='100' r='60'/%3E%3Ccircle class='a' cx='100' cy='100' r='40'/%3E%3Ccircle class='a' cx='100' cy='100' r='20'/%3E%3Cpath class='a' d='M100 20 L100 180'/%3E%3Cpath class='a' d='M20 100 L180 100'/%3E%3Cpath class='a' d='M43.4 43.4 L156.6 156.6'/%3E%3Cpath class='a' d='M156.6 43.4 L43.4 156.6'/%3E%3Cpath class='a' d='M100 20 L156.6 43.4 L180 100 L156.6 156.6 L100 180 L43.4 156.6 L20 100 L43.4 43.4 Z'/%3E%3Cpath class='a' d='M100 40 L140 60 L160 100 L140 140 L100 160 L60 140 L40 100 L60 60 Z'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

.mandala-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 350px;
  height: 350px;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 400'%3E%3Cdefs%3E%3Cstyle%3E.b%7Bfill:none;stroke:%23C5961A;stroke-width:1%7D%3C/style%3E%3C/defs%3E%3Ccircle class='b' cx='200' cy='200' r='190'/%3E%3Ccircle class='b' cx='200' cy='200' r='160'/%3E%3Ccircle class='b' cx='200' cy='200' r='130'/%3E%3Ccircle class='b' cx='200' cy='200' r='100'/%3E%3Ccircle class='b' cx='200' cy='200' r='70'/%3E%3Ccircle class='b' cx='200' cy='200' r='40'/%3E%3Cpath class='b' d='M200 10 L200 390 M10 200 L390 200'/%3E%3Cpath class='b' d='M65 65 L335 335 M335 65 L65 335'/%3E%3Cpath class='b' d='M200 10 L270 65 L335 135 L390 200 L335 270 L270 335 L200 390 L130 335 L65 270 L10 200 L65 130 L130 65 Z'/%3E%3Cpath class='b' d='M200 40 L253 65 L306 100 L340 153 L360 200 L340 253 L306 306 L253 340 L200 360 L147 340 L94 306 L60 253 L40 200 L60 147 L94 94 L147 60 Z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  animation: rotateMandala 120s linear infinite;
}

@keyframes rotateMandala {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

#app {
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--cream);
  overflow: hidden;
  z-index: 1;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--navy);
  overflow: hidden;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: var(--header-height);
  position: relative;
}

.header-top::before,
.header-top::after {
  content: "";
  position: absolute;
  top: 0;
  width: 100px;
  height: 45px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
}

.header-top::before {
  right: 0;
  border-radius: 0 0 0 40px;
}

.header-top::after {
  left: 0;
  border-radius: 0 0 40px 0;
}

.header-title {
  font-family: "Amiri", serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--white);
  z-index: 2;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.header-logo {
  width: 56px;
  height: 56px;
  background: var(--white);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.header-logo svg {
  width: 48px;
  height: 48px;
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  height: var(--nav-height);
  background: var(--navy-dark);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-bar .nav-right,
.nav-bar .nav-left {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-btn {
  background: none;
  border: none;
  color: var(--gold-lighter);
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 1.2rem;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  transform: scale(1.1);
}

.nav-btn:active {
  transform: scale(0.95);
}

.nav-btn.active {
  color: var(--white);
  background: rgba(197, 150, 26, 0.2);
}

.nav-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.page {
  display: none;
  padding: 32px 40px 40px;
  max-width: var(--content-max-width);
  margin: 0 auto;
  min-height: calc(100vh - var(--header-height) - var(--nav-height));
  min-height: calc(100dvh - var(--header-height) - var(--nav-height));
  position: relative;
  animation: pageSlideIn var(--transition-normal) ease-out;
}

.page.active {
  display: block;
}

@keyframes pageSlideIn {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pageSlideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(30px);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.page-title-bar {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  margin: -24px -20px 24px -20px;
  padding: 20px 24px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.page-title-bar::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--gold);
  border-radius: 2px;
}

.page-title {
  font-family: "Tajawal", sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--white);
  text-align: center;
}

.page-title.green {
  color: #27ae60;
}

.form-group {
  margin-bottom: 20px;
  animation: fadeIn var(--transition-normal) ease-out;
  animation-fill-mode: both;
}

.form-group:nth-child(1) {
  animation-delay: 0.05s;
}
.form-group:nth-child(2) {
  animation-delay: 0.1s;
}
.form-group:nth-child(3) {
  animation-delay: 0.15s;
}
.form-group:nth-child(4) {
  animation-delay: 0.2s;
}
.form-group:nth-child(5) {
  animation-delay: 0.25s;
}

.form-label {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 8px;
  padding-right: 4px;
}

.form-input {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--teal);
  border-radius: var(--radius-pill);
  background: var(--white);
  font-family: "Tajawal", sans-serif;
  font-size: 1rem;
  color: var(--text-primary);
  direction: rtl;
  text-align: right;
  transition: all var(--transition-fast);
  outline: none;
}

.form-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(197, 150, 26, 0.15);
}

.form-input::placeholder {
  color: var(--gray-400);
  font-size: 0.9rem;
}

.form-input.small {
  max-width: 48%;
  display: inline-block;
}

.form-row {
  display: flex;
  gap: 12px;
  direction: rtl;
}

.form-row .form-group {
  flex: 1;
}

.form-input.readonly {
  background: var(--gray-100);
  border-color: var(--gray-300);
  color: var(--gray-500);
  cursor: default;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border: none;
  border-radius: var(--radius-pill);
  font-family: "Tajawal", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  transform: translate(-50%, -50%);
  transition:
    width 0.6s,
    height 0.6s;
}

.btn:active::after {
  width: 300px;
  height: 300px;
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  color: var(--white);
  box-shadow: var(--shadow-gold);
}

.btn-gold:hover {
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(197, 150, 26, 0.35);
}

.btn-gold:active {
  transform: translateY(0);
}

.btn-teal {
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-light) 100%);
  color: var(--white);
  box-shadow: var(--shadow-teal);
}

.btn-teal:hover {
  background: linear-gradient(135deg, var(--teal-light) 0%, var(--teal) 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26, 92, 94, 0.35);
}

.btn-teal:active {
  transform: translateY(0);
}

.btn-navy {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: var(--white);
  box-shadow: var(--shadow-md);
}

.btn-navy:hover {
  background: linear-gradient(135deg, var(--navy-light) 0%, var(--navy) 100%);
  transform: translateY(-2px);
}

.btn-outline {
  background: var(--white);
  color: var(--gray-600);
  border: 2px solid var(--gray-300);
}

.btn-outline:hover {
  border-color: var(--gray-400);
  background: var(--gray-100);
  transform: translateY(-2px);
}

.btn-full {
  width: 100%;
}

.btn-sm {
  padding: 10px 20px;
  font-size: 0.95rem;
}

.btn-group {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.btn-group .btn {
  flex: 1;
}

.profile-card {
  background: linear-gradient(
    135deg,
    var(--gold-bg) 0%,
    var(--gold-subtle) 100%
  );
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  animation: scaleIn var(--transition-normal) ease-out;
  direction: rtl;
}

.profile-avatar {
  width: 52px;
  height: 52px;
  background: var(--white);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.profile-avatar svg {
  width: 28px;
  height: 28px;
  fill: var(--gray-400);
}

.profile-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.level-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: var(--white);
  border: 2px solid var(--teal);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  cursor: pointer;
  transition: all var(--transition-fast);
  direction: rtl;
  animation: fadeInUp var(--transition-normal) ease-out;
  animation-fill-mode: both;
}

.level-card:nth-child(1) {
  animation-delay: 0.05s;
}
.level-card:nth-child(2) {
  animation-delay: 0.12s;
}
.level-card:nth-child(3) {
  animation-delay: 0.19s;
}
.level-card:nth-child(4) {
  animation-delay: 0.26s;
}

.level-card:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  background: linear-gradient(135deg, var(--white) 0%, var(--gold-subtle) 100%);
}

.level-card:active {
  transform: translateY(0);
}

.level-card .level-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  flex-shrink: 0;
}

.level-card .level-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  flex: 1;
  text-align: center;
}

.radio-group {
  margin: 20px 0;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background var(--transition-fast);
  border-radius: var(--radius-md);
  direction: rtl;
  animation: fadeIn var(--transition-normal) ease-out;
  animation-fill-mode: both;
}

.radio-option:nth-child(1) {
  animation-delay: 0.05s;
}
.radio-option:nth-child(2) {
  animation-delay: 0.1s;
}
.radio-option:nth-child(3) {
  animation-delay: 0.15s;
}
.radio-option:nth-child(4) {
  animation-delay: 0.2s;
}
.radio-option:nth-child(5) {
  animation-delay: 0.25s;
}
.radio-option:nth-child(6) {
  animation-delay: 0.3s;
}

.radio-option:hover {
  background: var(--gold-subtle);
}

.radio-option input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-full);
  flex-shrink: 0;
  position: relative;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.radio-option input[type="radio"]:checked {
  border-color: var(--teal);
  background: var(--teal);
}

.radio-option input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background: var(--white);
  border-radius: var(--radius-full);
}

.radio-option .radio-label {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}

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

.radio-grid .radio-option {
  padding: 12px;
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 24px;
}

.action-buttons .btn {
  font-size: 1.1rem;
  padding: 15px 24px;
  animation: fadeInUp var(--transition-normal) ease-out;
  animation-fill-mode: both;
}

.action-buttons .btn:nth-child(1) {
  animation-delay: 0.1s;
}
.action-buttons .btn:nth-child(2) {
  animation-delay: 0.18s;
}
.action-buttons .btn:nth-child(3) {
  animation-delay: 0.26s;
}

.fees-section {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  margin-bottom: 24px;
  animation: scaleIn var(--transition-normal) ease-out;
}

.fees-header {
  background: var(--gold-bg);
  padding: 14px 20px;
  text-align: center;
}

.fees-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}

.semester-tabs {
  display: flex;
  gap: 0;
  padding: 12px 16px;
  background: var(--gray-100);
}

.semester-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius-pill);
  font-family: "Tajawal", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: transparent;
  color: var(--gray-500);
}

.semester-tab.active {
  background: var(--navy);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

.semester-tab:hover:not(.active) {
  background: var(--gray-200);
  color: var(--text-primary);
}

.fees-table {
  width: 100%;
  border-collapse: collapse;
}

.fees-table th {
  background: var(--gray-100);
  padding: 12px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gray-600);
  text-align: center;
  border-bottom: 1px solid var(--gray-200);
}

.fees-table td {
  padding: 12px 14px;
  text-align: center;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--gray-100);
  color: var(--text-primary);
  font-weight: 500;
}

.fees-table tr {
  transition: background var(--transition-fast);
}

.fees-table tbody tr:hover {
  background: var(--gold-subtle);
}

.status-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  margin-left: 4px;
}

.status-dot.paid {
  background: var(--status-paid);
}
.status-dot.partial {
  background: var(--status-partial);
}
.status-dot.late {
  background: var(--status-late);
}

.fees-totals {
  padding: 16px 20px;
  background: var(--gold-subtle);
  border-top: 2px solid var(--gold-bg);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.fees-total-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.fees-total-row.highlight {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--teal);
  padding-top: 10px;
  border-top: 1px dashed var(--gold);
  margin-top: 4px;
}

.status-legend {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin: 16px 0;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.payment-methods {
  display: flex;
  gap: 24px;
  justify-content: center;
  align-items: center;
  padding: 30px 0;
  animation: fadeInUp var(--transition-normal) ease-out;
}

.payment-method {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  min-width: 120px;
  background: var(--white);
}

.payment-method:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.payment-method.selected {
  border-color: var(--teal);
  background: linear-gradient(
    135deg,
    var(--white) 0%,
    rgba(26, 92, 94, 0.05) 100%
  );
  box-shadow: 0 0 0 3px rgba(26, 92, 94, 0.15);
}

.payment-method svg,
.payment-method .method-icon {
  width: 48px;
  height: 48px;
}

.payment-method span {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.payment-or {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-secondary);
}

.invoice-container {
  background: var(--white);
  border-radius: var(--radius-xl);
  border: 2px solid var(--gray-200);
  padding: 24px;
  min-height: 400px;
  animation: scaleIn var(--transition-normal) ease-out;
}

.invoice-header {
  text-align: center;
  padding-bottom: 16px;
  border-bottom: 2px dashed var(--gray-200);
  margin-bottom: 20px;
}

.invoice-header h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--gold);
}

.invoice-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.95rem;
}

.invoice-row .label {
  font-weight: 600;
  color: var(--text-secondary);
}

.invoice-row .value {
  font-weight: 700;
  color: var(--text-primary);
}

.invoice-total {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 2px solid var(--gold);
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--teal);
}

.invoice-actions {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 24px;
}

.invoice-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-600);
  font-size: 1.5rem;
  transition: all var(--transition-fast);
  padding: 12px;
  border-radius: var(--radius-full);
}

.invoice-action-btn:hover {
  color: var(--teal);
  background: rgba(26, 92, 94, 0.08);
  transform: scale(1.15);
}

.welcome-content {
  text-align: center;
  padding: 20px 0;
}

.welcome-logo {
  margin: 0 auto 20px;
  animation: scaleIn 0.6s ease-out;
}

.welcome-logo svg {
  width: 160px;
  height: 160px;
}

.welcome-title {
  font-family: "Amiri", serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
  animation: fadeIn 0.5s ease-out 0.2s both;
}

.welcome-description {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 8px;
  padding: 0 10px;
  animation: fadeIn 0.5s ease-out 0.3s both;
}

.welcome-slogan {
  font-family: "Amiri", serif;
  font-size: 1rem;
  color: var(--gold);
  margin-bottom: 32px;
  font-style: italic;
  animation: fadeIn 0.5s ease-out 0.4s both;
}

.welcome-buttons {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 10px;
}

.welcome-buttons .btn {
  font-size: 1.3rem;
  padding: 16px 32px;
  animation: fadeInUp 0.5s ease-out;
  animation-fill-mode: both;
}

.welcome-buttons .btn:nth-child(1) {
  animation-delay: 0.5s;
}
.welcome-buttons .btn:nth-child(2) {
  animation-delay: 0.65s;
}

.recovery-option {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.95rem;
  direction: rtl;
}

.recovery-option input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-full);
  flex-shrink: 0;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.recovery-option input[type="radio"]:checked {
  border-color: var(--teal);
  background: var(--teal);
}

.recovery-option input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 7px;
  height: 7px;
  background: var(--white);
  border-radius: var(--radius-full);
}

.social-divider {
  text-align: center;
  margin: 20px 0;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
}

.social-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}

.social-btn {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  border: 2px solid var(--gray-200);
  background: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.social-btn:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.social-btn svg {
  width: 30px;
  height: 30px;
}

.forgot-link {
  text-align: center;
  margin: 16px 0;
  font-size: 0.9rem;
}

.forgot-link span {
  color: var(--gold);
  font-weight: 600;
}

.forgot-link a {
  color: var(--teal);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.forgot-link a:hover {
  color: var(--gold);
  text-decoration: underline;
}

.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 20px;
  direction: rtl;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.checkbox-group input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-300);
  border-radius: 4px;
  flex-shrink: 0;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  margin-top: 2px;
}

.checkbox-group input[type="checkbox"]:checked {
  background: var(--teal);
  border-color: var(--teal);
}

.checkbox-group input[type="checkbox"]:checked::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
}

.thankyou-content {
  text-align: center;
  padding: 40px 16px;
  position: relative;
}

.thankyou-text {
  font-size: 1.25rem;
  line-height: 2;
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 30px;
  animation: fadeIn 0.6s ease-out;
}

.thankyou-slogan {
  font-size: 1.1rem;
  color: var(--teal);
  font-weight: 700;
  margin-bottom: 40px;
  animation: fadeIn 0.6s ease-out 0.2s both;
}

.thankyou-dots {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin: 16px 0 24px;
}

.thankyou-dots span {
  width: 6px;
  height: 6px;
  background: var(--gold);
  border-radius: var(--radius-full);
  animation: pulse 1.5s ease-in-out infinite;
}

.thankyou-dots span:nth-child(2) {
  animation-delay: 0.15s;
}
.thankyou-dots span:nth-child(3) {
  animation-delay: 0.3s;
}
.thankyou-dots span:nth-child(4) {
  animation-delay: 0.45s;
}
.thankyou-dots span:nth-child(5) {
  animation-delay: 0.6s;
}
.thankyou-dots span:nth-child(6) {
  animation-delay: 0.75s;
}
.thankyou-dots span:nth-child(7) {
  animation-delay: 0.9s;
}
.thankyou-dots span:nth-child(8) {
  animation-delay: 1.05s;
}

.contact-section {
  margin-top: 30px;
  animation: fadeInUp 0.6s ease-out 0.4s both;
}

.contact-section h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 16px;
}

.contact-icons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
}

.contact-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 1.4rem;
}

.contact-icon.whatsapp {
  background: #25d366;
  color: var(--white);
}

.contact-icon.email {
  background: var(--gray-200);
  color: var(--gray-600);
}

.contact-icon:hover {
  transform: scale(1.15);
  box-shadow: var(--shadow-md);
}

.contact-or {
  font-weight: 700;
  color: var(--text-secondary);
}

.separator {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
}

.separator .line {
  flex: 1;
  height: 2px;
  background: var(--gray-200);
}

.separator .text {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
}

.id-lookup {
  display: flex;
  gap: 12px;
  align-items: center;
  direction: rtl;
}

.id-lookup .form-input {
  flex: 1;
}

.id-lookup .btn {
  flex-shrink: 0;
}

.profile-actions {
  display: flex;
  gap: 12px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.profile-actions .btn {
  flex: 1;
  min-width: 120px;
  font-size: 0.9rem;
  padding: 10px 16px;
}

.add-student-btn {
  border: 2px dashed var(--teal);
  background: transparent;
  color: var(--teal);
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-pill);
  font-family: "Tajawal", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin: 16px 0;
}

.add-student-btn:hover {
  background: rgba(26, 92, 94, 0.06);
  border-color: var(--gold);
  color: var(--gold);
}

.payment-record-btn {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  color: var(--white);
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: var(--radius-pill);
  font-family: "Tajawal", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 20px;
  box-shadow: var(--shadow-gold);
  transition: all var(--transition-fast);
}

.payment-record-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(197, 150, 26, 0.35);
}

.download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 auto;
  padding: 10px 24px;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-pill);
  background: var(--white);
  color: var(--gray-600);
  font-family: "Tajawal", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: 16px;
}

.download-btn:hover {
  border-color: var(--teal);
  color: var(--teal);
  transform: translateY(-2px);
}

.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--navy);
  color: var(--white);
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  font-weight: 600;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 90%;
  text-align: center;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast.success {
  background: var(--status-paid);
}

.toast.error {
  background: var(--status-late);
}

.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-full);
  border-top-color: var(--white);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

::selection {
  background: var(--gold);
  color: var(--white);
}

.text-center {
  text-align: center;
}
.mt-8 {
  margin-top: 8px;
}
.mt-16 {
  margin-top: 16px;
}
.mt-24 {
  margin-top: 24px;
}
.mb-8 {
  margin-bottom: 8px;
}
.mb-16 {
  margin-bottom: 16px;
}
.mb-24 {
  margin-bottom: 24px;
}
.hidden {
  display: none !important;
}

@media (min-width: 768px) {
  .header-top {
    padding: 0 40px;
  }

  .header-top::before,
  .header-top::after {
    width: 160px;
    height: 50px;
  }

  .nav-bar {
    padding: 0 40px;
    gap: 8px;
  }

  .nav-btn {
    width: 48px;
    height: 48px;
  }

  .nav-btn svg {
    width: 24px;
    height: 24px;
  }

  .welcome-content {
    padding: 40px 0;
  }

  .welcome-buttons {
    flex-direction: row;
    gap: 20px;
  }

  .welcome-buttons .btn {
    flex: 1;
  }

  .level-card {
    padding: 24px 28px;
  }

  .level-card .level-icon {
    width: 64px;
    height: 64px;
    font-size: 2.5rem;
  }

  .level-card .level-name {
    font-size: 1.4rem;
  }

  .btn-group {
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
  }

  .form-group {
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 24px;
  }

  .form-input {
    padding: 16px 22px;
    font-size: 1.05rem;
  }

  .fees-section {
    border-radius: var(--radius-xl);
  }

  .payment-methods {
    gap: 40px;
    padding: 50px 0;
  }

  .payment-method {
    min-width: 180px;
    padding: 30px;
  }

  .profile-card {
    padding: 24px 28px;
  }

  .action-buttons {
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
  }

  .radio-group {
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
  }

  .invoice-container {
    padding: 32px;
  }

  .thankyou-content {
    padding: 60px 20px;
  }

  .social-buttons {
    gap: 24px;
  }

  .social-btn {
    width: 64px;
    height: 64px;
  }
}

@media (min-width: 1024px) {
  .header-top {
    padding: 0 60px;
  }

  .nav-bar {
    padding: 0 60px;
  }

  .page-title-bar {
    margin: -32px -40px 32px -40px;
    padding: 24px 40px;
  }
}

@media (max-width: 767px) {
  :root {
    --header-height: 64px;
    --nav-height: 50px;
    --content-max-width: 100%;
  }

  .page {
    padding: 20px 16px 28px;
  }

  .header-title {
    font-size: 1.5rem;
  }

  .header-logo {
    width: 48px;
    height: 48px;
  }

  .welcome-title {
    font-size: 1.8rem;
  }

  .page-title {
    font-size: 1.3rem;
  }

  .page-title-bar {
    margin: -20px -16px 20px -16px;
  }

  .level-card .level-name {
    font-size: 1.1rem;
  }

  .fees-table th,
  .fees-table td {
    padding: 10px 8px;
    font-size: 0.8rem;
  }
}

.settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 500;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.settings-overlay.open {
  opacity: 1;
  visibility: visible;
}

.settings-panel {
  position: fixed;
  top: 0;
  right: -380px;
  width: 380px;
  max-width: 90vw;
  height: 100%;
  background: var(--cream);
  z-index: 600;
  box-shadow: var(--shadow-lg);
  transition: right var(--transition-normal);
  overflow-y: auto;
  direction: rtl;
}

.settings-panel.open {
  right: 0;
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: var(--navy);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 2;
}

.settings-header h2 {
  font-size: 1.3rem;
  font-weight: 800;
}

.settings-close {
  background: none;
  border: none;
  color: var(--gold-lighter);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 1.5rem;
}

.settings-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.settings-body {
  padding: 24px;
}

.settings-section {
  margin-bottom: 28px;
}

.settings-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gray-200);
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--gray-100);
}

.setting-item:last-child {
  border-bottom: none;
}

.setting-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.setting-label span {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.setting-label small {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.toggle-switch {
  position: relative;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--gray-300);
  border-radius: 28px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.toggle-slider::before {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 22px;
  height: 22px;
  background: var(--white);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--teal);
}

.toggle-switch input:checked + .toggle-slider::before {
  right: calc(100% - 25px);
}

.setting-select {
  padding: 8px 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-pill);
  background: var(--white);
  font-family: "Tajawal", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  direction: rtl;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition-fast);
  appearance: none;
  -webkit-appearance: none;
  padding-left: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%235A5449'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
}

.setting-select:focus {
  border-color: var(--gold);
}

[data-theme="dark"] .settings-panel {
  background: var(--cream);
}

[data-theme="dark"] .setting-select {
  background-color: var(--gray-100);
  border-color: var(--gray-300);
  color: var(--text-primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%23BBBBD0'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
}

[data-theme="dark"] .toggle-slider {
  background: var(--gray-300);
}

[data-theme="dark"] .toggle-slider::before {
  background: var(--text-primary);
}

.settings-version {
  text-align: center;
  padding: 20px;
  color: var(--gray-400);
  font-size: 0.8rem;
}

.settings-version strong {
  color: var(--gold);
}

.settings-logout {
  width: 100%;
  padding: 14px;
  border: 2px solid var(--status-late);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--status-late);
  font-family: "Tajawal", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-top: 8px;
}

.settings-logout:hover {
  background: var(--status-late);
  color: var(--white);
}