/* Lucide icons (shadcn's icon set) drawn for the existing Font Awesome classes */
@import url('lucide-icons.css');

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  line-height: 1;
  padding: 0.5rem 1rem;
  height: 2.25rem;
  transition: background-color var(--transition-base),
              color var(--transition-base),
              border-color var(--transition-base),
              box-shadow var(--transition-base),
              opacity var(--transition-base);
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid transparent;
  text-decoration: none;
  user-select: none;
}

.btn:focus-visible {
  outline: none;
  border-color: var(--ring-strong);
  box-shadow: 0 0 0 3px var(--ring);
}

.btn:disabled,
.btn[disabled] {
  pointer-events: none;
  opacity: 0.5;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-secondary {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
  border-color: var(--border);
}

.btn-secondary:hover {
  background-color: var(--muted);
}

.btn-outline {
  background-color: transparent;
  color: var(--foreground);
  border-color: var(--border);
}

.btn-outline:hover {
  background-color: var(--accent);
  color: var(--accent-foreground);
}

.btn-ghost {
  background-color: transparent;
  color: var(--foreground);
}

.btn-ghost:hover {
  background-color: var(--accent);
  color: var(--accent-foreground);
}

.btn-destructive {
  background-color: var(--destructive);
  color: var(--destructive-foreground);
}

.btn-destructive:hover {
  background-color: oklch(0.52 0.2 27);
}

.btn-success {
  background-color: var(--success);
  color: var(--success-foreground);
}

.btn-success:hover {
  background-color: oklch(0.58 0.19 145);
}

.btn-link {
  background-color: transparent;
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 4px;
  padding: 0;
  height: auto;
}

.btn-link:hover {
  text-decoration: none;
}

.btn-xs {
  padding: 0.25rem 0.5rem;
  height: 1.75rem;
  font-size: var(--font-size-xs);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  height: 2rem;
  font-size: var(--font-size-xs);
}

.btn-lg {
  padding: 0.625rem 1.5rem;
  height: 2.75rem;
  font-size: var(--font-size-base);
}

.btn-xl {
  padding: 0.75rem 2rem;
  height: 3rem;
  font-size: var(--font-size-lg);
}

.btn-icon {
  padding: 0;
  width: 2.25rem;
  height: 2.25rem;
}

.btn-icon.btn-sm {
  width: 2rem;
  height: 2rem;
}

.btn-icon.btn-lg {
  width: 2.75rem;
  height: 2.75rem;
}

.btn-full {
  width: 100%;
}


.card {
  background-color: var(--card);
  color: var(--card-foreground);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  padding: var(--spacing-lg);
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  letter-spacing: -0.025em;
  margin: 0;
}

.card-description {
  font-size: var(--font-size-sm);
  color: var(--muted-foreground);
  margin: 0;
}

.card-content {
  padding: var(--spacing-lg);
  padding-top: 0;
}

.card-content:first-child {
  padding-top: var(--spacing-lg);
}

.card-footer {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-lg);
  padding-top: 0;
}

.card-bordered {
  border: 1px solid var(--border);
}

.card-elevated {
  box-shadow: var(--shadow-md);
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  padding: var(--spacing-md);
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.stat-card-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-card-value {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--foreground);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.stat-card-unit {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-normal);
  color: var(--muted-foreground);
  margin-left: var(--spacing-xs);
}

.stat-card-change {
  font-size: var(--font-size-xs);
  display: flex;
  align-items: center;
  gap: 2px;
}

.stat-card-change.positive {
  color: var(--success);
}

.stat-card-change.negative {
  color: var(--destructive);
}

.stat-card[data-status="success"] {
  border-left: 3px solid var(--success);
}

.stat-card[data-status="warning"] {
  border-left: 3px solid var(--warning);
}

.stat-card[data-status="error"] {
  border-left: 3px solid var(--destructive);
}

.stat-card[data-status="info"] {
  border-left: 3px solid var(--info);
}


