/* Tema "A Nossa Casinha" — cores extraídas do logo
   azul-petróleo do texto #17424F · teal do telhado #05AFB0 · pêssego da porta #FFC18B
   verde do jardim #9BCE5B · creme da parede #F0EAD2 · malva do beiral #8B636B
   Layout (modelo Fluxometrics): barra lateral com logo em bloco branco + faixa superior com abas e usuário
   + área de trabalho clara com filtros, cartão escuro de destaque, cartões de números e tabelas.
   No celular a barra lateral vira faixa no topo. */
:root {
  --bg: #EEF4F3;
  color-scheme: light;
  --surface: #FFFFFF;
  --surface-2: #F7FAFA;
  --line: #E2EBEA;
  --ink: #17424F;
  --ink-2: #587780;
  --brand: #0A7F86;          /* botões e links (texto branco passa de 4,5:1) */
  --on-brand: #FFFFFF;
  --brand-bright: #05AFB0;   /* preenchimentos, abas ativas, gráficos */
  --brand-soft: #E1F4F3;
  --warm: #F0EAD2;
  --warm-soft: #FFF3E3;
  --warm-ink: #8A4A12;
  --ok-soft: #E8F5D6;
  --ok-ink: #3B6A10;
  --bad: #C0453C;
  --bad-soft: #FBE7E4;
  --bad-ink: #8E2E26;
  --nav: #17424F;
  --nav-ink: #EAF3F2;
  --nav-dim: #A4C1C6;
  --nav-active: rgba(5, 175, 176, .22);
  --hero-a: #17424F;
  --hero-b: #0F3541;
  --bubble: #DCF5D8;
  --shadow: 0 1px 2px rgba(23, 66, 79, .04), 0 6px 18px rgba(23, 66, 79, .04);
  --font: 'Mulish', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --r: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; line-height: 1.2; text-wrap: balance; }
