/* ============================================================================
   VITALITEK DESIGN SYSTEM — Component Library
   Version: 2.0.0

   Healthcare-focused design system with coral/magenta brand identity.
   Pure CSS with CSS Custom Properties. No framework dependencies.
   WCAG AA compliant. Server-rendered HTML + progressive JS enhancement.

   DEPENDENCY: Requires design-tokens.css loaded FIRST for:
     --color-surface-*, --color-text-*, --color-primary*, --color-secondary*,
     --color-success*, --color-warning*, --color-error*, --color-info*,
     --color-border*, --color-focus-ring*, --space-*, --radius-*, --shadow-*,
     --font-family-sans, --font-weight-*, --text-*, --line-height-*,
     --transition-fast/normal/slow, --z-*

   DEPENDENCY: Requires accessibility.css loaded AFTER this file for:
     focus-visible overrides, skip-link, reduced-motion, forced-colors,
     touch targets, visually-hidden utilities.

   Table of Contents:
   0. Component Tokens (bridge from design-tokens.css)
   1. Global Reset & Base
   2. Navigation (Top Nav)
   3. Hero Section
   4. Cards (4 variants)
   5. Buttons (all variants, sizes, states)
   6. Form Inputs (all types)
   7. Modals & Dialogs
   8. Alerts & Toasts
   9. Tabs & Accordions
   10. Tables (sortable, responsive, paginated)
   11. Avatars & Badges
   12. Progress & Loading
   13. Footer
   14. Utility Classes
   ============================================================================ */


/* ============================================================================
   GLOBAL RESET & BASE
   ============================================================================ */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-normal);
  color: var(--color-gray-900);
  background-color: var(--color-gray-50);
}

/* Skip-to-content link for accessibility */
.vt-skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: calc(var(--z-toast) + 1);
  padding: var(--space-2) var(--space-4);
  background: var(--color-primary);
  color: var(--color-white);
  font-weight: var(--font-weight-semibold);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: top var(--transition-fast);
}

.vt-skip-link:focus {
  top: var(--space-4);
}


/* ============================================================================
   1. NAVIGATION (TOP NAV)
   ============================================================================

   HTML Example:
   <a class="vt-skip-link" href="#main-content">Skip to content</a>
   <nav class="vt-nav" aria-label="Main navigation">
     <div class="vt-nav__container">
       <div class="vt-nav__left">
         <a href="/" class="vt-nav__logo"><img src="/logo.svg" alt="Vitalitek"></a>
         <ul class="vt-nav__links">
           <li><a href="/dashboard" class="vt-nav__link vt-nav__link--active">Dashboard</a></li>
           <li><a href="/patients" class="vt-nav__link">Patients</a></li>
           <li><a href="/billing" class="vt-nav__link">Billing</a></li>
         </ul>
       </div>
       <div class="vt-nav__right">
         <div class="vt-nav__search">
           <svg class="vt-nav__search-icon">...</svg>
           <input class="vt-nav__search-input" type="search" placeholder="Search...">
         </div>
         <div class="vt-nav__user">
           <button class="vt-nav__user-trigger" aria-expanded="false" aria-haspopup="true">
             <div class="vt-avatar vt-avatar--sm">JD</div>
             <span class="vt-nav__user-name">Dr. Doe</span>
             <svg class="vt-nav__user-chevron">...</svg>
           </button>
           <div class="vt-nav__dropdown" role="menu">
             <a class="vt-nav__dropdown-item" role="menuitem" href="/settings">Settings</a>
             <div class="vt-nav__dropdown-divider"></div>
             <button class="vt-nav__dropdown-item vt-nav__dropdown-item--danger" role="menuitem">Sign out</button>
           </div>
         </div>
       </div>
       <button class="vt-nav__hamburger" aria-expanded="false" aria-label="Toggle menu">
         <span class="vt-nav__hamburger-line"></span>
         <span class="vt-nav__hamburger-line"></span>
         <span class="vt-nav__hamburger-line"></span>
       </button>
     </div>
   </nav>
   <div class="vt-nav__mobile-panel">
     <a class="vt-nav__mobile-link vt-nav__mobile-link--active" href="/dashboard">Dashboard</a>
     <a class="vt-nav__mobile-link" href="/patients">Patients</a>
   </div>

   ============================================================================ */

.vt-nav {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  width: 100%;
  height: 64px;
  background: var(--color-nav-bg, rgba(255, 255, 255, 0.72));
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--color-gray-200);
  transition: background var(--transition-base), box-shadow var(--transition-base);
}

.vt-nav--scrolled {
  background: var(--color-nav-bg-scrolled, rgba(255, 255, 255, 0.92));
  box-shadow: var(--shadow-sm);
}

.vt-nav__container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--container-xl);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.vt-nav__left {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.vt-nav__logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.vt-nav__logo img {
  height: 32px;
  width: auto;
}

.vt-nav__logo-dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .vt-nav__logo-light { display: none; }
  :root:not([data-theme="light"]) .vt-nav__logo-dark { display: block; }
}

[data-theme="dark"] .vt-nav__logo-light { display: none; }
[data-theme="dark"] .vt-nav__logo-dark { display: block; }

.vt-nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  list-style: none;
}

.vt-nav__link {
  position: relative;
  display: flex;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  color: var(--color-gray-600);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.vt-nav__link:hover {
  color: var(--color-gray-900);
  background-color: var(--color-gray-100);
}

.vt-nav__link:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.vt-nav__link--active {
  color: var(--color-primary);
  font-weight: var(--font-weight-semibold);
}

.vt-nav__link--active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: var(--space-3);
  right: var(--space-3);
  height: 2px;
  background: var(--color-primary);
  border-radius: var(--radius-full);
}

.vt-nav__right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

/* Search input in nav */
.vt-nav__search {
  position: relative;
  width: 220px;
}

.vt-nav__search-input {
  width: 100%;
  height: 36px;
  padding: 0 var(--space-3) 0 var(--space-8);
  font-size: var(--font-size-sm);
  font-family: var(--font-family);
  color: var(--color-gray-900);
  background: var(--color-gray-100);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.vt-nav__search-input::placeholder {
  color: var(--color-gray-400);
}

.vt-nav__search-input:focus {
  outline: none;
  background: var(--color-surface-primary);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-focus);
  width: 280px;
}

.vt-nav__search-icon {
  position: absolute;
  left: var(--space-2-5);
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--color-gray-400);
  pointer-events: none;
}

/* User dropdown in nav */
.vt-nav__user {
  position: relative;
}

.vt-nav__user-trigger {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1-5) var(--space-2);
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color var(--transition-fast);
  font-family: var(--font-family);
}

.vt-nav__user-trigger:hover {
  background-color: var(--color-gray-100);
}

.vt-nav__user-trigger:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.vt-nav__user-name {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-gray-700);
}

.vt-nav__user-chevron {
  width: 12px;
  height: 12px;
  color: var(--color-gray-400);
  transition: transform var(--transition-fast);
}

.vt-nav__user--open .vt-nav__user-chevron {
  transform: rotate(180deg);
}

.vt-nav__dropdown {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  min-width: 200px;
  padding: var(--space-1);
  background: var(--color-surface-primary);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.96);
  transition: opacity var(--transition-base), visibility var(--transition-base), transform var(--transition-base);
  z-index: var(--z-dropdown);
}

.vt-nav__user--open .vt-nav__dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.vt-nav__dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-size-sm);
  font-family: var(--font-family);
  color: var(--color-gray-700);
  text-decoration: none;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.vt-nav__dropdown-item:hover {
  background-color: var(--color-gray-50);
}

.vt-nav__dropdown-item:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}

.vt-nav__dropdown-item--danger {
  color: var(--color-error);
}

.vt-nav__dropdown-divider {
  height: 1px;
  margin: var(--space-1) 0;
  background: var(--color-gray-200);
}

/* Hamburger menu (mobile) */
.vt-nav__hamburger {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: none;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.vt-nav__hamburger:hover {
  background-color: var(--color-gray-100);
}

.vt-nav__hamburger:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.vt-nav__hamburger-line {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-gray-700);
  border-radius: var(--radius-full);
  transition: transform var(--transition-base), opacity var(--transition-base);
}

.vt-nav__hamburger-line + .vt-nav__hamburger-line {
  margin-top: 5px;
}

/* Mobile menu state */
.vt-nav__hamburger[aria-expanded="true"] .vt-nav__hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.vt-nav__hamburger[aria-expanded="true"] .vt-nav__hamburger-line:nth-child(2) {
  opacity: 0;
}

.vt-nav__hamburger[aria-expanded="true"] .vt-nav__hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile nav panel */
.vt-nav__mobile-panel {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-surface-primary);
  padding: var(--space-6);
  overflow-y: auto;
  z-index: var(--z-overlay);
  animation: vt-slideDown var(--transition-slow) ease-out;
}

