/* استایل آفلاین Mobile-First - بدون CDN */
:root {
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-bg: #f1f5f9;
  --color-card: #ffffff;
  --color-text: #1e293b;
  --color-muted: #64748b;
  --color-danger: #e11d48;
  --color-success: #059669;
  --radius: 1rem;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.06);
}

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

html { direction: rtl; }

body {
  margin: 0;
  font-family: Tahoma, "Segoe UI", sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

.app-header {
  background: var(--color-card);
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 20;
}

.app-header-inner {
  max-width: 40rem;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.app-title { font-weight: 700; font-size: 1rem; }
.app-subtitle { font-size: 0.75rem; color: var(--color-muted); margin-top: 0.15rem; }

.app-main {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1rem 1rem 5rem;
}

.card {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.card h1, .card h2 { margin: 0 0 0.5rem; font-size: 1.125rem; }
.muted { color: var(--color-muted); font-size: 0.875rem; }
.tiny { color: var(--color-muted); font-size: 0.75rem; }

.grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .app-title { font-size: 1.125rem; }
}

.stat-value { font-size: 1.75rem; font-weight: 700; margin-top: 0.25rem; }
.stat-blue { color: var(--color-primary); }
.stat-green { color: var(--color-success); }
.stat-purple { color: #7c3aed; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 48px;
  width: 100%;
}

.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-hover); }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-dark { background: #334155; color: #fff; }
.btn-amber { background: #d97706; color: #fff; }
.btn-menu { width: 100%; text-align: center; padding: 0.95rem 0.6rem; border-radius: 1rem; color: #fff; font-size: 0.875rem; font-weight: 700; box-shadow: 0 6px 14px rgba(15,23,42,0.12); transition: transform .12s ease; }
.btn-menu:active { transform: scale(0.98); }

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

@media (min-width: 640px) {
  .menu-grid { grid-template-columns: repeat(3, 1fr); }
}

label { display: block; font-size: 0.875rem; font-weight: 600; margin-bottom: 0.35rem; }

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="tel"],
input[type="search"],
input[type="file"],
select,
textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border: 1.5px solid #c5ced9;
  border-radius: 1rem;
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  color: var(--color-text);
  min-height: 3.15rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}

select {
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat left 0.95rem center;
  padding-left: 2.25rem;
}

textarea {
  min-height: 6rem;
  resize: vertical;
  line-height: 1.5;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 18%, transparent);
}

input:disabled, select:disabled, textarea:disabled {
  background: #f1f5f9;
  color: #64748b;
  border-color: #e2e8f0;
}

input[type="file"] {
  padding: 0.65rem 0.85rem;
  font-size: 0.85rem;
}


/* اجبار تمام‌عرض بودن فیلدهای فرم در کل سیستم */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; width: 100%; }
.form-group input,
.form-group select,
.form-group textarea,
.card form input[type="text"],
.card form input[type="tel"],
.card form input[type="password"],
.card form input[type="email"],
.card form input[type="number"],
.card form input[type="search"],
.card form select,
.card form textarea {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}


