:root {
  --bg: #07111f;
  --panel: rgba(8, 17, 31, 0.84);
  --panel-strong: rgba(6, 13, 24, 0.95);
  --line: rgba(140, 180, 204, 0.18);
  --line-strong: rgba(140, 180, 204, 0.32);
  --text: #edf5ff;
  --muted: #8aa1b9;
  --accent: #59d0b2;
  --accent-strong: #ffb84d;
  --danger: #ff7e7e;
  --info: #7fd2ff;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(89, 208, 178, 0.16), transparent 30%),
    radial-gradient(circle at right 10%, rgba(255, 184, 77, 0.14), transparent 26%),
    linear-gradient(180deg, #07111f 0%, #08172b 42%, #05101e 100%);
  color: var(--text);
  font-family: "IBM Plex Sans", sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

a {
  color: inherit;
}

.background-orb {
  position: fixed;
  width: 32rem;
  height: 32rem;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.22;
  pointer-events: none;
  z-index: 0;
}

.orb-a {
  top: -10rem;
  right: -9rem;
  background: #59d0b2;
}

.orb-b {
  bottom: -14rem;
  left: -8rem;
  background: #ffb84d;
}

.background-grid {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.8) 20%, rgba(0, 0, 0, 0.95));
  opacity: 0.16;
  pointer-events: none;
}

.layout {
  position: relative;
  z-index: 1;
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 64px;
}

.topbar,
.page-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 26px;
}

.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 20px;
  padding: 20px 24px;
}

.page-toolbar-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.brand-block strong {
  display: block;
  font-size: 1.05rem;
}

.menu-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.menu-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  text-decoration: none;
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease, transform 180ms ease;
}

.menu-link:hover {
  color: var(--text);
  transform: translateY(-1px);
}

.menu-link.active {
  color: #07111f;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent) 0%, #8ef4dc 100%);
}

.page-intro {
  margin-top: 20px;
}

.page-intro h1 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.7rem, 4vw, 2.8rem);
  line-height: 1;
}

.card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(12, 25, 44, 0.85), rgba(5, 12, 23, 0.88));
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  animation: rise-in 560ms ease both;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 35%);
  pointer-events: none;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 32px;
  margin-bottom: 24px;
}

.hero h1,
.panel h2 {
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.03em;
}

.hero h1 {
  margin: 0;
  max-width: 880px;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 0.95;
}

.hero-copy {
  margin: 18px 0 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  min-width: 240px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 16px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, opacity 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  color: #07111f;
  background: linear-gradient(135deg, var(--accent) 0%, #8ef4dc 100%);
}

.button-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--line-strong);
}

.panel {
  padding: 24px;
}

.panel-wide {
  min-width: 0;
}

.quick-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.quick-link-card {
  display: grid;
  gap: 10px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none;
}

.quick-link-card strong {
  font-size: 1.2rem;
}

.quick-link-card small {
  color: var(--muted);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-header-wrap {
  flex-wrap: wrap;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.muted,
label,
th,
.pipeline-meta,
.arrival-bar span,
.source-item small,
.integration-card small,
.kanban-card small,
.leaderboard-item small {
  color: var(--muted);
}

.panel h2 {
  margin: 0;
  font-size: 1.35rem;
}

.stats-grid,
.dashboard-grid,
.ops-grid,
.workspace-grid,
.detail-grid {
  display: grid;
  gap: 20px;
  margin-top: 20px;
}

.stats-grid-expanded {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.dashboard-grid-expanded {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.9fr) minmax(320px, 0.9fr);
}

.ops-grid {
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.85fr);
}

.workspace-grid,
.detail-grid {
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.45fr);
}

.stat {
  padding: 22px;
}

.stat strong {
  display: block;
  margin-top: 10px;
  font-size: 2rem;
  line-height: 1;
}

.stat small {
  display: inline-block;
  margin-top: 10px;
}

.trend-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  min-height: 260px;
  align-items: end;
}

.arrival-bar {
  display: flex;
  flex-direction: column;
  justify-content: end;
  gap: 10px;
  min-height: 220px;
}

.arrival-bar strong {
  font-size: 1.1rem;
}

.arrival-bar-visual {
  position: relative;
  min-height: 180px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: end;
}

.arrival-bar-visual div {
  width: 100%;
  border-radius: 12px 12px 6px 6px;
  background: linear-gradient(180deg, rgba(142, 244, 220, 0.95), rgba(89, 208, 178, 0.3));
}

.leaderboard-list,
.source-breakdown,
.integration-cards {
  display: grid;
  gap: 12px;
}

.leaderboard-item,
.source-item,
.integration-card,
.meta-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
}

.leaderboard-item strong,
.source-item strong,
.integration-card strong,
.meta-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.2rem;
}

.integration-card.enabled {
  border-color: rgba(89, 208, 178, 0.42);
}

.integration-card.disabled {
  border-color: rgba(255, 184, 77, 0.24);
}

.integration-card-editor {
  padding: 18px;
  background: #fcfdff;
  border-color: rgba(46, 107, 255, 0.12);
  box-shadow: 0 12px 30px rgba(46, 107, 255, 0.08);
}

.integration-card-summary {
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.integration-card-summary:hover {
  transform: translateY(-1px);
  border-color: rgba(46, 107, 255, 0.22);
  box-shadow: 0 14px 32px rgba(46, 107, 255, 0.08);
}

.integration-editor-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.ops-grid .panel:last-child {
  align-self: start;
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(240px, 1fr));
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.kanban-column {
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.025);
  padding: 16px;
}

.kanban-column-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.kanban-column-header strong {
  font-size: 1rem;
}

.kanban-count {
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.85rem;
}

.kanban-cards {
  min-height: 320px;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 4px;
  border-radius: 18px;
  transition: background 160ms ease, outline-color 160ms ease;
  outline: 1px dashed transparent;
}

.kanban-cards.drag-over {
  background: rgba(89, 208, 178, 0.08);
  outline-color: rgba(89, 208, 178, 0.36);
}

.kanban-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: linear-gradient(180deg, rgba(8, 18, 31, 0.95), rgba(8, 18, 31, 0.8));
  cursor: grab;
}

.kanban-card:active {
  cursor: grabbing;
}

.kanban-card.dragging {
  opacity: 0.52;
}

.kanban-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.kanban-meta,
.kanban-values {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.kanban-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.82rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.filters input,
.filters select {
  min-width: 180px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.compact-grid {
  gap: 12px;
}

.form-span-2 {
  grid-column: span 2;
}

label {
  display: grid;
  gap: 8px;
  font-size: 0.92rem;
}

.inline-check {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.inline-check input {
  width: auto;
  margin: 0;
}

input,
textarea,
select {
  width: 100%;
  padding: 12px 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  outline: none;
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(89, 208, 178, 0.6);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

textarea {
  resize: vertical;
}

.table-shell {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

tbody tr {
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

tbody tr.active {
  background: rgba(89, 208, 178, 0.12);
}

.lead-cell strong {
  display: block;
}

.lead-cell small {
  color: var(--muted);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
}

.status-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.status-novo {
  color: var(--info);
}

.status-contato {
  color: #9ab2ff;
}

.status-qualificado {
  color: #ffd36f;
}

.status-proposta {
  color: #ff9c7d;
}

.status-cliente {
  color: #67f0ad;
}

.status-perdido {
  color: #ff8e8e;
}

.payload-stack {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.payload-viewer {
  min-height: 360px;
  margin: 0;
  padding: 18px;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel-strong);
  color: #b7ffea;
  font-size: 0.9rem;
  line-height: 1.6;
}

.message-banner {
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 126, 126, 0.28);
  background: rgba(255, 126, 126, 0.08);
  color: #ffd4d4;
}

.hidden {
  display: none !important;
}

.empty-state {
  text-align: center;
  color: var(--muted);
}

body[data-page="crm"],
body[data-page="dashboard"],
body[data-page="configuracoes"],
body[data-page="funil-vendas"],
body[data-page="leads-ativos"],
body[data-page="agente-ia"],
body[data-page="calendario"],
body[data-page="insights"] {
  background: #eef4ff;
  color: #15243a;
}

body[data-page="crm"] .background-orb,
body[data-page="dashboard"] .background-orb,
body[data-page="configuracoes"] .background-orb,
body[data-page="funil-vendas"] .background-orb,
body[data-page="leads-ativos"] .background-orb,
body[data-page="agente-ia"] .background-orb,
body[data-page="calendario"] .background-orb,
body[data-page="insights"] .background-orb,
body[data-page="crm"] .background-grid,
body[data-page="dashboard"] .background-grid,
body[data-page="configuracoes"] .background-grid,
body[data-page="funil-vendas"] .background-grid,
body[data-page="leads-ativos"] .background-grid,
body[data-page="agente-ia"] .background-grid,
body[data-page="calendario"] .background-grid,
body[data-page="insights"] .background-grid {
  display: none;
}

.crm-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}

.crm-sidebar {
  display: grid;
  align-content: start;
  gap: 20px;
  padding: 20px 16px;
  background: linear-gradient(180deg, #f5f9ff 0%, #edf4ff 100%);
  border-right: 1px solid rgba(46, 107, 255, 0.12);
}

.crm-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.crm-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2e6bff, #79a3ff);
  color: #fff;
  font-weight: 700;
}

.crm-side-nav,
.crm-side-group {
  display: grid;
  gap: 8px;
}

.crm-side-link,
.crm-side-sub {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  color: #5f7595;
  text-decoration: none;
}

.crm-side-link:hover,
.crm-side-sub:hover {
  background: rgba(46, 107, 255, 0.06);
  color: #2e6bff;
}

.crm-side-link.active,
.crm-side-sub.active {
  background: #ffffff;
  color: #1f2430;
  box-shadow: 0 8px 28px rgba(67, 53, 28, 0.08);
}

.crm-side-label {
  margin: 0;
  padding: 0 14px;
  color: #8b9dbc;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.crm-side-footer {
  margin-top: auto;
  display: grid;
  gap: 6px;
  padding: 16px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(67, 53, 28, 0.08);
}

.crm-side-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.crm-side-user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #59d0b2, #8ef4dc);
  color: #07111f;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0;
}

.crm-side-user-info {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.crm-side-user-info strong {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crm-side-user-info small {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
}

.crm-main {
  padding: 20px;
}

.crm-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 4px 16px;
}

.crm-topbar-title h1 {
  margin: 8px 0 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.55rem;
  color: #16325c;
}

.crm-section-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: #e8f0ff;
  color: #2e6bff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.crm-topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 10px;
}

.crm-live-pill {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(52, 141, 92, 0.18);
  border-radius: 12px;
  background: #edf8f1;
  color: #31764d;
  font-size: 0.85rem;
  font-weight: 600;
}

.crm-search,
.crm-select {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(46, 107, 255, 0.12);
  border-radius: 12px;
  background: #fff;
  color: #16325c;
}

.crm-search {
  min-width: 220px;
}

.crm-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.crm-strip-card,
.crm-board-panel,
.crm-form-panel,
.crm-list-panel,
.crm-detail-panel {
  border: 1px solid rgba(46, 107, 255, 0.12);
  border-radius: 16px;
  background: #fcfdff;
  box-shadow: 0 12px 30px rgba(46, 107, 255, 0.08);
}

.crm-strip-card {
  padding: 16px;
}

.crm-strip-card span,
.crm-meta-box span {
  color: #6a83a6;
  font-size: 0.82rem;
}

.crm-strip-card strong,
.crm-meta-box strong {
  display: block;
  margin-top: 8px;
  color: #16325c;
  font-size: 1.25rem;
}

.crm-strip-card small {
  display: block;
  margin-top: 6px;
  color: #8aa1bf;
}

.crm-board-panel {
  padding: 14px;
}

.quick-lead-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 22, 43, 0.36);
  backdrop-filter: blur(8px);
  z-index: 40;
}

.quick-lead-dialog {
  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 20px;
  border: 1px solid rgba(46, 107, 255, 0.12);
  border-radius: 20px;
  background: #fcfdff;
  box-shadow: 0 24px 60px rgba(19, 48, 96, 0.18);
}

.lead-modal-dialog {
  width: min(1180px, 100%);
  padding: 24px;
}

.lead-modal-dialog.is-create-mode {
  width: min(560px, 100%);
  padding: 20px 24px 24px;
}

.lead-modal-header {
  align-items: start;
}

.lead-modal-dialog.is-create-mode .lead-modal-header {
  margin-bottom: 10px;
}

.lead-modal-subtitle {
  margin: 8px 0 0;
  color: #6f89af;
}

.lead-modal-dialog.is-create-mode .lead-modal-subtitle,
.lead-modal-dialog.is-create-mode #leadModalEyebrow {
  display: none;
}

.lead-modal-section {
  margin-top: 12px;
}

.lead-modal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  gap: 14px;
  margin-top: 12px;
}

.lead-modal-dialog .crm-form-panel,
.lead-modal-dialog .crm-detail-panel {
  box-shadow: none;
}

.lead-modal-close {
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
}

.lead-create-form {
  gap: 14px;
}

.lead-modal-dialog.is-create-mode .lead-create-form {
  grid-template-columns: 1fr;
}

.lead-modal-dialog.is-create-mode .lead-create-form .form-span-2 {
  grid-column: auto;
}

.lead-create-form label {
  color: #263e65;
  font-weight: 500;
}

.lead-create-more {
  padding: 0;
  border: 1px solid rgba(46, 107, 255, 0.12);
  border-radius: 14px;
  background: #f8fbff;
}

.lead-create-more summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  color: #2c4a78;
  font-weight: 600;
}

.lead-create-more summary::-webkit-details-marker {
  display: none;
}

.lead-create-more-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 0 16px 16px;
}

.lead-create-actions {
  display: flex;
}

.lead-create-actions .button {
  width: 100%;
}

.kanban-board-kommo {
  grid-template-columns: repeat(6, minmax(250px, 1fr));
  gap: 12px;
}

.kanban-board-kommo .kanban-column {
  min-height: 560px;
  padding: 0;
  border: 1px solid rgba(46, 107, 255, 0.12);
  border-radius: 14px;
  background: #f5f9ff;
}

.kanban-board-kommo .kanban-column-header {
  display: grid;
  gap: 4px;
  align-items: start;
  padding: 12px 12px 10px;
  margin: 0;
  border-bottom: 1px solid rgba(46, 107, 255, 0.08);
}

.kanban-board-kommo .kanban-column-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.kanban-board-kommo .kanban-column-title strong {
  color: #24436f;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.kanban-board-kommo .kanban-count {
  padding: 0;
  background: transparent;
  color: #6b84a8;
  font-size: 0.76rem;
}

.kanban-board-kommo .kanban-column-total {
  color: #7791b7;
  font-size: 0.78rem;
}

.kanban-board-kommo .kanban-cards {
  min-height: 500px;
  gap: 8px;
  padding: 10px;
  border-radius: 0 0 14px 14px;
}

.kanban-board-kommo .kanban-cards.drag-over {
  background: rgba(46, 107, 255, 0.06);
  outline-color: rgba(46, 107, 255, 0.32);
}

.kanban-board-kommo .kanban-card {
  padding: 10px 10px 12px;
  border: 1px solid rgba(46, 107, 255, 0.12);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(46, 107, 255, 0.06);
}

.kanban-board-kommo .kanban-card h3 {
  margin: 6px 0 4px;
  color: #2357d8;
  font-size: 0.88rem;
  font-weight: 600;
}

.kanban-board-kommo .kanban-card small {
  color: #7b91b0;
  font-size: 0.73rem;
}

.crm-card-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.crm-card-id {
  color: #1e5bcf;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}

.crm-card-date {
  color: #96a9c5;
  font-size: 0.72rem;
}

.crm-card-name {
  color: #16325c;
}

.crm-card-company {
  margin-top: 3px;
}

.crm-card-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.crm-card-owner {
  color: #5e789c;
  font-size: 0.74rem;
}

.crm-card-dot {
  display: inline-flex;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #4e88ff;
  margin-right: 6px;
}

.crm-card-value {
  color: #355f9e;
  font-size: 0.76rem;
  font-weight: 700;
}

.crm-workspace,
.crm-detail-layout {
  display: grid;
  grid-template-columns: minmax(340px, 0.85fr) minmax(0, 1.15fr);
  gap: 14px;
  margin-top: 14px;
}

.crm-dashboard-layout,
.crm-settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 14px;
  margin-top: 14px;
}

.crm-hub-grid,
.crm-ai-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.compact-hub-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0;
}

.crm-link-card {
  display: grid;
  gap: 10px;
  padding: 22px;
  border: 1px solid rgba(46, 107, 255, 0.12);
  border-radius: 16px;
  background: #fcfdff;
  box-shadow: 0 12px 30px rgba(46, 107, 255, 0.08);
  text-decoration: none;
}

.crm-link-card strong {
  color: #16325c;
  font-size: 1.15rem;
}

.crm-link-card small {
  color: #7f95b5;
}

.ai-summary-wrap {
  display: grid;
  gap: 12px;
}

.ai-summary-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(46, 107, 255, 0.12);
  border-radius: 14px;
  background: #f6f9ff;
}

.ai-summary-card span,
.ai-summary-card small {
  color: #6f89af;
}

.ai-summary-card strong {
  color: #16325c;
  font-size: 1.15rem;
}

.ai-output {
  min-height: 420px;
}

.calendar-list {
  display: grid;
  gap: 10px;
}

.calendar-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid rgba(46, 107, 255, 0.12);
  border-radius: 12px;
  background: #f8fbff;
  cursor: pointer;
}

.calendar-item strong {
  display: block;
  color: #16325c;
}

.calendar-item small,
.calendar-item-meta {
  color: #7892b6;
  font-size: 0.82rem;
}

.calendar-item-meta {
  display: grid;
  gap: 6px;
  text-align: right;
}

.calendar-item.active {
  background: #eef4ff;
  border-color: rgba(46, 107, 255, 0.24);
}

.crm-panel-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}

.crm-panel-header h2 {
  margin: 0;
  color: #16325c;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.1rem;
}

.crm-form-panel,
.crm-list-panel,
.crm-detail-panel {
  padding: 20px;
}

.crm-list-panel-full {
  margin-top: 14px;
}

.crm-list-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.crm-form-grid label {
  color: #6780a3;
}

.crm-shell input,
.crm-shell textarea,
.crm-shell select {
  color: #16325c;
  background: #fff;
  border: 1px solid rgba(46, 107, 255, 0.14);
}

.crm-shell input:focus,
.crm-shell textarea:focus,
.crm-shell select:focus {
  border-color: rgba(46, 107, 255, 0.44);
  background: #fff;
}

.crm-table-shell {
  border-color: rgba(46, 107, 255, 0.12);
  background: #fff;
}

.crm-shell table {
  background: #fff;
}

.crm-checkbox-column {
  width: 52px;
  text-align: center;
}

.crm-shell th.crm-checkbox-column,
.crm-shell td.crm-checkbox-column {
  padding-left: 12px;
  padding-right: 12px;
}

.lead-select-checkbox,
#selectAllLeads {
  width: 18px;
  height: 18px;
  accent-color: #2e6bff;
  cursor: pointer;
}

.crm-shell th {
  color: #6e87ac;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: #f5f9ff;
}

.crm-shell th,
.crm-shell td {
  border-bottom: 1px solid rgba(46, 107, 255, 0.08);
}

.crm-shell tbody tr:hover {
  background: #f4f8ff;
}

.crm-shell tbody tr.active {
  background: #eef3ff;
}

.crm-meta-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.crm-meta-box {
  padding: 14px;
  border: 1px solid rgba(46, 107, 255, 0.12);
  border-radius: 12px;
  background: #f6f9ff;
}

.crm-payload-viewer {
  min-height: 260px;
  margin-top: 14px;
  color: #29466f;
  background: #f6f9ff;
  border-color: rgba(46, 107, 255, 0.12);
}

.crm-shell .button-secondary {
  color: #355f9e;
  background: #fff;
  border-color: rgba(46, 107, 255, 0.14);
}

.crm-shell .button-primary {
  color: #fff;
  background: linear-gradient(135deg, #2e6bff 0%, #4e88ff 100%);
}

.crm-shell .button-danger {
  color: #fff;
  background: linear-gradient(135deg, #e35167 0%, #d63d54 100%);
}

body[data-loading="true"][data-page="crm"] .crm-live-pill,
body[data-loading="true"][data-page="funil-vendas"] .crm-live-pill,
body[data-loading="true"][data-page="leads-ativos"] .crm-live-pill,
body[data-loading="true"][data-page="agente-ia"] .crm-live-pill,
body[data-loading="true"][data-page="calendario"] .crm-live-pill,
body[data-loading="true"][data-page="insights"] .crm-live-pill,
body[data-loading="true"][data-page="configuracoes"] .crm-live-pill,
body[data-loading="true"][data-page="dashboard"] .crm-live-pill {
  color: #866b1f;
  border-color: rgba(203, 166, 55, 0.22);
  background: #fff7dd;
}

.settings-checklist,
.settings-links {
  display: grid;
  gap: 12px;
}

.settings-check-item {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid rgba(46, 107, 255, 0.12);
  border-radius: 14px;
  background: #f8fbff;
}

.settings-check-item strong {
  color: #16325c;
}

.settings-check-item small {
  color: #7c94b5;
}

.settings-link-card {
  min-height: 132px;
}

body[data-page="dashboard"] {
  position: relative;
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.18), transparent 28%),
    radial-gradient(circle at 85% 14%, rgba(34, 211, 238, 0.16), transparent 24%),
    radial-gradient(circle at 50% 100%, rgba(96, 165, 250, 0.12), transparent 30%),
    linear-gradient(180deg, #040915 0%, #07101d 46%, #030812 100%);
}

body[data-page="dashboard"]::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.46), rgba(0, 0, 0, 0.9) 24%, rgba(0, 0, 0, 0.45));
  opacity: 0.5;
  pointer-events: none;
}

body[data-page="dashboard"] .crm-shell {
  position: relative;
  z-index: 1;
  grid-template-columns: 260px minmax(0, 1fr);
}

body[data-page="dashboard"] .crm-sidebar {
  position: relative;
  gap: 24px;
  padding: 24px 18px;
  background:
    linear-gradient(180deg, rgba(7, 15, 28, 0.96) 0%, rgba(5, 11, 22, 0.92) 100%);
  border-right: 1px solid rgba(96, 165, 250, 0.18);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.02);
}

body[data-page="dashboard"] .crm-sidebar::after {
  content: "";
  position: absolute;
  inset: 18px 14px auto;
  height: 1px;
  background: linear-gradient(90deg, rgba(34, 211, 238, 0), rgba(34, 211, 238, 0.4), rgba(34, 211, 238, 0));
}

body[data-page="dashboard"] .crm-brand-mark {
  width: 46px;
  height: 46px;
  border: 1px solid rgba(125, 211, 252, 0.3);
  background: linear-gradient(135deg, #38bdf8 0%, #2563eb 100%);
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.28);
}

body[data-page="dashboard"] .crm-brand strong,
body[data-page="dashboard"] .crm-side-footer strong,
body[data-page="dashboard"] .crm-topbar-title h1,
body[data-page="dashboard"] .crm-panel-header h2,
body[data-page="dashboard"] .crm-strip-card strong,
body[data-page="dashboard"] .crm-link-card strong,
body[data-page="dashboard"] .leaderboard-item strong,
body[data-page="dashboard"] .source-item strong {
  color: #f4f8ff;
}

body[data-page="dashboard"] .crm-side-link,
body[data-page="dashboard"] .crm-side-sub {
  color: #93a8c7;
  border: 1px solid transparent;
}

body[data-page="dashboard"] .crm-side-link:hover,
body[data-page="dashboard"] .crm-side-sub:hover {
  color: #f4f8ff;
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(96, 165, 250, 0.18);
}

body[data-page="dashboard"] .crm-side-link.active,
body[data-page="dashboard"] .crm-side-sub.active {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.2), rgba(37, 99, 235, 0.12));
  border-color: rgba(125, 211, 252, 0.26);
  color: #eff6ff;
  box-shadow: 0 18px 38px rgba(2, 6, 23, 0.28);
}

body[data-page="dashboard"] .crm-side-label,
body[data-page="dashboard"] .crm-strip-card span,
body[data-page="dashboard"] .crm-meta-box span,
body[data-page="dashboard"] .eyebrow {
  color: #8ca2c3;
}

body[data-page="dashboard"] .crm-side-footer {
  border: 1px solid rgba(96, 165, 250, 0.14);
  background: linear-gradient(180deg, rgba(10, 20, 36, 0.92), rgba(7, 15, 28, 0.96));
  box-shadow: 0 18px 36px rgba(2, 6, 23, 0.28);
}

body[data-page="dashboard"] .crm-side-footer small,
body[data-page="dashboard"] .crm-strip-card small,
body[data-page="dashboard"] .dashboard-topbar-copy,
body[data-page="dashboard"] .dashboard-hero-text,
body[data-page="dashboard"] .dashboard-signal-card small,
body[data-page="dashboard"] .crm-link-card small,
body[data-page="dashboard"] .leaderboard-item small,
body[data-page="dashboard"] .source-item small {
  color: #91a4bf;
}

body[data-page="dashboard"] .crm-main {
  position: relative;
  padding: 28px 28px 36px;
}

body[data-page="dashboard"] .crm-topbar {
  align-items: end;
  padding: 4px 4px 20px;
}

body[data-page="dashboard"] .crm-topbar-title h1 {
  margin-top: 10px;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.04em;
}

.dashboard-topbar-copy {
  max-width: 720px;
  margin: 10px 0 0;
  font-size: 0.98rem;
  line-height: 1.65;
}

body[data-page="dashboard"] .crm-section-pill {
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(125, 211, 252, 0.18);
  color: #8fe8ff;
}

body[data-page="dashboard"] .button {
  min-height: 50px;
  border-radius: 14px;
}

body[data-page="dashboard"] .button-secondary {
  color: #e7f0ff;
  border-color: rgba(96, 165, 250, 0.18);
  background: rgba(8, 15, 30, 0.72);
}