.vt-nav__mobile-panel--open {
  display: block;
}

.vt-nav__mobile-link {
  display: block;
  padding: var(--space-3) var(--space-4);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-medium);
  color: var(--color-gray-700);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: background-color var(--transition-fast);
}

.vt-nav__mobile-link:hover {
  background-color: var(--color-gray-50);
}

.vt-nav__mobile-link--active {
  color: var(--color-primary);
  background-color: var(--color-primary-50);
}

@keyframes vt-slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  .vt-nav__links,
  .vt-nav__search {
    display: none;
  }
  .vt-nav__hamburger {
    display: flex;
  }
}


/* ============================================================================
   2. HERO SECTION
   ============================================================================

   HTML Example:
   <section class="vt-hero">
     <span class="vt-hero__eyebrow">New Feature</span>
     <h1 class="vt-hero__title">
       Healthcare automation,
       <span class="vt-hero__title--gradient">simplified.</span>
     </h1>
     <p class="vt-hero__subtitle">
       Streamline your practice with intelligent billing, scheduling, and compliance.
     </p>
     <div class="vt-hero__actions">
       <a href="/signup" class="vt-btn vt-btn--primary vt-btn--lg">Get Started</a>
       <a href="/demo" class="vt-btn vt-btn--secondary vt-btn--lg">Watch Demo</a>
     </div>
     <div class="vt-hero__illustration">
       <img src="/img/dashboard-preview.png" alt="Dashboard preview">
     </div>
   </section>

   ============================================================================ */

.vt-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-24) var(--space-6) var(--space-20);
  max-width: var(--container-max);
  margin: 0 auto;
}

.vt-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1-5) var(--space-4);
  margin-bottom: var(--space-6);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-primary);
  background: var(--color-primary-light);
  border-radius: var(--radius-full);
  letter-spacing: var(--letter-spacing-wide);
}

.vt-hero__title {
  font-size: var(--font-size-5xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-gray-900);
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-tight);
  max-width: 820px;
  margin-bottom: var(--space-6);
}

.vt-hero__title--gradient {
  background: linear-gradient(135deg, #E87461 0%, var(--color-primary) 50%, #7B4FA2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.vt-hero__subtitle {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-regular);
  color: var(--color-gray-500);
  line-height: var(--line-height-relaxed);
  max-width: 640px;
  margin-bottom: var(--space-10);
}

.vt-hero__actions {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  justify-content: center;
}

.vt-hero__illustration {
  margin-top: var(--space-16);
  max-width: 100%;
}

.vt-hero__illustration img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2xl);
}

@media (max-width: 768px) {
  .vt-hero {
    padding: var(--space-12) var(--space-5) var(--space-12);
  }
  .vt-hero__title {
    font-size: var(--font-size-3xl);
  }
  .vt-hero__subtitle {
    font-size: var(--font-size-md);
  }
  .vt-hero__actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 320px;
  }
}


/* ============================================================================
   3. CARDS (4 variants)
   ============================================================================

   HTML Example — Appointment Card:
   <div class="vt-card vt-card--appointment">
     <div class="vt-card__date">
       <span class="vt-card__date-month">Mar</span>
       <span class="vt-card__date-day">15</span>
     </div>
     <div class="vt-card__body">
       <div class="vt-card__patient">Jane Smith</div>
       <div class="vt-card__service">Botox - Full Face</div>
       <div class="vt-card__time">2:30 PM - 3:15 PM</div>
     </div>
     <span class="vt-badge vt-badge--success"><span class="vt-badge__dot"></span>Confirmed</span>
   </div>

   HTML Example — Provider Card:
   <div class="vt-card vt-card--provider">
     <div class="vt-card__avatar-wrapper">
       <div class="vt-avatar vt-avatar--xl vt-avatar--blue">DR</div>
     </div>
     <div class="vt-card__name">Dr. Rebecca Liu</div>
     <div class="vt-card__npi">NPI: 1234567890</div>
     <div class="vt-card__specialties">
       <span class="vt-badge vt-badge--primary">Dermatology</span>
       <span class="vt-badge vt-badge--gray">Aesthetics</span>
     </div>
   </div>

   HTML Example — Service Card:
   <div class="vt-card vt-card--service">
     <div class="vt-card__icon"><svg>...</svg></div>
     <h3 class="vt-card__title">Superbill Generation</h3>
     <p class="vt-card__description">Automated superbill creation from appointment data.</p>
     <div class="vt-card__price">$49<span class="vt-card__price-unit">/mo</span></div>
   </div>

   HTML Example — Article Card:
   <div class="vt-card vt-card--article">
     <img class="vt-card__thumbnail" src="/img/article.jpg" alt="">
     <div class="vt-card__content">
       <span class="vt-card__category">Compliance</span>
       <h3 class="vt-card__title">HIPAA Best Practices for 2026</h3>
       <p class="vt-card__excerpt">Learn the latest requirements for safeguarding PHI...</p>
       <a class="vt-card__link" href="/blog/hipaa">Read more &rarr;</a>
     </div>
   </div>

   ============================================================================ */

/* Base card */
.vt-card {
  position: relative;
  background: var(--color-surface-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-gray-100);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

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

.vt-card:focus-within {
  box-shadow: var(--shadow-focus);
}

/* Flat card: no hover lift (static information display) */
.vt-card--flat:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
}

/* Clickable card: full-card click target */
.vt-card--clickable {
  cursor: pointer;
}

/* Appointment Card */
.vt-card--appointment {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-4);
  align-items: center;
}

.vt-card--appointment .vt-card__date {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  background: var(--color-primary-light);
  border-radius: var(--radius-lg);
  min-width: 64px;
}

.vt-card--appointment .vt-card__date-month {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
}

.vt-card--appointment .vt-card__date-day {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
  line-height: 1;
}

.vt-card--appointment .vt-card__body {
  min-width: 0;
}

.vt-card--appointment .vt-card__patient {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--color-gray-900);
  margin-bottom: var(--space-0-5);
}

.vt-card--appointment .vt-card__service {
  font-size: var(--font-size-sm);
  color: var(--color-gray-500);
}

.vt-card--appointment .vt-card__time {
  font-size: var(--font-size-xs);
  color: var(--color-gray-400);
  margin-top: var(--space-1);
}

/* Provider Card */
.vt-card--provider {
  text-align: center;
  padding: var(--space-8) var(--space-6);
}

.vt-card--provider .vt-card__avatar-wrapper {
  margin-bottom: var(--space-4);
}

.vt-card--provider .vt-card__name {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-gray-900);
  margin-bottom: var(--space-1);
}

.vt-card--provider .vt-card__npi {
  font-size: var(--font-size-xs);
  font-family: var(--font-family-mono);
  color: var(--color-gray-400);
  margin-bottom: var(--space-3);
}

.vt-card--provider .vt-card__specialties {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
}

/* Service Card */
.vt-card--service {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.vt-card--service .vt-card__icon,
.vt-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--color-primary-light);
  border-radius: var(--radius-lg);
  color: var(--color-primary);
  flex-shrink: 0;
}

/* Icon color variants — use currentColor in SVGs for automatic theming */
.vt-card__icon--secondary {
  background: var(--color-secondary-light);
  color: var(--color-secondary);
}

.vt-card__icon--success {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.vt-card__icon--warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.vt-card__icon--error {
  background: var(--color-error-bg);
  color: var(--color-error);
}

.vt-card--service .vt-card__icon svg,
.vt-card__icon svg {
  width: 24px;
  height: 24px;
}

.vt-card--service .vt-card__title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-gray-900);
}

.vt-card--service .vt-card__description {
  font-size: var(--font-size-base);
  color: var(--color-gray-500);
  line-height: var(--line-height-relaxed);
}

.vt-card--service .vt-card__price {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-gray-900);
  margin-top: auto;
}

.vt-card--service .vt-card__price-unit {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-regular);
  color: var(--color-gray-400);
}

/* Article / Info Card */
.vt-card--article {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.vt-card--article .vt-card__thumbnail {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.vt-card--article .vt-card__content {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.vt-card--article .vt-card__category {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  margin-bottom: var(--space-2);
}

.vt-card--article .vt-card__title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-gray-900);
  margin-bottom: var(--space-2);
  line-height: var(--line-height-tight);
}

.vt-card--article .vt-card__excerpt {
  font-size: var(--font-size-base);
  color: var(--color-gray-500);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-4);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.vt-card--article .vt-card__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary);
  text-decoration: none;
  transition: gap var(--transition-fast);
}

.vt-card--article .vt-card__link:hover {
  gap: var(--space-2);
}

