/* ==========================================================================
   q24.vet — Modern Apple-Inspired Medical Design System
   Aesthetics: Clean, Refined, Content-First, High Readability
   Typography: Plus Jakarta Sans (Headings), Inter (Body), JetBrains Mono (Codes)
   Surfaces: Apple Light Canvas (#f5f5f7) & Apple OLED Black (#000000)
   Geometry: 16px Rounded Cards, 12px Inputs/Buttons, Full-Pill Badges
   Glassmorphism: Frosted Blur Headers & Micro-shadows
   ========================================================================== */

/* ── Google Fonts Import ─────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;600;700&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

/* ── Apple Design System Tokens ───────────────────────────────────────────── */
:root {
  /* Typography */
  --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  --font-title:   'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  --font-mono:    'JetBrains Mono', 'SF Mono', Menlo, Monaco, monospace;

  /* Surfaces & Canvas (Apple Light Mode) */
  --bg:                       #f5f5f7;
  --bg-card:                  #ffffff;
  --bg-header:                rgba(255, 255, 255, 0.82);
  --bg-glass:                 rgba(255, 255, 255, 0.82);
  --surface:                  #f5f5f7;
  --surface-container-lowest: #ffffff;
  --surface-container-low:    #f5f5f7;
  --surface-container:        #ebebed;
  --surface-container-high:   #e1e1e4;
  --surface-container-highest:#d6d6da;

  /* Borders & Dividers (Subtle Apple Hairlines) */
  --border:                   rgba(0, 0, 0, 0.08);
  --border-med:               rgba(0, 0, 0, 0.12);
  --border-light:             rgba(0, 0, 0, 0.04);
  --border-focus:             #008782;

  /* Text Colors (High Contrast, Refined) */
  --tx-main:                  #1d1d1f;
  --tx-sub:                   #515154;
  --tx-muted:                 #86868b;
  --tx-light:                 #a1a1a6;

  /* Apple Pro Color Palette */
  --primary:                  #008782; /* Apple Signature Clinical Teal */
  --primary-hover:            #009b95;
  --primary-light:            rgba(0, 135, 130, 0.08);
  --primary-container:        rgba(0, 135, 130, 0.1);
  --gradient-primary:         linear-gradient(135deg, #008782 0%, #33b7bc 100%);
  --gradient-card:            linear-gradient(135deg, #008782 0%, #006e6a 100%);

  --secondary:                #5856d6; /* Apple Indigo */
  --secondary-light:          rgba(88, 86, 214, 0.08);
  --secondary-container:      rgba(88, 86, 214, 0.1);

  --c-success:                #34c759; /* Apple Green */
  --c-success-light:          rgba(52, 199, 89, 0.1);
  --c-warning:                #ff9500; /* Apple Amber */
  --c-warning-light:          rgba(255, 149, 0, 0.1);
  --c-danger:                 #ff3b30; /* Apple Red */
  --c-danger-light:           rgba(255, 59, 48, 0.1);
  --c-teal:                   #0284c7; /* Clinical Sky/Cyan */
  --c-teal-light:             rgba(2, 132, 199, 0.08);
  --c-purple:                 #af52de; /* Apple Purple */
  --c-purple-light:           rgba(175, 82, 222, 0.08);

  /* Semantic Aliases */
  --c-primary:                #008782;
  --c-primary-dark:           #006e6a;
  --c-primary-light:          rgba(0, 135, 130, 0.08);
  --c-primary-xdark:          #00524f;
  --c-primary-xlight:         rgba(0, 135, 130, 0.04);
  --c-accent:                 #ff9500;

  /* Radii (Apple Fluid Geometry) */
  --r-xs:                     6px;
  --r-sm:                     8px;
  --r-md:                     12px;
  --r-lg:                     16px;
  --r-xl:                     20px;
  --r-2xl:                    24px;
  --r-full:                   9999px;

  /* Border Widths */
  --bw:                       1px;
  --bw-thick:                 1.5px;

  /* Soft Multi-Layered Ambient Shadows */
  --sh-xs:                    0 1px 2px rgba(0, 0, 0, 0.04);
  --sh-sm:                    0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --sh-md:                    0 4px 16px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.03);
  --sh-lg:                    0 8px 24px -4px rgba(0, 0, 0, 0.08), 0 2px 6px -1px rgba(0, 0, 0, 0.03);
  --sh-xl:                    0 16px 36px -6px rgba(0, 0, 0, 0.12), 0 4px 12px -2px rgba(0, 0, 0, 0.04);

  /* Smooth Transitions (Apple Spring Easing) */
  --t-fast:                   all 0.15s cubic-bezier(0.25, 1, 0.5, 1);
  --t-normal:                 all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

/* ── Apple Dark Mode ─────────────────────────────────────────────────────── */
[data-theme="dark"] {
  /* Surfaces & Canvas (True OLED Black) */
  --bg:                       #000000;
  --bg-card:                  #1c1c1e;
  --bg-header:                rgba(28, 28, 30, 0.82);
  --bg-glass:                 rgba(28, 28, 30, 0.82);
  --surface:                  #000000;
  --surface-container-lowest: #141416;
  --surface-container-low:    #1c1c1e;
  --surface-container:        #2c2c2e;
  --surface-container-high:   #3a3a3c;
  --surface-container-highest:#48484a;

  /* Borders & Dividers */
  --border:                   rgba(255, 255, 255, 0.1);
  --border-med:               rgba(255, 255, 255, 0.16);
  --border-light:             rgba(255, 255, 255, 0.06);
  --border-focus:             #33b7bc;

  /* Text Colors */
  --tx-main:                  #f5f5f7;
  --tx-sub:                   #a1a1a6;
  --tx-muted:                 #86868b;
  --tx-light:                 #636366;

  /* Apple Pro Color Palette (Dark Mode Luminance) */
  --primary:                  #33b7bc;
  --primary-hover:            #4ed0d5;
  --primary-light:            rgba(51, 183, 188, 0.15);
  --primary-container:        rgba(51, 183, 188, 0.18);
  --gradient-primary:         linear-gradient(135deg, #008782 0%, #33b7bc 100%);
  --gradient-card:            linear-gradient(135deg, #008782 0%, #006e6a 100%);

  --secondary:                #7d7aff;
  --secondary-light:          rgba(125, 122, 255, 0.15);
  --secondary-container:      rgba(125, 122, 255, 0.18);

  --c-success:                #30d158;
  --c-success-light:          rgba(48, 209, 88, 0.15);
  --c-warning:                #ff9f0a;
  --c-warning-light:          rgba(255, 159, 10, 0.15);
  --c-danger:                 #ff453a;
  --c-danger-light:           rgba(255, 69, 58, 0.15);
  --c-teal:                   #38bdf8;
  --c-teal-light:             rgba(56, 189, 248, 0.15);
  --c-purple:                 #bf5af2;
  --c-purple-light:           rgba(191, 90, 242, 0.15);

  --c-primary:                #33b7bc;
  --c-primary-dark:           #008782;
  --c-primary-light:          rgba(51, 183, 188, 0.15);

  /* Dark Mode Shadows */
  --sh-xs:                    0 1px 3px rgba(0, 0, 0, 0.3);
  --sh-sm:                    0 2px 8px rgba(0, 0, 0, 0.4);
  --sh-md:                    0 4px 16px rgba(0, 0, 0, 0.5);
  --sh-lg:                    0 8px 24px rgba(0, 0, 0, 0.6);
  --sh-xl:                    0 16px 40px rgba(0, 0, 0, 0.7);
}

/* ── Reset & Core ────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--tx-main);
  line-height: 1.55;
  letter-spacing: -0.01em;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--t-fast), color var(--t-fast);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--tx-main);
  line-height: 1.25;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--t-fast);
}

a:hover {
  color: var(--primary-hover);
}

p {
  color: var(--tx-sub);
}

/* ── Header (Frosted Glass Navigation) ───────────────────────────────────── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-header);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: var(--bw) solid var(--border);
  transition: var(--t-fast);
}

.header-inner {
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}




/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--tx-main);
  flex-shrink: 0;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: var(--t-fast);
  background: transparent;
  flex-shrink: 0;
}

.brand:hover .brand-icon {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.brand-icon svg,
.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-text {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--tx-main);
  letter-spacing: -0.035em;
  display: flex;
  align-items: baseline;
}

.brand-text .domain-tag {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
}

/* Header Search (Apple Rounded Pill Search) */
.header-search-form {
  position: relative;
  flex: 1;
  max-width: 440px;
}

.header-search {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.header-search input {
  width: 100%;
  height: 40px;
  padding: 0 1rem 0 2.4rem;
  border: var(--bw) solid var(--border);
  background: var(--surface-container);
  border-radius: var(--r-full);
  color: var(--tx-main);
  font-size: 0.9rem;
  font-family: var(--font-sans);
  font-weight: 500;
  transition: var(--t-fast);
  outline: none;
}

.header-search input:focus {
  background: var(--bg-card);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.header-search .search-icon {
  position: absolute;
  left: 0.85rem;
  color: var(--tx-muted);
  pointer-events: none;
  width: 16px;
  height: 16px;
}

.search-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 480px;
  max-width: min(92vw, 580px);
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-xl);
  z-index: 1050;
  max-height: 420px;
  overflow-y: auto;
  padding: 0.35rem 0;
}

.search-dropdown-menu--home {
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  border-radius: var(--r-xl);
  box-shadow: var(--sh-xl);
  text-align: left;
}

@media (max-width: 768px) {
  .search-dropdown-menu {
    min-width: 100% !important;
    width: 100% !important;
    left: 0 !important;
    right: 0 !important;
  }
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 1.15rem;
  text-decoration: none;
  color: var(--tx-main);
  border-bottom: 1px solid var(--border-light, var(--border));
  transition: background 0.15s ease;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: var(--surface-container);
}

.search-result-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--tx-main);
  margin-bottom: 0.18rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-sub {
  font-size: 0.76rem;
  color: var(--tx-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Header Nav */
.header-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--tx-sub);
  border-radius: var(--r-full);
  transition: var(--t-fast);
  white-space: nowrap;
}

.nav-link svg { width: 16px; height: 16px; flex-shrink: 0; }

.nav-link:hover {
  background: var(--surface-container);
  color: var(--tx-main);
}

.nav-link.active {
  background: var(--primary-light);
  color: var(--primary);
}

/* ── User Avatar & Profile Dropdown Component ───────────────────────────── */
.user-menu-wrapper {
  position: relative;
}

.user-avatar-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 3px 8px 3px 3px;
  background: var(--surface-container);
  border: 1.5px solid var(--border);
  border-radius: var(--r-full);
  cursor: pointer;
  transition: var(--t-fast);
  color: var(--tx-main);
  outline: none;
  font-family: var(--font-sans);
}

.user-avatar-btn:hover {
  background: var(--bg-card);
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.15);
}

.user-avatar-circle {
  min-width: 34px;
  height: 34px;
  padding: 0 0.5rem;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(13, 148, 136, 0.25);
  position: relative;
  box-sizing: border-box;
}

.user-avatar-circle.is-admin {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.25);
}

