:root, :root[data-theme="dark"] {
  --bg: #060a13;
  --panel: #0e1422;
  --panel-2: #131b2c;
  --panel-3: #18223a;
  --border: #1d2840;
  --border-2: #26334f;
  --text: #e6ebf5;
  --muted: #8b98b3;
  --faint: #5c6884;
  --primary: #3b82f6;
  --primary-2: #2563eb;
  --primary-soft: rgba(59,130,246,.14);
  --green: #22c55e;
  --green-soft: rgba(34,197,94,.13);
  --red: #ef4444;
  --red-soft: rgba(239,68,68,.13);
  --amber: #f59e0b;
  --amber-soft: rgba(245,158,11,.14);
  --purple: #a78bfa;
  --cyan: #22d3ee;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius: 14px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f3f6fb;
  --panel: #ffffff;
  --panel-2: #f6f8fc;
  --panel-3: #eef2f9;
  --border: #e3e8f2;
  --border-2: #d4dbe8;
  --text: #0f172a;
  --muted: #5d6b85;
  --faint: #94a0b8;
  --primary-soft: rgba(59,130,246,.10);
  --green: #16a34a;
  --green-soft: rgba(22,163,74,.10);
  --red: #dc2626;
  --red-soft: rgba(220,38,38,.09);
  --amber: #d97706;
  --amber-soft: rgba(217,119,6,.11);
  --shadow: 0 10px 30px rgba(15,23,42,.10);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.green { color: var(--green); }
.red { color: var(--red); }
.blue { color: var(--primary); }
.amber { color: var(--amber); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* ===== boot / spinner ===== */
.boot { position: fixed; inset: 0; display: grid; place-items: center; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--border-2); border-top-color: var(--primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== brand ===== */
.brand { display: flex; align-items: center; gap: 12px; padding: 18px 16px; border-bottom: 1px solid var(--border); }
.brand strong { display: block; font-size: 14px; }
.brand span { display: block; font-size: 12px; color: var(--muted); }
.brand-logo { width: 38px; height: 38px; border-radius: 10px; background: var(--primary); display: grid; place-items: center; color: #fff; }
.brand-logo svg { width: 20px; height: 20px; }
.brand-lg { border: 0; padding: 0 0 22px; }

/* ===== auth ===== */
.auth { min-height: 100%; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(800px 400px at 50% -10%, var(--primary-soft), transparent 70%), var(--bg); }
.auth-card { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--border); border-radius: 18px; padding: 28px; box-shadow: var(--shadow); }
.auth-card h2 { margin: 0 0 4px; font-size: 20px; }
.auth-card p.lead { margin: 0 0 20px; color: var(--muted); }
.auth-card .field { margin-bottom: 14px; }
.auth-links { display: flex; justify-content: space-between; margin-top: 16px; font-size: 13px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; }
.notice { padding: 12px 14px; border-radius: 10px; background: var(--primary-soft); color: var(--text); font-size: 13px; margin-bottom: 16px; }
.notice.error { background: var(--red-soft); }

/* ===== layout ===== */
.app { display: flex; min-height: 100%; }
.sidebar { width: 248px; flex: none; background: var(--panel); border-right: 1px solid var(--border); position: sticky; top: 0; height: 100vh; overflow-y: auto; transition: margin .2s; z-index: 40; }
.app.collapsed .sidebar { margin-left: -248px; }
.nav { padding: 14px 10px; }
.nav-label { font-size: 12px; color: var(--muted); padding: 6px 8px 8px; font-weight: 600; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: var(--text); font-weight: 500; margin-bottom: 2px; }
.nav a svg { color: var(--muted); width: 17px; height: 17px; }
.nav a:hover { background: var(--panel-2); }
.nav a.active { background: var(--panel-3); font-weight: 600; }
.nav a.active svg { color: var(--primary); }
.nav .badge { margin-left: auto; }
.scrim { display: none; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; height: 58px; display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); }
.topbar h1 { font-size: 16px; margin: 0; font-weight: 600; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.top-month { text-align: right; font-size: 12px; line-height: 1.35; color: var(--muted); }
.top-month b { font-weight: 600; }
.page { width: 100%; max-width: 1280px; margin: 0 auto; padding: 22px 18px 60px; }

@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; margin-left: -260px; box-shadow: var(--shadow); }
  .app.open .sidebar { margin-left: 0; }
  .app.open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 35; }
  .app.collapsed .sidebar { margin-left: -260px; }
  .top-month { display: none; }
  .page { padding: 16px 12px 60px; }
}

