@charset "UTF-8";
/* ==========================================================================
   WA EMPREENDIMENTO - Design System
   CSS puro, mobile-first, tema escuro por padrao com variante clara.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Marca - ouro: riqueza, empreendimento */
  --gold-200: #FFE7B3;
  --gold-300: #FFD98A;
  --gold-400: #F7C465;
  --gold-500: #F0A93B;
  --gold-600: #D4881A;
  --gold-700: #A66610;

  --violet: #7C5CFF;
  --violet-soft: rgba(124, 92, 255, .16);

  /* Semantica */
  --success: #12D18B;
  --success-soft: rgba(18, 209, 139, .14);
  --danger: #FF4D6D;
  --danger-soft: rgba(255, 77, 109, .14);
  --warning: #FFB020;
  --warning-soft: rgba(255, 176, 32, .14);
  --info: #38BDF8;
  --info-soft: rgba(56, 189, 248, .14);

  /* Superficies */
  --bg: #08090D;
  --bg-deep: #05060A;
  --surface: #12151D;
  --surface-2: #171B25;
  --surface-3: #1E2331;
  --border: rgba(255, 255, 255, .07);
  --border-strong: rgba(255, 255, 255, .13);
  --overlay: rgba(4, 5, 8, .72);

  /* Texto */
  --text: #ECEFF6;
  --text-2: #A8B0C2;
  --text-3: #6C7488;
  --text-on-gold: #1A1206;

  /* Tipografia */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-num: "SF Mono", "JetBrains Mono", ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;

  --fs-xs: .6875rem;
  --fs-sm: .8125rem;
  --fs-md: .9375rem;
  --fs-lg: 1.0625rem;
  --fs-xl: 1.375rem;
  --fs-2xl: 1.75rem;
  --fs-3xl: 2.25rem;

  /* Espacamento */
  --sp-1: .25rem;
  --sp-2: .5rem;
  --sp-3: .75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;

  /* Raios */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-full: 999px;

  /* Sombras */
  --sh-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --sh-md: 0 4px 16px rgba(0, 0, 0, .35);
  --sh-lg: 0 16px 44px rgba(0, 0, 0, .5);
  --sh-gold: 0 8px 28px rgba(240, 169, 59, .22);

  /* Movimento */
  --ease: cubic-bezier(.32, .72, 0, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --dur-fast: .16s;
  --dur: .28s;
  --dur-slow: .48s;

  /* Alturas de chrome */
  --topbar-h: 60px;
  --bottomnav-h: 68px;
  --sidebar-w: 264px;

  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #F4F5F8;
  --bg-deep: #EAECF1;
  --surface: #FFFFFF;
  --surface-2: #F7F8FB;
  --surface-3: #EFF1F6;
  --border: rgba(14, 18, 30, .09);
  --border-strong: rgba(14, 18, 30, .16);
  --overlay: rgba(20, 24, 34, .45);

  --text: #10131C;
  --text-2: #4C5468;
  --text-3: #7B8397;

  --gold-400: #D89320;
  --gold-500: #BE7A0C;

  --sh-sm: 0 1px 2px rgba(16, 19, 28, .06);
  --sh-md: 0 4px 16px rgba(16, 19, 28, .09);
  --sh-lg: 0 16px 44px rgba(16, 19, 28, .16);
  --sh-gold: 0 8px 28px rgba(190, 122, 12, .18);

  color-scheme: light;
}

/* Mapeamento dos tons usados pelos enums do dominio */
.tone-success { --tone: var(--success); --tone-soft: var(--success-soft); }
.tone-danger  { --tone: var(--danger);  --tone-soft: var(--danger-soft); }
.tone-warning { --tone: var(--warning); --tone-soft: var(--warning-soft); }
.tone-info    { --tone: var(--info);    --tone-soft: var(--info-soft); }
.tone-muted   { --tone: var(--text-3);  --tone-soft: rgba(120, 128, 148, .14); }
.tone-gold    { --tone: var(--gold-400);--tone-soft: rgba(247, 196, 101, .14); }

/* --------------------------------------------------------------------------
   2. Reset
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* Brilho ambiente atras de tudo - da profundidade sem custo de imagem */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(720px 380px at 12% -8%, rgba(240, 169, 59, .10), transparent 62%),
    radial-gradient(620px 340px at 92% 4%, rgba(124, 92, 255, .09), transparent 60%);
}

[data-theme="light"] body::before {
  background:
    radial-gradient(720px 380px at 12% -8%, rgba(240, 169, 59, .16), transparent 62%),
    radial-gradient(620px 340px at 92% 4%, rgba(124, 92, 255, .10), transparent 60%);
}

img, svg { display: block; max-width: 100%; }

/* Atributos de tracado dos icones ficam aqui, e nao repetidos em cada <svg>. */
.icon {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }
table { border-collapse: collapse; width: 100%; }

:focus-visible {
  outline: 2px solid var(--gold-400);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

::selection { background: rgba(240, 169, 59, .3); color: var(--text); }

/* Scrollbar discreta */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--r-full);
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-3); background-clip: content-box; }

