/* MedSense AI - shadcn/ui Component System & Primitives */

/* ==========================================================================
   1. BUTTONS & ACTIONS (shadcn Button Primitives)
   ========================================================================== */
.btn,
.btn-primary,
.btn-secondary,
.btn-outline,
.btn-ghost,
.btn-destructive,
.btn-scan {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-fa);
  font-size: 13px;
  font-weight: 500;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  outline: none;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.btn:active,
.btn-primary:active,
.btn-secondary:active {
  transform: scale(0.98);
}

.btn-primary {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-primary:hover {
  background-color: hsl(var(--primary) / 0.9);
}

.btn-secondary {
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  border-color: hsl(var(--border));
}

.btn-secondary:hover {
  background-color: hsl(var(--secondary) / 0.8);
  border-color: hsl(var(--ring) / 0.2);
}

.btn-outline {
  background-color: transparent;
  border-color: hsl(var(--border));
  color: hsl(var(--foreground));
}

.btn-outline:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.btn-ghost {
  background-color: transparent;
  color: hsl(var(--foreground));
}

.btn-ghost:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.btn-scan {
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
  background-color: hsl(var(--secondary));
  border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
  border-radius: calc(var(--radius) - 2px);
}

.btn-scan:hover {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background: transparent;
  color: hsl(var(--foreground));
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 14px;
}

.icon-btn:hover {
  background-color: hsl(var(--accent));
  border-color: hsl(var(--ring) / 0.3);
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-back:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--foreground));
}

/* ==========================================================================
   2. BADGES & PILLS (shadcn Badge Primitives)
   ========================================================================== */
.badge,
.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}

.section-badge {
  color: hsl(var(--muted-foreground));
  background-color: hsl(var(--secondary) / 0.6);
}

.badge-outline {
  background-color: transparent;
  border-color: hsl(var(--border));
  color: hsl(var(--foreground));
}

.badge-safe {
  background-color: hsl(var(--clinical-safe-bg));
  color: hsl(var(--clinical-safe));
  border-color: hsl(var(--clinical-safe-border));
}

.badge-caution {
  background-color: hsl(var(--clinical-caution-bg));
  color: hsl(var(--clinical-caution));
  border-color: hsl(var(--clinical-caution-border));
}

.badge-danger {
  background-color: hsl(var(--clinical-danger-bg));
  color: hsl(var(--clinical-danger));
  border-color: hsl(var(--clinical-danger-border));
}

/* Section Header Typography */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: hsl(var(--foreground));
  letter-spacing: -0.01em;
}

/* ==========================================================================
   3. SEARCH BAR & CATEGORY TABS (shadcn Command & Tabs Style)
   ========================================================================== */
.search-container {
  margin-bottom: 16px;
}

.search-bar-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius);
  padding: 0 12px;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  transition: all 0.15s ease;
}

.search-bar-wrapper:focus-within {
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.15);
}

.search-icon {
  color: hsl(var(--muted-foreground));
  font-size: 14px;
  margin-left: 6px;
}

.search-input {
  flex: 1;
  height: 44px;
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--font-fa);
  font-size: 13px;
  color: hsl(var(--foreground));
  padding: 0 6px;
}

.search-input::placeholder {
  color: hsl(var(--muted-foreground));
  font-size: 12.5px;
}

.search-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Category Horizontal Chips (shadcn Tabs List) */
.category-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 16px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.category-scroll::-webkit-scrollbar {
  display: none;
}

.category-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: calc(var(--radius) - 2px);
  background-color: hsl(var(--secondary) / 0.7);
  color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border) / 0.6);
  font-family: var(--font-fa);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.category-chip:hover {
  background-color: hsl(var(--secondary));
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
}

