:root {
  --brand: #12a36b; --brand-dark: #0b7d51; --bg: #f2f2ee; --card: #fdfdfb; --ink: #23262b; --muted: #8a8f98;
  --line: #ececea; --green: #1a9a4b; --red: #d6334a; --blue: #2f55d4; --soft: #f1f2ef; --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.04);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }

/* topo */
.top { background: var(--brand); color: #fff; position: sticky; top: 0; z-index: 20; }
.top .wrap { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 28px; height: 56px; padding: 0 16px; }
.logo { font-weight: 700; font-size: 20px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.logo .dot { width: 26px; height: 26px; border-radius: 50%; border: 6px solid #fff; border-right-color: rgba(255,255,255,.45); }
.nav { display: flex; gap: 22px; flex: 1; justify-content: center; }
.nav a { opacity: .9; padding: 16px 0 14px; border-bottom: 3px solid transparent; }
.nav a.on { opacity: 1; font-weight: 600; border-bottom-color: #fff; }
.top .icons { display: flex; gap: 14px; align-items: center; }
.icon-btn { background: none; border: 0; color: inherit; font-size: 20px; padding: 4px; }

main { max-width: 1100px; margin: 0 auto; padding: 22px 16px 120px; }
.panel { background: var(--card); border-radius: var(--radius); padding: 22px 26px; box-shadow: var(--shadow); margin-bottom: 18px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.row { display: flex; align-items: center; gap: 12px; }
.between { justify-content: space-between; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.pos { color: var(--green); } .neg { color: var(--red); } .blue { color: var(--blue); }
h2 { font-size: 18px; margin: 0 0 14px; }
h3 { font-size: 16px; margin: 0 0 10px; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* cabeçalho da visão geral */
.hello { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.hello .big { font-size: 20px; font-weight: 700; margin: 2px 0 14px; }
.kpis { display: flex; gap: 26px; }
.kpis .v { font-size: 19px; font-weight: 700; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { border: 1px solid #dadad6; background: var(--card); border-radius: 10px; padding: 9px 16px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.btn:hover { background: #f6f6f3; }
.btn.dark { background: #2b2d31; color: #fff; border-color: #2b2d31; }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.danger { color: var(--red); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.pill-dot { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; color: #fff; }

.stat { border-left: 4px solid var(--green); padding-left: 14px; margin-bottom: 14px; }
.stat .v { font-size: 22px; font-weight: 700; }

.list-item { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; flex: none; font-size: 15px; }
.avatar.sm { width: 34px; height: 34px; font-size: 15px; }
.cat-ico { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 17px; }
.section-sep { background: var(--soft); border-radius: 8px; text-align: center; padding: 6px; color: var(--muted); font-weight: 600; margin: 12px 0 4px; }
.more { text-align: center; padding-top: 8px; }
.link { color: var(--brand-dark); font-weight: 600; background: none; border: 0; padding: 0; }

/* donut */
.donut-wrap { display: flex; gap: 22px; align-items: center; }
.donut-wrap .legend { flex: 1; }
.empty { text-align: center; padding: 26px 10px; color: var(--muted); }

/* lançamentos */
.month-nav { display: flex; align-items: center; gap: 14px; font-weight: 700; font-size: 17px; }
.month-nav button { border: 0; background: none; font-size: 20px; padding: 2px 8px; color: var(--ink); }
.filters { background: var(--soft); border-radius: 999px; padding: 8px 14px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 18px 0 8px; }
.filters select, .filters input { border: 0; background: transparent; padding: 6px 8px; border-radius: 8px; max-width: 190px; }
.filters input { flex: 1; min-width: 140px; background: #fff; }
.day-head { color: var(--muted); font-size: 13px; padding: 16px 0 4px; border-bottom: 1px solid var(--line); }
.tx { display: grid; grid-template-columns: 38px minmax(0,1fr) minmax(0,220px) 120px 34px; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.tx:hover { background: #fafaf7; }
.tx .desc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx .src { color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; }
.tx .amt { text-align: right; font-weight: 600; }
.paid-btn { border: 0; background: none; font-size: 18px; padding: 0; filter: grayscale(1); opacity: .55; }
.paid-btn.on { filter: none; opacity: 1; }
.badge { font-size: 11px; background: var(--soft); color: var(--muted); border-radius: 6px; padding: 1px 6px; margin-left: 6px; }
.footer-bal { position: sticky; bottom: 0; background: #f7f7f3; border-top: 1px solid var(--line); margin: 0 -26px -22px; padding: 14px 26px; border-radius: 0 0 var(--radius) var(--radius); display: flex; justify-content: flex-end; gap: 28px; }
.footer-bal .v { font-weight: 700; font-size: 17px; text-align: right; }
.alert { background: #fff7ea; border: 1px solid #f6e1b7; color: #8a5a00; border-radius: 12px; padding: 12px 16px; margin-bottom: 14px; cursor: pointer; }

/* abas */
.tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--line); margin: 0 -26px 18px; padding: 0 26px; overflow-x: auto; }
.tabs a { padding: 12px 0; border-bottom: 2px solid transparent; color: #555; white-space: nowrap; }
.tabs a.on { color: var(--brand-dark); border-bottom-color: var(--brand); font-weight: 600; }

.bar { height: 8px; background: #ececea; border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.bar.over > i { background: var(--red); }

/* modal */
.overlay { position: fixed; inset: 0; background: rgba(20,22,25,.45); z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--card); border-radius: 22px; width: 100%; max-width: 500px; max-height: calc(100vh - 32px); overflow: auto; padding: 26px 30px; }
.modal h2 { display: flex; justify-content: space-between; align-items: center; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid #d8d8d3; border-radius: 12px; padding: 12px 14px; background: #fff; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--brand); border-color: transparent; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; margin-bottom: 14px; }
.switch input { display: none; }
.switch i { width: 38px; height: 22px; border-radius: 99px; background: #cfcfca; position: relative; transition: .15s; }
.switch i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .15s; }
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { left: 19px; }
.extras { display: flex; gap: 10px; margin: 6px 0 16px; flex-wrap: wrap; }
.extras button { border: 1px solid #dadad6; background: #fff; border-radius: 99px; padding: 7px 13px; font-size: 13px; }
.extras button.on { border-color: var(--brand); color: var(--brand-dark); background: #effaf4; }
.modal .foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; }
.seg { display: flex; background: var(--soft); border-radius: 12px; padding: 4px; margin-bottom: 14px; }
.seg button { flex: 1; border: 0; background: none; padding: 8px; border-radius: 9px; font-weight: 600; color: #666; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips label { border: 1px solid #dadad6; border-radius: 99px; padding: 4px 10px; font-size: 13px; cursor: pointer; }
.chips input { margin-right: 4px; }

.modal.wide { max-width: 940px; }
.imp-table { max-height: 52vh; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.imp-row { display: grid; grid-template-columns: 26px 70px minmax(0,1fr) 110px 190px; gap: 10px; align-items: center; padding: 7px 10px; border-bottom: 1px solid var(--line); font-size: 14px; }
.imp-row.off { opacity: .45; }
.imp-row select { border: 1px solid #d8d8d3; border-radius: 8px; padding: 5px; background: #fff; max-width: 100%; }
.imp-desc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bulkbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; background: #effaf4; border: 1px solid #bfe8d2; border-radius: 12px; padding: 10px 12px; position: sticky; top: 64px; z-index: 5; }
.bulkbar select.btn { max-width: 190px; }
.tx.picked { background: #effaf4; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #2b2d31; color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 60; }
.fab { position: fixed; right: 20px; bottom: 20px; width: 56px; height: 56px; border-radius: 50%; background: var(--brand); color: #fff; border: 0; font-size: 30px; box-shadow: 0 6px 18px rgba(0,0,0,.18); z-index: 30; display: none; }

table.simple { width: 100%; border-collapse: collapse; }
table.simple td, table.simple th { padding: 10px 6px; border-bottom: 1px solid var(--line); text-align: left; }
table.simple th { color: var(--muted); font-weight: 600; font-size: 13px; }
.right { text-align: right !important; }
.settings { display: grid; grid-template-columns: 210px 1fr; gap: 18px; align-items: start; }
.settings nav a { display: block; padding: 9px 12px; border-radius: 9px; color: #444; }
.settings nav a.on { background: #fff; font-weight: 600; color: var(--brand-dark); }

.login { max-width: 400px; margin: 9vh auto; }

@media (max-width: 860px) {
  .nav { display: none; }
  .grid2, .settings { grid-template-columns: 1fr; }
  .panel { padding: 18px 16px; }
  .tabs, .footer-bal { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
  .footer-bal { margin-bottom: -18px; }
  .tx { grid-template-columns: 34px minmax(0,1fr) 100px 30px; }
  .tx .src { display: none; }
  .tx .sub-mobile { display: block !important; }
  .kpis { gap: 18px; }
  .fab { display: block; bottom: 78px; }
  .bottom-nav { display: flex !important; }
  .top .wrap { gap: 12px; } .top .icons { margin-left: auto; }
  .filters { border-radius: 16px; padding: 8px; }
  .filters select { flex: 1 1 44%; max-width: none; background: #fff; }
  .filters input { flex: 1 1 100%; }
  .footer-bal { bottom: 62px; gap: 18px; justify-content: space-between; }
  .footer-bal .hide-m { display: none; }
  .footer-bal .v { font-size: 15px; }
  .month-nav { font-size: 16px; }
  .imp-row { grid-template-columns: 24px minmax(0,1fr) 92px; }
  .imp-row > span.small { display: none; }
  .imp-row select { grid-column: 2 / 4; }
  .bulkbar { top: 8px; }
  main { padding-bottom: 150px; }
  .donut-wrap { flex-direction: column-reverse; }
  .modal { padding: 22px 18px; border-radius: 18px; }
}
.bottom-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); z-index: 25; justify-content: space-around; padding: 6px 0 10px; }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; font-size: 11px; color: #666; gap: 2px; }
.bottom-nav a span { font-size: 20px; }
.bottom-nav a.on { color: var(--brand-dark); font-weight: 600; }
.sub-mobile { display: none; color: var(--muted); font-size: 12px; }
