@import url('/lib/vazirmatn/Vazirmatn-font-face.css');

:root {
  --brand-50:  #eefbf7;
  --brand-100: #d3f5ea;
  --brand-500: #12b886;
  --brand-600: #0ca678;
  --brand-700: #099268;
  --ink-900: #101828;
  --ink-700: #344054;
  --ink-500: #667085;
  --ink-300: #d0d5dd;
  --ink-100: #f2f4f7;
  --surface: #ffffff;
  --bg: #f7f9fb;
  --danger: #e03131;
  --warning: #f08c00;
  --info: #1c7ed6;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.06);
  --shadow-md: 0 6px 20px rgba(16,24,40,.08);
}

* { box-sizing: border-box; }

body {
  font-family: 'Vazirmatn', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink-900);
  direction: rtl;
}

a { text-decoration: none; }

/* ---------- Landing ---------- */
.hero {
  background: radial-gradient(1200px 500px at 20% -10%, var(--brand-100), transparent),
              linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
  padding: 96px 0 64px;
}

.hero h1 {
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.3;
}

.brand-gradient {
  background: linear-gradient(90deg, var(--brand-600), #0b7285);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.btn-brand {
  background: var(--brand-600);
  border: none;
  color: #fff;
  font-weight: 600;
  padding: .75rem 1.6rem;
  border-radius: var(--radius-md);
  transition: transform .15s ease, background .15s ease;
}
.btn-brand:hover { background: var(--brand-700); color: #fff; transform: translateY(-1px); }

.btn-outline-brand {
  border: 1.5px solid var(--brand-600);
  color: var(--brand-700);
  font-weight: 600;
  padding: .75rem 1.6rem;
  border-radius: var(--radius-md);
  background: #fff;
}
.btn-outline-brand:hover { background: var(--brand-50); color: var(--brand-700); }

/* ---------- سبک یکپارچه‌ی دکمه‌ها در کل برنامه ----------
   باگ: سبک بصری دکمه‌ها بین صفحات مختلف یکسان نبود - برخی صفحات (مثل دکمه‌های brand بالا) گرد و
   شیک بودند و بقیه (btn-outline-danger/btn-outline-secondary/btn-success و مشابه پیش‌فرض
   بوت‌استرپ که در اکثر Viewها برای عملیات حذف/لغو/تغییر وضعیت استفاده شده‌اند) با شعاع گوشه، ضخامت
   حاشیه و وزن فونت پیش‌فرض بوت‌استرپ رندر می‌شدند. به‌جای بازنویسی تک‌تک صفحات (که دوباره احتمال
   فراموش‌شدن در صفحه‌ی بعدی را دارد)، این‌جا یک قانون سراسری روی خودِ کلاس‌های استاندارد بوت‌استرپ
   (.btn*) گذاشته شده تا هر دکمه‌ای، در هر صفحه‌ای از برنامه، از همین یک منبع سبک بگیرد. رنگ‌های
   معنایی خودِ بوت‌استرپ (danger/success/secondary/warning/...) دست‌نخورده مانده‌اند - فقط شکل
   (گردی گوشه، ضخامت حاشیه، وزن فونت، انیمیشن Hover) یکدست شده. */
.btn {
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.btn.btn-sm { border-radius: 10px; padding: .4rem 1rem; font-size: .82rem; }
.btn[class*="btn-outline-"] { border-width: 1.5px; }
.btn:not(:disabled):not(.disabled):hover { transform: translateY(-1px); }
.btn:disabled, .btn.disabled { transform: none; opacity: .55; }
.btn-success, .btn-outline-success { --bs-btn-hover-color: #fff; }
.btn-check:checked + .btn, .btn:active, .btn.active { transform: none; }

.feature-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--ink-100);
  height: 100%;
  transition: box-shadow .2s ease, transform .2s ease;
}
.feature-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }

.feature-icon {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: var(--brand-50);
  color: var(--brand-600);
  font-size: 22px;
  margin-bottom: 14px;
}

.panel-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--ink-100);
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: .85rem;
  color: var(--ink-700);
  box-shadow: var(--shadow-sm);
}