.category-chip.active {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   4. DRUG CARDS (shadcn Card Primitive)
   ========================================================================== */
.drug-card {
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  position: relative;
}

.drug-card:hover {
  border-color: hsl(var(--ring) / 0.35);
  background-color: hsl(var(--accent) / 0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.08);
}

.drug-card:active {
  transform: scale(0.99);
}

.drug-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.drug-card-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.drug-pill-icon {
  width: 38px;
  height: 38px;
  border-radius: calc(var(--radius) - 2px);
  background-color: hsl(var(--secondary));
  border: 1px solid hsl(var(--border));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.drug-names h3 {
  font-size: 14.5px;
  font-weight: 700;
  color: hsl(var(--foreground));
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.generic-sub {
  font-family: var(--font-en);
  font-size: 11.5px;
  color: hsl(var(--muted-foreground));
  font-weight: 500;
  display: block;
  margin-top: 2px;
}

/* FarsiUI Clinical Decision Badges */
.farsi-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.farsi-badge .badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.farsi-badge.farsi-badge-safe {
  background-color: hsl(var(--clinical-safe-bg));
  color: hsl(var(--clinical-safe));
  border-color: hsl(var(--clinical-safe-border));
}
.farsi-badge.farsi-badge-safe .badge-dot {
  background-color: hsl(var(--clinical-safe));
  box-shadow: 0 0 6px hsl(var(--clinical-safe) / 0.5);
}

.farsi-badge.farsi-badge-caution {
  background-color: hsl(var(--clinical-caution-bg));
  color: hsl(var(--clinical-caution));
  border-color: hsl(var(--clinical-caution-border));
}
.farsi-badge.farsi-badge-caution .badge-dot {
  background-color: hsl(var(--clinical-caution));
  box-shadow: 0 0 6px hsl(var(--clinical-caution) / 0.5);
}

.farsi-badge.farsi-badge-danger {
  background-color: hsl(var(--clinical-danger-bg));
  color: hsl(var(--clinical-danger));
  border-color: hsl(var(--clinical-danger-border));
}
.farsi-badge.farsi-badge-danger .badge-dot {
  background-color: hsl(var(--clinical-danger));
  box-shadow: 0 0 6px hsl(var(--clinical-danger) / 0.5);
}

/* Legacy safety dot fallback */
.safety-indicator-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}

.safety-indicator-dot.safe {
  background-color: hsl(var(--clinical-safe));
  box-shadow: 0 0 8px hsl(var(--clinical-safe) / 0.6);
}

.safety-indicator-dot.caution {
  background-color: hsl(var(--clinical-caution));
  box-shadow: 0 0 8px hsl(var(--clinical-caution) / 0.6);
}

.safety-indicator-dot.danger {
  background-color: hsl(var(--clinical-danger));
  box-shadow: 0 0 8px hsl(var(--clinical-danger) / 0.6);
}

/* FarsiUI Quick Clinical Filter Bar */
.safety-filters-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.safety-filters-bar::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 500;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--secondary) / 0.5);
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.filter-pill:hover {
  background: hsl(var(--secondary));
  color: hsl(var(--foreground));
  border-color: hsl(var(--ring) / 0.2);
}

.filter-pill.active {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
  font-weight: 600;
}

.filter-pill.safe.active {
  background: hsl(var(--clinical-safe-bg));
  color: hsl(var(--clinical-safe));
  border-color: hsl(var(--clinical-safe));
}

.filter-pill.caution.active {
  background: hsl(var(--clinical-caution-bg));
  color: hsl(var(--clinical-caution));
  border-color: hsl(var(--clinical-caution));
}

.filter-pill.danger.active {
  background: hsl(var(--clinical-danger-bg));
  color: hsl(var(--clinical-danger));
  border-color: hsl(var(--clinical-danger));
}

/* Quick Cabinet Button */
.btn-quick-cabinet {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: calc(var(--radius) - 2px);
  font-size: 11px;
  font-weight: 600;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--secondary));
  color: hsl(var(--foreground));
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-quick-cabinet:hover {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}

