/* ============================================================
   shadcn-static.css — Static CSS port of shadcn/ui (Nova style)
   No Tailwind, no Vue, no React. Pure CSS.

   Layer-Architektur:
     @layer base       — diese Datei (upstream-sync-fähig)
     @layer custom     — shadcn-custom.css (Grafiker-Overrides)
   custom gewinnt IMMER über base, unabhängig von Selektorstärke.
   ============================================================ */

@layer base, custom;

@layer base {

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

/* --- CSS Custom Properties (Design Tokens) --- */
:root {
  /* Typography */
  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Radius Scale */
  --radius: 0.625rem;
  --radius-sm: calc(var(--radius) * 0.6);
  --radius-md: calc(var(--radius) * 0.8);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) * 1.4);
  --radius-2xl: calc(var(--radius) * 1.8);

  /* Spacing base */
  --spacing: 0.25rem;

  /* Light Theme Tokens (Neutral) */
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);

  --card: oklch(1 0 0);
  --card-foreground: oklch(0.145 0 0);

  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.145 0 0);

  --primary: oklch(0.205 0 0);
  --primary-foreground: oklch(0.985 0 0);

  --secondary: oklch(0.97 0 0);
  --secondary-foreground: oklch(0.205 0 0);

  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.556 0 0);

  --accent: oklch(0.97 0 0);
  --accent-foreground: oklch(0.205 0 0);

  --destructive: oklch(0.577 0.245 27.325);
  --destructive-foreground: oklch(0.577 0.245 27.325);

  --border: oklch(0.922 0 0);
  --input: oklch(0.922 0 0);
  --ring: oklch(0.708 0 0);

  --chart-1: oklch(0.646 0.222 41.116);
  --chart-2: oklch(0.6 0.118 184.704);
  --chart-3: oklch(0.398 0.07 227.392);
  --chart-4: oklch(0.828 0.189 84.429);
  --chart-5: oklch(0.769 0.188 70.08);

  --sidebar: oklch(0.985 0 0);
  --sidebar-foreground: oklch(0.145 0 0);
  --sidebar-primary: oklch(0.205 0 0);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  --sidebar-accent: oklch(0.97 0 0);
  --sidebar-accent-foreground: oklch(0.205 0 0);
  --sidebar-border: oklch(0.922 0 0);
  --sidebar-ring: oklch(0.708 0 0);

  color-scheme: light;
}

.dark {
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);

  --card: oklch(0.145 0 0);
  --card-foreground: oklch(0.985 0 0);

  --popover: oklch(0.145 0 0);
  --popover-foreground: oklch(0.985 0 0);

  --primary: oklch(0.985 0 0);
  --primary-foreground: oklch(0.205 0 0);

  --secondary: oklch(0.269 0 0);
  --secondary-foreground: oklch(0.985 0 0);

  --muted: oklch(0.269 0 0);
  --muted-foreground: oklch(0.708 0 0);

  --accent: oklch(0.269 0 0);
  --accent-foreground: oklch(0.985 0 0);

  --destructive: oklch(0.396 0.141 25.723);
  --destructive-foreground: oklch(0.637 0.237 25.331);

  --border: oklch(0.269 0 0);
  --input: oklch(0.269 0 0);
  --ring: oklch(0.439 0 0);

  --chart-1: oklch(0.488 0.243 264.376);
  --chart-2: oklch(0.696 0.17 162.48);
  --chart-3: oklch(0.769 0.188 70.08);
  --chart-4: oklch(0.627 0.265 303.9);
  --chart-5: oklch(0.645 0.246 16.439);

  --sidebar: oklch(0.17 0 0);
  --sidebar-foreground: oklch(0.985 0 0);
  --sidebar-primary: oklch(0.488 0.243 264.376);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  --sidebar-accent: oklch(0.269 0 0);
  --sidebar-accent-foreground: oklch(0.985 0 0);
  --sidebar-border: oklch(0.269 0 0);
  --sidebar-ring: oklch(0.439 0 0);

  color-scheme: dark;
}

/* --- Global Styles --- */
html {
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--background);
  color: var(--foreground);
  font-size: 0.875rem;
}

button:not(:disabled),
[role="button"]:not(:disabled) {
  cursor: pointer;
}

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

img, svg {
  display: block;
  max-width: 100%;
}

/* --- Animations --- */
@keyframes accordion-down {
  from { height: 0; opacity: 0; }
  to { height: var(--accordion-content-height); opacity: 1; }
}

@keyframes accordion-up {
  from { height: var(--accordion-content-height); opacity: 1; }
  to { height: 0; opacity: 0; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes zoom-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes zoom-out {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.95); }
}

@keyframes slide-in-from-top {
  from { transform: translateY(-0.5rem); }
  to { transform: translateY(0); }
}

@keyframes slide-in-from-bottom {
  from { transform: translateY(0.5rem); }
  to { transform: translateY(0); }
}

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

@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ============================================================
   COMPONENTS
   ============================================================ */

