/* Identidade visual: Midnight Navy #101828, Electric Blue #2563EB, Violet #7657FF e Soft Indigo #A5B4FC.
   Apoio: Pure White #FFFFFF, Cloud Gray #F1F5F9, Slate #64748B e Deep Charcoal #0B1220.
   Fora dela, só as cores que têm significado: entrada (verde), saída (vermelho), previsto (laranja) e alertas.
   O app abre no tema escuro. O claro é uma escolha da pessoa, guardada neste navegador. */
:root {
  color-scheme: dark;
  --page: #0b1220;
  --surface: #101828;
  --surface-2: #1a2334;
  --ink: #f1f5f9;
  --ink-2: #a3aebd;
  --axis: #8b98ab;
  --hairline: rgba(165, 180, 252, 0.14);
  --baseline: rgba(165, 180, 252, 0.3);
  --ring: rgba(165, 180, 252, 0.24);
  --grid: rgba(165, 180, 252, 0.03);
  --finance: #2563eb;
  --on-finance: #ffffff;
  --finance-text: #a5b4fc;
  --agenda: #7657ff;
  --on-agenda: #ffffff;
  --agenda-text: #a5b4fc;
  --tasks: #a5b4fc;
  --on-tasks: #101828;
  --tasks-text: #a5b4fc;
  --income: #22c77c;
  --expense: #f2594b;
  --planned: #ff9f40;
  --good-soft: rgba(47, 227, 138, 0.18);
  --bad-soft: rgba(242, 89, 75, 0.2);
  --bar-muted: #475569;
  --on-ink: #101828;
  --critical: #ff7b6e;
  --good: #2fe38a;
  --bubble-out: #1c4193;
  --bubble-in: #1a2334;
  --chat-bg: #0b1220;
  --soft-shadow: none;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.6);
  --glass: rgba(16, 24, 40, 0.66);
  --glass-edge: rgba(165, 180, 252, 0.24);
}

:root[data-theme="light"], .login-main {
  color-scheme: light;
  --page: #f1f5f9;
  --surface: #ffffff;
  --surface-2: #e9eef5;
  --ink: #101828;
  --ink-2: #5c6b81;
  --axis: #64748b;
  --hairline: #e2e8f0;
  --baseline: #cbd5e1;
  --ring: rgba(16, 24, 40, 0.12);
  --grid: rgba(16, 24, 40, 0.03);
  --finance: #2563eb;
  --on-finance: #ffffff;
  --finance-text: #2563eb;
  --agenda: #7657ff;
  --on-agenda: #ffffff;
  --agenda-text: #6a4cf0;
  --tasks: #a5b4fc;
  --on-tasks: #101828;
  --tasks-text: #101828;
  --income: #0f9d63;
  --expense: #e5483a;
  --planned: #d9730d;
  --good-soft: rgba(15, 157, 99, 0.14);
  --bad-soft: rgba(229, 72, 58, 0.13);
  --bar-muted: #b6c2d1;
  --on-ink: #ffffff;
  --critical: #c62f2f;
  --good: #006300;
  --bubble-out: #e4e8fe;
  --bubble-in: #ffffff;
  --chat-bg: #f1f5f9;
  --soft-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 8px 28px rgba(16, 24, 40, 0.14);
  --glass: rgba(255, 255, 255, 0.66);
  --glass-edge: rgba(255, 255, 255, 0.7);
}

:root {
  --brand: linear-gradient(90deg, #2563eb, #7657ff);
  --brand-hover: linear-gradient(90deg, #1f55cc, #6648e6);
  --night:
    radial-gradient(58% 48% at 16% 6%, rgba(118, 87, 255, 0.55), transparent 72%),
    radial-gradient(42% 46% at 88% 92%, rgba(37, 99, 235, 0.35), transparent 72%),
    linear-gradient(128deg, #101828 0%, #0b1220 100%);
  /* O mesmo fundo noturno sem as luzes: nas telas de entrada, as luzes andam (veja .night-lights). */
  --night-base: linear-gradient(128deg, #101828 0%, #0b1220 100%);
}

/* Luzes do fundo noturno, em movimento lento: a violeta no alto, à esquerda, e a azul embaixo, à direita.
   Ficam atrás do conteúdo (isolation) e se movem só com transform, que não pesa no celular. Valem para a
   tela de carregamento, a apresentação e a faixa escura da entrada. */
.boot,
.intro,
.login-pitch { isolation: isolate; }
.intro,
.login-pitch { position: relative; overflow: hidden; }
.is-booting .boot::before,
.boot[data-leaving]::before,
.intro::before,
.login-pitch::before,
.is-booting .boot::after,
.boot[data-leaving]::after,
.intro::after,
.login-pitch::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  will-change: transform;
}
.is-booting .boot::before,
.boot[data-leaving]::before,
.intro::before,
.login-pitch::before {
  inset: -30% 20% 30% -35%;
  background: radial-gradient(closest-side, rgba(118, 87, 255, 0.6), rgba(118, 87, 255, 0.18) 55%, transparent);
  animation: night-light-violet 14s ease-in-out infinite alternate;
}
.is-booting .boot::after,
.boot[data-leaving]::after,
.intro::after,
.login-pitch::after {
  inset: 40% -35% -30% 30%;
  background: radial-gradient(closest-side, rgba(37, 99, 235, 0.45), rgba(37, 99, 235, 0.12) 55%, transparent);
  animation: night-light-blue 17s ease-in-out infinite alternate;
}
@keyframes night-light-violet {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(22%, 14%) scale(1.15); }
  100% { transform: translate(8%, 30%) scale(0.95); }
}
@keyframes night-light-blue {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-20%, -16%) scale(1.2); }
  100% { transform: translate(-32%, 6%) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .boot::before, .boot::after,
  .intro::before, .intro::after,
  .login-pitch::before, .login-pitch::after { animation: none; }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  /* Cada assessor tem a sua cor. As janelas ficam fora do painel, então ela mora aqui. */
  --accent: var(--finance);
  --on-accent: var(--on-finance);
  /* Para texto e foco: o azul e o violeta puros não têm contraste bastante sobre o fundo escuro. */
  --accent-text: var(--finance-text);
  --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent);
  --accent-ring: color-mix(in srgb, var(--accent) 24%, transparent);
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}
body[data-advisor="agenda"] { --accent: var(--agenda); --on-accent: var(--on-agenda); --accent-text: var(--agenda-text); }
body[data-advisor="tasks"] { --accent: var(--tasks); --on-accent: var(--on-tasks); --accent-text: var(--tasks-text); }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.92em;
  background: var(--surface-2);
  border-radius: 4px;
  padding: 1px 4px;
}
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.muted { color: var(--ink-2); }
.hint { color: var(--ink-2); font-size: 13px; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--ring);
  border-radius: 999px;
  background: transparent;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary { border-color: transparent; background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 86%, var(--ink)); }
