:root {
  --brand: #5b3fd6;
  --brand-dark: #4529b8;
  --brand-soft: #eeeafe;
  --brand-softer: #f6f3ff;
  --ink: #171624;
  --ink-soft: #67657a;
  --ink-faint: #9997a8;
  --surface: #ffffff;
  --canvas: #f6f7fb;
  --line: #e8e8f0;
  --success: #168f63;
  --success-soft: #e5f7ef;
  --warning: #b76b09;
  --warning-soft: #fff2da;
  --danger: #c93f56;
  --danger-soft: #ffebef;
  --orange: #e56a34;
  --whatsapp: #188b61;
  --shadow-sm: 0 2px 8px rgba(32, 27, 66, 0.05);
  --shadow-md: 0 16px 38px rgba(32, 27, 66, 0.1);
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 24px;
  --sidebar-width: 256px;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar {
  display: none;
}

.workspace {
  min-width: 0;
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: env(safe-area-inset-top) 16px 0;
  border-bottom: 1px solid rgba(232, 232, 240, 0.88);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
}

.mobile-brand,
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: var(--brand);
  box-shadow: 0 6px 16px rgba(91, 63, 214, 0.22);
}

.brand-mark svg {
  width: 24px;
  height: 24px;
}

.mobile-brand-name {
  font-weight: 790;
  letter-spacing: -0.03em;
}

.topbar-title {
  display: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.connection-pill {
  display: none;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid #dceee7;
  border-radius: 999px;
  color: #3c745e;
  background: #f5fcf9;
  font-size: 12px;
  font-weight: 650;
}

.connection-pill span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(22, 143, 99, 0.1);
}

.icon-button,
.topbar-avatar {
  position: relative;
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.icon-button:hover {
  border-color: #d5d2e7;
  background: #faf9ff;
}

.icon-button:active,
.topbar-avatar:active,
.button:active {
  transform: translateY(1px);
}

.icon-button svg {
  width: 20px;
  height: 20px;
}

.icon-button.compact {
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
}

.notification-button i {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 6px;
  height: 6px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--danger);
}

.topbar-avatar,
.avatar {
  border: 0;
  color: #fff;
  background: #242134;
  font-size: 12px;
  font-weight: 760;
}

.page-content {
  width: 100%;
  max-width: 1480px;
  min-height: calc(100vh - 64px);
  margin: 0 auto;
  padding: 20px 16px calc(92px + env(safe-area-inset-bottom));
  outline: none;
}

.page-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  gap: 7px;
}

.page-loader span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  animation: loader 900ms ease-in-out infinite alternate;
}

.page-loader span:nth-child(2) { animation-delay: 180ms; }
.page-loader span:nth-child(3) { animation-delay: 360ms; }