/* --------------------------------------------------------------------------
   3. Tipografia
   -------------------------------------------------------------------------- */
h1, h2, h3, h4 { line-height: 1.2; font-weight: 650; letter-spacing: -.02em; }
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }

.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uppercase-label {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-3);
}

.money-positive { color: var(--success); }
.money-negative { color: var(--danger); }

/* --------------------------------------------------------------------------
   4. Shell da aplicacao
   -------------------------------------------------------------------------- */
.app {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.app-main {
  flex: 1;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: var(--sp-4) var(--sp-4) calc(var(--bottomnav-h) + var(--sp-8));
}

/* ---- Topbar ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0 var(--sp-4);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border);
}

.topbar__title {
  font-size: var(--fs-lg);
  font-weight: 650;
  letter-spacing: -.02em;
  flex: 1;
  min-width: 0;
}

.topbar__sub {
  display: block;
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: 0;
}

.topbar__actions { display: flex; align-items: center; gap: var(--sp-2); }

/* ---- Navegacao inferior (mobile) ---- */
.bottomnav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 45;
  height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border-top: 1px solid var(--border);
}

.bottomnav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 550;
  color: var(--text-3);
  position: relative;
  transition: color var(--dur-fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.bottomnav__item .icon { transition: transform var(--dur) var(--ease-spring); }

.bottomnav__item:active .icon { transform: scale(.86); }

.bottomnav__item[aria-current="page"] { color: var(--gold-400); }

.bottomnav__item[aria-current="page"] .icon {
  transform: translateY(-2px);
  filter: drop-shadow(0 4px 10px rgba(240, 169, 59, .45));
}

/* Indicador que desliza para o item ativo */
.bottomnav__item[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 0;
  width: 30px;
  height: 3px;
  border-radius: 0 0 var(--r-full) var(--r-full);
  background: linear-gradient(90deg, var(--gold-500), var(--gold-300));
  animation: navPop var(--dur) var(--ease-spring);
}

@keyframes navPop {
  from { width: 0; opacity: 0; }
  to { width: 30px; opacity: 1; }
}

/* Botao central de acao rapida */
.bottomnav__fab {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-top: -14px;
  border-radius: var(--r-full);
  background: linear-gradient(145deg, var(--gold-300), var(--gold-600));
  color: var(--text-on-gold);
  box-shadow: var(--sh-gold);
  transition: transform var(--dur) var(--ease-spring);
}

.bottomnav__fab:active { transform: scale(.9) rotate(90deg); }

/* ---- Sidebar (desktop) ---- */
.sidebar { display: none; }

/* --------------------------------------------------------------------------
   5. Logo
   -------------------------------------------------------------------------- */
.logo { display: inline-flex; align-items: center; gap: var(--sp-3); }

/* O tamanho vem do atributo width/height do proprio SVG, para que
   <x-logo :size="34" /> valha de verdade. */
.logo__mark {
  flex-shrink: 0;
  filter: drop-shadow(0 4px 14px rgba(240, 169, 59, .32));
}

.logo__text { display: flex; flex-direction: column; line-height: 1.05; }

.logo__name {
  font-size: var(--fs-md);
  font-weight: 750;
  letter-spacing: -.03em;
  background: linear-gradient(100deg, var(--gold-200), var(--gold-500) 62%, var(--gold-300));
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: goldFlow 7s linear infinite;
}

.logo__tag {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--text-3);
}

@keyframes goldFlow {
  to { background-position: 220% center; }
}

/* --------------------------------------------------------------------------
   6. Cards
   -------------------------------------------------------------------------- */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  box-shadow: var(--sh-sm);
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.card--glass {
  background: linear-gradient(160deg,
    color-mix(in srgb, var(--surface-2) 92%, transparent),
    color-mix(in srgb, var(--surface) 96%, transparent));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.card--interactive { cursor: pointer; }
.card--interactive:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--sh-md); }
.card--interactive:active { transform: translateY(0) scale(.995); }

.card__head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.card__title { font-size: var(--fs-md); font-weight: 620; flex: 1; min-width: 0; }
.card__body { display: flex; flex-direction: column; gap: var(--sp-3); }

/* Borda superior luminosa em cards de destaque */
.card--accent::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: linear-gradient(90deg, transparent, var(--tone, var(--gold-400)), transparent);
  opacity: .85;
}

/* Card hero do dashboard - moldura em gradiente animado */
.card--hero {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    linear-gradient(160deg, rgba(240, 169, 59, .10), transparent 46%),
    var(--surface);
  border-color: rgba(240, 169, 59, .22);
}

.card--hero::after {
  content: "";
  position: absolute;
  inset: -140%;
  background: conic-gradient(from 0deg, transparent 0 78%, rgba(240, 169, 59, .5) 88%, transparent 100%);
  animation: haloSpin 9s linear infinite;
  z-index: 0;
  opacity: .28;
}

.card--hero > * { position: relative; z-index: 1; }

@keyframes haloSpin { to { transform: rotate(1turn); } }