.input {
  display: flex;
  width: 100%;
  height: 2.25rem;
  padding: 0.25rem 0.75rem;
  box-shadow: var(--shadow-xs);
  border-radius: var(--radius-md);
  border: 1px solid var(--input-border);
  background-color: var(--input);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: var(--font-size-sm);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.input::placeholder {
  color: var(--muted-foreground);
}

.input:focus {
  outline: none;
  border-color: var(--ring-strong);
  box-shadow: 0 0 0 3px var(--ring);
}

.input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.input-sm {
  height: 2rem;
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: var(--font-size-xs);
}

.input-lg {
  height: 3rem;
  padding: var(--spacing-md) var(--spacing-lg);
  font-size: var(--font-size-base);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper .input {
  padding-left: 2.5rem;
}

.input-wrapper .input-icon {
  position: absolute;
  left: var(--spacing-md);
  color: var(--muted-foreground);
  pointer-events: none;
}

.textarea {
  display: flex;
  width: 100%;
  min-height: 4rem;
  padding: 0.5rem 0.75rem;
  box-shadow: var(--shadow-xs);
  border-radius: var(--radius-md);
  border: 1px solid var(--input-border);
  background-color: var(--input);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: var(--font-size-sm);
  resize: vertical;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.textarea:focus {
  outline: none;
  border-color: var(--ring-strong);
  box-shadow: 0 0 0 3px var(--ring);
}


.select {
  display: flex;
  width: 100%;
  height: 2.25rem;
  padding: 0.25rem 0.75rem;
  padding-right: 2.25rem;
  box-shadow: var(--shadow-xs);
  border-radius: var(--radius-md);
  border: 1px solid var(--input-border);
  background-color: var(--input);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: var(--font-size-sm);
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.25rem;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.select:focus {
  outline: none;
  border-color: var(--ring-strong);
  box-shadow: 0 0 0 3px var(--ring);
}

.select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.select option {
  background-color: var(--popover);
  color: var(--popover-foreground);
}


.label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--foreground);
  margin-bottom: var(--spacing-xs);
}

.label-required::after {
  content: ' *';
  color: var(--destructive);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.form-description {
  font-size: var(--font-size-xs);
  color: var(--muted-foreground);
}

.form-error {
  font-size: var(--font-size-xs);
  color: var(--destructive);
}


.table-container {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.table {
  width: 100%;
  caption-side: bottom;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

.table caption {
  margin-top: var(--spacing-md);
  font-size: var(--font-size-sm);
  color: var(--muted-foreground);
}

.table th {
  height: 2.75rem;
  padding: var(--spacing-sm) var(--spacing-md);
  text-align: left;
  font-weight: var(--font-weight-medium);
  color: var(--muted-foreground);
  background-color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: var(--spacing-sm) var(--spacing-md);
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}

.table tbody tr {
  transition: background-color var(--transition-fast);
}

.table tbody tr:hover {
  background-color: var(--muted);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table-brand th {
  background-color: var(--table-header);
  color: var(--table-header-foreground);
}

.table-brand tbody tr:nth-child(odd) {
  background-color: var(--table-row-odd);
}

.table-brand tbody tr:hover {
  background-color: var(--table-row-hover);
}

.table-compact th,
.table-compact td {
  padding: var(--spacing-xs) var(--spacing-sm);
}

.table-compact th {
  height: 2.25rem;
}

.table td input,
.table td select {
  width: 100%;
  background: transparent;
  border: none;
  color: inherit;
  font-size: inherit;
  padding: var(--spacing-xs);
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.table td input:focus,
.table td select:focus {
  outline: none;
  background-color: var(--input);
  box-shadow: 0 0 0 1px var(--primary);
}


.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  line-height: 1.4;
  white-space: nowrap;
}

.badge-default {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
}

.badge-primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.badge-secondary {
  background-color: var(--muted);
  color: var(--muted-foreground);
  border: 1px solid var(--border);
}

.badge-success {
  background-color: oklch(from var(--success) l c h / 0.15);
  color: var(--success);
}

.badge-warning {
  background-color: oklch(from var(--warning) l c h / 0.15);
  color: var(--warning);
}

.badge-destructive {
  background-color: oklch(from var(--destructive) l c h / 0.15);
  color: var(--destructive);
}

.badge-info {
  background-color: oklch(from var(--info) l c h / 0.15);
  color: var(--info);
}

.badge-outline {
  background-color: transparent;
  border: 1px solid var(--border);
  color: var(--foreground);
}


.dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal-backdrop);
  background-color: oklch(0 0 0 / 0.5);
  animation: fade-in 0.15s ease-out;
}

.dialog-content {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: var(--z-modal);
  transform: translate(-50%, -50%);
  width: calc(100% - 2rem);
  max-width: 32rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  background-color: var(--popover);
  border: 1px solid var(--popover-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-xl);
  animation: dialog-in 0.2s ease-out;
}

.dialog-content-lg {
  max-width: 48rem;
}

.dialog-content-xl {
  max-width: 64rem;
}

.dialog-content-full {
  max-width: calc(100vw - 2rem);
  width: calc(100vw - 2rem);
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translate(-50%, -48%) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.dialog-header {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  margin-bottom: var(--spacing-lg);
}

.dialog-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-md);
}

.dialog-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--foreground);
  margin: 0;
}

.dialog-description {
  font-size: var(--font-size-sm);
  color: var(--muted-foreground);
  margin: 0;
}

.dialog-body {
  margin-bottom: var(--spacing-lg);
}

.dialog-footer {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  gap: var(--spacing-sm);
}

.dialog-close {
  position: absolute;
  top: var(--spacing-md);
  right: var(--spacing-md);
  padding: var(--spacing-xs);
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.dialog-close:hover {
  background-color: var(--muted);
  color: var(--foreground);
}


.toast-container {
  position: fixed;
  bottom: var(--spacing-lg);
  right: var(--spacing-lg);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  max-width: 24rem;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background-color: var(--popover);
  border: 1px solid var(--popover-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.3s ease-out;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast-icon {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  font-size: var(--font-size-base);
}

.toast-success .toast-icon {
  background-color: oklch(from var(--success) l c h / 0.15);
  color: var(--success);
}

.toast-error .toast-icon {
  background-color: oklch(from var(--destructive) l c h / 0.15);
  color: var(--destructive);
}

.toast-warning .toast-icon {
  background-color: oklch(from var(--warning) l c h / 0.15);
  color: var(--warning);
}

.toast-info .toast-icon {
  background-color: oklch(from var(--info) l c h / 0.15);
  color: var(--info);
}

.toast-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.toast-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--foreground);
}

.toast-description {
  font-size: var(--font-size-xs);
  color: var(--muted-foreground);
}

.toast-close {
  padding: var(--spacing-xs);
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--muted-foreground);
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.toast-close:hover {
  background-color: var(--muted);
  color: var(--foreground);
}


.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.switch-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-track {
  position: relative;
  width: 2.75rem;
  height: 1.5rem;
  background-color: var(--input);
  border-radius: var(--radius-full);
  transition: background-color var(--transition-base);
}

.switch-input:checked + .switch-track {
  background-color: var(--primary);
}

.switch-input:focus-visible + .switch-track {
  border-color: var(--ring-strong);
  box-shadow: 0 0 0 3px var(--ring);
}

.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.25rem;
  height: 1.25rem;
  background-color: var(--foreground);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-xs);
  transition: transform var(--transition-base);
}