.alert {
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.alert-error {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #be123c;
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-card {
  width: 100%;
  max-width: 28rem;
  background: var(--color-card);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.login-card h1 {
  margin: 0;
  text-align: center;
  font-size: 1.35rem;
}

.center { text-align: center; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-0 { margin-bottom: 0; }
.space-y > * + * { margin-top: 1rem; }
.hidden-sm { display: none; }
@media (min-width: 640px) {
  .hidden-sm { display: inline; }
}

/* فاز ۱ — کاربران */
.row-between { display:flex; flex-wrap:wrap; gap:0.75rem; align-items:flex-start; justify-content:space-between; }
.actions-inline { display:flex; flex-wrap:wrap; gap:0.5rem; }
.btn-sm { min-height:40px; padding:0.55rem 0.85rem; width:auto; font-size:0.875rem; }
.alert-success { background:#ecfdf5; border:1px solid #a7f3d0; color:#047857; border-radius:0.75rem; padding:0.85rem 1rem; font-size:0.875rem; }
.user-list { display:flex; flex-direction:column; gap:0.75rem; }
.user-item { display:flex; flex-wrap:wrap; gap:0.75rem; justify-content:space-between; align-items:center; padding:0.85rem 0; border-bottom:1px solid #e2e8f0; }
.user-item:last-child { border-bottom:none; }
.user-name { font-weight:700; }
.user-actions { display:flex; flex-wrap:wrap; gap:0.4rem; }
.badge { display:inline-block; border-radius:999px; padding:0.15rem 0.55rem; font-size:0.75rem; }
.badge-green { background:#d1fae5; color:#065f46; }
.badge-gray { background:#e2e8f0; color:#475569; }
.check-label { display:flex; align-items:flex-start; gap:0.5rem; margin:0.45rem 0; font-size:0.9rem; font-weight:500; }
.check-label input { width:auto; margin-top:0.2rem; }
.perm-module { margin-top:1rem; padding-top:0.75rem; border-top:1px solid #e2e8f0; }
.perm-module-title { margin:0 0 0.5rem; font-size:1rem; }
.nav-bottom { position:fixed; bottom:0; left:0; right:0; background:#fff; border-top:1px solid #e2e8f0; display:flex; z-index:30; }
.nav-bottom a { flex:1; text-align:center; padding:0.7rem 0.25rem; font-size:0.8rem; color:#475569; }
.nav-bottom a.active { color:var(--color-primary); font-weight:700; }

/* فاز ۲ — بیماران */
.search-row { display:flex; flex-direction:column; gap:0.5rem; }
.search-row input { width:100%; }
@media (min-width:640px) {
  .search-row { flex-direction:row; align-items:center; }
  .search-row input { flex:1; }
}
.info-grid { display:grid; grid-template-columns:1fr; gap:0.85rem; }
@media (min-width:640px) {
  .info-grid { grid-template-columns:1fr 1fr; }
}
textarea {
  width:100%;
  border:1px solid #cbd5e1;
  border-radius:0.75rem;
  padding:0.85rem 1rem;
  font-size:1rem;
  font-family:inherit;
  background:#fff;
  color:var(--color-text);
  resize:vertical;
}
textarea:focus {
  outline:none;
  border-color:var(--color-primary);
  box-shadow:0 0 0 3px rgba(37,99,235,0.15);
}

/* فاز ۳ */
.badge-blue { background:#dbeafe; color:#1d4ed8; }
.badge-orange { background:#ffedd5; color:#c2410c; }
.badge-red { background:#fee2e2; color:#b91c1c; }

/* فاز ۴ — گزارش */
.report-card { display:block; text-decoration:none; color:inherit; transition:transform .12s ease; }
.report-card:active { transform:scale(0.98); }

/* چاپ گزارش */
.print-only { display: none; }
.print-table { display: none; width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.print-table.always-table { display: table; margin-top: 0.5rem; }
.print-table th, .print-table td {
  border: 1px solid #cbd5e1;
  padding: 0.45rem 0.55rem;
  text-align: right;
}
.print-table thead th { background: #f1f5f9; font-weight: 700; }
.print-table tbody th { background: #f8fafc; width: 40%; }

@media print {
  .no-print,
  .app-header,
  .nav-bottom,
  .btn,
  form,
  .actions-inline { display: none !important; }

  .print-only { display: block !important; }
  .print-table { display: table !important; }
  .user-list.no-print { display: none !important; }

  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 11pt;
  }
  .app-main {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .card {
    box-shadow: none !important;
    border: 1px solid #e2e8f0;
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 0.75rem;
  }
  .grid { display: grid !important; grid-template-columns: repeat(3, 1fr) !important; gap: 0.5rem !important; }
  .print-header {
    text-align: center;
    margin-bottom: 1rem;
    border-bottom: 2px solid #000;
    padding-bottom: 0.75rem;
  }
  .print-title { font-size: 1.25rem; font-weight: 700; }
  .print-sub { font-size: 1.05rem; margin-top: 0.25rem; }
  .print-meta { font-size: 0.8rem; color: #334155; margin-top: 0.35rem; }
  a { color: inherit; text-decoration: none; }
}

/* انتخابگر شمسی سه‌تایی موبایل */
.jalali-triple {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
  direction: rtl;
}
.jp-pill {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-height: 3rem;
  border: none;
  border-radius: 1rem;
  background: #f1f5f9 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat left 0.85rem center;
  padding: 0.75rem 0.85rem 0.75rem 2rem;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--color-text);
  text-align: center;
  box-shadow: inset 0 0 0 1px #e2e8f0;
}
.jp-pill:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--color-primary);
  background-color: #fff;
}

/* ساعت دایره‌ای */
.clock-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
.clock-overlay[hidden] { display: none !important; }
.clock-sheet {
  width: 100%;
  max-width: 22rem;
  background: #fffaf7;
  border-radius: 1.25rem 1.25rem 0 0;
  overflow: hidden;
  box-shadow: 0 -8px 30px rgba(0,0,0,0.15);
  margin-bottom: 0;
}
@media (min-width: 480px) {
  .clock-overlay { align-items: center; padding: 1rem; }
  .clock-sheet { border-radius: 1.25rem; }
}
.clock-header {
  background: #9a4a3c;
  color: #fff;
  text-align: center;
  padding: 1.1rem 1rem;
}
.clock-display {
  font-size: 2.75rem;
  font-weight: 300;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
.clock-body { padding: 1rem 1rem 0.5rem; }
.clock-face {
  position: relative;
  width: min(72vw, 16rem);
  height: min(72vw, 16rem);
  margin: 0 auto;
  border-radius: 50%;
  background: #eceff3;
}
.clock-hand {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3px;
  height: 32%;
  background: #9a4a3c;
  transform-origin: bottom center;
  transform: translate(-50%, 0) rotate(0deg);
  border-radius: 2px;
  margin-top: -32%;
  z-index: 2;
  pointer-events: none;
}
.clock-center {
  position: absolute;
  left: 50%; top: 50%;
  width: 10px; height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: #9a4a3c;
  z-index: 3;
  pointer-events: none;
}
.clock-num {
  position: absolute;
  width: 2.1rem;
  height: 2.1rem;
  margin: -1.05rem 0 0 -1.05rem;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 0.95rem;
  font-family: inherit;
  color: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 4;
  padding: 0;
}
.clock-num:active, .clock-num:focus {
  background: #9a4a3c;
  color: #fff;
  outline: none;
}
.clock-num-inner {
  font-size: 0.75rem;
  color: #64748b;
  width: 1.7rem;
  height: 1.7rem;
  margin: -0.85rem 0 0 -0.85rem;
}
.clock-mode-tabs {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.85rem;
}
.clock-tab {
  border: 0;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 0.4rem 1rem;
  font-family: inherit;
  font-size: 0.85rem;
  color: #475569;
  cursor: pointer;
}
.clock-tab.active {
  background: #9a4a3c;
  color: #fff;
}
.clock-footer {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 1rem 1.1rem;
}
.clock-btn {
  flex: 1;
  border: 0;
  background: transparent;
  color: #9a4a3c;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.65rem 0.5rem;
  cursor: pointer;
  border-radius: 0.5rem;
}
.clock-btn:active { background: #f1f5f9; }
.clock-set { color: #9a4a3c; }

/* جستجوی بیمار — ظاهر مدرن */
.patient-search-wrap { position: relative; }
.ps-field {
  position: relative;
  display: flex;
  align-items: center;
  background: #fff;
  border: 1.5px solid #c5ced9;
  border-radius: 1rem;
  min-height: 3.15rem;
  padding: 0 0.85rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.patient-search-wrap.is-focused .ps-field {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 18%, transparent);
}
.patient-search-wrap.is-selected .ps-field {
  border-color: #86efac;
  background: #f0fdf4;
}
.ps-icon {
  display: flex;
  color: #94a3b8;
  flex-shrink: 0;
  margin-left: 0.45rem;
}
.ps-input {
  flex: 1;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0.7rem 0.25rem !important;
  min-height: auto !important;
  font-size: 0.95rem;
  width: 100%;
}
.ps-input::placeholder { color: #94a3b8; }
.ps-input:focus { outline: none; }
.ps-clear {
  border: 0;
  background: #e2e8f0;
  color: #475569;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}
.ps-clear:active { background: #cbd5e1; }
.patient-search-results {
  position: absolute;
  z-index: 40;
  left: 0; right: 0;
  top: calc(100% - 0.15rem);
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  max-height: 260px;
  overflow: auto;
  margin-top: 0.35rem;
}
.search-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  text-align: right;
  border: 0;
  background: transparent;
  padding: 0.75rem 0.9rem;
  font-size: 0.9rem;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  font-family: inherit;
}
.search-item:last-child { border-bottom: 0; }
.search-item:hover, .search-item:active { background: #f8fafc; }
.search-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent, #0ea5e9));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  flex-shrink: 0;
}
.search-meta { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.search-title { font-weight: 600; color: #0f172a; }
.search-sub { font-size: 0.78rem; color: #64748b; }
.search-empty { padding: 0.9rem 1rem; color: var(--color-muted); font-size: 0.85rem; text-align: center; }
.ps-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.55rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: 0.82rem;
  font-weight: 600;
  width: fit-content;
  max-width: 100%;
}
.ps-chip-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: #10b981;
  flex-shrink: 0;
}

.photo-preview {
  width: 96px; height: 96px;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid #e2e8f0;
  background: #f8fafc;
  display: block;
  margin-bottom: 0.5rem;
}
.status-select {
  font-size: 0.8rem;
  padding: 0.35rem 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid #cbd5e1;
  background: #fff;
}

/* ===== صف انتظار ===== */
.queue-page { padding-bottom: 1rem; }
.queue-hero {
  background: linear-gradient(135deg, #0f766e 0%, #115e59 50%, #134e4a 100%);
  color: #fff;
  border-radius: 1.35rem;
  padding: 1.35rem 1.25rem 1.2rem;
  margin-bottom: 1rem;
  box-shadow: 0 12px 28px rgba(15, 118, 110, 0.28);
}
.queue-hero-top { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.queue-kicker { margin: 0; font-size: 0.75rem; opacity: 0.85; letter-spacing: 0.04em; }
.queue-hero h1 { margin: 0.2rem 0 0.35rem; font-size: 1.35rem; }
.queue-sub { margin: 0; font-size: 0.85rem; opacity: 0.9; }
.queue-count-pill {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 1rem;
  padding: 0.55rem 0.85rem;
  text-align: center;
  min-width: 4.5rem;
}
.queue-count-num { display: block; font-size: 1.5rem; font-weight: 800; line-height: 1.1; }
.queue-count-label { font-size: 0.7rem; opacity: 0.9; }
.queue-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.1rem; }
.btn-call {
  background: #fff;
  color: #0f766e;
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1.2rem;
  font-weight: 700;
  font-family: inherit;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  min-height: 3rem;
}
.btn-call:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-call-icon { font-size: 0.75rem; }
.btn-soft {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 999px;
  padding: 0.7rem 1rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
}
.btn-soft:hover { background: rgba(255,255,255,0.2); }

.queue-now {
  background: linear-gradient(180deg, #ecfdf5 0%, #fff 100%);
  border: 1.5px solid #a7f3d0;
  border-radius: 1.35rem;
  padding: 1.15rem;
  margin-bottom: 1rem;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.12);
}
.queue-now-badge {
  display: inline-block;
  background: #10b981;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}
.queue-now-body { display: flex; gap: 1rem; align-items: center; }
.queue-now-no {
  width: 4.25rem;
  height: 4.25rem;
  border-radius: 1.15rem;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  font-size: 1.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.queue-now-name { font-size: 1.2rem; font-weight: 800; color: #064e3b; }
.queue-now-meta { display: flex; flex-wrap: wrap; gap: 0.35rem 0.65rem; margin-top: 0.35rem; font-size: 0.82rem; color: #047857; }

.queue-empty {
  text-align: center;
  background: #fff;
  border-radius: 1.35rem;
  padding: 2.5rem 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}
.queue-empty-icon {
  width: 3.5rem; height: 3.5rem;
  margin: 0 auto 0.75rem;
  border-radius: 999px;
  background: #ecfdf5;
  color: #059669;
  font-size: 1.5rem;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.queue-empty h2 { margin: 0 0 0.35rem; }
.queue-empty p { margin: 0; color: var(--color-muted); }

.queue-list-card {
  background: #fff;
  border-radius: 1.35rem;
  padding: 1.1rem;
  box-shadow: var(--shadow);
}
.queue-list-title { margin: 0 0 0.85rem; font-size: 1rem; }
.queue-list { display: flex; flex-direction: column; gap: 0.55rem; }
.queue-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 1rem;
  background: #f8fafc;
  border: 1px solid #eef2f7;
}
.queue-item-no {
  width: 2.5rem; height: 2.5rem;
  border-radius: 0.75rem;
  background: #e2e8f0;
  color: #334155;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.queue-item-body { flex: 1; min-width: 0; }
.queue-item-name { font-weight: 700; font-size: 0.95rem; }
.queue-item-meta { font-size: 0.78rem; color: var(--color-muted); margin-top: 0.15rem; }
.queue-item-doc {
  font-size: 0.75rem;
  color: #0f766e;
  background: #ccfbf1;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}

/* ===== تابلو نمایشگر ===== */
.display-body {
  margin: 0;
  min-height: 100vh;
  background: #0b1220;
  color: #f8fafc;
  font-family: Tahoma, "Segoe UI", sans-serif;
}
.display-board {
  max-width: 56rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2rem;
}
.display-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.display-clinic { font-size: 1.35rem; font-weight: 800; }
.display-date { font-size: 0.9rem; color: #94a3b8; margin-top: 0.25rem; }
.display-live {
  display: flex; align-items: center; gap: 0.4rem;
  background: rgba(16,185,129,0.15);
  color: #6ee7b7;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
}
.live-dot {
  width: 0.55rem; height: 0.55rem;
  border-radius: 999px;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16,185,129,0.6);
  animation: pulse-dot 1.5s infinite;
}
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(16,185,129,0.55); }
  70% { box-shadow: 0 0 0 10px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}
.display-now {
  background: linear-gradient(145deg, #134e4a, #0f766e 55%, #115e59);
  border-radius: 1.75rem;
  padding: 2rem 1.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
  box-shadow: 0 20px 50px rgba(15, 118, 110, 0.35);
}
.display-now-label {
  font-size: 1rem;
  letter-spacing: 0.08em;
  opacity: 0.9;
  margin-bottom: 0.75rem;
}
.display-now-no {
  font-size: 5rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 0.5rem;
}
.display-now-name { font-size: 2rem; font-weight: 800; }
.display-now-meta { margin-top: 0.65rem; font-size: 1.05rem; opacity: 0.9; }
.muted-light { opacity: 0.75; font-size: 1.5rem !important; }
.display-waiting h2 {
  margin: 0 0 0.85rem;
  font-size: 1.1rem;
  color: #cbd5e1;
}
.display-waiting-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 0.65rem;
}
.display-wait-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 1rem;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.display-wait-no {
  width: 2rem; height: 2rem;
  border-radius: 0.55rem;
  background: #334155;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
}
.display-wait-name { font-weight: 700; font-size: 0.95rem; }
.display-empty { color: #64748b; }

/* ===== رزرو آنلاین ===== */
.booking-body {
  margin: 0;
  min-height: 100vh;
  background: #f0fdfa;
  font-family: Tahoma, "Segoe UI", sans-serif;
}
.booking-page {
  max-width: 28rem;
  margin: 0 auto;
  min-height: 100vh;
}
.booking-hero {
  background: linear-gradient(145deg, #0f766e, #0d9488 55%, #14b8a6);
  color: #fff;
  padding: 1.75rem 1.25rem 2.75rem;
  border-radius: 0 0 1.75rem 1.75rem;
}
.booking-hero-inner { max-width: 24rem; margin: 0 auto; }
.booking-badge {
  display: inline-block;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.3);
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.65rem;
}
.booking-hero h1 {
  margin: 0 0 0.45rem;
  font-size: 1.45rem;
  line-height: 1.35;
}
.booking-hero p {
  margin: 0;
  opacity: 0.92;
  font-size: 0.9rem;
  line-height: 1.7;
}
.booking-main {
  padding: 0 1rem 2.5rem;
  margin-top: -1.5rem;
  position: relative;
  z-index: 2;
}
.booking-card {
  background: #fff;
  border-radius: 1.5rem;
  padding: 1.35rem 1.15rem 1.5rem;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.1);
}
.booking-card-head {
  text-align: center;
  margin-bottom: 1.15rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f1f5f9;
}
.booking-card-head h2 {
  margin: 0 0 0.3rem;
  font-size: 1.2rem;
  color: #0f172a;
}
.booking-card-head p {
  margin: 0;
  font-size: 0.85rem;
  color: #64748b;
}
.booking-section {
  margin-bottom: 1.25rem;
}
.booking-section-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: #0f766e;
  margin: 0 0 0.85rem;
  padding: 0.4rem 0.75rem;
  background: #f0fdfa;
  border-radius: 0.65rem;
  border-right: 3px solid #0d9488;
}

/* فیلدهای فرم رزرو — تمام‌عرض و لمس‌پذیر */
.bf-field {
  display: block;
  width: 100%;
  margin-bottom: 0.9rem;
}
.bf-field label {
  display: block;
  width: 100%;
  font-size: 0.875rem;
  font-weight: 700;
  color: #334155;
  margin: 0 0 0.4rem;
}
.bf-field .req { color: #e11d48; }
.bf-field input,
.bf-field select {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  min-height: 3.25rem !important;
  margin: 0 !important;
  padding: 0.85rem 1rem !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 0.9rem !important;
  background: #f8fafc !important;
  color: #0f172a !important;
  font-size: 1rem !important;
  font-family: inherit !important;
  line-height: 1.4 !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}
.bf-field select {
  background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat left 1rem center !important;
  padding-left: 2.4rem !important;
}
.bf-field input:focus,
.bf-field select:focus {
  outline: none !important;
  border-color: #0d9488 !important;
  background: #fff !important;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.18) !important;
}
.bf-field input::placeholder {
  color: #94a3b8;
}

.btn-booking-submit {
  display: block;
  width: 100%;
  min-height: 3.35rem;
  margin-top: 0.35rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #0d9488, #0f766e);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(13, 148, 136, 0.3);
}
.btn-booking-submit:active { transform: scale(0.99); }
.booking-note {
  text-align: center;
  font-size: 0.78rem;
  color: #64748b;
  margin: 0.9rem 0 0;
  line-height: 1.6;
}
.booking-success {
  background: #fff;
  border-radius: 1.5rem;
  padding: 2.5rem 1.25rem;
  text-align: center;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}
.booking-success-icon {
  width: 4rem; height: 4rem;
  margin: 0 auto 1rem;
  border-radius: 999px;
  background: #ecfdf5;
  color: #059669;
  font-size: 1.75rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.booking-success h2 { margin: 0 0 0.4rem; }
.booking-success p { color: #64748b; margin: 0 0 1.25rem; }
.btn-booking {
  display: inline-block;
  width: 100%;
  text-align: center;
  min-height: 3.1rem;
  line-height: 3.1rem;
  border-radius: 999px;
  background: #0d9488;
  color: #fff !important;
  font-weight: 700;
  text-decoration: none;
}

/* ===== تبلت و دسکتاپ ===== */
@media (min-width: 768px) {
  .app-header-inner,
  .app-main {
    max-width: 48rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
  .app-main { padding-top: 1.25rem; padding-bottom: 3rem; }
  .card { padding: 1.35rem 1.5rem; }
  .menu-grid { grid-template-columns: repeat(4, 1fr); gap: 0.65rem; }
  .btn-sm { width: auto; min-width: 6rem; }
  .actions-inline { display: flex; flex-wrap: wrap; gap: 0.45rem; }
  .actions-inline .btn { width: auto; }
  .search-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
  }
  .search-row input { flex: 1; }
  .search-row .btn { width: auto; min-width: 5.5rem; }
  .user-item {
    padding: 0.85rem 1rem;
  }
  .booking-page { max-width: 36rem; }
  .booking-hero-inner { max-width: 32rem; }
}

@media (min-width: 1024px) {
  .app-header-inner,
  .app-main {
    max-width: 64rem;
  }
  .app-main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
  }
  /* دکمه‌های تمام‌عرض فقط در موبایل؛ روی دسکتاپ جمع‌وجور */
  .card form .btn,
  .pf-actions .btn {
    width: auto;
    min-width: 10rem;
  }
  .pf-actions {
    flex-direction: row !important;
    flex-wrap: wrap;
  }
  .nav-bottom {
    /* منوی پایین فقط موبایل؛ روی دسکتاپ مخفی */
    display: none !important;
  }
  .app-main {
    padding-bottom: 2rem;
  }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .menu-grid { grid-template-columns: repeat(5, 1fr); }
  .booking-page { max-width: 42rem; }
}

@media (min-width: 1280px) {
  .app-header-inner,
  .app-main {
    max-width: 72rem;
  }
}

/* انتخابگر روز/بازه */
.chip-row { display:flex; flex-wrap:wrap; gap:0.45rem; margin-top:0.35rem; }
.chip {
  border:1.5px solid #cbd5e1; background:#f8fafc; color:#0f172a;
  border-radius:999px; padding:0.55rem 0.95rem; font-family:inherit; font-size:0.875rem;
  font-weight:600; cursor:pointer; min-height:2.6rem;
}
.chip.active, .chip:hover { border-color:var(--color-primary,#2563eb); background:#eff6ff; color:#1d4ed8; }
.chip:disabled { opacity:0.5; cursor:not-allowed; }
