/* CRM Petricelli Digital — painel administrativo (claro, cores da marca) */
:root {
  --bg: #F6F3FA; --surface: #FFFFFF; --surface-2: #FAF8FD; --sunken: #F1ECF7;
  --ink: #1E1529; --ink-2: #4A4058; --muted: #7A7088; --line: #E9E3F1; --line-2: #DCD3E7;
  --primary: #7C3AED; --primary-ink: #5B21B6; --secondary: #DB2777; --grad: linear-gradient(120deg, #7C3AED, #DB2777);
  --ok: #059669; --ok-bg: #E7F7F0; --warn: #B45309; --warn-bg: #FEF3E2; --bad: #DC2626; --bad-bg: #FDECEC; --info: #2563EB; --info-bg: #EAF1FE;
  --font-h: 'Bricolage Grotesque', 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-b: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r: 14px; --r-sm: 10px;
  --shadow: 0 1px 2px rgb(30 21 41 / .04), 0 8px 24px -12px rgb(30 21 41 / .12);
  --shadow-lg: 0 24px 60px -20px rgb(30 21 41 / .35);
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--ink); font: 14px/1.55 var(--font-b); -webkit-font-smoothing: antialiased; min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.i { width: 1em; height: 1em; flex: none; }
h1, h2, h3 { font-family: var(--font-h); letter-spacing: -0.02em; line-height: 1.15; text-wrap: balance; }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line); padding: 18px 14px; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; background: var(--grad); color: #fff; display: grid; place-items: center; font-family: var(--font-h); font-weight: 700; font-size: 1.05rem; box-shadow: 0 8px 18px -8px #7C3AED; overflow: hidden; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand strong { display: block; font-family: var(--font-h); font-size: 1rem; line-height: 1.1; }
.brand small { color: var(--muted); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }
.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-label { font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--ink-2); font-weight: 500; transition: background .2s, color .2s; }
.nav a .i { font-size: 1.1rem; color: var(--muted); transition: color .2s; }
.nav a:hover { background: var(--sunken); color: var(--ink); }
.nav a.on { background: color-mix(in srgb, var(--primary) 10%, var(--surface)); color: var(--primary-ink); font-weight: 600; }
.nav a.on .i { color: var(--primary); }
.nav a .count { margin-left: auto; font-size: .72rem; font-weight: 700; background: var(--sunken); color: var(--ink-2); padding: 1px 8px; border-radius: 99px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.me { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex: none; }
.me div { min-width: 0; flex: 1; }
.me strong { display: block; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me small { color: var(--muted); font-size: .74rem; }
.main { min-width: 0; padding: 28px clamp(16px, 3vw, 40px) 60px; }
.topbar { display: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: clamp(1.5rem, 2.4vw, 2rem); }
.page-head p { color: var(--muted); margin-top: 4px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 14px; border-radius: 10px; font-weight: 600; font-size: .88rem; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); transition: background .2s, border-color .2s, transform .1s, box-shadow .2s; white-space: nowrap; }
.btn:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--line-2)); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn .i { font-size: 1.05rem; }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 8px 20px -10px #7C3AED; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--sunken); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.btn.sm { padding: 6px 10px; font-size: .8rem; border-radius: 8px; }
.btn.icon { padding: 7px; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; display: inline-grid; place-items: center; color: var(--muted); transition: background .2s, color .2s; }
.icon-btn:hover { background: var(--sunken); color: var(--ink); }
.icon-btn.danger:hover { background: var(--bad-bg); color: var(--bad); }
.icon-btn .i { font-size: 1.05rem; }