.switch-input:checked + .switch-track .switch-thumb {
  transform: translateX(1.25rem);
}

.switch-label {
  margin-left: var(--spacing-sm);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--foreground);
}


.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: var(--z-dropdown);
  min-width: 10rem;
  padding: var(--spacing-xs);
  background-color: var(--popover);
  border: 1px solid var(--popover-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity var(--transition-fast),
              transform var(--transition-fast),
              visibility var(--transition-fast);
}

.dropdown.open .dropdown-content,
.dropdown:focus-within .dropdown-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(var(--spacing-xs));
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  color: var(--popover-foreground);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background-color var(--transition-fast);
}

.dropdown-item:hover {
  background-color: var(--accent);
}

.dropdown-item.destructive {
  color: var(--destructive);
}

.dropdown-item.destructive:hover {
  background-color: oklch(from var(--destructive) l c h / 0.1);
}

.dropdown-separator {
  height: 1px;
  margin: var(--spacing-xs) 0;
  background-color: var(--border);
}


.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  padding: var(--spacing-sm);
}

.sidebar-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-md);
  color: var(--sidebar-foreground);
  text-decoration: none;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.sidebar-nav-item:hover {
  background-color: var(--sidebar-accent);
  color: var(--sidebar-accent-foreground);
}

.sidebar-nav-item.active {
  background-color: var(--sidebar-primary);
  color: var(--sidebar-primary-foreground);
}

.sidebar-nav-item i,
.sidebar-nav-item svg {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
}

.sidebar-section-title {
  padding: var(--spacing-md) var(--spacing-md) var(--spacing-xs);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--sidebar-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}


.separator {
  height: 1px;
  width: 100%;
  background-color: var(--border);
}

.separator-vertical {
  height: auto;
  width: 1px;
  align-self: stretch;
}


.avatar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-full);
  overflow: hidden;
  background-color: var(--muted);
  color: var(--muted-foreground);
  font-weight: var(--font-weight-medium);
  flex-shrink: 0;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-sm {
  width: 2rem;
  height: 2rem;
  font-size: var(--font-size-xs);
}

.avatar-lg {
  width: 3rem;
  height: 3rem;
  font-size: var(--font-size-lg);
}

.avatar-xl {
  width: 4rem;
  height: 4rem;
  font-size: var(--font-size-xl);
}


.skeleton {
  background: linear-gradient(
    90deg,
    var(--muted) 25%,
    oklch(from var(--muted) calc(l + 0.05) c h) 50%,
    var(--muted) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}


.custom-scrollbar::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: var(--muted);
  border-radius: var(--radius-full);
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-full);
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: var(--muted-foreground);
}


.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;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-muted {
  color: var(--muted-foreground);
}

.text-primary {
  color: var(--primary);
}

.text-success {
  color: var(--success);
}

.text-warning {
  color: var(--warning);
}

.text-destructive {
  color: var(--destructive);
}

/* ===== Floating tool bar (Test Methods, Lab Notes, Email to Lab, Snapshots) =====
   shadcn-style ghost buttons in one fixed bar: same place and size at every width, colour-only transitions. */
.fab-bar {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.35), 0 4px 6px -4px rgb(0 0 0 / 0.35);
}

.fab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.fab-btn i {
  font-size: 13px;
  color: var(--muted-foreground);
  transition: color 0.15s ease;
}

.fab-btn:hover {
  background: var(--muted);
}

.fab-btn:hover i {
  color: var(--foreground);
}

.fab-btn:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 1px;
}

.fab-btn:active {
  transform: none;
}

@media (max-width: 768px) {
  .fab-bar {
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .fab-btn {
    width: 40px;
    height: 40px;
    padding: 0;
  }

  .fab-btn span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .fab-btn i {
    font-size: 15px;
  }
}


/* ============================================
   APP SHELL — one layout vocabulary for every screen
   Every tab (Blend Sheet, History, Library, Admin, Dashboard, ...)
   is built from these, so all sections read as one product.
   ============================================ */

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-md);
  flex-wrap: wrap;
  padding-bottom: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
  border-bottom: 1px solid var(--border);
}

.page-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: var(--font-weight-semibold);
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--foreground);
  text-transform: none;
}

.page-description {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted-foreground);
}

.page-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

/* Section: the one card used for every block of content */
.section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--spacing-lg);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-md);
  min-height: 52px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}

.section-title {
  margin: 0;
  font-size: 15px;
  font-weight: var(--font-weight-semibold);
  letter-spacing: -0.01em;
  color: var(--foreground);
}

.section-description {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted-foreground);
}

.section-body {
  padding: 20px;
}

