/* Dizaê — sistema visual do painel.
   Tokens em :root (tema claro) e [data-theme=dark] / prefers-color-scheme (escuro). */

:root {
  --side: #520155; --side-2: #ffffff; --side-line: #6e2470; --side-text: #ffffff; --side-muted: #d9b8db; --side-active: #711d45;
  --bg: #f4f2ee; --surface: #ffffff; --surface-2: #fbfaf8; --line: #e4dfd7; --line-strong: #cfc8bd;
  --ink: #1b1a18; --muted: #5b5750; --faint: #807a71;
  --accent: #fda000; --accent-hover: #e08e00; --accent-soft: #fff1d6; --accent-ink: #7a4a00;
  --ok: #1c6b45; --ok-soft: #e2f3ea; --warn: #8a4b00; --warn-soft: #fdf0dc; --danger: #a11d1d; --danger-soft: #fbe3e3;
  --info: #1e5a8a; --info-soft: #e3eef8; --dizae-soft: #fff4ec; --team-soft: #e8f2fb;
  --cat-1: #2a78d6; --cat-2: #eb6834; --cat-3: #1baf7a; --cat-4: #eda100;
  --radius: 20px; --radius-sm: 14px; --shadow: 0 1px 2px rgb(27 26 24 / 5%), 0 6px 20px rgb(27 26 24 / 5%);
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Bricolage Grotesque', 'Manrope', system-ui, sans-serif;
  --focus: 0 0 0 3px #fff, 0 0 0 5px var(--accent);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --side: #16181b; --side-2: #1a1d20; --side-line: #2e3237; --side-text: #f1efeb; --side-muted: #b3ada4; --side-active: var(--accent-soft);
    --bg: #111315; --surface: #1a1d20; --surface-2: #202428; --line: #2e3237; --line-strong: #3d434a;
    --ink: #f1efeb; --muted: #b3ada4; --faint: #948e85;
    --accent: #f08a4b; --accent-hover: #f5a06b; --accent-soft: #3a2518; --accent-ink: #ffc9a6;
    --ok: #74d6a0; --ok-soft: #173327; --warn: #f5c16c; --warn-soft: #3a2c13; --danger: #ff9b9b; --danger-soft: #3d1a1a;
    --info: #8cc4f2; --info-soft: #172b3d; --dizae-soft: #2b2119; --team-soft: #182a39;
    --cat-1: #3987e5; --cat-2: #d95926; --cat-3: #199e70; --cat-4: #c98500;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%);
    --focus: 0 0 0 3px #111315, 0 0 0 5px var(--accent);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --side: #16181b; --side-2: #1a1d20; --side-line: #2e3237; --side-text: #f1efeb; --side-muted: #b3ada4; --side-active: var(--accent-soft);
  --bg: #111315; --surface: #1a1d20; --surface-2: #202428; --line: #2e3237; --line-strong: #3d434a;
  --ink: #f1efeb; --muted: #b3ada4; --faint: #948e85;
  --accent: #f08a4b; --accent-hover: #f5a06b; --accent-soft: #3a2518; --accent-ink: #ffc9a6;
  --ok: #74d6a0; --ok-soft: #173327; --warn: #f5c16c; --warn-soft: #3a2c13; --danger: #ff9b9b; --danger-soft: #3d1a1a;
  --info: #8cc4f2; --info-soft: #172b3d; --dizae-soft: #2b2119; --team-soft: #182a39;
  --cat-1: #3987e5; --cat-2: #d95926; --cat-3: #199e70; --cat-4: #c98500;
  --shadow: 0 1px 2px rgb(0 0 0 / 30%);
  --focus: 0 0 0 3px #111315, 0 0 0 5px var(--accent);
  color-scheme: dark;
}

