/* ═══════════════════════════════════════════════════════════════════════
   app-shell.css — as camadas que hoje são donas do shell; carregam depois de legacy, como já carregavam

   Concatenação na ordem EXATA em que o index.html carregava cada folha.
   Mexer nessa ordem muda qual regra vence.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── dashboard-foundation.css ──────────────────────────────────── */
/* Painel — mesma identidade da landing: branco, preto, roxo só como detalhe.
   Canvas cinza (#F5F5F7) com cartões brancos dá profundidade sem precisar de
   borda em tudo, que era o que deixava a tela ruidosa. */

#app-shell {
  --app-ink: #1D1D1F;
  --app-canvas: #F5F5F7;
  --app-paper: #FFFFFF;
  --app-violet: oklch(0.47 0.21 286);
  --app-violet-strong: oklch(0.4 0.19 286);
  --app-lavender: #F0ECFD;
  --app-whatsapp: oklch(0.5 0.13 151);
  --app-amber: oklch(0.56 0.12 74);
  --app-danger: oklch(0.5 0.17 27);
  --bg: var(--app-canvas);
  --surface: var(--app-paper);
  --surface-alt: #F5F5F7;
  --sidebar-bg: var(--app-paper);
  --input-bg: var(--app-paper);
  --fg: var(--app-ink);
  --fg-secondary: #6E6E73;
  --fg-tertiary: #86868B;
  --text-muted: var(--fg-tertiary);
  --border: #E3E3E8;
  --border-light: #EDEDF0;
  --border-strong: #D2D2D7;
  --accent: var(--app-violet);
  --accent-hover: var(--app-violet-strong);
  --accent-soft: var(--app-lavender);
  --accent-light: oklch(0.72 0.13 286);
  --green: var(--app-whatsapp);
  --green-soft: #E7F6EE;
  --orange: var(--app-amber);
  --orange-soft: #FDF2E3;
  --red: var(--app-danger);
  --red-soft: #FDECEC;
  --shadow-sm: none;
  --shadow-md: 0 12px 34px rgba(29, 29, 31, .09);
  --shadow-lg: 0 24px 64px rgba(29, 29, 31, .16);
  --radius-xs: 5px;
  --radius-sm: 7px;
  --radius-md: 9px;
  --radius-lg: 12px;
  --radius-xl: 14px;
  min-height: 100dvh;
  color: var(--fg);
  color-scheme: light;
  background: var(--bg);
  font-family: "Figtree", "Segoe UI Variable", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -.008em;
}

#app-shell.shell { grid-template-columns: 248px minmax(0, 1fr); }
#app-shell .rail {
  padding: 22px 14px 16px;
  gap: 16px;
  background: var(--bg);
  border-right-color: var(--border);
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
#app-shell .rail__logo-wrapper { padding: 4px 9px 10px; }
#app-shell .brand-lockup__mark {
  color: oklch(0.98 0.006 286);
  background: var(--accent);
  border-radius: 8px;
  box-shadow: 0 0 22px oklch(0.51 0.225 286 / 0.2);
}
#app-shell .brand-lockup__name { color: var(--fg); font-size: 13px; letter-spacing: 0.07em; }
#app-shell .rail__copy { max-width: 25ch; margin-top: 6px; color: var(--fg-tertiary); line-height: 1.5; }
#app-shell .rail__nav { gap: 2px; }
#app-shell .nav__link {
  position: relative;
  min-height: 40px;
  padding: 8px 10px;
  gap: 9px;
  border-radius: 7px;
  color: var(--fg-secondary);
  font-size: 12px;
  font-weight: 680;
}
#app-shell .nav__link::before {
  content: "";
  position: absolute;
  inset: 9px auto 9px -5px;
  width: 2px;
  border-radius: 99px;
  background: transparent;
}
#app-shell .nav__link svg { width: 15px; height: 15px; }
#app-shell .nav__link:hover { color: var(--fg); background: color-mix(in oklch, var(--surface) 66%, transparent); }
#app-shell .nav__link.active,
#app-shell .nav__link[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: color-mix(in oklch, var(--accent) 16%, transparent);
}
#app-shell .nav__link.active::before,
#app-shell .nav__link[aria-current="page"]::before { background: var(--accent); }
#app-shell #btn-logout { margin-top: 4px !important; border-top-color: transparent !important; }

