/* =============================================================================
   CARVO DESIGN SYSTEM
   Single source of truth for typography, spacing, color, components.
   Layered on top of Tailwind CDN. All custom classes prefixed `ds-`.
   ============================================================================= */

/* -----------------------------------------------------------------------------
   1. CSS VARIABLES — design tokens
   ----------------------------------------------------------------------------- */
:root {
  /* Color — neutral (ink) */
  --ink-50:  #F8FAFC;
  --ink-100: #F1F5F9;
  --ink-200: #E2E8F0;
  --ink-300: #CBD5E1;
  --ink-400: #94A3B8;
  --ink-500: #64748B;
  --ink-600: #475569;
  --ink-700: #334155;
  --ink-800: #1E293B;
  --ink-900: #0F172A;

  /* Color — brand (electric blue) */
  --brand-50:  #EFF6FF;
  --brand-100: #DBEAFE;
  --brand-200: #BFDBFE;
  --brand-500: #3B82F6;
  --brand-600: #2563EB;
  --brand-700: #1D4ED8;
  --brand-900: #1E3A8A;

  /* Color — semantic */
  --success-50:  #ECFDF5;
  --success-100: #D1FAE5;
  --success-600: #059669;
  --success-700: #047857;

  --warn-50:  #FFFBEB;
  --warn-100: #FEF3C7;
  --warn-600: #D97706;
  --warn-700: #B45309;

  --danger-50:  #FEF2F2;
  --danger-100: #FEE2E2;
  --danger-600: #DC2626;
  --danger-700: #B91C1C;

  /* Spacing — 4px grid */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;

  /* Typography scale */
  --fs-xs: 11px;     /* labels, caps */
  --fs-sm: 13px;     /* secondary text, table sub-cells */
  --fs-base: 14px;   /* body, table cells, inputs */
  --fs-md: 15px;     /* primary cell text, body emphasis */
  --fs-lg: 18px;     /* h3 */
  --fs-xl: 22px;     /* h2 */
  --fs-2xl: 28px;    /* h1 */
  --fs-3xl: 36px;    /* hero */

  --lh-tight: 1.25;
  --lh-normal: 1.5;

  /* Radii */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-pill: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-card: 0 1px 2px 0 rgba(15,23,42,.04), 0 1px 3px 0 rgba(15,23,42,.06);
  --shadow-pop:  0 10px 25px -5px rgba(15,23,42,.10), 0 8px 10px -6px rgba(15,23,42,.05);
  --shadow-modal: 0 20px 50px -10px rgba(15,23,42,.30);

  /* Component sizing */
  --control-h-sm: 32px;
  --control-h-md: 40px;
  --control-h-lg: 48px;

  /* Focus ring */
  --focus-ring: 0 0 0 3px rgba(59, 130, 246, 0.25);

  /* Transitions */
  --t-fast: 120ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-base: 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* -----------------------------------------------------------------------------
   2. RESETS & BASE
   ----------------------------------------------------------------------------- */
body {
  font-feature-settings: "ss01", "cv11", "tnum";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--ink-800);
}
* { box-sizing: border-box; }
a { color: var(--brand-600); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--brand-700); text-decoration: underline; }

h1, h2, h3, h4 { font-weight: 700; color: var(--ink-900); line-height: var(--lh-tight); margin: 0; }
h1 { font-size: var(--fs-2xl); margin-bottom: var(--s-3); }
h2 { font-size: var(--fs-xl); margin: var(--s-2) 0 var(--s-3); }
h3 { font-size: var(--fs-lg); font-weight: 600; margin: 0 0 var(--s-2); }
h4 { font-size: var(--fs-base); font-weight: 600; margin: 0 0 var(--s-2); }

/* -----------------------------------------------------------------------------
   3. CARDS & SURFACES
   ----------------------------------------------------------------------------- */
.ds-card {
  background: white;
  border: 1px solid var(--ink-200);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
}
.ds-card-pad { padding: var(--s-5); }
.ds-card-header {
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--ink-200);
  display: flex;
  align-items: center;
  gap: var(--s-2);
  background: white;
  border-top-left-radius: var(--r-lg);
  border-top-right-radius: var(--r-lg);
}
.ds-card-header h3 {
  font-size: var(--fs-base);
  font-weight: 600;
  margin: 0;
}

