/* ════════════════════════════════════════════════════════════
   DosTime Design System — نسخه WebApp
   مرجع: DosTime_WebApp_Design_Spec.md · پلن اجرا
   ════════════════════════════════════════════════════════════ */

/* ─── تم ۱: روشن (سفید) — پیش‌فرض ─── */
:root,
html[data-theme='light'] {
  /* ─── رنگ‌های پایه ─── */
  --primary: #5b4fcf;
  --primary-dark: #4338a8;
  --primary-light: #eef0ff;
  --primary-mid: #7b6fe0;

  --accent: #2ba8e0;
  --accent-dark: #1a8bc4;
  --accent-light: #e6f6fd;

  /* ─── رنگ‌های جدید نسخه ۲ ─── */
  --teal: #0ca678;
  --teal-light: #e6fcf5;
  --coral: #f03e3e;
  --coral-light: #ffe8e8;
  --amber: #f59f00;
  --amber-light: #fff4d6;
  --violet: #7c3aed;
  --violet-light: #f3e8ff;
  --network: #e64980;
  --network-light: #ffe3ef;

  /* ─── رنگ‌های وضعیت ─── */
  --success: #22c55e;
  --success-bg: #f0fdf4;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --info: #3b82f6;
  --info-bg: #eff6ff;

  /* ─── خاکستری‌ها ─── */
  --neutral-50: #f8fafc;
  --neutral-100: #f1f5f9;
  --neutral-200: #e2e8f0;
  --neutral-300: #cbd5e1;
  --neutral-400: #94a3b8;
  --neutral-500: #64748b;
  --neutral-600: #475569;
  --neutral-700: #334155;
  --neutral-800: #1e293b;
  --neutral-900: #0f172a;

  /* ─── بک‌گراندها ─── */
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-topbar: #ffffff;
  --bg-soft: #f1f5f9;

  /* ─── متن ─── */
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;

  /* ─── بوردر ─── */
  --border: #e2e8f0;
  --border-focus: #5b4fcf;

  /* ─── شل/ناو ─── */
  --nav-bg: rgb(255 255 255 / 0.92);

  /* ─── فونت‌ها ─── */
  --font-sans: 'Vazirmatn', 'Inter', 'IRANSans', system-ui, sans-serif;
  --font-mono: 'Fira Code', 'JetBrains Mono', monospace;

  /* ─── شعاع گوشه ─── */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl: 32px;
  --radius-full: 9999px;

  /* ─── سایه ─── */
  --shadow-xs: 0 1px 2px rgb(0 0 0 / 0.04);
  --shadow-sm: 0 2px 8px rgb(0 0 0 / 0.06), 0 1px 3px rgb(0 0 0 / 0.04);
  --shadow-md: 0 4px 16px rgb(0 0 0 / 0.08), 0 2px 6px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 8px 32px rgb(0 0 0 / 0.1), 0 4px 12px rgb(0 0 0 / 0.06);
  --shadow-xl: 0 16px 48px rgb(0 0 0 / 0.12), 0 8px 24px rgb(0 0 0 / 0.07);
  --shadow-primary: 0 4px 20px rgb(91 79 207 / 0.25);
  --shadow-accent: 0 4px 16px rgb(43 168 224 / 0.2);

  /* ─── انتقال و انیمیشن ─── */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  /* ─── ابعاد چیدمان ─── */
  --header-h: 52px;
  --nav-h: 56px;
}