#app-shell .quota-widget,
#app-shell .whatsapp-status-indicator { background: color-mix(in oklch, var(--surface) 66%, transparent); border-color: var(--border); }
#app-shell .quota-widget { margin-top: auto; padding: 12px; }
#app-shell .quota-widget__header { font-size: 10px; font-weight: 650; }
#app-shell .quota-widget__bar-bg { background: var(--input-bg); }
#app-shell .quota-widget__bar { box-shadow: 0 0 12px oklch(0.51 0.225 286 / 0.28); }
#app-shell .whatsapp-status-indicator { min-height: 38px; font-size: 10px; }
#app-shell .whatsapp-status-indicator[data-connected="true"] { color: var(--green); background: var(--green-soft); }

#app-shell .board { max-width: 1700px; padding: 24px clamp(18px, 2.4vw, 38px) 88px; }
#app-shell .button { border-radius: 8px; box-shadow: none; transition-duration: 140ms; }
#app-shell .button--primary {
  color: oklch(0.98 0.006 286);
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 8px 20px oklch(0.42 0.18 286 / 0.16);
}
#app-shell .button--primary:hover { color: white; background: var(--accent-hover); border-color: var(--accent-hover); }
#app-shell .button--ghost { color: var(--fg-secondary); }
#app-shell .button--ghost:hover { color: var(--fg); background: var(--surface-alt); border-color: var(--border); }
#app-shell :is(input, textarea, select) { accent-color: var(--accent); }
#app-shell .field :is(input, textarea, select),
#app-shell :is(input[type="search"], input[type="date"]) {
  border-color: var(--border);
  background: var(--input-bg);
  box-shadow: inset 0 1px 0 oklch(0.2 0.03 286 / 0.025);
}
#app-shell :is(input, textarea, select)::placeholder { color: var(--fg-tertiary); opacity: 0.9; }
#app-shell :is(input, textarea, select):hover { border-color: var(--border-strong); }
#app-shell :is(input, textarea, select):focus { border-color: var(--accent); }
#app-shell :is(#view-manual, #view-settings) input[style*="#FFFFFF"] { background: var(--input-bg) !important; }

#app-shell :is(#view-manual, #view-settings, #view-subscription, #view-admin) > h2 { margin-top: 4px !important; }
#app-shell :is(#view-manual, #view-settings, #view-subscription, #view-admin) > p { max-width: 72ch; }
#app-shell :is(#manual-lead-form, #settings-credentials-form),
#app-shell #view-subscription > div,
#app-shell #admin-users-view > .admin-grid > div,
#app-shell #admin-settings-view > div {
  background: var(--surface) !important;
  border-color: var(--border) !important;
  box-shadow: none !important;
}

