/* =========================================================================
   Banco do Murilo · estilo Windows XP, modernizado
   Papel de parede de céu e colina; o app é uma janela com barra de título
   azul brilhante, painel de tarefas à esquerda e barra de tarefas embaixo.
   No escuro, a mesma janela em grafite. Confortável: cores suaves, letras
   em tamanho de leitura e muito espaço.
   ========================================================================= */

/* ============ Tokens ============ */
:root {
  /* Papel de parede */
  --sky-1: #b6d6f7;
  --sky-2: #e5f1fc;

  /* Janela e painéis */
  --win: #f6f8fd;
  --panel: #ffffff;
  --panel-2: #f0f4fc;
  --panel-edge: #b9cbec;
  --edge: #7f9bd8;
  --rule: #dfe6f4;
  --ink: #1d2a44;
  --muted: #55617b;
  --faint: #8790a6;
  --head-ink: #1f4fb5;
  --link: #1c4ab0;

  /* Cromo do XP */
  --title-bar: linear-gradient(180deg, #5d9cf5 0%, #2f74e3 14%, #2463d6 50%, #1f58c8 86%, #1a4cb4 100%);
  --pane-head: linear-gradient(90deg, #2c64d4 0%, #4d8cf0 100%);
  --taskbar: linear-gradient(180deg, #4a8cf4 0%, #2a67dc 7%, #2459d2 50%, #2152c6 90%, #1c47ae 100%);
  --start: linear-gradient(180deg, #74d26d 0%, #45b141 40%, #2f962d 60%, #2b8d29 100%);
  --start-edge: #1f6b1d;
  --btn: linear-gradient(180deg, #ffffff 0%, #f5f4ef 50%, #e7e5dc 100%);
  --btn-edge: #3a5a99;
  --btn-press: linear-gradient(180deg, #e4e2d8 0%, #f1f0ea 100%);
  --hover-glow: #f5b742;
  --select: #316ac5;
  --tray: linear-gradient(180deg, #2a9ff2 0%, #1388e2 50%, #0f78cf 100%);
  --balloon: #ffffe1;
  --balloon-edge: #6f6b58;

  --accent: #2f9e35;
  --accent-ink: #ffffff;
  --accent-soft: #e4f4e3;
  --action: #f5c63c;
  --pos: #237f2b;
  --neg: #cf3a2b;
  --warn: #e3a20f;
  --warn-ink: #875800;
  --flame: #ef7d1a;
  --toast-link: #1c4ab0;

  /* Nomes que o app usa em estilos inline */
  --surface: var(--panel);
  --surface-2: var(--panel-2);
  --line: var(--rule);
  --leaf: var(--panel);
  --leaf-2: var(--panel-2);
  --sheet: var(--panel);
  --on: var(--ink);
  --on-2: var(--muted);

  --title: 'Trebuchet MS', 'Fira Sans', 'Segoe UI', sans-serif;
  --body: Tahoma, Verdana, 'Segoe UI', 'Fira Sans', sans-serif;
  --mono: 'Lucida Console', Consolas, 'Courier New', monospace;
  --display: var(--title);
  --sans: var(--body);
  --serif: var(--body);

  --r: 8px;
  --r-sm: 5px;
  --lift: 0 1px 2px rgba(20, 45, 100, .08), 0 8px 20px -14px rgba(20, 45, 100, .45);
  --board: #245edb;
  color-scheme: light;
}

[data-theme="dark"] {
  --sky-1: #0b1631;
  --sky-2: #172d52;
  --win: #161a21;
  --panel: #1e232c;
  --panel-2: #262c37;
  --panel-edge: #343c4b;
  --edge: #4c5669;
  --rule: #2c3340;
  --ink: #e8ecf5;
  --muted: #a6b0c5;
  --faint: #7c869c;
  --head-ink: #9cc2ff;
  --link: #8cb8ff;
  --title-bar: linear-gradient(180deg, #697284 0%, #474e5d 14%, #363c49 50%, #2c313c 86%, #23272f 100%);
  --pane-head: linear-gradient(90deg, #2c3a55 0%, #3f5478 100%);
  --taskbar: linear-gradient(180deg, #5a6272 0%, #3a404c 7%, #2e333d 50%, #272b33 90%, #1e2128 100%);
  --btn: linear-gradient(180deg, #3e4552 0%, #333945 50%, #2b303a 100%);
  --btn-edge: #5b6578;
  --btn-press: linear-gradient(180deg, #262b33 0%, #2f3540 100%);
  --hover-glow: #d99a2b;
  --select: #3d6fc2;
  --tray: linear-gradient(180deg, #40495a 0%, #323946 50%, #2a303b 100%);
  --balloon: #2a2f38;
  --balloon-edge: #5a6274;
  --accent: #5cc464;
  --accent-ink: #0d1a0e;
  --accent-soft: #1d2f20;
  --pos: #6fd277;
  --neg: #ff7a68;
  --warn: #f0b429;
  --warn-ink: #f0b429;
  --flame: #f59a4a;
  --toast-link: #8cb8ff;
  --lift: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 22px -14px rgba(0, 0, 0, .8);
  --board: #2c313c;
  color-scheme: dark;
}

/* ============ Base ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; scrollbar-color: var(--edge) transparent; }
body {
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
  caret-color: var(--select);
  /* Papel de parede: céu com nuvens e duas colinas verdes */
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 400' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='a' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%2392d66b'/%3E%3Cstop offset='1' stop-color='%234fa83a'/%3E%3C/linearGradient%3E%3ClinearGradient id='b' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23a7e07f'/%3E%3Cstop offset='1' stop-color='%235cb543'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M0 210 C 260 110 560 120 820 175 C 1060 225 1260 200 1440 150 L1440 400 L0 400 Z' fill='url(%23b)'/%3E%3Cpath d='M0 300 C 300 200 640 190 940 250 C 1150 292 1320 290 1440 270 L1440 400 L0 400 Z' fill='url(%23a)'/%3E%3C/svg%3E") bottom center / 100% 34vh no-repeat fixed,
    radial-gradient(ellipse 22% 6% at 18% 14%, rgba(255, 255, 255, .85), transparent 70%) fixed,
    radial-gradient(ellipse 16% 5% at 72% 22%, rgba(255, 255, 255, .7), transparent 70%) fixed,
    linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 66%) fixed;
}
[data-theme="dark"] body {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 400' preserveAspectRatio='none'%3E%3Cpath d='M0 210 C 260 110 560 120 820 175 C 1060 225 1260 200 1440 150 L1440 400 L0 400 Z' fill='%231d3524'/%3E%3Cpath d='M0 300 C 300 200 640 190 940 250 C 1150 292 1320 290 1440 270 L1440 400 L0 400 Z' fill='%23142a1a'/%3E%3C/svg%3E") bottom center / 100% 34vh no-repeat fixed,
    radial-gradient(ellipse 1px 1px at 20% 18%, #fff, transparent) fixed,
    radial-gradient(ellipse 1px 1px at 64% 12%, #fff, transparent) fixed,
    radial-gradient(ellipse 1.5px 1.5px at 82% 30%, #fff, transparent) fixed,
    linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 70%) fixed;
}
::selection { background: var(--select); color: #fff; }
body.no-scroll { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
svg { flex: none; }
ul { list-style: none; }
b, strong { font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.pos-t { color: var(--pos); }
.neg-t { color: var(--neg); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
/* O pontilhado de foco do XP, um pouco mais visível */
:focus-visible { outline: 2px dotted var(--ink); outline-offset: 2px; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: linear-gradient(90deg, #c5d6f7, #a9c1ef); border: 1px solid #8ea8e0; border-radius: 6px; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #3a4252; border-color: #4c5669; }

/* Títulos em Trebuchet, como as barras de título do XP */
.display, .pagehead h1, .hero-value, .modal-head h2, .auth-card h1 { font-family: var(--title); font-weight: 700; text-wrap: balance; }
.label, .field > span, .stat small, .section-title, .mini-title, .day-head, .card-head small {
  font-family: var(--body); font-size: 12.5px; font-weight: 700; color: var(--muted); letter-spacing: 0; text-transform: none;
}

/* ============ Janela ============ */
.app { min-height: 100dvh; padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
.window {
  min-height: calc(100dvh - 62px - env(safe-area-inset-bottom));
  background: var(--win);
  display: flex; flex-direction: column;
}
.window-body { display: flex; flex: 1; min-height: 0; }
.sidebar { display: none; }
.content { flex: 1; min-width: 0; padding: 4px 14px 28px; }
main { max-width: 1060px; margin: 0 auto; }
#view.turn { animation: turn 160ms ease-out; }
@keyframes turn { from { transform: translateY(6px); } }

.topbar { color: var(--ink); }
.titlebar {
  display: flex; align-items: center; gap: 8px;
  min-height: 40px; padding: env(safe-area-inset-top) 6px 0 10px;
  background: var(--title-bar); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 1px 0 rgba(10, 40, 110, .5);
}
.tb-icon { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 5px; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .35); }
.tb-icon svg { width: 15px; height: 15px; }
.tb-title { flex: 1; min-width: 0; font-family: var(--title); font-weight: 700; font-size: 15px; text-shadow: 0 1px 1px rgba(0, 0, 0, .45); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; gap: 5px; align-items: center; flex: none; }
.titlebar .icon-btn, .titlebar .sync-pill {
  height: 30px; min-width: 30px; width: auto; border-radius: 5px; color: #fff;
  background: linear-gradient(180deg, rgba(255, 255, 255, .32), rgba(255, 255, 255, .1));
  border: 1px solid rgba(255, 255, 255, .55);
  box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
}
.titlebar .icon-btn:hover, .titlebar .sync-pill:hover { background: linear-gradient(180deg, rgba(255, 255, 255, .45), rgba(255, 255, 255, .18)); }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; max-width: 1060px; margin: 0 auto; padding: 18px 14px 14px; }
.pagehead h1 { font-size: clamp(26px, 7vw, 36px); line-height: 1.1; color: var(--head-ink); letter-spacing: -.01em; }
.pagehead .sub { color: var(--muted); font-size: 15px; margin-top: 4px; }
.desk-only { display: none !important; }

.icon-btn { width: 40px; height: 40px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--btn); border: 1px solid var(--btn-edge); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
.modal-head .icon-btn {
  width: 32px; height: 32px; border-radius: 5px; color: #fff;
  background: linear-gradient(180deg, #f39a7f 0%, #e3582f 45%, #cf4220 100%);
  border: 1px solid rgba(255, 255, 255, .85); box-shadow: 0 1px 2px rgba(0, 0, 0, .3);
}
.modal-head .icon-btn:hover { background: linear-gradient(180deg, #f7b19b 0%, #ec6a42 45%, #d94c28 100%); }

/* ============ Barra de tarefas ============ */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; align-items: stretch; gap: 6px;
  height: calc(62px + env(safe-area-inset-bottom));
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom)) 0;
  background: var(--taskbar);
  border-top: 1px solid rgba(10, 40, 120, .8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 -4px 16px -8px rgba(10, 30, 80, .4);
}
/* O botão verde no lugar do "Iniciar" */
.bottomnav .nav-add {
  display: flex; align-items: center; gap: 6px; flex: none;
  padding: 0 20px 0 12px; border-radius: 0 18px 18px 0;
  background: var(--start); color: #fff; border: 1px solid var(--start-edge); border-left: 0;
  font-family: var(--title); font-style: italic; font-weight: 700; font-size: 18px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 2px 0 6px -2px rgba(0, 0, 0, .35);
}
.bottomnav .nav-add svg { width: 22px; height: 22px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .4)); }
.bottomnav .nav-add:hover { filter: brightness(1.06); }
.bottomnav .nav-add:active { filter: brightness(.94); }
.tasks { flex: 1; min-width: 0; display: flex; gap: 4px; }
.tasks a, .tasks button {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: 5px; color: #fff; font-size: 11px; font-weight: 700;
  background: linear-gradient(180deg, rgba(255, 255, 255, .24), rgba(255, 255, 255, .08));
  border: 1px solid rgba(0, 20, 80, .35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3);
  text-shadow: 0 1px 1px rgba(0, 0, 0, .35);
}
.tasks a:hover, .tasks button:hover { background: linear-gradient(180deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, .14)); }
.tasks svg { width: 20px; height: 20px; }
.tasks span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Aba ativa: botão "afundado" como na barra do XP */
.tasks .on { background: linear-gradient(180deg, rgba(0, 20, 70, .45), rgba(0, 20, 70, .2)); box-shadow: inset 0 2px 4px rgba(0, 0, 0, .35); }
.tray { display: none; }
.fab { display: none !important; }

/* ============ PC ============ */
@media (min-width: 900px) {
  .app { padding: 26px 26px calc(70px + env(safe-area-inset-bottom)); }
  .window {
    max-width: 1320px; margin: 0 auto; min-height: calc(100dvh - 96px);
    border: 1px solid #1d4fc0; border-radius: 10px 10px 6px 6px; overflow: clip;
    box-shadow: 0 2px 0 rgba(255, 255, 255, .4) inset, 0 24px 60px -30px rgba(10, 30, 80, .7);
  }
  [data-theme="dark"] .window { border-color: #4a5160; }
  .titlebar { border-radius: 9px 9px 0 0; min-height: 36px; }
  .content { padding: 0 26px 30px; }
  /* O cabeçalho fica alinhado ao conteúdo; à esquerda, o painel azul continua até a barra de título */
  .pagehead { max-width: none; margin: 0; padding: 22px 26px 16px calc(236px + 26px); background: linear-gradient(90deg, #a9c5f3 0 235px, #7f9bd8 235px 236px, transparent 236px); }
  [data-theme="dark"] .pagehead { background: linear-gradient(90deg, #232a37 0 235px, var(--panel-edge) 235px 236px, transparent 236px); }
  .desk-only { display: inline-flex !important; }
  .bottomnav { height: calc(48px + env(safe-area-inset-bottom)); padding: 4px 0 calc(4px + env(safe-area-inset-bottom)) 0; }
  .bottomnav .nav-add { font-size: 19px; padding: 0 26px 0 14px; }
  .tasks { flex: 1 1 auto; gap: 4px; padding-left: 6px; }
  .tasks a, .tasks button { flex: 0 0 156px; flex-direction: row; justify-content: flex-start; gap: 8px; padding: 0 12px; font-size: 13px; font-weight: 400; }
  .tasks svg { width: 17px; height: 17px; }
  .tray {
    display: flex; align-items: center; margin-left: auto; padding: 0 18px;
    background: var(--tray); color: #fff; border-left: 1px solid rgba(0, 20, 80, .55);
    box-shadow: inset 1px 0 0 rgba(255, 255, 255, .3);
    font-size: 13px; text-shadow: 0 1px 1px rgba(0, 0, 0, .35); font-variant-numeric: tabular-nums;
  }

  /* Painel de tarefas à esquerda, como no Explorer */
  .sidebar {
    display: flex; flex-direction: column; gap: 14px; flex: none; width: 236px;
    padding: 16px 12px;
    background: linear-gradient(180deg, #a9c5f3 0%, #8eaaea 100%);
    border-right: 1px solid #7f9bd8;
  }
  [data-theme="dark"] .sidebar { background: linear-gradient(180deg, #232a37 0%, #1b2029 100%); border-right-color: var(--panel-edge); }
  .brand { display: flex; align-items: center; gap: 10px; padding: 2px 4px 4px; font-family: var(--title); font-style: italic; font-weight: 700; font-size: 18px; color: #fff; text-shadow: 0 1px 2px rgba(10, 40, 110, .6); line-height: 1.1; }
  .brand img { width: 40px; height: 40px; border-radius: 10px; box-shadow: 0 2px 6px rgba(10, 40, 110, .35); }
  .side-nav, .side-foot { background: var(--panel); border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(10, 40, 110, .2); }
  .side-nav { display: flex; flex-direction: column; padding-bottom: 6px; }
  .side-nav::before, .side-foot::before {
    content: "Seções"; display: block; padding: 8px 12px; margin-bottom: 4px;
    background: var(--pane-head); color: #fff; font-family: var(--title); font-weight: 700; font-size: 13.5px;
    text-shadow: 0 1px 1px rgba(0, 0, 0, .3);
  }
  .side-foot::before { content: "Detalhes"; margin: 0; }
  .side-nav a { display: flex; align-items: center; gap: 10px; padding: 7px 12px; color: var(--link); font-size: 14px; }
  .side-nav a svg { width: 17px; height: 17px; }
  .side-nav a:hover { text-decoration: underline; text-underline-offset: 3px; }
  .side-nav a.on { background: var(--select); color: #fff; font-weight: 700; }
  .side-foot { padding: 0 0 12px; }
  .side-foot small, .side-foot b { display: block; padding: 0 12px; }
  .side-foot small { color: var(--muted); font-size: 12.5px; }
  .side-foot small:first-of-type { margin-top: 10px; font-weight: 700; }
  .side-foot b { font-family: var(--title); font-size: 24px; color: var(--head-ink); font-variant-numeric: tabular-nums; }
  body[data-section="inicio"] .side-foot { display: none; }
}

/* ============ Peças comuns ============ */
.stack { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.page { display: flex; flex-direction: column; gap: 14px; }
.grid2 { display: grid; gap: 14px; }
@media (min-width: 760px) { .grid2 { grid-template-columns: 1fr 1fr; } }

/* Painel com cabeçalho em gradiente, como os do painel de tarefas */
.card {
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--panel-edge); border-radius: 10px;
  padding: 16px; box-shadow: var(--lift); min-width: 0;
}
.card-head, .card > h3 {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  margin: -16px -16px 14px; padding: 9px 14px; min-height: 40px;
  background: var(--pane-head); color: #fff; border-radius: 9px 9px 0 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3);
}
.card h3 { font-family: var(--title); font-weight: 700; font-size: 15px; text-shadow: 0 1px 1px rgba(0, 0, 0, .3); }
.card-head small { color: rgba(255, 255, 255, .88); font-weight: 400; }
.card-head .link { color: #fff; }
.card-head .btn { height: 30px; padding: 0 12px; font-size: 13px; }
.link { color: var(--link); font-size: 14px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.section-title { margin: 18px 2px 6px; font-size: 13.5px; color: var(--head-ink); }
.row-btns { display: flex; gap: 6px; flex-wrap: wrap; }

/* Botões em relevo; no foco, o brilho laranja do XP */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 16px; border-radius: 6px;
  font-family: var(--body); font-size: 14px; font-weight: 700; white-space: nowrap;
  background: var(--btn); color: var(--ink); border: 1px solid var(--btn-edge);
  box-shadow: 0 1px 1px rgba(0, 0, 0, .08);
}
.btn:hover { box-shadow: inset 0 0 0 2px var(--hover-glow), 0 1px 1px rgba(0, 0, 0, .08); }
.btn:active { background: var(--btn-press); }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--start); color: #fff; border-color: var(--start-edge); font-family: var(--title); font-style: italic; font-size: 15px; text-shadow: 0 1px 1px rgba(0, 0, 0, .4); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 1px 2px rgba(0, 0, 0, .2); }
.btn.primary:hover { filter: brightness(1.06); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35), 0 1px 2px rgba(0, 0, 0, .2); }
.btn.soft { background: linear-gradient(180deg, #f2fbf1, #d9f0d6); color: #1f6f24; border-color: #5fae5a; }
[data-theme="dark"] .btn.soft { background: linear-gradient(180deg, #24382a, #1c2d21); color: var(--accent); border-color: #3f7a45; }
.btn.ghost { background: var(--btn); }
.btn.danger { background: linear-gradient(180deg, #f39a7f 0%, #e3582f 45%, #cf4220 100%); color: #fff; border-color: #a6331a; text-shadow: 0 1px 1px rgba(0, 0, 0, .35); }
.btn.danger-ghost { color: var(--neg); border-color: color-mix(in srgb, var(--neg) 60%, var(--btn-edge)); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; box-shadow: none; }

.chip {
  height: 34px; padding: 0 14px; border-radius: 999px; flex: none;
  border: 1px solid var(--panel-edge); background: var(--btn); color: var(--ink);
  font-size: 13px; font-weight: 700;
}
.chip:hover { box-shadow: inset 0 0 0 2px var(--hover-glow); }
.chip.on { background: linear-gradient(180deg, #5d9cf5, #2463d6); color: #fff; border-color: #1a4cb4; text-shadow: 0 1px 1px rgba(0, 0, 0, .3); }
.chips-scroll { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -14px; padding: 2px 14px; }
.chips-scroll::-webkit-scrollbar { display: none; }
@media (min-width: 900px) { .chips-scroll { margin: 0; padding: 2px 0; flex-wrap: wrap; } }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }

.tag, .status { font-style: normal; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; white-space: nowrap; border: 1px solid currentColor; line-height: 1.5; }
.tag { color: var(--muted); margin-left: 4px; }
.status.paid { color: var(--pos); background: var(--accent-soft); }
.status.late { color: var(--neg); background: color-mix(in srgb, var(--neg) 10%, transparent); }
.status.today, .status.soon { color: var(--warn-ink); background: color-mix(in srgb, var(--warn) 16%, transparent); }
.status.open, .status.none { color: var(--muted); }

.empty { text-align: center; padding: 26px 12px; color: var(--muted); font-size: 15px; }
.empty .big { margin: 0 auto 12px; width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; color: #fff; background: linear-gradient(180deg, #6aa8f7, #2a66d8); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 4px 10px -4px rgba(20, 60, 160, .5); font-size: 30px; }
.empty .big svg { width: 34px; height: 34px; }
.empty b { display: block; color: var(--head-ink); font-family: var(--title); font-size: 19px; margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }

/* Barra de progresso em blocos verdes, como a do XP */
.bar { height: 14px; border-radius: 4px; background: var(--panel); overflow: hidden; border: 1px solid var(--edge); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .12); padding: 1px; }
.bar i {
  display: block; height: 100%; border-radius: 2px;
  background:
    repeating-linear-gradient(90deg, transparent 0 8px, var(--panel) 8px 10px),
    linear-gradient(180deg, color-mix(in srgb, var(--c, #3cba2c) 45%, #fff) 0%, var(--c, #3cba2c) 55%, color-mix(in srgb, var(--c, #3cba2c) 80%, #000) 100%);
}
.bar.warn i { --c: #e8a10e; }
.bar.over i { --c: #d6402d; }
.bar.thin { height: 10px; margin-top: 6px; display: block; }

/* ============ Navegação de mês: os botões Voltar/Avançar verdes ============ */
.month-nav { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 10px; padding: 6px; box-shadow: var(--lift); }
.month-nav button:first-child, .month-nav button:last-child {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none;
  background: radial-gradient(circle at 40% 30%, #9ae78e 0%, #45b141 45%, #2b8d29 100%);
  border: 1px solid var(--start-edge); box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}
.month-nav button svg { width: 18px; height: 18px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .35)); }
.month-nav button:first-child:hover, .month-nav button:last-child:hover { filter: brightness(1.07); }
.month-nav .month-label { flex: 1; height: 36px; border-radius: 6px; font-family: var(--title); font-weight: 700; font-size: 16px; color: var(--head-ink); display: flex; gap: 8px; justify-content: center; align-items: center; }
.month-nav .month-label:hover { background: var(--panel-2); }
.month-label em { font-style: normal; font-family: var(--body); font-size: 11px; padding: 1px 8px; border-radius: 999px; background: linear-gradient(180deg, #fff6c8, #f5d36a); color: #6b4a00; border: 1px solid #d3a73a; }

/* ============ Início ============ */
.home-top { display: grid; gap: 14px; }
@media (min-width: 1000px) { .home-top { grid-template-columns: 1.05fr 1fr; align-items: start; } }

.hero {
  display: flex; flex-direction: column; gap: 14px;
  padding: 20px; border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #eaf2fe 100%);
  border: 1px solid var(--panel-edge); box-shadow: var(--lift);
}
[data-theme="dark"] .hero { background: linear-gradient(180deg, #232a36 0%, #1b2029 100%); }
.hero-value { font-size: clamp(44px, 12vw, 68px); line-height: 1; color: var(--head-ink); font-variant-numeric: tabular-nums; letter-spacing: -.02em; text-shadow: 0 1px 0 rgba(255, 255, 255, .8); }
[data-theme="dark"] .hero-value { text-shadow: none; }
.hero-sub { font-size: 16px; line-height: 1.55; color: var(--muted); max-width: 40ch; }
.hero-sub b { color: var(--ink); font-variant-numeric: tabular-nums; }
.hero-meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); gap: 8px; }
.hero-meta > * { display: flex; flex-direction: column; gap: 1px; padding: 9px 12px; border-radius: 8px; background: var(--panel); border: 1px solid var(--rule); min-width: 0; text-align: left; }
.hero-meta span { font-size: 12px; color: var(--muted); }
.hero-meta b { font-variant-numeric: tabular-nums; font-size: 15.5px; }
.hero-fc { cursor: pointer; }
.hero-fc:hover { border-color: var(--hover-glow); box-shadow: inset 0 0 0 1px var(--hover-glow); }
.hero-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.hero-actions .btn { padding: 0 8px; }

.stats { container-type: inline-size; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 10px; box-shadow: var(--lift); overflow: hidden; }
.stats.two { grid-template-columns: 1fr 1fr; }
.stat { padding: 12px 14px; min-width: 0; }
.stats .stat + .stat { border-left: 1px solid var(--rule); }
.stat small { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.stat b { display: block; font-family: var(--title); font-size: 22px; line-height: 1.2; margin-top: 2px; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Dinheiro nunca é cortado: o tamanho acompanha a largura da faixa */
.stats .stat b { font-size: clamp(12.5px, 4cqi, 24px); }
.stats.two .stat b { font-size: clamp(18px, 8cqi, 28px); }
@media (max-width: 480px) { .stats .stat { padding: 12px 10px; } }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpis .stat { background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 10px; box-shadow: var(--lift); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.pos { background: var(--pos); }
.dot.neg { background: var(--neg); }

/* Avisos com os ícones redondos do XP: azul (info), amarelo (atenção), vermelho (erro) */
.insights { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 10px; box-shadow: var(--lift); overflow: hidden; }
.insight { display: flex; gap: 12px; align-items: center; padding: 11px 14px; font-size: 14.5px; line-height: 1.45; }
.insight + .insight { border-top: 1px solid var(--rule); }
.insight .i-ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #fff; font-size: 16px; background: radial-gradient(circle at 40% 30%, #8ec0ff 0%, #2f74e3 55%, #1a4cb4 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 1px 2px rgba(0, 0, 0, .25); }
.insight .i-ic svg { width: 17px; height: 17px; }
.insight.good .i-ic { background: radial-gradient(circle at 40% 30%, #a6ef99 0%, #45b141 55%, #2b8d29 100%); }
.insight.warn .i-ic { background: radial-gradient(circle at 40% 30%, #ffe59a 0%, #f2b21c 55%, #c98a00 100%); }
.insight.danger .i-ic { background: radial-gradient(circle at 40% 30%, #ffb3a1 0%, #e3582f 55%, #b8361a 100%); }
.insight p { flex: 1; min-width: 0; }
.insight .btn { flex: none; }

/* ============ Gráficos ============ */
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: center; }
.donut { width: 140px; height: 140px; flex: none; }
.donut-k { font-size: 9.5px; fill: var(--muted); text-anchor: middle; font-weight: 700; font-family: var(--body); }
.donut-v { font-size: 15px; fill: var(--ink); text-anchor: middle; font-family: var(--title); font-weight: 700; }
.legend { flex: 1 1 180px; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.legend li { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.legend i { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.legend span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend b { font-variant-numeric: tabular-nums; }
.legend em { font-style: normal; color: var(--muted); font-size: 12px; width: 36px; text-align: right; font-variant-numeric: tabular-nums; }

.bars, .line { width: 100%; height: auto; display: block; }
.bars text, .line text { font-size: 10.5px; fill: var(--muted); font-family: var(--body); }
.bars text { text-anchor: middle; }
.bars text.cur, .line text.cur { fill: var(--ink); font-weight: 700; }
.bars text.ax-l { text-anchor: start; fill: var(--faint); }
.bars text.ax-r { text-anchor: end; }
.bars text.val { fill: var(--ink); font-size: 12px; font-weight: 700; }
.bars .hit { cursor: pointer; }
.bars .hit:hover { fill: color-mix(in srgb, var(--select) 8%, transparent); }
.line text:not(.val) { text-anchor: middle; }
.line text.ax, .line text.end { text-anchor: start; }
.line text.ax { fill: var(--faint); font-size: 10px; }
.line text.end { fill: var(--ink); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.line text.end.muted { fill: var(--muted); font-weight: 400; }
.line text.val { fill: var(--ink); font-size: 13px; font-weight: 700; }
.xh-chart { cursor: crosshair; touch-action: pan-y; }
.chart-key { display: flex; gap: 16px; font-size: 13px; color: var(--muted); margin-top: 10px; flex-wrap: wrap; }
.chart-key i { display: inline-block; width: 12px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart-key i.dash { background: repeating-linear-gradient(90deg, var(--faint) 0 4px, transparent 4px 7px); height: 3px; width: 18px; vertical-align: 2px; }
.pace-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.pace-head small { display: block; color: var(--muted); font-size: 13px; }
.pace-head b { font-family: var(--title); font-size: 26px; line-height: 1.1; color: var(--head-ink); font-variant-numeric: tabular-nums; }
.chip-stat { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; border: 1px solid currentColor; }
.chip-stat.good { color: var(--pos); background: var(--accent-soft); }
.chip-stat.bad { color: var(--neg); background: color-mix(in srgb, var(--neg) 10%, transparent); }

/* A dica amarelinha do XP */
.chart-tip { position: fixed; z-index: 400; pointer-events: none; background: var(--balloon); color: var(--ink); border: 1px solid var(--balloon-edge); padding: 7px 10px; border-radius: 4px; font-size: 13px; line-height: 1.45; max-width: 250px; font-variant-numeric: tabular-nums; box-shadow: 2px 3px 8px rgba(0, 0, 0, .2); }
.tip-row { display: flex; align-items: center; gap: 6px; min-width: 160px; }
.tip-row i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.tip-row b { margin-left: auto; padding-left: 12px; }

/* ============ Extrato ============ */
.tx-list { display: flex; flex-direction: column; }
.tx { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 9px 8px; border-radius: 6px; }
.tx + .tx { margin-top: 1px; }
.tx:hover { background: color-mix(in srgb, var(--select) 10%, var(--panel)); }
.tx-ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 19px; flex: none; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 10%, var(--panel)), color-mix(in srgb, var(--c) 24%, var(--panel))); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); }
.tx-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tx-main b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-main small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-amt { font-weight: 700; font-size: 15px; white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; }
.tx-amt small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); }
.tx-amt.pos { color: var(--pos); }
.tx-amt.neg { color: var(--neg); }
.tx-amt.neutral { color: var(--muted); }
.tx.future { opacity: .65; }
.day-head { display: flex; justify-content: space-between; padding: 14px 8px 6px; color: var(--head-ink); border-bottom: 1px solid var(--rule); margin-bottom: 4px; }
.day-head:first-child { padding-top: 2px; }
.day-head span:last-child { font-variant-numeric: tabular-nums; color: var(--muted); }

.filters { display: flex; flex-direction: column; gap: 10px; }
.search { position: relative; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search .input { padding-left: 40px; }
.filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.list-summary { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.list-summary span { font-size: 13px; padding: 5px 11px; border-radius: 999px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--rule); }
.list-summary span b { color: var(--ink); font-variant-numeric: tabular-nums; }
.list-foot { display: flex; justify-content: center; margin-top: 12px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: 10px; background: var(--balloon); border: 1px solid var(--balloon-edge); font-size: 15px; }

.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.cal-wd { text-align: center; font-size: 11.5px; font-weight: 700; color: var(--muted); padding-bottom: 2px; }
.cal-day { aspect-ratio: 1; min-width: 0; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; background: var(--panel-2); border: 1px solid var(--rule); line-height: 1.1; }
.cal-day b { font-size: 14px; }
.cal-day small { font-size: 9.5px; color: var(--muted); font-variant-numeric: tabular-nums; max-width: 100%; overflow: hidden; }
.lv1 { --h: 16%; } .lv2 { --h: 32%; } .lv3 { --h: 52%; } .lv4 { --h: 76%; }
.cal-day:is(.lv1, .lv2, .lv3, .lv4), .cal-legend i:is(.lv1, .lv2, .lv3, .lv4) { background: color-mix(in srgb, var(--neg) var(--h), var(--panel)); border-color: transparent; }
.cal-day.lv3 small { color: var(--ink); }
.cal-day.lv4 { color: #fff; }
.cal-day.lv4 small { color: rgba(255, 255, 255, .92); }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--select); }
.cal-day.fut { opacity: .45; }
.cal-day:hover { box-shadow: inset 0 0 0 2px var(--hover-glow); }
.cal-legend { display: flex; align-items: center; gap: 4px; justify-content: flex-end; font-size: 12px; color: var(--muted); margin-top: 10px; }
.cal-legend i { width: 12px; height: 12px; border-radius: 3px; background: var(--panel-2); border: 1px solid var(--rule); }
.cal-legend span { margin: 0 3px; }

/* ============ Potes ============ */
.pots-hero, .card.pots-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px; border-radius: 12px; background: linear-gradient(180deg, #f3fbef 0%, #dcf2d2 100%); border: 1px solid #9fd38f; box-shadow: var(--lift); }
[data-theme="dark"] .pots-hero, [data-theme="dark"] .card.pots-hero { background: linear-gradient(180deg, #213226, #1a271e); border-color: #3c6545; }
.pots-hero small { color: var(--muted); font-size: 14px; display: block; }
.pots-hero .big { font-family: var(--title); font-weight: 700; font-size: clamp(36px, 10vw, 52px); line-height: 1.1; color: var(--pos); font-variant-numeric: tabular-nums; }
.pots-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 268px), 1fr)); }
.pot { position: relative; background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 12px; cursor: pointer; box-shadow: var(--lift); overflow: hidden; }
.pot:hover { box-shadow: inset 0 0 0 2px var(--hover-glow), var(--lift); }
.pot.done { border-color: var(--c); }
.pot-head { display: flex; gap: 12px; align-items: center; min-width: 0; }
.pot-head > div { min-width: 0; }
.pot h4 { font-family: var(--title); font-weight: 700; font-size: 17px; color: var(--head-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pot-head small { color: var(--muted); font-size: 13px; }
.pot-value { font-family: var(--title); font-weight: 700; font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pot-value small { font-family: var(--body); font-size: 13px; color: var(--muted); font-weight: 400; }
.pot-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.pot-foot span:first-child { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.pot-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pot-actions.three { grid-template-columns: repeat(3, 1fr); }
.pot-actions.three .btn { padding: 0 8px; font-size: 13px; }
.pot-badge { position: absolute; top: 12px; right: 12px; font-size: 11.5px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: linear-gradient(180deg, #fff6c8, #f5d36a); color: #6b4a00; border: 1px solid #d3a73a; }

/* O pote é um vidrinho brilhante que enche com a cor dele */
.jar {
  --p: 0%;
  position: relative; width: 56px; height: 56px; border-radius: 14px; overflow: hidden; flex: none; isolation: isolate;
  background: linear-gradient(180deg, #ffffff, var(--panel-2)); border: 1px solid color-mix(in srgb, var(--c) 55%, var(--panel-edge));
  display: grid; place-items: center; font-size: 26px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 2px 5px -2px rgba(0, 0, 0, .25);
}
[data-theme="dark"] .jar { background: linear-gradient(180deg, #2c3340, #232934); }
.jar::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: var(--p); z-index: -1; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 45%, #fff), color-mix(in srgb, var(--c) 80%, transparent)); }
.jar::after { content: ""; position: absolute; inset: 0 0 55%; background: linear-gradient(180deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0)); z-index: -1; }
.jar.sm { width: 38px; height: 38px; border-radius: 10px; font-size: 18px; }
.jar.big { width: 108px; height: 108px; border-radius: 26px; font-size: 50px; }

.pot-row { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 2px; }
.pot-row::-webkit-scrollbar { display: none; }
.pot-mini { flex: 0 0 156px; scroll-snap-align: start; border: 1px solid var(--rule); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; text-align: left; background: var(--panel-2); }
.pot-mini:hover { box-shadow: inset 0 0 0 2px var(--hover-glow); }
.pot-mini b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pot-mini strong { font-family: var(--title); font-size: 19px; font-variant-numeric: tabular-nums; }
.pot-mini.add { align-items: center; justify-content: center; color: var(--link); font-weight: 700; font-size: 13px; border-style: dashed; border-color: var(--edge); background: transparent; text-align: center; }

.templates { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); }
.tpl { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 10px; border: 1px dashed var(--edge); background: var(--panel); text-align: left; font-weight: 700; font-size: 14px; color: var(--link); }
.tpl:hover { box-shadow: inset 0 0 0 2px var(--hover-glow); }
.tpl span { font-size: 20px; }

.pot-detail { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 6px 0 16px; }
.pot-detail .jar { margin-bottom: 8px; }
.pd-value { font-family: var(--title); font-weight: 700; font-size: 40px; line-height: 1.1; color: var(--head-ink); font-variant-numeric: tabular-nums; }
.pot-detail .bar { width: 100%; max-width: 320px; margin-top: 8px; }
.pd-hint { font-size: 14px; font-weight: 700; color: var(--muted); margin-top: 4px; }
.move { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--rule); }
.move:last-child { border: 0; }
.move .m-ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--rule); font-weight: 700; flex: none; }
.move .m-ic.in { color: var(--pos); }
.move .m-ic.out { color: var(--neg); }
.move > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.move small { color: var(--muted); font-size: 12.5px; }
.move b { font-variant-numeric: tabular-nums; }
.move .x { width: 30px; height: 30px; border-radius: 6px; color: var(--faint); display: grid; place-items: center; }
.move .x:hover { color: var(--neg); background: var(--panel-2); }
.move .x svg { width: 15px; height: 15px; }

.dist-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.dist-name { flex: 1; min-width: 0; display: flex; flex-direction: column; font-weight: 700; font-size: 14.5px; }
.dist-name small { color: var(--muted); font-weight: 400; font-size: 12.5px; }
.dist-row .input { width: 72px; text-align: right; height: 40px; padding: 0 8px; }
.dist-val { width: 92px; text-align: right; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.dist-total { font-size: 13.5px; font-weight: 700; color: var(--muted); padding: 6px 0; }
.dist-total.bad { color: var(--neg); }

.sim { padding: 14px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--rule); display: flex; flex-direction: column; gap: 10px; }
.sim .field input { background: var(--panel); }
.sim-out { font-size: 15px; }

/* ============ Planejar ============ */
.budget { display: flex; flex-direction: column; gap: 7px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.budget:last-child { border: 0; padding-bottom: 2px; }
.budget-top { display: flex; align-items: center; gap: 10px; }
.budget-top .e { font-size: 18px; width: 24px; text-align: center; flex: none; }
.budget-top span { flex: 1; font-weight: 700; font-size: 14.5px; min-width: 0; }
.budget-top small { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; }
.budget-left { font-size: 13px; color: var(--muted); }
.budget-left.over { color: var(--neg); }
.budget-total { padding: 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--rule); margin-bottom: 4px; }

.bill { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.bill:last-child { border: 0; }
.bill-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; text-align: left; padding: 2px 0; }
/* O dia do vencimento como uma folhinha de calendário */
.bill-day { width: 46px; height: 48px; border-radius: 7px; background: var(--panel); border: 1px solid var(--edge); display: flex; flex-direction: column; align-items: center; flex: none; overflow: hidden; line-height: 1; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.bill-day small { order: -1; width: 100%; text-align: center; padding: 3px 0; background: linear-gradient(180deg, #ef6b4c, #cf4220); color: #fff; font-size: 9.5px; font-weight: 700; text-transform: uppercase; }
.bill-day b { font-family: var(--title); font-size: 20px; margin-top: 5px; }
.bill-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.bill-info b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bill-info small { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.bills-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 6px; }
.bills-sum div { padding: 10px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--rule); }
.bills-sum small { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.bills-sum b { font-family: var(--title); font-size: 21px; font-variant-numeric: tabular-nums; }

.rule-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 0; }
.rule-row b { font-size: 15px; }
.rule-row small { color: var(--muted); font-size: 12.5px; }
.rule-row .r-val { text-align: right; font-family: var(--title); font-weight: 700; font-size: 21px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.rule-row .r-val small { display: block; font-family: var(--body); font-weight: 400; font-size: 12px; margin-top: 2px; }
.rule-bar { grid-column: 1 / -1; position: relative; height: 12px; background: var(--panel); border: 1px solid var(--edge); border-radius: 4px; margin-top: 6px; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .12); }
.rule-bar i { position: absolute; left: 1px; top: 1px; bottom: 1px; border-radius: 2px; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 45%, #fff), var(--c)); }
.rule-bar u { position: absolute; top: -5px; bottom: -5px; width: 2px; background: var(--ink); }
.verdict { margin-top: 10px; padding: 12px 14px; border-radius: 10px; background: var(--balloon); border: 1px solid var(--balloon-edge); font-size: 14.5px; }

/* ============ Cartões de crédito ============ */
.cards-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.cc-wrap { display: flex; flex-direction: column; gap: 14px; }
.ccard {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; justify-content: space-between; gap: 2px;
  padding: 18px; border-radius: 14px; color: #fff; text-align: left; aspect-ratio: 1.7; max-width: 100%;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 60%, #fff) 0%, var(--c) 48%, color-mix(in srgb, var(--c) 78%, #000) 100%);
  border: 1px solid color-mix(in srgb, var(--c) 60%, #000);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 10px 22px -12px rgba(0, 0, 0, .5);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
.ccard::after { content: ""; position: absolute; inset: 0 0 52%; background: linear-gradient(180deg, rgba(255, 255, 255, .3), rgba(255, 255, 255, 0)); z-index: -1; }
.cc-top { display: flex; justify-content: space-between; align-items: center; font-family: var(--title); font-weight: 700; font-size: 17px; }
.cc-chip { width: 40px; height: 30px; border-radius: 6px; background: linear-gradient(135deg, #fff1b8, #e7b53c); border: 1px solid rgba(0, 0, 0, .25); }
.cc-label { font-size: 12.5px; opacity: .9; margin-top: auto; }
.cc-val { font-family: var(--title); font-weight: 700; font-size: clamp(30px, 9vw, 38px); line-height: 1.05; font-variant-numeric: tabular-nums; }
.cc-foot { display: flex; justify-content: space-between; font-size: 13px; opacity: .95; margin-top: 8px; }
.cc-limit { display: flex; flex-direction: column; gap: 6px; }
.cc-closed { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--rule); }
.cc-closed small { display: block; color: var(--muted); font-size: 13px; }
.cc-closed b { font-variant-numeric: tabular-nums; }
.inv-sum { text-align: center; padding: 16px 0 10px; }
.inv-sum small { display: block; color: var(--muted); font-size: 13.5px; }
.inv-sum b { font-family: var(--title); font-size: 40px; color: var(--head-ink); font-variant-numeric: tabular-nums; }
.modal .month-nav { box-shadow: none; }
.modal .month-nav span.month-label { flex: 1; text-align: center; }

/* ============ Previsão ============ */
.fc-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: 14.5px; }
.fc-row > span:first-child:not(.fc-ic) { flex: 1; font-weight: 700; }
.fc-row b { font-variant-numeric: tabular-nums; }
.fc-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--rule); display: grid; place-items: center; flex: none; }
.fc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fc-main b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-main small { color: var(--muted); font-size: 12.5px; }
.fc-amt { text-align: right; display: flex; flex-direction: column; }
.fc-amt small { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.fc-now { margin-top: 12px; }
.fc-end { border-bottom: 0; padding-top: 14px; }
.fc-end b { font-family: var(--title); font-size: 26px; color: var(--head-ink); }

/* ============ Dívidas ============ */
.avatar { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; flex: none; font-family: var(--title); font-weight: 700; font-size: 19px; color: #fff; background: linear-gradient(180deg, color-mix(in srgb, var(--c, var(--select)) 55%, #fff), var(--c, var(--select))); border: 1px solid color-mix(in srgb, var(--c, var(--select)) 70%, #000); text-shadow: 0 1px 1px rgba(0, 0, 0, .35); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45); }
.avatar.big { width: 88px; height: 88px; border-radius: 20px; font-size: 40px; margin-bottom: 6px; }

/* ============ Relatórios ============ */
.rep-table { display: flex; flex-direction: column; }
.rep-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.rep-row:last-child { border: 0; }
.rep-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rep-main b { font-size: 14.5px; }
.rep-val { text-align: right; display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.rep-val small { color: var(--muted); font-size: 12px; }
.wk { display: flex; flex-direction: column; gap: 9px; }
.wk-row { display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center; font-size: 13.5px; }
.wk-row > span:first-child { font-weight: 700; color: var(--muted); }
.wk-row .bar { margin: 0; }
.wk-row b { font-variant-numeric: tabular-nums; min-width: 74px; text-align: right; }
.multi { display: flex; flex-direction: column; gap: 10px; }
.multi-row, .multi-axis { display: grid; grid-template-columns: minmax(0, 140px) 1fr 78px; gap: 12px; align-items: center; }
.multi-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.multi-row b { font-variant-numeric: tabular-nums; text-align: right; font-size: 14px; }
.spark { width: 100%; height: 40px; display: block; }
.multi-axis { font-size: 11px; color: var(--faint); margin-top: -4px; }
.multi-axis .ma { display: flex; justify-content: space-between; }
@media (max-width: 480px) { .multi-row, .multi-axis { grid-template-columns: minmax(0, 96px) 1fr 66px; gap: 8px; } }

/* ============ Dias sem gastar ============ */
.streak { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; background: var(--panel); border: 1px solid var(--panel-edge); box-shadow: var(--lift); }
.streak-flame { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; color: #fff; background: linear-gradient(180deg, #c8ced9, #9aa3b4); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5); }
.streak-flame svg { width: 24px; height: 24px; }
.streak-flame.on { background: radial-gradient(circle at 40% 30%, #ffd08a 0%, #f58a1f 55%, #c95f08 100%); }
.streak-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.streak-main b { font-size: 15.5px; }
.streak-main small { color: var(--muted); font-size: 13px; }
.streak-goal { text-align: right; display: flex; flex-direction: column; }
.streak-goal b { font-family: var(--title); font-size: 24px; line-height: 1.1; color: var(--head-ink); font-variant-numeric: tabular-nums; }
.streak-goal small { color: var(--muted); font-size: 11.5px; }

.ns-hero { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px 18px; padding: 20px; border-radius: 12px; background: linear-gradient(180deg, #fff6e8 0%, #ffe1b8 100%); border: 1px solid #f0b46a; box-shadow: var(--lift); color: #5a3305; }
[data-theme="dark"] .ns-hero { background: linear-gradient(180deg, #3a2a18, #2a1f13); border-color: #7a5328; color: #ffd9a8; }
.ns-flame { width: 74px; height: 74px; border-radius: 18px; display: grid; place-items: center; color: #fff; background: linear-gradient(180deg, #c8ced9, #9aa3b4); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 4px 10px -4px rgba(0, 0, 0, .3); }
.ns-flame svg { width: 42px; height: 42px; }
.ns-flame.on { background: radial-gradient(circle at 40% 30%, #ffd08a 0%, #f58a1f 55%, #c95f08 100%); }
.ns-num { font-family: var(--title); font-weight: 700; font-size: clamp(56px, 16vw, 84px); line-height: .95; font-variant-numeric: tabular-nums; color: #c25a06; }
[data-theme="dark"] .ns-num { color: #ffae5c; }
.ns-lbl { font-size: 15.5px; font-weight: 700; margin-top: 2px; }
.ns-side { display: grid; grid-template-columns: auto auto; gap: 4px 14px; align-items: baseline; padding: 10px 14px; border-radius: 10px; background: rgba(255, 255, 255, .6); border: 1px solid #f0c48a; }
[data-theme="dark"] .ns-side { background: rgba(0, 0, 0, .25); border-color: #7a5328; }
.ns-side small { font-size: 12.5px; }
.ns-side b { font-family: var(--title); font-size: 19px; text-align: right; font-variant-numeric: tabular-nums; }
.ns-msg { grid-column: 1 / -1; font-size: 15px; }
@media (max-width: 480px) {
  .ns-hero { grid-template-columns: auto 1fr; }
  .ns-side { grid-column: 1 / -1; grid-template-columns: auto auto auto auto; justify-content: start; }
}
.ns-goal { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.ns-goal b { font-family: var(--title); font-size: 40px; line-height: 1; color: var(--head-ink); font-variant-numeric: tabular-nums; }
.ns-goal span { color: var(--muted); font-size: 15px; }
.ns-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-top: 16px; }
.ns-day { aspect-ratio: 1; max-width: 44px; width: 100%; justify-self: center; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; min-width: 0; font-variant-numeric: tabular-nums; }
.ns-day.ok { color: #fff; background: radial-gradient(circle at 40% 30%, #a6ef99 0%, #45b141 55%, #2b8d29 100%); text-shadow: 0 1px 1px rgba(0, 0, 0, .3); }
.ns-day.spent { background: color-mix(in srgb, var(--neg) 12%, var(--panel)); color: var(--muted); border: 1px solid color-mix(in srgb, var(--neg) 30%, transparent); }
.ns-day.na { color: var(--faint); background: var(--panel-2); }
.ns-day.today { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--select); }
.ns-legend, .hm-legend { display: flex; align-items: center; gap: 4px 14px; font-size: 12.5px; color: var(--muted); margin-top: 12px; flex-wrap: wrap; }
.ns-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.ns-legend i.ok, .hm-legend i.ok { background: #45b141; }
.ns-legend i.spent { background: color-mix(in srgb, var(--neg) 30%, var(--panel)); }
.ns-legend i.na { background: var(--panel-2); border: 1px solid var(--rule); }
.hm-wrap { overflow-x: auto; padding-bottom: 4px; }
.hm { display: block; }
.hm text { font-size: 10px; fill: var(--muted); font-family: var(--body); }
.hm .na { fill: var(--panel-2); }
.hm .ok { fill: #45b141; }
.hm .l1, .hm-legend i.l1 { fill: color-mix(in srgb, var(--neg) 22%, var(--panel)); background: color-mix(in srgb, var(--neg) 22%, var(--panel)); }
.hm .l2, .hm-legend i.l2 { fill: color-mix(in srgb, var(--neg) 42%, var(--panel)); background: color-mix(in srgb, var(--neg) 42%, var(--panel)); }
.hm .l3, .hm-legend i.l3 { fill: color-mix(in srgb, var(--neg) 64%, var(--panel)); background: color-mix(in srgb, var(--neg) 64%, var(--panel)); }
.hm .l4, .hm-legend i.l4 { fill: color-mix(in srgb, var(--neg) 88%, var(--panel)); background: color-mix(in srgb, var(--neg) 88%, var(--panel)); }
.hm-legend { gap: 4px; }
.hm-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.hm-legend .sp { width: 14px; }
.medals { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 128px), 1fr)); gap: 10px; }
.medal { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; padding: 14px 8px; border-radius: 12px; border: 1px dashed var(--panel-edge); background: var(--panel-2); }
.medal span { font-size: 30px; filter: grayscale(1); opacity: .4; }
.medal b { font-family: var(--title); font-size: 14px; color: var(--muted); }
.medal small { font-size: 12px; color: var(--faint); }
.medal.on { border-style: solid; border-color: #e7b53c; background: linear-gradient(180deg, #fffbe8, #fff0b8); }
[data-theme="dark"] .medal.on { background: linear-gradient(180deg, #3a3318, #2c2712); border-color: #8a7230; }
.medal.on span { filter: none; opacity: 1; }
.medal.on b { color: var(--ink); }
.medal.on small { color: var(--muted); }

/* ============ Ajustes ============ */
.settings { display: grid; gap: 14px; align-items: start; }
@media (min-width: 960px) { .settings { grid-template-columns: 1fr 1fr; } .settings .span2 { grid-column: 1 / -1; } }
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 6px; width: 100%; text-align: left; }
.list-row:hover { background: color-mix(in srgb, var(--select) 10%, var(--panel)); }
.list-row > span:nth-child(2) { flex: 1; min-width: 0; font-weight: 700; }
.list-row b { font-variant-numeric: tabular-nums; }
.mini-title { margin: 4px 0 10px; font-size: 13.5px; color: var(--head-ink); }
.btn-grid { display: grid; gap: 8px; margin-top: 14px; }
@media (min-width: 560px) { .btn-grid { grid-template-columns: 1fr 1fr; } }
.switch-row { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; font-weight: 700; font-size: 15px; }
.switch { width: 52px; height: 28px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--edge); position: relative; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .15); }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: var(--btn); border: 1px solid var(--btn-edge); transition: transform .15s ease-out; }
.switch.on { background: linear-gradient(180deg, #74d26d, #2f962d); border-color: var(--start-edge); }
.switch.on::after { transform: translateX(24px); }
.foot { text-align: center; font-size: 13px; padding: 10px 0 4px; color: var(--muted); }

.sync-pill { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border-radius: 6px; font-size: 12.5px; font-weight: 700; white-space: nowrap; border: 1px solid var(--btn-edge); background: var(--btn); color: var(--ink); }
.sync-pill svg { width: 16px; height: 16px; }
.sync-pill.s-saving svg, .sync-pill.s-pending svg { animation: blink 1s ease-in-out infinite; }
.card .sync-pill.s-ok { color: var(--pos); }
.card .sync-pill.s-offline { color: var(--warn-ink); }
.sync-pill.s-error { color: var(--neg); }
.titlebar .sync-pill.s-error { color: #ffd1c7; }
[data-sync-slot] { display: inline-flex; }
@keyframes blink { 50% { opacity: .3; } }
@media (max-width: 599px) {
  .titlebar .sync-pill .sync-txt { display: none; }
  .titlebar .sync-pill { padding: 0; width: 30px; justify-content: center; }
}

/* O menu Mais lembra o menu Iniciar: lista com ícones grandes */
.more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 14px; }
.more-item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 8px; color: var(--ink); border: 1px solid transparent; }
.more-item:hover { background: var(--select); color: #fff; }
.more-item svg { width: 34px; height: 34px; padding: 7px; border-radius: 10px; color: #fff; flex: none; background: linear-gradient(180deg, #6aa8f7, #2a66d8); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45); }
.more-item b { display: block; font-family: var(--title); font-size: 15px; }
.more-item small { display: none; }
.more-item:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* ============ Formulários ============ */
.form { display: flex; flex-direction: column; gap: 15px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field small { color: var(--muted); font-size: 12.5px; }
.input, .field input:not([type=checkbox]), .field select {
  height: 46px; border-radius: 6px; border: 1px solid #7f9db9;
  background: var(--panel); padding: 0 12px; width: 100%; outline: none;
  font-size: 16px; appearance: none; -webkit-appearance: none; color: var(--ink);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .08);
}
[data-theme="dark"] .input, [data-theme="dark"] .field input:not([type=checkbox]), [data-theme="dark"] .field select { border-color: var(--edge); }
.input::placeholder, .field input::placeholder { color: var(--faint); }
.field select, select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%232a63d6' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; text-overflow: ellipsis;
}
.input:focus, .field input:focus, .field select:focus { border-color: var(--select); box-shadow: 0 0 0 3px color-mix(in srgb, var(--select) 25%, transparent); }
input[type=date] { min-width: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: flex; gap: 10px; align-items: center; font-size: 15px; }
.check input { width: 20px; height: 20px; accent-color: var(--select); }

.amount-field { display: flex; align-items: baseline; gap: 6px; justify-content: center; padding: 6px 0 4px; }
.amount-field span { font-family: var(--title); font-weight: 700; font-size: 22px; color: var(--muted); }
.amount-field input { font-family: var(--title); font-weight: 700; font-size: 50px; line-height: 1.1; border: 0; background: none; outline: none; width: 100%; max-width: 280px; text-align: center; font-variant-numeric: tabular-nums; padding: 0; color: var(--head-ink); }
.modal[data-type="expense"] .amount-field input { color: var(--neg); }
.modal[data-type="income"] .amount-field input { color: var(--pos); }
.quick-amts { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.calc-hint { text-align: center; font-weight: 700; font-size: 14px; color: var(--pos); margin-top: -8px; font-variant-numeric: tabular-nums; }
.calc-hint:empty, .shortcuts:empty, #card-hint:empty { display: none; }
.shortcuts { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; align-items: center; margin: 0 -18px; padding: 2px 18px; }
.shortcuts::-webkit-scrollbar { display: none; }
.shortcuts > span { font-size: 12.5px; font-weight: 700; color: var(--muted); flex: none; }
.shortcuts .chip { white-space: nowrap; font-weight: 400; }
#card-hint { color: var(--link); font-weight: 700; }

/* Abas no estilo XP: a aba ativa ganha a faixa laranja no topo */
.seg { display: flex; gap: 2px; border-bottom: 1px solid var(--edge); padding: 0 4px; }
.seg button { flex: 1; height: 40px; margin-bottom: -1px; border-radius: 7px 7px 0 0; font-size: 14px; font-weight: 700; color: var(--muted); background: var(--panel-2); border: 1px solid var(--rule); border-bottom-color: var(--edge); }
.seg button:hover { color: var(--ink); background: var(--panel); }
.seg button.on { background: var(--panel); color: var(--ink); border-color: var(--edge); border-bottom-color: var(--panel); box-shadow: inset 0 3px 0 #f5b742; }
.seg button.on[data-t="expense"], .seg button.on[data-d="out"] { color: var(--neg); }
.seg button.on[data-t="income"], .seg button.on[data-d="in"] { color: var(--pos); }
.seg.seg-sm { border-bottom: 0; padding: 0; gap: 4px; }
.seg.seg-sm button { height: 34px; padding: 0 14px; font-size: 13px; border-radius: 999px; border: 1px solid var(--panel-edge); margin: 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--btn); }
.seg.seg-sm button.on { background: linear-gradient(180deg, #5d9cf5, #2463d6); color: #fff; border-color: #1a4cb4; box-shadow: none; }
.seg.seg-sm svg { width: 15px; height: 15px; }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 6px; }
.cat-chip {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 9px 4px; border-radius: 10px; border: 1px solid var(--rule); background: var(--panel);
  font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; line-height: 1.15; min-height: 68px;
}
.cat-chip .e { font-size: 22px; }
.cat-chip:hover { box-shadow: inset 0 0 0 2px var(--hover-glow); }
.cat-chip.on { border-color: var(--select); background: color-mix(in srgb, var(--select) 12%, var(--panel)); color: var(--ink); box-shadow: inset 0 0 0 1px var(--select); }
.cat-chip.add { border-style: dashed; border-color: var(--edge); color: var(--link); }
.cat-chip small { font-size: 11px; font-weight: 400; color: var(--faint); }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 34px; height: 34px; border-radius: 8px; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 55%, #fff), var(--c)); border: 1px solid color-mix(in srgb, var(--c) 70%, #000); }
.swatch.on { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--select); }
.emoji-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-pick button { width: 44px; height: 44px; border-radius: 10px; font-size: 21px; background: var(--panel); border: 1px solid var(--rule); }
.emoji-pick button:hover { box-shadow: inset 0 0 0 2px var(--hover-glow); }
.emoji-pick button.on { border-color: var(--select); background: color-mix(in srgb, var(--select) 14%, var(--panel)); }

.imp-inv { align-self: end; padding-bottom: 12px; }
.imp-tools { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin: 10px 0 6px; }
button.link { padding: 0; }
.imp-list { max-height: 46dvh; overflow-y: auto; border: 1px solid #7f9db9; border-radius: 8px; padding: 0 10px; background: var(--panel); }
.imp-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.imp-row:last-child { border: 0; }
.imp-row.off { opacity: .5; }
.imp-row input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--select); flex: none; }
.imp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.imp-main b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.imp-main small { color: var(--muted); font-size: 12px; }
.imp-cat { height: 32px; border-radius: 6px; border: 1px solid #7f9db9; background: var(--panel); font-size: 13px; padding: 0 8px; max-width: 100%; width: fit-content; color: var(--ink); }
.imp-amt { font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }

.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }

/* ============ Janela de diálogo ============ */
.modal-wrap { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(10, 25, 60, .45); opacity: 0; transition: opacity .18s ease-out; }
.modal {
  position: relative; width: 100%; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--win); color: var(--ink);
  border: 1px solid #1d4fc0; border-bottom: 0; border-radius: 12px 12px 0 0;
  padding: 0 18px calc(20px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .24s cubic-bezier(.2, .8, .2, 1);
  box-shadow: 0 -10px 40px -10px rgba(0, 0, 0, .4);
}
[data-theme="dark"] .modal { border-color: #4a5160; }
.modal-wrap.open .modal-backdrop { opacity: 1; }
.modal-wrap.open .modal { transform: none; }
.modal-grip { display: none; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0 -18px 16px; padding: 0 8px 0 14px; min-height: 46px;
  position: sticky; top: 0; z-index: 2;
  background: var(--title-bar); color: #fff; border-radius: 11px 11px 0 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
}
.modal-head h2 { font-size: 17px; color: #fff; text-shadow: 0 1px 1px rgba(0, 0, 0, .45); line-height: 1.2; }
.modal-actions { display: flex; gap: 10px; margin-top: 4px; }
.modal-actions .btn { flex: 1; }
.modal-actions.col { flex-direction: column; }
.modal p + .modal-actions { margin-top: 16px; }
.modal p.muted { font-size: 15px; }
@media (min-width: 640px) {
  .modal-wrap { align-items: center; padding: 24px; }
  .modal { max-width: 540px; border: 1px solid #1d4fc0; border-radius: 12px; padding: 0 24px 24px; transform: scale(.97); opacity: 0; transition: transform .18s ease-out, opacity .18s ease-out; max-height: 88dvh; box-shadow: 0 30px 60px -25px rgba(0, 0, 0, .55); }
  .modal-head { margin: 0 -24px 18px; }
  .modal-wrap.open .modal { opacity: 1; }
  .modal.small { max-width: 420px; }
}

/* ============ Balão de aviso (como os da bandeja do XP) ============ */
#toast-root { position: fixed; left: 0; right: 0; bottom: calc(76px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 200; pointer-events: none; padding: 0 14px; }
.toast {
  position: relative; pointer-events: auto;
  background: var(--balloon); color: var(--ink); border: 1px solid var(--balloon-edge);
  padding: 12px 16px; border-radius: 10px; font-size: 14.5px; font-weight: 700;
  display: flex; gap: 16px; align-items: center; max-width: 440px;
  box-shadow: 2px 4px 14px rgba(0, 0, 0, .25);
  transform: translateY(10px); opacity: 0; transition: transform .2s ease-out, opacity .2s ease-out;
}
.toast::after { content: ""; position: absolute; right: 34px; bottom: -8px; width: 14px; height: 14px; background: var(--balloon); border-right: 1px solid var(--balloon-edge); border-bottom: 1px solid var(--balloon-edge); transform: rotate(45deg); }
.toast.show { transform: none; opacity: 1; }
.toast button { color: var(--toast-link); text-decoration: underline; text-underline-offset: 3px; font-weight: 700; }
@media (min-width: 900px) { #toast-root { bottom: 62px; align-items: flex-end; padding-right: 22px; } }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 300; overflow: hidden; }
.confetti i { position: absolute; top: -16px; width: 8px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translate(var(--x), 110vh) rotate(var(--r)); } }

/* ============ Tela de entrada (lembra a tela de boas-vindas do XP) ============ */
.auth {
  min-height: 100dvh; display: grid; place-items: center;
  padding-block: 90px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  background:
    linear-gradient(180deg, #00309c 0 64px, #f5a742 64px 66px, transparent 66px calc(100% - 66px), #f5a742 calc(100% - 66px) calc(100% - 64px), #00309c calc(100% - 64px)),
    radial-gradient(ellipse 60% 50% at 30% 40%, #7a9cec 0%, transparent 70%),
    linear-gradient(180deg, #5a7edc 0%, #4a6fd2 100%);
}
[data-theme="dark"] .auth { background: linear-gradient(180deg, #11151c 0 64px, #4a5160 64px 66px, transparent 66px calc(100% - 66px), #4a5160 calc(100% - 66px) calc(100% - 64px), #11151c calc(100% - 64px)), linear-gradient(180deg, #232934, #1a1f27); }
.auth-card { width: 100%; max-width: 420px; background: var(--win); color: var(--ink); border: 1px solid #1d4fc0; border-radius: 12px; padding: 28px 24px; box-shadow: 0 24px 50px -24px rgba(0, 0, 0, .6); display: flex; flex-direction: column; gap: 18px; text-align: center; }
[data-theme="dark"] .auth-card { border-color: #4a5160; }
.auth-card .form { text-align: left; }
.auth-logo { width: 76px; height: 76px; border-radius: 18px; margin: 0 auto; box-shadow: 0 4px 12px rgba(10, 40, 110, .35); }
.auth-card h1 { font-size: 30px; font-style: italic; color: var(--head-ink); margin-bottom: 6px; }
.auth-card p.muted { font-size: 15px; }
.auth-card .seg { padding: 0; }
.auth-msg { font-size: 14px; font-weight: 700; }
.auth-msg:empty { display: none; }
.auth-msg.err { color: var(--neg); }
.auth-msg.ok { color: var(--pos); }
.auth-links { display: flex; flex-direction: column; gap: 10px; }
.auth-links button { color: var(--link); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--rule); border-top-color: var(--select); margin: 4px auto; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

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