/* ─── تم ۲: تیره (بنفش/آبی/مشکی) ─── */
html[data-theme='dark'] {
  --primary: #7c6ff0;
  --primary-dark: #5b4fcf;
  --primary-light: #2e2a55;
  --primary-mid: #9a90f5;

  --accent: #38bdf8;
  --accent-dark: #0ea5e9;
  --accent-light: #12324a;

  --teal: #20c997;
  --teal-light: #0c2f26;
  --coral: #ff6b6b;
  --coral-light: #3a1d1d;
  --amber: #ffd43b;
  --amber-light: #33290f;
  --violet: #a78bfa;
  --violet-light: #2a2250;
  --network: #f783ac;
  --network-light: #3a1d2e;

  --success: #34d399;
  --success-bg: #102f26;
  --warning: #fbbf24;
  --warning-bg: #33290f;
  --danger: #f87171;
  --danger-bg: #3a1d20;
  --info: #60a5fa;
  --info-bg: #16263d;

  --neutral-50: #171b2b;
  --neutral-100: #202540;
  --neutral-200: #2b3150;
  --neutral-300: #3b4270;
  --neutral-400: #555e8f;
  --neutral-500: #737cad;
  --neutral-600: #949cc9;
  --neutral-700: #b9bfe2;
  --neutral-800: #d5d9f0;
  --neutral-900: #edeffa;

  --bg-page: #0f1220;
  --bg-card: #191e33;
  --bg-sidebar: #191e33;
  --bg-topbar: rgb(25 30 51 / 0.92);
  --bg-soft: #202540;

  --text-primary: #eef0fa;
  --text-secondary: #b9bfe2;
  --text-tertiary: #737cad;

  --border: #2b3150;
  --border-focus: #7c6ff0;

  --nav-bg: rgb(25 30 51 / 0.92);

  --shadow-xs: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-sm: 0 2px 8px rgb(0 0 0 / 0.4), 0 1px 3px rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 16px rgb(0 0 0 / 0.5), 0 2px 6px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 8px 32px rgb(0 0 0 / 0.55), 0 4px 12px rgb(0 0 0 / 0.4);
  --shadow-xl: 0 16px 48px rgb(0 0 0 / 0.6), 0 8px 24px rgb(0 0 0 / 0.45);
  --shadow-primary: 0 4px 20px rgb(124 111 240 / 0.35);
  --shadow-accent: 0 4px 16px rgb(56 189 248 / 0.3);

  color-scheme: dark;
}

/* ═══════════════ پایه ═══════════════ */

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

html {
  direction: rtl;
}

body {
  margin: 0;
  background-color: var(--neutral-300);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

html[data-theme='dark'] body {
  background-color: #080a12;
}

h1, h2, h3, h4, p {
  margin: 0;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--text-primary);
}

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

*:focus-visible {
  outline: 3px solid var(--border-focus);
  outline-offset: 2px;
}

.dir-ltr {
  direction: ltr;
}

:is(input, textarea).dir-ltr {
  text-align: left;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ═══════════════ انیمیشن‌ها ═══════════════ */

@keyframes dos-fade-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes dos-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

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

.dos-animate-fade-in {
  animation: dos-fade-in var(--transition-normal) ease;
}

@keyframes dos-fade-slide {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.screen {
  animation: dos-fade-slide 0.28s ease;
}

.dos-pulse {
  animation: dos-pulse 2s infinite;
}

/* ═══════════════ لایوت اپ — قاب موبایلی ═══════════════ */

#app {
  position: relative;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg-page);
  box-shadow: 0 0 80px rgb(0 0 0 / 0.08);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--header-h);
  padding-inline: 16px;
  padding-top: env(safe-area-inset-top);
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border);
}

.topbar-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--primary);
}

.topbar-spacer {
  flex: 1;
}

#view {
  flex: 1;
  min-height: calc(100vh - var(--header-h) - var(--nav-h));
  padding: 14px 14px calc(var(--nav-h) + 20px);
}

body.auth-mode #header {
  display: none;
}

body.auth-mode #view {
  min-height: calc(100vh - var(--nav-h));
  padding: 14px 14px calc(var(--nav-h) + 20px);
}

/* ─── هدر صفحه ─── */

.page-head {
  margin-bottom: 14px;
}

.page-head h1 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
}