/* --- Typography --- */
.h1 { font-size: 2.25rem; line-height: 2.5rem; font-weight: 700; letter-spacing: -0.025em; }
.h2 { font-size: 1.875rem; line-height: 2.25rem; font-weight: 600; letter-spacing: -0.025em; }
.h3 { font-size: 1.5rem; line-height: 2rem; font-weight: 600; letter-spacing: -0.025em; }
.h4 { font-size: 1.25rem; line-height: 1.75rem; font-weight: 600; letter-spacing: -0.025em; }
.p { font-size: 0.875rem; line-height: 1.625; }
.lead { font-size: 1.125rem; line-height: 1.75rem; color: var(--muted-foreground); }
.large { font-size: 1rem; font-weight: 600; }
.small { font-size: 0.8125rem; line-height: 1; }
.muted { font-size: 0.8125rem; color: var(--muted-foreground); }
.code {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  background: var(--muted);
  border-radius: var(--radius-sm);
  padding: 0.125rem 0.375rem;
}

/* --- Label --- */
.label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  line-height: 1;
  font-weight: 500;
}
.label[data-disabled] {
  opacity: 0.5;
}

/* --- Button --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  background-clip: padding-box;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
  outline: none;
  text-decoration: none;
  -webkit-user-select: none;
  user-select: none;
}
.btn:focus-visible {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring), transparent 50%);
}
.btn:active:not([aria-haspopup]):not(:disabled) {
  transform: translateY(1px);
}
.btn:disabled {
  pointer-events: none;
  opacity: 0.5;
}
.btn svg { width: 1rem; height: 1rem; flex-shrink: 0; }

/* Button Variants */
.btn-default {
  background-color: var(--primary);
  color: var(--primary-foreground);
}
.btn-default:hover { opacity: 0.9; }

.btn-outline {
  border-color: var(--border);
  background-color: var(--background);
  color: var(--foreground);
}
.btn-outline:hover {
  background-color: var(--muted);
}

.btn-secondary {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
}
.btn-secondary:hover { opacity: 0.85; }

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

.btn-destructive {
  background-color: color-mix(in oklch, var(--destructive), transparent 90%);
  color: var(--destructive);
  border-color: transparent;
}
.btn-destructive:hover {
  background-color: color-mix(in oklch, var(--destructive), transparent 80%);
}

.btn-link {
  background: transparent;
  color: var(--primary);
  text-decoration: none;
}
.btn-link:hover { text-decoration: underline; }

/* Button Sizes */
.btn-xs { height: 1.5rem; padding: 0 0.5rem; font-size: 0.75rem; gap: 0.25rem; border-radius: var(--radius-md); }
.btn-sm { height: 1.75rem; padding: 0 0.625rem; font-size: 0.8rem; gap: 0.25rem; border-radius: var(--radius-md); }
.btn      { height: 2rem; padding: 0 0.625rem; }
.btn-lg { height: 2.25rem; padding: 0 0.625rem; }
.btn-icon { height: 2rem; width: 2rem; padding: 0; }
.btn-icon-sm { height: 1.75rem; width: 1.75rem; padding: 0; border-radius: var(--radius-md); }
.btn-icon-lg { height: 2.25rem; width: 2.25rem; padding: 0; }

/* --- Badge --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  height: 1.25rem;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
  border-radius: 9999px;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background-color 0.15s, color 0.15s;
}
.badge svg { width: 0.75rem; height: 0.75rem; }

.badge-default {
  background-color: var(--primary);
  color: var(--primary-foreground);
}
.badge-secondary {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
}
.badge-outline {
  border-color: var(--border);
  color: var(--foreground);
}
.badge-destructive {
  background-color: color-mix(in oklch, var(--destructive), transparent 90%);
  color: var(--destructive);
}
.badge-ghost {
  background: transparent;
  color: var(--foreground);
}
.badge-ghost:hover {
  background-color: var(--muted);
  color: var(--muted-foreground);
}

/* --- Input --- */
.input {
  display: flex;
  width: 100%;
  height: 2rem;
  padding: 0.25rem 0.625rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--foreground);
  background-color: transparent;
  border: 1px solid var(--input);
  border-radius: var(--radius-lg);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.input::placeholder {
  color: var(--muted-foreground);
}
.input:focus-visible {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring), transparent 50%);
}
.input:disabled {
  opacity: 0.5;
  background-color: color-mix(in oklch, var(--input), transparent 50%);
}
.input[aria-invalid="true"] {
  border-color: var(--destructive);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--destructive), transparent 80%);
}
.input[type="file"] {
  padding-top: 0.25rem;
}
.input[type="file"]::file-selector-button {
  height: 1.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  border: 0;
  background: transparent;
  font-family: inherit;
  margin-right: 0.5rem;
}

/* --- Textarea --- */
.textarea {
  display: flex;
  width: 100%;
  min-height: 5rem;
  padding: 0.5rem 0.625rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--foreground);
  background-color: transparent;
  border: 1px solid var(--input);
  border-radius: var(--radius-lg);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
  resize: vertical;
}
.textarea::placeholder { color: var(--muted-foreground); }
.textarea:focus-visible {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring), transparent 50%);
}
.textarea:disabled { opacity: 0.5; }