.shell ~ dialog {
  --bg: var(--app-canvas, oklch(0.965 0.009 286));
  --surface: var(--app-browser-paper, oklch(0.995 0.004 286));
  --surface-alt: oklch(0.945 0.013 286);
  --input-bg: oklch(0.94 0.014 286);
  --fg: oklch(0.205 0.03 286);
  --fg-secondary: oklch(0.42 0.027 286);
  --fg-tertiary: oklch(0.54 0.022 286);
  --border: oklch(0.84 0.02 286 / 0.72);
  --border-strong: oklch(0.7 0.035 286 / 0.8);
  --accent: oklch(0.51 0.225 286);
  --accent-soft: oklch(0.925 0.048 293);
  --green: oklch(0.49 0.13 151);
  --red: oklch(0.49 0.17 27);
  border-color: var(--border);
  border-radius: 16px;
}
.shell ~ dialog::backdrop { background: oklch(0.18 0.035 286 / 0.62); backdrop-filter: blur(5px); }
.shell ~ dialog[open] { animation: app-dialog-enter 180ms cubic-bezier(0.16, 1, 0.3, 1); }
.shell ~ dialog#generate-dialog { max-height: min(92dvh, 860px); overflow-y: auto; }
.shell ~ dialog :is(input, textarea, select) { background: var(--input-bg); border-color: var(--border); }
.shell ~ dialog .generation-brief {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid color-mix(in oklch, var(--accent) 18%, var(--border));
  border-radius: 12px;
  background: color-mix(in oklch, var(--accent-soft) 30%, var(--surface));
}
.shell ~ dialog .generation-brief__header {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}
.shell ~ dialog .generation-brief__icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid color-mix(in oklch, var(--accent) 18%, transparent);
  border-radius: 9px;
}
.shell ~ dialog .generation-brief__icon svg { width: 17px; height: 17px; }
.shell ~ dialog .generation-brief h3 {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
}
.shell ~ dialog .generation-brief h3 span {
  padding: 2px 6px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 760;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.shell ~ dialog .generation-brief__header p {
  margin: 4px 0 0;
  color: var(--fg-secondary);
  font-size: 11.5px;
  line-height: 1.45;
}
.shell ~ dialog .generation-brief__fields {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}
.shell ~ dialog .generation-brief textarea {
  width: 100%;
  min-height: 66px;
  padding: 9px 10px;
  resize: vertical;
}
.shell ~ dialog .generation-brief .field small {
  color: var(--fg-tertiary);
  font-size: 11px;
  line-height: 1.4;
}
.shell ~ dialog #wa-qr-container { background: var(--surface-alt) !important; border-color: var(--border) !important; }
@keyframes app-dialog-enter { from { opacity: 0; transform: translateY(8px) scale(0.99); } }

/* ── dashboard-workflow.css ────────────────────────────────────── */
/* Rota de prospecção — era um bloco preto de ~190 px permanente no topo.
   Vira uma tira clara e compacta: mesma informação, um terço da altura, e
   sem competir com a fila de leads, que é o trabalho de verdade da tela. */

#app-shell .workflow-rail {
  position: relative;
  overflow: visible;
  margin-bottom: 14px;
  padding: 16px 20px 14px;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
#app-shell .workflow-rail::before { content: none; }
#app-shell .workflow-rail__heading { position: relative; margin-bottom: 14px; align-items: center; gap: 16px; }
#app-shell .workflow-rail__heading p {
  margin: 0;
  color: var(--fg-tertiary);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
#app-shell .workflow-rail__heading h1 { margin: 2px 0 0; color: var(--fg); font-size: 17px; font-weight: 620; letter-spacing: -.02em; }
#app-shell .workflow-rail .button--ghost {
  min-height: 32px;
  padding-inline: 13px;
  color: var(--fg-secondary);
  background: transparent;
  border-color: var(--border-strong);
  border-radius: 999px;
  font-size: 12px;
}
#app-shell .workflow-rail .button--ghost:hover { color: var(--fg); background: var(--surface-alt); border-color: var(--fg-tertiary); }

#app-shell .workflow-rail ol { position: relative; border-top: 0; }
/* Trilho contínuo atrás dos marcadores, alinhado ao centro deles. */
#app-shell .workflow-rail ol::before {
  content: "";
  position: absolute;
  top: 11px;
  left: 11px;
  right: calc(10% - 11px);
  height: 1px;
  background: var(--border);
}
#app-shell .workflow-rail li { position: relative; padding: 0 14px 0 0; grid-template-columns: 22px 1fr; column-gap: 9px; }
#app-shell .workflow-rail li + li { padding-left: 14px; border-left: 0; }
#app-shell .workflow-rail li > span {
  position: relative;
  width: 22px;
  height: 22px;
  color: var(--fg-tertiary);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  font-size: 10px;
  font-weight: 650;
}
#app-shell .workflow-rail li strong { color: var(--fg); font-size: 12.5px; font-weight: 580; letter-spacing: -.012em; }
#app-shell .workflow-rail li small { color: var(--fg-tertiary); font-size: 10.5px; }
#app-shell .workflow-rail li.is-complete > span { color: #FFFFFF; background: var(--accent); border-color: var(--accent); }
#app-shell .workflow-rail li.is-current > span {
  color: #FFFFFF;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
#app-shell .workflow-rail li.is-current strong { color: var(--accent); font-weight: 650; }

#app-shell .search-collapsible-wrapper { margin-bottom: 16px; border-color: var(--border); border-radius: 12px; }
#app-shell .search-toggle-btn { min-height: 50px; padding-inline: 16px; font-size: 12px; letter-spacing: 0.005em; }
#app-shell .search-toggle-btn > svg:first-child { color: var(--accent); }
#app-shell .search-collapsible-content { padding: 16px; border-top-color: var(--border-light); }
#app-shell .search-panel__grid { gap: 14px !important; }
#app-shell .search-panel__side { gap: 10px !important; }
#app-shell #goldenFilter + span { color: var(--app-amber) !important; }
#app-shell #feedback:empty { min-height: 0 !important; margin: 0 !important; }