/* Card grid layout helper */
.vt-card-grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

@media (max-width: 768px) {
  .vt-card-grid {
    grid-template-columns: 1fr;
  }
  .vt-card--appointment {
    grid-template-columns: auto 1fr;
  }
  .vt-card--appointment .vt-badge {
    grid-column: 1 / -1;
    justify-self: start;
  }
}


/* ============================================================================
   4. BUTTONS (all variants)
   ============================================================================

   HTML Example — Variants:
   <button class="vt-btn vt-btn--primary vt-btn--md">Save Changes</button>
   <button class="vt-btn vt-btn--secondary vt-btn--md">Cancel</button>
   <button class="vt-btn vt-btn--outline vt-btn--md">Export</button>
   <button class="vt-btn vt-btn--ghost vt-btn--md">Learn More</button>
   <button class="vt-btn vt-btn--danger vt-btn--md">Delete</button>
   <button class="vt-btn vt-btn--primary vt-btn--sm">Small</button>
   <button class="vt-btn vt-btn--primary vt-btn--lg">Large</button>

   HTML Example — Loading State:
   <button class="vt-btn vt-btn--primary vt-btn--md vt-btn--loading" aria-busy="true" disabled>
     Saving...
   </button>

   HTML Example — Icon Button:
   <button class="vt-btn vt-btn--secondary vt-btn--md vt-btn--icon" aria-label="Edit">
     <span class="vt-btn__icon"><svg>...</svg></span>
   </button>

   HTML Example — With Icon:
   <button class="vt-btn vt-btn--primary vt-btn--md">
     <span class="vt-btn__icon"><svg>...</svg></span>
     Add Patient
   </button>

   HTML Example — Button Group:
   <div class="vt-btn-group">
     <button class="vt-btn vt-btn--primary vt-btn--md">Save</button>
     <button class="vt-btn vt-btn--secondary vt-btn--md">Cancel</button>
   </div>

   HTML Example — Pill Shape:
   <button class="vt-btn vt-btn--primary vt-btn--md vt-btn--pill">Sign Up Free</button>

   ============================================================================ */

.vt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  height: 40px;
  padding: 0 var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  user-select: none;
  position: relative;
  overflow: hidden;
}

.vt-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.vt-btn:active {
  transform: scale(0.98);
}

/* Sizes */
.vt-btn--sm {
  height: 32px;
  padding: 0 var(--space-3);
  font-size: var(--font-size-sm);
  border-radius: var(--radius-sm);
}

.vt-btn--md {
  height: 40px;
  padding: 0 var(--space-4);
  font-size: var(--font-size-base);
}

.vt-btn--lg {
  height: 48px;
  padding: 0 var(--space-6);
  font-size: var(--font-size-md);
  border-radius: var(--radius-lg);
}

/* Primary (filled) */
.vt-btn--primary {
  background: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}

.vt-btn--primary:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  color: var(--color-white);
  box-shadow: 0 1px 2px rgba(200, 69, 126, 0.3);
}

.vt-btn--primary:active {
  background: var(--color-primary-active);
  border-color: var(--color-primary-active);
}

/* Secondary (outline) */
.vt-btn--secondary {
  background: var(--color-surface-primary);
  color: var(--color-gray-700);
  border-color: var(--color-gray-300);
}

.vt-btn--secondary:hover {
  background: var(--color-gray-50);
  border-color: var(--color-gray-400);
  color: var(--color-gray-900);
}

.vt-btn--secondary:active {
  background: var(--color-gray-100);
}

/* Tertiary (text-only, ghost) */
.vt-btn--tertiary {
  background: transparent;
  color: var(--color-primary);
  border-color: transparent;
}

.vt-btn--tertiary:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.vt-btn--tertiary:active {
  background: var(--color-primary-100);
}

/* Destructive (red) */
.vt-btn--destructive {
  background: var(--color-destructive);
  color: var(--color-white);
  border-color: var(--color-destructive);
}

.vt-btn--destructive:hover {
  background: var(--color-destructive-hover);
  border-color: var(--color-destructive-hover);
  color: var(--color-white);
}

.vt-btn--destructive:active {
  background: #9E2222;
}

.vt-btn--destructive:focus-visible {
  outline-color: var(--color-error);
}

/* Destructive outline variant */
.vt-btn--destructive-outline {
  background: var(--color-surface-primary);
  color: var(--color-error);
  border-color: var(--color-error-border);
}

.vt-btn--destructive-outline:hover {
  background: var(--color-error-light);
  border-color: var(--color-error);
}

/* Outline variant (alias for secondary — explicit outline naming) */
.vt-btn--outline {
  background: var(--color-surface-primary);
  color: var(--color-gray-700);
  border-color: var(--color-gray-300);
}

.vt-btn--outline:hover {
  background: var(--color-gray-50);
  border-color: var(--color-gray-400);
  color: var(--color-gray-900);
}

.vt-btn--outline:active {
  background: var(--color-gray-100);
}

/* Ghost variant (alias for tertiary — minimal text-only button) */
.vt-btn--ghost {
  background: transparent;
  color: var(--color-primary);
  border-color: transparent;
}

.vt-btn--ghost:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.vt-btn--ghost:active {
  background: var(--color-primary-100);
}

/* Danger variant (alias for destructive) */
.vt-btn--danger {
  background: var(--color-destructive);
  color: var(--color-white);
  border-color: var(--color-destructive);
}

.vt-btn--danger:hover {
  background: var(--color-destructive-hover);
  border-color: var(--color-destructive-hover);
  color: var(--color-white);
}

.vt-btn--danger:active {
  background: #9E2222;
}

.vt-btn--danger:focus-visible {
  outline-color: var(--color-error);
}

/* Danger loading spinner (white on red) */
.vt-btn--danger.vt-btn--loading::after {
  border-color: rgba(255,255,255,0.4);
  border-right-color: transparent;
  border-top-color: var(--color-white);
}

/* Outline loading spinner */
.vt-btn--outline.vt-btn--loading::after,
.vt-btn--ghost.vt-btn--loading::after {
  border-color: rgba(0,0,0,0.15);
  border-right-color: transparent;
  border-top-color: var(--color-gray-600);
}

/* Pill shape */
.vt-btn--pill {
  border-radius: var(--radius-full);
}

/* Icon-only */
.vt-btn--icon {
  padding: 0;
}

.vt-btn--icon.vt-btn--sm {
  width: 32px;
}

.vt-btn--icon.vt-btn--md {
  width: 40px;
}

.vt-btn--icon.vt-btn--lg {
  width: 48px;
}

.vt-btn__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.vt-btn__icon svg {
  width: 100%;
  height: 100%;
}

/* Disabled state */
.vt-btn:disabled,
.vt-btn--disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* Loading state */
.vt-btn--loading {
  color: transparent !important;
  pointer-events: none;
}

.vt-btn--loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: vt-spin 0.6s linear infinite;
}

.vt-btn--primary.vt-btn--loading::after {
  border-color: rgba(255,255,255,0.4);
  border-right-color: transparent;
  border-top-color: var(--color-white);
}

.vt-btn--secondary.vt-btn--loading::after,
.vt-btn--tertiary.vt-btn--loading::after {
  border-color: rgba(0,0,0,0.15);
  border-right-color: transparent;
  border-top-color: var(--color-gray-600);
}

.vt-btn--destructive.vt-btn--loading::after {
  border-color: rgba(255,255,255,0.4);
  border-right-color: transparent;
  border-top-color: var(--color-white);
}

@keyframes vt-spin {
  to { transform: rotate(360deg); }
}

/* Button group */
.vt-btn-group {
  display: inline-flex;
  gap: var(--space-2);
}

.vt-btn-group--attached .vt-btn {
  border-radius: 0;
}

