/* =========================================================================
   Academia · Design System (protótipo)
   Direção: Swiss/minimalista, painel denso, inspirado no dashboard Cloudflare.
   Regra: componentes usam só tokens (var(--...)); nada de cor crua fora daqui.
   ========================================================================= */

:root {
  /* Neutros */
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-sunken: #f5f5f5;
  --surface-hover: #f2f2f2;
  --border: #e5e5e5;
  --border-strong: #d4d4d4;
  --text: #171717;
  --text-secondary: #404040;
  --text-muted: #6b6b6b;      /* 5.3:1 em branco */
  --text-faint: #8a8a8a;      /* só para texto auxiliar >= 12px, nunca informação essencial */

  /* Marca / ação principal (teal do Academia, escurecido para contraste AA) */
  --primary: #0f766e;         /* 5.4:1 com branco */
  --primary-hover: #115e59;
  --primary-soft: #f0fdfa;
  --primary-border: #99f6e4;
  --on-primary: #ffffff;
  --link: #0f766e;
  --focus: #2563eb;

  /* Status: sempre com texto/ícone, nunca só cor */
  --success: #15803d; --success-soft: #f0fdf4; --success-border: #bbf7d0;
  --warning: #a16207; --warning-soft: #fefce8; --warning-border: #fde68a;
  --danger:  #b91c1c; --danger-soft:  #fef2f2; --danger-border:  #fecaca;
  --info:    #1d4ed8; --info-soft:    #eff6ff; --info-border:    #bfdbfe;

  /* Gráficos */
  --chart-1: #2563eb;
  --chart-1-fill: rgba(37, 99, 235, .12);
  --chart-2: #0f766e;
  --chart-grid: #ececec;

  /* Tipografia */
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --text-xs: 12px; --text-sm: 13px; --text-md: 14px; --text-lg: 16px;
  --text-xl: 20px; --text-2xl: 24px; --text-3xl: 30px;

  /* Espaço (ritmo de 4px, densidade alta) */
  --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;

  /* Forma e profundidade */
  --radius-sm: 6px; --radius: 8px; --radius-lg: 12px; --radius-full: 999px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-pop: 0 8px 24px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.06);

  /* Layout */
  --sidebar-w: 248px;
  --topbar-h: 56px;
  --content-max: 1280px;

  /* Movimento */
  --ease: cubic-bezier(.2,.0,.0,1);
  --dur-fast: 120ms; --dur: 180ms;
}