.btn-quick-cabinet.in-cabinet {
  background: hsl(var(--clinical-safe-bg));
  color: hsl(var(--clinical-safe));
  border-color: hsl(var(--clinical-safe-border));
}

/* Keyboard Shortcut Badge */
.search-kbd-shortcut {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-family: var(--font-en);
  font-size: 10px;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  background: hsl(var(--secondary));
  border: 1px solid hsl(var(--border));
  border-radius: 4px;
  padding: 2px 6px;
  user-select: none;
  pointer-events: none;
}

.drug-card-desc {
  font-size: 12.5px;
  color: hsl(var(--muted-foreground));
  line-height: 1.55;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.drug-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid hsl(var(--border) / 0.7);
  font-size: 11px;
}

.drug-brands-tag {
  color: hsl(var(--muted-foreground));
  max-width: 70%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-card-action {
  color: hsl(var(--foreground));
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  transition: transform 0.15s ease;
}

.drug-card:hover .btn-card-action {
  transform: translateX(-3px);
}

/* ==========================================================================
   5. PERSONALIZED CLINICAL DETAIL VIEW
   ========================================================================== */
.detail-top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid hsl(var(--border));
}

/* shadcn/ui Alert Banner for Clinical Safety */
.safety-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  margin-bottom: 16px;
}

.safety-banner.safe {
  background-color: hsl(var(--clinical-safe-bg));
  border-color: hsl(var(--clinical-safe-border));
  color: hsl(var(--clinical-safe));
}

.safety-banner.caution {
  background-color: hsl(var(--clinical-caution-bg));
  border-color: hsl(var(--clinical-caution-border));
  color: hsl(var(--clinical-caution));
}

.safety-banner.danger {
  background-color: hsl(var(--clinical-danger-bg));
  border-color: hsl(var(--clinical-danger-border));
  color: hsl(var(--clinical-danger));
}

.safety-banner-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.safety-banner-content h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.safety-banner-content p {
  font-size: 12.5px;
  line-height: 1.5;
  color: hsl(var(--foreground));
}

/* Personalized Dosage Card */
.personalized-box {
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 18px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

.personalized-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.personalized-box-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: hsl(var(--foreground));
}

.user-stat-badge {
  font-size: 11px;
  font-weight: 600;
  background-color: hsl(var(--secondary));
  color: hsl(var(--muted-foreground));
  padding: 2px 8px;
  border-radius: 9999px;
  border: 1px solid hsl(var(--border));
}

.dosage-highlight {
  font-size: 16px;
  font-weight: 800;
  color: hsl(var(--foreground));
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.dosage-note {
  font-size: 12.5px;
  color: hsl(var(--muted-foreground));
  line-height: 1.5;
}

/* Administration Instruction Steps */
.instruction-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.instruction-step-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
}

.step-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  background-color: hsl(var(--secondary));
  border: 1px solid hsl(var(--border));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.step-details h5 {
  font-size: 13px;
  font-weight: 700;
  color: hsl(var(--foreground));
  margin-bottom: 2px;
}

.step-details p {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  line-height: 1.5;
}

/* Warnings and Clinical Alert Cards */
.alert-card {
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
}

.alert-card.danger {
  border-color: hsl(var(--clinical-danger-border));
  background-color: hsl(var(--clinical-danger-bg));
}

.alert-card.danger h5 {
  color: hsl(var(--clinical-danger));
}

.alert-card.caution {
  border-color: hsl(var(--clinical-caution-border));
  background-color: hsl(var(--clinical-caution-bg));
}

.alert-card.caution h5 {
  color: hsl(var(--clinical-caution));
}

.alert-card h5 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.alert-card p {
  font-size: 12px;
  line-height: 1.5;
  color: hsl(var(--foreground));
}

.alert-recommendation {
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: calc(var(--radius) - 4px);
  background: hsl(var(--background) / 0.6);
  font-size: 11.5px;
  font-weight: 500;
  color: hsl(var(--foreground));
}