/* -----------------------------------------------------------------------------
   4. TABLE SYSTEM (the big one)
   ----------------------------------------------------------------------------- */
.ds-table-wrap {
  background: white;
  border: 1px solid var(--ink-200);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.ds-table-scroll { overflow-x: auto; }
.ds-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--fs-base);
  text-align: left;
}
/* Headers */
.ds-table thead th {
  background: var(--ink-50);
  color: var(--ink-500);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--ink-200);
  white-space: nowrap;
  text-align: left;
}
.ds-table thead th.right { text-align: right; }
.ds-table thead th.center { text-align: center; }
/* Body cells */
.ds-table tbody td {
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--ink-100);
  color: var(--ink-800);
  vertical-align: middle;
  font-size: var(--fs-base);
}
.ds-table tbody td.right { text-align: right; }
.ds-table tbody td.center { text-align: center; }
.ds-table tbody td.nowrap { white-space: nowrap; }
.ds-table tbody td.truncate {
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ds-table tbody tr {
  transition: background-color var(--t-fast);
}
.ds-table tbody tr:hover {
  background: var(--ink-50);
}
.ds-table tbody tr:last-child td { border-bottom: 0; }
.ds-table tbody tr.warn { background: rgba(254, 243, 199, 0.4); }
.ds-table tbody tr.warn:hover { background: rgba(254, 243, 199, 0.7); }
/* Footer */
.ds-table tfoot th, .ds-table tfoot td {
  padding: var(--s-3) var(--s-4);
  background: var(--ink-50);
  font-weight: 600;
  color: var(--ink-900);
  border-top: 1px solid var(--ink-200);
}
.ds-table tfoot td.right { text-align: right; }

/* Cell helpers */
.ds-cell-primary {
  font-size: var(--fs-md);
  font-weight: 500;
  color: var(--ink-900);
  line-height: 1.3;
}
.ds-cell-sub {
  font-size: var(--fs-sm);
  color: var(--ink-500);
  line-height: 1.3;
  margin-top: 2px;
}
.ds-cell-mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: var(--fs-sm);
  color: var(--ink-700);
  letter-spacing: -0.01em;
}
.ds-cell-num {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--ink-900);
}
.ds-cell-muted { color: var(--ink-400); }

/* Action icons in last column */
.ds-row-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  justify-content: flex-end;
}
.ds-row-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  width: 32px;
  border-radius: var(--r-sm);
  color: var(--ink-400);
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: all var(--t-fast);
  text-decoration: none;
}
.ds-row-action:hover {
  background: var(--ink-100);
  color: var(--ink-700);
  text-decoration: none;
}
.ds-row-action.danger:hover {
  background: var(--danger-100);
  color: var(--danger-700);
}