#app-shell .metrics { margin-top: 0; border-color: var(--border); border-radius: 11px; }
#app-shell .metric { position: relative; min-height: 78px; padding: 15px 18px; }
#app-shell .metric:first-child::before {
  content: "";
  position: absolute;
  inset: 14px auto 14px 0;
  width: 2px;
  background: var(--accent);
}
#app-shell .metric + .metric { border-left-color: var(--border-light); }
#app-shell .metric__label { color: var(--fg-tertiary); font-size: 9px; letter-spacing: 0.07em; text-transform: uppercase; }
#app-shell .metric__value { margin-top: 1px; color: var(--fg); font-size: 25px; font-variant-numeric: tabular-nums; }

#app-shell .tickets { margin-top: 16px; padding: 18px; border-color: var(--border); border-radius: 14px; }
#app-shell .tickets__header { margin-bottom: 14px; }
#app-shell .tickets__eyebrow { color: var(--accent); }
#app-shell .tickets__title { font-size: 21px; }
#app-shell #local-search { background: var(--input-bg) !important; border-color: var(--border) !important; }
#app-shell .bento-filters { margin-block: 7px 14px; background: var(--input-bg); border-color: var(--border-light); }
#app-shell .filter-pill { min-height: 33px; padding: 5px 10px; color: var(--fg-secondary); }
#app-shell .filter-pill.active,
#app-shell .filter-pill[aria-pressed="true"] { color: var(--accent); background: var(--surface); border-color: var(--border); box-shadow: none; }
#app-shell .batch-select-container { background: var(--surface-alt) !important; border-color: var(--border-light) !important; }
#app-shell #date-filters-container { background: transparent; border-color: transparent; border-bottom: 1px solid var(--border-light); border-radius: 0; }
#app-shell .google-maps-attribution { color: var(--fg-tertiary); }

#app-shell #kanban-board { gap: 12px; }
#app-shell .kanban-column {
  flex-basis: 360px;
  width: 360px;
  min-width: 360px;
  padding: 13px;
  gap: 12px;
  background: var(--surface-alt);
  border-color: var(--border-light);
  border-radius: 11px;
}
#app-shell .kanban-column > :first-child { border-bottom-width: 1px !important; }
#app-shell .kanban-column[data-status="pending"] > :first-child { border-bottom-color: color-mix(in oklch, var(--orange) 58%, var(--border)) !important; }
#app-shell .kanban-column[data-status="approved"] > :first-child { border-bottom-color: color-mix(in oklch, var(--accent) 58%, var(--border)) !important; }
#app-shell .kanban-column[data-status="rejected"] > :first-child { border-bottom-color: color-mix(in oklch, var(--red) 42%, var(--border)) !important; }
#app-shell .count-badge { min-width: 22px; text-align: center; font-variant-numeric: tabular-nums; }

#app-shell .ticket {
  border-color: var(--border-light);
  border-radius: 10px;
  transition: border-color 140ms ease, transform 140ms ease, background 140ms ease;
}
#app-shell .ticket::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 2px; background: var(--orange); opacity: 0.66; }
#app-shell .ticket[data-status="approved"]::before { background: var(--accent); }
#app-shell .ticket[data-status="site_created"]::before { background: var(--green); }
#app-shell .ticket[data-status="rejected"]::before { background: var(--red); opacity: 0.42; }
#app-shell .ticket:hover { border-color: var(--border-strong); transform: translateY(-1px); }
#app-shell .ticket__body { padding: 14px; }
#app-shell .ticket__topline { color: var(--fg-tertiary); }
#app-shell .ticket__status { color: var(--orange); background: var(--orange-soft); }
#app-shell .ticket[data-status="approved"] .ticket__status { color: var(--accent); background: var(--accent-soft); }
#app-shell .ticket[data-status="site_created"] .ticket__status { color: var(--green); background: var(--green-soft); }
#app-shell .ticket__source-badge { color: var(--fg-tertiary); background: var(--surface-alt); border: 1px solid var(--border-light); }
#app-shell .ticket__wa-sent-badge svg { width: 12px; height: 12px; flex: 0 0 auto; }
#app-shell .ticket__title { font-size: 16px; }
#app-shell .ticket__opportunity-badge { color: var(--orange); background: var(--orange-soft); }
#app-shell .ticket__site_links > div { background: var(--surface-alt) !important; border-color: var(--border-light) !important; }
#app-shell .ticket__action-group.primary-actions { grid-template-columns: minmax(0, 1fr) auto; }
#app-shell .ticket__more { border-top-color: var(--border-light); }
#app-shell .ticket__more summary::after { color: var(--accent); }
#app-shell .generating-status-container { color: var(--accent); background: var(--accent-soft); border: 1px solid color-mix(in oklch, var(--accent) 20%, var(--border)); }
#app-shell .card--generating { border-color: color-mix(in oklch, var(--accent) 55%, var(--border)); box-shadow: 0 0 22px oklch(0.51 0.225 286 / 0.1); }