.user-avatar-badge-dot {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 9px;
  height: 9px;
  background: #ef4444;
  border: 2px solid #ffffff;
  border-radius: 50%;
}

.user-avatar-badge-num {
  position: absolute;
  top: -5px;
  right: -7px;
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  background: #ef4444;
  color: #ffffff;
  border: 2px solid var(--bg-card, #ffffff);
  border-radius: var(--r-full, 9999px);
  font-size: 0.65rem;
  font-weight: 800;
  font-family: var(--font-display, sans-serif);
  line-height: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.45);
  animation: badgeNumPulse 2.2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  z-index: 3;
  pointer-events: none;
  box-sizing: border-box;
}

.user-avatar-badge-num.is-admin {
  background: #7c3aed;
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.45);
}

@keyframes badgeNumPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.45);
  }
  50% {
    transform: scale(1.12);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.7);
  }
}

.user-menu-notif-box {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(239, 68, 68, 0.15) 100%);
  border: 1.5px solid rgba(239, 68, 68, 0.35);
  border-radius: var(--r-lg);
  margin-bottom: 0.55rem;
  text-decoration: none;
  transition: var(--t-fast);
  cursor: pointer;
}

.user-menu-notif-box:hover {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.24) 100%);
  border-color: #ef4444;
  transform: translateY(-1px);
}

.user-menu-notif-box.is-admin {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.08) 0%, rgba(124, 58, 237, 0.16) 100%);
  border-color: rgba(124, 58, 237, 0.35);
}

.user-menu-notif-box.is-admin:hover {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.15) 0%, rgba(124, 58, 237, 0.25) 100%);
  border-color: #7c3aed;
}

.user-menu-notif-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ef4444;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35);
}

.user-menu-notif-box.is-admin .user-menu-notif-icon {
  background: #7c3aed;
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.35);
}