.vt-btn-group--attached .vt-btn:first-child {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.vt-btn-group--attached .vt-btn:last-child {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.vt-btn-group--attached .vt-btn + .vt-btn {
  margin-left: -1px;
}


/* ============================================================================
   5. FORM INPUTS (all types)
   ============================================================================

   HTML Example — Field with Label:
   <div class="vt-field">
     <label class="vt-field__label vt-field__label--required" for="name">Patient Name</label>
     <input class="vt-input" type="text" id="name" placeholder="Enter full name" required>
     <span class="vt-field__hint">As shown on insurance card</span>
   </div>

   HTML Example — Error State:
   <div class="vt-field">
     <label class="vt-field__label" for="email">Email</label>
     <input class="vt-input vt-input--error" type="email" id="email" aria-invalid="true" aria-describedby="email-err">
     <span class="vt-field__error" id="email-err" role="alert">Please enter a valid email</span>
   </div>

   HTML Example — Select:
   <div class="vt-field">
     <label class="vt-field__label" for="state">State</label>
     <select class="vt-select" id="state">
       <option value="">Select a state...</option>
       <option value="CA">California</option>
     </select>
   </div>

   HTML Example — Textarea:
   <div class="vt-field">
     <label class="vt-field__label" for="notes">Clinical Notes</label>
     <textarea class="vt-textarea" id="notes" rows="4" placeholder="Enter notes..."></textarea>
   </div>

   HTML Example — Checkbox:
   <label class="vt-checkbox">
     <input class="vt-checkbox__input" type="checkbox">
     <span class="vt-checkbox__label">I agree to the terms</span>
   </label>

   HTML Example — Radio Group:
   <div class="vt-radio-group" role="radiogroup" aria-label="Gender">
     <label class="vt-radio">
       <input class="vt-radio__input" type="radio" name="gender" value="m">
       <span class="vt-radio__label">Male</span>
     </label>
     <label class="vt-radio">
       <input class="vt-radio__input" type="radio" name="gender" value="f">
       <span class="vt-radio__label">Female</span>
     </label>
   </div>

   HTML Example — Toggle Switch:
   <label class="vt-toggle">
     <input class="vt-toggle__input" type="checkbox" role="switch" aria-checked="false">
     <div class="vt-toggle__track">
       <div class="vt-toggle__thumb"></div>
     </div>
     <span class="vt-toggle__label">Enable notifications</span>
   </label>

   HTML Example — Search with Clear:
   <div class="vt-search">
     <svg class="vt-search__icon">...</svg>
     <input class="vt-input" type="search" placeholder="Search patients...">
     <button class="vt-search__clear" aria-label="Clear search">&times;</button>
   </div>

   HTML Example — Form Row (two columns):
   <form class="vt-form">
     <div class="vt-form-row">
       <div class="vt-field">
         <label class="vt-field__label" for="first">First Name</label>
         <input class="vt-input" id="first" type="text">
       </div>
       <div class="vt-field">
         <label class="vt-field__label" for="last">Last Name</label>
         <input class="vt-input" id="last" type="text">
       </div>
     </div>
   </form>

   ============================================================================ */

/* Form layout */
.vt-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.vt-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}

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

/* Field group */
.vt-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1-5);
}

.vt-field__label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-gray-700);
  line-height: var(--line-height-normal);
}

.vt-field__label--required::after {
  content: ' *';
  color: var(--color-error);
}

.vt-field__hint {
  font-size: var(--font-size-xs);
  color: var(--color-gray-500);
}

.vt-field__error {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--font-size-xs);
  color: var(--color-error);
  font-weight: var(--font-weight-medium);
}

.vt-field__success {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--font-size-xs);
  color: var(--color-success-dark);
  font-weight: var(--font-weight-medium);
}

/* Base input styling */
.vt-input {
  width: 100%;
  height: 40px;
  padding: 0 var(--space-3);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--color-gray-900);
  background: var(--color-surface-primary);
  border: 1px solid var(--color-gray-300);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
}

.vt-input::placeholder {
  color: var(--color-gray-400);
}

.vt-input:hover {
  border-color: var(--color-gray-400);
}

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

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

.vt-input--error:focus {
  box-shadow: var(--shadow-focus-error);
}

.vt-input--success {
  border-color: var(--color-success);
}

.vt-input:disabled {
  background: var(--color-gray-50);
  color: var(--color-gray-400);
  cursor: not-allowed;
}

/* Textarea */
.vt-textarea {
  width: 100%;
  min-height: 100px;
  padding: var(--space-3);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--color-gray-900);
  background: var(--color-surface-primary);
  border: 1px solid var(--color-gray-300);
  border-radius: var(--radius-md);
  resize: vertical;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

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

/* Select / Dropdown */
.vt-select {
  width: 100%;
  height: 40px;
  padding: 0 var(--space-8) 0 var(--space-3);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--color-gray-900);
  background: var(--color-surface-primary);
  border: 1px solid var(--color-gray-300);
  border-radius: var(--radius-md);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23667085' stroke-width='1.67' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right var(--space-3) center;
  background-repeat: no-repeat;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

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

/* Input group (icon + input or input + button) */
.vt-input-group {
  display: flex;
  position: relative;
}

.vt-input-group .vt-input {
  flex: 1;
}

.vt-input-group--icon-left .vt-input {
  padding-left: var(--space-10);
}

.vt-input-group--icon-right .vt-input {
  padding-right: var(--space-10);
}

.vt-input-group__icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--color-gray-400);
  pointer-events: none;
  z-index: 1;
}

.vt-input-group--icon-left .vt-input-group__icon {
  left: var(--space-3);
}

.vt-input-group--icon-right .vt-input-group__icon {
  right: var(--space-3);
}

/* Search input with clear */
.vt-search {
  position: relative;
}

.vt-search .vt-input {
  padding-left: var(--space-10);
  padding-right: var(--space-10);
}

.vt-search__icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--color-gray-400);
  pointer-events: none;
}

.vt-search__clear {
  position: absolute;
  right: var(--space-2);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: var(--color-gray-200);
  border-radius: var(--radius-full);
  color: var(--color-gray-500);
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition-fast);
  font-size: var(--font-size-xs);
  line-height: 1;
}

.vt-search__clear:hover {
  background: var(--color-gray-300);
}

.vt-search--has-value .vt-search__clear {
  opacity: 1;
}

/* Checkbox */
.vt-checkbox {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  user-select: none;
}

.vt-checkbox__input {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--color-primary);
  border-radius: var(--radius-sm);
}

.vt-checkbox__input:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.vt-checkbox__label {
  font-size: var(--font-size-base);
  color: var(--color-gray-700);
}

/* Radio */
.vt-radio {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  user-select: none;
}

.vt-radio__input {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--color-primary);
}

.vt-radio__input:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.vt-radio__label {
  font-size: var(--font-size-base);
  color: var(--color-gray-700);
}

/* Radio group */
.vt-radio-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.vt-radio-group--horizontal {
  flex-direction: row;
  gap: var(--space-6);
}

/* Toggle Switch */
.vt-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  user-select: none;
}

.vt-toggle__track {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--color-gray-300);
  border-radius: var(--radius-full);
  transition: background-color var(--transition-base);
  flex-shrink: 0;
}

.vt-toggle__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.vt-toggle__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: var(--color-surface-primary);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base);
}

.vt-toggle__input:checked + .vt-toggle__track {
  background: var(--color-primary);
}

.vt-toggle__input:checked + .vt-toggle__track .vt-toggle__thumb {
  transform: translateX(20px);
}

.vt-toggle__input:focus-visible + .vt-toggle__track {
  box-shadow: var(--shadow-focus);
}

.vt-toggle__input:disabled + .vt-toggle__track {
  opacity: 0.45;
  cursor: not-allowed;
}

.vt-toggle__label {
  font-size: var(--font-size-base);
  color: var(--color-gray-700);
}

/* Date input */
.vt-input[type="date"] {
  padding-right: var(--space-3);
}


/* ============================================================================
   6. MODALS & DIALOGS
   ============================================================================

   HTML Example — Standard Modal:
   <div class="vt-modal-backdrop" id="modal-edit" aria-hidden="true">
     <div class="vt-modal" role="dialog" aria-modal="true" aria-labelledby="modal-edit-title">
       <div class="vt-modal__header">
         <h2 class="vt-modal__title" id="modal-edit-title">Edit Patient</h2>
         <button class="vt-modal__close" data-vt-modal-close aria-label="Close dialog">
           <svg width="16" height="16">...</svg>
         </button>
       </div>
       <div class="vt-modal__body">
         <p>Modal content goes here.</p>
       </div>
       <div class="vt-modal__footer">
         <button class="vt-btn vt-btn--secondary vt-btn--md" data-vt-modal-close>Cancel</button>
         <button class="vt-btn vt-btn--primary vt-btn--md">Save</button>
       </div>
     </div>
   </div>

   HTML Example — Confirmation Dialog:
   <div class="vt-modal-backdrop" id="modal-confirm" aria-hidden="true">
     <div class="vt-modal vt-modal--sm vt-modal--confirm" role="alertdialog" aria-modal="true">
       <div class="vt-modal__body">
         <div class="vt-modal__confirm-icon vt-modal__confirm-icon--danger"><svg>...</svg></div>
         <h3 class="vt-modal__confirm-title">Delete Patient?</h3>
         <p class="vt-modal__confirm-message">This action cannot be undone.</p>
       </div>
       <div class="vt-modal__footer">
         <button class="vt-btn vt-btn--secondary vt-btn--md" data-vt-modal-close>Cancel</button>
         <button class="vt-btn vt-btn--danger vt-btn--md">Delete</button>
       </div>
     </div>
   </div>

   JS API: VtComponents.openModal('modal-edit'), VtComponents.closeModal('modal-edit')
   Trigger via: <button data-vt-modal-open="modal-edit">Open</button>

   ============================================================================ */