#app-shell .generation-radar {
  position: fixed;
  top: clamp(88px, 18vh, 184px);
  right: 24px;
  z-index: calc(var(--z-nav) + 1);
  width: min(344px, calc(100vw - 48px));
  overflow: hidden;
  color: var(--fg);
  background: color-mix(in oklch, var(--surface) 96%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(14px);
}
#app-shell .generation-radar[hidden] { display: none; }
#app-shell .generation-radar__header {
  min-height: 62px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-light);
}
#app-shell .generation-radar__header p {
  margin: 0 0 2px;
  color: var(--orange);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
#app-shell .generation-radar__header h2 { margin: 0; font-size: 14px; letter-spacing: -0.015em; }
#app-shell .generation-radar__header h2 span {
  min-width: 20px;
  margin-left: 4px;
  padding: 2px 6px;
  display: inline-grid;
  place-items: center;
  color: var(--orange);
  background: var(--orange-soft);
  border-radius: 999px;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
#app-shell .generation-radar__signal { width: 8px; height: 8px; background: var(--orange); border-radius: 50%; box-shadow: 0 0 0 0 color-mix(in oklch, var(--orange) 38%, transparent); animation: generation-radar-pulse 1.8s ease-out infinite; }
#app-shell .generation-radar__list {
  max-height: min(54vh, 420px);
  padding: 8px;
  display: grid;
  gap: 7px;
  overflow-y: auto;
}
#app-shell .generation-radar__item {
  min-width: 0;
  padding: 11px;
  background: var(--surface-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}
#app-shell .generation-radar__item-heading { display: flex; align-items: center; gap: 8px; }
#app-shell .generation-radar__item-heading strong {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#app-shell .generation-radar__spinner { width: 13px; height: 13px; flex: 0 0 auto; border: 2px solid color-mix(in oklch, var(--orange) 24%, var(--border)); border-top-color: var(--orange); border-radius: 50%; animation: spin 0.8s linear infinite; }
#app-shell .generation-radar__format {
  margin-top: 7px;
  display: inline-flex;
  color: var(--accent);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.025em;
}
#app-shell .generation-radar__status {
  margin: 3px 0 8px;
  color: var(--fg-secondary);
  font-size: 10px;
  line-height: 1.45;
}
#app-shell .generation-radar__progress { height: 3px; overflow: hidden; background: var(--border); border-radius: 99px; }
#app-shell .generation-radar__progress span {
  height: 100%;
  display: block;
  background: var(--orange);
  border-radius: inherit;
  transition: width 180ms cubic-bezier(.16, 1, .3, 1);
}
#app-shell .generation-radar__footer {
  min-height: 28px;
  margin-top: 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
#app-shell .generation-radar__footer small { color: var(--fg-tertiary); font-size: 9px; }
#app-shell .generation-radar__action {
  min-height: 28px;
  padding: 0 5px;
  color: var(--accent);
  background: transparent;
  border: 0;
  border-radius: var(--radius-xs);
  font: inherit;
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
}
#app-shell .generation-radar__action:hover { background: var(--accent-soft); }
#app-shell .generation-radar__action:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@keyframes generation-radar-pulse { 70%, 100% { box-shadow: 0 0 0 7px transparent; } }

#app-shell .empty-state { min-height: 260px; padding: 30px !important; background: var(--surface); border-color: var(--border-strong); }
#app-shell .empty-state[data-state="loading"] { border-style: solid; }
#app-shell .empty-state[data-state="error"] { border-color: color-mix(in oklch, var(--red) 40%, var(--border)); }
#app-shell .empty-state[data-state="error"] .empty-state__eyebrow { color: var(--red); }
#app-shell .skeleton-card { border-color: var(--border-light); }
#app-shell .skeleton-box { background: var(--input-bg); }