@keyframes loader {
  from { opacity: 0.28; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(-4px); }
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 7px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.page-heading h1 {
  margin: 0;
  font-size: clamp(25px, 5vw, 34px);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.page-heading p:not(.eyebrow) {
  max-width: 650px;
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.55;
}

.heading-actions {
  display: none;
  gap: 10px;
}

.button {
  display: inline-flex;
  min-height: 44px;
  padding: 0 17px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button svg {
  width: 18px;
  height: 18px;
}

.button.primary {
  color: #fff;
  background: var(--brand);
  box-shadow: 0 7px 18px rgba(91, 63, 214, 0.2);
}

.button.primary:hover {
  background: var(--brand-dark);
  box-shadow: 0 9px 24px rgba(91, 63, 214, 0.26);
}

.button.secondary {
  border-color: var(--line);
  background: #fff;
}

.button.secondary:hover {
  border-color: #d7d4e9;
  background: #fbfaff;
}

.button.ghost {
  color: var(--brand);
  background: var(--brand-soft);
}

.button.full {
  width: 100%;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  box-shadow: none;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.welcome-card {
  position: relative;
  display: grid;
  min-height: 190px;
  margin-bottom: 16px;
  padding: 23px;
  overflow: hidden;
  color: #fff;
  border: 0;
  background: #242039;
  isolation: isolate;
}

.welcome-card::before,
.welcome-card::after {
  position: absolute;
  z-index: -1;
  content: "";
  border-radius: 50%;
}

.welcome-card::before {
  top: -82px;
  right: -36px;
  width: 210px;
  height: 210px;
  background: #5b3fd6;
  opacity: 0.62;
}

.welcome-card::after {
  right: 86px;
  bottom: -104px;
  width: 190px;
  height: 190px;
  border: 32px solid #ffcb72;
  opacity: 0.13;
}

.welcome-copy {
  position: relative;
  z-index: 2;
  align-self: center;
}

.welcome-copy .mini-label {
  display: inline-flex;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: #dcd5ff;
  background: rgba(255, 255, 255, 0.08);
  font-size: 11px;
  font-weight: 700;
}

.welcome-copy h2 {
  max-width: 500px;
  margin: 13px 0 7px;
  font-size: clamp(22px, 6vw, 34px);
  line-height: 1.12;
  letter-spacing: -0.045em;
}

.welcome-copy p {
  max-width: 470px;
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  line-height: 1.5;
}

.welcome-card .button {
  min-height: 42px;
  color: #272039;
  background: #fff;
  box-shadow: none;
}

.welcome-art {
  display: none;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 16px;
  gap: 10px;
}

.metric-grid.six {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-card {
  position: relative;
  min-width: 0;
  padding: 16px;
  overflow: hidden;
}

.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.metric-icon,
.quick-icon,
.section-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  color: var(--brand);
  background: var(--brand-soft);
}

.metric-icon svg,
.quick-icon svg,
.section-icon svg {
  width: 19px;
  height: 19px;
}

.metric-icon.green { color: var(--success); background: var(--success-soft); }
.metric-icon.orange { color: var(--orange); background: #fff0e9; }
.metric-icon.blue { color: #3271c8; background: #eaf3ff; }

.trend {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--success);
  font-size: 11px;
  font-weight: 750;
}

.trend svg {
  width: 12px;
  height: 12px;
}

.metric-value {
  display: block;
  margin: 14px 0 3px;
  font-size: clamp(21px, 6vw, 29px);
  font-weight: 780;
  line-height: 1;
  letter-spacing: -0.035em;
}

.metric-label {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 560;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-grid {
  display: grid;
  gap: 16px;
}

.panel-card {
  padding: 18px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 10px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.panel-heading p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.text-link,
.text-button {
  padding: 0;
  border: 0;
  color: var(--brand);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.text-link:hover,
.text-button:hover {
  color: var(--brand-dark);
}

.chart-wrap {
  position: relative;
  height: 225px;
  padding: 12px 0 28px 34px;
}

.chart-grid {
  position: absolute;
  inset: 12px 0 28px 34px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.chart-grid-line {
  position: relative;
  border-top: 1px dashed #e9e8f0;
}

.chart-grid-line span {
  position: absolute;
  top: -8px;
  left: -34px;
  color: var(--ink-faint);
  font-size: 9px;
}

.bar-chart {
  position: relative;
  z-index: 2;
  display: grid;
  height: 100%;
  grid-template-columns: repeat(7, minmax(18px, 1fr));
  align-items: end;
  gap: 8px;
}

.bar-group {
  position: relative;
  display: flex;
  height: 100%;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
}

.bar {
  width: min(10px, 38%);
  min-height: 4px;
  border-radius: 5px 5px 2px 2px;
  background: var(--brand);
  transition: height 500ms ease;
}

.bar.messages {
  background: #cfcaec;
}

.bar-label {
  position: absolute;
  bottom: -23px;
  left: 50%;
  color: var(--ink-soft);
  font-size: 10px;
  transform: translateX(-50%);
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 13px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-soft);
  font-size: 10px;
}

.chart-legend i {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--brand);
}

.chart-legend span:last-child i { background: #cfcaec; }

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

.quick-action {
  position: relative;
  display: flex;
  min-height: 116px;
  padding: 14px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color 170ms ease, transform 170ms ease, box-shadow 170ms ease;
}

.quick-action:hover {
  border-color: #d8d4ee;
  box-shadow: 0 8px 18px rgba(32, 27, 66, 0.07);
  transform: translateY(-2px);
}

.quick-action strong {
  display: block;
  margin-top: 11px;
  font-size: 13px;
}

.quick-action small {
  display: block;
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.35;
}

.quick-action > svg {
  position: absolute;
  top: 15px;
  right: 13px;
  width: 15px;
  height: 15px;
  color: var(--ink-faint);
}

.campaign-list,
.conversation-list {
  display: grid;
}

.campaign-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 13px 0;
  align-items: center;
  border-top: 1px solid var(--line);
  gap: 10px;
}

.campaign-row:first-child,
.conversation-row:first-child {
  padding-top: 0;
  border-top: 0;
}

.campaign-row:last-child,
.conversation-row:last-child {
  padding-bottom: 0;
}

.campaign-info {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.channel-icon {
  display: grid;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  color: #c53a7a;
  background: #fff0f7;
}

.channel-icon.facebook {
  color: #2866ba;
  background: #edf4ff;
}

.channel-icon svg {
  width: 17px;
  height: 17px;
}

.campaign-copy {
  min-width: 0;
}

.campaign-copy strong,
.conversation-copy strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.campaign-meta {
  display: flex;
  align-items: center;
  margin-top: 4px;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 10px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

.status-dot.paused { background: var(--warning); }

.campaign-result {
  text-align: right;
}

.campaign-result strong {
  display: block;
  font-size: 12px;
}

.campaign-result span {
  color: var(--ink-soft);
  font-size: 10px;
}

.conversation-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 13px 0;
  align-items: center;
  border-top: 1px solid var(--line);
  gap: 10px;
}

.contact-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: #553cb7;
  background: #eae5ff;
  font-size: 11px;
  font-weight: 760;
}

.contact-avatar.orange { color: #9a4b20; background: #ffe6d8; }
.contact-avatar.green { color: #267058; background: #dcf3e9; }

.conversation-copy {
  min-width: 0;
}

.conversation-copy span {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-meta {
  display: grid;
  justify-items: end;
  gap: 5px;
}

.conversation-meta time {
  color: var(--ink-faint);
  font-size: 9px;
}

.unread {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--whatsapp);
  font-size: 9px;
  font-weight: 800;
}

.section-grid {
  display: grid;
  gap: 16px;
}

.content-card {
  padding: 20px;
}

.content-card h2,
.empty-card h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.025em;
}

.content-card > p,
.empty-card > p {
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
}

.form-block {
  margin-top: 20px;
}

.ai-field-action {
  display: inline-flex;
  width: max-content;
  margin-top: 2px;
  align-items: center;
  gap: 5px;
}

.ai-field-action svg {
  width: 14px;
  height: 14px;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 4px 0 18px;
  gap: 5px;
}

.step {
  position: relative;
  padding-top: 22px;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 650;
  text-align: center;
}

.step::before {
  position: absolute;
  top: 6px;
  right: 0;
  left: 0;
  height: 3px;
  border-radius: 3px;
  background: var(--line);
  content: "";
}

.step.active { color: var(--brand); }
.step.active::before { background: var(--brand); }

.field-grid {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label,
.field > span {
  color: #403e50;
  font-size: 12px;
  font-weight: 700;
}

.input,
.select,
.textarea,
.search-input {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid #dcdbe7;
  border-radius: 12px;
  outline: 0;
  color: var(--ink);
  background: #fff;
  font-size: 14px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.textarea {
  min-height: 112px;
  padding-block: 12px;
  line-height: 1.55;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus,
.search-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(91, 63, 214, 0.1);
}

.field-help {
  color: var(--ink-faint);
  font-size: 10px;
}

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

.choice-card {
  position: relative;
  display: flex;
  min-height: 92px;
  padding: 13px;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  cursor: pointer;
}

.choice-card.selected {
  border-color: var(--brand);
  background: var(--brand-softer);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.choice-card svg {
  width: 20px;
  height: 20px;
  color: var(--brand);
}

.choice-card strong {
  font-size: 12px;
}

.choice-card small {
  display: block;
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 9px;
}

.form-actions {
  display: flex;
  margin-top: 20px;
  justify-content: flex-end;
  gap: 9px;
}

.preview-phone {
  width: min(100%, 282px);
  margin: 0 auto;
  padding: 10px;
  border: 6px solid #262333;
  border-radius: 31px;
  background: #fff;
  box-shadow: var(--shadow-md);
}

.phone-top {
  width: 68px;
  height: 14px;
  margin: -3px auto 8px;
  border-radius: 0 0 10px 10px;
  background: #262333;
}

.ad-preview-head {
  display: flex;
  padding: 7px 5px;
  align-items: center;
  gap: 8px;
}

.ad-preview-logo {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--brand);
  font-size: 10px;
  font-weight: 800;
}

.ad-preview-head strong { display: block; font-size: 10px; }
.ad-preview-head span { display: block; margin-top: 2px; color: var(--ink-soft); font-size: 8px; }

.ad-preview-visual {
  display: grid;
  aspect-ratio: 1 / 1;
  padding: 22px;
  place-items: center;
  border-radius: 5px;
  color: #fff;
  background: #5b3fd6;
  text-align: center;
}

.ad-preview-visual span { font-size: 9px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.ad-preview-visual strong { display: block; margin: 8px 0; font-size: 24px; line-height: 1.05; letter-spacing: -.05em; }
.ad-preview-visual small { color: rgba(255,255,255,.72); font-size: 8px; }

.ad-preview-stats {
  display: flex;
  padding: 9px 4px;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 8px;
}

.ad-preview-copy { padding: 9px 4px 4px; font-size: 9px; line-height: 1.4; }

.info-banner {
  display: flex;
  padding: 12px;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid #e4dfff;
  border-radius: 12px;
  color: #4d3f90;
  background: var(--brand-softer);
  font-size: 11px;
  line-height: 1.5;
}

.info-banner svg { flex: 0 0 auto; width: 17px; height: 17px; }

.studio-hero {
  position: relative;
  min-height: 210px;
  padding: 24px;
  overflow: hidden;
  color: #fff;
  border: 0;
  background: #262238;
}

.studio-hero::after {
  position: absolute;
  top: -90px;
  right: -45px;
  width: 230px;
  height: 230px;
  border: 42px solid rgba(118, 91, 239, .65);
  border-radius: 50%;
  content: "";
}

.studio-hero > * { position: relative; z-index: 2; }
.studio-hero .section-icon { color: #fff; background: rgba(255,255,255,.13); }
.studio-hero h2 { margin-top: 24px; font-size: 24px; }
.studio-hero p { max-width: 490px; color: rgba(255,255,255,.65); }

.studio-prompt {
  display: grid;
  max-width: 700px;
  margin-top: 18px;
  gap: 9px;
}

.studio-prompt .textarea {
  min-height: 92px;
  border-color: rgba(255,255,255,.15);
  color: #fff;
  background: rgba(255,255,255,.09);
  backdrop-filter: blur(4px);
}

.studio-prompt .textarea::placeholder { color: rgba(255,255,255,.48); }
.studio-prompt .textarea:focus { border-color: rgba(255,255,255,.45); box-shadow: 0 0 0 3px rgba(255,255,255,.1); }
.studio-prompt .button { justify-self: start; color: #272039; background: #fff; box-shadow: none; }

.studio-templates { margin-top: 16px; }
.template-card { border: 0; text-align: left; cursor: pointer; transition: transform 170ms ease, box-shadow 170ms ease; }
.template-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }

.template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 17px;
  gap: 10px;
}

.template-card {
  aspect-ratio: 4 / 5;
  padding: 12px;
  overflow: hidden;
  border-radius: 14px;
  color: #fff;
  background: #e06457;
}

.template-card:nth-child(2) { background: #293655; }
.template-card:nth-child(3) { background: #568c70; }
.template-card:nth-child(4) { color: #312b24; background: #f2ca74; }
.template-card strong { display: block; margin-top: 35%; font-size: 18px; line-height: 1.05; letter-spacing: -.04em; }
.template-card span { font-size: 8px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }

.toolbar {
  display: grid;
  margin-bottom: 14px;
  gap: 10px;
}

.search-wrap {
  position: relative;
}

.search-wrap > svg {
  position: absolute;
  top: 50%;
  left: 13px;
  width: 18px;
  height: 18px;
  color: var(--ink-faint);
  transform: translateY(-50%);
  pointer-events: none;
}

.search-wrap .search-input { padding-left: 40px; }

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

.data-table th {
  padding: 10px 12px;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .035em;
  text-align: left;
  text-transform: uppercase;
}

.data-table td {
  padding: 13px 12px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  vertical-align: middle;
}

.data-table strong { font-size: 12px; }
.data-table small { display: block; margin-top: 3px; color: var(--ink-soft); font-size: 10px; }

.table-scroll {
  margin-inline: -10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-scroll .data-table { min-width: 650px; }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--success);
  background: var(--success-soft);
  font-size: 10px;
  font-weight: 740;
}

.status-badge.paused { color: var(--warning); background: var(--warning-soft); }
.status-badge.draft { color: var(--ink-soft); background: #f0eff4; }

.best-ad-card {
  overflow: hidden;
  background: #fffdf8;
}

.best-ad-card .section-icon {
  color: var(--warning);
  background: var(--warning-soft);
}

.best-ad > strong {
  display: block;
  margin-bottom: 15px;
  font-size: 14px;
}

.best-ad > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.best-ad > div span {
  min-width: 0;
  padding: 10px;
  border: 1px solid #efe8da;
  border-radius: 11px;
  background: #fff;
  font-size: 11px;
  font-weight: 750;
}

.best-ad small {
  display: block;
  margin-bottom: 5px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-recommendations {
  background: var(--brand-softer);
}

.ai-recommendations ol {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: recommendations;
  gap: 9px;
}

.ai-recommendations li {
  position: relative;
  min-height: 34px;
  padding: 2px 0 0 38px;
  color: #514d66;
  font-size: 10px;
  line-height: 1.45;
  counter-increment: recommendations;
}

.ai-recommendations li::before {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 9px;
  color: var(--brand);
  background: #fff;
  content: counter(recommendations);
  font-size: 9px;
  font-weight: 800;
}

.analysis-copy {
  margin: 0 0 15px;
  color: #514d66;
  font-size: 11px;
  line-height: 1.6;
}

.line-chart {
  position: relative;
  height: 250px;
  padding-bottom: 25px;
}

.line-chart svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.line-chart .grid-lines path { fill: none; stroke: #e9e8f0; stroke-dasharray: 4 5; }
.line-chart .area { fill: rgba(91,63,214,.08); stroke: none; }
.line-chart .line { fill: none; stroke: var(--brand); stroke-width: 4; vector-effect: non-scaling-stroke; }
.line-chart .points circle { fill: #fff; stroke: var(--brand); stroke-width: 3; vector-effect: non-scaling-stroke; }

.line-labels {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 9px;
}

.donut-row {
  display: grid;
  grid-template-columns: 125px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}

.donut {
  position: relative;
  display: grid;
  width: 125px;
  height: 125px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--brand) 0 62%, #5c90d9 62% 90%, #dedce8 90% 100%);
}

.donut::after {
  position: absolute;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: #fff;
  content: "";
}

.donut > span { position: relative; z-index: 2; color: var(--ink-soft); font-size: 9px; text-align: center; }
.donut strong { display: block; color: var(--ink); font-size: 20px; }
.donut-row ul { display: grid; margin: 0; padding: 0; list-style: none; gap: 11px; }
.donut-row li { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 7px; font-size: 10px; }
.donut-row li i { width: 8px; height: 8px; border-radius: 3px; background: #dedce8; }
.donut-row li i.violet { background: var(--brand); }
.donut-row li i.blue { background: #5c90d9; }

.toggle {
  position: relative;
  width: 38px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: #cbc9d5;
  cursor: pointer;
}

.toggle::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,.16);
  content: "";
  transition: transform 170ms ease;
}

.toggle.on { background: var(--success); }
.toggle.on::after { transform: translateX(16px); }

.customer-name {
  display: flex;
  align-items: center;
  gap: 9px;
}

.customer-name .contact-avatar { width: 32px; height: 32px; }

.tag {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  color: #6d4a1c;
  background: #fff1d6;
  font-size: 9px;
  font-weight: 700;
}

.tag.new { color: #3f4e9e; background: #e9edff; }
.tag.won { color: var(--success); background: var(--success-soft); }

.kanban {
  display: grid;
  gap: 12px;
}

.kanban-column {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fafafd;
}

.kanban-head {
  display: flex;
  margin-bottom: 10px;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 750;
}

.kanban-head span {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 7px;
  color: var(--ink-soft);
  background: #ecebf1;
  font-size: 9px;
}

.lead-card {
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.lead-card strong { font-size: 11px; }
.lead-card p { margin: 5px 0 9px; color: var(--ink-soft); font-size: 10px; }
.lead-card footer { display: flex; align-items: center; justify-content: space-between; color: var(--ink-faint); font-size: 9px; }

.whatsapp-layout {
  display: grid;
  min-height: 620px;
  overflow: hidden;
}

.chat-list-panel {
  border-bottom: 1px solid var(--line);
}

.chat-list-header,
.chat-header {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.chat-list-header h2 { margin: 0 0 12px; font-size: 16px; }
.chat-list-header .search-input { min-height: 40px; }

.chat-list .conversation-row {
  padding: 13px 16px;
  cursor: pointer;
}

.chat-list .conversation-row.active {
  background: var(--brand-softer);
}

.chat-panel {
  display: flex;
  min-height: 430px;
  flex-direction: column;
  background: #f7f5ef;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
}

.chat-header strong { display: block; font-size: 12px; }
.chat-header span { color: var(--success); font-size: 10px; }
.chat-header .icon-button { margin-left: auto; }

.messages {
  display: flex;
  padding: 18px;
  flex: 1;
  flex-direction: column;
  justify-content: flex-end;
  gap: 9px;
}

.message {
  max-width: 83%;
  padding: 10px 12px;
  border-radius: 13px 13px 13px 3px;
  background: #fff;
  box-shadow: 0 2px 5px rgba(40,35,25,.06);
  font-size: 11px;
  line-height: 1.45;
}

.message.sent {
  align-self: flex-end;
  border-radius: 13px 13px 3px 13px;
  background: #dcf8e9;
}

.message time { display: block; margin-top: 4px; color: var(--ink-faint); font-size: 8px; text-align: right; }

.chat-composer {
  display: flex;
  padding: 11px;
  align-items: flex-end;
  gap: 8px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.chat-composer .input { min-height: 42px; }
.chat-composer .button { flex: 0 0 auto; width: 42px; min-height: 42px; padding: 0; }

.ai-suggestion {
  display: grid;
  max-width: 93%;
  padding: 10px;
  grid-template-columns: auto minmax(0,1fr);
  align-items: start;
  gap: 8px;
  border: 1px solid #dcd5ff;
  border-radius: 13px;
  color: #4c416f;
  background: #f2efff;
}

.ai-suggestion > span {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 8px;
  color: var(--brand);
  background: #fff;
}

.ai-suggestion svg { width: 14px; height: 14px; }
.ai-suggestion strong { font-size: 9px; }
.ai-suggestion p { margin: 4px 0 0; font-size: 9px; line-height: 1.45; }
.ai-suggestion .text-button { grid-column: 2; justify-self: start; }

.broadcast-summary {
  display: grid;
  gap: 3px;
}

.broadcast-summary > div {
  display: flex;
  padding: 12px 0;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}

.broadcast-summary span { color: var(--ink-soft); }
.broadcast-summary strong { font-size: 12px; }
.success-text { color: var(--success); }
.compliance-note { padding: 11px; border-radius: 11px; color: var(--ink-soft); background: #f5f4f8; font-size: 9px !important; }

.assistant-shell {
  display: grid;
  min-height: min(700px, calc(100vh - 150px));
  overflow: hidden;
}

.assistant-intro {
  position: relative;
  padding: 25px;
  color: #fff;
  background: #242039;
}

.assistant-intro::after {
  position: absolute;
  top: -60px;
  right: -60px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(91,63,214,.66);
  content: "";
}

.assistant-intro > * { position: relative; z-index: 2; }
.assistant-intro h2 { margin: 17px 0 8px; font-size: 24px; }
.assistant-intro p { max-width: 380px; color: rgba(255,255,255,.65); }

.prompt-chips {
  display: flex;
  margin-top: 20px;
  flex-wrap: wrap;
  gap: 7px;
}

.prompt-chip {
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 999px;
  color: #fff;
  background: rgba(255,255,255,.07);
  font-size: 10px;
  cursor: pointer;
}

.assistant-chat {
  display: flex;
  min-height: 470px;
  flex-direction: column;
  background: #fff;
}

.assistant-messages {
  display: flex;
  padding: 22px;
  flex: 1;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
}

.assistant-bubble {
  max-width: 88%;
  padding: 12px 14px;
  border-radius: 15px 15px 15px 4px;
  color: #3f3b53;
  background: #f1effb;
  font-size: 12px;
  line-height: 1.55;
}

.assistant-bubble.user {
  align-self: flex-end;
  border-radius: 15px 15px 4px 15px;
  color: #fff;
  background: var(--brand);
}

.assistant-composer {
  display: flex;
  padding: 14px;
  gap: 8px;
  border-top: 1px solid var(--line);
}

.assistant-composer .button { flex: 0 0 auto; }

.settings-layout {
  display: grid;
  gap: 16px;
}

.settings-nav {
  display: flex;
  padding: 5px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  gap: 4px;
}

.settings-nav button {
  flex: 0 0 auto;
  padding: 9px 12px;
  border: 0;
  border-radius: 10px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.settings-nav button.active { color: var(--brand); background: var(--brand-soft); }

.integration-list { display: grid; margin-top: 16px; gap: 10px; }

.settings-content {
  display: grid;
  gap: 16px;
}

.integrations-card code {
  padding: 2px 5px;
  border-radius: 5px;
  color: var(--brand-dark);
  background: var(--brand-soft);
  font-size: 10px;
}

.integration-row {
  display: flex;
  padding: 13px;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
}

.integration-logo {
  display: grid;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 12px;
  color: var(--brand);
  background: var(--brand-soft);
}

.integration-logo svg { width: 20px; height: 20px; }
.integration-copy { min-width: 0; flex: 1; }
.integration-copy strong { display: block; font-size: 12px; }
.integration-copy span { display: block; margin-top: 3px; color: var(--ink-soft); font-size: 10px; }

.not-connected {
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 700;
}

.empty-state {
  display: grid;
  min-height: 330px;
  padding: 30px 20px;
  place-items: center;
  text-align: center;
}

.empty-state .section-icon { width: 52px; height: 52px; margin: 0 auto 15px; border-radius: 16px; }
.empty-state .section-icon svg { width: 24px; height: 24px; }
.empty-state h2 { margin: 0; font-size: 18px; }
.empty-state p { max-width: 380px; margin: 8px auto 18px; color: var(--ink-soft); font-size: 12px; line-height: 1.55; }

.service-grid {
  display: grid;
  gap: 14px;
}

.service-card {
  overflow: hidden;
}

.service-cover {
  position: relative;
  display: flex;
  min-height: 130px;
  padding: 18px;
  align-items: flex-end;
  justify-content: space-between;
  color: #fff;
  background: #6a4bd7;
}

.service-cover::after {
  position: absolute;
  top: -42px;
  right: -24px;
  width: 128px;
  height: 128px;
  border: 28px solid rgba(255,255,255,.12);
  border-radius: 50%;
  content: "";
}

.service-cover.pastry { background: #bd6254; }
.service-cover > span { display: grid; width: 43px; height: 43px; place-items: center; border-radius: 13px; background: rgba(255,255,255,.14); }
.service-cover svg { width: 23px; height: 23px; }
.service-cover small { position: relative; z-index: 2; padding: 6px 8px; border-radius: 999px; background: rgba(0,0,0,.18); font-size: 9px; font-weight: 700; }
.service-body { padding: 18px; }
.service-body h2 { margin: 13px 0 5px; font-size: 17px; }
.service-body > p { margin: 0; color: var(--ink-soft); font-size: 11px; }
.service-body dl { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); margin: 18px 0; gap: 7px; }
.service-body dl div { padding: 9px; border-radius: 10px; background: #f7f6fa; }
.service-body dt { color: var(--ink-faint); font-size: 8px; }
.service-body dd { margin: 4px 0 0; overflow: hidden; font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }

.add-service-card {
  display: grid;
  min-height: 330px;
  padding: 30px;
  place-content: center;
  justify-items: center;
  border-style: dashed;
  color: var(--ink-soft);
  text-align: center;
  cursor: pointer;
}

.add-service-card:hover { border-color: #bcb2ee; background: var(--brand-softer); }
.add-service-card strong { margin-top: 14px; color: var(--ink); font-size: 13px; }
.add-service-card small { margin-top: 5px; font-size: 9px; }

.brand-preview { align-self: start; }
.logo-upload { display: flex; padding: 15px; align-items: center; gap: 11px; border: 1px dashed #d7d4e5; border-radius: 13px; }
.logo-upload strong { display: block; font-size: 12px; }
.logo-upload small { display: block; margin-top: 4px; color: var(--brand); font-size: 9px; }
.color-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); margin-top: 16px; gap: 10px; }
.color-row label { display: grid; padding: 10px; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 11px; }
.color-row label > span { grid-column: 1/-1; color: var(--ink-soft); font-size: 9px; }
.color-row input { width: 30px; height: 30px; padding: 0; overflow: hidden; border: 0; border-radius: 8px; background: none; }
.color-row strong { font-size: 10px; }
.brand-voice { margin-top: 16px; padding: 14px; border-radius: 12px; color: #514d66; background: var(--brand-softer); }
.brand-voice span { color: var(--brand); font-size: 9px; font-weight: 750; text-transform: uppercase; }
.brand-voice p { margin: 7px 0 0; font-size: 11px; line-height: 1.55; }

.mobile-nav {
  position: fixed;
  z-index: 50;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  height: calc(68px + env(safe-area-inset-bottom));
  padding: 7px 6px env(safe-area-inset-bottom);
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,.97);
  box-shadow: 0 -8px 24px rgba(36,31,61,.06);
  backdrop-filter: blur(14px);
}

.mobile-nav button {
  position: relative;
  display: flex;
  min-width: 0;
  padding: 4px 2px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  color: var(--ink-faint);
  background: transparent;
  font-size: 9px;
  font-weight: 650;
  cursor: pointer;
  gap: 4px;
}

.mobile-nav button svg { width: 21px; height: 21px; }
.mobile-nav button.active { color: var(--brand); }
.mobile-nav button.active::before {
  position: absolute;
  top: -7px;
  width: 26px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--brand);
  content: "";
}

.mobile-nav .nav-badge {
  position: absolute;
  top: 3px;
  left: calc(50% + 9px);
  display: grid;
  width: 15px;
  height: 15px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: var(--danger);
  font-size: 7px;
  font-style: normal;
  font-weight: 800;
}

.mobile-drawer-backdrop {
  position: fixed;
  z-index: 70;
  inset: 0;
  background: rgba(24,22,36,.45);
  backdrop-filter: blur(3px);
}

.mobile-drawer {
  position: fixed;
  z-index: 80;
  right: 0;
  bottom: 0;
  left: 0;
  max-height: 84vh;
  padding: 8px 16px calc(20px + env(safe-area-inset-bottom));
  overflow-y: auto;
  border-radius: 24px 24px 0 0;
  background: #fff;
  box-shadow: 0 -20px 50px rgba(25,21,48,.2);
  transform: translateY(105%);
  transition: transform 220ms ease;
}

.mobile-drawer.open { transform: translateY(0); }
.drawer-handle { width: 40px; height: 4px; margin: 0 auto 15px; border-radius: 3px; background: #d8d6e1; }

.drawer-heading {
  display: flex;
  margin-bottom: 14px;
  align-items: center;
  justify-content: space-between;
}

.drawer-heading span { display: block; margin-bottom: 3px; color: var(--ink-soft); font-size: 10px; }
.drawer-heading strong { font-size: 18px; }

#drawerNav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

#drawerNav button {
  display: flex;
  min-height: 58px;
  padding: 10px;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  font-size: 11px;
  font-weight: 680;
  text-align: left;
  cursor: pointer;
}

#drawerNav button > svg {
  box-sizing: border-box;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 8px;
  border-radius: 10px;
  color: var(--brand);
  background: var(--brand-soft);
}

#drawerNav button > span { min-width: 0; flex: 1; }
#drawerNav button.active { border-color: #cfc7fa; background: var(--brand-softer); }

.drawer-account {
  display: flex;
  margin-top: 14px;
  padding: 13px;
  align-items: center;
  gap: 10px;
  border-radius: 13px;
  background: #f5f4f9;
}

.avatar {
  display: grid;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
}

.account-copy { min-width: 0; flex: 1; }
.account-copy strong { display: block; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.account-copy span { display: block; overflow: hidden; margin-top: 3px; color: var(--ink-soft); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }

.toast-region {
  position: fixed;
  z-index: 100;
  right: 14px;
  bottom: calc(80px + env(safe-area-inset-bottom));
  left: 14px;
  display: grid;
  justify-items: center;
  pointer-events: none;
  gap: 8px;
}

.toast {
  display: flex;
  width: min(100%, 390px);
  padding: 12px 14px;
  align-items: center;
  gap: 9px;
  border-radius: 12px;
  color: #fff;
  background: #262333;
  box-shadow: var(--shadow-md);
  font-size: 11px;
  animation: toast-in 220ms ease both;
}

.toast svg { width: 17px; height: 17px; color: #9d8dff; }
.toast.leaving { animation: toast-out 180ms ease both; }

@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

.offline-banner {
  position: fixed;
  z-index: 110;
  top: 8px;
  left: 50%;
  width: max-content;
  max-width: calc(100% - 24px);
  padding: 8px 12px;
  border-radius: 999px;
  color: #fff;
  background: #3a364a;
  box-shadow: var(--shadow-md);
  font-size: 10px;
  transform: translateX(-50%);
}

@media (min-width: 560px) {
  .page-content { padding-inline: 22px; }
  .connection-pill { display: inline-flex; }
  .welcome-card { padding: 29px; }
  .metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  .metric-grid.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric-card { padding: 17px; }
  .quick-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .template-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .toolbar { grid-template-columns: minmax(220px, 1fr) auto; align-items: center; }
  .field-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .choice-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kanban { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .studio-prompt { grid-template-columns: minmax(0,1fr) auto; align-items: end; }
  .studio-prompt .button { min-height: 92px; padding-inline: 20px; }
  .service-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (min-width: 900px) {
  .app-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
  .sidebar {
    position: sticky;
    z-index: 40;
    top: 0;
    display: flex;
    height: 100vh;
    padding: 24px 15px 16px;
    flex-direction: column;
    border-right: 1px solid var(--line);
    background: #fff;
  }
  .brand { padding: 0 9px; }
  .brand-copy strong { display: block; font-size: 18px; line-height: 1; letter-spacing: -.04em; }
  .brand-copy small { display: block; margin-top: 4px; color: var(--brand); font-size: 7px; font-weight: 840; letter-spacing: .22em; }
  .desktop-nav { display: grid; margin-top: 35px; gap: 5px; }
  .desktop-nav button {
    position: relative;
    display: flex;
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    align-items: center;
    gap: 11px;
    border: 0;
    border-radius: 12px;
    color: var(--ink-soft);
    background: transparent;
    font-size: 12px;
    font-weight: 650;
    text-align: left;
    cursor: pointer;
    transition: color 150ms ease, background 150ms ease;
  }
  .desktop-nav button svg { width: 19px; height: 19px; }
  .desktop-nav button:hover { color: var(--ink); background: #f7f6fa; }
  .desktop-nav button.active { color: var(--brand); background: var(--brand-soft); }
  .desktop-nav button.active::before {
    position: absolute;
    top: 12px;
    bottom: 12px;
    left: -15px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--brand);
    content: "";
  }
  .nav-badge {
    display: grid;
    width: 18px;
    height: 18px;
    margin-left: auto;
    place-items: center;
    border-radius: 6px;
    color: #fff;
    background: var(--danger);
    font-size: 8px;
  }
  .sidebar-helper {
    display: flex;
    margin: auto 3px 14px;
    padding: 14px;
    align-items: flex-start;
    gap: 9px;
    border-radius: 14px;
    color: #fff;
    background: #282438;
  }
  .helper-icon { display: grid; flex: 0 0 auto; width: 27px; height: 27px; place-items: center; border-radius: 8px; color: #c2b8ff; background: rgba(255,255,255,.09); }
  .helper-icon svg { width: 15px; height: 15px; }
  .sidebar-helper strong { display: block; font-size: 10px; }
  .sidebar-helper p { margin: 5px 0 9px; color: rgba(255,255,255,.55); font-size: 9px; line-height: 1.4; }
  .sidebar-helper .text-button { color: #bcb0ff; font-size: 9px; }
  .sidebar-account { display: flex; padding: 12px 9px 0; align-items: center; gap: 9px; border-top: 1px solid var(--line); }
  .topbar { height: 72px; padding: 0 26px; }
  .mobile-brand { display: none; }
  .topbar-title { display: block; }
  .breadcrumb { display: block; margin-bottom: 3px; color: var(--ink-faint); font-size: 9px; }
  .topbar-title strong { font-size: 14px; }
  .page-content { min-height: calc(100vh - 72px); padding: 26px 28px 42px; }
  .mobile-nav { display: none; }
  .mobile-drawer, .mobile-drawer-backdrop { display: none !important; }
  .toast-region { right: 24px; bottom: 24px; left: auto; justify-items: end; }
  .dashboard-grid { grid-template-columns: minmax(0, 1.55fr) minmax(290px, .85fr); }
  .dashboard-span { grid-column: 1 / -1; }
  .section-grid.form-preview { grid-template-columns: minmax(0, 1.4fr) minmax(310px, .6fr); }
  .whatsapp-layout { grid-template-columns: 320px minmax(0, 1fr); }
  .chat-list-panel { border-right: 1px solid var(--line); border-bottom: 0; }
  .assistant-shell { grid-template-columns: minmax(280px, .75fr) minmax(0, 1.25fr); }
  .settings-layout { grid-template-columns: 180px minmax(0, 1fr); align-items: start; }
  .settings-nav { position: sticky; top: 95px; display: grid; padding: 6px; overflow: visible; }
  .settings-nav button { text-align: left; }
  .service-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

@media (min-width: 1180px) {
  :root { --sidebar-width: 272px; }
  .page-content { padding-inline: 36px; }
  .welcome-card { min-height: 218px; padding: 34px; grid-template-columns: 1fr 300px; }
  .welcome-art { position: relative; display: block; }
  .floating-ad {
    position: absolute;
    top: 13px;
    right: 29px;
    width: 126px;
    padding: 8px;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 14px;
    background: rgba(255,255,255,.12);
    box-shadow: 0 15px 35px rgba(0,0,0,.15);
    transform: rotate(6deg);
    backdrop-filter: blur(7px);
  }
  .floating-ad-screen { display: grid; aspect-ratio: 1; padding: 12px; place-items: center; border-radius: 9px; color: #2b2341; background: #ffcf75; font-size: 13px; font-weight: 800; line-height: 1.05; text-align: center; }
  .floating-ad-lines { display: grid; margin-top: 7px; gap: 4px; }
  .floating-ad-lines span { height: 4px; border-radius: 4px; background: rgba(255,255,255,.35); }
  .floating-ad-lines span:last-child { width: 65%; }
  .floating-message {
    position: absolute;
    top: 117px;
    left: 18px;
    display: flex;
    width: 180px;
    padding: 10px;
    align-items: center;
    gap: 8px;
    border-radius: 12px;
    color: var(--ink);
    background: #fff;
    box-shadow: 0 14px 30px rgba(0,0,0,.18);
    transform: rotate(-3deg);
  }
  .floating-message i { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 50%; color: #fff; background: var(--whatsapp); font-size: 11px; font-style: normal; }
  .floating-message strong { display: block; font-size: 9px; }
  .floating-message span { display: block; margin-top: 3px; color: var(--ink-soft); font-size: 7px; }
  .metric-card { padding: 20px; }
  .metric-grid.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .panel-card { padding: 21px; }
  .quick-action { min-height: 125px; }
}

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

@media print {
  .sidebar, .topbar, .mobile-nav { display: none !important; }
  .app-shell { display: block; }
  .page-content { padding: 0; }
  body { background: #fff; }
}