/* Combined leading icon + text cell */
.ds-cell-with-icon {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.ds-cell-icon {
  display: grid;
  place-items: center;
  height: 36px;
  width: 36px;
  border-radius: var(--r-md);
  background: var(--ink-100);
  color: var(--ink-700);
  flex-shrink: 0;
}
.ds-cell-icon.brand { background: var(--brand-100); color: var(--brand-700); }
.ds-cell-icon.success { background: var(--success-100); color: var(--success-700); }
.ds-cell-icon.warn { background: var(--warn-100); color: var(--warn-700); }
.ds-cell-icon.danger { background: var(--danger-100); color: var(--danger-700); }

/* -----------------------------------------------------------------------------
   5. PILLS / BADGES
   ----------------------------------------------------------------------------- */
.ds-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.ds-pill.brand   { background: var(--brand-100); color: var(--brand-700); }
.ds-pill.success { background: var(--success-100); color: var(--success-700); }
.ds-pill.warn    { background: var(--warn-100); color: var(--warn-700); }
.ds-pill.danger  { background: var(--danger-100); color: var(--danger-700); }
.ds-pill.ink     { background: var(--ink-100); color: var(--ink-600); }
.ds-pill.solid   { background: var(--brand-600); color: white; }

/* -----------------------------------------------------------------------------
   6. FORMS — inputs, selects, textareas
   ----------------------------------------------------------------------------- */
.ds-field { margin-bottom: var(--s-4); }
.ds-field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}
.ds-field-row.cols-2 { grid-template-columns: 1fr 1fr; }
.ds-field-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 640px) {
  .ds-field-row.cols-2, .ds-field-row.cols-3 { grid-template-columns: 1fr; }
}
.ds-label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink-700);
  margin-bottom: 6px;
}
.ds-label .ds-label-hint {
  font-weight: 400;
  color: var(--ink-400);
  font-size: var(--fs-xs);
  margin-left: 4px;
}
.ds-label .ds-label-req {
  color: var(--danger-600);
  margin-left: 2px;
}
/* Inputs / selects / textareas — uniform 40px height (md) */
.ds-input, .ds-select, .ds-textarea {
  display: block;
  width: 100%;
  font-size: var(--fs-base);
  font-family: inherit;
  color: var(--ink-900);
  background: white;
  border: 1px solid var(--ink-300);
  border-radius: var(--r-md);
  padding: 0 var(--s-3);
  height: var(--control-h-md);
  line-height: var(--control-h-md);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  -webkit-appearance: none;
  appearance: none;
}
.ds-textarea {
  height: auto;
  line-height: var(--lh-normal);
  padding: var(--s-2) var(--s-3);
  min-height: 80px;
  resize: vertical;
}
.ds-input::placeholder, .ds-textarea::placeholder {
  color: var(--ink-400);
}
.ds-input:hover:not(:disabled), .ds-select:hover:not(:disabled), .ds-textarea:hover:not(:disabled) {
  border-color: var(--ink-400);
}
.ds-input:focus, .ds-select:focus, .ds-textarea:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: var(--focus-ring);
}
.ds-input:disabled, .ds-select:disabled, .ds-textarea:disabled {
  background: var(--ink-50);
  color: var(--ink-400);
  cursor: not-allowed;
}
.ds-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.ds-input.with-icon {
  padding-left: 36px;
}
.ds-input-wrap { position: relative; }
.ds-input-wrap .ds-input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-400);
  pointer-events: none;
}

/* Sizes */
.ds-input.sm, .ds-select.sm { height: var(--control-h-sm); font-size: var(--fs-sm); padding: 0 10px; }
.ds-input.lg, .ds-select.lg { height: var(--control-h-lg); font-size: var(--fs-md); padding: 0 14px; }

/* Checkbox */
.ds-checkbox {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--fs-sm);
  color: var(--ink-700);
  cursor: pointer;
}
.ds-checkbox input[type=checkbox] {
  width: 16px;
  height: 16px;
  margin: 0;
  border-radius: 4px;
  border: 1px solid var(--ink-300);
  accent-color: var(--brand-600);
}

/* Help / error text */
.ds-field-help { font-size: var(--fs-sm); color: var(--ink-500); margin-top: 6px; }
.ds-field-error { font-size: var(--fs-sm); color: var(--danger-700); margin-top: 6px; }

/* -----------------------------------------------------------------------------
   7. BUTTONS — three variants, two sizes, icon-aware
   ----------------------------------------------------------------------------- */
.ds-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  height: var(--control-h-md);
  padding: 0 var(--s-4);
  border-radius: var(--r-md);
  font-size: var(--fs-base);
  font-weight: 500;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--t-fast);
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
}
.ds-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.ds-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ds-btn .lucide, .ds-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Primary */
.ds-btn.primary {
  background: var(--brand-600);
  color: white;
  border-color: var(--brand-600);
}
.ds-btn.primary:hover:not(:disabled) {
  background: var(--brand-700);
  border-color: var(--brand-700);
  color: white;
  text-decoration: none;
}

/* Secondary (outlined) */
.ds-btn.secondary {
  background: white;
  color: var(--ink-700);
  border-color: var(--ink-300);
}
.ds-btn.secondary:hover:not(:disabled) {
  background: var(--ink-50);
  border-color: var(--ink-400);
  color: var(--ink-900);
  text-decoration: none;
}

