/* RanjuUI - Base & Reset */
:root {
  --bg: #ffffff;
  --fg: #09090b;
  --primary: #2563eb;
  --primary-fg: #ffffff;
  --primary-hover: #1d4ed8;
  --secondary: #f4f4f5;
  --secondary-fg: #18181b;
  --secondary-hover: #e4e4e7;
  --muted: #f4f4f5;
  --muted-fg: #71717a;
  --accent: #f0f4ff;
  --accent-fg: #2563eb;
  --destructive: #ef4444;
  --destructive-fg: #ffffff;
  --destructive-hover: #dc2626;
  --warning: #f59e0b;
  --warning-fg: #ffffff;
  --success: #10b981;
  --success-fg: #ffffff;
  --info: #3b82f6;
  --info-fg: #ffffff;
  --border: #e4e4e7;
  --input: #e4e4e7;
  --ring: #2563eb;
  --radius: 0.5rem;
  --radius-sm: 0.375rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
  --shadow-xl: 0 20px 25px rgba(0,0,0,.1), 0 8px 10px rgba(0,0,0,.04);
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace;
  --transition: 150ms cubic-bezier(.4,0,.2,1);
  --transition-slow: 300ms cubic-bezier(.4,0,.2,1);
  --overlay: rgba(0,0,0,.5);
  --scrollbar: #d4d4d8;
  --scrollbar-hover: #a1a1aa;
  --skeleton-from: #e4e4e7;
  --skeleton-to: #f4f4f5;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #09090b;
  --fg: #fafafa;
  --primary: #3b82f6;
  --primary-fg: #ffffff;
  --primary-hover: #60a5fa;
  --secondary: #27272a;
  --secondary-fg: #fafafa;
  --secondary-hover: #3f3f46;
  --muted: #27272a;
  --muted-fg: #a1a1aa;
  --accent: #1e293b;
  --accent-fg: #60a5fa;
  --destructive: #dc2626;
  --destructive-fg: #fafafa;
  --destructive-hover: #ef4444;
  --warning: #d97706;
  --warning-fg: #ffffff;
  --success: #059669;
  --success-fg: #ffffff;
  --info: #2563eb;
  --info-fg: #ffffff;
  --border: #27272a;
  --input: #27272a;
  --ring: #3b82f6;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow: 0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
  --shadow-md: 0 4px 6px rgba(0,0,0,.4), 0 2px 4px rgba(0,0,0,.3);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.5), 0 4px 6px rgba(0,0,0,.3);
  --shadow-xl: 0 20px 25px rgba(0,0,0,.5), 0 8px 10px rgba(0,0,0,.3);
  --overlay: rgba(0,0,0,.7);
  --scrollbar: #3f3f46;
  --scrollbar-hover: #52525b;
  --skeleton-from: #27272a;
  --skeleton-to: #3f3f46;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 4; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg, video, canvas, audio, iframe, embed, object { display: block; max-width: 100%; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-hover); text-decoration: underline; }
hr { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }
::selection { background: var(--primary); color: var(--primary-fg); }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: var(--radius-sm); }
[hidden] { display: none !important; }