/* ---------- Auth pages ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--brand-700), #0b7285);
  padding: 24px;
}
.auth-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 40px;
  width: 100%;
  max-width: 440px;
}
.form-control, .form-select {
  border-radius: 10px;
  border: 1.5px solid var(--ink-300);
  padding: .65rem .9rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px var(--brand-100);
}
.form-label { font-weight: 600; color: var(--ink-700); font-size: .9rem; }

/* ---------- Split auth shell (ورود مدیر مرکز/کادر درمان و ورود ادمین شرکت) ----------
   طرح دو-ستونه: سمت راست پنل برند/معرفی، سمت چپ فرم. برای این‌که هر ساب‌دامین (Dashboard/Admin)
   هویت بصری مجزای خودش را داشته باشد، دو مدیفایر رنگی جدا تعریف شده - staff (سبز/آبی برند اصلی
   محصول) و admin (سرمه‌ای/خاکستری تیره، برای انتقال حس «پنل امن/پشتیبانی داخلی»، عمداً متفاوت
   از رنگ محصول تا کاربر بلافاصله بفهمد این بخش دیگری از سایت است). */
.auth-shell {
  min-height: 100vh;
  display: flex;
  background: var(--bg);
}
.auth-shell-info {
  flex: 1 1 44%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px 56px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.auth-shell-info::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(700px 420px at 15% 15%, rgba(255,255,255,.10), transparent 60%),
              radial-gradient(600px 500px at 90% 90%, rgba(255,255,255,.08), transparent 55%);
}
.auth-shell-info > * { position: relative; z-index: 1; }
.auth-shell--staff .auth-shell-info { background: linear-gradient(160deg, var(--brand-700), #0b7285 85%); }
.auth-shell--admin .auth-shell-info { background: linear-gradient(160deg, #1b2735, #0d1622 85%); }

.auth-shell-badge {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.08);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: .8rem;
  font-weight: 600;
  width: fit-content;
  margin-bottom: 22px;
}
.auth-shell-info h2 { font-weight: 800; font-size: 1.9rem; line-height: 1.4; margin-bottom: 14px; }
.auth-shell-info p.lead-text { color: rgba(255,255,255,.82); font-size: .98rem; max-width: 400px; }
.auth-shell-points { list-style: none; padding: 0; margin: 30px 0 0; display: flex; flex-direction: column; gap: 14px; }
.auth-shell-points li { display: flex; align-items: flex-start; gap: 12px; font-size: .92rem; color: rgba(255,255,255,.92); }
.auth-shell-points li i { font-size: 1.05rem; margin-top: 1px; color: rgba(255,255,255,.95); }

.auth-shell-form {
  flex: 1 1 56%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.auth-shell-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 40px;
}
.auth-shell--admin .auth-shell-card { border-top: 3px solid #1b2735; }
.auth-shell--staff .auth-shell-card { border-top: 3px solid var(--brand-600); }

.auth-icon-badge {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 14px;
}
.auth-shell--staff .auth-icon-badge { background: var(--brand-50); color: var(--brand-600); }
.auth-shell--admin .auth-icon-badge { background: #eef1f5; color: #1b2735; }

.auth-shell--admin .btn-brand { background: #1b2735; }
.auth-shell--admin .btn-brand:hover { background: #101a24; }
.auth-shell--admin .form-control:focus { border-color: #1b2735; box-shadow: 0 0 0 3px rgba(27,39,53,.12); }

@media (max-width: 900px) {
  .auth-shell { flex-direction: column; }
  .auth-shell-info { padding: 40px 28px; flex: 0 0 auto; }
  .auth-shell-points { display: none; }
  .auth-shell-form { padding: 32px 20px 56px; }
}

/* ---------- Role-chooser page (Views/Account/Login.cshtml - فقط برای محیط توسعه/تک-دامنه) ---------- */
.role-choice-card {
  display: block;
  background: var(--surface);
  border: 1.5px solid var(--ink-100);
  border-radius: var(--radius-lg);
  padding: 26px 22px;
  text-align: center;
  color: var(--ink-900);
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
  height: 100%;
}
.role-choice-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: var(--brand-500); }
.role-choice-icon {
  width: 56px; height: 56px; margin: 0 auto 16px;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  background: var(--brand-50); color: var(--brand-600);
}

/* asp-validation-summary همیشه یک div رندر می‌کند، حتی وقتی خطایی نیست - فقط کلاس زیر را اضافه
   می‌کند (بدون حذف alert/alert-danger که خودمان گذاشته‌ایم). بدون این قانون، یک باکس قرمز خالی
   همیشه بالای فرم‌ها دیده می‌شود. وقتی خطا واقعی وجود دارد، این کلاس با validation-summary-errors
   جایگزین می‌شود و باکس دوباره نمایش داده خواهد شد. */
.validation-summary-valid {
  display: none;
}

/* ---------- Dashboard shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 264px;
  flex-shrink: 0;
  background: #0f2027;
  background: linear-gradient(195deg, #10222a 0%, #0b1b21 100%);
  color: #e6f2f0;
  padding: 20px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.1rem;
  color: #fff;
  padding: 8px 10px 20px;
}
.sidebar-badge {
  font-size: .7rem;
  font-weight: 600;
  color: var(--brand-100);
  background: rgba(18,184,134,.18);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 18px;
  display: inline-block;
}
.nav-section-title {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #7d99a0;
  margin: 18px 10px 8px;
  font-weight: 700;
}
.sidebar .nav-link {
  color: #cfe3e0;
  border-radius: 10px;
  padding: .6rem .8rem;
  margin-bottom: 2px;
  font-weight: 500;
  font-size: .92rem;
  display: flex; align-items: center; gap: 10px;
}
.sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar .nav-link.active {
  background: var(--brand-600);
  color: #fff;
  font-weight: 700;
}

.main-col { flex: 1; min-width: 0; }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--ink-100);
  padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10;
}

.content-area { padding: 28px; }

.stat-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--ink-100);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.stat-card .stat-value { font-size: 1.8rem; font-weight: 800; color: var(--ink-900); }
.stat-card .stat-label { color: var(--ink-500); font-size: .85rem; font-weight: 600; }
.stat-card .stat-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}

.panel-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--ink-100);
  box-shadow: var(--shadow-sm);
}
.panel-card .panel-card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--ink-100);
  font-weight: 700;
  display: flex; align-items: center; justify-content: space-between;
}
.panel-card .panel-card-body { padding: 22px; }

.badge-status-pending  { background: #fff4e0; color: var(--warning); }
.badge-status-confirmed{ background: #e7f5ff; color: var(--info); }
.badge-status-checkedin{ background: #eef2ff; color: #4338ca; }
.badge-status-completed{ background: var(--brand-50); color: var(--brand-700); }
.badge-status-cancelled{ background: #fff0f0; color: var(--danger); }
.badge-status-noshow   { background: var(--ink-100); color: var(--ink-500); }
.badge-status-active        { background: var(--brand-50); color: var(--brand-700); }
.badge-status-pendingapproval { background: #fff4e0; color: var(--warning); }
.badge-status-suspended     { background: #fff0f0; color: var(--danger); }
.badge-status-rejected      { background: var(--ink-100); color: var(--ink-500); }
.badge-status-expired       { background: #fff0f0; color: var(--danger); }
.status-badge {
  font-size: .78rem; font-weight: 700; border-radius: 999px; padding: 4px 12px;
  display: inline-block;
}

.table-modern thead th {
  border: none; color: var(--ink-500); font-size: .8rem; text-transform: uppercase;
  letter-spacing: .03em; font-weight: 700; padding-bottom: 12px;
}
.table-modern tbody td { padding: 14px 10px; border-color: var(--ink-100); vertical-align: middle; }
.table-modern tbody tr:hover { background: var(--ink-100); }

@media (max-width: 900px) {
  .sidebar { position: fixed; right: -280px; z-index: 40; transition: right .2s ease; }
  .sidebar.open { right: 0; }
  .content-area { padding: 16px; }
}

/* ---------- Ticket chat thread ---------- */
.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 520px;
  overflow-y: auto;
  padding: 6px 2px;
}
.chat-bubble-row { display: flex; }
.chat-bubble-row.mine { justify-content: flex-start; }
.chat-bubble-row.theirs { justify-content: flex-end; }
.chat-bubble {
  max-width: 72%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: .9rem;
  line-height: 1.6;
}
.chat-bubble.mine {
  background: var(--brand-600);
  color: #fff;
  border-bottom-left-radius: 4px;
}
.chat-bubble.theirs {
  background: var(--ink-100);
  color: var(--ink-900);
  border-bottom-right-radius: 4px;
}
.chat-bubble .chat-meta {
  font-size: .72rem;
  opacity: .75;
  margin-top: 6px;
  display: block;
}

/* ---------- کارت‌های پلن (سفارش خودسرویس لایسنس/VIP توسط مدیر مرکز) ----------
   هر کارت با --accent/--accent-dark (ست‌شده inline از سمت View) رنگ‌بندی می‌شود تا
   پلن‌های مختلف به‌سادگی از هم تفکیک بصری شوند - مشابه صفحات قیمت‌گذاری معمول. */
.plan-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}
.plan-card {
  --accent: var(--brand-600);
  --accent-dark: var(--brand-700);
  position: relative;
  background: var(--surface);
  border: 1.5px solid var(--ink-100);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.plan-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}
.plan-card.is-disabled { cursor: not-allowed; opacity: .55; filter: grayscale(.35); }
.plan-card.is-disabled:hover { transform: none; box-shadow: none; }
.plan-card-top {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  padding: 18px 20px 14px;
  color: #fff;
}
.plan-card-top .plan-card-name { font-size: 1.1rem; font-weight: 800; margin-bottom: 10px; }
.plan-card-duration {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 999px;
  padding: 4px 14px;
  font-weight: 700;
  font-size: .8rem;
}
.plan-card-body { padding: 18px 20px; flex: 1; display: flex; flex-direction: column; }
.plan-card-price { font-size: 1.45rem; font-weight: 800; color: var(--ink-900); }
.plan-card-price small { font-size: .76rem; font-weight: 600; color: var(--ink-500); }
.plan-card-features { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.plan-card-features li { display: flex; align-items: flex-start; gap: 8px; font-size: .83rem; color: var(--ink-700); line-height: 1.5; }
.plan-card-features li i { color: var(--accent); margin-top: 3px; flex-shrink: 0; }
.plan-card-footer { padding: 14px 20px; border-top: 1px solid var(--ink-100); }
.plan-card-cta {
  display: block;
  width: 100%;
  text-align: center;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 9px 0;
  font-weight: 700;
  font-size: .87rem;
}
.plan-card.is-disabled .plan-card-cta { background: var(--ink-300); color: var(--ink-700); }
.plan-card-current-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: #fff;
  color: var(--accent-dark);
  font-size: .72rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}

/* ---------- دکمه/کارت پرداخت آنلاین با زرین‌پال ----------
   رنگ‌بندی زرد/نارنجی برند زرین‌پال، عمداً متفاوت از --brand سبز سامانه تا کاربر بلافاصله
   دکمه‌ی «پرداخت واقعی و آنی» را از «ثبت سفارش/بررسی دستی» تشخیص دهد. */
.btn-zarinpal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: linear-gradient(135deg, #ffc233, #ff8f1f);
  border: none;
  color: #402400;
  font-weight: 800;
  font-size: .92rem;
  padding: 11px 0;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(255, 143, 31, .35);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-zarinpal:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(255, 143, 31, .45);
  color: #402400;
}
.btn-zarinpal:disabled, .btn-zarinpal.disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}
.btn-zarinpal i { font-size: 1.05rem; }

.payment-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  color: var(--ink-500);
  font-size: .78rem;
}
.payment-divider::before, .payment-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--ink-100);
}

.zarinpal-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fff4e0;
  color: #b25b00;
  border: 1px solid #ffdca6;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: .72rem;
  font-weight: 700;
}