/* Trio de numeros do card principal - quebra sozinho em telas estreitas */
.hero-figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: var(--sp-3) var(--sp-4);
}

/* --------------------------------------------------------------------------
   7. Estatisticas
   -------------------------------------------------------------------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3);
}

.stat {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.stat:hover { transform: translateY(-2px); border-color: var(--border-strong); }

.stat::after {
  content: "";
  position: absolute;
  right: -28px;
  top: -28px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--tone-soft, var(--info-soft));
  filter: blur(6px);
  opacity: .75;
  transition: transform var(--dur-slow) var(--ease);
}

.stat:hover::after { transform: scale(1.25); }

.stat__top { display: flex; align-items: center; gap: var(--sp-2); position: relative; }

.stat__icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  background: var(--tone-soft, var(--info-soft));
  color: var(--tone, var(--info));
  flex-shrink: 0;
}

.stat__label {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-3);
  line-height: 1.3;
}

.stat__value {
  position: relative;
  font-family: var(--font-num);
  font-size: var(--fs-xl);
  font-weight: 680;
  letter-spacing: -.035em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.stat__value--gold {
  background: linear-gradient(96deg, var(--gold-200), var(--gold-500));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat__foot {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--fs-xs);
  color: var(--text-3);
}

.stat--wide { grid-column: 1 / -1; }

/* Variacao percentual */
.delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: var(--r-full);
  font-size: var(--fs-xs);
  font-weight: 650;
  font-family: var(--font-num);
}

.delta--up { background: var(--success-soft); color: var(--success); }
.delta--down { background: var(--danger-soft); color: var(--danger); }
.delta--flat { background: rgba(120, 128, 148, .14); color: var(--text-3); }

/* --------------------------------------------------------------------------
   8. Badges e chips
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--r-full);
  font-size: var(--fs-xs);
  font-weight: 620;
  line-height: 1.5;
  background: var(--tone-soft, rgba(120, 128, 148, .14));
  color: var(--tone, var(--text-2));
  white-space: nowrap;
}

.badge--outline {
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--tone, var(--text-3)) 40%, transparent);
}

/* Pisca em cobrancas vencidas para puxar o olho */
.badge--pulse { animation: badgePulse 2.4s var(--ease) infinite; }

@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--tone) 40%, transparent); }
  50% { box-shadow: 0 0 0 6px transparent; }
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: var(--fs-sm);
  font-weight: 550;
  color: var(--text-2);
  white-space: nowrap;
  transition: all var(--dur-fast) var(--ease);
}

.chip:hover { border-color: var(--border-strong); color: var(--text); }

.chip[aria-pressed="true"], .chip--active {
  background: linear-gradient(140deg, var(--gold-400), var(--gold-600));
  border-color: transparent;
  color: var(--text-on-gold);
  box-shadow: var(--sh-gold);
}

.chip__count {
  padding: 0 6px;
  border-radius: var(--r-full);
  background: rgba(0, 0, 0, .22);
  font-family: var(--font-num);
  font-size: var(--fs-xs);
}

/* Barra de filtros com rolagem horizontal no celular */
.filter-bar {
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  padding-bottom: var(--sp-1);
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x proximity;
}

.filter-bar::-webkit-scrollbar { display: none; }
.filter-bar > * { scroll-snap-align: start; flex-shrink: 0; }

/* --------------------------------------------------------------------------
   9. Botoes
   -------------------------------------------------------------------------- */
.btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  min-height: 44px;
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  font-weight: 620;
  letter-spacing: -.01em;
  white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; pointer-events: none; }

.btn--primary {
  background: linear-gradient(140deg, var(--gold-300), var(--gold-600));
  color: var(--text-on-gold);
  box-shadow: var(--sh-gold);
}

.btn--primary:hover { filter: brightness(1.06); }

.btn--ghost {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
}

.btn--ghost:hover { border-color: var(--border-strong); background: var(--surface-3); }

.btn--quiet { color: var(--text-2); padding-inline: var(--sp-2); }
.btn--quiet:hover { color: var(--text); }

.btn--danger { background: var(--danger-soft); color: var(--danger); border: 1px solid transparent; }
.btn--danger:hover { border-color: color-mix(in srgb, var(--danger) 40%, transparent); }

.btn--success { background: var(--success-soft); color: var(--success); border: 1px solid transparent; }
.btn--success:hover { border-color: color-mix(in srgb, var(--success) 40%, transparent); }

.btn--block { width: 100%; }
.btn--sm { min-height: 34px; padding: var(--sp-2) var(--sp-3); font-size: var(--fs-xs); }

.btn--icon {
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: var(--r-md);
  color: var(--text-2);
}

.btn--icon:hover { background: var(--surface-2); color: var(--text); }

/* Ondulacao ao toque - feedback tatil em tela pequena */
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--rx, 50%) var(--ry, 50%), rgba(255, 255, 255, .35), transparent 42%);
  opacity: 0;
  transition: opacity .5s var(--ease);
}

.btn:active::after { opacity: 1; transition: none; }