.user-menu-notif-icon svg {
  width: 16px;
  height: 16px;
  color: #ffffff;
}

.user-menu-notif-body {
  flex: 1;
  min-width: 0;
}

.user-menu-notif-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--tx-main);
  line-height: 1.25;
}

.user-menu-notif-sub {
  font-size: 0.72rem;
  color: var(--tx-sub);
  margin-top: 0.15rem;
  line-height: 1.2;
}

.user-menu-item.has-unread {
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.user-menu-item.has-unread:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: #ef4444;
}

.user-menu-unread-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.18rem 0.55rem;
  background: #ef4444;
  color: #ffffff;
  border-radius: 9999px;
  box-shadow: 0 1px 4px rgba(239, 68, 68, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.user-menu-unread-badge.is-admin {
  background: #7c3aed;
  box-shadow: 0 1px 4px rgba(124, 58, 237, 0.3);
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-xl);
  z-index: 1050;
  padding: 0.6rem;
  display: none;
  animation: dropdownIn 0.18s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.user-menu-dropdown.show {
  display: block;
}

@keyframes dropdownIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.user-menu-header {
  padding: 0.75rem 0.85rem;
  background: var(--surface-container-low);
  border-radius: var(--r-lg);
  margin-bottom: 0.5rem;
  border: 1px solid var(--border-light);
}

.user-menu-name {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--tx-main);
  line-height: 1.3;
  word-break: break-word;
}

.user-menu-sub {
  font-size: 0.78rem;
  color: var(--tx-sub);
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.user-menu-items {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.user-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.6rem 0.85rem;
  border-radius: var(--r-md);
  color: var(--tx-main);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: var(--t-fast);
}

.user-menu-item:hover {
  background: var(--surface-container);
  color: var(--primary);
}

.user-menu-item svg {
  width: 17px;
  height: 17px;
  color: var(--tx-sub);
  flex-shrink: 0;
  transition: var(--t-fast);
}

.user-menu-item:hover svg {
  color: var(--primary);
}

.user-menu-item--logout {
  color: var(--c-danger) !important;
}

.user-menu-item--logout:hover {
  background: rgba(239, 68, 68, 0.08) !important;
  color: var(--c-danger) !important;
}

.user-menu-item--logout svg {
  color: var(--c-danger) !important;
}

.user-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 0.4rem 0.2rem;
}

/* ── Buttons (Apple Style Rounded Actions) ───────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 1.15rem;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  border-radius: var(--r-md);
  border: var(--bw) solid transparent;
  cursor: pointer;
  transition: var(--t-fast);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.2;
}

.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 135, 130, 0.3);
}

.btn-primary:hover {
  background: var(--primary-hover);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 135, 130, 0.35);
}

.btn-secondary {
  background: var(--secondary-light);
  color: var(--secondary);
}

.btn-secondary:hover {
  background: var(--secondary-container);
  color: var(--secondary);
}

.btn-outline {
  background: var(--bg-card);
  border-color: var(--border-med);
  color: var(--tx-main);
  box-shadow: var(--sh-xs);
}

.btn-outline:hover {
  background: var(--surface-container);
  border-color: var(--border-med);
  color: var(--tx-main);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--c-danger-light);
  color: var(--c-danger);
  border-color: transparent;
}

.btn-danger:hover {
  background: var(--c-danger);
  color: #ffffff;
}

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.82rem; border-radius: var(--r-sm); }
.btn-xs { padding: 0.2rem 0.5rem; font-size: 0.75rem; border-radius: var(--r-xs); }
.btn-pill { border-radius: var(--r-full); }

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--r-full);
}

/* Favorite Bookmark Button */
.btn-favorite-toggle {
  width: 34px;
  height: 34px;
  border-radius: var(--r-full);
  border: var(--bw) solid var(--border);
  background: var(--surface-container-low);
  color: var(--tx-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--t-fast);
  outline: none;
}

.btn-favorite-toggle:hover {
  background: var(--surface-container);
  color: var(--tx-main);
  transform: scale(1.06);
}

.btn-favorite-toggle.active {
  background: var(--c-warning-light);
  border-color: rgba(255, 149, 0, 0.3);
  color: var(--c-warning);
}

.btn-favorite-toggle.active svg { fill: currentColor; }

/* ── Cards & Bento-Grids ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: var(--bw) solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  overflow: hidden;
  transition: var(--t-normal);
}

.card-body { padding: 1.5rem; }

.card-hover:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-lg);
}

/* ── Container ───────────────────────────────────────────────────────────── */
.container {
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}




/* ── Page Header ─────────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.page-header-title { display: flex; align-items: center; gap: 0.75rem; }

.page-header-title h1 {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--tx-main);
}

.page-header-sub {
  font-size: 0.95rem;
  color: var(--tx-sub);
  margin-top: 0.3rem;
  font-weight: 400;
}

/* ── Species Filter Bar (Apple Filter Chips) ─────────────────────────────── */
.species-bar {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
  scrollbar-width: none;
}

.species-bar::-webkit-scrollbar { display: none; }

.species-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  background: var(--bg-card);
  border: var(--bw) solid var(--border);
  border-radius: var(--r-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--tx-main);
  white-space: nowrap;
  cursor: pointer;
  transition: var(--t-fast);
  box-shadow: var(--sh-xs);
}

.species-chip:hover {
  background: var(--surface-container);
  transform: translateY(-1px);
}

.species-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 135, 130, 0.35);
}

/* ── Search & Filter Cards ───────────────────────────────────────────────── */
.search-card {
  background: var(--bg-card);
  border: var(--bw) solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--sh-sm);
}

/* ── View Mode & Layout Toolbar ──────────────────────────────────────────── */
.view-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  background: var(--bg-card);
  border: var(--bw) solid var(--border);
  border-radius: var(--r-lg);
  padding: 0.6rem 0.9rem;
  box-shadow: var(--sh-xs);
}

.view-mode-group {
  display: flex;
  gap: 0.25rem;
  background: var(--surface-container);
  border-radius: var(--r-md);
  padding: 3px;
}

.vt-btn {
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--font-sans);
  color: var(--tx-sub);
  text-decoration: none;
  border-radius: var(--r-sm);
  transition: var(--t-fast);
  white-space: nowrap;
}

.vt-btn:hover { color: var(--tx-main); }

.vt-btn--active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .vt-btn--active {
  background: var(--surface-container-high);
  color: #ffffff;
}

.layout-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.vt-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--tx-muted);
  margin-right: 0.25rem;
}

.vt-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--tx-muted);
  text-decoration: none;
  transition: var(--t-fast);
}

