/* ==========================================================================
  DS — Design System (Dark & White / Poppins + Inter)
   Camada visual única do painel. Não altera lógica, apenas apresentação.
   Carregue DEPOIS de qualquer outro CSS.
   ========================================================================== */

:root {
  /* ---- Cores (HSL crus, compatíveis com hsl(var(--x))) ---- */
  --ds-background: 220 18% 98%;      /* #f8f9fb */
  --ds-surface: 0 0% 100%;
  --ds-surface-2: 220 16% 95%;
  --ds-border: 220 14% 88%;
  --ds-border-strong: 220 12% 82%;
  --ds-foreground: 220 39% 11%;      /* #111827 */
  --ds-muted: 220 10% 42%;
  --ds-muted-soft: 220 12% 62%;

  --ds-primary: 220 39% 11%;         /* #111827 dark */
  --ds-primary-dark: 222 47% 8%;
  --ds-primary-soft: 220 16% 96%;
  --ds-primary-foreground: 0 0% 100%;

  --ds-success: 152 62% 38%;
  --ds-success-soft: 152 62% 95%;
  --ds-warning: 35 96% 52%;
  --ds-warning-soft: 45 100% 95%;
  --ds-danger: 0 72% 51%;
  --ds-danger-soft: 0 86% 97%;
  --ds-info: 199 89% 48%;
  --ds-info-soft: 199 95% 96%;

  /* ---- Tipografia ---- */
  --ds-font-body: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --ds-font-display: "Poppins", var(--ds-font-body);
  --ds-font-mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", monospace;

  /* ---- Escala de espaçamento ---- */
  --ds-1: 4px;  --ds-2: 8px;  --ds-3: 12px; --ds-4: 16px;
  --ds-5: 20px; --ds-6: 24px; --ds-8: 32px; --ds-10: 40px; --ds-12: 48px;

  /* ---- Raios ---- */
  --ds-r-sm: 8px;
  --ds-r-md: 10px;
  --ds-r-lg: 14px;
  --ds-r-xl: 18px;
  --ds-r-full: 999px;

  /* ---- Sombras (leves) ---- */
  --ds-shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --ds-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.04);
  --ds-shadow-md: 0 2px 4px rgba(15, 23, 42, 0.04), 0 8px 20px -8px rgba(15, 23, 42, 0.12);
  --ds-shadow-lg: 0 4px 8px rgba(15, 23, 42, 0.05), 0 24px 48px -16px rgba(15, 23, 42, 0.18);
  --ds-ring: 0 0 0 3px hsl(var(--ds-primary) / 0.28);

  --ds-transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Base
   ========================================================================== */
html { -webkit-text-size-adjust: 100%; }
body.ds-body,
.ds-scope {
  font-family: var(--ds-font-body);
  color: hsl(var(--ds-foreground));
  background: hsl(var(--ds-background));
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 15px;
  line-height: 1.55;
}
.ds-scope h1, .ds-scope h2, .ds-scope h3, .ds-scope h4,
.ds-display { font-family: var(--ds-font-display); letter-spacing: -0.02em; font-weight: 700; }

.ds-h1 { font-size: clamp(22px, 2.4vw, 28px); line-height: 1.2; }
.ds-h2 { font-size: 19px; line-height: 1.3; font-family: var(--ds-font-display); font-weight: 700; }
.ds-h3 { font-size: 16px; line-height: 1.4; font-family: var(--ds-font-display); font-weight: 600; }
.ds-sub { color: hsl(var(--ds-muted)); font-size: 14px; }
.ds-label { font-size: 13px; font-weight: 600; color: hsl(var(--ds-foreground)); display: block; margin-bottom: 6px; }
.ds-help { font-size: 12.5px; color: hsl(var(--ds-muted)); margin-top: 6px; }
.ds-num { font-family: var(--ds-font-display); font-variant-numeric: tabular-nums; font-weight: 700; letter-spacing: -0.03em; }
.ds-mono { font-family: var(--ds-font-mono); font-size: 12.5px; }
.ds-muted { color: hsl(var(--ds-muted)); }

:where(.ds-scope) a { color: inherit; }
.ds-link { color: hsl(var(--ds-primary-dark)); font-weight: 500; text-underline-offset: 3px; }
.ds-link:hover { text-decoration: underline; }

/* Foco visível global — acessibilidade */
.ds-scope :is(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid hsl(var(--ds-primary));
  outline-offset: 2px;
  border-radius: var(--ds-r-sm);
}

