/* ============ Tema ============ */
:root {
  --brand: #4f46e5;
  --bg: #f5f6f8; --surface: #ffffff; --surface-2: #f1f3f6; --surface-3: #e8ebf0;
  --border: #e3e6eb; --border-strong: #cdd2da;
  --text: #151922; --muted: #5b6474; --faint: #8b93a1;
  --ok: #15803d; --ok-soft: #e6f5eb; --warn: #b45309; --warn-soft: #fdf1df;
  --danger: #c62828; --danger-soft: #fdeaea; --info: #0369a1; --info-soft: #e3f1f9;
  --purple: #6d28d9; --purple-soft: #f0eafd;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.07);
  --shadow-lg: 0 16px 40px rgba(16,24,40,.18);
  --r: 12px; --r-sm: 8px; --side: 252px;
  --brand-soft: color-mix(in srgb, var(--brand) 11%, var(--surface));
  --brand-text: color-mix(in srgb, var(--brand) 78%, var(--text));
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0d1016; --surface: #151922; --surface-2: #1b2029; --surface-3: #242a35;
  --border: #262c37; --border-strong: #363e4c;
  --text: #e8eaef; --muted: #a3abba; --faint: #6f788a;
  --ok: #4ade80; --ok-soft: #10291a; --warn: #fbbf24; --warn-soft: #2d220e;
  --danger: #f87171; --danger-soft: #321515; --info: #38bdf8; --info-soft: #0e2432;
  --purple: #c4b5fd; --purple-soft: #231b3b;
  --shadow: 0 1px 3px rgba(0,0,0,.45); --shadow-lg: 0 16px 40px rgba(0,0,0,.55);
  --brand-soft: color-mix(in srgb, var(--brand) 22%, var(--surface));
  --brand-text: color-mix(in srgb, var(--brand) 45%, #ffffff);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--brand-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 15px; } h4 { font-size: 13px; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.small { font-size: 12.5px; } .tiny { font-size: 11.5px; }
.nowrap { white-space: nowrap; } .right { text-align: right; } .center { text-align: center; }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; } .mb { margin-bottom: 16px; } .mb-s { margin-bottom: 8px; }
.row { display: flex; align-items: center; gap: 8px; } .row.wrap { flex-wrap: wrap; } .between { justify-content: space-between; } .grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.ti { font-size: 18px; line-height: 1; vertical-align: -3px; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.ok-t { color: var(--ok); } .warn-t { color: var(--warn); } .danger-t { color: var(--danger); } .info-t { color: var(--info); }

/* ============ Layout ============ */
.app { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.brand .logo { width: 34px; height: 34px; border-radius: 10px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 17px; }
.brand b { display: block; font-size: 15px; } .brand small { color: var(--muted); font-size: 12px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.nav { padding: 10px 10px 20px; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: var(--r-sm); color: var(--text); font: inherit; font-weight: 500; background: none; border: 0; cursor: pointer; text-align: left; }
.nav-item:hover { background: var(--surface-2); text-decoration: none; }
.nav-item .ti { color: var(--muted); }
.nav-item .chev { margin-left: auto; font-size: 15px; transition: transform .15s; }
.nav-item.active { background: var(--brand-soft); color: var(--brand-text); }
.nav-item.active .ti { color: var(--brand-text); }
.nav-group.open > .nav-item .chev { transform: rotate(90deg); }
.nav-subs { display: none; padding: 2px 0 6px 18px; }
.nav-group.open .nav-subs { display: block; }
.nav-sub { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: var(--r-sm); color: var(--muted); font-size: 13.5px; }
.nav-sub:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-sub.active { color: var(--brand-text); background: var(--brand-soft); font-weight: 500; }
.nav-sub .ti { font-size: 16px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 14px 10px 4px; font-weight: 600; }
.side-foot { padding: 12px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; height: 58px; display: flex; align-items: center; gap: 12px; padding: 0 20px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.crumb { display: flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }
.crumb .ti { color: var(--faint); font-size: 15px; }
.crumb span { color: var(--muted); font-weight: 500; }
.content { padding: 22px 24px 48px; max-width: 1600px; width: 100%; }
.hamb { display: none; }
.scrim { display: none; }
.gsearch { position: relative; margin-left: auto; width: min(380px, 40vw); }
.gsearch input { width: 100%; padding: 8px 12px 8px 34px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; }
.gsearch input:focus { outline: 2px solid color-mix(in srgb, var(--brand) 40%, transparent); background: var(--surface); }
.gsearch > .ti { position: absolute; left: 11px; top: 9px; color: var(--faint); }
.gresults { position: absolute; top: 42px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-lg); max-height: 420px; overflow: auto; display: none; }
.gresults.show { display: block; }
.gres { display: flex; gap: 10px; align-items: center; padding: 9px 12px; cursor: pointer; }
.gres:hover { background: var(--surface-2); }
.gres small { color: var(--muted); display: block; }
.top-actions { display: flex; align-items: center; gap: 4px; }
.bell { position: relative; }
.bell .count { position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.dropdown { position: absolute; right: 0; top: 46px; width: 360px; max-width: 92vw; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-lg); z-index: 50; overflow: hidden; }
.dropdown .dd-head { padding: 12px 14px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.dropdown .dd-body { max-height: 420px; overflow: auto; }
.ntf { display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); cursor: pointer; }
.ntf:hover { background: var(--surface-2); }
.ntf.unread { background: var(--brand-soft); }
.ntf .ti { margin-top: 2px; }
.userchip { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: 999px; cursor: pointer; position: relative; }
.userchip:hover { background: var(--surface-2); }
.userchip .who { line-height: 1.2; } .userchip .who small { color: var(--muted); display: block; font-size: 11.5px; }
.dd-item { display: flex; gap: 10px; align-items: center; padding: 10px 14px; cursor: pointer; }
.dd-item:hover { background: var(--surface-2); }

@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .app.side-open .sidebar { transform: none; }
  .app.side-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 25; }
  .hamb { display: inline-flex; }
  .content { padding: 16px 16px 40px; }
  .topbar { padding: 0 12px; gap: 6px; }
  .gsearch { width: auto; flex: 1; }
  .userchip .who { display: none; }
  .crumb { display: none; }
}

/* ============ Componentes ============ */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn .ti { font-size: 17px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--brand) 88%, #000); border-color: transparent; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
[data-theme="dark"] .btn-ok { color: #06240f; }
.btn-ok:hover { background: color-mix(in srgb, var(--ok) 88%, #000); }
.btn-danger { background: var(--surface); border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-xs { padding: 3px 8px; font-size: 12px; border-radius: 6px; }
.btn-icon { padding: 8px; border-radius: 999px; background: transparent; border: 0; color: var(--muted); cursor: pointer; display: inline-flex; }
.btn-icon:hover { background: var(--surface-2); color: var(--text); }
.btn-group { display: inline-flex; border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.btn-group button { border: 0; background: none; padding: 7px 12px; font: inherit; font-weight: 500; color: var(--muted); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.btn-group button + button { border-left: 1px solid var(--border); }
.btn-group button.active { background: var(--brand-soft); color: var(--brand-text); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); }
.card.pad, .pad { padding: 16px 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px 0; }
.card-head h3 { display: flex; gap: 8px; align-items: center; }
.card-head .ti { color: var(--muted); }
.card-body { padding: 12px 18px 16px; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { display: flex; align-items: center; gap: 10px; }
.page-head h1 .ti { font-size: 24px; color: var(--brand-text); }
.page-head p { margin: 4px 0 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar select, .toolbar input { width: auto; min-width: 150px; }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
@media (max-width: 1200px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } .span2 { grid-column: auto; } }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--surface-2); color: var(--muted); border: 1px solid transparent; }
.b-ok { background: var(--ok-soft); color: var(--ok); } .b-warn { background: var(--warn-soft); color: var(--warn); }
.b-danger { background: var(--danger-soft); color: var(--danger); } .b-info { background: var(--info-soft); color: var(--info); }
.b-brand { background: var(--brand-soft); color: var(--brand-text); } .b-purple { background: var(--purple-soft); color: var(--purple); }
.b-outline { background: transparent; border-color: var(--border); }
.badge .ti { font-size: 13px; vertical-align: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 12.5px; cursor: pointer; color: var(--muted); }
.chip.active { background: var(--brand-soft); color: var(--brand-text); border-color: transparent; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.avatar { width: 28px; height: 28px; border-radius: 50%; color: #fff; display: inline-grid; place-items: center; font-size: 11px; font-weight: 600; flex: none; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.avatar.sm { width: 22px; height: 22px; font-size: 9.5px; }
.avatars { display: inline-flex; } .avatars .avatar { border: 2px solid var(--surface); margin-left: -6px; } .avatars .avatar:first-child { margin-left: 0; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); display: flex; gap: 12px; align-items: flex-start; }
.kpi[data-href] { cursor: pointer; } .kpi[data-href]:hover { border-color: var(--border-strong); }
.kpi .kico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); flex: none; }
.kpi .kico.ok { background: var(--ok-soft); color: var(--ok); } .kpi .kico.warn { background: var(--warn-soft); color: var(--warn); }
.kpi .kico.danger { background: var(--danger-soft); color: var(--danger); } .kpi .kico.info { background: var(--info-soft); color: var(--info); }
.kpi .klabel { color: var(--muted); font-size: 12.5px; }
.kpi .kval { font-size: 21px; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; }
.kpi .ksub { font-size: 12px; color: var(--muted); }

.progress { height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: var(--brand); border-radius: 99px; }
.progress.ok > div { background: var(--ok); } .progress.warn > div { background: var(--warn); } .progress.danger > div { background: var(--danger); }

/* Atenção */
.attention { border-left: 0; }
.att-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.att { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); cursor: pointer; border: 1px solid transparent; }
.att:hover { border-color: var(--border-strong); }
.att .ti { font-size: 20px; }
.att b { font-size: 18px; min-width: 26px; }
.att.danger .ti, .att.danger b { color: var(--danger); } .att.warn .ti, .att.warn b { color: var(--warn); } .att.info .ti, .att.info b { color: var(--info); }

.chart-box { position: relative; height: 260px; }
.chart-box.tall { height: 320px; } .chart-box.short { height: 200px; }

/* Tabelas */
.tbl-tools { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tbl-extra { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; flex: 1; }
.search { position: relative; }
.search input { padding-left: 32px !important; min-width: 220px; }
.search .ti { position: absolute; left: 10px; top: 9px; color: var(--faint); font-size: 16px; }
.tbl-scroll { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2); user-select: none; }
.tbl th.sortable { cursor: pointer; } .tbl th.sortable:hover { color: var(--text); }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.click:hover td { background: var(--surface-2); }
.tbl td.num, .tbl th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl tfoot td { font-weight: 600; background: var(--surface-2); border-top: 1px solid var(--border); }
.tbl .acts { white-space: nowrap; text-align: right; }
.tbl-foot { padding: 10px 14px; color: var(--muted); font-size: 12.5px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); }
.tbl.compact td, .tbl.compact th { padding: 7px 10px; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .ti { font-size: 34px; color: var(--faint); display: block; margin: 0 auto 8px; }

/* Formulários */
input, select, textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--text); font: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 35%, transparent); border-color: var(--brand); }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--brand); }
textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.field .req { color: var(--danger); font-weight: 600; }
.field .err { color: var(--danger); font-size: 12px; }
.field .err:empty { display: none; }
.col-12 { grid-column: span 12; } .col-8 { grid-column: span 8; } .col-6 { grid-column: span 6; } .col-4 { grid-column: span 4; } .col-3 { grid-column: span 3; } .col-9 { grid-column: span 9; }
@media (max-width: 640px) { .form-grid > * { grid-column: span 12 !important; } }
.form-section { grid-column: span 12; font-weight: 600; font-size: 13px; padding-top: 6px; border-top: 1px solid var(--border); margin-top: 4px; padding-top: 12px; display: flex; gap: 8px; align-items: center; }
.form-section:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.input-pre { display: flex; align-items: stretch; }
.input-pre span { padding: 8px 10px; border: 1px solid var(--border-strong); border-right: 0; border-radius: var(--r-sm) 0 0 var(--r-sm); background: var(--surface-2); color: var(--muted); font-size: 13px; }
.input-pre input { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text) !important; cursor: pointer; font-weight: 400 !important; }
.multi { display: flex; flex-wrap: wrap; gap: 6px; }
.multi label { display: inline-flex; gap: 6px; align-items: center; padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; font-size: 13px; color: var(--text); font-weight: 400; }
.multi label:has(input:checked) { background: var(--brand-soft); border-color: transparent; color: var(--brand-text); }
.items-tbl td { padding: 4px; border: 0; } .items-tbl th { padding: 4px; background: none; border: 0; }
.items-tbl input, .items-tbl select { padding: 6px 8px; }