.section-body.flush {
  padding: 0;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

.toolbar-spacer {
  flex: 1;
}

.toolbar-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.toolbar-separator {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 4px;
}

/* Data table: shadcn Table, same in History, Library, Admin, Dashboard */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  color: var(--foreground);
}

.data-table thead th {
  height: 40px;
  padding: 0 12px;
  text-align: left;
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  color: var(--muted-foreground);
  background: transparent;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  text-transform: none;
  letter-spacing: 0;
}

.data-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: var(--table-row-hover);
}

.data-table tbody tr.selected,
.data-table tbody tr[aria-selected="true"] {
  background: var(--muted);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
}

.stat-label {
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  color: var(--muted-foreground);
}

.stat-value {
  font-size: 1.5rem;
  font-weight: var(--font-weight-semibold);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--foreground);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 48px 16px;
  text-align: center;
  font-size: 14px;
  color: var(--muted-foreground);
}

.empty-state i {
  font-size: 20px;
  margin-bottom: 4px;
  opacity: 0.6;
}

html.embed body,
body.embed {
  background: var(--background);
}


.btn {
  height: 2.25rem;
  padding: 0 1rem;
  gap: 0.5rem;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  box-shadow: none;
  transform: none;
  background-image: none;
  text-shadow: none;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.btn i, .btn svg { font-size: 14px; width: 1em; flex-shrink: 0; }
.btn:hover, .btn:active { transform: none; }
.btn:focus-visible { outline: none; border-color: var(--ring-strong); box-shadow: 0 0 0 3px var(--ring); }

.btn-primary, .btn-default { background: var(--primary); color: var(--primary-foreground); border-color: transparent; }
.btn-primary:hover, .btn-default:hover { background: var(--primary-hover); color: var(--primary-foreground); }
.btn-secondary { background: var(--secondary); color: var(--secondary-foreground); border-color: transparent; }
.btn-secondary:hover { background: oklch(0.3 0 0); color: var(--secondary-foreground); }
.btn-outline { background: var(--input); color: var(--foreground); border: 1px solid var(--input-border); box-shadow: var(--shadow-xs); }
.btn-outline:hover { background: var(--accent); color: var(--accent-foreground); }
.btn-ghost { background: transparent; color: var(--foreground); border-color: transparent; }
.btn-ghost:hover { background: var(--accent); color: var(--accent-foreground); }
.btn-destructive { background: color-mix(in oklch, var(--destructive) 60%, transparent); color: #fff; border-color: transparent; }
.btn-destructive:hover { background: color-mix(in oklch, var(--destructive) 75%, transparent); color: #fff; }
.btn-success { background: var(--input); color: var(--foreground); border: 1px solid var(--input-border); }
.btn-success i { color: var(--success); }
.btn-success:hover { background: var(--accent); }
.btn-link { background: transparent; color: var(--foreground); height: auto; padding: 0; text-decoration: underline; text-underline-offset: 4px; }
.btn-link:hover { text-decoration-thickness: 2px; }

.btn-xs { height: 1.5rem; padding: 0 0.5rem; gap: 0.25rem; font-size: 12px; border-radius: var(--radius-sm); }
.btn-sm { height: 2rem; padding: 0 0.75rem; gap: 0.375rem; font-size: 13px; }
.btn-lg { height: 2.5rem; padding: 0 1.5rem; }
.btn-xl { height: 2.75rem; padding: 0 1.75rem; }
.btn-icon { width: 2.25rem; height: 2.25rem; padding: 0; }
.btn-icon.btn-sm { width: 2rem; height: 2rem; }
.btn-icon.btn-xs { width: 1.5rem; height: 1.5rem; }
.btn-icon.btn-lg { width: 2.5rem; height: 2.5rem; }
.btn:disabled, .btn[disabled], .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }

.btn-group { display: inline-flex; align-items: stretch; }
.btn-group > .btn { border-radius: 0; }
.btn-group > .btn:first-child { border-top-left-radius: var(--radius-md); border-bottom-left-radius: var(--radius-md); }
.btn-group > .btn:last-child { border-top-right-radius: var(--radius-md); border-bottom-right-radius: var(--radius-md); }
.btn-group > .btn + .btn { margin-left: -1px; }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: auto;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  line-height: 1.33;
  white-space: nowrap;
  width: fit-content;
}
.badge i { font-size: 11px; }
.badge-default, .badge-primary { background: var(--primary); color: var(--primary-foreground); }
.badge-secondary { background: var(--secondary); color: var(--secondary-foreground); border-color: transparent; }
.badge-outline { background: transparent; color: var(--foreground); border-color: var(--border); }
.badge-destructive { background: color-mix(in oklch, var(--destructive) 15%, transparent); color: var(--destructive); }
.badge-success { background: color-mix(in oklch, var(--success) 15%, transparent); color: var(--success); }
.badge-warning { background: color-mix(in oklch, var(--warning) 15%, transparent); color: var(--warning); }
.badge-info { background: color-mix(in oklch, var(--info) 15%, transparent); color: var(--info); }
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 9999px; background: currentColor; }