/* ---------- صفحه‌بندی سراسری (برند‌شده روی همان کلاس استاندارد بوت‌استرپ) ---------- */
.pagination .page-link {
  border: 1.5px solid var(--ink-100);
  color: var(--ink-700);
  font-weight: 600;
  margin: 0 2px;
  border-radius: 8px !important;
}
.pagination .page-link:hover { background: var(--brand-50); color: var(--brand-700); }
.pagination .page-item.active .page-link { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.pagination .page-item.disabled .page-link { color: var(--ink-300); background: transparent; }

/* ---------- کارت‌های آماری کوچک (بالای صفحه‌ی مدارک/تصاویر) ---------- */
.mini-stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.mini-stat {
  background: var(--surface);
  border: 1px solid var(--ink-100);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-sm);
}
.mini-stat .mini-stat-icon {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  background: var(--brand-50); color: var(--brand-600);
}
.mini-stat .mini-stat-value { font-size: 1.35rem; font-weight: 800; color: var(--ink-900); line-height: 1.1; }
.mini-stat .mini-stat-label { font-size: .78rem; color: var(--ink-500); font-weight: 600; margin-top: 2px; }

/* ---------- نوار جستجو/فیلتر مینیمال داخل هر کارت (اسناد/تصاویر/دسترسی مراکز) ---------- */
.section-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.section-toolbar .search-box { position: relative; flex: 1; min-width: 160px; }
.section-toolbar .search-box i {
  position: absolute; top: 50%; right: 12px; transform: translateY(-50%);
  color: var(--ink-500); font-size: .85rem; pointer-events: none;
}
.section-toolbar .search-box input {
  padding-right: 34px; font-size: .85rem;
}