h1, h2, h3, h4, h5, h6 { font-weight: 600; line-height: 1.25; color: var(--fg); letter-spacing: -0.02em; }
h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-muted { color: var(--muted-fg); }
.text-primary { color: var(--primary); }
.text-destructive { color: var(--destructive); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-mono { font-family: var(--font-mono); }
.leading-tight { line-height: 1.25; }
.leading-relaxed { line-height: 1.75; }
.tracking-tight { letter-spacing: -0.02em; }
p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }
code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--muted);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
  color: var(--accent-fg);
}
pre {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  background: var(--muted);
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  border: 1px solid var(--border);
  line-height: 1.7;
}
pre code { background: none; padding: 0; font-size: inherit; color: inherit; }
blockquote {
  border-left: 3px solid var(--primary);
  padding: 0.5rem 1rem;
  color: var(--muted-fg);
  font-style: italic;
  margin: 1rem 0;
}
mark { background: #fef08a; color: #000; padding: 0.1em 0.3em; border-radius: 2px; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.container-sm { max-width: 640px; }
.container-md { max-width: 768px; }
.container-lg { max-width: 1024px; }
.container-xl { max-width: 1280px; }
.grid { display: grid; gap: 1rem; }
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-6 { grid-template-columns: repeat(6, 1fr); }
.grid-cols-12 { grid-template-columns: repeat(12, 1fr); }
.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }
.col-span-4 { grid-column: span 4; }
.col-span-6 { grid-column: span 6; }
.col-span-full { grid-column: 1 / -1; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.flex-1 { flex: 1 1 0%; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.mx-auto { margin-inline: auto; }
.p-0 { padding: 0; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-2 { padding-inline: 0.5rem; }
.px-3 { padding-inline: 0.75rem; }
.px-4 { padding-inline: 1rem; }
.py-1 { padding-block: 0.25rem; }
.py-2 { padding-block: 0.5rem; }
.py-3 { padding-block: 0.75rem; }
.py-4 { padding-block: 1rem; }
.py-6 { padding-block: 1.5rem; }
.py-8 { padding-block: 2rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-4 > * + * { margin-left: 1rem; }
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.relative { position: relative; }
.absolute { position: absolute; }
.sticky { position: sticky; }
.inset-0 { inset: 0; }
.rounded { border-radius: var(--radius); }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: 9999px; }
.border { border: 1px solid var(--border); }
.border-t { border-top: 1px solid var(--border); }
.border-b { border-bottom: 1px solid var(--border); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow { box-shadow: var(--shadow); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.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;
}

.aspect-auto { aspect-ratio: auto; }
.aspect-square { aspect-ratio: 1/1; }
.aspect-video { aspect-ratio: 16/9; }
.aspect-photo { aspect-ratio: 4/3; }

.avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  overflow: hidden;
  background: var(--muted);
  color: var(--muted-fg);
  font-weight: 600;
  font-size: 0.875rem;
  flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 2rem; height: 2rem; font-size: 0.75rem; }
.avatar-lg { width: 3.5rem; height: 3.5rem; font-size: 1.125rem; }
.avatar-xl { width: 5rem; height: 5rem; font-size: 1.5rem; }
.avatar-group { display: flex; }
.avatar-group .avatar { border: 2px solid var(--bg); margin-left: -0.5rem; }
.avatar-group .avatar:first-child { margin-left: 0; }

.accordion { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.accordion-item { border-bottom: 1px solid var(--border); }
.accordion-item:last-child { border-bottom: 0; }
.accordion-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 500;
  background: none;
  border: none;
  color: var(--fg);
  cursor: pointer;
  text-align: left;
  transition: background var(--transition);
}
.accordion-trigger:hover { background: var(--muted); }
.accordion-trigger::after {
  content: '';
  width: 0.75rem;
  height: 0.75rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform var(--transition);
  flex-shrink: 0;
  margin-left: 1rem;
}
.accordion-item[data-state="open"] .accordion-trigger::after {
  transform: rotate(-135deg);
}
.accordion-content {
  overflow: hidden;
  max-height: 0;
  transition: max-height var(--transition-slow);
}
.accordion-item[data-state="open"] .accordion-content { max-height: 500px; }
.accordion-body { padding: 0 1.25rem 1rem; color: var(--muted-fg); font-size: 0.9375rem; }

.alert {
  position: relative;
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9375rem;
}
.alert-icon { flex-shrink: 0; width: 1.25rem; height: 1.25rem; margin-top: 0.1rem; }
.alert-content { flex: 1; min-width: 0; }
.alert-title { font-weight: 600; margin-bottom: 0.25rem; }
.alert-description { color: var(--muted-fg); font-size: 0.875rem; }
.alert-close {
  position: absolute; top: 0.75rem; right: 0.75rem;
  background: none; border: none; color: var(--muted-fg);
  cursor: pointer; padding: 0.25rem; border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  line-height: 1; font-size: 1.25rem;
}
.alert-close:hover { color: var(--fg); background: var(--muted); }
.alert-info { border-color: var(--info); background: color-mix(in srgb, var(--info) 8%, transparent); }
.alert-info .alert-icon { color: var(--info); }
.alert-success { border-color: var(--success); background: color-mix(in srgb, var(--success) 8%, transparent); }
.alert-success .alert-icon { color: var(--success); }
.alert-warning { border-color: var(--warning); background: color-mix(in srgb, var(--warning) 8%, transparent); }
.alert-warning .alert-icon { color: var(--warning); }
.alert-destructive { border-color: var(--destructive); background: color-mix(in srgb, var(--destructive) 8%, transparent); }
.alert-destructive .alert-icon { color: var(--destructive); }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.5;
  border-radius: 9999px;
  background: var(--primary);
  color: var(--primary-fg);
  white-space: nowrap;
  transition: background var(--transition);
}
.badge-secondary { background: var(--secondary); color: var(--secondary-fg); }
.badge-outline { background: transparent; color: var(--fg); border: 1px solid var(--border); }
.badge-destructive { background: var(--destructive); color: var(--destructive-fg); }
.badge-success { background: var(--success); color: var(--success-fg); }
.badge-warning { background: var(--warning); color: var(--warning-fg); }
.badge-ghost { background: var(--muted); color: var(--muted-fg); }
.badge-lg { padding: 0.25rem 0.75rem; font-size: 0.8125rem; }
.badge-dot::before {
  content: '';
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 9999px;
  background: currentColor;
  margin-right: 0.375rem;
}

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  font-size: 0.875rem;
  color: var(--muted-fg);
  list-style: none;
}
.breadcrumb li { display: flex; align-items: center; gap: 0.25rem; }
.breadcrumb li + li::before { content: '/'; color: var(--muted-fg); margin: 0 0.25rem; }
.breadcrumb a { color: var(--muted-fg); text-decoration: none; transition: color var(--transition); }
.breadcrumb a:hover { color: var(--fg); text-decoration: underline; }
.breadcrumb [aria-current="page"] { color: var(--fg); font-weight: 500; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  line-height: 1.5;
  white-space: nowrap;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition), opacity var(--transition);
  background: var(--primary);
  color: var(--primary-fg);
  text-decoration: none;
}
.btn:hover { background: var(--primary-hover); }
.btn:active { transform: scale(0.98); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }
.btn-secondary { background: var(--secondary); color: var(--secondary-fg); border-color: var(--border); }
.btn-secondary:hover { background: var(--secondary-hover); }
.btn-destructive { background: var(--destructive); color: var(--destructive-fg); }
.btn-destructive:hover { background: var(--destructive-hover); }
.btn-outline { background: transparent; color: var(--fg); border-color: var(--border); }
.btn-outline:hover { background: var(--muted); }
.btn-ghost { background: transparent; color: var(--fg); }
.btn-ghost:hover { background: var(--muted); }
.btn-link { background: transparent; color: var(--primary); padding: 0; height: auto; }
.btn-link:hover { text-decoration: underline; }
.btn-sm { padding: 0.25rem 0.75rem; font-size: 0.8125rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 0.625rem 1.5rem; font-size: 1rem; }
.btn-xl { padding: 0.75rem 2rem; font-size: 1.125rem; }
.btn-icon { padding: 0.5rem; width: 2.25rem; height: 2.25rem; }
.btn-icon.btn-sm { width: 1.75rem; height: 1.75rem; padding: 0.25rem; }
.btn-icon.btn-lg { width: 2.75rem; height: 2.75rem; padding: 0.625rem; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; }
.btn-group .btn:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.btn-group .btn:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.btn-group .btn + .btn { margin-left: -1px; }
.btn-loading { pointer-events: none; }
.btn-loading::before {
  content: '';
  width: 1em; height: 1em;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header { padding: 1.5rem 1.5rem 0; }
.card-title { font-size: 1.125rem; font-weight: 600; line-height: 1.3; }
.card-description { color: var(--muted-fg); font-size: 0.875rem; margin-top: 0.375rem; }
.card-content { padding: 1.5rem; }
.card-header + .card-content { padding-top: 1rem; }
.card-footer {
  padding: 0 1.5rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.card-image { width: 100%; height: auto; display: block; }
.card-hover { transition: box-shadow var(--transition), transform var(--transition); }
.card-hover:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.carousel { position: relative; overflow: hidden; border-radius: var(--radius-lg); }
.carousel-track {
  display: flex;
  transition: transform var(--transition-slow);
}
.carousel-slide {
  min-width: 100%;
  flex-shrink: 0;
}
.carousel-slide img { width: 100%; height: 100%; object-fit: cover; }
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9999px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  color: var(--fg);
  font-size: 1.25rem;
  transition: background var(--transition), box-shadow var(--transition);
  z-index: 2;
}
.carousel-btn:hover { background: var(--muted); box-shadow: var(--shadow-lg); }
.carousel-prev { left: 0.75rem; }
.carousel-next { right: 0.75rem; }
.carousel-dots {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.375rem;
  z-index: 2;
}
.carousel-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: var(--bg);
  opacity: 0.5;
  border: none;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
}
.carousel-dot.active { opacity: 1; transform: scale(1.25); }