/* Backdrop overlay */
.vt-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: rgba(16, 24, 40, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}

.vt-modal-backdrop--open {
  opacity: 1;
  visibility: visible;
}

/* Modal container */
.vt-modal {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - var(--space-12));
  background: var(--color-surface-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.95) translateY(8px);
  transition: transform var(--transition-slow);
}

.vt-modal-backdrop--open .vt-modal {
  transform: scale(1) translateY(0);
}

.vt-modal--sm {
  max-width: 400px;
}

.vt-modal--lg {
  max-width: 720px;
}

.vt-modal--fullscreen {
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
  border-radius: 0;
}

/* Modal header */
.vt-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-gray-200);
  flex-shrink: 0;
}

.vt-modal__title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-gray-900);
}

.vt-modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--color-gray-400);
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.vt-modal__close:hover {
  background: var(--color-gray-100);
  color: var(--color-gray-600);
}

.vt-modal__close:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}

/* Modal body */
.vt-modal__body {
  padding: var(--space-6);
  overflow-y: auto;
  flex: 1;
}

/* Modal footer / actions */
.vt-modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--color-gray-200);
  flex-shrink: 0;
}

/* Confirmation dialog variant */
.vt-modal--confirm .vt-modal__body {
  text-align: center;
  padding: var(--space-8) var(--space-6);
}

.vt-modal__confirm-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-5);
  border-radius: var(--radius-full);
}

.vt-modal__confirm-icon--warning {
  background: var(--color-warning-light);
  color: var(--color-warning);
}

.vt-modal__confirm-icon--danger {
  background: var(--color-error-light);
  color: var(--color-error);
}

.vt-modal__confirm-icon--success {
  background: var(--color-success-light);
  color: var(--color-success);
}

.vt-modal__confirm-icon--info {
  background: var(--color-info-light);
  color: var(--color-info-dark);
}

.vt-modal__confirm-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-gray-900);
  margin-bottom: var(--space-2);
}

.vt-modal__confirm-message {
  font-size: var(--font-size-base);
  color: var(--color-gray-500);
  line-height: var(--line-height-relaxed);
}

.vt-modal--confirm .vt-modal__footer {
  justify-content: center;
}

@media (max-width: 640px) {
  .vt-modal {
    max-width: none;
    margin: var(--space-4);
    max-height: calc(100vh - var(--space-8));
  }
}


/* ============================================================================
   7. ALERTS & TOASTS
   ============================================================================

   HTML Example — Inline Alert (dismissible):
   <div class="vt-alert vt-alert--success" role="alert">
     <div class="vt-alert__icon">
       <svg width="20" height="20"><path d="M10 18a8 8 0 100-16 8 8 0 000 16z" fill="currentColor" opacity="0.15"/><path d="M7 10l2 2 4-4" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>
     </div>
     <div class="vt-alert__content">
       <div class="vt-alert__title">Patient saved</div>
       <div class="vt-alert__message">Record has been updated successfully.</div>
     </div>
     <button class="vt-alert__dismiss" aria-label="Dismiss">
       <svg width="14" height="14"><path d="M10.5 3.5l-7 7m0-7l7 7" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>
     </button>
   </div>

   Alert variants: vt-alert--info, vt-alert--success, vt-alert--warning, vt-alert--error

   HTML Example — Toast (created via JS):
   <div class="vt-toast-container" role="log" aria-live="polite" aria-label="Notifications">
     <!-- Toasts are inserted here by JS -->
   </div>

   JS API:
   VtComponents.showToast({ type: 'success', title: 'Saved', message: 'Changes saved.', duration: 5000 });
   VtComponents.showToast({ type: 'error', title: 'Error', message: 'Failed to save.' });

   ============================================================================ */

/* Inline Alerts */
.vt-alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid;
}

.vt-alert__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.vt-alert__icon svg {
  width: 20px;
  height: 20px;
}

.vt-alert__content {
  flex: 1;
  min-width: 0;
}

.vt-alert__title {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-1);
}

.vt-alert__message {
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed);
}

.vt-alert__action {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  margin-top: var(--space-2);
}

.vt-alert__dismiss {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity var(--transition-fast);
}

.vt-alert__dismiss:hover {
  opacity: 1;
}

/* Alert variants */
.vt-alert--info {
  background: var(--color-info-light);
  border-color: var(--color-info-border);
  color: var(--color-info-dark);
}

.vt-alert--info .vt-alert__icon {
  color: var(--color-primary);
}

.vt-alert--success {
  background: var(--color-success-light);
  border-color: var(--color-success-border);
  color: var(--color-success-dark);
}

.vt-alert--success .vt-alert__icon {
  color: var(--color-success);
}

.vt-alert--warning {
  background: var(--color-warning-light);
  border-color: var(--color-warning-border);
  color: var(--color-warning-dark);
}

.vt-alert--warning .vt-alert__icon {
  color: var(--color-warning);
}

.vt-alert--error {
  background: var(--color-error-light);
  border-color: var(--color-error-border);
  color: var(--color-error-dark);
}

.vt-alert--error .vt-alert__icon {
  color: var(--color-error);
}

/* Toast Notifications */
.vt-toast-container {
  position: fixed;
  top: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
  max-width: 420px;
  width: 100%;
}

.vt-toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--color-surface-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--color-gray-200);
  pointer-events: auto;
  animation: vt-toastIn 0.3s ease-out forwards;
  overflow: hidden;
  position: relative;
}

.vt-toast--exiting {
  animation: vt-toastOut 0.2s ease-in forwards;
}

.vt-toast__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.vt-toast__content {
  flex: 1;
  min-width: 0;
}

.vt-toast__title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-gray-900);
  margin-bottom: var(--space-0-5);
}

.vt-toast__message {
  font-size: var(--font-size-sm);
  color: var(--color-gray-500);
  line-height: var(--line-height-relaxed);
}

.vt-toast__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--color-gray-400);
  cursor: pointer;
  flex-shrink: 0;
  transition: color var(--transition-fast);
}

.vt-toast__close:hover {
  color: var(--color-gray-600);
}

/* Toast countdown bar */
.vt-toast__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  animation: vt-toastProgress linear forwards;
}

/* Toast color variants */
.vt-toast--success .vt-toast__icon { color: var(--color-success); }
.vt-toast--success .vt-toast__progress { background: var(--color-success); }

.vt-toast--error .vt-toast__icon { color: var(--color-error); }
.vt-toast--error .vt-toast__progress { background: var(--color-error); }

.vt-toast--warning .vt-toast__icon { color: var(--color-warning); }
.vt-toast--warning .vt-toast__progress { background: var(--color-warning); }

.vt-toast--info .vt-toast__icon { color: var(--color-primary); }
.vt-toast--info .vt-toast__progress { background: var(--color-primary); }

@keyframes vt-toastIn {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes vt-toastOut {
  from { opacity: 1; transform: translateX(0); max-height: 200px; margin-bottom: var(--space-3); }
  to   { opacity: 0; transform: translateX(100%); max-height: 0; margin-bottom: 0; padding: 0; }
}

@keyframes vt-toastProgress {
  from { width: 100%; }
  to   { width: 0%; }
}

@media (max-width: 640px) {
  .vt-toast-container {
    top: var(--space-4);
    right: var(--space-4);
    left: var(--space-4);
    max-width: none;
  }
}


/* ============================================================================
   8. TABS & ACCORDIONS
   ============================================================================

   HTML Example — Tabs:
   <div class="vt-tabs">
     <div class="vt-tabs__list" role="tablist" aria-label="Patient sections">
       <button class="vt-tabs__tab" role="tab" aria-selected="true" aria-controls="panel-overview" id="tab-overview">
         Overview
       </button>
       <button class="vt-tabs__tab" role="tab" aria-selected="false" aria-controls="panel-billing" id="tab-billing" tabindex="-1">
         Billing
         <span class="vt-tabs__tab-badge">3</span>
       </button>
       <button class="vt-tabs__tab" role="tab" aria-selected="false" aria-controls="panel-history" id="tab-history" tabindex="-1">
         History
       </button>
       <div class="vt-tabs__indicator"></div>
     </div>
     <div class="vt-tabs__panel" role="tabpanel" id="panel-overview" aria-labelledby="tab-overview">
       <p>Overview content here.</p>
     </div>
     <div class="vt-tabs__panel" role="tabpanel" id="panel-billing" aria-labelledby="tab-billing" hidden>
       <p>Billing content here.</p>
     </div>
     <div class="vt-tabs__panel" role="tabpanel" id="panel-history" aria-labelledby="tab-history" hidden>
       <p>History content here.</p>
     </div>
   </div>

   HTML Example — Accordion:
   <div class="vt-accordion" data-vt-single-open>
     <div class="vt-accordion__item">
       <button class="vt-accordion__trigger" aria-expanded="false" aria-controls="acc-content-1">
         What insurance do you accept?
         <svg class="vt-accordion__chevron" width="16" height="16" viewBox="0 0 16 16"><path d="M4 6l4 4 4-4" stroke="currentColor" stroke-width="1.5" fill="none"/></svg>
       </button>
       <div class="vt-accordion__content" id="acc-content-1">
         <div class="vt-accordion__body">We accept all major insurance providers.</div>
       </div>
     </div>
     <div class="vt-accordion__item">
       <button class="vt-accordion__trigger" aria-expanded="false" aria-controls="acc-content-2">
         How do I schedule an appointment?
         <svg class="vt-accordion__chevron" width="16" height="16" viewBox="0 0 16 16"><path d="M4 6l4 4 4-4" stroke="currentColor" stroke-width="1.5" fill="none"/></svg>
       </button>
       <div class="vt-accordion__content" id="acc-content-2">
         <div class="vt-accordion__body">You can schedule online or by phone.</div>
       </div>
     </div>
   </div>

   ============================================================================ */

/* Tabs */
.vt-tabs {
  width: 100%;
}

.vt-tabs__list {
  display: flex;
  position: relative;
  border-bottom: 1px solid var(--color-gray-200);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  list-style: none;
}

.vt-tabs__list::-webkit-scrollbar {
  display: none;
}

.vt-tabs__list[role="tablist"] {
  gap: 0;
}

.vt-tabs__tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  color: var(--color-gray-500);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--transition-fast), border-color var(--transition-fast);
  font-family: var(--font-family);
}