/* ---------- منطقه‌ی آپلود کشیدن‌وانداختن ---------- */
.upload-dropzone {
  border: 1.5px dashed var(--ink-300);
  border-radius: var(--radius-md);
  background: var(--bg);
  padding: 16px;
  display: flex; align-items: center; gap: 12px;
  transition: border-color .15s ease, background .15s ease;
  cursor: pointer;
}
.upload-dropzone:hover, .upload-dropzone.is-dragover { border-color: var(--brand-500); background: var(--brand-50); }
.upload-dropzone .upload-dropzone-icon {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  background: var(--surface); border: 1px solid var(--ink-100);
  display: flex; align-items: center; justify-content: center;
  color: var(--brand-600); font-size: 17px;
}
.upload-dropzone .upload-dropzone-title { font-weight: 700; font-size: .85rem; color: var(--ink-700); }
.upload-dropzone .upload-dropzone-hint { font-size: .74rem; color: var(--ink-500); }
.upload-dropzone input[type=file] { display: none; }
.upload-filename-chip {
  display: none;
  align-items: center; gap: 6px;
  background: var(--brand-50); color: var(--brand-700);
  border-radius: 8px; padding: 4px 10px; font-size: .78rem; font-weight: 600;
  margin-top: 8px;
}
.upload-filename-chip.show { display: inline-flex; }