.alert {
  position: relative;
  display: grid;
  grid-template-columns: 0 1fr;
  align-items: start;
  gap: 2px 0;
  width: 100%;
  padding: 12px 16px;
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 14px;
}
.alert:has(> i, > svg) { grid-template-columns: 16px 1fr; column-gap: 12px; }
.alert > i, .alert > svg { font-size: 16px; transform: translateY(2px); color: currentColor; }
.alert-title { grid-column-start: 2; font-weight: var(--font-weight-medium); line-height: 1.4; letter-spacing: -0.01em; }
.alert-description { grid-column-start: 2; color: var(--muted-foreground); font-size: 14px; line-height: 1.6; }
.alert-destructive { color: var(--destructive); }
.alert-destructive .alert-description { color: color-mix(in oklch, var(--destructive) 85%, transparent); }
.alert-warning { color: var(--warning); }
.alert-success { color: var(--success); }
.alert-info { color: var(--info); }

/* Overlays sit above the app top bar (z 950), the tool bar (z 1000) and legacy layers (z 9999).
   They never set display: pages show/hide them with [hidden], classes or inline style. */
.dialog-overlay, .alert-dialog-overlay, .sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgb(0 0 0 / .5);
  backdrop-filter: none;
}
.dialog-overlay:not([hidden]):not([style*="display: none"]):not([style*="display:none"]) { display: flex; }
/* Content is centred by its overlay (flex), not by fixed positioning. */
.dialog-content {
  position: relative;
  top: auto;
  left: auto;
  transform: none;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  display: grid;
  gap: 16px;
  width: calc(100% - 2rem);
  max-width: 32rem;
  padding: 24px;
  background: var(--background);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: shadcn-zoom-in .2s ease-out;
}
.dialog-header { display: flex; flex-direction: column; gap: 6px; margin: 0; text-align: left; }
.dialog-title { font-size: 18px; font-weight: var(--font-weight-semibold); line-height: 1; letter-spacing: -0.01em; }
.dialog-description { font-size: 14px; color: var(--muted-foreground); line-height: 1.5; }
.dialog-body { margin: 0; }
.dialog-footer { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap-reverse; }
.dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--foreground);
  opacity: .7;
  transition: opacity .15s ease, background-color .15s ease;
}
.dialog-close:hover { opacity: 1; background: var(--accent); }

@keyframes shadcn-zoom-in { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: scale(1); } }
@keyframes shadcn-fade-in { from { opacity: 0; } to { opacity: 1; } }

.alert-dialog {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgb(0 0 0 / .5);
  backdrop-filter: none;
}
.alert-dialog-content {
  display: grid;
  gap: 16px;
  width: 100%;
  max-width: 32rem;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 24px;
  background: var(--background);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: shadcn-zoom-in .2s ease-out;
}
.alert-dialog-header { display: flex; flex-direction: column; gap: 8px; text-align: left; margin: 0; padding: 0; background: none; border: 0; }
.alert-dialog-title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 18px; font-weight: var(--font-weight-semibold); line-height: 1.3; color: var(--foreground); }
.alert-dialog-title i { font-size: 16px; color: var(--muted-foreground) !important; margin: 0 !important; }
.alert-dialog-description { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted-foreground); }
.alert-dialog-footer { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap-reverse; margin: 0; padding: 0; border: 0; background: none; }
.alert-dialog-cancel, .alert-dialog-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 2.25rem;
  padding: 0 1rem;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: background-color .15s ease, opacity .15s ease;
}
.alert-dialog-cancel { background: var(--input); color: var(--foreground); border: 1px solid var(--input-border); box-shadow: var(--shadow-xs); }
.alert-dialog-cancel:hover { background: var(--accent); }
.alert-dialog-action { background: var(--primary) !important; color: var(--primary-foreground); border: 1px solid transparent; }
.alert-dialog-action:hover { background: var(--primary-hover) !important; }
.alert-dialog-action.destructive, .alert-dialog-action-destructive { background: color-mix(in oklch, var(--destructive) 60%, transparent) !important; color: #fff; }
.alert-dialog-action i, .alert-dialog-cancel i { margin: 0 !important; font-size: 14px; }

.sheet-content {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 75%;
  max-width: 24rem;
  height: 100%;
  background: var(--background);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}
.sheet-content.left { right: auto; left: 0; border-left: 0; border-right: 1px solid var(--border); }
.sheet-header { display: flex; flex-direction: column; gap: 6px; padding: 16px; }
.sheet-title { font-size: 16px; font-weight: var(--font-weight-semibold); }
.sheet-description { font-size: 14px; color: var(--muted-foreground); }
.sheet-footer { display: flex; flex-direction: column; gap: 8px; margin-top: auto; padding: 16px; }

.card {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 0;
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}
.card-header { display: grid; gap: 6px; padding: 0 24px; margin: 0; border: 0; }
.card-title { font-size: 16px; font-weight: var(--font-weight-semibold); line-height: 1; letter-spacing: -0.01em; }
.card-description { font-size: 14px; color: var(--muted-foreground); }
.card-content { padding: 0 24px; }
.card-footer { display: flex; align-items: center; padding: 0 24px; border: 0; }
.card-action { grid-column-start: 2; grid-row: 1 / span 2; justify-self: end; align-self: start; }

.input, .textarea, .select {
  border-radius: var(--radius-md);
  border: 1px solid var(--input-border);
  background-color: var(--input);
  color: var(--foreground);
  font-size: 14px;
  box-shadow: var(--shadow-xs);
}
.input { height: 2.25rem; padding: 0.25rem 0.75rem; }
.input-sm, .select.input-sm { height: 2rem; font-size: 13px; }
.input[aria-invalid="true"], .textarea[aria-invalid="true"], .select[aria-invalid="true"], .is-invalid {
  border-color: var(--destructive) !important;
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--destructive) 40%, transparent) !important;
}
.input[type="file"] { padding: 0.375rem 0.75rem; font-size: 13px; }
.input[type="file"]::file-selector-button { border: 0; background: transparent; color: var(--foreground); font-weight: 500; margin-right: 8px; }

