/* ===== BASE STYLES ===== */

@font-face {
  font-family: IRANSansX;
  font-style: normal;
  font-weight: 100;
  src: url('../fonts/woff/IRANSansXFaNum-Thin.woff') format('woff'),
  url('../fonts/woff2/IRANSansXFaNum-Thin.woff2') format('woff2');
}

@font-face {
  font-family: IRANSansX;
  font-style: normal;
  font-weight: 200;
  src: url('../fonts/woff/IRANSansXFaNum-UltraLight.woff') format('woff'),
  url('../fonts/woff2/IRANSansXFaNum-UltraLight.woff2') format('woff2');
}

@font-face {
  font-family: IRANSansX;
  font-style: normal;
  font-weight: 300;
  src: url('../fonts/woff/IRANSansXFaNum-Light.woff') format('woff'),
  url('../fonts/woff2/IRANSansXFaNum-Light.woff2') format('woff2');
}

@font-face {
  font-family: IRANSansX;
  font-style: normal;
  font-weight: 500;
  src: url('../fonts/woff/IRANSansXFaNum-Medium.woff') format('woff'),
  url('../fonts/woff2/IRANSansXFaNum-Medium.woff2') format('woff2');
}

@font-face {
  font-family: IRANSansX;
  font-style: normal;
  font-weight: 600;
  src: url('../fonts/woff/IRANSansXFaNum-DemiBold.woff') format('woff'),
  url('../fonts/woff2/IRANSansXFaNum-DemiBold.woff2') format('woff2');
}

@font-face {
  font-family: IRANSansX;
  font-style: normal;
  font-weight: 800;
  src: url('../fonts/woff/IRANSansXFaNum-ExtraBold.woff') format('woff'),
  url('../fonts/woff2/IRANSansXFaNum-ExtraBold.woff2') format('woff2');
}

@font-face {
  font-family: IRANSansX;
  font-style: normal;
  font-weight: 900;
  src: url('../fonts/woff/IRANSansXFaNum-Black.woff') format('woff'),
  url('../fonts/woff2/IRANSansXFaNum-Black.woff2') format('woff2');
}

@font-face {
  font-family: IRANSansX;
  font-style: normal;
  font-weight: 950;
  src: url('../fonts/woff/IRANSansXFaNum-ExtraBlack.woff') format('woff'),
  url('../fonts/woff2/IRANSansXFaNum-ExtraBlack.woff2') format('woff2');
}

@font-face {
  font-family: IRANSansX;
  font-style: normal;
  font-weight: 1000;
  src: url('../fonts/woff/IRANSansXFaNum-Heavy.woff') format('woff'),
  url('../fonts/woff2/IRANSansXFaNum-Heavy.woff2') format('woff2');
}

@font-face {
  font-family: IRANSansX;
  font-style: normal;
  font-weight: bold;
  src: url('../fonts/woff/IRANSansXFaNum-Bold.woff') format('woff'),
  url('../fonts/woff2/IRANSansXFaNum-Bold.woff2') format('woff2');
}

@font-face {
  font-family: IRANSansX;
  font-style: normal;
  font-weight: normal;
  src: url('../fonts/woff/IRANSansXFaNum-Regular.woff') format('woff'),
  url('../fonts/woff2/IRANSansXFaNum-Regular.woff2') format('woff2');
}

#modal-message,#modal-title,#modal-buttons,#edit-btn,button {
  font-family: "IRANSansX", sans-serif;
}

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

:root {
  --background: #faf9f7;
  --foreground: #1a1625;
  --card: #ffffff;
  --card-foreground: #1f1a2e;
  --primary: #6b5b9a;
  --primary-foreground: #ffffff;
  --muted: #f2f0ed;
  --muted-foreground: #6b6280;
  --border: #e8e5e0;
  --destructive: #c44;
  --success: #4a9;
  --radius: 1rem;
}

body {
  font-family: "IRANSansX", sans-serif;
  background: #e8e4f0;
  color: var(--foreground);
  direction: rtl;
  line-height: 1.6;
}