body[data-page="dashboard"] .button-primary {
  color: #020617;
  background: linear-gradient(135deg, #67e8f9 0%, #60a5fa 100%);
  box-shadow: 0 16px 32px rgba(56, 189, 248, 0.22);
}

.dashboard-hero-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 18px;
  margin-bottom: 18px;
  padding: 26px;
  border: 1px solid rgba(96, 165, 250, 0.16);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(7, 15, 28, 0.9), rgba(6, 13, 24, 0.82));
  box-shadow: 0 28px 60px rgba(2, 6, 23, 0.34);
  overflow: hidden;
}

.dashboard-hero-panel::before {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  top: -140px;
  right: -110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(103, 232, 249, 0.26) 0%, rgba(103, 232, 249, 0) 68%);
  pointer-events: none;
}

.dashboard-hero-copy,
.dashboard-hero-side,
.dashboard-command-card {
  position: relative;
  z-index: 1;
}

.dashboard-hero-copy h2 {
  max-width: 740px;
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
  color: #f7fbff;
}

.dashboard-hero-text {
  max-width: 680px;
  margin: 18px 0 0;
  font-size: 1rem;
  line-height: 1.7;
}

.dashboard-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.dashboard-chip {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 999px;
  background: rgba(8, 15, 30, 0.7);
  color: #dbeafe;
  font-size: 0.86rem;
  letter-spacing: 0.02em;
}

.dashboard-command-card {
  padding: 18px;
  border: 1px solid rgba(125, 211, 252, 0.16);
  border-radius: 20px;
  background: rgba(7, 15, 28, 0.72);
  backdrop-filter: blur(14px);
}

.dashboard-command-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 16px;
}

.dashboard-command-header strong {
  display: block;
  margin-top: 6px;
  color: #f8fbff;
  font-size: 1.2rem;
}

.dashboard-command-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.18);
  color: #8ef9c8;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.dashboard-signal-grid {
  display: grid;
  gap: 12px;
}

.dashboard-signal-card {
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(13, 24, 42, 0.9), rgba(8, 15, 28, 0.94));
}

.dashboard-signal-card span {
  color: #8fb5ff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dashboard-signal-card strong {
  display: block;
  margin-top: 8px;
  color: #f4f8ff;
  font-size: 1.02rem;
}

body[data-page="dashboard"] .crm-strip-card,
body[data-page="dashboard"] .crm-detail-panel,
body[data-page="dashboard"] .crm-link-card,
body[data-page="dashboard"] .leaderboard-item,
body[data-page="dashboard"] .source-item {
  border: 1px solid rgba(96, 165, 250, 0.14);
  background: linear-gradient(180deg, rgba(9, 18, 33, 0.92), rgba(7, 14, 26, 0.96));
  box-shadow: 0 18px 36px rgba(2, 6, 23, 0.24);
}

body[data-page="dashboard"] .crm-strip-card {
  position: relative;
  overflow: hidden;
  min-height: 136px;
  padding: 18px;
}

body[data-page="dashboard"] .crm-strip-card::after {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.9), rgba(96, 165, 250, 0.3));
  opacity: 0.7;
}

body[data-page="dashboard"] .crm-strip-card strong {
  margin-top: 12px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.55rem, 2vw, 2rem);
  letter-spacing: -0.04em;
}

body[data-page="dashboard"] .crm-detail-panel {
  padding: 20px;
}

body[data-page="dashboard"] .crm-panel-header {
  margin-bottom: 18px;
}

body[data-page="dashboard"] .crm-dashboard-layout {
  gap: 16px;
  margin-top: 16px;
}

body[data-page="dashboard"] .trend-chart,
body[data-page="dashboard"] .leaderboard-list,
body[data-page="dashboard"] .source-breakdown {
  min-height: 100%;
}

body[data-page="dashboard"] .arrival-bar-visual,
body[data-page="dashboard"] .leaderboard-item,
body[data-page="dashboard"] .source-item {
  border-color: rgba(125, 211, 252, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

body[data-page="dashboard"] .arrival-bar-visual div {
  background: linear-gradient(180deg, rgba(103, 232, 249, 0.95), rgba(37, 99, 235, 0.34));
}

body[data-page="dashboard"] .crm-link-card {
  min-height: 178px;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

body[data-page="dashboard"] .crm-link-card:hover {
  transform: translateY(-2px);
  border-color: rgba(125, 211, 252, 0.26);
  box-shadow: 0 22px 44px rgba(8, 15, 30, 0.3);
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1320px) {
  .stats-grid-expanded {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-hero-panel {
    grid-template-columns: 1fr;
  }

  body[data-page="dashboard"] .crm-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid-expanded,
  .ops-grid,
  .workspace-grid,
  .detail-grid,
  .crm-dashboard-layout,
  .crm-settings-layout {
    grid-template-columns: 1fr;
  }

  .crm-strip,
  .crm-hub-grid,
  .compact-hub-grid,
  .crm-ai-layout,
  .crm-workspace,
  .crm-detail-layout,
  .lead-modal-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .layout {
    width: min(100% - 20px, 100%);
    padding-top: 20px;
  }

  body[data-page="dashboard"] .crm-main {
    padding: 20px 16px 28px;
  }

  .dashboard-hero-panel {
    padding: 22px 18px;
  }

  .dashboard-hero-copy h2 {
    font-size: clamp(1.8rem, 9vw, 2.7rem);
  }

  .topbar,
  .page-intro,
  .page-toolbar,
  .hero,
  .stats-grid-expanded,
  .dashboard-grid-expanded,
  .form-grid,
  .meta-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .page-intro,
  .page-toolbar {
    display: grid;
    justify-content: stretch;
  }

  .hero {
    padding: 24px;
  }

  .hero-actions {
    min-width: 100%;
  }

  .filters {
    width: 100%;
  }

  .filters input,
  .filters select,
  .form-span-2 {
    min-width: 100%;
    grid-column: auto;
  }

  .quick-links {
    grid-template-columns: 1fr;
  }

  .kanban-board {
    grid-template-columns: repeat(6, minmax(220px, 1fr));
  }

  .crm-shell {
    grid-template-columns: 1fr;
  }

  .crm-sidebar {
    gap: 14px;
    border-right: 0;
    border-bottom: 1px solid rgba(87, 73, 44, 0.12);
  }

  body[data-page="dashboard"] .crm-shell {
    grid-template-columns: 1fr;
  }

  body[data-page="dashboard"] .crm-sidebar {
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(96, 165, 250, 0.14);
  }

  .crm-topbar,
  .crm-topbar-actions {
    display: grid;
    justify-content: stretch;
  }

  .crm-strip,
  .crm-meta-strip {
    grid-template-columns: 1fr;
  }

  .lead-modal-dialog {
    padding: 18px;
  }

  .lead-create-more-grid {
    grid-template-columns: 1fr;
  }

  .crm-search,
  .crm-select {
    width: 100%;
  }
}

body[data-page] {
  position: relative;
  background:
    radial-gradient(circle at top left, rgba(23, 198, 181, 0.14), transparent 26%),
    radial-gradient(circle at 86% 10%, rgba(255, 138, 76, 0.16), transparent 24%),
    linear-gradient(180deg, #f8fafc 0%, #eef3f8 54%, #f6f8fb 100%);
  color: #16243a;
}

body[data-page]::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.18));
  pointer-events: none;
}

body[data-page]::after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.9), transparent 18%),
    radial-gradient(circle at 78% 78%, rgba(255, 255, 255, 0.55), transparent 20%);
  pointer-events: none;
}

body[data-page] .crm-shell {
  position: relative;
  z-index: 1;
  grid-template-columns: 272px minmax(0, 1fr);
  align-items: start;
}

body[data-page] .crm-sidebar {
  position: relative;
  display: grid;
  align-content: start;
  gap: 24px;
  padding: 24px 18px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  background:
    linear-gradient(180deg, rgba(12, 22, 36, 0.98) 0%, rgba(20, 34, 55, 0.96) 60%, rgba(15, 26, 43, 0.98) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 18px 0 50px rgba(15, 23, 42, 0.12);
  overflow: hidden;
}

body[data-page] .crm-sidebar::after {
  content: "";
  position: absolute;
  inset: 20px 16px auto;
  height: 1px;
  background: linear-gradient(90deg, rgba(23, 198, 181, 0), rgba(23, 198, 181, 0.56), rgba(23, 198, 181, 0));
}

body[data-page] .crm-brand {
  gap: 14px;
}

body[data-page] .crm-brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, #17c6b5 0%, #1f8fff 100%);
  box-shadow: 0 18px 34px rgba(23, 198, 181, 0.18);
}

body[data-page] .crm-brand strong,
body[data-page] .crm-side-footer strong {
  color: #f5f7fb;
}

body[data-page] .crm-side-label,
body[data-page] .crm-sidebar .eyebrow {
  color: #7d91ac;
}

body[data-page] .crm-side-link,
body[data-page] .crm-side-sub {
  min-height: 46px;
  padding: 0 14px;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: #afbed3;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.crm-nav-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  color: currentColor;
  opacity: 0.92;
}

.crm-nav-icon::before,
.crm-nav-icon::after {
  content: none;
}

.crm-nav-icon .material-icons {
  font-size: 18px;
  line-height: 1;
}

body[data-page] .crm-side-link:hover,
body[data-page] .crm-side-sub:hover {
  color: #f7fbff;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateX(2px);
}

body[data-page] .crm-side-link.active,
body[data-page] .crm-side-sub.active {
  color: #081018;
  background: linear-gradient(135deg, #f5fcff 0%, #dafaf4 55%, #d7e9ff 100%);
  border-color: rgba(255, 255, 255, 0.42);
  box-shadow: 0 16px 30px rgba(8, 16, 24, 0.16);
}

body[data-page] .crm-side-footer {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body[data-page] .crm-side-footer small {
  color: #91a4bf;
}

body[data-page] .crm-main {
  position: relative;
  padding: 26px 28px 32px;
}

body[data-page] .crm-topbar {
  align-items: end;
  gap: 18px;
  margin-bottom: 18px;
  padding: 22px 24px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 20px 42px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(16px);
}

body[data-page] .crm-topbar-title h1 {
  margin: 10px 0 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: #132238;
}

body[data-page] .crm-topbar-copy,
body[data-page] .dashboard-topbar-copy {
  max-width: 760px;
  margin: 8px 0 0;
  color: #63748d;
  font-size: 0.9rem;
  line-height: 1.5;
}

body[data-page] .crm-section-pill {
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid rgba(23, 198, 181, 0.18);
  background: rgba(23, 198, 181, 0.1);
  color: #0d7c71;
  letter-spacing: 0.12em;
}

body[data-page] .crm-topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

body[data-page] .button {
  min-height: 48px;
  border-radius: 16px;
  font-weight: 600;
}

body[data-page] .button-secondary {
  color: #20415f;
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
}

body[data-page] .button-primary {
  color: #fff;
  background: linear-gradient(135deg, #17c6b5 0%, #1f8fff 100%);
  box-shadow: 0 14px 28px rgba(31, 143, 255, 0.18);
}

body[data-page] .button-danger {
  color: #fff;
  background: linear-gradient(135deg, #ff7b6b 0%, #e5475e 100%);
  box-shadow: 0 14px 28px rgba(229, 71, 94, 0.16);
}

body[data-page] .crm-live-pill {
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid rgba(23, 198, 181, 0.14);
  border-radius: 14px;
  background: rgba(23, 198, 181, 0.1);
  color: #0a7d73;
}

body[data-page] .crm-search,
body[data-page] .crm-select,
body[data-page] .crm-shell input,
body[data-page] .crm-shell textarea,
body[data-page] .crm-shell select {
  color: #18304d;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

body[data-page] .crm-search,
body[data-page] .crm-select {
  min-height: 48px;
}

body[data-page] .crm-shell input:focus,
body[data-page] .crm-shell textarea:focus,
body[data-page] .crm-shell select:focus {
  border-color: rgba(23, 198, 181, 0.42);
  box-shadow: 0 0 0 4px rgba(23, 198, 181, 0.12);
  background: #fff;
}

body[data-page] .crm-strip {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

body[data-page] .crm-board-panel,
body[data-page] .crm-form-panel,
body[data-page] .crm-list-panel,
body[data-page] .crm-detail-panel,
body[data-page] .crm-link-card,
body[data-page] .crm-strip-card,
body[data-page] .integration-card,
body[data-page] .leaderboard-item,
body[data-page] .source-item,
body[data-page] .settings-check-item,
body[data-page] .calendar-item,
body[data-page] .crm-meta-box {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(18px);
}

body[data-page] .crm-strip-card {
  position: relative;
  overflow: hidden;
  min-height: 144px;
  padding: 18px;
}

body[data-page] .crm-strip-card::after {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #17c6b5 0%, #1f8fff 60%, #ff8a4c 100%);
}

body[data-page] .crm-strip-card span,
body[data-page] .crm-meta-box span,
body[data-page] .eyebrow,
body[data-page] .crm-shell th,
body[data-page] .crm-link-card small,
body[data-page] .settings-check-item small,
body[data-page] .calendar-item small,
body[data-page] .calendar-item-meta,
body[data-page] .leaderboard-item small,
body[data-page] .source-item small {
  color: #6f8099;
}

body[data-page] .crm-strip-card strong,
body[data-page] .crm-meta-box strong,
body[data-page] .crm-panel-header h2,
body[data-page] .crm-link-card strong,
body[data-page] .settings-check-item strong,
body[data-page] .calendar-item strong,
body[data-page] .leaderboard-item strong,
body[data-page] .source-item strong,
body[data-page] .integration-card strong {
  color: #16243a;
}

body[data-page] .crm-strip-card strong,
body[data-page] .crm-meta-box strong {
  margin-top: 12px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.55rem, 2vw, 2rem);
  letter-spacing: -0.04em;
}

body[data-page] .crm-strip-card small {
  color: #8696ad;
}

body[data-page] .crm-dashboard-layout,
body[data-page] .crm-settings-layout,
body[data-page] .crm-detail-layout,
body[data-page] .crm-workspace {
  gap: 16px;
  margin-top: 16px;
}

body[data-page] .crm-detail-panel,
body[data-page] .crm-form-panel,
body[data-page] .crm-list-panel,
body[data-page] .crm-board-panel,
body[data-page] .crm-link-card {
  padding: 20px;
}

body[data-page] .crm-panel-header {
  margin-bottom: 18px;
}

body[data-page] .crm-link-card {
  min-height: 168px;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

body[data-page] .crm-link-card:hover,
body[data-page] .calendar-item:hover,
body[data-page] .integration-card-summary:hover {
  transform: translateY(-2px);
  border-color: rgba(23, 198, 181, 0.22);
  box-shadow: 0 24px 44px rgba(15, 23, 42, 0.1);
}

body[data-page] .trend-chart {
  gap: 14px;
}

body[data-page] .arrival-bar-visual {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(240, 247, 255, 0.96), rgba(232, 241, 250, 0.92));
}

body[data-page] .arrival-bar-visual div {
  background: linear-gradient(180deg, rgba(23, 198, 181, 0.95), rgba(31, 143, 255, 0.45));
}

body[data-page] .kanban-board {
  gap: 18px;
}

body[data-page] .kanban-column,
body[data-page] .kanban-board-kommo .kanban-column {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(241, 246, 252, 0.94));
  box-shadow: 0 22px 40px rgba(15, 23, 42, 0.08);
}

body[data-page] .kanban-column-header,
body[data-page] .kanban-board-kommo .kanban-column-header {
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

body[data-page] .kanban-column-header strong,
body[data-page] .kanban-board-kommo .kanban-column-title strong {
  color: #16243a;
}

body[data-page] .kanban-count,
body[data-page] .kanban-board-kommo .kanban-column-total {
  color: #0a7d73;
  background: rgba(23, 198, 181, 0.12);
}

body[data-page] .kanban-cards,
body[data-page] .kanban-board-kommo .kanban-cards {
  border-radius: 18px;
}

body[data-page] .kanban-cards.drag-over,
body[data-page] .kanban-board-kommo .kanban-cards.drag-over {
  background: rgba(23, 198, 181, 0.08);
  outline-color: rgba(23, 198, 181, 0.3);
}

body[data-page] .kanban-card,
body[data-page] .kanban-board-kommo .kanban-card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f6f9fd 100%);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.06);
}

body[data-page] .kanban-card h3,
body[data-page] .kanban-board-kommo .kanban-card h3 {
  color: #14263d;
}

body[data-page] .kanban-chip,
body[data-page] .crm-card-value {
  color: #285d91;
  background: rgba(31, 143, 255, 0.08);
}

body[data-page] .table-shell,
body[data-page] .crm-table-shell {
  overflow: auto;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

body[data-page] .crm-shell table,
body[data-page] table {
  background: transparent;
}

body[data-page] .crm-shell th {
  color: #69809f;
  background: rgba(242, 247, 252, 0.95);
}

body[data-page] .crm-shell th,
body[data-page] .crm-shell td,
body[data-page] th,
body[data-page] td {
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

body[data-page] .crm-shell tbody tr:hover,
body[data-page] tbody tr:hover {
  background: rgba(23, 198, 181, 0.06);
}

body[data-page] .crm-shell tbody tr.active,
body[data-page] tbody tr.active {
  background: rgba(31, 143, 255, 0.08);
}

body[data-page] .status-badge {
  color: #224d78;
  background: rgba(31, 143, 255, 0.09);
}

body[data-page] .crm-meta-strip {
  gap: 12px;
}

body[data-page] .crm-meta-box {
  padding: 16px;
  background: linear-gradient(180deg, rgba(251, 253, 255, 0.96), rgba(242, 247, 252, 0.96));
}

body[data-page] .payload-viewer,
body[data-page] .crm-payload-viewer {
  min-height: 260px;
  margin-top: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 22px;
  background: linear-gradient(180deg, #132238 0%, #1b304d 100%);
  color: #c3fff3;
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.16);
}

body[data-page] .quick-lead-modal {
  background: rgba(10, 18, 31, 0.26);
  backdrop-filter: blur(10px);
}

body[data-page] .quick-lead-dialog {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 26px;
  background: rgba(247, 250, 253, 0.96);
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.16);
}

body[data-page] .lead-create-more,
body[data-page] .integration-card-editor,
body[data-page] .ai-summary-card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  background: rgba(242, 247, 252, 0.92);
  box-shadow: none;
}

body[data-page] .lead-create-more summary {
  color: #21405d;
}

body[data-page] .integration-card.enabled {
  border-color: rgba(23, 198, 181, 0.22);
}

body[data-page] .integration-card.disabled {
  border-color: rgba(255, 138, 76, 0.18);
}

body[data-page] .calendar-item.active {
  border-color: rgba(23, 198, 181, 0.26);
  background: linear-gradient(180deg, rgba(236, 253, 250, 0.96), rgba(242, 247, 252, 0.94));
}

body[data-page] .message-banner {
  border: 1px solid rgba(255, 123, 107, 0.22);
  background: rgba(255, 123, 107, 0.08);
  color: #8d3042;
}

body[data-loading="true"][data-page="crm"] .crm-live-pill,
body[data-loading="true"][data-page="funil-vendas"] .crm-live-pill,
body[data-loading="true"][data-page="leads-ativos"] .crm-live-pill,
body[data-loading="true"][data-page="agente-ia"] .crm-live-pill,
body[data-loading="true"][data-page="calendario"] .crm-live-pill,
body[data-loading="true"][data-page="insights"] .crm-live-pill,
body[data-loading="true"][data-page="configuracoes"] .crm-live-pill,
body[data-loading="true"][data-page="dashboard"] .crm-live-pill {
  color: #9a622d;
  border-color: rgba(255, 138, 76, 0.18);
  background: rgba(255, 138, 76, 0.12);
}

body[data-page] .dashboard-hero-panel {
  position: relative;
  grid-template-columns: minmax(0, 1.12fr) minmax(300px, 0.88fr);
  gap: 18px;
  padding: 26px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.08);
}

body[data-page] .dashboard-hero-panel::before {
  content: "";
  position: absolute;
  width: 340px;
  height: 340px;
  top: -160px;
  right: -140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(23, 198, 181, 0.24) 0%, rgba(23, 198, 181, 0) 68%);
  pointer-events: none;
}

body[data-page] .dashboard-hero-copy h2 {
  color: #122136;
}

body[data-page] .dashboard-hero-text,
body[data-page] .dashboard-signal-card small {
  color: #62738b;
}

body[data-page] .dashboard-chip {
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.86);
  color: #20415f;
}