/* Modal e drawer */
.modal-wrap { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; background: rgba(10,14,22,.45); animation: fade .12s; }
.modal { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; display: flex; flex-direction: column; animation: pop .14s; }
.modal.sm { max-width: 420px; } .modal.lg { max-width: 820px; } .modal.xl { max-width: 1100px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 14px 14px; flex-wrap: wrap; }
.drawer-wrap { position: fixed; inset: 0; z-index: 80; }
.drawer-bg { position: absolute; inset: 0; background: rgba(10,14,22,.35); animation: fade .12s; }
.drawer { position: absolute; right: 0; top: 0; bottom: 0; background: var(--bg); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .18s; }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 16px 20px 12px; background: var(--surface); border-bottom: 1px solid var(--border); }
.drawer-head h2 { font-size: 18px; }
.drawer-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.drawer-actions:empty { display: none; }
.drawer-body { padding: 16px 20px 40px; overflow-y: auto; flex: 1; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
@keyframes slide { from { transform: translateX(30px); opacity: .4; } }

.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #111827; color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: center; max-width: 380px; animation: pop .15s; font-size: 13.5px; }
.toast.ok .ti { color: #4ade80; } .toast.warn .ti { color: #fbbf24; } .toast.danger .ti { color: #f87171; } .toast.info .ti { color: #7dd3fc; }

/* Abas */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab { padding: 9px 14px; background: none; border: 0; border-bottom: 2px solid transparent; font: inherit; font-weight: 500; color: var(--muted); cursor: pointer; white-space: nowrap; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand-text); border-bottom-color: var(--brand); }
.tcount { background: var(--surface-3); color: var(--muted); border-radius: 99px; padding: 0 7px; font-size: 11.5px; margin-left: 4px; }

/* Kanban */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; min-height: 60vh; }
.kcol { flex: 0 0 284px; background: var(--surface-2); border-radius: var(--r); border: 1px solid var(--border); display: flex; flex-direction: column; max-height: calc(100vh - 210px); }
.kcol.over { outline: 2px dashed var(--brand); outline-offset: -2px; }
.kcol-head { display: flex; align-items: center; gap: 8px; padding: 11px 12px 8px; font-size: 13px; }
.kcol-head b { flex: 1; font-weight: 600; }
.kcount { background: var(--surface); border: 1px solid var(--border); border-radius: 99px; padding: 0 8px; font-size: 12px; color: var(--muted); }
.ksum { font-size: 12px; padding: 0 12px 6px; color: var(--muted); }
.kcol-body { padding: 4px 8px 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.kcard { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; cursor: pointer; box-shadow: var(--shadow); transition: border-color .12s, transform .12s; }
.kcard:hover { border-color: var(--border-strong); }
.kcard.dragging { opacity: .45; transform: rotate(1.5deg); }
.kcard .kt { font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.kcard .ks { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.kcard .kf { display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.kcard .kf .grow { min-width: 10px; }
.kcard.accent-danger { border-left: 3px solid var(--danger); } .kcard.accent-ok { border-left: 3px solid var(--ok); } .kcard.accent-warn { border-left: 3px solid var(--warn); }
.kempty { color: var(--faint); font-size: 12.5px; text-align: center; padding: 14px 0; border: 1px dashed var(--border-strong); border-radius: 10px; }

/* Listas e timeline */
.dl { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: 13.5px; }
.dl dt { color: var(--muted); } .dl dd { margin: 0; font-weight: 500; word-break: break-word; }
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.tl { position: relative; padding-bottom: 14px; }
.tl::before { content: ''; position: absolute; left: -19px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--brand); }
.tl small { color: var(--muted); display: block; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.list-item.click { cursor: pointer; } .list-item.click:hover { background: var(--surface-2); margin: 0 -10px; padding: 10px; border-radius: 8px; }
.ico-box { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); flex: none; }
.checklist label { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px; cursor: pointer; background: var(--surface); }
.checklist label.done span { text-decoration: line-through; color: var(--muted); }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.file { border: 1px solid var(--border); border-radius: 10px; padding: 10px; background: var(--surface); font-size: 12.5px; }
.file .thumb { height: 82px; border-radius: 7px; background: var(--surface-2); display: grid; place-items: center; margin-bottom: 8px; color: var(--faint); overflow: hidden; }
.file .thumb img { width: 100%; height: 100%; object-fit: cover; }
.file .thumb .ti { font-size: 30px; }
.note { padding: 10px 12px; border-radius: 8px; background: var(--info-soft); color: var(--info); font-size: 13px; display: flex; gap: 8px; align-items: flex-start; }
.note.warn { background: var(--warn-soft); color: var(--warn); } .note.ok { background: var(--ok-soft); color: var(--ok); } .note.danger { background: var(--danger-soft); color: var(--danger); }
.note .ti { margin-top: 1px; }
.stars { color: #f59e0b; letter-spacing: 1px; }
.seg-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); margin: 18px 0 8px; }

/* Agenda */
.agenda { display: grid; grid-template-columns: 56px repeat(6, minmax(130px, 1fr)); border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); overflow: auto; }
.ag-h { position: sticky; top: 0; background: var(--surface-2); border-bottom: 1px solid var(--border); padding: 8px; font-size: 12.5px; font-weight: 600; text-align: center; z-index: 2; }
.ag-h.today { color: var(--brand-text); background: var(--brand-soft); }
.ag-hours { border-right: 1px solid var(--border); }
.ag-hour { height: 52px; font-size: 11px; color: var(--faint); text-align: right; padding: 2px 6px 0 0; border-bottom: 1px dashed var(--border); }
.ag-day { position: relative; border-right: 1px solid var(--border); }
.ag-day:last-child { border-right: 0; }
.ag-slot { height: 52px; border-bottom: 1px dashed var(--border); }
.ag-ev { position: absolute; left: 4px; right: 4px; border-radius: 7px; padding: 5px 7px; font-size: 12px; overflow: hidden; cursor: pointer; border-left: 3px solid; line-height: 1.3; }
.ag-ev b { display: block; font-size: 12px; }
.ag-ev.done { opacity: .62; }

/* Mapa */
.map { height: calc(100vh - 230px); min-height: 420px; border-radius: var(--r); border: 1px solid var(--border); z-index: 1; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.pin { width: 16px; height: 16px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }

/* Login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-hero { background: var(--brand); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-hero h1 { font-size: 34px; line-height: 1.15; max-width: 480px; }
.login-hero p { opacity: .85; max-width: 460px; font-size: 15px; }
.login-hero .logo { width: 44px; height: 44px; border-radius: 12px; background: #fff; color: var(--brand); display: grid; place-items: center; font-weight: 800; font-size: 22px; }
.login-hero .feat { display: flex; gap: 10px; align-items: center; margin: 8px 0; opacity: .92; }
.login-side { padding: 40px; overflow-y: auto; max-height: 100vh; }
.login-users { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.login-user { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); cursor: pointer; text-align: left; font: inherit; color: var(--text); }
.login-user:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.login-user small { color: var(--muted); display: block; }
@media (max-width: 900px) { .login { grid-template-columns: 1fr; } .login-hero { padding: 28px; } .login-hero h1 { font-size: 24px; } .login-side { padding: 20px; max-height: none; } }

/* App de campo (celular) */
.mobile-shell { max-width: 480px; margin: 0 auto; }
.m-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow); }
.m-big { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.m-big button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); font: inherit; font-size: 12.5px; color: var(--text); cursor: pointer; }
.m-big .ti { font-size: 24px; color: var(--brand-text); }
.phone-hint { display: flex; gap: 8px; align-items: center; justify-content: center; color: var(--muted); font-size: 12.5px; margin-bottom: 12px; }