/* ==========================================================================
   Layout / Page header / Breadcrumb
   ========================================================================== */
.ds-page { max-width: 1440px; margin: 0 auto; width: 100%; padding: var(--ds-5) var(--ds-4) var(--ds-12); }
@media (min-width: 768px) { .ds-page { padding: var(--ds-8) var(--ds-8) var(--ds-12); } }

.ds-page-header { display: grid; gap: var(--ds-4); margin-bottom: var(--ds-6); }
@media (min-width: 768px) {
  .ds-page-header { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
}
.ds-page-header__actions { display: flex; flex-wrap: wrap; gap: var(--ds-2); }

.ds-breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: hsl(var(--ds-muted)); margin-bottom: 6px; flex-wrap: wrap; }
.ds-breadcrumb svg { width: 13px; height: 13px; opacity: 0.6; }
.ds-breadcrumb a:hover { color: hsl(var(--ds-foreground)); }

/* ==========================================================================
   Cards
   ========================================================================== */
.ds-card {
  background: hsl(var(--ds-surface));
  border: 1px solid hsl(var(--ds-border));
  border-radius: var(--ds-r-lg);
  box-shadow: var(--ds-shadow-sm);
}
.ds-card--flush { padding: 0; overflow: hidden; }
.ds-card__head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--ds-3);
  padding: var(--ds-4) var(--ds-5);
  border-bottom: 1px solid hsl(var(--ds-border));
}
.ds-card__title { font-family: var(--ds-font-display); font-weight: 700; font-size: 15.5px; }
.ds-card__body { padding: var(--ds-5); }
.ds-card__foot { padding: var(--ds-3) var(--ds-5); border-top: 1px solid hsl(var(--ds-border)); background: hsl(var(--ds-surface-2) / 0.45); }
.ds-card--hover { transition: box-shadow var(--ds-transition), transform var(--ds-transition); }
.ds-card--hover:hover { box-shadow: var(--ds-shadow-md); transform: translateY(-1px); }

.ds-grid { display: grid; gap: var(--ds-4); }
.ds-grid--stats { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }
.ds-grid--2 { grid-template-columns: 1fr; }
@media (min-width: 1024px) { .ds-grid--2 { grid-template-columns: 1fr 1fr; } }
.ds-grid--3 { grid-template-columns: 1fr; }
@media (min-width: 768px) { .ds-grid--3 { grid-template-columns: repeat(3, 1fr); } }