/* Danger */
.ds-btn.danger {
  background: var(--danger-600);
  color: white;
  border-color: var(--danger-600);
}
.ds-btn.danger:hover:not(:disabled) {
  background: var(--danger-700);
  border-color: var(--danger-700);
  color: white;
  text-decoration: none;
}

/* Ghost (no background until hover) */
.ds-btn.ghost {
  background: transparent;
  color: var(--ink-600);
  border-color: transparent;
}
.ds-btn.ghost:hover:not(:disabled) {
  background: var(--ink-100);
  color: var(--ink-900);
  text-decoration: none;
}

/* Sizes */
.ds-btn.sm { height: var(--control-h-sm); padding: 0 var(--s-3); font-size: var(--fs-sm); }
.ds-btn.lg { height: var(--control-h-lg); padding: 0 var(--s-5); font-size: var(--fs-md); }

/* Icon-only buttons */
.ds-btn.icon { padding: 0; width: var(--control-h-md); }
.ds-btn.icon.sm { width: var(--control-h-sm); }
.ds-btn.icon.lg { width: var(--control-h-lg); }

/* Full-width */
.ds-btn.block { width: 100%; }

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

/* -----------------------------------------------------------------------------
   8. PAGE STRUCTURE
   ----------------------------------------------------------------------------- */
.ds-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-bottom: var(--s-6);
}
.ds-page-title { font-size: var(--fs-2xl); font-weight: 700; color: var(--ink-900); margin: 0 0 4px; line-height: 1.2; }
.ds-page-subtitle { font-size: var(--fs-base); color: var(--ink-500); margin: 0; }
.ds-page-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-sm);
  color: var(--ink-500);
  text-decoration: none;
  margin-bottom: var(--s-2);
}
.ds-page-back:hover { color: var(--ink-900); text-decoration: none; }

/* -----------------------------------------------------------------------------
   9. EMPTY STATES
   ----------------------------------------------------------------------------- */
.ds-empty {
  text-align: center;
  padding: var(--s-12) var(--s-6);
}
.ds-empty .lucide, .ds-empty svg {
  width: 48px; height: 48px;
  color: var(--ink-300);
  margin: 0 auto var(--s-3);
}
.ds-empty h3 { color: var(--ink-900); margin-bottom: 4px; }
.ds-empty p { color: var(--ink-500); margin-bottom: var(--s-4); font-size: var(--fs-base); }

/* -----------------------------------------------------------------------------
   10. SKELETONS / LOADING
   ----------------------------------------------------------------------------- */
.ds-skeleton {
  background: linear-gradient(90deg, var(--ink-100) 0%, var(--ink-200) 50%, var(--ink-100) 100%);
  background-size: 200% 100%;
  animation: ds-skel-shimmer 1.4s ease-in-out infinite;
  border-radius: var(--r-sm);
}
@keyframes ds-skel-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.ds-skeleton-text { height: 14px; }
.ds-skeleton-row { height: 56px; }

/* Spinner */
.ds-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--brand-200);
  border-top-color: var(--brand-600);
  border-radius: 50%;
  animation: ds-spin 0.8s linear infinite;
}
@keyframes ds-spin { to { transform: rotate(360deg); } }

/* -----------------------------------------------------------------------------
   11. TOASTS
   ----------------------------------------------------------------------------- */
.ds-toast-container {
  position: fixed;
  top: var(--s-6);
  right: var(--s-6);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  pointer-events: none;
}
.ds-toast {
  background: white;
  border: 1px solid var(--ink-200);
  border-left-width: 4px;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-pop);
  padding: var(--s-3) var(--s-4);
  min-width: 280px;
  max-width: 380px;
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  font-size: var(--fs-base);
  color: var(--ink-800);
  pointer-events: auto;
  animation: ds-toast-in 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.ds-toast.success { border-left-color: var(--success-600); }
