/* ============================================================
   CRM Comercial Inteligente — tema visual 2.0
   ============================================================ */
:root {
  --primary: #2a78d6; --primary-dark: #1c5cab; --primary-light: #dcebfc; --primary-soft: #eef5fd;
  --good: #0a7a2f; --good-bg: #e5f5ea; --bad: #d03b3b; --bad-bg: #fceceb;
  --warn: #b97e00; --warn-bg: #fdf3dd;
  --ink: #14171c; --sec: #4d5560; --muted: #8b929c;
  --surface: #ffffff; --page: #f2f4f7; --border: #e6e8ec; --border-strong: #cfd4db;
  --sidebar-bg: #101c30; --sidebar-bg2: #16263f; --sidebar-ink: #aebdd2;
  --radius: 14px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .05);
  --shadow-lg: 0 8px 24px rgba(16, 24, 40, .12);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body { font-family: var(--font); background: var(--page); color: var(--ink); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
#app { height: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h2 { font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
h3 { font-size: 12.5px; font-weight: 600; color: var(--sec); margin-bottom: 14px; text-transform: uppercase; letter-spacing: .06em; }
.ic { vertical-align: -3px; flex: none; }

/* ---------- inputs ---------- */
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 8px 12px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
textarea { width: 100%; resize: vertical; }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--sec); font-weight: 500; }
label.f input, label.f select, label.f textarea { font-weight: 400; }