.btn-danger { color: var(--critical); }
.btn-block { width: 100%; }
.btn svg { width: 18px; height: 18px; }
.btn-whatsapp { border-color: transparent; background: var(--finance); color: var(--on-finance); }
.btn-whatsapp:hover { background: color-mix(in srgb, var(--finance) 86%, var(--ink)); }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  text-decoration: none;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 20px; height: 20px; }
.link-btn {
  border: 0;
  background: none;
  padding: 4px 0;
  color: var(--accent-text);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Tela de entrada: o painel escuro e o formulário claro são iguais nos dois temas. */
/* Tela de carregamento da entrada, no estilo do "boot" do macOS: a logo surge do desfoque, a barra enche
   enquanto a tela de entrada carrega, e tudo se dissolve. O comportamento fica em startBoot (app.js). */
.boot { display: none; }
.is-booting .boot,
.boot[data-leaving] {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--night-base);
}
html.is-booting,
.is-booting body { overflow: hidden; }
.boot-content { display: grid; justify-items: center; gap: 40px; translate: 0 -3vh; }
.boot-brand { display: block; width: 168px; height: auto; animation: boot-brand 1s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.boot-track {
  width: 160px;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  opacity: 0;
  transition: opacity 0.4s linear;
}
.boot[data-track] .boot-track { opacity: 1; }
.boot-bar {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  transform: translateX(calc((var(--progress, 0) - 1) * 100%));
}
.boot[data-complete] .boot-content { opacity: 0; transition: opacity 0.35s linear; }
.boot[data-leaving] { opacity: 0; transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes boot-brand {
  from { opacity: 0; filter: blur(8px); }
}

/* Apresentação antes da entrada (renderIntro, em app.js): telas que passam sozinhas, com cartões que
   lembram o app, e os dois botões fixos embaixo. No celular ocupa a tela; no computador, vira duas colunas. */
.intro {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: calc(14px + env(safe-area-inset-top)) 0 calc(16px + env(safe-area-inset-bottom));
  background: var(--night-base);
  color: #ffffff;
}
.intro-top { display: grid; justify-items: center; gap: 10px; padding: 8px 20px 0; }
.intro-dots { display: flex; gap: 6px; }
.intro-dot {
  position: relative;
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
  transition: width 0.3s ease, background 0.3s ease;
}
.intro-dot::after { content: ""; position: absolute; inset: -10px -4px; }
.intro-dot[aria-current] { width: 22px; background: #ffffff; }
.intro-dot:focus-visible { outline: 2px solid #a5b4fc; outline-offset: 4px; }
.intro-logo { width: 118px; height: auto; margin-top: 6px; }
.intro-kicker { margin: 0; color: rgba(255, 255, 255, 0.66); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.intro-track {
  flex: 1;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.intro-track::-webkit-scrollbar { display: none; }
.intro-track:focus-visible { outline: 2px solid #a5b4fc; outline-offset: -6px; }
.intro-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  display: grid;
  align-content: center;
  gap: 30px;
  padding: 20px 24px 8px;
}
.intro-text h2 { max-width: 14em; margin: 0 0 10px; font-size: 26px; font-weight: 600; line-height: 1.15; letter-spacing: -0.015em; }
.intro-text p { max-width: 26em; margin: 0; color: rgba(255, 255, 255, 0.76); font-size: 15px; line-height: 1.5; }
.intro-art { position: relative; justify-self: center; width: 100%; max-width: 340px; height: 270px; }
.intro-tile {
  position: absolute;
  display: grid;
  place-items: center;
  width: 108px;
  height: 108px;
  border-radius: 26px;
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.45);
}
.intro-tile-finance { background: var(--finance); }
.intro-tile-agenda { background: var(--agenda); }
.intro-tile-tasks { background: var(--tasks); }
.intro-photo { width: 84%; height: auto; }
.intro-card {
  position: absolute;
  display: grid;
  gap: 4px;
  min-width: 170px;
  padding: 14px 16px;
  border-radius: 18px;
  background: #ffffff;
  color: #101828;
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.45);
}
.intro-card strong { font-size: 18px; font-weight: 600; }
.intro-card-label { color: #5c6b81; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.intro-card-list { min-width: 206px; gap: 8px; }
.intro-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.intro-row b { color: #6a4cf0; font-weight: 600; font-variant-numeric: tabular-nums; }
.intro-check { position: relative; flex: none; width: 16px; height: 16px; border: 2px solid #a5b4fc; border-radius: 5px; }
.intro-done { color: #5c6b81; text-decoration: line-through; }
.intro-done .intro-check { border-color: #2563eb; background: #2563eb; }
.intro-done .intro-check::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 0;
  width: 4px;
  height: 8px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.intro-bars { display: flex; align-items: flex-end; gap: 6px; height: 34px; margin-top: 6px; }
.intro-bars i { width: 14px; border-radius: 4px; background: #c7d2fe; }
.intro-bars i:nth-child(1) { height: 40%; }
.intro-bars i:nth-child(2) { height: 72%; }
.intro-bars i:nth-child(3) { height: 55%; }
.intro-bars i:nth-child(4) { height: 100%; background: var(--finance); }
.intro-bubble {
  position: absolute;
  max-width: 200px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px 18px 18px 6px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  font-size: 14px;
  line-height: 1.35;
}
.intro-bubble-me { border-color: transparent; border-radius: 18px 18px 6px 18px; background: var(--brand); }
.intro-chip {
  position: absolute;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 13px;
  font-weight: 600;
}
.intro-spark {
  position: absolute;
  width: 34px;
  height: 34px;
  background: var(--brand);
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
}
.intro-pos-a { left: 0; top: 4px; rotate: -6deg; }
.intro-pos-b { right: 10px; top: 24px; rotate: 5deg; }
.intro-pos-c { left: 30%; top: 118px; rotate: -2deg; }
.intro-pos-d { right: 0; bottom: 0; }
.intro-pos-e { left: 14px; bottom: 26px; }
.intro-pos-f { right: 0; top: 30px; }
.intro-pos-g { right: 8px; bottom: 6px; }
@media (prefers-reduced-motion: no-preference) {
  .intro-tile, .intro-card, .intro-bubble, .intro-chip { animation: intro-float 6s ease-in-out infinite; }
  .intro-pos-b, .intro-pos-f { animation-delay: -2s; }
  .intro-pos-c, .intro-pos-g, .intro-pos-d { animation-delay: -4s; }
}
@keyframes intro-float {
  50% { translate: 0 -6px; }
}
.intro-actions { display: grid; gap: 10px; padding: 14px 20px 2px; }
.intro-cta,
.intro-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 18px;
  border-radius: 14px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}
.intro-cta { background: var(--brand); box-shadow: 0 12px 30px rgba(37, 99, 235, 0.35); }
.intro-cta:hover { background: var(--brand-hover); }
.intro-secondary { border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.06); }
.intro-secondary:hover { background: rgba(255, 255, 255, 0.12); }
.intro-cta:focus-visible,
.intro-secondary:focus-visible { outline: 2px solid #a5b4fc; outline-offset: 3px; }
@media (min-width: 900px) {
  .intro-top { padding-top: 22px; }
  .intro-logo { width: 140px; }
  .intro-slide {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 56px;
    padding: 24px max(48px, calc((100% - 1080px) / 2));
  }
  .intro-text h2 { font-size: 44px; }
  .intro-text p { font-size: 18px; }
  .intro-art { max-width: 440px; height: 340px; }
  .intro-tile { width: 132px; height: 132px; border-radius: 30px; }
  .intro-actions { grid-template-columns: 1fr 1fr; width: 100%; max-width: 560px; margin: 0 auto; padding-bottom: 20px; }
}

.login { min-height: 100dvh; display: flex; flex-direction: column; }
.login-pitch {
  display: flex;
  flex-direction: column;
  padding: 24px 20px 28px;
  color: #fff;
  background: var(--night-base);
}
.login-brand { display: flex; align-items: center; }
.login-brand .logo { width: auto; height: 30px; }
.login-hero { margin-top: 24px; }
.login-hero h1 { max-width: 15em; font-size: 26px; font-weight: 600; line-height: 1.2; letter-spacing: -0.015em; }
.login-tagline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.72);
  font: 14px/1.4 Georgia, "Times New Roman", serif;
}
.login-tagline::before { content: ""; flex: none; width: 22px; border-top: 1px solid rgba(255, 255, 255, 0.4); }
.login-points, .login-trust { display: none; }

.login-main {
  --accent: #2563eb;
  --accent-text: #2563eb;
  --accent-ring: rgba(37, 99, 235, 0.18);
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 28px 20px 20px;
  background: var(--page);
  color: var(--ink);
}
.login-panel { width: min(480px, 100%); margin: auto; display: flex; flex-direction: column; gap: 20px; }
.login-brand-form { display: none; }
.login-legal { margin-top: 24px; color: var(--ink-2); font-size: 12px; text-align: center; }
.login-legal a { text-underline-offset: 2px; }

.auth { display: flex; flex-direction: column; gap: 22px; }
.auth a { color: var(--accent-text); font-weight: 500; text-decoration: none; }
.auth a:hover { text-decoration: underline; text-underline-offset: 2px; }
.auth-head { display: flex; flex-direction: column; gap: 8px; }
.auth-title { font-size: 26px; font-weight: 600; line-height: 1.2; letter-spacing: -0.015em; }
.auth-intro { color: var(--ink-2); overflow-wrap: anywhere; }
.auth-quote { color: var(--ink-2); font: 15px/1.45 Georgia, "Times New Roman", serif; }
.auth-quote strong { color: var(--ink); }
.login-form { display: flex; flex-direction: column; gap: 18px; }
.auth .field { font-weight: 500; }
.field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.auth input:not([type="checkbox"]) { min-height: 54px; padding-left: 16px; border-radius: 14px; }
.auth .btn-primary {
  min-height: 54px;
  margin-top: 8px;
  background: var(--brand) border-box;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.26);
  color: #fff;
}
.auth .btn-primary:hover { background: var(--brand-hover) border-box; }
.auth-rule { width: 100%; margin: 4px 0 0; border: 0; border-top: 1px solid var(--hairline); }
.auth-or { display: flex; align-items: center; gap: 12px; margin-top: 4px; color: var(--ink-2); font-size: 13px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; border-top: 1px solid var(--hairline); }
.auth .btn-google { min-height: 54px; border-color: var(--baseline); background: var(--surface); color: var(--ink); font-weight: 500; }
.auth .btn-google:hover { background: var(--surface-2); text-decoration: none; }
.btn-google svg { stroke: none; }
.auth-links { display: flex; flex-direction: column; gap: 6px; align-items: center; color: var(--ink-2); font-size: 14px; text-align: center; }
.check-field { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; font-weight: 400; color: var(--ink-2); }
input[type="checkbox"] { flex: none; width: 20px; height: 20px; min-height: 20px; margin: 1px 0 0; padding: 0; accent-color: var(--accent); }
.password-wrap { position: relative; display: block; }
.password-wrap input { padding-right: 52px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink-2);
}
.password-toggle:hover { color: var(--ink); }
.password-toggle svg { width: 18px; height: 18px; stroke-width: 1.8; }
.legal-links { text-align: center; }
.dev-title { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
#dev-box { border-top: 1px solid var(--hairline); padding-top: 14px; }
.dev-mail { display: flex; flex-direction: column; gap: 2px; font-size: 13px; overflow-wrap: anywhere; }
.dev-mail + .dev-mail { margin-top: 10px; }
#dev-box a { color: var(--accent-text); }
.dev-form { display: flex; gap: 8px; margin-top: 8px; }
.dev-form input { flex: 1; min-width: 0; }
.dev-replies { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; font-size: 14px; }

@media (min-width: 1000px) {
  .login { display: grid; grid-template-columns: minmax(0, 1.82fr) minmax(480px, 1fr); }
  .login-pitch { min-height: 100dvh; padding: 56px; }
  .login-hero { margin-top: clamp(64px, 16vh, 150px); }
  .login-hero h1 { font-size: 36px; }
  .login-tagline { margin-top: 18px; }
  .login-points { display: grid; gap: 20px; margin: auto 0 0; padding: 48px 0 0; list-style: none; }
  .login-points li { display: flex; gap: 12px; align-items: center; }
  .login-photo { flex: none; border-radius: 50%; }
  .login-points strong { display: block; font-weight: 600; }
  .login-points strong + span { display: block; margin-top: 1px; color: rgba(255, 255, 255, 0.6); font-size: 13.5px; }
  .login-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-top: clamp(36px, 12vh, 110px);
    color: rgba(255, 255, 255, 0.55);
    font-size: 12.5px;
  }
  .login-main { padding: 40px 48px 20px; }
  .login-brand-form { display: flex; }
  .login-brand-form .logo { height: 26px; }
}

/* Estrutura */
.shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background-image:
    radial-gradient(52% 46% at 0% 100%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 72%),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: auto, 56px 56px, 56px 56px;
  background-attachment: fixed;
}
.appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: var(--page);
}
/* A logo tem duas versões: índigo e azul para fundo escuro, navy e azul para fundo claro. */
.logo { display: block; }
.logo-on-light { display: none; }
:root[data-theme="light"] .logo-on-dark { display: none; }
:root[data-theme="light"] .logo-on-light { display: block; }
.brand { flex: 0 1 auto; min-width: 0; text-decoration: none; }
.brand .logo { width: 119px; max-width: 100%; height: auto; }
.appbar-actions { display: flex; align-items: center; gap: 8px; }
.appbar-btn { width: 40px; height: 40px; border: 1px solid var(--ring); }
.appbar-btn[aria-current="page"] { background: var(--surface-2); }
.appbar .btn-whatsapp { min-height: 40px; padding: 0 12px; }
.appbar .btn-whatsapp span { display: none; }

/* No celular, os assessores flutuam logo abaixo da barra, num vidro por onde o conteúdo passa ao rolar. */
:root { --glass-space: 66px; }
/* O conteúdo some aos poucos atrás do vidro, sem aparecer nítido na fresta entre ele e a barra. */
.appbar::after {
  content: "";
  position: absolute;
  inset: 100% 0 auto;
  height: 16px;
  background: linear-gradient(var(--page), transparent);
  pointer-events: none;
}
.advisor-switch {
  position: fixed;
  inset: 65px 12px auto;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  padding: 5px;
  border: 1px solid var(--glass-edge);
  border-radius: 20px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.advisor-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px;
  border: 1.5px solid transparent;
  border-radius: 15px;
  text-decoration: none;
  min-width: 0;
}
.advisor-pill img { flex: none; width: 28px; height: 28px; border-radius: 50%; }
.advisor-pill-text { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; line-height: 1.15; }
.advisor-pill-area { font-size: 11px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; }
.advisor-pill-by { color: var(--ink-2); font-size: 11px; }
.advisor-pill[aria-current="page"] { border-color: color-mix(in srgb, var(--accent) 70%, var(--ink)); background: var(--accent-soft); }
/* O espaço de cima é a altura do vidro, que fica por cima da página. */
.workspace { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: var(--glass-space) 16px calc(24px + env(safe-area-inset-bottom)); }
/* Em tela muito estreita, a foto sobre o nome: lado a lado, "Finanças" não caberia. */
@media (max-width: 359px) {
  :root { --glass-space: 88px; }
  /* Com o X, o "agora" não cabe na primeira linha do balão e cairia sozinho na segunda. */
  .briefing-time { display: none; }
  .advisor-pill { flex-direction: column; gap: 1px; }
  .advisor-pill img { width: 24px; height: 24px; }
  .advisor-pill-text { align-items: center; }
}
.rail { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; }
.rail-item {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--ring);
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.rail-item svg { width: 18px; height: 18px; }
.rail-item[aria-current="page"] { border-color: transparent; background: var(--accent); color: var(--on-accent); font-weight: 600; }
main {
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  transition: opacity 120ms linear;
}
main[aria-busy="true"] { opacity: 0.55; }

@media (min-width: 900px) {
  /* Só aqui: o desfoque faria os assessores, fixos no celular, se prenderem à barra. */
  .appbar { padding: 14px 28px; background: color-mix(in srgb, var(--page) 88%, transparent); backdrop-filter: blur(10px); }
  .appbar::after { display: none; }
  .brand .logo { width: 139px; }
  .advisor-switch {
    position: static;
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--ring);
    border-radius: 999px;
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: none;
  }
  .advisor-pill { justify-content: flex-start; gap: 8px; padding: 3px 14px 3px 3px; border-radius: 999px; }
  .advisor-pill:hover { background: var(--surface-2); }
  .advisor-pill[aria-current="page"]:hover { background: var(--accent-soft); }
  .advisor-pill img { width: 36px; height: 36px; }
  .advisor-pill-area { font-size: 12.5px; }
  .advisor-pill-by { font-size: 12px; }
  .appbar .btn-whatsapp { padding: 0 16px; }
  .appbar .btn-whatsapp span { display: inline; }
  .workspace { flex-direction: row; align-items: flex-start; gap: 20px; padding: 8px 28px 32px; }
  .rail {
    position: sticky;
    top: 84px;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 8px;
    border: 1px solid var(--ring);
    border-radius: 999px;
    overflow: visible;
  }
  .rail-item { justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; }
  .rail-item:hover { background: var(--surface-2); color: var(--ink); }
  .rail-item[aria-current="page"]:hover { background: var(--accent); color: var(--on-accent); }
  .rail-item svg { width: 21px; height: 21px; }
  .rail-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* Assessores */
.advisor { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.advisor-photo { flex: none; width: 52px; height: 52px; border-radius: 50%; }
.advisor-name { font-size: 20px; line-height: 1.2; font-weight: 700; letter-spacing: -0.015em; }
.advisor-role { color: var(--ink-2); font-size: 13.5px; }
.team { display: flex; gap: 6px; }
.team img { width: 34px; height: 34px; border-radius: 50%; }

/* Cabeçalhos */
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.dash-title { font-size: 28px; font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.dash-sub { color: var(--ink-2); font-size: 14px; }
.dash-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 14px; }
.month-nav { display: flex; align-items: center; gap: 2px; margin-left: -10px; }
.month-nav-label { min-width: 150px; text-align: center; font-size: 16px; font-weight: 600; }
.month-nav .link-btn { margin-left: 6px; font-size: 14px; }
.dash-tabs { display: flex; align-items: center; gap: 6px; min-width: 0; }
.widget-menu.dash-menu summary { width: 40px; height: 40px; border: 1px solid var(--ring); border-radius: 50%; }
.dash-menu .widget-menu-list { top: 46px; }
.organize-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  margin-bottom: 14px;
  padding: 10px 14px;
  border: 1px dashed var(--baseline);
  border-radius: 16px;
  color: var(--ink-2);
  font-size: 14px;
}
.panel-tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--ring); border-radius: 26px; }
.panel-tab {
  min-height: 38px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
}
.panel-tab:hover { background: var(--surface-2); }
.panel-tab[aria-current="page"] { background: var(--accent); color: var(--on-accent); font-weight: 650; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.topbar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.month { display: flex; align-items: center; gap: 2px; margin-left: -10px; }
.month-label { min-width: 148px; text-align: center; font-weight: 600; }
.month-label::first-letter { text-transform: uppercase; }
.btn-label { display: none; }
@media (min-width: 480px) { .btn-label { display: inline; } }
.btn-add { padding: 0 14px; }
.page-title { font-size: 26px; line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; }
.section-title { font-size: 15px; font-weight: 650; }
.topbar-text { flex: 1 1 200px; font-size: 14px; }
.banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
  border: 1px solid var(--ring);
  border-left: 3px solid var(--critical);
  border-radius: 14px;
  background: var(--surface);
  font-size: 14px;
}
.banner span { flex: 1 1 220px; color: var(--ink-2); }

/* Blocos do painel */
.widgets { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.widget {
  grid-column: span 12;
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--ring);
  border-radius: 22px;
  box-shadow: var(--soft-shadow);
}
.widget.is-dragging { opacity: 0.4; }
.widget-head { display: flex; align-items: flex-start; gap: 6px; }
.widget-grip { flex: none; display: grid; place-items: center; width: 22px; height: 24px; margin-left: -4px; color: var(--ink-2); cursor: grab; touch-action: none; }
.widget-grip:active { cursor: grabbing; }
.widget-grip svg, .widget-menu summary svg { width: 18px; height: 18px; stroke-width: 2.800; }
.widget-titles { flex: 1; min-width: 0; }
.widget-title { font-size: 15.5px; font-weight: 650; letter-spacing: -0.005em; }
.widget-sub { color: var(--ink-2); font-size: 12.500px; }
.widget-menu { flex: none; position: relative; }
.widget-menu summary { display: grid; place-items: center; width: 30px; height: 26px; border-radius: 8px; color: var(--ink-2); cursor: pointer; list-style: none; }
.widget-menu summary::-webkit-details-marker { display: none; }
.widget-menu summary:hover { background: var(--surface-2); color: var(--ink); }
.widget-menu-list {
  position: absolute;
  z-index: 15;
  top: 30px;
  right: 0;
  display: grid;
  min-width: 190px;
  padding: 6px;
  background: var(--surface-2);
  border: 1px solid var(--ring);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.widget-menu-list button { padding: 8px 10px; border: 0; border-radius: 9px; background: none; font-size: 14px; text-align: left; }
.widget-menu-list button:hover { background: var(--hairline); }
.widget-menu-list button:disabled { color: var(--axis); cursor: default; background: none; }
.kpi-value { font-size: 32px; font-weight: 650; line-height: 1.1; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.kpi-lines { display: grid; gap: 2px; }
.kpi-line { display: flex; justify-content: space-between; gap: 10px; color: var(--ink-2); font-size: 13.5px; }
.kpi-line strong { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 28px; }
.delta { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.kpi-foot .spark { margin-left: auto; }
.delta.is-good { background: var(--good-soft); }
.delta.is-bad { background: var(--bad-soft); }
.spark { flex: none; width: 84px; height: 28px; }
.spark path { stroke-width: 2; }
.spark .spark-income { stroke: var(--income); }
.spark .spark-expense { stroke: var(--expense); }
.spark .spark-balance { stroke: var(--ink-2); }
.account-list { display: grid; gap: 10px; }
.account-line { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.account-line-name { min-width: 0; overflow-wrap: anywhere; color: var(--ink-2); }
.account-line-value { flex: none; font-weight: 650; font-variant-numeric: tabular-nums; }
.account-track { height: 4px; margin-top: 4px; border-radius: 2px; background: var(--hairline); }
.account-fill { height: 100%; min-width: 3px; border-radius: 2px; background: var(--income); }
.account-fill.is-negative { background: var(--expense); }
.widget-empty { padding: 8px 0; color: var(--ink-2); font-size: 14px; }
.widget-empty a { display: inline-block; margin-top: 6px; color: var(--accent-text); font-weight: 600; }
@media (min-width: 700px) {
  .w-kpi, .w-half { grid-column: span 6; }
}
@media (min-width: 1180px) {
  .w-kpi { grid-column: span 3; }
}

/* Fluxo mensal */
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--ink-2); font-size: 13px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-bar { width: 10px; height: 10px; border-radius: 3px; }
.legend-bar.income { background: var(--income); }
.legend-bar.expense { background: var(--expense); }
.legend-bar.planned { background: var(--ink-2); opacity: 0.4; }
.legend-line { width: 18px; border-top: 2px dashed var(--ink); }
.flow-chart { min-height: 300px; }
.flow-chart svg { display: block; width: 100%; }
.flow-grid { stroke: var(--hairline); stroke-width: 1; }
.flow-zero { stroke: var(--baseline); stroke-width: 1; }
.flow-text { fill: var(--ink-2); stroke: none; font-size: 12.500px; }
.flow-end { fill: var(--ink); stroke: none; font-size: 12.500px; font-weight: 650; }
.flow-income { fill: var(--income); stroke: none; }
.flow-expense { fill: var(--expense); stroke: none; }
.flow-pending { fill-opacity: 0.38; }
.flow-line { fill: none; stroke: var(--ink); stroke-width: 2; stroke-dasharray: 5 5; }
.flow-dot { fill: var(--ink); stroke: var(--surface); stroke-width: 2; }
.flow-band { fill: transparent; stroke: none; cursor: default; outline: none; }
.flow-band:hover, .flow-band:focus-visible { fill: var(--hairline); }
.chart-table summary { color: var(--ink-2); font-size: 13px; cursor: pointer; }
.chart-table table { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.chart-table th, .chart-table td { padding: 6px 8px; border-top: 1px solid var(--hairline); text-align: right; white-space: nowrap; }
.chart-table th:first-child, .chart-table td:first-child { text-align: left; }
.chart-table thead th { border-top: 0; color: var(--ink-2); font-weight: 500; }
.chart-table-wrap { overflow-x: auto; }

/* Barras por categoria */
.cat-list { list-style: none; margin: 0 -8px; padding: 0; }
.cat-row { display: block; width: 100%; padding: 8px; border: 0; border-radius: 12px; background: none; text-align: left; }
button.cat-row:hover { background: var(--surface-2); }
.cat-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.cat-name { font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.cat-value { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cat-bottom { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.cat-track { flex: 1; min-width: 0; }
.cat-bar { height: 10px; min-width: 3px; background: var(--expense); border-radius: 0 4px 4px 0; }
.cat-percent { width: 38px; text-align: right; color: var(--ink-2); font-size: 13px; font-variant-numeric: tabular-nums; }

/* Listas */
.filters { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin-bottom: 12px; }
.filters .wide { grid-column: 1 / -1; }
.day { margin-bottom: 14px; }
.day-head { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; color: var(--ink-2); font-size: 13px; }
.day-head span:last-child { font-variant-numeric: tabular-nums; }
.day-head .day-name::first-letter { text-transform: uppercase; }
.rows { background: var(--surface); border: 1px solid var(--ring); border-radius: 18px; box-shadow: var(--soft-shadow); overflow: hidden; }
.widget .rows { background: none; border: 0; border-radius: 0; box-shadow: none; margin: 0 -8px; }
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 8px 12px;
  border: 0;
  border-top: 1px solid var(--hairline);
  background: none;
  text-align: left;
}
.rows > :first-child { border-top: 0; }
button.row:hover { background: var(--surface-2); }
.row-emoji { font-size: 20px; line-height: 1; flex: none; width: 26px; text-align: center; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 500; overflow-wrap: anywhere; }
.row-sub { display: block; color: var(--ink-2); font-size: 13px; }
.row-amount { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-mark { flex: none; width: 4px; height: 26px; border-radius: 2px; background: var(--expense); }
.row-mark.is-income { background: var(--income); }
.row-mark.is-planned { background: var(--planned); }
.row-time { flex: none; width: 58px; color: var(--accent-text); font-weight: 650; font-size: 14px; font-variant-numeric: tabular-nums; }

/* Tarefas */
.task-add { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.task-add input:first-child { flex: 1 1 100%; }
.task-add input[type="date"] { flex: 1 1 150px; }
.task-add input[type="time"] { flex: 1 1 110px; }
.task-hint { margin-bottom: 16px; }
@media (min-width: 700px) {
  .task-add input:first-child { flex: 1 1 220px; }
  .task-add input[type="date"] { flex: 0 1 170px; }
  .task-add input[type="time"] { flex: 0 1 120px; }
}
.task-row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 12px; border-top: 1px solid var(--hairline); }
.rows > .task-row:first-child { border-top: 0; }
.task-open { flex: 1; min-width: 0; border: 0; background: none; padding: 2px 0; text-align: left; }
.task-row.is-done .row-title { color: var(--ink-2); text-decoration: line-through; }
.task-late { color: var(--critical); }
.past-toggle { margin: 4px 0 8px; }
.empty.panel { margin-bottom: 14px; }

/* Agenda: o céu é o mesmo nos dois temas. Os cartões de baixo continuam claros, para a leitura. */
body[data-advisor="agenda"] .shell {
  /* A barra de cima fica navy: o "xx" azul da logo sumiria sobre o céu azul. */
  --page: #101828;
  --surface: rgba(255, 255, 255, 0.1);
  --surface-2: rgba(255, 255, 255, 0.16);
  --ink: #ffffff;
  --ink-2: rgba(255, 255, 255, 0.8);
  --hairline: rgba(255, 255, 255, 0.2);
  --baseline: rgba(255, 255, 255, 0.34);
  --ring: rgba(255, 255, 255, 0.28);
  --accent: #a5b4fc;
  --on-accent: #101828;
  --accent-text: #ffffff;
  --accent-soft: rgba(255, 255, 255, 0.14);
  /* Azul o bastante para o texto branco continuar legível quando um cartão branco passa por baixo. */
  --glass: rgba(28, 65, 147, 0.74);
  --glass-edge: rgba(255, 255, 255, 0.28);
  color: var(--ink);
  /* Do Electric Blue escurecido ao Violet e ao Soft Indigo, que ficam só na faixa final, sem texto por cima. */
  background: linear-gradient(180deg, #1c4193 0, #2154c4 340px, #3a4fd6 calc(100% - 150px), #7657ff calc(100% - 60px), #a5b4fc 100%);
}
/* O lilás do fim do céu é claro demais para texto branco: fica numa faixa sem conteúdo. */
body[data-advisor="agenda"] #view::after { content: ""; display: block; height: 130px; }
body[data-advisor="agenda"] .appbar { border-bottom: 1px solid var(--hairline); }
body[data-advisor="agenda"] .appbar .logo-on-dark { display: block; }
body[data-advisor="agenda"] .appbar .logo-on-light { display: none; }
body[data-advisor="agenda"] .shell .rows,
body[data-advisor="agenda"] .shell .google-card,
body[data-advisor="agenda"] .shell .empty.panel,
body[data-advisor="agenda"] .shell .banner {
  color-scheme: light;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --ink: #101828;
  --ink-2: #5c6b81;
  --hairline: #e2e8f0;
  --ring: rgba(16, 24, 40, 0.12);
  --baseline: #cbd5e1;
  --accent: #2563eb;
  --on-accent: #ffffff;
  --accent-text: #2563eb;
  --critical: #b3261e;
  color: var(--ink);
}
body[data-advisor="agenda"] .shell .google-card .btn-primary { background: #2563eb; color: #fff; }
/* Azul sobre o céu azul sumiria: na Agenda, o botão do WhatsApp usa o Soft Indigo. */
body[data-advisor="agenda"] .shell .btn-whatsapp { background: var(--accent); color: var(--on-accent); }
/* A primeira tela é só a visão do dia: tira da altura a barra de cima e, no celular, o vidro dos assessores. */
.day-hero {
  --chrome: calc(var(--glass-space) + 74px);
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--chrome));
  min-height: calc(100svh - var(--chrome) - env(safe-area-inset-bottom));
  margin-bottom: 18px;
}
.day-cue { align-self: center; flex: none; min-height: 48px; margin-top: 6px; padding: 0 24px 0 20px; box-shadow: 0 8px 24px rgba(16, 24, 40, 0.28); }
.day-cue svg { width: 20px; height: 20px; }
.day-summary { display: grid; gap: 14px; }
.day-eyebrow { color: var(--ink-2); font-size: 13px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; }
.day-count { display: flex; align-items: baseline; gap: 10px; margin-top: 4px; font-size: 22px; font-weight: 500; }
.day-count strong { font-size: 60px; font-weight: 500; line-height: 1; letter-spacing: -0.03em; }
.day-stats { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 12px; }
.day-stat { display: flex; flex-direction: column; gap: 2px; }
.day-stat span { color: var(--ink-2); font-size: 12px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; }
.day-stat strong { font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; }
.day-all-day { margin-top: 10px; color: var(--ink-2); font-size: 14px; overflow-wrap: anywhere; }
/* A mensagem do dia tem a cara de uma notificação do celular. No celular, vem antes dos números, logo abaixo do menu. */
.briefing {
  position: relative;
  order: -1;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  color: #101828;
  box-shadow: 0 12px 32px rgba(16, 24, 40, 0.32);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
}
.briefing.is-arriving { animation: briefing-arrive 520ms cubic-bezier(0.2, 1.3, 0.35, 1) 1200ms both; }
/* Escondido de verdade enquanto espera: o X invisível não pode receber um toque nem o foco. */
@keyframes briefing-arrive {
  from { visibility: hidden; opacity: 0; transform: translateY(-32px) scale(0.96); }
  to { visibility: visible; opacity: 1; transform: none; }
}
.briefing.is-leaving { overflow: hidden; pointer-events: none; animation: briefing-leave 260ms ease-in-out forwards; }
/* A margem negativa recolhe também o vão até os números, que no celular vêm logo abaixo. */
@keyframes briefing-leave {
  to { height: 0; margin-bottom: -14px; padding-block: 0; border-width: 0; opacity: 0; transform: translateY(-12px) scale(0.97); }
}
.briefing-photo { flex: none; width: 46px; height: 46px; border-radius: 50%; }
.briefing-body { flex: 1; min-width: 0; }
.briefing-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; padding-right: 26px; }
.briefing-close {
  position: absolute;
  top: 6px;
  right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #5c6b81;
}
/* O desenho é pequeno, mas a área de toque tem 44 px. */
.briefing-close::after { content: ""; position: absolute; inset: -6px; }
.briefing-close:hover { background: rgba(16, 24, 40, 0.08); color: #101828; }
/* O contorno de foco da Agenda é branco, feito para o céu azul, e sumiria no balão claro. Por dentro, para não encostar no "agora". */
.briefing-close:focus-visible { outline-color: #2563eb; outline-offset: -2px; }
.briefing-close svg { width: 16px; height: 16px; }
.briefing-name { font-size: 15.5px; font-weight: 700; }
.briefing-role, .briefing-time, .briefing-sent { color: #5c6b81; font-size: 12.5px; }
.briefing-time { margin-left: auto; }
.briefing-text { margin-top: 2px; font-size: 14.5px; line-height: 1.4; overflow-wrap: anywhere; }
.briefing-text strong { font-weight: 700; }
.briefing-sent { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.briefing-sent svg { flex: none; width: 14px; height: 14px; }
.day-arc { position: relative; flex: 1; min-height: 220px; margin-top: 8px; }
.day-arc svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; overflow: visible; }
.arc-line { fill: none; stroke-width: 3; }
.arc-hit { fill: transparent; stroke: none; }
.arc-dot { fill: #fff; stroke: #2563eb; stroke-width: 2; }
.arc-event { outline: none; }
.arc-event:focus-visible .arc-dot, .arc-event:hover .arc-dot { fill: #a5b4fc; }
.arc-sun { fill: #a5b4fc; stroke: rgba(165, 180, 252, 0.35); stroke-width: 6; }
.arc-title { fill: #fff; stroke: none; font-size: 15.5px; font-weight: 600; }
.arc-time { fill: rgba(255, 255, 255, 0.85); stroke: none; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.arc-now { fill: rgba(255, 255, 255, 0.92); stroke: none; font-size: 14px; font-weight: 500; }
.arc-big { fill: #fff; stroke: none; font-size: 32px; font-weight: 600; letter-spacing: -0.01em; }
.arc-small { fill: rgba(255, 255, 255, 0.82); stroke: none; font-size: 13.5px; }
/* Ao abrir a aba: tudo começa escondido e aparece quando a linha chega. */
.is-intro .arc-reveal { opacity: 0; transform: translateY(8px); transition: opacity 320ms ease-out, transform 320ms ease-out; }
.is-intro .arc-reveal.is-shown { opacity: 1; transform: none; }
.arc-tip circle { fill: #fff; stroke: rgba(255, 255, 255, 0.35); stroke-width: 6; }
.arc-tip-time { fill: #fff; stroke: none; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
@media (min-width: 900px) {
  body[data-advisor="agenda"] .advisor-switch { background: rgba(16, 24, 40, 0.35); }
  .day-hero { --chrome: 105px; }
  .day-summary { grid-template-columns: minmax(0, 1fr) minmax(0, 460px); gap: 20px; align-items: start; }
  .briefing { order: 0; }
  .day-count strong { font-size: 76px; }
}

.google-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--ring);
  border-radius: 18px;
  box-shadow: var(--soft-shadow);
}

/* Veículos */
.vehicle-tabs { flex-wrap: wrap; margin-bottom: 12px; }
.vehicle-start { max-width: 620px; margin: 0 auto 14px; }
.vehicle-start form { display: grid; gap: 12px; }
.vehicle-start .btn { justify-self: start; }
.vehicle-card { margin-bottom: 16px; }
.vehicle-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.vehicle-name { font-size: 22px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.vehicle-plate { margin-top: 2px; color: var(--ink-2); font-size: 14px; letter-spacing: 0.04em; }
.vehicle-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.vehicle-stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vehicle-stat span { color: var(--ink-2); font-size: 13px; }
.vehicle-stat strong { font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.vehicle-actions { margin-top: 16px; }
.vehicle-note { margin-bottom: 12px; font-size: 14px; }
.service-date { flex: none; width: 88px; color: var(--ink-2); font-size: 13.5px; font-variant-numeric: tabular-nums; }
@media (min-width: 760px) {
  .vehicle-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Relatório do veículo: uma folha branca, igual na tela e no PDF. */
.report-page { max-width: 860px; margin: 0 auto; }
.report-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 6px; }
.report-toolbar .check-field { margin-left: auto; }
.report-tip { margin-bottom: 10px; text-align: right; }
.report {
  color-scheme: light;
  padding: 24px 20px;
  border-radius: 14px;
  background: #fff;
  color: #101828;
  box-shadow: var(--soft-shadow);
}
.report-logo { width: auto; height: 22px; margin-bottom: 18px; }
.report-kicker { color: #5c6b81; font-size: 13px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; }
.report-title { margin-top: 2px; font-size: 26px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.report-plate { margin-top: 2px; color: #5c6b81; font-size: 15px; }
.report-facts { display: flex; flex-wrap: wrap; gap: 12px 32px; margin-top: 18px; padding: 14px 0; border-top: 1px solid #e2e8f0; border-bottom: 1px solid #e2e8f0; }
.report-fact { display: flex; flex-direction: column; gap: 1px; }
.report-fact span { color: #5c6b81; font-size: 12.5px; }
.report-fact strong { font-size: 15.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.report-table { width: 100%; margin-top: 16px; border-collapse: collapse; font-size: 14px; }
.report-table th { padding: 8px 10px 8px 0; border-bottom: 2px solid #101828; color: #101828; font-size: 12.5px; font-weight: 650; text-align: left; }
.report-table td { padding: 9px 10px 9px 0; border-bottom: 1px solid #e2e8f0; vertical-align: top; overflow-wrap: anywhere; }
.report-table td:first-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.report-table .report-number { padding-right: 0; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.report-empty { margin-top: 18px; color: #5c6b81; }
.report-foot { margin-top: 18px; color: #5c6b81; font-size: 12.5px; }
.report-foot p + p { margin-top: 2px; }
/* Na tela estreita, cada manutenção vira um bloco, com o nome da coluna ao lado. O PDF sempre sai como tabela. */
@media screen and (max-width: 560px) {
  .report-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .report-table, .report-table tbody, .report-table tr, .report-table td { display: block; width: 100%; }
  .report-table tr { padding: 10px 0; border-bottom: 1px solid #e2e8f0; }
  .report-table td, .report-table .report-number { display: flex; justify-content: space-between; gap: 16px; padding: 2px 0; border: 0; text-align: right; white-space: normal; }
  .report-table td::before { content: attr(data-label); flex: none; color: #5c6b81; text-align: left; }
}
@media print {
  @page { margin: 16mm; }
  .appbar, .rail, .advisor-switch, .report-toolbar, .report-tip, .toast, .tooltip { display: none !important; }
  html, body, .shell, .workspace, main { background: #fff !important; }
  .shell { background-image: none !important; }
  .workspace { padding: 0 !important; }
  .report-page { max-width: none; }
  .report { padding: 0; border-radius: 0; box-shadow: none; }
  .report-table tr { break-inside: avoid; }
}

/* Boas-vindas */
.welcome { max-width: 1040px; margin: 0 auto; }
.welcome-hero { padding: 24px 20px; border-radius: 22px; background: linear-gradient(110deg, #1c4193, #2563eb 45%, #7657ff); color: #fff; }
.welcome-title { font-size: 28px; font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.welcome-intro { margin-top: 6px; font-size: 16px; }
.welcome-cards { display: grid; gap: 12px; margin-top: 14px; }
.welcome-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--ring);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
}
.welcome-card[data-advisor="finance"] { --accent: var(--finance); --on-accent: var(--on-finance); }
.welcome-card[data-advisor="agenda"] { --accent: var(--agenda); --on-accent: var(--on-agenda); }
.welcome-card[data-advisor="tasks"] { --accent: var(--tasks); --on-accent: var(--on-tasks); }
.welcome-who { display: flex; align-items: center; gap: 12px; }
.welcome-who img { flex: none; width: 64px; height: 64px; border: 2px solid var(--accent); border-radius: 50%; }
.welcome-name { font-size: 19px; font-weight: 650; line-height: 1.2; }
.welcome-role { color: var(--ink-2); font-size: 13px; }
.welcome-text { flex: 1; }
.welcome-foot { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 16px; color: var(--ink-2); font-size: 14px; }
.welcome-foot a:not(.btn) { color: var(--ink); font-weight: 600; }
.welcome-foot .btn { margin-top: 8px; color: var(--ink); }
@media (min-width: 760px) {
  .welcome-hero { padding: 36px 40px; }
  .welcome-title { font-size: 36px; }
  .welcome-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Conta */
.panel {
  background: var(--surface);
  border: 1px solid var(--ring);
  border-radius: 22px;
  box-shadow: var(--soft-shadow);
  padding: 16px 18px;
  min-width: 0;
}
.panel-title { font-size: 15px; font-weight: 650; }
.account { display: grid; gap: 14px; max-width: 620px; margin: 0 auto; }
.account-text { margin: 4px 0 12px; font-size: 14px; }
.account-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.account-form { display: grid; gap: 12px; }
.account-form .btn { justify-self: start; }
.account-email { margin-top: 2px; font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }
.whatsapp-steps { display: grid; gap: 16px; margin: 4px 0 0; padding: 0; list-style: none; counter-reset: passo; font-size: 14.5px; }
.whatsapp-steps li { display: flex; align-items: flex-start; gap: 12px; counter-increment: passo; }
.whatsapp-steps li::before {
  content: counter(passo);
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  font-size: 14px;
  font-weight: 650;
}
.whatsapp-step { display: grid; justify-items: start; gap: 8px; min-width: 0; padding-top: 3px; }
.whatsapp-message { padding: 10px 14px; border-radius: 12px; background: var(--surface-2); }
.whatsapp-expiry { margin-top: 14px; }
.whatsapp-retry { margin-top: 10px; }
.link-text { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.account-divider { margin: 14px 0; border: 0; border-top: 1px solid var(--hairline); }

/* Painel compartilhado */
.shared { min-height: 100dvh; padding: 20px 16px 40px; }
.shared-inner { max-width: 1400px; margin: 0 auto; }
.shared-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }

/* Páginas simples: termos, privacidade e Google */
.simple-page { max-width: 720px; margin: 0 auto; padding: 32px 16px 56px; }
.simple-page h1 { font-size: 26px; line-height: 1.2; letter-spacing: -0.015em; margin-bottom: 12px; }
.simple-page p { margin-bottom: 12px; }
.simple-page a:not(.btn) { color: var(--accent-text); }
.simple-page .btn { margin-top: 4px; }
.legal h2 { font-size: 17px; margin: 24px 0 8px; }
.legal ul { padding-left: 20px; margin: 0 0 12px; }
.legal li { margin-bottom: 6px; }

/* Formulários */
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ink-2); min-width: 0; }
input, select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--baseline);
  border-radius: 12px;
  background: var(--surface);
  font-size: 16px;
  font-weight: 400;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus { border-color: var(--accent-text); outline: 3px solid var(--accent-ring); outline-offset: 0; }
/* No iPhone, data e hora têm uma largura própria que ignora o 100% e passa da borda do cartão. Sem a aparência
   nativa, eles respeitam a largura e o seletor do sistema continua abrindo ao tocar. */
@supports (-webkit-touch-callout: none) {
  input[type="date"], input[type="time"] { display: block; -webkit-appearance: none; appearance: none; }
}
/* O Safari centraliza o valor; os outros campos ficam alinhados à esquerda. Regra à parte: os outros navegadores a descartam. */
input::-webkit-date-and-time-value { text-align: left; }
::placeholder { color: var(--axis); opacity: 1; }
textarea { min-height: 96px; resize: vertical; }
.form-error { color: var(--critical); font-size: 14px; }
.form-grid { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.form-grid .wide { grid-column: 1 / -1; }
.segmented { display: flex; gap: 4px; padding: 4px; margin-bottom: 12px; background: var(--surface-2); border-radius: 999px; }
.segmented button { flex: 1; min-height: 38px; border: 0; border-radius: 999px; background: none; color: var(--ink-2); font-weight: 500; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 650; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); }
.widget-options { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); margin-top: 12px; }
.share-url { margin: 10px 0; font-size: 14px; }

/* Janelas */
dialog {
  width: min(460px, 100%);
  max-width: 100%;
  max-height: 92dvh;
  margin: auto auto 0;
  padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
  border: 1px solid var(--ring);
  border-radius: 22px 22px 0 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
  overflow-y: auto;
}
dialog::backdrop { background: rgba(11, 18, 32, 0.6); }
.dialog-title { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 14px; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.dialog-actions .btn { flex: 1 1 auto; }
.dialog-actions .spacer { flex: 100 1 0; }
@media (min-width: 560px) {
  dialog { margin: auto; border-radius: 22px; padding: 24px; }
}

/* Adicionar evento: uma pergunta por vez, com o progresso no alto. */
.wizard-dialog .dialog-title { margin-bottom: 12px; padding-right: 44px; color: var(--ink-2); font-size: 15px; font-weight: 600; letter-spacing: 0; }
.wizard-close { position: absolute; top: 10px; right: 10px; }
.wizard-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.wizard-bar { display: flex; flex: 1; gap: 4px; }
.wizard-bar span { flex: 1; height: 4px; border-radius: 2px; background: var(--surface-2); transition: background-color 200ms ease-out; }
.wizard-bar span.is-done { background: var(--accent); }
.wizard-count { flex: none; color: var(--ink-2); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.wizard-recap { margin: -6px 0 12px; color: var(--ink-2); font-size: 13.5px; overflow-wrap: anywhere; }
/* A pergunta nova entra de lado. O vão de 4 px deixa o contorno do campo em foco aparecer inteiro. */
.wizard-stage { min-height: 150px; margin: -4px; padding: 4px; overflow: hidden; }
.wizard-step { display: grid; gap: 12px; }
.wizard-step[data-direction="next"] { animation: wizard-next 240ms ease-out; }
.wizard-step[data-direction="back"] { animation: wizard-back 240ms ease-out; }
@keyframes wizard-next { from { opacity: 0; transform: translateX(32px); } }
@keyframes wizard-back { from { opacity: 0; transform: translateX(-32px); } }
.wizard-field { display: grid; gap: 12px; }
.wizard-question { color: var(--ink); font-size: 21px; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; }
.wizard-field input { min-height: 52px; font-size: 17px; }
.wizard-answers { display: flex; flex-wrap: wrap; gap: 8px; }
.wizard-answers .chip { min-height: 40px; padding: 0 16px; font-size: 14px; font-weight: 600; }
.wizard-answers .chip[aria-pressed="true"] { border-color: var(--accent-text); background: var(--accent-soft); color: var(--accent-text); }
.wizard .dialog-actions { margin-top: 20px; }
.wizard .dialog-actions .btn-primary { flex-grow: 2; }
@media (prefers-reduced-motion: reduce) {
  .wizard-step[data-direction] { animation: none; }
}

/* Vazio */
.empty { padding: 28px 16px; text-align: center; color: var(--ink-2); }
.empty strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }

/* Conversa */
.chat { display: flex; flex-direction: column; border-radius: 22px; overflow: hidden; border: 1px solid var(--ring); background: var(--chat-bg); }
.thread { display: flex; flex-direction: column; gap: 6px; padding: 14px 12px; min-height: 300px; max-height: 58dvh; overflow-y: auto; }
.bubble {
  max-width: 86%;
  padding: 8px 12px;
  border-radius: 14px;
  background: var(--bubble-in);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  box-shadow: var(--soft-shadow);
}
.bubble.me { align-self: flex-end; background: var(--bubble-out); }
.chips { display: flex; gap: 6px; padding: 0 12px 10px; overflow-x: auto; scrollbar-width: none; }
.chip {
  flex: none;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--ring);
  border-radius: 18px;
  background: var(--surface);
  font-size: 13px;
}
.chip:hover { background: var(--surface-2); }
.chat-form { display: flex; gap: 8px; padding: 10px 12px; background: var(--surface); border-top: 1px solid var(--hairline); }
.chat-form input { flex: 1; min-width: 0; }
.check-mark { flex: none; width: 20px; height: 20px; }
.check-mark.ok { color: var(--good); }
.check-body { min-width: 0; flex: 1; }
.check-title { font-weight: 600; }
.check-sub { color: var(--ink-2); font-size: 13px; overflow-wrap: anywhere; }

/* Categorias */
.cat-edit-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Avisos flutuantes */
.tooltip {
  position: fixed;
  z-index: 40;
  max-width: 260px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--ring);
  box-shadow: var(--shadow);
  font-size: 13px;
  pointer-events: none;
}
.tooltip strong { display: block; font-size: 15px; font-variant-numeric: tabular-nums; }
.tooltip span { color: var(--ink-2); display: block; }
.toast {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--on-ink);
  font-weight: 500;
}

@media (min-width: 900px) {
  .filters { grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)) auto; align-items: end; }
  .filters .wide { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  main { transition: none; }
  .briefing.is-arriving, .briefing.is-leaving { animation: none; }
}

@media (forced-colors: active) {
  .cat-bar, .flow-income { background: CanvasText; fill: CanvasText; }
  .flow-expense, .account-fill { background: Highlight; fill: Highlight; }
  .login-pitch, .auth .btn-primary { background: Canvas; }
  .auth .btn-primary { border-color: ButtonText; }
}