.checkbox, .radio {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9375rem;
  user-select: none;
}
.checkbox input, .radio input { display: none; }
.checkbox-mark, .radio-mark {
  width: 1.125rem;
  height: 1.125rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), border-color var(--transition);
  flex-shrink: 0;
}
.radio-mark { border-radius: 9999px; }
.checkbox input:checked + .checkbox-mark {
  background: var(--primary);
  border-color: var(--primary);
}
.checkbox input:checked + .checkbox-mark::after {
  content: '';
  width: 0.375rem;
  height: 0.625rem;
  border: 2px solid var(--primary-fg);
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
}
.radio input:checked + .radio-mark {
  border-color: var(--primary);
}
.radio input:checked + .radio-mark::after {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: var(--primary);
}

.collapsible-trigger {
  cursor: pointer;
  user-select: none;
}
.collapsible-content {
  overflow: hidden;
  max-height: 0;
  transition: max-height var(--transition-slow), opacity var(--transition-slow);
  opacity: 0;
}
.collapsible[data-state="open"] .collapsible-content {
  max-height: 1000px;
  opacity: 1;
}

.select-wrapper { position: relative; display: inline-block; }
.select, select {
  display: block;
  width: 100%;
  padding: 0.5rem 2.5rem 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
  line-height: 1.5;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--input);
  border-radius: var(--radius);
  appearance: none;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.select:focus, select:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 15%, transparent);
}
.select-wrapper::after {
  content: '';
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--muted-fg);
  pointer-events: none;
}
.combobox { position: relative; }
.combobox-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
}
.combobox-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 200px;
  overflow-y: auto;
  z-index: 50;
  display: none;
  list-style: none;
}
.combobox[data-state="open"] .combobox-list { display: block; }
.combobox-option {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background var(--transition);
}
.combobox-option:hover, .combobox-option[data-highlighted] {
  background: var(--muted);
}
.combobox-option[data-selected] { font-weight: 500; color: var(--primary); }
.combobox-empty { padding: 0.5rem 0.75rem; color: var(--muted-fg); font-size: 0.875rem; }