#app-shell .tutorial-container,
#app-shell :is(#view-manual, #view-sales, #view-settings, #view-subscription, #view-admin) { max-width: 1420px; margin-inline: auto; }
#app-shell .tutorial-header { margin-bottom: 24px; }
#app-shell .bento-card,
#app-shell .copy-card { background: var(--surface); border-color: var(--border); box-shadow: none; }
#app-shell .bento-card--badge { color: var(--accent); background: var(--accent-soft); }
#app-shell .visual-flow { background: var(--surface) !important; border-color: var(--border) !important; box-shadow: none !important; }
#app-shell .copy-text { background: var(--input-bg); border-color: var(--border-light); }
#app-shell .admin-table th,
#app-shell .admin-table td { border-bottom-color: var(--border-light); }
#app-shell .admin-table tr:hover { background: var(--surface-alt); }

#app-shell .batch-action-bar { background: color-mix(in oklch, var(--surface) 94%, transparent); border-top-color: var(--border); backdrop-filter: blur(14px); }
#app-shell .mobile-tab-bar { background: color-mix(in oklch, var(--surface) 94%, transparent); backdrop-filter: blur(14px); }
#app-shell .mobile-tab-btn.active,
#app-shell .mobile-tab-btn[aria-current="page"] { color: var(--accent); }
#app-shell .mobile-kanban-tab-btn[aria-selected="true"] { color: var(--accent); background: var(--surface); }

/* ── dashboard-responsive.css ──────────────────────────────────── */
@media (max-width: 1180px) {
  #app-shell.shell { grid-template-columns: 230px minmax(0, 1fr); }
  #app-shell .kanban-column { flex-basis: 340px; width: 340px; min-width: 340px; }
}

@media (max-width: 990px) {
  #app-shell.shell { display: block; }
  #app-shell .mobile-app-header {
    height: 56px;
    background: color-mix(in oklch, var(--surface) 92%, transparent);
    border-bottom-color: var(--border);
    backdrop-filter: blur(14px);
  }
  #app-shell .mobile-app-header__toggle { color: var(--fg); }
  #app-shell .rail { width: min(294px, 88vw); box-shadow: var(--shadow-lg); }
  #app-shell .rail-overlay { background: oklch(0.18 0.035 286 / 0.58); backdrop-filter: blur(3px); }
  #app-shell .board { padding-top: 72px; }
  #app-shell .generation-radar { top: 68px; right: 16px; }
}

@media (max-width: 767px) {
  #app-shell.shell { padding-bottom: 64px; }
  #app-shell .board { padding: 68px 12px 84px; }
  #app-shell .workflow-rail { padding: 16px; }
  #app-shell .workflow-rail__heading { align-items: flex-start; }
  #app-shell .workflow-rail__heading h1 { font-size: 19px; }
  #app-shell .workflow-rail ol { gap: 0; padding-bottom: 4px; }
  #app-shell .workflow-rail ol::before { right: 18px; }
  #app-shell .workflow-rail li { flex-basis: 138px; }
  #app-shell .search-collapsible-content { padding: 14px; }
  #app-shell .search-panel__grid { display: grid !important; grid-template-columns: 1fr; }
  #app-shell .search-panel__grid > .field,
  #app-shell .search-panel__side { min-width: 0 !important; }
  #app-shell .search-panel__side .actions { justify-content: stretch !important; }
  #app-shell .search-panel__side .actions > * { flex: 1; }
  #app-shell .metrics { grid-template-columns: 1fr 1fr; }
  #app-shell .metric { min-height: 72px; padding: 13px 15px; }
  #app-shell .metric:nth-child(3) { border-left: 0; border-top-color: var(--border-light); }
  #app-shell .metric:nth-child(4) { border-top-color: var(--border-light); }
  #app-shell .tickets { padding: 13px; }
  #app-shell .tickets__header { gap: 12px; }
  #app-shell .tickets__header > div:last-child { display: grid !important; grid-template-columns: 1fr; }
  #app-shell #local-search { width: 100% !important; }
  #app-shell .bento-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
  #app-shell .filter-pill { flex: 0 0 auto; }
  #app-shell #date-filters-container > div { width: 100%; margin-left: 0 !important; padding: 4px 0 0 !important; }
  #app-shell .mobile-kanban-tabs { background: var(--input-bg); border-color: var(--border-light); }
  #app-shell .mobile-kanban-tab-btn { color: var(--fg-secondary); }
  #app-shell .mobile-kanban-tab-btn.active { color: var(--accent); background: var(--surface); }
  #app-shell .kanban-column { width: 100%; min-width: 100%; padding: 12px; }
  #app-shell .ticket__action-group.primary-actions { grid-template-columns: 1fr; }
  #app-shell .generation-radar {
    top: 68px;
    right: 12px;
    left: 12px;
    width: auto;
  }
  #app-shell .generation-radar__list { max-height: min(38vh, 330px); }
  #app-shell .mobile-tab-bar { height: 64px; border-top-color: var(--border); }
  #app-shell .mobile-tab-btn { min-height: 58px; }
  #app-shell .batch-action-bar { bottom: 64px; }
  #app-shell .batch-action-bar__actions .button { min-height: 38px; }
  #app-shell :is(#manual-lead-form, #settings-credentials-form),
  #app-shell #view-subscription > div { max-width: none !important; padding: 20px !important; }
  #app-shell #view-subscription > div > div:nth-child(2) { grid-template-columns: 1fr !important; }
  #app-shell .admin-grid { grid-template-columns: 1fr !important; }
  #app-shell .admin-grid > div { padding: 18px !important; }
  #app-shell .tutorial-header { margin-bottom: 18px; }
  .shell ~ dialog { width: min(94vw, 560px); padding: 22px 18px; }
}