/* --- Select (native styled) --- */
.select-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.375rem;
  width: 100%;
  height: 2rem;
  padding: 0.5rem 0.5rem 0.5rem 0.625rem;
  font-size: 0.875rem;
  color: var(--foreground);
  background-color: transparent;
  border: 1px solid var(--input);
  border-radius: var(--radius-lg);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1rem;
  padding-right: 2rem;
}
.select-trigger:focus-visible {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring), transparent 50%);
}

/* Custom JS-powered select */
.select-wrapper { position: relative; display: inline-flex; flex-direction: column; }
.select-content {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 50;
  min-width: 9rem;
  background-color: var(--popover);
  color: var(--popover-foreground);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
  ring: 1px solid color-mix(in oklch, var(--foreground), transparent 90%);
  outline: 1px solid color-mix(in oklch, var(--foreground), transparent 90%);
  padding: 0.25rem;
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
  transition: opacity 0.1s, transform 0.1s;
}
.select-content.open {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}
.select-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.375rem;
  font-size: 0.875rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color 0.1s;
}
.select-item:hover,
.select-item:focus {
  background-color: var(--accent);
  color: var(--accent-foreground);
  outline: none;
}
.select-item[aria-selected="true"]::after {
  content: "✓";
  margin-left: auto;
  font-size: 0.75rem;
}
.select-label {
  padding: 0.25rem 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
}
.select-separator {
  height: 1px;
  margin: 0.25rem -0.25rem;
  background-color: var(--border);
}

/* --- Checkbox --- */
.checkbox {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  border: 1px solid var(--input);
  border-radius: 4px;
  background: transparent;
  color: transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.checkbox:checked {
  background-color: var(--primary);
  border-color: var(--primary);
  color: var(--primary-foreground);
}
.checkbox:focus-visible {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring), transparent 50%);
}
.checkbox:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
/* Check icon via pseudo-element */
.checkbox:checked::after {
  content: "";
  display: block;
  width: 0.625rem;
  height: 0.625rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

/* --- Switch --- */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 2rem;
  height: 1.15rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9999px;
  background-color: var(--input);
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.2s, box-shadow 0.15s;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.switch::after {
  content: "";
  position: absolute;
  left: 1px;
  width: 1rem;
  height: 1rem;
  border-radius: 9999px;
  background-color: var(--background);
  transition: transform 0.2s;
  box-shadow: 0 1px 2px rgba(0,0,0,.1);
}
.switch:checked {
  background-color: var(--primary);
}
.switch:checked::after {
  transform: translateX(calc(100% - 2px));
}
.switch:focus-visible {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring), transparent 50%);
}
.switch:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- Card --- */
.card {
  background-color: var(--card);
  color: var(--card-foreground);
  border-radius: var(--radius-xl);
  box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--foreground), transparent 90%);
  padding: 0;
  overflow: hidden;
  font-size: 0.875rem;
}
.card-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem;
  position: relative;
}
.card-title {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.375;
}
.card-description {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}
.card-action {
  position: absolute;
  top: 1rem;
  right: 1rem;
}
.card-content {
  padding: 0 1rem;
}
.card-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  border-top: 1px solid var(--border);
  background-color: color-mix(in oklch, var(--muted), transparent 50%);
}

/* Card with image */
.card > img:first-child {
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  object-fit: cover;
}

/* Small card */
.card-sm .card-header { padding: 0.75rem; gap: 0.125rem; }
.card-sm .card-title { font-size: 0.875rem; }
.card-sm .card-content { padding: 0 0.75rem; }
.card-sm .card-footer { padding: 0.75rem; }

/* --- Alert --- */
.alert {
  display: grid;
  gap: 0.125rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 0.5rem 0.625rem;
  font-size: 0.875rem;
  text-align: left;
  position: relative;
}
.alert.has-icon {
  grid-template-columns: auto 1fr;
  gap: 0 0.5rem;
}
.alert.has-icon > svg {
  grid-row: span 2;
  width: 1rem;
  height: 1rem;
  margin-top: 0.125rem;
}
.alert-default {
  background-color: var(--card);
  color: var(--card-foreground);
}
.alert-destructive {
  background-color: var(--card);
  color: var(--destructive);
}
.alert-destructive .alert-description {
  color: color-mix(in oklch, var(--destructive), transparent 10%);
}
.alert-title {
  font-weight: 500;
}
.alert-description {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}
.alert-action {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
}

/* --- Separator --- */
.separator {
  background-color: var(--border);
  flex-shrink: 0;
}
.separator-horizontal {
  height: 1px;
  width: 100%;
}
.separator-vertical {
  width: 1px;
  height: 100%;
  align-self: stretch;
}