/* Action Buttons Row */
.detail-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 18px 0;
}

/* AI Clinical Assistant Widget (shadcn Chat Interface) */
.ai-consult-card {
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 20px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

.ai-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: hsl(var(--foreground));
  margin-bottom: 6px;
}

.ai-quick-questions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.ai-chip {
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 500;
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  border: 1px solid hsl(var(--border));
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-fa);
}

.ai-chip:hover {
  background-color: hsl(var(--accent));
  border-color: hsl(var(--ring) / 0.3);
}

.ai-input-group {
  display: flex;
  gap: 8px;
}

.ai-input {
  flex: 1;
  height: 38px;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--input));
  background-color: hsl(var(--background));
  padding: 0 12px;
  font-family: var(--font-fa);
  font-size: 12.5px;
  color: hsl(var(--foreground));
  outline: none;
}

.ai-input:focus {
  border-color: hsl(var(--ring));
}

.btn-ai-send {
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius);
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border: none;
  font-family: var(--font-fa);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.btn-ai-send:hover {
  opacity: 0.9;
}

.ai-response-box {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background-color: hsl(var(--secondary) / 0.5);
  border: 1px solid hsl(var(--border));
  font-size: 12.5px;
  line-height: 1.6;
  color: hsl(var(--foreground));
  white-space: pre-wrap;
}

/* ==========================================================================
   6. CABINET VIEW & CROSS-CHECK ENGINE
   ========================================================================== */
.cabinet-crosscheck-banner {
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--destructive) / 0.4);
  background-color: hsl(var(--clinical-danger-bg));
  margin-bottom: 16px;
}

.cabinet-crosscheck-banner.all-safe {
  border-color: hsl(var(--clinical-safe-border));
  background-color: hsl(var(--clinical-safe-bg));
}

.cabinet-item-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  margin-bottom: 8px;
  transition: all 0.15s ease;
}

.cabinet-item-card:hover {
  border-color: hsl(var(--ring) / 0.3);
}

.cabinet-item-info h4 {
  font-size: 14px;
  font-weight: 700;
  color: hsl(var(--foreground));
  margin-bottom: 2px;
}

.cabinet-item-meta {
  font-size: 11.5px;
  color: hsl(var(--muted-foreground));
}

.btn-remove-med {
  width: 28px;
  height: 28px;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background: transparent;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.15s ease;
}

.btn-remove-med:hover {
  background-color: hsl(var(--destructive) / 0.1);
  color: hsl(var(--destructive));
  border-color: hsl(var(--destructive) / 0.3);
}

/* ==========================================================================
   7. REMINDERS & ADHERENCE VIEW
   ========================================================================== */
.adherence-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  margin-bottom: 18px;
}

.adherence-text h4 {
  font-size: 14.5px;
  font-weight: 700;
  color: hsl(var(--foreground));
  margin-bottom: 4px;
}

.adherence-text p {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
}

.adherence-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-en);
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.reminder-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  margin-bottom: 8px;
  transition: all 0.15s ease;
}

.reminder-item.taken {
  opacity: 0.65;
  background-color: hsl(var(--secondary) / 0.4);
}

.reminder-time {
  font-family: var(--font-en);
  font-size: 15px;
  font-weight: 700;
  color: hsl(var(--foreground));
  padding: 4px 10px;
  background-color: hsl(var(--secondary));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
}

.reminder-pill-info h5 {
  font-size: 13.5px;
  font-weight: 700;
  color: hsl(var(--foreground));
  margin-bottom: 2px;
}

.reminder-pill-info span {
  font-size: 11.5px;
  color: hsl(var(--muted-foreground));
}