/* Botao flutuante */
.fab {
  position: fixed;
  right: var(--sp-4);
  bottom: calc(var(--bottomnav-h) + var(--sp-4) + env(safe-area-inset-bottom));
  z-index: 44;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: var(--r-full);
  background: linear-gradient(145deg, var(--gold-300), var(--gold-600));
  color: var(--text-on-gold);
  box-shadow: var(--sh-gold), var(--sh-md);
  animation: fabIn var(--dur-slow) var(--ease-spring) backwards .3s;
  transition: transform var(--dur) var(--ease-spring);
}

.fab:active { transform: scale(.88); }

@keyframes fabIn {
  from { transform: scale(0) rotate(-90deg); opacity: 0; }
  to { transform: scale(1) rotate(0); opacity: 1; }
}

/* --------------------------------------------------------------------------
   10. Formularios
   -------------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: var(--sp-2); }

.field__label {
  font-size: var(--fs-xs);
  font-weight: 620;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-3);
}

.field__hint { font-size: var(--fs-xs); color: var(--text-3); }
.field__error { font-size: var(--fs-xs); color: var(--danger); font-weight: 550; }

.input, .select, .textarea {
  width: 100%;
  min-height: 46px;
  padding: var(--sp-3);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: var(--fs-md);
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
}

.input::placeholder, .textarea::placeholder { color: var(--text-3); }

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--gold-500);
  background: var(--surface-3);
  box-shadow: 0 0 0 3px rgba(240, 169, 59, .15);
}

.input[aria-invalid="true"] { border-color: var(--danger); }

.textarea { min-height: 96px; resize: vertical; line-height: 1.6; }

.select {
  appearance: none;
  padding-right: var(--sp-8);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236C7488' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--sp-3) center;
}

/* Campo monetario com prefixo */
.input-money { position: relative; display: flex; align-items: center; }

.input-money__prefix {
  position: absolute;
  left: var(--sp-3);
  font-size: var(--fs-sm);
  font-weight: 620;
  color: var(--text-3);
  pointer-events: none;
}

.input-money .input {
  padding-left: 2.6rem;
  font-family: var(--font-num);
  font-size: var(--fs-lg);
  font-weight: 620;
}

/* Busca */
.search { position: relative; display: flex; align-items: center; }

.search .icon {
  position: absolute;
  left: var(--sp-3);
  color: var(--text-3);
  pointer-events: none;
}

.search .input { padding-left: 2.75rem; }

/* Segmentado */
.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 3px;
  padding: 3px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.segmented__option {
  padding: var(--sp-2) var(--sp-3);
  border-radius: calc(var(--r-md) - 4px);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-3);
  text-align: center;
  transition: all var(--dur-fast) var(--ease);
}

.segmented__option[aria-pressed="true"] {
  background: var(--surface-3);
  color: var(--text);
  box-shadow: var(--sh-sm);
}

/* Escolha em cartao (modalidade do emprestimo) */
.choice {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
}

.choice:hover { border-color: var(--border-strong); }

.choice[aria-pressed="true"] {
  border-color: var(--gold-500);
  background: rgba(240, 169, 59, .08);
  box-shadow: 0 0 0 3px rgba(240, 169, 59, .12);
}

.choice__icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  background: var(--surface-3);
  color: var(--gold-400);
  flex-shrink: 0;
}

.choice__title { font-size: var(--fs-sm); font-weight: 620; }
.choice__desc { font-size: var(--fs-xs); color: var(--text-3); line-height: 1.45; }

.form-grid { display: grid; gap: var(--sp-4); }
.form-row { display: grid; gap: var(--sp-4); }

/* --------------------------------------------------------------------------
   11. Listas
   -------------------------------------------------------------------------- */
.list { display: flex; flex-direction: column; gap: var(--sp-2); }

/*
  Listas longas em tela larga: uma coluna unica de 1440px deixa a linha com
  metros de vazio no meio. A partir de 1280px a lista quebra em duas colunas.
*/
.list-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-2);
  align-items: start;
}

.list-grid > * { margin-bottom: 0 !important; }

@media (min-width: 1280px) {
  .list-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .list-grid > .empty { grid-column: 1 / -1; }
}

.list-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease);
}

.list-item:hover { border-color: var(--border-strong); background: var(--surface-2); }
.list-item:active { transform: scale(.99); }

.list-item__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.list-item__title { font-size: var(--fs-md); font-weight: 600; }
.list-item__meta { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-xs); color: var(--text-3); }
.list-item__side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; }

.list-item__amount {
  font-family: var(--font-num);
  font-size: var(--fs-md);
  font-weight: 650;
  letter-spacing: -.03em;
}

/* Faixa lateral colorida indicando o status */
.list-item--tone {
  border-left: 3px solid var(--tone, var(--border));
  padding-left: calc(var(--sp-3) - 2px);
}

.avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-full);
  background: linear-gradient(140deg, var(--surface-3), var(--surface-2));
  border: 1px solid var(--border);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: -.03em;
  color: var(--gold-400);
  flex-shrink: 0;
}

