@import url("/assets/pavet-theme.php?v=20261028-corporate");

:root {
  --font-family: 'CustomUploadedFont', 'Shabnam', Tahoma, 'Vazirmatn', sans-serif;
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-hover: #f1f5f9;
  --border: #e2e8f0;
  --input-border: #cbd5e1;
  --text: #0f172a;
  --text-muted: #64748b;
  --primary: var(--pavet-primary);
  --primary-rgb: var(--pavet-primary-rgb);
  --primary-ink: var(--pavet-primary-ink);
  --primary-soft: var(--pavet-primary-soft);
  --on-primary: var(--pavet-on-primary);
  --primary-hover: var(--pavet-primary-hover);
  --primary-light: var(--primary-soft);
  --sidebar-bg: var(--surface);
  --clinic-bg: #dbeafe; --clinic-text: #1d4ed8;
  --web-bg: #fce7f3; --web-text: #be185d;
  --sub-bg: #fef3c7; --sub-text: #b45309;
  --walkin-bg: #dcfce7; --walkin-text: #15803d;
  --groom-bg: #f3e8ff; --groom-text: #7e22ce;
  --wash-bg: #e0f2fe; --wash-text: #0369a1;
  --bday-bg: #ffe4e6; --bday-text: #e11d48;
  --wc-bg: #f3e8ff; --wc-text: #6b21a8;
  --danger: #dc2626; --danger-bg: #fef2f2;
  --warning: #d97706; --warning-bg: #fef3c7;
  --success: #16a34a; --success-bg: #dcfce7;
  --radius: 14px;
  --shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06);
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
}

/* The clinical network shares CRM surfaces, typography and theme tokens. */
.pet-omnibox-wrap { position:relative; width:clamp(230px,32vw,580px); min-width:0; }
.pet-omnibox-wrap > label { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.pet-omnibox-wrap .form-control { padding-right:38px; padding-left:76px; width:100%; text-overflow:ellipsis; }
.pet-omnibox-icon { position:absolute; right:12px; top:50%; transform:translateY(-50%); width:18px; height:18px; color:var(--text-muted); pointer-events:none; }
.pet-omnibox-shortcut { position:absolute; left:10px; right:auto; top:50%; transform:translateY(-50%); white-space:nowrap; pointer-events:none; }
.pet-omnibox-results { position:absolute; top:calc(100% + 8px); inset-inline-end:0; width:max(100%,400px); max-width:calc(100vw - 32px); max-height:65vh; overflow:auto; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow); z-index:1100; padding:6px; }
.pet-search-result { display:flex; flex-direction:column; align-items:flex-start; gap:5px; width:100%; border:0; border-bottom:1px solid var(--border); border-radius:8px; padding:11px; color:var(--text); background:var(--surface); cursor:pointer; text-align:start; }
.pet-search-result:hover,.pet-search-result[aria-selected="true"] { background:var(--primary-light); outline:1px solid var(--primary); }
.pet-search-result:last-child { border-bottom:0; }
.pet-network-message { padding:16px; color:var(--text-muted); font-size:12px; }
.pet-file-badge { display:inline-block; border-radius:8px; padding:3px 9px; background:var(--primary-light); color:var(--primary-ink); font-size:15px; font-weight:800; white-space:nowrap; }
.pet-global-code { display:inline-block; color:var(--text-muted); font-size:11px; overflow-wrap:anywhere; }
.pet-transfer-badge { background:var(--clinic-bg); color:var(--clinic-text); white-space:normal; }
.radar-dialog.pet-record-dialog { width:min(840px,calc(100vw - 28px)); }
.pet-record-heading,.pet-record-toolbar,.pet-record-identifiers { display:flex; align-items:center; flex-wrap:wrap; gap:10px; }
.pet-record-heading { justify-content:space-between; margin-bottom:14px; }
.pet-record-heading h3 { font-size:18px; }
.pet-record-toolbar { margin-bottom:16px; font-size:12px; }
.pet-record-toolbar .btn { margin-inline-start:auto; }
.pet-red-flags { background:var(--danger-bg); color:var(--danger); border:1px solid var(--danger); border-inline-start-width:4px; border-radius:10px; padding:12px 14px; margin-bottom:14px; font-size:13px; white-space:pre-wrap; overflow-wrap:anywhere; }
html[data-theme="dark"] .pet-red-flags { color:#fca5a5; border-color:#f87171; }
html[data-theme="dark"] .pet-file-badge { color:var(--primary-ink); }
.pet-red-flags p { margin-top:4px; }
.pet-weight-delta { color:var(--success); background:var(--success-bg); white-space:normal; }
.pet-weight-down { color:var(--warning); background:var(--warning-bg); }
.pet-medical-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin-bottom:16px; }
#pet-medical-status:not(:empty) { margin-bottom:10px; }
.pet-medical-grid .form-group { min-width:0; }
.pet-medical-wide { grid-column:1 / -1; }
.pet-sterilized-switch { display:flex; align-items:center; gap:10px; min-height:65px; cursor:pointer; }
.pet-sterilized-switch input { width:20px; height:20px; accent-color:var(--primary); }
.pet-record-reminders { padding:16px 0; margin-top:14px; border-top:1px solid var(--border); }
.pet-record-reminders h4 { margin-bottom:8px; }
.pet-clinical-timeline { margin-top:10px; }
.pet-clinical-timeline p { white-space:pre-wrap; overflow-wrap:anywhere; }
.pet-medical-summary { margin-bottom:12px; padding:12px; background:var(--surface-2); border:1px solid var(--border); border-radius:12px; }
.pet-network-actions { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:16px; }
.pet-transfer-dialog { width:min(650px,calc(100vw - 28px)); }
.pet-transfer-search { display:flex; align-items:end; flex-wrap:wrap; gap:12px; margin:18px 0 10px; }
.pet-transfer-search .form-group { flex:1; min-width:190px; margin:0; }
.pet-transfer-candidate { display:flex; align-items:center; flex-wrap:wrap; justify-content:space-between; gap:12px; padding:14px; margin-block:10px; background:var(--surface-2); border:1px solid var(--border); border-radius:12px; }
.pet-transfer-verify { border-top:1px solid var(--border); margin-top:18px; padding-top:16px; }
.pet-debug-hint { color:var(--warning); background:var(--warning-bg); padding:8px 12px; border-radius:8px; }
.pet-tag-clean .pet-file-badge { font-size:11px; padding:1px 5px; }
@media (max-width:700px) {
  .top-bar { flex-wrap:wrap; gap:12px; }
  .top-actions { width:100%; min-width:0; }
  .pet-omnibox-wrap { flex:1 0 100%; width:100%; order:10; }
  .pet-omnibox-results { width:100%; max-width:100%; }
  .pet-medical-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
  .pet-record-toolbar .btn { width:100%; margin-inline-start:0; white-space:normal; }
  .pet-record-dialog,.pet-transfer-dialog { padding:16px; }
  .pet-transfer-candidate .btn { width:100%; white-space:normal; }
}
@media (max-width:380px) { .pet-medical-grid { grid-template-columns:minmax(0,1fr); } }

html[data-theme="dark"] {
  --bg: #0b1120;
  --surface: #1e293b;
  --surface-2: #0f172a;
  --surface-hover: #334155;
  --border: #334155;
  --input-border: #475569;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --primary-light: var(--primary-soft);
  --clinic-bg: rgba(59, 130, 246, 0.2); --clinic-text: #93c5fd;
  --web-bg: rgba(236, 72, 153, 0.2); --web-text: #f9a8d4;
  --sub-bg: rgba(245, 158, 11, 0.2); --sub-text: #fcd34d;
  --walkin-bg: rgba(34, 197, 94, 0.2); --walkin-text: #86efac;
  --groom-bg: rgba(168, 85, 247, 0.22); --groom-text: #d8b4fe;
  --wash-bg: rgba(14, 165, 233, 0.22); --wash-text: #7dd3fc;
  --bday-bg: rgba(244, 63, 94, 0.24); --bday-text: #fda4af;
  --wc-bg: rgba(147, 51, 234, 0.22); --wc-text: #e9d5ff;
  --danger-bg: rgba(220, 38, 38, 0.18);
  --warning-bg: rgba(217, 119, 6, 0.2);
  --success-bg: rgba(22, 163, 74, 0.2);
  --shadow: 0 6px 24px -2px rgba(0, 0, 0, 0.45);
}

*, *::before, *::after, body, input, button, select, textarea, .mono-phone, .sub-code-text, code, table, th, td, svg text {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-family) !important;
}

body {
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.25s var(--ease-spring), color 0.25s var(--ease-spring);
}