.vt-tabs__tab:hover {
  color: var(--color-gray-700);
}

.vt-tabs__tab:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}

.vt-tabs__tab[aria-selected="true"],
.vt-tabs__tab--active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: var(--font-weight-semibold);
}

.vt-tabs__tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 var(--space-1-5);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  background: var(--color-gray-200);
  color: var(--color-gray-600);
  border-radius: var(--radius-full);
}

.vt-tabs__tab[aria-selected="true"] .vt-tabs__tab-badge {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

/* Animated underline indicator */
.vt-tabs__indicator {
  position: absolute;
  bottom: -1px;
  height: 2px;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  transition: left var(--transition-slow), width var(--transition-slow);
}

/* Tab panels */
.vt-tabs__panel {
  padding: var(--space-6) 0;
  animation: vt-fadeIn 0.2s ease-out;
}

.vt-tabs__panel[hidden] {
  display: none;
}

@keyframes vt-fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Accordion */
.vt-accordion {
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.vt-accordion__item {
  border-bottom: 1px solid var(--color-gray-200);
}

.vt-accordion__item:last-child {
  border-bottom: none;
}

.vt-accordion__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-4) var(--space-5);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  color: var(--color-gray-900);
  background: var(--color-surface-primary);
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background-color var(--transition-fast);
}

.vt-accordion__trigger:hover {
  background: var(--color-gray-25);
}

.vt-accordion__trigger:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}

.vt-accordion__chevron {
  width: 16px;
  height: 16px;
  color: var(--color-gray-400);
  transition: transform var(--transition-base);
  flex-shrink: 0;
}

.vt-accordion__trigger[aria-expanded="true"] .vt-accordion__chevron {
  transform: rotate(180deg);
}

.vt-accordion__content {
  overflow: hidden;
  max-height: 0;
  transition: max-height var(--transition-slow) ease-in-out;
}

.vt-accordion__content--open {
  /* max-height is set via JS to the scrollHeight */
}

.vt-accordion__body {
  padding: 0 var(--space-5) var(--space-5);
  font-size: var(--font-size-base);
  color: var(--color-gray-600);
  line-height: var(--line-height-relaxed);
}


/* ============================================================================
   9. TABLES
   ============================================================================

   HTML Example — Sortable Table with Responsive Collapse:
   <div class="vt-table-wrapper">
     <table class="vt-table vt-table--responsive">
       <thead>
         <tr>
           <th class="vt-table__sortable" aria-sort="none">
             Patient <span class="vt-table__sort-icon"><svg>...</svg></span>
           </th>
           <th class="vt-table__sortable" aria-sort="ascending">
             Date <span class="vt-table__sort-icon"><svg>...</svg></span>
           </th>
           <th>Service</th>
           <th>Status</th>
           <th>Amount</th>
         </tr>
       </thead>
       <tbody>
         <tr>
           <td data-label="Patient">Jane Smith</td>
           <td data-label="Date" data-sort-value="2026-03-15">Mar 15, 2026</td>
           <td data-label="Service">Botox</td>
           <td data-label="Status"><span class="vt-badge vt-badge--success">Paid</span></td>
           <td data-label="Amount">$450.00</td>
         </tr>
       </tbody>
     </table>
     <div class="vt-pagination">
       <span class="vt-pagination__info">Showing 1-10 of 42 results</span>
       <div class="vt-pagination__controls">
         <button class="vt-pagination__btn" disabled>&laquo;</button>
         <button class="vt-pagination__btn vt-pagination__btn--active">1</button>
         <button class="vt-pagination__btn">2</button>
         <span class="vt-pagination__ellipsis">...</span>
         <button class="vt-pagination__btn">5</button>
         <button class="vt-pagination__btn">&raquo;</button>
       </div>
     </div>
   </div>

   HTML Example — Empty State:
   <div class="vt-table__empty">
     <div class="vt-table__empty-icon"><svg>...</svg></div>
     <div class="vt-table__empty-title">No patients found</div>
     <div class="vt-table__empty-message">Try adjusting your search filters.</div>
   </div>

   ============================================================================ */

.vt-table-wrapper {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  background: var(--color-surface-primary);
}

.vt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-base);
}

.vt-table th {
  padding: var(--space-3) var(--space-4);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-gray-500);
  text-align: left;
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  background: var(--color-gray-50);
  border-bottom: 1px solid var(--color-gray-200);
  white-space: nowrap;
  user-select: none;
}

.vt-table td {
  padding: var(--space-3) var(--space-4);
  color: var(--color-gray-700);
  border-bottom: 1px solid var(--color-gray-100);
  vertical-align: middle;
}

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

.vt-table tbody tr:hover {
  background-color: var(--color-gray-25);
}

/* Striped rows */
.vt-table--striped tbody tr:nth-child(even) {
  background-color: var(--color-gray-25);
}

.vt-table--striped tbody tr:nth-child(even):hover {
  background-color: var(--color-gray-50);
}

/* Compact density (for workspace/data-entry screens) */
.vt-table--compact th,
.vt-table--compact td {
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-size-sm);
}

/* Sortable columns */
.vt-table__sortable {
  cursor: pointer;
  transition: color var(--transition-fast);
}

.vt-table__sortable:hover {
  color: var(--color-gray-700);
}

.vt-table__sort-icon {
  display: inline-flex;
  margin-left: var(--space-1);
  opacity: 0.3;
  transition: opacity var(--transition-fast);
}

.vt-table__sortable:hover .vt-table__sort-icon {
  opacity: 0.6;
}

.vt-table__sortable--asc .vt-table__sort-icon,
.vt-table__sortable--desc .vt-table__sort-icon {
  opacity: 1;
  color: var(--color-primary);
}

.vt-table__sortable--desc .vt-table__sort-icon {
  transform: rotate(180deg);
}

/* Pagination */
.vt-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--color-gray-200);
  font-size: var(--font-size-sm);
  color: var(--color-gray-500);
}

.vt-pagination__info {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.vt-pagination__controls {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.vt-pagination__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 var(--space-2);
  font-size: var(--font-size-sm);
  font-family: var(--font-family);
  font-weight: var(--font-weight-medium);
  color: var(--color-gray-700);
  background: var(--color-surface-primary);
  border: 1px solid var(--color-gray-300);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.vt-pagination__btn:hover {
  background: var(--color-gray-50);
  border-color: var(--color-gray-400);
}

.vt-pagination__btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.vt-pagination__btn--active {
  background: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}

.vt-pagination__btn--active:hover {
  background: var(--color-primary-hover);
}

.vt-pagination__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.vt-pagination__ellipsis {
  padding: 0 var(--space-1);
  color: var(--color-gray-400);
}

/* Empty state */
.vt-table__empty {
  text-align: center;
  padding: var(--space-12) var(--space-6);
}

.vt-table__empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-4);
  background: var(--color-gray-100);
  border-radius: var(--radius-full);
  color: var(--color-gray-400);
}