.avatar--sm { width: 32px; height: 32px; font-size: var(--fs-xs); }
.avatar--lg { width: 60px; height: 60px; font-size: var(--fs-lg); }

.avatar--tone { color: var(--tone); border-color: color-mix(in srgb, var(--tone) 32%, transparent); }

/* --------------------------------------------------------------------------
   12. Tabelas (desktop)
   -------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); border: 1px solid var(--border); }

.table { font-size: var(--fs-sm); min-width: 640px; }

.table th {
  padding: var(--sp-3);
  text-align: left;
  font-size: var(--fs-xs);
  font-weight: 620;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-3);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td { padding: var(--sp-3); border-bottom: 1px solid var(--border); }
.table tbody tr { transition: background var(--dur-fast) var(--ease); }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }

.table tfoot td {
  background: var(--surface-2);
  border-top: 2px solid var(--border-strong);
  border-bottom: 0;
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   Seletor de relatorio
   -------------------------------------------------------------------------- */
.report-picker {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-2);
}

@media (min-width: 640px) {
  .report-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1100px) {
  .report-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.report-card {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all var(--dur-fast) var(--ease);
}

.report-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }

.report-card--active {
  border-color: var(--tone, var(--gold-400));
  background: linear-gradient(140deg, var(--tone-soft, rgba(247, 196, 101, .14)), transparent 70%);
}

.report-card__title { display: block; font-size: var(--fs-sm); font-weight: 620; }

.report-card__desc {
  display: block;
  font-size: var(--fs-xs);
  color: var(--text-3);
  line-height: 1.45;
}

/* Linhas do relatorio entram em cascata quando os dados chegam */
.report-row {
  animation: reportRow .34s var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 22ms);
}

@keyframes reportRow {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.report-skeleton { animation: fadeIn .18s var(--ease); }

/* --------------------------------------------------------------------------
   13. Progresso
   -------------------------------------------------------------------------- */
.progress {
  height: 6px;
  border-radius: var(--r-full);
  background: var(--surface-3);
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  border-radius: var(--r-full);
  background: linear-gradient(90deg, var(--tone, var(--gold-500)), color-mix(in srgb, var(--tone, var(--gold-300)) 70%, white));
  width: var(--value, 0%);
  animation: growBar 1s var(--ease-out) backwards;
}

@keyframes growBar { from { width: 0; } }

/* Anel de progresso para taxa de inadimplencia */
.ring { position: relative; width: 92px; height: 92px; flex-shrink: 0; }
.ring svg { transform: rotate(-90deg); }
.ring__track { fill: none; stroke: var(--surface-3); stroke-width: 8; }

.ring__value {
  fill: none;
  stroke: var(--tone, var(--gold-400));
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: var(--circumference, 251);
  stroke-dashoffset: var(--offset, 251);
  animation: ringDraw 1.2s var(--ease-out) backwards .2s;
}

@keyframes ringDraw { from { stroke-dashoffset: var(--circumference, 251); } }

.ring__label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
}

.ring__number {
  font-family: var(--font-num);
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: -.04em;
}

/* --------------------------------------------------------------------------
   14. Graficos (SVG puro)
   -------------------------------------------------------------------------- */
.chart { width: 100%; }

.chart__area { fill: url(#waAreaGradient); opacity: 0; animation: fadeIn .8s var(--ease-out) forwards .35s; }

.chart__line {
  fill: none;
  stroke: var(--gold-400);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: var(--len, 1200);
  stroke-dashoffset: var(--len, 1200);
  animation: drawLine 1.4s var(--ease-out) forwards;
}

@keyframes drawLine { to { stroke-dashoffset: 0; } }

.chart__dot {
  fill: var(--bg);
  stroke: var(--gold-400);
  stroke-width: 2.5;
  opacity: 0;
  animation: dotIn .4s var(--ease-spring) forwards;
}

@keyframes dotIn { to { opacity: 1; } }

.chart__grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 5; }
.chart__label { fill: var(--text-3); font-size: 10px; font-family: var(--font-num); }

/* Barras */
.bars { display: flex; align-items: flex-end; gap: var(--sp-2); height: 132px; }

.bars__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); height: 100%; }

.bars__stack {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
}

.bars__bar {
  width: 100%;
  max-width: 14px;
  border-radius: var(--r-sm) var(--r-sm) 2px 2px;
  background: var(--tone, var(--gold-500));
  height: var(--h, 4px);
  min-height: 4px;
  transform-origin: bottom;
  animation: barGrow .7s var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 55ms);
  transition: filter var(--dur-fast) var(--ease);
}

.bars__bar:hover { filter: brightness(1.25); }

@keyframes barGrow { from { transform: scaleY(0); } }

.bars__label { font-size: 10px; color: var(--text-3); font-family: var(--font-num); }

/* --------------------------------------------------------------------------
   Grade do painel

   Uma coluna no celular; 12 colunas no desktop, onde cada bloco declara a
   largura que faz sentido para o conteudo dele. Evita o efeito de "card
   gigante com um numero no meio" em tela larga.
   -------------------------------------------------------------------------- */