.input-group {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 2.25rem;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  background: var(--input);
  box-shadow: var(--shadow-xs);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input-group:focus-within { border-color: var(--ring-strong); box-shadow: 0 0 0 3px var(--ring); }
.input-group > input, .input-group > .input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 0.75rem;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.input-group-addon { display: inline-flex; align-items: center; gap: 6px; padding: 0 0.75rem; color: var(--muted-foreground); font-size: 14px; }
.input-group-addon + input, .input-group-addon + .input { padding-left: 0; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field-row { flex-direction: row; align-items: center; gap: 12px; }
.field-label, .label { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; font-weight: var(--font-weight-medium); line-height: 1; color: var(--foreground); }
.field-description, .form-description { font-size: 13px; line-height: 1.45; color: var(--muted-foreground); }
.field-error, .form-error { font-size: 13px; color: var(--destructive); }
.field-group { display: flex; flex-direction: column; gap: 24px; }
.field-set { display: flex; flex-direction: column; gap: 16px; border: 0; padding: 0; margin: 0; }
.field-legend { margin-bottom: 4px; font-size: 16px; font-weight: var(--font-weight-medium); }
.form-group { gap: 8px; }

.checkbox, :where(input[type="checkbox"]) {
  appearance: none;
  -webkit-appearance: none;
  display: inline-grid;
  place-content: center;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  background: var(--input);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.checkbox:checked, :where(input[type="checkbox"]):checked {
  background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' 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") center / 12px no-repeat;
  border-color: var(--primary);
}
.checkbox:indeterminate, :where(input[type="checkbox"]):indeterminate {
  background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E") center / 12px no-repeat;
  border-color: var(--primary);
}
.radio, :where(input[type="radio"]) {
  appearance: none;
  -webkit-appearance: none;
  display: inline-grid;
  place-content: center;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--input-border);
  border-radius: 9999px;
  background: var(--input);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
}
.radio:checked, :where(input[type="radio"]):checked { border-color: var(--primary); background: radial-gradient(circle, var(--primary) 0 4px, transparent 4.5px); }
.checkbox:focus-visible, .radio:focus-visible,
:where(input[type="checkbox"], input[type="radio"]):focus-visible { outline: none; border-color: var(--ring-strong); box-shadow: 0 0 0 3px var(--ring); }
.checkbox:disabled, .radio:disabled,
:where(input[type="checkbox"], input[type="radio"]):disabled { opacity: .5; cursor: not-allowed; }

.switch-track {
  width: 2rem;
  height: 1.15rem;
  border: 1px solid transparent;
  background: var(--input-border);
  box-shadow: var(--shadow-xs);
}
.switch-thumb { top: 50%; left: 1px; width: 1rem; height: 1rem; margin-top: -0.5rem; background: var(--foreground); box-shadow: none; }
.switch-input:checked + .switch-track { background: var(--primary); }
.switch-input:checked + .switch-track .switch-thumb { transform: translateX(calc(2rem - 1rem - 4px)); }
.switch-input:disabled + .switch-track { opacity: .5; cursor: not-allowed; }
.switch-label { font-size: 14px; }
.form-group .switch {
  display: inline-flex;
  width: auto;
  margin-bottom: 0;
}

.tabs-list, .toggle-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 36px;
  padding: 3px;
  background: var(--muted);
  border-radius: var(--radius-lg);
  color: var(--muted-foreground);
}
.tabs-trigger, .toggle-group-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 100%;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--muted-foreground);
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
  cursor: pointer;
  transition: color .15s ease, background-color .15s ease;
}
.tabs-trigger:hover, .toggle-group-item:hover { color: var(--foreground); }
.tabs-trigger.active, .tabs-trigger[aria-selected="true"], .tabs-trigger[data-state="active"],
.toggle-group-item.active, .toggle-group-item[aria-pressed="true"] {
  background: var(--background);
  border-color: var(--input-border);
  color: var(--foreground);
  box-shadow: var(--shadow-xs);
}
.tabs-content { padding-top: 8px; }

.toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 2.25rem;
  min-width: 2.25rem;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--foreground);
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  cursor: pointer;
}
.toggle:hover { background: var(--muted); color: var(--muted-foreground); }
.toggle.active, .toggle[aria-pressed="true"] { background: var(--accent); color: var(--accent-foreground); }
.toggle-outline { border-color: var(--input-border); box-shadow: var(--shadow-xs); }

