/* Minha Vida Organizada — Design tokens.
   Fonte única de verdade pra cor, tipografia, espaçamento, raio, sombra e os
   componentes-base (botão, input, card, badge, avatar). Nunca duplicar esses
   valores direto num arquivo de módulo.
   Regras: design-preview/mv-design-system-adapted.html (skill design-mvo). */

:root {
  /* Neutros quentes */
  /* Família lavanda empoeirada (2026-10-11, aprovada pela Viviane): fundo off-white neutro, cards brancos. */
  --bg: #F6F4F1;
  --surface: #FFFFFF;
  --surface-2: #F1EFEC;
  --border: #E6E2DC;
  --border-soft: #EFECE7;
  --border-strong: #D5D0C8;
  --text-primary: #25212E;
  --text-secondary: #625D6B;
  --text-faint: #6E6977;

  /* Cor de marca: SÓ seleção e estado ativo. Nunca status. */
  --brand: #6E5FA6;
  --brand-light: #EEEBF5;
  --brand-ink: #4F447F;
  /* Viagem sem foto no Início: degradê rosa antigo com texto branco. O destaque lavanda fica no bloco .destaque, mais abaixo. */
  --destaque-viagem-a: #6E4352; --destaque-viagem-b: #A56E7F;   /* viagem sem foto: rosa antigo, escuro o bastante pro texto branco */
  --on-destaque: #FFFFFF;
  --on-brand: #FFFFFF;

  /* Estados: SÓ dado sobre o conteúdo. Cada cor tem cheia, suave e ink (texto sobre o suave). */
  --good: #4E8B65;   --good-soft: #E8F1EB;   --good-ink: #2F5E40;
  --warn: #B08A2E;   --warn-soft: #F5EEDD;   --warn-ink: #6B521A;
  --danger: #B04E52; --danger-soft: #F5E8E8; --danger-ink: #7A3135; --danger-btn: #A8454A;

  /* Cor por módulo */
  /* Cores de apoio (empoeiradas, conversam com a lavanda): só nos detalhes de cada módulo (ícone, gráfico). */
  --module-fatura: #5D7197;       --module-fatura-soft: #ECEFF4;       --module-fatura-ink: #3E4F6E;
  --module-vip: #86688A;          --module-vip-soft: #F1EDF2;          --module-vip-ink: #5C4560;
  --module-financeiro: #6E8E7D;   --module-financeiro-soft: #ECF1EE;   --module-financeiro-ink: #45614F;
  --module-viagens: #A56E7F;      --module-viagens-soft: #F4EDEF;      --module-viagens-ink: #6E4352;
  --module-compromissos: #4E6F78; --module-compromissos-soft: #EAF0F1; --module-compromissos-ink: #334C53;
  --module-senhas: #5C5A72;       --module-senhas-soft: #EEEDF2;       --module-senhas-ink: #3F3D52;

  /* Sidebar clara: acompanha a superfície, sem bloco escuro fixo */
  --sidebar: var(--surface);
  --sidebar-ink: var(--text-primary);
  --sidebar-ink-soft: var(--text-secondary);
  --sidebar-line: var(--border);
  --sidebar-active: var(--brand-light);

  /* Sombra */
  --shadow-card: 0 1px 2px rgba(37,33,46,.04), 0 8px 22px -16px rgba(37,33,46,.18);
  --shadow-floating: 0 4px 14px -6px rgba(36,31,20,.28);
  --shadow-focus: 0 0 0 2px var(--surface), 0 0 0 4px var(--brand);   /* anel visível nos dois temas (contraste com o fundo acima de 3:1) */
  --overlay: rgba(36,31,20,.5);
  /* Sobre a foto do login o texto é sempre claro, nos dois temas. */
  --on-photo: #FFFFFF; --on-photo-accent: #B298F9; --photo-base: #241F14; --photo-veil: rgba(36,31,20,.69);

  /* Widget da próxima viagem: fundo escuro fixo nos dois temas, texto sempre branco */
  --travel-a: #0E4F86;
  --travel-b: #005E60;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  /* Números na fonte do texto, com algarismos de largura igual (2026-10-11: sai a fonte de programador). */
  --font-mono: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  color-scheme: light;
}

/* Tema escuro: mesmos matizes, luminosidade maior, fundo marrom muito escuro (quente) */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #16151A; --surface: #201E25; --surface-2: #29272F;
  --border: #37343E; --border-soft: #2C2A33; --border-strong: #4A4652;
  --text-primary: #F0EEF3; --text-secondary: #B5B1BC; --text-faint: #A29DAA;

  --brand: #A99BD8; --brand-light: rgba(169,155,216,.16); --brand-ink: #D3CAF0; --on-brand: #16151A;
  --destaque-viagem-a: #5A3744; --destaque-viagem-b: #86586A;
  --good: #8DBB9D; --good-soft: rgba(141,187,157,.16); --good-ink: #BCD9C5;
  --warn: #D6B566; --warn-soft: rgba(214,181,102,.16); --warn-ink: #EBD49C;
  --danger: #D98A8D; --danger-soft: rgba(217,138,141,.16); --danger-ink: #F0BDBF; --danger-btn: #C46E72;

  --module-fatura: #93A6C9;       --module-fatura-soft: rgba(147,166,201,.16);       --module-fatura-ink: #C3CFE4;
  --module-vip: #B79ABB;          --module-vip-soft: rgba(183,154,187,.16);          --module-vip-ink: #DACADC;
  --module-financeiro: #9DBBAB;   --module-financeiro-soft: rgba(157,187,171,.16);   --module-financeiro-ink: #C6DACE;
  --module-viagens: #CC9AA9;      --module-viagens-soft: rgba(204,154,169,.16);      --module-viagens-ink: #E8C8D1;
  --module-compromissos: #86A9B2; --module-compromissos-soft: rgba(134,169,178,.16); --module-compromissos-ink: #BFD3D8;
  --module-senhas: #A3A1BA;       --module-senhas-soft: rgba(163,161,186,.16);       --module-senhas-ink: #CFCEDD;

  --shadow-card: 0 1px 2px rgba(0,0,0,.3), 0 10px 24px -16px rgba(0,0,0,.5);
  --shadow-floating: 0 4px 14px -6px rgba(0,0,0,.6);
  --overlay: rgba(0,0,0,.6);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 20px;
  font-variant-numeric: tabular-nums;
  transition: background-color 180ms, color 180ms;
}

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