:root[data-theme="dark"] {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface-sunken: #0f0f0f;
  --surface-hover: #1c1c1c;
  --border: #262626;
  --border-strong: #3a3a3a;
  --text: #f5f5f5;
  --text-secondary: #d4d4d4;
  --text-muted: #a3a3a3;
  --text-faint: #8a8a8a;
  --primary: #14b8a6;
  --primary-hover: #2dd4bf;
  --primary-soft: rgba(20,184,166,.12);
  --primary-border: rgba(20,184,166,.35);
  --on-primary: #042f2e;
  --link: #5eead4;
  --focus: #60a5fa;
  --success: #4ade80; --success-soft: rgba(74,222,128,.10); --success-border: rgba(74,222,128,.30);
  --warning: #facc15; --warning-soft: rgba(250,204,21,.10); --warning-border: rgba(250,204,21,.30);
  --danger:  #f87171; --danger-soft:  rgba(248,113,113,.10); --danger-border:  rgba(248,113,113,.30);
  --info:    #60a5fa; --info-soft:    rgba(96,165,250,.10); --info-border:    rgba(96,165,250,.30);
  --chart-1: #60a5fa; --chart-1-fill: rgba(96,165,250,.15); --chart-2: #2dd4bf; --chart-grid: #262626;
  --shadow-sm: none; --shadow: none; --shadow-pop: 0 8px 24px rgba(0,0,0,.5);
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur-fast: 0ms; --dur: 0ms; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
.ds-app {
  background: var(--bg); color: var(--text);
  font: 400 var(--text-md)/1.5 var(--font); font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
:where(.ds-view a) { color: var(--link); text-decoration: none; }
:where(.ds-view a:hover) { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.ds-view h1, .ds-view h2, .ds-view h3, .ds-view h4 { margin: 0; color: var(--text); letter-spacing: -0.01em; }
.ds-view p { margin: 0; }
.ds-icon { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ds-icon-sm { width: 14px; height: 14px; }
.ds-icon-lg { width: 20px; height: 20px; }
.ds-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ds-muted { color: var(--text-muted); }
.ds-mono { font-family: var(--font-mono); font-size: var(--text-sm); }
.ds-num { font-variant-numeric: tabular-nums; }

/* ---------- App shell ---------- */
.ds-app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.ds-sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); border-right: 1px solid var(--border); overflow: hidden;
}
.ds-sidebar-head { height: var(--topbar-h); display: flex; align-items: center; gap: var(--s-2); padding: 0 var(--s-3); border-bottom: 1px solid var(--border); }
.ds-brand-mark { width: 28px; height: 28px; border-radius: 7px; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.ds-switcher {
  flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: var(--s-2);
  padding: 6px 8px; border: 0; background: transparent; border-radius: var(--radius-sm); color: var(--text); font: 600 var(--text-md) var(--font); cursor: pointer;
}
.ds-switcher:hover { background: var(--surface-hover); }
.ds-switcher span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-sidebar-search { padding: var(--s-3); }
.ds-search-trigger {
  width: 100%; display: flex; align-items: center; gap: var(--s-2); padding: 7px 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-muted); font: var(--text-sm) var(--font); cursor: pointer; text-align: left;
}
.ds-search-trigger:hover { border-color: var(--border-strong); }
.ds-search-trigger .ds-kbd { margin-left: auto; }
.ds-kbd { display: inline-flex; gap: 2px; }
.ds-kbd kbd { font: 500 11px var(--font); color: var(--text-muted); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--surface); }
.ds-nav { flex: 1; overflow-y: auto; padding: 0 var(--s-2) var(--s-4); }
.ds-nav-section { padding: var(--s-4) 10px var(--s-1); font-size: var(--text-xs); font-weight: 500; color: var(--text-muted); }
.ds-nav a, .ds-nav button.ds-nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; margin: 1px 0;
  border: 0; background: transparent; border-radius: var(--radius-sm); color: var(--text-secondary);
  font: 500 var(--text-md) var(--font); text-decoration: none; cursor: pointer; text-align: left;
}
.ds-nav a:hover, .ds-nav button.ds-nav-item:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
.ds-nav a[aria-current="page"] { background: var(--surface-hover); color: var(--text); font-weight: 600; }
.ds-nav .ds-chev { margin-left: auto; color: var(--text-faint); }
.ds-nav .ds-tag-new { margin-left: 6px; }
.ds-nav-sub { padding-left: 26px; }
.ds-nav-sub a { font-weight: 400; padding: 6px 10px; }
.ds-nav-back { border-bottom: 1px solid var(--border); padding: var(--s-2); }
.ds-sidebar-foot { border-top: 1px solid var(--border); padding: var(--s-2) var(--s-3); display: flex; align-items: center; justify-content: space-between; }

.ds-main { min-width: 0; display: flex; flex-direction: column; }
.ds-scrim { display: none; }
.ds-topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar-h); display: flex; align-items: center; gap: var(--s-3);
  padding: 0 var(--s-6); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.ds-topbar .ds-context { display: flex; align-items: center; gap: var(--s-2); min-width: 0; font-weight: 600; }
.ds-topbar .ds-context .ds-crumb { color: var(--text-muted); font-weight: 500; }
.ds-topbar .ds-spacer { flex: 1; }
.ds-topbar .ds-menu-toggle { display: none; }