/* Base de conhecimento */
.kb { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }
.kb-tree a { display: flex; gap: 8px; padding: 6px 10px; border-radius: 7px; color: var(--text); align-items: center; }
.kb-tree a:hover { background: var(--surface-2); text-decoration: none; }
.kb-tree a.active { background: var(--brand-soft); color: var(--brand-text); }
.kb-tree .sub { padding-left: 18px; }
.kb-article { line-height: 1.7; font-size: 15px; }
.kb-article h2 { margin: 18px 0 8px; } .kb-article h3 { margin: 16px 0 6px; }
.kb-article ul, .kb-article ol { padding-left: 22px; }
.kb-article code { background: var(--surface-2); padding: 1px 6px; border-radius: 5px; font-size: 13px; }
.editor { min-height: 280px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); padding: 12px 14px; background: var(--surface); line-height: 1.7; }
.editor:focus { outline: 2px solid color-mix(in srgb, var(--brand) 35%, transparent); }
.ed-tools { display: flex; gap: 4px; margin-bottom: 6px; }
@media (max-width: 860px) { .kb { grid-template-columns: 1fr; } }

/* Mídia */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.media { border-radius: var(--r); overflow: hidden; border: 1px solid var(--border); background: var(--surface); }
.media .mthumb { height: 130px; display: grid; place-items: center; color: #fff; position: relative; }
.media .mthumb .ti { font-size: 34px; opacity: .9; }
.media .mthumb .dur { position: absolute; bottom: 6px; right: 8px; background: rgba(0,0,0,.55); padding: 1px 6px; border-radius: 5px; font-size: 11px; }
.media .minfo { padding: 10px 12px; font-size: 12.5px; }

/* Etiquetas */
.labels { display: grid; gap: 0; background: #fff; color: #000; margin: 0 auto; }
.labels.a4 { grid-template-columns: repeat(3, 70mm); width: 210mm; padding: 8mm 0; justify-content: center; }
.labels.a4 .label { width: 70mm; height: 36mm; }
.labels.termica { grid-template-columns: 100mm; width: 100mm; }
.labels.termica .label { width: 100mm; height: 50mm; page-break-after: always; }
.label { border: 1px dashed #bbb; padding: 3mm; display: flex; gap: 3mm; align-items: center; font-family: 'Inter', sans-serif; overflow: hidden; }
.label .qr { flex: none; }
.label .loc { font-size: 20px; font-weight: 800; letter-spacing: .02em; line-height: 1; }
.labels.termica .label .loc { font-size: 30px; }
.label .lname { font-size: 10px; font-weight: 600; line-height: 1.2; margin: 3px 0; max-height: 2.4em; overflow: hidden; }
.labels.termica .label .lname { font-size: 13px; }
.label .lmeta { font-size: 8.5px; color: #333; line-height: 1.35; }
.labels.termica .label .lmeta { font-size: 11px; }
.label-preview { background: var(--surface-2); padding: 20px; border-radius: var(--r); overflow: auto; }

/* Documentos e proposta */
.doc-root { min-height: 100vh; background: var(--surface-2); padding: 24px 12px 60px; }
.doc-bar { max-width: 860px; margin: 0 auto 16px; display: flex; gap: 8px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.paper { max-width: 860px; margin: 0 auto; background: #fff; color: #1a1d24; border-radius: 6px; box-shadow: var(--shadow-lg); padding: 56px 64px; font-size: 13.5px; line-height: 1.65; }
.paper h1 { font-size: 22px; margin-bottom: 4px; } .paper h2 { font-size: 15px; margin: 22px 0 8px; }
.paper .muted { color: #5b6474; }
.paper table { width: 100%; border-collapse: collapse; margin: 10px 0; } .paper td, .paper th { border: 1px solid #ddd; padding: 6px 9px; text-align: left; font-size: 13px; }
.paper .sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 60px; text-align: center; font-size: 12.5px; }
.paper .sign div { border-top: 1px solid #333; padding-top: 6px; }
.stamp { display: inline-flex; gap: 8px; align-items: center; border: 2px solid #15803d; color: #15803d; padding: 6px 12px; border-radius: 8px; font-weight: 600; transform: rotate(-2deg); }
@media (max-width: 700px) { .paper { padding: 28px 22px; } }

.prop { max-width: 960px; margin: 0 auto; background: #fff; color: #1a1d24; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow-lg); }
.prop-cover { background: var(--brand); color: #fff; padding: 64px 64px 56px; position: relative; overflow: hidden; }
.prop-cover::after { content: ''; position: absolute; right: -120px; top: -120px; width: 420px; height: 420px; border-radius: 50%; background: rgba(255,255,255,.08); }
.prop-cover::before { content: ''; position: absolute; right: 80px; bottom: -160px; width: 300px; height: 300px; border-radius: 50%; background: rgba(255,255,255,.06); }
.prop-cover .pbrand { display: flex; align-items: center; gap: 10px; font-weight: 600; margin-bottom: 70px; position: relative; z-index: 1; }
.prop-cover .pbrand .logo { width: 36px; height: 36px; border-radius: 10px; background: #fff; color: var(--brand); display: grid; place-items: center; font-weight: 800; }
.prop-cover h1 { font-size: 40px; line-height: 1.1; max-width: 620px; position: relative; z-index: 1; letter-spacing: -.02em; }
.prop-cover p { font-size: 17px; opacity: .9; margin-top: 14px; position: relative; z-index: 1; }
.prop-cover .pmeta { display: flex; gap: 28px; margin-top: 40px; font-size: 13px; opacity: .9; position: relative; z-index: 1; flex-wrap: wrap; }
.prop-cover .pmeta b { display: block; font-size: 15px; }
.prop-sec { padding: 44px 64px; border-bottom: 1px solid #eceef2; }
.prop-sec h2 { font-size: 24px; letter-spacing: -.01em; margin-bottom: 6px; }
.prop-sec .lead { color: #5b6474; font-size: 15.5px; max-width: 720px; line-height: 1.7; }
.prop-amb { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 24px; }
.prop-amb .amb { border: 1px solid #e6e8ee; border-radius: 14px; padding: 20px; break-inside: avoid; }
.prop-amb .amb .aico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--brand) 12%, #fff); color: var(--brand); margin-bottom: 12px; }
.prop-amb .amb .aico .ti { font-size: 22px; }
.prop-amb .amb h3 { font-size: 16px; margin-bottom: 8px; }
.prop-amb .amb ul { margin: 0; padding-left: 18px; color: #3d4452; font-size: 14px; line-height: 1.65; }
.prop-inc { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 24px; margin-top: 18px; }
.prop-inc div { display: flex; gap: 10px; align-items: center; font-size: 14.5px; }
.prop-inc .ti { color: var(--brand); font-size: 20px; }
.prop-inv { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; margin-top: 24px; align-items: stretch; }
.prop-inv .big { background: #111827; color: #fff; border-radius: 16px; padding: 28px; }
.prop-inv .big small { opacity: .7; font-size: 13px; }
.prop-inv .big .v { font-size: 40px; font-weight: 700; letter-spacing: -.02em; margin: 6px 0; }
.prop-inv .cond { border: 1px solid #e6e8ee; border-radius: 16px; padding: 24px; font-size: 14px; }
.prop-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 22px; }
.prop-steps div { border-top: 3px solid var(--brand); padding-top: 10px; font-size: 13px; color: #3d4452; }
.prop-steps b { display: block; color: #1a1d24; font-size: 14px; margin-bottom: 2px; }
.prop-foot { padding: 32px 64px; display: flex; justify-content: space-between; align-items: center; gap: 20px; background: #fafbfc; flex-wrap: wrap; }
@media (max-width: 760px) {
  .prop-cover, .prop-sec, .prop-foot { padding-left: 24px; padding-right: 24px; }
  .prop-cover h1 { font-size: 28px; }
  .prop-amb, .prop-inc, .prop-inv { grid-template-columns: 1fr; }
  .prop-steps { grid-template-columns: 1fr 1fr; }
}

.keypad-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.keypad { border: 1px solid #d8dbe2; border-radius: 12px; padding: 14px; background: #f7f8fa; break-inside: avoid; }
.keypad .kp { background: #fff; border: 1px solid #cfd3db; border-radius: 10px; padding: 10px; display: grid; gap: 6px; aspect-ratio: 7 / 10; grid-auto-rows: 1fr; } /* tamanho único: as teclas dividem o espaço */
.keypad .key { display: flex; align-items: center; justify-content: center; min-height: 0; }
.keypad .key { border: 1px solid #e1e4ea; border-radius: 6px; padding: 7px; text-align: center; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #222; }

/* Impressão */
@media print {
  @page { margin: 10mm; }
  html, body { background: #fff !important; }
  .sidebar, .topbar, .no-print, .toasts, .doc-bar { display: none !important; }
  .app { display: block; } .content { padding: 0; max-width: none; }
  .doc-root { padding: 0; background: #fff; }
  .paper, .prop { box-shadow: none; border-radius: 0; max-width: none; }
  .prop-cover, .prop-inv .big { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .prop-sec { break-inside: avoid-page; }
  .label-preview { padding: 0; background: #fff; }
  .labels .label { border-color: transparent; }
}

/* ============ Celular e telas estreitas ============ */
html { overflow-x: hidden; }
.main { overflow-x: clip; }
.grid > *, .kb > *, .form-grid > *, .toolbar > *, .page-head > * { min-width: 0; max-width: 100%; }
.btn-group { max-width: 100%; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.btn-group::-webkit-scrollbar, .tabs::-webkit-scrollbar { display: none; }
.btn-group button { white-space: nowrap; flex: none; }
.tabs { scrollbar-width: none; }
.tbl-scroll .tbl th:first-child, .tbl-scroll .tbl td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.tbl-scroll .tbl th:first-child { background: var(--surface-2); }
.tbl-scroll .tbl tfoot td:first-child { background: var(--surface-2); }
.tbl tbody tr.click:hover td:first-child { background: var(--surface-2); }
.ag-list .ag-day-h { display: flex; justify-content: space-between; align-items: center; font-weight: 600; margin: 16px 0 8px; }
.ag-list .ag-day-h.today { color: var(--brand-text); }
.ag-item { display: flex; gap: 12px; align-items: stretch; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 12px; margin-bottom: 8px; cursor: pointer; border-left: 4px solid var(--faint); box-shadow: var(--shadow); }
.ag-item .hr { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 54px; }
.ag-item .hr small { display: block; font-weight: 400; color: var(--muted); }

@media (max-width: 960px) {
  input, select, textarea, .gsearch input { font-size: 16px; }
  .dropdown { position: fixed; left: 8px; right: 8px; top: calc(62px + env(safe-area-inset-top, 0px)); width: auto; max-width: none; }
  .content { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .kb { grid-template-columns: minmax(0, 1fr); }
  .modal-wrap { padding: 12px 8px; }
  .modal-body { padding: 16px 14px; }
  .modal-head, .modal-foot { padding-left: 14px; padding-right: 14px; }
  .drawer-head, .drawer-actions { padding-left: 14px; padding-right: 14px; }
  .drawer-body { padding: 14px 14px calc(60px + env(safe-area-inset-bottom, 0px)); }
  .kanban { scroll-snap-type: x mandatory; min-height: 0; }
  .kcol { flex-basis: 82vw; max-width: 320px; scroll-snap-align: start; max-height: none; }
  .search, .search input { width: 100%; min-width: 0; }
  .tbl-tools .search { flex: 1 1 100%; }
  .toolbar select, .toolbar input { min-width: 0; }
  .page-head h1 { font-size: 20px; }
  .dl { grid-template-columns: minmax(96px, 38%) minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .tbl.stackable thead { display: none; }
  .tbl.stackable, .tbl.stackable tbody, .tbl.stackable tr, .tbl.stackable td { display: block; width: 100%; }
  .tbl.stackable tbody tr { padding: 12px 14px; border-bottom: 1px solid var(--border); }
  .tbl.stackable tbody tr:last-child { border-bottom: 0; }
  .tbl.stackable td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right; position: static; background: transparent !important; }
  .tbl.stackable td::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; text-align: left; flex: none; max-width: 45%; }
  .tbl.stackable td:first-child { display: block; text-align: left; font-size: 15px; padding-bottom: 6px; }
  .tbl.stackable td:first-child::before, .tbl.stackable td[data-label=""]::before { display: none; }
  .tbl.stackable td:empty { display: none; }
  .tbl.stackable td.acts { justify-content: flex-end; padding-top: 8px; flex-wrap: wrap; }
  .tbl.stackable tfoot { display: block; }
  .tbl.stackable tfoot tr { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 10px 14px; background: var(--surface-2); }
  .tbl.stackable tfoot td { display: block; width: auto; padding: 0; background: transparent; border: 0; }
  .tbl.stackable tfoot td::before { display: none; }
  .tbl.stackable .empty { padding: 24px 8px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi { padding: 12px; gap: 8px; flex-direction: column; }
  .kpi .kico { width: 30px; height: 30px; }
  .kpi .kval { font-size: 18px; }
  .att-list { grid-template-columns: 1fr; }
  .content { padding-left: 12px; padding-right: 12px; }
  .drawer-actions .btn { flex: 1 1 auto; justify-content: center; }
}
.tbl .tv:empty { display: none; }
@media (max-width: 640px) {
  .tbl.stackable td > .tv { min-width: 0; text-align: right; overflow-wrap: anywhere; }
  .tbl.stackable td:first-child > .tv { text-align: left; }
  .tbl.stackable td:has(> .tv:empty) { display: none; }
  .tbl.stackable td.acts > .tv { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
  .tbl.stackable td .tv .row { justify-content: flex-end; }
  .tbl.stackable td:first-child .tv .row { justify-content: flex-start; }
}

/* ============ Kanban com colunas de altura cheia ============ */
.kanban { align-items: stretch; min-height: 0; }
.kcol { max-height: none; min-height: 0; }
.kcol-body { flex: 1; min-height: 0; overflow-y: auto; }
.kempty { margin-bottom: auto; }

/* ============ Menu no topo ============ */
.app.layout-topo { grid-template-columns: minmax(0, 1fr); }
.layout-topo .topbar { gap: 14px; height: 60px; padding: 0 20px; }
.tbrand { display: flex; align-items: center; gap: 9px; color: var(--text); font-size: 16px; flex: none; margin-right: 4px; }
.tbrand:hover { text-decoration: none; }
.tbrand .logo { width: 32px; height: 32px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; }
.tmods { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; overflow: hidden; position: relative; }
.tmore { position: relative; flex: none; }
.tmod { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 8px; color: var(--muted); font: inherit; font-weight: 500; white-space: nowrap; flex: none; background: none; border: 0; cursor: pointer; }
.tmod .ti { font-size: 17px; }
.tmod:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.tmod.active { background: var(--brand); color: #fff; }
.tmod.active .ti { color: #fff; }
.tmods + .gsearch, .layout-topo .gsearch { margin-left: 0; width: 230px; flex: none; }
.subbar { position: sticky; top: calc(60px + env(safe-area-inset-top, 0px)); z-index: 19; display: flex; gap: 4px; align-items: center; min-height: 50px; padding: 7px 20px; background: var(--surface-2); border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.subbar::-webkit-scrollbar { display: none; }
.sublink { display: inline-flex; gap: 7px; align-items: center; padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; white-space: nowrap; font-size: 13.5px; border: 1px solid transparent; flex: none; }
.sublink .ti { font-size: 16px; }
.sublink:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.sublink.active { background: var(--surface); color: var(--brand-text); border-color: var(--border); box-shadow: var(--shadow); }
.sub-title { display: flex; gap: 8px; align-items: center; font-weight: 600; padding: 6px 2px; }
.sub-title .ti { color: var(--brand-text); }
@media (min-width: 961px) {
  .app.layout-topo .sidebar, .app.layout-topo .hamb { display: none; }
}
@media (max-width: 960px) {
  .layout-topo .topbar { height: 58px; padding: 0 12px; gap: 8px; }
  .layout-topo .tmods { display: none; }
  .layout-topo .tbrand b { display: none; }
  .layout-topo .gsearch { flex: 1; width: auto; }
  .subbar { top: calc(58px + env(safe-area-inset-top, 0px)); padding: 6px 12px; min-height: 46px; }
}
[hidden], .tmod[hidden], .tmore[hidden] { display: none !important; }
.btn-icon.on { color: var(--brand-text); background: var(--brand-soft); }
@media (min-width: 961px) {
  .layout-topo .topbar .gsearch { position: absolute; right: 20px; top: calc(60px + 8px); width: 280px; z-index: 21; }
  .layout-topo .gsearch input { padding-top: 7px; padding-bottom: 7px; background: var(--surface); }
  .layout-topo .subbar { padding-right: 320px; }
}
@media (max-width: 1360px) and (min-width: 961px) {
  .tmod { padding: 8px 10px; }
  .tmod:not(.active) .ti { display: none; }
}
.toolbar input[type="checkbox"], .toolbar input[type="radio"] { min-width: 0; width: auto; }
@media (max-width: 960px) {
  .layout-topo .top-actions [data-theme-t], .layout-topo .top-actions a[href="#/config"] { display: none; }
}

/* ============ Login ============ */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--bg); }
.auth-hero { position: relative; overflow: hidden; background: var(--brand); color: #fff; padding: 40px 48px; display: flex; flex-direction: column; gap: 36px; justify-content: space-between; }
.auth-hero::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.14) 1px, transparent 1.4px); background-size: 22px 22px; mask-image: linear-gradient(160deg, #000 10%, transparent 75%); -webkit-mask-image: linear-gradient(160deg, #000 10%, transparent 75%); pointer-events: none; }
.auth-hero > * { position: relative; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.auth-brand .logo { width: 38px; height: 38px; border-radius: 11px; background: #fff; color: var(--brand); display: grid; place-items: center; font-weight: 800; font-size: 19px; }
.auth-pitch h1 { font-size: clamp(30px, 3.4vw, 46px); line-height: 1.08; letter-spacing: -.025em; max-width: 560px; font-weight: 700; text-wrap: balance; }
.auth-pitch h1 em { font-style: normal; background: rgba(255,255,255,.16); padding: 0 .18em; border-radius: 8px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.auth-pitch p { font-size: 16px; opacity: .88; max-width: 470px; margin-top: 16px; line-height: 1.6; }
.auth-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 560px; }
.auth-tile { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(6px); }
.auth-tile .ico { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.16); display: grid; place-items: center; flex: none; }
.auth-tile div { min-width: 0; flex: 1; } .auth-tile b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.auth-tile small { opacity: .8; font-size: 12px; }
.auth-tile .pulse { width: 9px; height: 9px; border-radius: 50%; background: #86efac; box-shadow: 0 0 0 0 rgba(134,239,172,.7); animation: pulse 2s infinite; flex: none; }
.auth-tile .bar { width: 46px; height: 6px; border-radius: 9px; background: rgba(255,255,255,.2); overflow: hidden; flex: none; } .auth-tile .bar span { display: block; height: 100%; background: #fff; }
.auth-tile .ti.ok { color: #86efac; font-size: 20px; }
.auth-foot { opacity: .7; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(134,239,172,0); } 100% { box-shadow: 0 0 0 0 rgba(134,239,172,0); } }
@media (prefers-reduced-motion: reduce) { .auth-tile .pulse { animation: none; } }
.auth-side { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; gap: 18px; }
.auth-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 32px 30px; box-shadow: var(--shadow-lg); }
.auth-card h2 { font-size: 24px; letter-spacing: -.02em; }
.auth-sub { color: var(--muted); margin: 6px 0 22px; line-height: 1.55; }
.auth-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.auth-field > label { font-size: 13px; font-weight: 600; }
.auth-input { position: relative; display: flex; align-items: center; }
.auth-input > .ti { position: absolute; left: 13px; color: var(--faint); pointer-events: none; }
.auth-input input { padding: 12px 44px 12px 40px; border-radius: 11px; font-size: 15px; background: var(--surface-2); border-color: var(--border); }
.auth-input input:focus { background: var(--surface); }
.auth-eye { position: absolute; right: 6px; width: 34px; height: 34px; border: 0; background: none; color: var(--muted); border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.auth-eye:hover { background: var(--surface-3); color: var(--text); }
.auth-caps { color: var(--warn); font-size: 12px; display: flex; gap: 4px; align-items: center; }
.auth-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 4px 0 18px; flex-wrap: wrap; }
.auth-row .check { font-size: 13.5px; }
.linkish { background: none; border: 0; padding: 0; color: var(--brand-text); font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.linkish:hover { text-decoration: underline; }
.auth-btn { width: 100%; justify-content: center; padding: 12px; font-size: 15px; border-radius: 11px; }
.auth-err { color: var(--danger); font-size: 13px; min-height: 0; margin-bottom: 10px; }
.auth-err:empty { display: none; }
.auth-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 18px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.auth-note .ti { margin-top: 1px; }
.auth-help { color: var(--muted); }
.auth-back { background: none; border: 0; color: var(--muted); font: inherit; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; padding: 0; margin-bottom: 14px; cursor: pointer; }
.auth-back:hover { color: var(--text); }
.auth-canais { border: 0; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.auth-canais legend { font-size: 13px; font-weight: 600; margin-bottom: 6px; padding: 0; }
.auth-canal { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; background: var(--surface); transition: border-color .12s, background .12s; }
.auth-canal input { accent-color: var(--brand); }
.auth-canal .ico { width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); flex: none; }
.auth-canal small { display: block; color: var(--muted); font-size: 12.5px; }
.auth-canal:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.auth-canal:has(input:checked) .ico { background: var(--brand); color: #fff; }
.auth-badge { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); margin-bottom: 14px; }
.auth-badge .ti { font-size: 26px; }
.auth-badge.ok { background: var(--ok-soft); color: var(--ok); }
.auth-badge.big { width: 64px; height: 64px; } .auth-badge.big .ti { font-size: 34px; }
.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 14px; }
.otp input { text-align: center; font-size: 22px; font-weight: 700; padding: 12px 0; border-radius: 11px; background: var(--surface-2); font-variant-numeric: tabular-nums; }
.otp.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }
.auth-resend { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font-size: 13px; color: var(--muted); gap: 10px; flex-wrap: wrap; }
.meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 6px; }
.meter span { height: 5px; border-radius: 9px; background: var(--surface-3); }
.meter span.on.f1 { background: var(--danger); } .meter span.on.f2 { background: var(--warn); } .meter span.on.f3, .meter span.on.f4 { background: var(--ok); }
.meter-l { color: var(--muted); font-size: 12px; }
.auth-rules { list-style: none; padding: 0; margin: -4px 0 16px; display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.auth-rules li::before { content: '○'; margin-right: 8px; }
.auth-rules li.ok { color: var(--ok); } .auth-rules li.ok::before { content: '✓'; }
.spin { width: 15px; height: 15px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 900px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-hero { padding: 24px 20px 28px; gap: 18px; }
  .auth-tiles, .auth-foot { display: none; }
  .auth-pitch h1 { font-size: 26px; }
  .auth-pitch p { font-size: 14.5px; margin-top: 10px; }
  .auth-side { justify-content: flex-start; padding: 20px 16px 40px; }
  .auth-card { padding: 24px 20px; margin-top: -8px; }
}

/* ============ Editor de orçamento ============ */
.orc-head { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.orc-crumbs { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.orc-crumbs a { color: var(--muted); font-weight: 500; } .orc-crumbs a:hover { color: var(--text); }
.orc-title { font-size: 24px; font-weight: 700; letter-spacing: -.02em; border: 1px solid transparent; background: transparent; padding: 4px 8px; margin-left: -8px; border-radius: 8px; width: 100%; max-width: 720px; }
.orc-title:hover { border-color: var(--border); } .orc-title:focus { background: var(--surface); }
.orc-saved { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); padding: 0 6px; }
.orc-saved .ti { color: var(--ok); }
.orc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.orc-side { position: sticky; top: 130px; }
.layout-lateral .orc-side { top: 76px; }
.orc-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); }
.orc-sum { padding: 18px; }
.orc-total { background: var(--brand); color: #fff; border-radius: 12px; padding: 16px 18px; margin-bottom: 14px; }
.orc-total small { opacity: .85; font-size: 12.5px; } .orc-total .v { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; margin: 2px 0; font-variant-numeric: tabular-nums; }
.orc-lines { display: grid; gap: 2px; }
.orc-line { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13.5px; border-bottom: 1px dashed var(--border); }
.orc-line > span:first-child { flex: 1; } .orc-line b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.orc-line.muted { color: var(--muted); }
.orc-pct { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 7px; overflow: hidden; background: var(--surface); }
.orc-pct input { width: 64px; border: 0; padding: 4px 6px; text-align: right; font-size: 13px; border-radius: 0; }
.orc-pct i, .orc-pct button { font-style: normal; font-size: 12px; color: var(--muted); padding: 0 8px; background: var(--surface-2); border: 0; align-self: stretch; display: grid; place-items: center; font-weight: 600; }
.orc-pct button { cursor: pointer; color: var(--brand-text); }
.orc-sec-t { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin: 16px 0 8px; display: flex; gap: 8px; align-items: center; }
.orc-bar { margin-bottom: 9px; font-size: 13px; } .orc-bar .row { margin-bottom: 4px; } .orc-bar .ti { font-size: 15px; color: var(--muted); }
.orc-margem { display: flex; align-items: baseline; gap: 8px; padding: 8px 0 6px; } .orc-margem span { flex: 1; font-weight: 600; } .orc-margem em { font-style: normal; font-weight: 700; }
.orc-margem.ok em, .orc-margem.ok b { color: var(--ok); } .orc-margem.warn em { color: var(--warn); } .orc-margem.danger em { color: var(--danger); }
.orc-side-btns { display: grid; gap: 8px; margin-top: 16px; } .orc-side-btns .btn { justify-content: center; }
.orc-search { position: relative; margin-bottom: 14px; }
.orc-search-in { display: flex; align-items: center; gap: 10px; padding: 0 14px; border: 1.5px solid var(--border-strong); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.orc-search-in:focus-within { border-color: var(--brand); }
.orc-search-in > .ti { color: var(--faint); }
.orc-search-in input { border: 0; padding: 13px 0; font-size: 15px; background: transparent; outline: none; }
.orc-search-in input:focus { outline: none; }
.orc-alvo { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; font-size: 12.5px; background: var(--brand-soft); color: var(--brand-text); border-radius: 99px; padding: 4px 6px 4px 10px; font-weight: 600; }
.orc-alvo button { border: 0; background: none; color: inherit; cursor: pointer; display: grid; place-items: center; padding: 0; }
.orc-results { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); overflow: hidden; }
.orc-res { display: flex; gap: 12px; align-items: center; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--border); }
.orc-res:last-child { border-bottom: 0; } .orc-res.on, .orc-res:hover { background: var(--brand-soft); }
.orc-res small { display: block; color: var(--muted); font-size: 12px; }
.orc-thumb { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--brand-text); flex: none; }
.orc-sol { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden; }
.orc-sol > header { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.orc-sol > header small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.orc-sico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--brand); color: #fff; flex: none; }
.orc-scount { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.orc-stotal { font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.orc-sact { display: flex; } .orc-sact .btn-icon:disabled { opacity: .3; cursor: default; }
.orc-rows { padding: 4px 6px; }
.orc-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px 116px 112px 112px 100px; gap: 10px; align-items: center; padding: 8px; border-radius: 10px; }
.orc-row:not(.orc-rh):hover { background: var(--surface-2); }
.orc-row.flash { background: var(--brand-soft); transition: background .6s; }
.orc-rh { font-size: 11.5px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; padding-bottom: 2px; }
.orc-row .r { text-align: right; font-variant-numeric: tabular-nums; }
.orc-item { display: flex; gap: 10px; align-items: center; min-width: 0; }
.orc-item .mn { min-width: 0; } .orc-item b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13.5px; }
.orc-item small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.orc-in { border: 1px solid transparent; background: transparent; padding: 6px 8px; border-radius: 8px; font-size: 13.5px; min-width: 0; }
.orc-row:hover .orc-in, .orc-in:focus { border-color: var(--border-strong); background: var(--surface); }
.orc-qty { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; background: var(--surface); }
.orc-qty button { width: 30px; height: 32px; border: 0; background: var(--surface-2); color: var(--text); font-size: 16px; cursor: pointer; flex: none; }
.orc-qty button:hover { background: var(--surface-3); }
.orc-qty input { border: 0; border-radius: 0; text-align: center; padding: 4px 2px; font-size: 13.5px; min-width: 0; -moz-appearance: textfield; }
.orc-qty input::-webkit-inner-spin-button, .orc-qty input::-webkit-outer-spin-button { -webkit-appearance: none; }
.orc-ract { display: flex; justify-content: flex-end; opacity: .45; } .orc-row:hover .orc-ract { opacity: 1; }
.orc-ract .btn-icon { padding: 6px; }
.orc-sol > footer { padding: 6px 12px 10px; }
.orc-vazio { color: var(--muted); padding: 18px 10px; display: flex; gap: 8px; align-items: center; font-size: 13.5px; }
.orc-addsol { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.orc-start { padding: 28px; text-align: center; margin-bottom: 14px; } .orc-start > .ti { font-size: 34px; color: var(--brand-text); }
.orc-pays { display: grid; gap: 10px; }
.orc-pay { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); flex-wrap: wrap; }
.orc-pay.on { border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }
.orc-pars { display: flex; gap: 8px; }
.orc-par { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.orc-par input { width: 96px; padding: 6px 8px; font-size: 14px; }
.orc-pay:not(.on) .orc-pars { opacity: .45; pointer-events: none; }
.orc-switch { position: relative; width: 40px; height: 22px; flex: none; cursor: pointer; }
.orc-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.orc-switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-3); transition: .15s; }
.orc-switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: .15s; }
.orc-switch input:checked + span { background: var(--brand); } .orc-switch input:checked + span::after { transform: translateX(18px); }
.orc-switch input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.orc-star { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); padding: 6px 10px; border-radius: 99px; border: 1px solid var(--border); cursor: pointer; white-space: nowrap; }
.orc-star input { display: none; } .orc-star.on { background: var(--brand-soft); color: var(--brand-text); border-color: transparent; font-weight: 600; }
.pp-pay-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.orc-opprev { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: var(--surface); display: grid; gap: 4px; }
.orc-opprev.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.orc-opprev .v { font-size: 17px; font-weight: 700; }
.orc-txt { margin-bottom: 10px; } .orc-txt > summary { display: flex; gap: 12px; align-items: center; padding: 12px 14px; cursor: pointer; list-style: none; }
.orc-txt > summary::-webkit-details-marker { display: none; }
.orc-capa-mini { height: 40px; border-radius: 6px; }
@media (max-width: 1180px) { .orc-grid { grid-template-columns: minmax(0, 1fr); } .orc-side { position: static; } }
@media (max-width: 760px) {
  .orc-row { grid-template-columns: minmax(0, 1fr) 110px; gap: 6px 10px; }
  .orc-rh { display: none; }
  .orc-row > .orc-item { grid-column: 1 / -1; }
  .orc-row > [data-f="ambiente"] { grid-column: 1 / 2; }
  .orc-row > .orc-qty { grid-column: 2 / 3; }
  .orc-row > [data-f="unit"] { grid-column: 1 / 2; }
  .orc-row > [data-tot] { grid-column: 2 / 3; }
  .orc-row > .orc-ract { grid-column: 1 / -1; opacity: 1; }
  .orc-row { border-bottom: 1px solid var(--border); border-radius: 0; }
  .orc-sol > header { flex-wrap: wrap; } .orc-scount { display: none; }
  .orc-title { font-size: 20px; }
}

/* ============ Proposta para o cliente ============ */
.pp-root { --pp-ink: #0b1b30; --pp-muted: #536b7f; --pp-soft: #f3f5f8; --pp-line: #e3e8ee; padding: 0; background: #fff; color: var(--pp-ink); font-family: 'Funnel Sans', 'Inter', system-ui, sans-serif; color-scheme: light; }
.pp-root h1, .pp-root h2, .pp-root h3, .pp-root .pp-display { font-family: 'Funnel Display', 'Inter', system-ui, sans-serif; font-weight: 500; letter-spacing: -.02em; }
.pp-bar { position: fixed; top: 12px; left: 12px; right: 12px; z-index: 50; display: flex; justify-content: flex-end; align-items: center; gap: 8px; pointer-events: none; }
.pp-bar > * { pointer-events: auto; }
.pp-dots { position: fixed; right: 18px; top: 50%; transform: translateY(-50%); z-index: 40; display: flex; flex-direction: column; gap: 9px; padding: 10px 6px; border-radius: 99px; background: rgba(6,27,53,.35); backdrop-filter: blur(6px); }
.pp-dots a { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.55); display: block; transition: .2s; }
.pp-dots a.on { background: var(--pp-accent); transform: scale(1.35); }
.pp-page { position: relative; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 88px 0 72px; overflow: hidden; }
.pp-wrap { width: min(1120px, calc(100% - 96px)); margin: 0 auto; }
.pp-foot { position: absolute; left: 0; right: 0; bottom: 22px; display: flex; justify-content: space-between; width: min(1120px, calc(100% - 96px)); margin: 0 auto; font-size: 11.5px; letter-spacing: .08em; color: #9fb2c2; font-weight: 600; }
.pp-eyebrow { font-size: 12px; letter-spacing: .14em; font-weight: 700; color: rgba(255,255,255,.7); margin-bottom: 10px; }
.pp-eyebrow.dark { color: var(--pp-muted); }
.pp-tag { display: inline-block; background: var(--pp-accent); color: #fff; font-size: 11.5px; font-weight: 700; letter-spacing: .12em; padding: 6px 14px; border-radius: 99px; margin-bottom: 22px; }
.pp-root h2 { font-size: clamp(32px, 4vw, 54px); line-height: 1.06; max-width: 900px; text-wrap: balance; }
.pp-lead2 { font-size: 19px; color: var(--pp-muted); max-width: 760px; margin-top: 14px; line-height: 1.55; }
.pp-logo { display: inline-flex; align-items: center; gap: 10px; font-family: 'Funnel Display', sans-serif; font-weight: 600; font-size: 19px; letter-spacing: .02em; }
.pp-logo .m { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--pp-accent); color: #fff; font-weight: 700; }
.pp-logo.light { color: #fff; }
/* capa */
.pp-capa { flex-direction: row; padding: 0; background: var(--pp-dark); color: #fff; align-items: stretch; }
.pp-capa-l { flex: 0 0 46%; padding: 56px 64px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; position: relative; z-index: 1; }
.pp-capa h1 { font-size: clamp(36px, 4.3vw, 62px); line-height: 1.04; text-wrap: balance; }
.pp-lead { font-size: 18px; color: rgba(255,255,255,.78); margin-top: 18px; line-height: 1.55; max-width: 520px; }
.pp-rule { display: block; width: 64px; height: 4px; border-radius: 4px; background: var(--pp-accent); margin: 34px 0 26px; }
.pp-cli { font-family: 'Funnel Display', sans-serif; font-size: 30px; font-weight: 600; }
.pp-meta { color: rgba(255,255,255,.7); margin-top: 4px; }
.pp-capa-foot { color: rgba(255,255,255,.5); font-size: 13px; }
.pp-capa-r { flex: 1; position: relative; background: color-mix(in srgb, var(--pp-dark) 80%, #000); background-size: cover; background-position: center; }
.pp-capa-r.img::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, var(--pp-dark) 0%, transparent 28%); }
.pp-decor { position: absolute; inset: 0; overflow: hidden; background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1.4px); background-size: 26px 26px; }
.pp-decor .b1, .pp-decor .b2 { position: absolute; left: -20%; right: -20%; height: 120px; background: var(--pp-accent); transform: rotate(-24deg); opacity: .9; }
.pp-decor .b1 { bottom: 16%; } .pp-decor .b2 { bottom: calc(16% - 150px); height: 60px; opacity: .45; }
.pp-tiles { position: absolute; top: 14%; left: 12%; right: 12%; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.pp-tile { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: 16px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(4px); font-weight: 600; }
.pp-tile .ti { font-size: 28px; color: var(--pp-accent); }
/* a proposta */
.pp-sols { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 44px; }
.pp-solcard { border: 1px solid var(--pp-line); border-radius: 18px; padding: 22px; background: #fff; display: grid; gap: 10px; align-content: start; }
.pp-solcard b { font-family: 'Funnel Display', sans-serif; font-size: 20px; font-weight: 600; line-height: 1.2; }
.pp-solcard p { color: var(--pp-muted); font-size: 15px; line-height: 1.5; margin: 0; }
.pp-n { font-family: 'Funnel Display', sans-serif; font-size: 15px; font-weight: 700; color: var(--pp-accent); }
.pp-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--pp-soft); display: grid; place-items: center; color: var(--pp-dark); } .pp-ic .ti { font-size: 22px; }
/* solução */
.pp-sol { justify-content: flex-start; padding-top: 0; }
.pp-band { background: var(--pp-dark); color: #fff; padding: 64px 0 52px; position: relative; overflow: hidden; border-left: 8px solid var(--pp-accent); }
.pp-band p { font-size: 19px; color: rgba(255,255,255,.78); margin-top: 12px; max-width: 760px; line-height: 1.5; }
.pp-big { position: absolute; right: 6%; bottom: -40px; font-family: 'Funnel Display', sans-serif; font-size: 220px; font-weight: 700; color: rgba(255,255,255,.06); line-height: 1; }
.pp-solbody { padding-top: 44px; }
.pp-solbody h3 { font-size: 22px; margin-bottom: 16px; }
.pp-bul { list-style: none; padding: 0; margin: 0 0 32px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 40px; }
.pp-bul li { position: relative; padding-left: 22px; font-size: 16px; line-height: 1.55; }
.pp-bul li::before { content: ''; position: absolute; left: 0; top: .55em; width: 8px; height: 8px; border-radius: 50%; background: var(--pp-accent); }
.pp-escopo { background: var(--pp-soft); border-radius: 18px; padding: 24px 28px; }
.pp-escopo ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 40px; }
.pp-escopo li { display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; padding: 6px 0; border-bottom: 1px solid var(--pp-line); }
.pp-escopo li em { font-style: normal; color: var(--pp-muted); white-space: nowrap; }
.pp-inv { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 26px; padding: 22px 28px; border-radius: 18px; background: var(--pp-dark); color: #fff; flex-wrap: wrap; }
.pp-inv span { font-size: 12.5px; letter-spacing: .14em; font-weight: 700; color: rgba(255,255,255,.7); }
.pp-inv b { font-family: 'Funnel Display', sans-serif; font-size: 34px; font-weight: 600; color: #fff; }
/* investimento */
.pp-inv-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 28px; margin-top: 40px; align-items: start; }
.pp-rl { display: flex; align-items: baseline; gap: 10px; padding: 13px 0; font-size: 16px; }
.pp-rl span { display: flex; gap: 8px; align-items: center; } .pp-rl .ti { color: var(--pp-accent); }
.pp-rl i { flex: 1; border-bottom: 2px dotted var(--pp-line); transform: translateY(-4px); }
.pp-rl b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pp-total { margin-top: 18px; padding: 24px 26px; border-radius: 18px; background: var(--pp-dark); color: #fff; display: grid; gap: 4px; }
.pp-total span { font-size: 12.5px; letter-spacing: .14em; font-weight: 700; color: rgba(255,255,255,.7); }
.pp-total b { font-family: 'Funnel Display', sans-serif; font-size: 44px; font-weight: 600; line-height: 1.1; }
.pp-total small { color: rgba(255,255,255,.7); }
.pp-pay { display: grid; gap: 12px; }
.pp-op { position: relative; border: 1px solid var(--pp-line); border-radius: 16px; padding: 18px 20px; display: grid; gap: 4px; background: #fff; }
.pp-op.on { border: 2px solid var(--pp-accent); box-shadow: 0 10px 30px -12px color-mix(in srgb, var(--pp-accent) 60%, transparent); }
.pp-op-h { display: flex; gap: 8px; align-items: center; } .pp-op-h .ti { color: var(--pp-accent); }
.pp-op .v { font-family: 'Funnel Display', sans-serif; font-size: 24px; font-weight: 600; }
.pp-op small { color: var(--pp-muted); }
.pp-chip { position: absolute; top: -11px; right: 16px; background: var(--pp-accent); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .08em; padding: 4px 10px; border-radius: 99px; text-transform: uppercase; }
/* anexo */
.pp-anexo { justify-content: flex-start; }
.pp-ax { margin-top: 26px; break-inside: avoid; }
.pp-ax-h { display: flex; gap: 10px; align-items: center; font-family: 'Funnel Display', sans-serif; font-size: 18px; font-weight: 600; padding-bottom: 8px; border-bottom: 2px solid var(--pp-dark); }
.pp-ax-h .ti { color: var(--pp-accent); }
.pp-ax table { width: 100%; border-collapse: collapse; }
.pp-ax th { text-align: left; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--pp-muted); padding: 10px 6px 6px; }
.pp-ax td { padding: 9px 6px; border-bottom: 1px solid var(--pp-line); font-size: 14.5px; vertical-align: top; }
.pp-ax td small { display: block; color: var(--pp-muted); font-size: 12.5px; }
.pp-ax .r { text-align: right; white-space: nowrap; }
/* aceite */
.pp-info { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-top: 34px; }
.pp-ic-card { border: 1px solid var(--pp-line); border-radius: 16px; padding: 18px 20px; }
.pp-ic-card p, .pp-ic-card ul { margin: 6px 0 0; color: var(--pp-ink); line-height: 1.55; font-size: 15px; }
.pp-ic-card ul { padding-left: 18px; }
.pp-form { margin-top: 22px; border-radius: 18px; background: var(--pp-soft); padding: 24px 26px; }
.pp-form p { color: var(--pp-muted); }
.pp-fg { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 14px 0 10px; }
.pp-fg label { display: grid; gap: 6px; font-size: 12.5px; font-weight: 700; letter-spacing: .06em; color: var(--pp-muted); text-transform: uppercase; }
.pp-fg input { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--pp-line); font-size: 16px; background: #fff; color: var(--pp-ink); text-transform: none; letter-spacing: 0; font-weight: 400; }
.pp-chk { display: flex; gap: 10px; align-items: center; font-size: 15px; margin: 6px 0 12px; }
.pp-chk input { width: 18px; height: 18px; accent-color: var(--pp-accent); }
.pp-err { color: #c62828; font-size: 14px; min-height: 0; margin-bottom: 10px; } .pp-err:empty { display: none; }
.pp-btn { background: var(--pp-accent); color: #fff; border: 0; border-radius: 12px; padding: 14px 28px; font: inherit; font-weight: 700; font-size: 16px; cursor: pointer; }
.pp-btn:disabled { opacity: .5; cursor: not-allowed; }
.pp-note { display: block; margin-top: 10px; color: var(--pp-muted); }
.pp-ok { display: flex; gap: 14px; align-items: center; } .pp-ok .ti { font-size: 34px; color: #15803d; } .pp-ok p { margin: 2px 0 0; }
/* encerramento */
.pp-end { background: var(--pp-dark); color: #fff; }
.pp-end .pp-wrap { display: flex; flex-direction: column; justify-content: space-between; min-height: 60vh; gap: 40px; }
.pp-end h2 { margin-top: 36px; font-size: clamp(38px, 5vw, 70px); }
.pp-end p { font-size: 19px; color: rgba(255,255,255,.75); margin-top: 16px; }
.pp-contato { color: rgba(255,255,255,.7); line-height: 1.7; border-top: 1px solid rgba(255,255,255,.15); padding-top: 20px; }
@media (max-width: 860px) {
  .pp-wrap, .pp-foot { width: calc(100% - 40px); }
  .pp-page { padding: 72px 0 64px; min-height: auto; }
  .pp-capa { flex-direction: column; min-height: 100vh; } .pp-capa-l { flex: none; padding: 72px 24px 32px; } .pp-capa-r { min-height: 260px; }
  .pp-tiles { top: 10%; left: 6%; right: 6%; grid-template-columns: repeat(2, 1fr); gap: 10px; } .pp-tile { padding: 12px; }
  .pp-bul, .pp-escopo ul, .pp-inv-grid, .pp-fg { grid-template-columns: 1fr; }
  .pp-big { font-size: 140px; } .pp-band { padding: 44px 0 36px; }
  .pp-dots { right: 8px; } .pp-lead2 { font-size: 16.5px; }
  .pp-total b { font-size: 34px; } .pp-inv b { font-size: 26px; }
}
@media print {
  @page { size: A4 landscape; margin: 0; }
  .pp-root { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pp-page { min-height: 210mm; break-after: page; padding-top: 48px; padding-bottom: 56px; }
  .pp-capa, .pp-end { height: 210mm; }
  .pp-sol { padding-top: 0; }
}
.pp-ax table { table-layout: fixed; } .pp-ax th:last-child { width: 160px; }
@media (max-width: 760px) {
  .orc-sol > header > .grow { flex: 1 1 calc(100% - 52px); }
  .orc-stotal { flex: 1; padding-left: 48px; }
  .orc-head .page-actions .btn span { display: none; }
  .orc-head .page-actions .btn-primary span { display: inline; }
}
@media (max-width: 860px) {
  .pp-dots { display: none; }
  .pp-bar { position: static; padding: 10px 12px; background: var(--pp-dark); }
  .pp-capa-l { padding-top: 40px; }
}

.orc-viewbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.orc-sico.amb { background: color-mix(in srgb, var(--brand) 14%, var(--surface)); color: var(--brand-text); }
.orc-sico.warn { background: var(--warn-soft); color: var(--warn); }
.orc-semamb { border-style: dashed; border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); }
.orc-namb { display: inline-flex; gap: 4px; } .orc-namb input { width: 170px; padding: 5px 10px; border-radius: 99px; font-size: 13px; }
select.orc-in { padding: 6px 4px; cursor: pointer; }
.mat-amb { margin-bottom: 12px; }
.mat-amb > header { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.mat-amb > header b { flex: 1; min-width: 140px; }
.mat-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 70px 90px 120px; gap: 10px; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.mat-row:last-child { border-bottom: 0; }
.mat-row.done b { text-decoration: line-through; color: var(--muted); }
.mat-row small { display: block; color: var(--muted); font-size: 12px; }
.mat-row .r { text-align: right; }
@media (max-width: 760px) { .mat-row { grid-template-columns: minmax(0, 1fr) 110px; } .mat-row > .msol, .mat-row > .mped { display: none; } }

/* ===== Compartilhar atendimento (WhatsApp) ===== */
.cp-contatos { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin-bottom: 8px; }
.cp-contato { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; background: var(--surface); transition: border-color .15s, background .15s; min-width: 0; }
.cp-contato input { width: auto; flex: none; accent-color: var(--ok); }
.cp-contato.on { border-color: var(--ok); background: var(--ok-soft); }
.cp-contato .grow { min-width: 0; } .cp-contato b, .cp-contato small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-contato small { color: var(--muted); font-size: 12px; }
.cp-contato .avatar.sm, .rc-ct .avatar.sm { width: 30px; height: 30px; font-size: 12px; }
.cp-inc { display: flex; flex-wrap: wrap; gap: 8px; }
.cp-inc .chip { padding: 7px 12px; font-size: 13px; }
.wa-prev { background: #e5ddd5 radial-gradient(circle at 20% 20%, rgba(255,255,255,.35) 0 2px, transparent 3px) 0 0/22px 22px; border-radius: 14px; padding: 16px; }
.wa-bubble { position: relative; max-width: 440px; margin-left: auto; background: #d9fdd3; color: #111b21; padding: 9px 12px 20px; border-radius: 10px 0 10px 10px; font-size: 14px; line-height: 1.45; box-shadow: 0 1px 1px rgba(0,0,0,.12); white-space: pre-wrap; word-break: break-word; }
.wa-bubble u { color: #027eb5; }
.wa-time { position: absolute; right: 8px; bottom: 4px; font-size: 11px; color: #667781; }
[data-theme="dark"] .wa-prev { background: #0b141a radial-gradient(circle at 20% 20%, rgba(255,255,255,.05) 0 2px, transparent 3px) 0 0/22px 22px; } [data-theme="dark"] .wa-bubble { background: #005c4b; color: #e9edef; } [data-theme="dark"] .wa-bubble u { color: #53bdeb; } [data-theme="dark"] .wa-time { color: #a7c0b9; }

/* Página do cliente */
.vs-root { background: #f3f4f8; min-height: 100vh; font-family: 'Funnel Sans', Inter, sans-serif; color: #18202e; }
.vs { max-width: 640px; margin: 0 auto; padding: 16px 16px 40px; }
.vs-head { background: var(--pp-dark); color: #fff; border-radius: 22px; padding: 22px 22px 24px; margin-bottom: 14px; position: relative; overflow: hidden; }
.vs-head::after { content: ''; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(var(--pp-accent), transparent 70%); opacity: .55; }
.vs-head h1 { font-family: 'Funnel Display', sans-serif; font-size: 26px; line-height: 1.15; margin: 6px 0 14px; position: relative; }
.vs-eyebrow { font-size: 12px; letter-spacing: .16em; font-weight: 700; color: var(--pp-accent); margin-top: 18px; filter: brightness(1.4); position: relative; }
.vs-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 14px; align-items: center; opacity: .95; position: relative; }
.vs-meta span { display: inline-flex; align-items: center; gap: 5px; }
.vs-st { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #eef0f4; color: #374151; white-space: nowrap; }
.vs-st.ok { background: #dcfce7; color: #166534; } .vs-st.warn { background: #fef3c7; color: #92400e; } .vs-st.danger { background: #fee2e2; color: #991b1b; } .vs-st.info { background: #e0f2fe; color: #075985; } .vs-st.purple { background: #ede9fe; color: #5b21b6; }
.vs-card { background: #fff; border-radius: 18px; padding: 18px; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(16,24,40,.05); }
.vs-card h2 { font-family: 'Funnel Display', sans-serif; font-size: 17px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.vs-card h2 .ti { color: var(--pp-accent); }
.vs-team { display: flex; flex-wrap: wrap; gap: 12px 20px; }
.vs-team > div { display: flex; align-items: center; gap: 10px; } .vs-team b, .vs-team small { display: block; } .vs-team small { color: #6b7280; font-size: 12px; }
.vs-team .avatar { width: 38px; height: 38px; font-size: 13px; }
.vs-addr { margin: 14px 0 0; font-size: 14px; color: #4b5563; display: flex; gap: 6px; }
.vs-list { list-style: none; margin: 0; padding: 0; }
.vs-list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid #eef0f4; font-size: 15px; }
.vs-list li:first-child { border-top: 0; } .vs-list li .ti { color: #9ca3af; font-size: 18px; flex: none; }
.vs-list li.ok .ti { color: #16a34a; } .vs-list .grow { flex: 1; min-width: 0; } .vs-list small { display: block; color: #6b7280; font-size: 12px; }
.vs-oc { border: 1px solid #eef0f4; border-radius: 12px; padding: 12px; margin-bottom: 8px; } .vs-oc p { margin: 6px 0 0; font-size: 14px; }
.vs-fotos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px; }
.vs-fotos div { aspect-ratio: 1; border-radius: 10px; background: linear-gradient(135deg, #e8e5f7, #dfe7f3); display: grid; place-items: center; color: #9aa3b8; font-size: 22px; }
.vs-rate { text-align: center; } .vs-rate h2 { justify-content: center; }
.vs-stars { display: flex; justify-content: center; gap: 4px; font-size: 38px; color: #f59e0b; margin: 6px 0 12px; }
.vs-stars button { background: none; border: 0; font-size: inherit; color: #d1d5db; cursor: pointer; padding: 0 2px; line-height: 1; transition: transform .1s; }
.vs-stars.on button, .vs-stars button:hover { color: #f59e0b; } .vs-stars button:active { transform: scale(.9); }
.vs-rate textarea { width: 100%; border-radius: 12px; border: 1px solid #e5e7eb; padding: 10px 12px; font: inherit; font-size: 16px; margin-bottom: 12px; resize: vertical; background: #fff; color: #18202e; }
.vs-rate .pp-btn { width: 100%; justify-content: center; } .vs-rate .pp-btn:disabled { opacity: .45; cursor: default; }
.vs-foot { text-align: center; font-size: 12.5px; color: #6b7280; margin-top: 18px; line-height: 1.6; } .vs-foot span { color: #9ca3af; }

/* Relatórios compartilhados: uma linha por cliente, envios aninhados */
.rc { padding: 0; overflow: hidden; }
.rc-grid { display: grid; grid-template-columns: 44px minmax(180px, 1.6fr) minmax(140px, 1.3fr) 120px 140px 130px 120px; gap: 12px; align-items: center; padding: 10px 16px; }
.rc-headrow { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); font-weight: 600; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.rc-cli { border-bottom: 1px solid var(--border); } .rc-cli:last-child { border-bottom: 0; }
.rc-row { cursor: pointer; transition: background .12s; } .rc-row:hover { background: var(--surface-2); }
.rc-row small, .rc-env small { display: block; color: var(--muted); font-size: 12px; } .rc-row > div { min-width: 0; }
.rc-row .rc-name b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-tog { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer; padding: 0; }
.rc-cli.open .rc-tog { background: var(--brand); color: #fff; border-color: transparent; }
.rc-cli.open > .rc-row { background: var(--brand-soft); }
.rc-bar { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-bottom: 3px; max-width: 110px; } .rc-bar i { display: block; height: 100%; background: var(--ok); border-radius: 99px; }
.rc-sub { padding: 6px 16px 14px 72px; background: var(--surface-2); }
.rc-lote { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-top: 8px; overflow: hidden; }
.rc-lote-h { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 9px 12px; border-bottom: 1px solid var(--border); }
.rc-env { display: grid; grid-template-columns: minmax(180px, 1.5fr) 80px 100px 70px minmax(110px, 1fr) 124px; gap: 10px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--border); }
.rc-lote-h + .rc-env { border-top: 0; }
.rc-envh { border: 0; padding: 8px 13px 0; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); font-weight: 600; }
#rc-q { min-width: 280px; } .rc-env.off { opacity: .6; } .rc-env > div { min-width: 0; }
.rc-ct { display: flex; align-items: center; gap: 10px; min-width: 0; } .rc-ct b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-com { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-style: italic; }
.rc-acts { display: flex; } .rc-acts .btn-icon { padding: 6px; }
.rc-yn { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; } .rc-yn::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.rc-yn.y::before { background: var(--ok); }
@media (max-width: 960px) {
  .rc-headrow { display: none; }
  .rc-grid.rc-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 12px; padding: 12px 12px 14px 56px; align-items: start; position: relative; }
  .rc-row .rc-name { grid-column: 1 / -1; } .rc-row .rc-tog { position: absolute; left: 14px; top: 12px; }
  .rc-row > [data-l]::before, .rc-env > [data-l]::before { content: attr(data-l); display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); font-weight: 600; margin-bottom: 2px; }
  .rc-sub { padding: 4px 10px 12px; } .rc-envh { display: none; } #rc-q { min-width: 0; width: 100%; } .toolbar .search:has(#rc-q) { flex: 1 1 100%; }
  .rc-env { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .rc-env .rc-ct { grid-column: 1 / -1; } .rc-env > [data-l="Avaliação"] { grid-column: 1 / 3; } .rc-acts { justify-content: flex-end; align-self: end; }
}
.tk-bar { position: sticky; bottom: -40px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 18px -20px -40px; padding: 12px 20px 16px; background: var(--surface); border-top: 1px solid var(--border); z-index: 2; }
@media (max-width: 960px) { .tk-bar { bottom: calc(-60px - env(safe-area-inset-bottom, 0px)); margin: 18px -14px calc(-60px - env(safe-area-inset-bottom, 0px)); padding: 12px 14px calc(16px + env(safe-area-inset-bottom, 0px)); } }
@media (max-width: 600px) { .tk-bar #tk-st { flex: 1 1 100%; } .tk-bar .grow { display: none; } .tk-bar .btn { flex: 1; justify-content: center; } }
.keypad > .row.between { gap: 8px; align-items: flex-start; } .keypad > .row.between > .row { flex: none; white-space: nowrap; }

/* ===== Etapas configuráveis do kanban ===== */
.kcol-head[draggable="true"] { cursor: grab; }
.kcol-head[draggable="true"]:active { cursor: grabbing; }
.kcol-cfg { border: 0; background: none; color: var(--faint); padding: 4px; border-radius: 6px; cursor: pointer; display: inline-flex; margin: -4px -4px -4px 0; }
.kcol-cfg:hover { background: var(--surface); color: var(--text); }
.kcol-cfg .ti { font-size: 16px; }
.kdesc { padding: 0 12px 6px; font-size: 12px; color: var(--muted); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kcol.dragging-col { opacity: .45; }
.kcol.drop-before { box-shadow: -4px 0 0 -1px var(--brand); }
.kcol.drop-after { box-shadow: 4px 0 0 -1px var(--brand); }
.kcol-add { background: transparent; border: 1.5px dashed var(--border-strong, var(--border)); flex: 0 0 220px; padding: 10px; gap: 8px; justify-content: flex-start; }
.kadd { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 10px; border: 0; background: none; color: var(--muted); border-radius: 10px; cursor: pointer; font: inherit; text-align: center; }
.kadd:hover { background: var(--surface-2); color: var(--text); }
.kadd .ti { font-size: 22px; color: var(--brand-text); }
.kadd b { font-size: 14px; color: var(--text); }
.kadd span { font-size: 12px; }
.kadd-arq { border: 0; background: none; color: var(--muted); font: inherit; font-size: 12.5px; cursor: pointer; padding: 6px; border-radius: 8px; display: inline-flex; gap: 6px; align-items: center; justify-content: center; }
.kadd-arq:hover { background: var(--surface-2); color: var(--text); }
.et-cores { display: flex; flex-wrap: wrap; gap: 8px; }
.et-cor { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; background: var(--c); cursor: pointer; padding: 0; box-shadow: inset 0 0 0 2px var(--surface); position: relative; }
.et-cor.on { border-color: var(--text); }
.et-custom { background: conic-gradient(#ef4444, #f59e0b, #22c55e, #38bdf8, #6366f1, #ec4899, #ef4444); display: grid; place-items: center; color: #fff; overflow: hidden; }
.et-custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.et-custom .ti { font-size: 15px; pointer-events: none; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.et-prev { margin-top: 16px; width: 284px; max-width: 100%; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); padding-bottom: 6px; }
.et-prev .kcol-head { cursor: default; }
@media (max-width: 960px) { .kcol-add { flex-basis: 78vw; } }
#et-cont .btn-group { flex-wrap: wrap; overflow: visible; }