.command-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.command-overlay[data-state="open"] { opacity: 1; pointer-events: auto; }
.command-dialog {
  width: 100%;
  max-width: 520px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  transform: scale(0.96) translateY(-10px);
  transition: transform var(--transition);
}
.command-overlay[data-state="open"] .command-dialog {
  transform: scale(1) translateY(0);
}
.command-input-wrapper {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  gap: 0.75rem;
}
.command-input-wrapper svg { width: 1.125rem; height: 1.125rem; color: var(--muted-fg); flex-shrink: 0; }
.command-input {
  flex: 1;
  border: none;
  background: none;
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--fg);
  outline: none;
}
.command-input::placeholder { color: var(--muted-fg); }
.command-list { padding: 0.5rem; max-height: 300px; overflow-y: auto; }
.command-group-label {
  padding: 0.375rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-fg);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.command-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.625rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.875rem;
  transition: background var(--transition);
}
.command-item:hover, .command-item[data-highlighted] { background: var(--muted); }
.command-item svg { width: 1rem; height: 1rem; color: var(--muted-fg); }
.command-shortcut { margin-left: auto; font-size: 0.75rem; color: var(--muted-fg); font-family: var(--font-mono); }

.context-menu {
  position: fixed;
  min-width: 180px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 0.25rem;
  z-index: 100;
  display: none;
  list-style: none;
}
.context-menu[data-state="open"] { display: block; }
.context-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.375rem 0.625rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8125rem;
  transition: background var(--transition);
  color: var(--fg);
}
.context-menu-item:hover { background: var(--muted); }
.context-menu-separator { height: 1px; background: var(--border); margin: 0.25rem -0.25rem; }
.context-menu-item .shortcut {
  margin-left: auto;
  font-size: 0.6875rem;
  color: var(--muted-fg);
  font-family: var(--font-mono);
}
.context-menu-item[data-disabled] { opacity: 0.5; pointer-events: none; }

.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
table, .table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
th, .table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--muted-fg);
  background: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
}
th[data-sortable] { cursor: pointer; }
th[data-sortable]:hover { color: var(--fg); }
th[data-sort="asc"]::after { content: ' ↑'; }
th[data-sort="desc"]::after { content: ' ↓'; }
td, .table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--fg);
}
tr:last-child td { border-bottom: 0; }
.table-striped tr:nth-child(even) td { background: var(--muted); }
.table-hover tr:hover td { background: color-mix(in srgb, var(--muted) 60%, transparent); }

.dialog-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.dialog-overlay[data-state="open"] { opacity: 1; pointer-events: auto; }
.dialog {
  background: var(--bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition);
  margin: 1rem;
}
.dialog-overlay[data-state="open"] .dialog {
  transform: scale(1) translateY(0);
}
.dialog-header { padding: 1.5rem 1.5rem 0; }
.dialog-title { font-size: 1.125rem; font-weight: 600; line-height: 1.3; }
.dialog-description { color: var(--muted-fg); font-size: 0.875rem; margin-top: 0.375rem; }
.dialog-body { padding: 1.25rem 1.5rem; }
.dialog-footer {
  padding: 0 1.5rem 1.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}
.dialog-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--muted-fg);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  line-height: 1;
  font-size: 1.25rem;
}
.dialog-close:hover { color: var(--fg); background: var(--muted); }