/* --- Table --- */
.table-container {
  position: relative;
  width: 100%;
  overflow-x: auto;
}
.table {
  width: 100%;
  caption-side: bottom;
  font-size: 0.875rem;
  border-collapse: collapse;
}
.table caption {
  color: var(--muted-foreground);
  margin-top: 1rem;
  font-size: 0.875rem;
}
.table thead tr {
  border-bottom: 1px solid var(--border);
}
.table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background-color 0.1s;
}
.table tbody tr:last-child {
  border-bottom: 0;
}
.table tbody tr:hover {
  background-color: color-mix(in oklch, var(--muted), transparent 50%);
}
.table th {
  height: 2.5rem;
  padding: 0 0.5rem;
  text-align: left;
  vertical-align: middle;
  font-weight: 500;
  color: var(--foreground);
  white-space: nowrap;
}
.table td {
  padding: 0.5rem;
  vertical-align: middle;
  white-space: nowrap;
}
.table tfoot {
  border-top: 1px solid var(--border);
  background-color: color-mix(in oklch, var(--muted), transparent 50%);
  font-weight: 500;
}
.table tfoot tr:last-child {
  border-bottom: 0;
}

/* --- Accordion --- */
.accordion {
  width: 100%;
}
.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: 0.625rem 0;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: left;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  outline: none;
  border-radius: var(--radius-lg);
  transition: text-decoration 0.15s;
}
.accordion-trigger:hover {
  text-decoration: underline;
}
.accordion-trigger:focus-visible {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring), transparent 50%);
}
.accordion-trigger-icon {
  width: 1rem;
  height: 1rem;
  color: var(--muted-foreground);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.accordion-trigger[aria-expanded="true"] .accordion-trigger-icon {
  transform: rotate(180deg);
}
.accordion-content {
  overflow: hidden;
  font-size: 0.875rem;
  transition: height 0.2s ease-out, opacity 0.2s ease-out;
}
.accordion-content[hidden] {
  display: none;
}
.accordion-content-inner {
  padding-bottom: 0.625rem;
}

/* --- Tabs --- */
.tabs {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.tabs-list {
  display: inline-flex;
  align-items: center;
  gap: 0;
  height: 2rem;
  padding: 3px;
  background-color: var(--muted);
  border-radius: var(--radius-lg);
  width: fit-content;
}
.tabs-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.125rem 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  outline: none;
  transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.tabs-trigger:hover {
  color: var(--foreground);
}
.tabs-trigger[aria-selected="true"],
.tabs-trigger.active {
  background-color: var(--background);
  color: var(--foreground);
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.tabs-trigger:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring), transparent 50%);
}
.tabs-content {
  font-size: 0.875rem;
}
.tabs-content[hidden] {
  display: none;
}

/* Tabs line variant */
.tabs-list-line {
  background: transparent;
  padding: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  height: auto;
  gap: 0;
}
.tabs-list-line .tabs-trigger {
  border-radius: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 0.375rem 0.75rem;
}
.tabs-list-line .tabs-trigger[aria-selected="true"],
.tabs-list-line .tabs-trigger.active {
  background: transparent;
  box-shadow: none;
  border-bottom-color: var(--primary);
  color: var(--foreground);
}

/* --- Dialog / Modal --- */
.dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background-color: rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.1s;
  pointer-events: none;
}
.dialog-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.dialog-content {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 51;
  transform: translate(-50%, -50%) scale(0.95);
  opacity: 0;
  max-width: calc(100% - 2rem);
  width: 24rem;
  background-color: var(--popover);
  color: var(--popover-foreground);
  border-radius: var(--radius-xl);
  box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--foreground), transparent 90%);
  padding: 1rem;
  display: grid;
  gap: 1rem;
  font-size: 0.875rem;
  pointer-events: none;
  transition: opacity 0.1s, transform 0.1s;
}
.dialog-content.open {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}
.dialog-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
}
.dialog-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.dialog-title {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1;
}
.dialog-description {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}
.dialog-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem;
  margin: 0 -1rem -1rem;
  border-top: 1px solid var(--border);
  background-color: color-mix(in oklch, var(--muted), transparent 50%);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* --- Dropdown Menu --- */
.dropdown {
  position: relative;
  display: inline-flex;
}
.dropdown-content {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 50;
  min-width: 8rem;
  background-color: var(--popover);
  color: var(--popover-foreground);
  border-radius: var(--radius-lg);
  padding: 0.25rem;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
  outline: 1px solid color-mix(in oklch, var(--foreground), transparent 90%);
  opacity: 0;
  transform: scale(0.95) translateY(-0.5rem);
  pointer-events: none;
  transition: opacity 0.1s, transform 0.1s;
}
.dropdown-content.open {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}
.dropdown-content.align-end {
  left: auto;
  right: 0;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.375rem;
  font-size: 0.875rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  outline: none;
  border: none;
  background: none;
  color: inherit;
  width: 100%;
  text-align: left;
  transition: background-color 0.1s;
}
.dropdown-item:hover,
.dropdown-item:focus {
  background-color: var(--accent);
  color: var(--accent-foreground);
  outline: none;
}
.dropdown-item svg { width: 1rem; height: 1rem; flex-shrink: 0; }
.dropdown-item[data-variant="destructive"] {
  color: var(--destructive);
}
.dropdown-item[data-variant="destructive"]:hover,
.dropdown-item[data-variant="destructive"]:focus {
  background-color: color-mix(in oklch, var(--destructive), transparent 90%);
}
.dropdown-item:disabled,
.dropdown-item.disabled {
  opacity: 0.5;
  pointer-events: none;
}
.dropdown-label {
  padding: 0.25rem 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
}
.dropdown-separator {
  height: 1px;
  margin: 0.25rem -0.25rem;
  background-color: var(--border);
}
.dropdown-shortcut {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  letter-spacing: 0.05em;
}