.ds-toast.error   { border-left-color: var(--danger-600); }
.ds-toast.info    { border-left-color: var(--brand-600); }
.ds-toast.warn    { border-left-color: var(--warn-600); }
.ds-toast.removing { animation: ds-toast-out 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
.ds-toast .ds-toast-icon { flex-shrink: 0; margin-top: 1px; }
.ds-toast.success .ds-toast-icon { color: var(--success-600); }
.ds-toast.error   .ds-toast-icon { color: var(--danger-600); }
.ds-toast.info    .ds-toast-icon { color: var(--brand-600); }
.ds-toast.warn    .ds-toast-icon { color: var(--warn-600); }
.ds-toast .ds-toast-content { flex: 1; line-height: 1.4; }
.ds-toast .ds-toast-title { font-weight: 600; color: var(--ink-900); }
.ds-toast .ds-toast-msg { margin-top: 2px; color: var(--ink-600); font-size: var(--fs-sm); }
.ds-toast .ds-toast-close {
  border: 0; background: transparent; color: var(--ink-400);
  cursor: pointer; padding: 2px; line-height: 0; border-radius: 4px;
}
.ds-toast .ds-toast-close:hover { color: var(--ink-700); background: var(--ink-100); }

@keyframes ds-toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes ds-toast-out {
  to { opacity: 0; transform: translateX(20px); }
}

/* -----------------------------------------------------------------------------
   12. MODAL / CONFIRM DIALOG
   ----------------------------------------------------------------------------- */
.ds-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-6);
  animation: ds-fade-in 0.15s ease-out;
}
.ds-modal {
  background: white;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-modal);
  max-width: 460px;
  width: 100%;
  overflow: hidden;
  animation: ds-modal-in 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.ds-modal-body {
  padding: var(--s-5) var(--s-5) var(--s-4);
  display: flex;
  gap: var(--s-4);
  align-items: flex-start;
}
.ds-modal-icon {
  flex-shrink: 0;
  height: 40px; width: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.ds-modal-icon.danger { background: var(--danger-100); color: var(--danger-600); }
.ds-modal-icon.warn { background: var(--warn-100); color: var(--warn-600); }
.ds-modal-icon.info { background: var(--brand-100); color: var(--brand-600); }
.ds-modal-content { flex: 1; }
.ds-modal-title {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--ink-900);
  margin: 0 0 4px;
}
.ds-modal-desc {
  font-size: var(--fs-base);
  color: var(--ink-600);
  margin: 0;
  line-height: 1.5;
}
.ds-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-5);
  background: var(--ink-50);
  border-top: 1px solid var(--ink-200);
}
@keyframes ds-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes ds-modal-in {
  from { opacity: 0; transform: scale(0.96) translateY(-8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* -----------------------------------------------------------------------------
   13. UTILITIES
   ----------------------------------------------------------------------------- */
.ds-stack > * + * { margin-top: var(--s-3); }
.ds-stack-lg > * + * { margin-top: var(--s-6); }
.ds-divider { height: 1px; background: var(--ink-200); margin: var(--s-4) 0; }
.ds-truncate { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: var(--fs-sm); }
.ds-text-muted { color: var(--ink-500); }
.ds-text-sm { font-size: var(--fs-sm); }
.ds-text-xs { font-size: var(--fs-xs); }
.ds-uppercase-label {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-500);
}

/* -----------------------------------------------------------------------------
   14. LEGACY BRIDGES (so old class names still work during transition)
   ----------------------------------------------------------------------------- */
.card { background: white; border: 1px solid var(--ink-200); border-radius: var(--r-lg); box-shadow: var(--shadow-card); padding: var(--s-5); margin-bottom: var(--s-4); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); height: var(--control-h-md); padding: 0 var(--s-4); border-radius: var(--r-md); background: var(--brand-600); color: white; font-weight: 500; font-size: var(--fs-base); border: 1px solid var(--brand-600); cursor: pointer; transition: all var(--t-fast); text-decoration: none; }
.btn:hover { background: var(--brand-700); border-color: var(--brand-700); color: white; text-decoration: none; }
.muted { color: var(--ink-500); }
.error { color: var(--danger-700); }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 600; }
.pill-success { background: var(--success-100); color: var(--success-700); }
.pill-warn { background: var(--warn-100); color: var(--warn-700); }
.pill-danger { background: var(--danger-100); color: var(--danger-700); }
.pill-brand { background: var(--brand-100); color: var(--brand-700); }
.pill-ink { background: var(--ink-100); color: var(--ink-600); }