.page-head p {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.page-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ═══════════════ کامپوننت‌ها ═══════════════ */

/* ─── Card ─── */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.card-pad {
  padding: 14px;
}

.section-title {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
  padding-top: 10px;
}

.card-pad-sm {
  padding: 10px;
}

.profile-page .text-lg {
  font-size: 15px;
}

.profile-page .text-base {
  font-size: 12.5px;
}

.profile-page .text-sm {
  font-size: 10px;
}

.profile-page .text-xs {
  font-size: 9.5px;
}

.profile-page .field-label {
  font-size: 11px;
}

.profile-page .input,
.profile-page .select {
  font-size: 11.5px;
}

.profile-page .btn {
  font-size: 11px;
}

.profile-page .btn-sm {
  font-size: 10px;
}

.card-hero {
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: var(--shadow-primary);
}

.card-hero .text-muted {
  color: rgb(255 255 255 / 0.8);
}

.card-hero .text-faint {
  color: rgb(255 255 255 / 0.65);
}

/* ─── Button ─── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding-inline: 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  transition: background var(--transition-fast), border-color var(--transition-fast),
    color var(--transition-fast), opacity var(--transition-fast), box-shadow var(--transition-fast);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.btn svg {
  flex-shrink: 0;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-primary);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-soft);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--neutral-100);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
}

.btn-sm {
  height: 32px;
  padding-inline: 10px;
  font-size: 12px;
}

.btn-lg {
  height: 44px;
  padding-inline: 20px;
  font-size: 14px;
}

.btn-block {
  width: 100%;
}

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 13px;
}

.btn-link:hover {
  color: var(--primary-dark);
}

/* ─── Input / Select ─── */

.field {
  display: block;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.input,
.select {
  width: 100%;
  height: 40px;
  padding-inline: 11px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast);
}

.input:focus,
.select:focus {
  outline: none;
  border-color: var(--border-focus);
}

.input::placeholder {
  color: var(--text-tertiary);
}

.input.has-error {
  border-color: var(--danger);
}

.field-error {
  margin-top: 4px;
  font-size: 12px;
  color: var(--danger);
}

.field-hint {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ─── Badge ─── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: var(--radius-full);
  font-weight: 500;
  font-size: 12px;
  padding: 5px 10px;
  white-space: nowrap;
}

.badge-sm {
  font-size: 10px;
  padding: 3px 8px;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-accent { background: var(--accent-light); color: var(--accent); }
.badge-neutral { background: var(--neutral-100); color: var(--neutral-500); }
.badge-network { background: var(--network-light); color: var(--network); }

/* ─── Tabs / Filter chips ─── */

.segmented {
  display: inline-flex;
  padding: 3px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.segmented button {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.segmented button:hover {
  background: var(--neutral-100);
}

.segmented button.active {
  background: var(--primary-light);
  color: var(--primary);
}

/* ─── Tabs (خطی برای ورود) ─── */

.tabs-line {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.tabs-line button {
  flex: 1;
  padding: 12px 0;
  border-bottom: 2px solid transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-tertiary);
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.tabs-line button:hover {
  color: var(--text-secondary);
}

.tabs-line button.active {
  border-color: var(--primary);
  color: var(--primary);
}

/* ═══════════════ لایوت‌های کاربردی ═══════════════ */

.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.wrap { flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.grid-7 { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.flex-1 { flex: 1; min-width: 0; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 10px; }
.gap-4 { gap: 14px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 10px; }
.mt-4 { margin-top: 14px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 10px; }
.mb-4 { margin-bottom: 14px; }
.pt-4 { padding-top: 14px; }
.py-10 { padding-block: 32px; }

/* ─── متن ─── */

.text-muted { color: var(--text-secondary); }
.text-faint { color: var(--text-tertiary); }
.text-primary-c { color: var(--primary); }
.text-accent-c { color: var(--accent); }
.text-success-c { color: var(--success); }
.text-warning-c { color: var(--warning); }
.text-danger-c { color: var(--danger); }
.text-network-c { color: var(--network); }
.bg-network-light { background: var(--network-light); }
.text-sm { font-size: 12.5px; }
.text-base { font-size: 15px; }
.text-xs { font-size: 11.5px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 21px; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 800; }
.font-medium { font-weight: 500; }
.text-center { text-align: center; }
.text-start { text-align: start; }
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ═══════════════ Bottom Nav — ثابت و محدود به قاب ═══════════════ */

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  max-width: 480px;
  margin: 0 auto;
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 8px rgb(0 0 0 / 0.04);
}

.bottom-nav a,
.bottom-nav span {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 9px;
  font-weight: 500;
  color: var(--text-tertiary);
  transition: color var(--transition-fast);
}

.bottom-nav a.active {
  color: var(--primary);
}

.bottom-nav a:hover:not(.active) {
  color: var(--text-secondary);
}

.bottom-nav [aria-disabled='true'] {
  cursor: not-allowed;
  opacity: 0.45;
}

.bottom-nav svg {
  width: 20px;
  height: 20px;
}

@keyframes network-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgb(230 73 128 / 0.35); }
  50% { box-shadow: 0 0 0 6px rgb(230 73 128 / 0); }
}

.bottom-nav .nav-network.active svg {
  color: var(--network);
  animation: network-pulse 2s infinite;
}

/* ═══ منوی AI — حباب گرادیانی برجسته ═══ */

.bottom-nav .nav-ai {
  position: relative;
}

.bottom-nav .nav-ai .ai-bubble {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 55%, #f59e0b 125%);
  box-shadow:
    0 5px 14px rgb(139 92 246 / 0.5),
    inset 0 0 0 2px rgb(255 255 255 / 0.28);
  margin-top: -12px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  animation: ai-bubble-glow 3s ease-in-out infinite;
}

.bottom-nav .nav-ai .ai-bubble svg {
  width: 22px;
  height: 22px;
  color: #fff;
  filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.25));
}

.bottom-nav .nav-ai .ai-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, #8b5cf6, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.bottom-nav .nav-ai:hover .ai-bubble,
.bottom-nav .nav-ai.active .ai-bubble {
  transform: scale(1.1);
}

.bottom-nav .nav-ai.active .ai-bubble {
  animation: none;
  box-shadow:
    0 6px 20px rgb(236 72 153 / 0.65),
    inset 0 0 0 2px rgb(255 255 255 / 0.35);
}

@keyframes ai-bubble-glow {
  0%,
  100% {
    box-shadow:
      0 5px 14px rgb(139 92 246 / 0.5),
      inset 0 0 0 2px rgb(255 255 255 / 0.28);
  }
  50% {
    box-shadow:
      0 5px 20px rgb(236 72 153 / 0.75),
      inset 0 0 0 2px rgb(255 255 255 / 0.28);
  }
}

/* ═══════════════ Header button (bell / avatar) ═══════════════ */

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: background var(--transition-fast);
}

.icon-btn:hover {
  background: var(--neutral-100);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.notif-badge {
  position: absolute;
  top: 6px;
  inset-inline-end: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding-inline: 4px;
  border-radius: var(--radius-full);
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}

.avatar-lg {
  width: 64px;
  height: 64px;
  font-size: 20px;
}

/* ═══════════════ Toast ═══════════════ */

.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translate(-50%, -120%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 480px;
  width: calc(100vw - 32px);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  background: var(--neutral-800);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition-normal);
}

.toast.show {
  transform: translate(-50%, 0);
}

.toast-success { background: var(--success); }
.toast-danger { background: var(--danger); }
.toast-warning { background: var(--warning); }

/* ═══════════════ Modal ═══════════════ */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin: 0 auto;
  max-width: 480px;
  background: rgb(0 0 0 / 0.5);
}