body[data-page] .dashboard-command-card,
body[data-page] .dashboard-signal-card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(249, 252, 255, 0.96), rgba(239, 245, 251, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

body[data-page] .dashboard-command-badge {
  background: rgba(23, 198, 181, 0.1);
  border-color: rgba(23, 198, 181, 0.18);
  color: #0c7d72;
}

body[data-page] .dashboard-signal-card span {
  color: #1d7fd8;
}

@media (max-width: 1320px) {
  body[data-page] .crm-shell {
    grid-template-columns: 248px minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  body[data-page] .crm-shell {
    grid-template-columns: 1fr;
  }

  body[data-page] .crm-sidebar {
    position: relative;
    top: auto;
    height: auto;
    overflow: visible;
    padding-bottom: 18px;
    border-right: 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  }

  body[data-page] .crm-main {
    padding: 18px 14px 24px;
  }

  body[data-page] .crm-topbar {
    padding: 20px 18px;
    border-radius: 24px;
  }

  body[data-page] .crm-topbar-title h1,
  body[data-page] .dashboard-hero-copy h2 {
    font-size: clamp(1.35rem, 7vw, 1.75rem);
  }

  body[data-page] .dashboard-hero-panel {
    grid-template-columns: 1fr;
    padding: 20px 18px;
  }

  body[data-page] .crm-strip {
    grid-template-columns: 1fr;
  }
}

body[data-page] {
  overflow-x: hidden;
}

body[data-page] .crm-main,
body[data-page] .crm-board-panel,
body[data-page] .crm-form-panel,
body[data-page] .crm-list-panel,
body[data-page] .crm-detail-panel,
body[data-page] .crm-link-card,
body[data-page] .crm-topbar-title,
body[data-page] .crm-topbar-actions,
body[data-page] .dashboard-hero-copy,
body[data-page] .dashboard-hero-side {
  min-width: 0;
}

body[data-page] .crm-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

body[data-page] .crm-topbar-actions {
  min-width: min(100%, 720px);
  align-self: start;
}

body[data-page] .crm-topbar-actions > * {
  max-width: 100%;
}

body[data-page] .crm-search {
  flex: 1 1 260px;
  min-width: min(100%, 260px);
}

body[data-page] .crm-select {
  flex: 1 1 180px;
  min-width: min(100%, 180px);
}

body[data-page] .crm-live-pill,
body[data-page] .button {
  flex: 0 0 auto;
}

body[data-page] .crm-dashboard-layout,
body[data-page] .crm-settings-layout,
body[data-page] .crm-detail-layout,
body[data-page] .crm-workspace,
body[data-page] .crm-hub-grid,
body[data-page] .compact-hub-grid,
body[data-page] .crm-ai-layout {
  align-items: start;
}

body[data-page] .crm-hub-grid,
body[data-page] .compact-hub-grid,
body[data-page] .crm-ai-layout {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

body[data-page] .crm-meta-strip {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

body[data-page] .crm-list-actions {
  align-items: center;
  justify-content: flex-end;
}

body[data-page] .table-shell,
body[data-page] .crm-table-shell,
body[data-page] .kanban-board {
  max-width: 100%;
}

body[data-page] .crm-board-panel {
  overflow: hidden;
}

body[data-page] .kanban-board {
  grid-template-columns: repeat(6, minmax(252px, 1fr));
  overflow-x: auto;
  padding-bottom: 6px;
}

body[data-page] .dashboard-hero-panel {
  display: grid;
  align-items: stretch;
}

body[data-page] .trend-chart {
  min-width: 0;
}

@media (max-width: 1200px) {
  body[data-page] .crm-topbar {
    grid-template-columns: 1fr;
  }

  body[data-page] .crm-topbar-actions {
    min-width: 0;
    justify-content: stretch;
  }
}

@media (max-width: 900px) {
  body[data-page] .crm-topbar-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  body[data-page] .crm-search,
  body[data-page] .crm-select,
  body[data-page] .button,
  body[data-page] .crm-live-pill {
    width: 100%;
    min-width: 0;
  }

  body[data-page] .crm-dashboard-layout,
  body[data-page] .crm-settings-layout,
  body[data-page] .crm-detail-layout,
  body[data-page] .crm-workspace,
  body[data-page] .crm-hub-grid,
  body[data-page] .compact-hub-grid,
  body[data-page] .crm-ai-layout,
  body[data-page] .crm-meta-strip {
    grid-template-columns: 1fr;
  }
}

body[data-auth="signed-out"] .crm-shell {
  filter: blur(8px);
  pointer-events: none;
  user-select: none;
}

.crm-auth-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.crm-user-pill {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #21405d;
  font-size: 0.84rem;
  font-weight: 600;
}

.crm-sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: #d9f7f3;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.crm-sidebar-toggle:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
}

.crm-sidebar-toggle .material-icons {
  font-size: 20px;
  line-height: 1;
}

body[data-page] .crm-shell.is-sidebar-collapsed {
  grid-template-columns: 96px minmax(0, 1fr);
}

body[data-page] .crm-shell.is-sidebar-collapsed .crm-sidebar {
  padding-inline: 12px;
}

body[data-page] .crm-shell.is-sidebar-collapsed .crm-sidebar-toggle {
  margin-inline: auto;
}

body[data-page] .crm-shell.is-sidebar-collapsed .crm-brand {
  justify-content: center;
}

body[data-page] .crm-shell.is-sidebar-collapsed .crm-brand > div,
body[data-page] .crm-shell.is-sidebar-collapsed .crm-side-label,
body[data-page] .crm-shell.is-sidebar-collapsed .crm-side-footer {
  display: none;
}

body[data-page] .crm-shell.is-sidebar-collapsed .crm-side-link,
body[data-page] .crm-shell.is-sidebar-collapsed .crm-side-sub {
  justify-content: center;
  padding: 0;
  gap: 0;
  font-size: 0;
  position: relative;
}

body[data-page] .crm-shell.is-sidebar-collapsed .crm-side-link::before,
body[data-page] .crm-shell.is-sidebar-collapsed .crm-side-sub::before {
  content: none;
}

body[data-page] .crm-shell.is-sidebar-collapsed .crm-nav-icon {
  flex-basis: 20px;
  width: 20px;
  height: 20px;
}

body[data-page] .crm-shell.is-sidebar-collapsed .crm-side-link:hover::after,
body[data-page] .crm-shell.is-sidebar-collapsed .crm-side-sub:hover::after {
  content: attr(data-full);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(12, 22, 36, 0.94);
  color: #f5f7fb;
  font-size: 0.78rem;
  white-space: nowrap;
  box-shadow: 0 14px 28px rgba(8, 16, 24, 0.18);
  pointer-events: none;
  z-index: 4;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(11, 18, 32, 0.28);
  backdrop-filter: blur(12px);
}

.auth-panel {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 18px;
  padding: 22px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 28px;
  background: rgba(248, 251, 255, 0.94);
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.18);
}

.auth-panel-copy {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 8px;
}

.auth-panel-copy h2 {
  margin: 0;
  color: #132238;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.auth-panel-copy p {
  margin: 0;
  color: #62738b;
  line-height: 1.7;
}

.auth-panel-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.auth-form {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.auth-form label {
  color: #51647d;
  font-weight: 600;
}

.auth-form input {
  color: #17304d !important;
  background: #ffffff !important;
  border: 1px solid rgba(23, 198, 181, 0.26) !important;
  font-weight: 600;
  caret-color: #0f766e;
  -webkit-text-fill-color: #17304d;
}

.auth-form input::placeholder {
  color: #7b8da4;
  opacity: 1;
  -webkit-text-fill-color: #7b8da4;
}

.auth-form input:focus {
  color: #132a44 !important;
  background: #ffffff !important;
  border-color: rgba(23, 198, 181, 0.5) !important;
  -webkit-text-fill-color: #132a44;
}

.auth-form input:-webkit-autofill,
.auth-form input:-webkit-autofill:hover,
.auth-form input:-webkit-autofill:focus,
.auth-form input:-webkit-autofill:active {
  -webkit-text-fill-color: #17304d !important;
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
  box-shadow: 0 0 0 1000px #ffffff inset !important;
  transition: background-color 9999s ease-in-out 0s;
}

.auth-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.auth-form-actions .button {
  flex: 1 1 180px;
}

.auth-form-message {
  margin: 0;
  color: #62738b;
  line-height: 1.5;
}

.auth-form-message[data-tone="error"] {
  color: #b24157;
}

@media (max-width: 1200px) {
  body[data-page] .crm-shell.is-sidebar-collapsed {
    grid-template-columns: 88px minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  body[data-auth="signed-out"] .crm-shell {
    filter: blur(4px);
  }

  body[data-page] .crm-shell.is-sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  body[data-page] .crm-shell.is-sidebar-collapsed .crm-sidebar {
    padding-inline: 18px;
  }

  .crm-sidebar-toggle {
    margin-left: 0;
  }

  body[data-page] .crm-shell.is-sidebar-collapsed .crm-brand > div,
  body[data-page] .crm-shell.is-sidebar-collapsed .crm-side-label,
  body[data-page] .crm-shell.is-sidebar-collapsed .crm-side-footer {
    display: block;
  }

  body[data-page] .crm-shell.is-sidebar-collapsed .crm-side-link,
  body[data-page] .crm-shell.is-sidebar-collapsed .crm-side-sub {
    justify-content: flex-start;
    padding: 0 14px;
    gap: 12px;
    font-size: inherit;
  }

  body[data-page] .crm-shell.is-sidebar-collapsed .crm-side-link::before,
  body[data-page] .crm-shell.is-sidebar-collapsed .crm-side-sub::before,
  body[data-page] .crm-shell.is-sidebar-collapsed .crm-side-link:hover::after,
  body[data-page] .crm-shell.is-sidebar-collapsed .crm-side-sub:hover::after {
    content: none;
  }

  body[data-page] .crm-shell.is-sidebar-collapsed .crm-nav-icon {
    flex-basis: 18px;
    width: 18px;
    height: 18px;
  }

  .auth-panel {
    grid-template-columns: 1fr;
    padding: 18px;
  }
}

body[data-page] .crm-topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 18px 22px;
}

body[data-page] .crm-topbar-title {
  display: none;
}

body[data-page] .crm-topbar-actions {
  width: 100%;
  min-width: 0;
  justify-content: flex-end;
  align-items: center;
}

body[data-page] .crm-topbar-actions .crm-auth-controls {
  margin-left: auto;
}

@media (max-width: 1200px) {
  body[data-page] .crm-topbar-actions {
    justify-content: stretch;
  }

  body[data-page] .crm-topbar-actions .crm-auth-controls {
    margin-left: 0;
  }
}

@media (max-width: 900px) {
  body[data-page] .crm-topbar {
    padding: 16px;
  }

  body[data-page] .crm-topbar-actions .crm-auth-controls {
    display: grid;
    grid-template-columns: 1fr;
  }
}

body[data-page] .crm-topbar,
body[data-page] .crm-board-panel,
body[data-page] .crm-form-panel,
body[data-page] .crm-list-panel,
body[data-page] .crm-detail-panel,
body[data-page] .crm-link-card,
body[data-page] .crm-strip-card,
body[data-page] .integration-card,
body[data-page] .leaderboard-item,
body[data-page] .source-item,
body[data-page] .settings-check-item,
body[data-page] .calendar-item,
body[data-page] .crm-meta-box,
body[data-page] .table-shell,
body[data-page] .crm-table-shell {
  background: #ffffff;
  backdrop-filter: none;
}

body[data-page] .button-secondary,
body[data-page] .crm-user-pill,
body[data-page] .crm-live-pill {
  background: #ffffff;
  backdrop-filter: none;
}

body[data-page] .crm-shell input,
body[data-page] .crm-shell textarea,
body[data-page] .crm-shell select {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.14);
  box-shadow: none;
}

body[data-page] .crm-shell input::placeholder,
body[data-page] .crm-shell textarea::placeholder {
  color: #8a99ad;
  opacity: 1;
}

body[data-page] .crm-shell input:focus,
body[data-page] .crm-shell textarea:focus,
body[data-page] .crm-shell select:focus {
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(23, 198, 181, 0.14);
}

body[data-page] .quick-lead-modal {
  background: rgba(10, 18, 31, 0.42);
  backdrop-filter: blur(6px);
}

body[data-page] .quick-lead-dialog,
body[data-page] .lead-modal-dialog,
body[data-page] .lead-modal-dialog .crm-form-panel,
body[data-page] .lead-modal-dialog .crm-detail-panel,
body[data-page] .lead-create-more,
body[data-page] .integration-card-editor,
body[data-page] .ai-summary-card {
  background: #ffffff;
  backdrop-filter: none;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.12);
}

body[data-page] .crm-meta-box {
  background: #ffffff;
}

body[data-page] .payload-viewer,
body[data-page] .crm-payload-viewer {
  background: linear-gradient(180deg, #132238 0%, #1b304d 100%);
}

body[data-page="configuracoes"] .crm-main {
  padding-top: 20px;
}

body[data-page="configuracoes"] .crm-settings-layout {
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 14px;
  margin-top: 14px;
}

body[data-page="configuracoes"] .settings-panel-compact {
  padding: 16px 16px 18px;
  border-radius: 20px;
}

body[data-page="configuracoes"] .crm-panel-header {
  margin-bottom: 14px;
}

body[data-page="configuracoes"] .crm-panel-header h2 {
  font-size: 1rem;
}

.settings-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.settings-summary-card {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.06);
}

.settings-summary-card span {
  color: #6b7f9a;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.settings-summary-card strong {
  color: #16243a;
  font-size: 1rem;
}

.settings-summary-card small {
  color: #71839c;
  line-height: 1.45;
}

body[data-page="configuracoes"] .settings-form-grid {
  gap: 10px;
}

body[data-page="configuracoes"] .settings-form-grid textarea {
  min-height: 104px;
}

body[data-page="configuracoes"] .integration-cards,
body[data-page="configuracoes"] .source-breakdown,
body[data-page="configuracoes"] .settings-checklist,
body[data-page="configuracoes"] .settings-links {
  gap: 10px;
}

body[data-page="configuracoes"] .integration-card,
body[data-page="configuracoes"] .source-item,
body[data-page="configuracoes"] .settings-check-item,
body[data-page="configuracoes"] .settings-link-card {
  padding: 14px 15px;
  border-radius: 16px;
  min-height: 0;
}

body[data-page="configuracoes"] .settings-link-card {
  min-height: 110px;
}

body[data-page="configuracoes"] .settings-check-item strong,
body[data-page="configuracoes"] .integration-card strong,
body[data-page="configuracoes"] .source-item strong,
body[data-page="configuracoes"] .settings-link-card strong {
  font-size: 1rem;
}

body[data-page="configuracoes"] .settings-check-item small,
body[data-page="configuracoes"] .integration-card small,
body[data-page="configuracoes"] .source-item small,
body[data-page="configuracoes"] .settings-link-card small {
  line-height: 1.45;
}

@media (max-width: 1320px) {
  .settings-summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  body[data-page="configuracoes"] .crm-settings-layout,
  .settings-summary-strip {
    grid-template-columns: 1fr;
  }
}

body[data-page="dashboard"] .crm-main {
  padding-bottom: 18px;
}

body[data-page="dashboard"] .crm-strip {
  margin-bottom: 12px;
}

body[data-page="dashboard"] .dashboard-stack-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
  gap: 14px;
  margin-top: 12px;
  align-items: start;
}

body[data-page="dashboard"] .dashboard-stack-column {
  display: grid;
  gap: 14px;
  align-content: start;
}

body[data-page="dashboard"] .crm-dashboard-layout {
  align-items: start;
  gap: 14px;
  margin-top: 12px;
}

body[data-page="dashboard"] .crm-detail-panel {
  height: auto;
}

body[data-page="dashboard"] .crm-hub-grid.compact-hub-grid {
  gap: 10px;
}

body[data-page="dashboard"] .crm-link-card {
  min-height: 132px;
}

body[data-page="dashboard"] .source-breakdown,
body[data-page="dashboard"] .leaderboard-list {
  gap: 10px;
}

body[data-page="dashboard"] .message-banner {
  margin-top: 12px;
}

@media (max-width: 1320px) {
  body[data-page="dashboard"] .dashboard-stack-layout {
    grid-template-columns: 1fr;
  }
}

#userProfilesList [data-user-profile-id] {
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

#userProfilesList [data-user-profile-id]:hover {
  transform: translateY(-2px);
  border-color: rgba(23, 198, 181, 0.24);
  box-shadow: 0 22px 42px rgba(15, 23, 42, 0.1);
}

body[data-page] .lead-modal-dialog,
body[data-page] .lead-modal-dialog .crm-form-panel,
body[data-page] .lead-modal-dialog .crm-detail-panel,
body[data-page] .lead-modal-dialog label,
body[data-page] .lead-modal-dialog .lead-modal-subtitle,
body[data-page] .lead-modal-dialog .crm-panel-header h2,
body[data-page] .lead-modal-dialog .eyebrow,
body[data-page] .lead-modal-dialog .crm-meta-box span,
body[data-page] .lead-modal-dialog .crm-meta-box strong {
  color: #233956;
}

body[data-page] .lead-modal-dialog input,
body[data-page] .lead-modal-dialog textarea,
body[data-page] .lead-modal-dialog select {
  color: #0f2238 !important;
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.16) !important;
  -webkit-text-fill-color: #0f2238 !important;
  opacity: 1 !important;
}

body[data-page] .lead-modal-dialog input::placeholder,
body[data-page] .lead-modal-dialog textarea::placeholder {
  color: #8a99ad !important;
  opacity: 1 !important;
  -webkit-text-fill-color: #8a99ad !important;
}

body[data-page] .lead-modal-dialog input:focus,
body[data-page] .lead-modal-dialog textarea:focus,
body[data-page] .lead-modal-dialog select:focus {
  color: #0f2238 !important;
  background: #ffffff !important;
  -webkit-text-fill-color: #0f2238 !important;
}

body[data-page] .lead-modal-dialog input::-webkit-datetime-edit,
body[data-page] .lead-modal-dialog input::-webkit-datetime-edit-fields-wrapper,
body[data-page] .lead-modal-dialog input::-webkit-datetime-edit-text,
body[data-page] .lead-modal-dialog input::-webkit-datetime-edit-month-field,
body[data-page] .lead-modal-dialog input::-webkit-datetime-edit-day-field,
body[data-page] .lead-modal-dialog input::-webkit-datetime-edit-year-field,
body[data-page] .lead-modal-dialog input::-webkit-datetime-edit-hour-field,
body[data-page] .lead-modal-dialog input::-webkit-datetime-edit-minute-field {
  color: #0f2238 !important;
}

body[data-page] .lead-modal-dialog input:-webkit-autofill,
body[data-page] .lead-modal-dialog input:-webkit-autofill:hover,
body[data-page] .lead-modal-dialog input:-webkit-autofill:focus,
body[data-page] .lead-modal-dialog textarea:-webkit-autofill,
body[data-page] .lead-modal-dialog select:-webkit-autofill {
  -webkit-text-fill-color: #0f2238 !important;
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
  box-shadow: 0 0 0 1000px #ffffff inset !important;
}

.auth-form-help {
  margin: -2px 0 0;
  color: #6e8199;
  font-size: 0.9rem;
  line-height: 1.45;
}

.field-hint {
  display: block;
  margin-top: 6px;
  color: #7588a1;
  font-size: 0.82rem;
  line-height: 1.45;
}

body[data-page] .crm-topbar-actions {
  gap: 12px;
  flex-wrap: wrap;
}

body[data-page] .crm-auth-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

body[data-page="configuracoes"] .integration-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

body[data-page="configuracoes"] .integration-editor-actions .button {
  flex: 1 1 180px;
}

body[data-page="configuracoes"] #userProfilePassword:disabled {
  background: #f3f6fa;
  color: #7f8ea3;
}

body[data-page="configuracoes"] #userProfilesList .source-item.is-selected {
  border-color: rgba(23, 198, 181, 0.36);
  box-shadow: 0 20px 38px rgba(15, 23, 42, 0.1);
}

body[data-page="configuracoes"] #userProfilesList .source-item.is-selected strong {
  color: #0f766e;
}

@media (max-width: 900px) {
  body[data-page] .crm-auth-controls,
  body[data-page="configuracoes"] .integration-editor-actions {
    width: 100%;
  }
}

/* Product shell redesign inspired by the reference board, adapted to the CRM context. */
body[data-page] {
  background:
    radial-gradient(circle at top left, rgba(160, 144, 255, 0.22), transparent 26%),
    radial-gradient(circle at 92% 8%, rgba(136, 185, 255, 0.24), transparent 24%),
    radial-gradient(circle at 50% 100%, rgba(245, 214, 255, 0.34), transparent 28%),
    linear-gradient(180deg, #f4f1ff 0%, #eef1ff 48%, #f7f8ff 100%);
  color: #2a3051;
}

body[data-page]::before {
  background-image:
    linear-gradient(rgba(117, 108, 196, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(117, 108, 196, 0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.42;
}

body[data-page] .crm-shell {
  width: min(1480px, calc(100% - 34px));
  margin: 24px auto;
  padding: 18px;
  gap: 18px;
  grid-template-columns: 260px minmax(0, 1fr);
  border: 1px solid rgba(126, 115, 237, 0.1);
  border-radius: 38px;
  background: linear-gradient(180deg, rgba(252, 251, 255, 0.9), rgba(247, 247, 255, 0.94));
  box-shadow:
    0 34px 80px rgba(105, 92, 179, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(18px);
}

body[data-page] .crm-sidebar {
  position: sticky;
  top: 18px;
  height: calc(100vh - 48px);
  gap: 18px;
  padding: 22px 16px 18px;
  border: 0;
  border-radius: 28px;
  background:
    linear-gradient(180deg, #7f70ff 0%, #6d62f2 42%, #5d54e0 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 24px 44px rgba(92, 78, 187, 0.28);
}

body[data-page] .crm-sidebar::after {
  content: "";
  position: absolute;
  inset: auto 18px 92px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.32), transparent);
  opacity: 0.8;
}

body[data-page] .crm-brand {
  gap: 14px;
  padding: 4px 2px 8px;
}

body[data-page] .crm-brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.1));
  color: #ffffff;
  box-shadow: 0 16px 28px rgba(63, 47, 162, 0.28);
}

body[data-page] .crm-brand strong,
body[data-page] .crm-side-footer strong {
  color: #ffffff !important;
}

body[data-page] .crm-sidebar .eyebrow,
body[data-page] .crm-side-label,
body[data-page] .crm-side-footer small {
  color: rgba(238, 240, 255, 0.72) !important;
}

body[data-page] .crm-side-link,
body[data-page] .crm-side-sub {
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 16px;
  color: rgba(245, 246, 255, 0.76) !important;
  background: transparent;
  font-weight: 500;
}

body[data-page] .crm-side-link:hover,
body[data-page] .crm-side-sub:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

body[data-page] .crm-side-link.active,
body[data-page] .crm-side-sub.active {
  color: #2f3664 !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 244, 255, 0.92));
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 14px 26px rgba(44, 34, 124, 0.18);
}

body[data-page] .crm-side-footer {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.08));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

body[data-page] .crm-sidebar-toggle {
  margin: 6px 2px 2px auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

body[data-page] .crm-sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.16);
}

body[data-page] .crm-sidebar-toggle-icon,
body[data-page] .crm-sidebar-toggle-icon::before,
body[data-page] .crm-sidebar-toggle-icon::after {
  background: #ffffff;
}

body[data-page] .crm-main {
  padding: 4px 4px 12px;
}