.btn-check-taken {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid hsl(var(--input));
  background: transparent;
  color: hsl(var(--foreground));
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.reminder-item.taken .btn-check-taken {
  background-color: hsl(var(--clinical-safe));
  border-color: hsl(var(--clinical-safe));
  color: #ffffff;
}

/* ==========================================================================
   8. HEALTH PROFILE (Smart Health Passport)
   ========================================================================== */
.profile-card-hero {
  text-align: center;
  padding: 20px 14px;
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.profile-avatar-large {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  font-size: 24px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px auto;
  border: 2px solid hsl(var(--border));
}

.profile-hero-name {
  font-size: 16px;
  font-weight: 800;
  color: hsl(var(--foreground));
  margin-bottom: 4px;
}

.profile-hero-subtitle {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
}

.form-group {
  margin-bottom: 14px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  height: 40px;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--input));
  background-color: hsl(var(--card));
  padding: 0 12px;
  font-family: var(--font-fa);
  font-size: 13px;
  color: hsl(var(--foreground));
  transition: all 0.15s ease;
  outline: none;
}

.form-input:focus {
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.15);
}

.segmented-control {
  display: flex;
  background-color: hsl(var(--secondary));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 3px;
  height: 40px;
}

.segmented-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: hsl(var(--muted-foreground));
  font-family: var(--font-fa);
  font-size: 12.5px;
  font-weight: 500;
  border-radius: calc(var(--radius) - 3px);
  cursor: pointer;
  transition: all 0.15s ease;
}

.segmented-btn.active {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.selectable-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

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

.selectable-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 500;
  color: hsl(var(--foreground));
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.selectable-item:hover {
  background-color: hsl(var(--accent));
  border-color: hsl(var(--ring) / 0.3);
}

.selectable-item.selected {
  background-color: hsl(var(--secondary));
  border-color: hsl(var(--primary));
  font-weight: 600;
}

.selectable-checkbox {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid hsl(var(--input));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  flex-shrink: 0;
}

.selectable-item.selected .selectable-checkbox {
  background-color: hsl(var(--primary));
  border-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

/* ==========================================================================
   9. AUTHENTICATION / LOGIN VIEW (shadcn Auth Form)
   ========================================================================== */
.login-wrapper {
  max-width: 380px;
  margin: 60px auto;
  padding: 0 16px;
}

.login-brand-hero {
  text-align: center;
  margin-bottom: 24px;
}

.login-logo-container {
  width: 56px;
  height: 56px;
  border-radius: calc(var(--radius) * 1.4);
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border: 1px solid hsl(var(--border));
  margin: 0 auto 14px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.login-logo-container svg {
  width: 34px;
  height: 34px;
}

.login-title {
  font-size: 20px;
  font-weight: 800;
  color: hsl(var(--foreground));
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 12.5px;
  color: hsl(var(--muted-foreground));
  line-height: 1.5;
}

.login-card {
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 22px 20px;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.08);
}

.test-user-card {
  background-color: hsl(var(--secondary) / 0.5);
  border: 1px dashed hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  padding: 10px 12px;
  margin-bottom: 16px;
  font-size: 11.5px;
}

.test-user-card-header {
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 4px;
}

.test-credentials-row {
  display: flex;
  align-items: center;
  gap: 6px;
  color: hsl(var(--muted-foreground));
  margin-bottom: 6px;
}

.test-code-badge {
  font-family: var(--font-en);
  font-size: 11px;
  background-color: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  padding: 1px 6px;
  border-radius: 4px;
  color: hsl(var(--foreground));
}

.btn-autofill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-fa);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border: none;
  cursor: pointer;
}

/* ==========================================================================
   10. MODALS & TOAST NOTIFICATIONS (shadcn Dialog & Toast)
   ========================================================================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.15s ease-out;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 420px;
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) * 1.3);
  padding: 20px;
  box-shadow: 
    0 0 0 1px hsl(var(--border)),
    0 20px 40px -8px rgba(0, 0, 0, 0.4);
  animation: slideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 120;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 9999px;
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

/* ==========================================================================
   11. PILL INVENTORY & REFILL ALERT SYSTEM
   ========================================================================== */