.dropdown-content, .context-menu, .popover-content, .menu {
  min-width: 8rem;
  padding: 4px;
  background: var(--popover);
  color: var(--popover-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}
.popover-content { width: 18rem; padding: 16px; }
.dropdown-item, .context-menu-item, .menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 32px;
  padding: 6px 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--popover-foreground);
  font-size: 14px;
  text-align: left;
  text-decoration: none;
  cursor: default;
  user-select: none;
}
.dropdown-item i, .context-menu-item i, .menu-item i { width: 16px; font-size: 14px; color: var(--muted-foreground); text-align: center; }
.dropdown-item:hover, .dropdown-item:focus-visible, .dropdown-item.highlighted,
.context-menu-item:hover, .menu-item:hover { background: var(--accent); color: var(--accent-foreground); outline: none; box-shadow: none; }
.dropdown-item.destructive, .dropdown-item-destructive, .context-menu-item.destructive { color: var(--destructive); }
.dropdown-item.destructive i, .dropdown-item-destructive i, .context-menu-item.destructive i { color: var(--destructive); }
.dropdown-item.destructive:hover, .dropdown-item-destructive:hover, .context-menu-item.destructive:hover { background: color-mix(in oklch, var(--destructive) 10%, transparent); color: var(--destructive); }
.dropdown-item[aria-disabled="true"], .dropdown-item:disabled { opacity: .5; pointer-events: none; }
.dropdown-label { padding: 6px 8px; font-size: 14px; font-weight: var(--font-weight-medium); }
.dropdown-separator, .context-menu-separator, .menu-separator { height: 1px; margin: 4px -4px; background: var(--border); }
.dropdown-shortcut { margin-left: auto; font-size: 12px; letter-spacing: .1em; color: var(--muted-foreground); }

.tooltip-content {
  z-index: var(--z-tooltip);
  width: fit-content;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  background: var(--foreground);
  color: var(--background);
  font-size: 12px;
  line-height: 1.4;
  text-wrap: balance;
  box-shadow: none;
}

.table-container { border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--card); overflow: auto; }
.table, .data-table { width: 100%; border-collapse: collapse; caption-side: bottom; font-size: 14px; color: var(--foreground); }
.table thead th, .table th, .data-table thead th {
  height: 40px;
  padding: 0 8px;
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  color: var(--foreground);
  background: transparent;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  text-transform: none;
  letter-spacing: 0;
}
.table th:first-child, .table td:first-child, .data-table th:first-child, .data-table td:first-child { padding-left: 16px; }
.table th:last-child, .table td:last-child, .data-table th:last-child, .data-table td:last-child { padding-right: 16px; }
.table td, .data-table tbody td { padding: 8px; vertical-align: middle; border-bottom: 1px solid var(--border); white-space: normal; }
.table tbody tr, .data-table tbody tr { transition: background-color .15s ease; }
.table tbody tr:hover, .data-table tbody tr:hover { background: color-mix(in oklch, var(--muted) 50%, transparent); }
.table tbody tr:last-child td, .data-table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.selected, .table tbody tr[data-state="selected"],
.data-table tbody tr.selected, .data-table tbody tr[data-state="selected"] { background: var(--muted); }
.table tfoot, .data-table tfoot { background: color-mix(in oklch, var(--muted) 50%, transparent); border-top: 1px solid var(--border); font-weight: var(--font-weight-medium); }
.table caption, .data-table caption { margin-top: 16px; font-size: 14px; color: var(--muted-foreground); }
.table-brand th { background: var(--table-header); color: var(--table-header-foreground); }
.table-compact th { height: 32px; }
.table-compact td { padding: 4px 8px; }

.toast-container { z-index: 10100; bottom: 24px; right: 24px; gap: 14px; max-width: 356px; width: calc(100% - 32px); }
.toast {
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 16px;
  background: var(--popover);
  color: var(--popover-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  animation: shadcn-toast-in .3s ease-out;
}
.toast-icon { width: 16px; height: 16px; border-radius: 0; background: none !important; font-size: 16px; }
.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--destructive); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info .toast-icon { color: var(--info); }
.toast-title { font-size: 14px; font-weight: var(--font-weight-medium); line-height: 1.5; }
.toast-description { font-size: 13px; line-height: 1.4; color: var(--muted-foreground); }
@keyframes shadcn-toast-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

.accordion-item { border-bottom: 1px solid var(--border); }
.accordion-item:last-child { border-bottom: 0; }
.accordion-trigger {
  display: flex;
  flex: 1;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 16px 0;
  border: 0;
  background: transparent;
  color: var(--foreground);
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  text-align: left;
  cursor: pointer;
}
.accordion-trigger:hover { text-decoration: underline; text-underline-offset: 4px; }
.accordion-trigger > i:last-child { color: var(--muted-foreground); transition: transform .2s ease; }
.accordion-trigger[aria-expanded="true"] > i:last-child, .accordion-item.open .accordion-trigger > i:last-child { transform: rotate(180deg); }
.accordion-content { padding-bottom: 16px; font-size: 14px; }

.progress, :where(progress) {
  position: relative;
  width: 100%;
  height: 8px;
  overflow: hidden;
  border: 0;
  border-radius: 9999px;
  background: color-mix(in oklch, var(--primary) 20%, transparent);
  appearance: none;
}
.progress-indicator { height: 100%; background: var(--primary); transition: width .3s ease; }
:where(progress)::-webkit-progress-bar { background: transparent; }
:where(progress)::-webkit-progress-value { background: var(--primary); border-radius: 9999px; }
:where(progress)::-moz-progress-bar { background: var(--primary); border-radius: 9999px; }

:where(input[type="range"]) { appearance: none; -webkit-appearance: none; height: 6px; padding: 0; border: 0; border-radius: 9999px; background: var(--muted); box-shadow: none; }
:where(input[type="range"])::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 9999px; border: 1px solid var(--primary); background: var(--foreground); box-shadow: var(--shadow-sm); cursor: pointer; }
:where(input[type="range"])::-moz-range-thumb { width: 16px; height: 16px; border-radius: 9999px; border: 1px solid var(--primary); background: var(--foreground); cursor: pointer; }