/* ===== MOBILE CONTAINER ===== */
.mobile-container {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  background: #fcfbfa;
  position: relative;
  box-shadow: 0 0 60px rgba(107, 91, 154, 0.08);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

/* ===== HEADER ===== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 1);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-logo-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  justify-content: center;
}

.header-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.header-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--foreground);
  margin: 0;
}

.header-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s;
}

.header-back:hover {
  background: var(--muted);
}

.header-back svg {
  width: 20px;
  height: 20px;
  color: var(--muted-foreground);
}

.header-debt-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s;
  color: var(--muted-foreground);
}

.header-debt-btn:hover {
  background: var(--muted);
}

.header-debt-btn svg {
  width: 20px;
  height: 20px;
}

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  background: rgba(255, 255, 255, 1);
  border-top: 1px solid var(--border);
  padding: 0.5rem 1rem;
  padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0));
  z-index: 50;
}

.bottom-nav-inner {
  display: flex;
  justify-content: space-around;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 1rem;
  text-decoration: none;
  color: var(--muted-foreground);
  border-radius: 12px;
  transition: all 0.2s;
}

.nav-item:hover,
.nav-item.active {
  color: var(--primary);
  background: rgba(107, 91, 154, 0.1);
}

.nav-item svg {
  width: 22px;
  height: 22px;
}

.nav-item span {
  font-size: 10px;
  font-weight: 500;
}

.nav-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.nav-icon-wrapper svg {
  width: 22px;
  height: 22px;
  display: block;
}

.nav-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background-color: #ef4444;
  border-radius: 8px;
  border: 2px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1;
  white-space: nowrap;
}

/* ===== PAGE CONTENT ===== */
.page-content {
  padding: 1.25rem;
  padding-bottom: 100px;
}

.page-content > *:not(:last-child) {
  margin-bottom: 1rem;
}

/* ===== CARDS ===== */
.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1rem;
  border: 1px solid #e9e9e9;
}

.card-highlight {
  background: rgba(107, 91, 154, 0.05);
  border-color: rgba(107, 91, 154, 0.15);
}

/* ===== STAT CARD ===== */
.stat-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(107, 91, 154, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
}

.stat-content {
  flex: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--muted-foreground);
}

.stat-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--foreground);
  margin-top: 2px;
}

.stat-value.primary {
  color: var(--primary);
}

/* ===== GRID ===== */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

/* ===== SECTION TITLE ===== */
.section-title {
  font-size: 12px;
  color: var(--muted-foreground);
  padding: 0 0.25rem;
  margin-bottom: 0.75rem;
}

/* ===== LIST ITEM ===== */
.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s;
  cursor: pointer;
}

.list-item:active {
  transform: scale(0.98);
}

.list-item-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.list-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(107, 91, 154, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.list-item-icon svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
}

.list-item-text h4 {
  font-size: 15px;
  font-weight: 500;
  color: var(--foreground);
}

.list-item-text p {
  font-size: 12px;
  color: var(--muted-foreground);
  margin-top: 2px;
}

.list-item-arrow {
  color: rgba(107, 91, 154, 0.3);
}

.list-item-arrow svg {
  width: 20px;
  height: 20px;
}

