@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700&display=swap');

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

:root {
  /* پالت رنگی برگرفته از لوگوی رسمی سایت — بدون سبز، به‌جایش طیف آبی روشن */
  --navy: #2c5f86;
  --navy-dark: #23496b;
  --sky: #3aa9bc;           /* فیروزه‌ای اصلی — رنگ برند */
  --sky-dark: #2c5f86;
  --sky-light: #eaf5f9;
  --sky-xlight: #f4fafc;
  --sky-border: #9ed7e8;
  --teal-green: #4fb3d1;    /* آبی روشن میانی — جایگزین سبز-فیروزه‌ای قبلی */
  --lime: #9adcef;          /* آبی خیلی روشن — جایگزین سبز لیمویی قبلی */
  --lime-dark: #6fbdd8;
  --green: #57a563;
  --yellow: #d97706;
  --red: #e11d48;
  --text: #24384a;
  --text-muted: #647a8c;
  --bg: #f0f8fb;
  --white: #ffffff;
  --radius: 14px;
  --shadow: 0 2px 16px rgba(44,95,134,.10);
  --brand-gradient: linear-gradient(120deg, var(--navy) 0%, var(--sky) 42%, var(--teal-green) 72%, var(--lime) 125%);
}

body {
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  direction: rtl;
}