.sheet {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 400px;
  height: 100%;
  background: var(--bg);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
  transform: translateX(100%);
  transition: transform var(--transition-slow);
  z-index: 91;
  overflow-y: auto;
}
.dialog-overlay[data-state="open"] ~ .sheet,
.sheet[data-state="open"] {
  transform: translateX(0);
}
.sheet-left { left: 0; right: auto; border-left: none; border-right: 1px solid var(--border); transform: translateX(-100%); }
.sheet-left[data-state="open"] { transform: translateX(0); }

.drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: var(--shadow-xl);
  transform: translateY(100%);
  transition: transform var(--transition-slow);
  z-index: 91;
  max-height: 80vh;
  overflow-y: auto;
}
.drawer[data-state="open"] { transform: translateY(0); }
.drawer-handle {
  width: 3rem;
  height: 0.25rem;
  background: var(--border);
  border-radius: 9999px;
  margin: 0.75rem auto;
}

.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 180px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 0.25rem;
  z-index: 50;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
  list-style: none;
}
.dropdown[data-state="open"] .dropdown-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.dropdown-right .dropdown-menu { left: auto; right: 0; }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.625rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8125rem;
  transition: background var(--transition);
  color: var(--fg);
  text-decoration: none;
}
.dropdown-item:hover { background: var(--muted); color: var(--fg); text-decoration: none; }
.dropdown-item svg { width: 1rem; height: 1rem; color: var(--muted-fg); }
.dropdown-separator { height: 1px; background: var(--border); margin: 0.25rem -0.25rem; }
.dropdown-label {
  padding: 0.375rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-fg);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 2rem;
  color: var(--muted-fg);
}
.empty-state-icon {
  width: 3rem;
  height: 3rem;
  margin-bottom: 1rem;
  color: var(--muted-fg);
  opacity: 0.5;
}
.empty-state-title { font-size: 1rem; font-weight: 600; color: var(--fg); margin-bottom: 0.5rem; }
.empty-state-description { font-size: 0.875rem; max-width: 320px; margin-bottom: 1.5rem; }

.label, label:not(.checkbox):not(.radio):not(.switch) {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg);
  display: block;
  margin-bottom: 0.375rem;
}
.label-required::after { content: ' *'; color: var(--destructive); }
.input, input[type="text"], input[type="email"],
input[type="password"], input[type="search"],
input[type="url"], input[type="tel"],
input[type="number"], input[type="date"],
input[type="datetime-local"], input[type="time"],
input[type="month"], input[type="week"] {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
  line-height: 1.5;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--input);
  border-radius: var(--radius);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input:focus, input:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 15%, transparent);
}
.input::placeholder, input::placeholder { color: var(--muted-fg); }
.input-error, .input[aria-invalid="true"] { border-color: var(--destructive); }
.input-error:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--destructive) 15%, transparent); }
textarea, .textarea {
  display: block;
  width: 100%;
  min-height: 5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
  line-height: 1.5;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--input);
  border-radius: var(--radius);
  resize: vertical;
  transition: border-color var(--transition), box-shadow var(--transition);
}
textarea:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 15%, transparent); }
.field { margin-bottom: 1.25rem; }
.field-hint { font-size: 0.8125rem; color: var(--muted-fg); margin-top: 0.375rem; }
.field-error { font-size: 0.8125rem; color: var(--destructive); margin-top: 0.375rem; }
.input-group {
  display: flex;
  align-items: stretch;
}
.input-group .input { border-radius: 0; }
.input-group .input:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.input-group .input:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.input-group-text {
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  font-size: 0.875rem;
  color: var(--muted-fg);
  background: var(--muted);
  border: 1px solid var(--input);
  white-space: nowrap;
}
.input-group-text:first-child { border-radius: var(--radius) 0 0 var(--radius); border-right: 0; }
.input-group-text:last-child { border-radius: 0 var(--radius) var(--radius) 0; border-left: 0; }

.hover-card { position: relative; display: inline-block; }
.hover-card-content {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  width: 280px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1rem;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
}
.hover-card:hover .hover-card-content {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

kbd, .kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.125rem 0.375rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 500;
  line-height: 1.5;
  color: var(--fg);
  background: var(--muted);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: var(--radius-sm);
  min-width: 1.5em;
  white-space: nowrap;
}