.dash {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-4);
  align-items: start;
}

.dash > * { min-width: 0; }

/* Grade de graficos: uma coluna no celular, duas no desktop */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-4);
  margin-top: var(--sp-4);
}

@media (min-width: 900px) {
  .chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .dash { grid-template-columns: repeat(12, minmax(0, 1fr)); }

  .col-3  { grid-column: span 3; }
  .col-4  { grid-column: span 4; }
  .col-5  { grid-column: span 5; }
  .col-6  { grid-column: span 6; }
  .col-7  { grid-column: span 7; }
  .col-8  { grid-column: span 8; }
  .col-9  { grid-column: span 9; }
  .col-12 { grid-column: 1 / -1; }

  /* Cards de conteudo comparavel ficam com a mesma altura na linha. */
  .dash--stretch { align-items: stretch; }
  .dash--stretch > * { height: 100%; }
}

@media (min-width: 1280px) {
  .col-xl-3 { grid-column: span 3; }
  .col-xl-4 { grid-column: span 4; }
  .col-xl-6 { grid-column: span 6; }
  .col-xl-8 { grid-column: span 8; }
}

/* Ajustes do ApexCharts para casar com o design system */
.apexcharts-canvas { background: transparent !important; }
.apexcharts-tooltip {
  background: var(--surface-2) !important;
  border: 1px solid var(--border-strong) !important;
  box-shadow: var(--sh-lg) !important;
  color: var(--text) !important;
  border-radius: var(--r-md) !important;
}
.apexcharts-tooltip-title {
  background: var(--surface-3) !important;
  border-bottom: 1px solid var(--border) !important;
  font-weight: 650 !important;
}
.apexcharts-legend-text { color: var(--text-2) !important; }
.apexcharts-datalabel-value { fill: var(--text) !important; }
.apexcharts-datalabel-label { fill: var(--text-3) !important; }
.apexcharts-text tspan { fill: var(--text-3); }

/* Legenda */
.legend { display: flex; flex-wrap: wrap; gap: var(--sp-3); font-size: var(--fs-xs); color: var(--text-2); }
.legend__item { display: inline-flex; align-items: center; gap: 6px; }
.legend__swatch { width: 10px; height: 10px; border-radius: 3px; background: var(--tone, var(--gold-500)); }

/* --------------------------------------------------------------------------
   15. Modal / bottom sheet
   -------------------------------------------------------------------------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--overlay);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn var(--dur) var(--ease) backwards;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 61;
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--sh-lg);
  animation: sheetUp var(--dur-slow) var(--ease-out) backwards;
  padding-bottom: env(safe-area-inset-bottom);
}

@keyframes sheetUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.sheet__grip {
  width: 38px;
  height: 4px;
  margin: var(--sp-3) auto var(--sp-1);
  border-radius: var(--r-full);
  background: var(--border-strong);
  flex-shrink: 0;
}

.sheet__head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sheet__title { font-size: var(--fs-lg); font-weight: 650; flex: 1; }
.sheet__body { padding: var(--sp-4); overflow-y: auto; flex: 1; }

.sheet__foot {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.sheet__foot .btn { flex: 1; }

/* --------------------------------------------------------------------------
   16. Toasts
   -------------------------------------------------------------------------- */
.toast-stack {
  position: fixed;
  top: calc(var(--topbar-h) + var(--sp-2));
  left: var(--sp-3);
  right: var(--sp-3);
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  pointer-events: none;
}

.toast {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid var(--border-strong);
  background: color-mix(in srgb, var(--surface-2) 96%, transparent);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  box-shadow: var(--sh-lg);
  pointer-events: auto;
}

.toast__icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  background: var(--tone-soft);
  color: var(--tone);
  flex-shrink: 0;
}

.toast__content { flex: 1; min-width: 0; }
.toast__title { font-size: var(--fs-sm); font-weight: 650; }
.toast__message { font-size: var(--fs-xs); color: var(--text-2); line-height: 1.5; }

/* Barra que consome o tempo restante do toast */
.toast__timer {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  background: var(--tone);
  animation: toastTimer var(--toast-duration, 4.5s) linear forwards;
}

@keyframes toastTimer { from { width: 100%; } to { width: 0; } }

/* --------------------------------------------------------------------------
   17. Estados
   -------------------------------------------------------------------------- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-10) var(--sp-4);
  text-align: center;
}

.empty__icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: var(--r-full);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-3);
  animation: floaty 4s var(--ease) infinite;
}

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

.empty__title { font-size: var(--fs-md); font-weight: 620; }
.empty__text { font-size: var(--fs-sm); color: var(--text-3); max-width: 34ch; }

.skeleton {
  border-radius: var(--r-sm);
  background: linear-gradient(100deg, var(--surface-2) 30%, var(--surface-3) 50%, var(--surface-2) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.4s linear infinite;
}

@keyframes shimmer { to { background-position: -220% 0; } }

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, currentColor 25%, transparent);
  border-top-color: currentColor;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(1turn); } }

/* --------------------------------------------------------------------------
   18. Entrada em cascata
   -------------------------------------------------------------------------- */