/* --- Tooltip --- */
.tooltip-trigger {
  position: relative;
  display: inline-flex;
}
[data-tooltip] {
  position: relative;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) scale(0.95);
  background-color: var(--primary);
  color: var(--primary-foreground);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s, transform 0.1s;
  z-index: 50;
}
[data-tooltip]:hover::after,
[data-tooltip]:focus::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* --- Progress --- */
.progress {
  position: relative;
  width: 100%;
  height: 0.25rem;
  background-color: var(--muted);
  border-radius: 9999px;
  overflow: hidden;
}
.progress-indicator {
  height: 100%;
  background-color: var(--primary);
  border-radius: 9999px;
  transition: width 0.3s ease;
}

/* --- Skeleton --- */
.skeleton {
  background-color: var(--muted);
  border-radius: var(--radius-md);
  animation: skeleton-pulse 2s ease-in-out infinite;
}

/* --- Spinner --- */
.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 9999px;
  animation: spin 0.6s linear infinite;
}
.spinner-sm { width: 0.75rem; height: 0.75rem; }
.spinner-lg { width: 1.25rem; height: 1.25rem; }

/* --- Avatar --- */
.avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  overflow: hidden;
  flex-shrink: 0;
}
.avatar-lg { width: 2.5rem; height: 2.5rem; }
.avatar-sm { width: 1.5rem; height: 1.5rem; }
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 9999px;
}
.avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background-color: var(--muted);
  color: var(--muted-foreground);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* --- Toggle --- */
.toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  height: 2rem;
  min-width: 2rem;
  padding: 0 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--foreground);
  cursor: pointer;
  outline: none;
  transition: background-color 0.15s, color 0.15s;
}
.toggle:hover {
  color: var(--foreground);
}
.toggle[aria-pressed="true"] {
  background-color: var(--muted);
}
.toggle:focus-visible {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring), transparent 50%);
}
.toggle svg { width: 1rem; height: 1rem; }

.toggle-outline {
  border-color: var(--input);
}

/* --- Toast / Notification --- */
.toast-container {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 100;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
  max-width: 24rem;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background-color: var(--card);
  color: var(--card-foreground);
  border-radius: var(--radius-2xl);
  box-shadow: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
  border: 1px solid var(--border);
  font-size: 0.875rem;
  animation: slide-in-from-bottom 0.2s, fade-in 0.2s;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.removing {
  opacity: 0;
  transform: translateX(100%);
}
.toast-title {
  font-weight: 500;
}
.toast-description {
  color: var(--muted-foreground);
  font-size: 0.8125rem;
}
.toast-close {
  margin-left: auto;
  flex-shrink: 0;
}
.toast-destructive {
  border-color: var(--destructive);
  color: var(--destructive);
}

/* --- Sheet / Drawer --- */
.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background-color: rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.sheet-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.sheet-content {
  position: fixed;
  z-index: 51;
  background-color: var(--popover);
  color: var(--popover-foreground);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 0.875rem;
  box-shadow: -4px 0 6px rgba(0,0,0,.1);
  transition: transform 0.2s ease-in-out;
}
.sheet-content-right {
  top: 0;
  right: 0;
  bottom: 0;
  width: 75%;
  max-width: 24rem;
  border-left: 1px solid var(--border);
  transform: translateX(100%);
}
.sheet-content-right.open {
  transform: translateX(0);
}
.sheet-content-left {
  top: 0;
  left: 0;
  bottom: 0;
  width: 75%;
  max-width: 24rem;
  border-right: 1px solid var(--border);
  transform: translateX(-100%);
}
.sheet-content-left.open {
  transform: translateX(0);
}
.sheet-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
}
.sheet-header {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: 1rem;
}
.sheet-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--foreground);
}
.sheet-description {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}
.sheet-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
}