/* ---------- cartões ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 1.05rem; }
.card-head p { color: var(--muted); font-size: .82rem; }
.grid { display: grid; gap: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden; }
.kpi .k-label { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); font-weight: 600; }
.kpi .k-ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: .95rem; background: var(--sunken); color: var(--primary); }
.kpi .k-val { font-family: var(--font-h); font-size: 1.55rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi .k-sub { font-size: .78rem; color: var(--muted); }
.kpi.ok .k-ico { background: var(--ok-bg); color: var(--ok); }
.kpi.bad .k-ico { background: var(--bad-bg); color: var(--bad); }
.kpi.warn .k-ico { background: var(--warn-bg); color: var(--warn); }
.two { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
.two > * { min-width: 0; }

/* ---------- tabelas ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: .86rem; }
.t th { text-align: left; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.t td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr { transition: background .15s; }
.t tbody tr.click { cursor: pointer; }
.t tbody tr:hover { background: var(--surface-2); }
.t .right, .t th.right { text-align: right; }
.t .actions { display: flex; gap: 2px; justify-content: flex-end; }
.t .strong { font-weight: 600; }
.t .sub { display: block; color: var(--muted); font-size: .78rem; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.money.in { color: var(--ok); }
.money.out { color: var(--bad); }
.empty { padding: 44px 20px; text-align: center; color: var(--muted); display: grid; justify-items: center; gap: 10px; }
.empty .i { font-size: 2rem; color: var(--line-2); }
.empty strong { color: var(--ink); font-size: 1rem; }

/* ---------- pílulas de status ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: .74rem; font-weight: 700; white-space: nowrap; background: var(--sunken); color: var(--ink-2); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.brand { background: color-mix(in srgb, var(--primary) 12%, white); color: var(--primary-ink); }
.pill.plain::before { display: none; }

/* ---------- filtros ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.search { display: flex; align-items: center; gap: 8px; flex: 1 1 220px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); }
.search input { border: 0; outline: 0; background: none; flex: 1; min-width: 0; }
.search .i { color: var(--muted); }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--sunken); gap: 2px; flex-wrap: wrap; }
.seg button { padding: 6px 12px; border-radius: 8px; font-size: .8rem; font-weight: 600; color: var(--ink-2); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgb(30 21 41 / .1); }
.month-nav { display: inline-flex; align-items: center; gap: 4px; padding: 3px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); }
.month-nav strong { min-width: 130px; text-align: center; font-size: .88rem; }

/* ---------- formulários ---------- */
.form { display: grid; gap: 14px; }
.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: .8rem; font-weight: 600; color: var(--ink-2); }
.field small { color: var(--muted); font-size: .76rem; }
.input, .field input:not([type=checkbox]), .field select, .field textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); outline: 0; transition: border-color .2s, box-shadow .2s; }
.field textarea { resize: vertical; min-height: 84px; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 14%, transparent); }
.prefix { display: flex; align-items: stretch; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: var(--surface); }
.prefix:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 14%, transparent); }
.prefix em { font-style: normal; display: grid; place-items: center; padding: 0 10px; background: var(--sunken); color: var(--muted); font-size: .82rem; white-space: nowrap; }
.prefix input { border: 0 !important; box-shadow: none !important; border-radius: 0 !important; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: .86rem; user-select: none; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 99px; background: var(--line-2); position: relative; transition: background .2s; cursor: pointer; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .2); transition: transform .2s; }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { transform: translateX(16px); }
.section-title { display: flex; align-items: center; gap: 10px; font-family: var(--font-h); font-size: 1rem; font-weight: 700; }
.section-title .i { color: var(--primary); }
.hint { color: var(--muted); font-size: .82rem; }
.callout { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; background: var(--info-bg); color: #1E3A8A; font-size: .86rem; }
.callout.warn { background: var(--warn-bg); color: #7C2D12; }
.callout.ok { background: var(--ok-bg); color: #064E3B; }
.callout .i { font-size: 1.15rem; margin-top: 1px; }
.callout strong { display: block; }

/* ---------- gaveta / modal ---------- */
.overlay { position: fixed; inset: 0; background: rgb(30 21 41 / .4); backdrop-filter: blur(3px); z-index: 80; animation: fade .2s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--surface); z-index: 90; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: slide .28s cubic-bezier(.2,.8,.2,1); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 1.2rem; }
.drawer-body { padding: 20px 22px; overflow-y: auto; flex: 1; }
.drawer-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); flex-wrap: wrap; }
.drawer-foot .spacer { flex: 1; }
.modal { position: fixed; z-index: 95; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(440px, calc(100% - 32px)); background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 22px; display: grid; gap: 14px; animation: pop .22s cubic-bezier(.2,.8,.2,1); }
.modal h2 { font-size: 1.15rem; }
.modal p { color: var(--ink-2); }
.modal .acts { display: flex; justify-content: flex-end; gap: 8px; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@keyframes pop { from { transform: translate(-50%, -46%) scale(.97); opacity: 0; } }

/* ---------- toasts ---------- */
#toasts { position: fixed; z-index: 120; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); display: grid; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 500; box-shadow: var(--shadow-lg); animation: pop2 .25s; max-width: 380px; }
.toast .i { font-size: 1.1rem; color: #6EE7B7; }
.toast.err .i { color: #FCA5A5; }
.toast.out { opacity: 0; transform: translateY(8px); transition: .3s; }
@keyframes pop2 { from { opacity: 0; transform: translateY(8px); } }

/* ---------- gráfico ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font-b); }
.legend { display: flex; gap: 16px; font-size: .8rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ---------- listas compactas ---------- */
.list { display: grid; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .grow strong { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .grow small { color: var(--muted); }
.date-chip { width: 44px; flex: none; text-align: center; border-radius: 10px; background: var(--sunken); padding: 5px 0; line-height: 1.1; }
.date-chip b { display: block; font-family: var(--font-h); font-size: 1.05rem; }
.date-chip small { font-size: .66rem; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.date-chip.late { background: var(--bad-bg); color: var(--bad); }

/* ---------- catálogo ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.cat { padding: 18px; display: flex; flex-direction: column; gap: 10px; transition: opacity .2s; }
.cat.off { opacity: .55; }
.cat-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.cat h3 { font-size: 1.05rem; }
.cat p { color: var(--ink-2); font-size: .86rem; }
.cat .price { font-family: var(--font-h); font-size: 1.35rem; font-weight: 700; }
.cat .price small { font-family: var(--font-b); font-size: .78rem; color: var(--muted); font-weight: 500; }
.cat ul { list-style: none; display: grid; gap: 4px; font-size: .84rem; color: var(--ink-2); }
.cat li { display: flex; gap: 8px; }
.cat li .i { color: var(--ok); margin-top: 3px; }
.cat-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px dashed var(--line); }

/* ---------- editor de orçamento ---------- */
.q-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.q-side { position: sticky; top: 20px; display: grid; gap: 14px; }
.q-block { padding: 20px; display: grid; gap: 14px; }
.lines { display: grid; gap: 10px; }
.line { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.line-top { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.line-grid { display: grid; grid-template-columns: 80px 1fr 170px 100px; gap: 10px; }
.line-tools { display: flex; gap: 2px; }
.total-row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: .9rem; }
.total-row.big { font-family: var(--font-h); font-size: 1.3rem; font-weight: 700; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.total-row span:first-child { color: var(--muted); }
.total-row.big span:first-child { color: var(--ink); }
.link-box { display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 12px; border-radius: 10px; background: var(--sunken); font-size: .8rem; }
.link-box code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--primary-ink); }
.stat-line { display: flex; justify-content: space-between; font-size: .84rem; color: var(--muted); }
.stat-line b { color: var(--ink); font-weight: 600; }
.picker { display: grid; gap: 6px; max-height: 320px; overflow-y: auto; }
.pick { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; text-align: left; transition: border-color .2s, background .2s; }
.pick:hover { border-color: var(--primary); background: var(--surface-2); }
.pick .grow { flex: 1; min-width: 0; }
.pick small { color: var(--muted); display: block; }

/* ---------- contas ---------- */
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.acc { padding: 18px; display: grid; gap: 8px; position: relative; overflow: hidden; }
.acc::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--c, var(--primary)); }
.acc .bal { font-family: var(--font-h); font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- configurações ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; }
.tabs a.on { color: var(--primary-ink); border-color: var(--primary); }
.dns { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; }
.host-status { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(60% 50% at 15% 10%, color-mix(in srgb, #7C3AED 18%, transparent), transparent), radial-gradient(50% 50% at 90% 90%, color-mix(in srgb, #DB2777 16%, transparent), transparent), var(--bg); }
.login-card { width: min(400px, 100%); padding: 32px; display: grid; gap: 14px; }
.login-card .brand-mark { width: 52px; height: 52px; font-size: 1.4rem; border-radius: 15px; }
.login-card h1 { font-size: 1.6rem; }
.login-card p { color: var(--muted); }
.login-err { color: var(--bad); font-weight: 600; font-size: .86rem; min-height: 1.2em; }

/* ---------- relatórios ---------- */
.report { padding: clamp(20px, 4vw, 44px); display: grid; gap: 22px; }
.report-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 2px solid var(--ink); }
.report-head h2 { font-size: 1.6rem; }
.report h3 { font-size: 1.05rem; margin-bottom: 8px; }
.report .kpis { margin: 0; }
.report .kpi { border: 1px solid var(--line); border-radius: 12px; box-shadow: none; }
.bar-cell { display: flex; align-items: center; gap: 10px; }
.bar-cell i { display: block; height: 8px; border-radius: 99px; background: var(--grad); min-width: 2px; }

/* ---------- responsivo ---------- */
@media (max-width: 1100px) { .q-layout { grid-template-columns: 1fr; } .q-side { position: static; } .two { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 70; left: 0; width: 272px; transform: translateX(-100%); transition: transform .3s; box-shadow: var(--shadow-lg); padding-top: max(18px, env(safe-area-inset-top)); }
  .shell.menu .side { transform: none; }
  .shell.menu::after { content: ""; position: fixed; inset: 0; background: rgb(30 21 41 / .35); z-index: 60; }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); padding: max(10px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); border-bottom: 1px solid var(--line); }
  .main { padding-top: 18px; }
  .line-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) { .kpi .k-val { font-size: 1.3rem; } .page-head { align-items: stretch; } .page-actions .btn { flex: 1; } }

/* ---------- impressão (relatórios) ---------- */
@media print {
  body { background: #fff; }
  .side, .topbar, .page-head, .no-print, #toasts { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
  .card { box-shadow: none; border: 0; }
  .report { padding: 0; }
  .t th { background: #f5f5f5 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