@keyframes shimmerWave {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-shimmer {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmerWave 1.3s infinite linear;
  border-radius: 10px;
}

.skeleton-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-line { height: 14px; width: 100%; }
.skeleton-line.short { width: 45%; }
.skeleton-line.medium { width: 72%; }
.skeleton-line.tall { height: 26px; width: 60%; }

@keyframes softFadeSlideUp {
  from { opacity: 0; transform: translateY(10px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes modalPopIn {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes bellPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

.global-search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 7px 13px;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s var(--ease-spring);
  min-width: 215px;
  justify-content: space-between;
}

.global-search-trigger:hover {
  border-color: var(--primary);
  color: var(--text);
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.1);
}

.kbd-shortcut {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 10.5px;
  font-weight: 700;
  color:var(--primary-ink);
  direction: ltr;
}

.spotlight-search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}

.spotlight-search-input {
  width: 100%;
  padding: 14px 44px 14px 16px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 14px;
  border: 2px solid var(--primary);
  background: var(--surface-2);
  color: var(--text);
  outline: none;
}

.spotlight-search-icon {
  position: absolute;
  right: 14px;
  font-size: 18px;
  pointer-events: none;
}

.spotlight-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  margin-bottom: 8px;
  flex-wrap: wrap;
  transition: all 0.18s var(--ease-spring);
}

.spotlight-result-item:hover {
  border-color: var(--primary);
  background: var(--surface-hover);
}

.notif-bell-wrapper { position: relative; }

.notif-bell-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s var(--ease-spring);
}

.notif-bell-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.notif-badge-count {
  position: absolute;
  top: -5px;
  left: -5px;
  background: #ef4444;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface);
  animation: bellPulse 2s infinite ease-in-out;
}

.notif-dropdown-panel {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 400px;
  max-width: 92vw;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.28);
  z-index: 4500;
  padding: 16px;
  animation: modalPopIn 0.22s var(--ease-spring);
}

.notif-dropdown-panel.open { display: block; }

.notif-item-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-right: 4px solid var(--primary);
  margin-bottom: 8px;
  cursor: pointer;
}

.notif-item-card.unread { background: var(--primary-light); }

.app-shell {
  display: grid;
  grid-template-columns: 265px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: var(--sidebar-bg);
  color: var(--text);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 22px;
  height: calc(100dvh - 44px);
  margin: 22px 18px 22px 0;
  min-height: 0;
  scrollbar-width: thin;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-y: auto;
  border: 1px solid var(--border);
}

.brand-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.brand-logo {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: bold;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}

.brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.brand-title h1 { font-size: 15px; font-weight: 700; color: var(--text); }
.brand-title span { font-size: 11px; color: var(--text-muted); display: block; }

.nav-menu { display: flex; flex-direction: column; gap: 4px; flex: 1; }

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 11px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: right;
  transition: all 0.2s var(--ease-spring);
}

.nav-btn:hover { background: var(--surface-hover); color: var(--text); }
.nav-btn.active { background: var(--primary); color: #fff; box-shadow: var(--shadow); }
.nav-btn-left { display: flex; align-items: center; gap: 9px; }
.nav-badge { background: var(--surface-hover); color: var(--text); padding: 2px 8px; border-radius: 99px; font-size: 11px; }
.nav-badge-alert { background: #ef4444; color: #fff; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; }

.sidebar-footer {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 10.5px;
  color: var(--text-muted);
  display: grid;
  gap: 4px;
  flex-shrink: 0;
}
.sidebar-info-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar-info-row strong { color: var(--text); font-weight: 500; }

.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; margin-left: 6px; }

.main-content {
  padding: 22px 18px 90px;
  width: 100%;
  margin: 0 auto;
  min-width: 0;
}

.top-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
  background: var(--surface);
  padding: 15px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.top-bar-title h2 { font-size: 18px; color: var(--text); }
.top-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.theme-toggle-btn {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  padding: 0;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s var(--ease-spring);
}
.theme-toggle-btn:hover { border-color: var(--primary); color:var(--primary-ink); transform: translateY(-2px); }
.theme-toggle-btn svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
html[data-theme="dark"] .theme-toggle-btn .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle-btn .icon-sun { display: block; }
html[data-theme="light"] .theme-toggle-btn .icon-sun { display: none; }
html[data-theme="light"] .theme-toggle-btn .icon-moon { display: block; }

.role-switcher-box {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  height: 40px;
  padding: 2px 7px;
  border-radius: 9px;
  font-size: 11px;
}

.role-switcher-select {
  width: auto;
  min-width: 0;
  height: 30px;
  padding: 2px 3px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}

.role-switcher-select:focus {
  border: 0;
  box-shadow: none;
}

.clinic-account-menu { position: relative; }
.clinic-account-menu summary { list-style: none; cursor: pointer; gap: 8px; padding: 2px 10px; color: var(--text-muted); transition: border-color .2s; }
.clinic-account-menu summary::-webkit-details-marker { display: none; }
.clinic-account-menu summary:hover, .clinic-account-menu[open] summary { border-color: var(--primary); }
.clinic-account-menu summary:focus-visible, .clinic-account-action:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.clinic-account-chevron { transition: transform .2s; }
.clinic-account-menu[open] .clinic-account-chevron { transform: rotate(180deg); }
.clinic-account-panel { position: absolute; top: calc(100% + 10px); inset-inline-start: 0; width: 240px; max-width: calc(100vw - 32px); padding: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 20px 45px -10px rgba(15,23,42,.28); z-index: 4500; }
.clinic-account-heading { padding: 8px 10px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--border); color: var(--text-muted); font-size: 11px; }
.clinic-account-action { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--text); font: inherit; font-size: 13px; text-align: start; cursor: pointer; }
.clinic-account-action:hover { background: var(--surface-2); }
.clinic-account-action-icon { flex: 0 0 20px; text-align: center; font-size: 20px; }
.clinic-account-logout { color: var(--danger); margin-top: 4px; }
.clinic-account-logout:hover { background: var(--danger-bg); }
.clinic-theme-switch { margin-inline-start: auto; width: 32px; height: 18px; padding: 3px; border-radius: 20px; background: var(--border); direction: ltr; }
.clinic-theme-switch::before { content: ''; display: block; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); transition: transform .2s; }
html[data-theme="dark"] .clinic-theme-switch { background: var(--primary); }
html[data-theme="dark"] .clinic-theme-switch::before { transform: translateX(14px); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s var(--ease-spring);
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: var(--surface-hover); border-color: var(--primary); }

.btn-danger-sm {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(220, 38, 38, 0.25);
  padding: 5px 10px;
  font-size: 11.5px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.kpi-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s var(--ease-spring), border-color 0.2s;
}

.kpi-card:hover { transform: translateY(-3px); border-color: var(--primary); }
.kpi-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.kpi-title { font-size: 12.5px; font-weight: 700; color: var(--text-muted); }
.kpi-icon { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 17px; }
.kpi-value { font-size: 24px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.kpi-sub { font-size: 11px; color: var(--text-muted); }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
  min-width: 0;
}

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

.card-title { font-size: 15.5px; font-weight: 700; color: var(--text); }

.sub-item-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 12.5px;
  gap: 10px;
  flex-wrap: wrap;
}

.pet-tag-clean {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  margin-left: 4px;
  margin-bottom: 4px;
}

.pet-tag-divider { color:var(--primary-ink); font-weight: bold; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; align-items: center; }

.pill-btn {
  padding: 7px 13px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pill-btn:hover { border-color: var(--primary); color: var(--text); }
.pill-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; min-width: 0; }
.form-group { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-group label { font-size: 12px; font-weight: 500; color: var(--text); }

.form-control {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--input-border);
  font-size: 13px;
  background: var(--surface-2);
  color: var(--text);
  outline: none;
}

.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }

.sms-balance-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }

.sms-balance-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sms-conn-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font-size: 11px; font-weight: 700; }
.sms-conn-online { background: var(--success-bg); color: var(--success); }
.sms-conn-warn { background: var(--warning-bg); color: var(--warning); }

.ws-QuickSwitch-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }

.ws-module-switcher-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s var(--ease-spring);
}

.ws-module-switcher-card.active-ws-tab {
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--surface) 0%, var(--primary-light) 100%);
}

.ws-subtabs-bar { display: flex; flex-wrap: wrap; gap: 8px; background: var(--surface); padding: 8px; border-radius: 12px; border: 1px solid var(--border); margin-bottom: 18px; }

