/* ============================================================
   FONTS — Peyda Web (FaNum) family
   ============================================================ */
@font-face {
  font-family: 'Peyda100';
  src: url('../fonts/PeydaWebFaNum-Thin.4dc9791976a333b36501.woff2') format('woff2');
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Peyda200';
  src: url('../fonts/PeydaWebFaNum-ExtraLight.cb12d7d5e9d6131c285f.woff') format('woff');
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Peyda300';
  src: url('../fonts/PeydaWebFaNum-Light.e5c4aa2be8084a7fd345.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Peyda400';
  src: url('../fonts/PeydaWebFaNum-Regular.a85fc388413d6fb2707b.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Peyda500';
  src: url('../fonts/PeydaWebFaNum-Medium.5ae94427bffc3c292a70.woff') format('woff');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Peyda600';
  src: url('../fonts/PeydaWebFaNum-SemiBold.bee880ae22ea6f0f046e.woff') format('woff');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Peyda700';
  src: url('../fonts/PeydaWebFaNum-Bold.2106f9398d9799d35d55.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Peyda800';
  src: url('../fonts/PeydaWebFaNum-ExtraBold.5d0e4f0b138c23493636.woff') format('woff');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Peyda900';
  src: url('../fonts/PeydaWebFaNum-Black.ce8ffc88f1303a4ed135.woff') format('woff');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* ============================================================
   DESIGN TOKENS — متغیرهای اصلی
   پالت رنگ اصلی بدون تغییر؛ سایه‌ها/فاصله‌ها/گوشه‌ها مدرن‌تر شده‌اند.
   ============================================================ */
:root {
  /* --- رنگ‌های اصلی (دست‌نخورده) --- */
  --primary-color: #00897b;
  --primary-dark: #016359;
  --secondary-color: #2196F3;
  --accent-color: #74b9ff;

  --text-primary: #2c3e50;
  --text-secondary: #7f8c8d;
  --background-light: #f8f9fa;
  --white: #ffffff;

  --error-color: #e74c3c;
  --warning-color: #e2b83e;
  --success-color: #00897b;
  --info-color: #2196F3;

  /* مرز و حالت hover (برای یکدست شدن لایت/دارک) */
  --border-color: #edf0f2;
  --hover-color: #f1f3f5;

  /* --- گرادیان‌ها (ساده‌تر و ملایم‌تر) --- */
  --gradient-primary: linear-gradient(135deg, #00897b, #016359);
  --gradient-secondary: linear-gradient(135deg, #6c5ce7, #a29bfe);
  --gradient-accent: linear-gradient(135deg, #74b9ff, #0984e3);

  /* --- سایه‌ها (لایه‌ای و سبک، سبک مدرن) --- */
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.06), 0 2px 4px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 12px 28px rgba(16, 24, 40, 0.08), 0 4px 10px rgba(16, 24, 40, 0.04);

  /* aliasهای سازگار با کد قدیمی */
  --box-shadow: var(--shadow-md);
  --box-shadow-hover: var(--shadow-lg);
  --box-shadow-light: var(--shadow-xs);

  /* --- گردی گوشه‌ها (یکدست) --- */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 999px;

  /* aliasهای سازگار با کد قدیمی */
  --border-radius: var(--radius-md);
  --border-radius-small: var(--radius-sm);
  --border-radius-large: var(--radius-lg);

  /* --- انتقال‌ها --- */
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;

  /* --- لایه‌بندی (z-index) --- */
  --z-loading: 9999;
  --z-toast: 99999;
  --z-modal: 9997;
  --z-bottom-nav: 1000;
  --z-header: 999;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: 'Peyda400', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-weight: 400;
  direction: rtl;
  background: var(--background-light);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* جلوگیری از انتخاب متن و منوی لمسی (تجربه‌ی اپ‌مانند) */
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* --- پنهان کردن اسکرول‌بار در همه‌جا --- */
* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
*::-webkit-scrollbar {
  display: none;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2 {
  font-family: 'Peyda900', sans-serif;

  line-height: 1.2;
}

h3, h4 {
  font-family: 'Peyda700', sans-serif;

  line-height: 1.3;
}

h5, h6, span, div {
  font-family: 'Peyda400', sans-serif;
 
  line-height: 1.4;
}

p {
  font-family: 'Peyda300', sans-serif;

  line-height: 1.6;
}

strong, b {
  font-family: 'Peyda800', sans-serif;
  
}

em {
  font-family: 'Peyda200', sans-serif;

  font-style: normal;
}

a {
  font-family: 'Peyda500', sans-serif;

  text-decoration: none;
  color: inherit;
  transition: var(--transition-fast);
}

small,
.caption {
  font-family: 'Peyda100', sans-serif;
 
  font-size: 0.875rem;
}

button, input, textarea, select {
  font-family: 'Peyda600', sans-serif;
 
}

/* ============================================================
   LOADING SCREEN
   ============================================================ */
.loading-screen {
  position: fixed;
  inset: 0;
  background: var(--background-light);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-loading);
}

.loading-content {
  text-align: center;
  color: var(--text-primary);
}

.loading-logo {
  width: 90%;
  margin-bottom: 2rem;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: spin 1s linear infinite;
}

.loading-text {
  font-size: 1.1rem;
  opacity: 0.9;
  color: var(--text-primary);
}

/* ============================================================
   LOGIN SCREEN
   ============================================================ */
.login-screen {
  display: none;
  flex-direction: column;
  height: 100vh;
  background: var(--primary-color);
  position: relative;
  overflow: hidden;
}

/* موج تزئینی پس‌زمینه */
.login-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120" fill="none"><path d="M0,64L48,74.7C96,85,192,107,288,112C384,117,480,107,576,90.7C672,75,768,53,864,58.7C960,64,1056,96,1152,101.3L1200,107L1200,0L1152,0C1056,0,960,0,864,0C768,0,672,0,576,0C480,0,384,0,288,0C192,0,96,0,48,0L0,0Z" fill="rgba(255,255,255,0.1)"/></svg>') no-repeat center;
  background-size: cover;
  opacity: 0.3;
}

.login-header {
  text-align: center;
  padding: 3rem 2rem 2rem;
  color: var(--white);
  position: relative;
  z-index: 1;
}

.app-logo {
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: var(--transition);
}

.app-logo:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
}

.app-logo i {
  font-size: 2.5rem;
  color: var(--white);
}

.app-title {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.app-subtitle {
  font-size: 1rem;
  opacity: 0.9;
}

/* کانتینر فرم — کارت پایین‌چسبان با گوشه‌ی گرد بالا */
.login-container {
  flex: 1;
  background: var(--white);
  border-radius: 28px 28px 0 0;
  padding: 2rem;
  margin-top: auto;
  box-shadow: 0 -8px 40px rgba(16, 24, 40, 0.08);
  position: relative;
  z-index: 1;
  min-height: 50%;
}

.login-step {
  max-width: 400px;
  margin: 0 auto;
  animation: fadeInUp 0.5s ease-out;
}

.login-step.hidden {
  display: none;
}

.form-title {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  text-align: center;
}

.form-subtitle {
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 2rem;
  line-height: 1.5;
}

/* نمایش شماره‌ی موبایل تأییدشده */
.phone-display {
  background: var(--background-light);
  padding: 1rem;
  border-radius: var(--radius-sm);
  text-align: center;
  margin-bottom: 1.5rem;
  font-family: 'Peyda600', sans-serif;
  color: var(--primary-color);
  border: 1px solid rgba(0, 137, 123, 0.2);
}

/* ============================================================
   FORM CONTROLS (login + general)
   ============================================================ */
.form-group {
  margin-bottom: 1.5rem;
  position: relative;
}

.form-input {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: var(--transition);
  background: var(--background-light);
  text-align: center;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-color);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(0, 137, 123, 0.1);
}

.form-input::placeholder {
  color: var(--text-secondary);
  font-family: 'Peyda300', sans-serif;
}

.form-icon {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  transition: var(--transition-fast);
  z-index: 1;
}

.form-input:focus + .form-icon {
  color: var(--primary-color);
}

/* دکمه‌ی اصلی ورود */
.login-btn {
  width: 100%;
  background: var(--gradient-primary);
  border: none;
  padding: 1rem;
  border-radius: var(--radius-md);
  color: var(--white);
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
}

.login-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

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

.login-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* حالت در حال بارگذاری دکمه */
.btn-loading {
  display: none;
  align-items: center;
  gap: 0.5rem;
}

.login-btn.loading .btn-text,
.login-btn.loading i {
  display: none;
}

.login-btn.loading .btn-loading {
  display: flex;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* بخش ارسال مجدد کد */
.resend-section {
  text-align: center;
  margin-top: 1.5rem;
}

.resend-section p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.resend-btn {
  background: none;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.resend-btn:hover:not(:disabled) {
  background: rgba(0, 137, 123, 0.08);
}

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

.resend-timer {
  color: var(--text-secondary);
}

/* ============================================================
   SUCCESS SCREEN
   ============================================================ */
.success-screen {
  position: fixed;
  inset: 0;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
}

.success-screen.hidden {
  display: none;
}

.success-content {
  text-align: center;
  color: var(--white);
  animation: fadeInUp 0.5s ease-out;
}

.success-icon {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 2rem;
  backdrop-filter: blur(10px);
  animation: pulse 2s infinite;
}

.success-icon i {
  font-size: 3rem;
  color: var(--white);
}

.success-content h2 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.success-content p {
  font-size: 1.1rem;
  opacity: 0.9;
}

/* ============================================================
   DASHBOARD — صفحه و هدر
   ============================================================ */
.dashboard-screen {
  display: none;
  height: 100vh;
  background: var(--background-light);
  padding-bottom: 80px;
}

.dashboard-screen.active {
  display: block;
}

.dashboard-header {
  background: var(--white);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  margin: 5px 5px 0;
  border-radius: var(--radius-sm);
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* دکمه‌ی پشتیبانی */
.support-btn {
  background: var(--secondary-color);
  border: none;
  border-radius: var(--radius-sm);
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.support-btn:hover {
  filter: brightness(1.08);
  transform: scale(1.05);
}

/* آواتار کاربر در هدر */
.user-avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 1.1rem;
  box-shadow: var(--shadow-xs);
}

.user-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.user-info h3 {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.2;
}

.user-info p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.2;
}

/* دکمه‌های اعلان و امتیاز */
.notification-btn,
.score-btn {
  background: var(--background-light);
  border: none;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  position: relative;
  cursor: pointer;
  transition: var(--transition-fast);
}

.notification-btn:hover {
  background: rgba(0, 137, 123, 0.08);
  color: var(--primary-color);
}

.notification-badge {
  position: absolute;
  top: 0.25rem;
  left: 0.25rem;
  background: var(--error-color);
  color: var(--white);
  font-size: 0.7rem;
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-full);
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse 2s infinite;
}

/* محتوای داشبورد */
.dashboard-content {
  padding: 1rem;
  overflow-y: auto;
  height: calc(100vh - 140px);
}

.dashboard-page {
  display: none;
  animation: fadeInUp 0.35s ease-out;
}

.dashboard-page.active {
  display: block;
}

/* ============================================================
   STATS GRID — کارت‌های آماری بزرگ
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  text-align: center;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

/* نوار رنگی بالای کارت — هنگام hover ظاهر می‌شود */
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.stat-card:hover::before {
  transform: scaleX(1);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 1.3rem;
  margin: 0 auto 1rem;
  box-shadow: var(--shadow-xs);
}

.stat-icon.patients  { background: var(--gradient-primary); }
.stat-icon.completed { background: linear-gradient(135deg, #3498db, #2980b9); }
.stat-icon.pending   { background: linear-gradient(135deg, #f39c12, #e67e22); }
.stat-icon.studies   { background: linear-gradient(135deg, #9b59b6, #8e44ad); }

.stat-number {
  font-size: 1.8rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  line-height: 1;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.2;
}

/* ============================================================
   SECTION TITLES
   ============================================================ */
.section-title {
  font-size: 1.2rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title i {
  color: var(--primary-color);
}

/* ============================================================
   QUICK ACTIONS — کارت‌های اقدام
   ============================================================ */
.quick-actions {
  margin-bottom: 1.5rem;
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.action-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
}

/* افکت درخشش عبوری هنگام hover */
.action-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 137, 123, 0.08), transparent);
  transition: var(--transition);
}

.action-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(0, 137, 123, 0.15);
}

.action-card:hover::before {
  left: 100%;
}

.action-card:hover .action-icon {
  transform: scale(1.1);
  color: var(--primary-color);
}

.action-icon {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 0.75rem;
  transition: var(--transition);
}

.action-title {
  font-size: 1rem;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.action-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

/* ============================================================
   RECENT ACTIVITY — فعالیت اخیر
   ============================================================ */
.recent-activity {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 1rem;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--background-light);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  border-right: 3px solid transparent;
}

.activity-item:hover {
  background: rgba(0, 137, 123, 0.04);
  border-right-color: var(--primary-color);
}

.activity-icon {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.activity-icon.new       { background: var(--gradient-primary); }
.activity-icon.completed { background: linear-gradient(135deg, #3498db, #2980b9); }
.activity-icon.updated   { background: linear-gradient(135deg, #f39c12, #e67e22); }

.activity-content {
  flex: 1;
}

.activity-title {
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.activity-time {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.2;
}

/* ============================================================
   BOTTOM NAVIGATION — ناوبری پایین
   ============================================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  padding: 0.5rem 1rem 1rem;
  display: flex;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -8px 32px rgba(16, 24, 40, 0.1);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-color);
  z-index: var(--z-bottom-nav);
}

/* دستگیره‌ی تزئینی بالای نوار */
.bottom-nav::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 4px;
  background: var(--gradient-primary);
  border-radius: 0 0 10px 10px;
  opacity: 0.7;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text-secondary);
  transition: var(--transition);
  padding: 0.75rem 0.5rem;
  border-radius: var(--radius-lg);
  position: relative;
  min-width: 60px;
  cursor: pointer;
}

.nav-item.active {
  color: var(--primary-color);
  transform: scale(1.05);
}

.nav-item.active .nav-icon-container {
  background: var(--gradient-primary);
  transform: translateY(-8px);
  box-shadow: 0 8px 20px rgba(0, 137, 123, 0.25);
}

.nav-item.active .nav-icon {
  color: var(--white);
  transform: scale(1.1);
}

.nav-item.active .nav-label {
  color: var(--primary-color);
  transform: translateY(-2px);
}

.nav-item:hover:not(.active) {
  color: var(--primary-color);
  transform: scale(1.02);
}

.nav-item:hover:not(.active) .nav-icon-container {
  background: rgba(0, 137, 123, 0.08);
  transform: translateY(-3px);
}

.nav-icon-container {
  width: 45px;
  height: 45px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  transition: var(--transition);
  margin-bottom: 0.25rem;
  position: relative;
  overflow: hidden;
}

/* درخشش متحرک روی آیتم فعال */
.nav-icon-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  opacity: 0;
  transition: var(--transition);
}

.nav-item.active .nav-icon-container::before {
  opacity: 1;
  animation: shimmer 2s infinite;
}

.nav-icon {
  font-size: 1.3rem;
  transition: var(--transition);
  position: relative;
  z-index: 1;
}

.nav-label {
  font-size: 0.7rem;
  transition: var(--transition);
  text-align: center;
  line-height: 1;
}

/* نشان اعلان روی آیتم ناوبری */
.nav-item .nav-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--error-color);
  color: var(--white);
  font-size: 0.6rem;
  padding: 0.15rem 0.3rem;
  border-radius: 8px;
  min-width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse 2s infinite;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 350px;
  animation: slideInRight 0.3s ease-out;
  border-right: 3px solid var(--success-color);
}

.toast.error   { border-right-color: var(--error-color); }
.toast.warning { border-right-color: var(--warning-color); }
.toast.info    { border-right-color: var(--info-color); }

.toast-icon {
  font-size: 1.2rem;
  color: var(--success-color);
}

.toast.error .toast-icon   { color: var(--error-color); }
.toast.warning .toast-icon { color: var(--warning-color); }
.toast.info .toast-icon    { color: var(--info-color); }

.toast-message {
  flex: 1;
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 50%;
  transition: var(--transition-fast);
}

.toast-close:hover {
  background: var(--background-light);
  color: var(--text-primary);
}

/* ============================================================
   CARDS — کارت عمومی
   ============================================================ */
.card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 1rem;
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin: 0;
}

.card-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0.25rem 0 0;
}

.card-content {
  color: var(--text-primary);
  line-height: 1.6;
}

.card-footer {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ============================================================
   HISTORY LIST — لیست سوابق (نسخه‌ی کامل)
   ============================================================ */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 1000px;
}

.history-item {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  border-right: 3px solid transparent;
  cursor: pointer;
}

.history-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-right-color: var(--primary-color);
}

.history-item.incomplete { border-right-color: var(--warning-color); }
.history-item.complete   { border-right-color: var(--success-color); }

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

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

.history-status {
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.history-status.incomplete { background: rgba(226, 184, 62, 0.12); color: var(--warning-color); }
.history-status.complete   { background: rgba(0, 137, 123, 0.1);  color: var(--success-color); }
.history-status.reviewed   { background: rgba(33, 150, 243, 0.1); color: var(--info-color); }

.history-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.history-meta span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.history-preview {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.history-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

/* ============================================================
   BUTTONS — دکمه‌های کوچک و عمومی
   ============================================================ */
.btn-small {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.btn-small:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
}

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

.btn-secondary {
  background: var(--background-light);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

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

/* ============================================================
   SEARCH & FILTERS
   ============================================================ */
.search-container {
  margin-bottom: 1.5rem;
}

.search-box {
  position: relative;
  margin-bottom: 1rem;
}

.search-input {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: var(--transition);
  background: var(--white);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(0, 137, 123, 0.1);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.search-input:focus + .search-icon {
  color: var(--primary-color);
}

.filter-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.filter-tab {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
}

.filter-tab.active {
  background: var(--gradient-primary) !important;
  color: var(--white);
  border-color: transparent;
}

.filter-tab:hover:not(.active) {
  background: rgba(0, 137, 123, 0.08);
  border-color: var(--primary-color);
}

/* ============================================================
   PROFILE PAGE
   ============================================================ */
.profile-header {
  background: var(--gradient-primary);
  color: var(--white);
  padding: 2rem 1rem;
  text-align: center;
  margin: -1rem -1rem 1.5rem;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  background: rgba(255, 255, 255, 0.2);
  border: 3px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  position: relative;
  cursor: pointer;
  transition: var(--transition);
}

.profile-avatar:hover {
  transform: scale(1.05);
}

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

.camera-icon {
  position: absolute;
  bottom: 0;
  left: 0;
  background: var(--primary-color);
  color: var(--white);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.profile-name {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.profile-info {
  font-size: 1rem;
  opacity: 0.9;
}

.profile-sections {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.profile-section {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}

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

.section-header h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.edit-btn {
  background: none;
  border: none;
  color: var(--primary-color);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.edit-btn:hover {
  background: rgba(0, 137, 123, 0.08);
}

.info-grid {
  display: grid;
  gap: 1rem;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.info-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.info-value {
  font-size: 1rem;
  color: var(--text-primary);
}

/* کارت اشتراک */
.subscription-card {
  background: var(--gradient-primary);
  color: var(--white);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1rem;
}

.subscription-plan {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.subscription-status {
  font-size: 1rem;
  opacity: 0.9;
  margin-bottom: 1rem;
}

.upgrade-btn {
  background: var(--white);
  color: var(--primary-color);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.upgrade-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* ============================================================
   FORMS — فرم‌های عمومی
   ============================================================ */
.form-container {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-row.two-cols {
  grid-template-columns: 1fr 1fr;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-size: 0.9rem;
  color: var(--text-primary);
}

.form-label.required::after {
  content: ' *';
  color: var(--error-color);
}

.form-control {
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  transition: var(--transition);
  background: var(--background-light);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(0, 137, 123, 0.1);
}

.form-control.error {
  border-color: var(--error-color);
  background: rgba(231, 76, 60, 0.05);
}

.form-error {
  font-size: 0.8rem;
  color: var(--error-color);
  margin-top: 0.25rem;
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  justify-content: flex-end;
}

/* دکمه‌ی استاندارد */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 120px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xs);
}

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

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal.active .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: -15px;
  background: var(--background-light);
  z-index: 10;
}

.modal-header h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.25rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition-fast);
}

.modal-close:hover {
  background: var(--hover-color);
  color: var(--text-primary);
}

.modal-body {
  padding: 2rem;
}

.modal-footer {
  display: flex;
  gap: 1rem;
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border-color);
  justify-content: flex-end;
}

/* فیلدهای فرم داخل مودال */
.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: border-color 0.3s ease;
  background: var(--background-light);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

body.modal-open {
  overflow: hidden;
}

/* ============================================================
   EDUCATIONAL GRID — کارت‌های آموزشی
   ============================================================ */
.educational-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.educational-row {
  display: flex;
  gap: 1rem;
}

.educational-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}

.educational-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.educational-card.half-width { flex: 1; }
.educational-card.full-width { width: 100%; }

.card-icon {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: var(--white);
  flex-shrink: 0;
}

.card-icon.ai        { background: linear-gradient(135deg, #9b59b6, #8e44ad); }
.card-icon.challenge { background: linear-gradient(135deg, #f39c12, #e67e22); }

.card-content {
  flex: 1;
}

.card-content h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.card-content p {
  margin: 0 0 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.4;
}

.card-stats {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.card-stats i {
  margin-right: auto;
  color: var(--primary-color);
}

.feature-badge {
  background: var(--primary-color);
  color: var(--white);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
}

.challenge-today {
  background: #f39c12;
  color: var(--white);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
}

/* ============================================================
   PROMOTIONAL SLIDER — اسلایدر تبلیغاتی
   ============================================================ */
.promo-slider {
  margin-bottom: 1.5rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  position: relative;
}

.slider-container {
  position: relative;
  height: 180px;
  overflow: hidden;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
  cursor: pointer;
}

.slide.active {
  opacity: 1;
}

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

.slide-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  color: var(--white);
  padding: 1rem;
}

.slide-content h3 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
}

.slide-content p {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.9;
}

.slider-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  z-index: 2;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: var(--transition);
}

.dot.active {
  background: var(--white);
  width: 24px;
  border-radius: 4px;
}

/* ============================================================
   COMPACT STATS — کارت‌های آماری کوچک
   ============================================================ */
.stats-grid-compact {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.stat-card-mini {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1rem;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.stat-card-mini:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon-mini {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 1.1rem;
}

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

.stat-info .stat-number {
  font-size: 1.4rem;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-info .stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* ============================================================
   ENHANCED ACTIONS — کارت‌های اقدام پیشرفته
   ============================================================ */
.quick-actions-enhanced {
  margin-bottom: 1.5rem;
}

.actions-grid-enhanced {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.action-card-enhanced {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  text-align: center;
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.action-card-enhanced:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* رنگ مرز هنگام hover بر اساس نوع کارت */
.action-card-enhanced.primary:hover   { border-color: var(--primary-color); }
.action-card-enhanced.secondary:hover { border-color: var(--info-color); }
.action-card-enhanced.accent:hover    { border-color: #9b59b6; }
.action-card-enhanced.warning:hover   { border-color: var(--warning-color); }
.action-card-enhanced.info:hover      { border-color: var(--info-color); }
.action-card-enhanced.success:hover   { border-color: var(--success-color); }

.action-icon-enhanced {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

.action-card-enhanced.secondary .action-icon-enhanced { color: var(--info-color); }
.action-card-enhanced.accent .action-icon-enhanced    { color: #9b59b6; }
.action-card-enhanced.warning .action-icon-enhanced   { color: var(--warning-color); }
.action-card-enhanced.info .action-icon-enhanced      { color: var(--info-color); }
.action-card-enhanced.success .action-icon-enhanced   { color: var(--success-color); }

.action-content-enhanced h4 {
  font-size: 0.8rem;
  margin: 0 0 0.25rem;
}

.action-content-enhanced p {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin: 0;
}

/* ============================================================
   COMPACT ACTIVITY — فعالیت اخیر فشرده
   ============================================================ */
.activity-list-compact {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.activity-item-compact {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--white);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
}

.activity-item-compact:hover {
  box-shadow: var(--shadow-md);
  transform: translateX(-3px);
}

.activity-icon-compact {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.activity-info-compact {
  flex: 1;
}

.activity-title-compact {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.activity-meta-compact {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.activity-meta-compact span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.status-badge {
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
}

.status-badge.complete   { background: rgba(0, 137, 123, 0.1);  color: var(--success-color); }
.status-badge.incomplete { background: rgba(226, 184, 62, 0.12); color: var(--warning-color); }

.activity-arrow {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ============================================================
   EMPTY STATE — حالت خالی
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 2rem;
}

.empty-state i {
  font-size: 3rem;
  color: var(--text-secondary);
  opacity: 0.5;
  margin-bottom: 1rem;
}

.empty-state p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

/* ============================================================
   COMPACT HISTORY — سوابق فشرده
   ============================================================ */
.history-item-compact {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 0.5rem 1rem;
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
  border-right: 3px solid transparent;
  cursor: pointer;
}

.history-item-compact:hover {
  box-shadow: var(--shadow-md);
  transform: translateX(-2px);
}

.history-item-compact.incomplete { border-right-color: var(--warning-color); }
.history-item-compact.complete   { border-right-color: var(--success-color); }

.history-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.history-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

.patient-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.history-info {
  flex: 1;
}

.patient-name-compact {
  font-size: 0.95rem;
  margin: 0 0 0.25rem;
}

.history-meta-compact {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.history-meta-compact span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.history-status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  flex-shrink: 0;
}

.history-status-badge.incomplete { background: rgba(226, 184, 62, 0.12); color: var(--warning-color); }
.history-status-badge.complete   { background: rgba(0, 137, 123, 0.1);  color: var(--success-color); }
.history-status-badge.reviewed   { background: rgba(33, 150, 243, 0.1); color: var(--info-color); }

.history-actions-compact {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* دکمه‌های آیکونی */
.btn-icon {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.85rem;
}

.btn-icon.btn-primary   { background: rgba(0, 137, 123, 0.1);  color: var(--primary-color); }
.btn-icon.btn-info      { background: rgba(33, 150, 243, 0.1); color: var(--info-color); }
.btn-icon.btn-secondary { background: var(--background-light); color: var(--text-secondary); }

.btn-icon:hover {
  transform: scale(1.1);
}

/* ============================================================
   THEME SELECTOR — انتخابگر تم
   ============================================================ */
.theme-selector-container {
  grid-column: 1 / -1;
}

.theme-selector {
  display: flex;
  gap: 0.5rem;
  background: var(--background-light);
  padding: 0.5rem;
  border-radius: var(--radius-md);
}

.theme-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 0.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--white);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.theme-option i {
  font-size: 1.5rem;
}

.theme-option:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xs);
}

.theme-option.active {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: rgba(0, 137, 123, 0.05);
}

.theme-option.active i {
  color: var(--primary-color);
}

/* ============================================================
   TOGGLE SWITCH — کلید روشن/خاموش
   ============================================================ */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
  flex-shrink: 0;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: var(--radius-full);
}

.toggle-slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: var(--white);
  transition: 0.4s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

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

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(24px);
}

.toggle-switch input:disabled + .toggle-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================================
   MARKDOWN & CONTENT RENDERING — رندر محتوای متنی
   ============================================================ */
.explanation-title-bold {
  color: #d9534f;
  display: block;
}

.explanation-title-main {
  background: #fef5e7;
  border-right: 4px solid #f1c40f;
}

.ref {
  font-size: 0.7em;
  color: #6c757d;
  margin: 0 2px;
  vertical-align: super;
  cursor: pointer;
}

.ref:hover {
  color: #343a40;
}

.md-table {
  border-collapse: collapse;
  width: 100%;
  margin: 1em 0;
}

.md-table th,
.md-table td {
  border: 1px solid var(--border-color);
  padding: 8px 12px;
}

.md-table thead {
  background: var(--background-light);
}

.md-table tr:nth-child(even) {
  background: #f2f2f2;
}

.md-hr {
  border: none;
  border-top: 2px solid var(--border-color);
  margin: 1.5em 0;
}

.md-blockquote {
  border-right: 4px solid #17a2b8;
  padding: 8px 16px;
  color: #555;
  background: var(--background-light);
  margin: 1em 0;
  border-radius: 4px;
}

.code-block {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 16px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-family: "Courier New", monospace;
  position: relative;
  margin: 1em 0;
}

.code-lang-label {
  font-size: 0.75em;
  color: #888;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.inline-code {
  background: #f0f0f0;
  color: #c7254e;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.9em;
}

.md-img {
  max-width: 100%;
  border-radius: 6px;
}

.md-mark {
  background: #fff176;
  padding: 0 3px;
  border-radius: 2px;
}

.md-link {
  color: var(--secondary-color);
  text-decoration: none;
}

.md-link:hover {
  text-decoration: underline;
}

.md-p strong {
  color: var(--primary-dark);
}

.md-ul li strong {
  color: var(--error-color);
}

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

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

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
  40% { transform: translateX(-50%) translateY(-8px); }
  60% { transform: translateX(-50%) translateY(-4px); }
}

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

@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

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

.unselectable {
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* متن */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-left   { text-align: left; }

/* margin / padding */
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* رنگ متن */
.text-primary   { color: var(--primary-color); }
.text-secondary { color: var(--text-secondary); }
.text-success   { color: var(--success-color); }
.text-error     { color: var(--error-color); }
.text-warning   { color: var(--warning-color); }

/* رنگ پس‌زمینه */
.bg-primary   { background: var(--primary-color); }
.bg-secondary { background: var(--text-secondary); }
.bg-light     { background: var(--background-light); }
.bg-white     { background: var(--white); }

/* ابعاد */
.w-100 { width: 100%; }
.h-100 { height: 100%; }

/* flexbox */
.d-flex  { display: flex; }
.d-block { display: block; }
.d-none  { display: none; }

.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around  { justify-content: space-around; }

.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.items-end    { align-items: flex-end; }

.flex-column { flex-direction: column; }
.flex-row    { flex-direction: row; }

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* ============================================================
   DARK THEME — تم تیره
   پالت رنگ اصلی حفظ شده؛ فقط سطوح/متن‌ها تیره شده‌اند.
   ============================================================ */
body[data-theme="dark"] {
  --primary-color: #00897b;
  --primary-dark: #016359;
  --secondary-color: #2196F3;
  --accent-color: #74b9ff;

  --text-primary: #e8eaed;
  --text-secondary: #9aa0a6;
  --background-light: #1a1d23;
  --white: #242830;

  --error-color: #ef5350;
  --warning-color: #e2b83e;
  --success-color: #00897b;
  --info-color: #2196F3;

  --border-color: #2d3139;
  --hover-color: #2d3139;

  --gradient-primary: linear-gradient(135deg, #00897b, #016359);
  --gradient-secondary: linear-gradient(135deg, #a29bfe, #6c5ce7);
  --gradient-accent: linear-gradient(135deg, #74b9ff, #0984e3);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.5);

  background: #0f1115 !important;
  color: #e8eaed !important;
}

/* صفحات اصلی */
body[data-theme="dark"] .loading-screen {
  background: linear-gradient(135deg, #1a1d23, #0f1115) !important;
}

body[data-theme="dark"] .dashboard-screen {
  background: #0f1115 !important;
}

/* placeholderها در دارک */
body[data-theme="dark"] .form-input::placeholder {
  color: #5f6368 !important;
}

/* جدول مارک‌داون در دارک */
body[data-theme="dark"] .md-table tr:nth-child(even) {
  background: #242830 !important;
}

/* اسلایدر در دارک */
body[data-theme="dark"] .slide-content {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent) !important;
}

/* اسکرول‌بار سفارشی (در صورت نمایش) */
body[data-theme="dark"] ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
body[data-theme="dark"] ::-webkit-scrollbar-track {
  background: #1a1d23;
}
body[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #2d3139;
  border-radius: 4px;
}
body[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: #3d4149;
}

/* وضعیت خالی در دارک */
body[data-theme="dark"] .empty-state i {
  opacity: 0.3 !important;
}

/*
  نکته: چون اجزای رابط کاربری از همان متغیرهای رنگی
  (--white, --background-light, --border-color و ...) استفاده می‌کنند،
  با بازتعریف توکن‌ها در بالا، اکثر کارت‌ها/فرم‌ها/مودال‌ها به‌صورت
  خودکار تیره می‌شوند و دیگر نیازی به ده‌ها override تکراری نیست.
*/

/* ============================================================
   LIGHT THEME — تم روشن (بازنشانی صریح توکن‌ها)
   ============================================================ */
body[data-theme="light"] {
  --primary-color: #00897b;
  --primary-dark: #016359;
  --secondary-color: #2196F3;
  --accent-color: #74b9ff;

  --text-primary: #2c3e50;
  --text-secondary: #7f8c8d;
  --background-light: #f8f9fa;
  --white: #ffffff;

  --error-color: #e74c3c;
  --warning-color: #e2b83e;
  --success-color: #00897b;
  --info-color: #2196F3;

  --border-color: #edf0f2;
  --hover-color: #f1f3f5;

  --gradient-primary: linear-gradient(135deg, #00897b, #016359);
  --gradient-secondary: linear-gradient(135deg, #6c5ce7, #a29bfe);
  --gradient-accent: linear-gradient(135deg, #74b9ff, #0984e3);

  background: #f8f9fa !important;
  color: #2c3e50 !important;
}

/* ============================================================
   RESPONSIVE — واکنش‌گرا
   ============================================================ */
@media (max-width: 768px) {
  .educational-row {
    flex-direction: column;
  }

  .educational-card.half-width {
    width: 100%;
  }

  .modal-content {
    width: 95%;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 1rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .login-container {
    padding: 1.5rem;
    border-radius: 24px 24px 0 0;
  }

  .stats-grid,
  .actions-grid {
    gap: 0.75rem;
  }

  .stats-grid-compact {
    grid-template-columns: repeat(2, 1fr);
  }

  .actions-grid-enhanced {
    grid-template-columns: repeat(2, 1fr);
  }

  .promo-slider .slider-container {
    height: 250px;
  }

  .dashboard-content {
    padding: 0.75rem;
    padding-bottom: 100px;
  }

  .bottom-nav {
    padding: 0.25rem 0.5rem 0.75rem;
  }

  .nav-item {
    min-width: 50px;
    padding: 0.5rem 0.25rem;
  }

  .nav-icon-container {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
  }

  .nav-icon {
    font-size: 1.2rem;
  }

  .nav-label {
    font-size: 0.65rem;
  }

  .form-row.two-cols {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column;
  }

  .toast-container {
    right: 0.5rem;
    left: 0.5rem;
  }

  .toast {
    max-width: none;
  }

  .profile-header {
    padding: 1.5rem 1rem;
  }

  .profile-avatar {
    width: 80px;
    height: 80px;
    font-size: 2rem;
  }
}

@media (max-width: 375px) {
  .app-title {
    font-size: 1.6rem;
  }

  .stat-card,
  .action-card {
    padding: 1rem;
  }

  .card,
  .profile-section,
  .form-container {
    padding: 1rem;
  }
}

/* ============================================================
   PRINT — چاپ
   ============================================================ */
@media print {
  body,
  html {
    display: none;
  }

  .bottom-nav,
  .dashboard-header .notification-btn,
  .btn,
  .action-card {
    display: none !important;
  }

  .dashboard-content {
    padding: 0;
    height: auto;
  }

  .card,
  .history-item {
    box-shadow: none;
    border: 1px solid var(--border-color);
    break-inside: avoid;
  }
}