/* ---------- botões ---------- */
.btn { font: inherit; font-weight: 600; border: none; border-radius: var(--radius-sm); padding: 9px 16px; cursor: pointer; transition: all .15s; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; justify-content: center; }
.btn-primary { background: linear-gradient(180deg, #3585e3, var(--primary)); color: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.15), inset 0 1px 0 rgba(255,255,255,.15); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: var(--surface); color: var(--sec); border: 1px solid var(--border-strong); }
.btn-ghost:hover { color: var(--ink); border-color: var(--muted); }
.btn-whats { background: #17a06e; color: #fff; }
.btn-whats:hover { filter: brightness(.93); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-logout { padding: 8px 10px; }
.icon-btn { background: none; border: none; cursor: pointer; color: var(--muted); padding: 5px 6px; border-radius: 8px; display: inline-flex; align-items: center; transition: all .12s; }
.icon-btn:hover { background: var(--page); color: var(--ink); }
.icon-btn.ib-whats:hover { color: #17a06e; background: #e6f6f0; }
.icon-btn.ib-danger:hover { color: var(--bad); background: var(--bad-bg); }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(1100px 600px at 15% -10%, #23446e 0%, #101c30 55%, #0b1422 100%); padding: 20px; }
.login-card { background: var(--surface); border-radius: 20px; padding: 40px 34px; width: 100%; max-width: 400px; box-shadow: 0 24px 80px rgba(0,0,0,.45); display: flex; flex-direction: column; gap: 14px; }
.login-card h1 { font-size: 20px; text-align: center; letter-spacing: -.02em; }
.login-sub { text-align: center; color: var(--muted); font-size: 13px; margin-top: -8px; }
.login-logo { width: 58px; height: 58px; border-radius: 16px; background: linear-gradient(135deg, #3585e3, var(--primary-dark)); color: #fff; font-weight: 800; font-size: 22px; display: flex; align-items: center; justify-content: center; margin: 0 auto; box-shadow: 0 8px 20px rgba(42,120,214,.4); }
.login-card label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--sec); }
.login-demo { background: var(--primary-soft); border: 1px solid var(--primary-light); border-radius: 12px; padding: 12px 14px; font-size: 12px; color: var(--sec); display: flex; flex-direction: column; gap: 3px; }
.login-demo strong { color: var(--primary-dark); }

/* ---------- shell ---------- */
.shell { display: flex; height: 100vh; }
.sidebar { width: 236px; flex: none; background: linear-gradient(180deg, var(--sidebar-bg2), var(--sidebar-bg) 40%); color: var(--sidebar-ink); display: flex; flex-direction: column; padding: 18px 14px 14px; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand-logo { width: 36px; height: 36px; flex: none; border-radius: 10px; background: linear-gradient(135deg, #3585e3, var(--primary-dark)); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 14px; box-shadow: 0 4px 12px rgba(42,120,214,.35); }
.brand-name { font-weight: 700; color: #fff; font-size: 13.5px; line-height: 1.25; letter-spacing: -.01em; }
.sidebar nav { display: flex; flex-direction: column; gap: 3px; flex: 1; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 11px; color: var(--sidebar-ink); padding: 9px 12px; border-radius: 10px; font-weight: 500; font-size: 13.5px; transition: all .12s; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav-item.active { background: linear-gradient(180deg, #3585e3, var(--primary)); color: #fff; box-shadow: 0 4px 12px rgba(42,120,214,.35); }
.nav-icon { display: inline-flex; opacity: .9; }
.nav-badge { margin-left: auto; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 1px 7px; }
.sidebar-foot { border-top: 1px solid rgba(255,255,255,.1); padding-top: 14px; display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.sidebar-foot .btn-ghost { background: transparent; color: var(--sidebar-ink); border-color: rgba(255,255,255,.18); }
.sidebar-foot .btn-ghost:hover { color: #fff; border-color: rgba(255,255,255,.4); }
.user-chip { display: flex; align-items: center; gap: 9px; min-width: 0; }
.avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; background: linear-gradient(135deg, #3585e3, var(--primary-dark)); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.user-nome { font-size: 12.5px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 108px; }
.user-perfil { font-size: 11px; color: var(--sidebar-ink); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 12px 26px; background: var(--surface); border-bottom: 1px solid var(--border); }
.hamburger { display: none; background: none; border: none; font-size: 20px; cursor: pointer; color: var(--ink); }
.gsearch { position: relative; flex: 1; max-width: 460px; }
.gsearch-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); display: inline-flex; pointer-events: none; }
.gsearch input { width: 100%; background: var(--page); border-color: transparent; padding-left: 36px; border-radius: 99px; }
.gsearch input:focus { background: var(--surface); border-color: var(--primary); }
#gsearch-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); z-index: 60; overflow: hidden; }
#gsearch-results:empty { display: none; }
.gs-item { padding: 10px 14px; cursor: pointer; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gs-item:hover { background: var(--primary-soft); }
.content { flex: 1; overflow-y: auto; padding: 24px 26px 44px; }

/* ---------- páginas ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.filters-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card-wide { grid-column: 1 / -1; }
.onboard { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; background: linear-gradient(120deg, var(--primary-soft), var(--surface) 60%); border-color: var(--primary-light); }

/* ---------- KPIs ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: flex; gap: 12px; align-items: flex-start; transition: transform .12s, box-shadow .12s; }
.kpi:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.kpi-icon { width: 38px; height: 38px; flex: none; border-radius: 11px; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; }
.kpi-good .kpi-icon { background: var(--good-bg); color: var(--good); }
.kpi-bad .kpi-icon { background: var(--bad-bg); color: var(--bad); }
.kpi-txt { min-width: 0; }
.kpi-label { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.kpi-value { font-size: 23px; font-weight: 700; margin-top: 1px; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub { font-size: 11.5px; color: var(--muted); }
.kpi-good .kpi-value { color: var(--good); }
.kpi-bad .kpi-value { color: var(--bad); }

/* ---------- gráficos ---------- */
.chart-empty { color: var(--muted); text-align: center; padding: 30px 10px; font-size: 13px; }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar-row { display: grid; grid-template-columns: minmax(90px, 150px) 1fr auto; align-items: center; gap: 10px; }
.hbar-label { font-size: 12.5px; color: var(--sec); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { background: var(--page); border-radius: 5px; height: 16px; overflow: hidden; }
.hbar-fill { display: block; height: 100%; border-radius: 0 5px 5px 0; min-width: 2px; }
.hbar-value { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hbar-value small { color: var(--muted); font-weight: 400; }
.donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.donut-legend { display: flex; flex-direction: column; gap: 7px; min-width: 150px; flex: 1; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.legend-dot { width: 10px; height: 10px; border-radius: 3.5px; flex: none; }
.legend-name { color: var(--sec); flex: 1; }
.legend-val { font-weight: 600; font-variant-numeric: tabular-nums; }
.legend-val small { color: var(--muted); font-weight: 400; }

/* ---------- tabelas ---------- */
.table-card { padding: 0; overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; padding: 11px 14px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border); white-space: nowrap; background: #fafbfc; }
td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { cursor: pointer; transition: background .1s; }
tbody tr:hover { background: var(--primary-soft); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.td-sub { font-size: 11.5px; color: var(--muted); }
.row-actions { white-space: nowrap; }
.text-bad { color: var(--bad); font-weight: 600; }

/* ---------- badges / tags / temperatura ---------- */
.badge { display: inline-block; font-size: 11px; font-weight: 600; border-radius: 99px; padding: 2.5px 10px; white-space: nowrap; }
.badge-good { background: var(--good-bg); color: var(--good); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-muted { background: var(--page); color: var(--sec); border: 1px solid var(--border); }
.tag { display: inline-block; font-size: 10.5px; font-weight: 600; background: var(--primary-soft); color: var(--primary-dark); border-radius: 6px; padding: 1.5px 7px; margin-left: 5px; }
.temp { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: var(--sec); white-space: nowrap; }
.temp i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.temp-frio i { background: var(--primary); } .temp-morno i { background: #eda100; } .temp-quente i { background: var(--bad); }
.temp-quente { color: var(--bad); }
.alert-inline { font-size: 11px; color: var(--bad); font-weight: 600; margin-top: 4px; }

/* ---------- kanban ---------- */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 18px; align-items: flex-start; }
.kcol { flex: none; width: 272px; background: #e9ecf1; border-radius: var(--radius); max-height: calc(100vh - 190px); display: flex; flex-direction: column; border: 1px solid var(--border); }
.kcol.drop { outline: 2px dashed var(--primary); outline-offset: -2px; }
.kcol-head { padding: 11px 14px 9px; border-radius: var(--radius) var(--radius) 0 0; background: var(--surface); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; border-bottom: 1px solid var(--border); }
.kcol-title { font-weight: 700; font-size: 13px; letter-spacing: -.01em; }
.kcol-count { background: var(--page); border: 1px solid var(--border); color: var(--sec); font-size: 11px; font-weight: 700; border-radius: 99px; padding: 0 8px; }
.kcol-sum { width: 100%; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.kcol-body { padding: 10px; display: flex; flex-direction: column; gap: 9px; overflow-y: auto; min-height: 60px; }
.kcard { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 13px; cursor: grab; box-shadow: 0 1px 2px rgba(16,24,40,.06); font-size: 12.5px; transition: box-shadow .12s, transform .12s; }
.kcard:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.kcard:active { cursor: grabbing; }
.kcard-alert { border-left: 3px solid var(--bad); }
.kcard-top { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.kcard-prod { color: var(--sec); font-weight: 500; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kcard-line { color: var(--muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.kcard-valor { justify-content: space-between; }
.kcard-valor strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.kcard-origem { font-size: 10.5px; font-weight: 600; background: var(--page); border: 1px solid var(--border); border-radius: 99px; padding: 1px 8px; color: var(--sec); }
.kcard-prox { display: inline-flex; align-items: center; gap: 3px; margin-left: auto; font-size: 11px; }
.mini-avatar { width: 18px; height: 18px; flex: none; border-radius: 50%; background: var(--primary-light); color: var(--primary-dark); font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.kcard-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 9px; padding-top: 7px; border-top: 1px solid var(--border); font-size: 11px; color: var(--muted); }

/* ---------- modal / painel ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(13, 20, 33, .5); backdrop-filter: blur(2px); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: var(--surface); border-radius: 18px; padding: 26px; width: 100%; max-width: 680px; max-height: 90vh; overflow-y: auto; box-shadow: 0 24px 70px rgba(0,0,0,.35); animation: pop .18s ease; }
@keyframes pop { from { transform: scale(.97); opacity: .6; } to { transform: none; opacity: 1; } }
.modal h3 { font-size: 17px; text-transform: none; letter-spacing: -.01em; color: var(--ink); margin-bottom: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.f-span { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

.panel-backdrop { justify-content: flex-end; padding: 0; }
.panel { background: var(--surface); width: 580px; max-width: 100%; height: 100%; overflow-y: auto; box-shadow: -16px 0 48px rgba(0,0,0,.25); display: flex; flex-direction: column; animation: slideIn .2s ease; }
@keyframes slideIn { from { transform: translateX(40px); opacity: .5; } to { transform: none; opacity: 1; } }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 22px 22px 12px; gap: 10px; }
.panel-title { font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.panel-sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.panel-close { font-size: 16px; }
.panel-tools { display: flex; gap: 8px; padding: 0 22px 14px; flex-wrap: wrap; align-items: center; }
.panel-tools select { font-size: 13px; padding: 6px 10px; max-width: 200px; }
.panel-tabs { display: flex; gap: 2px; padding: 0 22px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.ptab { background: none; border: none; font: inherit; font-weight: 600; font-size: 13px; color: var(--muted); padding: 10px 12px; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; transition: color .12s; }
.ptab:hover { color: var(--ink); }
.ptab.active { color: var(--primary); border-bottom-color: var(--primary); }
.panel-body { padding: 18px 22px 32px; flex: 1; }

.dl { display: flex; flex-direction: column; }
.dl > div { display: grid; grid-template-columns: 172px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.dl > div:last-child { border-bottom: none; }
.dl dt { color: var(--muted); font-weight: 500; }
.obs-box { background: var(--page); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-top: 12px; font-size: 13px; }
.obs-box strong { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; display: block; margin-bottom: 3px; }

/* ---------- timeline ---------- */
.quick-note { display: flex; gap: 8px; flex-wrap: wrap; }
.quick-note input[name="texto"], .quick-note input[name="produto"] { flex: 1; min-width: 160px; }
.timeline { margin-top: 16px; display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.tl-item:last-child { border-bottom: none; }
.tl-icon { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--page); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 14px; }
.tl-meta { font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.tl-body { font-size: 13px; min-width: 0; }

/* ---------- tarefas ---------- */
.task-mini-list { display: flex; flex-direction: column; gap: 7px; }
.task-mini { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); font-size: 12.5px; flex-wrap: wrap; cursor: default; }
.task-mini.atrasada { border-left: 3px solid var(--bad); }
.task-mini.concluida { opacity: .55; }
.task-mini.concluida .task-mini-title { text-decoration: line-through; }
.task-mini-date { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; font-size: 11.5px; }
.task-mini-title { font-weight: 600; flex: 1; min-width: 140px; }
.task-mini-ref { color: var(--muted); }
input[type="checkbox"] { accent-color: var(--primary); width: 15px; height: 15px; }

/* ---------- necessidade ---------- */
.need-card { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; background: var(--surface); box-shadow: var(--shadow); }
.need-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 8px; }
.need-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; font-size: 12.5px; color: var(--sec); }
.need-grid b { color: var(--muted); font-weight: 600; }

/* ---------- config ---------- */
.chip-list { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border-strong); border-radius: 99px; padding: 4.5px 12px; font-size: 12.5px; font-weight: 500; background: var(--surface); }
.chip button { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 11px; padding: 0; }
.chip button:hover { color: var(--bad); }
.chip-off { color: var(--muted); border-style: dashed; background: transparent; }
.chip-add { display: inline-flex; gap: 6px; }
.chip-add input { padding: 5px 11px; font-size: 12.5px; width: 180px; }
.perm-list { padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--sec); }

/* ---------- metas ---------- */
.meta-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; flex-wrap: wrap; }
.meta-nome { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; min-width: 140px; }
.meta-track { flex: 1; min-width: 140px; height: 14px; background: var(--page); border-radius: 7px; overflow: hidden; }
.meta-fill { height: 100%; background: linear-gradient(90deg, #3585e3, var(--primary)); border-radius: 7px; min-width: 3px; transition: width .3s; }
.meta-fill.ok { background: linear-gradient(90deg, #16a34a, var(--good)); }
.meta-val { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.meta-val small { color: var(--muted); font-weight: 400; }

/* ---------- toast ---------- */
#toast-root { position: fixed; bottom: 20px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #1c2430; color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 13px; font-weight: 500; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(8px); transition: all .25s; }
.toast.show { opacity: 1; transform: none; }
.toast-bad { background: var(--bad); }

/* ---------- responsivo ---------- */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 200; transform: translateX(-100%); transition: transform .2s ease; width: 254px; }
  .sidebar.open { transform: none; box-shadow: 20px 0 50px rgba(0,0,0,.4); }
  .hamburger { display: block; }
  .content { padding: 16px 14px 44px; }
  .topbar { padding: 10px 14px; }
  .topbar .btn-primary { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .dl > div { grid-template-columns: 1fr; gap: 1px; }
  .kcol { width: 246px; }
  .panel { width: 100%; }
  .kpi-value { font-size: 19px; }
}
@media (max-width: 560px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .filters-row select, .filters-row input { flex: 1 1 45%; min-width: 0; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .donut-wrap { justify-content: center; }
}
