/* ===== استایل مشترک همه صفحات — استخر ماهتاب ===== */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700&display=swap');

*{box-sizing:border-box;margin:0;padding:0}
body{font-family:'Vazirmatn',sans-serif;direction:rtl;background:#0a2a4a;min-height:100vh;color:#1e293b}

/* پس‌زمینه موج */
.bg-waves{position:fixed;inset:0;z-index:0;overflow:hidden;pointer-events:none}
.wave{position:absolute;bottom:0;left:0;width:200%;border-radius:50% 50% 0 0;animation:wave-anim 8s ease-in-out infinite}
.wave:nth-child(1){height:120px;animation-delay:0s;background:rgba(14,165,233,.15)}
.wave:nth-child(2){height:90px;animation-delay:-2s;background:rgba(56,189,248,.1)}
.wave:nth-child(3){height:60px;animation-delay:-4s;background:rgba(125,211,252,.07)}
@keyframes wave-anim{0%,100%{transform:translateX(0) scaleY(1)}50%{transform:translateX(-10%) scaleY(1.1)}}
.glow{position:fixed;border-radius:50%;filter:blur(80px);opacity:.12;pointer-events:none}
.glow-1{width:600px;height:600px;background:#0ea5e9;top:-100px;right:-100px}
.glow-2{width:400px;height:400px;background:#38bdf8;bottom:-50px;left:-50px}

/* نوار بالا */
.topbar{
  position:relative;z-index:10;
  background:linear-gradient(135deg,#0c4a6e,#0369a1,#0ea5e9);
  padding:1rem 1.5rem;
  display:flex;align-items:center;justify-content:space-between;
  box-shadow:0 4px 20px rgba(0,0,0,.3);
}
.topbar-brand{display:flex;align-items:center;gap:.8rem}
.topbar-logo{width:44px;height:44px;background:#fff;border-radius:50%;overflow:hidden;display:flex;align-items:center;justify-content:center;box-shadow:0 2px 8px rgba(0,0,0,.2)}
.topbar-logo img{width:38px;height:38px;object-fit:contain}
.topbar-title{color:#fff}
.topbar-title h1{font-size:1rem;font-weight:700}
.topbar-title p{font-size:.72rem;opacity:.8;margin-top:.1rem}
.topbar-user{color:rgba(255,255,255,.9);font-size:.8rem;display:flex;align-items:center;gap:.8rem}
.btn-logout{background:rgba(255,255,255,.15);border:1px solid rgba(255,255,255,.3);color:#fff;padding:.35rem .8rem;border-radius:8px;font-size:.75rem;font-family:'Vazirmatn',sans-serif;cursor:pointer;transition:all .15s}
.btn-logout:hover{background:rgba(255,255,255,.25)}

/* محتوا */
.page-wrap{position:relative;z-index:10;padding:1.2rem;max-width:960px;margin:0 auto}
.page-wrap.wide{max-width:1100px}

/* کارت */
.card{background:#fff;border-radius:16px;padding:1.5rem;margin-bottom:1rem;box-shadow:0 4px 20px rgba(0,0,0,.15)}
.card-title{font-size:1rem;font-weight:700;color:#0c4a6e;margin-bottom:1rem;padding-bottom:.7rem;border-bottom:2px solid #e0f2fe;display:flex;align-items:center;gap:.5rem}

/* فرم */
.form-group{margin-bottom:1rem}
.form-group label{display:block;font-size:.83rem;font-weight:600;color:#0369a1;margin-bottom:.4rem}
.form-group input,.form-group select,.form-group textarea{
  width:100%;padding:.7rem 1rem;
  border:1.5px solid #bae6fd;border-radius:10px;
  font-size:.9rem;font-family:'Vazirmatn',sans-serif;
  background:#f0f9ff;color:#0c4a6e;transition:all .2s;
}
.form-group input:focus,.form-group select:focus{outline:none;border-color:#0ea5e9;background:#fff;box-shadow:0 0 0 3px rgba(14,165,233,.1)}
.required{color:#dc2626}

/* دکمه‌ها */
.btn{padding:.6rem 1.2rem;border:none;border-radius:10px;font-size:.85rem;font-weight:600;font-family:'Vazirmatn',sans-serif;cursor:pointer;transition:all .2s}
.btn-primary{background:linear-gradient(135deg,#0c4a6e,#0ea5e9);color:#fff;box-shadow:0 3px 10px rgba(14,165,233,.3)}
.btn-primary:hover{transform:translateY(-1px);box-shadow:0 5px 15px rgba(14,165,233,.4)}
.btn-primary:disabled{background:#94a3b8;box-shadow:none;transform:none;cursor:not-allowed}
.btn-success{background:#dcfce7;color:#16a34a;border:1px solid #86efac}
.btn-success:hover{background:#bbf7d0}
.btn-danger{background:#fee2e2;color:#dc2626;border:1px solid #fca5a5}
.btn-danger:hover{background:#fecaca}
.btn-warning{background:#fef3c7;color:#d97706;border:1px solid #fcd34d}
.btn-warning:hover{background:#fde68a}
.btn-info{background:#e0f2fe;color:#0369a1;border:1px solid #7dd3fc}
.btn-info:hover{background:#bae6fd}
.btn-ghost{background:#f8fafc;color:#64748b;border:1px solid #e2e8f0}
.btn-ghost:hover{background:#f1f5f9}
.btn-dl{background:#f0fdf4;color:#16a34a;border:1px solid #86efac;font-size:.78rem}

/* پیام‌ها */
.alert{padding:.8rem 1rem;border-radius:10px;font-size:.83rem;font-weight:500;margin-top:.8rem;display:none}
.alert-error{background:#fef2f2;border:1.5px solid #fecaca;color:#dc2626}
.alert-success{background:#f0fdf4;border:1.5px solid #bbf7d0;color:#166534}
.alert-info{background:#f0f9ff;border:1.5px solid #bae6fd;color:#0369a1}

/* بج وضعیت */
.badge{padding:.2rem .7rem;border-radius:20px;font-size:.72rem;font-weight:600;white-space:nowrap}
.badge-new{background:#f1f5f9;color:#64748b}
.badge-pending{background:#fef9ec;color:#d97706}
.badge-approved{background:#dcfce7;color:#16a34a}
.badge-expired{background:#fee2e2;color:#dc2626}

/* جدول */
.table{width:100%;border-collapse:collapse;font-size:.8rem}
.table th{background:#f0f9ff;padding:.65rem .8rem;text-align:right;color:#0369a1;font-weight:700;border-bottom:2px solid #bae6fd;white-space:nowrap}
.table td{padding:.65rem .8rem;border-bottom:1px solid #f0f9ff;vertical-align:middle}
.table tr:hover td{background:#f8fafc}

/* فایل لینک */
.file-link{font-size:.72rem;color:#0369a1;text-decoration:none;padding:.2rem .5rem;background:#e0f2fe;border-radius:5px;white-space:nowrap}
.file-link:hover{background:#bae6fd}

/* toast */
.toast{position:fixed;bottom:1.5rem;left:50%;transform:translateX(-50%);padding:.8rem 1.5rem;border-radius:12px;color:#fff;font-size:.88rem;font-weight:600;font-family:'Vazirmatn',sans-serif;z-index:300;opacity:0;transition:opacity .3s;min-width:220px;text-align:center;box-shadow:0 4px 20px rgba(0,0,0,.2)}
.toast.show{opacity:1}
.toast.ok{background:linear-gradient(135deg,#16a34a,#22c55e)}
.toast.err{background:linear-gradient(135deg,#dc2626,#ef4444)}

/* modal */
.modal-bg{display:none;position:fixed;inset:0;background:rgba(0,0,0,.6);backdrop-filter:blur(4px);z-index:100;align-items:center;justify-content:center}
.modal-bg.open{display:flex}
.modal{background:#fff;border-radius:20px;padding:1.8rem;width:440px;max-width:95vw;box-shadow:0 20px 60px rgba(0,0,0,.3)}
.modal-title{font-size:1rem;font-weight:700;color:#0c4a6e;margin-bottom:1rem;padding-bottom:.7rem;border-bottom:2px solid #e0f2fe}

/* empty */
.empty-state{text-align:center;padding:2.5rem;color:#94a3b8}
.empty-state .icon{font-size:3rem;margin-bottom:.8rem}
.empty-state p{font-size:.85rem}
/* ===== دکمه سوئیچ زبان ===== */
.lang-switch {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  padding: 2px;
  cursor: pointer;
  user-select: none;
  backdrop-filter: blur(4px);
  direction: ltr;
}
.lang-btn {
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.2s ease;
}
.lang-btn.active {
  background: #fff;
  color: #0c4a6e;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
/* پشتیبانی از جهت چپ به راست در حالت انگلیسی */
html[dir="ltr"] body {
  font-family: system-ui, -apple-system, sans-serif;
}
html[dir="ltr"] .sidebar {
  right: auto;
  left: 0;
  border-right: 1px solid rgba(255,255,255,0.1);
}
html[dir="ltr"] .main {
  margin-right: 0;
  margin-left: 220px;
}
html[dir="ltr"] .nav-item {
  border-right: none;
  border-left: 3px solid transparent;
}
html[dir="ltr"] .nav-item.active {
  border-left-color: #0ea5e9;
}
@media(max-width: 768px) {
  html[dir="ltr"] .main { margin-left: 0; }
}

/* responsive */
@media(max-width:600px){.page-wrap{padding:.8rem}.card{padding:1.1rem}.topbar{padding:.8rem 1rem}}
