:root {
  color-scheme: light;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --bg: #f2f4f7;
  --bg-glow: rgba(20, 184, 166, 0.12);
  --bg-glow-2: rgba(99, 102, 241, 0.08);
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef2f6;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e6eaf0;
  --line-strong: #d6dce5;
  --brand: #0d9488;
  --brand-strong: #0f766e;
  --brand-ink: #ffffff;
  --brand-soft: #e7f7f5;
  --brand-soft-ink: #0f6b63;
  --ring: rgba(13, 148, 136, 0.2);
  --pj: #6366f1;
  --pj-soft: #eef0ff;
  --pj-ink: #4338ca;
  --pf: #0d9488;
  --pf-soft: #e3f6f3;
  --pf-ink: #0f6b63;
  --accent: #f59e0b;
  --accent-strong: #d97706;
  --accent-soft: #fff4dc;
  --accent-ink: #92400e;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --danger-ink: #b91c1c;
  --success: #16a34a;
  --success-soft: #e5f6ea;
  --success-ink: #15803d;
  --sidebar: #0b1220;
  --sidebar-2: #121b2f;
  --sidebar-ink: #94a3b8;
  --toast-bg: #0f172a;
  --toast-ink: #f8fafc;
  --backdrop: rgba(2, 6, 23, 0.45);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-hover: 0 2px 4px rgba(15, 23, 42, 0.05), 0 16px 36px rgba(15, 23, 42, 0.1);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.2);
  --avatar-s: 70%;
  --avatar-l: 91%;
  --avatar-ink-l: 30%;
  --radius: 16px;
  --radius-sm: 10px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0f1a;
  --bg-glow: rgba(20, 184, 166, 0.09);
  --bg-glow-2: rgba(99, 102, 241, 0.08);
  --surface: #111827;
  --surface-2: #0e1522;
  --surface-3: #1a2333;
  --ink: #e8edf5;
  --ink-2: #c3cddb;
  --muted: #8b98ab;
  --line: #1f2a3c;
  --line-strong: #2b384d;
  --brand: #14b8a6;
  --brand-strong: #0d9488;
  --brand-ink: #04201d;
  --brand-soft: rgba(20, 184, 166, 0.14);
  --brand-soft-ink: #5eead4;
  --ring: rgba(20, 184, 166, 0.28);
  --pj: #818cf8;
  --pj-soft: rgba(129, 140, 248, 0.15);
  --pj-ink: #a5b4fc;
  --pf: #2dd4bf;
  --pf-soft: rgba(45, 212, 191, 0.13);
  --pf-ink: #5eead4;
  --accent: #fbbf24;
  --accent-strong: #f59e0b;
  --accent-soft: rgba(251, 191, 36, 0.14);
  --accent-ink: #fcd34d;
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.14);
  --danger-ink: #fca5a5;
  --success: #4ade80;
  --success-soft: rgba(74, 222, 128, 0.13);
  --success-ink: #86efac;
  --sidebar: #060a12;
  --sidebar-2: #0d1422;
  --toast-bg: #1e293b;
  --toast-ink: #f1f5f9;
  --backdrop: rgba(0, 0, 0, 0.6);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.35), 0 18px 40px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 30px 70px rgba(0, 0, 0, 0.6);
  --avatar-s: 38%;
  --avatar-l: 25%;
  --avatar-ink-l: 82%;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden], .hidden { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 520px at 100% -8%, var(--bg-glow), transparent 60%),
    radial-gradient(700px 420px at 20% 110%, var(--bg-glow-2), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, h4, p { margin: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.ico {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.ico.xs { width: 14px; height: 14px; }
.ico.lg { width: 22px; height: 22px; }
.ico.xl { width: 34px; height: 34px; stroke-width: 1.6; }
.spin { animation: spin 0.8s linear infinite; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- layout ---------- */
.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
}

.sidebar {
  position: sticky; top: 0; height: 100vh;
  background: linear-gradient(180deg, var(--sidebar-2), var(--sidebar));
  color: #fff;
  padding: 22px 14px;
  display: flex; flex-direction: column; gap: 26px;
  z-index: 30;
}

.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #2dd4bf, #0d9488 55%, #6366f1);
  box-shadow: 0 8px 22px -6px rgba(45, 212, 191, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.brand strong { display: block; font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.brand span { display: block; color: var(--sidebar-ink); font-size: 12px; }

.nav { display: grid; gap: 4px; }
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  border: 0; border-radius: 11px;
  background: transparent; color: var(--sidebar-ink);
  padding: 11px 12px;
  font-weight: 600; text-align: left;
  transition: background 0.2s, color 0.2s, transform 0.2s var(--ease);
}
.nav-item:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.nav-item:active { transform: scale(0.98); }
.nav-item.active { color: #fff; background: rgba(45, 212, 191, 0.14); }
.nav-item::before {
  content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 3px;
  border-radius: 0 3px 3px 0; background: #2dd4bf;
  transform: scaleY(0); transition: transform 0.25s var(--ease);
}
.nav-item.active::before { transform: scaleY(1); }
.nav-item.active .ico { color: #5eead4; }
.nav-count {
  margin-left: auto; font-style: normal; font-size: 11px; font-weight: 700;
  background: rgba(255, 255, 255, 0.1); color: #e2e8f0;
  padding: 2px 8px; border-radius: 999px;
}

.sidebar-foot { margin-top: auto; }
.user-card {
  display: grid; gap: 10px; padding: 12px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.07);
}
.user-top { display: flex; align-items: center; gap: 10px; }
.user-info { flex: 1; min-width: 0; }
.user-info strong { display: block; color: #f1f5f9; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-info span { display: block; color: var(--sidebar-ink); font-size: 11.5px; }
.user-out { color: var(--sidebar-ink); }
.user-out:hover { color: #fff; background: rgba(255, 255, 255, 0.08) !important; }
.sync-status { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--sidebar-ink); }
.sync-status.is-ok .ico { color: #5eead4; }
.sync-status.is-saving .ico, .sync-status.is-loading .ico { color: #fbbf24; }
.sync-status.is-error { color: #fca5a5; }

body.role-vendedor .admin-only { display: none !important; }
.mobile-out { display: none; }

/* ---------- login ---------- */
.auth {
  min-height: 100vh; display: grid; place-items: center;
  padding: 32px max(16px, env(safe-area-inset-right, 0px)) 32px max(16px, env(safe-area-inset-left, 0px));
}
.auth-card {
  width: min(420px, 100%); display: grid; gap: 22px;
  padding: 30px 28px; border-radius: 22px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  animation: rise 0.45s var(--ease);
}
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand strong { display: block; font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.auth-brand span { display: block; color: var(--muted); font-size: 13px; }
.auth-brand .brand-mark { color: #fff; }
.auth-pane { display: grid; gap: 16px; }
.auth-pane h2 { font-size: 20px; font-weight: 800; }
.auth-pane p { color: var(--muted); }
.auth-pane code { font-size: 12px; background: var(--surface-3); padding: 1px 6px; border-radius: 6px; }
.auth-tabs { max-width: none; }
.auth-tabs button { color: var(--muted); }
.auth-tabs button.active { color: var(--brand-strong); }
:root[data-theme="dark"] .auth-tabs button.active { color: var(--brand-soft-ink); }
.auth-tabs[data-active="PJ"]::before { transform: translateX(100%); }
.auth-form { display: grid; gap: 14px; }
.auth-submit { height: 44px; width: 100%; margin-top: 4px; }
.auth-link { justify-self: center; }
.auth-note { color: var(--muted); font-size: 12.5px; text-align: center; }
.auth-wait { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); padding: 18px 0; font-weight: 600; }
.auth-wait-icon {
  width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-ink);
}
.auth-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.auth-msg {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 11px 13px; border-radius: 12px; font-size: 13px; font-weight: 600;
  background: var(--danger-soft); color: var(--danger-ink);
}
.auth-msg.ok { background: var(--success-soft); color: var(--success-ink); }
.auth-card:has(#requestForm:not(.hidden)) { width: min(520px, 100%); }
.req-steps { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.req-steps li {
  flex: 1; display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 10px; background: var(--surface-2);
  color: var(--muted); font-size: 12.5px; font-weight: 700;
  transition: background 0.2s, color 0.2s;
}
.req-steps b {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--surface-3); font-size: 11.5px;
}
.req-steps li.active { background: var(--brand-soft); color: var(--brand-soft-ink); }
.req-steps li.active b, .req-steps li.done b { background: var(--brand); color: var(--brand-ink); }
.req-steps li.done { color: var(--ink-2); }
.req-step { display: grid; gap: 14px; animation: rise 0.3s var(--ease); }
.req-nav { display: flex; gap: 10px; }
.req-nav .auth-submit { flex: 1; margin: 0; }
.req-nav .btn { height: 44px; }
.chip-opt.none.active { border-style: solid; color: var(--brand-soft-ink); }
.chip-select.stacked { display: grid; }
.chip-select.stacked .chip-opt { justify-content: flex-start; text-align: left; height: auto; min-height: 40px; padding: 8px 14px; border-radius: 12px; }
.label-text small, .field label small { color: var(--muted); font-weight: 500; }

/* ---------- painel M7 ---------- */
.platform-only { display: none !important; }
body.is-platform .platform-only { display: revert !important; }
body.is-platform .nav-item.platform-only { display: flex !important; }
.co-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.co-filters button {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); font-weight: 650;
}
.co-filters button.active { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.co-filters em { font-style: normal; font-size: 11.5px; opacity: 0.7; }
.co-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.co-card {
  display: grid; gap: 14px; padding: 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  animation: rise 0.35s var(--ease) both;
}
.co-card.st-pendente { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.co-top { display: flex; gap: 12px; align-items: flex-start; }
.co-top > div { flex: 1; min-width: 0; }
.co-top strong { display: block; font-size: 15.5px; font-weight: 750; overflow-wrap: anywhere; }
.co-top span { display: block; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.co-top > .avatar { display: inline-grid; color: hsl(var(--h, 170) 60% var(--avatar-ink-l)); font-size: 14px; }
.co-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.co-facts div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.co-facts strong { display: block; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.co-facts span { color: var(--muted); font-size: 11.5px; font-weight: 600; }
.co-answers { display: grid; gap: 6px; font-size: 13px; }
.co-answers b { color: var(--muted); font-weight: 650; }
.co-pains { display: flex; flex-wrap: wrap; gap: 5px; }
.co-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.co-controls select, .co-controls input { height: 38px; }
.co-card textarea { min-height: 60px; }
.co-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.st-pill.pendente { background: var(--accent-soft); color: var(--accent-ink); }
.st-pill.teste { background: var(--pj-soft); color: var(--pj-ink); }
.st-pill.ativa { background: var(--success-soft); color: var(--success-ink); }
.st-pill.bloqueada { background: var(--danger-soft); color: var(--danger-ink); }

.user-form { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) auto; gap: 10px; align-items: end; padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 14px; }
.user-form .field-msg { min-height: 0; }
.access-row.off { opacity: 0.55; }
.access-actions { display: flex; gap: 4px; justify-content: flex-end; }
.auth-msg .ico { margin-top: 1px; }

/* ---------- avisos e acessos ---------- */
.notice {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  padding: 16px 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.notice-icon {
  width: 42px; height: 42px; border-radius: 12px; flex: none; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-soft-ink);
}
.notice.warn .notice-icon { background: var(--accent-soft); color: var(--accent-ink); }
.notice-text { flex: 1; min-width: 220px; }
.notice-text strong { display: block; font-weight: 750; }
.notice-text span { color: var(--muted); font-size: 13px; }
.access-list { display: grid; gap: 4px; }
.access-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 150px 190px auto; gap: 10px; align-items: center;
  padding: 9px 10px; border-radius: 11px; transition: background 0.15s;
}
.access-row:hover { background: var(--surface-2); }
.access-row.pending { background: var(--accent-soft); }
.access-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.access-who div { min-width: 0; }
.access-who strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.access-who span { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.access-row select { height: 36px; }
.settings-grid .span-all { grid-column: 1 / -1; }

.main {
  min-width: 0;
  padding: 26px 30px 40px;
  display: grid; gap: 22px; align-content: start;
  max-width: 1440px; width: 100%;
}

.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.eyebrow {
  display: block; color: var(--brand); font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.topbar h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; margin-top: 2px; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 15px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  font-weight: 650; white-space: nowrap; text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s var(--ease), box-shadow 0.18s, background 0.18s, border-color 0.18s, color 0.18s;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-hover); border-color: var(--line-strong); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  border-color: transparent; color: var(--brand-ink);
  box-shadow: 0 8px 20px -8px var(--brand), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn.primary:hover { box-shadow: 0 12px 26px -8px var(--brand), inset 0 1px 0 rgba(255, 255, 255, 0.18); filter: brightness(1.04); }
.btn.accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-color: transparent; color: #fff;
  box-shadow: 0 8px 20px -8px var(--accent);
}
:root[data-theme="dark"] .btn.accent { color: #2a1700; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-3); box-shadow: none; }
.btn.danger-text { color: var(--danger-ink); }
.btn.danger-text:hover { background: var(--danger-soft); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn.loading .ico:first-child { animation: spin 0.8s linear infinite; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; flex: none;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink-2);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s var(--ease), background 0.18s, color 0.18s, border-color 0.18s, opacity 0.18s;
}
.icon-btn:hover { transform: translateY(-1px); color: var(--ink); background: var(--surface-2); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 9px; }
.icon-btn.sm .ico { width: 16px; height: 16px; }
.icon-btn.plain { border-color: transparent; background: transparent; box-shadow: none; }
.icon-btn.plain:hover { background: var(--surface-3); }
.icon-btn.danger:hover { color: var(--danger-ink); background: var(--danger-soft); border-color: transparent; }
.icon-btn.wa { color: #16a34a; }
.icon-btn.wa:hover { background: var(--success-soft); }
.icon-btn.disabled { opacity: 0.35; pointer-events: none; }

.link-btn {
  display: inline-flex; align-items: center; gap: 4px;
  border: 0; background: none; padding: 0;
  color: var(--brand); font-weight: 700; font-size: 13px;
}
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

kbd {
  font-family: inherit; font-size: 11px; font-weight: 700; color: var(--muted);
  border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px;
  padding: 1px 7px; background: var(--surface);
}

/* ---------- menu ---------- */
.menu { position: relative; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 260px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(-6px) scale(0.98); transform-origin: top right;
  pointer-events: none; visibility: hidden;
  transition: opacity 0.18s, transform 0.2s var(--ease), visibility 0.2s;
  z-index: 40;
}
.menu.open .menu-pop { opacity: 1; transform: none; pointer-events: auto; visibility: visible; }
.menu.open #dataMenuBtn .chev { transform: rotate(180deg); }
#dataMenuBtn .chev { transition: transform 0.2s var(--ease); }
.menu-label {
  display: block; padding: 10px 10px 4px;
  color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
}
.menu-sep { display: block; height: 1px; background: var(--line); margin: 6px 4px; }
.menu-pop button {
  width: 100%; display: flex; align-items: center; gap: 10px;
  border: 0; background: none; border-radius: 9px;
  padding: 9px 10px; text-align: left; font-weight: 600; color: var(--ink-2);
  transition: background 0.15s, color 0.15s;
}
.menu-pop button .ico { color: var(--muted); }
.menu-pop button:hover { background: var(--surface-3); color: var(--ink); }
.menu-pop button.danger, .menu-pop button.danger .ico { color: var(--danger-ink); }
.menu-pop button.danger:hover { background: var(--danger-soft); }

/* ---------- views ---------- */
.view { display: grid; gap: 20px; }
.view.enter { animation: viewIn 0.4s var(--ease); }
.view.enter .stagger > * { animation: rise 0.5s var(--ease) both; }
.view.enter .stagger > *:nth-child(2) { animation-delay: 0.05s; }
.view.enter .stagger > *:nth-child(3) { animation-delay: 0.1s; }
.view.enter .stagger > *:nth-child(4) { animation-delay: 0.15s; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat {
  position: relative; overflow: hidden;
  display: flex; gap: 14px; align-items: flex-start;
  padding: 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: transform 0.25s var(--ease), box-shadow 0.25s;
}
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.stat::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: var(--tone-ink); opacity: 0.55;
  transform: scaleX(0); transform-origin: left; transition: transform 0.35s var(--ease);
}
.stat:hover::before { transform: scaleX(1); }
.stat-icon {
  position: relative; z-index: 1;
  width: 46px; height: 46px; border-radius: 13px; flex: none;
  display: grid; place-items: center;
  background: var(--tone-soft); color: var(--tone-ink);
  transition: transform 0.3s var(--ease);
}
.stat:hover .stat-icon { transform: scale(1.08) rotate(-4deg); }
.stat-text { position: relative; z-index: 1; min-width: 0; }
.stat-label { display: block; color: var(--muted); font-size: 13px; font-weight: 600; }
.stat-value { display: block; font-size: 30px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat-sub { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.tone-brand { --tone-soft: var(--brand-soft); --tone-ink: var(--brand-soft-ink); }
.tone-pj { --tone-soft: var(--pj-soft); --tone-ink: var(--pj-ink); }
.tone-pf { --tone-soft: var(--pf-soft); --tone-ink: var(--pf-ink); }
.tone-accent { --tone-soft: var(--accent-soft); --tone-ink: var(--accent-ink); }

/* ---------- panels ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  min-width: 0;
}
.panel-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.panel-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.panel-title h3 { font-size: 15.5px; font-weight: 750; }
.panel-title p { color: var(--muted); font-size: 12.5px; }
.panel-icon {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  background: var(--tone-soft, var(--brand-soft)); color: var(--tone-ink, var(--brand-soft-ink));
}
.panel-icon .ico { width: 16px; height: 16px; }
.panel-body { padding: 14px 16px 16px; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.dash-col { display: grid; gap: 20px; min-width: 0; }

.rank-list { display: grid; gap: 2px; }
.rank-row {
  width: 100%; display: flex; align-items: center; gap: 12px;
  border: 0; background: transparent; border-radius: 12px;
  padding: 10px; text-align: left;
  transition: background 0.18s, transform 0.18s var(--ease);
}
.rank-row:hover { background: var(--surface-2); }
.rank-row:hover .rank-go { opacity: 1; transform: none; }
.rank-main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.rank-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.rank-top strong { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-top em { font-style: normal; font-weight: 800; font-variant-numeric: tabular-nums; }
.rank-sub { color: var(--muted); font-size: 12px; }
.rank-go { color: var(--muted); opacity: 0; transform: translateX(-4px); transition: 0.2s var(--ease); }
.seg-dot {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-ink);
}
.seg-dot.none { background: var(--surface-3); color: var(--muted); }

.bar { display: block; height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar-fill {
  display: flex; height: 100%; border-radius: 99px; overflow: hidden; gap: 2px;
  transform-origin: left; animation: barIn 0.8s var(--ease) both;
}
.bar-fill > span { display: block; height: 100%; min-width: 0; }
.bar-pj { background: var(--pj); }
.bar-pf { background: var(--pf); }
.bar-seg { background: linear-gradient(90deg, var(--accent), var(--accent-strong)); }
.bar-none { background: var(--line-strong); }

.legend { display: flex; gap: 14px; color: var(--muted); font-size: 12px; font-weight: 600; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.recent-list { display: grid; gap: 2px; }
.recent-row {
  width: 100%; display: flex; align-items: center; gap: 12px;
  border: 0; background: none; border-radius: 12px; padding: 9px 10px; text-align: left;
  transition: background 0.18s;
}
.recent-row:hover { background: var(--surface-2); }
.recent-info { flex: 1; min-width: 0; }
.recent-info strong { display: block; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-info span { color: var(--muted); font-size: 12px; }
.recent-when { color: var(--muted); font-size: 12px; white-space: nowrap; }

.muted-note { color: var(--muted); font-size: 13px; padding: 6px 10px 4px; }

/* ---------- onboarding ---------- */
.onboard { padding: 48px 28px; text-align: center; display: grid; justify-items: center; gap: 14px; overflow: hidden; position: relative; }
.onboard-art {
  width: 84px; height: 84px; border-radius: 26px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #2dd4bf, #0d9488 55%, #6366f1);
  box-shadow: 0 20px 40px -14px rgba(13, 148, 136, 0.7);
  animation: float 4s ease-in-out infinite;
}
.onboard h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; margin-top: 8px; }
.onboard p { color: var(--muted); max-width: 460px; }
.onboard-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.onboard-steps { display: flex; gap: 22px; flex-wrap: wrap; justify-content: center; margin-top: 14px; color: var(--muted); font-size: 13px; }
.onboard-steps span { display: inline-flex; align-items: center; gap: 8px; }
.onboard-steps b {
  width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-soft-ink); font-size: 12px;
}

/* ---------- avatars, pills, chips ---------- */
.avatar {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  display: inline-grid; place-items: center;
  background: hsl(var(--h, 170) var(--avatar-s) var(--avatar-l));
  color: hsl(var(--h, 170) 60% var(--avatar-ink-l));
  font-weight: 800; font-size: 13px; letter-spacing: 0.02em;
}
.avatar.xs { width: 22px; height: 22px; border-radius: 7px; font-size: 9.5px; }
.avatar.sm { width: 34px; height: 34px; border-radius: 10px; font-size: 12px; }
.avatar.md { width: 44px; height: 44px; border-radius: 13px; font-size: 14px; }
.avatar.lg { width: 56px; height: 56px; border-radius: 16px; font-size: 18px; }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 999px; padding: 3px 10px 3px 8px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
  background: var(--surface-3); color: var(--ink-2);
}
.pill .ico { width: 13px; height: 13px; }
.pill-pj { background: var(--pj-soft); color: var(--pj-ink); }
.pill-pf { background: var(--pf-soft); color: var(--pf-ink); }
.pill-seg { background: var(--accent-soft); color: var(--accent-ink); }
.pill-ok { background: var(--success-soft); color: var(--success-ink); }
.pill-warn { background: var(--danger-soft); color: var(--danger-ink); }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2);
  border-radius: 8px; padding: 2px 8px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.chip .ico { width: 12px; height: 12px; color: var(--muted); }
button.chip { transition: border-color 0.15s, background 0.15s, transform 0.15s var(--ease); }
button.chip:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-soft-ink); transform: translateY(-1px); }
button.chip:hover .ico { color: inherit; }
.chip em { font-style: normal; color: var(--muted); font-weight: 700; margin-left: 2px; }
.chip.more { color: var(--muted); }

/* ---------- lista de clientes ---------- */
.toolbar { display: grid; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.search {
  display: flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 12px 0 14px;
  border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface-2);
  color: var(--muted);
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); background: var(--surface); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; height: 100%; color: var(--ink); }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.filter-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filter-row select { width: auto; min-width: 150px; flex: 1 1 150px; max-width: 230px; height: 38px; }
.filter-row select.active { border-color: var(--brand); background-color: var(--brand-soft); color: var(--brand-soft-ink); font-weight: 650; }

.list-meta {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 18px; color: var(--muted); font-size: 12.5px; font-weight: 600;
  border-bottom: 1px solid var(--line);
}

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; min-width: 980px; }
.table th {
  text-align: left; padding: 10px 16px;
  background: var(--surface-2); color: var(--muted);
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.th-sort {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: none; padding: 0;
  color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit;
}
.th-sort .ico { width: 13px; height: 13px; opacity: 0.45; }
.th-sort.sorted { color: var(--ink); }
.th-sort.sorted .ico { opacity: 1; color: var(--brand); }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { cursor: pointer; transition: background 0.15s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { animation: fadeIn 0.35s var(--ease) both; }

.cell-client { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell-client strong { display: block; font-weight: 700; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub { display: block; color: var(--muted); font-size: 12.5px; }
.muted { color: var(--muted); }
.table td[data-label="Local"] { white-space: nowrap; }
.stack { display: grid; gap: 3px; font-size: 13px; }
.stack span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.stack .ico { width: 13px; height: 13px; color: var(--muted); }
.seller-tag { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; max-width: 260px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; opacity: 0.6; transition: opacity 0.18s; }
.table tbody tr:hover .row-actions, .row-actions:focus-within { opacity: 1; }

.empty-state { padding: 54px 20px; text-align: center; display: grid; justify-items: center; gap: 10px; }
.empty-icon {
  width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center;
  background: var(--surface-3); color: var(--muted);
}
.empty-state h3 { font-size: 16px; font-weight: 750; }
.empty-state p { color: var(--muted); max-width: 380px; }

.pager {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 600;
}
.pager div { display: flex; gap: 6px; }

/* ---------- formulários ---------- */
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field > label, .label-text { color: var(--ink-2); font-size: 13px; font-weight: 650; }
.req { color: var(--danger); font-weight: 700; }

input, select, textarea {
  width: 100%; height: 42px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 0 12px; background: var(--surface-2); color: var(--ink);
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.75; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--brand) 35%, var(--line-strong)); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); background: var(--surface);
  box-shadow: 0 0 0 4px var(--ring);
}
select {
  appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b98ab' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }

.field.has-error input, .field.has-error select, .field.has-error .tag-input {
  border-color: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft);
}
.field.has-error { animation: shake 0.35s; }
.field-msg { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field-msg:empty { display: none; }
.field-msg.is-error { color: var(--danger-ink); }
.field-msg.is-ok { color: var(--success-ink); }
.field-msg.is-loading { color: var(--brand); }

.input-group { display: flex; gap: 8px; }
.input-group input { flex: 1; min-width: 0; }
.input-group .btn { height: 42px; }

.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.span-1 { grid-column: span 1; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-full { grid-column: 1 / -1; }

.form-panel { overflow: visible; }
.form-body { display: grid; }
.form-block { padding: 22px 24px; border-bottom: 1px solid var(--line); display: grid; gap: 18px; }
.block-head { display: flex; align-items: center; gap: 12px; }
.block-head h3 { font-size: 15.5px; font-weight: 750; }
.block-head p { color: var(--muted); font-size: 12.5px; }
.block-head .count {
  margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 700;
  background: var(--surface-3); border-radius: 999px; padding: 2px 9px;
}
.block-icon {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-soft-ink);
}

.segmented {
  position: relative; display: grid; grid-template-columns: 1fr 1fr;
  padding: 4px; border-radius: 13px; background: var(--surface-3);
  max-width: 460px;
}
.segmented::before {
  content: ""; position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px);
  border-radius: 10px; background: var(--surface); box-shadow: var(--shadow);
  transition: transform 0.35s var(--ease);
}
.segmented[data-active="PJ"]::before { transform: translateX(100%); }
.segmented button {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; border: 0; background: none; border-radius: 10px;
  font-weight: 700; color: var(--muted); transition: color 0.25s;
}
.segmented button.active[data-type="PF"] { color: var(--pf-ink); }
.segmented button.active[data-type="PJ"] { color: var(--pj-ink); }

.chip-select { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-opt {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 14px 0 8px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--surface); color: var(--ink-2); font-weight: 650;
  transition: border-color 0.18s, background 0.18s, color 0.18s, transform 0.18s var(--ease), box-shadow 0.18s;
}
.chip-opt:hover { border-color: var(--brand); transform: translateY(-1px); }
.chip-opt.none { padding-left: 12px; border-style: dashed; color: var(--muted); }
.chip-opt.active {
  border-color: var(--brand); background: var(--brand-soft); color: var(--brand-soft-ink);
  box-shadow: 0 0 0 3px var(--ring);
}
.chip-opt .check { display: none; }
.chip-opt.active .check { display: block; }

.combo { position: relative; }
.combo input { padding-left: 40px; padding-right: 42px; }
.combo-icon {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--accent-ink); pointer-events: none; display: grid;
}
.combo-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border: 0; border-radius: 8px;
  display: grid; place-items: center; background: transparent; color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.combo-toggle:hover { background: var(--surface-3); color: var(--ink); }
.combo-toggle .ico { transition: transform 0.25s var(--ease); }
.combo.open .combo-toggle .ico { transform: rotate(180deg); }
.combo-pop {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 25;
  max-height: 280px; overflow-y: auto; overscroll-behavior: contain;
  padding: 6px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(-6px) scale(0.98); transform-origin: top center;
  transition: opacity 0.16s, transform 0.2s var(--ease), visibility 0.2s;
}
.combo.open .combo-pop { opacity: 1; visibility: visible; pointer-events: auto; transform: none; }
.combo-label {
  display: block; padding: 8px 10px 4px;
  color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
}
.combo-opt {
  width: 100%; display: flex; align-items: center; gap: 10px;
  border: 0; background: none; border-radius: 9px;
  padding: 8px 10px; text-align: left; font-weight: 600; color: var(--ink-2);
  transition: background 0.12s, color 0.12s;
}
.combo-opt .dot {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink);
}
.combo-opt .dot .ico { width: 14px; height: 14px; }
.combo-opt .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-opt .name mark { background: none; color: var(--brand); font-weight: 800; }
.combo-opt .qty { color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.combo-opt .check { color: var(--brand); display: none; }
.combo-opt.selected .check { display: block; }
.combo-opt.selected { color: var(--ink); }
.combo-opt.active, .combo-opt:hover { background: var(--surface-3); color: var(--ink); }
.combo-opt.create .dot { background: var(--brand-soft); color: var(--brand-soft-ink); }
.combo-opt.create { color: var(--brand); }
.combo-empty { padding: 12px 10px; color: var(--muted); font-size: 13px; }

.tag-input {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  min-height: 44px; padding: 6px 8px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-2);
  cursor: text; transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.tag-input:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); background: var(--surface); }
.tag-input input { flex: 1; min-width: 160px; height: 30px; border: 0; padding: 0 4px; background: transparent; box-shadow: none !important; }
.tag-chips { display: contents; }
.tag-chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 28px; padding: 0 4px 0 9px; border-radius: 8px;
  background: var(--brand-soft); color: var(--brand-soft-ink); font-weight: 650; font-size: 13px;
  animation: pop 0.25s var(--ease);
}
.tag-chip button {
  display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px;
  border: 0; background: transparent; color: inherit; opacity: 0.7;
}
.tag-chip button:hover { opacity: 1; background: rgba(0, 0, 0, 0.08); }
.tag-suggest { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag-suggest .label { color: var(--muted); font-size: 12px; font-weight: 600; margin-right: 2px; }

.company-info {
  border: 1px solid color-mix(in srgb, var(--pj) 30%, var(--line));
  background: linear-gradient(135deg, var(--pj-soft), transparent 80%);
  border-radius: 14px; padding: 14px 16px;
  display: grid; gap: 10px; animation: rise 0.4s var(--ease);
}
.company-info-head { display: flex; align-items: center; gap: 8px; justify-content: space-between; flex-wrap: wrap; }
.company-info-head strong { display: inline-flex; align-items: center; gap: 8px; color: var(--pj-ink); font-size: 13px; }
.company-info dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 18px; margin: 0; }
.company-info dt { color: var(--muted); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.company-info dd { margin: 2px 0 0; font-weight: 600; font-size: 13px; }

.buyers-list { display: grid; gap: 10px; }
.buyer-card {
  display: grid; grid-template-columns: 1.2fr 1fr 1fr 1.2fr auto; gap: 10px; align-items: end;
  padding: 12px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line);
  animation: rise 0.3s var(--ease);
  transition: opacity 0.2s, transform 0.2s var(--ease);
}
.buyer-card.leaving { opacity: 0; transform: translateX(16px); }
.buyer-card input { background: var(--surface); height: 38px; }
.buyer-card .field > span.label-text { font-size: 12px; }
.buyer-actions { display: flex; gap: 6px; padding-bottom: 2px; }
.buyers-empty {
  display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px;
  padding: 14px; border: 1px dashed var(--line-strong); border-radius: 12px;
}

.form-footer {
  position: sticky; bottom: 0; z-index: 3;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 24px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
}
.spacer { flex: 1; }

/* ---------- vendedores ---------- */
.sellers-layout { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 20px; align-items: start; }
.seller-form { position: sticky; top: 20px; overflow: clip; }
.seller-form .panel-body { display: grid; gap: 16px; padding: 18px 20px; }
.seller-form .form-footer { position: static; padding: 14px 20px; }
.seller-form.editing { border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring), var(--shadow); }
.seller-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.seller-card {
  display: grid; gap: 14px; padding: 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: transform 0.25s var(--ease), box-shadow 0.25s, border-color 0.25s;
  animation: rise 0.4s var(--ease) both;
}
.seller-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.seller-card.editing { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.seller-card.unassigned { border-style: dashed; box-shadow: none; background: transparent; }
.seller-top { display: flex; align-items: center; gap: 12px; }
.seller-info { flex: 1; min-width: 0; }
.seller-info strong { display: block; font-size: 15px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seller-info span { display: block; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seller-actions { display: flex; gap: 4px; }
.seller-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seller-stats div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: 9px 10px; }
.seller-stats strong { display: block; font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.seller-stats span { color: var(--muted); font-size: 11.5px; font-weight: 600; }

/* ---------- configurações ---------- */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.cat-add { display: flex; gap: 8px; }
.cat-add input { flex: 1; min-width: 0; }
.cat-list { display: grid; gap: 2px; margin-top: 14px; }
.cat-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 8px 7px 10px; border-radius: 11px; margin: 0;
  transition: background 0.15s;
  animation: fadeIn 0.3s var(--ease) both;
}
.cat-row:hover { background: var(--surface-2); }
.cat-row:hover .row-actions, .cat-row .row-actions:focus-within { opacity: 1; }
.cat-row.editing { background: var(--brand-soft); }
.cat-row.editing input { flex: 1; min-width: 0; height: 36px; background: var(--surface); }
.cat-dot {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink);
}
.cat-dot.tag { background: var(--pj-soft); color: var(--pj-ink); }
.cat-dot .ico { width: 15px; height: 15px; }
.cat-name { flex: 1; min-width: 0; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-qty { color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.cat-qty.zero { opacity: 0.7; }
.cat-tools { display: flex; gap: 8px; align-items: center; margin-top: 14px; }
.cat-tools input { height: 36px; }
.cat-empty { padding: 22px 10px; text-align: center; color: var(--muted); font-size: 13px; }
.cat-more {
  width: 100%; height: 38px; margin-top: 8px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px dashed var(--line-strong); border-radius: 10px; background: transparent;
  color: var(--muted); font-weight: 650; font-size: 13px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.cat-more:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }
.cat-more.less .ico { transform: rotate(180deg); }
.cat-head-tools { display: flex; align-items: center; gap: 8px; }
.collapse-btn .ico { transition: transform 0.25s var(--ease); }
.panel.collapsed .collapse-btn .ico { transform: rotate(-90deg); }
.panel.collapsed .panel-head { border-bottom: 0; }
.panel.collapsed .panel-body { display: none; }

/* ---------- drawer ---------- */
.backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: var(--backdrop); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.backdrop.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 51;
  width: min(480px, 100%);
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  transform: translateX(104%); visibility: hidden;
  transition: transform 0.38s var(--ease), visibility 0.38s;
}
.drawer.open { transform: none; visibility: visible; }
.drawer-head { display: flex; gap: 14px; align-items: flex-start; padding: 22px 22px 16px; }
.drawer-title { flex: 1; min-width: 0; }
.drawer-title h2 { font-size: 19px; font-weight: 800; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.drawer-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.drawer-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 22px 16px; border-bottom: 1px solid var(--line); }
.drawer-body { flex: 1; overflow-y: auto; padding: 6px 22px 28px; }
.d-section { padding: 16px 0; border-bottom: 1px solid var(--line); }
.d-section:last-child { border-bottom: 0; }
.d-section h4 {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
  color: var(--muted); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
}
.d-section h4 .ico { width: 14px; height: 14px; }
.d-list { display: grid; gap: 10px; margin: 0; }
.d-row { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; }
.d-row dt { color: var(--muted); font-size: 13px; }
.d-row dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.d-row dd a { color: var(--brand); text-decoration: none; }
.d-row dd a:hover { text-decoration: underline; }
.d-notes { white-space: pre-wrap; color: var(--ink-2); background: var(--surface-2); border-radius: 12px; padding: 12px 14px; border: 1px solid var(--line); }
.d-buyer { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.d-buyer + .d-buyer { margin-top: 8px; }
.d-buyer-info { flex: 1; min-width: 0; }
.d-buyer-info strong { display: block; }
.d-buyer-info span { display: block; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.d-meta { color: var(--muted); font-size: 12px; padding-top: 14px; display: flex; gap: 6px; align-items: center; }

/* ---------- modal ---------- */
.modal-wrap {
  position: fixed; inset: 0; z-index: 70;
  display: grid; place-items: center; padding: 16px;
  background: var(--backdrop); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}
.modal-wrap.open { opacity: 1; pointer-events: auto; visibility: visible; }
.modal {
  width: min(440px, 100%); padding: 24px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg);
  transform: translateY(10px) scale(0.96); transition: transform 0.3s var(--ease);
}
.modal-wrap.open .modal { transform: none; }
.modal-icon {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 14px;
  background: var(--brand-soft); color: var(--brand-soft-ink);
}
.modal-icon.danger { background: var(--danger-soft); color: var(--danger-ink); }
.modal h3 { font-size: 18px; font-weight: 800; }
.modal p { color: var(--muted); margin-top: 6px; white-space: pre-line; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.btn.danger { background: var(--danger); border-color: transparent; color: #fff; box-shadow: 0 8px 20px -8px var(--danger); }
:root[data-theme="dark"] .btn.danger { color: #2b0505; }

/* ---------- toasts ---------- */
.toasts {
  position: fixed; right: 20px; bottom: 20px; z-index: 80;
  display: grid; gap: 10px; justify-items: end; pointer-events: none;
}
.toast {
  position: relative; overflow: hidden; pointer-events: auto;
  display: flex; align-items: center; gap: 10px;
  min-width: 260px; max-width: min(420px, calc(100vw - 32px));
  padding: 12px 10px 12px 14px; border-radius: 14px;
  background: var(--toast-bg); color: var(--toast-ink); box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateX(24px) scale(0.98);
  transition: opacity 0.25s, transform 0.3s var(--ease);
}
.toast.show { opacity: 1; transform: none; }
.toast.hide { opacity: 0; transform: translateY(8px) scale(0.98); }
.toast::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%;
  background: var(--toast-tone, #2dd4bf); transform-origin: left; opacity: 0.85;
}
.toast.show::after { animation: drain var(--d, 3400ms) linear forwards; }
.toast-success { --toast-tone: #34d399; }
.toast-error { --toast-tone: #f87171; }
.toast-info { --toast-tone: #60a5fa; }
.toast-icon { color: var(--toast-tone); display: grid; }
.toast-msg { flex: 1; font-weight: 600; font-size: 13.5px; }
.toast-action {
  border: 0; background: rgba(255, 255, 255, 0.12); color: inherit;
  padding: 6px 10px; border-radius: 8px; font-weight: 700; font-size: 13px;
}
.toast-action:hover { background: rgba(255, 255, 255, 0.2); }
.toast-close { border: 0; background: none; color: inherit; opacity: 0.6; display: grid; padding: 4px; border-radius: 6px; }
.toast-close:hover { opacity: 1; }

/* ---------- animações ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: none; } }
@keyframes barIn { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes drain { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ---------- responsivo ---------- */
@media (max-width: 1180px) {
  .settings-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: 1fr; }
  .sellers-layout { grid-template-columns: 1fr; }
  .seller-form { position: static; }
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto;
    flex-direction: row; padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
  .brand, .sidebar-foot { display: none; }
  .mobile-out { display: inline-grid; }
  .access-row { grid-template-columns: 1fr 1fr; }
  .access-who, .access-actions { grid-column: 1 / -1; }
  .user-form { grid-template-columns: 1fr 1fr; }
  .user-form > .btn { grid-column: 1 / -1; }
  .co-grid { grid-template-columns: 1fr; }
  .nav { grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; }
  .nav-item { flex-direction: column; gap: 4px; padding: 8px 2px; font-size: 10.5px; justify-content: center; text-align: center; min-width: 0; }
  .nav-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-item .full { display: none; }
  .nav-item .short { display: inline !important; }
  .nav-item::before { left: 25%; right: 25%; top: -6px; bottom: auto; width: auto; height: 3px; border-radius: 0 0 3px 3px; transform: scaleX(0); }
  .nav-item.active::before { transform: scaleX(1); }
  .nav-count { position: absolute; top: 3px; left: calc(50% + 8px); margin: 0; padding: 0 6px; font-size: 10px; background: var(--brand); color: #fff; }
  .main { padding: 18px 16px 104px; }
  .toasts { bottom: 92px; right: 16px; left: 16px; justify-items: stretch; }
  .toast { max-width: none; }
  .cols-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-6 > .span-1, .cols-6 > .span-2 { grid-column: span 1; }
  .cols-6 > .span-3, .cols-6 > .span-4 { grid-column: 1 / -1; }
  .buyer-card { grid-template-columns: 1fr 1fr; }
  .buyer-actions { grid-column: 1 / -1; justify-content: flex-end; }
}

@media (max-width: 760px) {
  .table { min-width: 0; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tbody { padding: 12px; display: grid; gap: 12px; }
  .table tbody tr { border: 1px solid var(--line); border-radius: 14px; padding: 6px 0; background: var(--surface); }
  .table tbody tr:hover { background: var(--surface); border-color: var(--line-strong); }
  .table td { border: 0; padding: 7px 14px; display: flex; justify-content: space-between; align-items: center; gap: 14px; text-align: right; }
  .table td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 700; text-align: left; flex: none; }
  .table td.cell-main { text-align: left; padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
  .table td.cell-main::before, .table td.cell-actions::before { display: none; }
  .table td.cell-actions { justify-content: flex-end; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 10px; }
  .cell-client strong { max-width: none; white-space: normal; }
  .stack { justify-items: end; }
  .tags { justify-content: flex-end; max-width: none; }
  .row-actions { opacity: 1; }
}

@media (max-width: 620px) {
  .topbar h1 { font-size: 23px; }
  .hide-sm { display: none; }
  .topbar-actions .btn { padding: 0 11px; }
  .stats { gap: 10px; }
  .stat { padding: 16px 12px; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
  .stat-text { width: 100%; }
  .stat-icon { width: 38px; height: 38px; border-radius: 11px; }
  .stat-value { font-size: 25px; }
  .cols-2, .cols-6 { grid-template-columns: 1fr; }
  .cols-6 > * { grid-column: 1 / -1 !important; }
  .form-block { padding: 18px 16px; }
  .form-footer { padding: 12px 16px; }
  .buyer-card { grid-template-columns: 1fr; }
  .filter-row select { max-width: none; flex-basis: calc(50% - 5px); min-width: 0; }
  .input-group .btn span { display: none; }
  .d-row { grid-template-columns: 96px minmax(0, 1fr); }
  .menu-pop { right: -54px; }
}

/* ---------- tela de pedido recebido ---------- */
.status-extra { display: grid; gap: 14px; }
.status-extra:empty { display: none; }
.status-steps { list-style: none; margin: 0; padding: 0; display: grid; }
.status-steps li { position: relative; display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding-bottom: 16px; }
.status-steps li:last-child { padding-bottom: 0; }
.status-steps li::before { content: ""; position: absolute; left: 13px; top: 30px; bottom: 2px; width: 2px; border-radius: 2px; background: var(--line); }
.status-steps li:last-child::before { display: none; }
.status-steps li.done::before { background: var(--success); }
.status-steps .mark {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-3); color: var(--muted); font-size: 12px; font-weight: 800;
}
.status-steps li.done .mark { background: var(--success); color: #fff; }
.status-steps li.now .mark { background: var(--accent-soft); color: var(--accent-ink); animation: ring 2s ease-out infinite; }
.status-steps strong { display: block; font-size: 14px; font-weight: 750; }
.status-steps li > div > span { display: block; color: var(--muted); font-size: 13px; }
.status-steps li:not(.done):not(.now) strong { color: var(--muted); }
.status-summary {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px;
  padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line);
}
.status-summary span { display: block; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.status-summary strong { display: block; font-size: 13.5px; font-weight: 650; overflow-wrap: anywhere; }
.status-live { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; margin: 0; }
.status-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--success); flex: none; animation: ring 2s ease-out infinite; }
#statusIcon { background: var(--success-soft); color: var(--success-ink); }
@keyframes ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); } 100% { box-shadow: 0 0 0 8px transparent; } }

/* ---------- vendas: produtos, pedidos e resumo ---------- */
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.sheet { width: min(560px, 100%); z-index: 61; }
#sheetBackdrop { z-index: 60; }
.sheet .form-footer { position: static; border-radius: 0; }
.sheet-form { display: grid; gap: 16px; align-content: start; padding-top: 18px; }
.switch-row { display: flex; gap: 10px; align-items: center; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.switch-row input { width: 18px; height: 18px; accent-color: var(--brand); }

.pthumb { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; flex: none; background: var(--surface-3); display: block; }
.pthumb.sm { width: 32px; height: 32px; border-radius: 8px; }
.pthumb.md { width: 44px; height: 44px; }
.pthumb.xl { width: 100%; height: 100%; border-radius: 0; }
.pthumb.xxl { width: 100%; max-height: 320px; height: auto; aspect-ratio: 4 / 3; border-radius: 14px; }
.pthumb.empty {
  display: grid; place-items: center; font-weight: 800; font-size: 12px;
  background: hsl(var(--h, 170) var(--avatar-s) var(--avatar-l)); color: hsl(var(--h, 170) 60% var(--avatar-ink-l));
}
.pthumb.xl.empty, .pthumb.xxl.empty { font-size: 28px; }

.photo-pick { display: grid; gap: 10px; }
.photo-drop {
  display: grid; place-items: center; aspect-ratio: 16 / 10; max-width: 100%;
  border: 2px dashed var(--line-strong); border-radius: 14px; background: var(--surface-2);
  color: var(--muted); cursor: pointer; overflow: hidden; transition: border-color 0.2s, background 0.2s;
}
.photo-drop:hover, .photo-drop.drag { border-color: var(--brand); background: var(--brand-soft); }
.photo-drop > span { display: grid; justify-items: center; gap: 4px; font-weight: 650; width: 100%; height: 100%; place-content: center; }
.photo-drop img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.photo-drop small { font-weight: 500; font-size: 12px; }
.photo-actions { display: flex; gap: 8px; }

.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; padding: 18px; }
.prod-card {
  display: grid; text-align: left; padding: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm);
  transition: transform 0.22s var(--ease), box-shadow 0.22s, border-color 0.22s; animation: rise 0.35s var(--ease) both;
}
.prod-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: var(--line-strong); }
.prod-card.off { opacity: 0.6; }
.prod-photo { position: relative; aspect-ratio: 4 / 3; background: #fff; display: block; border-bottom: 1px solid var(--line); }
.prod-photo img.pthumb { object-fit: contain; }
.prod-off { position: absolute; top: 8px; left: 8px; font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--danger-soft); color: var(--danger-ink); }
.prod-info { display: grid; gap: 2px; padding: 12px 14px 14px; }
.prod-info strong { font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prod-info > span { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prod-info .prod-price { color: var(--ink); font-size: 17px; font-weight: 800; margin-top: 4px; }
.prod-price small { color: var(--muted); font-weight: 600; font-size: 12px; }
.prod-sold { font-size: 12px !important; }
.prod-view-photo { background: #fff; border-radius: 14px; border: 1px solid var(--line); overflow: hidden; }
.prod-view-photo img { object-fit: contain; }

.order-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.okpi { display: grid; gap: 2px; padding: 14px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.okpi span { color: var(--muted); font-size: 12.5px; font-weight: 650; }
.okpi strong { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.okpi small { color: var(--muted); font-size: 12px; }
.order-table { min-width: 860px; }
.order-pill.aberto { background: var(--accent-soft); color: var(--accent-ink); }
.order-pill.faturado { background: var(--success-soft); color: var(--success-ink); }
.order-pill.cancelado { background: var(--surface-3); color: var(--muted); text-decoration: line-through; }
.order-badge { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-soft-ink); flex: none; }

.ov-items { display: grid; gap: 8px; }
.ov-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.ov-item-info { flex: 1; min-width: 0; }
.ov-item-info strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-item-info span { color: var(--muted); font-size: 12.5px; }
.ov-totals { display: grid; gap: 6px; margin: 14px 0 0; }
.ov-totals > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--ink-2); }
.ov-totals dt { color: var(--muted); }
.ov-totals dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.ov-totals .grand { padding-top: 10px; margin-top: 4px; border-top: 1px solid var(--line); }
.ov-totals .grand dt { color: var(--ink); font-weight: 750; }
.ov-totals .grand dd { font-size: 22px; font-weight: 800; color: var(--ink); }
.ov-totals dd input { width: 120px; height: 34px; text-align: right; }

.client-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cm { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); min-width: 0; }
.cm span { display: block; color: var(--muted); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.cm strong { display: block; font-size: 16px; font-weight: 800; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm small { display: block; color: var(--muted); font-size: 12px; }
.d-section h4 .pill { margin-left: auto; text-transform: none; letter-spacing: 0; }
.d-orders { display: grid; gap: 6px; }
.d-order {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2);
  transition: border-color 0.15s, background 0.15s;
}
.d-order:hover { border-color: var(--line-strong); background: var(--surface); }
.d-order-main { flex: 1; min-width: 0; display: grid; }
.d-order-main span { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-order-side { display: grid; justify-items: end; gap: 4px; }

.buy-cell { display: grid; gap: 2px; white-space: nowrap; }
.buy-days { font-weight: 750; }
.buy-days.ok { color: var(--success-ink); }
.buy-days.warn { color: var(--accent-ink); }
.buy-days.late { color: var(--danger-ink); }

.of-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.of-main { display: grid; gap: 18px; min-width: 0; }
.of-block { padding: 20px 22px; display: grid; gap: 14px; overflow: visible; }
.of-side { position: sticky; top: 20px; }
.of-summary { padding: 20px; display: grid; gap: 6px; }
.of-summary h3 { font-size: 16px; font-weight: 800; }
.of-pay-line { display: flex; gap: 6px; align-items: center; color: var(--ink-2); font-size: 13px; font-weight: 600; margin: 8px 0 0; }
.of-actions { display: grid; gap: 8px; margin-top: 14px; }
.of-actions .btn { height: 44px; }
.of-client { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.of-client-info { flex: 1; min-width: 0; display: grid; gap: 2px; }
.of-client-info > strong { font-size: 15px; font-weight: 750; }
.of-client-info > span { color: var(--muted); font-size: 12.5px; }
.of-client-stats { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.of-search .combo-opt .pthumb { width: 32px; height: 32px; }
.of-items { display: grid; gap: 8px; }
.of-item {
  display: grid; grid-template-columns: 48px repeat(3, minmax(0, 120px)) minmax(90px, 1fr) 32px; column-gap: 12px; row-gap: 6px; align-items: end;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2);
  animation: rise 0.25s var(--ease);
}
.of-item > .pthumb { grid-row: 1 / 3; align-self: center; width: 48px; height: 48px; }
.of-item .of-item-name { grid-column: 2 / 6; grid-row: 1; }
.of-item .of-num { grid-row: 2; }
.of-item .of-line { grid-column: 5; grid-row: 2; align-self: center; font-size: 15px; }
.of-item > .icon-btn { grid-column: 6; grid-row: 1 / 3; align-self: center; }
.of-item-name { min-width: 0; display: grid; }
.of-item-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.of-item-name span { color: var(--muted); font-size: 12px; }
.of-item-name input { height: 36px; }
.of-num { display: grid; gap: 2px; }
.of-num span { color: var(--muted); font-size: 11px; font-weight: 700; }
.of-num input { height: 36px; padding: 0 8px; text-align: right; background: var(--surface); }
.of-line { text-align: right; }

.dash-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.seg-tabs { display: inline-flex; padding: 4px; gap: 2px; border-radius: 12px; background: var(--surface-3); flex-wrap: wrap; }
.seg-tabs button { border: 0; background: none; padding: 7px 14px; border-radius: 9px; font-weight: 700; color: var(--muted); font-size: 13px; transition: background 0.15s, color 0.15s; }
.seg-tabs button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.dash-range { font-size: 13px; font-weight: 600; }
.stat-value.money { font-size: 25px; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; color: var(--muted); }
.delta.up { color: var(--success-ink); }
.delta.down { color: var(--danger-ink); }
.rank-row.static { cursor: default; }
.rank-row.static:hover { background: transparent; }
.chart-wrap { width: 100%; overflow-x: auto; }
.rev-chart { width: 100%; min-width: 560px; height: auto; display: block; }
.ch-grid { stroke: var(--line); stroke-width: 1; }
.ch-label { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.ch-bar { fill: color-mix(in srgb, var(--brand) 70%, transparent); }
.ch-bar.today { fill: var(--brand); }
.ch-bar.future { fill: var(--surface-3); }
.ch-line { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.ch-line.cur { stroke: var(--brand-strong); }
.ch-line.prev { stroke: var(--muted); stroke-dasharray: 5 5; stroke-width: 2; }
.ch-dot { fill: var(--brand-strong); stroke: var(--surface); stroke-width: 2.5; }
.chart-foot { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; padding-top: 10px; font-size: 13px; }

@media (max-width: 1180px) {
  .of-layout { grid-template-columns: 1fr; }
  .of-side { position: static; }
}
@media (max-width: 760px) {
  .order-kpis { grid-template-columns: 1fr; }
  .of-item { grid-template-columns: repeat(3, minmax(0, 1fr)) 32px; }
  .of-item > .pthumb { display: none; }
  .of-item .of-item-name { grid-column: 1 / 4; }
  .of-item .of-line { grid-column: 1 / 4; grid-row: 3; text-align: left; }
  .of-item > .icon-btn { grid-column: 4; grid-row: 1; }
  .client-metrics { grid-template-columns: 1fr 1fr; }
  .prod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px; }
}
@media (max-width: 620px) {
  .of-block { padding: 16px; }
  .stat-value.money { font-size: 20px; }
}

/* ---------- celular: nada pode alargar a página ---------- */
/* as colunas de grade usam minmax(0, 1fr) para o conteúdo largo (gráfico, tabela) rolar dentro do próprio cartão */
.main, .view, #ordersBody, #platformBody { grid-template-columns: minmax(0, 1fr); }
.panel-head { flex-wrap: wrap; }
.panel-title { flex: 1 1 220px; }
.panel-title > div { min-width: 0; }

@media (max-width: 1180px) {
  .dash-grid, .sellers-layout, .settings-grid, .of-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .nav-item { font-size: 10px; padding: 8px 0; }
  .nav-item .ico { width: 20px; height: 20px; }
}

@media (max-width: 760px) {
  .table.order-table { min-width: 0; }
  .order-table td[data-label="Pagamento"] .sub { white-space: normal; text-align: right; }
  .seg-tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .seg-tabs::-webkit-scrollbar { display: none; }
  .seg-tabs button { flex: none; }
  .dash-head { gap: 8px; }
  .chart-foot { gap: 8px 14px; }
  .rev-chart { min-width: 520px; }
  .access-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 12px 4px; border-bottom: 1px solid var(--line); border-radius: 0; }
  .access-row:last-child { border-bottom: 0; }
  .access-who { grid-column: 1 / -1; }
  .access-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .user-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 12px; }
  .user-form > .btn, .user-form > .field:nth-child(3) { grid-column: 1 / -1; }
  .cat-add .btn { padding: 0 12px; }
  .drawer-actions { gap: 6px; }
  .drawer-actions .btn.sm { padding: 0 10px; }
  .of-summary { position: static; }
  .of-client { flex-wrap: wrap; }
  .of-client .btn { margin-left: auto; }
  .okpi strong { font-size: 20px; }
}

@media (max-width: 620px) {
  .topbar { flex-wrap: wrap; gap: 10px; align-items: flex-end; }
  .topbar > div:first-child { flex: 1 1 140px; min-width: 0; }
  .topbar-actions { margin-left: auto; gap: 6px; }
  .topbar-actions .icon-btn, .topbar-actions .btn { height: 38px; }
  .topbar-actions .icon-btn { width: 38px; }
  .topbar h1 { font-size: 22px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .panel-head { padding: 14px 16px; }
  .panel-body { padding: 12px; }
  .toolbar { padding: 12px; }
  .list-meta { padding: 8px 12px; }
  .stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .stat-value.money { font-size: 18px; }
  .stat-sub { font-size: 11px; }
  .order-kpis { gap: 8px; }
  .okpi { padding: 12px 14px; }
  .prod-grid { padding: 10px; gap: 8px; }
  .prod-info { padding: 10px; }
  .prod-info .prod-price { font-size: 15px; }
  .seller-grid { grid-template-columns: minmax(0, 1fr); }
  .co-controls { grid-template-columns: minmax(0, 1fr); }
  .d-row { grid-template-columns: 88px minmax(0, 1fr); }
  .client-metrics { gap: 6px; }
  .cm { padding: 8px 10px; }
  .cm strong { font-size: 14px; }
}

/* listas em grade: itens com texto longo encolhem e cortam com reticências em vez de alargar a página */
.rank-list, .recent-list, .d-orders, .ov-items, .of-items, .access-list, .cat-list, .buyers-list, .d-list, .status-steps, .dash-col, .form-body, .of-main { grid-template-columns: minmax(0, 1fr); }
.rank-row, .recent-row, .d-order { min-width: 0; }
.rank-main, .recent-info, .d-order-main, .ov-item-info { grid-template-columns: minmax(0, 1fr); }
.rank-top strong { min-width: 0; }
.access-who > .avatar, .seller-top > .avatar, .d-buyer > .avatar, .recent-row > .avatar, .of-client > .avatar { display: inline-grid; }
.access-actions .btn { height: 32px; padding: 0 10px; font-size: 12.5px; }
.day-order-side { display: grid; justify-items: end; gap: 4px; flex: none; }

/* ===================== gestão comercial ===================== */

/* pedidos: prioridade, orçamento, aprovação */
.order-pill.orcamento { background: var(--pj-soft); color: var(--pj-ink); }
.prio-pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 750; white-space: nowrap; line-height: 1.6;
}
.prio-pill.urgente { background: var(--danger-soft); color: var(--danger-ink); }
.prio-pill.atencao { background: var(--accent-soft); color: var(--accent-ink); }
.prio-pill.approval { background: var(--pj-soft); color: var(--pj-ink); }
.prio-pill.due { background: var(--surface-3); color: var(--ink-2); }
.prio-pill.due.late { background: var(--danger-soft); color: var(--danger-ink); }
.flag-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.flag-row:empty { display: none; }
.order-table tr.row-urgent td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.order-badge.urgente { background: var(--danger-soft); color: var(--danger-ink); }
.order-badge.atencao { background: var(--accent-soft); color: var(--accent-ink); }
button.okpi { text-align: left; font: inherit; color: inherit; cursor: pointer; transition: border-color 0.15s, transform 0.15s; }
button.okpi:hover { border-color: var(--brand); transform: translateY(-1px); }
.okpi.danger { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.okpi.danger strong { color: var(--danger-ink); }
.okpi.ok strong { color: var(--success-ink); }
.okpi span .ico { vertical-align: -2px; }
.ov-alert {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; margin-bottom: 14px;
  background: var(--pj-soft); color: var(--pj-ink);
}
.ov-alert > div { flex: 1; display: grid; gap: 2px; min-width: 0; }
.ov-alert span { font-size: 12.5px; opacity: 0.9; }
.ov-owner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 12px; border-radius: 10px; margin-bottom: 14px;
  background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; color: var(--ink-2);
}
.ov-owner.none { border-style: dashed; color: var(--muted); }
.ov-parcels { display: grid; gap: 6px; margin-top: 10px; }
.ov-parcel {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center;
  padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13px;
}
.ov-parcel strong { font-variant-numeric: tabular-nums; }
.ov-parcel em { grid-column: 1 / -1; font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--success-ink); }
.ov-parcel.paid { background: var(--success-soft); }
.ov-parcel.late { background: var(--danger-soft); color: var(--danger-ink); }

/* formulário do pedido */
.prio-select { flex-wrap: nowrap; }
.prio-select .chip-opt { flex: 1; justify-content: center; }
.chip-opt.prio-atencao.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.chip-opt.prio-urgente.active { background: var(--danger-soft); border-color: var(--danger); color: var(--danger-ink); }
.cp-tag { color: var(--pj-ink); font-weight: 700; }
.of-warn {
  display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; padding: 10px 12px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent-ink); font-size: 12.5px; line-height: 1.45;
}
.of-warn .ico { margin-top: 2px; flex: none; }
.of-discount-note { margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.of-free-name { width: 100%; height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-weight: 650; }

/* ficha do cliente */
.client-fin {
  display: flex; align-items: center; gap: 6px; margin-top: 10px; padding: 8px 12px; border-radius: 10px;
  background: var(--surface-2); font-size: 13px; color: var(--ink-2);
}
.client-fin.late { background: var(--danger-soft); color: var(--danger-ink); }
.client-contact {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px;
  padding: 10px 12px; border-radius: 10px; border: 1px dashed var(--line-strong); font-size: 13px; color: var(--ink-2);
}
.client-contact > span { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.cp-add { display: grid; grid-template-columns: minmax(0, 1fr) 130px auto; gap: 8px; margin-top: 12px; }
.cp-add select, .cp-add input {
  height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; min-width: 0;
}

/* resumo: mini indicadores e metas */
.mini-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.mini-kpi {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); text-align: left;
  font: inherit; color: inherit; cursor: pointer; min-width: 0; transition: border-color 0.15s, transform 0.15s;
}
.mini-kpi:hover { border-color: var(--brand); transform: translateY(-1px); }
.mini-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand-soft-ink); }
.mini-kpi.pj .mini-icon { background: var(--pj-soft); color: var(--pj-ink); }
.mini-kpi.accent .mini-icon { background: var(--accent-soft); color: var(--accent-ink); }
.mini-kpi.danger .mini-icon { background: var(--danger-soft); color: var(--danger-ink); }
.mini-kpi.ok .mini-icon { background: var(--success-soft); color: var(--success-ink); }
.mini-text { display: grid; gap: 1px; min-width: 0; }
.mini-text > span { font-size: 12px; font-weight: 650; color: var(--muted); }
.mini-text strong { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.mini-kpi.danger strong { color: var(--danger-ink); }
.mini-text small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal-bar { position: relative; overflow: visible; }
.goal-mark { position: absolute; top: -3px; bottom: -3px; width: 2px; border-radius: 2px; background: var(--ink-2); opacity: 0.55; }
.seller-goal { display: grid; gap: 6px; padding: 12px; border-radius: 12px; background: var(--surface-2); }
.seller-goal-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; color: var(--muted); font-weight: 650; }
.seller-goal-top strong { color: var(--ink); font-size: 16px; font-variant-numeric: tabular-nums; }
.seller-goal-sub { font-size: 12px; color: var(--muted); }

/* dados da empresa */
.company-form { display: grid; gap: 16px; }
.logo-pick { display: flex; align-items: center; gap: 16px; }
.logo-drop {
  width: 104px; height: 104px; flex: none; border-radius: 16px; display: grid; place-items: center; align-content: center; gap: 4px;
  border: 2px dashed var(--line-strong); background: var(--surface-2); color: var(--muted); cursor: pointer;
  font-size: 12px; font-weight: 700; overflow: hidden; transition: border-color 0.15s;
}
.logo-drop:hover { border-color: var(--brand); color: var(--brand); }
.logo-drop img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.logo-side { display: grid; gap: 4px; min-width: 0; }
.logo-side > span { font-size: 12.5px; color: var(--muted); }
.color-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: 13px; font-weight: 650; }
.color-row input { width: 44px; height: 32px; padding: 2px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; }
.company-actions { display: flex; justify-content: flex-end; }

/* financeiro */
.fin-list { display: grid; }
.fin-row {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto auto; gap: 16px; align-items: center;
  padding: 14px 20px; border-top: 1px solid var(--line);
}
.fin-row.vencido { box-shadow: inset 3px 0 0 var(--danger); }
.fin-main, .fin-due { display: grid; gap: 2px; min-width: 0; }
.fin-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fin-main span { font-size: 12.5px; color: var(--muted); }
.fin-due strong { font-size: 13.5px; font-variant-numeric: tabular-nums; }
.fin-tag { justify-self: start; font-size: 11px; font-weight: 750; padding: 1px 8px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); }
.fin-tag.vencido { background: var(--danger-soft); color: var(--danger-ink); }
.fin-tag.pago { background: var(--success-soft); color: var(--success-ink); }
.fin-amount { font-size: 15px; text-align: right; }
.fin-row.pago .fin-amount { color: var(--success-ink); }
.fin-actions { display: flex; gap: 6px; justify-content: flex-end; min-width: 120px; }

/* agenda */
.agenda-intro { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.agenda-intro > div { display: grid; gap: 2px; }
.agenda-intro span:not(.notice-icon) { font-size: 13px; color: var(--muted); }
.tab-count { font-style: normal; font-size: 11px; padding: 0 6px; border-radius: 999px; background: var(--surface-3); margin-left: 4px; }
.seg-tabs button.active .tab-count { background: var(--brand-soft); color: var(--brand-soft-ink); }
.agenda-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.agenda-card {
  display: grid; gap: 12px; padding: 16px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow); min-width: 0;
}
.agenda-card.warm { border-left: 3px solid var(--accent); }
.agenda-card.hot { border-left: 3px solid var(--danger); }
.agenda-who { display: flex; gap: 12px; align-items: flex-start; text-align: left; background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; min-width: 0; }
.agenda-who > span { display: grid; gap: 3px; min-width: 0; }
.agenda-reason { font-size: 13px; font-weight: 650; color: var(--ink-2); }
.agenda-card.hot .agenda-reason { color: var(--danger-ink); }
.agenda-facts { font-size: 12px; color: var(--muted); }
.agenda-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.nav-count.urgent { background: var(--danger); color: #fff; }

@media (max-width: 1180px) {
  .agenda-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  /* barra inferior com mais abas: rola de lado */
  .nav-count.urgent { background: var(--danger); }
}
@media (max-width: 760px) {
  .mini-kpis { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .mini-kpi { padding: 12px 14px; }
  .fin-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 14px 16px; }
  .fin-due { grid-row: 2; }
  .fin-amount { grid-row: 1; grid-column: 2; }
  .fin-actions { grid-row: 2; grid-column: 2; min-width: 0; }
  .cp-add { grid-template-columns: minmax(0, 1fr) 110px; }
  .cp-add .btn { grid-column: 1 / -1; }
  .logo-drop { width: 84px; height: 84px; }
  .prio-select .chip-opt { padding: 0 8px; }
}

/* ===================== Resumo reorganizado ===================== */
.tone-danger { --tone-soft: var(--danger-soft); --tone-ink: var(--danger-ink); }
button.stat { font: inherit; color: inherit; text-align: left; cursor: pointer; width: 100%; }
.stat-sub .danger-text { color: var(--danger-ink); font-weight: 750; }
.stat-sub .delta { display: block; margin-top: 2px; }
.dash-split { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.dash-split > .panel { min-width: 0; }
.todo-panel { display: flex; flex-direction: column; }
.todo-list { display: grid; padding: 0 10px 10px; }
.todo-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 10px; border: 0; border-radius: 12px;
  background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; transition: background 0.15s;
}
.todo-row + .todo-row { border-top: 1px solid var(--line); border-radius: 0; }
.todo-row:hover { background: var(--surface-2); border-radius: 12px; }
.todo-icon { width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-soft-ink); }
.todo-row.danger .todo-icon { background: var(--danger-soft); color: var(--danger-ink); }
.todo-row.accent .todo-icon { background: var(--accent-soft); color: var(--accent-ink); }
.todo-row.pj .todo-icon { background: var(--pj-soft); color: var(--pj-ink); }
.todo-text { display: grid; gap: 1px; min-width: 0; flex: 1; }
.todo-text strong { font-size: 14px; }
.todo-text span { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-count { min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--surface-3); color: var(--ink-2); }
.todo-row.danger .todo-count { background: var(--danger); color: #fff; }
.todo-empty { flex: 1; display: grid; place-items: center; align-content: center; gap: 6px; padding: 28px 20px; text-align: center; color: var(--success-ink); }
.todo-empty span { color: var(--muted); font-size: 13px; max-width: 260px; }
@media (max-width: 1180px) {
  .dash-split { grid-template-columns: minmax(0, 1fr); }
  .todo-panel { order: -1; }
}
@media (max-width: 620px) {
  button.stat { text-align: center; }
}

/* ===================== revisão do celular ===================== */
.nav-more-btn { display: none; }
.sync-dot { display: none; }
.more-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.more-item {
  position: relative; display: grid; justify-items: start; gap: 10px; padding: 14px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface); font: inherit; font-weight: 750; color: var(--ink); text-align: left; cursor: pointer;
}
.more-item.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-soft-ink); }
.more-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); }
.more-item.active .more-icon { background: var(--surface); color: var(--brand); }
.more-badge { position: absolute; top: 12px; right: 12px; font-style: normal; font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 999px; background: var(--danger); color: #fff; }
.more-list { display: grid; margin-top: 16px; border-top: 1px solid var(--line); }
.more-row {
  display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 0 4px; border: 0; border-bottom: 1px solid var(--line);
  background: none; font: inherit; font-weight: 650; color: var(--ink); text-align: left; cursor: pointer;
}
.more-row .ico { color: var(--muted); }
.more-row.danger, .more-row.danger .ico { color: var(--danger-ink); }
@keyframes pulse-dot { 50% { opacity: 0.35; } }

@media (max-width: 900px) {
  .hide-mobile { display: none !important; }
  .nav-more { display: none !important; }
  .nav-more-btn { display: flex; position: relative; }
  .nav { grid-auto-columns: minmax(0, 1fr); overflow: visible; min-width: 0; }
  .sidebar { width: 100%; max-width: 100vw; box-sizing: border-box; }
  .nav-item { font-size: 11px; min-height: 52px; }
  .sync-dot {
    display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 999px;
    font-size: 12px; font-weight: 700; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line);
  }
  .sync-dot i { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
  .sync-dot.is-saving i, .sync-dot.is-loading i { background: var(--accent); animation: pulse-dot 1s ease-in-out infinite; }
  .sync-dot.is-error { color: var(--danger-ink); border-color: var(--danger); background: var(--danger-soft); }
  .sync-dot.is-error i { background: var(--danger); }
  .topbar { flex-wrap: nowrap; align-items: center; }
  .topbar-actions { flex: none; gap: 8px; }
}

@media (max-width: 760px) {
  /* 16px nos campos evita o zoom automático do iPhone */
  input, select, textarea, .search input { font-size: 16px !important; }
  /* área de toque confortável */
  .btn { min-height: 44px; }
  .btn.sm { height: auto; min-height: 40px; }
  .icon-btn { min-width: 44px; min-height: 44px; }
  .icon-btn.sm { width: 40px; height: 40px; min-width: 40px; min-height: 40px; }
  .link-btn { min-height: 36px; display: inline-flex; align-items: center; }
  .stat-sub, .rank-sub, .mini-text small, .okpi small { font-size: 12px; }
}

/* listas compactas e filtros recolhidos no celular */
.m-row, .m-filter-btn { display: none; }
.m-filter-count { font-style: normal; font-size: 11px; font-weight: 800; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; background: var(--brand); color: #fff; }
.m-pill { font-size: 11.5px; font-weight: 750; padding: 2px 9px; border-radius: 999px; white-space: nowrap; background: var(--surface-3); color: var(--muted); }
.m-pill.ok { background: var(--success-soft); color: var(--success-ink); }
.m-pill.warn { background: var(--accent-soft); color: var(--accent-ink); }
.m-pill.late { background: var(--danger-soft); color: var(--danger-ink); }
@media (max-width: 760px) {
  .panel .toolbar { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
  .panel .toolbar > .search { min-width: 0; }
  .m-filter-btn { display: inline-flex; gap: 6px; }
  .panel .toolbar > .filter-row { grid-column: 1 / -1; }
  .panel .toolbar > .m-filter-btn ~ .filter-row { display: none; }
  .panel .toolbar.filters-open > .m-filter-btn ~ .filter-row { display: flex; }
  .panel .toolbar.filters-open .m-filter-btn { border-color: var(--brand); color: var(--brand); }
  .table tbody { padding: 0; gap: 0; }
  .table tbody tr { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 0; background: none; }
  .table tbody tr:last-child { border-bottom: 0; }
  .table tbody tr:hover { background: var(--surface-2); }
  .table tbody tr > td:not(.m-row) { display: none !important; }
  .table td.m-row { display: flex !important; align-items: center; justify-content: flex-start; gap: 12px; padding: 12px 16px; text-align: left; }
  .table td.m-row::before { display: none; }
  .m-main { min-width: 0; flex: 1; display: grid; gap: 2px; }
  .m-main strong { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .m-main span { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .m-side { flex: none; display: grid; justify-items: end; gap: 4px; }
  .m-side .money { font-size: 14px; font-weight: 800; }
  .m-side .pill { font-size: 11px; padding: 2px 8px; }
  .m-num { width: 42px; height: 42px; flex: none; border-radius: 12px; display: grid; place-items: center; font-size: 12.5px; font-weight: 800; background: var(--surface-3); color: var(--ink-2); }
  .m-num.urgente { background: var(--danger-soft); color: var(--danger-ink); }
  .m-num.atencao { background: var(--accent-soft); color: var(--accent-ink); }
  .order-table tr.row-urgent td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
  /* totais de pedidos numa faixa só */
  .order-kpis:not(.fin-kpis) { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .order-kpis:not(.fin-kpis) .okpi { padding: 10px; gap: 1px; }
  .order-kpis:not(.fin-kpis) .okpi span { font-size: 11px; line-height: 1.25; }
  .order-kpis:not(.fin-kpis) .okpi strong { font-size: 14.5px; }
  .order-kpis:not(.fin-kpis) .okpi small { display: none; }
}

/* vendedores: cartão compacto; detalhes ao tocar */
.m-only { display: none; }
.seller-list-wrap { display: grid; gap: 12px; min-width: 0; }
.seller-card.compact { cursor: pointer; gap: 12px; min-width: 0; }
.seller-card.compact .seller-info { min-width: 0; flex: 1; }
.seller-card.compact .seller-info strong, .seller-card.compact .seller-info span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seller-pct { flex: none; display: grid; justify-items: end; line-height: 1.15; }
.seller-pct strong { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.seller-pct span { font-size: 11.5px; color: var(--muted); font-weight: 650; }
.seller-line { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.seller-line b { color: var(--ink); }
@media (max-width: 900px) {
  .m-only { display: inline-flex; }
  .sellers-layout:not(.form-open) > .seller-form { display: none; }
  .sellers-layout.form-open > .seller-list-wrap { display: none; }
  .seller-list-wrap > .m-only { justify-self: stretch; justify-content: center; }
}

/* produtos: alternar lista e grade */
.view-toggle { display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; background: var(--surface-3); flex: none; }
.view-toggle button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer; }
.view-toggle button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.prod-list { display: grid; }
.prod-row {
  display: grid; grid-template-columns: minmax(0, 2.6fr) minmax(0, 1fr) minmax(0, 0.9fr) minmax(0, 1fr) minmax(0, 0.7fr) minmax(0, 0.9fr);
  gap: 14px; align-items: center; padding: 12px 20px; border: 0; border-top: 1px solid var(--line); background: none;
  font: inherit; color: inherit; text-align: left; cursor: pointer; transition: background 0.15s; animation: fadeIn 0.35s var(--ease) both;
}
.prod-row:hover { background: var(--surface-2); }
.prod-row.head { cursor: default; padding-block: 10px; font-size: 11.5px; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); animation: none; }
.prod-row.head:hover { background: none; }
.prod-row.off { opacity: 0.6; }
.pr-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pr-name { display: grid; gap: 2px; min-width: 0; }
.pr-name strong { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-name small { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.pr-tags:empty { display: none; }
.pr-tag { font-style: normal; font-size: 11px; font-weight: 750; padding: 1px 8px; border-radius: 999px; background: var(--pj-soft); color: var(--pj-ink); justify-self: start; }
.pr-tag.off { background: var(--surface-3); color: var(--muted); }
.pr-price { display: grid; }
.pr-price strong { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pr-price small { font-size: 12px; color: var(--muted); }
.pr-num { font-size: 13.5px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.pr-num.strong { font-weight: 750; color: var(--ink); }
.pr-mobile { display: none; }
@media (max-width: 760px) {
  .view-toggle span { display: none; }
  .prod-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 16px; }
  .prod-row.head, .pr-num { display: none; }
  .pr-price { justify-items: end; }
  .pr-mobile { display: block; grid-column: 1 / -1; padding-left: 58px; font-size: 12.5px; color: var(--brand); font-weight: 650; }
}
@media (max-width: 760px) {
  .pr-name strong { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}

/* novo pedido no celular: total sempre visível */
.of-sticky { display: none; }
@media (max-width: 900px) {
  .of-sticky {
    position: fixed; left: 0; right: 0; bottom: calc(66px + env(safe-area-inset-bottom, 0px)); z-index: 30;
    display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px;
    background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
  }
  .of-sticky > div { display: grid; line-height: 1.15; }
  .of-sticky span { font-size: 12px; color: var(--muted); font-weight: 650; }
  .of-sticky strong { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
  #view-order-form { padding-bottom: 72px; }
}
@media (max-width: 760px) {
  .of-item { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.3fr) minmax(0, 0.8fr) 40px; }
}

/* ficha do pedido: ações principais à vista, o resto em "Mais" no celular */
.ov-more { display: contents; }
.ov-more-btn { display: none; }
@media (max-width: 760px) {
  .ov-more-btn { display: inline-flex; margin-left: auto; }
  .ov-more { display: none; width: 100%; flex-wrap: wrap; gap: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
  .ov-actions.show-more .ov-more { display: flex; }
  .ov-actions.show-more .ov-more-btn .ico { transform: rotate(180deg); }
  .ov-owner { display: block; }
  .ov-owner .ico { vertical-align: -2px; margin-right: 4px; }
}

/* financeiro em tabela */
.fin-toolbar { grid-template-columns: auto minmax(0, 1fr); align-items: center; }
.fin-toolbar > .filter-row { grid-column: 1 / -1; }
.fin-toolbar .search { height: 40px; }
.fin-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fin-table { min-width: 760px; }
.fin-table td.fin-method { white-space: normal; min-width: 110px; }
.fin-table th, .fin-table td { padding-left: 12px; padding-right: 12px; }
.fin-table th { white-space: normal; line-height: 1.25; }
.fin-table td { white-space: nowrap; }
.fin-table .fin-name { display: block; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.fin-table .fin-num { font-variant-numeric: tabular-nums; }
.fin-table tr.vencido td.cell-main { box-shadow: inset 3px 0 0 var(--danger); }
.fin-table tr.pago .money { color: var(--success-ink); }
td.fin-actions { display: table-cell; min-width: 0; text-align: right; }
td.fin-actions > * { vertical-align: middle; margin-left: 6px; }
.fin-table tfoot td { padding: 12px 16px; border-top: 2px solid var(--line); font-size: 13px; color: var(--muted); font-weight: 650; }
.fin-table tfoot .money { color: var(--ink); font-size: 15px; }
.fin-tag.soon { background: var(--accent-soft); color: var(--accent-ink); }
.fin-mfoot { display: none; }
.m-due { display: flex !important; align-items: center; gap: 6px; color: var(--ink-2) !important; font-weight: 650; }
.m-pay { font-size: 11.5px; font-weight: 750; color: var(--brand); }
@media (max-width: 1180px) {
  .fin-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .fin-toolbar { grid-template-columns: minmax(0, 1fr) auto; }
  .fin-toolbar .fin-tabs { grid-column: 1 / -1; }
  .fin-table { min-width: 0; }
  .fin-table tfoot { display: none; }
  .fin-mfoot { display: flex; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); font-weight: 650; }
  .fin-kpis { gap: 6px; }
  .fin-kpis .okpi { padding: 10px 12px; }
  .fin-kpis .okpi strong { font-size: 16px; }
  .fin-kpis .okpi small { font-size: 11.5px; }
}

/* Para fazer agora: limite de itens e versão compacta no celular */
.todo-list:not(.expanded) .todo-extra { display: none; }
.todo-more { display: inline-flex; align-items: center; justify-content: center; gap: 6px; margin-top: 4px; min-height: 40px; border: 0; border-radius: 10px; background: var(--surface-2); font: inherit; font-size: 13px; font-weight: 750; color: var(--brand); cursor: pointer; }
.todo-list.expanded .todo-more .ico { transform: rotate(180deg); }
@media (max-width: 760px) {
  .todo-panel .panel-head { padding-bottom: 6px; }
  .todo-list { padding: 0 8px 8px; }
  .todo-row { padding: 8px 8px; gap: 10px; }
  .todo-icon { width: 30px; height: 30px; border-radius: 9px; }
  .todo-icon .ico { width: 16px; height: 16px; }
  .todo-text strong { font-size: 13.5px; }
  .todo-text span { font-size: 12px; }
  .todo-count { min-width: 24px; height: 24px; font-size: 11.5px; }
  .todo-empty { padding: 16px; grid-auto-flow: column; justify-content: start; text-align: left; gap: 10px; }
  .todo-empty span { display: none; }
}

/* cadastro: cartão estável entre as etapas */
.auth-card > * { min-width: 0; }
.req-steps li { min-width: 0; white-space: nowrap; overflow: hidden; }
@media (max-width: 760px) {
  .auth { place-items: start center; padding-top: max(40px, env(safe-area-inset-top, 0px)); }
  .auth-card { width: 100%; padding: 24px 20px; }
  .req-steps li { padding: 8px 6px; gap: 6px; font-size: 12px; justify-content: center; }
}

/* cartão do usuário na barra lateral: botões não escapam do cartão */
.user-top { gap: 8px; }
.user-top > .user-out { flex: none; width: 30px; height: 30px; }
.user-info span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#userAvatar { flex: none; }
#userAvatar .avatar { width: 36px; height: 36px; font-size: 13px; }
.user-card { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 760px) {
  .fin-tabs { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .fin-tabs button { padding: 7px 4px; font-size: 12.5px; }
}
@media (max-width: 620px) {
  /* totais do Resumo mais baixos: ícone pequeno no canto */
  .stats .stat, .stats button.stat { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 12px; text-align: left; align-items: start; }
  .stats .stat-icon { position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; border-radius: 8px; }
  .stats .stat-icon .ico { width: 15px; height: 15px; }
  .stats .stat-label { padding-right: 30px; font-size: 12px; }
  .stats .stat-value.money { font-size: 17px; }
  .stats .stat-sub { font-size: 11.5px; line-height: 1.35; }
}

/* resposta do cliente pelo link */
.prio-pill.client-ok { background: var(--success-soft); color: var(--success-ink); }
.prio-pill.client-adj { background: var(--accent-soft); color: var(--accent-ink); }
.ov-client { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; background: var(--success-soft); color: var(--success-ink); }
.ov-client.ajuste { background: var(--accent-soft); color: var(--accent-ink); }
.ov-client > div { display: grid; gap: 2px; min-width: 0; }
.ov-client span { font-size: 12.5px; opacity: 0.9; }
.ov-client em { font-style: normal; font-size: 13.5px; color: var(--ink); margin-top: 4px; }

/* ---------- visual 3D (aprovado nas prévias): ícones com volume, cartões com profundidade, gráficos com degradê ---------- */
:root { --hi: rgba(255, 255, 255, 0.85); --hi2: rgba(255, 255, 255, 0.45); --sh: 15, 23, 42; --c: #0d9488; --c2: #2dd4bf; --c3: #0b5f58; }
:root[data-theme="dark"] { --hi: rgba(255, 255, 255, 0.07); --hi2: rgba(255, 255, 255, 0.03); --sh: 0, 0, 0; }
.tone-brand, .tone-pf { --c: #0d9488; --c2: #2dd4bf; --c3: #0b5f58; }
.tone-pj { --c: #4f46e5; --c2: #818cf8; --c3: #3730a3; }
.tone-accent { --c: #d97706; --c2: #fbbf24; --c3: #92400e; }
.tone-danger { --c: #dc2626; --c2: #f87171; --c3: #991b1b; }

.stat-icon, .panel-icon, .seg-dot:not(.none), .todo-icon {
  overflow: hidden; color: #fff;
  background: linear-gradient(150deg, var(--c2) 0%, var(--c) 55%, var(--c3) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 -3px 6px rgba(0, 0, 0, 0.22), 0 7px 14px -6px var(--c);
}
.seg-dot:not(.none) { --c: #d97706; --c2: #fbbf24; --c3: #92400e; }
.stat-icon::after, .panel-icon::after, .seg-dot:not(.none)::after, .todo-icon::after {
  content: ""; position: absolute; left: 3px; right: 3px; top: 2px; height: 46%; border-radius: 9px 9px 14px 14px; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0));
}
.panel-icon, .seg-dot, .todo-icon { position: relative; overflow: hidden; }
.todo-row { --c: #0d9488; --c2: #2dd4bf; --c3: #0b5f58; }
.todo-row.danger { --c: #dc2626; --c2: #f87171; --c3: #991b1b; }
.todo-row.accent { --c: #d97706; --c2: #fbbf24; --c3: #92400e; }
.todo-row.pj { --c: #4f46e5; --c2: #818cf8; --c3: #3730a3; }
.stat-icon .ico, .panel-icon .ico, .seg-dot .ico, .todo-icon .ico { position: relative; z-index: 1; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25)); }

/* 3D na medida (aprovado na comparação): só os ícones têm volume; cartões, barras e gráfico ficam limpos */
.stat, .panel { box-shadow: 0 1px 2px rgba(var(--sh), 0.05), 0 6px 16px -10px rgba(var(--sh), 0.16); }
.stat:hover { box-shadow: 0 2px 4px rgba(var(--sh), 0.06), 0 12px 24px -12px rgba(var(--sh), 0.22); }
.btn.primary { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 4px 10px -6px var(--brand); }

.ch-bar { fill: url(#chBar3d); }
.ch-bar.today { fill: var(--accent); }
.ch-bar.future { fill: var(--surface-3); }
.ch-cap, .ch-area { display: none; }
.ch-line.prev { stroke: #7c3aed; }
@media (prefers-reduced-motion: reduce) { .stat:hover { transform: none; } }
.todo-row .todo-icon { color: #fff; background: linear-gradient(150deg, var(--c2) 0%, var(--c) 55%, var(--c3) 100%); }

/* visual 3D no sistema inteiro: números de Pedidos e Financeiro, ícones de formulários, avisos e telas vazias */
.tone-success { --tone-soft: var(--success-soft); --tone-ink: var(--success-ink); --c: #16a34a; --c2: #4ade80; --c3: #166534; }
.okpi:has(> .okpi-icon) { grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; align-items: center; }
.okpi:has(> .okpi-icon) > :not(.okpi-icon) { grid-column: 2; }
.okpi .okpi-icon { color: #fff; }
.okpi-icon { grid-row: 1 / span 3; width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; }
.okpi-icon .ico { width: 20px; height: 20px; }
.block-icon, .notice-icon, .empty-icon, .mini-icon { --c: #0d9488; --c2: #2dd4bf; --c3: #0b5f58; }
.notice.warn .notice-icon { --c: #d97706; --c2: #fbbf24; --c3: #92400e; }
.mini-kpi.pj .mini-icon { --c: #4f46e5; --c2: #818cf8; --c3: #3730a3; }
.mini-kpi.accent .mini-icon { --c: #d97706; --c2: #fbbf24; --c3: #92400e; }
.mini-kpi.danger .mini-icon { --c: #dc2626; --c2: #f87171; --c3: #991b1b; }
.mini-kpi.ok .mini-icon { --c: #16a34a; --c2: #4ade80; --c3: #166534; }
.okpi-icon, .block-icon, .notice-icon, .empty-icon, .mini-icon, .notice.warn .notice-icon, .mini-kpi .mini-icon, .onboard-steps b {
  position: relative; overflow: hidden; flex: none; color: #fff;
  background: linear-gradient(150deg, var(--c2) 0%, var(--c) 55%, var(--c3) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 -3px 6px rgba(0, 0, 0, 0.22), 0 7px 14px -6px var(--c);
}
.okpi-icon::after, .block-icon::after, .notice-icon::after, .empty-icon::after, .mini-icon::after, .onboard-art::after {
  content: ""; position: absolute; left: 3px; right: 3px; top: 2px; height: 46%; border-radius: 9px 9px 14px 14px; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0));
}
.empty-icon::after, .onboard-art::after { left: 6px; right: 6px; top: 4px; border-radius: 16px 16px 24px 24px; }
.onboard-art { position: relative; overflow: hidden; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 -5px 10px rgba(0, 0, 0, 0.2), 0 20px 40px -14px rgba(13, 148, 136, 0.7); }
.okpi-icon .ico, .block-icon .ico, .notice-icon .ico, .empty-icon .ico, .mini-icon .ico, .onboard-art .ico { position: relative; z-index: 1; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25)); }

.okpi, .mini-kpi { box-shadow: 0 1px 2px rgba(var(--sh), 0.05), 0 6px 16px -10px rgba(var(--sh), 0.16); }
.okpi.danger { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }

/* celular: números de Pedidos em 3 colunas estreitas, ícone pequeno em cima do título */
@media (max-width: 760px) {
  .order-kpis:not(.fin-kpis) .okpi:has(> .okpi-icon) { grid-template-columns: minmax(0, 1fr); }
  .order-kpis:not(.fin-kpis) .okpi:has(> .okpi-icon) > * { grid-column: 1; }
  .order-kpis:not(.fin-kpis) .okpi-icon { grid-row: auto; width: 26px; height: 26px; border-radius: 9px; margin-bottom: 4px; }
  .order-kpis:not(.fin-kpis) .okpi-icon .ico { width: 14px; height: 14px; }
  .okpi-icon { width: 36px; height: 36px; border-radius: 11px; }
}

/* ---------- relatórios: Curva ABC, mapa de vendas e margem ---------- */
.rep-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.rep-tabs button { display: inline-flex; align-items: center; gap: 6px; }
.rep-range { font-size: 13px; margin-top: -8px; }
.rep-abc-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.abc-letter { font-size: 19px; font-weight: 800; position: relative; z-index: 1; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); }
.okpi strong small { font-size: 13px; font-weight: 700; }
.abc-pill { font-weight: 800; letter-spacing: 0.01em; }
.abc-pill.abc-a { background: var(--brand-soft); color: var(--brand-soft-ink); }
.abc-pill.abc-b { background: var(--accent-soft); color: var(--accent-ink); }
.abc-pill.abc-c { background: var(--pj-soft); color: var(--pj-ink); }
.pr-tags .abc-pill, .prod-info .abc-pill { font-size: 10.5px; padding: 1px 7px; margin-right: 6px; }
span.abc-a, i.abc-a { background: #0d9488; }
span.abc-b, i.abc-b { background: #f59e0b; }
span.abc-c, i.abc-c { background: #6366f1; }
.abc-stack { display: flex; height: 12px; border-radius: 99px; overflow: hidden; gap: 2px; margin-bottom: 14px; }
.abc-stack i { display: block; height: 100%; }
.abc-bar { filter: none; }
.ch-cut { stroke: color-mix(in srgb, var(--accent) 60%, var(--line)); stroke-dasharray: 4 4; }
.ch-line.cum { stroke: #7c3aed; stroke-width: 2.2; }
.chart-foot .lg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.rep-table { min-width: 640px; }
.rep-table th.r, .rep-table td.r { text-align: right; }
.rep-table td { white-space: nowrap; }
.rep-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rep-who > span { display: grid; min-width: 0; }
.rep-who strong { font-weight: 700; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
.rep-who small { color: var(--muted); font-size: 12px; }
.cum { display: inline-flex; align-items: center; gap: 8px; }
.cum .bar { width: 70px; }
.pill.m-ok { background: var(--success-soft); color: var(--success-ink); }
.pill.m-warn { background: var(--accent-soft); color: var(--accent-ink); }
.pill.m-bad { background: var(--danger-soft); color: var(--danger-ink); }
.pill.m-none { background: var(--surface-3); color: var(--muted); }
.pill-admin { font-size: 10.5px; padding: 0 7px; background: var(--pj-soft); color: var(--pj-ink); margin-left: 4px; }
.field-msg.margin-ok { color: var(--success-ink); font-weight: 700; }
.field-msg.margin-warn { color: var(--accent-ink); font-weight: 700; }
.field-msg.margin-bad { color: var(--danger-ink); font-weight: 700; }
.goal-edit { display: inline-flex; align-items: center; gap: 6px; }
.goal-edit input { width: 64px; height: 30px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-weight: 700; }
.goal-edit .btn.sm { height: 30px; }

.map-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
.map-box { position: relative; }
.rep-map { width: 100%; height: auto; max-height: 560px; display: block; }
.rep-map path { stroke: color-mix(in srgb, #fff 75%, var(--surface)); stroke-width: 1.1; cursor: pointer; transition: fill 0.2s, opacity 0.2s; }
.rep-map path.none { fill: color-mix(in srgb, var(--muted) 14%, var(--surface)); cursor: default; }
.rep-map path:not(.none):hover { stroke: var(--ink); stroke-width: 1.6; }
.rep-map path.sel { stroke: var(--ink); stroke-width: 2.2; }
.rep-map .uf-label { font-size: 11px; font-weight: 800; fill: #fff; text-anchor: middle; dominant-baseline: middle; pointer-events: none; paint-order: stroke; stroke: rgba(0, 0, 0, 0.28); stroke-width: 2px; }
.map-tip { position: absolute; z-index: 5; pointer-events: none; opacity: 0; transform: translateY(4px); transition: opacity 0.12s, transform 0.12s;
  display: grid; gap: 1px; min-width: 150px; padding: 9px 11px; border-radius: 12px; background: var(--toast-bg); color: var(--toast-ink); font-size: 12.5px; box-shadow: var(--shadow-lg); }
.map-tip.show { opacity: 1; transform: none; }
.map-tip span { font-size: 15px; font-weight: 800; }
.map-tip small { opacity: 0.75; }
.map-legend { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.map-legend i { width: 120px; height: 8px; border-radius: 99px; background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 18%, var(--surface)), var(--brand)); }
.uf-rank { display: grid; gap: 2px; }
.uf-row { display: flex; gap: 12px; align-items: center; width: 100%; padding: 9px 8px; border: 0; background: none; border-radius: 12px; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.uf-row:hover { background: var(--surface-2); }
.uf-main { flex: 1; min-width: 0; display: grid; gap: 5px; }
.uf-badge { width: 36px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(150deg, #2dd4bf, #0d9488 55%, #0b5f58); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 6px 12px -6px #0d9488; }
.uf-badge.lg { width: 46px; height: 40px; font-size: 14px; border-radius: 12px; }
.uf-panel { display: grid; gap: 8px; }
.uf-panel-head { display: flex; align-items: center; gap: 12px; }
.uf-panel-head > div { flex: 1; min-width: 0; }
.uf-panel-head h4 { font-size: 17px; font-weight: 800; margin: 0; }
.uf-panel h5 { margin: 10px 0 2px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 800; }
.uf-panel h5 small { text-transform: none; letter-spacing: 0; font-weight: 600; }
.uf-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.uf-kpis > div { display: grid; gap: 1px; padding: 9px 11px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.uf-kpis span { font-size: 11.5px; color: var(--muted); font-weight: 650; }
.uf-kpis b { font-size: 15px; font-variant-numeric: tabular-nums; }
.uf-line { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 4px; border: 0; background: none; border-radius: 10px; text-align: left; font: inherit; color: inherit; }
button.uf-line { cursor: pointer; }
button.uf-line:hover { background: var(--surface-2); }
.uf-n { width: 24px; font-size: 12px; font-weight: 800; color: var(--muted); }
.uf-t { flex: 1; min-width: 0; display: grid; }
.uf-t strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uf-t small { font-size: 11.5px; color: var(--muted); }
.uf-line b { font-size: 13px; font-variant-numeric: tabular-nums; }
.uf-cities { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 1000px) { .map-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .rep-abc-kpis { grid-template-columns: minmax(0, 1fr); }
  .rep-head .seg-tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .rep-head .seg-tabs button { white-space: nowrap; }
  .rep-table { min-width: 0; }
  .rep-who strong { max-width: 220px; }
  .rep-map .uf-label { font-size: 13px; }
}
#reportsBody { grid-template-columns: minmax(0, 1fr); }
#reportsBody > *, .rep-head > * { min-width: 0; max-width: 100%; }
/* linha do mês passado lisa, sem pontilhado */
.ch-line.prev { stroke-dasharray: none; stroke-width: 2.2; }
/* mapa de vendas dentro do Resumo: um pouco mais baixo para não empurrar o resto */
#view-dashboard .rep-map { max-height: 460px; margin-inline: auto; }
#dashboardBody > * { min-width: 0; }

/* ---------- estoque ---------- */
.pill.st-ok { background: var(--success-soft); color: var(--success-ink); }
.pill.st-low { background: var(--accent-soft); color: var(--accent-ink); }
.pill.st-out { background: var(--danger-soft); color: var(--danger-ink); }
.pill.st-none { background: var(--surface-3); color: var(--muted); }
.stock-toolbar { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.stock-toolbar > .seg-tabs { grid-column: 1 / -1; justify-self: start; }
.stock-actions { display: flex; gap: 8px; }
.stock-table { min-width: 860px; }
.stock-table th.r, .stock-table td.r { text-align: right; }
.stock-table td { white-space: nowrap; }
.stock-h { margin: 0 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 800; }
.of-stock { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.of-stock.warn { color: var(--accent-ink); font-weight: 700; }
.of-stock-wrap:empty { display: none; }
.count-list { display: grid; gap: 2px; }
.count-row { display: flex; align-items: center; gap: 12px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.count-row input { width: 110px; height: 38px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-weight: 700; text-align: right; padding: 0 10px; }
.count-row input:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); }
#stockBody { grid-template-columns: minmax(0, 1fr); }
#stockBody > * { min-width: 0; }
@media (max-width: 760px) {
  .stock-toolbar { grid-template-columns: minmax(0, 1fr); }
  .stock-actions { justify-content: stretch; }
  .stock-actions .btn { flex: 1; justify-content: center; }
  .stock-toolbar > .seg-tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .stock-toolbar > .seg-tabs button { white-space: nowrap; }
  .stock-table { min-width: 0; }
}
/* celular: Relatórios e Estoque mostram cada linha como cartão (as outras tabelas usam a linha resumida .m-row) */
@media (max-width: 760px) {
  .table.rep-table tbody, .table.stock-table tbody { padding: 12px; display: grid; gap: 10px; }
  .table.rep-table tbody tr, .table.stock-table tbody tr { border: 1px solid var(--line); border-radius: 14px; padding: 6px 0; background: var(--surface); }
  .table.rep-table tbody tr > td:not(.m-row), .table.stock-table tbody tr > td:not(.m-row) { display: flex !important; }
}
@media (max-width: 760px) {
  .table.stock-table td[data-label="Reservado"], .table.stock-table td[data-label="Mínimo"], .table.stock-table td[data-label="Vende em 30 dias"] { display: none !important; }
}