.vt-table__empty-title {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  color: var(--color-gray-900);
  margin-bottom: var(--space-1);
}

.vt-table__empty-message {
  font-size: var(--font-size-sm);
  color: var(--color-gray-500);
}

/* Responsive: collapse to stacked cards */
@media (max-width: 768px) {
  .vt-table--responsive thead {
    display: none;
  }

  .vt-table--responsive tbody tr {
    display: block;
    padding: var(--space-4);
    border-bottom: 1px solid var(--color-gray-200);
  }

  .vt-table--responsive tbody tr:last-child {
    border-bottom: none;
  }

  .vt-table--responsive td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-2) 0;
    border-bottom: none;
  }

  .vt-table--responsive td::before {
    content: attr(data-label);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--color-gray-500);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wide);
    flex-shrink: 0;
    margin-right: var(--space-4);
  }

  .vt-pagination {
    flex-direction: column;
    gap: var(--space-3);
  }
}


/* ============================================================================
   10. AVATARS & BADGES
   ============================================================================

   HTML Example — Avatar with Image:
   <div class="vt-avatar vt-avatar--md">
     <img src="/photos/dr-liu.jpg" alt="Dr. Liu">
   </div>

   HTML Example — Avatar with Initials + Status Dot:
   <div class="vt-avatar vt-avatar--lg vt-avatar--blue">
     RL
     <span class="vt-avatar__status vt-avatar__status--online"></span>
   </div>

   Sizes: vt-avatar--xs (24px), --sm (32px), --md (40px), --lg (56px), --xl (72px)
   Colors: vt-avatar--blue, --green, --purple, --amber, --rose, --cyan

   HTML Example — Avatar Group:
   <div class="vt-avatar-group">
     <div class="vt-avatar vt-avatar--sm vt-avatar--blue">AB</div>
     <div class="vt-avatar vt-avatar--sm vt-avatar--green">CD</div>
     <div class="vt-avatar vt-avatar--sm vt-avatar--purple">+3</div>
   </div>

   HTML Example — Text Badge:
   <span class="vt-badge vt-badge--success"><span class="vt-badge__dot"></span>Active</span>
   <span class="vt-badge vt-badge--warning">Pending</span>
   <span class="vt-badge vt-badge--error">Overdue</span>
   <span class="vt-badge vt-badge--info">Draft</span>
   <span class="vt-badge vt-badge--gray">Archived</span>

   HTML Example — Count Badge (notification dot on icon):
   <div style="position:relative; display:inline-block;">
     <svg class="vtk-icon">...</svg>
     <span class="vt-badge-count">5</span>
   </div>

   HTML Example — Dot-only Badge:
   <div style="position:relative; display:inline-block;">
     <svg class="vtk-icon">...</svg>
     <span class="vt-badge-count vt-badge-count--dot"></span>
   </div>

   ============================================================================ */

/* Avatars */
.vt-avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  background: var(--color-gray-200);
  color: var(--color-gray-600);
  font-weight: var(--font-weight-semibold);
  user-select: none;
}

.vt-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

/* Avatar sizes */
.vt-avatar--xs {
  width: 24px;
  height: 24px;
  font-size: var(--font-size-xs);
}

.vt-avatar--sm {
  width: 32px;
  height: 32px;
  font-size: var(--font-size-xs);
}

.vt-avatar--md {
  width: 40px;
  height: 40px;
  font-size: var(--font-size-sm);
}

.vt-avatar--lg {
  width: 56px;
  height: 56px;
  font-size: var(--font-size-lg);
}

.vt-avatar--xl {
  width: 72px;
  height: 72px;
  font-size: var(--font-size-xl);
}

/* Fallback initials — color variants (assign via JS or server) */
.vt-avatar--blue    { background: var(--color-primary-100); color: var(--color-primary-700); }
.vt-avatar--green   { background: #d1fae5; color: #065f46; }
.vt-avatar--purple  { background: #ede9fe; color: #5b21b6; }
.vt-avatar--amber   { background: #fef3c7; color: #92400e; }
.vt-avatar--rose    { background: #ffe4e6; color: #9f1239; }
.vt-avatar--cyan    { background: #cffafe; color: #155e75; }

/* Status dot */
.vt-avatar__status {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-white);
}

.vt-avatar--sm .vt-avatar__status {
  width: 8px;
  height: 8px;
}

.vt-avatar--lg .vt-avatar__status,
.vt-avatar--xl .vt-avatar__status {
  width: 14px;
  height: 14px;
  border-width: 3px;
}

.vt-avatar__status--online  { background: var(--color-success); }
.vt-avatar__status--away    { background: var(--color-warning); }
.vt-avatar__status--busy    { background: var(--color-error); }
.vt-avatar__status--offline { background: var(--color-gray-400); }

/* Avatar group */
.vt-avatar-group {
  display: flex;
}

.vt-avatar-group .vt-avatar {
  border: 2px solid var(--color-white);
  margin-left: -8px;
}

.vt-avatar-group .vt-avatar:first-child {
  margin-left: 0;
}

/* Notification count badge (on avatars or icons) */
.vt-count-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: var(--font-weight-bold);
  color: var(--color-white);
  background: var(--color-error);
  border-radius: var(--radius-full);
  border: 2px solid var(--color-white);
  line-height: 1;
}

.vt-count-badge--dot {
  min-width: 8px;
  height: 8px;
  padding: 0;
}

/* Alias: vt-badge-count (alternate naming convention) */
.vt-badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: var(--font-weight-bold);
  color: var(--color-white);
  background: var(--color-error);
  border-radius: var(--radius-full);
  border: 2px solid var(--color-white);
  line-height: 1;
}

.vt-badge-count--dot {
  min-width: 8px;
  height: 8px;
  padding: 0;
}

/* Text Badges / Tags */
.vt-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-0-5) var(--space-2-5);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  border-radius: var(--radius-full);
  white-space: nowrap;
  line-height: 1.5;
}

/* Badge variants */
.vt-badge--gray {
  background: var(--color-gray-100);
  color: var(--color-gray-700);
}

.vt-badge--primary {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.vt-badge--success {
  background: var(--color-success-light);
  color: var(--color-success-dark);
}

.vt-badge--warning {
  background: var(--color-warning-light);
  color: var(--color-warning-dark);
}

.vt-badge--error {
  background: var(--color-error-light);
  color: var(--color-error-dark);
}

.vt-badge--info {
  background: var(--color-info-light);
  color: var(--color-info-dark);
}

/* Badge with dot indicator */
.vt-badge__dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.vt-badge--success .vt-badge__dot { background: var(--color-success); }
.vt-badge--warning .vt-badge__dot { background: var(--color-warning); }
.vt-badge--error .vt-badge__dot   { background: var(--color-error); }
.vt-badge--primary .vt-badge__dot { background: var(--color-primary); }
.vt-badge--gray .vt-badge__dot    { background: var(--color-gray-400); }


/* ============================================================================
   11. PROGRESS & LOADING
   ============================================================================

   HTML Example — Skeleton Loader (shimmer):
   <div class="vt-skeleton vt-skeleton--heading"></div>
   <div class="vt-skeleton vt-skeleton--text" style="margin-bottom:8px"></div>
   <div class="vt-skeleton vt-skeleton--text-sm"></div>

   HTML Example — Skeleton Avatar:
   <div class="vt-skeleton vt-skeleton--avatar vt-avatar--lg"></div>

   HTML Example — Skeleton Table Row:
   <div class="vt-skeleton--table-row">
     <div class="vt-skeleton vt-skeleton--table-cell"></div>
     <div class="vt-skeleton vt-skeleton--table-cell"></div>
     <div class="vt-skeleton vt-skeleton--table-cell"></div>
     <div class="vt-skeleton vt-skeleton--table-cell"></div>
   </div>

   HTML Example — Progress Bar (determinate):
   <div class="vt-progress-labeled">
     <div class="vt-progress-labeled__header">
       <span class="vt-progress-labeled__label">Uploading...</span>
       <span class="vt-progress-labeled__value">65%</span>
     </div>
     <div class="vt-progress">
       <div class="vt-progress__bar" style="width: 65%" role="progressbar" aria-valuenow="65" aria-valuemin="0" aria-valuemax="100"></div>
     </div>
   </div>

   HTML Example — Progress Bar (indeterminate):
   <div class="vt-progress vt-progress--indeterminate" role="progressbar" aria-label="Loading">
     <div class="vt-progress__bar"></div>
   </div>

   HTML Example — Spinner:
   <div class="vt-spinner vt-spinner--md" role="status" aria-label="Loading">
     <span class="vt-sr-only">Loading...</span>
   </div>

   Spinner sizes: vt-spinner--sm (16px), --md (24px), --lg (40px)
   Spinner on dark: vt-spinner--white

   HTML Example — Full-page Loading Overlay:
   <div class="vt-loading-overlay">
     <div class="vt-spinner vt-spinner--lg"></div>
     <span class="vt-loading-overlay__text">Loading patient data...</span>
   </div>

   ============================================================================ */

/* Skeleton Loader (Apple-style shimmer) */
.vt-skeleton {
  position: relative;
  overflow: hidden;
  background: var(--color-gray-100);
  border-radius: var(--radius-md);
}

.vt-skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.5) 50%,
    transparent 100%
  );
  animation: vt-shimmer 1.8s ease-in-out infinite;
}