h1, h2, h3 { margin: 0; }

/* ---------- Foco: sempre :focus-visible, sempre shadow-focus (nunca o outline nativo) ---------- */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: none; box-shadow: var(--shadow-focus); }

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

/* ---------- Botões (Primary / Secondary / Ghost / Danger) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: 40px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background-color 150ms, border-color 150ms, box-shadow 150ms;
}
.btn svg { width: 16px; height: 16px; }
.btn-sm { height: 32px; padding: 0 var(--space-3); font-size: 12.5px; }
.btn-lg { height: 46px; padding: 0 var(--space-5); font-size: 15px; }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: color-mix(in srgb, var(--brand) 86%, #000); }
.btn-secondary { background: var(--surface); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--border-strong); }
.btn-ghost { background: transparent; color: var(--brand); }
.btn-ghost:hover { background: var(--brand-light); }
.btn-danger { background: var(--danger-btn); color: var(--on-brand); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger-btn) 86%, #000); }
.btn:disabled { opacity: 0.5; cursor: default; }
a.btn { text-decoration: none; }

/* ---------- Inputs ---------- */
.field { margin-bottom: var(--space-4); }
.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.input, input.input, select.input {
  width: 100%;
  height: 42px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0 var(--space-3);
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 150ms, box-shadow 150ms;
}
.input:focus-visible { border-color: var(--brand); box-shadow: var(--shadow-focus); }
.input::placeholder { color: var(--text-faint); }

/* ---------- Cards: sombra em repouso; card clicável sobe 1px no hover ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-card);
  transition: box-shadow 150ms, transform 150ms, border-color 150ms;
}
a.card, .card.is-link { text-decoration: none; color: inherit; }
a.card:hover, .card.is-link:hover { box-shadow: var(--shadow-floating); transform: translateY(-1px); }
a.card:focus-visible, .card.is-link:focus-visible { box-shadow: var(--shadow-focus), var(--shadow-card); }
.card-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
}

/* ---------- Badges: pílula, estáticos, cinco estados; texto no tom ink ---------- */
.badge { font-size: 11px; font-weight: 700; padding: var(--space-1) var(--space-2); border-radius: var(--radius-pill); display: inline-flex; align-items: center; gap: var(--space-1); white-space: nowrap; }
.badge-good { background: var(--good-soft); color: var(--good-ink); }
.badge-warn { background: var(--warn-soft); color: var(--warn-ink); }
.badge-danger { background: var(--danger-soft); color: var(--danger-ink); }
.badge-info { background: var(--module-fatura-soft); color: var(--module-fatura-ink); }
.badge-neutral { background: var(--surface-2); color: var(--text-faint); }

/* ---------- Avatar ---------- */
.avatar {
  border-radius: 50%;
  color: var(--on-brand);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.avatar-group { display: flex; }
.avatar-group .avatar { margin-left: -8px; border: 2px solid var(--surface); }
.avatar-group .avatar:first-child { margin-left: 0; }

/* ---------- Empty state ---------- */
.empty-state { padding: var(--space-6); text-align: center; color: var(--text-faint); font-size: 13px; }

/* ---------- Destaque da tela: um por tela. Fundo claro e borda lilás (2026-10-11: o lilás cheio ficou pesado) ---------- */
.destaque { --on-destaque: var(--text-primary); --destaque-tom2: var(--module-viagens); --destaque-tom3: var(--module-financeiro);
  position: relative; overflow: hidden; isolation: isolate; color: var(--text-primary); border-radius: var(--radius-lg);
  background: radial-gradient(90% 120% at 100% 0%, var(--brand-light) 0%, transparent 60%), var(--surface);
  border: 1.5px solid color-mix(in srgb, var(--brand) 55%, transparent); box-shadow: 0 16px 36px -28px rgba(70,55,130,.5); }
/* Dois anéis lilás bem leves no canto, de enfeite, atrás do conteúdo. */
.destaque::before { content: ''; position: absolute; z-index: -1; width: 340px; height: 340px; right: -110px; top: -150px; border-radius: 50%;
  border: 46px solid color-mix(in srgb, var(--brand) 7%, transparent); box-shadow: 0 0 0 38px color-mix(in srgb, var(--brand) 4%, transparent); pointer-events: none; }
.destaque-barra { display: flex; height: 10px; border-radius: var(--radius-pill); overflow: hidden; background: var(--surface-2); }
.tom-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.destaque-barra i { display: block; height: 100%; transition: width 700ms cubic-bezier(.2,.8,.2,1); }
.destaque-barra i + i { box-shadow: -2px 0 0 var(--surface); }
.destaque .row-sub, .destaque .hint, .destaque .card-label, .destaque .stat-sub { color: var(--text-secondary); }
.destaque a, .destaque .card-link { color: var(--brand); }
.destaque-tile { background: var(--brand-light); border-radius: var(--radius-md); padding: var(--space-2) var(--space-3); }