@media (max-width: 480px) {
  #app-shell .workflow-rail__heading { flex-direction: column; gap: 12px; }
  #app-shell .workflow-rail__heading .button { width: 100%; }
  #app-shell .metrics { border-radius: 9px; }
  #app-shell .metric__value { font-size: 22px; }
  #app-shell .tickets__title { font-size: 19px; }
  #app-shell .empty-state { min-height: 240px; padding: 22px !important; }
  #app-shell .empty-state__actions { width: 100%; }
  #app-shell .empty-state__actions .button { width: 100%; }
  #app-shell .batch-action-bar__actions { padding-bottom: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  #app-shell .workflow-rail li.is-current > span,
  #app-shell .card--generating,
  #app-shell .quota-widget__bar { box-shadow: none; }
  #app-shell .generation-radar__signal,
  #app-shell .generation-radar__spinner { animation: none; }
  #app-shell .generation-radar__progress span { transition: none; }
  .shell ~ dialog[open] { animation: none; }
}

/* ── dashboard-compact.css ─────────────────────────────────────── */
/* ── Compactação e acabamento Apple ───────────────────────────────────────
   O topo da tela de leads somava mais de 700 px de cromo antes do primeiro
   card. Aqui cada bloco perde altura sem perder função, e os controles ganham
   a mesma linguagem da landing: pílula nos filtros, cantos menores, borda fina
   e o roxo reservado para estado ativo. */

@media (min-width: 991px) {
  #app-shell .board { padding-top: 20px; }
}

/* Métricas: faixa de leitura rápida, não um painel. */
#app-shell .metrics { border-radius: var(--radius-lg); }
#app-shell .metric { min-height: 62px; padding: 12px 18px; }
/* O filete de acento no primeiro número destacava um dado sem motivo. */
#app-shell .metric:first-child::before { content: none; }
#app-shell .metric__label { color: var(--fg-tertiary); font-size: 10px; font-weight: 600; letter-spacing: .06em; }
#app-shell .metric__value { margin-top: 2px; font-size: 22px; font-weight: 620; letter-spacing: -.028em; }

/* Busca: recolhida ocupa uma linha; aberta, um cartão contido. */
#app-shell .search-collapsible-wrapper { margin-bottom: 14px; border-radius: var(--radius-lg); }
#app-shell .search-toggle-btn { min-height: 46px; padding-inline: 18px; font-size: 13px; font-weight: 580; }
#app-shell .search-collapsible-content { padding: 16px 18px 18px; }
#app-shell .search-panel__grid { gap: 16px !important; }
#app-shell #query { min-height: 44px !important; border-radius: var(--radius-md); }

/* Filtros em pílula, com o ativo marcado por contraste e não por sombra. */
#app-shell .bento-filters { margin-block: 0 12px; padding: 4px; gap: 4px; background: var(--surface-alt); border-color: var(--border-light); border-radius: 999px; }
#app-shell .filter-pill { min-height: 30px; padding: 5px 13px; border-radius: 999px; font-size: 12px; font-weight: 550; letter-spacing: -.008em; }
#app-shell .filter-pill.active,
#app-shell .filter-pill[aria-pressed="true"] { color: #FFFFFF; background: var(--app-ink); border-color: var(--app-ink); box-shadow: none; }
#app-shell #date-filters-container { margin-top: 0 !important; padding: 0 !important; background: transparent; border: 0; border-radius: 0; }
#app-shell #date-filters-container .filter-pill { background: var(--surface-alt); border-color: var(--border-light); }
#app-shell #date-filters-container .filter-pill.active { background: var(--app-ink); border-color: var(--app-ink); }