.vt-skeleton--text {
  height: 14px;
  width: 100%;
}

.vt-skeleton--text-sm {
  height: 12px;
  width: 60%;
}

.vt-skeleton--heading {
  height: 24px;
  width: 40%;
  margin-bottom: var(--space-3);
}

.vt-skeleton--avatar {
  border-radius: var(--radius-full);
}

.vt-skeleton--avatar.vt-avatar--sm { width: 32px; height: 32px; }
.vt-skeleton--avatar.vt-avatar--md { width: 40px; height: 40px; }
.vt-skeleton--avatar.vt-avatar--lg { width: 56px; height: 56px; }

.vt-skeleton--rect {
  height: 200px;
  border-radius: var(--radius-lg);
}

.vt-skeleton--card {
  padding: var(--space-6);
  border-radius: var(--radius-xl);
  min-height: 180px;
}

/* Skeleton table row */
.vt-skeleton--table-row {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr 1fr;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-gray-100);
}

.vt-skeleton--table-cell {
  height: 14px;
  border-radius: var(--radius-sm);
}

@keyframes vt-shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Linear Progress Bar */
.vt-progress {
  width: 100%;
  height: 6px;
  background: var(--color-gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.vt-progress--sm {
  height: 4px;
}

.vt-progress--lg {
  height: 10px;
}

.vt-progress__bar {
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

.vt-progress__bar--success {
  background: var(--color-success);
}

.vt-progress__bar--warning {
  background: var(--color-warning);
}

.vt-progress__bar--error {
  background: var(--color-error);
}

/* Indeterminate progress */
.vt-progress--indeterminate .vt-progress__bar {
  width: 40%;
  animation: vt-indeterminate 1.5s ease-in-out infinite;
}

@keyframes vt-indeterminate {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

/* Labeled progress */
.vt-progress-labeled {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.vt-progress-labeled__header {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-size-sm);
}

.vt-progress-labeled__label {
  font-weight: var(--font-weight-medium);
  color: var(--color-gray-700);
}

.vt-progress-labeled__value {
  font-weight: var(--font-weight-semibold);
  color: var(--color-gray-900);
}

/* Circular Spinner */
.vt-spinner {
  display: inline-block;
  border: 2px solid var(--color-gray-200);
  border-top-color: var(--color-primary);
  border-radius: var(--radius-full);
  animation: vt-spin 0.7s linear infinite;
}

.vt-spinner--sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

.vt-spinner--md {
  width: 24px;
  height: 24px;
  border-width: 2.5px;
}

.vt-spinner--lg {
  width: 40px;
  height: 40px;
  border-width: 3px;
}

.vt-spinner--white {
  border-color: rgba(255, 255, 255, 0.3);
  border-top-color: var(--color-white);
}

/* Full-page loading overlay */
.vt-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.vt-loading-overlay__text {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-medium);
  color: var(--color-gray-600);
}


/* ============================================================================
   12. FOOTER
   ============================================================================

   HTML Example:
   <footer class="vt-footer">
     <div class="vt-footer__container">
       <div class="vt-footer__grid">
         <div class="vt-footer__brand">
           <img class="vt-footer__brand-logo" src="/logo.svg" alt="Vitalitek">
           <p class="vt-footer__brand-description">
             Healthcare automation platform for modern practices.
           </p>
           <div class="vt-footer__social">
             <a class="vt-footer__social-link" href="#" aria-label="Twitter"><svg>...</svg></a>
             <a class="vt-footer__social-link" href="#" aria-label="LinkedIn"><svg>...</svg></a>
           </div>
         </div>
         <div>
           <h3 class="vt-footer__column-title">Product</h3>
           <ul class="vt-footer__links">
             <li><a class="vt-footer__link" href="/features">Features</a></li>
             <li><a class="vt-footer__link" href="/pricing">Pricing</a></li>
             <li><a class="vt-footer__link" href="/integrations">Integrations</a></li>
           </ul>
         </div>
         <div>
           <h3 class="vt-footer__column-title">Company</h3>
           <ul class="vt-footer__links">
             <li><a class="vt-footer__link" href="/about">About</a></li>
             <li><a class="vt-footer__link" href="/careers">Careers</a></li>
             <li><a class="vt-footer__link" href="/contact">Contact</a></li>
           </ul>
         </div>
         <div>
           <h3 class="vt-footer__column-title">Legal</h3>
           <ul class="vt-footer__links">
             <li><a class="vt-footer__link" href="/privacy">Privacy Policy</a></li>
             <li><a class="vt-footer__link" href="/terms">Terms of Service</a></li>
             <li><a class="vt-footer__link" href="/hipaa">HIPAA Compliance</a></li>
           </ul>
         </div>
       </div>
       <div class="vt-footer__bottom">
         <span class="vt-footer__copyright">&copy; 2026 Vitalitek. All rights reserved.</span>
         <div class="vt-footer__legal">
           <a class="vt-footer__legal-link" href="/privacy">Privacy</a>
           <a class="vt-footer__legal-link" href="/terms">Terms</a>
         </div>
       </div>
     </div>
   </footer>

   ============================================================================ */

.vt-footer {
  background: var(--color-surface-tertiary);
  color: var(--color-text-secondary);
  padding: var(--space-16) var(--space-6) var(--space-8);
}

.vt-footer__container {
  max-width: var(--container-xl);
  margin: 0 auto;
}

.vt-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-12);
  margin-bottom: var(--space-12);
}

.vt-footer__brand {
  max-width: 320px;
}

.vt-footer__brand-logo {
  height: 28px;
  width: auto;
  margin-bottom: var(--space-4);
}

.vt-footer__brand-logo--light {
  mix-blend-mode: multiply;
}

.vt-footer__brand-logo--dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .vt-footer__brand-logo--light { display: none; }
  :root:not([data-theme="light"]) .vt-footer__brand-logo--dark { display: block; }
}

[data-theme="dark"] .vt-footer__brand-logo--light { display: none; }
[data-theme="dark"] .vt-footer__brand-logo--dark { display: block; }

.vt-footer__brand-description {
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-tertiary);
}

.vt-footer__column-title {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  margin-bottom: var(--space-4);
}

.vt-footer__links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.vt-footer__link {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.vt-footer__link:hover {
  color: var(--color-text-primary);
}

.vt-footer__link:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Social icons */
.vt-footer__social {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.vt-footer__social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  color: var(--color-text-tertiary);
  background: var(--color-surface-secondary);
  transition: background-color var(--transition-fast), color var(--transition-fast);
  text-decoration: none;
}

.vt-footer__social-link:hover {
  background: var(--color-border-subtle);
  color: var(--color-text-primary);
}

.vt-footer__social-link:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.vt-footer__social-link svg {
  width: 18px;
  height: 18px;
}

/* Footer bottom / legal */
.vt-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-8);
  border-top: 1px solid var(--color-border-subtle);
}

.vt-footer__copyright {
  font-size: var(--font-size-sm);
  color: var(--color-text-tertiary);
}

.vt-footer__legal {
  display: flex;
  gap: var(--space-6);
}

.vt-footer__legal-link {
  font-size: var(--font-size-sm);
  color: var(--color-text-tertiary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.vt-footer__legal-link:hover {
  color: var(--color-text-secondary);
}

@media (max-width: 768px) {
  .vt-footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }

  .vt-footer__brand {
    grid-column: 1 / -1;
    max-width: none;
  }

  .vt-footer__bottom {
    flex-direction: column;
    gap: var(--space-4);
    text-align: center;
  }

  .vt-footer__legal {
    flex-wrap: wrap;
    justify-content: center;
  }
}

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


/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

/* Screen reader only */
.vt-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus visible utility */
.vt-focus-ring:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Container */
.vt-container {
  width: 100%;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* Section spacing */
.vt-section {
  padding: var(--space-20) 0;
}

/* Divider */
.vt-divider {
  height: 1px;
  background: var(--color-gray-200);
  border: none;
  margin: var(--space-6) 0;
}

/* Text utilities */
.vt-text-muted {
  color: var(--color-gray-500);
}

.vt-text-primary {
  color: var(--color-primary);
}

/* Truncate */
.vt-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