.ws-subtab-btn {
  flex: 1;
  min-width: 180px;
  padding: 10px 14px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.ws-subtab-btn.active { background: var(--primary); color: #fff; }

.sms-provider-config-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 18px; }

.sms-provider-config-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--primary);
  border-radius: 15px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.sms-provider-config-card.prov-kavenegar { border-top-color: #16a34a; }
.sms-provider-config-card.prov-mediana { border-top-color: #2563eb; }
.sms-prov-credit-banner { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 11px 13px; display: flex; flex-direction: column; gap: 6px; }
.sms-prov-help-box { background: var(--surface-2); border-right: 3px solid var(--primary); border-radius: 8px; padding: 8px 11px; font-size: 11.5px; color: var(--text-muted); }

.input-with-eye { position: relative; display: flex; align-items: center; }
.input-with-eye .form-control { padding-left: 64px; }

.eye-toggle-btn {
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  padding: 3px 8px;
  font-size: 11px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
}

.rfm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 16px; }
.rfm-segment-card { background: var(--surface-2); border: 2px solid var(--border); border-radius: 12px; padding: 14px; cursor: pointer; transition: all 0.2s; }
.rfm-segment-card.active-rfm-card { border-color: var(--primary); background: var(--primary-light); }
.badge-rfm-vip { background: #ede9fe; color: #6d28d9; }
.badge-rfm-new { background: #dcfce7; color: #15803d; }
.badge-rfm-risk { background: #fef3c7; color: #b45309; }
.badge-rfm-sleep { background: #fee2e2; color: #b91c1c; }

.timeline-360-list { position: relative; padding-right: 26px; display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.timeline-360-list::before { content: ''; position: absolute; right: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline-360-item { position: relative; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.timeline-360-dot { position: absolute; right: -25px; top: 14px; width: 18px; height: 18px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 10px; }

.multi-pet-row { display: grid; grid-template-columns: 1.2fr 1fr 1.2fr auto; gap: 8px; align-items: center; background: var(--surface); padding: 9px 10px; border-radius: 10px; border: 1px solid var(--border); margin-top: 8px; }
.jalali-date-control { display: flex; align-items: stretch; gap: 5px; min-width: 0; width: 100%; flex: 1; position: relative; }
.jalali-date-control > .form-control { min-width: 0; flex: 1; }
.jalali-date-trigger { flex: 0 0 auto; padding: 7px 10px; min-width: 38px; }
.jalali-calendar { display: none; position: fixed; z-index: 9000; width: min(310px, calc(100vw - 24px)); padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: 0 18px 44px rgba(15, 23, 42, .24); direction: rtl; }
.jalali-calendar.open { display: block; }
.jalali-calendar-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.jalali-calendar-header strong { font-size: 13px; }
.jalali-calendar-nav { width: 32px; height: 30px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text); font-size: 18px; line-height: 1; cursor: pointer; }
.jalali-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; text-align: center; }
.jalali-calendar-weekdays { margin-bottom: 4px; color: var(--text-muted); font-size: 10px; font-weight: 700; }
.jalali-calendar-day, .jalali-calendar-empty { min-width: 0; height: 34px; }
.jalali-calendar-day { border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-size: 12px; cursor: pointer; }
.jalali-calendar-day:hover { border-color: var(--primary); background: var(--primary-light); color:var(--primary-ink); }
.jalali-calendar-day.is-today { border-color: var(--primary); color:var(--primary-ink); font-weight: 700; }
.jalali-calendar-day.is-selected { background: var(--primary); color: #fff; }
.jalali-calendar-today { width: 100%; margin-top: 9px; padding: 7px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color:var(--primary-ink); font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.automations-cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 18px; }
.auto-rule-card { background: var(--surface-2); border: 1px solid var(--border); border-right: 4px solid var(--primary); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.auto-rule-card.inactive-rule { border-right-color: #94a3b8; opacity: 0.85; }
.auto-rule-top { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.auto-rule-2col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.auto-days-chips-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; background: var(--surface); padding: 8px 10px; border-radius: 10px; border: 1px dashed var(--border); }
.day-preset-chip { padding: 3px 9px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted); font-size: 11px; font-weight: 500; cursor: pointer; }
.day-preset-chip.active-chip, .day-preset-chip:hover { border-color: var(--primary); background: var(--primary-light); color:var(--primary-ink); }

.sms-var-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 11.5px; font-weight: 500; cursor: pointer; }
.sms-var-code { direction: ltr; background: var(--surface-2); padding: 1px 6px; border-radius: 5px; color:var(--primary-ink); font-weight: 700; font-size: 11px; }

.pwd-meter-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-top: 6px; }
.pwd-bars-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 6px 0 8px; }
.pwd-bar-seg { height: 6px; border-radius: 99px; background: var(--border); transition: background-color 0.2s; }
.pwd-req-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 8px; font-size: 11px; color: var(--text-muted); }
.pwd-req-item.met { color: var(--success); font-weight: 700; }

.conditional-section { display: none; background: var(--surface-2); border: 1px solid var(--border); border-right: 4px solid var(--primary); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.conditional-section.visible { display: block; }
.conditional-section-title { font-size: 12.5px; font-weight: 700; color:var(--primary-ink); margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 99px; font-size: 11px; font-weight: 700; margin-left: 4px; margin-bottom: 3px; }
.badge-clinic { background: var(--clinic-bg); color: var(--clinic-text); }
.badge-website { background: var(--web-bg); color: var(--web-text); }
.badge-subscription { background: var(--sub-bg); color: var(--sub-text); }
.badge-walkin { background: var(--walkin-bg); color: var(--walkin-text); }
.badge-grooming { background: var(--groom-bg); color: var(--groom-text); }
.badge-washing { background: var(--wash-bg); color: var(--wash-text); }
.badge-wc { background: var(--wc-bg); color: var(--wc-text); }

.growth-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.growth-up { background: var(--success-bg); color: var(--success); }
.growth-down { background: var(--danger-bg); color: var(--danger); }

.table-responsive { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 900px; }
th, td { padding: 12px 13px; text-align: right; border-bottom: 1px solid var(--border); font-size: 13px; }
th { background: var(--surface-2); color: var(--text-muted); font-weight: 700; font-size: 12px; white-space: nowrap; }
tr:hover td { background: var(--surface-hover); }

.mono-phone { font-weight: 700; font-size: 14px; color: var(--text); direction: ltr; unicode-bidi: embed; display: inline-block; }
.sub-code-text { font-weight: 700; color: var(--sub-text); }
.spa-view { display: none; animation: softFadeSlideUp 0.22s var(--ease-spring); }
.spa-view.active { display: block; }

.source-check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 10px; margin: 10px 0 16px; }
.source-check-card { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: 11px; border: 2px solid var(--border); background: var(--surface-2); cursor: pointer; font-weight: 500; font-size: 12.5px; }
.source-check-card.checked-card { border-color: var(--primary); background: var(--primary-light); }
.source-check-card input { width: 18px; height: 18px; accent-color: var(--primary); }

.modal-backdrop { display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.65); backdrop-filter: blur(4px); z-index: 5000; align-items: center; justify-content: center; padding: 16px; }
.modal-backdrop.open { display: flex; }
.modal-card { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 18px; max-width: 780px; width: 100%; max-height: 90vh; overflow-y: auto; padding: 22px; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45); animation: modalPopIn 0.22s var(--ease-spring); }

.sms-phone-mockup { background: #0f172a; color: #f8fafc; border-radius: 22px; padding: 20px; max-width: 360px; border: 1px solid #334155; }
.sms-bubble { background: #1e293b; border: 1px solid #334155; padding: 14px; border-radius: 16px 16px 4px 16px; font-size: 13px; line-height: 1.7; color: #e2e8f0; margin-top: 12px; white-space: pre-wrap; }

.color-swatch-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; align-items: center; }
.color-swatch { width: 34px; height: 34px; border-radius: 10px; cursor: pointer; border: 3px solid transparent; transition: transform 0.15s; }
.color-swatch.active { border-color: var(--text); transform: scale(1.1); }

.chart-wrapper { width: 100%; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 18px; overflow-x: auto; }
.source-progress-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.source-progress-bar-bg { width: 100%; height: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 99px; overflow: hidden; }
.source-progress-bar-fill { height: 100%; border-radius: 99px; transition: width 0.4s; }

.toast-container { position: fixed; bottom: 24px; left: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast { background: #0f172a; color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.3); font-size: 13px; font-weight: 500; border-right: 4px solid var(--primary); }

.sub-meter-hero-card {
  background: var(--pavet-banner-gradient);
  color: #f8fafc;
  border-radius: 18px;
  padding: 20px 24px;
  margin-bottom: 22px;
  border: 1px solid rgba(var(--primary-rgb), 0.28);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 22px;
  align-items: center;
}

.sub-radial-gauge-box { width: 108px; height: 108px; position: relative; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sub-radial-gauge-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; line-height: 1.2; }
.sub-segmented-meter-track { width: 100%; height: 12px; background: rgba(15, 23, 42, 0.65); border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 99px; overflow: hidden; padding: 2px; margin-top: 10px; }
.sub-segmented-meter-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--primary), var(--pavet-primary-light)); transition: width 0.5s; }

.sidebar-sub-status-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  flex-shrink: 0;
  background: linear-gradient(145deg, var(--primary-light), var(--surface) 75%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px;
  color: var(--text);
  text-align: right;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.sidebar-sub-status-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.sidebar-sub-status-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.sidebar-sub-heading { display: flex; align-items: center; justify-content: space-between; font-size: 10.5px; color: var(--text-muted); }
.sidebar-sub-spark { font-size: 18px; line-height: 1; color:var(--primary-ink); }
#sidebar-sub-plan-title { font-size: 12px; font-weight: 700; line-height: 1.9; overflow-wrap: anywhere; }
.sidebar-sub-summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
#sidebar-sub-days-pill { background: var(--primary-light); color:var(--primary-ink); padding: 3px 8px; border-radius: 99px; font-size: 10px; font-weight: 700; white-space: nowrap; }
#sidebar-sub-expire-label { font-size: 9.5px; color: var(--text-muted); overflow-wrap: anywhere; }
.sidebar-sub-meter { display: block; height: 5px; background: var(--border); border-radius: 99px; overflow: hidden; }
#sidebar-sub-meter-bar { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--pavet-primary-light)); border-radius: inherit; transition: width 0.3s; }
.sidebar-sub-action { display: flex; align-items: center; justify-content: space-between; padding-top: 9px; border-top: 1px solid var(--border); font-size: 11px; font-weight: 700; color:var(--primary-ink); }
.sidebar-sub-action > span { font-size: 18px; line-height: 1; }


.bottom-left-sub-widget {
  position: fixed;
  bottom: 18px;
  left: 18px;
  z-index: 2500;
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid rgba(45, 212, 191, 0.45);
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.tenant-plan-card { background: var(--surface-2); border: 2px solid var(--border); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; }
.tenant-plan-card.popular-plan { border-color: var(--primary); background: linear-gradient(180deg, var(--surface) 0%, var(--primary-light) 100%); }

body[data-role="admin"] .super-admin-only { display: none !important; }

.mobile-bottom-nav { display: none; position: fixed; bottom: 0; right: 0; left: 0; background: var(--surface); border-top: 1px solid var(--border); z-index: 1000; justify-content: space-around; padding: 6px 4px; }
.mobile-nav-item { display: flex; flex-direction: column; align-items: center; gap: 3px; border: none; background: none; color: var(--text-muted); font-size: 10px; font-weight: 500; padding: 5px 6px; border-radius: 8px; cursor: pointer; }
.mobile-nav-item.active { color:var(--primary-ink); background: var(--primary-light); }

@media (max-width: 920px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main-content { padding: 14px 12px 85px; }
  .mobile-bottom-nav { display: flex; }
  .sub-meter-hero-card, .ws-QuickSwitch-grid, .automations-cards-grid, .auto-rule-2col, .multi-pet-row { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .bottom-left-sub-widget { bottom: 68px; left: 10px; }
}

/* SMS delivery choices and wallet */
[hidden]{display:none!important}
.sms-section-heading{display:flex;align-items:center;gap:14px;margin-bottom:24px}
.sms-section-heading h2,.sms-wallet-header h2{font-size:21px;line-height:1.6;font-weight:700}
.sms-section-heading h3,.sms-packages-heading h3{font-size:16px}
.sms-section-heading p,.sms-wallet-header p{font-size:12px;color:var(--text-muted);margin-top:4px}
.sms-section-icon{display:grid;place-items:center;flex-shrink:0;width:48px;height:48px;border-radius:16px;background:var(--primary-light);color:var(--primary-ink);font-size:24px}
.sms-mode-options{border:0;display:grid;grid-template-columns:1fr 1fr;gap:14px;min-width:0}
.sms-mode-options legend{font-size:12px;color:var(--text-muted);margin-bottom:10px}
.sms-mode-option{display:flex;align-items:flex-start;gap:12px;padding:20px;border:1px solid var(--border);border-radius:16px;background:var(--surface);cursor:pointer;transition:border-color .15s,background .15s}
.sms-mode-option:has(input:checked){border-color:var(--primary);background:var(--primary-light);box-shadow:0 0 0 1px var(--primary)}
.sms-mode-option input{accent-color:var(--primary);width:18px;height:18px;margin-top:4px;flex-shrink:0}
.sms-mode-option:focus-within{outline:2px solid var(--primary);outline-offset:4px}
.sms-mode-copy{display:flex;flex-direction:column;gap:8px;font-size:12px;color:var(--text-muted)}
.sms-mode-title{display:flex;align-items:center;flex-wrap:wrap;gap:9px;font-size:14px;font-weight:700;color:var(--text)}
.sms-recommended{font-size:10px;border-radius:20px;background:var(--primary);color:#fff;padding:2px 9px}
.sms-cloud-overview{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-top:24px;padding:22px;border-radius:16px;background:var(--surface-2);border:1px solid var(--border)}
.sms-cloud-overview strong{display:block;font-size:28px;font-weight:700;margin:3px 0}
.sms-cloud-overview p{font-size:12px;color:var(--text-muted)}
.sms-eyebrow{font-size:11px;color:var(--text-muted);display:block;margin-bottom:5px}
.sms-inline-status{font-size:12px;line-height:1.9;color:var(--text-muted)}
.sms-inline-status:empty{display:none}
.sms-inline-status[data-error=true]{color:var(--danger);padding:12px;border-radius:10px;background:var(--danger-bg)}
#sms-wallet-dialog{position:fixed;inset:50dvh auto auto 50vw;margin:0;transform:translate(-50%,-50%);width:min(840px,calc(100vw - 32px));max-width:none;max-height:calc(100dvh - 48px);overflow:auto;border:1px solid var(--border);border-radius:24px;background:var(--surface);color:var(--text);padding:0;box-shadow:0 28px 90px rgb(0 0 0 / .25)}
#sms-wallet-dialog::backdrop{background:rgb(15 23 42 / .56);backdrop-filter:blur(4px)}
.sms-wallet-header{position:sticky;top:0;z-index:1;display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:26px 28px 22px;background:var(--surface);border-bottom:1px solid var(--border)}
.sms-wallet-close{width:36px;height:36px;display:grid;place-items:center;border:1px solid var(--border);border-radius:12px;background:var(--surface-2);color:var(--text);cursor:pointer;font-size:16px;flex-shrink:0}
.sms-wallet-close:hover{background:var(--surface-hover)}
.sms-wallet-body{padding:24px 28px}
.sms-wallet-balance{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:22px;color:var(--text-muted);font-size:12px}
.sms-wallet-balance strong{color:var(--primary-ink);font-size:17px}
.sms-custom-topup{border:1px solid var(--border);border-radius:18px;padding:20px;background:var(--surface-2)}
.sms-custom-topup .sms-section-heading{margin-bottom:16px}
.sms-custom-topup>label{display:block;font-size:12px;font-weight:500;margin-bottom:8px}
.sms-custom-topup-row{display:flex;align-items:stretch;gap:12px}
.sms-quantity-field{flex:1;display:flex;align-items:center;gap:10px;padding:10px 14px;background:var(--surface);border:1px solid var(--input-border);border-radius:12px;min-width:0}
.sms-quantity-field:focus-within{border-color:var(--primary);box-shadow:0 0 0 3px var(--primary-light)}
.sms-quantity-field input{min-width:0;width:100%;background:transparent;border:0;outline:0;color:var(--text);font-size:16px;direction:rtl}
.sms-quantity-field span{font-size:12px;color:var(--text-muted)}
.sms-quote{margin-top:12px;font-size:12px;color:var(--text-muted);min-height:24px}
.sms-packages-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:26px 0 14px}
.sms-packages-heading>span{font-size:11px;color:var(--text-muted)}
.sms-wallet-packages{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.sms-package{position:relative;display:flex;flex-direction:column;align-items:stretch;padding:22px 16px 16px;border:1px solid var(--border);border-radius:16px;background:var(--surface)}
.sms-package-popular{border-color:var(--primary);background:linear-gradient(180deg,var(--primary-light),var(--surface) 75%)}
.sms-package-badge{position:absolute;top:-10px;inset-inline-start:16px;font-size:10px;color:#fff;background:var(--primary);border-radius:16px;padding:2px 10px}
.sms-package-name{font-size:12px;color:var(--text-muted)}
.sms-package-quantity{font-size:27px;font-weight:700;margin:12px 0 4px}
.sms-package-quantity small{font-size:11px;font-weight:400;color:var(--text-muted)}
.sms-package-price{font-size:14px;font-weight:700;margin:6px 0 16px}
.sms-package-price small{font-size:11px;font-weight:400;color:var(--text-muted)}
.sms-package button{width:100%;margin-top:auto;justify-content:center;font-size:12px}
.sms-payment-choice{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:20px 0;font-size:12px;border-bottom:1px solid var(--border)}
.sms-payment-choice .form-control{width:130px}
.sms-payment-choice>span{color:var(--text-muted);font-size:11px}
.sms-wallet-history{margin-top:18px;font-size:12px}
.sms-wallet-history summary{cursor:pointer;color:var(--text-muted)}
#sms-wallet-logs p{padding:12px 0;border-bottom:1px solid var(--border);line-height:1.9}
.sms-tone-preview{margin-top:12px;min-width:0}
.sms-tone-preview .sms-pattern-preview-heading{margin-bottom:8px;color:var(--text-muted)}
.sms-live-bubble{white-space:pre-wrap;overflow-wrap:anywhere;padding:12px 14px;margin:0;border:1px solid var(--border);border-radius:10px;background:var(--surface);color:var(--text);font-size:12px;font-weight:400;text-align:right;line-height:2.1}
@media(max-width:640px){.sms-mode-options{grid-template-columns:1fr}.sms-cloud-overview{align-items:stretch;flex-direction:column}.sms-wallet-header{padding:20px 18px}.sms-wallet-header h2{font-size:18px}.sms-wallet-body{padding:18px}.sms-custom-topup{padding:16px}.sms-custom-topup-row{flex-direction:column}.sms-wallet-packages{grid-template-columns:1fr}.sms-package{display:grid;grid-template-columns:1fr 1fr;gap:4px 12px}.sms-package-name{grid-column:1/-1}.sms-package-quantity{margin:5px 0}.sms-package-price{margin:8px 0;text-align:left}.sms-package button{grid-column:1/-1;margin-top:8px}.sms-packages-heading{align-items:flex-start;flex-direction:column;gap:3px}#sms-wallet-dialog{width:calc(100vw - 20px);max-height:calc(100dvh - 24px);border-radius:20px}.sms-mode-option{padding:16px}}

.sms-mode-save{display:flex;justify-content:flex-end;margin-top:18px}

html{scrollbar-gutter:stable}

/* Custom pattern editor: shares the CRM's form controls, cards and theme tokens. */
.sms-pattern-panel{border:1px solid var(--border);border-radius:var(--radius);margin-bottom:20px;background:var(--surface);overflow:hidden}
.sms-pattern-summary{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 20px;cursor:pointer;list-style:none}
.sms-pattern-summary::-webkit-details-marker{display:none}
.sms-pattern-summary::marker{content:''}
.sms-pattern-summary-copy{display:flex;align-items:center;gap:12px;min-width:0}
.sms-pattern-summary-copy strong{display:block;font-size:14px;font-weight:700;color:var(--text)}
.sms-pattern-icon{display:grid;place-items:center;width:36px;height:36px;flex-shrink:0;border-radius:10px;background:var(--surface-2);border:1px solid var(--border);color:var(--primary-ink);font-size:20px}
.sms-pattern-help{display:block;font-size:11.5px;color:var(--text-muted);line-height:1.9;font-weight:400}
.sms-pattern-summary-action{display:inline-flex;align-items:center;gap:8px;font-size:12px;font-weight:500;color:var(--primary-ink);white-space:nowrap}
.sms-pattern-summary-action svg{transition:transform .18s}
#sms-pattern-composer[open] .sms-pattern-summary{border-bottom:1px solid var(--border)}
#sms-pattern-composer[open] .sms-pattern-summary-action svg{transform:rotate(180deg)}
.sms-pattern-summary:focus-visible{outline:2px solid var(--primary);outline-offset:-3px}
.sms-pattern-form{padding:20px}
.sms-pattern-layout{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(240px,1fr);gap:24px;align-items:start}
.sms-pattern-editor{display:flex;flex-direction:column;gap:18px;min-width:0}
#sms-pattern-text{resize:vertical;min-height:144px;line-height:2;font-size:12px}
#sms-pattern-text::placeholder{font-size:11.5px;color:var(--text-muted);opacity:.8}
.sms-pattern-required{color:var(--primary-ink)}
.sms-pattern-field-meta{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:10.5px;color:var(--text-muted);line-height:1.8}
#sms-pattern-count{white-space:nowrap;font-variant-numeric:tabular-nums}
.sms-pattern-tags{display:flex;flex-wrap:wrap;gap:7px;margin-top:-7px}
.sms-pattern-tags .sms-var-chip{font-size:11px;padding:5px 9px}
.sms-pattern-preview{padding:16px;border:1px solid var(--border);border-radius:12px;background:var(--surface-2);display:flex;flex-direction:column;gap:14px;min-width:0}
.sms-pattern-preview-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:12px}
.sms-pattern-preview-heading .badge{font-size:10px;background:var(--surface);color:var(--text-muted);border:1px solid var(--border)}
.sms-pattern-preview-message{white-space:pre-wrap;overflow-wrap:anywhere;min-height:150px;max-height:260px;overflow:auto;padding:14px;border:1px solid var(--border);border-radius:10px;background:var(--surface);color:var(--text);font-size:12px;line-height:2.1}
.sms-pattern-preview-message[data-empty=true]{color:var(--text-muted);display:flex;align-items:center;justify-content:center;text-align:center}
.sms-pattern-footer{display:flex;align-items:center;justify-content:space-between;gap:18px;border-top:1px solid var(--border);padding-top:18px;margin-top:22px}
.sms-pattern-footer .btn{flex-shrink:0;font-size:12px}
#sms-pattern-status:not(:empty){margin-top:14px}
.sms-pattern-request-section{padding:16px 20px;border-top:1px solid var(--border)}
.sms-pattern-request-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px;font-size:12px}
.sms-pattern-empty{padding:12px 14px;border:1px dashed var(--border);border-radius:10px;font-size:11.5px;color:var(--text-muted);background:var(--surface-2)}
.sms-pattern-request-row{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:12px 14px;border:1px solid var(--border);border-radius:10px;background:var(--surface-2)}
.sms-pattern-request-row+.sms-pattern-request-row{margin-top:8px}
.sms-pattern-request-row strong{font-size:12px}
.sms-pattern-request-row p{font-size:11.5px;color:var(--text-muted);line-height:1.9;margin-top:4px;overflow-wrap:anywhere}
.sms-pattern-request-row .badge{flex-shrink:0;font-size:10px;background:var(--surface);border:1px solid var(--border);white-space:normal}
.sms-pattern-request-row[data-status=pending] .badge{color:var(--warning)}
.sms-pattern-request-row[data-status=approved] .badge{color:var(--success)}
.sms-pattern-request-row[data-status=rejected] .badge{color:var(--danger)}
@media(max-width:760px){.sms-pattern-layout{grid-template-columns:1fr;gap:18px}.sms-pattern-summary,.sms-pattern-form,.sms-pattern-request-section{padding:16px}.sms-pattern-summary-copy .sms-pattern-help{max-width:240px}.sms-pattern-footer{align-items:stretch;flex-direction:column;gap:12px}.sms-pattern-footer .btn{justify-content:center}.sms-pattern-request-row{flex-direction:column;gap:9px}.sms-pattern-request-heading{align-items:flex-start;flex-direction:column;gap:3px}.sms-pattern-preview-message{min-height:120px}}
@media(max-width:420px){.sms-pattern-summary{align-items:flex-start}.sms-pattern-summary-copy{gap:8px}.sms-pattern-summary-copy strong{font-size:12px}.sms-pattern-summary-action{font-size:11px;gap:3px}.sms-pattern-icon{display:none}.sms-pattern-field-meta{align-items:flex-start}}

/* Named clinic patterns: creation, review and selection share the CRM form language. */
.sms-pattern-intro{padding:20px;border-bottom:1px solid var(--border);background:var(--surface-2)}
.sms-pattern-intro h3{margin:0 0 5px;font-size:14px;color:var(--text)}
.sms-pattern-intro p{margin:0}
.sms-pattern-steps{display:flex;flex-wrap:wrap;gap:12px 24px;list-style:none;margin:16px 0 0;padding:0}
.sms-pattern-steps li{display:flex;align-items:center;gap:7px;font-size:11.5px;color:var(--text-muted)}
.sms-pattern-steps li span{display:grid;place-items:center;width:24px;height:24px;border:1px solid var(--border);border-radius:8px;background:var(--surface);color:var(--primary-ink);font-weight:700}
.sms-pattern-identity{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px;align-items:start}
.sms-pattern-identity .form-group{margin:0;min-width:0}
.sms-pattern-identity .sms-pattern-help{margin-top:7px}
.sms-pattern-suggestions{padding:12px 14px;border:1px solid var(--border);border-radius:10px;background:var(--surface-2)}
.sms-pattern-suggestions summary{cursor:pointer;font-size:12px;font-weight:500;color:var(--text)}
.sms-pattern-suggestions summary .sms-pattern-help{display:inline;font-size:10px;margin-inline-start:5px}
.sms-pattern-suggestions .sms-pattern-tags{margin-top:14px}
.sms-pattern-suggestions p{margin:10px 0 0}
.sms-pattern-message-editor .sms-pattern-tags{margin:8px 0 10px}
.sms-pattern-message-editor{margin:0}
.sms-pattern-request-copy{min-width:0;flex:1}
.sms-pattern-request-copy>strong{display:block;overflow-wrap:anywhere}
.sms-pattern-request-text{margin-top:8px}
.sms-pattern-request-text summary{cursor:pointer;font-size:11px;color:var(--primary-ink)}
.sms-pattern-request-text p{white-space:pre-wrap;overflow-wrap:anywhere}
#sms-pattern-status:empty{display:none}
#sms-pattern-status:not(:empty){margin:0;padding:12px 20px;border-top:1px solid var(--border)}
.sms-pattern-empty strong{display:block;font-size:12px;margin-bottom:5px}
.sms-pattern-empty p{margin:0;font-size:11.5px;line-height:1.9}
#sms-pattern-composer[open] .sms-pattern-summary-action{font-size:0}
#sms-pattern-composer[open] .sms-pattern-summary-action::before{content:'بستن فرم';font-size:12px}
@media(max-width:760px){.sms-pattern-intro{padding:16px}.sms-pattern-identity{grid-template-columns:1fr}.sms-pattern-steps{gap:10px 16px}.sms-pattern-steps li{font-size:10.5px}.sms-pattern-layout{gap:16px}}

@media(max-width:760px){.sms-pattern-steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.sms-pattern-steps li{flex-direction:column;text-align:center;line-height:1.8}}

/* پرونده پت: همان توکن‌ها و کنترل‌های پنل در هر دو تم */
.pet-reminders-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:12px; text-align:right; width:100%; }
.pet-row-reminders { grid-column:1 / -1; }
.pet-date-chips { display:flex; flex-wrap:wrap; gap:5px; margin-top:6px; }
.pet-date-chips .day-preset-chip { border-radius:999px; font-family:inherit; }
.pet-quick-visit { padding:14px; border:1px solid var(--border); border-radius:12px; background:var(--surface-2); margin-bottom:14px; }
.pet-quick-visit h4 { color:var(--primary-ink); font-size:13px; margin:0 0 12px; }
.pet-visit-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; align-items:start; }
.pet-visit-grid .form-group { min-width:0; margin-bottom:0; }
.pet-visit-note,.pet-visit-due { grid-column:span 2; }
.pet-due-overdue { color:var(--primary-ink); background:var(--primary-light); border:1px solid var(--primary); }
.pet-tag-clean { flex-wrap:wrap; }
.pet-quick-visit .form-control { width:100%; min-width:0; }
.pet-date-chips button:disabled { opacity:.5; cursor:default; }
@media(max-width:640px) {
 .pet-reminders-grid,.pet-visit-grid { grid-template-columns:minmax(0,1fr); }
 .pet-visit-note,.pet-visit-due { grid-column:auto; }
 .pet-quick-visit>.btn { width:100%; }
 .pet-row-reminders { justify-self:stretch; }
 .multi-pet-row>.form-control { width:100%; min-width:0; }
}

/* ثبت فوت در انتهای یادآورهای همان پت */
.pet-death-actions { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:16px; padding-top:12px; border-top:1px solid var(--border); text-align:right; }
.pet-death-actions .sms-pattern-help { flex:1; margin:0; line-height:1.9; min-width:0; }
.pet-death-actions .pet-death-button { flex-shrink:0; min-height:36px; padding:7px 14px; font-family:inherit; font-size:12px; line-height:1.7; white-space:nowrap; }
.pet-death-actions .pet-death-button:hover { border-color:var(--danger); }
.pet-death-actions .pet-death-button:focus-visible { outline:2px solid var(--danger); outline-offset:3px; }
.pet-death-actions .pet-death-button:disabled { opacity:.55; cursor:wait; }
@media(max-width:640px) {
 .pet-death-actions { flex-direction:column; align-items:stretch; gap:10px; }
 .pet-death-actions .pet-death-button { align-self:flex-start; min-height:40px; }
}

/* وضعیت پت، هم‌راستا با نشان‌های پرونده در هر دو تم */
.pet-status-deceased { display:inline-flex; align-items:center; gap:5px; padding:3px 9px; border:1px solid var(--border); border-radius:99px; background:var(--surface); color:var(--text-muted); font-size:11px; font-weight:500; line-height:1.7; white-space:nowrap; vertical-align:middle; }
.pet-status-deceased::before { content:""; width:5px; height:5px; flex-shrink:0; border-radius:50%; background:currentColor; opacity:.7; }
.pet-tag-deceased .pet-status-deceased { margin-inline-start:3px; }
.pet-tag-deceased .pet-tag-divider { color:var(--text-muted); font-weight:400; }
.pet-deceased-summary { grid-column:1 / -1; display:flex; align-items:center; flex-wrap:wrap; gap:8px; padding:4px 0; }
.pet-deceased-summary .sms-pattern-help { margin:0; }

/* Sales radar shares the CRM typography, theme tokens and controls. */
.radar-dashboard-card{font:inherit;text-align:start}
.radar-dashboard-card .kpi-value,.radar-dashboard-card .kpi-sub{display:block}
.radar-heading{display:flex;align-items:center;justify-content:space-between;gap:18px;flex-wrap:wrap}
.radar-heading h2{margin:0}.radar-heading p{margin-bottom:0}
.radar-row-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.radar-tabs{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:20px}.radar-tabs button{display:flex;flex-direction:column;gap:6px;align-items:flex-start;white-space:normal;text-align:right}
.radar-tabs small{font-size:11px;font-weight:400}.radar-toolbar{display:flex;gap:16px;align-items:center;flex-wrap:wrap;margin-bottom:16px}
.radar-table-wrap{width:100%;overflow-x:auto}.radar-table-wrap table{width:100%;border-collapse:collapse;min-width:820px}.radar-table-wrap th,.radar-table-wrap td{text-align:right;padding:16px 12px;border-bottom:1px solid var(--border);vertical-align:top}.radar-table-wrap th{background:var(--surface-2);color:var(--text-muted);font-size:12px}.radar-table-wrap td{font-size:13px}.radar-table-wrap td:first-child{min-width:150px}.radar-table-wrap td:nth-child(2){max-width:320px}.radar-table-wrap small{color:var(--text-muted)}
.radar-insight{display:block;padding:9px 12px;background:var(--surface-2);border:1px solid var(--border);border-radius:8px;font-size:12px;line-height:1.9}
.radar-estimate{margin-top:10px;font-weight:700}.radar-state{display:flex;flex-direction:column;align-items:flex-start;gap:12px}.radar-state .badge{white-space:normal;line-height:1.8}.radar-empty{text-align:center!important;color:var(--text-muted);padding:32px!important}
.radar-dialog{box-sizing:border-box;width:min(640px,calc(100% - 28px));max-height:85dvh;overflow-y:auto;background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:16px;padding:24px;font-family:var(--font-family);box-shadow:0 20px 60px #0003}.radar-dialog::backdrop{background:#0008}.radar-dialog .card-header{gap:12px}.radar-dialog h2{font-size:17px}.radar-dialog textarea{resize:vertical}.radar-dialog .form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.radar-preview{white-space:pre-wrap;line-height:2;background:var(--surface-2);border-radius:8px;padding:12px}.radar-preview:empty{display:none}
#view-sales-radar .kpi-value{font-size:clamp(19px,2vw,28px);overflow-wrap:anywhere}#view-sales-radar .kpi-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
@media(max-width:1000px){#view-sales-radar .kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.radar-heading,.radar-dialog{padding:16px}.radar-tabs{flex-wrap:nowrap;overflow-x:auto;padding-bottom:8px}.radar-tabs button{min-width:175px;flex-shrink:0}.radar-dialog .form-grid{grid-template-columns:1fr}.radar-toolbar>.btn{width:100%}#view-sales-radar .kpi-grid{gap:10px}.radar-dialog .card-header{align-items:flex-start}}
.radar-dialog{margin:auto}

.radar-dialog-footer{display:flex;align-items:center;gap:10px;margin-top:20px;padding-top:16px;border-top:1px solid var(--border)}
.radar-dialog-footer .btn{min-height:44px;padding:10px 20px}
@media(max-width:600px){.radar-dialog-footer .btn{width:100%;justify-content:center}}

.radar-sms-settings{width:min(920px,calc(100% - 28px))}.radar-sms-settings .card-header{align-items:flex-start}.radar-sms-settings .card-header .btn{flex-shrink:0}.radar-sms-settings .card-header p{margin:8px 0 0}.radar-sms-settings .sms-pattern-layout{margin-top:18px}.radar-sms-settings .sms-pattern-editor{display:flex;flex-direction:column;gap:16px;min-width:0}.radar-sms-settings .sms-pattern-footer{gap:10px;flex-wrap:wrap}.radar-sms-settings .sms-pattern-footer>.btn{min-height:44px}#radar-sms-approved-text{white-space:pre-wrap;overflow-wrap:anywhere}#radar-hunt-settings-link{margin-bottom:16px}
.radar-category-help{background:var(--surface-2);border:1px solid var(--border);border-radius:10px;padding:14px 16px;margin-bottom:18px}.radar-category-help strong{font-size:13px}.radar-category-help p{font-size:12px;color:var(--text-muted);line-height:2;margin:6px 0 0}
@media(max-width:600px){.radar-sms-settings .sms-pattern-footer>.btn{width:100%}.radar-category-help{padding:12px}}

.radar-sms-settings[open]{display:flex;flex-direction:column;overflow:hidden}.radar-sms-settings>.card-header,.radar-sms-dialog-footer{flex-shrink:0}.radar-sms-settings>form{overflow-y:auto;min-height:0;padding-inline:2px}.radar-sms-dialog-footer{margin-top:16px;padding-top:16px}

.radar-sms-settings .radar-sms-dialog-footer{justify-content:flex-start}.radar-sms-dialog-footer>.btn:last-child{margin-inline-start:auto}
@media(max-width:760px){.radar-sms-dialog-footer>.btn:last-child{margin-inline-start:0}}

.radar-sms-settings.radar-sms-confirmed{width:min(560px,calc(100% - 28px))}.radar-pattern-confirmation{text-align:center;padding:18px 8px 4px;overflow-y:auto;outline:none}.radar-pattern-confirmation-icon{display:grid;place-items:center;width:64px;height:64px;margin:0 auto 18px;border-radius:50%;background:var(--primary-light);color:var(--primary-ink);font-size:36px;font-weight:700}.radar-pattern-confirmation h3{font-size:19px;color:var(--text);margin:0 0 14px}.radar-pattern-confirmation p{font-size:14px;line-height:2;color:var(--text-muted);overflow-wrap:anywhere}.radar-pattern-confirmation .badge{display:inline-block;margin:14px 0;white-space:normal}.radar-pattern-confirmation-next{padding:14px;border:1px solid var(--border);border-radius:10px;background:var(--surface-2)}.radar-pattern-confirmation-actions{display:flex;justify-content:center;gap:10px;flex-wrap:wrap;margin-top:22px}.radar-pattern-confirmation-actions .btn{min-height:44px;padding:10px 20px}
@media(max-width:600px){.radar-pattern-confirmation{padding-inline:0}.radar-pattern-confirmation-actions .btn{width:100%}}

/* ثبت مراجعه در مدال پرونده */
.qtl-visit-guidance { margin:0 0 12px; }
.qtl-visit-grid { margin-top:0; align-items:start; }
.qtl-visit-grid .form-group { min-width:0; margin-bottom:0; }
.qtl-visit-schedule { margin-top:0; }
.qtl-visit-schedule > .sms-pattern-help { grid-column:1 / -1; margin:0; }

/* Doctor workspace reuses CRM forms, tables, badges and navigation. */
body[data-role="doctor"] .sidebar-sub-status-card,
body[data-role="doctor"] .top-actions > [hidden],
#view-doctor [hidden] { display: none !important; }
body.doctor-loading { visibility: hidden; }
body[data-role="doctor"] .spa-view:not(#view-doctor):not(#view-appointments) { display: none !important; }
#view-doctor .card { margin-bottom: 20px; }
#view-doctor .card-header { flex-wrap: wrap; gap: 10px; }
#doctor-intake-host { padding-top: 6px; }
#doctor-intake-host .source-check-grid,
#doctor-intake-host #qtl-cond-website-box,
#doctor-intake-host #qtl-cond-sub-box,
#doctor-intake-host .form-group:has(#qtl-visit-amount),
#doctor-intake-host .form-group:has(input[id$="-next_grooming"]),
#doctor-intake-host .form-group:has(input[id$="-next_wash"]) { display: none !important; }
#doctor-intake-host .form-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
#doctor-intake-host #qtl-cond-pet-box > .form-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
.doctor-existing-row, .doctor-pet-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.doctor-existing-row { justify-content: space-between; }
.doctor-existing-row .doctor-pet-badges { margin-top: 8px; }
.doctor-search { display: flex; gap: 10px; margin: 16px 0; }
.doctor-search .form-control { flex: 1; min-width: 0; }
.doctor-table { min-width: 760px; }
.doctor-table .btn { white-space: nowrap; }
.doctor-table .sms-pattern-help { margin-top: 5px; }
.doctor-pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; font-size: 12.5px; color: var(--text-muted); }
.doctor-pagination > div { display: flex; align-items: center; gap: 8px; }
#doctor-page-number { font-weight: 700; padding: 8px; color: var(--text); }
.doctor-empty { padding: 40px; text-align: center; color: var(--text-muted); }
.doctor-records { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,260px),1fr)); gap: 12px; margin: 16px 0; }
.doctor-pet { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); color: var(--text); overflow-wrap: anywhere; }
.doctor-pet p { margin-top: 8px; }
.doctor-history { padding: 16px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.doctor-history p { margin-top: 8px; line-height: 1.9; }
.doctor-back { margin-bottom: 16px; }
@media(max-width:600px) {
  #doctor-intake-host .form-grid, #doctor-intake-host #qtl-cond-pet-box > .form-grid { grid-template-columns: minmax(0,1fr); }
  .doctor-search { flex-wrap: wrap; }
  .doctor-search .form-control { flex-basis: 100%; }
  .doctor-pagination { justify-content: center; }
  .doctor-pagination > div { width: 100%; justify-content: space-between; gap: 4px; }
  .doctor-pagination .btn { font-size: 11px; padding: 8px; }
  body[data-role="doctor"] .mobile-nav-item { flex: 1; }
}

/* Doctor statistics inherit the original CRM KPI card design. */
.doctor-stat-card { text-align: right; }
.doctor-stat-card .kpi-value { display: block; }
.doctor-stat-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.doctor-kpi-icon { background: var(--clinic-bg); color: var(--clinic-text); }
.doctor-file-button { height: 40px; padding: 0 12px; border-radius: 9px; font-size: 14px; white-space: nowrap; flex-shrink: 0; }
.doctor-file-button svg { flex-shrink: 0; }
.doctor-file-button:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.doctor-case-note { min-width: 160px; max-width: 320px; white-space: pre-wrap; overflow-wrap: anywhere; }

#doctor-dashboard-status:empty { display: none; }
@media(max-width:600px) {
  body[data-role="doctor"] .top-bar { flex-wrap: wrap; }
  body[data-role="doctor"] .top-actions { flex: 1 0 100%; justify-content: space-between; }

}

.doctor-dashboard-toolbar { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:16px; flex-wrap:wrap; }
.doctor-period-filter { margin:0; padding:5px; background:var(--surface); border:1px solid var(--border); border-radius:12px; gap:5px; }
.doctor-workspace-grid { display:grid; grid-template-columns:minmax(0,2fr) minmax(270px,1fr); align-items:start; gap:18px; }
.doctor-workspace-grid > * { min-width:0; }
.doctor-workspace-grid .card-header { align-items:flex-start; }
.doctor-today-table { min-width:620px; }
.doctor-visit-note { min-width:120px; max-width:200px; overflow-wrap:anywhere; line-height:1.9; }
.doctor-record-link { background:transparent; border:0; padding:0; color:var(--primary-ink); cursor:pointer; font-size:12.5px; font-weight:700; text-align:right; }
.doctor-record-link:hover { text-decoration:underline; }
.doctor-record-link:focus-visible { outline:2px solid var(--primary); outline-offset:3px; }
.doctor-followup-row { padding:16px 0; border-bottom:1px solid var(--border); }
.doctor-followup-row p { margin-top:8px; line-height:1.9; }
.doctor-followup-actions { display:flex; flex-wrap:wrap; gap:7px; margin-top:10px; }
.doctor-service-badge { white-space:nowrap; }
.doctor-service-checkup { background:var(--clinic-bg); color:var(--clinic-text); }
.doctor-service-vaccine { background:var(--bday-bg); color:var(--bday-text); }
.doctor-service-anti_parasite { background:var(--sub-bg); color:var(--sub-text); }
.doctor-service-fluid_therapy { background:var(--wash-bg); color:var(--wash-text); }
.doctor-service-nail_trim { background:var(--groom-bg); color:var(--groom-text); }
.doctor-service-anal_gland { background:var(--walkin-bg); color:var(--walkin-text); }
.doctor-quick-details { margin:0 0 16px; border:1px solid var(--border); border-radius:var(--radius); background:var(--surface-2); }
.doctor-quick-details > summary { cursor:pointer; padding:13px 14px; color:var(--primary-ink); font-size:12.5px; font-weight:700; }
.doctor-quick-details[open] > summary { border-bottom:1px solid var(--border); }
#doctor-dashboard-intake-host > #doctor-intake-panel { padding:14px; }
.doctor-followups .doctor-empty { padding:24px 0; }
@media(max-width:1150px) { .doctor-workspace-grid { grid-template-columns:minmax(0,1fr); } }
@media(max-width:600px) {
 .doctor-period-filter { width:100%; flex-wrap:nowrap; }
 .doctor-period-filter .pill-btn { flex:1; padding:8px 6px; font-size:11px; }
 .doctor-workspace-grid { gap:0; }
 #doctor-dashboard-intake-host > #doctor-intake-panel { padding:10px; }
}

/* The physician's account menu sits alongside the page title in the CRM header. */
body[data-role="doctor"] .top-bar-title { display:flex; align-items:center; flex-wrap:wrap; gap:14px; min-width:0; }
.doctor-identity-menu { --doctor-identity-ink:var(--primary); }
html[data-theme="dark"] .doctor-identity-menu { --doctor-identity-ink:color-mix(in srgb,var(--primary) 45%,white); }
.doctor-identity-menu summary { height:40px; gap:8px; padding:4px 10px; border-color:color-mix(in srgb,var(--primary) 28%,var(--border)); border-radius:11px; background:linear-gradient(120deg,var(--surface-2),var(--primary-light)); box-shadow:0 3px 12px color-mix(in srgb,var(--primary) 10%,transparent); }
.doctor-identity-menu summary:hover, .doctor-identity-menu[open] summary { border-color:var(--primary); box-shadow:0 4px 14px color-mix(in srgb,var(--primary) 16%,transparent); }
.doctor-identity-menu .clinic-account-avatar { display:grid; place-items:center; flex-shrink:0; width:28px; height:28px; border-radius:8px; background:var(--primary); color:#fff; }
.doctor-identity-menu .role-switcher-select { height:auto; padding:0; max-width:240px; overflow:hidden; text-overflow:ellipsis; color:var(--doctor-identity-ink); font-size:13.5px; font-weight:700; }
.doctor-identity-menu .clinic-account-chevron { color:var(--doctor-identity-ink); flex-shrink:0; }
.doctor-page-description { margin:0 0 18px; line-height:1.9; }
@media(max-width:600px) {
 body[data-role="doctor"] .top-bar-title { gap:8px; }
 .doctor-identity-menu summary { gap:6px; padding:4px 8px; max-width:calc(100vw - 76px); }
 .doctor-identity-menu .clinic-account-avatar { width:24px; height:24px; border-radius:7px; }
 .doctor-identity-menu .role-switcher-select { max-width:160px; font-size:12px; }
}

.doctor-followup-confirmed { background:var(--success-bg); color:var(--success); line-height:1.4; margin:0; align-self:center; }
.doctor-followup-row[aria-busy="true"] .doctor-followup-actions { opacity:.75; }

/* Passport tools inherit each clinic's existing theme and component styling. */
.pet-passport-links { display:inline-flex; flex-wrap:wrap; gap:6px; align-items:center; }
.pet-passport-links .btn { text-decoration:none; margin:0; font-size:11px; padding:7px 10px; }
.pet-passport-table-actions { display:flex; flex-wrap:wrap; gap:6px; margin-top:6px; }
.pet-passport-table-actions > span { display:inline-flex; align-items:center; gap:5px; }
.pet-copy-field { position:fixed; inset-inline-start:-9999px; top:0; }
.passport-inbox-tools,.passport-inbox-row-actions { display:flex; align-items:center; flex-wrap:wrap; gap:7px; }
/* Appointment desk: shared CRM cards, theme tokens, RTL and Shabnam. */
.appointment-kpis{grid-template-columns:repeat(4,minmax(0,1fr))}
.appointment-kpis .kpi-card{min-width:0;display:flex;flex-direction:column;gap:12px}
.appointment-kpi-link{display:flex;flex-direction:column;gap:10px;background:none;border:0;padding:0;color:inherit;font:inherit;text-align:start;cursor:pointer;width:100%}
.appointment-kpis .kpi-sub{line-height:1.9;white-space:normal}
.appointment-kpis .btn{white-space:normal;font-size:11px}
.appointment-toolbar{display:flex;gap:16px;flex-wrap:wrap;align-items:center}
.appointment-toolbar .filter-bar{margin:0;display:flex;gap:8px;flex-wrap:wrap;flex:1}
.appointment-toolbar .form-group{margin:0;min-width:190px}
.appointment-shift+.appointment-shift{margin-top:26px}
.appointment-list{display:grid;gap:12px}
.appointment-row{display:grid;grid-template-columns:125px minmax(0,1fr) 185px;gap:18px;align-items:start;margin:0}
.appointment-clock{display:flex;flex-direction:column;gap:10px;font-size:11px;color:var(--text-muted)}
.appointment-details{min-width:0;font-size:12px;line-height:1.9;overflow-wrap:anywhere}
.appointment-details a{color:var(--text-muted);text-decoration:none}
.appointment-details .pet-red-flags{font-size:12px;margin:10px 0}
.appointment-actions{display:flex;flex-direction:column;gap:8px}
.appointment-actions .btn{font-size:11px;white-space:normal;min-height:38px}
.appointment-prep{display:block;white-space:pre-wrap;overflow-wrap:anywhere;background:var(--warning-bg);color:var(--warning);border-radius:8px;padding:10px 12px;line-height:1.9;font-size:12px;margin:12px 0}
.appointment-dialog{width:min(760px,calc(100% - 28px))}
.appointment-dialog #appointment-identity{margin-bottom:20px}
.appointment-dialog #appointment-new-customer{display:block;margin-top:14px}
.appointment-dialog [hidden],.appointment-prep[hidden]{display:none!important}
.appointment-search-results{max-height:220px;overflow-y:auto}
.appointment-search-results .pet-search-result{width:100%;display:flex;justify-content:space-between;flex-wrap:wrap;gap:8px}
.appointment-shortcuts{margin-top:8px}.appointment-shortcuts .btn{font-size:11px}
.appointment-check{font-size:13px;display:flex;align-items:center;gap:8px;margin-top:14px}
.appointment-check input,.appointment-prep input{accent-color:var(--primary);width:16px;height:16px;vertical-align:middle}
.appointment-dialog .radar-dialog-footer{flex-wrap:wrap}
.appointment-sms-settings{width:min(920px,calc(100% - 28px))}
.appointment-sms-settings[open]{display:flex;flex-direction:column;overflow:hidden}
.appointment-sms-settings>.card-header,.appointment-sms-footer{flex-shrink:0}
.appointment-sms-settings>.card-header{gap:12px;align-items:flex-start;flex-wrap:nowrap}
.appointment-sms-settings>.card-header>div{min-width:0}
.appointment-sms-settings>form{overflow-y:auto;min-height:0;padding-inline:2px}
.appointment-sms-settings .sms-pattern-layout{margin-top:18px}
.appointment-sms-settings .sms-pattern-tags{margin:10px 0}
.appointment-sms-settings textarea{line-height:2;resize:vertical;font-size:12px}
.appointment-sms-settings .sms-pattern-field-meta{flex-wrap:wrap;margin-top:8px}
.appointment-sms-settings .sms-pattern-help{margin:6px 0}
.appointment-sms-settings [hidden],#appointment-sms-settings-button[hidden]{display:none!important}
.appointment-sms-footer{margin-top:16px;padding-top:14px}
@media(max-width:600px){.appointment-sms-settings .card-title{font-size:15px}.appointment-sms-settings .card-header p{margin-bottom:0}.appointment-sms-footer{gap:8px}.appointment-sms-footer .btn{width:100%}.appointment-sms-settings .sms-var-chip{white-space:normal}}
@media(max-width:1100px){.appointment-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.appointment-row{grid-template-columns:110px minmax(0,1fr)}.appointment-actions{grid-column:1/-1;flex-direction:row;flex-wrap:wrap}}
@media(max-width:600px){.appointment-kpis{gap:10px}.appointment-kpis .kpi-card{padding:14px}.appointment-kpis .kpi-title{font-size:11px}.appointment-row{grid-template-columns:minmax(0,1fr);padding:14px}.appointment-clock{flex-direction:row;flex-wrap:wrap;align-items:center}.appointment-toolbar{align-items:stretch}.appointment-toolbar .form-group{width:100%}.appointment-actions .btn{flex:1 1 135px}.appointment-dialog .card-header{flex-wrap:nowrap}.appointment-dialog .card-header h2{font-size:15px}.appointment-check{align-items:flex-start}}
.passport-inbox-tools .form-control { width:auto; max-width:100%; font-size:12px; }
.passport-inbox-list { display:grid; gap:10px; margin-top:12px; }
.passport-inbox-row { gap:14px; flex-wrap:wrap; }
.passport-inbox-details { min-width:0; font-size:12px; }
.passport-inbox-phone { color:var(--text-muted); text-decoration:none; }
.passport-inbox .passport-owner-note { white-space:pre-wrap; overflow-wrap:anywhere; max-width:100%; color:var(--text-muted); margin:6px 0; }
.passport-inbox-row-actions .btn { font-size:11px; }
.passport-inbox .doctor-pagination { margin-top:14px; }
@media(max-width:600px) {
  .passport-inbox-row { align-items:stretch; flex-direction:column; }
  .passport-inbox-tools { width:100%; }
  .passport-inbox-row-actions .btn { flex:1; min-height:38px; }
  .passport-inbox .doctor-pagination { flex-wrap:wrap; gap:10px; }
}

/* A clinic may choose its own accent; the corporate palette remains the default. */
html[data-custom-accent] { --primary-ink: color-mix(in srgb, var(--primary) 76%, #061b21); --primary-soft: color-mix(in srgb, var(--primary) 6.5%, transparent); }
html[data-theme="dark"][data-custom-accent] { --primary-ink: color-mix(in srgb, var(--primary) 72%, white); --primary-soft: color-mix(in srgb, var(--primary) 10%, transparent); }
