/* Qózt Financeiro — layout do print do Rudy (sidebar + cards brancos), cor da marca Qózt (gradiente #e9233a → #ff8948). */
:root {
  --bg: #f6f4f1; --card: #ffffff; --line: #eeeae5; --line2: #f3efea;
  --tx: #1d1b19; --tx2: #6f6a64; --tx3: #a19b94;
  --acc: #f4511e; --acc-2: #ff8948; --acc-3: #e9233a; --acc-soft: #fff2eb; --acc-soft2: #ffe5d8;
  --ok: #16a34a; --ok-soft: #e8f7ee; --bad: #e5383b; --bad-soft: #fdecec; --warn: #f59e0b; --warn-soft: #fff6e0;
  --blue: #2563eb; --gray-soft: #f3f2f0;
  --r: 14px; --sh: 0 1px 2px rgba(30, 20, 10, .04), 0 4px 18px rgba(30, 20, 10, .04);
  --f: "Plus Jakarta Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--tx); font: 14px/1.45 var(--f); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--tx2); }
.small { font-size: 12px; }
.pos { color: var(--ok); } .neg { color: var(--bad); }

/* ---------- casca ---------- */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--card); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand img { width: 40px; height: 40px; }
.brand b { display: block; font-size: 17px; letter-spacing: -.2px; }
.brand span { display: block; font-size: 11.5px; color: var(--tx2); }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #3b3732; font-weight: 500; cursor: pointer; }
.nav a:hover { background: var(--acc-soft); }
.nav a.on { background: var(--acc); color: #fff; box-shadow: 0 6px 14px rgba(244, 81, 30, .28); }
.nav svg { width: 18px; height: 18px; flex: none; }
.nav .sep { height: 1px; background: var(--line); margin: 8px 6px; }
.promo { margin-top: auto; background: linear-gradient(160deg, var(--acc-soft), #fff 70%); border: 1px solid var(--acc-soft2); border-radius: var(--r); padding: 16px; }
.promo b { display: block; font-size: 15px; margin-bottom: 2px; }
.promo .v { font-size: 22px; font-weight: 700; margin: 6px 0 2px; }
.promo p { margin: 0 0 12px; font-size: 12px; color: var(--tx2); }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 16px; padding: 14px 28px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top h2 { margin: 0; font-size: 18px; font-weight: 600; flex: none; }
.search { flex: 1; max-width: 420px; margin: 0 auto; position: relative; }
.search input { width: 100%; border: 1px solid var(--line); background: #fbfaf8; border-radius: 999px; padding: 9px 14px 9px 38px; outline: none; }
.search input:focus { border-color: var(--acc-2); background: #fff; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--tx3); }
.user { display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--acc-3), var(--acc-2)); color: #fff; display: grid; place-items: center; font-weight: 700; }
.user b { display: block; font-size: 13.5px; } .user span { font-size: 12px; color: var(--tx2); }
.iconbtn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; color: #3b3732; }
.iconbtn:hover { background: var(--gray-soft); }
.iconbtn svg { width: 18px; height: 18px; }

.page { padding: 24px 28px 40px; display: flex; flex-direction: column; gap: 18px; }
.hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hello h1 { margin: 0; font-size: 24px; letter-spacing: -.3px; }
.hello p { margin: 2px 0 0; color: var(--tx2); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 14px; cursor: pointer; font-weight: 600; font-size: 13px; }
.btn:hover { border-color: #ddd5cc; }
.btn svg { width: 16px; height: 16px; }
.btn.pri { background: var(--acc); border-color: var(--acc); color: #fff; }
.btn.pri:hover { background: #e2461a; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 12px; font-weight: 600; font-size: 13px; }
.chip svg { width: 16px; height: 16px; }

/* ---------- cards ---------- */
.grid { display: grid; gap: 18px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-73 { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); }
.g-343 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.25fr); }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--sh); border: 1px solid var(--line2); padding: 18px; min-width: 0; }
.card h3 { margin: 0; font-size: 15.5px; font-weight: 600; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.sel { border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; background: #fff; font-size: 12.5px; font-weight: 600; }
.tabs { display: inline-flex; gap: 6px; }
.tabs button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--tx2); }
.tabs button.on { background: var(--acc-soft); border-color: var(--acc-soft2); color: var(--acc); }

.kpi { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; }
.kpi .ic { width: 34px; height: 34px; border-radius: 9px; background: var(--acc-soft); color: var(--acc); display: grid; place-items: center; }
.kpi .ic svg { width: 18px; height: 18px; }
.kpi .hd { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 13px; grid-column: 1 / -1; margin-bottom: 8px; }
.kpi .v { font-size: 26px; font-weight: 700; letter-spacing: -.5px; }
.kpi .d { font-size: 12px; color: var(--tx2); grid-column: 1; }
.kpi .d b { font-weight: 600; }
.kpi .sp { grid-row: 2 / span 2; grid-column: 2; width: 92px; height: 40px; }
.up { color: var(--ok); } .down { color: var(--bad); }

/* gráfico de linha */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: 260px; overflow: visible; }
.chart .ax { font-size: 11px; fill: var(--tx3); }
.chart .gl { stroke: var(--line); stroke-dasharray: 3 4; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--tx2); align-items: center; }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.tip { position: absolute; pointer-events: none; background: var(--acc); color: #fff; font-size: 11.5px; font-weight: 700; padding: 4px 8px; border-radius: 6px; transform: translate(-50%, -130%); white-space: nowrap; display: none; }
.tip.v { display: block; }
.tip small { display: block; font-weight: 500; opacity: .9; }
.strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; background: var(--acc-soft); border-radius: 12px; padding: 12px 14px; margin-top: 12px; }
.strip > div { display: flex; gap: 10px; align-items: center; min-width: 0; }
.strip .ic { color: var(--acc); flex: none; } .strip .ic svg { width: 18px; height: 18px; }
.strip span { display: block; font-size: 11.5px; color: var(--tx2); }
.strip b { display: block; font-size: 14px; }

/* donut */
.donut { display: grid; grid-template-columns: 190px 1fr; gap: 18px; align-items: center; }
.donut svg { width: 190px; height: 190px; }
.donut .c1 { font-size: 17px; font-weight: 700; fill: var(--tx); }
.donut .c2 { font-size: 10px; fill: var(--tx2); letter-spacing: .4px; }
.leg { display: flex; flex-direction: column; gap: 12px; }
.leg > div { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: center; }
.leg i { width: 11px; height: 11px; border-radius: 50%; }
.leg b { font-size: 13px; font-weight: 600; display: block; }
.leg span { font-size: 11.5px; color: var(--tx2); }
.leg em { font-style: normal; font-weight: 700; font-size: 13px; }
.hi { display: flex; gap: 12px; align-items: center; background: var(--acc-soft); border-radius: 12px; padding: 12px 14px; margin-top: 14px; }
.hi .ic { color: var(--acc); } .hi .ic svg { width: 22px; height: 22px; }
.hi span { display: block; color: var(--acc); font-weight: 700; font-size: 12.5px; }
.hi b { font-size: 13px; }

/* listas */
.rank { display: flex; flex-direction: column; gap: 12px; }
.rank > div { display: grid; grid-template-columns: 24px 34px 1fr auto; gap: 10px; align-items: center; }
.rank .n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; }
.rank .av { width: 34px; height: 34px; border-radius: 10px; background: var(--gray-soft); display: grid; place-items: center; font-weight: 700; font-size: 12px; color: var(--tx2); }
.rank b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank span { font-size: 11.5px; color: var(--tx2); }
.rank em { font-style: normal; font-weight: 700; font-size: 13px; }
.gauge { display: flex; flex-direction: column; align-items: center; }
.gauge svg { width: 220px; height: 120px; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; width: 100%; margin-top: 10px; }
.tiles > div { border-radius: 10px; padding: 10px 6px; text-align: center; }
.tiles em { font-style: normal; font-size: 11.5px; font-weight: 700; display: block; }
.tiles b { display: block; font-size: 18px; margin-top: 2px; }
.tiles span { font-size: 11px; color: var(--tx2); }
.t-ok { background: var(--ok-soft); } .t-ok em { color: var(--ok); }
.t-warn { background: var(--warn-soft); } .t-warn em { color: #c27c06; }
.t-bad { background: var(--bad-soft); } .t-bad em { color: var(--bad); }
.t-gray { background: var(--gray-soft); } .t-gray em { color: var(--tx2); }
.ins { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ins > div { padding: 12px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ins > div:nth-child(2n) { border-right: 0; }
.ins > div:nth-last-child(-n+2) { border-bottom: 0; }
.ins span { display: block; font-size: 11.5px; color: var(--tx2); }
.ins b { display: block; font-size: 15px; margin-top: 4px; }
.foot { background: var(--acc-soft); border-radius: 10px; padding: 9px 12px; text-align: center; font-size: 12.5px; color: #8a3a17; margin-top: 12px; }

/* tabelas */
.tbl-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--line); }
table.t { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 12.5px; }
.t th, .t td { padding: 8px 10px; border-bottom: 1px solid var(--line2); white-space: nowrap; text-align: right; }
.t th { background: #fbfaf8; font-weight: 600; color: var(--tx2); position: sticky; top: 0; z-index: 1; font-size: 11.5px; text-transform: uppercase; letter-spacing: .3px; }
.t th:first-child, .t td:first-child { text-align: left; position: sticky; left: 0; background: #fff; z-index: 2; min-width: 250px; max-width: 320px; overflow: hidden; text-overflow: ellipsis; border-right: 1px solid var(--line2); }
.t th:first-child { background: #fbfaf8; z-index: 3; }
.t tr.grp td { background: #fdf7f3; font-weight: 700; cursor: pointer; }
.t tr.grp td:first-child { background: #fdf7f3; }
.t tr.sub td { font-weight: 700; background: #faf8f6; }
.t tr.sub td:first-child { background: #faf8f6; }
.t tr.tot td { font-weight: 800; background: var(--acc-soft); }
.t tr.tot td:first-child { background: var(--acc-soft); }
.t tr.ln td:first-child { padding-left: 26px; }
.t tr.ln { cursor: pointer; }
.t tr.ln:hover td { background: #fffaf7; }
.t td.z { color: #d6d1cb; }
.t td.tc { font-weight: 700; background: #fcfbf9; }
.t .tag { display: inline-block; font-size: 10.5px; font-weight: 700; border-radius: 6px; padding: 2px 6px; margin-left: 6px; vertical-align: 1px; }
.tag.ok { background: var(--ok-soft); color: var(--ok); } .tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.warn { background: var(--warn-soft); color: #c27c06; } .tag.gray { background: var(--gray-soft); color: var(--tx2); } .tag.acc { background: var(--acc-soft); color: var(--acc); }
.t td.pago { background: var(--ok-soft); color: #11632f; font-weight: 600; }
.t td.falta { background: var(--bad-soft); color: var(--bad); }
.t.list td, .t.list th { text-align: left; }
.t.list td.r, .t.list th.r { text-align: right; }
.t.list td:first-child, .t.list th:first-child { min-width: 92px; position: static; border-right: 0; }

/* gerencial (design diferente: extrato em cascata) */
.cascade { display: flex; flex-direction: column; gap: 0; }
.cs { display: grid; grid-template-columns: 34px 1fr minmax(120px, 34%) 130px; gap: 14px; align-items: center; padding: 12px 6px; border-bottom: 1px dashed var(--line); }
.cs .op { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 16px; }
.cs .op.p { background: var(--ok-soft); color: var(--ok); } .cs .op.m { background: var(--bad-soft); color: var(--bad); } .cs .op.e { background: var(--acc); color: #fff; }
.cs b { display: block; font-size: 14px; } .cs span { font-size: 12px; color: var(--tx2); }
.cs .bar { height: 10px; background: var(--gray-soft); border-radius: 6px; position: relative; overflow: hidden; }
.cs .bar i { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 6px; }
.cs .bar i.p { background: linear-gradient(90deg, #4ade80, var(--ok)); } .cs .bar i.m { background: linear-gradient(90deg, #fb7185, var(--bad)); } .cs .bar i.e { background: linear-gradient(90deg, var(--acc-2), var(--acc-3)); }
.cs .v { text-align: right; font-weight: 700; font-size: 15px; }
.cs.res { background: linear-gradient(90deg, var(--acc-soft), #fff); border-radius: 12px; border-bottom: 0; margin: 6px 0; padding: 14px 10px; }
.cs.res b { font-size: 15px; } .cs.res .v { font-size: 18px; }
.bars svg { width: 100%; height: 220px; display: block; overflow: visible; }

/* gaveta de transações */
.drawer-bg { position: fixed; inset: 0; background: rgba(20, 12, 6, .28); z-index: 20; display: none; }
.drawer-bg.v { display: block; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100%); background: #fff; z-index: 21; box-shadow: -10px 0 40px rgba(0, 0, 0, .12); transform: translateX(105%); transition: transform .2s ease; display: flex; flex-direction: column; }
.drawer.v { transform: none; }
.drawer .dh { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; gap: 12px; }
.drawer .dh h3 { margin: 0; font-size: 16px; } .drawer .dh p { margin: 2px 0 0; font-size: 12.5px; color: var(--tx2); }
.drawer .db { overflow: auto; padding: 14px 20px 30px; flex: 1; }
.rc { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.rc select, .rc input { border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font-size: 12px; background: #fff; }
.rc input { width: 190px; }
.rc .btn { padding: 5px 10px; }
.mark { color: var(--acc); font-weight: 700; }
.empty { padding: 30px; text-align: center; color: var(--tx2); }
.note { font-size: 12.5px; color: var(--tx2); background: #fbfaf8; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }

.emp { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.emp .card h4 { margin: 0 0 2px; font-size: 14px; } .emp .card p { margin: 6px 0 0; font-size: 12.5px; color: var(--tx2); }
.emp .row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 20% 10%, var(--acc-soft), transparent 50%), var(--bg); }
.login { width: min(400px, 100%); }
.login img { height: 46px; margin-bottom: 14px; }
.login h1 { margin: 0 0 4px; font-size: 20px; }
.login input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; margin-top: 10px; outline: none; }
.login input:focus { border-color: var(--acc-2); }
.login .btn { width: 100%; justify-content: center; margin-top: 14px; padding: 11px; }
.erro { color: var(--bad); font-size: 13px; min-height: 18px; margin: 10px 0 0; }

@media (max-width: 1200px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-73, .g-343 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; overflow-x: auto; padding: 10px; gap: 4px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0 8px 0 0; } .brand div, .promo, .nav .sep { display: none; }
  .nav { display: flex; gap: 4px; } .nav a { white-space: nowrap; padding: 8px 10px; }
  .top { padding: 10px 16px; position: static; } .search { display: none; } .user div { display: none; }
  .page { padding: 16px 16px 30px; }
  .g4, .g3, .g2 { grid-template-columns: 1fr; }
  .donut { grid-template-columns: 1fr; justify-items: center; }
  .strip { grid-template-columns: 1fr 1fr; }
  .cs { grid-template-columns: 30px 1fr 110px; } .cs .bar { display: none; }
}
[hidden] { display: none !important; }
.prog { height: 12px; background: var(--gray-soft); border-radius: 8px; overflow: hidden; }
.prog i { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--acc-2), var(--ok)); }
.prog-card .card-h { margin-bottom: 10px; }
.hi .grow { flex: 1; }
.rc input.dia { width: 64px; }
.rc input[type=number] { width: 110px; }
.regime { display: inline-flex; background: var(--gray-soft); border-radius: 999px; padding: 3px; gap: 2px; flex: none; }
.regime button { border: 0; background: transparent; border-radius: 999px; padding: 6px 12px; font-size: 12.5px; font-weight: 600; color: var(--tx2); cursor: pointer; }
.regime button.on { background: #fff; color: var(--acc); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
@media (max-width: 900px) { .regime button { padding: 5px 9px; } }