.menubar {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.menubar-item {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  color: var(--fg);
  position: relative;
}
.menubar-item:hover { background: var(--muted); }
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.navbar-brand { font-size: 1.125rem; font-weight: 700; color: var(--fg); text-decoration: none; }
.navbar-nav { display: flex; align-items: center; gap: 0.25rem; list-style: none; }
.navbar-link {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  color: var(--muted-fg);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}
.navbar-link:hover, .navbar-link[aria-current="page"] { color: var(--fg); background: var(--muted); text-decoration: none; }

.meter {
  width: 100%;
  height: 0.625rem;
  background: var(--muted);
  border-radius: 9999px;
  overflow: hidden;
}
.meter-fill {
  height: 100%;
  border-radius: 9999px;
  background: var(--primary);
  transition: width var(--transition-slow);
}
.meter-success .meter-fill { background: var(--success); }
.meter-warning .meter-fill { background: var(--warning); }
.meter-destructive .meter-fill { background: var(--destructive); }

.pagination {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}
.pagination-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  color: var(--fg);
  text-decoration: none;
  border: 1px solid transparent;
}
.pagination-item:hover { background: var(--muted); }
.pagination-item[aria-current="page"], .pagination-item.active {
  background: var(--primary);
  color: var(--primary-fg);
}
.pagination-item[disabled] { opacity: 0.5; pointer-events: none; }
.pagination-ellipsis { color: var(--muted-fg); padding: 0 0.25rem; }

.popover { position: relative; display: inline-block; }
.popover-content {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  min-width: 200px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1rem;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
}
.popover[data-state="open"] .popover-content {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.progress {
  width: 100%;
  height: 0.5rem;
  background: var(--muted);
  border-radius: 9999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 9999px;
  background: var(--primary);
  transition: width var(--transition-slow);
}
.progress-indeterminate .progress-fill {
  width: 40% !important;
  animation: progress-indeterminate 1.5s ease-in-out infinite;
}
@keyframes progress-indeterminate {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}
.progress-sm { height: 0.25rem; }
.progress-lg { height: 0.75rem; }

.resizable {
  position: relative;
  display: flex;
}
.resizable-panel {
  overflow: auto;
  flex: 1;
}
.resizable-handle {
  width: 4px;
  background: var(--border);
  cursor: col-resize;
  flex-shrink: 0;
  transition: background var(--transition);
  position: relative;
}
.resizable-handle:hover, .resizable-handle:active {
  background: var(--primary);
}
.resizable-handle::after {
  content: '';
  position: absolute;
  inset: -4px;
}
.resizable-vertical { flex-direction: column; }
.resizable-vertical .resizable-handle {
  height: 4px;
  width: auto;
  cursor: row-resize;
}

.scroll-area {
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar) transparent;
}
.scroll-area::-webkit-scrollbar { width: 6px; height: 6px; }
.scroll-area::-webkit-scrollbar-track { background: transparent; }
.scroll-area::-webkit-scrollbar-thumb {
  background: var(--scrollbar);
  border-radius: 9999px;
}
.scroll-area::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-hover); }

.separator {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}
.separator-vertical {
  border-top: none;
  border-left: 1px solid var(--border);
  height: auto;
  align-self: stretch;
  margin: 0 0.75rem;
  display: inline-block;
  min-height: 1rem;
}
.separator-label {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--muted-fg);
  font-size: 0.8125rem;
  margin: 1rem 0;
}
.separator-label::before, .separator-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.sidebar {
  width: 260px;
  height: 100%;
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width var(--transition-slow), transform var(--transition-slow);
  overflow-y: auto;
}
.sidebar-collapsed { width: 60px; }
.sidebar-collapsed .sidebar-label,
.sidebar-collapsed .sidebar-item-text { display: none; }
.sidebar-header { padding: 1rem; border-bottom: 1px solid var(--border); }
.sidebar-content { padding: 0.5rem; flex: 1; overflow-y: auto; }
.sidebar-footer { padding: 0.75rem; border-top: 1px solid var(--border); }
.sidebar-label {
  padding: 0.5rem 0.75rem 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--muted-fg);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--muted-fg);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
}
.sidebar-item:hover { background: var(--muted); color: var(--fg); text-decoration: none; }
.sidebar-item[aria-current="page"], .sidebar-item.active { background: var(--muted); color: var(--fg); font-weight: 500; }
.sidebar-item svg { width: 1.125rem; height: 1.125rem; flex-shrink: 0; }

