:root {
  --ink: #0f1c1c;
  --muted: #6b7b7b;
  --line: #e2ebe8;
  --soft: #f3f7f6;
  --card: #ffffff;
  --primary: #0f766e;
  --primary-dark: #0b5c56;
  --primary-soft: #e6f4f1;
  --danger: #b42318;
  --shadow: 0 1px 2px rgba(15, 28, 28, .04), 0 12px 32px rgba(15, 28, 28, .06);
  --radius: 18px;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--soft); color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }

/* ---------- Public / auth ---------- */
.public { min-height: 100vh; width: min(100%, 1100px); margin: auto; padding: 26px 20px; }
.public-brand, .brand { display: flex; align-items: center; gap: 11px; }
.public-brand { font-size: 19px; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; font-weight: 800; font-size: 22px; flex: none; }
.auth { display: grid; place-items: center; min-height: calc(100vh - 90px); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px; width: min(100%, 440px); }
h1 { font-size: 27px; letter-spacing: -.035em; margin: 0 0 8px; }
h2 { font-size: 19px; letter-spacing: -.02em; margin: 0 0 7px; }
.muted { color: var(--muted); line-height: 1.55; margin: 0 0 22px; }
.stack { display: grid; gap: 15px; }
.field { display: grid; gap: 7px; border: 0; padding: 0; margin: 0; }
.field label { font-size: 13px; font-weight: 650; }
.field small { color: var(--muted); font-size: 12px; }
.field input, .field select { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; font: inherit; background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.field input:focus, .field select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px #0f766e1f; }
.btn { border: 0; border-radius: 12px; padding: 13px 18px; background: var(--primary); color: #fff; font: inherit; font-weight: 700; cursor: pointer; text-align: center; transition: background .15s, transform .05s; }
.btn:hover { background: var(--primary-dark); }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: var(--primary-soft); color: var(--primary-dark); }
.btn.secondary:hover { background: #d6ebe6; }
.link { color: var(--primary); font-weight: 700; }
.hint { text-align: center; color: var(--muted); font-size: 13px; }
.alert { padding: 13px 15px; border-radius: 12px; margin: 0 0 16px; font-size: 14px; }
.alert.success { background: #dcfce7; color: #166534; }
.alert.error { background: #fee2e2; color: #991b1b; }
.alert.warning { background: #fef3c7; color: #92400e; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 252px; background: #fff; border-right: 1px solid var(--line); padding: 24px 16px; display: flex; flex-direction: column; gap: 26px; }
.brand-text strong { display: block; font-size: 15px; }
.brand-text small { display: block; color: var(--muted); font-size: 11px; margin-top: 1px; }
.nav { display: grid; gap: 4px; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 11px; color: var(--muted); font-size: 14px; font-weight: 550; transition: background .15s, color .15s; }
.nav-link svg { width: 18px; height: 18px; flex: none; }
.nav-link:hover { background: #f0f6f4; color: var(--ink); }
.nav-link.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 750; }
.logout { margin-top: auto; padding: 12px; border-radius: 11px; color: var(--muted); font-size: 14px; }
.logout:hover { background: #fdeceA; color: var(--danger); }
.main { flex: 1; min-width: 0; }
.top { height: 70px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 0 32px; position: sticky; top: 0; z-index: 5; }
.top-title { font-weight: 750; font-size: 15px; }
.menu { display: none; background: none; border: 0; font-size: 20px; cursor: pointer; color: var(--ink); }
.user-name { margin-left: 12px; color: var(--muted); font-weight: 600; font-size: 13px; }
.top-spacer { margin-left: auto; }
.top-icon { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--soft); border: 0; cursor: pointer; font-size: 16px; position: relative; color: inherit; flex: none; }
.top-icon:hover { background: #e6efec; }
.top-icon b { position: absolute; top: -4px; right: -4px; background: var(--danger); color: #fff; font-size: 10px; border-radius: 99px; padding: 1px 5px; }
.chat-actions { display: flex; gap: 8px; }
.chip-install { margin-left: auto; border: 1px solid var(--line); background: var(--primary-soft); color: var(--primary-dark); font: inherit; font-size: 12.5px; font-weight: 700; padding: 8px 12px; border-radius: 10px; cursor: pointer; }
.chip-install:hover { background: #d6ebe6; }
.chip-install + .user-name { margin-left: 12px; }
.page { width: min(100%, 1120px); margin: auto; padding: 30px; }

/* ---------- Dashboard ---------- */
.welcome { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; }
.welcome h1 { font-size: 30px; }
.welcome .muted { margin: 4px 0 0; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.metric { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.metric small { color: var(--muted); display: block; margin-bottom: 10px; font-size: 12px; }
.metric strong { font-size: 21px; letter-spacing: -.02em; }
.metric.primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; border-color: transparent; }
.metric.primary small { color: #bdeae4; }
.empty { background: #fff; border: 1px dashed #bcd3ce; border-radius: 16px; padding: 34px; text-align: center; margin-top: 18px; }
.empty p { color: var(--muted); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 18px; padding-bottom: 2px; }
.tabs a { padding: 9px 15px; border-radius: 10px; font-size: 13px; font-weight: 650; color: var(--muted); white-space: nowrap; border: 1px solid transparent; }
.tabs a:hover { background: #f0f6f4; color: var(--ink); }
.tabs a.active { background: #fff; color: var(--primary-dark); border-color: var(--line); box-shadow: var(--shadow); }

/* ---------- Content blocks ---------- */
.two-col { display: grid; grid-template-columns: minmax(260px, 380px) 1fr; gap: 18px; align-items: start; }
.two-col .card { width: auto; }
.list { display: grid; gap: 4px; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 13px 0; }
.list-row:last-child { border-bottom: 0; }
.list-row small { color: var(--muted); display: block; margin-top: 2px; }
.form-card { max-width: 700px; width: 100%; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.actions { display: flex; justify-content: flex-end; gap: 10px; }
.filters, .table-card { width: 100%; padding: 18px; margin-bottom: 18px; }
.filter-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr auto; gap: 10px; }
.filter-grid input, .filter-grid select { border: 1px solid var(--line); border-radius: 11px; padding: 11px; font: inherit; color: var(--ink); min-width: 0; background: #fff; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; min-width: 720px; }
th, td { text-align: left; padding: 13px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
td small { display: block; color: var(--muted); margin-top: 3px; }
.tag { display: inline-block; padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.tag.income, .amount.income { color: #18794e; }
.tag.income { background: #dcfce7; }
.tag.expense { color: var(--danger); background: #fee2e2; }
.amount { font-weight: 750; white-space: nowrap; }
.row-actions { display: flex; gap: 12px; align-items: center; }
.row-actions a { color: var(--primary); font-weight: 700; font-size: 13px; }
.row-actions form { margin: 0; }
.row-actions button { background: none; border: 0; padding: 0; color: var(--danger); font: inherit; font-size: 13px; cursor: pointer; }
.center { text-align: center; }

/* ---------- Cards / goals / misc ---------- */
.card-item { padding: 4px 0 16px; border-bottom: 1px solid var(--line); }
.card-item:last-child { border-bottom: 0; }
.card-item small { color: var(--muted); }
.card-values { display: flex; gap: 24px; color: var(--muted); font-size: 12px; }
.card-values strong { color: var(--ink); font-size: 14px; }
.link-button { border: 0; background: none; color: var(--primary); cursor: pointer; font: inherit; font-size: 13px; font-weight: 650; padding: 4px 0; }
.link-button.danger { color: var(--danger); }
.status-ok { color: #18794e !important; display: block; padding-top: 4px; }
.goal-item { padding: 6px 0 17px; border-bottom: 1px solid var(--line); }
.goal-item:last-child { border-bottom: 0; }
.progress { height: 9px; border-radius: 99px; background: #e5efed; overflow: hidden; margin: 10px 0 7px; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-dark)); border-radius: inherit; }
.goal-item > small { color: var(--muted); }
.goal-add { display: flex; gap: 8px; margin-top: 10px; }
.goal-add input { min-width: 0; flex: 1; border: 1px solid var(--line); border-radius: 9px; padding: 8px; font: inherit; }
.spend-result { width: 100%; max-width: none; margin-top: 18px; }
.spend-result.safe { border-color: #86efac; background: #f0fdf4; }
.spend-result.caution { border-color: #fcd34d; background: #fffbeb; }
.spend-breakdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }
.spend-breakdown span { color: var(--muted); font-size: 12px; background: #ffffffb0; padding: 11px; border-radius: 11px; }
.spend-breakdown strong { display: block; color: var(--ink); font-size: 14px; margin-top: 4px; }
.plan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.plan-card { width: auto; }
.plan-price { font-size: 25px; font-weight: 800; margin: 14px 0; letter-spacing: -.03em; }
.plan-price small { font-size: 12px; color: var(--muted); font-weight: 500; }
.admin-input { width: 120px; border: 1px solid var(--line); border-radius: 9px; padding: 8px; font: inherit; }
.check-row { display: flex; align-items: center; gap: 9px; font-size: 13.5px; cursor: pointer; }
.check-row input { width: 17px; height: 17px; accent-color: var(--primary); }
.ai-assist-card { margin-bottom: 16px; }
.ai-provider-box { border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; gap: 12px; }
.ai-provider-box h2 { font-size: 16px; margin: 0; }
.changelog { margin-top: 8px; }
.changelog summary { cursor: pointer; color: var(--primary); font-size: 12.5px; font-weight: 650; }
.changelog pre { white-space: pre-wrap; font-size: 12px; color: var(--muted); background: var(--soft); padding: 10px; border-radius: 10px; margin: 8px 0 0; }
.ai-result { width: 100%; max-width: none; margin-bottom: 18px; }
.ai-fields { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0; }
.ai-fields div { background: var(--soft); border-radius: 11px; padding: 12px; }
.ai-fields small, .ai-fields strong { display: block; }
.ai-fields small { color: var(--muted); margin-bottom: 5px; }

/* ---------- "Mais" hub ---------- */
.hub-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.hub-card { display: block; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); transition: transform .08s, border-color .15s; }
.hub-card:hover { transform: translateY(-2px); border-color: var(--primary); }
.hub-card .hub-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-dark); margin-bottom: 13px; }
.hub-card .hub-icon svg { width: 21px; height: 21px; }
.hub-card strong { display: block; font-size: 15px; margin-bottom: 3px; }
.hub-card small { color: var(--muted); font-size: 12.5px; line-height: 1.45; }

/* ---------- Chat ---------- */
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.btn-ghost { background: transparent; color: var(--primary); padding: 8px 10px; }
.late { color: var(--danger) !important; }
.chat-wrap { display: flex; flex-direction: column; gap: 14px; }
.chat-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.chat-head h1 { font-size: 26px; }
.chat-head .muted { margin: 4px 0 0; }
.chat-body { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 10px; min-height: 280px; max-height: 56vh; overflow-y: auto; }
.chat-hint { color: var(--muted); font-size: 14px; }
.chat-hint ul { margin: 8px 0 0; padding-left: 18px; }
.chat-hint li { margin: 4px 0; }
.msg { max-width: 88%; padding: 11px 14px; border-radius: 14px; font-size: 14px; line-height: 1.5; }
.msg.user { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-start; background: #f1f5f4; color: var(--ink); border-bottom-left-radius: 4px; }
.msg.bot.err { background: #fee2e2; color: #991b1b; }
.chat-card { margin-top: 10px; display: grid; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.chat-card .form-grid { gap: 10px; }
.chat-done { margin-top: 8px; color: #18794e; font-weight: 700; font-size: 13px; }
.chat-input { display: flex; gap: 8px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 8px; }
.chat-input input[name="text"] { flex: 1; min-width: 0; border: 0; outline: none; padding: 10px; font: inherit; background: transparent; }
.chat-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: var(--soft); cursor: pointer; font-size: 18px; border: 0; flex: none; }
.chat-icon input { display: none; }
.chat-input .btn { padding: 11px 16px; }
@media (max-width: 820px) {
  .chat-body { max-height: 60vh; }
  .chat-input { flex-wrap: wrap; }
}

/* ---------- Bottom nav ---------- */
.bottom { display: none; }

/* ---------- Mobile ---------- */
@media (max-width: 820px) {
  .sidebar { position: fixed; z-index: 40; inset: 0 auto 0 0; width: 252px; transform: translateX(-100%); transition: transform .22s ease; box-shadow: 0 0 60px #0000001a; }
  .sidebar.open { transform: none; }
  .top { padding: 0 18px; }
  .menu { display: block; }
  .page { padding: 20px 16px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .metric { padding: 15px; }
  .metric strong { font-size: 17px; }
  .welcome { display: block; }
  .welcome h1 { font-size: 26px; }
  .two-col, .form-grid { grid-template-columns: 1fr; }
  .ai-fields, .spend-breakdown { grid-template-columns: 1fr 1fr; }
  .plan-grid { grid-template-columns: 1fr; }
  .hub-grid { grid-template-columns: 1fr; }
  .filter-grid { grid-template-columns: 1fr 1fr; }
  .filter-grid input:first-child, .filter-grid .btn { grid-column: 1 / -1; }
  .bottom { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); height: 64px; z-index: 30; justify-content: space-around; align-items: center; padding-bottom: env(safe-area-inset-bottom); }
  .bottom a { display: grid; justify-items: center; gap: 2px; font-size: 10.5px; color: var(--muted); font-weight: 600; min-width: 56px; }
  .bottom a svg { width: 21px; height: 21px; }
  .bottom a.active { color: var(--primary-dark); }
  .bottom .add { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; border-radius: 50%; font-size: 24px; width: 46px; height: 46px; display: grid; place-items: center; margin: 0; box-shadow: 0 6px 16px #0f766e4d; }
  .main { padding-bottom: 88px; }
  .welcome .btn { margin-top: 14px; }
  .chip-install { font-size: 11.5px; padding: 7px 10px; }
  .card { padding: 24px 20px; }
}

/* ---------- Tema escuro ---------- */
html[data-theme="dark"] {
  --ink: #e7efed;
  --muted: #9bb0ad;
  --line: #24332f;
  --soft: #0e1614;
  --card: #16211e;
  --primary: #17a394;
  --primary-dark: #128d80;
  --primary-soft: #12332e;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 32px rgba(0,0,0,.35);
}
html[data-theme="dark"] body { background: var(--soft); color: var(--ink); }
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .top,
html[data-theme="dark"] .bottom,
html[data-theme="dark"] .card,
html[data-theme="dark"] .metric,
html[data-theme="dark"] .chat-body,
html[data-theme="dark"] .chat-input,
html[data-theme="dark"] .hub-card { background: var(--card); border-color: var(--line); }
html[data-theme="dark"] .msg.bot { background: #1d2a27; color: var(--ink); }
html[data-theme="dark"] .chat-card,
html[data-theme="dark"] .ai-fields div { background: #1d2a27; border-color: var(--line); }
html[data-theme="dark"] .nav-link.active { background: var(--primary-soft); color: #7fe3d6; }
html[data-theme="dark"] .tabs a.active { background: var(--card); color: #7fe3d6; }
html[data-theme="dark"] .top-icon { background: var(--soft); }
html[data-theme="dark"] .field input, html[data-theme="dark"] .field select,
html[data-theme="dark"] .filter-grid input, html[data-theme="dark"] .filter-grid select,
html[data-theme="dark"] .admin-input, html[data-theme="dark"] .goal-add input { background: #101a18; color: var(--ink); border-color: var(--line); }
html[data-theme="dark"] .metric.primary { background: linear-gradient(135deg, #17a394, #0f6f66); color: #fff; }
html[data-theme="dark"] .progress { background: #24332f; }
html[data-theme="dark"] .empty { background: var(--card); }

/* ---------- Branding ---------- */
.brand-img { width: 40px; height: 40px; border-radius: 12px; object-fit: contain; flex: none; background: #fff; }

/* ---------- Landing ---------- */
.land { background: #fff; color: var(--ink); }
.land a { color: inherit; }
.land-nav { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 22px; background: #fffffff2; border-bottom: 1px solid var(--line); max-width: 1120px; margin: 0 auto; }
.land-brand { display: flex; align-items: center; gap: 10px; font-size: 17px; }
.land-brand img { width: 36px; height: 36px; object-fit: contain; border-radius: 10px; }
.land-links { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.land-links a { color: var(--muted); font-weight: 600; }
.land-links a:hover { color: var(--ink); }
.land-hero { max-width: 1120px; margin: 0 auto; padding: 56px 22px 34px; display: grid; grid-template-columns: 1.05fr .95fr; gap: 44px; align-items: center; }
.land-badge { display: inline-block; background: var(--primary-soft); color: var(--primary-dark); font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 999px; margin-bottom: 16px; }
.land-hero h1 { font-size: 44px; line-height: 1.1; letter-spacing: -.04em; margin: 0 0 16px; }
.land-hero p { font-size: 17px; color: var(--muted); line-height: 1.6; margin: 0 0 24px; }
.land-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-lg { padding: 15px 24px; font-size: 16px; }
.btn-block { width: 100%; display: block; }
.land-checks { display: flex; gap: 18px; list-style: none; padding: 0; margin: 22px 0 0; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.land-checks li::before { content: "\2713"; color: var(--primary); font-weight: 800; margin-right: 6px; }
.land-hero-card { display: grid; place-items: center; }
.mock { width: 100%; max-width: 380px; background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 30px 70px #0f766e1f; padding: 22px; }
.mock-top { display: flex; gap: 6px; margin-bottom: 18px; }
.mock-top span { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.mock-balance small { color: var(--muted); }
.mock-balance strong { display: block; font-size: 30px; letter-spacing: -.03em; margin-top: 4px; }
.mock-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.mock-grid div { background: var(--soft); border-radius: 12px; padding: 12px; }
.mock-grid small { color: var(--muted); display: block; margin-bottom: 4px; }
.mock-grid b { font-size: 15px; }
.mock-row { display: flex; justify-content: space-between; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14px; }
.mock-row .expense { color: #b42318; }
.mock-row .income { color: #18794e; }
.land-section { max-width: 1120px; margin: 0 auto; padding: 46px 22px; }
.land-section h2 { font-size: 30px; letter-spacing: -.03em; text-align: center; margin: 0 0 10px; }
.land-section-sub { text-align: center; color: var(--muted); margin: 0 0 26px; }
.land-features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; max-width: 760px; margin: 0 auto; }
.land-feature { display: flex; align-items: center; gap: 10px; background: var(--soft); border-radius: 14px; padding: 15px 16px; font-size: 15px; }
.land-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); flex: none; }
.land-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; align-items: start; }
.land-plan { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 26px; box-shadow: var(--shadow); }
.land-plan.featured { border-color: var(--primary); box-shadow: 0 24px 60px #0f766e24; }
.land-tag { position: absolute; top: -12px; left: 26px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; padding: 5px 10px; border-radius: 999px; }
.land-plan h3 { margin: 0 0 12px; font-size: 19px; }
.land-price strong { font-size: 34px; letter-spacing: -.04em; }
.land-price small { color: var(--muted); }
.land-year { color: var(--muted); font-size: 13px; margin: 4px 0 14px; }
.land-plan ul { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 9px; }
.land-plan li { color: var(--muted); font-size: 14px; }
.land-plan li::before { content: "\2713"; color: var(--primary); font-weight: 800; margin-right: 8px; }
.land-faq { max-width: 760px; margin: 0 auto; }
.land-faq details { border: 1px solid var(--line); border-radius: 14px; padding: 15px 18px; margin-bottom: 10px; background: #fff; }
.land-faq summary { cursor: pointer; font-weight: 700; }
.land-faq p { color: var(--muted); margin: 10px 0 0; }
.land-foot { max-width: 1120px; margin: 20px auto 0; padding: 26px 22px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.land-foot strong { color: var(--ink); }
.land-foot-links { display: flex; gap: 16px; }
@media (max-width: 880px) {
  .land-hero { grid-template-columns: 1fr; padding-top: 34px; gap: 30px; }
  .land-hero h1 { font-size: 32px; }
  .land-links a:not(.btn) { display: none; }
  .land-features { grid-template-columns: 1fr; }
}
html[data-theme="dark"] .land,
html[data-theme="dark"] .land-nav,
html[data-theme="dark"] .land-plan,
html[data-theme="dark"] .land-faq details { background: var(--card); }

/* ---------- Calendário / Agenda ---------- */
.cal { background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); margin: 18px 0; overflow: hidden; }
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.cal-head strong { font-size: 16px; }
.cal-nav { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--soft); color: var(--ink); font-size: 20px; font-weight: 700; }
.cal-nav:hover { background: var(--primary-soft); color: var(--primary-dark); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-dow { padding: 10px 6px; text-align: center; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--soft); }
.cal-cell { position: relative; min-height: 78px; padding: 8px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; color: inherit; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.blank { background: #fafcfb; }
.cal-cell:hover { background: var(--soft); }
.cal-cell.today { background: var(--primary-soft); }
.cal-cell.overdue { background: #fef2f2; }
.cal-cell.selected { outline: 2px solid var(--primary); outline-offset: -2px; }
.cal-num { font-size: 13px; font-weight: 700; }
.cal-cell.today .cal-num { color: var(--primary-dark); }
.cal-dots { display: flex; gap: 4px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.pay { background: #b42318; }
.dot.rec { background: #18794e; }
.dot.rem { background: #d97706; }
.cal-mini { display: grid; gap: 1px; margin-top: auto; }
.cal-mini small { font-size: 10.5px; font-weight: 700; line-height: 1.2; }
.cal-mini .pay { color: #b42318; }
.cal-mini .rec { color: #18794e; }
.cal-legend { display: flex; gap: 18px; padding: 12px 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.income { color: #18794e; }
@media (max-width: 820px) {
  .cal-cell { min-height: 62px; padding: 6px; }
  .cal-mini { display: none; }
}
html[data-theme="dark"] .cal { background: var(--card); }
html[data-theme="dark"] .cal-cell.blank { background: #121b19; }
html[data-theme="dark"] .cal-cell:hover { background: #1d2a27; }
html[data-theme="dark"] .cal-cell.overdue { background: #3a1d1d; }

/* ---------- Agenda: mover e agendar ---------- */
.cal-cell { position: relative; }
.cal-day { font-size: 13px; font-weight: 700; color: inherit; }
.cal-cell.today .cal-day { color: var(--primary-dark); }
.cal-add { position: absolute; top: 4px; right: 5px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: var(--primary-soft); color: var(--primary-dark); font-size: 15px; font-weight: 800; line-height: 1; opacity: 0; transition: opacity .15s; }
.cal-cell:hover .cal-add { opacity: 1; }
.cal-cell.drop { background: var(--primary-soft); outline: 2px dashed var(--primary); outline-offset: -2px; }
.drag { cursor: grab; }
.drag.dragging { opacity: .45; }
.move { display: inline-block; }
.move summary { cursor: pointer; color: var(--primary); font-size: 12px; font-weight: 650; list-style: none; }
.move summary::-webkit-details-marker { display: none; }
.move form { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.move input[type="date"] { border: 1px solid var(--line); border-radius: 8px; padding: 5px; font: inherit; font-size: 12px; background: #fff; color: var(--ink); }
@media (max-width: 820px) { .cal-add { opacity: 1; } }
html[data-theme="dark"] .move input[type="date"] { background: #101a18; }

/* ---------- Agenda: contagem e painel do dia ---------- */
.cal-count { display: none; }
.sheet-bg { position: fixed; inset: 0; background: #0f172a66; z-index: 50; display: none; align-items: flex-end; justify-content: center; }
.sheet-bg.open { display: flex; }
.sheet { width: 100%; max-width: 560px; background: var(--card); border-radius: 20px 20px 0 0; padding: 18px; box-shadow: 0 -20px 50px #00000024; max-height: 82vh; overflow-y: auto; display: grid; gap: 12px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head strong { font-size: 17px; }
.sheet-x { border: 0; background: var(--soft); width: 34px; height: 34px; border-radius: 10px; cursor: pointer; font: inherit; color: var(--ink); }
.sheet-body { display: grid; gap: 8px; }
.sheet-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--soft); border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.sheet-row .dotmark { width: 8px; height: 8px; border-radius: 50%; }
.sheet-row.expense { border-left: 4px solid #b42318; }
.sheet-row.income { border-left: 4px solid #18794e; }
.sheet-row.rem { border-left: 4px solid #d97706; }
.sheet-row b { white-space: nowrap; }
@media (max-width: 820px) {
  .cal-cell { min-height: 58px; padding: 5px; }
  .cal-mini { display: none; }
  .cal-count { display: grid; place-items: center; position: absolute; bottom: 4px; left: 4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 10.5px; font-weight: 800; }
  .cal-dots { display: none; }
  .cal-day { font-size: 14px; }
}
html[data-theme="dark"] .sheet-row { background: #1d2a27; }

/* ---------- Ajustes finais de layout ---------- */
.form-card { margin-left: auto; margin-right: auto; }
.cal-legend { justify-content: center; }
.list-row > span,
.sheet-row span { min-width: 0; overflow-wrap: anywhere; }
.hub-grid, .plan-grid { justify-content: center; }
@media (max-width: 820px) {
  .bottom { justify-content: space-between; }
  .bottom a { flex: 1 1 0; }
  .bottom .add { flex: 0 0 auto; width: 46px; max-width: 46px; margin: 0 auto; }
  .page { padding-bottom: 18px; }
  .cal-legend { gap: 12px; font-size: 11.5px; }
}

/* ---------- Agenda: titulo centralizado ---------- */
.cal-title { display: grid; gap: 2px; text-align: center; }
.cal-title strong { font-size: 16px; }
.cal-today { font-size: 11.5px; font-weight: 700; color: var(--primary); }

/* ---------- Centralizacao final ---------- */
.land-foot { flex-direction: column; align-items: center; text-align: center; }
.land-foot-links { justify-content: center; }
.cal, .card.table-card, .card.filters, .card.form-card { margin-left: auto; margin-right: auto; }
.top-icon { text-decoration: none; }
@media (min-width: 821px) {
  .welcome .actions, .welcome > .btn, .welcome > div { align-self: center; }
}

/* ---------- Offline / sincronizacao ---------- */
.sync-banner { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; border-radius: 12px; padding: 10px 14px; margin: 0 0 14px; font-size: 13.5px; font-weight: 650; }
.msg.pending { opacity: .7; font-style: italic; }
@media (max-width: 480px) {
  .chip-install { display: none; }
  .top-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
html[data-theme="dark"] .sync-banner { background: #3a2f10; color: #fcd34d; border-color: #6b5518; }