.skeleton { background: var(--accent); border-radius: var(--radius-md); animation: shadcn-pulse 2s cubic-bezier(.4, 0, .6, 1) infinite; }
@keyframes shadcn-pulse { 50% { opacity: .5; } }
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--muted);
  border-top-color: var(--foreground);
  border-radius: 9999px;
  animation: shadcn-spin .8s linear infinite;
}
.spinner-lg { width: 24px; height: 24px; }
@keyframes shadcn-spin { to { transform: rotate(360deg); } }

.kbd, :where(kbd) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  border-radius: var(--radius-sm);
  background: var(--muted);
  color: var(--muted-foreground);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  pointer-events: none;
  user-select: none;
}

.separator, :where(hr) { height: 1px; width: 100%; margin: 0; border: 0; background: var(--border); flex-shrink: 0; }
.separator-vertical { width: 1px; height: auto; align-self: stretch; background: var(--border); }

.avatar { width: 32px; height: 32px; border-radius: 9999px; overflow: hidden; background: var(--muted); flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-fallback { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 13px; font-weight: 500; color: var(--foreground); background: var(--muted); }

.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; color: var(--muted-foreground); list-style: none; margin: 0; padding: 0; }
.breadcrumb-item { display: inline-flex; align-items: center; gap: 6px; }
.breadcrumb-link { color: var(--muted-foreground); text-decoration: none; cursor: pointer; transition: color .15s ease; background: none; border: 0; padding: 0; font: inherit; }
.breadcrumb-link:hover { color: var(--foreground); }
.breadcrumb-page { color: var(--foreground); font-weight: 400; }
.breadcrumb-separator { display: inline-flex; font-size: 12px; color: var(--muted-foreground); }

.pagination { display: flex; align-items: center; justify-content: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.pagination-item, .pagination-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--foreground);
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  cursor: pointer;
}
.pagination-item:hover, .pagination-link:hover { background: var(--accent); }
.pagination-item.active, .pagination-link.active, .pagination-item[aria-current="page"] { background: var(--input); border-color: var(--input-border); box-shadow: var(--shadow-xs); }
.pagination-item:disabled { opacity: .5; pointer-events: none; }
.pagination-ellipsis { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; color: var(--muted-foreground); }

.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; min-width: 0; padding: 48px 24px; border: 1px dashed var(--border); border-radius: var(--radius-lg); text-align: center; }
.empty-header { display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 24rem; }
.empty-icon { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-bottom: 8px; border-radius: var(--radius-lg); background: var(--muted); color: var(--foreground); font-size: 20px; }
.empty-title { font-size: 18px; font-weight: var(--font-weight-medium); letter-spacing: -0.01em; }
.empty-description { font-size: 14px; line-height: 1.6; color: var(--muted-foreground); }

.item { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 12px 16px; border: 1px solid transparent; border-radius: var(--radius-md); font-size: 14px; transition: background-color .15s ease; }
.item-outline { border-color: var(--border); }
.item-muted { background: color-mix(in oklch, var(--muted) 50%, transparent); }
a.item:hover, button.item:hover, .item.interactive:hover { background: color-mix(in oklch, var(--accent) 50%, transparent); }
.item-media { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 32px; height: 32px; border-radius: var(--radius-sm); background: var(--muted); color: var(--foreground); font-size: 16px; }
.item-content { display: flex; flex: 1; flex-direction: column; gap: 4px; min-width: 0; }
.item-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: var(--font-weight-medium); line-height: 1.3; }
.item-description { font-size: 13px; line-height: 1.45; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.item-actions { display: flex; align-items: center; gap: 8px; }

.command { display: flex; flex-direction: column; overflow: hidden; border-radius: var(--radius-md); background: var(--popover); color: var(--popover-foreground); }
.command-input-wrapper { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-bottom: 1px solid var(--border); color: var(--muted-foreground); }
.command-input { flex: 1; height: 40px; border: 0 !important; background: transparent !important; box-shadow: none !important; font-size: 14px; outline: none; color: var(--foreground); }
.command-list { max-height: 300px; overflow-y: auto; padding: 4px; }
.command-group-heading { padding: 6px 8px; font-size: 12px; font-weight: var(--font-weight-medium); color: var(--muted-foreground); }
.command-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--radius-sm); font-size: 14px; cursor: default; }
.command-item:hover, .command-item.selected, .command-item[aria-selected="true"] { background: var(--accent); color: var(--accent-foreground); }
.command-empty { padding: 24px 0; text-align: center; font-size: 14px; color: var(--muted-foreground); }

/* ---------- Native defaults (zero specificity: anything already styled wins) ---------- */
:where(button:not([class])) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 2.25rem;
  padding: 0 1rem;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  background: var(--input);
  color: var(--foreground);
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
}
:where(button:not([class])):hover { background: var(--accent); }
:where(label) { font-size: inherit; }
:where(a) { text-underline-offset: 4px; }
:where(code) { padding: 0.2em 0.3em; border-radius: var(--radius-sm); background: var(--muted); font-family: var(--font-mono); font-size: 0.875em; }

/* Data numbers line up in every table and stat */
.data-table td, .table td, .stat-value { font-variant-numeric: tabular-nums; }