.ds-page { width: 100%; max-width: var(--content-max); margin: 0 auto; padding: var(--s-8) var(--s-8) var(--s-12); }
.ds-page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-6); }
.ds-page-title { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.ds-page-title h1 { font-size: var(--text-2xl); font-weight: 600; line-height: 1.25; }
.ds-page-header .ds-desc { margin-top: 6px; color: var(--text-muted); }
.ds-page-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.ds-section-title { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin: var(--s-8) 0 var(--s-3); }
.ds-section-title h2 { font-size: var(--text-lg); font-weight: 600; }

/* ---------- Botões ---------- */
.ds-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: 500 var(--text-md) var(--font); cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.ds-btn:hover { background: var(--surface-hover); text-decoration: none; }
.ds-btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.ds-btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.ds-btn-ghost { border-color: transparent; background: transparent; color: var(--text-secondary); }
.ds-btn-ghost:hover { background: var(--surface-hover); color: var(--text); }
.ds-btn-danger { color: var(--danger); border-color: var(--danger-border); }
.ds-btn-danger:hover { background: var(--danger-soft); }
.ds-btn-sm { height: 30px; padding: 0 10px; font-size: var(--text-sm); }
.ds-btn-icon { width: 36px; padding: 0; }
.ds-btn-icon.ds-btn-sm { width: 30px; }
.ds-btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Status, chips e contadores ----------
   Como a Cloudflare: status é texto com ícone pequeno (só o ícone tem cor);
   marcadores e contagens são chips neutros. Nada de pílula colorida. */
.ds-status { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--text); }
.ds-status .ds-icon { width: 14px; height: 14px; stroke-width: 2; }
.ds-status-ok .ds-icon { color: var(--success); }
.ds-status-warn .ds-icon { color: var(--warning); }
.ds-status-bad { color: var(--danger); }
.ds-status-muted { color: var(--text-muted); }
.ds-chip { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 4px; border: 1px solid var(--border-strong); background: var(--surface); font: 500 var(--text-xs) var(--font); color: var(--text-secondary); white-space: nowrap; }
.ds-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 4px; border: 1px solid var(--border-strong); font: 600 11px var(--font); color: var(--text-secondary); }
.ds-eyebrow { font-size: var(--text-xs); font-weight: 500; color: var(--text-muted); }

/* ---------- Cards ---------- */
.ds-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.ds-card-header { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border); }
.ds-card-header h3 { font-size: var(--text-md); font-weight: 600; }
.ds-card-body { padding: var(--s-4); }
.ds-card-footer { padding: var(--s-3) var(--s-4); border-top: 1px solid var(--border); color: var(--text-muted); font-size: var(--text-sm); }
.ds-grid { display: grid; gap: var(--s-4); }
.ds-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ds-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ds-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ds-span-2 { grid-column: span 2; }

/* KPI */
.ds-kpi { padding: var(--s-4); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ds-kpi-label { display: flex; align-items: center; justify-content: space-between; color: var(--text-muted); font-size: var(--text-sm); }
.ds-kpi-value { display: flex; align-items: baseline; gap: var(--s-2); font-size: var(--text-3xl); font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ds-delta { display: inline-flex; align-items: center; gap: 2px; font-size: var(--text-sm); font-weight: 500; }
.ds-delta-up { color: var(--success); }
.ds-delta-down { color: var(--danger); }
.ds-kpi-foot { color: var(--text-muted); font-size: var(--text-xs); }
.ds-spark { width: 100%; height: 44px; margin-top: var(--s-2); display: block; }

/* ---------- Toolbar / formulários ---------- */
.ds-toolbar { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; margin-bottom: var(--s-3); }
.ds-input-wrap { position: relative; flex: 1 1 280px; min-width: 200px; }
.ds-input-wrap .ds-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.ds-input, .ds-select {
  width: 100%; height: 36px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: var(--text-md) var(--font);
}
.ds-input-wrap .ds-input { padding-left: 34px; }
.ds-input::placeholder { color: var(--text-muted); }
.ds-input:hover, .ds-select:hover { border-color: var(--text-faint); }
.ds-input:focus, .ds-select:focus { outline: 2px solid var(--focus); outline-offset: -1px; border-color: transparent; }
.ds-select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b6b6b' stroke-width='1.75' 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 10px center; }
.ds-field { display: flex; flex-direction: column; gap: 6px; }
.ds-label { font-size: var(--text-sm); font-weight: 500; color: var(--text-secondary); }
.ds-filter-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px 0 10px; border-radius: var(--radius-full); background: var(--surface-sunken); border: 1px solid var(--border); font-size: var(--text-sm); }
.ds-filter-chip button { border: 0; background: transparent; color: var(--text-muted); cursor: pointer; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; }
.ds-filter-chip button:hover { background: var(--surface-hover); color: var(--text); }

/* Segmented (abas da Cloudflare em Análise) */
.ds-segmented { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--radius); }
.ds-segmented a, .ds-segmented button { border: 0; background: transparent; padding: 5px 12px; border-radius: 6px; color: var(--text-muted); font: 500 var(--text-md) var(--font); cursor: pointer; text-decoration: none; }
.ds-segmented a:hover, .ds-segmented button:hover { color: var(--text); text-decoration: none; }
.ds-segmented [aria-selected="true"], .ds-segmented [aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); border: 1px solid var(--border); padding: 4px 11px; }

