/*
 * Qurify components as plain CSS — recreated from qurify-fe origin/develop@2835b146 src/components/ui/*.tsx
 * and src/components/empty-state.tsx. Tailwind classes are written out at the product's 14px root
 * (Tailwind default scale: h-9 = 2.25rem = 31.5px, px-3 = 10.5px, …). Needs tokens.css loaded first.
 * Theme: tokens.css switches on [data-theme="dark"] (the product itself uses the .dark class).
 */
.q-btn, .q-input, .q-textarea, .q-chip, .q-badge, .q-alert, .q-tabs, .q-tab, .q-switch, .q-switch__thumb { box-sizing: border-box; }

/* ---------- Button — src/components/ui/button.tsx ---------- */
.q-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xxs);
  height: 32px; padding: 0 10px; white-space: nowrap; cursor: pointer;
  border: 0; border-radius: var(--radius-sm); background: transparent;
  font-family: var(--font-sans); font-size: 14px; line-height: 100%; font-weight: 500;
  color: var(--texts-primary);
  transition: color .15s cubic-bezier(.4,0,.2,1), background-color .15s cubic-bezier(.4,0,.2,1), border-color .15s cubic-bezier(.4,0,.2,1);
}
.q-btn:focus-visible { outline: none; }
.q-btn svg, .q-btn img { width: 16px; height: 16px; flex-shrink: 0; pointer-events: none; }
.q-btn--xl { height: 40px; } .q-btn--l { height: 36px; } .q-btn--m { height: 32px; } .q-btn--s { height: 28px; } .q-btn--xs { height: 24px; }
.q-btn--icon.q-btn--xl { width: 40px; } .q-btn--icon.q-btn--l { width: 36px; } .q-btn--icon, .q-btn--icon.q-btn--m { width: 32px; }
.q-btn--icon.q-btn--s { width: 28px; } .q-btn--icon.q-btn--xs { width: 24px; }

.q-btn--primary { color: var(--static-white); background: var(--brand-55); }
.q-btn--primary:hover { background: var(--brand-50); }
.q-btn--primary:active { background: var(--brand-45); }
.q-btn--primary-outline { color: var(--brand-50); border: 1px solid var(--brand-50); }
.q-btn--primary-outline:hover { background: var(--interactive-b-primary); }
.q-btn--primary-outline:active { background: var(--interactive-b-secondary); }

.q-btn--secondary, .q-btn--secondary-outline { background: var(--interactive-primary); }
.q-btn--secondary-outline { border: 1px solid var(--line-normal); }
.q-btn--secondary:hover, .q-btn--secondary-outline:hover { background: var(--interactive-secondary); }
.q-btn--secondary:active, .q-btn--secondary-outline:active { background: var(--interactive-tertiary); }
.q-btn--secondary svg, .q-btn--secondary-outline svg { color: var(--grays-gray); }

.q-btn--assistive, .q-btn--assistive-outline { color: var(--texts-tertiary); }
.q-btn--assistive-outline { border: 1px solid var(--line-normal); }
.q-btn--assistive:hover { color: var(--texts-primary); }
.q-btn--assistive:hover, .q-btn--assistive-outline:hover { background: var(--interactive-primary); }
.q-btn--assistive:active, .q-btn--assistive-outline:active { background: var(--interactive-secondary); }
.q-btn--assistive svg { color: var(--grays-gray1); }
.q-btn--assistive-outline svg { color: var(--grays-gray2); }
.q-btn--assistive:hover svg, .q-btn--assistive-outline:hover svg { color: var(--grays-gray); }

.q-btn--error { color: var(--static-white); background: var(--red-55); }
.q-btn--error:hover { background: var(--red-50); }
.q-btn--error:active { background: var(--red-45); }
.q-btn--error-outline { color: var(--support-default-error); border: 1px solid var(--support-default-error); }
.q-btn--error-outline:hover { background: var(--interactive-e-primary); }
.q-btn--error-outline:active { background: var(--interactive-e-secondary); }

.q-btn:disabled, .q-btn[aria-disabled="true"] {
  pointer-events: none; background: var(--interactive-disabled); color: var(--texts-quenternary); border: none;
}

/* ---------- Input · Textarea — input.tsx, textarea.tsx ---------- */
.q-input {
  display: flex; width: 100%; height: 31.5px; padding: 3.5px 10.5px;
  border: 1px solid var(--input); border-radius: var(--radius-sm); background: transparent;
  font-family: var(--font-sans); font-size: 14px; line-height: 100%; color: var(--texts-primary);
  transition: color .15s, background-color .15s, border-color .15s;
}
.q-textarea {
  display: flex; width: 100%; min-height: 0; padding: var(--space-sm);
  border: 1px solid var(--input); border-radius: var(--radius-md); background: transparent;
  font-family: var(--font-sans); font-size: 14px; line-height: 160%; color: var(--texts-primary); resize: vertical;
}
.q-input::placeholder, .q-textarea::placeholder { color: var(--muted-foreground); }
.q-input:focus-visible, .q-textarea:focus-visible { outline: none; }
.q-input:disabled, .q-textarea:disabled { cursor: not-allowed; opacity: .5; }
@media (min-width: 768px) { .q-input, .q-textarea { font-size: 12px; line-height: 120%; } }
@media (hover: none) and (pointer: coarse) { .q-input, .q-textarea { font-size: 16px; } }