.vt-icon-btn svg { width: 16px; height: 16px; }
.vt-icon-btn:hover { color: var(--tx-main); background: var(--surface-container); }
.vt-icon-btn--active { background: var(--surface-container); color: var(--primary); }

/* ── Drug Grid & Apple Cards ─────────────────────────────────────────────── */
.drug-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 1.5rem;
}

.drug-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: var(--bw) solid var(--border);
  background: var(--bg-card);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  transition: var(--t-normal);
  overflow: hidden;
  position: relative;
  cursor: pointer;
}

.drug-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-lg);
  border-color: var(--border-med);
}

.drug-card.is-favorited {
  border-color: #f59e0b !important;
  box-shadow: 0 0 0 1.5px rgba(245, 158, 11, 0.4), var(--sh-xs) !important;
}

.drug-card.is-favorited:hover {
  border-color: #d97706 !important;
  box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.55), var(--sh-md) !important;
}

.list-row.is-favorited {
  background: rgba(245, 158, 11, 0.05) !important;
  border-left: 3px solid #f59e0b !important;
}

.drug-card-inner {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  flex: 1;
}

.drug-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--tx-main);
  line-height: 1.25;
  margin: 0;
  letter-spacing: -0.02em;
  transition: var(--t-fast);
}

.drug-card:hover .drug-name {
  color: var(--primary);
}

.atc-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--tx-muted);
}

.drug-mfr {
  font-size: 0.85rem;
  color: var(--tx-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 500;
}

.drug-mfr svg { width: 14px; height: 14px; }

/* ── Badges & Pills (Apple Soft Tinted Tags) ──────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
  border-radius: var(--r-full);
  font-family: var(--font-sans);
  border: var(--bw) solid transparent;
}

.badge-kirmizi { background: var(--c-danger-light); color: var(--c-danger); }
.badge-yesil   { background: var(--c-success-light); color: var(--c-success); }
.badge-otc     { background: var(--c-teal-light); color: var(--c-teal); }
.badge-normal  { background: var(--surface-container); color: var(--tx-sub); }
.badge-teal    { background: var(--primary-light); color: var(--primary); }
.badge-purple  { background: var(--secondary-light); color: var(--secondary); }
.badge-lemon   { background: var(--c-warning-light); color: var(--c-warning); }
.badge-peach   { background: var(--c-danger-light); color: var(--c-danger); }

/* Withdrawal Strip (Apple Clean Card Box) */
.withdrawal-strip {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
}

.wd-item {
  flex: 1;
  background: var(--surface-container-low);
  border: var(--bw) solid var(--border);
  border-radius: var(--r-md);
  padding: 0.45rem 0.65rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.wd-title {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--tx-muted);
}

.wd-days {
  font-size: 0.88rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--tx-main);
}

.wd-days.free   { color: var(--c-success); }
.wd-days.banned { color: var(--c-danger); font-size: 0.78rem; }

/* Target Species Pills */
.species-pills { display: flex; gap: 0.35rem; flex-wrap: wrap; }

.sp-pill {
  font-size: 0.85rem;
  background: var(--surface-container);
  color: var(--tx-main);
  border-radius: var(--r-sm);
  padding: 0.2rem 0.45rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Card Footer */
.drug-card-footer {
  padding: 0.75rem 1.5rem;
  border-top: var(--bw) solid var(--border);
  background: var(--surface-container-low);
  border-bottom-left-radius: var(--r-lg);
  border-bottom-right-radius: var(--r-lg);
}

.btn-full { width: 100%; justify-content: space-between; }

/* ── Form Inputs (Apple Rounded Controls) ────────────────────────────────── */
.form-control, textarea.form-control {
  width: 100%;
  padding: 0.65rem 0.95rem;
  font-size: 0.92rem;
  font-family: var(--font-sans);
  background: var(--bg-card);
  border: var(--bw) solid var(--border-med);
  border-radius: var(--r-md);
  color: var(--tx-main);
  transition: var(--t-fast);
  outline: none;
  box-shadow: var(--sh-xs);
}

.form-select {
  width: 100%;
  height: 44px;
  padding: 0.65rem 2.6rem 0.65rem 1rem;
  font-size: 0.92rem;
  font-weight: 600;
  font-family: var(--font-sans);
  background-color: var(--bg-card);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230d9488' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 16px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  color: var(--tx-main);
  transition: var(--t-fast);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  box-shadow: var(--sh-xs);
}

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

.form-select:hover {
  border-color: var(--primary);
}

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

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--tx-sub);
  margin-bottom: 0.35rem;
}

.form-group { margin-bottom: 1.1rem; }

/* ── Filter Panel & Cards Component ──────────────────────────────────────── */
.filter-panel-box, .filter-panel {
  background: var(--surface-container-low);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  padding: 1.25rem 1.4rem;
  margin-top: 1.15rem;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.02);
}

.filter-fields-grid, .filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.85rem;
}

.filter-select-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 0.65rem 0.9rem;
  transition: var(--t-fast);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  position: relative;
}

.filter-select-card:hover {
  border-color: var(--primary);
  box-shadow: 0 3px 10px rgba(13, 148, 136, 0.08);
}

.filter-select-card.is-active {
  border-color: var(--primary);
  background: linear-gradient(to bottom, var(--primary-light), var(--bg-card));
}

.filter-select-card:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.filter-select-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--tx-sub);
}

.filter-native-select {
  width: 100%;
  height: 36px;
  border: none;
  background: transparent;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--tx-main);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%230d9488' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.2rem center;
  background-size: 15px 15px;
  padding: 0 1.6rem 0 0;
}

.filter-fav-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  border-radius: var(--r-full);
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--tx-main);
  cursor: pointer;
  transition: var(--t-fast);
  user-select: none;
}

.filter-fav-pill:hover {
  border-color: var(--primary);
}

.filter-fav-pill.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

/* ── Tables (Apple Medical Ledger) ───────────────────────────────────────── */
.list-table-wrap, .table-responsive {
  background: var(--bg-card);
  border: var(--bw) solid var(--border);
  border-radius: var(--r-lg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 100%;
  box-shadow: var(--sh-sm);
}

.list-table, .table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.list-table thead tr, .table thead tr {
  background: var(--surface-container);
  border-bottom: var(--bw) solid var(--border);
}

.list-table th, .table th {
  padding: 0.85rem 1.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--tx-muted);
}

.list-table td, .table td {
  padding: 0.95rem 1.25rem;
  border-bottom: var(--bw) solid var(--border-light);
  font-size: 0.88rem;
  color: var(--tx-main);
}