.skeleton {
  background: linear-gradient(90deg, var(--skeleton-from) 25%, var(--skeleton-to) 50%, var(--skeleton-from) 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-text { height: 0.875rem; margin-bottom: 0.5rem; }
.skeleton-text:last-child { width: 60%; }
.skeleton-heading { height: 1.5rem; width: 50%; margin-bottom: 0.75rem; }
.skeleton-avatar { width: 2.5rem; height: 2.5rem; border-radius: 9999px; }
.skeleton-image { width: 100%; height: 12rem; border-radius: var(--radius); }
.skeleton-btn { height: 2.25rem; width: 6rem; border-radius: var(--radius); }

.slider {
  position: relative;
  width: 100%;
  height: 2rem;
  display: flex;
  align-items: center;
}
.slider input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 0.375rem;
  background: var(--muted);
  border-radius: 9999px;
  outline: none;
  cursor: pointer;
}
.slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  background: var(--primary);
  border: 2px solid var(--bg);
  box-shadow: var(--shadow);
  border-radius: 9999px;
  cursor: grab;
  transition: transform var(--transition);
}
.slider input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }
.slider input[type="range"]::-webkit-slider-thumb:active { cursor: grabbing; }
.slider input[type="range"]::-moz-range-thumb {
  width: 1.25rem;
  height: 1.25rem;
  background: var(--primary);
  border: 2px solid var(--bg);
  box-shadow: var(--shadow);
  border-radius: 9999px;
  cursor: grab;
}

.spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--muted);
  border-top-color: var(--primary);
  border-radius: 9999px;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinner-sm { width: 1rem; height: 1rem; border-width: 2px; }
.spinner-lg { width: 2rem; height: 2rem; border-width: 3px; }
.spinner-xl { width: 3rem; height: 3rem; border-width: 3px; }
.spinner-dots {
  display: inline-flex;
  gap: 0.25rem;
}
.spinner-dots span {
  width: 0.5rem;
  height: 0.5rem;
  background: var(--primary);
  border-radius: 9999px;
  animation: spinner-bounce 1.4s ease-in-out infinite both;
}
.spinner-dots span:nth-child(1) { animation-delay: -0.32s; }
.spinner-dots span:nth-child(2) { animation-delay: -0.16s; }
@keyframes spinner-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}
.spinner-bar {
  display: inline-flex;
  gap: 2px;
  align-items: center;
  height: 1.25rem;
}
.spinner-bar span {
  width: 3px;
  height: 100%;
  background: var(--primary);
  animation: spinner-bar 1.2s ease-in-out infinite;
}
.spinner-bar span:nth-child(1) { animation-delay: -1.1s; }
.spinner-bar span:nth-child(2) { animation-delay: -1.0s; }
.spinner-bar span:nth-child(3) { animation-delay: -0.9s; }
@keyframes spinner-bar {
  0%, 40%, 100% { transform: scaleY(0.4); }
  20% { transform: scaleY(1); }
}

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
  font-size: 0.9375rem;
}
.switch input { display: none; }
.switch-track {
  width: 2.75rem;
  height: 1.5rem;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 2px;
  transition: background var(--transition), border-color var(--transition);
  flex-shrink: 0;
}
.switch-thumb {
  display: block;
  width: 1.125rem;
  height: 1.125rem;
  background: white;
  border-radius: 9999px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition);
}
.switch input:checked + .switch-track {
  background: var(--primary);
  border-color: var(--primary);
}
.switch input:checked + .switch-track .switch-thumb {
  transform: translateX(1.25rem);
}
.toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  font-family: inherit;
}
.toggle:hover { background: var(--muted); }
.toggle[aria-pressed="true"], .toggle.active {
  background: var(--primary);
  color: var(--primary-fg);
  border-color: var(--primary);
}
.toggle-group { display: inline-flex; }
.toggle-group .toggle { border-radius: 0; }
.toggle-group .toggle:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.toggle-group .toggle:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.toggle-group .toggle + .toggle { margin-left: -1px; }