/* Skyroom classes - video/streaming accent */
#skyroom-classes-section {
  margin-top: 1.5rem;
}
.skyroom-class-item .skyroom-icon {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(99, 102, 241, 0.1));
}
.skyroom-class-item .skyroom-icon svg {
  color: #3b82f6;
}
.skyroom-class-item:hover {
  border-color: rgba(59, 130, 246, 0.3);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-outline {
  background: var(--muted);
  color: var(--foreground);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  background: rgba(107, 91, 154, 0.05);
}

.btn-outline.active {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

.btn-danger {
  background: rgba(204, 68, 68, 0.05);
  color: var(--destructive);
  border: 1px solid rgba(204, 68, 68, 0.1);
}

.btn-danger:hover {
  background: rgba(204, 68, 68, 0.1);
}

.btn-full {
  width: 100%;
}

/* ===== INPUTS ===== */
.input {
  width: 100%;
  height: 44px;
  padding: 0 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(242, 240, 237, 0.5);
  font-size: 14px;
  font-family: inherit;
  color: var(--foreground);
  transition: border-color 0.2s;
}

.input:focus {
  outline: none;
  border-color: var(--primary);
}

.input:disabled {
  background: rgba(242, 240, 237, 0.3);
  color: var(--muted-foreground);
}

.input-center {
  text-align: center;
}

.input-ltr {
  direction: ltr;
}

.input-otp {
  font-size: 24px;
  letter-spacing: 0.75em;
  font-family: monospace;
}

/* ===== FORM GROUPS ===== */
.form-group {
  margin-bottom: 0.75rem;
}

.form-label {
  display: block;
  font-size: 11px;
  color: var(--muted-foreground);
  margin-bottom: 0.25rem;
}

/* ===== SELECT ===== */
.select-wrapper {
  position: relative;
}

.select-btn {
  width: 100%;
  height: 44px;
  padding: 0 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(242, 240, 237, 0.5);
  font-size: 14px;
  font-family: inherit;
  color: var(--foreground);
  text-align: right;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.select-btn:disabled {
  background: rgba(242, 240, 237, 0.3);
  color: var(--muted-foreground);
  cursor: not-allowed;
}

.select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  z-index: 10;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  display: none;
}

.select-dropdown.show {
  display: block;
}

.select-option {
  width: 100%;
  padding: 0.625rem 1rem;
  text-align: right;
  border: none;
  background: none;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.select-option:hover {
  background: var(--muted);
}

/* ===== BADGE ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 500;
}

.badge-primary {
  background: rgba(107, 91, 154, 0.1);
  color: var(--primary);
}

.badge-success {
  background: rgba(68, 170, 153, 0.1);
  color: var(--success);
}

/* ===== LOGIN PAGE ===== */
body[data-page="login"] {
  overflow: hidden;
  height: 100vh;
}

body[data-page="login"] .mobile-container {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.login-page {
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

.login-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 320px;
  margin: 0 auto;
  width: 100%;
  min-height: 0;
  flex-shrink: 0;
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo-icon {
  width: 84px;
  height: 84px;
  border-radius: 50px;
  margin: 0 auto 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.login-logo-icon .school-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50px;
}

.login-logo-icon span {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  display: none;
}

.login-logo h1 {
  font-size: 18px;
  font-weight: 600;
  color: var(--foreground);
  margin: 0;
}

.login-logo p {
  font-size: 13px;
  color: var(--muted-foreground);
  margin-top: 0.25rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-info {
  text-align: center;
  padding: 0.75rem;
  background: rgba(242, 240, 237, 0.5);
  border-radius: 10px;
  margin-bottom: 0.25rem;
}

.login-info p {
  font-size: 13px;
  color: var(--muted-foreground);
  margin: 0;
}

.login-info strong {
  display: inline;
  font-weight: 600;
  color: var(--foreground);
  direction: ltr;
  margin: 0 0.25rem;
}

.login-hint {
  font-size: 12px;
  color: var(--muted-foreground);
  text-align: center;
  margin-top: 0.5rem;
}

.error-text {
  font-size: 14px;
  color: var(--destructive);
  text-align: center;
}

.btn-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  text-decoration: underline;
  font-family: inherit;
  font-size: inherit;
  color: var(--primary);
  transition: opacity 0.2s;
}

.btn-link:hover {
  opacity: 0.8;
}

.btn-link:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== WELCOME CARD ===== */
.welcome-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(107, 91, 154, 0.05);
  border: 1px solid rgba(107, 91, 154, 0.1);
  border-radius: 16px;
}

.welcome-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: rgba(107, 91, 154, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.welcome-icon svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
}

.welcome-text p:first-child {
  font-size: 14px;
  color: var(--muted-foreground);
}

.welcome-text p:last-child {
  font-weight: 600;
  color: var(--foreground);
}

/* ===== MESSAGE CARD ===== */
.message-card {
  padding: 1rem;
  border-radius: 16px;
  background: rgba(107, 91, 154, 0.05);
  border: 1px solid rgba(107, 91, 154, 0.1);
  cursor: pointer;
  transition: transform 0.15s;
}

.message-card:active {
  transform: scale(0.98);
}

.message-card h4 {
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground);
}

.message-card p {
  font-size: 12px;
  color: var(--muted-foreground);
  margin-top: 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== FOOD CARD ===== */
.food-card {
  padding: 1rem;
}

.food-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.food-day {
  font-weight: 500;
  color: var(--foreground);
}

.food-date {
  font-size: 12px;
  color: var(--muted-foreground);
  margin-top: 2px;
}

.food-name {
  font-size: 14px;
  color: rgba(26, 22, 37, 0.8);
  margin-bottom: 0.75rem;
}

.food-options {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.food-option {
  flex: 0 0 auto;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 400;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(242, 240, 237, 0.5);
  color: var(--foreground);
  border: 1px solid var(--border);
}

.food-option:hover {
  background: var(--muted);
}

.food-option.active {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

.food-option .price {
  font-size: 12px;
  opacity: 0.7;
}

/* ===== TUITION CARD ===== */
.tuition-card {
  padding: 1rem;
}

.tuition-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.tuition-title {
  font-weight: 500;
  color: var(--foreground);
}

.tuition-due {
  font-size: 12px;
  color: var(--muted-foreground);
  margin-top: 2px;
}

.tuition-amount {
  font-weight: 600;
  color: var(--primary);
}

.tuition-paid {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tuition-paid-info h4 {
  font-weight: 500;
  color: var(--foreground);
}

.tuition-paid-info p {
  font-size: 12px;
  color: var(--primary);
  margin-top: 2px;
}

.tuition-paid-amount {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary);
}

.tuition-paid-amount span {
  font-size: 14px;
  font-weight: 500;
}

.tuition-paid-amount svg {
  width: 16px;
  height: 16px;
}

/* ===== MESSAGE ITEM ===== */
.message-item {
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.2s;
  background: var(--card);
  border: 1px solid var(--border);
}

.message-item.unread {
  background: rgba(107, 91, 154, 0.05);
  border-color: rgba(107, 91, 154, 0.15);
}

.message-header {
  width: 100%;
  padding: 1rem;
  text-align: right;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.2s;
}

.message-header:hover {
  background-color: rgba(107, 91, 154, 0.03);
}

.message-header:active {
  background-color: rgba(107, 91, 154, 0.05);
}

.message-header-content {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.message-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.message-icon.unread {
  background: var(--primary);
}

.message-icon.unread svg {
  color: var(--primary-foreground);
  stroke: var(--primary-foreground);
}

.message-icon.read {
  background: var(--muted);
}

.message-icon.read svg {
  color: var(--primary);
  stroke: var(--primary);
}

.message-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
  display: block;
}

.message-meta {
  flex: 1;
  min-width: 0;
}

.message-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.message-title-row h4 {
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-title-row svg {
  width: 16px;
  height: 16px;
  color: rgba(107, 91, 154, 0.3);
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.message-item.expanded .message-title-row svg {
  transform: rotate(180deg);
}

.message-sender {
  font-size: 12px;
  color: var(--muted-foreground);
  margin-top: 0.25rem;
}

.message-date {
  font-size: 10px;
  color: rgba(107, 91, 154, 0.4);
  margin-top: 2px;
}

.message-body {
  margin-right: 48px;
  max-height: 0;
  overflow: hidden;
  padding: 0 1rem;
  transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}

.message-body:not(.hidden) {
  max-height: 2000px;
  padding: 0 1rem 1rem 1rem;
}

.message-body.hidden {
  max-height: 0;
  padding: 0 1rem;
  display: block;
}

.message-body p {
  font-size: 14px;
  color: var(--muted-foreground);
  line-height: 1.7;
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.message-body p:not(:last-child) {
  margin-bottom: 0.5rem;
}

.message-content {
  font-size: 14px;
  color: var(--muted-foreground);
  line-height: 1.7;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.message-content p {
  margin: 0 0 0.5rem 0;
}

.message-content p:last-child {
  margin-bottom: 0;
}

/* ===== PROFILE PAGE ===== */
.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem;
}

.profile-avatar {
  position: relative;
  margin-bottom: 1rem;
}

.profile-avatar-img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 2px solid var(--border);
}

.profile-avatar-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar-img svg {
  width: 40px;
  height: 40px;
  color: rgba(107, 91, 154, 0.3);
}

.profile-upload-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.profile-upload-btn svg {
  width: 16px;
  height: 16px;
  color: var(--primary-foreground);
}

.profile-name {
  font-weight: 600;
  color: var(--foreground);
}

.profile-phone {
  font-size: 14px;
  color: var(--muted-foreground);
}

.profile-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.profile-form-header h3 {
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground);
}

.profile-form-header button {
  font-size: 12px;
  color: var(--primary);
  font-weight: 500;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.profile-form-header button svg {
  width: 12px;
  height: 12px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
}

.empty-state svg {
  width: 40px;
  height: 40px;
  color: rgba(107, 91, 154, 0.2);
  margin: 0 auto 0.75rem;
}

.empty-state p {
  font-size: 14px;
  color: var(--muted-foreground);
}

/* ===== UTILITIES ===== */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.mt-1 {
  margin-top: 0.25rem;
}
.mt-2 {
  margin-top: 0.5rem;
}
.mt-3 {
  margin-top: 0.75rem;
}
.mt-4 {
  margin-top: 1rem;
}
.mb-3 {
  margin-bottom: 0.75rem;
}
.gap-2 {
  gap: 0.5rem;
}
.gap-3 {
  gap: 0.75rem;
}

.space-y-2 > *:not(:last-child) {
  margin-bottom: 0.5rem;
}
.space-y-3 > *:not(:last-child) {
  margin-bottom: 0.75rem;
}
.space-y-4 > *:not(:last-child) {
  margin-bottom: 1rem;
}

/* ===== ANIMATIONS ===== */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* ===== ICONS (SVG Inline) ===== */
.icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: middle;
}

/* ===== TABS ===== */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  background-color: #f5f5f5;
  border-radius: 12px;
  padding: 0.25rem;
}

.tab-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  background: transparent;
  color: #666;
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active {
  background-color: #fff;
  color: #6b5b9a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
  padding: 1rem;
}

.pagination-btn {
  width: 40px;
  height: 40px;
  border: 1px solid #e0e0e0;
  background-color: #fff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.pagination-btn:not(:disabled):hover {
  background-color: #f5f5f5;
  border-color: #6b5b9a;
}

.pagination-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pagination-btn svg {
  width: 16px;
  height: 16px;
  color: #666;
}

.pagination-info {
  font-size: 14px;
  color: #666;
  font-weight: 500;
}
/* Send message page - full width form */
body[data-page="send-message"] .page-content .stat-card {
  flex-direction: column;
  align-items: stretch;
  width: 100%;
}
body[data-page="send-message"] #customer-upload-form {
  width: 100%;
  display: block;
  box-sizing: border-box;
}
.send-msg-text{
  resize: none;
  height: 70px;
  padding: 4px 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(242, 240, 237, 0.5);
  font-size: 14px;
  font-family: inherit;
  color: var(--foreground);
  transition: border-color 0.2s;
  width: 100%;
  box-sizing: border-box;
}
/* Send message - File upload zone */
.send-msg-file-wrap {
  margin-top: 1rem;
  width: 100%;
}
.send-msg-file-label {
  display: block;
  color: #797979;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 0.5rem;
}
.send-msg-file-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  padding: 1.25rem;
  border: 2px dashed rgba(107, 91, 154, 0.35);
  border-radius: 14px;
  background: rgba(107, 91, 154, 0.04);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  width: 100%;
  box-sizing: border-box;
}
.send-msg-file-zone:hover {
  border-color: rgba(107, 91, 154, 0.55);
  background: rgba(107, 91, 154, 0.08);
}
.send-msg-file-zone.has-file {
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.06);
}
.send-msg-file-zone.has-file:hover {
  border-color: rgba(34, 197, 94, 0.7);
}
.send-msg-file-zone.drag-over {
  border-color: var(--primary, #6b5b9a);
  background: rgba(107, 91, 154, 0.12);
}
.send-msg-file {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.send-msg-file-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: #6b7280;
  font-size: 14px;
}
.send-msg-file-placeholder svg {
  color: var(--primary, #6b5b9a);
}
.send-msg-file-placeholder small {
  font-size: 12px;
  color: #9ca3af;
}
.send-msg-file-zone.has-file .send-msg-file-placeholder {
  display: none;
}
.send-msg-file-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #22c55e;
  font-size: 14px;
  font-weight: 500;
}
.send-msg-file-name::before {
  content: "✓";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: rgba(34, 197, 94, 0.15);
  border-radius: 50%;
  font-size: 14px;
  font-weight: bold;
  color: #22c55e;
}
.send-msg-btn{
  width: 100%;
  margin-top: 20px;
  box-sizing: border-box;
  text-decoration: none;
}

/* ارسالی‌های من */
.sent-messages-card {
  margin-top: 1.5rem;
}
.sent-messages-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
  color: var(--text, #333);
}
.sent-messages-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.sent-message-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.75rem;
  background: rgba(107, 91, 154, 0.06);
  border-radius: 8px;
  border: 1px solid rgba(107, 91, 154, 0.15);
}
.sent-message-item .sent-msg-title {
  font-size: 0.95rem;
  color: var(--text, #333);
}
.sent-message-item .sent-msg-download {
  font-size: 0.85rem;
  color: var(--primary, #6b5b9a);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.sent-message-item .sent-msg-download:hover {
  text-decoration: underline;
}
.sent-message-item .sent-msg-download[href=""] {
  display: none;
}
.sent-messages-pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.sent-messages-pagination .page-btn {
  min-width: 36px;
  padding: 0.4rem 0.6rem;
  border: 1px solid rgba(107, 91, 154, 0.3);
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--primary, #6b5b9a);
}
.sent-messages-pagination .page-btn:hover:not(:disabled) {
  background: rgba(107, 91, 154, 0.08);
}
.sent-messages-pagination .page-btn.active {
  background: var(--primary, #6b5b9a);
  color: #fff;
  border-color: var(--primary, #6b5b9a);
}
.sent-messages-pagination .page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.sent-messages-loading,
.sent-messages-empty {
  text-align: center;
  padding: 1rem;
  color: #666;
  font-size: 0.9rem;
}

.upload {
  direction: ltr;
  border: 1px solid #E1E1E1;
  padding: 10px;
  border-radius: 10px;
  display: grid;
  grid-template-columns: auto 32px;
  gap: 10px;
  text-align: left;
  align-items: center;
  margin-bottom: 10px;
}

.upload-file-name {
  display: grid;
  grid-template-columns: 32px auto 32px;
  align-items: center;
}

.file-name span {
  color: rgb(89 89 89 / 35%);
}

.upload-progress {
  height: 10px;
  border-radius: 8px;
  background: #F0F0F0;
  margin-top: 10px;
  position: relative;
}

.upload-progress div {
  background: var(--color-primary);
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 8px;
}

svg.remove-upload {
  cursor: pointer;
}

.new-ticket-info-fields + .form-group,
.new-ticket-info-fields .form-group {
  margin-top: 0;
}

.uploaded-document {
  display: none;
}

.upload.uploaded .upload-document {
  display: none;
}

.upload.uploaded .uploaded-document {
  display: block;
}

.upload.uploaded .upload-file-name, .upload.uploaded .upload-file-name span {
  color: #2BD500;
}

.upload.uploaded .upload-percent {
  display: none;
}

.upload.uploaded .upload-progress {
  display: none;
}

.upload.uploaded {
  border-color: #2BD500;
}


.upload-here input {
  display: none;
}

.upload-here label {
  color: #9C9C9C;
  display: block;
  text-align: center;
  padding: 20px;
  border-radius: 10px;
  border: 1px dashed #9C9C9C;
  cursor: pointer;
}
.upload-progress div {
  background: var(--primary);
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 8px;
}
.upload-files{margin-top: 20px}
#form-message{
  display: none;
  margin-top: 18px;
  background: #f9f9f9;
  padding: 7px;
  border-radius: 8px;
  text-align: center;
}

/* Upload Progress Overlay */
.upload-progress-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 22, 37, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.25s ease;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.upload-progress-card {
  background: linear-gradient(145deg, #fff 0%, #f8f7fc 100%);
  border-radius: 20px;
  padding: 2rem 2.5rem;
  max-width: 340px;
  width: 100%;
  box-shadow: 0 25px 50px -12px rgba(107, 91, 154, 0.25);
  text-align: center;
  animation: slideUp 0.35s ease;
}
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.upload-progress-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.25rem;
  background: linear-gradient(135deg, rgba(107, 91, 154, 0.12), rgba(107, 91, 154, 0.06));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary, #6b5b9a);
}
.upload-progress-icon.success {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.08));
  color: #22c55e;
}
.upload-progress-icon.error {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.08));
  color: #ef4444;
}
.upload-progress-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1a1625;
  margin: 0 0 0.5rem;
}
.upload-progress-desc {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0 0 1.25rem;
}

.upload-progress-bar-wrap {
  height: 8px;
  background: rgba(107, 91, 154, 0.12);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}
.upload-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #6b5b9a, #8b7cb8);
  border-radius: 999px;
  width: 0%;
  transition: width 0.3s ease;
}
.upload-progress-percent {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary, #6b5b9a);
}
.upload-progress-card.success .upload-progress-bar {
  background: linear-gradient(90deg, #22c55e, #16a34a);
}
.upload-progress-card.success .upload-progress-percent {
  color: #22c55e;
}
.upload-progress-card.error .upload-progress-bar-wrap {
  opacity: 0.5;
}
.sent-msg-date{
  font-size: 0.7rem;
  color:  #666464;
  text-align: end;
}

/* ========================================================================
   Recipient selector (parent → teacher or school)
   ======================================================================== */
.send-msg-recipient-wrap {
  margin-top: 0.5rem;
  width: 100%;
}
.recipient-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 0.5rem;
}
.recipient-option {
  position: relative;
  cursor: pointer;
  margin: 0;
}
.recipient-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}
.recipient-option-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.9rem 0.5rem;
  border: 2px solid rgba(107, 91, 154, 0.25);
  border-radius: 12px;
  background: #fff;
  transition: all 0.15s ease;
  text-align: center;
}
.recipient-option-box svg {
  color: #9ca3af;
  transition: color 0.15s ease;
}
.recipient-option-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: #374151;
}
.recipient-option-desc {
  font-size: 0.72rem;
  color: #9ca3af;
}
.recipient-option input[type="radio"]:checked + .recipient-option-box {
  border-color: var(--primary, #6b5b9a);
  background: rgba(107, 91, 154, 0.08);
  box-shadow: 0 0 0 3px rgba(107, 91, 154, 0.12);
}
.recipient-option input[type="radio"]:checked + .recipient-option-box svg,
.recipient-option input[type="radio"]:checked + .recipient-option-box .recipient-option-label {
  color: var(--primary, #6b5b9a);
}
.recipient-option input[type="radio"]:focus-visible + .recipient-option-box {
  outline: 2px solid rgba(107, 91, 154, 0.5);
  outline-offset: 2px;
}

/* ========================================================================
   Multiple file slots (up to 3 files per message)
   ======================================================================== */
.send-msg-file-hint {
  display: block;
  font-size: 0.72rem;
  color: #9ca3af;
  margin: 0 0 0.6rem;
}
#file-zones-container {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.file-slot {
  position: relative;
}
.file-slot-remove {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  z-index: 2;
}
.file-slot-remove:hover {
  background: rgba(239, 68, 68, 0.2);
}
.file-slot:first-child .file-slot-remove {
  display: none;
}
.btn-add-file {
  margin-top: 0.7rem;
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1.5px dashed rgba(107, 91, 154, 0.4);
  border-radius: 10px;
  background: rgba(107, 91, 154, 0.03);
  color: var(--primary, #6b5b9a);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}
.btn-add-file:hover:not(:disabled):not(.disabled) {
  background: rgba(107, 91, 154, 0.08);
  border-color: rgba(107, 91, 154, 0.6);
}
.btn-add-file:disabled,
.btn-add-file.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-add-file .file-count {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-right: 0.3rem;
}

/* ========================================================================
   Sent messages list — recipient badge + multiple download links
   ======================================================================== */
.sent-msg-recipient {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 500;
  border-radius: 10px;
  width: fit-content;
}
.recipient-badge-teacher {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}
.recipient-badge-school {
  background: rgba(168, 85, 247, 0.14);
  color: #7c3aed;
}
.sent-msg-files {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.15rem;
}
.sent-msg-files .sent-msg-download {
  background: rgba(107, 91, 154, 0.08);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.78rem;
}