h1 { font-size: 1.3rem; font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 1.12rem; font-weight: 800; }
h3 { font-size: .95rem; font-weight: 700; }
p { margin: 0; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--brand-bright); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- estrutura ---------- */
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); grid-template-rows: 64px minmax(0, 1fr); min-height: 100vh; }
.bar { grid-column: 1 / -1; background: #0F3541; color: #EAF3F2; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 clamp(16px, 3vw, 36px); border-bottom: 3px solid var(--brand-bright); position: sticky; top: 0; z-index: 6; }
.bar .t { font-weight: 800; letter-spacing: .02em; font-size: 1rem; }
.bar .t small { display: block; font-weight: 600; font-size: .78rem; color: #9FD6D8; letter-spacing: 0; }
.side { background: var(--nav); color: var(--nav-ink); display: flex; flex-direction: column; position: sticky; top: 64px; height: calc(100vh - 64px); align-self: start; }
.brand { background: #fff; margin: 18px 18px 0; border-radius: 16px; padding: 18px 14px 14px; display: flex; align-items: center; justify-content: center; }
.brand img { width: 150px; max-width: 100%; height: auto; display: block; margin: 0 auto; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 18px 12px; }
.nav a { display: flex; align-items: center; gap: 14px; padding: 11px 14px; border-radius: 10px; color: var(--nav-dim);
  text-decoration: none; font-weight: 600; font-size: .98rem; }
.nav a:hover { color: var(--nav-ink); background: rgba(255,255,255,.06); }
.nav a[aria-current="page"] { color: #fff; background: var(--nav-active); box-shadow: inset 3px 0 0 var(--brand-bright); font-weight: 700; }
.nav svg, .ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.side .foot { margin-top: auto; padding: 16px 20px 20px; font-size: .84rem; color: var(--nav-dim); border-top: 1px solid rgba(255,255,255,.08); display: flex; flex-direction: column; gap: 4px; }
.side .foot b { color: var(--nav-ink); font-weight: 700; display: block; overflow-wrap: anywhere; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--nav-ink); text-decoration: underline; cursor: pointer; text-align: left; font-size: .84rem; }

.content { min-width: 0; display: flex; flex-direction: column; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: stretch; gap: 28px;
  padding: 0 clamp(16px, 3vw, 36px); min-height: 68px; position: sticky; top: 0; z-index: 5; }
.topbar h1 { align-self: center; white-space: nowrap; }
.tabs { display: flex; gap: 6px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: none; cursor: pointer; padding: 0 14px; font-weight: 700; font-size: .95rem; color: var(--ink-2);
  border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab[aria-current="true"] { color: var(--brand); border-bottom-color: var(--brand-bright); }
.userchip { display: flex; align-items: center; gap: 10px; padding: 5px 16px 5px 6px; border: 1px solid rgba(255,255,255,.22); border-radius: 999px; font-weight: 600; font-size: .92rem; white-space: nowrap; color: #fff; }
.userchip i { width: 28px; height: 28px; border-radius: 50%; background: var(--brand-bright); color: #fff; display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: .85rem; }

.main { padding: 24px clamp(16px, 3vw, 36px) 56px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.intro { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.lead { color: var(--ink-2); max-width: 70ch; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.demo-banner { background: var(--warm-soft); color: var(--warm-ink); padding: 8px 16px; font-weight: 600; font-size: .86rem; text-align: center; }

.psel { padding: 4px 18px 18px; display: flex; flex-direction: column; gap: 6px; }
.psel label { font-size: .72rem; letter-spacing: .07em; text-transform: uppercase; font-weight: 800; color: var(--nav-dim); }
.psel select.input { width: 100%; border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.08); color: var(--nav-ink); border-radius: 10px; padding: 9px 10px; font-weight: 700; }
.psel select option { color: #17424F; }
.psel-top { display: none; }
.intro h1 { font-size: 1.5rem; }
.intro .lead { margin-top: 4px; }

/* ---------- componentes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); min-width: 0; }
.card > header { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 18px 20px 0; }
.card .body { padding: 14px 20px 20px; }
.grid { display: grid; gap: 16px; }
.two { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
.notice { background: var(--warm-soft); color: var(--warm-ink); border-radius: 10px; padding: 10px 14px; font-size: .88rem; font-weight: 600; }
.notice.info { background: var(--brand-soft); color: var(--ink); }

.sec { display: flex; flex-direction: column; gap: 4px; }
.sec h2 { font-size: 1.08rem; }
.sec p { color: var(--ink-2); font-size: .92rem; }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* faixa de filtros */
.filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 20px; display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; box-shadow: var(--shadow); }
.filters .field { flex: 0 1 170px; }
.filters .field.grow { flex: 1 1 200px; }
.filters .field label { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 800; color: var(--ink); }

/* cartão de destaque (fundo claro, cores da logo) */
.hero { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px; box-shadow: var(--shadow); }
.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.tile { border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; border: 1px solid transparent; }
.tile .label { color: var(--ink-2); font-size: .84rem; font-weight: 700; }
.tile .value { font-size: 2rem; font-weight: 800; line-height: 1; letter-spacing: -.02em; color: var(--ink); }
.tile .hint { font-size: .8rem; color: var(--ink-2); }
.tile.t1 { background: var(--brand-soft); }
.tile.t2 { background: #EEF7E1; }
.tile.t3 { background: #FBF7EA; }
.tile.t4 { background: var(--surface-2); border-color: var(--line); }
.tile.alert { background: var(--warm-soft); }
.tile.alert .value, .tile.alert .label, .tile.alert .hint { color: var(--warm-ink); }
.hd2 { flex-direction: row; justify-content: space-between; align-items: baseline; }

.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 10px 18px; border-radius: 10px; font-weight: 700; cursor: pointer; }
.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.primary:hover { filter: brightness(1.08); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.sm { padding: 6px 10px; font-size: .88rem; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .lbl { font-weight: 700; font-size: .85rem; color: var(--ink-2); }
.input, select.input, textarea.input { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 12px; min-width: 0; }
.input:focus { border-color: var(--brand-bright); outline: 2px solid var(--brand-bright); outline-offset: 0; }
textarea.input { min-height: 150px; resize: vertical; line-height: 1.5; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 160px; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 800; white-space: nowrap;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.pill.ok { background: var(--ok-soft); color: var(--ok-ink); border-color: transparent; }
.pill.bad { background: var(--bad-soft); color: var(--bad-ink); border-color: transparent; }
.pill.warm { background: var(--warm-soft); color: var(--warm-ink); border-color: transparent; }
.pill.brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.pill.airbnb { background: #FFE6E8; color: #B3243A; border-color: transparent; }
.pill.booking { background: #E3ECFB; color: #1D4C9C; border-color: transparent; }

/* tabelas */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; font-size: .72rem; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); font-weight: 800; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th.r, td.r { text-align: right; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
tfoot td { border-top: 2px solid var(--line); border-bottom: 0; font-weight: 800; background: var(--surface-2); }
td .sub { display: block; font-size: .8rem; color: var(--ink-2); font-weight: 400; }
.empty { padding: 30px 18px; text-align: center; color: var(--ink-2); }
.tcard { padding: 6px 8px 8px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 13px; font-weight: 700; font-size: .86rem; cursor: pointer; color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }

.dots { display: flex; gap: 4px; align-items: center; margin-bottom: 3px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--brand-bright); }
.dots i.off { background: transparent; box-shadow: inset 0 0 0 2px var(--line); }

/* gráfico */
.chart { width: 100%; height: auto; display: block; }
.chart .grid-l { stroke: var(--line); stroke-width: 1; }
.chart .t { fill: var(--ink-2); font: 600 11px var(--font); }
.chart .bar-ok { fill: var(--brand-bright); }
.chart .bar-bad { fill: var(--bad); }
.legend { display: flex; gap: 16px; font-size: .82rem; color: var(--ink-2); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; background: var(--brand-bright); }
.legend i.b { background: var(--bad); }

/* lista de mensagens recentes */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.list li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: center; }
.list li:last-child { border-bottom: 0; }
.list .t { min-width: 0; }
.list .t b { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .t span { font-size: .82rem; color: var(--ink-2); }

/* modelos de mensagem */
.split { display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); gap: 16px; align-items: start; }
.tpl-list { display: flex; flex-direction: column; padding: 8px; gap: 4px; }
.tpl-list button { text-align: left; border: 0; background: none; padding: 10px 12px; border-radius: 10px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.tpl-list button:hover { background: var(--surface-2); }
.tpl-list button[aria-current="true"] { background: var(--brand-soft); }
.tpl-list b { font-weight: 700; }
.vars { display: flex; gap: 6px; flex-wrap: wrap; }
.vars button { border: 1px dashed var(--brand); background: var(--brand-soft); color: var(--brand); border-radius: 7px; padding: 3px 9px; font-weight: 700; font-size: .82rem; cursor: pointer; }
.phone { background: var(--surface-2); border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.bubble { background: var(--bubble); color: var(--ink); border-radius: 4px 14px 14px 14px; padding: 10px 12px 8px; max-width: 34ch; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.bubble small { display: block; text-align: right; color: var(--ink-2); font-size: .72rem; margin-top: 4px; }

/* automações */
.rules { display: flex; flex-direction: column; gap: 12px; }
.rule { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; padding: 18px 20px; align-items: center; }
.rule .flow { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.rule .step { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: .9rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rule .step em { font-style: normal; font-weight: 800; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); }
.rule .step .input { width: auto; padding: 4px 8px; }
.rule .step input[type="number"] { width: 4.2rem; }
.arrow { color: var(--ink-2); font-weight: 800; }
.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; width: 100%; height: 100%; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid var(--brand-bright); outline-offset: 2px; }

/* modal e aviso */
.scrim { position: fixed; inset: 0; background: rgba(8, 24, 30, .55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 20; }
.modal { background: var(--surface); border-radius: 16px; width: min(520px, 100%); max-height: 90vh; overflow: auto; padding: 24px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.toast { position: fixed; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 10px; font-weight: 700; z-index: 30; max-width: calc(100% - 32px); }
.toast.err { background: var(--bad); color: #fff; }

.cfg { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.kv dt { color: var(--ink-2); font-weight: 700; font-size: .85rem; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.later { opacity: .8; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.login .art { background: var(--warm); display: flex; align-items: center; justify-content: center; padding: 32px; }
.login .art img { width: min(460px, 90%); height: auto; mix-blend-mode: multiply; }
.login form { align-self: center; justify-self: center; width: min(380px, calc(100% - 32px)); display: flex; flex-direction: column; gap: 16px; padding-block: 32px; }
.login .err { color: var(--bad-ink); background: var(--bad-soft); padding: 9px 12px; border-radius: 9px; font-weight: 600; }

/* ---------- responsivo ---------- */
@media (max-width: 960px) { .two, .split { grid-template-columns: minmax(0, 1fr); } }
.brand .mini { display: none; }
@media (max-width: 820px) {
  .shell { grid-template-columns: 72px minmax(0, 1fr); }
  .side { width: 72px; }
  .bar .t small { display: none; }
  .brand { margin: 10px 8px 0; padding: 8px 4px; border-radius: 12px; }
  .brand .full { display: none; }
  .brand .mini { display: block; width: 44px; height: auto; }
  .nav { padding: 14px 8px; align-items: center; }
  .nav a { width: 48px; height: 48px; padding: 0; justify-content: center; }
  .nav a span { display: none; }
  .side .foot { display: none; }
  .psel { display: none; }
  .psel-top { display: flex; flex-direction: column; gap: 4px; }
  .psel-top select { min-width: 190px; }
  .rule { grid-template-columns: minmax(0, 1fr); }
  .login { grid-template-columns: minmax(0, 1fr); }
  .login .art { padding: 20px; }
  .login .art img { width: 220px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
