/* ================= Painel de gestão — Orlando Vidros ================= */
:root {
  --sb-bg: #0b1d44;
  --sb-ink: #a9bbdf;
  --sb-ink-2: #6f84b0;
  --bg: #f3f6fb;
  --panel: #fff;
  --edge: #e2e8f3;
  --edge-2: #eef2f8;
  --ink-2: #3b4760;
  --ok: #15914a;
  --ok-bg: #e5f6ec;
  --warn: #9a6200;
  --warn-bg: #fff3d6;
  --bad: #c2372c;
  --bad-bg: #fde9e7;
  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 8px;
  --sh-1: 0 1px 2px rgba(11, 29, 68, .05), 0 1px 1px rgba(11, 29, 68, .03);
  --sh-2: 0 12px 32px rgba(11, 29, 68, .12);
  --z-sb: 40; --z-drawer: 60; --z-bar: 70; --z-toast: 80; --z-tip: 90;
}

body.adm, body.admin { background: var(--bg); min-height: 100dvh; font-size: 15px; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.btn .ic { width: 16px; height: 16px; }
.btn-block { width: 100%; }
.btn-quiet { background: transparent; color: #cfdcf5; border: 0; }
.btn-quiet:hover { color: #fff; }
.btn { transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s, border-color .2s; }
.btn-ghost { background: #fff; }
.link-btn { background: none; border: 0; color: var(--blue); font-weight: 700; font-size: .84rem; cursor: pointer; text-decoration: none; padding: 4px 2px; }
.link-btn:hover { text-decoration: underline; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--edge); background: #fff; display: grid; place-items: center; cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { background: var(--ice); }
.input-sm, select.input.input-sm { padding: 9px 12px; font-size: .9rem; width: auto; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Login ---------- */
.auth { min-height: 100dvh; display: grid; grid-template-columns: minmax(320px, 1fr) minmax(360px, 1.1fr); }
.auth-brand { position: relative; overflow: hidden; background: var(--sb-bg); color: #dce6fb; display: flex; align-items: flex-end; padding: 48px; }
.auth-brand::before { content: ''; position: absolute; inset: -20% -30% auto auto; width: 560px; height: 560px; background: radial-gradient(closest-side, rgba(47, 123, 240, .45), transparent); }
.auth-brand::after { content: ''; position: absolute; right: 48px; top: 64px; width: 220px; height: 300px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 6px; box-shadow: 36px 30px 0 -1px rgba(255, 255, 255, .05), 36px 30px 0 0 rgba(255, 255, 255, .1); transform: skewY(-8deg); }
.auth-foto { position: absolute; right: 0; bottom: 0; height: 86%; width: auto; max-width: 80%; object-fit: cover; object-position: top; opacity: .85;
  -webkit-mask-image: linear-gradient(to left, #000 40%, transparent 95%), linear-gradient(to bottom, transparent, #000 30%); -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to left, #000 40%, transparent 95%), linear-gradient(to bottom, transparent, #000 30%); mask-composite: intersect; }
.auth-brand-in h2, .auth-brand-in li { text-shadow: 0 1px 12px rgba(11, 29, 68, .8); }
.auth-brand:has(.auth-foto)::after { display: none; }
.auth-brand::before { z-index: 0; }
.auth-brand-in { position: relative; z-index: 1; max-width: 380px; }
.auth-brand h2 { font-size: 2rem; color: #fff; margin: 28px 0 18px; }
.auth-brand ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.auth-brand li { display: flex; gap: 12px; align-items: center; color: #b9cbef; }
.auth-brand li .ic { color: #7fb2ff; }
.auth-form { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: min(380px, 100%); display: grid; gap: 14px; }
.auth-card h1 { font-size: 1.7rem; color: var(--navy); margin: 0; }
.auth-card > .muted { margin: -8px 0 6px; }
.auth-foot { font-size: .86rem; color: var(--muted); text-align: center; margin: 4px 0 0; }
.auth-foot a { color: var(--muted); }
.logo-light .logo-text { color: #fff; }
.logo-light .logo-text span { color: #7fb2ff; }
@media (max-width: 820px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
}

/* ---------- Estrutura ---------- */
.shell { display: grid; grid-template-columns: 256px 1fr; min-height: 100dvh; }
.sb { position: sticky; top: 0; height: 100dvh; background: var(--sb-bg); color: var(--sb-ink); display: flex; flex-direction: column; padding: 18px 12px; z-index: var(--z-sb); }
.sb-top { display: flex; align-items: center; justify-content: space-between; padding: 4px 10px 22px; }
.sb-top .logo-text { font-size: 1.1rem; }
.sb-close { display: none; background: none; border: 0; color: var(--sb-ink); cursor: pointer; }
.sb-nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; scrollbar-width: none; }
.sb-nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: var(--sb-ink); text-decoration: none; font-weight: 600; font-size: .92rem; transition: background .15s, color .15s; }
.sb-nav a:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.sb-nav a[aria-current='page'] { background: rgba(127, 178, 255, .14); color: #fff; }
.sb-nav a[aria-current='page']::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #7fb2ff; }
.sb-group { margin: 18px 12px 6px; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--sb-ink-2); }
.sb-badge { margin-left: auto; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 6px; background: #2f7bf0; color: #fff; font-size: .74rem; font-weight: 800; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.sb-badge.hot { background: #e5533d; }
.sb-foot { border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 12px; display: grid; gap: 10px; }
.sb-link { display: flex; align-items: center; gap: 10px; padding: 8px 12px; color: var(--sb-ink); text-decoration: none; font-size: .88rem; font-weight: 600; border-radius: 10px; }
.sb-link:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, .04); }
.sb-user strong { display: block; color: #fff; font-size: .9rem; line-height: 1.2; }
.sb-user small { color: var(--sb-ink-2); font-size: .76rem; }
.avatar { width: 36px; height: 36px; border-radius: 10px; overflow: hidden; flex: none; background: #1d3670; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.sb-out { margin-left: auto; background: none; border: 0; color: var(--sb-ink-2); cursor: pointer; padding: 6px; border-radius: 8px; }
.sb-out:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.sb-scrim { display: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px; padding: 18px 32px; background: rgba(243, 246, 251, .88); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; }
.topbar.scrolled { border-bottom-color: var(--edge); }
.tb-menu { display: none; background: #fff; border: 1px solid var(--edge); border-radius: 10px; width: 40px; height: 40px; place-items: center; cursor: pointer; color: var(--navy); }
.tb-title h1 { font-size: 1.45rem; color: var(--navy); margin: 0; letter-spacing: -0.02em; }
.tb-title p { margin: 2px 0 0; font-size: .88rem; }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.db-pill { display: inline-flex; align-items: center; gap: 7px; font-size: .78rem; font-weight: 700; padding: 6px 11px; border-radius: 8px; background: var(--ok-bg); color: var(--ok); }
.db-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.db-pill.off { background: var(--warn-bg); color: var(--warn); }
.content { padding: 8px 32px 120px; max-width: 1320px; width: 100%; }
.content > section { display: grid; gap: 20px; animation: entra .28s ease; }
@keyframes entra { from { opacity: 0; transform: translateY(6px); } }
.content-foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--edge); }

/* ---------- Blocos ---------- */
.grid { display: grid; gap: 20px; align-items: start; }
.grid.tight { gap: 12px; }
.g-1-1 { grid-template-columns: 1fr 1fr; }
.g-2-1 { grid-template-columns: 1.7fr 1fr; }
.g-1-2 { grid-template-columns: 1fr 1.6fr; }
.g-1-1-1 { grid-template-columns: repeat(3, 1fr); }
.panel { background: var(--panel); border: 1px solid var(--edge); border-radius: var(--r-lg); padding: 20px 22px; box-shadow: var(--sh-1); min-width: 0; }
.panel.flush { padding: 0; overflow: hidden; }
.panel h3 { font-size: 1rem; color: var(--navy); margin: 0; letter-spacing: -0.01em; }
.panel h3.mt { margin-top: 8px; }
.panel-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.panel-h.pad { padding: 18px 22px 0; }
.panel-h p { margin: 2px 0 0; }
.panel-foot { padding: 12px 16px; border-top: 1px solid var(--edge-2); background: #fbfcfe; }
.hint { margin: 0; padding: 12px 16px; border-radius: var(--r-md); background: #e9f1ff; color: #22407a; font-size: .9rem; }
.hint a { font-weight: 700; }

.hello { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.hello h2 { font-size: 1.6rem; color: var(--navy); margin: 0 0 2px; }
.hello p { margin: 0; }
.seg { display: inline-flex; background: #fff; border: 1px solid var(--edge); border-radius: 10px; padding: 3px; }
.seg button { background: none; border: 0; padding: 7px 12px; border-radius: 7px; font-weight: 700; font-size: .84rem; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed='true'] { background: var(--navy); color: #fff; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--edge); border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--sh-1); display: grid; gap: 6px; }
.kpi-l { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .84rem; font-weight: 600; }
.kpi-l .ic { width: 16px; height: 16px; color: var(--blue); }
.kpi-v { font-size: 1.85rem; font-weight: 800; color: var(--navy); letter-spacing: -0.03em; line-height: 1.1; }
.kpi-d { font-size: .8rem; color: var(--muted); display: flex; align-items: center; flex-wrap: wrap; gap: 2px 6px; }
.kpi-d b { font-weight: 800; white-space: nowrap; }
.kpi-d .up { color: var(--ok); }
.kpi-d .down { color: var(--bad); }

/* Gráfico de colunas */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid-l { stroke: var(--edge-2); stroke-width: 1; }
.chart .axis-t { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .bar { fill: var(--blue); transition: fill .15s; pointer-events: none; }
.chart .hit { fill: transparent; }
.chart .hit.on-tip { fill: rgba(21, 82, 201, .06); }
.chart .hit.on-tip + .bar { fill: #0f3f9e; }
.chart .lbl { fill: var(--navy); font-size: 11px; font-weight: 700; pointer-events: none; }
.chart-empty { display: grid; place-items: center; height: 220px; color: var(--muted); font-size: .92rem; text-align: center; }
.chart table { width: 100%; font-size: .86rem; border-collapse: collapse; }
.chart table td, .chart table th { padding: 6px 8px; border-bottom: 1px solid var(--edge-2); text-align: left; }
.chart table td:last-child, .chart table th:last-child { text-align: right; font-variant-numeric: tabular-nums; }

/* Barras horizontais (funil, serviços) */
.hbars { display: grid; gap: 14px; }
.hb { display: grid; gap: 6px; }
.hb-top { display: flex; justify-content: space-between; gap: 10px; font-size: .88rem; }
.hb-top span { color: var(--ink-2); font-weight: 600; }
.hb-top b { color: var(--navy); font-variant-numeric: tabular-nums; }
.hb-top b small { color: var(--muted); font-weight: 600; margin-left: 4px; }
.hb-track { height: 10px; border-radius: 4px; background: #e8eef9; overflow: hidden; }
.hb-fill { height: 100%; border-radius: 0 4px 4px 0; background: var(--blue); min-width: 2px; transform-origin: left; animation: cresce .6s cubic-bezier(.2, .8, .2, 1); }
@keyframes cresce { from { transform: scaleX(0); } }

/* Alertas */
.alerts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.alerts li { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: var(--r-md); background: #fbfcfe; border: 1px solid var(--edge-2); font-size: .9rem; }
.alerts .ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.alerts .ico.bad { background: var(--bad-bg); color: var(--bad); }
.alerts .ico.warn { background: var(--warn-bg); color: var(--warn); }
.alerts .ico.ok { background: var(--ok-bg); color: var(--ok); }
.alerts strong { display: block; color: var(--navy); }
.alerts a { font-weight: 700; font-size: .84rem; }

/* Atendimento resumo */
.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mini { padding: 12px; border-radius: var(--r-md); background: #fbfcfe; border: 1px solid var(--edge-2); }
.mini span { display: block; font-size: .78rem; color: var(--muted); font-weight: 600; }
.mini b { font-size: 1.35rem; color: var(--navy); letter-spacing: -0.02em; }
.equipe-status { margin-top: 12px; font-size: .86rem; display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #b7c2d6; flex: none; }
.dot.on { background: #22c26b; box-shadow: 0 0 0 3px #d7f5e4; }

/* Checklist */
.meter-wrap { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.meter { flex: 1; height: 8px; border-radius: 4px; background: #e8eef9; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--blue); border-radius: 0 4px 4px 0; transition: width .5s ease; }
.meter-wrap b { font-size: .9rem; color: var(--navy); font-variant-numeric: tabular-nums; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 24px; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--edge-2); font-size: .9rem; }
.checklist .st { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; flex: none; margin-top: 1px; }
.checklist .st .ic { width: 14px; height: 14px; stroke-width: 2.4; }
.checklist .feito .st { background: var(--ok-bg); color: var(--ok); }
.checklist .falta .st { background: var(--warn-bg); color: var(--warn); }
.checklist .feito strong { color: var(--muted); font-weight: 600; }
.checklist strong { display: block; color: var(--navy); }
.checklist small { color: var(--muted); }
.checklist a { margin-left: auto; white-space: nowrap; font-weight: 700; font-size: .84rem; text-decoration: none; }

/* Tabelas */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { position: sticky; top: 0; background: #fbfcfe; text-align: left; font-size: .74rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 11px 14px; border-bottom: 1px solid var(--edge); white-space: nowrap; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--edge-2); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .input { padding: 8px 10px; border-radius: 9px; font-size: .9rem; min-width: 90px; }
.tbl td.n .input { max-width: 130px; text-align: right; font-variant-numeric: tabular-nums; }
.tbl a { word-break: break-all; }
.tbl-leads tbody tr { cursor: pointer; transition: background .12s; }
.tbl-leads tbody tr:hover { background: #f7f9fd; }
.tbl .cli strong { display: block; color: var(--navy); }
.tbl .cli small, .tbl .sub { color: var(--muted); font-size: .8rem; }
.tbl .v { font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .t { color: var(--muted); font-size: .84rem; white-space: nowrap; }
.del { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 8px; display: grid; place-items: center; }
.del:hover { color: var(--bad); background: var(--bad-bg); }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--navy); font-size: 1.05rem; margin-bottom: 4px; }

/* Etiquetas de etapa */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 7px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.s-novo { background: #e6efff; color: #1552c9; }
.pill.s-contatado { background: var(--warn-bg); color: var(--warn); }
.pill.s-visita-agendada { background: #e3f4f6; color: #0d6b78; }
.pill.s-orcamento-enviado { background: #efe9fd; color: #5b3cc4; }
.pill.s-fechado { background: var(--ok-bg); color: var(--ok); }
.pill.s-perdido { background: #eef1f5; color: #6b778c; }
.pill.s-aguardando { background: var(--warn-bg); color: var(--warn); }
.pill.s-em_atendimento { background: #e6efff; color: #1552c9; }
.pill.s-encerrada { background: #eef1f5; color: #6b778c; }
.origem { font-size: .78rem; color: var(--muted); display: inline-flex; gap: 5px; align-items: center; }
.origem .ic { width: 14px; height: 14px; }
.temp { font-size: .74rem; font-weight: 800; padding: 2px 8px; border-radius: 6px; }
.temp.quente { background: #ffe9e3; color: #c2410c; }
.temp.morno { background: var(--warn-bg); color: var(--warn); }

/* Filtros */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.search { position: relative; flex: 1 1 260px; max-width: 380px; }
.search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search .input { padding-left: 38px; }
.toolbar .chips { margin: 0; }
.toolbar .chip { padding: 7px 12px; font-size: .84rem; }
.toolbar .chip b { font-variant-numeric: tabular-nums; margin-left: 4px; opacity: .7; }

/* Produtos */
.prods { display: grid; grid-template-columns: repeat(auto-fill, minmax(460px, 1fr)); gap: 16px; }
.prod { background: var(--panel); border: 1px solid var(--edge); border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--sh-1); }
.prod-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.prod-head strong { color: var(--navy); }
.prod-head .tag { font-size: .72rem; font-weight: 700; background: var(--ice); color: var(--muted); padding: 3px 9px; border-radius: 6px; }
.prod-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.prod-grid .field label { font-size: .74rem; }
.prod-grid .input { padding: 9px 10px; font-variant-numeric: tabular-nums; }
.prod-vidros { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.prod-vidros label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; font-size: .8rem; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--edge); color: var(--ink-2); }
.prod-vidros label:has(input:checked) { background: #e9f1ff; border-color: #bcd2fb; color: #163f94; }
.prod-vidros input { accent-color: var(--blue); }
.prod-ex { margin-top: 14px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.prod-ex div { padding: 10px 12px; border-radius: 10px; background: #fbfcfe; border: 1px solid var(--edge-2); }
.prod-ex span { display: block; font-size: .72rem; color: var(--muted); font-weight: 600; }
.prod-ex b { color: var(--navy); font-variant-numeric: tabular-nums; }
.prod-ex .lucro b { color: var(--ok); }
.prod-ex .warn { grid-column: 1 / -1; background: var(--warn-bg); color: var(--warn); border: 0; font-size: .86rem; }

/* Simulador */
.sim-out { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.sim-out div { padding: 14px; border-radius: var(--r-md); background: #fbfcfe; border: 1px solid var(--edge-2); }
.sim-out span { display: block; font-size: .78rem; color: var(--muted); font-weight: 600; }
.sim-out b { font-size: 1.3rem; color: var(--navy); letter-spacing: -0.02em; }
.sim-out .destaque { background: var(--navy); border: 0; }
.sim-out .destaque span { color: #a9bbdf; }
.sim-out .destaque b { color: #fff; }
.formula-box { border-top: 1px solid var(--edge-2); padding-top: 12px; }
.formula-box summary { cursor: pointer; font-weight: 700; color: var(--blue); font-size: .88rem; }
.formula { padding-left: 20px; font-size: .88rem; display: grid; gap: 6px; color: var(--ink-2); margin: 12px 0 0; }

/* Depoimentos */
.deps { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.dep-card { background: var(--panel); border: 1px solid var(--edge); border-radius: var(--r-lg); padding: 16px; display: grid; gap: 10px; box-shadow: var(--sh-1); }
.dep-card .row { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px; align-items: end; }
.dep-card textarea { min-height: 90px; }
.deps .empty { grid-column: 1 / -1; background: var(--panel); border: 1px dashed var(--edge); border-radius: var(--r-lg); }

/* Equipe */
.team { list-style: none; margin: 0; padding: 0; }
.team li { display: flex; align-items: center; gap: 12px; padding: 14px 22px; border-top: 1px solid var(--edge-2); }
.team .avatar { background: #e6efff; color: var(--blue); display: grid; place-items: center; font-weight: 800; }
.team .who strong { display: block; color: var(--navy); }
.team .who small { color: var(--muted); }
.team .acts { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* Detalhe do pedido */
.drawer { position: fixed; inset: 0; z-index: var(--z-drawer); background: rgba(11, 29, 68, .35); display: flex; justify-content: flex-end; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.drawer-in { width: min(480px, 100%); height: 100%; background: var(--bg); box-shadow: var(--sh-2); display: flex; flex-direction: column; animation: slide .25s cubic-bezier(.2, .8, .2, 1); }
@keyframes slide { from { transform: translateX(40px); opacity: .6; } }
.drawer-h { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; padding: 20px 22px; background: #fff; border-bottom: 1px solid var(--edge); }
.drawer-h h2 { font-size: 1.25rem; color: var(--navy); margin: 0; }
.drawer-h p { margin: 2px 0 0; }
.drawer-b { flex: 1; overflow-y: auto; padding: 18px 22px 40px; display: grid; gap: 16px; align-content: start; }
.d-sec { background: #fff; border: 1px solid var(--edge); border-radius: var(--r-md); padding: 14px 16px; }
.d-sec h4 { margin: 0 0 10px; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.d-sec dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .9rem; }
.d-sec dt { color: var(--muted); }
.d-sec dd { margin: 0; color: var(--ink); }
.d-sec ul { margin: 0; padding-left: 18px; font-size: .9rem; display: grid; gap: 4px; }
.d-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.d-nums div { background: #fbfcfe; border: 1px solid var(--edge-2); border-radius: 10px; padding: 8px 10px; }
.d-nums span { display: block; font-size: .72rem; color: var(--muted); font-weight: 600; }
.d-nums b { color: var(--navy); font-variant-numeric: tabular-nums; }
.d-nums .lucro b { color: var(--ok); }
.etapas { display: flex; flex-wrap: wrap; gap: 6px; }
.etapas button { border: 1px solid var(--edge); background: #fff; border-radius: 8px; padding: 7px 11px; font-weight: 700; font-size: .82rem; color: var(--ink-2); cursor: pointer; }
.etapas button[aria-pressed='true'] { background: var(--navy); border-color: var(--navy); color: #fff; }
.d-acts { display: flex; gap: 8px; flex-wrap: wrap; }

/* Barra de salvar, toast e tooltip */
.savebar { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: var(--z-bar); background: var(--sb-bg); color: #fff; border-radius: 14px; padding: 8px 8px 8px 18px; display: flex; gap: 18px; align-items: center; box-shadow: var(--sh-2); width: max-content; max-width: calc(100vw - 24px); flex-wrap: wrap; animation: sobe .25s cubic-bezier(.2, .8, .2, 1); }
@keyframes sobe { from { transform: translate(-50%, 20px); opacity: 0; } }
.savebar > span { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem; }
.savebar > span .ic { width: 10px; height: 10px; fill: #ffb547; stroke: none; }
.savebar-a { display: flex; gap: 6px; }
.toast { position: fixed; top: 20px; right: 20px; z-index: var(--z-toast); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: .9rem; opacity: 0; transform: translateY(-8px); transition: all .2s; pointer-events: none; max-width: min(380px, calc(100vw - 40px)); }
.toast.show { opacity: 1; transform: none; }
.toast.err { background: var(--bad); }
.tip { position: fixed; z-index: var(--z-tip); pointer-events: none; background: var(--ink); color: #fff; font-size: .8rem; padding: 7px 10px; border-radius: 8px; box-shadow: var(--sh-2); white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); }
.tip b { font-variant-numeric: tabular-nums; }

/* Responsivo */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .g-1-1-1 { grid-template-columns: 1fr 1fr; }
  .g-1-1-1 > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sb { position: fixed; left: 0; top: 0; width: 272px; transform: translateX(-100%); transition: transform .25s ease; }
  .sb.open { transform: none; box-shadow: var(--sh-2); }
  .sb-close { display: grid; }
  .sb-scrim.open { display: block; position: fixed; inset: 0; z-index: calc(var(--z-sb) - 1); background: rgba(11, 29, 68, .35); }
  .tb-menu { display: grid; }
  .topbar { padding: 14px 16px; }
  .content { padding: 8px 16px 120px; }
  .g-2-1, .g-1-2, .g-1-1 { grid-template-columns: 1fr; }
  .checklist { grid-template-columns: 1fr; }
  .prods { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .g-1-1-1 { grid-template-columns: 1fr; }
  .kpi-v { font-size: 1.5rem; }
  .prod-grid { grid-template-columns: repeat(2, 1fr); }
  .tb-site, .db-pill { display: none; }
  .dep-card .row { grid-template-columns: 1fr 1fr; }
  .tbl-leads .h-sm { display: none; }
  .panel-h { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  .content > section, .hb-fill, .drawer, .drawer-in, .savebar { animation: none; }
}

/* Fornecedores */
.forn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.forn-card { background: var(--panel); border: 1px solid var(--edge); border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--sh-1); display: grid; gap: 14px; cursor: pointer; transition: border-color .15s, box-shadow .2s, transform .15s; }
.forn-card:hover { border-color: #bcd2fb; box-shadow: 0 8px 24px rgba(11, 29, 68, .08); transform: translateY(-1px); }
.forn-card header { display: flex; gap: 12px; align-items: center; }
.forn-card header strong { display: block; color: var(--navy); }
.forn-card header small { color: var(--muted); font-size: .8rem; }
.forn-card .avatar { background: #e6efff; color: var(--blue); display: grid; place-items: center; font-weight: 800; }
.forn-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.forn-stats div { background: #fbfcfe; border: 1px solid var(--edge-2); border-radius: 10px; padding: 8px 10px; }
.forn-stats span { display: block; font-size: .72rem; color: var(--muted); font-weight: 600; }
.forn-stats b { color: var(--navy); font-variant-numeric: tabular-nums; }
.forn-card footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.stack-lg { display: grid; gap: 20px; }
.tbl.cmp td.best { background: var(--ok-bg); color: var(--ok); font-weight: 700; }
.tbl.cmp td.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl.cmp th:not(:first-child) { text-align: right; }
.tbl select.fonte { min-width: 150px; }
.sub.warn-t { color: var(--warn); }
.kit-fonte { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); font-weight: 600; }
.kit-orig { margin: 8px 0 0; }
.prod-grid .input:disabled, .tbl .input:disabled { background: #f3f6fb; color: var(--ink-2); cursor: not-allowed; }
.drawer.largo .drawer-in { width: min(620px, 100%); }
.price-rows { display: grid; gap: 6px; }
.price-row { display: grid; grid-template-columns: 1fr 130px 70px; gap: 10px; align-items: center; font-size: .88rem; color: var(--ink-2); }
.price-rows.kits .price-row, .price-rows.kits .price-head { grid-template-columns: 1fr 120px 120px 60px; }
.price-head { display: grid; gap: 10px; font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.price-row .input { padding: 8px 10px; font-size: .9rem; text-align: right; font-variant-numeric: tabular-nums; }
.price-row .input-suffix span { left: 10px; right: auto; }
.price-row .input-suffix .input { padding-right: 10px; padding-left: 32px; }
.var { font-size: .74rem; font-weight: 800; white-space: nowrap; }
.var.sobe { color: var(--bad); }
.var.desce { color: var(--ok); }
.btn.danger { color: var(--bad); border-color: #f3c9c4; }
.btn.danger:hover { background: var(--bad-bg); }
.links-lista { display: grid; gap: 8px; }
.link-row { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 8px; align-items: center; }
@media (max-width: 640px) {
  .price-row, .price-rows.kits .price-row, .price-rows.kits .price-head { grid-template-columns: 1fr 1fr; }
  .price-row > span:first-child { grid-column: 1 / -1; font-weight: 700; }
  .link-row { grid-template-columns: 1fr auto; }
  .link-row .input:nth-child(2) { grid-column: 1; }
}

/* Clientes, compras e galeria */
.grid .field.full, .grid .full { grid-column: 1 / -1; }
.d-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.d-lista button { width: 100%; display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--edge-2); background: #fbfcfe; cursor: pointer; font: inherit; font-size: .86rem; text-align: left; color: var(--ink-2); }
.d-lista button:hover { border-color: #bcd2fb; background: #f5f8ff; }
.d-lista b { color: var(--navy); font-variant-numeric: tabular-nums; }
.tbl-mini td { padding: 8px 4px; }
.d-total { margin: 10px 0 0; text-align: right; color: var(--muted); }
.d-total b { color: var(--navy); font-size: 1.05rem; }
.texto-pedido { margin: 0; white-space: pre-wrap; font: inherit; font-size: .85rem; background: #fbfcfe; border: 1px dashed var(--edge); border-radius: 10px; padding: 12px; color: var(--ink-2); max-height: 320px; overflow: auto; }
.ok-t { color: var(--ok) !important; font-weight: 700; }

.upload-box { display: grid; gap: 14px; }
.drop { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 28px 16px; border: 2px dashed #bcd2fb; border-radius: var(--r-lg); background: #f6f9ff; cursor: pointer; transition: background .15s, border-color .15s; }
.drop:hover, .drop.sobre { background: #eaf1ff; border-color: var(--blue); }
.drop .ic { width: 30px; height: 30px; color: var(--blue); }
.drop strong { color: var(--navy); }
.drop.off { opacity: .5; pointer-events: none; }
.up-opcoes { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; font-size: .88rem; font-weight: 600; color: var(--ink-2); }
.up-opcoes label { display: inline-flex; gap: 8px; align-items: center; }
.up-fila { display: grid; gap: 6px; }
.up-fila:empty { display: none; }
.up-item { display: grid; grid-template-columns: minmax(0, 1fr) 160px 110px; gap: 12px; align-items: center; font-size: .84rem; padding: 8px 12px; border-radius: 10px; background: #fbfcfe; border: 1px solid var(--edge-2); }
.up-nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-barra { height: 6px; border-radius: 3px; background: #e8eef9; overflow: hidden; }
.up-barra span { display: block; height: 100%; width: 0; background: var(--blue); transition: width .2s; }
.up-status { text-align: right; color: var(--muted); font-weight: 700; }
.up-item.feito .up-barra span { width: 100% !important; background: var(--ok); }
.up-item.feito .up-status { color: var(--ok); }
.up-item.erro .up-status { color: var(--bad); }
.trab-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.trab-admin > .empty { grid-column: 1 / -1; background: var(--panel); border: 1px dashed var(--edge); border-radius: var(--r-lg); }
.tr-card { background: var(--panel); border: 1px solid var(--edge); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-1); display: flex; flex-direction: column; }
.tr-thumb { position: relative; aspect-ratio: 4 / 3; background: #e9eef7; }
.tr-thumb img, .tr-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.tr-tag { position: absolute; left: 10px; top: 10px; background: rgba(11, 29, 68, .8); color: #fff; font-size: .74rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
.tr-campos { padding: 12px; display: grid; gap: 8px; }
.tr-campos .input { padding: 8px 10px; font-size: .9rem; }
.tr-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tr-acts { display: flex; align-items: center; gap: 6px; }
.tr-acts .icon-btn { width: 32px; height: 32px; }
.tr-star { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--edge); background: #fff; border-radius: 8px; padding: 6px 10px; font: inherit; font-size: .8rem; font-weight: 700; color: var(--muted); cursor: pointer; }
.tr-star .ic { width: 15px; height: 15px; }
.tr-star[aria-pressed='true'] { background: #fff4d6; border-color: #f1d08a; color: #9a6200; }
.tr-star[aria-pressed='true'] .ic { fill: currentColor; }
.tr-salvo { font-size: .76rem; color: var(--ok); font-weight: 700; margin-left: auto; }
.tr-acts .del { margin-left: 4px; }
@media (max-width: 640px) {
  .up-item { grid-template-columns: 1fr; gap: 4px; }
  .up-status { text-align: left; }
}

/* ---------- Agenda da equipe de campo ---------- */
.warn-t { color: var(--warn); font-weight: 700; }
.tbl tr.ag-dia th { background: var(--edge-2); color: var(--navy); font-size: .8rem; text-transform: none; letter-spacing: 0; padding: 8px 22px; text-align: left; }
.tbl tr.ag-dia:first-child th { border-top: 0; }
.vis-mini { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.vis-mini li { display: grid; gap: 1px; }
.vis-mini .link-btn { padding: 0; text-align: left; font-size: .9rem; }
.vis-mini small { color: var(--muted); }
.vis-med td { vertical-align: top; }
.vis-med .sub { font-size: .8rem; color: var(--muted); }
.vis-obs { background: #fbfcfe; border: 1px solid var(--edge-2); border-radius: 10px; padding: 10px 12px; font-size: .9rem; margin: 10px 0 0; }
.vis-fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 10px; }
.vis-foto { position: relative; display: block; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--edge-2); cursor: pointer; }
.vis-foto img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.vis-foto:hover img { transform: scale(1.04); }
.vis-foto input { position: absolute; top: 6px; left: 6px; width: 20px; height: 20px; accent-color: var(--blue); }
.vis-foto:has(input:checked) { outline: 3px solid var(--blue); outline-offset: -3px; }
.vis-foto span:not(:empty) { position: absolute; inset: auto 0 0; background: rgba(21, 145, 74, .9); color: #fff; font-size: .72rem; font-weight: 700; text-align: center; padding: 3px; }
.vis-foto.pub { cursor: default; opacity: .8; }
.vis-orc { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .9rem; }
.vis-orc li { display: flex; justify-content: space-between; gap: 12px; }
.vis-orc small { display: block; color: var(--muted); font-size: .8rem; }
.vis-orc b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.vis-hist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .86rem; }
.vis-hist li span { color: var(--muted); font-size: .78rem; margin-right: 8px; font-variant-numeric: tabular-nums; }
.team .papel { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 6px; background: #e6efff; color: var(--blue); font-size: .7rem; font-weight: 800; vertical-align: 2px; }
.team .papel.vid, .team .avatar.vid { background: var(--ok-bg); color: var(--ok); }
.seg-full { display: flex; }
.seg-full button { flex: 1; }
.check-line { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; color: var(--ink-2); cursor: pointer; }
.check-line input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--blue); flex: none; }

/* ---------- Ordens de serviço ---------- */
.os-prox { margin: 0; padding: 10px 12px; border-radius: 10px; background: #eef4ff; color: #1d3b73; font-weight: 600; font-size: .92rem; }
.os-par-a { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--edge); border-radius: 10px; margin-bottom: 8px; }
.os-par-a.pago { background: #f3fbf6; border-color: #cbead7; }
.os-par-a > div .num { font-weight: 800; color: var(--navy); margin-left: 6px; }
.os-par-a small { grid-column: 1; color: var(--muted); }
.os-par-a > button { grid-row: 1 / span 2; grid-column: 2; }
.os-rep-a { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.os-cancel { color: var(--bad); border-color: #f1c9c5; }
.os-cancel:hover { color: var(--bad); border-color: var(--bad); }
#repasses .acts b { color: var(--navy); margin-right: 6px; }

/* ---------- Verificação em duas etapas ---------- */
.seg2fa { margin-top: 18px; }
.seg-h { display: flex; gap: 14px; align-items: flex-start; }
.seg-h h3 { margin: 0 0 4px; }
.seg-h p { margin: 0; max-width: 68ch; }
.seg-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--warn-bg); font-size: 1.2rem; flex: none; }
.seg-ico.ok { background: var(--ok-bg); }
.seg-rec { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 6px; background: var(--warn-bg); color: var(--warn); font-size: .7rem; font-weight: 800; vertical-align: 2px; }
.seg-passos { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 14px; font-size: .92rem; }
.seg-qr { margin: 10px 0 6px; padding: 10px; background: #fff; border: 1px solid var(--edge); border-radius: 14px; width: fit-content; }
.seg-qr svg { display: block; }
.seg-chave { font-size: .9rem; letter-spacing: .06em; background: var(--edge-2); padding: 2px 6px; border-radius: 6px; }
.seg-conf { display: flex; gap: 8px; margin-top: 8px; max-width: 360px; }
.seg-conf .input { font-size: 1.2rem; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.seg-reservas { list-style: none; margin: 8px 0 12px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.seg-reservas code { display: block; padding: 8px 10px; border-radius: 8px; background: var(--edge-2); font-size: .95rem; letter-spacing: .05em; text-align: center; }
.seg-alerta { border-left: 3px solid var(--warn); }