.list-table tbody tr:hover, .table tbody tr:hover {
  background: var(--surface-container-low);
}

.list-table tbody tr:last-child td, .table tbody tr:last-child td {
  border-bottom: none;
}

.list-name-link {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--tx-main);
}

.list-name-link:hover { color: var(--primary); }

.list-atc {
  display: block;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--tx-muted);
  margin-top: 0.15rem;
}

.list-wd {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  margin-right: 0.4rem;
}

/* ── Tabs (Apple Segmented Controls) ─────────────────────────────────────── */
.tab-nav {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.35rem;
  background: var(--surface-container);
  border-radius: var(--r-md);
  margin-bottom: 1.5rem;
  scrollbar-width: none;
}

.tab-nav::-webkit-scrollbar { display: none; }

.tab-btn {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--tx-sub);
  border: none;
  background: transparent;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: var(--t-fast);
  white-space: nowrap;
}

.tab-btn:hover { color: var(--tx-main); }

.tab-btn.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .tab-btn.active {
  background: var(--surface-container-high);
  color: #ffffff;
}

.tab-pane {
  display: none !important;
}

.tab-pane.active {
  display: block !important;
  animation: fadeInTab 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}

@keyframes fadeInTab {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Info Box & Alerts ───────────────────────────────────────────────────── */
.info-box {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.25rem;
  border-radius: var(--r-lg);
  border: var(--bw) solid transparent;
  font-size: 0.9rem;
}

.info-box.danger {
  background: var(--c-danger-light);
  color: var(--c-danger);
  border-color: rgba(255, 59, 48, 0.2);
}

.info-box.warning {
  background: var(--c-warning-light);
  color: var(--c-warning);
  border-color: rgba(255, 149, 0, 0.2);
}

.info-box.success {
  background: var(--c-success-light);
  color: var(--c-success);
  border-color: rgba(52, 199, 89, 0.2);
}

.info-box.info {
  background: var(--primary-light);
  color: var(--primary);
  border-color: rgba(0, 135, 130, 0.2);
}

/* ── Toasts ──────────────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.85rem 1.25rem;
  background: var(--bg-card);
  border: var(--bw) solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xl);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--tx-main);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: opacity 0.3s ease;
}

/* ── Detail Page Two-Column Layout ───────────────────────────────────────── */
.drug-detail-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  align-items: start;
}

.detail-panel {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.detail-panel-card {
  background: var(--bg-card);
  border: var(--bw) solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-sm);
  overflow: hidden;
}

.detail-panel-header {
  background: linear-gradient(135deg, #008782 0%, #33b7bc 100%) !important;
  color: #ffffff !important;
  padding: 1.25rem 1.4rem;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
}

.detail-panel-header-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #ffffff !important;
  margin: 0;
  letter-spacing: -0.02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  font-family: var(--font-display);
}

.detail-panel-header-sub {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.94) !important;
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.detail-panel-body {
  padding: 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.detail-panel-section {
  background: var(--bg-card);
  border: var(--bw) solid var(--border);
  border-radius: var(--r-xl);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--sh-xs);
}

.detail-panel-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--tx-main);
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

@media (max-width: 960px) {
  .drug-detail-layout { grid-template-columns: 1fr; }
  .detail-panel { position: static; }
}

/* ── Mobile Bottom Navigation Bar (Apple Frosted Glass) ──────────────────── */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100vw;
  max-width: 100%;
  background: var(--bg-header);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: var(--bw) solid var(--border);
  padding: 0.35rem 0.5rem;
  padding-bottom: max(0.45rem, env(safe-area-inset-bottom));
  z-index: 10000;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
}

.mobile-nav-items {
  display: flex !important;
  flex-direction: row !important;
  justify-content: space-around !important;
  align-items: center !important;
  width: 100% !important;
  max-width: 540px;
  margin: 0 auto;
  gap: 2px;
}

.mobile-nav-item {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;
  font-size: 0.68rem !important;
  font-weight: 600;
  color: var(--tx-muted);
  text-decoration: none;
  padding: 0.25rem 0.1rem;
  border-radius: var(--r-sm);
  position: relative;
  transition: var(--t-fast);
  white-space: nowrap;
}

.mobile-nav-item.active {
  color: var(--primary) !important;
  font-weight: 700;
}

.mobile-nav-item svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.2;
}

.mobile-nav-badge {
  position: absolute;
  top: 1px;
  right: calc(50% - 16px);
  background: var(--c-danger);
  color: #ffffff;
  font-size: 0.6rem;
  font-weight: 800;
  min-width: 15px;
  height: 15px;
  line-height: 15px;
  padding: 0 3px;
  border-radius: var(--r-full);
  text-align: center;
  box-shadow: 0 2px 5px rgba(255, 59, 48, 0.4);
}

@media (max-width: 768px) {
  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
  }
  .desktop-only { display: none !important; }
  .mobile-nav { display: flex !important; }
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)) !important; }
  .container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 1.15rem 0.85rem !important;
    overflow-x: hidden !important;
  }
  .header-inner { padding: 0.65rem 0.85rem !important; }
}

/* ── Calculator Result Display ───────────────────────────────────────────── */
.calc-result-box {
  background: var(--primary-light);
  border: 1.5px solid var(--primary);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  text-align: center;
  margin-top: 1.5rem;
  box-shadow: 0 4px 16px rgba(0, 135, 130, 0.1);
}

.calc-result-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.calc-result-value {
  font-size: 2.3rem;
  font-weight: 800;
  font-family: var(--font-display);
  color: var(--primary);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.calc-result-sub {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--tx-sub);
  margin-top: 0.35rem;
}

/* ── Modern App Footer (Apple Pro Style) ─────────────────────────────────── */
.app-footer {
  background: var(--surface-container-low);
  border-top: 1px solid var(--border);
  margin-top: 5rem;
  padding-top: 3.5rem;
  color: var(--tx-sub);
  position: relative;
}

[data-theme="dark"] .app-footer {
  background: #0d1117;
  border-top-color: rgba(255, 255, 255, 0.08);
}

.footer-inner {
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
}


.footer-trust-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  padding: 1.75rem 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  box-shadow: var(--sh-sm);
  margin-bottom: 3.5rem;
}

.footer-trust-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.footer-trust-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-xl);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.footer-trust-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--tx-main);
  margin-bottom: 0.15rem;
}

.footer-trust-desc {
  font-size: 0.8rem;
  color: var(--tx-muted);
  line-height: 1.4;
}