/* ---------- گرید گالری تصاویر درمانی ---------- */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.media-tile {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: var(--ink-100);
  border: 1px solid var(--ink-100);
  box-shadow: var(--shadow-sm);
}
.media-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-tile .media-tile-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(16,24,40,0) 40%, rgba(16,24,40,.82) 100%);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 8px;
  opacity: 0; transition: opacity .15s ease;
}
.media-tile:hover .media-tile-overlay { opacity: 1; }
.media-tile .media-tile-name {
  color: #fff; font-size: .72rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 6px;
}
.media-tile .media-tile-actions { display: flex; gap: 6px; }
.media-tile .media-tile-actions .btn {
  padding: .25rem .5rem; font-size: .72rem; border-radius: 7px; flex: 1;
}
.media-tile .media-tile-date {
  position: absolute; top: 6px; right: 6px;
  background: rgba(16,24,40,.55); color: #fff;
  font-size: .64rem; font-weight: 600;
  padding: 2px 7px; border-radius: 999px;
}

/* ---------- ردیف اسناد (لیست با آیکون نوع فایل) ---------- */
.doc-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--ink-100);
}
.doc-row:last-child { border-bottom: none; }
.doc-row .doc-icon {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 17px;
  background: var(--ink-100); color: var(--ink-500);
}
.doc-row .doc-icon.is-pdf { background: #fdecec; color: var(--danger); }
.doc-row .doc-icon.is-image { background: var(--brand-50); color: var(--brand-600); }
.doc-row .doc-meta { flex: 1; min-width: 0; }
.doc-row .doc-name {
  font-weight: 600; font-size: .87rem; color: var(--ink-900);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block;
}
.doc-row .doc-date { font-size: .74rem; color: var(--ink-500); }
.doc-row .doc-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ---------- ردیف/جدول دسترسی مراکز به پرونده ---------- */
.clinic-access-row { display: flex; align-items: center; gap: 10px; }
.clinic-avatar {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-50); color: var(--brand-600); font-size: 16px;
}
.empty-state {
  text-align: center; padding: 36px 16px; color: var(--ink-500);
}
.empty-state i { font-size: 1.8rem; color: var(--ink-300); margin-bottom: 10px; display: block; }
.empty-state .empty-state-text { font-size: .85rem; font-weight: 600; }