body[data-page] .crm-topbar {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 18px;
  padding: 20px 22px !important;
  border: 1px solid rgba(126, 115, 237, 0.1);
  border-radius: 28px;
  background: linear-gradient(180deg, #ffffff 0%, #fcfbff 100%);
  box-shadow: 0 18px 38px rgba(107, 91, 181, 0.08);
}

body[data-page] .crm-topbar-title {
  display: grid !important;
  gap: 8px;
  align-content: start;
}

body[data-page] .crm-topbar-title h1 {
  margin: 0 !important;
  color: #272c4f !important;
  font-size: clamp(1.45rem, 3vw, 2.15rem) !important;
  line-height: 1.02;
  letter-spacing: -0.04em;
}

body[data-page] .crm-topbar-copy,
body[data-page="dashboard"] .dashboard-topbar-copy {
  max-width: 680px;
  margin: 0;
  color: #858aa7 !important;
  font-size: 0.94rem;
  line-height: 1.55;
}

body[data-page] .crm-section-pill {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(126, 115, 237, 0.14);
  background: #f1ecff;
  color: #6a5ae8;
}

body[data-page] .crm-topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

body[data-page] .crm-auth-controls {
  margin-left: 0;
}

body[data-page] .crm-shell .button-primary {
  color: #ffffff;
  border: 0;
  background: linear-gradient(135deg, #7d6cff 0%, #6190ff 100%);
  box-shadow: 0 14px 28px rgba(110, 97, 230, 0.18);
}

body[data-page] .crm-shell .button-secondary {
  color: #4d5380;
  border: 1px solid rgba(126, 115, 237, 0.12);
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(106, 91, 181, 0.05);
}

body[data-page] .crm-live-pill,
body[data-page] .crm-user-pill {
  border: 1px solid rgba(126, 115, 237, 0.12);
  background: #f3efff;
  color: #6a5ae8;
}

body[data-page] .crm-search,
body[data-page] .crm-select,
body[data-page] .crm-shell input,
body[data-page] .crm-shell textarea,
body[data-page] .crm-shell select {
  border: 1px solid rgba(126, 115, 237, 0.12);
  border-radius: 16px;
  background: #ffffff;
  color: #2c3052;
  box-shadow: 0 8px 18px rgba(107, 91, 181, 0.05);
}

body[data-page] .crm-shell input::placeholder,
body[data-page] .crm-shell textarea::placeholder {
  color: #9aa0bc;
}

body[data-page] .crm-shell input:focus,
body[data-page] .crm-shell textarea:focus,
body[data-page] .crm-shell select:focus {
  border-color: rgba(126, 115, 237, 0.3);
  box-shadow: 0 0 0 4px rgba(126, 115, 237, 0.08);
}

body[data-page] .crm-strip {
  gap: 14px;
  margin-top: 16px;
  margin-bottom: 14px;
}

body[data-page] .crm-strip-card,
body[data-page] .crm-detail-panel,
body[data-page] .crm-link-card,
body[data-page] .crm-board-panel,
body[data-page] .crm-form-panel,
body[data-page] .crm-list-panel,
body[data-page] .integration-card,
body[data-page] .leaderboard-item,
body[data-page] .source-item,
body[data-page] .calendar-item,
body[data-page] .crm-meta-box,
body[data-page] .table-shell,
body[data-page] .crm-table-shell,
body[data-page] .settings-summary-card,
body[data-page] .settings-check-item,
body[data-page] .integration-card-editor,
body[data-page] .ai-summary-card {
  border: 1px solid rgba(126, 115, 237, 0.08) !important;
  border-radius: 24px !important;
  background: linear-gradient(180deg, #ffffff 0%, #fcfbff 100%) !important;
  box-shadow: 0 16px 34px rgba(107, 91, 181, 0.08) !important;
}

body[data-page] .crm-strip-card {
  position: relative;
  overflow: hidden;
  min-height: 132px;
  padding: 18px;
}

body[data-page] .crm-strip-card::after {
  content: "";
  position: absolute;
  inset: 0 auto auto 18px;
  width: calc(100% - 36px);
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, #7f70ff 0%, #8bb8ff 100%);
  opacity: 0.95;
}

body[data-page] .crm-strip-card span,
body[data-page] .crm-meta-box span,
body[data-page] .eyebrow,
body[data-page] .settings-summary-card span {
  color: #8c92ad !important;
}

body[data-page] .crm-strip-card strong,
body[data-page] .crm-link-card strong,
body[data-page] .crm-panel-header h2,
body[data-page] .leaderboard-item strong,
body[data-page] .source-item strong,
body[data-page] .calendar-item strong,
body[data-page] .crm-meta-box strong,
body[data-page] .settings-summary-card strong,
body[data-page] .settings-check-item strong,
body[data-page] .integration-card strong,
body[data-page] .ai-summary-card strong,
body[data-page] .crm-shell th,
body[data-page="dashboard"] .crm-strip-card strong,
body[data-page="dashboard"] .crm-panel-header h2,
body[data-page="dashboard"] .crm-link-card strong,
body[data-page="dashboard"] .leaderboard-item strong,
body[data-page="dashboard"] .source-item strong {
  color: #282d53 !important;
}

body[data-page] .crm-strip-card strong {
  margin-top: 14px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.5rem, 2vw, 1.95rem) !important;
}

body[data-page] .crm-strip-card small,
body[data-page] .crm-link-card small,
body[data-page] .leaderboard-item small,
body[data-page] .source-item small,
body[data-page] .calendar-item small,
body[data-page] .calendar-item-meta,
body[data-page] .settings-summary-card small,
body[data-page] .settings-check-item small,
body[data-page] .integration-card small,
body[data-page="dashboard"] .crm-strip-card small,
body[data-page="dashboard"] .crm-link-card small,
body[data-page="dashboard"] .leaderboard-item small,
body[data-page="dashboard"] .source-item small {
  color: #959bb8 !important;
}

body[data-page] .crm-detail-panel,
body[data-page] .crm-link-card {
  padding: 22px;
}

body[data-page] .crm-panel-header {
  margin-bottom: 16px;
}

body[data-page] .crm-panel-header h2 {
  font-size: 1.15rem;
}

body[data-page] .trend-chart {
  border: 1px solid rgba(126, 115, 237, 0.08);
  border-radius: 20px;
  background: linear-gradient(180deg, #f8f7ff 0%, #fdfdff 100%);
}

body[data-page] .arrival-bar-visual,
body[data-page] .calendar-item,
body[data-page] .leaderboard-item,
body[data-page] .source-item,
body[data-page] .integration-card {
  border-radius: 18px;
  background: #f9f8ff !important;
  border: 1px solid rgba(126, 115, 237, 0.08) !important;
}

body[data-page] .arrival-bar-visual div {
  background: linear-gradient(180deg, #8f7dff 0%, #85b4ff 100%);
}

body[data-page] .crm-link-card {
  min-height: 150px;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

body[data-page] .crm-link-card:hover,
body[data-page] .calendar-item:hover,
body[data-page] .integration-card-summary:hover {
  transform: translateY(-2px);
  border-color: rgba(126, 115, 237, 0.18) !important;
  box-shadow: 0 18px 34px rgba(107, 91, 181, 0.12) !important;
}

body[data-page] .crm-table-shell,
body[data-page] .table-shell {
  overflow: hidden;
}

body[data-page] .crm-shell table {
  background: #ffffff;
}

body[data-page] .crm-shell th {
  background: #f5f2ff !important;
  color: #7f86a7 !important;
}

body[data-page] .crm-shell th,
body[data-page] .crm-shell td {
  border-bottom: 1px solid rgba(126, 115, 237, 0.08);
}

body[data-page] .crm-shell tbody tr:hover {
  background: #f7f5ff;
}

body[data-page] .crm-shell tbody tr.active {
  background: #f0edff;
}

body[data-page] .crm-meta-box {
  border-radius: 20px;
  background: linear-gradient(180deg, #f7f6ff 0%, #fcfbff 100%) !important;
}

body[data-page] .crm-payload-viewer,
body[data-page] .payload-viewer {
  border-radius: 22px;
  background: linear-gradient(180deg, #2e345c 0%, #242a4c 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body[data-page] .kanban-column,
body[data-page] .kanban-board-kommo .kanban-column {
  border-radius: 22px;
  background: linear-gradient(180deg, #f4f2ff 0%, #f8f8ff 100%);
  border: 1px solid rgba(126, 115, 237, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.64);
}

body[data-page] .kanban-column-header,
body[data-page] .kanban-board-kommo .kanban-column-header {
  border-bottom: 1px solid rgba(126, 115, 237, 0.08);
}

body[data-page] .kanban-cards,
body[data-page] .kanban-board-kommo .kanban-cards {
  background: transparent;
}

body[data-page] .kanban-card,
body[data-page] .kanban-board-kommo .kanban-card {
  border-radius: 16px;
  border: 1px solid rgba(126, 115, 237, 0.08);
  background: #ffffff;
  box-shadow: 0 10px 20px rgba(107, 91, 181, 0.06);
}

body[data-page] .kanban-card h3,
body[data-page] .kanban-board-kommo .kanban-card h3 {
  color: #4450a6;
}

body[data-page] .message-banner {
  border: 1px solid rgba(231, 90, 113, 0.14);
  border-radius: 22px;
  background: rgba(255, 245, 248, 0.96);
  color: #b1495f;
  box-shadow: 0 14px 24px rgba(191, 91, 115, 0.06);
}

body[data-page="dashboard"] .crm-main {
  padding: 6px 6px 14px !important;
}

body[data-page="dashboard"] .crm-topbar-title h1 {
  font-size: clamp(1.6rem, 3.2vw, 2.25rem) !important;
  margin: 0 !important;
}

body[data-page="dashboard"] .dashboard-stack-layout {
  gap: 16px;
  margin-top: 14px;
}

body[data-page="dashboard"] .dashboard-stack-column {
  gap: 16px;
}

body[data-page="dashboard"] .crm-link-card {
  min-height: 146px;
}

.auth-overlay {
  background: rgba(108, 96, 184, 0.18);
  backdrop-filter: blur(20px);
}

.auth-panel {
  border: 1px solid rgba(126, 115, 237, 0.12);
  border-radius: 34px;
  background: linear-gradient(180deg, rgba(252, 251, 255, 0.96), rgba(246, 245, 255, 0.98));
  box-shadow: 0 30px 72px rgba(103, 88, 183, 0.14);
}

.auth-form {
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 16px 30px rgba(103, 88, 183, 0.08);
}

@media (max-width: 1200px) {
  body[data-page] .crm-shell {
    width: min(100% - 24px, 100%);
    grid-template-columns: 236px minmax(0, 1fr);
  }

  body[data-page] .crm-topbar {
    grid-template-columns: 1fr;
  }

  body[data-page] .crm-topbar-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 900px) {
  body[data-page] .crm-shell {
    margin: 12px auto 18px;
    padding: 12px;
    border-radius: 28px;
    grid-template-columns: 1fr;
  }

  body[data-page] .crm-sidebar {
    position: relative;
    top: 0;
    height: auto;
    border-radius: 24px;
  }

  body[data-page] .crm-topbar {
    padding: 16px !important;
    border-radius: 24px;
  }

  body[data-page] .crm-topbar-actions,
  body[data-page] .crm-auth-controls {
    width: 100%;
    justify-content: stretch;
  }

  body[data-page] .crm-topbar-actions > * {
    width: 100%;
  }

  body[data-page] .crm-strip,
  body[data-page] .crm-meta-strip,
  body[data-page="dashboard"] .dashboard-stack-layout,
  body[data-page] .crm-settings-layout,
  body[data-page] .crm-dashboard-layout,
  body[data-page] .crm-workspace,
  body[data-page] .crm-detail-layout,
  body[data-page] .crm-hub-grid,
  body[data-page] .compact-hub-grid {
    grid-template-columns: 1fr;
  }
}

/* Unified system stabilization layer */
body[data-page] {
  --crm-bg-1: #f4f1ff;
  --crm-bg-2: #eef3ff;
  --crm-surface: #ffffff;
  --crm-surface-soft: #f8f7ff;
  --crm-border: rgba(126, 115, 237, 0.12);
  --crm-border-strong: rgba(126, 115, 237, 0.22);
  --crm-shadow: 0 22px 50px rgba(83, 68, 164, 0.1);
  --crm-shadow-soft: 0 12px 28px rgba(83, 68, 164, 0.08);
  --crm-text: #232846;
  --crm-text-soft: #6e7597;
  --crm-pill: #f0edff;
  background:
    radial-gradient(circle at top left, rgba(126, 115, 237, 0.18), transparent 34%),
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 28%),
    linear-gradient(180deg, var(--crm-bg-1) 0%, var(--crm-bg-2) 100%);
  color: var(--crm-text);
}

body[data-page] .crm-shell {
  width: min(calc(100% - 32px), 1720px) !important;
  min-height: calc(100vh - 32px);
  margin: 16px auto !important;
  padding: 18px !important;
  display: grid !important;
  grid-template-columns: 268px minmax(0, 1fr) !important;
  gap: 18px !important;
  border-radius: 34px !important;
  background: rgba(249, 247, 255, 0.86) !important;
  border: 1px solid rgba(255, 255, 255, 0.72) !important;
  box-shadow: 0 30px 80px rgba(67, 54, 140, 0.11) !important;
  backdrop-filter: blur(18px);
}

body[data-page] .crm-shell.is-sidebar-collapsed {
  grid-template-columns: 92px minmax(0, 1fr) !important;
}

body[data-page] .crm-sidebar {
  position: sticky !important;
  top: 0 !important;
  height: calc(100vh - 32px) !important;
  padding: 18px 16px !important;
  display: flex !important;
  flex-direction: column;
  gap: 16px;
  border-radius: 28px !important;
  background:
    radial-gradient(circle at top left, rgba(90, 205, 255, 0.18), transparent 28%),
    linear-gradient(180deg, #1a2335 0%, #1b2740 48%, #1f2740 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 22px 50px rgba(18, 24, 43, 0.34) !important;
  overflow: hidden;
}

body[data-page] .crm-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 2px 12px;
  border-bottom: 1px solid rgba(207, 220, 255, 0.12);
}

body[data-page] .crm-brand-mark {
  width: 50px;
  height: 50px;
  border-radius: 18px;
  background: linear-gradient(145deg, #1fc0d2 0%, #3293ff 100%);
  box-shadow: 0 14px 28px rgba(31, 129, 212, 0.24);
}

body[data-page] .crm-brand .eyebrow,
body[data-page] .crm-side-label,
body[data-page] .crm-side-footer small {
  color: rgba(211, 220, 255, 0.56) !important;
}

body[data-page] .crm-brand strong,
body[data-page] .crm-side-footer strong {
  color: #f7f8ff !important;
}

body[data-page] .crm-side-nav,
body[data-page] .crm-side-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

body[data-page] .crm-side-link,
body[data-page] .crm-side-sub {
  min-height: 52px !important;
  padding: 0 16px !important;
  display: flex !important;
  align-items: center;
  gap: 12px;
  border-radius: 18px !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  color: rgba(236, 241, 255, 0.74) !important;
  font-weight: 500;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

body[data-page] .crm-side-link:hover,
body[data-page] .crm-side-sub:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
  transform: translateX(1px);
}

body[data-page] .crm-side-link.active,
body[data-page] .crm-side-sub.active {
  background: linear-gradient(135deg, rgba(229, 247, 255, 0.96), rgba(194, 227, 255, 0.92)) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: #20304e !important;
  box-shadow: 0 16px 32px rgba(10, 23, 52, 0.18) !important;
}

body[data-page] .crm-nav-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 20px !important;
  height: 20px !important;
  flex: 0 0 20px !important;
  opacity: 0.96;
}

body[data-page] .crm-nav-icon .material-icons {
  font-size: 18px;
  line-height: 1;
}

body[data-page] .crm-side-footer {
  margin-top: auto;
  padding: 16px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

body[data-page] .crm-sidebar-toggle {
  align-self: flex-end;
  margin: 2px 4px 2px auto !important;
  position: relative !important;
  top: auto !important;
  right: auto !important;
}

body[data-page] .crm-shell.is-sidebar-collapsed .crm-sidebar {
  padding-inline: 12px !important;
}

body[data-page] .crm-shell.is-sidebar-collapsed .crm-side-link,
body[data-page] .crm-shell.is-sidebar-collapsed .crm-side-sub {
  justify-content: center !important;
  align-items: center !important;
  padding: 0 !important;
  gap: 0 !important;
  font-size: 0 !important;
}

body[data-page] .crm-shell.is-sidebar-collapsed .crm-side-link::before,
body[data-page] .crm-shell.is-sidebar-collapsed .crm-side-sub::before,
body[data-page] .crm-shell.is-sidebar-collapsed .crm-side-link::after,
body[data-page] .crm-shell.is-sidebar-collapsed .crm-side-sub::after {
  content: none !important;
}

body[data-page] .crm-shell.is-sidebar-collapsed .crm-nav-icon {
  margin: 0 !important;
  flex: 0 0 20px !important;
  width: 20px !important;
  height: 20px !important;
}

body[data-page] .crm-main {
  min-width: 0;
  display: flex !important;
  flex-direction: column;
  gap: 16px;
  padding: 0 !important;
}

body[data-page] .crm-topbar,
body[data-page] .crm-strip,
body[data-page] .dashboard-stack-layout,
body[data-page] .crm-settings-layout,
body[data-page] .crm-detail-layout,
body[data-page] .crm-list-panel,
body[data-page] .crm-board-panel,
body[data-page] .settings-summary-strip,
body[data-page] .message-banner {
  margin: 0 !important;
}

body[data-page] .crm-topbar {
  display: grid !important;
  grid-template-columns: minmax(280px, 1fr) auto !important;
  align-items: start !important;
  gap: 14px 16px !important;
  padding: 18px 20px !important;
  border-radius: 28px !important;
  background: rgba(255, 255, 255, 0.92) !important;
  border: 1px solid rgba(126, 115, 237, 0.08) !important;
  box-shadow: var(--crm-shadow-soft) !important;
  overflow: hidden;
}

body[data-page] .crm-topbar-title {
  display: flex !important;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  max-width: 700px;
}

body[data-page] .crm-section-pill {
  width: fit-content;
  padding: 6px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(126, 115, 237, 0.12), rgba(59, 130, 246, 0.08));
  color: #615cc9;
  letter-spacing: 0.14em;
}

body[data-page] .crm-topbar-title h1 {
  margin: 0 !important;
  font-size: clamp(1.32rem, 2vw, 1.9rem) !important;
  line-height: 1.08 !important;
  letter-spacing: -0.03em;
  color: var(--crm-text) !important;
}

body[data-page] .crm-topbar-copy,
body[data-page] .dashboard-topbar-copy {
  margin: 0 !important;
  max-width: 60ch;
  font-size: 0.95rem !important;
  line-height: 1.56 !important;
  color: var(--crm-text-soft) !important;
}

body[data-page] .crm-topbar-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  min-width: 0;
}

body[data-page] .crm-topbar-actions .crm-search {
  min-width: min(300px, 100%);
  flex: 1 1 300px;
}

body[data-page] .crm-topbar-actions .crm-select {
  min-width: 180px;
}

body[data-page] .crm-topbar-actions .button,
body[data-page] .crm-topbar-actions .crm-select,
body[data-page] .crm-topbar-actions .crm-search,
body[data-page] .crm-auth-controls > * {
  min-height: 48px;
}

body[data-page] .crm-auth-controls {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

body[data-page] .crm-user-pill,
body[data-page] .crm-live-pill {
  min-height: 44px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px !important;
  background: linear-gradient(180deg, #f7f6ff 0%, #f0f5ff 100%) !important;
  border: 1px solid rgba(126, 115, 237, 0.12) !important;
  color: #4c5778 !important;
  box-shadow: none !important;
}

body[data-page] .button {
  border-radius: 18px !important;
}

body[data-page] .crm-strip {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 14px !important;
}

body[data-page] .crm-strip-card,
body[data-page] .crm-detail-panel,
body[data-page] .crm-link-card,
body[data-page] .crm-board-panel,
body[data-page] .crm-form-panel,
body[data-page] .crm-list-panel,
body[data-page] .integration-card,
body[data-page] .leaderboard-item,
body[data-page] .source-item,
body[data-page] .calendar-item,
body[data-page] .crm-meta-box,
body[data-page] .table-shell,
body[data-page] .crm-table-shell,
body[data-page] .settings-summary-card,
body[data-page] .settings-check-item,
body[data-page] .integration-card-editor,
body[data-page] .ai-summary-card {
  border-radius: 24px !important;
  background: linear-gradient(180deg, #ffffff 0%, #fcfbff 100%) !important;
  border: 1px solid var(--crm-border) !important;
  box-shadow: var(--crm-shadow-soft) !important;
}

body[data-page] .crm-strip-card {
  min-height: 128px;
  padding: 18px !important;
}

body[data-page] .crm-detail-panel,
body[data-page] .crm-board-panel,
body[data-page] .crm-form-panel,
body[data-page] .crm-list-panel {
  padding: 18px !important;
  overflow: hidden;
}

body[data-page] .crm-panel-header {
  margin-bottom: 14px !important;
}

body[data-page] .crm-panel-header-wrap,
body[data-page] .lead-modal-header,
body[data-page] .crm-list-actions,
body[data-page] .integration-editor-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

body[data-page] .crm-panel-header-wrap {
  justify-content: space-between;
}

body[data-page] .crm-panel-header h2 {
  margin: 2px 0 0;
  font-size: 1.12rem !important;
}

body[data-page] .dashboard-stack-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.95fr) !important;
  gap: 16px !important;
  align-items: start !important;
}

body[data-page] .dashboard-stack-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

body[data-page] .crm-settings-layout,
body[data-page] .crm-detail-layout {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 16px !important;
  align-items: start !important;
}

body[data-page] .crm-board-panel {
  min-height: calc(100vh - 292px);
}

body[data-page] .kanban-board,
body[data-page] .kanban-board-kommo {
  grid-template-columns: repeat(6, minmax(300px, 1fr)) !important;
  column-gap: 28px !important;
  row-gap: 20px !important;
  align-items: start;
  padding: 0 18px 8px !important;
}

body[data-page] .kanban-column,
body[data-page] .kanban-board-kommo .kanban-column {
  min-width: 300px;
}

body[data-page] .crm-hub-grid,
body[data-page] .compact-hub-grid,
body[data-page] .settings-links,
body[data-page] .source-breakdown,
body[data-page] .leaderboard-list,
body[data-page] .calendar-list,
body[data-page] .integration-cards,
body[data-page] .settings-checklist,
body[data-page] #metaConnectionsList,
body[data-page] #userProfilesList {
  display: grid;
  gap: 12px;
}

body[data-page] .compact-hub-grid {
  grid-template-columns: 1fr !important;
}

body[data-page] .crm-link-card {
  min-height: 122px !important;
  padding: 18px !important;
}

body[data-page] .source-item,
body[data-page] .leaderboard-item,
body[data-page] .calendar-item,
body[data-page] .integration-card {
  padding: 16px 18px !important;
  min-height: auto !important;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

body[data-page] .source-item.is-selected,
body[data-page] .calendar-item.active,
body[data-page] .integration-card[data-provider]:hover {
  border-color: var(--crm-border-strong) !important;
  background: linear-gradient(180deg, #fcfbff 0%, #f5f3ff 100%) !important;
  box-shadow: 0 18px 34px rgba(97, 92, 201, 0.12) !important;
}

body[data-page] .calendar-item {
  cursor: pointer;
}

body[data-page] .calendar-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

body[data-page] .settings-summary-strip {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 12px !important;
}

body[data-page] .settings-summary-card {
  min-height: 138px;
  padding: 18px !important;
}

body[data-page] .settings-form-grid,
body[data-page] .crm-form-grid {
  gap: 14px !important;
}

body[data-page] .crm-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #6c7395;
}

body[data-page] .inline-check {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 10px !important;
  min-height: 48px;
}

body[data-page] .inline-check input {
  width: 18px;
  height: 18px;
}

body[data-page] .field-hint,
body[data-page] .muted {
  color: #8a90ae !important;
}

body[data-page] .table-shell,
body[data-page] .crm-table-shell {
  overflow: hidden !important;
}

body[data-page] .crm-shell table {
  width: 100%;
  background: #ffffff;
}

body[data-page] .crm-shell th,
body[data-page] .crm-shell td {
  padding: 14px 16px !important;
  vertical-align: middle;
}

body[data-page] .crm-shell td {
  color: #4e5679;
}

body[data-page] .crm-meta-strip {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 12px !important;
}

body[data-page] .crm-shell input,
body[data-page] .crm-shell textarea,
body[data-page] .crm-shell select {
  color: #2c3052 !important;
}

body[data-page] .crm-shell input:-webkit-autofill,
body[data-page] .crm-shell input:-webkit-autofill:hover,
body[data-page] .crm-shell input:-webkit-autofill:focus,
body[data-page] .crm-shell textarea:-webkit-autofill,
body[data-page] .crm-shell select:-webkit-autofill {
  -webkit-text-fill-color: #2c3052 !important;
  box-shadow: 0 0 0 1000px #ffffff inset !important;
}

body[data-page] .quick-lead-modal {
  padding: 18px !important;
  align-items: flex-start !important;
  background: rgba(20, 24, 44, 0.48) !important;
  backdrop-filter: blur(18px) !important;
  overflow-y: auto !important;
}

body[data-page] .lead-modal-dialog {
  width: min(1320px, 100%) !important;
  margin: 20px auto !important;
  padding: 18px !important;
  border-radius: 30px !important;
  background: linear-gradient(180deg, #fbfaff 0%, #f5f7ff 100%) !important;
  border: 1px solid rgba(126, 115, 237, 0.14) !important;
  box-shadow: 0 28px 80px rgba(18, 24, 43, 0.24) !important;
}

body[data-page] .lead-modal-header {
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(126, 115, 237, 0.08);
}

body[data-page] .lead-modal-header .integration-editor-actions {
  margin-left: auto;
}

body[data-page] .lead-modal-subtitle {
  margin: 6px 0 0;
  max-width: 62ch;
  color: #707899 !important;
}

body[data-page] .lead-modal-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr) !important;
  gap: 16px !important;
}

body[data-page] .lead-create-more {
  border: 1px solid rgba(126, 115, 237, 0.12);
  border-radius: 18px;
  padding: 12px 14px;
  background: #faf9ff;
}

body[data-page] .lead-create-more summary {
  cursor: pointer;
  color: #4d5482;
  font-weight: 600;
}

body[data-page] .lead-create-more-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.auth-overlay {
  padding: 18px;
  background: rgba(93, 85, 162, 0.2);
  backdrop-filter: blur(18px);
}

.auth-panel {
  width: min(880px, 100%) !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px) !important;
  gap: 18px;
  padding: 20px !important;
}

.auth-panel-copy {
  padding: 22px 8px 22px 8px;
}

.auth-panel-copy h2 {
  margin: 12px 0 8px;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
  color: #242948;
}

.auth-panel-copy p {
  max-width: 38ch;
  color: #6b7394;
  line-height: 1.6;
}

.auth-panel-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.auth-form {
  padding: 22px !important;
  display: flex;
  flex-direction: column;
  gap: 14px !important;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #627094;
}

.auth-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.auth-form-message,
.auth-form-help {
  margin: 0;
  line-height: 1.55;
}

@media (max-width: 1480px) {
  body[data-page] .crm-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  body[data-page] .settings-summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 1180px) {
  body[data-page] .crm-shell {
    grid-template-columns: 1fr !important;
    width: min(calc(100% - 20px), 100%) !important;
  }

  body[data-page] .crm-shell.is-sidebar-collapsed {
    grid-template-columns: 1fr !important;
  }

  body[data-page] .crm-sidebar {
    position: relative !important;
    top: auto !important;
    height: auto !important;
  }

  body[data-page] .crm-shell.is-sidebar-collapsed .crm-brand > div,
  body[data-page] .crm-shell.is-sidebar-collapsed .crm-side-label,
  body[data-page] .crm-shell.is-sidebar-collapsed .crm-side-footer {
    display: block !important;
  }

  body[data-page] .crm-shell.is-sidebar-collapsed .crm-side-link,
  body[data-page] .crm-shell.is-sidebar-collapsed .crm-side-sub {
    justify-content: flex-start;
    padding-inline: 16px !important;
  }

  body[data-page] .crm-topbar,
  body[data-page] .dashboard-stack-layout,
  body[data-page] .crm-settings-layout,
  body[data-page] .crm-detail-layout,
  body[data-page] .lead-modal-layout {
    grid-template-columns: 1fr !important;
  }

  body[data-page] .crm-topbar-actions {
    justify-content: flex-start !important;
  }

  body[data-page] .crm-board-panel {
    min-height: auto;
  }
}

@media (max-width: 760px) {
  body[data-page] .crm-shell {
    width: min(calc(100% - 12px), 100%) !important;
    margin: 6px auto !important;
    padding: 12px !important;
    border-radius: 24px !important;
  }

  body[data-page] .crm-sidebar,
  body[data-page] .crm-topbar,
  body[data-page] .crm-strip-card,
  body[data-page] .crm-detail-panel,
  body[data-page] .crm-link-card,
  body[data-page] .crm-board-panel,
  body[data-page] .crm-form-panel,
  body[data-page] .crm-list-panel,
  body[data-page] .lead-modal-dialog,
  .auth-panel,
  .auth-form {
    border-radius: 22px !important;
  }

  body[data-page] .crm-topbar,
  body[data-page] .crm-strip-card,
  body[data-page] .crm-detail-panel,
  body[data-page] .crm-link-card,
  body[data-page] .crm-board-panel,
  body[data-page] .crm-form-panel,
  body[data-page] .crm-list-panel,
  body[data-page] .lead-modal-dialog {
    padding: 16px !important;
  }

  body[data-page] .crm-strip,
  body[data-page] .settings-summary-strip,
  body[data-page] .crm-meta-strip,
  body[data-page] .lead-create-more-grid {
    grid-template-columns: 1fr !important;
  }

  body[data-page] .crm-topbar-actions > *,
  body[data-page] .crm-auth-controls,
  body[data-page] .crm-auth-controls > * {
    width: 100%;
  }

  body[data-page] .crm-topbar-actions .crm-search,
  body[data-page] .crm-topbar-actions .crm-select {
    min-width: 100%;
  }

  .auth-panel {
    grid-template-columns: 1fr !important;
    padding: 14px !important;
  }

  .auth-panel-copy,
  .auth-form {
    padding: 16px !important;
  }
}

/* Configuracoes cleanup layer */
body[data-page="configuracoes"] .crm-topbar {
  grid-template-columns: minmax(240px, 1fr) auto !important;
}

body[data-page="configuracoes"] .crm-topbar-title {
  max-width: 520px;
}

body[data-page="configuracoes"] .crm-topbar-copy {
  max-width: 34ch;
}

body[data-page="configuracoes"] .crm-main {
  gap: 14px;
}

body[data-page="configuracoes"] .crm-settings-layout {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.98fr) !important;
  gap: 14px !important;
}

body[data-page="configuracoes"] .settings-panel-compact {
  padding: 16px !important;
}

body[data-page="configuracoes"] .settings-panel-compact .crm-panel-header {
  margin-bottom: 12px !important;
}

body[data-page="configuracoes"] .settings-panel-compact .crm-panel-header h2 {
  font-size: 1.06rem !important;
}

body[data-page="configuracoes"] .integration-cards,
body[data-page="configuracoes"] #metaConnectionsList,
body[data-page="configuracoes"] #userProfilesList {
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

body[data-page="configuracoes"] .integration-card,
body[data-page="configuracoes"] .source-item,
body[data-page="configuracoes"] .settings-link-card,
body[data-page="configuracoes"] .settings-check-item {
  border-radius: 18px !important;
}

body[data-page="configuracoes"] .integration-card {
  padding: 14px 16px !important;
  gap: 4px;
}

body[data-page="configuracoes"] .integration-card strong,
body[data-page="configuracoes"] .source-item strong,
body[data-page="configuracoes"] .settings-link-card strong,
body[data-page="configuracoes"] .settings-check-item strong {
  font-size: 0.98rem !important;
}

body[data-page="configuracoes"] .integration-card small,
body[data-page="configuracoes"] .source-item small,
body[data-page="configuracoes"] .settings-link-card small,
body[data-page="configuracoes"] .settings-check-item small,
body[data-page="configuracoes"] .field-hint {
  font-size: 0.77rem !important;
  line-height: 1.45 !important;
}

body[data-page="configuracoes"] .settings-link-card small,
body[data-page="configuracoes"] .integration-card small {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body[data-page="configuracoes"] .settings-checklist {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

body[data-page="configuracoes"] .settings-check-item {
  padding: 14px 16px !important;
  min-height: auto;
}

body[data-page="configuracoes"] .settings-links,
body[data-page="configuracoes"] .source-breakdown {
  gap: 10px;
}

body[data-page="configuracoes"] .settings-link-card {
  min-height: 104px !important;
  padding: 16px !important;
}

body[data-page="configuracoes"] .settings-form-grid,
body[data-page="configuracoes"] .crm-form-grid {
  gap: 12px !important;
}

body[data-page="configuracoes"] .crm-form-grid label {
  gap: 6px;
  font-size: 0.83rem;
}

body[data-page="configuracoes"] .crm-form-grid input,
body[data-page="configuracoes"] .crm-form-grid select,
body[data-page="configuracoes"] .crm-form-grid textarea {
  min-height: 44px;
  font-size: 0.9rem;
}

body[data-page="configuracoes"] .crm-form-grid textarea {
  min-height: 84px;
}

body[data-page="configuracoes"] #integrationDefaultEndpoint,
body[data-page="configuracoes"] .settings-link-card small {
  font-size: 0.74rem !important;
}

body[data-page="configuracoes"] #integrationDefaultEndpoint {
  font-family: "IBM Plex Sans", sans-serif;
}

body[data-page="configuracoes"] .crm-topbar-actions .button,
body[data-page="configuracoes"] .integration-editor-actions .button {
  min-width: 0;
}

body[data-page="configuracoes"] .integration-editor-actions {
  justify-content: flex-end;
}

body[data-page="configuracoes"] #userManagementSection .crm-detail-panel:first-child {
  align-self: start;
}

body[data-page="configuracoes"] .message-banner {
  margin-top: 2px !important;
}

@media (max-width: 1180px) {
  body[data-page="configuracoes"] .crm-settings-layout {
    grid-template-columns: 1fr !important;
  }

  body[data-page="configuracoes"] .settings-checklist {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body[data-page="configuracoes"] .integration-editor-actions {
    justify-content: stretch;
  }

  body[data-page="configuracoes"] .integration-editor-actions .button {
    width: 100%;
  }
}

/* Responsive and menu toggle stabilization */
body[data-page] .crm-sidebar-toggle {
  width: 44px !important;
  height: 44px !important;
  padding: 0 !important;
  border-radius: 14px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: #f3f6ff !important;
  box-shadow: none !important;
}

body[data-page] .crm-sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.14) !important;
  transform: translateY(-1px);
}

body[data-page] .crm-sidebar-toggle .material-icons {
  font-size: 20px;
  line-height: 1;
  transition: transform 180ms ease;
}

body[data-page] .crm-sidebar-toggle[aria-pressed="true"] .material-icons {
  transform: scaleX(-1);
}

@media (max-width: 1180px) {
  body[data-page] .crm-sidebar-toggle {
    display: none !important;
  }

  body[data-page] .crm-main {
    gap: 14px !important;
  }

  body[data-page] .crm-topbar-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    gap: 10px !important;
  }

  body[data-page] .crm-topbar-actions .crm-search,
  body[data-page] .crm-topbar-actions .crm-auth-controls {
    grid-column: 1 / -1;
  }

  body[data-page] .crm-topbar-actions .crm-auth-controls {
    margin-left: 0;
    justify-content: flex-start;
  }

  body[data-page] .crm-topbar-actions .crm-select,
  body[data-page] .crm-topbar-actions .button,
  body[data-page] .crm-topbar-actions .crm-user-pill,
  body[data-page] .crm-topbar-actions .crm-live-pill {
    width: 100%;
  }

  body[data-page] .crm-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body[data-page] .dashboard-stack-layout,
  body[data-page] .crm-dashboard-layout,
  body[data-page] .crm-detail-layout,
  body[data-page] .crm-settings-layout,
  body[data-page] .lead-modal-layout {
    grid-template-columns: 1fr !important;
  }

  body[data-page] .crm-meta-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body[data-page] .crm-table-shell,
  body[data-page] .table-shell {
    overflow-x: auto !important;
  }

  body[data-page] .crm-shell table {
    min-width: 720px;
  }
}

@media (max-width: 760px) {
  body[data-page] .crm-shell {
    width: calc(100% - 12px) !important;
  }

  body[data-page] .crm-sidebar {
    gap: 12px;
  }

  body[data-page] .crm-brand {
    padding-bottom: 10px;
  }

  body[data-page] .crm-side-nav,
  body[data-page] .crm-side-group {
    gap: 8px;
  }

  body[data-page] .crm-side-link,
  body[data-page] .crm-side-sub {
    min-height: 48px !important;
  }

  body[data-page] .crm-topbar-title {
    max-width: none;
  }

  body[data-page] .crm-topbar-actions {
    grid-template-columns: 1fr !important;
  }

  body[data-page] .crm-topbar-actions > *,
  body[data-page] .crm-auth-controls,
  body[data-page] .crm-auth-controls > * {
    width: 100% !important;
  }

  body[data-page] .crm-strip,
  body[data-page] .crm-meta-strip,
  body[data-page] .settings-checklist,
  body[data-page] .lead-create-more-grid {
    grid-template-columns: 1fr !important;
  }

  body[data-page] .kanban-board,
  body[data-page] .kanban-board-kommo {
    overflow-x: auto;
    padding-bottom: 4px;
  }

  body[data-page] .kanban-column,
  body[data-page] .kanban-board-kommo .kanban-column {
    min-width: min(86vw, 320px);
  }

  body[data-page] .lead-modal-header .integration-editor-actions {
    width: 100%;
    margin-left: 0;
  }

  body[data-page] .crm-form-grid .form-span-2 {
    grid-column: auto !important;
  }

  body[data-page] .crm-shell table {
    min-width: 640px;
  }
}

/* Dashboard executive refresh */
body[data-page="dashboard"] .crm-main {
  gap: 16px !important;
}

body[data-page="dashboard"] .crm-topbar {
  grid-template-columns: minmax(420px, 1.2fr) minmax(460px, auto) !important;
  align-items: start !important;
  padding: 20px 22px !important;
}

body[data-page="dashboard"] .crm-topbar-title {
  max-width: 760px;
}

body[data-page="dashboard"] .crm-topbar-title h1 {
  max-width: 12ch;
  font-size: clamp(1.58rem, 2.2vw, 2.06rem) !important;
  line-height: 1.02 !important;
}

body[data-page="dashboard"] .dashboard-topbar-copy {
  max-width: 46ch;
  font-size: 0.92rem !important;
}

body[data-page="dashboard"] .crm-topbar-actions {
  max-width: 560px;
  margin-left: auto;
  display: grid !important;
  grid-template-columns: auto auto auto;
  justify-content: end !important;
  align-items: center !important;
  gap: 10px !important;
}

body[data-page="dashboard"] .crm-topbar-actions .crm-auth-controls {
  grid-column: 1 / -1;
  justify-content: flex-end;
}

body[data-page="dashboard"] .dashboard-period-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: #f4f6fb;
  border: 1px solid rgba(25, 61, 58, 0.08);
}

body[data-page="dashboard"] .dashboard-period-chip {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #728094;
  font: inherit;
  font-weight: 600;
  cursor: default;
}

body[data-page="dashboard"] .dashboard-period-chip.is-active {
  background: #ffffff;
  color: #204442;
  box-shadow: 0 10px 20px rgba(32, 68, 66, 0.08);
}

body[data-page="dashboard"] .dashboard-summary-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

body[data-page="dashboard"] .dashboard-summary-panel,
body[data-page="dashboard"] .dashboard-focus-panel,
body[data-page="dashboard"] .dashboard-traffic-panel {
  padding: 18px !important;
  border-radius: 28px !important;
}

body[data-page="dashboard"] .dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

body[data-page="dashboard"] .dashboard-kpi-grid .crm-strip-card {
  min-height: 150px;
  padding: 16px !important;
}

body[data-page="dashboard"] .dashboard-kpi-grid .crm-strip-card strong {
  font-size: clamp(1.5rem, 1.8vw, 1.95rem) !important;
}

body[data-page="dashboard"] .dashboard-kpi-grid .crm-strip-card::after,
body[data-page="dashboard"] .dashboard-traffic-grid .crm-strip-card::after {
  left: 18px;
  width: calc(100% - 36px);
  background: linear-gradient(90deg, #1e6f6c 0%, #4aa7a2 100%);
}

body[data-page="dashboard"] .dashboard-focus-panel {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 14px;
  background:
    radial-gradient(circle at top right, rgba(40, 167, 151, 0.12), transparent 34%),
    linear-gradient(180deg, #fefefe 0%, #f7fbfb 100%) !important;
}

body[data-page="dashboard"] .dashboard-focus-copy h2 {
  margin: 6px 0 8px;
  font-size: 1.45rem;
  color: #1f3342;
}

body[data-page="dashboard"] .dashboard-focus-copy p {
  margin: 0;
  color: #657287;
  line-height: 1.6;
  font-size: 0.94rem;
}

body[data-page="dashboard"] .dashboard-focus-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 0;
}

body[data-page="dashboard"] .dashboard-sync-pill {
  min-height: 44px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(35, 119, 111, 0.08);
  border: 1px solid rgba(35, 119, 111, 0.14);
  color: #246660;
  font-size: 0.9rem;
  font-weight: 600;
}

body[data-page="dashboard"] .dashboard-focus-links {
  display: grid;
  gap: 10px;
  margin-top: 2px;
}

body[data-page="dashboard"] .dashboard-action-link {
  min-height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 18px;
  background: #f3f7f8;
  border: 1px solid rgba(30, 111, 108, 0.08);
  color: #214543;
  font-weight: 600;
  text-decoration: none;
}

body[data-page="dashboard"] .dashboard-action-link::after {
  content: "->";
  color: #3f6d69;
  font-size: 0.9rem;
}

body[data-page="dashboard"] .dashboard-traffic-panel {
  background:
    linear-gradient(180deg, #ffffff 0%, #fbfcff 100%) !important;
}

body[data-page="dashboard"] .dashboard-traffic-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

body[data-page="dashboard"] .dashboard-mini-card {
  min-height: 116px !important;
  padding: 15px !important;
  border-radius: 22px !important;
  background: linear-gradient(180deg, #f9fbfb 0%, #ffffff 100%) !important;
}

body[data-page="dashboard"] .dashboard-mini-card strong {
  font-size: clamp(1.28rem, 1.8vw, 1.7rem) !important;
}

body[data-page="dashboard"] .dashboard-executive-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.52fr) minmax(300px, 0.84fr);
  gap: 16px;
  align-items: start;
}

body[data-page="dashboard"] .dashboard-stack-column {
  display: grid;
  gap: 16px;
  align-content: start;
}

body[data-page="dashboard"] .dashboard-stack-column-side {
  grid-template-rows: auto 1fr;
}

body[data-page="dashboard"] .dashboard-stack-column-side > .crm-detail-panel:last-child {
  height: 100%;
}

body[data-page="dashboard"] .trend-chart {
  min-height: 248px;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  background:
    linear-gradient(180deg, rgba(218, 240, 238, 0.42) 0%, rgba(255, 255, 255, 0.92) 100%),
    repeating-linear-gradient(
      to top,
      rgba(32, 68, 66, 0.06) 0,
      rgba(32, 68, 66, 0.06) 1px,
      transparent 1px,
      transparent 56px
    ) !important;
}

body[data-page="dashboard"] .arrival-bar {
  display: grid;
  gap: 10px;
  align-items: end;
}

body[data-page="dashboard"] .arrival-bar-visual {
  min-height: 176px;
  padding: 12px;
  display: flex;
  align-items: flex-end;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(226, 238, 239, 0.78), rgba(245, 250, 250, 0.92));
  border: 1px solid rgba(32, 68, 66, 0.08);
}

body[data-page="dashboard"] .arrival-bar-visual div {
  width: 100%;
  border-radius: 16px 16px 10px 10px;
  background: linear-gradient(180deg, #2d8d88 0%, #1d6662 100%) !important;
  box-shadow: 0 14px 28px rgba(29, 102, 98, 0.18);
}

body[data-page="dashboard"] .arrival-bar strong,
body[data-page="dashboard"] .arrival-bar span {
  text-align: center;
}

body[data-page="dashboard"] .arrival-bar strong {
  color: #203243;
}

body[data-page="dashboard"] .arrival-bar span {
  color: #7a8597;
  font-size: 0.84rem;
}

body[data-page="dashboard"] .leaderboard-list,
body[data-page="dashboard"] .source-breakdown {
  gap: 12px;
}

body[data-page="dashboard"] .leaderboard-item,
body[data-page="dashboard"] .source-item {
  padding: 16px 18px !important;
  border-radius: 18px !important;
  background: linear-gradient(180deg, #fbfdfd 0%, #ffffff 100%) !important;
}

body[data-page="dashboard"] .leaderboard-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
}

body[data-page="dashboard"] .leaderboard-item span,
body[data-page="dashboard"] .leaderboard-item small {
  grid-column: 1;
}

body[data-page="dashboard"] .leaderboard-item strong {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  justify-self: end;
  font-size: 1.1rem;
  color: #1f645f !important;
}

body[data-page="dashboard"] .source-item strong {
  font-size: 1.08rem;
}

body[data-page="dashboard"] .compact-hub-grid {
  gap: 12px;
}

body[data-page="dashboard"] .compact-hub-grid .crm-link-card {
  min-height: 104px !important;
  padding: 16px !important;
  background:
    linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%) !important;
}

@media (max-width: 1480px) {
  body[data-page="dashboard"] .crm-topbar {
    grid-template-columns: minmax(320px, 1fr) minmax(420px, auto) !important;
  }

  body[data-page="dashboard"] .dashboard-kpi-grid,
  body[data-page="dashboard"] .dashboard-traffic-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  body[data-page="dashboard"] .dashboard-summary-shell,
  body[data-page="dashboard"] .dashboard-executive-grid {
    grid-template-columns: 1fr !important;
  }

  body[data-page="dashboard"] .crm-topbar {
    grid-template-columns: 1fr !important;
  }

  body[data-page="dashboard"] .crm-topbar-actions {
    max-width: none;
    margin-left: 0;
    justify-content: start !important;
  }
}

@media (max-width: 760px) {
  body[data-page="dashboard"] .dashboard-kpi-grid,
  body[data-page="dashboard"] .dashboard-traffic-grid {
    grid-template-columns: 1fr !important;
  }

  body[data-page="dashboard"] .trend-chart {
    min-height: auto;
    padding: 14px;
    gap: 10px;
  }

  body[data-page="dashboard"] .arrival-bar-visual {
    min-height: 148px;
    padding: 10px;
  }

  body[data-page="dashboard"] .dashboard-period-group {
    width: 100%;
    justify-content: space-between;
  }

  body[data-page="dashboard"] .dashboard-period-chip {
    flex: 1 1 0;
    justify-content: center;
  }
}

/* Viewport fit stabilization */
html,
body {
  height: 100%;
}

body[data-page] {
  min-height: 100dvh;
  overflow: hidden;
}

body[data-page] .crm-shell {
  height: calc(100dvh - 32px) !important;
  min-height: 0 !important;
  max-height: calc(100dvh - 32px) !important;
  overflow: hidden !important;
}

body[data-page] .crm-sidebar {
  height: 100% !important;
  max-height: 100% !important;
}

body[data-page] .crm-main {
  min-height: 0 !important;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px !important;
}

body[data-page] .crm-topbar {
  position: sticky;
  top: 0;
  z-index: 6;
}

body[data-page] .crm-main > * {
  flex-shrink: 0;
}

body[data-page="dashboard"] .dashboard-summary-panel,
body[data-page="dashboard"] .dashboard-focus-panel,
body[data-page="dashboard"] .dashboard-traffic-panel,
body[data-page="dashboard"] .dashboard-stack-column > .crm-detail-panel {
  min-height: 0 !important;
}

body[data-page] .crm-main::-webkit-scrollbar {
  width: 10px;
}

body[data-page] .crm-main::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(104, 115, 154, 0.28);
  border: 2px solid transparent;
  background-clip: padding-box;
}

body[data-page] .crm-main::-webkit-scrollbar-track {
  background: transparent;
}

@media (max-width: 980px) {
  body[data-page] {
    overflow-x: hidden;
    overflow-y: auto;
  }

  body[data-page] .crm-shell {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  body[data-page] .crm-main {
    max-height: none;
    overflow: visible;
    padding-right: 0 !important;
  }

  body[data-page] .crm-topbar {
    position: relative;
    top: auto;
  }
}

/* Mobile drawer menu */
.crm-mobile-menu-button,
.crm-mobile-menu-backdrop {
  display: none;
}

@media (max-width: 980px) {
  body[data-page] {
    overflow-x: hidden;
  }

  body.is-mobile-menu-open {
    overflow: hidden;
  }

  body[data-page] .crm-shell {
    grid-template-columns: 1fr !important;
  }

  body[data-page] .crm-topbar {
    grid-template-columns: auto minmax(0, 1fr) !important;
    align-items: start !important;
    gap: 12px !important;
  }

  body[data-page] .crm-topbar > .crm-topbar-actions {
    grid-column: 1 / -1;
  }

  body[data-page] .crm-topbar-title {
    min-width: 0;
  }

  .crm-mobile-menu-button {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(20, 35, 63, 0.08);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 12px 24px rgba(25, 36, 71, 0.08);
    color: #1d304d;
    cursor: pointer;
  }

  .crm-mobile-menu-icon {
    position: relative;
    display: block;
    width: 18px;
    height: 12px;
  }

  .crm-mobile-menu-icon,
  .crm-mobile-menu-icon::before,
  .crm-mobile-menu-icon::after {
    border-radius: 999px;
    background: currentColor;
  }

  .crm-mobile-menu-icon::before,
  .crm-mobile-menu-icon::after {
    content: "";
    position: absolute;
    left: 0;
    width: 18px;
    height: 2px;
  }

  .crm-mobile-menu-icon {
    height: 2px;
    margin-top: 5px;
    box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor;
  }

  .crm-mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    display: block;
    border: 0;
    padding: 0;
    background: rgba(12, 16, 28, 0.56);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
    z-index: 48;
  }

  body.is-mobile-menu-open .crm-mobile-menu-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  body[data-page] .crm-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: min(86vw, 320px) !important;
    height: 100dvh !important;
    z-index: 52;
    transform: translateX(-104%);
    transition: transform 220ms ease;
    border-radius: 0 28px 28px 0 !important;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%) !important;
    border: 1px solid rgba(40, 60, 82, 0.08) !important;
    box-shadow: 0 24px 60px rgba(16, 24, 40, 0.18) !important;
    overflow-y: auto;
  }

  body.is-mobile-menu-open .crm-sidebar {
    transform: translateX(0);
  }

  body[data-page] .crm-sidebar-toggle {
    display: none !important;
  }

  body[data-page] .crm-brand {
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(37, 56, 78, 0.08);
  }

  body[data-page] .crm-brand .eyebrow,
  body[data-page] .crm-side-label,
  body[data-page] .crm-side-footer small {
    color: #8c96aa !important;
  }

  body[data-page] .crm-brand strong,
  body[data-page] .crm-side-footer strong {
    color: #21304b !important;
  }

  body[data-page] .crm-side-link,
  body[data-page] .crm-side-sub {
    color: #5e6982 !important;
    background: transparent !important;
  }

  body[data-page] .crm-side-link:hover,
  body[data-page] .crm-side-sub:hover {
    background: #f4f8fb !important;
    border-color: rgba(42, 102, 120, 0.08) !important;
    color: #213d48 !important;
  }

  body[data-page] .crm-side-link.active,
  body[data-page] .crm-side-sub.active {
    background: linear-gradient(180deg, #e4f4f7 0%, #d8eef3 100%) !important;
    color: #204442 !important;
    box-shadow: none !important;
  }

  body[data-page] .crm-side-footer {
    background: linear-gradient(180deg, #f3f7fb 0%, #eef4f9 100%);
    border: 1px solid rgba(37, 56, 78, 0.08);
  }
}

@media (max-width: 760px) {
  body[data-page] .crm-topbar {
    padding: 14px !important;
  }

  .crm-mobile-menu-button {
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }

  body[data-page] .crm-sidebar {
    width: min(88vw, 310px) !important;
  }
}

/* Final layout correction layer */
body[data-page] .crm-shell {
  width: min(calc(100vw - 24px), 1820px) !important;
  height: calc(100dvh - 24px) !important;
  max-height: calc(100dvh - 24px) !important;
  margin: 12px auto !important;
  gap: 16px !important;
}

body[data-page] .crm-main {
  gap: 14px !important;
  align-content: start;
}

body[data-page] .crm-detail-panel,
body[data-page] .crm-list-panel,
body[data-page] .crm-form-panel,
body[data-page] .crm-board-panel,
body[data-page] .dashboard-summary-panel,
body[data-page] .dashboard-focus-panel,
body[data-page] .dashboard-traffic-panel {
  height: auto !important;
  min-height: 0 !important;
}

body[data-page] .trend-chart,
body[data-page] .leaderboard-list,
body[data-page] .source-breakdown,
body[data-page] .integration-cards,
body[data-page] .settings-links,
body[data-page] .settings-checklist,
body[data-page] .calendar-list,
body[data-page] .crm-hub-grid,
body[data-page] .compact-hub-grid {
  min-height: 0 !important;
}

body[data-page="dashboard"] .crm-topbar {
  min-height: 0 !important;
}

body[data-page="dashboard"] .dashboard-summary-shell {
  grid-template-columns: 1fr !important;
  align-items: start !important;
}

body[data-page="dashboard"] .dashboard-summary-panel {
  align-self: start;
}

body[data-page="dashboard"] .dashboard-kpi-grid {
  align-items: stretch;
}

body[data-page="dashboard"] .dashboard-kpi-grid .crm-strip-card {
  min-height: 132px !important;
}

body[data-page="dashboard"] .dashboard-focus-panel {
  align-self: start;
}

body[data-page="dashboard"] .dashboard-traffic-panel {
  align-self: start;
}

body[data-page="dashboard"] .dashboard-executive-grid {
  grid-template-columns: minmax(0, 1.48fr) minmax(290px, 0.84fr) !important;
}

body[data-page="dashboard"] .dashboard-stack-column {
  align-content: start;
}

body[data-page="dashboard"] .trend-chart {
  min-height: 228px !important;
}

body[data-page="dashboard"] .arrival-bar-visual {
  min-height: 164px !important;
}

body[data-page="dashboard"] .compact-hub-grid .crm-link-card {
  min-height: 96px !important;
}

body[data-page="dashboard"] .message-banner {
  margin-bottom: 2px !important;
}

@media (max-width: 1400px) {
  body[data-page="dashboard"] .dashboard-kpi-grid,
  body[data-page="dashboard"] .dashboard-traffic-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 1180px) {
  body[data-page] .crm-shell {
    width: min(calc(100vw - 16px), 100%) !important;
    height: auto !important;
    max-height: none !important;
    margin: 8px auto !important;
  }

  body[data-page] .crm-main {
    overflow: visible !important;
  }

  body[data-page="dashboard"] .dashboard-summary-shell,
  body[data-page="dashboard"] .dashboard-executive-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 760px) {
  body[data-page] .crm-shell {
    width: calc(100vw - 10px) !important;
    margin: 5px auto !important;
    gap: 10px !important;
  }

  body[data-page] .crm-main {
    gap: 10px !important;
  }

  body[data-page="dashboard"] .dashboard-kpi-grid,
  body[data-page="dashboard"] .dashboard-traffic-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ── Geo Map Panel ─────────────────────────────────────────── */
.dashboard-geo-panel {
  margin-top: 0;
}

.dashboard-geo-panel .crm-panel-header {
  align-items: center;
}

.geo-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.geo-panel-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  align-items: start;
}

.geo-map-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  padding: 8px;
}