/* Alto contraste — cores, bordas e textos mais fortes (data-contrast="high", em Personalizar). */
:root[data-contrast="high"] {
  --side: #ffffff; --side-2: #ffffff; --side-line: #726b5e; --side-text: #000000; --side-muted: #2e2b26; --side-active: var(--accent-soft);
  --bg: #ffffff; --surface: #ffffff; --surface-2: #f2f1ee; --line: #726b5e; --line-strong: #3a362f;
  --ink: #000000; --muted: #2e2b26; --faint: #45413a;
  --accent: #9c3705; --accent-hover: #7c2c04; --accent-soft: #fbe0cf; --accent-ink: #5c2603;
  --ok: #0c4a2e; --ok-soft: #d3ecdd; --warn: #5c3200; --warn-soft: #fbe6c2; --danger: #6e1010; --danger-soft: #f8d3d3;
  --info: #0d3f66; --info-soft: #d3e6f5;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"])[data-contrast="high"] {
    --side: #000000; --side-2: #000000; --side-line: #8a9198; --side-text: #ffffff; --side-muted: #e2ded6; --side-active: var(--accent-soft);
    --bg: #000000; --surface: #000000; --surface-2: #121212; --line: #8a9198; --line-strong: #c3c9ce;
    --ink: #ffffff; --muted: #e2ded6; --faint: #c7c1b7;
    --accent: #ffab6e; --accent-hover: #ffbd8c; --accent-soft: #4a2c15; --accent-ink: #ffd2ac;
    --ok: #9df0c0; --ok-soft: #0f3322; --warn: #ffd699; --warn-soft: #4a3210; --danger: #ffb3b3; --danger-soft: #4a1616;
    --info: #b7ddfa; --info-soft: #143148;
  }
}
:root[data-theme="dark"][data-contrast="high"] {
  --side: #000000; --side-2: #000000; --side-line: #8a9198; --side-text: #ffffff; --side-muted: #e2ded6; --side-active: var(--accent-soft);
  --bg: #000000; --surface: #000000; --surface-2: #121212; --line: #8a9198; --line-strong: #c3c9ce;
  --ink: #ffffff; --muted: #e2ded6; --faint: #c7c1b7;
  --accent: #ffab6e; --accent-hover: #ffbd8c; --accent-soft: #4a2c15; --accent-ink: #ffd2ac;
  --ok: #9df0c0; --ok-soft: #0f3322; --warn: #ffd699; --warn-soft: #4a3210; --danger: #ffb3b3; --danger-soft: #4a1616;
  --info: #b7ddfa; --info-soft: #143148;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 500 15px/1.5 var(--font); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h2 { font-size: 17px; font-weight: 800; }
p { margin: 0; }
a { color: var(--accent); font-weight: 700; text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: 10px; background: var(--ink); color: var(--bg); }
.skip-link:focus { top: 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hint { color: var(--muted); font-size: 13px; }
.icon { flex-shrink: 0; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* ------------------------------------------------------------------ Estrutura */
.app { display: flex; min-height: 100vh; min-height: 100dvh; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { flex: 1; padding: 24px 32px 40px; display: flex; flex-direction: column; gap: 20px; max-width: 1480px; width: 100%; margin: 0 auto; }
.content:focus { outline: none; }

/* Menu lateral */
.sidebar { width: 264px; flex-shrink: 0; background: var(--side); color: var(--side-text); position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; z-index: 40; }
.sidebar-inner { display: flex; flex-direction: column; min-height: 100%; padding: 18px 14px; gap: 2px; }
.sidebar-top { display: flex; justify-content: flex-end; min-height: 0; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.brand-mark { width: 48px; height: 48px; border-radius: 12px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; padding: 6px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; flex: 1; }
.brand-text strong { color: var(--ink); font: 700 19px/1.1 var(--display); }
.brand-text span { color: var(--side-muted); font-size: 12px; }
.brand-light .brand-text strong { color: var(--ink); }
.brand-light .brand-text span { color: var(--muted); }
.icon-button.sidebar-close { display: none; color: var(--side-text); }
.tenant { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; padding: 10px; border: 1px solid var(--side-line); border-radius: 12px; background: var(--side-2); }
.tenant-logo { width: 42px; height: 42px; border-radius: 10px; background: #fff; display: grid; place-items: center; overflow: hidden; }
.tenant-logo img { width: 36px; height: auto; }
.brand-logo-preview { width: 88px; height: 88px; flex: 0 0 88px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 16px; background: #fff; overflow: hidden; color: #20252a; font: 800 38px var(--display); }
.brand-logo-preview img { max-width: 76px; max-height: 76px; width: auto; height: auto; object-fit: contain; }
.tenant-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.tenant-text strong { color: var(--ink); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.tenant-text span { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group-title { display: flex; align-items: center; justify-content: space-between; width: 100%; margin: 0; padding: 16px 12px 6px; border: 0; background: transparent; font: 800 11px var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--side-muted); cursor: pointer; text-align: left; }
.nav-group-title:hover { color: var(--side-text); }
.nav-group-chev { transition: transform .15s ease; flex-shrink: 0; }
.nav-group.is-collapsed .nav-group-chev { transform: rotate(-90deg); }
.nav-group-items { display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.nav-group.is-collapsed .nav-group-items { display: none; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 14px; border-radius: 99px; color: var(--side-text); text-decoration: none; font-weight: 700; font-size: 14.5px; }
.nav-link:hover { background: var(--side-active); color: var(--side-text); }
.nav-link.is-active { background: var(--accent); color: var(--side); font-weight: 800; box-shadow: none; }
.nav-link.is-active .badge { background: #fff; color: var(--side); }
.nav-logout { margin: 0; }
.nav-logout .nav-link { width: 100%; border: 0; background: none; font: inherit; cursor: pointer; text-align: left; }
.nav-label { flex: 1; }
.soon { padding: 2px 7px; border-radius: 99px; border: 1px solid var(--side-line); color: var(--side-muted); font-size: 11px; font-weight: 700; }
.nav-spacer { flex: 1; min-height: 16px; }
.sidebar-footer { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; margin-top: 14px; padding: 18px 10px; border-radius: 18px; background: var(--side-active); }
.sidebar-footer .brand-mark { margin-bottom: 2px; }
.sidebar-footer strong { color: var(--side-text); font: 700 15px/1.2 var(--display); }
.sidebar-footer > span:not(.nav-version) { color: var(--side-muted); font-size: 11px; }
.nav-version { padding: 0 12px 8px; color: var(--side-muted); font-size: 11px; text-align: center; }
.dot { width: 8px; height: 8px; border-radius: 99px; flex-shrink: 0; }
.dot-on { background: #3ddc84; animation: dizae-pulse 1.8s ease-in-out infinite; }
.dot-off { background: #8b929b; }
.dot-idle { background: #f5c16c; }
@keyframes dizae-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .dot-on { animation: none; } }
.scrim { position: fixed; inset: 0; background: rgb(0 0 0 / 45%); z-index: 35; }

/* Topo */
.topbar { display: flex; align-items: center; gap: 14px; padding: 18px 32px; border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 20; }
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font: 700 26px/1.15 var(--display); }
.topbar-title p { color: var(--muted); font-size: 14px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-button.menu-button { display: none; }
.topbar-search { width: 320px; }
.search-field { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--muted); }
.search-field:focus-within { box-shadow: var(--focus); }
.search-field input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font: inherit; color: var(--ink); }
.icon-button { width: 44px; height: 44px; flex-shrink: 0; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; }
.icon-button:hover { border-color: var(--line-strong); color: var(--ink); }
.topbar-alert { position: relative; }
.topbar-alert.has-alerts { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }
.topbar-alert-count { position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px; padding: 0 5px; display: grid; place-items: center; border-radius: 99px; background: var(--danger); color: white; font: 800 11px var(--font); }
.topbar-alert-count[hidden] { display: none; }
.sound-toggle.is-on { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); background: var(--ok-soft); }
.contrast-toggle.is-on { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); background: var(--ok-soft); }
.accent-picker { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.accent-picker input[type="color"] { width: 44px; height: 44px; padding: 2px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); cursor: pointer; }
.accent-picker input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
.accent-picker input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 8px; }
.accent-saved { display: inline-flex; align-items: center; gap: 4px; color: var(--ok); font-weight: 700; }
.accent-saved svg { width: 14px; height: 14px; }
.theme-light { display: none; }
[data-theme="dark"] .theme-dark { display: none; }
[data-theme="dark"] .theme-light { display: block; }
@media (prefers-color-scheme: dark) { [data-theme="auto"] .theme-dark { display: none; } [data-theme="auto"] .theme-light { display: block; } }
.bot-toggle-form { margin: 0; }
.bot-toggle { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px 0 10px; border-radius: 99px; font: 800 14px var(--font); cursor: pointer; white-space: nowrap; }
.bot-toggle.is-on { background: var(--ok-soft); color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent); }
.bot-toggle.is-off { background: var(--warn-soft); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); }
span.bot-toggle { cursor: default; }
.bot-toggle-short { display: none; }
.switch { width: 38px; height: 22px; border-radius: 99px; display: flex; align-items: center; padding: 0 3px; }
.switch span { width: 16px; height: 16px; border-radius: 99px; background: #fff; }
.is-on .switch { background: var(--ok); justify-content: flex-end; }
.is-off .switch { background: #9a9389; justify-content: flex-start; }

/* Menu inferior (celular) */
.bottom-nav { display: none; }

/* --------------------------------------------------------------- Componentes */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card-inner { box-shadow: none; background: var(--surface-2); }
.card-hero { background: var(--side); border-color: var(--side); color: #fff; }
.card-hero h2 { color: #fff; }
.card-hero .muted { color: var(--side-muted); }
.card-hero .facts dt { color: #F0D9F1; }
.card-hero .facts dd { color: #fff; }
.card-flush { padding: 0; gap: 0; overflow: hidden; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-head > div { min-width: 0; flex: 1 1 240px; display: flex; flex-direction: column; gap: 3px; }
.card-head p { font-size: 13.5px; }
.card-head.padded { padding: 16px 18px; border-bottom: 1px solid var(--line); align-items: center; }
.card-head > .card-head-actions { flex: 0 0 auto; flex-direction: row; align-items: center; gap: 8px; }
.card-links { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; }
.grid { display: grid; gap: 20px; }
.grid-2-1 { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-lg { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.wrap { gap: 6px; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spaced { margin-top: 12px; }
.time { margin-left: auto; color: var(--muted); font-size: 12.5px; font-weight: 600; white-space: nowrap; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--ink); font: 800 14px var(--font); text-decoration: none; cursor: pointer; white-space: nowrap; }
.button:hover { border-color: var(--ink); color: var(--ink); }
.button-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
[data-theme="dark"] .button-primary, :root:not([data-theme="light"]) .button-primary { color: #fff; }
.button-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.button-dark { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.button-dark:hover { opacity: .9; color: var(--bg); }
.button-ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 40%, transparent); color: var(--ok); }
.button-danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 40%, transparent); color: var(--danger); }
.button-small { min-height: 36px; padding: 0 12px; font-size: 13px; }
.button-block { width: 100%; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 800; white-space: nowrap; text-decoration: none; }
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.chip-danger { background: var(--danger-soft); color: var(--danger); }
.chip-info { background: var(--info-soft); color: var(--info); }
.chip-accent { background: var(--accent-soft); color: var(--accent-ink); }
.chip-muted { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { min-width: 22px; padding: 1px 7px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; text-align: center; }
.avatar { width: 40px; height: 40px; flex-shrink: 0; border-radius: 99px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); font-weight: 800; }
.avatar-accent { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.avatar-lg { width: 64px; height: 64px; font-size: 24px; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; font-weight: 800; min-width: 0; }
.field.inline { flex-direction: row; align-items: center; }
input[type="text"], input[type="search"], input[type="password"], input[type="time"], input[type="date"], input[type="url"], input[type="email"], input[type="tel"], input[type="number"], input:not([type]), select, textarea {
  width: 100%; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--ink); font: 500 15px var(--font);
}
input[type="number"] { font-variant-numeric: tabular-nums; }
.search-field input[type="search"] { min-height: 0; padding: 0; border: 0; background: transparent; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; box-shadow: var(--focus); }
input[type="file"] { font: 600 14px var(--font); color: var(--muted); max-width: 100%; }
.code-area { min-height: 60vh; font: 500 14px/1.55 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; }
.code-block { max-height: 320px; overflow: auto; margin: 10px 0 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); font: 500 13px/1.55 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
.reveal-field { display: flex; gap: 8px; align-items: center; }
.reveal-field input { flex: 1; }
.check { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); flex-shrink: 0; }
.check span { display: flex; flex-direction: column; gap: 2px; }
.check small { color: var(--muted); font-size: 13px; font-weight: 500; }
.check.compact { padding: 8px 10px; background: transparent; border: 0; align-items: center; }
.inline-form { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.inline-form input { width: 150px; }
.form-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.setup-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: start; }
.setup-address-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, .75fr); gap: 12px; }
.setup-street { grid-column: span 2; }
.setup-notes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.setup-hours { min-width: 550px; }
.setup-hours .check.compact { padding: 4px 2px; white-space: nowrap; }

.segmented { display: flex; flex-wrap: wrap; gap: 8px; }
.segment { min-width: 76px; min-height: 44px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface-2); color: var(--ink); font: 800 14.5px var(--font); cursor: pointer; }
.segment:hover { border-color: var(--ink); }
.segment.is-selected { background: var(--accent); border-color: var(--accent); color: #fff; }

.disclosure { border-top: 1px solid var(--line); padding-top: 12px; }
.disclosure > summary { cursor: pointer; font-weight: 800; color: var(--muted); min-height: 32px; display: flex; align-items: center; gap: 6px; }
.disclosure[open] > summary { margin-bottom: 10px; }
.disclosure > .button { margin-top: 10px; }

.facts { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.facts > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.facts dt { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; }
.facts dd { margin: 0; font-weight: 800; text-align: right; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.kpi-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; font-weight: 700; }
.kpi strong { font: 800 34px/1.1 var(--display); }
.kpi-note { color: var(--muted); font-size: 13px; }

.notice { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: var(--radius); background: var(--warn-soft); color: var(--warn); text-decoration: none; font-weight: 600; }
.notice span { flex: 1; }
.notice:hover { color: var(--warn); filter: brightness(.98); }
.notice-soft { background: var(--accent-soft); color: var(--accent-ink); }

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.list > li + li { border-top: 1px solid var(--line); }
.list.compact > li { padding: 10px 0; }
.list.compact .row { justify-content: space-between; }
.queue-item { display: flex; gap: 14px; padding: 20px 0; }
.queue-item:first-child { padding-top: 0; }
.queue-item.is-late .time { color: var(--warn); }
.queue-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.queue-body p { color: var(--muted); }
.queue-body .reason { color: var(--ink); font-weight: 600; }
.conv-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; text-decoration: none; color: var(--ink); }
.conv-row:hover strong { color: var(--accent); }
.conv-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.conv-text span { color: var(--muted); font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.more-link { font-size: 14px; padding: 12px 0 0; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); }
.empty strong { color: var(--ink); }
.plain-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.summary { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; }
.summary span { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 13px; color: var(--accent-ink); }
.quote { padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 13.5px; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.unanswered-card { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.unanswered-card .quote { color: var(--ink); overflow-wrap: anywhere; }
.ask-title { font-size: 14px; font-weight: 800; }
.ask-question { flex: 1 1 220px; min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.site-source { overflow-wrap: anywhere; }
.unanswered-card .inline-form { margin-top: auto; }
.notice-urgent {
  background: linear-gradient(135deg, var(--danger-soft), color-mix(in srgb, var(--danger) 16%, var(--danger-soft)));
  color: var(--danger); border: 2px solid var(--danger); font-size: 15px; padding: 16px 20px;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--danger) 22%, transparent);
  animation: notice-urgent-glow 2s ease-in-out infinite;
}
.notice-urgent:hover { color: var(--danger); }
.notice-urgent .icon { animation: dizae-pulse 1.1s ease-in-out infinite; flex-shrink: 0; }
@keyframes notice-urgent-glow {
  0%, 100% { box-shadow: 0 6px 20px color-mix(in srgb, var(--danger) 22%, transparent), 0 0 0 0 color-mix(in srgb, var(--danger) 45%, transparent); }
  50% { box-shadow: 0 6px 20px color-mix(in srgb, var(--danger) 22%, transparent), 0 0 0 7px color-mix(in srgb, var(--danger) 0%, transparent); }
}
@media (prefers-reduced-motion: reduce) { .notice-urgent, .notice-urgent .icon { animation: none; } }
.knowledge-item { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 14px 0; }
.knowledge-item p { color: var(--muted); margin-top: 4px; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tab { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-bottom: 3px solid transparent; color: var(--muted); text-decoration: none; font-weight: 700; }
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 800; }
.agent-head { flex-direction: row; align-items: center; gap: 16px; }
.agent-mark { width: 56px; height: 56px; border-radius: 16px; background: var(--accent); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.agent-head h2 { font: 700 24px var(--display); }
.hero-soon { flex-direction: row; align-items: flex-start; gap: 18px; max-width: 900px; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table.setup-hours thead th { padding: 7px 6px; }
.table.setup-hours tbody th, .table.setup-hours tbody td { padding: 3px 6px; }
.table.setup-hours input.time-24 { min-width: 110px; min-height: 44px; padding: 5px 8px; }
.table thead th { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); }
.table tbody tr:last-child > * { border-bottom: 0; }
.table-numbers td { font-variant-numeric: tabular-nums; }
.hours-table input.time-24 { max-width: 180px; }
.client-link { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.client-link:hover strong { color: var(--accent); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; flex: 1; }
.toolbar .search-field { min-width: 220px; flex: 1; max-width: 360px; }
.toolbar select { width: auto; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 16px; }
.segments { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.segment-card { display: flex; flex-direction: column; gap: 2px; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; }
.segment-card span { font-size: 13.5px; font-weight: 800; color: var(--muted); }
.segment-card strong { font: 700 30px/1.1 var(--display); }
.segment-card small { font-size: 12.5px; color: var(--muted); }
.segment-card:hover { border-color: var(--ink); color: var(--ink); }
.segment-card.is-active { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.segment-card.is-active span, .segment-card.is-active small { color: var(--bg); opacity: .85; }

.photo-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.photo-card { display: flex; flex-direction: column; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.photo-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }
.photo-card span { font-size: 13.5px; font-weight: 800; }
.photo-card form .button { width: 100%; }

.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; }
.checklist small { display: block; color: var(--muted); font-size: 13px; font-weight: 500; }
.check-icon { width: 32px; height: 32px; border-radius: 99px; display: grid; place-items: center; flex-shrink: 0; }
.check-icon.is-ok { background: var(--ok-soft); color: var(--ok); }
.check-icon.is-warn { background: var(--warn-soft); color: var(--warn); }

.flashes { display: flex; flex-direction: column; gap: 8px; }
.flash { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; font-weight: 700; }
.flash-ok { background: var(--ok-soft); color: var(--ok); }
.flash-error { background: var(--danger-soft); color: var(--danger); }
.flash-info { background: var(--info-soft); color: var(--ink); }
.flash-warn { background: var(--warn-soft); color: var(--ink); }
.flash-notice { align-items: flex-start; font-weight: 500; line-height: 1.5; }
.flash-notice > .icon { flex: none; margin-top: 2px; }
.flash-info.flash-notice > .icon { color: var(--info); }
.flash-warn.flash-notice > .icon { color: var(--warn); }
.flash-notice strong { font-weight: 700; }
.notice-stack { display: flex; flex-direction: column; gap: 6px; }
/* Contagem do teste grátis no aviso do topo. */
.trial-meter { display: block; max-width: 320px; height: 6px; margin: 8px 0; border-radius: 999px; background: var(--line); overflow: hidden; }
.trial-meter i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.flash-notice .button-small { margin-top: 2px; }
/* Início: o que o agente fez nos últimos 30 dias. */
.agent-value { margin-bottom: 16px; }
.agent-value-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px 20px; margin: 14px 0 0; }
.agent-value-grid dt { font-size: 13px; color: var(--muted); }
.agent-value-grid dd { margin: 4px 0 0; font-family: var(--display); font-size: 32px; font-weight: 800; line-height: 1.1; }
.agent-value-grid .is-closed dd { color: var(--accent); }
.first-chat { margin-bottom: 16px; }
.first-chat .wa-chat { min-height: 0; margin-top: 14px; border-radius: 14px; background: #efeae2; }
.notice-more > summary { cursor: pointer; width: max-content; font-size: 13px; font-weight: 600; color: var(--muted); padding: 2px 4px; }
.notice-more[open] > summary { margin-bottom: 6px; }
.usage-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--muted); text-decoration: none; font-size: 13px; }
.usage-bar:hover { border-color: var(--accent); color: var(--muted); }
.usage-bar strong { color: var(--ink); }
.usage-bar-track { flex: 1 1 160px; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.usage-bar-track > span { display: block; height: 100%; border-radius: inherit; background: var(--ok); }
.usage-bar-warn { border-color: var(--warn); background: var(--warn-soft); }
.usage-bar-warn .usage-bar-track > span { background: var(--warn); }
.usage-bar-danger { border-color: var(--danger); background: var(--danger-soft); }
.usage-bar-danger .usage-bar-track > span { background: var(--danger); }
.usage-bar-note { flex-basis: 100%; color: var(--ink); font-weight: 600; }

.sticky-actions { position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 35%); display: flex; justify-content: flex-end; }

/* Calendário de folgas */
.calendar { max-width: 420px; display: flex; flex-direction: column; gap: 10px; }
.calendar-head { display: flex; align-items: center; justify-content: space-between; }
.calendar-head strong { text-transform: capitalize; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.calendar-weekday { text-align: center; font-size: 11.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; padding: 4px 0; }
.calendar-day { min-height: 44px; border: 1px solid transparent; border-radius: 10px; background: var(--surface-2); color: var(--ink); font: 700 14px var(--font); cursor: pointer; }
.calendar-day:hover { border-color: var(--accent); }
.calendar-day.is-outside { background: transparent; color: var(--faint); }
.calendar-day.is-today { border-color: var(--accent); }
.calendar-day.is-selected { background: var(--accent); color: #fff; }
.calendar-day:disabled { opacity: .4; cursor: not-allowed; }
.calendar-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.calendar-chips button { border: 0; background: var(--accent-soft); color: var(--accent-ink); border-radius: 99px; padding: 4px 10px; font: 800 12.5px var(--font); cursor: pointer; }
.js .noscript-field { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------------------------------------------------------------- Conversas */
.inbox { display: grid; grid-template-columns: 340px minmax(0, 1fr) 300px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; height: min(640px, calc(100vh - 170px)); box-shadow: var(--shadow); }
.inbox-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; max-height: calc(100vh - 170px); }
.inbox-search { padding: 14px 14px 8px; }
.filters { display: flex; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 0 14px 12px; border-bottom: 1px solid var(--line); scrollbar-width: none; cursor: grab; }
.filters.is-dragging, .segmented.is-dragging { cursor: grabbing; user-select: none; scroll-snap-type: none; }
.filter { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 13px; }
.filter span { color: var(--muted); font-weight: 600; }
.filter.is-active { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.filter.is-active span { color: var(--bg); opacity: .8; }
.inbox-items { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; position: relative; }
.inbox-items .empty { margin: 14px; }
.inbox-item { display: flex; gap: 12px; padding: 14px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 500; }
.inbox-item:hover { background: var(--surface-2); color: var(--ink); }
.inbox-item.is-active { background: var(--dizae-soft); box-shadow: inset 3px 0 0 var(--accent); }
.inbox-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.inbox-text .preview { color: var(--muted); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-list .more-link { padding: 12px 14px; border-top: 1px solid var(--line); }
.inbox-thread { display: flex; flex-direction: column; min-width: 0; background: var(--bg); max-height: calc(100vh - 170px); }
.inbox-empty { justify-content: center; padding: 24px; }
.thread-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.thread-back { display: none; }
.thread-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.thread-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.thread-actions form { margin: 0; }
.thread { list-style: none; margin: 0; padding: 20px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; flex: 1; }
.day-sep { text-align: center; }
.day-sep span { display: inline-block; padding: 3px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 800; }
.bubble { max-width: min(560px, 85%); padding: 10px 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 4px; }
.bubble p { overflow-wrap: anywhere; }
.bubble-who { font-size: 12px; font-weight: 800; color: var(--muted); }
.bubble-client { align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble-dizae { align-self: flex-end; background: var(--dizae-soft); border-bottom-right-radius: 4px; }
.bubble-team { align-self: flex-end; background: var(--team-soft); border-bottom-right-radius: 4px; }
.bubble-team .bubble-who { color: var(--info); }
.bubble-failed { margin-top: 4px; padding: 6px 10px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); font-size: 13px; }
.bubble-extras { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.attachment { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 700; }
.wa-button { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--info); font-size: 13px; font-weight: 800; }
.quick-replies { border-top: 1px solid var(--line); padding: 10px 16px; background: var(--surface); }
.quick-replies summary { cursor: pointer; font-weight: 800; }
.quick-reply-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; max-height: 280px; overflow-y: auto; }
.quick-reply-list li { display: flex; flex-direction: column; gap: 4px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.quick-reply-list span:not(.actions) { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.thread-foot { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 13px; }
.inbox-client { border-left: 1px solid var(--line); padding: 18px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; max-height: calc(100vh - 170px); }
.client-head { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-bottom: 14px; border-bottom: 1px solid var(--line); text-align: center; }
.chat-demo { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 14px; background: var(--bg); }

/* ------------------------------------------------------------------ Login */
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--side); }
.auth-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 16px; }
.auth-card h1 { font: 700 26px var(--display); text-align: center; }
.auth-card > p.muted { text-align: center; }
.auth-card .brand { padding: 0 0 8px; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.auth-card .brand-mark { width: 76px; height: 76px; border-radius: 18px; padding: 10px; }
.auth-link { text-align: center; font-size: 13.5px; font-weight: 700; }
.auth-link a { color: var(--accent); }
.auth-code { text-align: center; font: 800 26px/1 var(--display); letter-spacing: 4px; }

/* ------------------------------------------------------------- Responsivo */
@media (max-width: 1280px) {
  .inbox { grid-template-columns: 320px minmax(0, 1fr); grid-template-rows: auto auto; }
  .inbox-list { grid-row: 1 / span 2; max-height: none; }
  .inbox-thread { max-height: 70vh; }
  .inbox-client { grid-column: 2; border-left: 0; border-top: 1px solid var(--line); max-height: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .inbox-client .client-head { grid-column: 1 / -1; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .topbar-search { display: none; }
  .grid-2-1 { grid-template-columns: minmax(0, 1fr); }
  .setup-grid { grid-template-columns: minmax(0, 1fr); }
  .segments { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1023px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 0 0 40px rgb(0 0 0 / 35%); }
  .sidebar.is-open { transform: none; }
  .icon-button.sidebar-close { display: inline-grid; background: transparent; border-color: var(--side-line); }
  .icon-button.menu-button { display: inline-grid; }
  .topbar { padding: 12px 20px; }
  .content { padding: 20px; }
}
@media (max-width: 760px) {
  body { font-size: 15px; padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .topbar { padding: 10px 14px; gap: 10px; }
  .topbar-title h1 { font-size: 20px; }
  .topbar-title p { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .icon-button.menu-button { display: none; }
  .bot-toggle { padding: 0 12px 0 8px; font-size: 12.5px; gap: 6px; }
  .bot-toggle .switch { font-size: 14px; }
  .bot-toggle-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .bot-toggle-short { display: inline; }
  .sticky-actions { bottom: calc(66px + env(safe-area-inset-bottom)); }
  .sticky-actions .button { flex: 1 1 auto; }
  .table.setup-hours { min-width: 0; }
  .setup-hours thead { display: none; }
  .setup-hours tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .table.setup-hours tbody th, .table.setup-hours tbody td { display: block; padding: 0; border: 0; }
  .setup-hours td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 4px; color: var(--muted); font-size: 12.5px; font-weight: 700; }
  .table.setup-hours input.time-24 { width: 100%; min-width: 0; max-width: none; }
  .content { padding: 14px; gap: 14px; }
  .card { padding: 16px; border-radius: 14px; }
  .kpis { gap: 10px; }
  .kpi { padding: 14px; }
  .kpi strong { font-size: 26px; }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .setup-grid, .setup-notes-grid { grid-template-columns: minmax(0, 1fr); }
  .setup-address-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .setup-street { grid-column: span 2; }
  .segmented { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; scrollbar-width: none; cursor: grab; }
  .segment { flex-shrink: 0; }
  .queue-item { flex-direction: column; gap: 10px; }
  .queue-item .avatar { display: none; }
  .inline-form { flex-wrap: wrap; }
  .inline-form input { width: 100%; }
  .actions .button, .actions .inline-form, .actions .inline-form .button { flex: 1 1 auto; }
  .table-clients th:nth-child(4), .table-clients td:nth-child(4), .table-clients th:nth-child(6), .table-clients td:nth-child(6) { display: none; }
  .agent-head, .hero-soon { flex-direction: column; align-items: flex-start; }
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 4px 6px calc(6px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
  .bottom-nav a, .bottom-nav button { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px; min-height: 56px; padding: 7px 2px 0; text-align: center; line-height: 1.15; border: 0; background: transparent; color: var(--muted); font: 800 11.5px var(--font); text-decoration: none; cursor: pointer; }
  .bottom-nav .is-active { color: var(--accent); }
  .tab-badge { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; padding: 0 5px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 11px; line-height: 18px; }
  .inbox { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; min-height: calc(100dvh - 170px); border-radius: 14px; }
  .inbox-list { grid-row: auto; max-height: none; }
  .inbox-client { grid-column: auto; grid-template-columns: minmax(0, 1fr); }
  .inbox:not(.has-selection) .inbox-client { display: none; }
  .inbox-thread { max-height: none; }
  .inbox:not(.has-selection) .inbox-thread { display: none; }
  .inbox.has-selection .inbox-list { display: none; }
  .inbox:not(.has-selection) .inbox-thread { display: none; }
  .thread-back { display: inline-grid; }
  .thread-head { flex-wrap: wrap; }
  .thread-actions { width: 100%; justify-content: stretch; }
  .thread-actions > * { flex: 1; }
  .thread-actions .button { width: 100%; }
  .thread { padding: 14px; }
  .bubble { max-width: 92%; }
  body.has-selection .topbar { display: none; }
  body.has-selection .content { padding: 0; }
  body.has-selection .inbox { border: 0; border-radius: 0; min-height: calc(100dvh - 68px); }
  /* A thread precisa de uma altura FIXA (não só min-height) pra "flex:1 + overflow-y:auto"
     conseguir recortar o conteúdo — senão ela cresce até caber todas as mensagens e quem
     rola é a página inteira, não só a conversa. */
  body.has-selection .inbox-thread { height: calc(100dvh - 68px); }
}
@media (max-width: 420px) {
  .segments { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .kpi strong { font-size: 22px; }
}
.print-only { display: none; }
@media print {
  .sidebar, .topbar, .bottom-nav { display: none !important; }
  .no-print { display: none !important; }
  .print-only { display: block; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; }
  .card .actions { display: none; }
  .print-reservas { font-size: 15px; }
  .print-reservas th, .print-reservas td { padding: 10px 8px; }
}

/* Gráficos simples (Relatórios): funil de vendas, pizza por tipo de uso e horários de
   pico — tudo em HTML/CSS puro (conic-gradient, clip-path), sem biblioteca externa. */
.funnel { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px; }
.funnel-stage { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; }
.funnel-shape { height: 56px; background: var(--funnel-fill, var(--accent)); clip-path: polygon(var(--funnel-top, 0%) 0, calc(100% - var(--funnel-top, 0%)) 0, calc(100% - var(--funnel-bottom, 0%)) 100%, var(--funnel-bottom, 0%) 100%); transition: clip-path .3s ease, width .3s ease; }
.funnel-stage-label { display: flex; align-items: baseline; gap: 6px; font-size: 13.5px; font-weight: 800; }
.funnel-stage-label strong { font-size: 15px; }
.funnel-stage-note { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-top: 8px; }

.piechart-wrap { display: flex; align-items: center; gap: 24px; padding: 18px; flex-wrap: wrap; }
.piechart { width: 140px; height: 140px; border-radius: 99%; background: var(--pie-gradient, conic-gradient(var(--line) 0 100%)); flex-shrink: 0; }
.piechart-legend { display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 180px; }
.piechart-item { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.piechart-swatch { width: 14px; height: 14px; border-radius: 4px; flex-shrink: 0; }
.piechart-item strong { font-weight: 800; }
.piechart-item span.muted { margin-left: auto; font-weight: 700; }

.hourchart { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); align-items: end; gap: 3px; height: 130px; padding: 18px 18px 0; }
.daychart { display: flex; align-items: stretch; gap: 4px; height: 170px; padding-top: 8px; }
.daychart-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; }
.daychart-stack { display: flex; flex-direction: column; min-height: 2px; border-radius: 6px 6px 2px 2px; overflow: hidden; background: var(--surface-2); }
.daychart-stack span { display: block; min-height: 2px; }
.daychart .is-ia, .daychart-legend .is-ia { background: var(--accent); }
.daychart .is-human, .daychart-legend .is-human { background: var(--violet, #8b5cf6); }
.daychart .is-open, .daychart-legend .is-open { background: var(--line-strong); }
.daychart-label { font-size: 10px; color: var(--muted); text-align: center; white-space: nowrap; height: 14px; }
.daychart-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.daychart-legend span { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: -8px; vertical-align: middle; }
.report-table > summary { cursor: pointer; padding: 12px 18px; font-weight: 600; color: var(--accent); }
.report-table[open] > summary { border-bottom: 1px solid var(--line); }
@media (max-width: 760px) { .daychart { gap: 2px; } .daychart-label.is-minor { visibility: hidden; } }
.hourchart-bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.hourchart-fill { width: 100%; min-height: 2px; border-radius: 4px 4px 0 0; background: var(--accent); }
.hourchart-bar.is-open, .hourchart-legend i { border-radius: 4px 4px 0 0; background: color-mix(in srgb, var(--muted) 22%, transparent); }
.hourchart-legend { display: flex; align-items: center; gap: 8px; margin: 0; padding: 0 18px 12px; font-size: 12px; color: var(--muted); }
.hourchart-legend i { display: inline-block; width: 14px; height: 10px; border-radius: 3px; }
.hourchart-axis { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 3px; padding: 6px 18px 18px; font-size: 10px; color: var(--muted); font-weight: 700; text-align: center; }
.weekchart { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); align-items: end; gap: 10px; height: 110px; padding: 18px; }
.weekchart-bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.weekchart-fill { width: 100%; min-height: 2px; border-radius: 6px 6px 0 0; background: var(--accent); }
.weekchart-label { font-size: 11.5px; color: var(--muted); font-weight: 800; text-align: center; padding: 0 18px 18px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 640px) {
  .hourchart, .hourchart-axis { gap: 1px; }
  .hourchart-axis span:nth-child(even) { visibility: hidden; }
}

.npschart { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: end; gap: 6px; height: 130px; padding: 18px 18px 0; }
.npschart-bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.npschart-fill { width: 100%; min-height: 2px; border-radius: 4px 4px 0 0; background: var(--ok); }
.npschart-fill.is-negative { background: var(--danger); }
.npschart-axis { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; padding: 6px 18px 18px; font-size: 10.5px; color: var(--muted); font-weight: 700; text-align: center; }
.nps-compare { display: flex; flex-wrap: wrap; gap: 32px; }
.nps-compare-item { display: flex; flex-direction: column; gap: 2px; }
.nps-compare-value { font: 800 28px var(--display); }
.nps-compare-value.is-ok { color: var(--ok); }
.nps-compare-value.is-danger { color: var(--danger); }
.nps-reason { display: flex; align-items: center; gap: 12px; }
.nps-reason > strong { flex: 0 0 120px; }
.nps-reason-bar { flex: 1; height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.nps-reason-bar > span { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
@media (max-width: 520px) { .nps-reason { gap: 10px; } .nps-reason > strong { flex-basis: 108px; } }

/* Central de módulos */
.module-card { justify-content: space-between; }
.module-card .card-head { align-items: flex-start; }
.module-check { display: flex; gap: 12px; align-items: flex-start; padding: 13px 0; border-top: 1px solid var(--line); }
.module-check .chip { flex: 0 0 auto; }
.module-check strong { display: block; }
.module-check p { margin-top: 4px; }
@media (max-width: 580px) { .module-check { flex-direction: column; } }

/* Produto 9.4: navegação curta, seções locais e jornada com dados reais. */
:root:is([data-theme="light"], :not([data-theme])):not([data-contrast="high"]) {
  --side: #26152e; --side-2: #35213e; --side-line: #49354f;
  --side-text: #f8f5f8; --side-muted: #baacbf; --side-active: #4b2b55;
  --bg: #f6f4f5; --surface-2: #faf8fa; --line: #e9e3e8;
  --ink: #261c2b; --muted: #6e6570; --accent: #562362;
  --accent-hover: #3e1949; --accent-soft: #eee3f0; --accent-ink: #562362;
  --radius: 15px; --radius-sm: 10px; --shadow: none;
}
:root[data-theme="dark"]:not([data-contrast="high"]) {
  --side: #3b2842; --side-2: #49344f; --side-line: #775e7e; --side-text: #ffffff; --side-muted: #e7d9ea; --side-active: #64446e;
  --bg: #2b2830; --surface: #39343f; --surface-2: #453e4a; --line: #6c606f; --line-strong: #8a7c90;
  --ink: #fffaff; --muted: #e3dbe5; --faint: #d0c3d2;
  --accent: #ffbf77; --accent-hover: #ffdbab; --accent-soft: #583b2d; --accent-ink: #ffdfb6;
  --ok: #a3ebbd; --ok-soft: #294637; --warn: #ffcf83; --warn-soft: #58432a; --danger: #ffb3b3; --danger-soft: #563039;
  --info: #b7dcff; --info-soft: #304758; --dizae-soft: #514039; --team-soft: #334958;
  --shadow: 0 4px 18px rgb(0 0 0 / 12%); --focus: 0 0 0 3px #2b2830, 0 0 0 5px var(--accent);
}
/* O resumo do dia usa fundo claro no tema padrão e links legíveis em todos os temas. */
:root:is([data-theme="light"], :not([data-theme])):not([data-contrast="high"]) .card-hero {
  background: #f0e8f2; border-color: #d9c8dd; color: #261c2b;
}
:root:is([data-theme="light"], :not([data-theme])):not([data-contrast="high"]) .card-hero h2,
:root:is([data-theme="light"], :not([data-theme])):not([data-contrast="high"]) .card-hero .facts dd { color: #261c2b; }
:root:is([data-theme="light"], :not([data-theme])):not([data-contrast="high"]) .card-hero .facts dt { color: #49384f; }
.card-hero .card-links a { color: #ffdcac; text-decoration-thickness: 2px; }
.card-hero .card-links a:hover { color: #ffffff; }
:root:is([data-theme="light"], :not([data-theme])):not([data-contrast="high"]) .card-hero .card-links a { color: #562362; }
:root:is([data-theme="light"], :not([data-theme])):not([data-contrast="high"]) .card-hero .card-links a:hover { color: #321039; }
:root[data-theme="dark"]:not([data-contrast="high"]) .card-hero { background: #49344f; border-color: #775e7e; }
:root[data-theme="dark"]:not([data-contrast="high"]) .card-hero .facts dt { color: #f4e8f5; }
:root[data-theme="light"][data-contrast="high"] .card-hero,
:root:not([data-theme])[data-contrast="high"] .card-hero { background: #ffffff; border-color: #3a362f; color: #000000; }
:root[data-theme="light"][data-contrast="high"] .card-hero h2,
:root[data-theme="light"][data-contrast="high"] .card-hero .facts dt,
:root[data-theme="light"][data-contrast="high"] .card-hero .facts dd,
:root:not([data-theme])[data-contrast="high"] .card-hero h2,
:root:not([data-theme])[data-contrast="high"] .card-hero .facts dt,
:root:not([data-theme])[data-contrast="high"] .card-hero .facts dd { color: #000000; }
:root[data-theme="light"][data-contrast="high"] .card-hero .card-links a,
:root:not([data-theme])[data-contrast="high"] .card-hero .card-links a { color: #5c2603; }
.sidebar { width: 248px; }
.sidebar-inner { padding: 22px 15px; gap: 4px; }
.tenant { background: transparent; border: 0; border-bottom: 1px solid var(--side-line); border-radius: 0; padding: 5px 7px 19px; margin-bottom: 16px; }
.tenant-text strong, .tenant-text span { color: var(--side-text); }
.tenant-text span { color: var(--side-muted); }
.nav-group-title { padding: 19px 14px 8px; }
.nav-link { border-radius: 9px; min-height: 44px; font-size: 14px; font-weight: 600; }
.nav-link.is-active { background: var(--side-active); color: var(--side-text); border-left: 3px solid #f5a13b; padding-left: 11px; }
.nav-link.is-active .badge { background: #f5a13b; color: #26152e; }
.sidebar-footer { flex-direction: row; justify-content: center; padding: 12px; margin-top: 12px; border-radius: 10px; }
.sidebar-footer .brand-mark { width: 27px; height: 27px; margin: 0; }
.sidebar-footer > span:not(.nav-version) { display: none; }
.nav-version { padding: 0; margin-left: auto; }
.topbar { background: var(--surface); padding: 15px 30px; }
.topbar-title h1 { font-size: 24px; }
.content { max-width: none; padding: 28px 32px 44px; }
.card { border-radius: var(--radius); }
.button { border-radius: 9px; }
.button-primary { background: #f5a13b; border-color: #f5a13b; color: #271829; }
.button-primary:hover { background: #e9932d; border-color: #e9932d; color: #271829; }
[data-theme="dark"] .button-primary, :root:not([data-theme="light"]) .button-primary { color: #271829; }
.context-nav { display: flex; gap: 3px; padding: 0 32px; overflow-x: auto; border-bottom: 1px solid var(--line); background: var(--surface); scrollbar-width: thin; }
.context-nav a { flex: 0 0 auto; padding: 12px 14px; border-bottom: 2px solid transparent; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 800; white-space: nowrap; }
.context-nav a:hover, .context-nav a.is-active { color: var(--accent); border-color: var(--accent); }
.crm-workspace { display: flex; flex-direction: column; gap: 25px; min-width: 0; }
.crm-intro { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.crm-eyebrow { color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .1em; }
.crm-intro h2 { margin: 7px 0; font: 700 clamp(25px, 2.6vw, 37px)/1.15 var(--display); letter-spacing: -.035em; }
.crm-intro p, .crm-toolbar p { color: var(--muted); }
.crm-pulse { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--accent-soft); border-radius: 12px; overflow: hidden; }
.crm-pulse > div { min-width: 0; padding: 22px 23px; display: flex; align-items: baseline; gap: 12px; border-right: 1px solid var(--line); }
.crm-pulse > div:last-child { border: 0; }
.crm-pulse strong { color: var(--accent); font: 700 34px/1 var(--display); }
.crm-pulse span { font-weight: 750; font-size: 13px; }
.crm-toolbar { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 16px; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.crm-toolbar h2 { font: 700 22px var(--display); }
.crm-toolbar p { font-size: 13px; margin-top: 4px; }
.crm-filters { display: flex; gap: 5px; flex-wrap: wrap; }
.crm-filters a { padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--muted); font-size: 13px; }
.crm-filters a:hover, .crm-filters a.is-active { color: var(--accent); background: var(--accent-soft); }
.crm-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(232px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 14px; align-items: start; scrollbar-width: thin; }
.crm-lane { min-width: 232px; display: flex; flex-direction: column; gap: 12px; }
.crm-lane-heading { display: flex; align-items: center; justify-content: space-between; padding: 11px 13px; background: var(--accent-soft); color: var(--ink); border-radius: 8px; text-decoration: none; font-size: 13px; font-weight: 800; }
.crm-lane-heading strong { color: var(--accent); }
.crm-lane-empty { color: var(--muted); padding: 16px; font-size: 13px; }
.crm-person { display: flex; flex-direction: column; gap: 13px; min-height: 165px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); text-decoration: none; color: var(--ink); }
.crm-person:hover, .crm-person:focus-within { border-color: var(--accent); box-shadow: 0 5px 20px rgb(38 21 46 / 8%); }
.crm-person-link { display: flex; flex-direction: column; gap: 13px; flex: 1; text-decoration: none; color: var(--ink); }
.crm-person-link:hover { color: var(--ink); }
.crm-person-tools { display: flex; align-items: center; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.crm-person-tools .crm-move { flex: 1; min-width: 0; }
.crm-person-tools select { width: 100%; min-height: 34px; padding: 4px 8px; font-size: 12px; }
.crm-person-tools .button-small { min-height: 34px; padding: 0 10px; font-size: 12px; gap: 4px; }
.crm-person-head { display: flex; align-items: center; gap: 9px; min-width: 0; }
.crm-person-head > span:last-child { min-width: 0; }
.crm-person-head strong, .crm-person-head small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.crm-person-head strong { font-size: 13px; }
.crm-person-head small { font-size: 11px; color: var(--muted); }
.crm-person .avatar { width: 34px; height: 34px; background: var(--accent-soft); color: var(--accent); font-size: 11px; }
.crm-person-action { display: flex; flex-direction: column; gap: 3px; padding-top: 10px; border-top: 1px solid var(--line); }
.crm-person-action small { font-size: 10px; letter-spacing: .04em; color: var(--accent); font-weight: 800; }
.crm-person-action strong { color: var(--accent); font-size: 12px; line-height: 1.4; }
.crm-person-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: auto; color: var(--muted); font-size: 11px; }
.crm-person-foot .is-late { color: var(--danger); font-weight: 800; }
@media (max-width: 1100px) { .crm-pulse { grid-template-columns: repeat(2, minmax(0, 1fr)); } .crm-pulse > div:nth-child(2) { border-right: 0; } }
@media (max-width: 760px) {
  .context-nav { padding: 0 10px; flex-wrap: wrap; }
  .content { padding: 17px 14px 24px; }
  .crm-intro { align-items: stretch; flex-direction: column; gap: 15px; }
  .crm-intro .button { align-self: flex-start; }
  .crm-pulse > div { flex-direction: column; gap: 3px; padding: 15px; }
  .crm-pulse strong { font-size: 29px; }
  .crm-board { grid-auto-columns: minmax(260px, 82vw); scroll-snap-type: x proximity; }
  .crm-lane { scroll-snap-align: start; }
  .crm-toolbar { align-items: flex-start; }
  .crm-filters { flex-wrap: nowrap; max-width: 100%; overflow-x: auto; }
  .crm-filters a { white-space: nowrap; }
  .bottom-nav .is-active { color: var(--accent); }
}

/* Compras: lista operável no balcão e no celular. */
.purchase-workspace { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.purchase-intro { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.purchase-intro h2 { margin: 5px 0 8px; font: 700 clamp(27px, 3vw, 38px)/1.12 var(--display); letter-spacing: -.035em; }
.purchase-intro p { max-width: 660px; color: var(--muted); }
.purchase-summary { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 17px 22px; border-radius: 12px; background: var(--accent-soft); }
.purchase-summary strong { font: 700 34px/1 var(--display); color: var(--accent); }
.purchase-summary span { font-size: 13px; font-weight: 800; }
.purchase-add { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(140px, 180px) minmax(130px, 160px) auto; gap: 12px; align-items: end; }
.purchase-add .button { min-height: 44px; }
.purchase-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.purchase-section-head h2 { font: 700 22px var(--display); }
.purchase-section-head p { font-size: 13px; color: var(--muted); }
.purchase-list { display: flex; flex-direction: column; gap: 10px; }
.purchase-item { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 15px 18px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.purchase-item.is-urgent { border-left: 4px solid var(--danger); padding-left: 15px; }
.purchase-item-head { min-width: 0; flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.purchase-item-head strong { display: block; margin-bottom: 5px; font-size: 16px; }
.purchase-item-meta { color: var(--muted); font-size: 12px; white-space: nowrap; }
.purchase-item-actions { display: flex; align-items: center; gap: 12px; }
.purchase-item-actions > details { position: relative; }
.purchase-item-actions summary { cursor: pointer; color: var(--accent); font-size: 13px; font-weight: 800; list-style: none; white-space: nowrap; }
.purchase-item-actions summary::-webkit-details-marker { display: none; }
.purchase-edit { position: absolute; z-index: 5; right: -95px; top: 35px; width: min(360px, 85vw); padding: 16px; display: flex; flex-direction: column; gap: 12px; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgb(0 0 0 / 16%); background: var(--surface); }
.purchase-settings > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.purchase-settings > summary strong { font-size: 17px; }
.purchase-settings > summary span { color: var(--muted); font-size: 13px; }
.purchase-settings[open] > summary { margin-bottom: 20px; }
.purchase-settings > p, .purchase-settings > form + p { margin-top: 12px; }
.purchase-history { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.purchase-history strong, .purchase-history small { display: block; }
.purchase-history small { color: var(--muted); margin-top: 3px; }
@media (max-width: 1120px) { .purchase-add { grid-template-columns: minmax(200px,1fr) minmax(140px,1fr); } }
@media (max-width: 760px) {
  .purchase-intro, .purchase-item, .purchase-item-head { align-items: flex-start; flex-direction: column; }
  .purchase-summary { align-self: stretch; }
  .purchase-add { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .purchase-product, .purchase-add .button { grid-column: 1 / -1; }
  .purchase-item-actions { width: 100%; justify-content: space-between; }
  .purchase-edit { left: 0; right: auto; }
  .purchase-settings > summary { align-items: flex-start; flex-direction: column; }
}

/* Checklist de ativação no Início */
.activation { margin: 0 0 20px; }
.activation progress { width: 100%; height: 8px; margin: 12px 0 4px; accent-color: var(--accent); }
.activation-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; }
.activation-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.activation-list li:last-child { border-bottom: 0; }
.activation-list li > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.activation-list small { color: var(--muted); font-size: 13px; }
.activation-mark { flex-shrink: 0; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-strong); }
.activation-list li.is-next .activation-mark { border-color: var(--accent); }
.activation-list li.is-next strong { color: var(--accent); }
.activation-list form { margin: 0; }
.activation-list li.is-done .activation-mark { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.activation-list li.is-done strong { color: var(--muted); font-weight: 600; }
/* No celular, só o próximo passo fica aberto, com o botão largo embaixo; os outros ocupam uma linha. */
@media (max-width: 640px) {
  .activation-list li:not(.is-next) small, .activation-list li:not(.is-next) > .button, .activation-list li:not(.is-next) > form { display: none; }
  .activation-list li.is-next { flex-wrap: wrap; }
  .activation-list li.is-next > .button, .activation-list li.is-next > form, .activation-list li.is-next > form .button { flex-basis: 100%; width: 100%; justify-content: center; }
  .dz-panel-dash .dz-grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dz-panel-dash .dz-grid4 .dz-spark { display: none; }
}

/* Vitrine de módulos: cadeado com o plano que inclui o módulo */
.module-lock { display: flex; align-items: flex-start; gap: 8px; color: var(--muted); font-size: 14px; }
.module-lock .icon { flex-shrink: 0; margin-top: 2px; color: var(--accent-ink); }
/* Precisa de você: atalhos por tipo de pendência e listas curtas */
.need-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.need-tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 600; }
.need-tabs a strong { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); text-align: center; font-size: 12px; }
.need-tabs a.has-items { color: var(--ink); border-color: var(--accent); }
.need-tabs a.has-items strong { background: var(--accent); color: #fff; }
.need-tabs a:hover { border-color: var(--accent); color: var(--ink); }
.need-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.need-list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.need-list li:first-child { border-top: 0; }
.need-list li > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.need-list li > div span { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#sem-resposta, #fila, #novas-reservas, #envios, #duvidas { scroll-margin-top: 90px; }
@media (max-width: 760px) { .need-list li { flex-wrap: wrap; } .need-list li > div { flex-basis: calc(100% - 60px); } }
.client-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; padding-left: 44px; }
.client-tags span { font-size: 11px; line-height: 18px; padding: 0 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.card-head > .client-toolbar { flex: 1 1 100%; }
.client-toolbar .search-field { flex: 2 1 260px; max-width: none; }
.client-toolbar select { flex: 1 1 150px; min-width: 0; max-width: 240px; }
@media (max-width: 760px) {
  .client-toolbar { display: grid; grid-template-columns: 1fr 1fr; }
  .client-toolbar .search-field, .client-toolbar .button { grid-column: 1 / -1; }
  .client-toolbar select { max-width: none; width: 100%; }
}

/* Ajuda ------------------------------------------------------------------ */
.help-contact { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.help-contact-text { flex: 1 1 320px; display: flex; flex-direction: column; gap: 8px; }
.help-contact-text h2, .help-contact-text p { margin: 0; }
.help-safe { display: flex; align-items: flex-start; gap: 8px; color: var(--muted); font-size: 13.5px; }
.help-safe .icon { flex: none; margin-top: 2px; }
.help-channels { flex: 1 1 320px; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.help-channel { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink); text-decoration: none; }
.help-channel:hover { border-color: var(--accent); }
.help-channel > span { display: flex; flex-direction: column; min-width: 0; }
.help-channel small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.help-channel .icon { flex: none; color: var(--accent); }
.help-channel.is-main { background: var(--accent-soft); border-color: var(--accent); }
.help-shortcuts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.help-shortcut { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; }
.help-shortcut:hover { border-color: var(--accent); }
.help-shortcut > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.help-shortcut small { color: var(--muted); font-size: 12.5px; }
.help-shortcut-icon { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); }
.help-faq-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.help-faq-head h2 { margin: 0; }
.help-search { flex: 0 1 320px; }
.help-search input:focus-visible { outline: none; box-shadow: none; }
.help-group { display: flex; flex-direction: column; }
.help-group-title { display: flex; align-items: center; gap: 8px; margin: 14px 0 2px; font-size: 12.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.help-q { border-bottom: 1px solid var(--line); }
.help-q > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 10px 4px; cursor: pointer; font-weight: 700; list-style: none; border-radius: 8px; }
.help-q > summary::-webkit-details-marker { display: none; }
.help-q > summary:focus-visible { outline: none; box-shadow: var(--focus); }
.help-chev { flex: none; color: var(--muted); transition: transform .15s ease; }
.help-q[open] > summary .help-chev { transform: rotate(90deg); }
.help-a { padding: 0 4px 14px; color: var(--muted); line-height: 1.55; }
.help-a p, .help-a ol { margin: 0 0 8px; }
.help-a ol { padding-left: 20px; }
.help-a a { color: var(--accent-ink); font-weight: 700; }
.help-empty { margin: 8px 0 0; }
@media (prefers-reduced-motion: reduce) { .help-chev { transition: none; } }
@media (max-width: 520px) { .help-search { flex-basis: 100%; } }

/* Identidade da atendente (página Agente › Identidade) */
.agent-avatar { --avatar-size: 56px; width: var(--avatar-size); height: var(--avatar-size); flex: 0 0 var(--avatar-size); display: grid; place-items: center; border-radius: 999px; overflow: hidden; background: var(--accent-soft); color: var(--accent-ink); font: 800 calc(var(--avatar-size) * .42) var(--display); line-height: 1; }
.agent-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.agent-avatar-initial { background: var(--accent); color: #110319; }
.agent-avatar-upload { background: var(--surface-2); border: 1px dashed var(--line-strong); color: var(--muted); }
.agent-head-avatar { display: inline-flex; border-radius: 999px; }
.identity-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
.identity-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
:is(.identity-grid, .identity-form) fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.identity-choices { display: flex; flex-wrap: wrap; gap: 16px 28px; }
:is(.identity-grid, .identity-form) .field small { font-weight: 500; color: var(--muted); }
:is(.identity-grid, .identity-form) legend { font-size: 13.5px; font-weight: 800; padding: 0; margin-bottom: 10px; }
.avatar-options { display: flex; flex-wrap: wrap; gap: 12px; }
.avatar-option { position: relative; display: inline-grid; padding: 4px; border-radius: 999px; border: 2px solid transparent; cursor: pointer; transition: border-color .15s, transform .15s; }
.avatar-option:hover { transform: translateY(-2px); }
.avatar-option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.avatar-option:has(input:checked) { border-color: var(--accent); }
.avatar-option:has(input:focus-visible) { box-shadow: var(--focus); }
.tone-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.tone-option { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); cursor: pointer; transition: border-color .15s, transform .15s; }
.tone-option:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.tone-option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.tone-option strong { font: 800 15px var(--display); color: var(--ink); }
.tone-option span { font-size: 13px; color: var(--muted); }
.tone-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.tone-option:has(input:focus-visible) { box-shadow: var(--focus); }
.segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); width: fit-content; max-width: 100%; }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span { display: block; padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 800; color: var(--muted); }
.segmented label:has(input:checked) span { background: var(--accent); color: #110319; }
.segmented label:has(input:focus-visible) span { box-shadow: var(--focus); }
.identity-grid .setup-address-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.identity-preview { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 12px; }
.wa-phone { border-radius: 28px; overflow: hidden; border: 8px solid #110319; background: #efeae2; box-shadow: 0 24px 60px rgba(17, 3, 25, .35); }
.wa-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #075e54; color: #fff; }
.wa-head > div { min-width: 0; }
.wa-head strong, .wa-head small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-head strong { display: block; font: 700 15px var(--font); color: #fff; }
.wa-head small { display: block; font-size: 12px; color: rgba(255, 255, 255, .8); }
.wa-chat { display: flex; flex-direction: column; gap: 8px; padding: 16px 12px 20px; min-height: 300px; }
.wa-bubble { margin: 0; max-width: 85%; padding: 8px 12px; border-radius: 12px; font-size: 14px; line-height: 1.4; color: #111b21; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); overflow-wrap: anywhere; }
.wa-in { align-self: flex-start; background: #fff; border-top-left-radius: 4px; }
.wa-out { align-self: flex-end; background: #d9fdd3; border-top-right-radius: 4px; }
@media (max-width: 1100px) { .identity-grid { grid-template-columns: minmax(0, 1fr); } .identity-preview { position: static; } }
@media (max-width: 640px) { .identity-pair { grid-template-columns: minmax(0, 1fr); } .segmented span { padding: 8px 10px; } }