.footer-main-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.3fr;
  gap: 3rem;
  padding-bottom: 3.5rem;
  border-bottom: 1px solid var(--border);
}

.footer-brand-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--tx-main);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.footer-brand-desc {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--tx-sub);
  margin-bottom: 1.25rem;
}

.footer-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  background: var(--surface-container);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--tx-main);
}

.footer-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-success);
  box-shadow: 0 0 0 2px var(--c-success-light);
}

.footer-col-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--tx-main);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.footer-links-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.footer-links-list a {
  color: var(--tx-sub);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: var(--t-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.footer-links-list a:hover {
  color: var(--primary);
  transform: translateX(3px);
}

.footer-disclaimer-box {
  background: var(--surface-container);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.15rem 1.25rem;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--tx-sub);
}

.footer-bottom-bar {
  padding: 1.75rem 0 2.5rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.82rem;
  color: var(--tx-muted);
}

.footer-bottom-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-bottom-links a {
  color: var(--tx-muted);
  text-decoration: none;
  transition: var(--t-fast);
}

.footer-bottom-links a:hover {
  color: var(--primary);
}

@media (max-width: 992px) {
  .footer-main-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

@media (max-width: 600px) {
  .footer-main-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .footer-trust-banner {
    grid-template-columns: 1fr;
    padding: 1.25rem;
  }
  .footer-bottom-bar {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
}

/* ── Global Spin Animation for Loaders & Buttons ── */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.spin, svg.spin, i.spin {
  animation: spin 0.85s linear infinite !important;
  display: inline-block !important;
  transform-origin: center center !important;
}

/* ==========================================================================
   Vademecum, Prospektüsler & Takviyeler — Unified Light & Dark Mode System
   ========================================================================== */
.vademecum-page-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 1.25rem;
  padding-bottom: 3.5rem;
}

/* Header Card */
.vademecum-header-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  padding: 1.35rem 1.65rem;
  box-shadow: var(--sh-xs);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.vademecum-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 260px;
}
.vademecum-title-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(13,148,136,0.14) 0%, rgba(13,148,136,0.04) 100%);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(13,148,136,0.25);
  box-shadow: 0 4px 12px rgba(13,148,136,0.08);
}
[data-theme="dark"] .vademecum-title-icon {
  background: linear-gradient(135deg, rgba(51,183,188,0.2) 0%, rgba(51,183,188,0.06) 100%);
  border-color: rgba(51,183,188,0.35);
  color: var(--primary);
}
.vademecum-title {
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--tx-main);
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.025em;
}
.vademecum-subtitle {
  font-size: .88rem;
  color: var(--tx-muted);
  margin: .25rem 0 0 0;
  font-weight: 500;
}
.vademecum-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .75rem;
}
.vademecum-stats-strip {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
}
.stat-pill-card {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .45rem .85rem;
  background: var(--surface-container-low);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
  transition: all 0.2s ease;
}
.stat-pill-card:hover {
  border-color: var(--primary);
  background: var(--bg-card);
  transform: translateY(-1px);
  box-shadow: var(--sh-sm);
}
.stat-pill-icon-circle {
  font-size: 1.25rem;
  line-height: 1;
}
.stat-pill-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.stat-pill-num {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--tx-main);
  font-family: var(--font-display);
}
.stat-pill-text {
  font-size: .68rem;
  font-weight: 800;
  color: var(--tx-muted);
  text-transform: uppercase;
  letter-spacing: .02em;
  margin-top: 2px;
}
.btn-interaction {
  background: #faf5ff;
  color: #7c3aed;
  border: 1px solid #e9d5ff;
  font-weight: 700;
}
.btn-interaction:hover {
  background: #7c3aed;
  color: #ffffff;
  border-color: #7c3aed;
}
[data-theme="dark"] .btn-interaction {
  background: rgba(124, 58, 237, 0.15);
  color: #c084fc;
  border-color: rgba(124, 58, 237, 0.35);
}
[data-theme="dark"] .btn-interaction:hover {
  background: #7c3aed;
  color: #ffffff;
}