/* ── Layout ── */
header {
  background: var(--brand-gradient);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 3px 14px rgba(44,95,134,.3);
  position: sticky;
  top: 0;
  z-index: 100;
}
.hdr-brand { display: flex; align-items: center; gap: 12px; }
.hdr-brand .logo {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,.25));
}
.hdr-brand .logo img { width: 100%; height: 100%; object-fit: contain; }
.hdr-brand h1 { color: #fff; font-size: 17px; font-weight: 700; }
.hdr-brand p { color: rgba(255,255,255,.85); font-size: 11px; }
.hdr-user { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.hdr-user span { color: #fff; font-size: 13px; }
.btn-logout { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 8px; padding: 6px 12px; font-family: inherit; font-size: 12px; cursor: pointer; }
.btn-logout:hover { background: rgba(255,255,255,.28); }

.container { max-width: 960px; margin: 0 auto; padding: 20px 16px; }

/* ── Cards ── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  border: 1px solid var(--sky-border);
}
.card h2 {
  font-size: 15px; font-weight: 700; color: var(--sky-dark);
  margin-bottom: 16px; padding-bottom: 10px;
  border-bottom: 2px solid var(--sky-light);
}

/* ── Forms ── */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media(max-width:580px){ .grid2 { grid-template-columns: 1fr; } }
.span2 { grid-column: span 2; }
@media(max-width:580px){ .span2 { grid-column: span 1; } }

.fg { display: flex; flex-direction: column; gap: 5px; }
.fg label { font-size: 12px; font-weight: 600; color: var(--sky-dark); }
.fg input, .fg select, .fg textarea {
  border: 1.5px solid var(--sky-border);
  border-radius: 9px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--sky-xlight);
  outline: none;
  width: 100%;
  direction: rtl;
  transition: border-color .2s, box-shadow .2s;
}
.fg input:focus, .fg select:focus, .fg textarea:focus {
  border-color: var(--sky);
  box-shadow: 0 0 0 3px rgba(58,169,188,.18);
}
.fg textarea { resize: vertical; line-height: 1.7; min-height: 44px; }
.d3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 6px; }
.d3t { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 6px; align-items: end; }

/* ── Buttons ── */
.btn {
  background: linear-gradient(135deg, var(--sky-dark), var(--sky));
  color: #fff; border: none; border-radius: 11px;
  padding: 11px 20px; font-family: inherit; font-size: 14px;
  font-weight: 700; cursor: pointer; width: 100%;
  box-shadow: 0 4px 12px rgba(44,95,134,.28);
  transition: transform .15s, box-shadow .15s;
  margin-top: 16px;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(44,95,134,.38); }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.btn-outline {
  background: #fff; color: var(--sky-dark);
  border: 2px solid var(--sky-dark);
  border-radius: 11px; padding: 10px 20px;
  font-family: inherit; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all .2s;
}
.btn-outline:hover { background: var(--sky-dark); color: #fff; }

.btn-sm {
  padding: 6px 12px; font-size: 12px; border-radius: 8px;
  border: none; cursor: pointer; font-family: inherit; font-weight: 600;
  transition: all .2s;
}
.btn-today { background: var(--sky); color: #fff; border: none; border-radius: 9px; padding: 9px 10px; font-family: inherit; font-size: 11px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.btn-today:hover { background: var(--sky-dark); }
.btn-danger { background: #fee2e2; color: #dc2626; border: 1px solid #fecaca; }
.btn-danger:hover { background: #dc2626; color: #fff; }
.btn-icon { background: var(--sky-xlight); color: var(--sky-dark); border: 1px solid var(--sky-border); }
.btn-icon:hover { background: var(--sky-light); }

.btn-row { display: flex; gap: 8px; margin-top: 10px; }
.btn-row .btn, .btn-row .btn-outline { flex: 1; width: auto; }

/* ── Auth pages ── */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--brand-gradient);
  padding: 20px;
}
.auth-box {
  background: #fff; border-radius: 18px; padding: 36px 32px;
  width: 100%; max-width: 420px;
  box-shadow: 0 20px 60px rgba(44,95,134,.28);
}
.auth-logo { text-align: center; margin-bottom: 24px; }
.auth-logo-img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  display: block;
  margin: 0 auto 12px;
  filter: drop-shadow(0 4px 10px rgba(44,95,134,.25));
}
.auth-logo h2 { font-size: 20px; font-weight: 700; color: var(--sky-dark); }
.auth-logo p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.auth-tabs { display: flex; margin-bottom: 24px; border-bottom: 2px solid var(--sky-light); }
.auth-tab { flex: 1; text-align: center; padding: 10px; font-size: 14px; font-weight: 600; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.auth-tab.active { color: var(--sky-dark); border-bottom-color: var(--sky-dark); }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form .fg input { font-size: 14px; }
.auth-divider { display: flex; align-items: center; text-align: center; color: var(--text-muted); font-size: 12px; margin: 4px 0; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--sky-light); }
.auth-divider span { padding: 0 10px; }
.google-btn-wrap { display: flex; justify-content: center; }
.reg-method-tabs { display: flex; gap: 8px; margin-bottom: 4px; }
.reg-method-tab {
  flex: 1; text-align: center; padding: 8px; font-size: 13px; font-weight: 600;
  color: var(--text-muted); cursor: pointer; border: 1.5px solid var(--sky-light); border-radius: 9px;
}
.reg-method-tab.active { color: #fff; background: var(--sky-dark); border-color: var(--sky-dark); }
.otp-target-info { font-size: 13px; color: var(--text-muted); text-align: center; margin-bottom: -4px; }

/* ── Messages ── */
.errmsg { background: #fff1f2; border: 1px solid #fda4af; border-radius: 9px; padding: 10px 14px; color: #e11d48; font-size: 13px; margin-top: 8px; }
.successmsg { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 9px; padding: 10px 14px; color: #16a34a; font-size: 13px; margin-top: 8px; }
.notice { background: #fefce8; border: 1px solid #fde68a; border-radius: 9px; padding: 10px 14px; color: #92400e; font-size: 12px; }

/* ── Z-Score cards ── */
.zgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
@media(max-width:500px){ .zgrid { grid-template-columns: 1fr 1fr; } }
.zcard { border-radius: 11px; padding: 12px; text-align: center; border: 1px solid transparent; }
.zcard .zl { font-size: 11px; font-weight: 600; color: #475569; margin-bottom: 4px; }
.zcard .zv { font-size: 20px; font-weight: 700; direction: ltr; }
.zcard .zs { font-size: 11px; color: #94a3b8; margin-top: 2px; direction: ltr; }
.zcard.ok { background: #f0fdf4; border-color: #bbf7d0; } .zcard.ok .zv { color: #16a34a; }
.zcard.warn { background: #fffbeb; border-color: #fde68a; } .zcard.warn .zv { color: #d97706; }
.zcard.bad { background: #fff1f2; border-color: #fecdd3; } .zcard.bad .zv { color: #e11d48; }
.zcard.info { background: var(--sky-xlight); border-color: var(--sky-border); } .zcard.info .zv { color: var(--sky-dark); }

/* ── Chart tabs ── */
.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tab { padding: 6px 14px; border-radius: 20px; border: 1.5px solid var(--sky-border); background: var(--sky-xlight); font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer; color: var(--sky-dark); transition: all .2s; }
.tab.on { background: var(--sky-dark); border-color: var(--sky-dark); color: #fff; }
.cbox { position: relative; height: 320px; }

/* ── AI box ── */
.aibox { background: linear-gradient(135deg, var(--sky-xlight), var(--sky-light)); border: 1.5px solid var(--sky-border); border-radius: 13px; padding: 16px; }
.aibox .ait { font-size: 13px; font-weight: 700; color: var(--sky-dark); margin-bottom: 9px; }
.aic { font-size: 13px; line-height: 1.85; color: var(--text); }

/* ── Profile list ── */
.prof-card {
  background: var(--sky-xlight); border: 2px solid var(--sky-border);
  border-radius: 12px; padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; cursor: pointer; transition: all .2s;
}
.prof-card:hover { border-color: var(--sky-dark); background: var(--sky-light); }
.prof-card .pname { font-size: 15px; font-weight: 700; color: var(--sky-dark); }
.prof-card .pinfo { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.prof-card .arrow { color: var(--sky-border); font-size: 22px; }
.prof-card:hover .arrow { color: var(--sky-dark); }

/* ── Records table ── */
.records-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.records-table th { background: var(--sky-xlight); color: var(--sky-dark); padding: 8px 10px; text-align: right; font-weight: 600; border-bottom: 2px solid var(--sky-light); }
.records-table td { padding: 8px 10px; border-bottom: 1px solid var(--sky-light); color: var(--text); }
.records-table tr:last-child td { border-bottom: none; }
.records-table tr:hover td { background: var(--sky-xlight); }

.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; direction: ltr; }
.badge-ok { background: #dcfce7; color: #16a34a; }
.badge-warn { background: #fef9c3; color: #a16207; }
.badge-bad { background: #fee2e2; color: #dc2626; }

/* ── Section nav cards (زیر نوار آبی) ── */
.section-nav {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin-bottom: 18px;
}
@media(max-width:700px){ .section-nav { grid-template-columns: repeat(2, 1fr); } }
.section-nav-card {
  background: var(--white); border: 1.5px solid var(--sky-border); border-radius: var(--radius);
  padding: 16px 10px; display: flex; flex-direction: column; align-items: center; gap: 5px;
  cursor: pointer; font-family: inherit; box-shadow: var(--shadow); transition: all .2s;
}
.section-nav-card:hover { border-color: var(--sky-dark); transform: translateY(-2px); }
.section-nav-card.active { background: var(--sky-dark); border-color: var(--sky-dark); }
.section-nav-card.active .snc-label,
.section-nav-card.active .snc-icon,
.section-nav-card.active .snc-sublabel,
.section-nav-card.active .snc-count { color: #fff; }
/* دکمه «بازگشت» بالای کارت‌ها — فقط مخصوص حالت موبایل (پایین صفحه فعال می‌شود)، در دسکتاپ همیشه پنهان */
#dash-back-btn { display: none; }

.snc-icon { font-size: 26px; line-height: 1; }
.snc-label { font-size: 13px; font-weight: 700; color: var(--sky-dark); }
.snc-sublabel { font-size: 10.5px; font-weight: 400; color: var(--text-muted); margin-top: -2px; }
.snc-count { font-size: 11px; color: var(--text-muted); }

/* ── Card title row (عنوان + دکمهٔ ثبت جدید در یک ردیف) ── */
.card-title-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-bottom: 10px; border-bottom: 2px solid var(--sky-light); margin-bottom: 16px;
}
.card-title-row h2 { border: none; margin: 0; padding: 0; }

/* ── Dashboard header ── */
.dash-header {
  background: linear-gradient(135deg, var(--sky-dark), var(--sky));
  border-radius: var(--radius); padding: 16px 20px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.dash-header .dname { font-size: 18px; font-weight: 700; color: #fff; }
.dash-header .dinfo { font-size: 12px; color: rgba(255,255,255,.8); margin-top: 3px; }
.dash-header .dash-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dash-actions .btn-sm { padding: 8px 14px; font-size: 12px; }

/* ── Spinner ── */
.spin { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--sky-light); border-top-color: var(--sky); border-radius: 50%; animation: sp .7s linear infinite; vertical-align: middle; margin-left: 6px; }
@keyframes sp { to { transform: rotate(360deg); } }

.hidden { display: none !important; }
.mt8 { margin-top: 8px; }
.empty-state { text-align: center; padding: 32px 16px; color: var(--text-muted); }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ── جعبهٔ لیست‌های مورد علاقه (دارو/مکمل) ── */
.fav-box {
  background: linear-gradient(135deg, var(--sky-xlight), var(--sky-light));
  border: 1.5px solid var(--sky-border);
  border-radius: 13px;
  padding: 16px;
  margin-bottom: 16px;
}
.fav-box-title {
  font-size: 13px; font-weight: 700; color: var(--sky-dark);
  margin-bottom: 4px; display: flex; align-items: center; gap: 6px;
}
.fav-box-hint { font-size: 11.5px; color: var(--text-muted); margin-bottom: 12px; }
.fav-row { display: flex; gap: 8px; align-items: center; }
.fav-row select {
  flex: 1; min-width: 0;
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  border: 1.5px solid var(--sky-border);
  border-radius: 9px;
  padding: 9px 12px 9px 34px;
  font-family: inherit; font-size: 13px; font-weight: 600;
  color: var(--sky-dark); background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%232c5f86' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  outline: none; direction: rtl; cursor: pointer;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.fav-row select:hover { border-color: var(--sky); }
.fav-row select:focus { border-color: var(--sky); box-shadow: 0 0 0 3px rgba(58,169,188,.18); }
.fav-row .btn-outline, .fav-row .btn-danger {
  width: auto; flex-shrink: 0;
  padding: 9px 16px; font-size: 12.5px; white-space: nowrap;
  border-radius: 9px;
}
@media(max-width:580px) {
  .fav-row { flex-wrap: wrap; }
  .fav-row select { flex-basis: 100%; }
}

/* ── Gender toggle fix ── */
.gtoggle {
  display: flex;
  border: 1.5px solid var(--sky-border);
  border-radius: 9px;
  overflow: hidden;
  background: var(--sky-xlight);
}
.gtoggle input[type="radio"] { display: none; }
.gtoggle label {
  flex: 1;
  text-align: center;
  padding: 10px 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--sky-dark);
  background: var(--sky-xlight);
  transition: all .2s;
  user-select: none;
}
.gtoggle input[type="radio"]:checked + label {
  background: var(--sky-dark);
  color: #fff;
}
.gtoggle.gtoggle-sm label { font-size: 11px; padding: 9px 4px; }

/* ── Button spacing fix ── */
.card .btn {
  margin-top: 16px;
}

.grid2 + .btn,
.grid2 + #i-err + .btn,
.grid2 + div + .btn {
  margin-top: 18px;
}

/* ── AI Analysis Enhanced ── */
.ai-report {
  font-size: 13.5px;
  line-height: 2;
  color: var(--text);
}
.ai-report .ai-section {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 11px;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(125,211,252,0.4);
}
.ai-report .ai-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--sky-dark);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1.5px solid var(--sky-light);
  padding-bottom: 7px;
}
.ai-report .ai-refs {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 14px;
  line-height: 1.9;
}
.ai-report .ai-refs strong {
  color: var(--sky-dark);
  display: block;
  margin-bottom: 5px;
  font-size: 12.5px;
}

/* ── Chatbox ── */
.chatbox-wrap {
  margin-top: 4px;
  border-top: 2px solid var(--sky-light);
  padding-top: 18px;
}
.chatbox-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--sky-dark);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 340px;
  overflow-y: auto;
  padding: 4px 2px 10px;
  scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: var(--sky-xlight); border-radius: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--sky-border); border-radius: 4px; }

.chat-msg {
  display: flex;
  gap: 8px;
  animation: fadeSlide 0.25s ease;
}
@keyframes fadeSlide { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.chat-msg.user { flex-direction: row-reverse; }
.chat-msg .avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.chat-msg.user .avatar { background: linear-gradient(135deg, var(--sky-dark), var(--sky)); }
.chat-msg.bot .avatar { background: linear-gradient(135deg, #059669, #34d399); }
.chat-msg .bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.75;
}
.chat-msg.user .bubble {
  background: linear-gradient(135deg, var(--sky-dark), var(--sky));
  color: #fff;
  border-bottom-left-radius: 4px;
}
.chat-msg.bot .bubble {
  background: #fff;
  color: var(--text);
  border: 1.5px solid var(--sky-border);
  border-bottom-right-radius: 4px;
}
.chat-msg.bot .bubble.thinking {
  color: var(--text-muted);
  font-style: italic;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  align-items: flex-end;
}
.chat-input-row textarea {
  flex: 1;
  border: 1.5px solid var(--sky-border);
  border-radius: 12px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--sky-xlight);
  resize: none;
  outline: none;
  transition: border-color .2s;
  min-height: 42px;
  max-height: 100px;
  direction: rtl;
}
.chat-input-row textarea:focus {
  border-color: var(--sky);
  box-shadow: 0 0 0 3px rgba(58,169,188,.15);
}
.chat-send-btn {
  background: linear-gradient(135deg, var(--sky-dark), var(--sky));
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 20px;
  cursor: pointer;
  transition: transform .15s;
  line-height: 1;
  height: 44px;
  display: flex; align-items: center; justify-content: center;
}
.chat-send-btn:hover { transform: scale(1.07); }
.chat-send-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.chat-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  text-align: center;
}
.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.chat-chip {
  background: var(--sky-xlight);
  border: 1px solid var(--sky-border);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--sky-dark);
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
}
.chat-chip:hover {
  background: var(--sky-dark);
  color: #fff;
  border-color: var(--sky-dark);
}

/* ── AI source badge ── */
.ai-source-badge {
  text-align: center;
  margin-top: 12px;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 11px;
  display: inline-block;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  display: block;
}
.ai-source-badge.offline { background: #f1f5f9; color: #94a3b8; }
.ai-source-badge.online  { background: #f0fdf4; color: #16a34a; }

/* ── AI body paragraph ── */
.ai-body {
  font-size: 13.5px;
  line-height: 2;
  color: var(--text);
  text-align: justify;
}

/* ── Profile button in header ── */
.btn-profile {
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 8px;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}
.btn-profile:hover { background: rgba(255,255,255,.25); }

/* ── About Us button in header (matches login/logout button family) ── */
.btn-about {
  background: rgba(255,255,255,.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 8px;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}
.btn-about:hover { background: rgba(255,255,255,.25); }

/* ── Account type badge (profile page) ── */
.acc-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  margin-right: 8px;
  vertical-align: middle;
}
.acc-badge.normal { background: #f1f5f9; color: #64748b; }
.acc-badge.pro { background: #fef9c3; color: #a16207; }
.acc-badge.admin { background: #ede9fe; color: #6d28d9; }
.acc-badge.expired { background: #fee2e2; color: #b91c1c; }

/* ── Admin table ── */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 10px;
}
.admin-table th, .admin-table td {
  padding: 8px 10px;
  text-align: right;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}
.admin-table th {
  background: var(--sky-xlight);
  color: var(--sky-dark);
  font-weight: 700;
}
.admin-table tr:hover td { background: #f8fafc; }

/* ── Captcha widget ── */
.captcha-box { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 12px; }
.captcha-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.captcha-question {
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  padding: 6px 14px;
  font-weight: 700;
  letter-spacing: 1px;
  direction: ltr;
  flex: 1;
  text-align: center;
  user-select: none;
}
.captcha-refresh {
  background: none;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 14px;
}
.captcha-refresh:hover { background: #f1f5f9; }

/* ── پرو‌پلاس badge ── */
.acc-badge.pro_plus { background: #e3f4fa; color: #1a6c8a; }

/* ── Rich-text toolbar (bold) for admin text fields ── */
.rt-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.rt-btn {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
  color: var(--sky-dark);
}
.rt-btn:hover { background: var(--sky-xlight); }
.rt-hint { font-size: 11px; color: #94a3b8; }
textarea.rt-textarea {
  width: 100%;
  min-height: 160px;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.9;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  resize: vertical;
}
textarea.rt-textarea:focus { outline: none; border-color: var(--sky-border, #93c5fd); }

/* ── Enamad badge/link ── */
.enamad-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  text-decoration: none;
  margin-top: 14px;
}
.enamad-badge:hover { background: #dcfce7; }

/* ── تصویر واقعی نماد اعتماد الکترونیکی (لوگوی رسمی enamad.ir) ── */
.enamad-seal {
  display: inline-block;
  line-height: 0;
  margin-top: 14px;
}
.enamad-seal img {
  height: 84px;
  width: auto;
  display: block;
  cursor: pointer;
}
.about-footer .enamad-seal { margin-top: 0; }

.about-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.about-footer .enamad-badge { margin-top: 0; }
.about-footer-img {
  height: 72px;
  width: auto;
  max-width: 180px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--sky-border);
  box-shadow: 0 2px 8px rgba(15,23,42,.08);
}


/* ── لینک‌های خودکار تلفن/ایمیل داخل متن غنی (درباره ما، توضیحات بسته) ── */
.rt-link {
  color: var(--sky-dark);
  text-decoration: underline;
  font-weight: 600;
}
.rt-link:hover { color: #0284c7; }

/* ── کارت‌های بسته (نمایش برای خرید در پروفایل کاربر) ── */
.pkg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  margin-top: 4px;
}
.pkg-card {
  background: var(--white);
  border: 1px solid var(--sky-light);
  border-radius: var(--radius);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.pkg-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--sky-border);
}
.pkg-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}
.pkg-card-price {
  display: flex;
  align-items: baseline;
  gap: 5px;
  color: var(--sky-dark);
  margin-bottom: 6px;
}
.pkg-card-price .num { font-size: 26px; font-weight: 800; }
.pkg-card-price .unit { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.pkg-card-duration {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--sky-xlight);
  border-radius: 20px;
  padding: 3px 12px;
  margin-bottom: 14px;
  display: inline-block;
}
.pkg-card-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.9;
  margin-bottom: 16px;
  width: 100%;
}
.pkg-card-buy {
  margin-top: auto;
  width: 100%;
}

/* ── چک کد تخفیف در صفحه پروفایل ── */
.discount-check-row { display: flex; gap: 8px; }
.discount-check-row input { flex: 1; }
.discount-check-btn {
  width: auto;
  white-space: nowrap;
  padding: 0 16px;
  font-size: 13px;
}
.pkg-price-old {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-bottom: 2px;
}
.pkg-card-price.discounted { color: var(--green); }
.pkg-discount-tag {
  font-size: 11px;
  color: var(--green);
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 20px;
  padding: 2px 10px;
  display: inline-block;
  margin-top: 4px;
}

/* ── هدر یادآوری «ورود به‌جای کاربر» توسط ادمین ── */
.imp-banner {
  background: #fef9c3;
  border-bottom: 2px solid #eab308;
  color: #713f12;
  padding: 10px 16px;
  text-align: center;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.imp-banner button {
  background: #713f12;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 13px;
  cursor: pointer;
}
.imp-banner button:hover { background: #57320d; }

/* ── کارت‌های سطح اکانت (تب «📏 محدودیت‌ها» در پنل ادمین) ── */
.tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.tier-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow .15s, border-color .15s;
}
.tier-card:hover { border-color: var(--sky-border); box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.tier-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #cbd5e1;
}
.tier-slug {
  font-family: monospace;
  font-size: 12px;
  background: #e2e8f0;
  color: #475569;
  padding: 2px 8px;
  border-radius: 6px;
}
.tier-badge.default {
  display: inline-block;
  margin-inline-start: 6px;
  background: #fef9c3;
  color: #a16207;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
}
.tier-users-count { font-size: 12px; color: #64748b; }
.tier-toggle-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #334155;
}
.tier-check { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.tier-check input { width: 16px; height: 16px; cursor: pointer; }
.tier-days-input { width: 55px !important; padding: 4px 6px !important; text-align: center; }
.tier-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px dashed #cbd5e1;
}
.btn-outline.danger { color: #dc2626; border-color: #fca5a5; }
.btn-outline.danger:hover { background: #fef2f2; }

/* ── پیام پیشنهاد خرید بسته پس از پایان سقف رایگان چت مهمان ── */
.bubble.chat-upsell {
  background: #fefce8 !important;
  border: 1px solid #fde68a !important;
  color: #713f12 !important;
}
.chat-upsell-actions { margin-top: 8px; }
.chat-chip:disabled { opacity: .45; cursor: not-allowed; }

/* ── مودال زیبا (جایگزین confirm/alert پیش‌فرض مرورگر) ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
  animation: modalFadeIn .15s ease-out;
}
@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
  background: #fff;
  border-radius: 16px;
  max-width: 420px;
  width: 100%;
  padding: 22px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  animation: modalPopIn .18s ease-out;
}
@keyframes modalPopIn { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--sky-dark);
  margin-bottom: 14px;
  text-align: center;
}
.modal-body { font-size: 14px; color: var(--text); line-height: 1.9; }
.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  justify-content: center;
}
.modal-price-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
}
.modal-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 14px;
  color: #334155;
}
.modal-price-row + .modal-price-row { border-top: 1px dashed #e2e8f0; }
.modal-price-row.discount b { color: #16a34a; }
.modal-price-row.total {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 2px solid #cbd5e1 !important;
  font-size: 15px;
}
.modal-price-row.total b { color: var(--sky-dark); font-size: 17px; }
.modal-note {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.8;
}

/* ── هشدار نبود شماره موبایل کودک وقتی یادآوری پیامکی فعال است ── */
.reminder-warning {
  background: #fff7e6;
  border: 1px solid #fcd34d;
  color: #92400e;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 14px;
  line-height: 1.8;
}
.reminder-warning a { color: #b45309; font-weight: 700; margin-right: 6px; }

/* ── نشانگر یادداشت روی هر ردیف اندازه‌گیری ── */
.note-badge { cursor: help; font-size: 13px; opacity: .85; }

/* ── جعبه یادداشت اختیاری برای هر اندازه‌گیری ── */
.note-box {
  background: linear-gradient(135deg, var(--sky-xlight), #ffffff);
  border: 1.5px dashed var(--sky-border);
  border-radius: 12px;
  padding: 12px 14px 8px;
}
.note-box-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--sky-dark);
  margin-bottom: 8px;
}
.note-optional { font-weight: 400; color: var(--text-muted); font-size: 11px; }
.note-box textarea {
  border: 1.5px solid var(--sky-border);
  border-radius: 9px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  width: 100%;
  resize: vertical;
  min-height: 64px;
  background: #fff;
  outline: none;
  line-height: 1.7;
  transition: border-color .2s, box-shadow .2s;
}
.note-box textarea:focus { border-color: var(--sky); box-shadow: 0 0 0 3px rgba(58,169,188,.18); }
.note-box textarea::placeholder { color: #b9c6d0; }
.note-box-footer { display: flex; justify-content: flex-end; margin-top: 4px; }
.note-box-footer span { font-size: 11px; color: var(--text-muted); }

/* ── مودال ثبت آزمایش خون ── */
.bt-modal {
  max-width: 640px;
  max-height: 88vh;
  overflow-y: auto;
}
.vax-modal {
  max-width: 620px;
  max-height: 88vh;
  overflow-y: auto;
}
.bt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px 14px;
}
.bt-field label { font-size: 12px; }
.bt-field-wide { grid-column: 1 / -1; }
.bt-range { font-weight: 400; color: var(--text-muted); font-size: 11px; }
.bt-input-abnormal {
  border-color: #ef4444 !important;
  background: #fef2f2 !important;
  color: #b91c1c !important;
  font-weight: 700;
}
.bt-input-abnormal:focus { box-shadow: 0 0 0 3px rgba(239,68,68,.18) !important; }

/* ── دسته‌بندی آزمایش‌ها داخل مودال ثبت ── */
.bt-category { margin-bottom: 16px; }
.bt-category-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--sky-dark);
  background: var(--sky-light);
  border-radius: 8px;
  padding: 6px 12px;
  margin-bottom: 10px;
  display: inline-block;
}

/* ── کارت هر آزمایش خون در تاریخچه ── */
.bt-entry {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: #fafcfe;
}
.bt-entry-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.bt-entry-date { font-weight: 700; color: var(--sky-dark); font-size: 13px; }
.bt-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.bt-chip {
  font-size: 12px;
  background: var(--sky-light);
  color: var(--text);
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
  border: none;
}
.bt-chip:hover { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(44,95,134,.25); }
.bt-chip-abnormal { background: #fee2e2; color: #b91c1c; font-weight: 700; }
.bt-panel-badge {
  font-size: 10px;
  font-weight: 700;
  color: #7c3aed;
  background: #ede9fe;
  border-radius: 999px;
  padding: 2px 8px;
  margin-right: 6px;
}

/* ── سازنده‌ی پنل آزمایش سفارشی ── */
.cp-field-row {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: #fafcfe;
}
.cp-field-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.cp-field-row-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--sky-dark);
}
.cp-field-row-remove {
  border: none;
  background: #fee2e2;
  color: #dc2626;
  font-weight: 700;
  font-size: 11px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
  transition: background .12s;
}
.cp-field-row-remove:hover { background: #fecaca; }
.cp-panel-chip { display: inline-flex; align-items: center; gap: 6px; cursor: default; }
.cp-panel-chip-remove {
  border: none;
  background: none;
  color: #dc2626;
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
  padding: 0;
}
#cp-err:not(:empty) { margin-top: 10px; }

/* ── یادداشت پزشک: نوار ابزار متن غنی ── */
.note-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding: 6px 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px 8px 0 0;
}
.note-tb-btn {
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 6px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 13px;
  color: var(--sky-dark);
  transition: background .12s;
}
.note-tb-btn:hover { background: var(--sky-xlight); }
.note-tb-select {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  background: #fff;
  color: var(--text-main);
}
.note-editor {
  min-height: 160px;
  border: 1px solid #e2e8f0;
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.8;
  background: #fff;
  outline: none;
}
.note-editor:focus { box-shadow: inset 0 0 0 2px var(--sky-border); }
.note-preview {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.8;
  background: #fafcfe;
  max-height: 160px;
  overflow-y: auto;
}

/* ── سابقه‌ی جراحی: طراحی خط زمانی (تایم‌لاین) ── */
.surgery-timeline { position: relative; }
.surg-item {
  display: flex;
  gap: 14px;
  position: relative;
  padding-bottom: 22px;
}
.surg-item:last-child { padding-bottom: 0; }
.surg-item:not(:last-child)::before {
  content: '';
  position: absolute;
  top: 42px;
  right: 19px;
  bottom: -2px;
  width: 2px;
  background: linear-gradient(to bottom, #fca5a5, transparent);
}
.surg-item-badge {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #fca5a5;
  z-index: 1;
}
.surg-item-body {
  flex: 1;
  min-width: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(15,23,42,.05);
}
.surg-item-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.surg-item-title { font-weight: 700; font-size: 15px; color: var(--text-main); }
.surg-item-date { font-size: 12px; color: var(--text-muted); }
.surg-item-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.surg-meta-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.surg-meta-chip {
  background: #f1f5f9;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  color: #475569;
}
.surg-section {
  font-size: 13px;
  margin-top: 6px;
  line-height: 1.7;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--text-main);
}
.surg-section-complication { background: #fef2f2; color: #991b1b; }
.surg-section-note { background: #fafcfe; color: var(--text-muted); }
.bt-entry-note { margin-top: 8px; font-size: 12px; color: var(--text-muted); background: #fff; border: 1px dashed #e2e8f0; border-radius: 8px; padding: 6px 10px; }

/* ── مودال روند تغییرات یک آزمایش خون ── */
.bt-trend-modal { max-width: 620px; }
.bt-trend-chart-wrap { position: relative; height: 320px; width: 100%; }

/* ── جعبه آپلود و تشخیص خودکار آزمایش خون ── */
.bt-upload-box {
  background: linear-gradient(135deg, var(--sky-light), #fff);
  border: 1.5px dashed var(--sky);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.bt-upload-title { font-size: 13px; font-weight: 700; color: var(--sky-dark); margin-bottom: 8px; }
.bt-upload-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bt-upload-row input[type="file"] {
  flex: 1;
  min-width: 180px;
  font-size: 12px;
  border: 1.5px solid var(--sky-border);
  border-radius: 9px;
  padding: 7px 10px;
  background: #fff;
}

/* ══════════════ کارت واکسیناسیون ══════════════ */
.vax-progress-wrap { margin-bottom: 22px; }
.vax-progress-text { font-size: 13px; font-weight: 700; color: var(--sky-dark); margin-bottom: 8px; }
.vax-progress-bar {
  height: 12px;
  background: #eef2f5;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.08);
}
.vax-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--navy), var(--sky), var(--teal-green));
  border-radius: 999px;
  transition: width .5s ease;
}

.vax-timeline {
  position: relative;
  padding-inline-start: 22px;
  border-inline-start: 3px dashed var(--sky-border);
}
.vax-group { position: relative; margin-bottom: 22px; }
.vax-group:last-child { margin-bottom: 0; }
.vax-group-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.vax-age-dot {
  position: absolute;
  right: -33px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--sky);
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--sky);
}
.vax-age-label {
  font-size: 14px;
  font-weight: 800;
  color: var(--navy);
  background: var(--sky-light);
  padding: 3px 12px;
  border-radius: 999px;
}
.vax-items { display: flex; flex-direction: column; gap: 8px; }

.vax-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fafcfe;
  border: 1.5px solid #e6edf2;
  border-radius: 12px;
  padding: 10px 12px;
  transition: box-shadow .15s, border-color .15s;
}
.vax-item:hover { box-shadow: 0 2px 10px rgba(44,95,134,.1); }
.vax-item-body { flex: 1; min-width: 0; }
.vax-item-title { font-size: 13px; font-weight: 700; color: var(--text); }
.vax-item-disease { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.vax-item-date { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.vax-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
  align-self: center;
}

.vax-item.vax-done { background: #f0faf3; border-color: #bbe8c8; }
.vax-item.vax-done .vax-badge { background: #dcfce7; color: #15803d; }
.vax-item.vax-overdue { background: #fef2f2; border-color: #fecaca; }
.vax-item.vax-overdue .vax-badge { background: #fee2e2; color: #b91c1c; }
.vax-item.vax-due { background: #fffbeb; border-color: #fde68a; }
.vax-item.vax-due .vax-badge { background: #fef3c7; color: #a16207; }
.vax-item.vax-upcoming { opacity: .72; }
.vax-item.vax-upcoming .vax-badge { background: #f1f5f9; color: #64748b; }

/* چک‌باکس خفن‌شده */
.vax-checkbox-wrap { position: relative; flex-shrink: 0; margin-top: 2px; cursor: pointer; }
.vax-checkbox-wrap input { position: absolute; opacity: 0; width: 26px; height: 26px; margin: 0; cursor: pointer; }
.vax-checkmark {
  display: block;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 2px solid var(--sky-border);
  background: #fff;
  transition: all .15s;
  position: relative;
}
.vax-checkbox-wrap input:checked ~ .vax-checkmark {
  background: linear-gradient(135deg, var(--navy), var(--sky));
  border-color: var(--sky-dark);
}
.vax-checkmark::after {
  content: "";
  position: absolute;
  display: none;
  right: 8px;
  top: 3px;
  width: 6px;
  height: 12px;
  border: solid white;
  border-width: 0 3px 3px 0;
  transform: rotate(35deg);
}
.vax-checkbox-wrap input:checked ~ .vax-checkmark::after { display: block; }
.vax-checkbox-wrap:hover .vax-checkmark { border-color: var(--sky); transform: scale(1.05); }

/* ── زنگوله‌ی اعلان‌ها (پیام‌های اشتراک‌گذاری اطلاعات کودک) ── */
.notif-badge {
  position: absolute; top: -4px; left: -4px;
  background: #dc2626; color: #fff; font-size: 10px; font-weight: 700;
  border-radius: 999px; min-width: 16px; height: 16px; line-height: 16px;
  text-align: center; padding: 0 3px;
}
.notif-panel {
  position: absolute; left: 20px; top: 64px; width: 340px; max-width: 90vw;
  max-height: 70vh; overflow-y: auto; background: #fff; color: #1e293b;
  border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.25); z-index: 200;
}
.notif-panel-head {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 12px 14px; border-bottom: 1px solid #e2e8f0; font-size: 14px;
}
.notif-panel-list { padding: 6px; }
.notif-item { padding: 10px 10px; border-radius: 8px; margin-bottom: 4px; }
.notif-item.unread { background: #f0f9ff; }
.notif-item-title { font-size: 13px; font-weight: 700; }
.notif-item-body { font-size: 12px; color: #475569; margin-top: 4px; line-height: 1.7; }
.notif-item-date { font-size: 11px; color: #94a3b8; margin-top: 4px; }

/* ── پیش‌بینی قد آینده (Mid-Parental Height) ── */
.hp-card {
  background: var(--sky-xlight);
  border: 1px solid var(--sky-border);
  border-radius: 14px;
  padding: 20px 18px;
  text-align: center;
}
.hp-value {
  font-size: 34px;
  font-weight: 800;
  color: var(--sky-dark);
  line-height: 1.2;
}
.hp-value span {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-right: 6px;
}
.hp-range-label {
  font-size: 13px;
  color: var(--text);
  opacity: .8;
  margin-top: 4px;
  margin-bottom: 18px;
}
.hp-bar-wrap { max-width: 420px; margin: 0 auto; direction: ltr; }
.hp-bar {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--sky-border), var(--sky), var(--sky-dark));
}
.hp-marker {
  position: absolute;
  top: 50%;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--sky-dark);
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
  transform: translate(-50%, -50%);
}
.hp-scale {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text);
  opacity: .75;
  margin-top: 8px;
}

/* ══════════════════════════════════════════════════════════════
   نمایش موبایل — اصلاحات ریسپانسیو
   (بدون تغییر در ظاهر دسکتاپ؛ همه چیز فقط زیر بریک‌پوینت‌های پایین فعال می‌شود)
   ══════════════════════════════════════════════════════════════ */

/* جلوگیری از اسکرول افقی ناخواسته کل صفحه */
html, body { overflow-x: hidden; width: 100%; }

@media (max-width: 760px) {
  .container { padding: 14px 12px; }
  .card { padding: 16px 14px; }

  /* ── هدر: قبلاً روی موبایل ۴ دکمه (زنگوله/درباره‌ما/نام کاربر/خروج)
     کنار هم فشرده می‌شدند و از عرض صفحه بیرون می‌زدند ── */
  header {
    padding: 10px 12px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .hdr-brand { gap: 8px; }
  .hdr-brand .logo { width: 34px; height: 34px; }
  .hdr-brand h1 { font-size: 14px; }
  .hdr-brand p { display: none; } /* زیرنویس «پایش رشد کودک...» روی موبایل جا نمی‌شود */
  .hdr-user { gap: 6px; }
  .hdr-user span { font-size: 12px; }
  .btn-logout, .btn-profile, .btn-about {
    padding: 6px 9px;
    font-size: 11px;
  }
  /* روی موبایل فقط آیکن دکمه‌ها دیده می‌شود، متن پنهان می‌شود (title همچنان برای اسکرین‌ریدر باقی می‌ماند) */
  .hdr-txt { display: none; }
  .hdr-uname {
    display: inline-block;
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
  }
  #notif-panel.notif-panel { top: 56px; left: 8px; width: calc(100vw - 16px); }
}

@media (max-width: 480px) {
  .container { padding: 12px 10px; }
  .card { padding: 14px 12px; margin-bottom: 14px; }
  .card h2 { font-size: 14px; }

  /* جلوگیری از زوم خودکار سافاری روی iOS هنگام فوکوس روی فیلدها */
  .fg input, .fg select, .fg textarea { font-size: 16px; }

  /* ردیف تاریخ (سال/ماه/روز [+ دکمه امروز]) که روی موبایل بیش‌ازحد فشرده می‌شد */
  .d3 { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .d3t { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .d3t .btn-today { grid-column: 1 / -1; width: 100%; padding: 10px; }

  .section-nav { gap: 8px; }
  .section-nav-card { padding: 12px 6px; }
  .snc-icon { font-size: 22px; }
  .snc-label { font-size: 12px; }

  /* ── فقط موبایل: با انتخاب یک کارت، بقیه کارت‌ها محو و جمع می‌شوند و دکمه بازگشت ظاهر می‌شود ── */
  .section-nav-card.snc-fading-out { opacity: 0; transform: scale(.95); pointer-events: none; }
  .section-nav-card.snc-hidden-mobile { display: none; }
  .section-nav.nav-collapsed { grid-template-columns: 1fr; }
  #dash-back-btn.show {
    display: inline-flex; align-items: center; gap: 6px;
    margin-bottom: 12px; background: #fff; color: var(--sky-dark); border: 1px solid var(--sky-border);
  }

  .dash-header { padding: 14px 16px; }
  .dash-header .dname { font-size: 16px; }

  .cbox { height: 260px; }

  .auth-box { padding: 26px 20px; }
  .auth-logo-img { width: 76px; height: 76px; }

  .hp-value { font-size: 26px; }

  .modal-box { padding: 16px; }

  .btn-row { flex-wrap: wrap; }
  .discount-check-row { flex-wrap: wrap; }
  .discount-check-row input { flex-basis: 100%; }
}

@media (max-width: 380px) {
  .hdr-brand h1 { font-size: 13px; }
  .hdr-uname { max-width: 40px; }
  .btn-logout, .btn-profile, .btn-about { padding: 5px 7px; font-size: 10px; }
  .zgrid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .zcard { padding: 8px; }
  .zcard .zv { font-size: 17px; }
}