.modal {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  background: var(--bg-card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: var(--shadow-xl);
  animation: dos-fade-in var(--transition-normal) ease;
}

@media (min-width: 640px) {
  .modal-overlay {
    align-items: center;
    padding: 16px;
  }

  .modal {
    max-width: 480px;
    border-radius: var(--radius-xl);
  }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-head h2 {
  font-size: 16px;
  font-weight: 700;
}

.modal-body {
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-top: 1px solid var(--border);
}

.modal-foot .btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ═══════════════ Progress bar / ring ═══════════════ */

.progress-track {
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--neutral-100);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--primary);
  transition: width 300ms ease;
}

.ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ring svg {
  transform: rotate(-90deg);
}

.ring-label {
  position: absolute;
  font-weight: 800;
  font-size: 20px;
}

/* ═══════════════ OTP ═══════════════ */

.otp-box {
  display: flex;
  justify-content: center;
  gap: 8px;
  direction: ltr;
}

.otp-box input {
  width: 44px;
  height: 54px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.otp-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--shadow-primary);
}

.otp-box input.filled {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

/* ═══════════════ DrugCard ═══════════════ */

.drug-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-inline-end: 4px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--transition-fast);
}

.drug-card.taken {
  border-inline-end-color: var(--success);
  background: var(--success-bg);
  border-color: var(--success);
}

.drug-card.missed {
  border-inline-end-color: var(--danger);
  background: var(--danger-bg);
  border-color: var(--danger);
}

.drug-card.pending {
  border-inline-end-color: var(--warning);
  background: var(--warning-bg);
  border-color: var(--warning);
}

.drug-card.paused {
  border-inline-end-color: var(--neutral-300);
  background: var(--neutral-100);
  opacity: 0.6;
}

.drug-glyph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  font-size: 16px;
  box-shadow: var(--shadow-xs);
}

.drug-info {
  flex: 1;
  min-width: 0;
}

.drug-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.drug-detail {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-secondary);
  direction: ltr;
  text-align: right;
}

.drug-detail .fa {
  direction: rtl;
}