/* --- Field layout helpers --- */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.field-horizontal {
  flex-direction: row;
  align-items: center;
}
.field-label {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
}
.field-description {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}
.field-error {
  font-size: 0.875rem;
  color: var(--destructive);
}
.field-group {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

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

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.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; }
.w-full { width: 100%; }
.max-w-sm { max-width: 24rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-4xl { max-width: 56rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.ml-auto { margin-left: auto; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-muted { color: var(--muted-foreground); }
.text-destructive { color: var(--destructive); }
.text-primary { color: var(--primary); }
.rounded-full { border-radius: 9999px; }
.overflow-hidden { overflow: hidden; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.relative { position: relative; }
.inline-flex { display: inline-flex; }
.hidden { display: none; }
.block { display: block; }
.border-b { border-bottom: 1px solid var(--border); }
.border-t { border-top: 1px solid var(--border); }

/* ============================================================
   ADDITIONAL COMPONENTS (Phase 2)
   ============================================================ */

/* --- Radio Group --- */
.radio-group {
  display: grid;
  gap: 0.5rem;
}
.radio {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  border: 1px solid var(--input);
  border-radius: 9999px;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.15s, border-color 0.15s;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.radio:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}
.radio:checked::after {
  content: "";
  display: block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background-color: var(--primary-foreground);
}
.radio:focus-visible {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring), transparent 50%);
}
.radio:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- Slider --- */
.slider {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 1.25rem;
  cursor: pointer;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.slider input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 0.25rem;
  background: var(--muted);
  border-radius: 9999px;
  outline: none;
  cursor: pointer;
}
.slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 9999px;
  background: white;
  border: 1px solid var(--ring);
  cursor: pointer;
  transition: box-shadow 0.15s;
}
.slider input[type="range"]::-moz-range-thumb {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 9999px;
  background: white;
  border: 1px solid var(--ring);
  cursor: pointer;
}
.slider input[type="range"]:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring), transparent 50%);
}
.slider input[type="range"]::-webkit-slider-runnable-track {
  height: 0.25rem;
  border-radius: 9999px;
}
.slider input[type="range"]::-moz-range-track {
  height: 0.25rem;
  border-radius: 9999px;
  background: var(--muted);
}
.slider input[type="range"]::-moz-range-progress {
  background: var(--primary);
  border-radius: 9999px;
  height: 0.25rem;
}
.slider-label {
  font-size: 0.875rem;
  font-weight: 500;
}
.slider-value {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

/* --- Popover --- */
.popover {
  position: relative;
  display: inline-flex;
}
.popover-content {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) scale(0.95);
  z-index: 50;
  min-width: 12rem;
  background-color: var(--popover);
  color: var(--popover-foreground);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
  outline: 1px solid color-mix(in oklch, var(--foreground), transparent 90%);
  padding: 0.625rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  font-size: 0.875rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s, transform 0.1s;
}
.popover-content.open {
  opacity: 1;
  transform: translateX(-50%) scale(1);
  pointer-events: auto;
}
.popover-content.align-start {
  left: 0;
  transform: scale(0.95);
}
.popover-content.align-start.open {
  transform: scale(1);
}
.popover-content.align-end {
  left: auto;
  right: 0;
  transform: scale(0.95);
}
.popover-content.align-end.open {
  transform: scale(1);
}
.popover-header {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
.popover-title {
  font-weight: 500;
}
.popover-description {
  color: var(--muted-foreground);
}

/* --- Hover Card --- */
.hover-card {
  position: relative;
  display: inline-flex;
}
.hover-card-content {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(0.95);
  z-index: 50;
  width: 16rem;
  background-color: var(--popover);
  color: var(--popover-foreground);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
  outline: 1px solid color-mix(in oklch, var(--foreground), transparent 90%);
  padding: 0.625rem;
  font-size: 0.875rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
}
.hover-card:hover .hover-card-content,
.hover-card-content:hover {
  opacity: 1;
  transform: translateX(-50%) scale(1);
  pointer-events: auto;
}

/* --- Context Menu --- */
.context-menu-content {
  position: fixed;
  z-index: 50;
  min-width: 8rem;
  background-color: var(--popover);
  color: var(--popover-foreground);
  border-radius: var(--radius-lg);
  padding: 0.25rem;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
  outline: 1px solid color-mix(in oklch, var(--foreground), transparent 90%);
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
  transition: opacity 0.1s, transform 0.1s;
}
.context-menu-content.open {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}
.context-menu-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.375rem;
  font-size: 0.875rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  outline: none;
  border: none;
  background: none;
  color: inherit;
  width: 100%;
  text-align: left;
  transition: background-color 0.1s;
}
.context-menu-item:hover,
.context-menu-item:focus {
  background-color: var(--accent);
  color: var(--accent-foreground);
  outline: none;
}
.context-menu-item svg { width: 1rem; height: 1rem; flex-shrink: 0; }
.context-menu-item[data-variant="destructive"] { color: var(--destructive); }
.context-menu-item[data-variant="destructive"]:hover {
  background-color: color-mix(in oklch, var(--destructive), transparent 90%);
}
.context-menu-label {
  padding: 0.25rem 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
}
.context-menu-separator {
  height: 1px;
  margin: 0.25rem -0.25rem;
  background-color: var(--border);
}
.context-menu-shortcut {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  letter-spacing: 0.05em;
}

/* --- Collapsible --- */
.collapsible-content {
  overflow: hidden;
  transition: height 0.2s ease-out;
}
.collapsible-content[hidden] {
  display: none;
}

/* --- Scroll Area --- */
.scroll-area {
  position: relative;
  overflow: hidden;
}
.scroll-area-viewport {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in oklch, var(--foreground), transparent 80%) transparent;
}
.scroll-area-viewport::-webkit-scrollbar {
  width: 0.5rem;
}
.scroll-area-viewport::-webkit-scrollbar-track {
  background: transparent;
}
.scroll-area-viewport::-webkit-scrollbar-thumb {
  background: color-mix(in oklch, var(--foreground), transparent 80%);
  border-radius: 9999px;
}