/* Seleção em lote: uma linha discreta, não um painel tingido. */
#app-shell .batch-select-container { min-height: 38px; margin-bottom: 12px !important; padding: 2px 10px !important; background: transparent !important; border: 0 !important; border-radius: 0 !important; }
#app-shell .select-all-label { min-height: 32px; color: var(--fg-secondary); font-size: 12.5px; }

/* Fila de leads. */
#app-shell .tickets { margin-top: 14px; padding: 18px; border-radius: var(--radius-lg); }
#app-shell .tickets__eyebrow { color: var(--fg-tertiary); font-size: 10px; font-weight: 600; letter-spacing: .08em; }
#app-shell .tickets__title { font-size: 19px; font-weight: 620; letter-spacing: -.024em; }
#app-shell #local-search { min-height: 34px; border-radius: 999px !important; padding-inline: 14px !important; font-size: 12.5px; }
#app-shell .kanban-column { background: var(--surface-alt); border-color: transparent; border-radius: var(--radius-lg); }
#app-shell .ticket { border-color: var(--border); border-radius: var(--radius-md); }
/* O filete colorido na borda de cada card virava listra em toda a coluna;
   o status já é comunicado pela pílula no topo do card. */
#app-shell .ticket::before { content: none; }
#app-shell .ticket:hover { border-color: var(--border-strong); transform: none; box-shadow: var(--shadow-md); }

/* Botões e controles. */
#app-shell .button { border-radius: var(--radius-md); font-weight: 560; }
#app-shell .button--primary { box-shadow: none; }
#app-shell .filter-pill,
#app-shell .workflow-rail .button--ghost { transition: color 140ms ease, background 140ms ease, border-color 140ms ease; }

/* Barra lateral: fundo branco contra o canvas cinza dispensa a borda pesada. */
#app-shell .rail { padding: 18px 12px 14px; background: var(--sidebar-bg); border-right: 1px solid var(--border); }
#app-shell .nav__link { min-height: 38px; border-radius: var(--radius-md); font-size: 12.5px; font-weight: 540; }
#app-shell .nav__link.active,
#app-shell .nav__link[aria-current="page"] { color: var(--accent); background: var(--accent-soft); border-color: transparent; font-weight: 600; }
#app-shell .nav__link.active::before,
#app-shell .nav__link[aria-current="page"]::before { background: transparent; }
#app-shell .rail__copy { color: var(--fg-tertiary); font-size: 11.5px; }
#app-shell .quota-widget { padding: 11px 12px; background: var(--surface-alt); border-color: transparent; border-radius: var(--radius-md); }
#app-shell .quota-widget__header { color: var(--fg-secondary); font-size: 10.5px; font-weight: 560; }
#app-shell .quota-widget__bar-bg { background: var(--border); }
#app-shell .quota-widget__bar { box-shadow: none; }
#app-shell #btn-logout { color: var(--fg-secondary) !important; }
#app-shell #btn-logout:hover { color: var(--red) !important; background: var(--red-soft) !important; }

/* O seletor acima tem especificidade de ID e vencia .collapsed, deixando o
   padding vertical ativo com o painel fechado — 34 px de vão fantasma. */
#app-shell .search-collapsible-content.collapsed { padding-block: 0; border-top-color: transparent; }

/* As quatro faixas entre o título da fila e o kanban (filtros, atribuição,
   seleção em lote e datas) somavam ~180 px. Mesmo conteúdo, menos respiro
   morto entre elas. A atribuição do Google Maps é exigência de uso da API
   e continua visível. */
#app-shell .google-maps-attribution { margin: 0 0 8px; font-size: 11px; }
#app-shell .batch-select-container { min-height: 32px; margin-bottom: 6px !important; }
#app-shell #date-filters-container { margin-bottom: 14px !important; gap: 6px; }
#app-shell #date-filters-container > span { font-size: 10px !important; color: var(--fg-tertiary) !important; }

/* Aviso no diálogo de geração quando a tentativa anterior foi recusada. */
.shell ~ dialog .generate-rejected-note {
  margin: 6px 0 0;
  padding: 9px 11px;
  color: oklch(0.46 0.16 40);
  background: oklch(0.97 0.025 60);
  border-radius: 9px;
  font-size: 11.5px;
  line-height: 1.45;
}