/* ---- Stat card ---- */
.ds-stat { padding: var(--ds-5); display: grid; gap: var(--ds-3); }
.ds-stat__top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--ds-3); }
.ds-stat__label { font-size: 12.5px; font-weight: 600; letter-spacing: 0.02em; color: hsl(var(--ds-muted)); text-transform: uppercase; }
.ds-stat__value { font-family: var(--ds-font-display); font-size: 27px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.ds-stat__icon {
  width: 36px; height: 36px; border-radius: var(--ds-r-md); display: grid; place-items: center;
  background: hsl(var(--ds-surface-2)); color: hsl(var(--ds-muted)); flex: 0 0 auto;
}
.ds-stat__icon svg { width: 18px; height: 18px; }
.ds-stat__foot { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: hsl(var(--ds-muted)); }
.ds-trend { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; padding: 2px 7px; border-radius: var(--ds-r-full); font-size: 12px; }
.ds-trend svg { width: 13px; height: 13px; }
.ds-trend--up { color: hsl(var(--ds-success)); background: hsl(var(--ds-success-soft)); }
.ds-trend--down { color: hsl(var(--ds-danger)); background: hsl(var(--ds-danger-soft)); }
.ds-trend--flat { color: hsl(var(--ds-muted)); background: hsl(var(--ds-surface-2)); }

/* ==========================================================================
   Botões
   ========================================================================== */
.ds-btn {
  --btn-bg: hsl(var(--ds-surface));
  --btn-fg: hsl(var(--ds-foreground));
  --btn-bd: hsl(var(--ds-border-strong));
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px;
  border-radius: var(--ds-r-md);
  border: 1px solid var(--btn-bd);
  background: var(--btn-bg); color: var(--btn-fg);
  font-family: var(--ds-font-body); font-size: 14px; font-weight: 600;
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background var(--ds-transition), border-color var(--ds-transition),
              box-shadow var(--ds-transition), transform var(--ds-transition);
}
.ds-btn svg { width: 16px; height: 16px; flex: 0 0 auto; }
.ds-btn:hover { background: hsl(var(--ds-surface-2) / 0.7); }
.ds-btn:active { transform: translateY(1px); }
.ds-btn[disabled], .ds-btn.is-disabled { opacity: 0.55; pointer-events: none; }

.ds-btn--primary { --btn-bg: hsl(var(--ds-primary)); --btn-fg: hsl(var(--ds-primary-foreground)); --btn-bd: hsl(var(--ds-primary)); box-shadow: var(--ds-shadow-xs); }
.ds-btn--primary:hover { --btn-bg: hsl(var(--ds-primary-dark)); --btn-bd: hsl(var(--ds-primary-dark)); }
.ds-btn--danger { --btn-bg: hsl(var(--ds-danger)); --btn-fg: #fff; --btn-bd: hsl(var(--ds-danger)); }
.ds-btn--danger:hover { filter: brightness(0.94); }
.ds-btn--success { --btn-bg: hsl(var(--ds-success)); --btn-fg: #fff; --btn-bd: hsl(var(--ds-success)); }
.ds-btn--ghost { --btn-bg: transparent; --btn-bd: transparent; color: hsl(var(--ds-muted)); }
.ds-btn--ghost:hover { background: hsl(var(--ds-surface-2)); color: hsl(var(--ds-foreground)); }
.ds-btn--soft { --btn-bg: hsl(var(--ds-primary-soft)); --btn-fg: hsl(var(--ds-primary-dark)); --btn-bd: transparent; }
.ds-btn--sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: var(--ds-r-sm); }
.ds-btn--lg { min-height: 50px; padding: 0 24px; font-size: 16px; border-radius: var(--ds-r-lg); }
.ds-btn--block { width: 100%; }
.ds-btn--icon { width: 40px; padding: 0; }
.ds-btn--icon.ds-btn--sm { width: 34px; }

/* Loading state */
.ds-btn.is-loading { pointer-events: none; color: transparent !important; position: relative; }
.ds-btn.is-loading::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent;
  border-color: hsl(var(--ds-primary-foreground)) transparent hsl(var(--ds-primary-foreground)) transparent;
  animation: ds-spin 0.7s linear infinite;
}
@keyframes ds-spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Formulários
   ========================================================================== */
.ds-field { margin-bottom: var(--ds-4); }
.ds-input, .ds-select, .ds-textarea {
  width: 100%; min-height: 40px; padding: 9px 12px;
  font-family: var(--ds-font-body); font-size: 14px; color: hsl(var(--ds-foreground));
  background: hsl(var(--ds-surface));
  border: 1px solid hsl(var(--ds-border-strong));
  border-radius: var(--ds-r-md);
  transition: border-color var(--ds-transition), box-shadow var(--ds-transition);
  appearance: none;
}
.ds-textarea { min-height: 110px; resize: vertical; }
.ds-input::placeholder, .ds-textarea::placeholder { color: hsl(var(--ds-muted-soft)); }
.ds-input:focus, .ds-select:focus, .ds-textarea:focus {
  outline: none; border-color: hsl(var(--ds-primary)); box-shadow: var(--ds-ring);
}
.ds-input[disabled], .ds-select[disabled], .ds-textarea[disabled] { background: hsl(var(--ds-surface-2) / 0.6); color: hsl(var(--ds-muted)); cursor: not-allowed; }
.ds-input.is-invalid, .ds-select.is-invalid { border-color: hsl(var(--ds-danger)); }
.ds-select {
  padding-right: 34px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.ds-search { position: relative; }
.ds-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: hsl(var(--ds-muted-soft)); pointer-events: none; }
.ds-search .ds-input { padding-left: 36px; }

.ds-filters { display: flex; flex-wrap: wrap; gap: var(--ds-2); align-items: center; }
.ds-filters > * { min-width: 0; }
.ds-fieldset { border: 0; padding: 0; margin: 0 0 var(--ds-8); }
.ds-fieldset__legend { font-family: var(--ds-font-display); font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.ds-fieldset__hint { font-size: 13px; color: hsl(var(--ds-muted)); margin-bottom: var(--ds-4); }
.ds-form-grid { display: grid; gap: var(--ds-4); grid-template-columns: 1fr; }
@media (min-width: 768px) { .ds-form-grid--2 { grid-template-columns: 1fr 1fr; } }

.ds-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.ds-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.ds-switch__track { width: 40px; height: 23px; border-radius: var(--ds-r-full); background: hsl(var(--ds-border-strong)); position: relative; transition: background var(--ds-transition); flex: 0 0 auto; }
.ds-switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: var(--ds-shadow-xs); transition: transform var(--ds-transition); }
.ds-switch input:checked + .ds-switch__track { background: hsl(var(--ds-primary)); }
.ds-switch input:checked + .ds-switch__track::after { transform: translateX(17px); }
.ds-switch input:focus-visible + .ds-switch__track { box-shadow: var(--ds-ring); }

/* ==========================================================================
   Tabelas
   ========================================================================== */
.ds-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ds-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.ds-table thead th {
  position: sticky; top: 0; z-index: 1;
  text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  color: hsl(var(--ds-muted)); background: hsl(var(--ds-surface-2) / 0.6);
  padding: 11px 16px; white-space: nowrap;
  border-bottom: 1px solid hsl(var(--ds-border));
}
.ds-table tbody td { padding: 13px 16px; border-bottom: 1px solid hsl(var(--ds-border) / 0.8); vertical-align: middle; }
.ds-table tbody tr:last-child td { border-bottom: 0; }
.ds-table tbody tr { transition: background var(--ds-transition); }
.ds-table tbody tr:hover { background: hsl(var(--ds-primary-soft) / 0.55); }
.ds-table .ds-num, .ds-table .is-numeric { text-align: right; font-variant-numeric: tabular-nums; }
.ds-table__actions { display: flex; gap: 6px; justify-content: flex-end; }

.ds-cell-title { font-weight: 600; }
.ds-cell-sub { font-size: 12.5px; color: hsl(var(--ds-muted)); }

/* Cards de tabela no mobile */
.ds-rowcards { display: grid; gap: var(--ds-3); }
.ds-rowcard { padding: var(--ds-4); display: grid; gap: 10px; }
.ds-rowcard__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--ds-3); }
.ds-rowcard__meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; font-size: 13px; }
.ds-rowcard__meta dt { color: hsl(var(--ds-muted)); font-size: 12px; }
.ds-rowcard__meta dd { margin: 0; font-weight: 600; }
@media (min-width: 900px) { .ds-only-mobile { display: none !important; } }
@media (max-width: 899px) { .ds-only-desktop { display: none !important; } }