/* ═══════════════ Empty state ═══════════════ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 16px;
  text-align: center;
}

.empty-state-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: var(--neutral-100);
  color: var(--text-tertiary);
}

.empty-state-icon svg {
  width: 28px;
  height: 28px;
}

.empty-state-title {
  font-weight: 600;
  color: var(--text-primary);
}

.empty-state-desc {
  max-width: 300px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ═══════════════ Skeleton ═══════════════ */

.skeleton {
  border-radius: var(--radius-sm);
  background: linear-gradient(
    90deg,
    var(--neutral-100) 25%,
    var(--neutral-200) 50%,
    var(--neutral-100) 75%
  );
  background-size: 200% 100%;
  animation: dos-shimmer 1.4s infinite;
}

/* ═══════════════ Stock bar ═══════════════ */

.stock-track {
  height: 8px;
  flex: 1;
  border-radius: var(--radius-full);
  background: var(--neutral-100);
  overflow: hidden;
}

.stock-fill {
  height: 100%;
  border-radius: var(--radius-full);
}

.stock-fill.low {
  background: var(--warning);
}

.stock-fill.ok {
  background: var(--success);
}

/* ═══════════════ Calendar ═══════════════ */

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}

.cal-head {
  padding-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
}

.cal-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 44px;
  height: 40px;
  margin-inline: auto;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-primary);
  transition: background var(--transition-fast);
}

.cal-day:hover {
  background: var(--neutral-100);
}

.cal-day.out-month {
  color: var(--text-tertiary);
}

.cal-day.today {
  box-shadow: inset 0 0 0 2px var(--primary);
}

.cal-day.selected {
  background: var(--primary-light);
  font-weight: 700;
  color: var(--primary);
}

.cal-dot {
  width: 6px;
  height: 6px;
  margin-top: 2px;
  border-radius: var(--radius-full);
}

.cal-dot.complete { background: var(--success); }
.cal-dot.partial { background: var(--warning); }
.cal-dot.missed { background: var(--danger); }
.cal-dot.neutral { background: var(--neutral-200); }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-secondary);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

/* ═══════════════ Adherence chart ═══════════════ */

.chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 64px;
}

.chart-col {
  flex: 1;
  min-width: 0;
  border-radius: 2px 2px 0 0;
}

.chart-col.complete { background: var(--success); }
.chart-col.partial { background: var(--warning); }
.chart-col.missed { background: var(--danger); }
.chart-col.none { background: var(--neutral-200); }

/* ═══════════════ Quick actions ═══════════════ */

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.quick-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  text-align: center;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.quick-card.enabled {
  cursor: pointer;
}

.quick-card.enabled:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.quick-card.disabled {
  opacity: 0.45;
}

.quick-card svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
}

.quick-card span {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ═══════════════ AI banner ═══════════════ */

.ai-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  margin-top: 14px;
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
}

.ai-banner svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--primary);
  margin-top: 2px;
}

.ai-banner p {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ═══════════════ Warning banner (low stock) ═══════════════ */

.warn-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px;
  margin-top: 10px;
  background: var(--warning-bg);
  border: 1px solid var(--warning);
  border-radius: var(--radius-md);
}

.warn-banner > svg {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  color: var(--warning);
}

/* ═══════════════ Medication card (list) ═══════════════ */

.med-card {
  padding: 12px;
}

.med-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.med-actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.med-actions .btn {
  flex: 1;
  min-width: 0;
  height: 28px;
  padding-inline: 4px;
  gap: 4px;
  font-size: 11px;
  white-space: nowrap;
  border-radius: var(--radius-full);
}

.med-actions .btn svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

.med-card .drug-name {
  font-size: 11.5px;
}

.med-card .text-xs {
  font-size: 10px;
}

.med-card .med-actions .btn {
  font-size: 10px;
}

.med-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
}

.med-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--warning);
}

.med-card.paused-card {
  opacity: 0.8;
}

/* ─── Wizard ─── */

.wizard-step-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
}

.wizard-step-head .step-title {
  font-weight: 500;
  color: var(--text-primary);
}

.wizard-step-head .step-pct {
  color: var(--text-tertiary);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: border-color var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
}

.chip:hover {
  background: var(--bg-soft);
}

.chip.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.chip .dot {
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  border: 2px solid var(--neutral-300);
}

.chip.selected .dot {
  border-color: var(--primary);
  background: var(--primary);
}

.time-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--neutral-50);
  font-size: 13px;
}

.time-chip svg {
  width: 14px;
  height: 14px;
  color: var(--primary);
}