/* ===== buttons ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--panel); cursor: pointer; font-weight: 600; font-size: 13.5px; white-space: nowrap; transition: background .15s, border-color .15s, opacity .15s; }
.btn:hover { background: var(--panel-2); }
.btn:disabled { opacity: .55; cursor: default; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-2); }
.btn-danger { background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 55%, transparent); color: var(--red); }
.btn-danger:hover { background: color-mix(in srgb, var(--red) 22%, transparent); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { height: 32px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--border-2); background: var(--panel); cursor: pointer; }
.icon-btn:hover { background: var(--panel-2); }
.icon-btn.ghost { border-color: transparent; background: transparent; }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 8px; }
.icon-btn.sm svg { width: 16px; height: 16px; }
.icon-btn.danger { color: var(--red); }

/* ===== forms ===== */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-weight: 600; font-size: 13px; }
.field .hint { font-size: 12px; color: var(--muted); }
.input, select.input, textarea.input { height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--panel-2); outline: none; width: 100%; min-width: 0; }
textarea.input { height: auto; min-height: 70px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
select.input { appearance: none; padding-right: 32px; 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='%238b98b3' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input-sm { height: 32px; font-size: 13px; border-radius: 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.span-2 { grid-column: span 2; }
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.reveal { padding: 14px; border-radius: 12px; background: var(--primary-soft); border: 1px dashed color-mix(in srgb, var(--primary) 45%, transparent); }
.inline-add { display: flex; gap: 8px; }
@media (max-width: 600px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } .span-2 { grid-column: auto; } }

/* ===== cards ===== */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 18px 20px 14px; }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-head .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.card-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.section-title { margin: 34px 0 14px; display: flex; align-items: baseline; gap: 10px; }
.section-title h2 { margin: 0; font-size: 17px; }
.section-title span { color: var(--muted); font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row-gap { display: grid; gap: 16px; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpis.k5 { grid-template-columns: repeat(5, 1fr); }
.kpi { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 18px 16px; position: relative; overflow: hidden; }
.kpi .label { color: var(--muted); font-size: 13px; }
.kpi .value { font-size: 25px; font-weight: 700; margin: 6px 0 4px; letter-spacing: -.02em; }
.kpi .foot { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.kpi .ico { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; }
.kpi .ico.g { background: var(--green-soft); color: var(--green); }
.kpi .ico.r { background: var(--red-soft); color: var(--red); }
.kpi .ico.b { background: var(--primary-soft); color: var(--primary); }
.kpi .ico.a { background: var(--amber-soft); color: var(--amber); }
.kpi.mini { padding: 14px 16px; }
.kpi.mini .value { font-size: 21px; margin: 4px 0 0; }
.delta { font-weight: 600; font-size: 12px; padding: 1px 6px; border-radius: 6px; }
.delta.up { color: var(--green); background: var(--green-soft); }
.delta.down { color: var(--red); background: var(--red-soft); }
@media (max-width: 1100px) { .kpis, .kpis.k5 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .kpis, .kpis.k5 { grid-template-columns: 1fr 1fr; } .kpi .value { font-size: 20px; } .kpi .ico { display: none; } }

/* period bar */
.period { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.period .title small { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.period .title strong { font-size: 15px; }
.period .controls { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--border); }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
:root[data-theme="light"] .seg button.on { background: #fff; }

/* charts */
.chart-wrap { position: relative; height: 320px; padding: 0 16px 16px; }
.chart-wrap.sm { height: 240px; }
.legend { display: flex; gap: 16px; justify-content: center; font-size: 12.5px; padding: 0 0 16px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.dash-grid { display: grid; grid-template-columns: 1.65fr 1fr; gap: 16px; margin-top: 16px; }
.dash-grid.even { grid-template-columns: 1fr 1fr; }
@media (max-width: 1000px) { .dash-grid, .dash-grid.even { grid-template-columns: 1fr; } }

/* bars list */
.bars { padding: 0 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.bar-row .top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; gap: 10px; }
.bar-row .top span:last-child { color: var(--muted); white-space: nowrap; }
.bar { height: 7px; border-radius: 99px; background: var(--panel-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--primary); }

/* funnel */
.funnel { padding: 4px 20px 20px; display: flex; flex-direction: column; gap: 8px; }
.f-step { display: grid; grid-template-columns: 150px 1fr 90px; align-items: center; gap: 12px; font-size: 13px; }
.f-step .track { height: 30px; background: var(--panel-2); border-radius: 8px; position: relative; }
.f-step .fill { position: absolute; inset: 0 auto 0 0; border-radius: 8px; display: flex; align-items: center; padding-left: 10px; font-weight: 700; color: #fff; min-width: 34px; }
.f-step .rate { text-align: right; color: var(--muted); font-size: 12px; }
@media (max-width: 600px) { .f-step { grid-template-columns: 100px 1fr 54px; } }

/* list items */
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 12px; padding: 13px 20px; border-top: 1px solid var(--border); }
.li .main-t { font-weight: 600; }
.li .sub { font-size: 12.5px; color: var(--muted); }
.li .end { margin-left: auto; text-align: right; display: flex; align-items: center; gap: 12px; }
.empty { padding: 30px 20px; text-align: center; color: var(--muted); }

/* tables */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--panel-2); }
.tbl .t-sub { font-size: 12px; color: var(--muted); }
.tbl td.money { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
.tbl th.money { text-align: right; }
.tbl .acts { display: flex; gap: 4px; justify-content: flex-end; }
.tbl th:first-child, .tbl td:first-child { padding-left: 20px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 16px; }
.pager { display: flex; align-items: center; gap: 6px; padding: 12px 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.pager .info { font-size: 12.5px; color: var(--muted); margin-right: auto; }
.pager button { min-width: 32px; height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--border-2); background: var(--panel); cursor: pointer; font-weight: 600; font-size: 12.5px; }
.pager button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager button:disabled { opacity: .45; cursor: default; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; background: var(--panel-3); color: var(--text); white-space: nowrap; }
.badge.blue { background: var(--primary-soft); color: var(--primary); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.purple { background: rgba(167,139,250,.14); color: var(--purple); }
.status-select { height: 32px; border-radius: 8px; font-size: 12.5px; font-weight: 600; min-width: 128px; }

/* ===== CRM ===== */
.crm-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.crm-head h2 { margin: 0; font-size: 19px; }
.crm-head p { margin: 2px 0 0; color: var(--muted); }
.crm-head .actions { margin-left: auto; display: flex; gap: 8px; }
.crm-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.crm-tools .search { position: relative; }
.crm-tools .search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 15px; height: 15px; }
.crm-tools .search input { padding-left: 32px; width: 230px; }
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(268px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.col { background: var(--panel); border: 1px solid var(--border); border-top: 3px solid var(--c, var(--primary)); border-radius: 12px; display: flex; flex-direction: column; max-height: calc(100vh - 250px); min-height: min(420px, calc(100vh - 250px)); }
.col-head { padding: 12px 12px 8px; }
.col-head .t { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.col-head .count { margin-left: auto; min-width: 24px; height: 22px; border-radius: 6px; background: var(--panel-3); display: grid; place-items: center; font-size: 12px; font-weight: 700; padding: 0 6px; }
.col-head .sum { font-size: 12px; color: var(--muted); margin-top: 2px; min-height: 16px; }
.col-body { padding: 4px 8px 10px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 8px; min-height: 80px; }
.col-empty { text-align: center; color: var(--faint); font-size: 12.5px; padding: 18px 0; pointer-events: none; }
.lead-card { background: var(--panel-2); border: 1px solid var(--border-2); border-radius: 10px; padding: 11px 12px; cursor: grab; position: relative; transition: border-color .15s, transform .15s; }
.lead-card:hover { border-color: color-mix(in srgb, var(--c, var(--primary)) 60%, var(--border-2)); }
.lead-card .n { font-weight: 600; padding-right: 26px; }
.lead-card .m { font-size: 12.5px; color: var(--muted); }
.lead-card .v { color: var(--green); font-weight: 700; margin-top: 6px; }
.lead-card .tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
.lead-card .meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; margin-top: 8px; }
.lead-card .meta span { display: inline-flex; align-items: center; gap: 4px; }
.lead-card .meta svg { width: 13px; height: 13px; }
.lead-card .menu { position: absolute; top: 8px; right: 6px; }
.lead-card.sortable-ghost { opacity: .35; }
.lead-card.sortable-drag { transform: rotate(2deg); box-shadow: var(--shadow); }
.dropdown { position: fixed; z-index: 90; min-width: 180px; background: var(--panel); border: 1px solid var(--border-2); border-radius: 10px; box-shadow: var(--shadow); padding: 5px; }
.dropdown button, .dropdown a { display: flex; width: 100%; align-items: center; gap: 8px; padding: 8px 10px; border: 0; background: none; cursor: pointer; border-radius: 7px; text-align: left; color: var(--text); font-size: 13px; }
.dropdown button:hover, .dropdown a:hover { background: var(--panel-2); }
.dropdown .danger { color: var(--red); }

/* calendar */
.cal-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; }
.cal-head strong { font-size: 15px; text-transform: capitalize; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--border); }
.cal .dow { padding: 8px; font-size: 12px; color: var(--muted); font-weight: 600; text-align: center; border-bottom: 1px solid var(--border); }
.cal .day { min-height: 108px; padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.cal .day:nth-child(7n) { border-right: 0; }
.cal .day.out { background: var(--panel-2); opacity: .55; }
.cal .day .d { font-size: 12px; font-weight: 600; color: var(--muted); }
.cal .day.today .d { color: #fff; background: var(--primary); border-radius: 6px; width: 22px; height: 22px; display: grid; place-items: center; }
.cal .ev { font-size: 11.5px; padding: 3px 6px; border-radius: 6px; background: var(--primary-soft); color: var(--text); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid var(--primary); }
.cal .ev.fu { background: var(--amber-soft); border-left-color: var(--amber); }
.cal .ev.done { background: var(--green-soft); border-left-color: var(--green); }
@media (max-width: 700px) { .cal .day { min-height: 70px; } .cal .ev { font-size: 10px; padding: 2px 4px; } }

/* ===== modal ===== */
.modal-back { position: fixed; inset: 0; background: rgba(2,6,14,.62); z-index: 80; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 14px 24px; overflow-y: auto; animation: fade .15s; }
.modal { width: 100%; max-width: 640px; background: var(--panel); border: 1px solid var(--border-2); border-radius: 16px; box-shadow: var(--shadow); animation: pop .16s; }
.modal.sm { max-width: 440px; }
.modal.lg { max-width: 900px; }
.modal-head { display: flex; align-items: center; padding: 20px 22px 6px; }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: 12px 22px 8px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 20px; flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99); } }

/* peças usadas */
.parts { display: flex; flex-direction: column; gap: 8px; }
.part-row { display: grid; grid-template-columns: 1fr 80px 100px 32px; gap: 8px; align-items: center; }
.part-row .cost { font-size: 12.5px; text-align: right; color: var(--muted); }
.parts-empty { padding: 10px 12px; border: 1px solid var(--border-2); border-radius: 10px; font-size: 12.5px; color: var(--muted); background: var(--panel-2); }
.calc { display: flex; gap: 18px; flex-wrap: wrap; padding: 12px 14px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--border); font-size: 13px; }
.calc b { font-variant-numeric: tabular-nums; }

/* report */
.rep-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; margin: 14px 0; }
.rep-sum div small { display: block; color: var(--muted); font-size: 12px; }
.rep-sum div b { font-size: 17px; }
.rep-group { margin-bottom: 14px; }
.rep-group h4 { margin: 0 0 6px; font-size: 13.5px; display: flex; justify-content: space-between; }
.rep-scroll { max-height: 46vh; overflow-y: auto; }

/* toasts */
.toasts { position: fixed; bottom: 18px; right: 18px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--panel); border: 1px solid var(--border-2); border-left: 4px solid var(--green); border-radius: 10px; padding: 11px 14px; box-shadow: var(--shadow); font-size: 13.5px; max-width: 340px; animation: pop .2s; }
.toast.error { border-left-color: var(--red); }

/* print: só o relatório */
@media print {
  body * { visibility: hidden !important; }
  #print-area, #print-area * { visibility: visible !important; }
  #print-area { position: absolute; left: 0; top: 0; width: 100%; color: #000; background: #fff; padding: 10px; font-size: 12px; }
  #print-area .tbl td, #print-area .tbl th { border-color: #ccc; color: #000; }
  #print-area .rep-scroll { max-height: none; overflow: visible; }
}