/* Switch */
.ds-switch { position: relative; display: inline-block; width: 34px; height: 20px; flex: none; }
.ds-switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.ds-switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--border-strong); transition: background var(--dur) var(--ease); pointer-events: none; }
.ds-switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform var(--dur) var(--ease); }
.ds-switch input:checked + span { background: var(--primary); }
.ds-switch input:checked + span::after { transform: translateX(14px); }
.ds-switch input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Tabela ---------- */
.ds-table-card { overflow: hidden; }
.ds-table-scroll { overflow-x: auto; }
.ds-table { width: 100%; border-collapse: collapse; font-size: var(--text-md); }
.ds-table th {
  text-align: left; font-weight: 500; color: var(--text-muted); font-size: var(--text-sm); padding: 10px var(--s-4);
  border-bottom: 1px solid var(--border); background: var(--surface); white-space: nowrap;
}
.ds-table th .ds-sort { display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; padding: 0; }
.ds-table th .ds-sort:hover { color: var(--text); }
.ds-table th .ds-sort[aria-sort="ascending"], .ds-table th .ds-sort[aria-sort="descending"] { color: var(--text); }
.ds-table td { padding: 10px var(--s-4); border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
.ds-table tbody tr:last-child td { border-bottom: 0; }
.ds-table tbody tr:hover td { background: var(--surface-hover); }
.ds-table tbody tr.ds-is-selected td { background: var(--primary-soft); }
.ds-table .ds-col-check { width: 40px; padding-right: 0; }
.ds-table .ds-col-actions { width: 48px; text-align: right; }
.ds-table .ds-link-strong { color: var(--text); font-weight: 500; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.ds-table .ds-link-strong:hover { text-decoration-color: var(--text); }
.ds-cell-person { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.ds-cell-person small { display: block; color: var(--text-muted); font-size: var(--text-xs); }
.ds-table-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-top: 1px solid var(--border); color: var(--text-muted); font-size: var(--text-sm); flex-wrap: wrap; }
.ds-pager { display: flex; gap: var(--s-1); align-items: center; }
.ds-checkbox { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.ds-bulk-bar { display: none; align-items: center; gap: var(--s-3); padding: var(--s-2) var(--s-4); background: var(--primary-soft); border-bottom: 1px solid var(--primary-border); font-size: var(--text-sm); }
.ds-bulk-bar.ds-is-visible { display: flex; }

/* Medidor (frequência) */
.ds-meter { display: flex; align-items: center; gap: var(--s-2); min-width: 120px; }
.ds-meter-track { flex: 1; height: 6px; border-radius: 999px; background: var(--surface-sunken); border: 1px solid var(--border); overflow: hidden; }
.ds-meter-fill { height: 100%; border-radius: 999px; background: var(--primary); }
.ds-meter-fill.ds-is-low { background: var(--danger); }
.ds-meter-fill.ds-is-mid { background: var(--warning); }
.ds-meter span { font-variant-numeric: tabular-nums; font-size: var(--text-sm); color: var(--text-secondary); width: 36px; text-align: right; }

/* Avatar */
.ds-avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-sunken); border: 1px solid var(--border); color: var(--text-secondary); font: 600 12px var(--font); }
.ds-avatar-lg { width: 56px; height: 56px; font-size: 18px; }

/* Listas tipo "Domains / Recents" da home */
.ds-list { list-style: none; margin: 0; padding: 0; }
.ds-list li + li { border-top: 1px solid var(--border); }
.ds-list-item { display: flex; align-items: center; gap: var(--s-3); padding: 11px var(--s-4); color: var(--text); text-decoration: none; }
a.ds-list-item:hover { background: var(--surface-hover); text-decoration: none; }
.ds-list-item .ds-grow { flex: 1; min-width: 0; }
.ds-list-item .ds-grow small { display: block; color: var(--text-muted); font-size: var(--text-xs); }
.ds-list-item .ds-chev { color: var(--text-faint); }

/* Descrição (dl) */
.ds-dl { display: grid; grid-template-columns: 140px 1fr; gap: 10px var(--s-4); margin: 0; font-size: var(--text-md); }
.ds-dl dt { color: var(--text-muted); }
.ds-dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* Callout / banner */
.ds-callout { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-3) var(--s-4); border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
/* Avisos neutros: só o ícone indica o tipo (sem fundo colorido). */
.ds-callout .ds-icon { margin-top: 2px; }
.ds-callout-info .ds-icon { color: var(--info); } .ds-callout-warning .ds-icon { color: var(--warning); } .ds-callout-danger .ds-icon { color: var(--danger); }
.ds-callout strong { display: block; font-weight: 600; }
.ds-callout .ds-actions { margin-left: auto; display: flex; gap: var(--s-2); }

/* Estado vazio */
.ds-empty { text-align: center; padding: var(--s-10) var(--s-6); color: var(--text-muted); }
.ds-empty .ds-icon { width: 28px; height: 28px; color: var(--text-faint); margin-bottom: var(--s-2); }
.ds-empty strong { display: block; color: var(--text); font-weight: 600; margin-bottom: 4px; }

/* Timeline */
.ds-timeline { list-style: none; margin: 0; padding: 0 var(--s-4); }
.ds-timeline li { position: relative; padding: 10px 0 10px 22px; border-left: 1px solid var(--border); margin-left: 6px; }
.ds-timeline li::before { content: ""; position: absolute; left: -5px; top: 15px; width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-strong); }
.ds-timeline li.ds-is-ok::before { border-color: var(--success); }
.ds-timeline li.ds-is-bad::before { border-color: var(--danger); }
.ds-timeline small { display: block; color: var(--text-muted); font-size: var(--text-xs); }

