/* ==========================================================================
   Demandz UI — sistema visual (v2)
   Carregado por último em todas as telas. Organização:
   01 Tokens · 02 Base · 03 Shell (menu, barra, celular) · 04 Cabeçalho de página
   05 Superfícies · 06 Botões · 07 Formulários · 08 Status · 09 Tabelas
   10 Navegação secundária · 11 Diálogos · 12 Visão geral · 13 Telas
   ========================================================================== */

/* 01 · Tokens ------------------------------------------------------------- */
:root {
  /* Marca */
  --v-50: #f5f2ff;
  --v-100: #ece6ff;
  --v-200: #dcd2ff;
  --v-300: #bfaeff;
  --v-400: #9a82ff;
  --v-500: #7656f6;
  --v-600: #5f3ce8;
  --v-700: #4d2cc7;
  --v-800: #3a2195;
  --v-900: #251863;

  /* Neutros (tinta levemente violeta) */
  --ink: #141029;
  --ink-2: #1d1736;
  --ink-3: #2a2347;

  /* Mapeamento para as variáveis já usadas nas telas */
  --bg: #f3f2f8;
  --bg-2: #ffffff;
  --bg-3: #f8f7fc;
  --surface: #ffffff;
  --surface-2: #f8f7fc;
  --surface-3: #efedf6;
  --border: #e7e5ef;
  --border-2: #d6d2e3;
  --text: #17122e;
  --text-2: #463f5f;
  --text-3: #645e7c;
  --text-4: #8a85a0;

  --purple: var(--v-600);
  --purple-2: var(--v-600);
  --purple-3: var(--v-700);
  --purple-soft: var(--v-50);
  --grad: linear-gradient(140deg, #7a5cff 0%, #5f3ce8 55%, #4a2bc2 100%);
  --grad-subtle: linear-gradient(140deg, var(--v-100), var(--v-50));

  --success: #0f7350;
  --success-soft: #e4f5ed;
  --success-line: #b9e4cf;
  --warning: #9a5208;
  --warning-soft: #fdf1df;
  --warning-line: #f3d4a6;
  --danger: #bf2338;
  --danger-soft: #fde9ec;
  --danger-line: #f5c0c8;
  --info: #2353c2;
  --info-soft: #e8eefd;
  --info-line: #c3d3f7;
  --orange: #c2560c;
  --orange-soft: #fdeee2;

  /* Escala */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px;
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --ctl-h: 42px;
  --ctl-h-sm: 34px;

  --shadow-sm: 0 1px 2px rgba(20, 16, 41, .04), 0 1px 1px rgba(20, 16, 41, .02);
  --shadow: 0 1px 2px rgba(20, 16, 41, .04), 0 8px 24px -10px rgba(20, 16, 41, .10);
  --shadow-lg: 0 24px 60px -18px rgba(20, 16, 41, .28), 0 2px 6px rgba(20, 16, 41, .06);
  --ring: 0 0 0 3px rgba(95, 60, 232, .22);
  --focus: 2px solid var(--v-600);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

/* 02 · Base --------------------------------------------------------------- */
html, body { background: var(--bg); color: var(--text); font-family: var(--font); }
body { font-size: 14px; line-height: 1.5; letter-spacing: -.006em; font-feature-settings: "cv11", "ss01", "tnum" 0; }
::selection { background: var(--v-200); color: var(--ink); }
.code-mono, code { font-family: var(--mono); font-feature-settings: normal; }
.muted-mono { font-family: inherit; color: var(--text-3); font-size: 12px; letter-spacing: 0; font-variant-numeric: tabular-nums; }
:is(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: var(--focus); outline-offset: 2px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d4d0e1; border-radius: 99px; border: 3px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* 03 · Shell -------------------------------------------------------------- */
.app.dz-pilot { background: var(--bg); color: var(--text); }
.dz-pilot > .main {
  width: 100%;
  min-width: 0;
  max-width: none;
  padding: 0 0 56px;
}

/* Menu lateral */
.dz-pilot .sidebar {
  --nav-fg: #e9e5f7;
  --nav-muted: #9c95b8;
  --nav-line: rgba(255, 255, 255, .08);
  background:
    radial-gradient(120% 40% at 0% 0%, rgba(118, 86, 246, .22), transparent 60%),
    var(--ink);
  border: 0;
  border-radius: var(--r-xl);
  box-shadow: 0 20px 40px -20px rgba(20, 16, 41, .55);
  color: var(--nav-fg);
  padding: 14px 12px 12px;
  gap: 2px;
  scrollbar-width: none;
}
.dz-pilot .sidebar::-webkit-scrollbar { display: none; }
.dz-pilot .brand { min-height: 48px; gap: 11px; padding: 4px 8px 14px; margin: 0 0 6px; border-bottom: 1px solid var(--nav-line); }
.dz-pilot .brand-mark { width: 36px; height: 36px; border-radius: 11px; box-shadow: 0 6px 16px -4px rgba(118, 86, 246, .7); }
.dz-pilot .brand-name { color: #fff; font-size: 17px; font-weight: 700; letter-spacing: -.03em; }
.dz-pilot .nav-section {
  padding: 16px 12px 6px;
  margin: 0;
  border: 0;
  color: var(--nav-muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.dz-pilot .nav-section-muted { margin-top: 6px; padding-top: 16px; border-top: 1px solid var(--nav-line); }
.dz-pilot .nav-item {
  position: relative;
  flex-shrink: 0;
  min-height: 40px;
  padding: 9px 12px;
  gap: 12px;
  border-radius: 12px;
  color: var(--nav-fg);
  font-size: 13.5px;
  font-weight: 500;
  opacity: 1;
  transition: background .15s ease, color .15s ease;
}
.dz-pilot .nav-item > span:not(.nav-badge) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dz-pilot .nav-item .nav-ico { color: var(--nav-muted); transition: color .15s ease; }
.dz-pilot .nav-item .nav-ico :is(i, svg) { width: 19px; height: 19px; stroke-width: 1.75; }
.dz-pilot .nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.dz-pilot .nav-item:hover .nav-ico { color: #fff; }
.dz-pilot .nav-item.active {
  background: var(--v-500);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 8px 18px -8px rgba(118, 86, 246, .9), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.dz-pilot .nav-item.active .nav-ico { color: #fff; }
.dz-pilot .nav-item-muted { color: #cfc9e2; }
.dz-pilot .sidebar .nav-badge {
  margin-left: auto;
  min-width: 20px;
  padding: 1px 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.dz-pilot .sidebar .nav-item.active .nav-badge { background: rgba(255, 255, 255, .22); color: #fff; }
.dz-pilot .sidebar .dz-switch-trigger,
.dz-pilot .sidebar .user-card {
  flex-shrink: 0;
  border: 1px solid var(--nav-line);
  background: rgba(255, 255, 255, .04);
  color: var(--nav-fg);
  border-radius: 14px;
}
.dz-pilot .sidebar .dz-switch-trigger { min-height: 42px; margin: 10px 0 6px; font-weight: 500; }
.dz-pilot .sidebar .dz-switch-trigger svg { color: var(--nav-muted); }
.dz-pilot .sidebar .user-card { margin-top: 0; padding: 9px 10px; }
.dz-pilot .sidebar .dz-switch-trigger:hover,
.dz-pilot .sidebar .user-card:hover { background: rgba(255, 255, 255, .09); border-color: rgba(255, 255, 255, .14); color: #fff; }
.dz-pilot .sidebar .avatar { width: 32px; height: 32px; background: linear-gradient(140deg, #a48dff, #6a48f0); font-size: 11.5px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .1); }
.dz-pilot .sidebar .user-name { color: #fff; font-weight: 600; font-size: 13px; }
.dz-pilot .sidebar .user-role { color: var(--nav-muted); }
.dz-pilot .sidebar .user-card > :is(i, svg) { color: var(--nav-muted) !important; }
.dz-pilot .sidebar :is(a, button):focus-visible { outline: 2px solid #c9b8ff; outline-offset: -2px; }
/* O primeiro item depois da lista empurra o rodapé para baixo */
.dz-pilot .sidebar > link + .dz-switch-trigger, .dz-pilot .sidebar .dz-switch-trigger { margin-top: auto; }

/* Desktop: trilho recolhido que abre empurrando o conteúdo */
@media (min-width: 781px) {
  .app.dz-pilot {
    grid-template-columns: 80px minmax(0, 1fr);
    column-gap: clamp(16px, 1.8vw, 28px);
    padding: 16px clamp(16px, 1.8vw, 28px) 0 16px;
    transition: grid-template-columns .22s cubic-bezier(.3, .7, .2, 1);
  }
  .app.dz-pilot:has(> .sidebar:focus-within),
  .app.dz-pilot.dz-menu-pinned { grid-template-columns: 256px minmax(0, 1fr); }
  .app.dz-pilot > .sidebar {
    position: sticky;
    top: 16px;
    width: 100%;
    height: calc(100dvh - 32px);
    transition: none;
    box-shadow: 0 20px 40px -20px rgba(20, 16, 41, .55);
  }
  .dz-pilot .sidebar:hover, .dz-pilot .sidebar:focus-within { width: 100%; border-color: transparent; }

  /* Recolhido */
  .dz-pilot .sidebar:not(:hover):not(:focus-within) { padding-inline: 12px; }
  .dz-pilot .sidebar:not(:hover):not(:focus-within) .brand { justify-content: center; padding-inline: 0; }
  .dz-pilot .sidebar:not(:hover):not(:focus-within) .brand-name { display: none; }
  .dz-pilot .sidebar:not(:hover):not(:focus-within) .nav-item {
    display: flex;
    justify-content: center;
    width: 48px;
    min-height: 44px;
    margin-inline: auto;
    padding: 0;
  }
  .dz-pilot .sidebar:not(:hover):not(:focus-within) .nav-section { display: block; height: 1px; padding: 0; margin: 10px 14px; background: var(--nav-line); font-size: 0; }
  .dz-pilot .sidebar:not(:hover):not(:focus-within) .nav-section-muted { border: 0; }
  .dz-pilot .sidebar:not(:hover):not(:focus-within) .nav-badge {
    position: absolute;
    top: 3px;
    right: 2px;
    min-width: 17px;
    height: 17px;
    padding: 0 5px;
    font-size: 10px;
    line-height: 17px;
    background: var(--v-400);
    color: #fff;
    box-shadow: 0 0 0 2px var(--ink);
  }
  .dz-pilot .sidebar:not(:hover):not(:focus-within) .nav-item.active .nav-badge { background: #fff; color: var(--v-700); }
  .dz-pilot .sidebar:not(:hover):not(:focus-within) .dz-switch-trigger { justify-content: center; padding-inline: 0; }
  .dz-pilot .sidebar:not(:hover):not(:focus-within) .dz-switch-trigger span { display: none; }
  .dz-pilot .sidebar:not(:hover):not(:focus-within) .user-card { justify-content: center; padding-inline: 0; gap: 0; }
  .dz-pilot .sidebar:not(:hover):not(:focus-within) .user-card > *:not(.avatar) { display: none; }

  /* Fixado: mantém aberto mesmo sem hover */
  .dz-menu-pinned .sidebar:not(:hover):not(:focus-within) { padding-inline: 12px; }
  .dz-menu-pinned .sidebar:not(:hover):not(:focus-within) .brand { justify-content: flex-start; padding-inline: 8px; }
  .dz-menu-pinned .sidebar:not(:hover):not(:focus-within) .brand-name { display: block; }
  .dz-menu-pinned .sidebar .brand-name,
  .dz-menu-pinned .sidebar .user-card .user-info,
  .dz-menu-pinned .sidebar .user-card > i { opacity: 1; transform: none; }
  .dz-menu-pinned .sidebar:not(:hover):not(:focus-within) .nav-item {
    justify-content: flex-start;
    width: auto;
    min-height: 40px;
    margin-inline: 0;
    padding: 9px 12px;
  }
  .dz-menu-pinned .sidebar:not(:hover):not(:focus-within) :is(.nav-item > span:not(.nav-badge)) { display: block; }
  .dz-menu-pinned .sidebar:not(:hover):not(:focus-within) .nav-section {
    display: block; height: auto; margin: 0; padding: 16px 12px 6px; background: none; font-size: 10.5px;
  }
  .dz-menu-pinned .sidebar:not(:hover):not(:focus-within) .nav-section-muted { margin-top: 6px; border-top: 1px solid var(--nav-line); }
  .dz-menu-pinned .sidebar:not(:hover):not(:focus-within) .nav-badge {
    position: static; height: auto; min-width: 20px; padding: 1px 7px; font-size: 11px; line-height: 18px;
    background: rgba(255, 255, 255, .1); box-shadow: none;
  }
  .dz-menu-pinned .sidebar:not(:hover):not(:focus-within) .nav-item.active .nav-badge { background: rgba(255, 255, 255, .22); color: #fff; }
  .dz-menu-pinned .sidebar:not(:hover):not(:focus-within) .dz-switch-trigger { justify-content: flex-start; padding-inline: 12px; }
  .dz-menu-pinned .sidebar:not(:hover):not(:focus-within) .dz-switch-trigger span { display: inline; }
  .dz-menu-pinned .sidebar:not(:hover):not(:focus-within) .user-card { justify-content: flex-start; gap: 10px; padding-inline: 10px; }
  .dz-menu-pinned .sidebar:not(:hover):not(:focus-within) .user-card > :not(.avatar) { display: block; }
}
@media (min-width: 781px) and (hover: hover) {
  .app.dz-pilot:has(> .sidebar:hover) { grid-template-columns: 256px minmax(0, 1fr); }
}

/* Barra superior de contexto */
.dz-workspace-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin: -16px 0 18px;
  padding: 16px 0 8px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(var(--bg) 70%, rgba(243, 242, 248, 0));
  box-shadow: none;
}
.dz-workspace-location, .dz-workspace-location nav { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dz-workspace-location nav { font-size: 13px; color: var(--text-3); font-weight: 500; }
.dz-workspace-location nav a { color: var(--text-3); border-radius: 6px; }
.dz-workspace-location nav a:hover { color: var(--v-700); text-decoration: none; }
.dz-workspace-location nav :is(i, svg) { width: 14px; height: 14px; color: var(--text-4); }
.dz-workspace-location [aria-current] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 600; }
.dz-pin-menu {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background .15s, color .15s, border-color .15s;
}
.dz-pin-menu :is(i, svg) { width: 17px; height: 17px; }
.dz-pin-menu:hover { border-color: var(--border-2); color: var(--v-700); }
.dz-pin-menu[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.dz-workspace-shortcut {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding-inline: 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.dz-workspace-shortcut :is(i, svg) { width: 15px; height: 15px; color: var(--v-600); }
.dz-workspace-shortcut:hover { border-color: var(--v-200); color: var(--v-700); background: var(--v-50); }

.dz-mobile-bar { display: none; }
.dz-skip-link {
  position: fixed; top: 10px; left: 10px; z-index: 65;
  transform: translateY(-150%);
  padding: 10px 16px; border-radius: 12px;
  background: var(--ink); color: #fff; font-weight: 600;
}
.dz-skip-link:focus { transform: none; }

/* 04 · Cabeçalho de página ----------------------------------------------- */
.dz-pilot h2.page,
.dz-pilot .main h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(24px, 2.2vw, 30px);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -.035em;
}
.dz-pilot h2.page > span {
  display: inline-flex !important;
  align-items: center;
  height: 24px;
  margin-left: 6px;
  padding: 0 9px;
  border-radius: 99px;
  background: var(--surface-3);
  color: var(--text-2) !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  letter-spacing: 0;
  vertical-align: 5px;
  font-variant-numeric: tabular-nums;
}
.dz-pilot .page-sub { margin: 6px 0 0 !important; color: var(--text-3); font-size: 13.5px; line-height: 1.5; }
.dz-pilot .main > div:has(> div > h2.page),
.dz-pilot .main > header:has(h2.page),
.dz-pilot .main > div:has(> h2.page),
.dz-pilot :is(.ag-head, .msg-head) {
  display: flex;
  align-items: flex-end !important;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 20px !important;
  margin: 0 0 22px !important;
}
.dz-pilot .main > div:has(> h2.page) { display: block; }
.dz-pilot .main > div:has(> div > h2.page) > div:last-child:not(:first-child),
.dz-pilot :is(.ag-head-actions) { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* 05 · Superfícies -------------------------------------------------------- */
.dz-pilot .card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px 22px;
}
.dz-pilot .card-flat { background: var(--surface-2); box-shadow: none; }
.dz-pilot .card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.dz-pilot .card-title {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -.015em;
}
.dz-pilot .card-title > :is(i, svg) {
  width: 30px !important;
  height: 30px !important;
  padding: 7px;
  border-radius: 10px;
  background: var(--v-50);
  color: var(--v-600);
  flex-shrink: 0;
}
.dz-pilot .pill, .dz-pilot .card-title .pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border: 0;
  border-radius: 99px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.dz-pilot .card-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  margin: -6px -10px -6px 0;
  border-radius: 99px;
  color: var(--v-700);
  font-size: 12.5px;
  font-weight: 600;
}
.dz-pilot .card-link :is(i, svg) { width: 14px; height: 14px; }
.dz-pilot .card-link:hover { background: var(--v-50); color: var(--v-800); }
.dz-pilot .empty { padding: 44px 20px; text-align: center; color: var(--text-3); }
.dz-pilot .empty > :is(i, svg) {
  width: 52px; height: 52px; padding: 14px; margin: 0 auto 12px; display: block;
  border-radius: 16px; background: var(--surface-3); color: var(--text-3); stroke-width: 1.6;
}
.dz-pilot .empty h4 { color: var(--text); font-size: 14.5px; font-weight: 650; margin-bottom: 4px; }
.dz-pilot .empty p { color: var(--text-3); font-size: 13px; }
.dz-pilot .alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r-md); font-weight: 500; line-height: 1.5; }
.dz-pilot .alert-success { background: var(--success-soft); border-color: var(--success-line); color: var(--success); }
.dz-pilot .alert-danger { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.dz-pilot .alert-warning { background: var(--warning-soft); border-color: var(--warning-line); color: var(--warning); }
.dz-pilot .alert-info { background: var(--info-soft); border-color: var(--info-line); color: var(--info); }

/* 06 · Botões ------------------------------------------------------------- */
.btn,
.dz-pilot .main .btn {
  min-height: var(--ctl-h);
  padding: 0 18px;
  gap: 8px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -.005em;
  line-height: 1;
  white-space: nowrap;
  background-image: none;
  animation: none;
  transform: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.btn :is(i, svg) { width: 16px; height: 16px; stroke-width: 2; }
.btn:hover { transform: none; animation: none; }
.btn-primary,
.dz-pilot .main .btn-primary {
  background: var(--v-600);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, 0));
  color: #fff;
  border-color: var(--v-700);
  box-shadow: 0 1px 2px rgba(37, 24, 99, .2), 0 6px 14px -6px rgba(95, 60, 232, .7), inset 0 1px 0 rgba(255, 255, 255, .16);
}
.btn-primary:hover,
.dz-pilot .main .btn-primary:hover { background-color: var(--v-700); background-position: 0 0; animation: none; transform: none; }
.btn-primary:active { background-color: var(--v-800); }
.btn-ghost,
.dz-pilot .main .btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-2);
  box-shadow: var(--shadow-sm);
}
.btn-ghost:hover,
.dz-pilot .main .btn-ghost:hover { background: var(--surface-2); border-color: #c7c2d8; color: var(--text); }
.btn-ghost :is(i, svg) { color: var(--text-2); }
.btn-danger,
.dz-pilot .main .btn-danger { background: var(--danger); color: #fff; border: 1px solid #a51d30; box-shadow: 0 6px 14px -8px rgba(191, 35, 56, .8); }
.btn-danger:hover, .dz-pilot .main .btn-danger:hover { background: #a51d30; }
.btn-sm,
.dz-pilot .main .btn-sm { min-height: var(--ctl-h-sm); padding: 0 13px; font-size: 12.5px; gap: 6px; }
.btn-sm :is(i, svg) { width: 14px; height: 14px; }
.btn:disabled, .btn[disabled] { opacity: .5; filter: none; box-shadow: none; }
.btn-icon,
.dz-pilot .main .btn-icon {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-icon :is(i, svg) { width: 16px; height: 16px; stroke-width: 1.85; }
.btn-icon:hover, .dz-pilot .main .btn-icon:hover { background: var(--v-50); border-color: var(--v-100); color: var(--v-700); transform: none; }
.btn-icon.danger:hover, .dz-pilot .main .btn-icon.danger:hover { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.icon-btn { border-radius: 12px; border-color: var(--border); color: var(--text-2); }
.btn.is-loading { position: relative; color: transparent !important; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .5); border-top-color: #fff; animation: dzspin .7s linear infinite;
}
.btn-ghost.is-loading::after { border-color: var(--v-200); border-top-color: var(--v-600); }
@keyframes dzspin { to { transform: rotate(360deg); } }

/* 07 · Formulários -------------------------------------------------------- */
.input, .select, .textarea,
.dz-pilot .main :is(.input, .select, .textarea) {
  min-height: var(--ctl-h);
  padding: 10px 14px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  background-color: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  box-shadow: inset 0 1px 1px rgba(20, 16, 41, .03);
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.textarea, .dz-pilot .main .textarea { min-height: 96px; line-height: 1.55; }
.input::placeholder, .textarea::placeholder { color: var(--text-4); }
.input:hover, .select:hover, .textarea:hover { border-color: #c4bfd6; }
.input:focus, .select:focus, .textarea:focus,
.dz-pilot .main :is(.input, .select, .textarea):focus {
  outline: none;
  border-color: var(--v-500);
  background-color: #fff;
  box-shadow: var(--ring);
}
.select, select.input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23645e7c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  cursor: pointer;
}
input.input[type="date"], input.input[type="datetime-local"], input.input[type="time"] { font-variant-numeric: tabular-nums; }
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; }
.label, .dz-pilot .main .label {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0;
}
.form-group { margin-bottom: 16px; }
.form-help { color: var(--text-3); font-size: 12px; line-height: 1.5; margin-top: 6px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--v-600); }
.bulk-check {
  width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid #bdb7cf; background: #fff;
}
.bulk-check:checked { background-color: var(--v-600); border-color: var(--v-600); }
details.advanced { border-radius: var(--r-md); }

/* 08 · Status e etiquetas ------------------------------------------------- */
.badge, .dz-pilot .main .badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  letter-spacing: 0;
}
.badge :is(i, svg) { width: 12px !important; height: 12px !important; stroke-width: 2.2; }
.badge-success { background: var(--success-soft); color: var(--success); border-color: var(--success-line); }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.badge-warning { background: var(--warning-soft); color: var(--warning); border-color: var(--warning-line); }
.badge-info { background: var(--info-soft); color: var(--info); border-color: var(--info-line); }
.badge-purple { background: var(--v-50); color: var(--v-700); border-color: var(--v-200); }
.badge-gray { background: var(--surface-3); color: var(--text-2); border-color: var(--border); }
/* Etiquetas de status textuais (sem ícone) ganham um ponto indicador */
.badge:is(.badge-success, .badge-warning, .badge-danger, .badge-info):not(:has(svg, i))::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* 09 · Tabelas ------------------------------------------------------------ */
.dz-pilot .table-wrap {
  min-width: 0;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
table.dz { font-size: 13.5px; border-collapse: separate; border-spacing: 0; }
table.dz th,
.dz-pilot table.dz th {
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
table.dz td { padding: 14px 16px; border-bottom: 1px solid #efedf5; color: var(--text); }
table.dz tbody tr { transition: background-color .12s; }
table.dz tbody tr:hover, .dz-pilot table.dz tbody tr:hover { background: #faf9fe; }
table.dz tbody tr:has(.bulk-check:checked) { background: var(--v-50); }
table.dz tbody tr:has(.bulk-check:checked) td:first-child { box-shadow: inset 3px 0 0 var(--v-600); }
.bulk-actions {
  align-items: center;
  padding: 10px 12px 10px 18px;
  border-radius: var(--r-md);
  border: 0;
  background: var(--ink);
  color: #cfc9e2;
  box-shadow: var(--shadow-lg);
}
.bulk-actions strong { color: #fff; }
.bulk-actions .btn-ghost { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .14); color: #fff; box-shadow: none; }
.bulk-actions .btn-ghost :is(i, svg) { color: #fff; }
.bulk-actions .btn-ghost:hover { background: rgba(255, 255, 255, .16); color: #fff; border-color: rgba(255, 255, 255, .22); }
.bulk-actions.active { position: sticky; top: 72px; z-index: 15; }

/* Paginação (gerada a partir do mesmo markup em todas as listas) */
.dz-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; margin-top: 16px; color: var(--text-3); font-size: 13px; }
.dz-pager strong { color: var(--text); font-weight: 600; }
.dz-pager-size { display: inline-flex; align-items: center; gap: 4px; padding: 3px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); }
.dz-pager-size a { min-width: 32px; height: 28px; padding: 0 10px; display: inline-grid; place-items: center; border-radius: 99px; color: var(--text-2); font-weight: 600; font-size: 12.5px; }
.dz-pager-size a:hover { background: var(--surface-3); }
.dz-pager-size a.is-active { background: var(--ink); color: #fff; }

/* 10 · Navegação secundária: abas e alternadores -------------------------- */
.dz-pill-tabs,
.dz-pilot :is(.msg-view-toggle, .ag-view-toggle) {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.dz-pill-tabs .btn,
.dz-pilot .main .dz-pill-tabs .btn,
.dz-pilot :is(.msg-view-toggle, .ag-view-toggle) a {
  min-height: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  box-shadow: none;
}
.dz-pilot :is(.msg-view-toggle, .ag-view-toggle) a :is(i, svg) { width: 15px; height: 15px; }
.dz-pill-tabs .btn:hover,
.dz-pilot :is(.msg-view-toggle, .ag-view-toggle) a:hover { background: var(--surface-3); color: var(--text); }
.dz-pill-tabs .btn-primary,
.dz-pilot .main .dz-pill-tabs .btn-primary,
.dz-pill-tabs [aria-current],
.dz-pilot :is(.msg-view-toggle, .ag-view-toggle) a.active {
  background: var(--ink);
  background-image: none;
  color: #fff;
  box-shadow: 0 4px 10px -4px rgba(20, 16, 41, .5);
}
.dz-pilot :is(.msg-view-toggle, .ag-view-toggle) a.active :is(i, svg) { color: #fff; }

/* 11 · Diálogos ----------------------------------------------------------- */
dialog, .dz-pilot .main dialog {
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  max-width: calc(100vw - 28px);
}
dialog::backdrop, .dz-pilot dialog::backdrop { background: rgba(20, 16, 41, .48); backdrop-filter: blur(6px); }
dialog .card-head { padding-bottom: 14px; border-bottom: 1px solid var(--border); }
#dz-switch-drawer { border-radius: var(--r-xl); }
#dz-demo-feedback, #demo-feedback {
  border-radius: 14px; background: var(--ink); padding: 12px 16px 12px 40px;
  font-family: var(--font); box-shadow: var(--shadow-lg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23bfaeff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4M12 8h.01'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 14px center;
}
.dz-dropdown-menu { border-radius: 14px !important; border-color: var(--border) !important; box-shadow: var(--shadow-lg) !important; padding: 6px !important; }
.dz-dd-item:hover { background: var(--surface-2); }
.dz-page-loader::before { background: linear-gradient(90deg, var(--v-400), var(--v-600)); }

/* 12 · Visão geral -------------------------------------------------------- */
.dz-pilot .dz-overview-banner {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 24px;
  margin: 0 0 26px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
}
.dz-overview-banner .dz-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 10px;
  color: var(--text-3); font-size: 13px; font-weight: 500;
}
.dz-overview-banner .dz-eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #1fae74; box-shadow: 0 0 0 4px rgba(31, 174, 116, .16); }
.dz-pilot .dz-overview-banner h1 { font-size: clamp(30px, 3vw, 40px); letter-spacing: -.045em; font-weight: 700; line-height: 1.05; }
.dz-overview-banner p { max-width: 52ch; margin-top: 8px; color: var(--text-3); font-size: 14px; }
.dz-overview-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dz-overview-actions time {
  min-height: var(--ctl-h);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-inline: 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.dz-overview-actions time :is(i, svg) { width: 16px; height: 16px; color: var(--v-600); }
.dz-pilot .dz-overview-period { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; margin-bottom: 14px; }
.dz-overview-period h2, .dz-pilot .dash-section-title h3 { color: var(--text); font-size: 17px; font-weight: 700; letter-spacing: -.025em; }

/* KPIs */
.dz-pilot .stats { gap: 16px; margin-bottom: 16px; }
body[data-page="dashboard"] .dz-pilot .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dz-pilot .stats .stat {
  --metric-accent: var(--v-600);
  --metric-tint: var(--v-50);
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "label icon" "value spark" "trend trend";
  align-items: center;
  gap: 6px 12px;
  min-height: 0;
  padding: 20px 22px;
  overflow: hidden;
}
.dz-pilot .stats .stat:nth-child(2) { --metric-accent: #2353c2; --metric-tint: #e8eefd; }
.dz-pilot .stats .stat:nth-child(3) { --metric-accent: #a1471a; --metric-tint: #fdeee2; }
.dz-pilot .stats .stat:nth-child(4) { --metric-accent: #0f7350; --metric-tint: #e4f5ed; }
.dz-stat-icon {
  grid-area: icon;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--metric-tint);
  color: var(--metric-accent);
}
.dz-stat-icon :is(i, svg) { width: 19px; height: 19px; stroke-width: 1.8; }
.dz-pilot .stat-label { grid-area: label; align-self: center; margin: 0; color: var(--text-2); font-size: 13.5px; font-weight: 600; letter-spacing: -.005em; }
.dz-pilot .stat-value {
  grid-area: value;
  margin-top: 6px;
  color: var(--text);
  font-size: clamp(32px, 3vw, 42px);
  font-weight: 700;
  letter-spacing: -.045em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.dz-pilot .stat-trend {
  grid-area: trend;
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px;
  margin: 10px 0 0;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  color: var(--text-3);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
}
.dz-pilot .stat-trend :is(i, svg) { width: 14px; height: 14px; margin: 0; color: var(--text-4); }
.dz-pilot .stat-trend.up { color: var(--text-3); }
.dz-pilot .stat-trend .dz-delta,
.dz-pilot .stat-trend.up .dz-delta {
  display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 8px; border-radius: 99px;
  background: var(--success-soft); color: var(--success); font-weight: 700; font-size: 12px;
}
.dz-pilot .stat-trend .dz-delta :is(i, svg) { color: var(--success); width: 13px; height: 13px; }
.dz-pilot .stat-trend span[style] { color: var(--text-3) !important; }
.dz-stat-spark { grid-area: spark; align-self: end; display: flex; align-items: flex-end; gap: 4px; height: 40px; }
.dz-stat-spark i { display: block; width: 7px; height: var(--h); min-height: 4px; border-radius: 3px; background: var(--v-200); font-style: normal; }
.dz-stat-spark i:last-child { background: var(--v-600); }
/* KPI em destaque */
.dz-pilot .stats .stat.is-featured,
body[data-page="dashboard"] .dz-pilot .stats .stat:first-child {
  background: radial-gradient(120% 90% at 100% 0%, #8a6dff 0%, transparent 55%), linear-gradient(150deg, #5f3ce8, #3f22ad);
  border-color: #4d2cc7;
  color: #fff;
  box-shadow: 0 18px 34px -18px rgba(77, 44, 199, .85);
}
body[data-page="dashboard"] .dz-pilot .stats .stat:first-child :is(.stat-label, .stat-value) { color: #fff; }
body[data-page="dashboard"] .dz-pilot .stats .stat:first-child .stat-trend { color: #e3dcff; border-top-color: rgba(255, 255, 255, .2); }
body[data-page="dashboard"] .dz-pilot .stats .stat:first-child .stat-trend :is(i, svg) { color: #cbbcff; }
body[data-page="dashboard"] .dz-pilot .stats .stat:first-child .dz-stat-icon { background: rgba(255, 255, 255, .16); color: #fff; }

/* Análises */
body[data-page="dashboard"] .dz-pilot .analytics-grid { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.dz-pilot .analytics-card { padding: 22px 24px; }
.dz-pilot .analytics-card .card-title { flex-wrap: wrap; font-size: 15.5px; }
.dz-pilot .analytics-filter { gap: 10px 14px; margin-bottom: 14px; padding: 8px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); }
.dz-pilot .analytics-filter, .dz-pilot .analytics-filter-fields, .dz-pilot .analytics-chart-readout { flex-wrap: wrap; }
.dz-pilot .analytics-filter .analytics-date { min-height: 36px; max-width: 100%; padding: 6px 10px; border: 1px solid var(--border-2); border-radius: 10px; background: #fff; font-variant-numeric: tabular-nums; }
.dz-pilot .analytics-filter .btn { min-height: 36px; }
.dz-pilot .analytics-filter-total { padding-right: 8px; color: var(--text-2); font-weight: 600; font-size: 12.5px; }
.dz-pilot .analytics-chart-readout { color: var(--text-3); font-size: 12px; }
.dz-pilot .analytics-chart-feedback { font-weight: 600; color: var(--text-2); }
.dz-pilot .analytics-chart-feedback.is-active { color: var(--v-700); background: var(--v-50); border-radius: 99px; padding: 2px 10px; }
.dz-pilot .analytics-chart::before { top: 0; height: auto; pointer-events: none; background: repeating-linear-gradient(to top, #ebe9f2 0 1px, transparent 1px 25%); }
.dz-pilot .analytics-day-bar {
  width: min(38px, 62%) !important;
  border-radius: 10px 10px 4px 4px !important;
  background: linear-gradient(180deg, var(--v-300), var(--v-200)) !important;
  box-shadow: none !important;
  transition: background .15s;
}
.dz-pilot .analytics-day:last-child .analytics-day-bar { background: linear-gradient(180deg, var(--v-500), var(--v-700)) !important; }
.dz-pilot .analytics-day:is(:hover, :focus-visible) .analytics-day-bar { background: linear-gradient(180deg, var(--v-500), var(--v-700)) !important; }
.dz-pilot .analytics-day:focus-visible { outline: var(--focus); outline-offset: 2px; border-radius: 10px; }
.dz-pilot .analytics-day-label { color: var(--text-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.dz-pilot .channel-row { gap: 14px; }
.dz-pilot .channel-label { color: var(--text-2); font-weight: 600; font-size: 13px; }
.dz-pilot .analytics-card .channel-track { height: 10px; border-radius: 99px; background: var(--surface-3); }
.dz-pilot .channel-fill { border-radius: 99px; }
.dz-pilot .channel-row:nth-of-type(2) .channel-fill { background: linear-gradient(90deg, #22b07d, #0f7350) !important; }
.dz-pilot .channel-row:nth-of-type(3) .channel-fill { background: linear-gradient(90deg, #f0a35a, #d9572b) !important; }
.dz-pilot .channel-row:nth-of-type(4) .channel-fill { background: linear-gradient(90deg, var(--v-300), var(--v-600)) !important; }
.dz-pilot .channel-value { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.dz-pilot .insight-grid { gap: 10px; }
.dz-pilot .insight { min-width: 0; padding: 14px; overflow-wrap: anywhere; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); }
.dz-pilot .insight-label { color: var(--text-3); font-size: 12px; font-weight: 500; }
.dz-pilot .insight-value { margin-top: 4px; color: var(--text); font-size: 22px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

/* Alertas do painel */
.dz-pilot .dash-alerts { gap: 12px; margin-bottom: 8px; }
.dz-pilot .dash-alert {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  border-radius: var(--r-lg);
  border: 1px solid var(--warning-line);
  background: linear-gradient(90deg, var(--warning-soft), #fffaf3);
  box-shadow: none;
  transition: border-color .15s, box-shadow .15s;
}
.dz-pilot .dash-alert:hover { border-color: #e6b46c; box-shadow: var(--shadow); }
.dz-pilot .dash-alert::after {
  content: ""; margin-left: auto; width: 18px; height: 18px; flex-shrink: 0; opacity: .7;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%239a5208' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E") center/18px no-repeat;
}
.dz-pilot .dash-alert-ico { width: 38px; height: 38px; border-radius: 12px; background: #fff; color: var(--warning); display: grid; place-items: center; box-shadow: var(--shadow-sm); }
.dz-pilot .dash-alert-title { color: var(--text); font-weight: 650; font-size: 14px; }
.dz-pilot .dash-alert-text { color: var(--warning); font-size: 12.5px; }

/* Seções */
.dz-pilot .dash-section-title {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  margin: 34px 0 14px; padding: 0; border: 0;
}
.dz-pilot .dash-section-title h3::before { display: none; }
.dz-pilot .dash-section-title p { margin: 3px 0 0; color: var(--text-3); font-size: 13px; }
.dz-pilot .dash-row-3, .dz-pilot .dash-row-2, .dz-pilot .dash-row-4-stats { gap: 16px; margin-bottom: 16px; }
.dz-pilot .ops-card { transition: border-color .15s, box-shadow .15s, transform .15s; }
.dz-pilot a.ops-card:hover, .dz-pilot a.dz-mini-stat:hover { border-color: var(--v-200); box-shadow: var(--shadow); }
.dz-pilot .ops-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.dz-pilot .ops-title { display: flex; align-items: center; gap: 9px; color: var(--text); font-size: 15px; font-weight: 650; }
.dz-pilot .ops-title :is(i, svg) { width: 30px; height: 30px; padding: 7px; border-radius: 10px; background: var(--v-50); color: var(--v-600); }
.dz-pilot .ops-pill { height: 24px; display: inline-flex; align-items: center; padding: 0 10px; border-radius: 99px; background: var(--v-50); color: var(--v-700); border: 1px solid var(--v-200); font-size: 12px; font-weight: 700; }
.dz-pilot .ops-pill.ok { background: var(--warning-soft); color: var(--warning); border-color: var(--warning-line); }
.dz-pilot .ops-list { display: flex; flex-direction: column; gap: 0; }
.dz-pilot .ops-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f0eef6; color: var(--text-2); font-size: 13.5px; }
.dz-pilot .ops-row:last-child { border-bottom: 0; }
.dz-pilot .ops-row strong { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.dz-pilot .sched-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.dz-pilot .sched-row + .sched-row { border-top: 1px solid #f0eef6; }
.dz-pilot .sched-date { width: 44px; height: 46px; display: grid; place-content: center; text-align: center; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.dz-pilot .sched-date .day { color: var(--v-600); font-size: 9.5px; font-weight: 700; letter-spacing: .08em; }
.dz-pilot .sched-date .num { color: var(--text); font-size: 16px; font-weight: 700; line-height: 1.1; }
.dz-pilot .sched-title { color: var(--text); font-weight: 600; font-size: 13.5px; }
.dz-pilot .sched-meta { color: var(--text-3); font-size: 12px; }
.dz-pilot .bar-chart { gap: 14px; padding-top: 22px; }
.dz-pilot .bar { border-radius: 10px 10px 4px 4px; background: var(--v-100); }
.dz-pilot .bar:hover { background: var(--v-300); }
.dz-pilot .bar:last-child { background: var(--v-600); }
.dz-pilot .bar-val { color: var(--text-2); font-weight: 700; }
.dz-pilot .bar-label { color: var(--text-3); font-variant-numeric: tabular-nums; }
.dz-activity-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--border); }
.dz-activity-summary > div { padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); color: var(--text-3); font-size: 12.5px; }
.dz-activity-summary strong { display: block; color: var(--text); font-size: 20px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.dz-mini-stat { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px !important; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.dz-mini-stat span { color: var(--text-3); font-size: 12.5px; font-weight: 500; }
.dz-mini-stat strong { color: var(--text); font-size: 26px; font-weight: 700; letter-spacing: -.035em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.dz-mini-stat small { color: var(--text-3); font-size: 12px; }
.dz-mini-stat::after {
  content: ""; position: absolute; top: 16px; right: 16px; width: 16px; height: 16px; opacity: .5;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23645e7c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M7 7h10v10'/%3E%3C/svg%3E") center/16px no-repeat;
}
.dz-pilot .dz-mini-stat { position: relative; }
.dz-note { margin-top: 14px; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; font-size: 12.5px; font-weight: 500; }
.dz-note.ok { background: var(--success-soft); color: var(--success); }
.dz-note.ok::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* 13 · Telas -------------------------------------------------------------- */
/* Faixa de resumo das telas de trabalho (ex.: Grupos) */
.dz-pilot .main > .card:has(> div > div > .badge) { padding: 12px 16px !important; background: var(--surface-2); box-shadow: none; }

/* Filtros: faixas consistentes */
.dz-pilot :is(.grupos-filters, .msg-filters, .ag-filters) { gap: 10px; }
.dz-pilot .grupos-filters {
  padding: 10px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
@media (min-width: 781px) {
  .dz-pilot .grupos-filters { grid-template-columns: minmax(160px, 1.8fr) minmax(130px, 1fr) minmax(150px, 1fr) minmax(120px, .8fr) auto; }
}
.dz-pilot .grupos-filters .btn, .dz-pilot .msg-filters .btn, .dz-pilot .ag-filters .btn { min-height: var(--ctl-h); }
.dz-pilot :is(.grupos-filters, .msg-filters) .filter-search,
.dz-pilot .ag-filters input[name="q"],
.dz-pilot input.input[name="q"],
.dz-pilot input.input[type="search"] {
  padding-left: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23645e7c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 14px center;
  background-size: 16px;
}
.dz-pilot .grupos-filters .btn, .dz-pilot .ag-filters .btn, .dz-pilot .msg-filters .btn-primary { padding-inline: 18px; }

/* Grupos */
.dz-pilot .dz-group-selection {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 14px;
  margin-bottom: 12px; padding: 8px 8px 8px 16px;
  border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface-2); box-shadow: none;
}
.dz-pilot .dz-selection-page { display: flex; align-items: center; gap: 10px; }
.dz-pilot .dz-selection-page .label { margin: 0; color: var(--text-2); font-weight: 600; }
.dz-pilot .dz-selection-page .select { width: auto; min-width: 84px; min-height: 36px; }
.dz-pilot .dz-selection-actions .btn { min-height: 36px; }
.dz-pilot .grupo-avatar { width: 40px; height: 40px; border-radius: 12px; font-size: 13px; font-weight: 700; letter-spacing: -.01em; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.dz-pilot [data-bulk-scope="grupos"] table.dz :is(th, td) { padding-inline: 14px; }
.dz-pilot .dz-group-row-actions { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: transparent; }
.dz-pilot tr:hover .dz-group-row-actions { background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }

/* Mensagens */
.dz-pilot .msg-list-card { padding: 20px 22px; }
.dz-pilot .msg-toolbar { margin-bottom: 14px; }
.dz-pilot .msg-filters { padding: 8px; margin-bottom: 18px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); }
.dz-pilot .msg-feed-grid { gap: 16px; }
.dz-pilot .msg-feed-card {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.dz-pilot .msg-feed-card:hover { border-color: var(--v-200); box-shadow: var(--shadow); }
.dz-pilot .msg-feed-card:has(.msg-feed-check input:checked) { border-color: var(--v-500); box-shadow: var(--ring); }
.dz-pilot .msg-feed-media { background: linear-gradient(160deg, var(--v-50), var(--surface-3)); border-bottom: 1px solid var(--border); }
.dz-pilot .msg-feed-media img { object-fit: cover; object-position: left center; }
.dz-pilot .msg-feed-icon { border-radius: 16px; box-shadow: 0 10px 20px -10px rgba(20, 16, 41, .25); color: var(--v-600); }
.dz-pilot .msg-feed-title { color: var(--text); font-size: 15px; font-weight: 650; letter-spacing: -.015em; }
.dz-pilot .msg-feed-meta { color: var(--text-3); font-weight: 500; }
.dz-pilot .msg-feed-text { color: var(--text-2); line-height: 1.55; }
.dz-pilot .msg-feed-actions { border-top: 1px solid #f0eef6; }
.dz-pilot .msg-ag-badge { border-radius: 99px; background: var(--v-50); border-color: var(--v-200); color: var(--v-700); font-weight: 600; }
.dz-pilot .msg-tag { border-radius: 99px; font-weight: 600; }
.dz-pilot .msg-feed-check { box-shadow: 0 2px 6px rgba(20, 16, 41, .15); }

/* Agendamentos */
.dz-pilot .ag-filter-card { padding: 10px; border-radius: var(--r-lg); }
.dz-pilot .ag-filters { grid-template-columns: minmax(200px, 1.7fr) repeat(2, minmax(140px, 1fr)) repeat(4, minmax(130px, 1fr)) auto; }
@container (max-width: 1320px) { .dz-pilot .ag-filters { grid-template-columns: repeat(4, minmax(0, 1fr)); } .dz-pilot .ag-filters input[name="q"] { grid-column: span 2; } }
.dz-pilot .ag-filters .btn { width: auto; }
.dz-pilot .ag-msg-thumb { border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--v-600); }
.dz-pilot .ag-msg-type { color: var(--text-3); }
.dz-pilot .ag-target-chip { border-radius: 99px; background: var(--v-50); color: var(--v-700); border: 1px solid var(--v-200); font-weight: 600; }
.dz-pilot .ag-event { border-radius: var(--r-md); }
.dz-pilot .ag-day { border-radius: var(--r-lg); }

/* Progresso (0/3, 3/3) */
.dz-progress { display: inline-flex; align-items: center; gap: 10px; min-width: 110px; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text-2); font-size: 12.5px; }
.dz-progress i { position: relative; flex: 1; height: 6px; min-width: 56px; border-radius: 99px; background: var(--surface-3); overflow: hidden; font-style: normal; }
.dz-progress i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--p, 0%); border-radius: inherit; background: var(--v-600); }
.dz-progress.is-done i::after { background: #1fae74; }

/* Telas de acesso */
body:has(> .login-bg) { background: var(--bg); }
body:has(> .login-bg) .login-bg {
  background:
    radial-gradient(60% 50% at 15% 10%, rgba(118, 86, 246, .18), transparent 70%),
    radial-gradient(50% 50% at 90% 90%, rgba(118, 86, 246, .14), transparent 70%),
    var(--bg);
}
body:has(> .login-bg) .login-card { border-radius: var(--r-xl); border: 1px solid var(--border); box-shadow: var(--shadow-lg); padding: 32px; }
body:has(> .login-bg) .login-card h2 { font-size: 24px; font-weight: 700; letter-spacing: -.03em; }
body:has(> .login-bg) .login-card .btn-primary { width: 100%; min-height: 46px; }

/* Celular ---------------------------------------------------------------- */
@media (max-width: 780px) {
  .dz-workspace-bar { display: none; }
  .dz-mobile-bar {
    position: fixed;
    inset: 10px 12px auto;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 56px;
    padding-inline: 8px 16px;
    border-radius: 18px;
    background: var(--ink);
    box-shadow: 0 12px 28px -12px rgba(20, 16, 41, .6);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -.02em;
  }
  .dz-mobile-bar::before {
    content: ""; order: 1; width: 28px; height: 28px; border-radius: 8px;
    background: url("./demandz-ui-logo.svg") center/cover no-repeat;
  }
  .dz-mobile-bar span { order: 2; }
  .dz-mobile-bar .hamburger {
    position: static; order: 0; width: 40px; height: 40px; border-radius: 12px; border: 0;
    background: rgba(255, 255, 255, .1); color: #fff; box-shadow: none;
  }
  .dz-mobile-bar .hamburger :is(i, svg) { color: #fff; }
  .sidebar-backdrop.open { background: rgba(20, 16, 41, .5); backdrop-filter: blur(4px); }
  .app.dz-pilot { padding: 0; }
  .app.dz-pilot .sidebar {
    position: fixed;
    top: 76px;
    left: 12px;
    height: calc(100dvh - 88px);
    width: min(290px, calc(100vw - 24px));
    transform: translateX(calc(-100% - 16px));
    visibility: hidden;
    transition: transform .25s cubic-bezier(.3, .7, .2, 1), visibility .25s;
    z-index: 55;
  }
  .app.dz-pilot .sidebar.open { visibility: visible; transform: none; }
  .app.dz-pilot .sidebar .brand { display: none; }
  .dz-pilot > .main { padding: 82px 14px 40px; }
  .dz-pilot .card, .dz-pilot .table-wrap { border-radius: 20px; }
  .dz-pilot .card { padding: 16px; }
  .dz-pilot .dz-overview-banner { margin-bottom: 20px; }
  .dz-overview-actions { width: 100%; }
  .dz-overview-actions time { flex: 1; justify-content: center; }
  .dz-pilot .dz-overview-banner .dz-overview-cta { flex: 1; }
  .dz-pilot .dz-overview-period .dz-pill-tabs { width: 100%; justify-content: space-between; }
  .dz-pilot .dz-overview-period .dz-pill-tabs .btn { flex: 1; padding: 0 8px; }
  .dz-pilot .stats { gap: 10px; }
  .dz-pilot .stats .stat { padding: 16px; }
  .dz-pilot .analytics-card { padding: 16px; }
  .dz-pilot .analytics-filter-fields { gap: 7px; }
  .dz-pilot .analytics-filter-fields .analytics-date { flex: 1 1 110px; min-width: 0; }
  .dz-pilot .analytics-card .channel-row { grid-template-columns: 78px minmax(0, 1fr) auto; }
  .dz-activity-summary { grid-template-columns: 1fr; }
  .dz-pilot .ag-filters { grid-template-columns: 1fr 1fr; }
  .dz-pilot .grupos-filters { grid-template-columns: 1fr 1fr; }
  .dz-pilot .grupos-filters .filter-search { grid-column: 1 / -1; }
  .dz-pilot .main > div:has(> div > h2.page) > div:last-child:not(:first-child) .btn,
  .dz-pilot .ag-head-actions .btn-primary { flex: 1 1 auto; }
}

/* Contêiner: o conteúdo central se reorganiza conforme o menu abre */
body:is([data-page="dashboard"], [data-page="grupos"], [data-page="agendamentos"], [data-page="mensagens"]) .dz-pilot > .main { container-type: inline-size; }
@container (max-width: 1020px) {
  body[data-page="dashboard"] .dz-pilot .analytics-grid { grid-template-columns: minmax(0, 1fr); }
  body[data-page="dashboard"] .dz-pilot .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (max-width: 820px) {
  .dz-pilot .dash-row-3 { grid-template-columns: 1fr 1fr; }
  .dz-pilot .dash-row-3 > :last-child { grid-column: 1 / -1; }
  .dz-pilot .dash-row-4-stats { grid-template-columns: 1fr 1fr; }
}
@container (max-width: 560px) {
  .dz-pilot .dash-row-3, .dz-pilot .dash-row-2 { grid-template-columns: 1fr; }
  body[data-page="dashboard"] .dz-pilot .stats .stat { padding: 14px; gap: 4px 8px; }
  .dz-pilot .stat-value { font-size: 30px; }
  .dz-stat-icon { width: 34px; height: 34px; border-radius: 10px; }
  .dz-stat-spark { display: none; }
  .dz-pilot .stat-label, .dz-pilot .stat-trend { font-size: 12px; }
  .dz-pilot .analytics-day-label { font-size: 9.5px; }
  .dz-pilot .insight { padding: 10px; }
  .dz-pilot .insight-value { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .app.dz-pilot, .app.dz-pilot .sidebar, .btn, .card { transition: none !important; }
}

/* Paginação — links */
.dz-pager > div { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dz-pager-sep { width: 1px; height: 16px; margin: 0 6px; background: var(--border-2); }
.dz-pager-label { margin-right: 2px; }
.dz-pager-link { min-width: 34px; height: 32px; padding: 0 10px; display: inline-grid; place-items: center; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 600; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.dz-pager-link:hover { border-color: var(--border-2); color: var(--text); }
.dz-pager-link.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.dz-pager .btn-sm { min-width: 34px; min-height: 32px !important; }
@media (min-width: 781px) { .dz-menu-pinned .sidebar:not(:hover):not(:focus-within) .nav-badge { margin-left: auto; } }
.dz-pilot .sidebar .nav-badge { position: static; }
@media (min-width: 781px) { .dz-pilot .sidebar:not(:hover):not(:focus-within) .nav-badge { position: absolute; } .dz-menu-pinned .sidebar:not(:hover):not(:focus-within) .nav-badge { position: static; } }
.dz-pilot .dash-alerts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.dz-pilot .bar { background: var(--v-200); }
.dz-pilot .bar-val { opacity: 1; transform: none; }
.dz-pager .btn-primary { background: var(--ink) !important; border-color: var(--ink) !important; box-shadow: none !important; }
@media (min-width: 781px) {
  .app.dz-pilot:not(.dz-menu-pinned) .sidebar:not(:hover):not(:focus-within) .nav-section { margin: 8px 16px; background: rgba(255,255,255,.12); }
}

/* Gráfico das campanhas: três séries distinguíveis */
.dz-pilot .redir-chart-bar { width: 8px; border-radius: 4px 4px 1px 1px; background: var(--v-700); box-shadow: none; }
.dz-pilot .redir-chart-bar.redirect { background: var(--v-300); }
.dz-pilot .redir-chart-bar.entry { background: #1fae74; }
.dz-pilot .redir-chart-legend span:nth-child(1) .redir-dot { background: var(--v-700) !important; }
.dz-pilot .redir-chart-legend span:nth-child(2) .redir-dot { background: var(--v-300) !important; }
.dz-pilot .redir-chart-legend span:nth-child(3) .redir-dot { background: #1fae74 !important; }
.dz-pilot .redir-chart-legend { font-size: 12px; gap: 14px; }

/* Botão sem variante = secundário */
.dz-pilot .main .btn:not(.btn-primary):not(.btn-ghost):not(.btn-danger) { background: var(--surface); color: var(--text); border: 1px solid var(--border-2); box-shadow: var(--shadow-sm); }
.dz-pilot .main .btn:not(.btn-primary):not(.btn-ghost):not(.btn-danger):hover { background: var(--surface-2); }
/* Central de alertas */
.dz-pilot .alerts-card { border-color: var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.dz-pilot .alerts-card h2, .dz-pilot .main > h2 { font-size: 17px; font-weight: 700; letter-spacing: -.025em; }
.dz-pilot .main > h2 { margin: 28px 0 12px; }
.dz-pilot .alerts-status { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 99px; background: var(--success-soft); color: var(--success); }
.dz-pilot .alerts-status:empty { display: none; }
.dz-pilot .main > div:has(> div > h2.page) + .alerts-card { margin-top: 0; }
.dz-pilot .page-header { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin: 0 0 22px; }
.dz-pilot .page-header p { margin-top: 6px; color: var(--text-3); font-size: 13.5px; }
@media (max-width: 780px) {
  .dz-overview-actions time, .dz-pilot .dz-overview-banner .dz-overview-cta { flex: 1 1 100%; white-space: nowrap; }
  .dz-pilot .dz-overview-banner .dz-overview-cta { order: -1; }
  .dz-pilot .stat-trend { align-items: flex-start; }
}
@media (max-width: 600px) {
  .dz-pilot .grupos-filters { display: flex; flex-wrap: wrap; gap: 8px; }
  .dz-pilot .grupos-filters .filter-search { flex: 1 1 0; min-width: 0; grid-column: auto; }
  .dz-pilot .grupos-filters .btn-icon-text { flex: 0 0 42px; width: 42px; min-height: 42px; height: 42px; padding: 0 !important; border-radius: 12px; }
  .dz-pilot .grupos-filters select[name="numero"] { flex: 1 1 100%; }
  .dz-pilot .grupos-filters select[name="admin"], .dz-pilot .grupos-filters select[name="origem"] { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .dz-pilot .grupos-filters .input, .dz-pilot .grupos-filters .select { height: 42px; font-size: 13.5px; padding-block: 0; }
  .dz-pilot .grupos-filters .select { padding-right: 34px; }
  .dz-pilot .dz-group-selection { padding: 12px; }
  .dz-pilot .dz-selection-actions { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
  .dz-pilot .dz-selection-actions .btn { flex: 1 1 auto; }
}
.dz-pilot .ag-filters > *, .dz-pilot .msg-filters > *, .dz-pilot .grupos-filters > * { min-width: 0; }
@media (max-width: 780px) {
  .dz-pilot .ag-filters { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .dz-pilot .ag-filters input[name="q"], .dz-pilot .ag-filters .btn { grid-column: 1 / -1; width: 100%; }
  .dz-pilot :is(.ag-head, .msg-head) > div:last-child, .dz-pilot .ag-head-actions { justify-content: flex-start; }
}
@media (min-width: 781px) { .dz-menu-pinned .sidebar:not(:hover):not(:focus-within) .nav-item, .dz-pilot .sidebar:is(:hover, :focus-within) .nav-item { gap: 12px; } }
@media (max-width: 780px) { .dz-pilot .sidebar .nav-item { gap: 12px; } }

/* Integration with the live panel. */
.dz-overview-banner .dz-eyebrow::before { background: var(--v-600); box-shadow: 0 0 0 4px var(--v-100); }
.dz-pilot .stat-trend.down .dz-delta { color: var(--danger); background: var(--danger-soft); }
.dz-pilot .stat-trend.down .dz-delta :is(i, svg) { color: inherit; }
.dz-pilot .stat-trend.flat .dz-delta { color: var(--text-3); background: var(--surface-3); }
.dz-pilot .stat-trend.flat .dz-delta :is(i, svg) { color: inherit; }
.dz-note.warning { background: var(--warning-soft); color: var(--warning); }
.dz-pilot .dash-alerts { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.dz-pilot .dz-mobile-bar::before { flex-shrink: 0; }