/* Sidebar & Form */
.vademecum-layout {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}
.vademecum-sidebar {
  width: 275px;
  flex-shrink: 0;
  position: sticky;
  top: 90px;
  scroll-margin-top: 95px;
  max-height: calc(100vh - 105px);
  overflow-y: auto;
  scrollbar-width: none;
}
.vademecum-sidebar::-webkit-scrollbar { display: none; }
.vademecum-sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0;
  overflow: hidden;
  box-shadow: var(--sh-md);
  transition: background 0.2s ease, border-color 0.2s ease;
}
.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 1.25rem 1rem;
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 55%, #134e4a 100%);
}
[data-theme="dark"] .sidebar-header {
  background: linear-gradient(135deg, #0f766e 0%, #134e4a 60%, #042f2e 100%);
}
.sidebar-form-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--bg-card);
  padding: .35rem 0 .5rem 0;
}
.filter-row {
  display: flex;
  flex-direction: column;
  padding: .8rem 1.25rem;
}
.filter-row + .filter-row {
  border-top: 1px solid var(--border);
}
.filter-row--split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0;
  border-top: 1px solid var(--border);
}
.filter-row--split .filter-row-cell {
  padding: .8rem 1rem;
}
.filter-row--split .filter-row-cell + .filter-row-cell {
  border-left: 1px solid var(--border);
}
.filter-label {
  font-size: .67rem;
  font-weight: 800;
  color: var(--tx-muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: .5rem;
  display: flex;
  align-items: center;
  gap: .3rem;
}
.filter-control-clean {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--border);
  border-radius: 0;
  padding: .35rem .05rem;
  font-size: .875rem;
  font-weight: 600;
  color: var(--tx-main);
  outline: none;
  transition: border-color 0.2s ease;
}
.filter-control-clean:hover {
  border-bottom-color: var(--tx-muted);
}
.filter-control-clean:focus {
  border-bottom-color: var(--primary);
  background: transparent;
}
.filter-control-clean::placeholder {
  color: var(--tx-muted);
  font-weight: 400;
}
select.filter-control-clean {
  cursor: pointer;
  appearance: auto;
  color: var(--tx-main);
  background-color: var(--bg-card);
}
select.filter-control-clean option {
  background-color: var(--bg-card);
  color: var(--tx-main);
}
.category-radio-list {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  margin-top: .25rem;
  max-height: 220px;
  overflow-y: auto;
  padding-right: .2rem;
}
.category-radio-list::-webkit-scrollbar { width: 4px; }
.category-radio-list::-webkit-scrollbar-thumb {
  background: var(--border-med);
  border-radius: 4px;
}
.category-radio-item {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .4rem .65rem;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--tx-sub);
  cursor: pointer;
  transition: all 0.15s ease;
  background: var(--surface-container-low);
  border: 1px solid transparent;
  user-select: none;
}
.category-radio-item:hover {
  background: var(--surface-container);
  border-color: var(--border);
  color: var(--primary);
}
.category-radio-item.active {
  background: rgba(13, 148, 136, 0.14);
  border-color: rgba(13, 148, 136, 0.35);
  color: var(--primary);
  font-weight: 800;
}
[data-theme="dark"] .category-radio-item.active {
  background: rgba(51, 183, 188, 0.2);
  border-color: rgba(51, 183, 188, 0.4);
  color: var(--primary);
}
.sidebar-footer {
  padding: .85rem 1.25rem 1rem;
  background: var(--surface-container-low);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.sidebar-fav-toggle {
  display: flex;
  align-items: center;
  gap: .6rem;
  cursor: pointer;
  font-size: .85rem;
  font-weight: 700;
  color: var(--tx-sub);
  user-select: none;
  padding: .5rem .7rem;
  background: var(--surface-container);
  border-radius: 8px;
  transition: background 0.15s ease;
}
.sidebar-fav-toggle:hover {
  background: var(--surface-container-high);
}

/* Species Row */
.species-single-row {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: .4rem;
  width: 100%;
}
.species-pill-item {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: .55rem .2rem .45rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  text-decoration: none;
  color: var(--tx-main);
  transition: all 0.15s ease-in-out;
  cursor: pointer;
  text-align: center;
  box-shadow: var(--sh-xs);
  min-width: 0;
}
.animal-icon {
  display: inline-block;
  vertical-align: middle;
  stroke: currentColor;
  fill: none;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}
.species-pill-item .sp-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  line-height: 1;
}
.species-pill-item .sp-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .68rem;
  font-weight: 700;
  color: var(--tx-sub);
  max-width: 100%;
  padding: 0 .1rem;
}
.species-pill-item:hover {
  border-color: var(--primary);
  background: var(--surface-container-low);
  transform: translateY(-2px);
  box-shadow: var(--sh-sm);
}
.species-pill-item.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(13,148,136,0.35);
}
.species-pill-item.active .sp-emoji { filter: none; }
.species-pill-item.active .sp-name { color: #ffffff; font-weight: 800; }

/* Cards & Grid */
.drug-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.15rem;
}
.drug-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  box-shadow: var(--sh-xs);
}
.drug-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--sh-md);
}
.drug-card.is-favorited {
  border-color: rgba(245,158,11,0.5);
}
.card-header-panel {
  background: var(--surface-container-low);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1.15rem 0.75rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
}
[data-theme="dark"] .card-header-panel {
  background: var(--surface-container-lowest);
  border-bottom: 1px solid var(--border);
}
.drug-name-prominent {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.3;
  margin: 0 0 .2rem;
  color: var(--tx-main);
  letter-spacing: -0.02em;
  text-decoration: none;
  display: block;
  transition: color 0.15s ease;
}
.drug-name-prominent:hover { color: var(--primary); }
.card-cat-badge {
  display: inline-block;
  font-size: .68rem;
  font-weight: 800;
  color: var(--primary);
  background: var(--surface-container);
  border: 1px solid var(--border);
  padding: .12rem .45rem;
  border-radius: 6px;
  letter-spacing: .02em;
}
.btn-fav-on-panel {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  color: var(--tx-muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
  box-shadow: var(--sh-xs);
}
.btn-fav-on-panel:hover {
  background: var(--surface-container);
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-1px);
}
.btn-fav-on-panel.active {
  background: #f59e0b !important;
  color: #ffffff !important;
  border-color: #f59e0b !important;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35) !important;
}
.btn-fav-on-panel.active svg {
  fill: currentColor !important;
}

#detail-fav-btn.active,
#detail-fav-btn.is-in-bag,
#btn-commercial-fav.active,
#btn-commercial-fav.is-in-bag {
  background: var(--primary) !important;
  color: #ffffff !important;
  border-color: var(--primary) !important;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.35) !important;
}

#detail-fav-btn.active svg,
#detail-fav-btn.is-in-bag svg,
#btn-commercial-fav.active svg,
#btn-commercial-fav.is-in-bag svg {
  fill: currentColor !important;
}