.pill-inventory-box {
  margin-top: 10px;
  padding: 10px 12px;
  background-color: hsl(var(--secondary) / 0.5);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
}

.pill-inventory-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 12px;
}

.pill-count-badge {
  font-weight: 700;
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: var(--radius);
  background-color: hsl(var(--secondary));
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
}

.pill-count-badge.low {
  background-color: hsl(var(--destructive) / 0.15);
  border-color: hsl(var(--destructive) / 0.4);
  color: hsl(var(--destructive));
  animation: pulseLow 1.5s infinite;
}

.pill-inventory-track {
  width: 100%;
  height: 6px;
  background-color: hsl(var(--border));
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 6px;
}

.pill-inventory-fill {
  height: 100%;
  background: linear-gradient(90deg, hsl(var(--primary)), hsl(var(--accent)));
  border-radius: 9999px;
  transition: width 0.3s ease;
}

.pill-inventory-fill.low {
  background: hsl(var(--destructive));
}

.pill-inventory-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.btn-inventory-action {
  font-size: 11px;
  font-weight: 600;
  height: 28px;
  padding: 0 10px;
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  color: hsl(var(--foreground));
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-inventory-action:hover {
  background-color: hsl(var(--secondary));
  border-color: hsl(var(--ring) / 0.3);
}

.refill-alert-banner {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  margin-top: 6px;
  border-radius: calc(var(--radius) - 2px);
  background-color: hsl(var(--destructive) / 0.1);
  border: 1px solid hsl(var(--destructive) / 0.3);
  color: hsl(var(--destructive));
  font-size: 11.5px;
  font-weight: 700;
}

/* ==========================================================================
   12. FAMILY MEMBERS CHIPS & PROFILES SWITCHER
   ========================================================================== */
.family-member-chip {
  padding: 6px 12px;
  border-radius: calc(var(--radius) - 2px);
  background-color: hsl(var(--secondary));
  border: 1px solid hsl(var(--border));
  color: hsl(var(--muted-foreground));
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.family-member-chip:hover {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.family-member-chip.active {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Voice search pulsing state */
.btn-voice-active {
  background-color: hsl(var(--destructive)) !important;
  color: #fff !important;
  animation: pulseVoice 1s infinite alternate;
}

@keyframes pulseVoice {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  100% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

@keyframes pulseLow {
  0% { opacity: 1; }
  50% { opacity: 0.6; }
  100% { opacity: 1; }
}

/* ==========================================================================
   13. MEDICAL PASSPORT PRINT STYLES
   ========================================================================== */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
    padding: 0 !important;
  }

  .app-header,
  .bottom-nav,
  .view-panel,
  .btn-close-modal,
  #btn-print-passport-action,
  .toast-container {
    display: none !important;
  }

  .modal-overlay {
    position: static !important;
    background: transparent !important;
    backdrop-filter: none !important;
    padding: 0 !important;
    display: block !important;
  }

  .printable-passport-card {
    max-width: 100% !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    color: #000 !important;
    background: #fff !important;
  }

  .printable-passport-card * {
    color: #000 !important;
  }
}

/* Floating AI Assistant Action Button */
.floating-ai-btn {
  position: fixed;
  bottom: 84px;
  left: 24px;
  z-index: 45;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 9999px;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border: 1px solid hsl(var(--ring) / 0.3);
  font-family: var(--font-fa);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(8px);
}

.floating-ai-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.45);
}

.floating-ai-btn:active {
  transform: scale(0.97);
}

.ai-sparkle {
  font-size: 16px;
  animation: pulse 2s infinite ease-in-out;
}

@media (max-width: 640px) {
  .floating-ai-btn {
    bottom: 74px;
    left: 16px;
    padding: 8px 14px;
    font-size: 12px;
  }
}