.reveal {
  animation: revealUp var(--dur-slow) var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 55ms);
}

@keyframes revealUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.reveal-scale {
  animation: revealScale var(--dur-slow) var(--ease-spring) backwards;
  animation-delay: calc(var(--i, 0) * 45ms);
}

@keyframes revealScale {
  from { opacity: 0; transform: scale(.94); }
  to { opacity: 1; transform: scale(1); }
}

/* Transicao de pagina */
.page { animation: pageIn var(--dur-slow) var(--ease-out); }

@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Cabecalho de secao */
.section {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin: var(--sp-6) 0 var(--sp-3);
}

.section:first-child { margin-top: 0; }
.section__title { font-size: var(--fs-md); font-weight: 650; flex: 1; letter-spacing: -.01em; }

.section__link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--gold-400);
  transition: gap var(--dur-fast) var(--ease);
}

.section__link:hover { gap: 7px; }

.divider { height: 1px; background: var(--border); border: 0; margin: var(--sp-4) 0; }

/* --------------------------------------------------------------------------
   Paginacao
   -------------------------------------------------------------------------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  padding: var(--sp-4) 0 var(--sp-2);
}

.pager__btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: all var(--dur-fast) var(--ease);
}

.pager__btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.pager__btn:active { transform: scale(.94); }
.pager__btn[aria-disabled="true"] { opacity: .32; pointer-events: none; }

.pager__status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-sm);
  color: var(--text-3);
}

.pager__status strong { color: var(--text); font-weight: 650; }

/* --------------------------------------------------------------------------
   18b. Tela de entrada

   Celular: so o formulario, com a marca no topo.
   Desktop: painel ilustrado a esquerda e formulario a direita.
   -------------------------------------------------------------------------- */
.login {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr;
}

.login__aside { display: none; }

.login__panel {
  display: grid;
  place-items: center;
  padding: var(--sp-6) var(--sp-5);
}

.login__card {
  width: 100%;
  max-width: 400px;
  animation: revealScale .6s var(--ease-spring);
}

.login__brand {
  display: grid;
  place-items: center;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
  text-align: center;
}

.login__hint {
  margin-top: var(--sp-5);
  padding: var(--sp-3);
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  font-size: var(--fs-xs);
  color: var(--text-3);
  text-align: center;
  line-height: 1.7;
}

.login__hint code { color: var(--gold-400); font-family: var(--font-num); }

.login__reveal { position: relative; }

.login__toggle {
  position: absolute;
  right: 3px;
  top: 3px;
}