/* Paginação */
.ds-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; justify-content: space-between; }
.ds-pagination__pages { display: flex; gap: 4px; flex-wrap: wrap; }
.ds-page-btn {
  min-width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 10px; border-radius: var(--ds-r-sm); border: 1px solid hsl(var(--ds-border));
  font-size: 13px; font-weight: 600; background: hsl(var(--ds-surface)); color: hsl(var(--ds-muted));
}
.ds-page-btn:hover { background: hsl(var(--ds-surface-2)); color: hsl(var(--ds-foreground)); }
.ds-page-btn.is-active { background: hsl(var(--ds-primary)); border-color: hsl(var(--ds-primary)); color: #fff; }

/* ==========================================================================
   Badges / Status
   ========================================================================== */
.ds-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--ds-r-full);
  font-size: 12px; font-weight: 600; line-height: 1.6; white-space: nowrap;
  background: hsl(var(--ds-surface-2)); color: hsl(var(--ds-muted));
}
.ds-badge--neutral  { background: hsl(var(--ds-surface-2)); color: hsl(var(--ds-muted)); }
.ds-badge--primary  { background: hsl(var(--ds-primary-soft)); color: hsl(var(--ds-primary-dark)); }
.ds-badge--success  { background: hsl(var(--ds-success-soft)); color: hsl(var(--ds-success)); }
.ds-badge--warning  { background: hsl(var(--ds-warning-soft)); color: hsl(38 80% 34%); }
.ds-badge--danger   { background: hsl(var(--ds-danger-soft)); color: hsl(var(--ds-danger)); }
.ds-badge--info     { background: hsl(var(--ds-info-soft)); color: hsl(199 89% 33%); }
.ds-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.ds-dot--pulse { box-shadow: 0 0 0 0 currentColor; animation: ds-pulse 2s infinite; }
@keyframes ds-pulse { 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ==========================================================================
   Alerts / Toasts
   ========================================================================== */
.ds-alert {
  display: flex; gap: 12px; padding: 13px 16px; border-radius: var(--ds-r-md);
  border: 1px solid hsl(var(--ds-border)); background: hsl(var(--ds-surface-2) / 0.5);
  font-size: 14px; align-items: flex-start;
}
.ds-alert svg { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; }
.ds-alert__title { font-weight: 700; }
.ds-alert--success { background: hsl(var(--ds-success-soft)); border-color: hsl(var(--ds-success) / 0.25); color: hsl(152 55% 24%); }
.ds-alert--warning { background: hsl(var(--ds-warning-soft)); border-color: hsl(var(--ds-warning) / 0.3); color: hsl(38 75% 28%); }
.ds-alert--danger  { background: hsl(var(--ds-danger-soft)); border-color: hsl(var(--ds-danger) / 0.25); color: hsl(0 60% 38%); }
.ds-alert--info    { background: hsl(var(--ds-info-soft)); border-color: hsl(var(--ds-info) / 0.25); color: hsl(199 80% 27%); }

#ds-toasts { position: fixed; z-index: 90; right: 16px; bottom: 16px; display: grid; gap: 10px; width: min(360px, calc(100vw - 32px)); }
.ds-toast {
  display: flex; gap: 10px; align-items: flex-start;
  background: hsl(var(--ds-surface)); border: 1px solid hsl(var(--ds-border));
  border-radius: var(--ds-r-md); box-shadow: var(--ds-shadow-lg); padding: 12px 14px; font-size: 14px;
  animation: ds-toast-in 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
.ds-toast--success { border-left: 3px solid hsl(var(--ds-success)); }
.ds-toast--danger { border-left: 3px solid hsl(var(--ds-danger)); }
.ds-toast--info { border-left: 3px solid hsl(var(--ds-primary)); }
.ds-toast.is-leaving { animation: ds-toast-out 180ms ease forwards; }
@keyframes ds-toast-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
@keyframes ds-toast-out { to { opacity: 0; transform: translateY(6px); } }

/* ==========================================================================
   Modal / Drawer
   ========================================================================== */
.ds-modal[hidden] { display: none; }
.ds-modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; }
.ds-modal__backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.45); backdrop-filter: blur(2px); }
.ds-modal__panel {
  position: relative; width: min(560px, 100%); max-height: 88vh; overflow: auto;
  background: hsl(var(--ds-surface)); border-radius: var(--ds-r-xl); box-shadow: var(--ds-shadow-lg);
  animation: ds-modal-in 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes ds-modal-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
.ds-modal__head { padding: var(--ds-5); border-bottom: 1px solid hsl(var(--ds-border)); display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.ds-modal__body { padding: var(--ds-5); }
.ds-modal__foot { padding: var(--ds-4) var(--ds-5); border-top: 1px solid hsl(var(--ds-border)); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 599px) {
  .ds-modal { place-items: end center; padding: 0; }
  .ds-modal__panel { width: 100%; border-radius: var(--ds-r-xl) var(--ds-r-xl) 0 0; max-height: 92vh; }
  .ds-modal__foot .ds-btn { flex: 1; }
}

/* ==========================================================================
   Tabs / segmented / chips
   ========================================================================== */
.ds-tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid hsl(var(--ds-border)); }
.ds-tabs::-webkit-scrollbar { display: none; }
.ds-tab {
  padding: 10px 14px; font-size: 14px; font-weight: 600; color: hsl(var(--ds-muted));
  border-bottom: 2px solid transparent; white-space: nowrap; transition: color var(--ds-transition), border-color var(--ds-transition);
}
.ds-tab:hover { color: hsl(var(--ds-foreground)); }
.ds-tab.is-active { color: hsl(var(--ds-primary-dark)); border-bottom-color: hsl(var(--ds-primary)); }

.ds-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.ds-chips::-webkit-scrollbar { display: none; }
.ds-chip {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  padding: 7px 14px; border-radius: var(--ds-r-full); font-size: 13.5px; font-weight: 600;
  border: 1px solid hsl(var(--ds-border)); background: hsl(var(--ds-surface)); color: hsl(var(--ds-muted));
  transition: all var(--ds-transition);
}
.ds-chip:hover { border-color: hsl(var(--ds-border-strong)); color: hsl(var(--ds-foreground)); }
.ds-chip.is-active { background: hsl(var(--ds-foreground)); border-color: hsl(var(--ds-foreground)); color: #fff; }
.ds-chip__count { font-size: 11.5px; padding: 1px 7px; border-radius: var(--ds-r-full); background: hsl(var(--ds-surface-2)); color: hsl(var(--ds-muted)); }
.ds-chip.is-active .ds-chip__count { background: rgba(255, 255, 255, 0.2); color: #fff; }

/* ==========================================================================
   Empty / Loading / Skeleton
   ========================================================================== */
.ds-empty { text-align: center; padding: var(--ds-12) var(--ds-5); display: grid; justify-items: center; gap: 10px; }
.ds-empty__icon { width: 52px; height: 52px; border-radius: var(--ds-r-lg); display: grid; place-items: center; background: hsl(var(--ds-surface-2)); color: hsl(var(--ds-muted-soft)); }
.ds-empty__icon svg { width: 24px; height: 24px; }
.ds-empty__title { font-family: var(--ds-font-display); font-weight: 700; font-size: 16px; }
.ds-empty__text { font-size: 14px; color: hsl(var(--ds-muted)); max-width: 380px; }

.ds-skeleton { background: linear-gradient(90deg, hsl(var(--ds-surface-2)) 25%, hsl(var(--ds-border) / 0.55) 37%, hsl(var(--ds-surface-2)) 63%); background-size: 400% 100%; animation: ds-shimmer 1.3s ease infinite; border-radius: var(--ds-r-sm); height: 14px; }
@keyframes ds-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.ds-spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid hsl(var(--ds-border-strong)); border-top-color: hsl(var(--ds-primary)); animation: ds-spin 0.7s linear infinite; }

/* ==========================================================================
   Barra / gráfico simples (sem biblioteca)
   ========================================================================== */
.ds-bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; }
.ds-bars__item { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; min-width: 0; }
.ds-bars__bar { width: 100%; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, hsl(var(--ds-primary)) 0%, hsl(var(--ds-primary) / 0.55) 100%); transition: opacity var(--ds-transition); min-height: 3px; }
.ds-bars__item:hover .ds-bars__bar { opacity: 0.82; }
.ds-bars__label { font-size: 11px; color: hsl(var(--ds-muted)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

.ds-progress { height: 7px; border-radius: var(--ds-r-full); background: hsl(var(--ds-surface-2)); overflow: hidden; }
.ds-progress__fill { height: 100%; border-radius: inherit; background: hsl(var(--ds-primary)); }

/* ==========================================================================
   Timeline (status de pedido)
   ========================================================================== */
.ds-timeline { display: grid; gap: 0; }
.ds-timeline__step { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 12px; }
.ds-timeline__marker { display: grid; justify-items: center; }
.ds-timeline__dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: hsl(var(--ds-surface-2)); color: hsl(var(--ds-muted-soft)); border: 2px solid hsl(var(--ds-surface)); }
.ds-timeline__dot svg { width: 12px; height: 12px; }
.ds-timeline__line { width: 2px; flex: 1; min-height: 22px; background: hsl(var(--ds-border)); }
.ds-timeline__step.is-done .ds-timeline__dot { background: hsl(var(--ds-success)); color: #fff; }
.ds-timeline__step.is-done .ds-timeline__line { background: hsl(var(--ds-success) / 0.45); }
.ds-timeline__step.is-current .ds-timeline__dot { background: hsl(var(--ds-primary)); color: #fff; box-shadow: 0 0 0 4px hsl(var(--ds-primary) / 0.16); }
.ds-timeline__content { padding-bottom: 18px; }
.ds-timeline__title { font-weight: 600; font-size: 14px; }
.ds-timeline__time { font-size: 12.5px; color: hsl(var(--ds-muted)); }

/* ==========================================================================
   Utilitários curtos
   ========================================================================== */
.ds-stack { display: grid; gap: var(--ds-4); }
.ds-stack--sm { gap: var(--ds-2); }
.ds-row { display: flex; align-items: center; gap: var(--ds-3); }
.ds-row--between { justify-content: space-between; }
.ds-wrap { flex-wrap: wrap; }
.ds-min0 { min-width: 0; }
.ds-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ds-divider { height: 1px; background: hsl(var(--ds-border)); border: 0; margin: var(--ds-4) 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------------- Listas de atividade ---------------- */
.ds-list { list-style: none; margin: 0; padding: 0; }
.ds-list__row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid hsl(var(--ds-border));
}
.ds-list__row:last-child { border-bottom: 0; padding-bottom: 0; }
.ds-list__row:first-child { padding-top: 0; }
.ds-list__title {
  display: block; font-size: 14px; font-weight: 600; color: hsl(var(--ds-foreground));
  text-decoration: none;
}
a.ds-list__title:hover { color: hsl(var(--ds-primary-dark)); }
.ds-list__meta { display: block; font-size: 12.5px; color: hsl(var(--ds-muted)); margin-top: 2px; }
.ds-list__side { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