.card.is-favorited {
  border-color: rgba(245, 158, 11, 0.45) !important;
}
.card-species-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-container-low);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  line-height: 1;
  color: var(--tx-main);
  flex-shrink: 0;
}
.metric-chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: var(--surface-container-low);
  border: 1px solid var(--border);
  padding: .22rem .5rem;
  border-radius: 8px;
  font-size: .76rem;
  font-weight: 700;
  color: var(--tx-sub);
}
.card-info-box {
  background: var(--surface-container-low);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .45rem .65rem;
  font-size: .78rem;
  color: var(--tx-sub);
  font-weight: 600;
}
.withdrawal-banner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  background: var(--surface-container-low);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .5rem .75rem;
  margin-top: auto;
}
.wd-col { display: flex; flex-direction: column; gap: 2px; }
.wd-label {
  font-size: .68rem;
  font-weight: 800;
  color: var(--tx-muted);
  text-transform: uppercase;
}
.wd-val {
  font-size: .82rem;
  font-weight: 900;
  color: var(--tx-main);
}
.wd-val.free { color: #16a34a; }
.wd-val.banned { color: #dc2626; }
[data-theme="dark"] .wd-val.free { color: #4ade80; }
[data-theme="dark"] .wd-val.banned { color: #f87171; }
.drug-card-footer {
  padding: .65rem 1.15rem;
  background: var(--surface-container-low);
  border-top: 1px solid var(--border);
}
[data-theme="dark"] .drug-card-footer {
  background: var(--surface-container-lowest);
}

/* ── Commercial Brand List Table (Apple Pro Vademecum Redesign) ───────────── */
.comm-table-wrap {
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl, 16px);
  overflow: hidden !important; /* Prevent ANY horizontal overflow/scroll */
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.03);
  margin-bottom: 2rem;
}
[data-theme="dark"] .comm-table-wrap {
  background: var(--bg-card);
  border-color: var(--border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.comm-list-table {
  table-layout: fixed !important; /* STRICTLY ENFORCE COLUMN WIDTHS WITHIN 100% CONTAINER */
  width: 100% !important;
  max-width: 100% !important;
  border-collapse: collapse;
  text-align: left;
  box-sizing: border-box;
  font-size: 0.83rem;
}

.comm-list-table thead tr {
  background: var(--surface-container, #f8fafc);
  border-bottom: 1.5px solid var(--border);
}

.comm-list-table th {
  padding: 0.7rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--tx-muted);
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comm-th-name { width: 29%; }
.comm-th-type { width: 13%; text-align: center !important; }
.comm-th-company { width: 20%; }
.comm-th-ingredient { width: 18%; }
.comm-th-form { width: 9%; text-align: center !important; }
.comm-th-actions { width: 11%; text-align: right !important; }

.comm-list-row {
  border-bottom: 1px solid var(--border-light, #f1f5f9);
  transition: background-color 0.15s ease, border-color 0.15s ease;
  border-left: 3px solid transparent;
}
.comm-list-row:last-child {
  border-bottom: none;
}
.comm-list-row:hover {
  background: var(--surface-container-low, #f8fafc);
  border-left-color: var(--primary, #008782);
}
.comm-list-row.comm-row--sponsored {
  background: rgba(124, 58, 237, 0.025);
  border-left-color: #7c3aed;
}
.comm-list-row.comm-row--sponsored:hover {
  background: rgba(124, 58, 237, 0.06);
}
.comm-list-row.comm-row--featured {
  background: rgba(245, 158, 11, 0.025);
  border-left-color: #f59e0b;
}
.comm-list-row.comm-row--featured:hover {
  background: rgba(245, 158, 11, 0.06);
}

.comm-td {
  padding: 0.65rem 0.45rem;
  vertical-align: middle;
  color: var(--tx-main);
  box-sizing: border-box;
  overflow: hidden;
}
.comm-td--type, .comm-td--form {
  text-align: center !important;
}
.comm-td--actions {
  text-align: right !important;
}

/* Product Name & Metadata */
.comm-name-cell {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}
.comm-name-link {
  font-family: var(--font-display, inherit);
  font-weight: 800;
  font-size: 0.94rem;
  color: var(--tx-main);
  text-decoration: none;
  line-height: 1.3;
  transition: color 0.15s ease;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.comm-name-link:hover {
  color: var(--primary);
}
.comm-name-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.comm-meta-atc {
  font-family: var(--font-mono, monospace);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--tx-muted);
  background: var(--surface-container, #f1f5f9);
  padding: 0.12rem 0.4rem;
  border-radius: var(--r-sm, 6px);
  border: 1px solid var(--border-light, #e2e8f0);
}
.comm-meta-kub {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.65rem;
  font-weight: 800;
  color: #0d9488;
  background: rgba(13, 148, 136, 0.08);
  border: 1px solid rgba(13, 148, 136, 0.2);
  padding: 0.12rem 0.4rem;
  border-radius: var(--r-full, 9999px);
}

/* Centered Pills in "Tür" and "Form" Columns */
.comm-pills-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}
.comm-centered-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.16rem 0.38rem;
  border-radius: var(--r-full, 9999px);
  font-size: 0.67rem;
  font-weight: 700;
  line-height: 1.2;
  width: auto;
  max-width: 100%;
  box-sizing: border-box;
  white-space: nowrap;
}
.comm-centered-pill span {
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.comm-centered-pill.comm-pill--icononly {
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  max-width: 24px !important;
  padding: 0 !important;
  font-size: 0.78rem !important;
  line-height: 1 !important;
  border-radius: 9999px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.badge--icononly {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
}
.comm-pill--vet {
  background: var(--surface-container, #f1f5f9);
  color: var(--tx-sub, #475569);
  border: 1px solid var(--border, #cbd5e1);
}
.comm-pill--human {
  background: rgba(124, 58, 237, 0.09);
  color: #7c3aed;
  border: 1px solid rgba(124, 58, 237, 0.22);
}
.comm-pill--single {
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.comm-pill--combo {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.28);
}
.comm-pill--sponsored {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: #ffffff !important;
  border: 1px solid #7c3aed;
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.25);
}
.comm-pill--featured {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff !important;
  border: 1px solid #d97706;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.25);
}
.comm-pill--form {
  background: var(--surface-container, #f1f5f9);
  color: var(--tx-main);
  border: 1px solid var(--border);
  font-weight: 600;
  max-width: 100%;
  font-size: 0.68rem;
  padding: 0.18rem 0.4rem;
}
[data-theme="dark"] .comm-pill--form {
  background: var(--surface-container-low);
  border-color: var(--border);
}

/* Company / Manufacturer Cell (Truncated to 25 chars with tooltip) */
.comm-company-box {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--tx-sub);
  font-weight: 600;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  cursor: default;
}
.comm-company-icon {
  width: 14px;
  height: 14px;
  color: var(--tx-muted);
  flex-shrink: 0;
}
.comm-company-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.35;
  color: var(--tx-sub);
  min-width: 0;
  flex: 1;
}
[data-theme="dark"] .comm-company-text {
  color: var(--tx-muted);
}

/* Active Ingredient Cell */
.comm-ing-box {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}
.comm-ing-link {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
  font-size: 0.84rem;
  color: var(--primary, #008782);
  text-decoration: none;
  transition: color 0.15s ease;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}
.comm-ing-link:hover {
  color: var(--primary-hover, #006c68);
  text-decoration: underline;
}
.comm-ing-static {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
  font-size: 0.84rem;
  color: var(--tx-main);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}
.comm-ing-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}
.comm-ing-icon {
  width: 13px;
  height: 13px;
  color: var(--primary);
  flex-shrink: 0;
}

/* Action Buttons */
.comm-actions-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.22rem;
  width: 100%;
  max-width: 100%;
}
.comm-btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.2rem 0.48rem;
  font-size: 0.69rem;
  font-weight: 700;
  border-radius: var(--r-full, 9999px);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.2;
  box-sizing: border-box;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.comm-btn-pill:hover {
  transform: translateY(-1px);
}

/* Grid View Sponsored / Featured Card Borders */
.drug-card--sponsored {
  border: 2px solid #7c3aed !important;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.16) !important;
}
.drug-card--featured {
  border: 2px solid #d97706 !important;
  box-shadow: 0 4px 16px rgba(217, 119, 6, 0.16) !important;
}

.comm-empty-cell {
  padding: 3.5rem 1.5rem;
  text-align: center;
}
.comm-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.prosp-sp-emoji,
.supp-sp-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1;
  transition: transform 0.15s ease;
  cursor: default;
}
.prosp-sp-emoji:hover,
.supp-sp-emoji:hover {
  transform: scale(1.25);
}