/* ---------- کارت‌های وضعیت دسترسی (صفحه‌ی جستجوی بیمار برای تصاویر/مدارک) ---------- */
.access-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.access-status-card {
  border: 1.5px solid var(--ink-100);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  background: var(--surface);
  display: flex; flex-direction: column; gap: 10px;
}
.access-status-card.is-granted { border-color: var(--brand-100); background: var(--brand-50); }
.access-status-card .access-status-top { display: flex; align-items: center; gap: 10px; }
.access-status-card .access-status-icon {
  width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  background: var(--ink-100); color: var(--ink-500);
}
.access-status-card.is-granted .access-status-icon { background: var(--brand-600); color: #fff; }
.access-status-card .access-status-title { font-weight: 700; font-size: .92rem; }
.access-status-card .access-status-sub { font-size: .76rem; color: var(--ink-500); }
.access-status-card form { margin: 0; }

/* ---------- لایت‌باکس مرور تصاویر درمانی (پنل مرکز/پزشک) ---------- */
.lightbox-overlay {
  position: fixed; inset: 0; z-index: 1050;
  background: rgba(16,24,40,.92);
  display: none; align-items: center; justify-content: center;
  padding: 24px;
}
.lightbox-overlay.show { display: flex; }
.lightbox-overlay img {
  max-width: min(92vw, 900px); max-height: 82vh;
  object-fit: contain; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.lightbox-close, .lightbox-nav {
  position: absolute; background: rgba(255,255,255,.12); color: #fff; border: none;
  border-radius: 999px; width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  cursor: pointer; transition: background .15s ease;
}
.lightbox-close:hover, .lightbox-nav:hover { background: rgba(255,255,255,.25); }
.lightbox-close { top: 18px; left: 18px; }
.lightbox-nav.prev { right: 18px; top: 50%; transform: translateY(-50%); }
.lightbox-nav.next { left: 18px; top: 50%; transform: translateY(-50%); }
.lightbox-caption {
  position: absolute; bottom: 22px; right: 0; left: 0; text-align: center;
  color: #fff; font-size: .82rem;
}
.lightbox-caption .btn { margin-top: 8px; }
.media-tile { cursor: zoom-in; }