.time-chip .remove {
  color: var(--text-tertiary);
  display: inline-flex;
}

.time-chip .remove:hover {
  color: var(--danger);
}

.time-chip .remove svg {
  width: 14px;
  height: 14px;
}

/* ═══════════════ Notification center ═══════════════ */

.notif-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  margin: 0 auto;
  max-width: 480px;
  background: rgb(15 23 42 / 0.4);
}

.notif-panel {
  position: fixed;
  top: calc(var(--header-h) + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 81;
  display: flex;
  flex-direction: column;
  width: calc(100vw - 32px);
  max-width: 480px;
  max-height: 75vh;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  animation: dos-fade-in var(--transition-normal) ease;
}

.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.notif-head h2 {
  font-size: 15px;
  font-weight: 700;
}

.notif-filter {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.notif-filter button {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.notif-filter button:hover {
  background: var(--neutral-100);
}

.notif-filter button.active {
  background: var(--primary-light);
  color: var(--primary);
}

.notif-list {
  overflow-y: auto;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition-fast);
}

.notif-item:hover {
  background: var(--neutral-50);
}

.notif-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: var(--radius-full);
}

.notif-icon svg {
  width: 18px;
  height: 18px;
}

.notif-icon.danger { background: var(--danger-bg); color: var(--danger); }
.notif-icon.warning { background: var(--warning-bg); color: var(--warning); }
.notif-icon.success { background: var(--success-bg); color: var(--success); }

.notif-title {
  font-size: 13px;
  color: var(--text-primary);
}

.notif-title.unread {
  font-weight: 600;
}

.notif-title.read {
  color: var(--text-tertiary);
}

.notif-time {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.notif-cat {
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--neutral-100);
  font-size: 10px;
}

.notif-empty {
  padding: 40px 16px;
  text-align: center;
}

/* ═══════════════ Login page ═══════════════ */

.auth-wrap {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: linear-gradient(to bottom, var(--bg-page), var(--primary-light));
}

.auth-center {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

.auth-logo {
  margin-bottom: 24px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.auth-title {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}

.auth-subtitle {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--text-secondary);
  text-align: center;
}

.auth-features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

.feature-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}

.auth-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
}

.auth-footer a {
  font-weight: 600;
  color: var(--primary);
}

.auth-footer a:hover {
  color: var(--primary-dark);
}

.auth-note {
  margin-top: 16px;
  padding: 12px 16px;
  border: 1px solid var(--accent-light);
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--accent-dark);
}

.test-code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 16px;
}

.resend-row {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
}

.resend-row button {
  font-weight: 600;
  color: var(--accent);
}

.resend-row button:hover {
  color: var(--accent-dark);
}

@media (max-width: 640px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .grid-3 .card-pad-sm {
    padding: 8px;
  }

  .grid-3 .row-between {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .grid-3 .ring svg {
    width: 44px;
    height: 44px;
  }

  .grid-3 .ring-label {
    font-size: 13px;
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .quick-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 480px) {
  #app {
    box-shadow: none;
    min-height: 100dvh;
  }
}

/* ═══════════════ دستیار AI ═══════════════ */

.ai-suggest-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-primary);
  line-height: 1.55;
}

.ai-suggest-ic {
  display: inline-flex;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  margin-top: 1px;
}

.ai-suggest-ic svg {
  width: 13px;
  height: 13px;
}

.ai-chat-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ai-chat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.ai-chat-head svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
}

.ai-chat-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  max-height: 300px;
  min-height: 90px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.ai-msg {
  max-width: 88%;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  line-height: 1.6;
  word-break: break-word;
}

.ai-msg.bot {
  align-self: flex-start;
  background: var(--bg-soft);
  border-start-start-radius: 4px;
  color: var(--text-primary);
}

.ai-msg.user {
  align-self: flex-end;
  background: var(--primary);
  border-end-end-radius: 4px;
  color: #fff;
}

.ai-chips {
  padding: 8px 14px;
  border-top: 1px solid var(--border);
}

.ai-chips .chip {
  font-size: 11.5px;
  padding: 6px 10px;
}

.ai-input-row {
  padding: 10px 14px 14px;
  border-top: 1px solid var(--border);
}

.ai-input-row .btn {
  flex-shrink: 0;
}

/* ═══════════════ شبکه خانوادگی ═══════════════ */

.net-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 16px;
  margin-bottom: 14px;
  background: linear-gradient(135deg, var(--primary), var(--network));
  color: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-primary);
}