.tabs-list {
  display: flex;
  border-bottom: 1px solid var(--border);
  gap: 0;
  overflow-x: auto;
}
.tabs-trigger {
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--muted-fg);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--transition), border-color var(--transition);
  margin-bottom: -1px;
}
.tabs-trigger:hover { color: var(--fg); }
.tabs-trigger[aria-selected="true"], .tabs-trigger.active {
  color: var(--fg);
  border-bottom-color: var(--primary);
}
.tabs-content { padding: 1rem 0; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.tabs-pills .tabs-list { border-bottom: none; gap: 0.25rem; }
.tabs-pills .tabs-trigger {
  border-bottom: none;
  border-radius: var(--radius-sm);
  margin-bottom: 0;
}
.tabs-pills .tabs-trigger[aria-selected="true"],
.tabs-pills .tabs-trigger.active {
  background: var(--muted);
  color: var(--fg);
}

.toast-container {
  position: fixed;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  max-width: 420px;
  width: 100%;
}
.toast-container.top-right { top: 1rem; right: 1rem; }
.toast-container.top-left { top: 1rem; left: 1rem; }
.toast-container.bottom-right { bottom: 1rem; right: 1rem; }
.toast-container.bottom-left { bottom: 1rem; left: 1rem; }
.toast-container.top-center { top: 1rem; left: 50%; transform: translateX(-50%); }
.toast-container.bottom-center { bottom: 1rem; left: 50%; transform: translateX(-50%); }
.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toast-in 0.3s ease-out forwards;
  font-size: 0.875rem;
}
.toast-leaving { animation: toast-out 0.2s ease-in forwards; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-8px) scale(0.96); }
}
.toast-icon { flex-shrink: 0; width: 1.25rem; height: 1.25rem; margin-top: 0.1rem; }
.toast-content { flex: 1; min-width: 0; }
.toast-title { font-weight: 600; margin-bottom: 0.125rem; }
.toast-description { color: var(--muted-fg); font-size: 0.8125rem; }
.toast-close {
  background: none; border: none; color: var(--muted-fg);
  cursor: pointer; padding: 0.25rem; flex-shrink: 0;
  border-radius: var(--radius-sm); transition: color var(--transition);
  line-height: 1; font-size: 1.125rem;
}
.toast-close:hover { color: var(--fg); }
.toast-success { border-color: var(--success); }
.toast-success .toast-icon { color: var(--success); }
.toast-destructive { border-color: var(--destructive); }
.toast-destructive .toast-icon { color: var(--destructive); }
.toast-warning { border-color: var(--warning); }
.toast-warning .toast-icon { color: var(--warning); }

.tooltip { position: relative; display: inline-block; }
.tooltip-content {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 0.375rem 0.625rem;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--primary-fg);
  background: var(--fg);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
}
.tooltip-content::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--fg);
}
.tooltip:hover .tooltip-content {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.tooltip-bottom .tooltip-content {
  bottom: auto;
  top: calc(100% + 6px);
}
.tooltip-bottom .tooltip-content::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: var(--fg);
}

.calendar {
  width: fit-content;
  padding: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.calendar-title { font-size: 0.875rem; font-weight: 600; }
.calendar-nav {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--fg);
  transition: background var(--transition);
}
.calendar-nav:hover { background: var(--muted); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.calendar-day-header {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-fg);
  padding: 0.25rem;
}
.calendar-day {
  text-align: center;
  padding: 0.375rem;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.calendar-day:hover { background: var(--muted); }
.calendar-day.today { font-weight: 600; background: var(--muted); }
.calendar-day.selected { background: var(--primary); color: var(--primary-fg); font-weight: 500; }
.calendar-day.other-month { color: var(--muted-fg); opacity: 0.4; }
.calendar-day.disabled { opacity: 0.3; pointer-events: none; }

.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }
.pointer-events-none { pointer-events: none; }
.cursor-pointer { cursor: pointer; }
.select-none { user-select: none; }
.transition { transition: all var(--transition); }
.animate-fade-in { animation: fade-in 0.2s ease-out; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.animate-slide-up { animation: slide-up 0.2s ease-out; }
@keyframes slide-up { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.animate-slide-down { animation: slide-down 0.2s ease-out; }
@keyframes slide-down { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.animate-scale-in { animation: scale-in 0.2s ease-out; }
@keyframes scale-in { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.item-group {
  display: flex;
  flex-direction: column;
}
.item-group-horizontal { flex-direction: row; flex-wrap: wrap; }
.item-group > * + * { border-top: 1px solid var(--border); }
.item-group-horizontal > * + * { border-top: none; border-left: 1px solid var(--border); }
.item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  transition: background var(--transition);
}
.item-clickable { cursor: pointer; }
.item-clickable:hover { background: var(--muted); }
.item-icon { flex-shrink: 0; width: 1.25rem; height: 1.25rem; color: var(--muted-fg); }
.item-content { flex: 1; min-width: 0; }
.item-title { font-weight: 500; font-size: 0.9375rem; }
.item-description { font-size: 0.8125rem; color: var(--muted-fg); }
.item-action { flex-shrink: 0; }

@media (max-width: 768px) {
  .grid-cols-2, .grid-cols-3, .grid-cols-4 { grid-template-columns: 1fr; }
  .container { padding: 0 1rem; }
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  .dialog { margin: 0.5rem; max-width: calc(100% - 1rem); }
  .sheet { max-width: 85%; }
  .hide-mobile { display: none !important; }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
  .hide-tablet { display: none !important; }
}
@media (min-width: 769px) {
  .show-mobile { display: none !important; }
}

@media print {
  .toast-container, .dialog-overlay, .command-overlay,
  .dropdown-menu, .context-menu, .tooltip-content { display: none !important; }
  body { color: #000; background: #fff; }
  .card, .alert { box-shadow: none; border: 1px solid #ddd; }
}