/* --- Pagination --- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
}
.pagination-content {
  display: flex;
  align-items: center;
  gap: 0.125rem;
}
.pagination-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--foreground);
  cursor: pointer;
  outline: none;
  transition: background-color 0.1s;
  text-decoration: none;
}
.pagination-item:hover {
  background-color: var(--muted);
}
.pagination-item.active {
  border-color: var(--border);
  background-color: var(--background);
}
.pagination-item:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring), transparent 50%);
}
.pagination-item svg { width: 1rem; height: 1rem; }
.pagination-item:disabled,
.pagination-item.disabled {
  opacity: 0.5;
  pointer-events: none;
}
.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}
.pagination-prev { padding-left: 0.375rem; }
.pagination-next { padding-right: 0.375rem; }

/* --- Carousel --- */
.carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
}
.carousel-viewport {
  overflow: hidden;
}
.carousel-container {
  display: flex;
  transition: transform 0.3s ease;
}
.carousel-slide {
  flex: 0 0 100%;
  min-width: 0;
}
.carousel-prev,
.carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
}
.carousel-prev {
  left: 0.5rem;
}
.carousel-next {
  right: 0.5rem;
}
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.375rem;
  margin-top: 0.75rem;
}
.carousel-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  border: none;
  background-color: var(--muted);
  cursor: pointer;
  padding: 0;
  transition: background-color 0.15s;
}
.carousel-dot.active {
  background-color: var(--primary);
}

/* --- Navigation Menu --- */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 0;
}
.nav-menu-list {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
}
.nav-menu-item {
  position: relative;
}
.nav-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.375rem 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  background: transparent;
  border: none;
  border-radius: var(--radius-lg);
  color: var(--foreground);
  cursor: pointer;
  outline: none;
  transition: background-color 0.15s;
}
.nav-menu-trigger:hover,
.nav-menu-trigger[aria-expanded="true"] {
  background-color: var(--muted);
}
.nav-menu-trigger:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring), transparent 50%);
}
.nav-menu-trigger-icon {
  width: 0.75rem;
  height: 0.75rem;
  color: var(--muted-foreground);
  transition: transform 0.2s;
}
.nav-menu-trigger[aria-expanded="true"] .nav-menu-trigger-icon {
  transform: rotate(180deg);
}
.nav-menu-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  font-size: 0.875rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--foreground);
  transition: background-color 0.15s;
}
.nav-menu-link:hover {
  background-color: var(--muted);
}
.nav-menu-content {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 50;
  min-width: 14rem;
  background-color: var(--popover);
  color: var(--popover-foreground);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
  outline: 1px solid color-mix(in oklch, var(--foreground), transparent 90%);
  padding: 0.25rem;
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
  transition: opacity 0.1s, transform 0.1s;
}
.nav-menu-content.open {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}
.nav-menu-content-wide {
  min-width: 24rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
}

/* --- Sidebar --- */
.sidebar-layout {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 16rem;
  flex-shrink: 0;
  background-color: var(--sidebar);
  color: var(--sidebar-foreground);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  transition: width 0.2s ease, margin 0.2s ease;
  overflow: hidden;
}
.sidebar.collapsed {
  width: 3.5rem;
}
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
}
.sidebar-content {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
}
.sidebar-content::-webkit-scrollbar {
  display: none;
}
.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem;
}
.sidebar-group {
  padding: 0.5rem;
}
.sidebar-group-label {
  display: flex;
  align-items: center;
  height: 2rem;
  padding: 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: color-mix(in oklch, var(--sidebar-foreground), transparent 30%);
  border-radius: var(--radius-md);
}
.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 0;
  list-style: none;
}
.sidebar-menu-item {
  position: relative;
}
.sidebar-menu-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  height: 2rem;
  padding: 0.5rem;
  font-size: 0.875rem;
  text-align: left;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--sidebar-foreground);
  cursor: pointer;
  outline: none;
  transition: background-color 0.1s;
  text-decoration: none;
}
.sidebar-menu-button:hover {
  background-color: var(--sidebar-accent);
  color: var(--sidebar-accent-foreground);
}
.sidebar-menu-button.active {
  background-color: var(--sidebar-accent);
  color: var(--sidebar-accent-foreground);
  font-weight: 500;
}
.sidebar-menu-button:focus-visible {
  box-shadow: 0 0 0 2px var(--sidebar-ring);
}
.sidebar-menu-button svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}
.sidebar-separator {
  height: 1px;
  background-color: var(--sidebar-border);
  margin: 0 0.5rem;
}
.sidebar-inset {
  flex: 1;
  background-color: var(--background);
}
.sidebar-toggle {
  position: absolute;
  top: 0.75rem;
  right: -0.75rem;
  z-index: 10;
}

/* --- Calendar --- */
.calendar {
  padding: 0.5rem;
  font-size: 0.875rem;
}
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.25rem;
  margin-bottom: 0.5rem;
}
.calendar-title {
  font-size: 0.875rem;
  font-weight: 500;
}
.calendar-grid {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
}
.calendar-grid th {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
  padding: 0.25rem;
  width: calc(100% / 7);
}
.calendar-grid td {
  padding: 1px;
}
.calendar-day {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  font-size: 0.8125rem;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--foreground);
  cursor: pointer;
  outline: none;
  transition: background-color 0.1s;
}
.calendar-day:hover {
  background-color: var(--muted);
}
.calendar-day.today {
  background-color: var(--accent);
  color: var(--accent-foreground);
  font-weight: 600;
}
.calendar-day.selected {
  background-color: var(--primary);
  color: var(--primary-foreground);
}
.calendar-day.outside {
  color: var(--muted-foreground);
  opacity: 0.5;
}
.calendar-day:disabled {
  opacity: 0.3;
  pointer-events: none;
}
.calendar-day:focus-visible {
  box-shadow: 0 0 0 2px var(--ring);
}