.net-hero-ic {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background: rgb(255 255 255 / 0.18);
}

.net-hero-ic svg {
  width: 22px;
  height: 22px;
}

.net-hero h2 {
  font-size: 16px;
  font-weight: 800;
}

.net-hero p {
  margin-top: 2px;
  font-size: 12px;
  color: rgb(255 255 255 / 0.85);
}

.net-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: var(--network-light);
  border: 1px solid var(--network);
  border-radius: var(--radius-md);
  color: var(--network);
}

.net-alert > svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.net-member {
  position: relative;
}

.member-avatar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  font-size: 15px;
}

.online-dot {
  position: absolute;
  bottom: 0;
  inset-inline-end: 0;
  width: 11px;
  height: 11px;
  border-radius: var(--radius-full);
  background: var(--success);
  border: 2px solid var(--bg-card);
}

.online-dot.offline {
  background: var(--neutral-300);
}

.net-meds {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.net-med {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 500;
}

.net-med.taken {
  background: var(--success-bg);
  color: var(--success);
}

.net-med.missed {
  background: var(--danger-bg);
  color: var(--danger);
}

.net-med.pending {
  background: var(--warning-bg);
  color: var(--warning);
}

.net-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.net-head-actions .badge {
  white-space: nowrap;
}

.net-head-actions .btn {
  height: 28px;
  padding-inline: 8px;
  font-size: 11px;
  gap: 4px;
  white-space: nowrap;
  border-radius: var(--radius-full);
}

.net-head-actions .btn svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

.net-member .drug-name {
  font-size: 11.5px;
}

.net-member .drug-name span {
  margin-inline-start: 4px;
}

.net-member .text-xs {
  font-size: 10px;
}

.net-member .net-head-actions .btn {
  font-size: 10px;
}

.net-event {
  display: flex;
  align-items: center;
  gap: 10px;
}

.net-event-ic {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: var(--radius-full);
}

.net-event-ic svg {
  width: 14px;
  height: 14px;
}

.net-event-ic.taken { background: var(--success-bg); color: var(--success); }
.net-event-ic.missed { background: var(--danger-bg); color: var(--danger); }
.net-event-ic.reminder_sent { background: var(--warning-bg); color: var(--warning); }

/* ═══════════════ Switch toggle ═══════════════ */

.switch {
  position: relative;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  background: var(--neutral-300);
  transition: background var(--transition-fast);
}

.switch .switch-thumb {
  position: absolute;
  top: 3px;
  inset-inline-start: 3px;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: inset-inline-start var(--transition-fast);
}

.switch.active {
  background: var(--primary);
}

.switch.active .switch-thumb {
  inset-inline-start: calc(100% - 23px);
}

/* ═══════════════ صفحه یادآور دارو ═══════════════ */

.rem-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rem-row .rem-time-input {
  flex: 1;
  min-width: 0;
  max-width: 130px;
}

.reminders-card.flash {
  animation: dos-flash 600ms ease;
}

@keyframes dos-flash {
  0%, 100% { box-shadow: var(--shadow-sm); border-color: var(--border); }
  50% { box-shadow: 0 0 0 4px var(--success-bg); border-color: var(--success); }
}

/* ═══════════════ مودال اطلاعات دارو ═══════════════ */

.drug-info-sec {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.drug-info-ic {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: var(--radius-full);
}

.drug-info-ic svg {
  width: 15px;
  height: 15px;
}

.drug-info-ic.success { background: var(--success-bg); color: var(--success); }
.drug-info-ic.warning { background: var(--warning-bg); color: var(--warning); }
.drug-info-ic.danger { background: var(--danger-bg); color: var(--danger); }
.drug-info-ic.teal { background: var(--teal-light); color: var(--teal); }

.drug-info-title {
  margin-bottom: 2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.drug-info-chip {
  font-size: 11.5px;
  padding: 5px 10px;
  border-color: var(--border);
  background: var(--bg-soft);
  color: var(--text-secondary);
}

/* ═══════════════ مشاوره ═══════════════ */

textarea.input {
  height: auto;
  min-height: 84px;
  padding-block: 9px;
  resize: vertical;
  line-height: 1.7;
}

.consult-faq {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.consult-faq:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

/* ═══════════════ پرونده سلامت ═══════════════ */

.badge svg {
  vertical-align: -2px;
  margin-inline-end: 2px;
}