@media (min-width: 900px) {
  .login { grid-template-columns: 1.05fr .95fr; }

  .login__aside {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: var(--sp-10) var(--sp-8);
    background:
      radial-gradient(900px 520px at 18% 12%, rgba(240, 169, 59, .18), transparent 60%),
      radial-gradient(760px 480px at 88% 88%, rgba(124, 92, 255, .16), transparent 62%),
      linear-gradient(155deg, #0B0D13, #05060A 62%);
    border-right: 1px solid rgba(240, 169, 59, .16);
  }

  /* Malha de pontos discreta ao fundo */
  .login__aside::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px);
    background-size: 26px 26px;
    mask-image: radial-gradient(70% 60% at 50% 45%, #000 30%, transparent 100%);
    -webkit-mask-image: radial-gradient(70% 60% at 50% 45%, #000 30%, transparent 100%);
  }

  .login__aside > * { position: relative; z-index: 1; }

  .login__panel { padding: var(--sp-10); }

  .login__card { max-width: 380px; }

  .login__brand { display: none; }

  .login__mobile-brand { display: none; }
}

.login__headline {
  font-size: clamp(1.6rem, 2.4vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1.18;
  max-width: 15ch;
  margin-top: var(--sp-8);
}

.login__headline em {
  font-style: normal;
  background: linear-gradient(100deg, var(--gold-200), var(--gold-500));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.login__lede {
  margin-top: var(--sp-3);
  max-width: 38ch;
  font-size: var(--fs-md);
  color: var(--text-2);
  line-height: 1.65;
}

.login__points {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-top: var(--sp-6);
}

.login__point {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--fs-sm);
  color: var(--text-2);
  animation: revealUp .6s var(--ease-out) backwards;
  animation-delay: calc(.3s + var(--i, 0) * 110ms);
}

.login__point span.dot {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  background: rgba(240, 169, 59, .13);
  color: var(--gold-400);
  flex-shrink: 0;
}

/* ---- Ilustração ---- */
.login__art {
  width: 100%;
  max-width: 460px;
  margin: var(--sp-6) auto;
}

.art-bar {
  transform-origin: bottom;
  animation: artBar 1.1s var(--ease-out) backwards;
  animation-delay: calc(.25s + var(--i, 0) * 120ms);
}

@keyframes artBar {
  from { transform: scaleY(0); opacity: 0; }
  to { transform: scaleY(1); opacity: 1; }
}

.art-line {
  stroke-dasharray: 620;
  stroke-dashoffset: 620;
  animation: drawLine 1.8s var(--ease-out) forwards .7s;
}

.art-dot {
  opacity: 0;
  animation: artDot .5s var(--ease-spring) forwards 2.1s;
}

@keyframes artDot {
  to { opacity: 1; }
}

.art-float {
  animation: artFloat 6s var(--ease) infinite;
  transform-origin: center;
}

.art-float--slow { animation-duration: 8.5s; animation-delay: -2s; }

@keyframes artFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.login__foot {
  font-size: var(--fs-xs);
  color: var(--text-3);
  letter-spacing: .04em;
}

/* --------------------------------------------------------------------------
   19. Utilitarios
   -------------------------------------------------------------------------- */
.stack { display: flex; flex-direction: column; gap: var(--sp-4); }
.stack-sm { display: flex; flex-direction: column; gap: var(--sp-2); }
.row { display: flex; align-items: center; gap: var(--sp-3); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.center { display: grid; place-items: center; }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.mt-auto { margin-top: auto; }
.text-right { text-align: right; }
.gap-2 { gap: var(--sp-2); }
.full { width: 100%; }

[x-cloak] { display: none !important; }

/* --------------------------------------------------------------------------
   20. Responsivo
   -------------------------------------------------------------------------- */
@media (min-width: 560px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-row--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toast-stack { left: auto; right: var(--sp-4); width: 380px; }
}

@media (min-width: 900px) {
  .app { flex-direction: row; }

  .app-main {
    padding: var(--sp-6);
    padding-bottom: var(--sp-10);
  }

  .bottomnav { display: none; }
  .fab { display: none; }

  .topbar {
    padding: 0 var(--sp-6);
    --topbar-h: 68px;
  }

  /* Sidebar fixa no desktop */
  .sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
    position: sticky;
    top: 0;
    height: 100dvh;
    width: var(--sidebar-w);
    flex-shrink: 0;
    padding: var(--sp-5) var(--sp-3);
    background: color-mix(in srgb, var(--surface) 62%, transparent);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-right: 1px solid var(--border);
    overflow-y: auto;
  }

  .sidebar__brand { padding: var(--sp-2) var(--sp-3) var(--sp-5); }

  .sidebar__group { margin-top: var(--sp-5); }

  .sidebar__item {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3);
    border-radius: var(--r-md);
    font-size: var(--fs-sm);
    font-weight: 560;
    color: var(--text-2);
    position: relative;
    transition: all var(--dur-fast) var(--ease);
  }

  .sidebar__item:hover { background: var(--surface-2); color: var(--text); }

  .sidebar__item[aria-current="page"] {
    background: linear-gradient(96deg, rgba(240, 169, 59, .16), transparent 78%);
    color: var(--gold-300);
    font-weight: 620;
  }

  .sidebar__item[aria-current="page"]::before {
    content: "";
    position: absolute;
    left: 0;
    top: 22%;
    bottom: 22%;
    width: 3px;
    border-radius: var(--r-full);
    background: linear-gradient(180deg, var(--gold-300), var(--gold-600));
    animation: railIn var(--dur) var(--ease-spring);
  }

  @keyframes railIn { from { transform: scaleY(0); } }

  .sidebar__badge {
    margin-left: auto;
    padding: 1px 7px;
    border-radius: var(--r-full);
    background: var(--danger-soft);
    color: var(--danger);
    font-size: var(--fs-xs);
    font-weight: 700;
    font-family: var(--font-num);
  }

  .app-shell { flex: 1; min-width: 0; display: flex; flex-direction: column; }

  .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stat--wide { grid-column: span 2; }

  /* Dentro de uma coluna do painel os indicadores viram 2x2, e nao 4 colunas
     espremidas ao lado do card principal. */
  .col-7 .stat-grid,
  .col-6 .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .dash-split { display: grid; grid-template-columns: 1.6fr 1fr; gap: var(--sp-4); align-items: start; }
  .form-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  .sheet {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    width: min(560px, calc(100vw - 4rem));
    transform: translate(-50%, -50%);
    border-radius: var(--r-xl);
    border-bottom: 1px solid var(--border);
    animation: dialogIn var(--dur) var(--ease-spring) backwards;
  }

  @keyframes dialogIn {
    from { opacity: 0; transform: translate(-50%, -46%) scale(.96); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  }

  .sheet__grip { display: none; }

  /* revert e nao initial: em <div>, initial computa para inline. */
  .desktop-only { display: revert; }
  .mobile-only { display: none !important; }
}

@media (max-width: 899px) {
  .desktop-only { display: none !important; }
}

@media (min-width: 1200px) {
  .stat-grid--6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* --------------------------------------------------------------------------
   21. Impressao e acessibilidade
   -------------------------------------------------------------------------- */
@media print {
  .topbar, .bottomnav, .sidebar, .fab, .toast-stack, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .stat { border: 1px solid #ddd; box-shadow: none; }
}

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