/* --- Breadcrumb --- */
.breadcrumb {
  display: flex;
  align-items: center;
}
.breadcrumb-list {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  list-style: none;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}
.breadcrumb-item {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}
.breadcrumb-link {
  color: var(--muted-foreground);
  text-decoration: none;
  transition: color 0.15s;
}
.breadcrumb-link:hover {
  color: var(--foreground);
}
.breadcrumb-page {
  color: var(--foreground);
  font-weight: 400;
}
.breadcrumb-separator {
  display: inline-flex;
  color: var(--muted-foreground);
}
.breadcrumb-separator svg { width: 0.875rem; height: 0.875rem; }
.breadcrumb-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
}

/* --- Toggle Group --- */
.toggle-group {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border-radius: var(--radius-lg);
}
.toggle-group .toggle {
  border-radius: 0;
}
.toggle-group .toggle:first-child {
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}
.toggle-group .toggle:last-child {
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}
.toggle-group-outline .toggle {
  border-color: var(--input);
  border-right-width: 0;
}
.toggle-group-outline .toggle:last-child {
  border-right-width: 1px;
}

/* --- Kbd (Keyboard Shortcut) --- */
.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 1.25rem;
  min-width: 1.25rem;
  padding: 0 0.25rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  background-color: var(--muted);
  color: var(--muted-foreground);
  border-radius: var(--radius-sm);
  gap: 0.25rem;
}
.kbd svg { width: 0.75rem; height: 0.75rem; }

/* --- Collapsible (visual) --- */
.collapsible-trigger-icon {
  width: 1rem;
  height: 1rem;
  transition: transform 0.2s;
}
.collapsible-trigger[aria-expanded="true"] .collapsible-trigger-icon {
  transform: rotate(90deg);
}

/* --- Resizable Panels --- */
.resizable {
  display: flex;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.resizable-panel {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.resizable-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 0.75rem;
  flex-shrink: 0;
  background: transparent;
  border: none;
  cursor: col-resize;
  transition: background-color 0.1s;
  position: relative;
}
.resizable-handle:hover {
  background-color: var(--muted);
}
.resizable-handle::after {
  content: "";
  width: 0.25rem;
  height: 1.5rem;
  border-radius: var(--radius-lg);
  background-color: var(--border);
}

/* --- Empty State --- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-xl);
  text-align: center;
}
.empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-lg);
  background-color: var(--muted);
  color: var(--foreground);
}
.empty-icon svg { width: 1rem; height: 1rem; }
.empty-title {
  font-size: 0.875rem;
  font-weight: 500;
}
.empty-description {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.625;
}

/* --- Command Palette --- */
.command-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background-color: rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s;
}
.command-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.command-dialog {
  position: fixed;
  left: 50%;
  top: 15%;
  z-index: 51;
  transform: translateX(-50%) scale(0.95);
  opacity: 0;
  width: 32rem;
  max-width: calc(100% - 2rem);
  background-color: var(--popover);
  color: var(--popover-foreground);
  border-radius: var(--radius-xl);
  box-shadow: 0 10px 25px rgba(0,0,0,.15);
  outline: 1px solid color-mix(in oklch, var(--foreground), transparent 90%);
  overflow: hidden;
  pointer-events: none;
  transition: opacity 0.1s, transform 0.1s;
}
.command-dialog.open {
  opacity: 1;
  transform: translateX(-50%) scale(1);
  pointer-events: auto;
}
.command-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.command-input-wrapper svg {
  width: 1rem;
  height: 1rem;
  color: var(--muted-foreground);
  flex-shrink: 0;
}
.command-input {
  flex: 1;
  height: 2rem;
  border: none;
  background: transparent;
  font-size: 0.875rem;
  color: var(--foreground);
  outline: none;
  font-family: inherit;
}
.command-input::placeholder {
  color: var(--muted-foreground);
}
.command-list {
  max-height: 18rem;
  overflow-y: auto;
  padding: 0.25rem;
  scrollbar-width: none;
}
.command-list::-webkit-scrollbar { display: none; }
.command-group-heading {
  padding: 0.375rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
}
.command-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.5rem;
  font-size: 0.875rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  outline: none;
  transition: background-color 0.1s;
}
.command-item:hover,
.command-item.highlighted {
  background-color: var(--muted);
  color: var(--foreground);
}
.command-item svg { width: 1rem; height: 1rem; flex-shrink: 0; }
.command-item-shortcut {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}
.command-separator {
  height: 1px;
  margin: 0.25rem -0.25rem;
  background-color: var(--border);
}
.command-empty {
  display: flex;
  justify-content: center;
  padding: 1.5rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

} /* end @layer base */