.geo-svg-shell {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.geo-svg {
  width: min(100%, 760px);
  max-height: 620px;
  display: block;
  overflow: visible;
}

.geo-state-shape {
  transition: fill 180ms ease, opacity 180ms ease, filter 180ms ease;
  vector-effect: non-scaling-stroke;
}

.geo-state-shape:hover {
  filter: brightness(1.04);
}

.geo-state-marker-line {
  stroke: rgba(42, 60, 88, 0.48);
  stroke-width: 0.85;
  stroke-dasharray: 1.8 1.6;
}

.geo-state-marker-bubble {
  fill: rgba(255, 255, 255, 0.94);
  stroke: rgba(40, 58, 84, 0.22);
  stroke-width: 0.8;
}

.geo-state-marker-bubble.is-active {
  fill: #1f847d;
  stroke: rgba(14, 72, 68, 0.36);
}

.geo-state-marker-count {
  fill: #5f6d84;
  font-size: 4.8px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.geo-state-marker-bubble.is-active + .geo-state-marker-count {
  fill: #ffffff;
}

.geo-state-marker-abbr {
  fill: #677892;
  font-size: 4.1px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 1.4px;
  stroke-linejoin: round;
}

.geo-svg {
  width: 100%;
  max-width: 760px;
  height: auto;
  display: block;
  overflow: visible;
}

.geo-state-path {
  stroke: rgba(7, 17, 31, 0.9);
  stroke-width: 0.7;
  transition: fill 0.3s ease, filter 0.2s ease;
  cursor: default;
}

.geo-state-group:not([data-count="0"]) .geo-state-path {
  stroke: rgba(7, 17, 31, 0.7);
}

.geo-state-group:not([data-count="0"]):hover .geo-state-path {
  filter: brightness(1.3);
  stroke: rgba(255, 255, 255, 0.5);
  stroke-width: 1;
}

.geo-state-label {
  fill: rgba(230, 234, 240, 0.85);
  font-size: 6.5px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
  letter-spacing: 0.02em;
}

.geo-state-count {
  fill: #8ef4dc;
  font-size: 6px;
  font-weight: 600;
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
}

.geo-ranking {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
}

.geo-rank-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.geo-rank-header {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.geo-rank-abbr {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--crm-accent, #59d0b2);
  min-width: 28px;
}

.geo-rank-name {
  font-size: 0.78rem;
  color: var(--crm-text, #e6eaf0);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.geo-rank-count {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--crm-text, #e6eaf0);
  white-space: nowrap;
}

.geo-rank-count small {
  font-size: 0.68rem;
  opacity: 0.6;
}

.geo-rank-bar {
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.geo-rank-bar > div {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #59d0b2, #8ef4dc);
  transition: width 0.4s ease;
}

@media (max-width: 900px) {
  .geo-panel-body {
    grid-template-columns: 1fr !important;
  }

  .geo-ranking {
    max-height: 260px;
  }
}

@media (max-width: 640px) {
  .geo-map-container {
    min-height: 240px;
    padding: 0;
  }

  .geo-svg {
    width: 100%;
  }
}

/* Dashboard density tuning */
body[data-page="dashboard"] .crm-main {
  gap: 10px !important;
}

body[data-page="dashboard"] .dashboard-summary-shell {
  grid-template-columns: 1fr !important;
  gap: 10px !important;
}

body[data-page="dashboard"] .dashboard-summary-panel,
body[data-page="dashboard"] .dashboard-focus-panel,
body[data-page="dashboard"] .dashboard-traffic-panel,
body[data-page="dashboard"] .dashboard-stack-column > .crm-detail-panel {
  padding: 14px !important;
  border-radius: 22px !important;
}

body[data-page="dashboard"] .dashboard-kpi-grid,
body[data-page="dashboard"] .dashboard-traffic-grid {
  gap: 8px !important;
}

body[data-page="dashboard"] .dashboard-kpi-grid .crm-strip-card {
  min-height: 118px !important;
  padding: 12px 13px !important;
}

body[data-page="dashboard"] .dashboard-kpi-grid .crm-strip-card strong {
  margin-top: 6px;
  font-size: clamp(1.28rem, 1.5vw, 1.72rem) !important;
}

body[data-page="dashboard"] .dashboard-kpi-grid .crm-strip-card small {
  margin-top: 4px;
}

body[data-page="dashboard"] .dashboard-traffic-panel {
  padding-top: 12px !important;
  padding-bottom: 12px !important;
}

body[data-page="dashboard"] .dashboard-traffic-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
}

body[data-page="dashboard"] .dashboard-mini-card {
  min-height: 92px !important;
  padding: 10px 12px !important;
  border-radius: 16px !important;
}

body[data-page="dashboard"] .dashboard-mini-card strong {
  margin-top: 4px;
  font-size: clamp(1.08rem, 1.4vw, 1.36rem) !important;
}

body[data-page="dashboard"] .dashboard-mini-card small {
  margin-top: 3px;
  line-height: 1.35;
}

body[data-page="dashboard"] .dashboard-executive-grid {
  grid-template-columns: minmax(0, 1.58fr) minmax(286px, 0.78fr) !important;
  gap: 10px !important;
}

body[data-page="dashboard"] .dashboard-stack-column {
  gap: 10px !important;
}

body[data-page="dashboard"] .crm-panel-header {
  margin-bottom: 10px !important;
}

body[data-page="dashboard"] .trend-chart {
  min-height: 184px !important;
  padding: 12px !important;
  gap: 8px !important;
}

body[data-page="dashboard"] .arrival-bar {
  gap: 6px !important;
}

body[data-page="dashboard"] .arrival-bar-visual {
  min-height: 120px !important;
  padding: 8px !important;
}

body[data-page="dashboard"] .leaderboard-list,
body[data-page="dashboard"] .source-breakdown,
body[data-page="dashboard"] .compact-hub-grid {
  gap: 8px !important;
}

body[data-page="dashboard"] .leaderboard-item,
body[data-page="dashboard"] .source-item,
body[data-page="dashboard"] .compact-hub-grid .crm-link-card {
  padding: 12px !important;
  border-radius: 16px !important;
}

body[data-page="dashboard"] .compact-hub-grid .crm-link-card {
  min-height: 82px !important;
}

body[data-page="dashboard"] .geo-panel-body {
  gap: 14px !important;
}

body[data-page="dashboard"] .dashboard-geo-panel {
  padding: 14px !important;
}

@media (max-width: 1400px) {
  body[data-page="dashboard"] .dashboard-traffic-grid,
  body[data-page="dashboard"] .dashboard-kpi-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 1180px) {
  body[data-page="dashboard"] .dashboard-summary-shell,
  body[data-page="dashboard"] .dashboard-executive-grid {
    grid-template-columns: 1fr !important;
  }

  body[data-page="dashboard"] .dashboard-kpi-grid,
  body[data-page="dashboard"] .dashboard-traffic-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 760px) {
  body[data-page="dashboard"] .dashboard-kpi-grid,
  body[data-page="dashboard"] .dashboard-traffic-grid {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (max-width: 560px) {
  body[data-page="dashboard"] .dashboard-kpi-grid,
  body[data-page="dashboard"] .dashboard-traffic-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Dashboard compact layout */
body[data-page="dashboard"] .dashboard-traffic-panel {
  padding: 10px 12px 12px !important;
}

body[data-page="dashboard"] .dashboard-traffic-panel .crm-panel-header {
  margin-bottom: 8px !important;
}

body[data-page="dashboard"] .dashboard-traffic-grid {
  gap: 0 !important;
  border: 1px solid rgba(46, 107, 255, 0.1);
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(180deg, #fbfcff 0%, #f7f9ff 100%);
}

body[data-page="dashboard"] .dashboard-traffic-grid .dashboard-mini-card {
  min-height: 86px !important;
  padding: 10px 12px !important;
  border: 0 !important;
  border-right: 1px solid rgba(46, 107, 255, 0.08) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

body[data-page="dashboard"] .dashboard-traffic-grid .dashboard-mini-card:last-child {
  border-right: 0 !important;
}

body[data-page="dashboard"] .dashboard-traffic-grid .dashboard-mini-card strong {
  margin-top: 2px !important;
  font-size: clamp(1rem, 1.2vw, 1.25rem) !important;
}

body[data-page="dashboard"] .dashboard-traffic-grid .dashboard-mini-card small {
  margin-top: 2px !important;
  font-size: 0.72rem;
}

body[data-page="dashboard"] .dashboard-executive-grid {
  grid-template-columns: minmax(0, 1.64fr) minmax(260px, 0.72fr) !important;
  gap: 8px !important;
}

body[data-page="dashboard"] .dashboard-stack-column-wide {
  gap: 8px !important;
}

body[data-page="dashboard"] .dashboard-stack-column-side {
  gap: 8px !important;
}

body[data-page="dashboard"] .dashboard-stack-column-wide > .crm-detail-panel,
body[data-page="dashboard"] .dashboard-stack-column-side > .crm-detail-panel {
  padding: 12px !important;
}

body[data-page="dashboard"] .dashboard-stack-column-wide .source-breakdown,
body[data-page="dashboard"] .dashboard-stack-column-side .source-breakdown,
body[data-page="dashboard"] .dashboard-stack-column-side .leaderboard-list {
  gap: 6px !important;
}

body[data-page="dashboard"] .dashboard-stack-column-wide .source-item,
body[data-page="dashboard"] .dashboard-stack-column-side .source-item,
body[data-page="dashboard"] .dashboard-stack-column-side .leaderboard-item {
  padding: 10px 12px !important;
}

body[data-page="dashboard"] .dashboard-stack-column-side .compact-hub-grid {
  gap: 6px !important;
}

body[data-page="dashboard"] .dashboard-stack-column-side .compact-hub-grid .crm-link-card {
  min-height: 74px !important;
  padding: 10px 12px !important;
}

body[data-page="dashboard"] .dashboard-stack-column-side .compact-hub-grid .crm-link-card small {
  line-height: 1.35;
}

@media (max-width: 1180px) {
  body[data-page="dashboard"] .dashboard-traffic-grid {
    gap: 6px !important;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  body[data-page="dashboard"] .dashboard-traffic-grid .dashboard-mini-card {
    border: 1px solid rgba(46, 107, 255, 0.08) !important;
    border-radius: 14px !important;
    background: #fbfcff !important;
  }
}

/* Auth overlay refresh */
body[data-auth="signed-out"] .crm-shell,
body:not([data-auth="signed-in"]) .crm-shell {
  filter: blur(9px) saturate(0.9);
  transform: scale(0.992);
  transform-origin: center;
  pointer-events: none !important;
  user-select: none !important;
}

body[data-page] .auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(66, 147, 255, 0.26), transparent 24%),
    radial-gradient(circle at bottom left, rgba(30, 95, 220, 0.2), transparent 30%),
    linear-gradient(180deg, rgba(242, 247, 255, 0.88), rgba(224, 234, 251, 0.82));
  backdrop-filter: blur(16px);
}

body[data-page] .auth-overlay::before,
body[data-page] .auth-overlay::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

body[data-page] .auth-overlay::before {
  left: -8rem;
  bottom: -8rem;
  width: 18rem;
  height: 18rem;
  background: linear-gradient(135deg, rgba(20, 91, 228, 0.9), rgba(58, 136, 255, 0.28));
}

body[data-page] .auth-overlay::after {
  right: -4rem;
  top: -4rem;
  width: 14rem;
  height: 14rem;
  background: rgba(103, 180, 255, 0.3);
}

body[data-page] .auth-panel {
  position: relative;
  z-index: 1;
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
  gap: 0;
  border: 1px solid rgba(207, 224, 255, 0.84);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 28px 70px rgba(37, 73, 138, 0.2);
  overflow: hidden;
}

body[data-page] .auth-stage {
  display: grid;
  align-content: start;
  gap: 18px;
  min-height: 100%;
  padding: 30px 32px;
  background:
    radial-gradient(circle at top left, rgba(76, 146, 255, 0.08), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
}

body[data-page] .auth-brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

body[data-page] .auth-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1d63e8 0%, #53b0ff 100%);
  color: #ffffff;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  box-shadow: 0 14px 28px rgba(29, 99, 232, 0.22);
}

body[data-page] .auth-brand-copy {
  display: grid;
  gap: 2px;
}

body[data-page] .auth-brand-copy strong {
  color: #24385e;
  font-size: 1.05rem;
  font-weight: 700;
}

body[data-page] .auth-brand-copy span {
  color: #6c7ea2;
  font-size: 0.92rem;
}

body[data-page] .auth-stage-pill {
  width: fit-content;
  min-height: 30px;
  padding-inline: 13px;
  background: #edf1ff;
  color: #5d63d4;
  border: 1px solid rgba(93, 99, 212, 0.14);
}

body[data-page] .auth-stage-hero {
  display: grid;
  gap: 10px;
  max-width: 30rem;
}

body[data-page] .auth-stage h2 {
  margin: 0;
  color: #273558;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2rem, 3.8vw, 3.3rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
}

body[data-page] .auth-stage p {
  margin: 0;
  color: #5d6f90;
  font-size: 1rem;
  line-height: 1.65;
}

body[data-page] .auth-stage-visual {
  position: relative;
  min-height: 320px;
  margin-top: 8px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(245, 249, 255, 0.92), rgba(234, 242, 255, 0.82));
  border: 1px solid rgba(81, 134, 232, 0.12);
  overflow: hidden;
}

body[data-page] .auth-visual-ring {
  position: absolute;
  border-radius: 50%;
  border: 12px solid rgba(30, 99, 232, 0.12);
}

body[data-page] .auth-visual-ring-a {
  left: -38px;
  bottom: -46px;
  width: 180px;
  height: 180px;
  border-color: rgba(30, 99, 232, 0.22);
}

body[data-page] .auth-visual-ring-b {
  right: -52px;
  top: -48px;
  width: 170px;
  height: 170px;
  border-color: rgba(83, 176, 255, 0.22);
}

body[data-page] .auth-visual-card {
  position: absolute;
  inset: 50% auto auto 50%;
  width: min(320px, calc(100% - 56px));
  height: 196px;
  transform: translate(-50%, -50%);
  border-radius: 28px;
  background: linear-gradient(135deg, #1b63e8 0%, #0d52d4 100%);
  box-shadow: 0 28px 50px rgba(18, 76, 191, 0.24);
}

body[data-page] .auth-visual-avatar {
  position: absolute;
  left: 44px;
  bottom: 48px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #d9ebff;
  box-shadow:
    0 -18px 0 -8px #d9ebff,
    16px 40px 0 14px #d9ebff;
}

body[data-page] .auth-visual-avatar-alt {
  left: auto;
  right: 44px;
  bottom: 58px;
  width: 46px;
  height: 46px;
  box-shadow:
    0 -16px 0 -8px #d9ebff,
    12px 34px 0 12px #d9ebff;
}

body[data-page] .auth-visual-lock {
  position: absolute;
  left: 50%;
  top: 54%;
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 14px 28px rgba(7, 32, 88, 0.2);
}

body[data-page] .auth-visual-lock::before {
  content: "";
  position: absolute;
  top: 22px;
  width: 28px;
  height: 22px;
  border: 5px solid #1b63e8;
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
}

body[data-page] .auth-visual-lock-body {
  width: 34px;
  height: 28px;
  border-radius: 10px;
  background: #1b63e8;
}

body[data-page] .auth-visual-chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: #ffffff;
  color: #1b63e8;
  font-size: 0.86rem;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(32, 74, 150, 0.12);
}

body[data-page] .auth-visual-chip-top {
  right: 28px;
  top: 28px;
}

body[data-page] .auth-visual-chip-bottom {
  left: 28px;
  bottom: 26px;
}

body[data-page] .auth-card {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 40px 32px;
  background: linear-gradient(180deg, #1d63e8 0%, #0f55d7 100%);
}

body[data-page] .auth-card-header {
  display: grid;
  gap: 10px;
}

body[data-page] .auth-card-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 28px;
  padding-inline: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

body[data-page] .auth-card-header h3 {
  margin: 0;
  color: #ffffff;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.8rem, 2.2vw, 2.4rem);
  letter-spacing: -0.04em;
}

body[data-page] .auth-card-header p {
  margin: 0;
  color: rgba(231, 240, 255, 0.88);
  line-height: 1.6;
}

body[data-page] .auth-field {
  display: grid;
  gap: 8px;
}

body[data-page] .auth-field > span {
  color: rgba(242, 247, 255, 0.9);
  font-size: 0.9rem;
  font-weight: 700;
}

body[data-page] .auth-form input {
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid rgba(190, 224, 255, 0.82) !important;
  border-radius: 999px;
  background: #ffffff !important;
  color: #23406b !important;
  font-weight: 600;
  -webkit-text-fill-color: #23406b;
}

body[data-page] .auth-form input::placeholder {
  color: #85a0c3;
  -webkit-text-fill-color: #85a0c3;
}

body[data-page] .auth-form input:focus {
  border-color: #ffffff !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.18);
  transform: none;
}

body[data-page] .auth-form input:-webkit-autofill,
body[data-page] .auth-form input:-webkit-autofill:hover,
body[data-page] .auth-form input:-webkit-autofill:focus,
body[data-page] .auth-form input:-webkit-autofill:active {
  -webkit-text-fill-color: #23406b !important;
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
  box-shadow: 0 0 0 1000px #ffffff inset !important;
}

body[data-page] .auth-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

body[data-page] .auth-form-actions .button {
  min-height: 48px;
  padding-inline: 22px;
  border-radius: 999px;
  font-weight: 700;
}

body[data-page] .auth-form-actions .button-primary {
  background: linear-gradient(135deg, #ffbf2f 0%, #ff9f1c 100%);
  color: #213864;
  box-shadow: 0 14px 26px rgba(10, 35, 95, 0.18);
}

body[data-page] .auth-form-actions .button-secondary {
  border-color: rgba(255, 255, 255, 0.5);
  background: transparent;
  color: #ffffff;
}

body[data-page] .auth-form-meta {
  display: grid;
  gap: 10px;
}

body[data-page] .auth-form-help,
body[data-page] .auth-form-message {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.6;
}

body[data-page] .auth-form-help {
  color: rgba(233, 241, 255, 0.84);
}

body[data-page] .auth-form-message {
  color: rgba(233, 241, 255, 0.84);
}

body[data-page] .auth-form-message[data-tone="error"] {
  color: #ffd6dc;
}

@media (max-width: 980px) {
  body[data-page] .auth-panel {
    grid-template-columns: 1fr;
    max-width: 560px;
  }

  body[data-page] .auth-stage {
    padding: 24px 24px 10px;
  }

  body[data-page] .auth-stage-visual {
    min-height: 240px;
  }

  body[data-page] .auth-card {
    padding: 28px 24px 30px;
  }
}

@media (max-width: 640px) {
  body[data-page] .auth-overlay {
    padding: 12px;
  }

  body[data-page] .auth-panel {
    border-radius: 22px;
  }

  body[data-page] .auth-stage {
    padding: 20px 20px 6px;
  }

  body[data-page] .auth-stage h2 {
    font-size: clamp(1.8rem, 10vw, 2.4rem);
  }

  body[data-page] .auth-stage-visual {
    min-height: 210px;
  }

  body[data-page] .auth-visual-card {
    width: min(260px, calc(100% - 40px));
    height: 156px;
  }

  body[data-page] .auth-visual-lock {
    width: 72px;
    height: 72px;
  }

  body[data-page] .auth-card {
    padding: 24px 20px 26px;
  }

  body[data-page] .auth-form-actions {
    flex-direction: column;
  }

  body[data-page] .auth-form-actions .button {
    width: 100%;
  }
}

/* Clean typography refresh */
:root {
  --font-ui-clean: "Manrope", sans-serif;
  --font-display-clean: "Sora", sans-serif;
}

html,
body,
button,
input,
textarea,
select,
option {
  font-family: var(--font-ui-clean) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
h5,
h6,
.page-toolbar-title,
.page-intro h1,
.hero h1,
.panel h2,
.crm-topbar-title h1,
.crm-brand strong,
.crm-brand-mark,
.crm-side-label,
.eyebrow,
.crm-section-pill,
.crm-card-value,
.dashboard-focus-copy h2,
.dashboard-kpi-grid .crm-strip-card strong,
.auth-brand-mark,
.auth-stage h2,
.auth-card-header h3,
.auth-card-badge {
  font-family: var(--font-display-clean) !important;
}

.crm-side-link,
.crm-side-sub,
.crm-side-user-info strong,
.crm-side-user-info small,
.crm-live-pill,
.auth-field > span,
.auth-form-help,
.auth-form-message,
.auth-brand-copy strong,
.auth-brand-copy span,
.dashboard-kpi-grid .crm-strip-card small {
  font-family: var(--font-ui-clean) !important;
}

/* Sidebar toggle refinement */
body[data-page] .crm-brand {
  align-items: center;
}

body[data-page] .crm-sidebar-toggle {
  margin: 0 0 0 auto !important;
  position: relative !important;
  top: auto !important;
  right: auto !important;
  flex: 0 0 auto;
  width: 40px !important;
  height: 40px !important;
  border-radius: 14px !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.08)) !important;
  color: #f6f8ff !important;
  box-shadow: 0 10px 22px rgba(11, 21, 43, 0.2) !important;
  transition:
    transform 180ms ease,
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    color 180ms ease !important;
}

body[data-page] .crm-sidebar-toggle:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1)) !important;
  border-color: rgba(255, 255, 255, 0.24) !important;
  box-shadow: 0 14px 28px rgba(11, 21, 43, 0.26) !important;
}

body[data-page] .crm-sidebar-toggle:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 4px rgba(94, 160, 255, 0.22),
    0 14px 28px rgba(11, 21, 43, 0.26) !important;
}

body[data-page] .crm-sidebar-toggle-icon {
  width: 18px !important;
  height: 18px !important;
}

body[data-page] .crm-sidebar-toggle-panel {
  inset: 1px auto 1px 0;
  width: 13px;
  border-width: 1.8px;
  border-radius: 4px;
}

body[data-page] .crm-sidebar-toggle-panel::before {
  left: 4px;
  width: 1.8px;
}

body[data-page] .crm-sidebar-toggle-arrow {
  right: -1px;
  width: 8px;
  height: 2.2px;
}

body[data-page] .crm-sidebar-toggle-arrow::before,
body[data-page] .crm-sidebar-toggle-arrow::after {
  width: 6px;
  height: 2.2px;
}

body[data-page] .crm-shell.is-sidebar-collapsed .crm-brand {
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

body[data-page] .crm-shell.is-sidebar-collapsed .crm-sidebar-toggle {
  margin: 0 !important;
}

/* ============================================================
   DASHBOARD PREMIUM — bloco de melhorias visuais
   Todos os seletores são scoped em body[data-page="dashboard"]
   para garantir zero impacto nas outras páginas.
   ============================================================ */

/* --- Keyframes -------------------------------------------- */
@keyframes bar-grow {
  from { transform: scaleY(0); transform-origin: bottom; }
  to   { transform: scaleY(1); transform-origin: bottom; }
}

@keyframes card-enter {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.55; }
  50%       { opacity: 1; }
}

/* --- Orbs ambiente ---------------------------------------- */
body[data-page="dashboard"] .dashboard-ambient-orb {
  position: fixed;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(90px);
  z-index: 0;
}

body[data-page="dashboard"] .dashboard-ambient-orb-a {
  width: 520px;
  height: 520px;
  top: -140px;
  right: -80px;
  background: radial-gradient(circle, rgba(89, 208, 178, 0.13), transparent 60%);
  animation: glow-pulse 8s ease-in-out infinite;
}

body[data-page="dashboard"] .dashboard-ambient-orb-b {
  width: 400px;
  height: 400px;
  bottom: 8%;
  left: 12%;
  background: radial-gradient(circle, rgba(255, 184, 77, 0.09), transparent 60%);
  animation: glow-pulse 10s ease-in-out infinite 3s;
}

/* --- Entradas escalonadas de seção ----------------------- */
body[data-page="dashboard"] .dashboard-summary-shell {
  animation: card-enter 540ms ease both;
  animation-delay: 40ms;
}

body[data-page="dashboard"] .dashboard-traffic-panel {
  animation: card-enter 540ms ease both;
  animation-delay: 100ms;
}

body[data-page="dashboard"] .dashboard-executive-grid {
  animation: card-enter 540ms ease both;
  animation-delay: 160ms;
}

body[data-page="dashboard"] .dashboard-geo-panel {
  animation: card-enter 540ms ease both;
  animation-delay: 220ms;
}

/* --- KPI Cards -------------------------------------------- */
body[data-page="dashboard"] .dashboard-kpi-grid .crm-strip-card {
  transition: transform 200ms ease, box-shadow 200ms ease;
  animation: card-enter 480ms ease both;
}

body[data-page="dashboard"] .dashboard-kpi-grid .crm-strip-card:nth-child(1) { animation-delay: 60ms; }
body[data-page="dashboard"] .dashboard-kpi-grid .crm-strip-card:nth-child(2) { animation-delay: 120ms; }
body[data-page="dashboard"] .dashboard-kpi-grid .crm-strip-card:nth-child(3) { animation-delay: 180ms; }
body[data-page="dashboard"] .dashboard-kpi-grid .crm-strip-card:nth-child(4) { animation-delay: 240ms; }
body[data-page="dashboard"] .dashboard-kpi-grid .crm-strip-card:nth-child(5) { animation-delay: 300ms; }

body[data-page="dashboard"] .dashboard-kpi-grid .crm-strip-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 28px 56px rgba(2, 6, 23, 0.4), 0 0 0 1px rgba(125, 211, 252, 0.14) !important;
}

/* Número principal — maior e mais impactante */
body[data-page="dashboard"] .dashboard-kpi-grid .crm-strip-card strong {
  font-size: clamp(1.65rem, 2.1vw, 2.2rem) !important;
  letter-spacing: -0.05em !important;
  line-height: 1 !important;
  margin-top: 10px !important;
}

/* Label — micro-texto uppercase */
body[data-page="dashboard"] .dashboard-kpi-grid .crm-strip-card > span:first-child {
  font-size: 0.7rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  color: #4a6a8a !important;
}

/* Top accent line pulsante por métrica */
body[data-page="dashboard"] .crm-strip-card[data-kpi="leads"]::after {
  background: linear-gradient(90deg, #59d0b2 0%, rgba(89, 208, 178, 0.2) 100%) !important;
  animation: glow-pulse 3.5s ease infinite !important;
  opacity: 1 !important;
}
body[data-page="dashboard"] .crm-strip-card[data-kpi="attended"]::after {
  background: linear-gradient(90deg, #34d399 0%, rgba(52, 211, 153, 0.2) 100%) !important;
  animation: glow-pulse 3.5s ease infinite 0.6s !important;
  opacity: 1 !important;
}
body[data-page="dashboard"] .crm-strip-card[data-kpi="response"]::after {
  background: linear-gradient(90deg, #7fd2ff 0%, rgba(127, 210, 255, 0.2) 100%) !important;
  animation: glow-pulse 3.5s ease infinite 1.2s !important;
  opacity: 1 !important;
}
body[data-page="dashboard"] .crm-strip-card[data-kpi="clients"]::after {
  background: linear-gradient(90deg, #a3e635 0%, rgba(163, 230, 53, 0.2) 100%) !important;
  animation: glow-pulse 3.5s ease infinite 1.8s !important;
  opacity: 1 !important;
}
body[data-page="dashboard"] .crm-strip-card[data-kpi="pipeline"]::after {
  background: linear-gradient(90deg, #ffb84d 0%, rgba(255, 184, 77, 0.2) 100%) !important;
  animation: glow-pulse 3.5s ease infinite 2.4s !important;
  opacity: 1 !important;
}

/* Número colorido por métrica */
body[data-page="dashboard"] .crm-strip-card[data-kpi="leads"] strong,
body[data-page="dashboard"] .crm-strip-card[data-kpi="attended"] strong {
  color: #59d0b2 !important;
}
body[data-page="dashboard"] .crm-strip-card[data-kpi="response"] strong {
  color: #7fd2ff !important;
}
body[data-page="dashboard"] .crm-strip-card[data-kpi="clients"] strong {
  color: #a3e635 !important;
}
body[data-page="dashboard"] .crm-strip-card[data-kpi="pipeline"] strong {
  color: #ffb84d !important;
}

/* --- Traffic Panel mini-cards ----------------------------- */
body[data-page="dashboard"] .dashboard-traffic-grid .dashboard-mini-card {
  animation: card-enter 420ms ease both;
}
body[data-page="dashboard"] .dashboard-traffic-grid .dashboard-mini-card:nth-child(1) { animation-delay: 160ms; border-top: 2px solid rgba(127, 210, 255, 0.55) !important; }
body[data-page="dashboard"] .dashboard-traffic-grid .dashboard-mini-card:nth-child(2) { animation-delay: 200ms; border-top: 2px solid rgba(127, 210, 255, 0.35) !important; }
body[data-page="dashboard"] .dashboard-traffic-grid .dashboard-mini-card:nth-child(3) { animation-delay: 240ms; border-top: 2px solid rgba(89, 208, 178, 0.55) !important; }
body[data-page="dashboard"] .dashboard-traffic-grid .dashboard-mini-card:nth-child(4) { animation-delay: 280ms; border-top: 2px solid rgba(255, 184, 77, 0.6) !important; }
body[data-page="dashboard"] .dashboard-traffic-grid .dashboard-mini-card:nth-child(5) { animation-delay: 320ms; border-top: 2px solid rgba(163, 230, 53, 0.5) !important; }

body[data-page="dashboard"] .dashboard-traffic-grid .dashboard-mini-card:nth-child(1) strong,
body[data-page="dashboard"] .dashboard-traffic-grid .dashboard-mini-card:nth-child(2) strong { color: #7fd2ff !important; }
body[data-page="dashboard"] .dashboard-traffic-grid .dashboard-mini-card:nth-child(3) strong { color: #59d0b2 !important; }
body[data-page="dashboard"] .dashboard-traffic-grid .dashboard-mini-card:nth-child(4) strong { color: #ffb84d !important; }
body[data-page="dashboard"] .dashboard-traffic-grid .dashboard-mini-card:nth-child(5) strong { color: #a3e635 !important; }

/* --- Gráfico de chegadas de leads ------------------------- */
body[data-page="dashboard"] .trend-chart {
  background:
    repeating-linear-gradient(
      to top,
      rgba(125, 211, 252, 0.04) 0,
      rgba(125, 211, 252, 0.04) 1px,
      transparent 1px,
      transparent 25%
    ) !important;
  border-radius: 18px !important;
  padding: 16px 12px 12px !important;
}

body[data-page="dashboard"] .arrival-bar-visual {
  background: rgba(125, 211, 252, 0.05) !important;
  border-color: rgba(125, 211, 252, 0.09) !important;
  border-radius: 14px !important;
  overflow: hidden !important;
}

body[data-page="dashboard"] .arrival-bar-visual div {
  background: linear-gradient(180deg, #59d0b2 0%, rgba(89, 208, 178, 0.32) 100%) !important;
  box-shadow: 0 0 18px rgba(89, 208, 178, 0.25), inset 0 1px 0 rgba(255,255,255,0.12) !important;
  border-radius: 10px 10px 6px 6px !important;
  transform-origin: bottom;
  animation: bar-grow 600ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

body[data-page="dashboard"] .arrival-bar:nth-child(1) .arrival-bar-visual div { animation-delay: 80ms; }
body[data-page="dashboard"] .arrival-bar:nth-child(2) .arrival-bar-visual div { animation-delay: 140ms; }
body[data-page="dashboard"] .arrival-bar:nth-child(3) .arrival-bar-visual div { animation-delay: 200ms; }
body[data-page="dashboard"] .arrival-bar:nth-child(4) .arrival-bar-visual div { animation-delay: 260ms; }
body[data-page="dashboard"] .arrival-bar:nth-child(5) .arrival-bar-visual div { animation-delay: 320ms; }
body[data-page="dashboard"] .arrival-bar:nth-child(6) .arrival-bar-visual div { animation-delay: 380ms; }
body[data-page="dashboard"] .arrival-bar:nth-child(7) .arrival-bar-visual div { animation-delay: 440ms; }

/* Última barra (hoje) = destaque dourado */
body[data-page="dashboard"] .arrival-bar:last-child .arrival-bar-visual div {
  background: linear-gradient(180deg, #ffb84d 0%, rgba(255, 184, 77, 0.38) 100%) !important;
  box-shadow: 0 0 20px rgba(255, 184, 77, 0.32), inset 0 1px 0 rgba(255,255,255,0.1) !important;
}

body[data-page="dashboard"] .arrival-bar:hover .arrival-bar-visual div {
  box-shadow: 0 0 28px rgba(89, 208, 178, 0.48), inset 0 1px 0 rgba(255,255,255,0.18) !important;
}

body[data-page="dashboard"] .arrival-bar strong {
  color: #c8e8ff !important;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em !important;
}

body[data-page="dashboard"] .arrival-bar span {
  color: #4a6a8a !important;
  font-size: 0.7rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
}

/* --- Source / Campaign Breakdown — fill bar --------------- */
body[data-page="dashboard"] .dashboard-stack-column-wide .source-item {
  position: relative !important;
  overflow: hidden !important;
}

body[data-page="dashboard"] .dashboard-stack-column-wide .source-item::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--fill-pct, 0%);
  background: linear-gradient(90deg, rgba(89, 208, 178, 0.11) 0%, rgba(89, 208, 178, 0.03) 100%);
  border-right: 1px solid rgba(89, 208, 178, 0.14);
  pointer-events: none;
  transition: width 700ms cubic-bezier(0.34, 1.06, 0.64, 1);
}

body[data-page="dashboard"] #campaignBreakdown .source-item::before {
  background: linear-gradient(90deg, rgba(255, 184, 77, 0.1) 0%, rgba(255, 184, 77, 0.02) 100%);
  border-right-color: rgba(255, 184, 77, 0.16);
}

body[data-page="dashboard"] .dashboard-stack-column-wide .source-item > strong {
  color: #59d0b2 !important;
}

body[data-page="dashboard"] #campaignBreakdown .source-item > strong {
  color: #ffb84d !important;
}

/* --- SDR Leaderboard — rank badges e barra de SLA --------- */
body[data-page="dashboard"] .leaderboard-item .sdr-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  margin-right: 6px;
}

body[data-page="dashboard"] .leaderboard-item[data-rank="1"] .sdr-rank {
  background: linear-gradient(135deg, #ffd700, #ffb84d);
  color: #1a1200;
  box-shadow: 0 0 10px rgba(255, 184, 77, 0.5);
}
body[data-page="dashboard"] .leaderboard-item[data-rank="2"] .sdr-rank {
  background: linear-gradient(135deg, #c0c8d8, #8fa0b8);
  color: #0d1828;
}
body[data-page="dashboard"] .leaderboard-item[data-rank="3"] .sdr-rank {
  background: linear-gradient(135deg, #cd7f32, #a0522d);
  color: #f8f0e8;
}
body[data-page="dashboard"] .leaderboard-item[data-rank="4"] .sdr-rank,
body[data-page="dashboard"] .leaderboard-item[data-rank="5"] .sdr-rank,
body[data-page="dashboard"] .leaderboard-item[data-rank="6"] .sdr-rank,
body[data-page="dashboard"] .leaderboard-item[data-rank="7"] .sdr-rank,
body[data-page="dashboard"] .leaderboard-item[data-rank="8"] .sdr-rank {
  background: rgba(125, 211, 252, 0.08);
  border: 1px solid rgba(125, 211, 252, 0.16);
  color: #6a90b8;
}

body[data-page="dashboard"] .leaderboard-item .sdr-name-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

body[data-page="dashboard"] .leaderboard-item .sdr-bar-track {
  grid-column: 1 / -1;
  height: 3px;
  background: rgba(125, 211, 252, 0.07);
  border-radius: 999px;
  margin-top: 4px;
  overflow: hidden;
}

body[data-page="dashboard"] .leaderboard-item .sdr-bar-fill {
  height: 100%;
  width: var(--sla-pct, 50%);
  background: linear-gradient(90deg, #59d0b2, #34d399);
  border-radius: 999px;
  transition: width 800ms cubic-bezier(0.34, 1.06, 0.64, 1);
}

body[data-page="dashboard"] .leaderboard-item[data-slow="true"] .sdr-bar-fill {
  background: linear-gradient(90deg, #ff7e7e, #f43f5e);
}

/* --- VISÃO GERAL — KPI icon indicators -------------------- */
body[data-page="dashboard"] .dashboard-kpi-grid .crm-strip-card::before {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 800;
  margin-bottom: 4px;
}

body[data-page="dashboard"] .crm-strip-card[data-kpi="leads"]::before {
  content: "↓";
  background: rgba(89, 208, 178, 0.12);
  color: #59d0b2;
  border: 1px solid rgba(89, 208, 178, 0.18);
}
body[data-page="dashboard"] .crm-strip-card[data-kpi="attended"]::before {
  content: "✓";
  background: rgba(52, 211, 153, 0.12);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.18);
}
body[data-page="dashboard"] .crm-strip-card[data-kpi="response"]::before {
  content: "◷";
  background: rgba(127, 210, 255, 0.12);
  color: #7fd2ff;
  border: 1px solid rgba(127, 210, 255, 0.18);
}
body[data-page="dashboard"] .crm-strip-card[data-kpi="clients"]::before {
  content: "★";
  background: rgba(163, 230, 53, 0.12);
  color: #a3e635;
  border: 1px solid rgba(163, 230, 53, 0.18);
}
body[data-page="dashboard"] .crm-strip-card[data-kpi="pipeline"]::before {
  content: "$";
  background: rgba(255, 184, 77, 0.12);
  color: #ffb84d;
  border: 1px solid rgba(255, 184, 77, 0.18);
}

/* --- VISÃO GERAL — Focus panel refinement ----------------- */
body[data-page="dashboard"] .dashboard-focus-panel {
  border: 1px solid rgba(35, 119, 111, 0.1) !important;
  box-shadow:
    0 16px 40px rgba(35, 119, 111, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
  position: relative;
  overflow: hidden;
}

body[data-page="dashboard"] .dashboard-focus-panel::before {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(89, 208, 178, 0.14), transparent 65%);
  pointer-events: none;
}

body[data-page="dashboard"] .dashboard-focus-copy h2 {
  font-family: "Sora", "Space Grotesk", sans-serif !important;
  font-size: 1.5rem !important;
  font-weight: 800 !important;
  background: linear-gradient(135deg, #1a3d3a 0%, #2d8d88 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body[data-page="dashboard"] .dashboard-focus-copy .eyebrow {
  color: #2d8d88 !important;
  font-size: 0.68rem !important;
  letter-spacing: 0.18em !important;
}

/* Sync pill — animated dot */
body[data-page="dashboard"] .dashboard-sync-pill {
  position: relative !important;
  padding-left: 32px !important;
  font-size: 0.82rem !important;
  min-height: 38px !important;
  border-radius: 12px !important;
  background: rgba(35, 119, 111, 0.06) !important;
  border: 1px solid rgba(35, 119, 111, 0.1) !important;
}

body[data-page="dashboard"] .dashboard-sync-pill::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.6);
  animation: glow-pulse 2s ease-in-out infinite;
}

/* Action links — refined with arrow icon */
body[data-page="dashboard"] .dashboard-action-link {
  border-radius: 14px !important;
  background: rgba(35, 119, 111, 0.04) !important;
  border: 1px solid rgba(35, 119, 111, 0.07) !important;
  font-size: 0.88rem !important;
  min-height: 44px !important;
  padding: 0 14px !important;
  transition: all 180ms ease !important;
  color: #1a3d3a !important;
}

body[data-page="dashboard"] .dashboard-action-link:hover {
  background: rgba(35, 119, 111, 0.09) !important;
  border-color: rgba(35, 119, 111, 0.16) !important;
  transform: translateX(3px);
}

body[data-page="dashboard"] .dashboard-action-link::after {
  content: "→" !important;
  font-size: 1rem !important;
  color: #2d8d88 !important;
  transition: transform 180ms ease;
}

body[data-page="dashboard"] .dashboard-action-link:hover::after {
  transform: translateX(3px);
}

/* --- MÍDIA PAGA — enhanced layout ------------------------- */
body[data-page="dashboard"] .dashboard-traffic-panel {
  border: 1px solid rgba(127, 210, 255, 0.1) !important;
  box-shadow: 0 16px 40px rgba(46, 107, 255, 0.05) !important;
  position: relative !important;
  overflow: hidden !important;
}

body[data-page="dashboard"] .dashboard-traffic-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg,
    rgba(127, 210, 255, 0.5) 0%,
    rgba(89, 208, 178, 0.5) 30%,
    rgba(255, 184, 77, 0.5) 65%,
    rgba(163, 230, 53, 0.4) 100%
  );
  border-radius: 3px 3px 0 0;
}

body[data-page="dashboard"] .dashboard-traffic-panel > .crm-panel-header .eyebrow {
  color: #5a8fc8 !important;
}

body[data-page="dashboard"] .dashboard-traffic-panel > .crm-panel-header h2 {
  font-family: "Sora", "Space Grotesk", sans-serif !important;
  font-weight: 700 !important;
}

/* Mini-cards — hover + transitions */
body[data-page="dashboard"] .dashboard-mini-card {
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease !important;
  position: relative !important;
}

body[data-page="dashboard"] .dashboard-mini-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 18px 36px rgba(46, 107, 255, 0.1) !important;
}

body[data-page="dashboard"] .dashboard-mini-card > span {
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  color: #7a8ca0 !important;
}

body[data-page="dashboard"] .dashboard-mini-card > small {
  font-size: 0.72rem !important;
  color: #8fa0b8 !important;
  line-height: 1.4 !important;
}

/* --- ATALHOS — layout e estilo refinados ------------------- */
body[data-page="dashboard"] .compact-hub-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 10px !important;
}

body[data-page="dashboard"] .compact-hub-grid .crm-link-card {
  padding: 16px !important;
  border-radius: 18px !important;
  border: 1px solid rgba(46, 107, 255, 0.08) !important;
  background: linear-gradient(180deg, #fcfdff 0%, #f8faff 100%) !important;
  box-shadow: 0 8px 20px rgba(46, 107, 255, 0.05) !important;
  transition: all 220ms ease !important;
  position: relative !important;
  overflow: hidden !important;
}

body[data-page="dashboard"] .compact-hub-grid .crm-link-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  border-radius: 3px 0 0 3px;
  transition: opacity 200ms ease;
}

body[data-page="dashboard"] .crm-link-card[data-shortcut="pipeline"]::before {
  background: linear-gradient(180deg, #59d0b2, #2d8d88);
  opacity: 0.7;
}
body[data-page="dashboard"] .crm-link-card[data-shortcut="leads"]::before {
  background: linear-gradient(180deg, #7fd2ff, #4e9fc8);
  opacity: 0.7;
}
body[data-page="dashboard"] .crm-link-card[data-shortcut="config"]::before {
  background: linear-gradient(180deg, #ffb84d, #e0963a);
  opacity: 0.7;
}

body[data-page="dashboard"] .compact-hub-grid .crm-link-card:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 18px 36px rgba(46, 107, 255, 0.1) !important;
  border-color: rgba(46, 107, 255, 0.14) !important;
}

body[data-page="dashboard"] .compact-hub-grid .crm-link-card:hover::before {
  opacity: 1;
}

body[data-page="dashboard"] .compact-hub-grid .crm-link-card .eyebrow {
  font-size: 0.62rem !important;
  letter-spacing: 0.16em !important;
  margin-bottom: 4px !important;
}

body[data-page="dashboard"] .crm-link-card[data-shortcut="pipeline"] .eyebrow { color: #2d8d88 !important; }
body[data-page="dashboard"] .crm-link-card[data-shortcut="leads"] .eyebrow { color: #4e9fc8 !important; }
body[data-page="dashboard"] .crm-link-card[data-shortcut="config"] .eyebrow { color: #c07b1e !important; }

body[data-page="dashboard"] .compact-hub-grid .crm-link-card strong {
  font-size: 1rem !important;
  font-weight: 700 !important;
  color: #16325c !important;
}

body[data-page="dashboard"] .compact-hub-grid .crm-link-card small {
  font-size: 0.76rem !important;
  color: #7a8ea8 !important;
  line-height: 1.45 !important;
}

/* --- ENTRADA COMERCIAL — chart container polish ------------ */
body[data-page="dashboard"] .dashboard-executive-grid .crm-detail-panel {
  border: 1px solid rgba(46, 107, 255, 0.08) !important;
  box-shadow: 0 10px 28px rgba(46, 107, 255, 0.05) !important;
  transition: box-shadow 200ms ease !important;
}

body[data-page="dashboard"] .dashboard-executive-grid .crm-detail-panel:hover {
  box-shadow: 0 16px 40px rgba(46, 107, 255, 0.08) !important;
}

body[data-page="dashboard"] .dashboard-executive-grid .crm-panel-header .eyebrow {
  font-size: 0.65rem !important;
  letter-spacing: 0.18em !important;
}

body[data-page="dashboard"] .dashboard-stack-column-wide > .crm-detail-panel:first-child .eyebrow {
  color: #2d8d88 !important;
}

body[data-page="dashboard"] .dashboard-stack-column-wide > .crm-detail-panel:nth-child(2) .eyebrow {
  color: #4e9fc8 !important;
}

body[data-page="dashboard"] .dashboard-stack-column-wide > .crm-detail-panel:nth-child(3) .eyebrow {
  color: #c07b1e !important;
}

body[data-page="dashboard"] .dashboard-executive-grid .crm-panel-header h2 {
  font-family: "Sora", "Space Grotesk", sans-serif !important;
  font-weight: 700 !important;
  font-size: 1.05rem !important;
}

/* Chart — enhanced bar container */
body[data-page="dashboard"] .trend-chart {
  min-height: 260px !important;
  background:
    linear-gradient(180deg, rgba(218, 240, 238, 0.35) 0%, rgba(255, 255, 255, 0.9) 100%),
    repeating-linear-gradient(
      to top,
      rgba(45, 141, 136, 0.06) 0,
      rgba(45, 141, 136, 0.06) 1px,
      transparent 1px,
      transparent 25%
    ) !important;
  border-radius: 20px !important;
  border: 1px solid rgba(45, 141, 136, 0.06);
}

body[data-page="dashboard"] .arrival-bar-visual {
  background: linear-gradient(180deg, rgba(226, 238, 239, 0.7), rgba(245, 250, 250, 0.85)) !important;
  border: 1px solid rgba(45, 141, 136, 0.08) !important;
  border-radius: 18px !important;
  transition: border-color 180ms ease !important;
}

body[data-page="dashboard"] .arrival-bar:hover .arrival-bar-visual {
  border-color: rgba(45, 141, 136, 0.18) !important;
}

body[data-page="dashboard"] .arrival-bar-visual div {
  background: linear-gradient(180deg, #2d8d88 0%, #1d6662 100%) !important;
  box-shadow: 0 10px 24px rgba(29, 102, 98, 0.2) !important;
  border-radius: 14px 14px 8px 8px !important;
}

/* Today bar — gold highlight */
body[data-page="dashboard"] .arrival-bar:last-child .arrival-bar-visual div {
  background: linear-gradient(180deg, #e8a33e 0%, #c47e24 100%) !important;
  box-shadow: 0 10px 24px rgba(232, 163, 62, 0.22) !important;
}

body[data-page="dashboard"] .arrival-bar strong {
  color: #1a3d3a !important;
  font-size: 0.88rem !important;
  font-weight: 800 !important;
}

body[data-page="dashboard"] .arrival-bar span {
  color: #7a8ea8 !important;
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
}

/* --- Panel header — subtle section divider line ------------ */
body[data-page="dashboard"] .dashboard-executive-grid .crm-panel-header {
  padding-bottom: 12px !important;
  margin-bottom: 14px !important;
  border-bottom: 1px solid rgba(46, 107, 255, 0.06) !important;
}

/* --- Source/breakdown items — polish ----------------------- */
body[data-page="dashboard"] .source-item,
body[data-page="dashboard"] .leaderboard-item {
  border-radius: 14px !important;
  transition: all 180ms ease !important;
}

body[data-page="dashboard"] .source-item:hover,
body[data-page="dashboard"] .leaderboard-item:hover {
  background: rgba(45, 141, 136, 0.04) !important;
  border-color: rgba(45, 141, 136, 0.12) !important;
}

/* ============================================================
   FIM DO BLOCO DASHBOARD PREMIUM
   ============================================================ */

/* Dashboard color standardization */
body[data-page="dashboard"] {
  --dashboard-bg: #edf3f7;
  --dashboard-surface: rgba(255, 255, 255, 0.94);
  --dashboard-surface-strong: #ffffff;
  --dashboard-surface-soft: #f5f9fb;
  --dashboard-border: rgba(20, 50, 76, 0.1);
  --dashboard-border-strong: rgba(31, 143, 131, 0.18);
  --dashboard-text: #17324d;
  --dashboard-muted: #70849a;
  --dashboard-primary: #1f8f83;
  --dashboard-primary-deep: #176861;
  --dashboard-primary-soft: rgba(31, 143, 131, 0.12);
  --dashboard-secondary: #4a84f0;
  --dashboard-secondary-soft: rgba(74, 132, 240, 0.12);
  --dashboard-warm: #d79a3b;
  --dashboard-warm-soft: rgba(215, 154, 59, 0.16);
  --dashboard-success: #49a971;
  --dashboard-shadow: 0 18px 42px rgba(16, 46, 77, 0.08);
  background:
    radial-gradient(circle at top right, rgba(31, 143, 131, 0.1), transparent 28%),
    radial-gradient(circle at left 18%, rgba(74, 132, 240, 0.08), transparent 24%),
    linear-gradient(180deg, #f5f8fb 0%, #ebf2f7 100%) !important;
  color: var(--dashboard-text) !important;
}

body[data-page="dashboard"] .dashboard-ambient-orb-a {
  background: radial-gradient(circle, rgba(31, 143, 131, 0.12), transparent 62%) !important;
}

body[data-page="dashboard"] .dashboard-ambient-orb-b {
  background: radial-gradient(circle, rgba(74, 132, 240, 0.08), transparent 62%) !important;
}

body[data-page="dashboard"] .crm-sidebar {
  background:
    radial-gradient(circle at top left, rgba(90, 205, 255, 0.18), transparent 28%),
    linear-gradient(180deg, #1a2335 0%, #1b2740 48%, #1f2740 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 22px 50px rgba(18, 24, 43, 0.34) !important;
}

body[data-page="dashboard"] .crm-brand-mark {
  background: linear-gradient(145deg, #1fc0d2 0%, #3293ff 100%) !important;
  box-shadow: 0 14px 28px rgba(31, 129, 212, 0.24) !important;
}

body[data-page="dashboard"] .crm-side-label {
  color: rgba(211, 220, 255, 0.56) !important;
}

body[data-page="dashboard"] .crm-side-link,
body[data-page="dashboard"] .crm-side-sub {
  border: 1px solid transparent !important;
  background: transparent !important;
  color: rgba(236, 241, 255, 0.74) !important;
}

body[data-page="dashboard"] .crm-side-link:hover,
body[data-page="dashboard"] .crm-side-sub:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
}

body[data-page="dashboard"] .crm-side-link.active,
body[data-page="dashboard"] .crm-side-sub.active {
  background: linear-gradient(135deg, rgba(229, 247, 255, 0.96), rgba(194, 227, 255, 0.92)) !important;
  color: #20304e !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  box-shadow: 0 16px 32px rgba(10, 23, 52, 0.18) !important;
}

body[data-page="dashboard"] .crm-side-footer {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04)) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}

body[data-page="dashboard"] .crm-side-user-avatar {
  background: linear-gradient(135deg, #59d0b2, #8ef4dc) !important;
  color: #07111f !important;
}

body[data-page="dashboard"] .crm-main {
  position: relative;
  padding: 24px 24px 32px !important;
  display: grid;
  gap: 18px !important;
}

body[data-page="dashboard"] .crm-topbar {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: start !important;
  gap: 18px !important;
  padding: 22px 24px !important;
  border: 1px solid var(--dashboard-border) !important;
  border-radius: 28px !important;
  background:
    linear-gradient(135deg, rgba(31, 143, 131, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 252, 0.96)) !important;
  box-shadow: var(--dashboard-shadow) !important;
}

body[data-page="dashboard"] .crm-topbar-title {
  display: grid;
  gap: 10px;
  max-width: 56ch !important;
}

body[data-page="dashboard"] .crm-section-pill {
  width: fit-content;
  background: var(--dashboard-primary-soft) !important;
  color: var(--dashboard-primary-deep) !important;
}

body[data-page="dashboard"] .crm-topbar-title h1 {
  max-width: none !important;
  margin: 0 !important;
  font-family: "Sora", "Space Grotesk", sans-serif !important;
  font-size: clamp(1.9rem, 3vw, 2.75rem) !important;
  line-height: 1.02 !important;
  letter-spacing: -0.04em;
  color: var(--dashboard-text) !important;
}

body[data-page="dashboard"] .crm-topbar-subtitle {
  margin: 0;
  color: var(--dashboard-muted);
  font-size: 0.96rem;
  line-height: 1.65;
  max-width: 54ch;
}

body[data-page="dashboard"] .crm-topbar-actions {
  max-width: 620px !important;
  margin-left: auto;
  display: flex !important;
  flex-wrap: wrap;
  justify-content: flex-end !important;
  align-items: center;
  gap: 10px !important;
}

body[data-page="dashboard"] .button {
  min-height: 44px;
  border-radius: 14px;
  font-weight: 700;
}

body[data-page="dashboard"] .button-primary {
  background: linear-gradient(135deg, var(--dashboard-primary) 0%, var(--dashboard-secondary) 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 12px 26px rgba(31, 143, 131, 0.2) !important;
}

body[data-page="dashboard"] .button-secondary {
  background: rgba(255, 255, 255, 0.9) !important;
  color: var(--dashboard-text) !important;
  border-color: var(--dashboard-border) !important;
}

body[data-page="dashboard"] .dashboard-period-group {
  padding: 6px !important;
  background: rgba(245, 249, 251, 0.96) !important;
  border: 1px solid var(--dashboard-border) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

body[data-page="dashboard"] .dashboard-period-chip {
  min-height: 36px !important;
  padding: 0 14px !important;
  color: var(--dashboard-muted) !important;
}

body[data-page="dashboard"] .dashboard-period-chip.is-active {
  background: var(--dashboard-surface-strong) !important;
  color: var(--dashboard-text) !important;
  box-shadow: 0 10px 18px rgba(18, 46, 77, 0.08) !important;
}

body[data-page="dashboard"] .dashboard-summary-shell {
  grid-template-columns: 1fr !important;
  gap: 18px !important;
}

body[data-page="dashboard"] .dashboard-executive-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.9fr) !important;
  gap: 18px !important;
}

body[data-page="dashboard"] .dashboard-stack-column {
  gap: 18px !important;
}

body[data-page="dashboard"] .dashboard-summary-panel,
body[data-page="dashboard"] .dashboard-focus-panel,
body[data-page="dashboard"] .dashboard-traffic-panel,
body[data-page="dashboard"] .dashboard-stack-column > .crm-detail-panel,
body[data-page="dashboard"] .dashboard-geo-panel,
body[data-page="dashboard"] .dashboard-kpi-grid .crm-strip-card,
body[data-page="dashboard"] .dashboard-traffic-grid .dashboard-mini-card,
body[data-page="dashboard"] .compact-hub-grid .crm-link-card {
  border: 1px solid var(--dashboard-border) !important;
  border-radius: 24px !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 252, 0.95)) !important;
  box-shadow: var(--dashboard-shadow) !important;
}

body[data-page="dashboard"] .crm-panel-header {
  margin-bottom: 16px !important;
  padding-bottom: 14px !important;
  border-bottom: 1px solid rgba(20, 50, 76, 0.07) !important;
}

body[data-page="dashboard"] .crm-panel-header h2,
body[data-page="dashboard"] .dashboard-focus-copy h2 {
  color: var(--dashboard-text) !important;
  font-family: "Sora", "Space Grotesk", sans-serif !important;
}

body[data-page="dashboard"] .crm-panel-header .eyebrow,
body[data-page="dashboard"] .dashboard-focus-copy .eyebrow {
  color: var(--dashboard-primary-deep) !important;
}

body[data-page="dashboard"] .dashboard-summary-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(245, 249, 251, 0.95)),
    radial-gradient(circle at top left, rgba(74, 132, 240, 0.06), transparent 28%) !important;
}

body[data-page="dashboard"] .dashboard-kpi-grid {
  gap: 12px !important;
}

body[data-page="dashboard"] .dashboard-kpi-grid .crm-strip-card {
  position: relative;
  min-height: 144px !important;
  padding: 18px !important;
  overflow: hidden;
}

body[data-page="dashboard"] .dashboard-kpi-grid .crm-strip-card::before {
  display: none !important;
}

body[data-page="dashboard"] .dashboard-kpi-grid .crm-strip-card::after {
  content: "" !important;
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  border-radius: 24px 24px 0 0;
  background: linear-gradient(90deg, var(--dashboard-primary), var(--dashboard-secondary)) !important;
}

body[data-page="dashboard"] .dashboard-kpi-grid .crm-strip-card span,
body[data-page="dashboard"] .dashboard-traffic-grid .dashboard-mini-card > span {
  color: var(--dashboard-muted) !important;
  text-transform: uppercase;
  letter-spacing: 0.08em !important;
  font-size: 0.7rem !important;
  font-weight: 700 !important;
}

body[data-page="dashboard"] .dashboard-kpi-grid .crm-strip-card strong {
  margin-top: 12px !important;
  font-size: clamp(1.65rem, 2vw, 2rem) !important;
}

body[data-page="dashboard"] .dashboard-kpi-grid .crm-strip-card small,
body[data-page="dashboard"] .dashboard-traffic-grid .dashboard-mini-card small,
body[data-page="dashboard"] .dashboard-focus-copy p,
body[data-page="dashboard"] .compact-hub-grid .crm-link-card small,
body[data-page="dashboard"] .source-item small,
body[data-page="dashboard"] .leaderboard-item small {
  color: var(--dashboard-muted) !important;
}

body[data-page="dashboard"] .crm-strip-card[data-kpi="leads"] strong,
body[data-page="dashboard"] #sourceBreakdown .source-item > strong,
body[data-page="dashboard"] .dashboard-mini-card:nth-child(3) strong {
  color: var(--dashboard-primary) !important;
}

body[data-page="dashboard"] .crm-strip-card[data-kpi="attended"] strong,
body[data-page="dashboard"] .crm-strip-card[data-kpi="clients"] strong,
body[data-page="dashboard"] .dashboard-mini-card:nth-child(5) strong {
  color: var(--dashboard-success) !important;
}

body[data-page="dashboard"] .crm-strip-card[data-kpi="response"] strong,
body[data-page="dashboard"] .dashboard-mini-card:nth-child(1) strong,
body[data-page="dashboard"] .dashboard-mini-card:nth-child(2) strong {
  color: var(--dashboard-secondary) !important;
}

body[data-page="dashboard"] .crm-strip-card[data-kpi="pipeline"] strong,
body[data-page="dashboard"] #campaignBreakdown .source-item > strong,
body[data-page="dashboard"] .dashboard-mini-card:nth-child(4) strong {
  color: var(--dashboard-warm) !important;
}

body[data-page="dashboard"] .dashboard-focus-panel {
  gap: 16px !important;
  background:
    radial-gradient(circle at top right, rgba(31, 143, 131, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(242, 248, 249, 0.96)) !important;
  border-color: var(--dashboard-border-strong) !important;
}

body[data-page="dashboard"] .dashboard-focus-copy h2 {
  margin: 4px 0 8px !important;
  font-size: 1.52rem !important;
}

body[data-page="dashboard"] .dashboard-focus-meta {
  gap: 10px !important;
}

body[data-page="dashboard"] .dashboard-sync-pill,
body[data-page="dashboard"] .crm-user-pill {
  border-radius: 999px !important;
  border: 1px solid var(--dashboard-border) !important;
  background: rgba(255, 255, 255, 0.82) !important;
  color: var(--dashboard-primary-deep) !important;
  box-shadow: none !important;
}

body[data-page="dashboard"] .dashboard-sync-pill::before {
  background: var(--dashboard-success) !important;
}

body[data-page="dashboard"] .dashboard-focus-links {
  gap: 10px !important;
}

body[data-page="dashboard"] .dashboard-action-link {
  min-height: 48px !important;
  padding: 0 16px !important;
  border-radius: 16px !important;
  background: rgba(255, 255, 255, 0.78) !important;
  border: 1px solid var(--dashboard-border) !important;
  color: var(--dashboard-text) !important;
  font-weight: 700 !important;
}

body[data-page="dashboard"] .dashboard-action-link:hover {
  background: var(--dashboard-primary-soft) !important;
  border-color: var(--dashboard-border-strong) !important;
}

body[data-page="dashboard"] .dashboard-action-link::after {
  content: "->" !important;
  color: var(--dashboard-primary-deep) !important;
}

body[data-page="dashboard"] .dashboard-traffic-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(246, 250, 253, 0.96)),
    radial-gradient(circle at right top, rgba(74, 132, 240, 0.08), transparent 24%) !important;
}

body[data-page="dashboard"] .dashboard-traffic-grid {
  gap: 12px !important;
}

body[data-page="dashboard"] .dashboard-mini-card {
  min-height: 118px !important;
  padding: 16px !important;
}

body[data-page="dashboard"] .dashboard-mini-card:nth-child(1) {
  border-top: 4px solid var(--dashboard-secondary) !important;
}

body[data-page="dashboard"] .dashboard-mini-card:nth-child(2) {
  border-top: 4px solid #7aa5f6 !important;
}

body[data-page="dashboard"] .dashboard-mini-card:nth-child(3) {
  border-top: 4px solid var(--dashboard-primary) !important;
}

body[data-page="dashboard"] .dashboard-mini-card:nth-child(4) {
  border-top: 4px solid var(--dashboard-warm) !important;
}

body[data-page="dashboard"] .dashboard-mini-card:nth-child(5) {
  border-top: 4px solid var(--dashboard-success) !important;
}

body[data-page="dashboard"] .trend-chart {
  min-height: 252px !important;
  padding: 18px !important;
  border: 1px solid rgba(23, 104, 97, 0.08) !important;
  border-radius: 24px !important;
  background:
    linear-gradient(180deg, rgba(235, 245, 244, 0.85), rgba(255, 255, 255, 0.96)),
    repeating-linear-gradient(
      to top,
      rgba(31, 143, 131, 0.06) 0,
      rgba(31, 143, 131, 0.06) 1px,
      transparent 1px,
      transparent 56px
    ) !important;
}

body[data-page="dashboard"] .arrival-bar-visual {
  min-height: 176px !important;
  background: linear-gradient(180deg, rgba(228, 239, 240, 0.92), rgba(246, 250, 251, 0.98)) !important;
  border: 1px solid rgba(23, 104, 97, 0.1) !important;
  border-radius: 20px !important;
}

body[data-page="dashboard"] .arrival-bar-visual div {
  background: linear-gradient(180deg, var(--dashboard-primary) 0%, var(--dashboard-primary-deep) 100%) !important;
  box-shadow: 0 14px 28px rgba(31, 143, 131, 0.18) !important;
}

body[data-page="dashboard"] .arrival-bar:last-child .arrival-bar-visual div {
  background: linear-gradient(180deg, #ebb14f 0%, #d58c2d 100%) !important;
  box-shadow: 0 14px 28px rgba(215, 154, 59, 0.2) !important;
}

body[data-page="dashboard"] .arrival-bar strong {
  color: var(--dashboard-text) !important;
  font-weight: 800 !important;
}

body[data-page="dashboard"] .arrival-bar span {
  color: var(--dashboard-muted) !important;
}

body[data-page="dashboard"] .source-item,
body[data-page="dashboard"] .leaderboard-item {
  border: 1px solid var(--dashboard-border) !important;
  border-radius: 18px !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 249, 251, 0.94)) !important;
}

body[data-page="dashboard"] .source-item::before {
  background: linear-gradient(90deg, rgba(31, 143, 131, 0.16), rgba(31, 143, 131, 0.03)) !important;
  border-right-color: rgba(31, 143, 131, 0.16) !important;
}

body[data-page="dashboard"] #campaignBreakdown .source-item::before {
  background: linear-gradient(90deg, rgba(215, 154, 59, 0.18), rgba(215, 154, 59, 0.03)) !important;
  border-right-color: rgba(215, 154, 59, 0.14) !important;
}

body[data-page="dashboard"] .leaderboard-item {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  align-items: center;
}

body[data-page="dashboard"] .leaderboard-item strong {
  margin-top: 0 !important;
  color: var(--dashboard-text) !important;
}

body[data-page="dashboard"] .leaderboard-item small,
body[data-page="dashboard"] .leaderboard-item .sdr-bar-track {
  grid-column: 1 / -1;
}

body[data-page="dashboard"] .sdr-bar-track {
  height: 5px !important;
  background: rgba(74, 132, 240, 0.08) !important;
}

body[data-page="dashboard"] .sdr-bar-fill {
  background: linear-gradient(90deg, var(--dashboard-primary), var(--dashboard-secondary)) !important;
}

body[data-page="dashboard"] .leaderboard-item[data-slow="true"] .sdr-bar-fill {
  background: linear-gradient(90deg, #e69c5a, #d66a67) !important;
}

body[data-page="dashboard"] .sdr-rank {
  background: var(--dashboard-primary-soft) !important;
  color: var(--dashboard-primary-deep) !important;
  box-shadow: none !important;
}

body[data-page="dashboard"] .compact-hub-grid {
  gap: 12px !important;
}

body[data-page="dashboard"] .compact-hub-grid .crm-link-card {
  min-height: 154px;
  padding: 18px !important;
}

body[data-page="dashboard"] .compact-hub-grid .crm-link-card:hover {
  border-color: var(--dashboard-border-strong) !important;
  box-shadow: 0 18px 36px rgba(16, 46, 77, 0.1) !important;
}

body[data-page="dashboard"] .compact-hub-grid .crm-link-card strong {
  color: var(--dashboard-text) !important;
}

body[data-page="dashboard"] .crm-link-card[data-shortcut="pipeline"]::before {
  background: linear-gradient(180deg, var(--dashboard-primary), #63b8af) !important;
}

body[data-page="dashboard"] .crm-link-card[data-shortcut="leads"]::before {
  background: linear-gradient(180deg, var(--dashboard-secondary), #87aef8) !important;
}

body[data-page="dashboard"] .crm-link-card[data-shortcut="config"]::before {
  background: linear-gradient(180deg, var(--dashboard-warm), #e9bb6e) !important;
}

body[data-page="dashboard"] .geo-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

body[data-page="dashboard"] .geo-filters .crm-select {
  min-width: 180px;
  border-color: var(--dashboard-border) !important;
  background: rgba(255, 255, 255, 0.94) !important;
  color: var(--dashboard-text) !important;
}

body[data-page="dashboard"] .geo-panel-body {
  grid-template-columns: minmax(0, 1fr) 320px !important;
  gap: 18px !important;
}

body[data-page="dashboard"] .geo-map-container {
  min-height: 340px !important;
  padding: 20px !important;
  border: 1px solid var(--dashboard-border) !important;
  border-radius: 24px !important;
  background: linear-gradient(180deg, rgba(246, 250, 252, 0.95), rgba(238, 245, 248, 0.9)) !important;
}

body[data-page="dashboard"] .geo-ranking {
  display: grid;
  gap: 10px;
}

body[data-page="dashboard"] .geo-rank-item {
  padding: 14px 16px;
  border: 1px solid var(--dashboard-border);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 249, 251, 0.94));
}

body[data-page="dashboard"] .geo-rank-abbr {
  color: var(--dashboard-primary-deep) !important;
}

body[data-page="dashboard"] .geo-rank-name,
body[data-page="dashboard"] .geo-rank-count {
  color: var(--dashboard-text);
}

body[data-page="dashboard"] .geo-rank-count small {
  color: var(--dashboard-muted);
}

body[data-page="dashboard"] .geo-rank-bar {
  height: 6px !important;
  border-radius: 999px !important;
  background: rgba(74, 132, 240, 0.08) !important;
}

body[data-page="dashboard"] .geo-rank-bar > div {
  border-radius: 999px !important;
  background: linear-gradient(90deg, var(--dashboard-primary), var(--dashboard-secondary)) !important;
}

body[data-page="dashboard"] .geo-state-shape:hover {
  filter: brightness(1.02) drop-shadow(0 0 8px rgba(31, 143, 131, 0.16)) !important;
}

body[data-page="dashboard"] .geo-state-marker-bubble.is-active {
  fill: var(--dashboard-primary) !important;
}

@media (max-width: 1180px) {
  body[data-page="dashboard"] .crm-topbar,
  body[data-page="dashboard"] .dashboard-summary-shell,
  body[data-page="dashboard"] .dashboard-executive-grid,
  body[data-page="dashboard"] .geo-panel-body {
    grid-template-columns: 1fr !important;
  }

  body[data-page="dashboard"] .crm-topbar-actions {
    justify-content: flex-start !important;
    margin-left: 0;
  }
}

@media (max-width: 820px) {
  body[data-page="dashboard"] .crm-main {
    padding: 16px 16px 24px !important;
  }

  body[data-page="dashboard"] .crm-topbar {
    padding: 18px !important;
    border-radius: 22px !important;
  }

  body[data-page="dashboard"] .dashboard-kpi-grid,
  body[data-page="dashboard"] .dashboard-traffic-grid,
  body[data-page="dashboard"] .compact-hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px) {
  body[data-page="dashboard"] .crm-topbar-actions,
  body[data-page="dashboard"] .dashboard-period-group {
    width: 100%;
  }

  body[data-page="dashboard"] .dashboard-kpi-grid,
  body[data-page="dashboard"] .dashboard-traffic-grid,
  body[data-page="dashboard"] .compact-hub-grid {
    grid-template-columns: 1fr !important;
  }

  body[data-page="dashboard"] .dashboard-kpi-grid .crm-strip-card,
  body[data-page="dashboard"] .dashboard-mini-card,
  body[data-page="dashboard"] .compact-hub-grid .crm-link-card {
    min-height: 0;
  }
}

/* Dashboard compact spacing */
body[data-page] .crm-shell {
  width: min(calc(100vw - 16px), 1840px) !important;
  height: calc(100dvh - 16px) !important;
  max-height: calc(100dvh - 16px) !important;
  margin: 8px auto !important;
  padding: 12px !important;
  gap: 12px !important;
}

body[data-page="dashboard"] .crm-main {
  padding: 16px 16px 22px !important;
  gap: 12px !important;
}

body[data-page="dashboard"] .crm-topbar {
  gap: 12px !important;
  padding: 16px 18px !important;
  border-radius: 24px !important;
}

body[data-page="dashboard"] .crm-topbar-title {
  gap: 8px !important;
}

body[data-page="dashboard"] .crm-topbar-title h1 {
  font-size: clamp(1.7rem, 2.5vw, 2.35rem) !important;
  line-height: 1 !important;
}

body[data-page="dashboard"] .crm-topbar-subtitle {
  font-size: 0.92rem !important;
  line-height: 1.45 !important;
  max-width: 46ch !important;
}

body[data-page="dashboard"] .crm-topbar-actions {
  gap: 8px !important;
  max-width: 760px !important;
}

body[data-page="dashboard"] .crm-topbar-actions .crm-auth-controls {
  margin-left: 0 !important;
  width: auto !important;
  flex: 0 1 auto !important;
  justify-content: flex-end !important;
}

body[data-page="dashboard"] .crm-topbar-actions .crm-auth-controls > * {
  width: auto !important;
}

body[data-page="dashboard"] .button,
body[data-page="dashboard"] .crm-user-pill,
body[data-page="dashboard"] .dashboard-sync-pill {
  min-height: 40px !important;
}

body[data-page="dashboard"] .dashboard-period-group {
  padding: 4px !important;
  gap: 6px !important;
}

body[data-page="dashboard"] .dashboard-period-chip {
  min-height: 34px !important;
  padding: 0 12px !important;
}

body[data-page="dashboard"] .dashboard-summary-shell,
body[data-page="dashboard"] .dashboard-executive-grid,
body[data-page="dashboard"] .dashboard-stack-column {
  gap: 12px !important;
}

body[data-page="dashboard"] .dashboard-summary-shell {
  grid-template-columns: 1fr !important;
}

body[data-page="dashboard"] .dashboard-executive-grid {
  grid-template-columns: minmax(0, 1.56fr) minmax(280px, 0.82fr) !important;
}

body[data-page="dashboard"] .dashboard-summary-panel,
body[data-page="dashboard"] .dashboard-focus-panel,
body[data-page="dashboard"] .dashboard-traffic-panel,
body[data-page="dashboard"] .dashboard-stack-column > .crm-detail-panel,
body[data-page="dashboard"] .dashboard-geo-panel {
  padding: 14px !important;
  border-radius: 20px !important;
}

body[data-page="dashboard"] .crm-panel-header {
  margin-bottom: 10px !important;
  padding-bottom: 10px !important;
}

body[data-page="dashboard"] .dashboard-kpi-grid,
body[data-page="dashboard"] .dashboard-traffic-grid,
body[data-page="dashboard"] .compact-hub-grid {
  gap: 10px !important;
}

body[data-page="dashboard"] .dashboard-kpi-grid .crm-strip-card {
  min-height: 122px !important;
  padding: 14px !important;
}

body[data-page="dashboard"] .dashboard-kpi-grid .crm-strip-card strong {
  margin-top: 8px !important;
  font-size: clamp(1.42rem, 1.7vw, 1.82rem) !important;
}

body[data-page="dashboard"] .dashboard-kpi-grid .crm-strip-card small {
  line-height: 1.35 !important;
}

body[data-page="dashboard"] .dashboard-mini-card {
  min-height: 92px !important;
  padding: 12px !important;
}

body[data-page="dashboard"] .dashboard-mini-card strong {
  font-size: clamp(1.1rem, 1.5vw, 1.45rem) !important;
}

body[data-page="dashboard"] .dashboard-focus-panel {
  gap: 12px !important;
}

body[data-page="dashboard"] .dashboard-focus-copy h2 {
  margin: 2px 0 6px !important;
  font-size: 1.28rem !important;
}

body[data-page="dashboard"] .dashboard-focus-copy p {
  line-height: 1.45 !important;
  font-size: 0.92rem !important;
}

body[data-page="dashboard"] .dashboard-focus-meta,
body[data-page="dashboard"] .dashboard-focus-links {
  gap: 8px !important;
}

body[data-page="dashboard"] .dashboard-action-link {
  min-height: 44px !important;
  padding: 0 14px !important;
  border-radius: 14px !important;
}

body[data-page="dashboard"] .trend-chart {
  min-height: 206px !important;
  padding: 14px !important;
  gap: 10px !important;
}

body[data-page="dashboard"] .source-item,
body[data-page="dashboard"] .leaderboard-item,
body[data-page="dashboard"] .compact-hub-grid .crm-link-card {
  min-height: 0 !important;
  padding: 14px !important;
}

@media (max-width: 1180px) {
  body[data-page] .crm-shell {
    width: min(calc(100vw - 12px), 1840px) !important;
    height: calc(100dvh - 12px) !important;
    max-height: calc(100dvh - 12px) !important;
    margin: 6px auto !important;
  }

  body[data-page="dashboard"] .crm-topbar-actions .crm-auth-controls {
    width: 100% !important;
    justify-content: flex-start !important;
  }
}

/* Dashboard tighter spacing pass */
body[data-page] .crm-shell {
  grid-template-columns: 246px minmax(0, 1fr) !important;
}

body[data-page] .crm-shell.is-sidebar-collapsed {
  grid-template-columns: 84px minmax(0, 1fr) !important;
}

body[data-page="dashboard"] .crm-sidebar {
  padding: 14px 12px !important;
  gap: 12px !important;
}

body[data-page="dashboard"] .crm-brand {
  gap: 12px !important;
  padding: 2px 2px 10px !important;
}

body[data-page="dashboard"] .crm-brand-mark {
  width: 44px !important;
  height: 44px !important;
  border-radius: 15px !important;
}

body[data-page="dashboard"] .crm-side-link,
body[data-page="dashboard"] .crm-side-sub {
  min-height: 46px !important;
  padding: 0 14px !important;
  border-radius: 16px !important;
}

body[data-page="dashboard"] .crm-side-footer {
  padding: 14px !important;
  border-radius: 18px !important;
}

body[data-page="dashboard"] .crm-main {
  padding: 14px 14px 18px !important;
  gap: 10px !important;
}

body[data-page="dashboard"] .crm-topbar {
  grid-template-columns: minmax(0, 1.15fr) auto !important;
  gap: 10px !important;
  padding: 14px 16px !important;
}

body[data-page="dashboard"] .crm-topbar-title {
  max-width: 50ch !important;
}

body[data-page="dashboard"] .crm-topbar-title h1 {
  font-size: clamp(1.58rem, 2.15vw, 2.1rem) !important;
}

body[data-page="dashboard"] .crm-topbar-subtitle {
  font-size: 0.88rem !important;
  line-height: 1.35 !important;
  max-width: 40ch !important;
}

body[data-page="dashboard"] .crm-topbar-actions {
  gap: 6px !important;
}

body[data-page="dashboard"] .button,
body[data-page="dashboard"] .crm-user-pill,
body[data-page="dashboard"] .dashboard-sync-pill {
  min-height: 38px !important;
  padding-inline: 14px !important;
}

body[data-page="dashboard"] .dashboard-summary-shell,
body[data-page="dashboard"] .dashboard-executive-grid,
body[data-page="dashboard"] .dashboard-stack-column {
  gap: 10px !important;
}

body[data-page="dashboard"] .dashboard-summary-shell {
  grid-template-columns: 1fr !important;
}

body[data-page="dashboard"] .dashboard-executive-grid {
  grid-template-columns: minmax(0, 1.62fr) minmax(250px, 0.74fr) !important;
}

body[data-page="dashboard"] .dashboard-summary-panel,
body[data-page="dashboard"] .dashboard-focus-panel,
body[data-page="dashboard"] .dashboard-traffic-panel,
body[data-page="dashboard"] .dashboard-stack-column > .crm-detail-panel,
body[data-page="dashboard"] .dashboard-geo-panel {
  padding: 12px !important;
  border-radius: 18px !important;
}

body[data-page="dashboard"] .crm-panel-header {
  margin-bottom: 8px !important;
  padding-bottom: 8px !important;
}

body[data-page="dashboard"] .crm-panel-header h2,
body[data-page="dashboard"] .dashboard-focus-copy h2 {
  font-size: 1.02rem !important;
}

body[data-page="dashboard"] .dashboard-kpi-grid,
body[data-page="dashboard"] .dashboard-traffic-grid,
body[data-page="dashboard"] .compact-hub-grid {
  gap: 8px !important;
}

body[data-page="dashboard"] .dashboard-kpi-grid .crm-strip-card {
  min-height: 108px !important;
  padding: 12px !important;
  border-radius: 18px !important;
}

body[data-page="dashboard"] .dashboard-kpi-grid .crm-strip-card strong {
  margin-top: 6px !important;
  font-size: clamp(1.3rem, 1.45vw, 1.62rem) !important;
}

body[data-page="dashboard"] .dashboard-kpi-grid .crm-strip-card small,
body[data-page="dashboard"] .dashboard-mini-card small {
  font-size: 0.8rem !important;
}

body[data-page="dashboard"] .dashboard-mini-card {
  min-height: 84px !important;
  padding: 10px 12px !important;
  border-radius: 18px !important;
}

body[data-page="dashboard"] .dashboard-mini-card strong {
  font-size: clamp(1rem, 1.25vw, 1.28rem) !important;
}

body[data-page="dashboard"] .dashboard-focus-panel {
  gap: 10px !important;
}

body[data-page="dashboard"] .dashboard-focus-copy h2 {
  margin: 0 0 4px !important;
  font-size: 1.18rem !important;
}

body[data-page="dashboard"] .dashboard-focus-copy p {
  font-size: 0.88rem !important;
  line-height: 1.35 !important;
}

body[data-page="dashboard"] .dashboard-focus-meta,
body[data-page="dashboard"] .dashboard-focus-links {
  gap: 6px !important;
}

body[data-page="dashboard"] .dashboard-action-link {
  min-height: 40px !important;
  padding: 0 12px !important;
}

body[data-page="dashboard"] .trend-chart {
  min-height: 182px !important;
  padding: 12px !important;
  gap: 8px !important;
}

body[data-page="dashboard"] .source-item,
body[data-page="dashboard"] .leaderboard-item,
body[data-page="dashboard"] .compact-hub-grid .crm-link-card {
  padding: 12px !important;
  border-radius: 16px !important;
}

body[data-page="dashboard"] .geo-panel-body {
  gap: 16px !important;
}

/* --- Mídia Paga: mesmo tamanho que Visão Geral --- */
body[data-page="dashboard"] .dashboard-summary-shell,
body[data-page="dashboard"] .dashboard-traffic-panel {
  width: 100% !important;
  box-sizing: border-box !important;
}

body[data-page="dashboard"] .dashboard-kpi-grid,
body[data-page="dashboard"] .dashboard-traffic-grid {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 12px !important;
}

body[data-page="dashboard"] .dashboard-kpi-grid .crm-strip-card,
body[data-page="dashboard"] .dashboard-mini-card {
  min-height: 132px !important;
  padding: 16px !important;
  border-radius: 22px !important;
}

body[data-page="dashboard"] .dashboard-kpi-grid .crm-strip-card strong,
body[data-page="dashboard"] .dashboard-mini-card strong {
  font-size: clamp(1.4rem, 1.8vw, 1.9rem) !important;
}

/* --- Remove espaços vazios na coluna lateral --- */
body[data-page="dashboard"] .dashboard-executive-grid {
  align-items: stretch !important;
}

body[data-page="dashboard"] .dashboard-stack-column-side {
  grid-template-rows: auto 1fr !important;
  align-content: start !important;
}

body[data-page="dashboard"] .dashboard-stack-column-side > .crm-detail-panel:last-child {
  min-height: 0 !important;
  height: 100% !important;
}