/* Menu flutuante (ações de linha) */
.ds-menu-wrap { position: relative; display: inline-block; }
.ds-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 200px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-pop); display: none; }
.ds-menu.ds-is-open { display: block; }
.ds-menu a:not(.ds-btn), .ds-menu button:not(.ds-btn):not(.ds-combo-trigger):not(.ds-date-toggle):not(.ds-date-nav):not(.ds-date-day) { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: 0; background: transparent; border-radius: 6px; color: var(--text); font: var(--text-md) var(--font); text-decoration: none; cursor: pointer; text-align: left; }
.ds-menu a:not(.ds-btn):hover, .ds-menu button:not(.ds-btn):not(.ds-combo-trigger):not(.ds-date-toggle):not(.ds-date-nav):not(.ds-date-day):hover { background: var(--surface-hover); text-decoration: none; }
.ds-menu .ds-danger { color: var(--danger); }
.ds-menu hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }

/* Gráfico de barras simples (SVG) */
.ds-chart { width: 100%; height: auto; display: block; }
.ds-chart .ds-grid-line { stroke: var(--chart-grid); stroke-width: 1; }
.ds-chart .ds-axis { fill: var(--text-muted); font: 11px var(--font); }
.ds-chart .ds-bar-ok { fill: var(--chart-2); }
.ds-chart .ds-bar-miss { fill: var(--danger); opacity: .85; }
.ds-chart .ds-bar-none { fill: var(--border-strong); }
.ds-legend { display: flex; gap: var(--s-4); flex-wrap: wrap; font-size: var(--text-sm); color: var(--text-secondary); }
.ds-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

/* Paleta de comandos */
.ds-palette { width: min(560px, 92vw); padding: var(--s-3); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop); margin-top: 12vh; }
.ds-palette::backdrop { background: rgba(0,0,0,.35); }

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
  .ds-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ds-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .ds-app { grid-template-columns: 1fr; }
  .ds-sidebar { position: fixed; z-index: 50; left: 0; top: 0; width: min(300px, 86vw); transform: translateX(-100%); transition: transform var(--dur) var(--ease); background: var(--surface); }
  .ds-app.ds-nav-open .ds-sidebar { transform: none; box-shadow: var(--shadow-pop); }
  .ds-scrim { display: none; position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.35); }
  .ds-app.ds-nav-open .ds-scrim { display: block; }
  .ds-topbar .ds-menu-toggle { display: inline-flex; }
  .ds-page { padding: var(--s-6) var(--s-4) var(--s-10); }
  .ds-topbar { padding: 0 var(--s-4); }
  .ds-grid-2, .ds-grid-3 { grid-template-columns: 1fr; }
  .ds-span-2 { grid-column: auto; }
  .ds-hide-md { display: none; }
}
@media (max-width: 600px) {
  .ds-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); }
  .ds-grid-4 .ds-kpi { padding: var(--s-3); }
  .ds-page-title h1 { font-size: var(--text-xl); }
  .ds-kpi-value { font-size: var(--text-2xl); }
  .ds-hide-sm { display: none; }
  .ds-dl { grid-template-columns: 1fr; gap: 2px; }
  .ds-dl dd { margin-bottom: var(--s-2); }
}