/* ---------- InfoChip — info-chip.tsx ---------- */
.q-chip {
  display: inline-block; padding: var(--space-xxs); border-radius: var(--radius-sm);
  font-family: var(--font-sans); font-size: 14px; line-height: 100%; color: var(--texts-secondary);
}
.q-chip--filled { background: var(--grays-gray5); }
.q-chip--outlined { border: 1px solid var(--line-normal); }

/* ---------- Badge — badge.tsx (shadcn default styling) ---------- */
.q-badge {
  display: inline-flex; align-items: center; padding: 1.75px 8.75px;
  border: 1px solid transparent; border-radius: var(--radius-md);
  font-family: var(--font-sans); font-size: 10.5px; line-height: 14px; font-weight: 600;
  transition: color .15s, background-color .15s;
}
.q-badge--default { background: var(--primary); color: var(--primary-foreground); box-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1); }
.q-badge--default:hover { background: color-mix(in srgb, var(--primary) 80%, transparent); }
.q-badge--secondary { background: var(--secondary); color: var(--secondary-foreground); }
.q-badge--secondary:hover { background: color-mix(in srgb, var(--secondary) 80%, transparent); }
.q-badge--destructive { background: var(--destructive); color: var(--destructive-foreground); box-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1); }
.q-badge--destructive:hover { background: color-mix(in srgb, var(--destructive) 80%, transparent); }
.q-badge--outline { color: var(--foreground); border-color: var(--border); }

/* ---------- Alert — alert.tsx ---------- */
.q-alert {
  position: relative; width: 100%; padding: 10.5px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--background); color: var(--foreground);
  font-family: var(--font-sans); font-size: 12px; line-height: 120%;
}
.q-alert > svg { position: absolute; left: 14px; top: 14px; width: 16px; height: 16px; color: var(--foreground); }
.q-alert > svg ~ * { padding-left: 24.5px; }
.q-alert > svg + div { transform: translateY(-3px); }
.q-alert__title { margin: 0 0 3.5px; font-size: 12px; font-weight: 500; line-height: 1; letter-spacing: -.025em; }
.q-alert__desc { font-size: 12px; line-height: 120%; }
.q-alert__desc p { margin: 0; line-height: 1.625; }
.q-alert--destructive { color: var(--destructive); border-color: color-mix(in srgb, var(--destructive) 50%, transparent); }
.q-alert--destructive > svg { color: var(--destructive); }
[data-theme="dark"] .q-alert--destructive { border-color: var(--destructive); }

/* ---------- Tabs — tabs.tsx ---------- */
.q-tabs {
  display: inline-flex; align-items: center; justify-content: center; height: 31.5px; padding: 3.5px;
  border-radius: var(--radius-lg); background: var(--muted); color: var(--muted-foreground);
}
.q-tab {
  display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
  padding: 3.5px 10.5px; border: 0; border-radius: var(--radius-md); background: transparent; color: inherit; cursor: pointer;
  font-family: var(--font-sans); font-size: 12px; line-height: 120%; font-weight: 500; transition: all .15s cubic-bezier(.4,0,.2,1);
}
.q-tab:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--background), 0 0 0 4px var(--ring); }
.q-tab[aria-selected="true"] { background: var(--grays-inverse-w); color: var(--foreground); box-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1); }
.q-tab:disabled { pointer-events: none; opacity: .5; }

/* ---------- Switch — switch.tsx ---------- */
.q-switch {
  display: inline-flex; align-items: center; flex-shrink: 0; width: 31.5px; height: 17.5px; padding: 0; cursor: pointer;
  border: 2px solid transparent; border-radius: 9999px; background: var(--grays-gray3);
  box-shadow: var(--shadow-sm); transition: background-color .15s;
}
.q-switch[aria-checked="true"] { background: #4ade80; } /* Tailwind default green-400 — not a Qurify token */
.q-switch:disabled { cursor: not-allowed; background: var(--grays-gray4); }
.q-switch:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--background), 0 0 0 4px var(--ring); }
.q-switch__thumb { display: block; width: 14px; height: 14px; border-radius: 9999px; background: #fff; pointer-events: none; transition: transform .15s; }
.q-switch[aria-checked="true"] .q-switch__thumb { transform: translateX(14px); }

/* ---------- EmptyState — src/components/empty-state.tsx ---------- */
.q-empty { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 100%; font-family: var(--font-sans); }
.q-empty__art { flex-shrink: 0; display: block; }
.q-empty__art--dark { display: none; }
[data-theme="dark"] .q-empty__art--light { display: none; }
[data-theme="dark"] .q-empty__art--dark { display: block; }
.q-empty__text { display: flex; flex-direction: column; align-items: center; gap: var(--space-sm); }
.q-empty--compact .q-empty__text { gap: var(--space-xxs); }
.q-empty__title { margin: 0; text-align: center; font-size: 14px; line-height: 160%; color: var(--texts-primary); }
.q-empty__rule { width: 40px; height: 1px; background: var(--line-normal); }
.q-empty__desc { margin: 0; text-align: center; white-space: pre-line; font-size: 13px; line-height: 160%; color: var(--texts-tertiary); }
.q-empty__em { color: var(--brand-50); }
.q-empty__action { padding-top: var(--space-md); }

/* ---------- StatCard — src/features/evaluations/evaluation-card.tsx ---------- */
.q-statcard {
  box-sizing: border-box; display: flex; flex-direction: column; gap: var(--space-sm); padding: var(--space-md);
  border: 1px solid var(--line-normal); border-radius: var(--radius-md); background: var(--background-primary);
  font-family: var(--font-sans); cursor: pointer; transition: box-shadow .15s;
}
.q-statcard:hover { box-shadow: var(--shadow-md); }
.q-statcard__title { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; line-height: 140%; font-weight: 500; color: var(--texts-primary); }
.q-statcard__stats { display: flex; align-items: center; border-radius: var(--radius-md); background: var(--interactive-primary); }
.q-statcard__stat { display: flex; flex: 1; flex-direction: column; align-items: center; gap: var(--space-xxs); padding: var(--space-sm) var(--space-lg); }
.q-statcard__label { margin: 0; font-size: 13px; line-height: 100%; color: var(--texts-tertiary); }
.q-statcard__value { font-size: 18px; line-height: 140%; font-weight: 500; color: var(--texts-primary); }
.q-statcard__total { font-size: 18px; line-height: 140%; color: var(--texts-tertiary); }
.q-statcard__divider { width: 1px; height: 28px; margin: 0 var(--space-sm); background: var(--border); }
.q-statcard__foot { display: flex; align-items: center; justify-content: space-between; font-size: 13px; line-height: 100%; }
.q-statcard__date { color: var(--texts-quenternary); }

/* ---------- SectionCard — src/features/collections/collection-card.tsx ---------- */
.q-sectioncard { box-sizing: border-box; overflow: hidden; border: 1px solid var(--line-normal); border-radius: var(--radius-md); font-family: var(--font-sans); }
.q-sectioncard__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-xs); padding: var(--space-md) var(--space-xl); border-bottom: 1px solid var(--line-normal); background: var(--background-secondary); }
.q-sectioncard__title { margin: 0; font-size: 16px; line-height: 140%; font-weight: 700; color: var(--texts-primary); }
.q-sectioncard__desc { margin: 0; font-size: 14px; line-height: 100%; color: var(--texts-secondary); }
.q-sectioncard__body { padding: var(--space-xl); background: var(--background-primary); }

/* ---------- StatusBadge — src/features/workflow/workflow-method-badge.tsx (Badge + rounded-full px-xs py-xxs, no shadow) ---------- */
.q-status {
  box-sizing: border-box; display: inline-flex; align-items: center; padding: var(--space-xxs) var(--space-xs);
  border: 1px solid transparent; border-radius: 9999px;
  font-family: var(--font-sans); font-size: 14px; line-height: 100%; font-weight: 500;
}
.q-status--info { background: var(--support-background-info); color: var(--support-default-info); }
.q-status--success { background: var(--support-background-success); color: var(--support-default-success); }
.q-status--caution { background: var(--support-background-caution); color: var(--support-default-caution); }
.q-status--error { background: var(--support-background-error); color: var(--support-default-error); }
.q-status--brand { background: var(--interactive-b-secondary); color: var(--support-default-brand); }
.q-status--neutral { background: var(--grays-gray5); color: var(--texts-tertiary); } /* original sets text = grays-gray5 (invisible placeholder '-'); texts-tertiary is this system's readable neutral */

/* ---------- LabelChip — src/features/collections/db-collections/db-dialect-badge.tsx ---------- */
.q-label {
  box-sizing: border-box; display: flex; width: fit-content; align-items: center; gap: var(--space-xs); padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--line-alternative); border-radius: var(--radius-sm); background: var(--interactive-primary);
  font-family: var(--font-sans); font-size: 14px; line-height: 100%; color: var(--texts-quenternary);
}
.q-label svg, .q-label img { width: 20px; height: 20px; flex-shrink: 0; }

/* ---------- theme-paired assets (-light / -dark SVG) — the product swaps them with useThemeVariant() ---------- */
.q-only-dark { display: none !important; }
[data-theme="dark"] .q-only-light { display: none !important; }
[data-theme="dark"] .q-only-dark { display: revert !important; }
