/* Painel Comercial CGLUB — identidade Lubrax (verde + amarelo) */
:root {
  /* paleta de marca */
  --lbx-green: #00843D;
  --lbx-green-600: #00702F;
  --lbx-green-700: #00612C;
  --lbx-green-900: #003D1C;
  --lbx-green-50: #E8F5EE;
  --lbx-yellow: #FFC72C;
  --lbx-yellow-600: #E5A800;
  --lbx-yellow-50: #FFF7DD;

  /* tokens de interface (claro) */
  --bg: #F3F6F4;
  --surface: #FFFFFF;
  --surface-2: #EEF3F0;
  --border: #DCE4DF;
  --ink: #142019;
  --ink-2: #44524A;
  --ink-3: #6F7D75;
  --brand: var(--lbx-green);
  --brand-hover: var(--lbx-green-700);
  --brand-ink: #FFFFFF;
  --brand-soft: var(--lbx-green-50);
  --accent: var(--lbx-yellow);
  --accent-ink: #2A1F00;
  --accent-soft: var(--lbx-yellow-50);
  --bar: var(--lbx-green);
  --side-bg: linear-gradient(180deg, #00592A 0%, #003D1C 100%);
  --side-ink: rgba(255,255,255,.82);
  --good: #17793A; --good-bg: #E3F4E8;
  --warn: #8A5D00; --warn-bg: #FFF3D1;
  --bad: #B3261E;  --bad-bg: #FCE6E4;
  --info: #1F4F96; --info-bg: #E8EFFA;
  --shadow: 0 1px 2px rgba(16,40,26,.06), 0 4px 14px rgba(16,40,26,.05);
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0C120E; --surface: #141C17; --surface-2: #1B2620; --border: #2A3830;
    --ink: #E7EEE9; --ink-2: #B3C1B8; --ink-3: #85948B;
    --brand: #35B96E; --brand-hover: #4CC981; --brand-ink: #04140A; --brand-soft: #173325;
    --accent: #FFC72C; --accent-soft: #33290C; --bar: #3DBE74;
    --side-bg: linear-gradient(180deg, #0A2A17 0%, #06190D 100%);
    --good: #6FD391; --good-bg: #163222; --warn: #F0C75A; --warn-bg: #352B10;
    --bad: #FF8A80; --bad-bg: #3A1B19; --info: #9CC0FF; --info-bg: #17243A;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0C120E; --surface: #141C17; --surface-2: #1B2620; --border: #2A3830;
  --ink: #E7EEE9; --ink-2: #B3C1B8; --ink-3: #85948B;
  --brand: #35B96E; --brand-hover: #4CC981; --brand-ink: #04140A; --brand-soft: #173325;
  --accent: #FFC72C; --accent-soft: #33290C; --bar: #3DBE74;
  --side-bg: linear-gradient(180deg, #0A2A17 0%, #06190D 100%);
  --good: #6FD391; --good-bg: #163222; --warn: #F0C75A; --warn-bg: #352B10;
  --bad: #FF8A80; --bad-bg: #3A1B19; --info: #9CC0FF; --info-bg: #17243A;
  --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 14px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
a { color: var(--brand); }
p { margin: 0 0 8px; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.num, td.n, th.n { font-variant-numeric: tabular-nums; text-align: right; }
.ico-svg { width: 18px; height: 18px; flex: none; }
code.senha { font: 600 16px ui-monospace, Consolas, monospace; background: var(--surface); padding: 2px 8px; border-radius: 6px; border: 1px dashed var(--border); user-select: all; }

/* ---------- logo ---------- */
.logo-slot { display: inline-flex; align-items: center; }
.logo-img { display: block; height: 32px; width: auto; max-width: 160px; object-fit: contain; }
.logo-slot.md .logo-img { height: 34px; }
.logo-slot.lg .logo-img { height: 56px; max-width: 220px; }
.logo-slot.xl .logo-img { height: 72px; max-width: 260px; }
.logo-fallback {
  position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; overflow: hidden;
  background: var(--lbx-green); color: #fff; font-weight: 800; letter-spacing: .5px; font-size: 15px;
}
.logo-fallback i { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; background: var(--lbx-yellow); }
.logo-slot.on-dark .logo-fallback { background: rgba(255,255,255,.12); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.logo-slot.xl .logo-fallback { width: 64px; height: 64px; font-size: 22px; border-radius: 16px; }
.logo-slot.xl .logo-fallback i { height: 12px; }
.logo-slot.lg .logo-fallback { width: 52px; height: 52px; font-size: 19px; }
.logo-preview { padding: 14px; background: var(--surface-2); border-radius: 10px; margin: 8px 0 10px; display: flex; gap: 16px; }

/* ---------- autenticação ---------- */
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--ink-3); }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-brand { position: relative; background: radial-gradient(1200px 600px at 0% 0%, #0A9A4C 0%, transparent 60%), var(--side-bg); color: #fff; display: flex; align-items: center; padding: 48px; overflow: hidden; }
.auth-brand::after { content: ""; position: absolute; right: -120px; top: -120px; width: 420px; height: 420px; border-radius: 50%; border: 56px solid rgba(255,199,44,.13); }
.auth-brand-in { position: relative; z-index: 1; max-width: 440px; }
.auth-brand h1 { font-size: 38px; font-weight: 800; margin-top: 28px; letter-spacing: -.02em; }
.auth-brand p { font-size: 16px; color: rgba(255,255,255,.8); }
.auth-points { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 10px; }
.auth-points li { display: flex; gap: 10px; align-items: center; color: rgba(255,255,255,.9); }
.auth-points li::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--lbx-yellow); }
.auth-brand .stripe { position: absolute; left: 0; right: 0; bottom: 0; height: 10px; background: var(--lbx-yellow); }
.auth-form { position: relative; display: grid; place-items: center; padding: 32px 20px; background: var(--bg); }
.auth-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 28px; box-shadow: var(--shadow); }
.auth-card h2 { font-size: 22px; margin-bottom: 4px; }
.tema-auth { position: absolute; top: 16px; right: 16px; }
.pwd { position: relative; }
.pwd input { width: 100%; padding-right: 70px; }
.pwd .linklike { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 12px; }
@media (max-width: 860px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-brand { padding: 28px 20px 36px; }
  .auth-brand h1 { font-size: 26px; margin-top: 16px; }
  .auth-points { display: none; }
}

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: var(--side-bg); color: var(--side-ink); display: flex; flex-direction: column; padding: 18px 12px 12px; overflow-y: auto; z-index: 30; }
.side::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: var(--lbx-yellow); }
.side-brand { display: flex; gap: 10px; align-items: center; padding: 2px 8px 18px; border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 10px; }
.side-brand b { display: block; color: #fff; font-size: 14px; }
.side-brand span { font-size: 12px; color: rgba(255,255,255,.65); }
.side-nav { flex: 1; }
.nav-group { margin-bottom: 14px; }
.nav-label { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px; color: rgba(255,255,255,.45); padding: 6px 12px; font-weight: 700; }
.side-nav a { position: relative; display: flex; gap: 11px; align-items: center; padding: 9px 12px; border-radius: 10px; color: var(--side-ink); text-decoration: none; font-weight: 500; }
.side-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-nav a.active { background: rgba(255,255,255,.12); color: #fff; font-weight: 600; }
.side-nav a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--lbx-yellow); }
.side-user { display: flex; align-items: center; gap: 6px; padding: 10px 4px 14px; border-top: 1px solid rgba(255,255,255,.1); }
.user-chip { flex: 1; display: flex; gap: 10px; align-items: center; text-decoration: none; color: #fff; padding: 6px; border-radius: 10px; min-width: 0; }
.user-chip:hover, .user-chip.active { background: rgba(255,255,255,.08); }
.user-chip b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip small { color: rgba(255,255,255,.6); font-size: 11.5px; }
.user-chip > span:last-child { min-width: 0; }
.side .icon-btn { color: rgba(255,255,255,.75); border-color: transparent; background: transparent; }
.side .icon-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--lbx-yellow); color: var(--accent-ink); font-weight: 800; font-size: 12.5px; }
.avatar.sm { width: 26px; height: 26px; font-size: 10.5px; vertical-align: middle; }
.avatar.lg { width: 56px; height: 56px; font-size: 19px; }

.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 12px 24px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.page-title { flex: 1; min-width: 0; }
.page-title h1 { font-size: 19px; font-weight: 800; }
.page-title p { margin: 0; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.icon-btn.menu-btn { display: none; }
main { padding: 22px 24px 40px; max-width: 1440px; width: 100%; margin: 0 auto; }
main:focus { outline: none; }
.scrim { display: none; }

@media (max-width: 1000px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; transform: translateX(-100%); visibility: hidden; transition: transform .2s ease, visibility .2s; }
  body.nav-open .side { transform: none; visibility: visible; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 25; }
  .icon-btn.menu-btn { display: inline-grid; }
  .topbar { padding: 10px 14px; flex-wrap: wrap; }
  .top-actions { width: 100%; justify-content: flex-start; }
  main { padding: 16px 14px 32px; }
}
@media (max-width: 520px) {
  .topbar .switch span { display: none; }
  .topbar .switch::after { content: "Sem remessa"; font-size: 12px; }
  #btnImportar span { display: none; }
}

/* ---------- botões e campos ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink);
  border-radius: 10px; padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; min-height: 38px;
  transition: background .12s;
}
.btn:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.ghost { background: var(--surface); color: var(--ink-2); border-color: var(--border); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 4px 10px; font-size: 12.5px; min-height: 30px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); cursor: pointer; font: inherit; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.linklike { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
input[type=text], input[type=number], input[type=date], input[type=search], input[type=email], input[type=password], input[type=tel], input:not([type]), select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 10px; min-width: 0; min-height: 38px;
}
input[readonly], input:disabled { background: var(--surface-2); color: var(--ink-2); }
textarea { width: 100%; min-height: 76px; resize: vertical; }
input[type=range] { accent-color: var(--brand); width: 100%; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, .chip:focus-visible, .icon-btn:focus-visible, a:focus-visible, tr:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.switch { display: inline-flex; gap: 7px; align-items: center; font-size: 13px; color: var(--ink-2); cursor: pointer; padding: 0 4px; }
.switch input { accent-color: var(--brand); width: 16px; height: 16px; }
.sel-mes select { font-weight: 600; }
.form { display: grid; gap: 2px; }
.field { display: grid; gap: 5px; margin-bottom: 12px; }
.field > span, .field-l { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field input, .field select { width: 100%; }
.row { display: flex; gap: 10px 12px; flex-wrap: wrap; align-items: flex-end; }
.row > .field { flex: 1 1 180px; }
.erro { color: var(--bad); font-weight: 600; min-height: 1em; margin: 4px 0 8px; }
fieldset { border: 1px solid var(--border); border-radius: 12px; padding: 6px 14px 4px; }
legend { font-weight: 700; padding: 0 6px; }

/* ---------- layout ---------- */
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(4, minmax(0,1fr)); }
.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0,1fr)); } .two, .three { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .kpis { gap: 10px; } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card.soft { background: var(--surface-2); box-shadow: none; border-color: transparent; }
.card > header { display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; margin-bottom: 14px; flex-wrap: wrap; }
.section { margin-top: 18px; }
.hello { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.hello h2 { font-size: 22px; font-weight: 800; }
.hello p { margin: 2px 0 0; }

/* KPI */
.kpi { position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--brand); opacity: .9; }
.kpi .kpi-ico { position: absolute; right: 14px; top: 14px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.kpi .label { font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--ink-3); padding-right: 40px; }
.kpi .value { font-size: 27px; font-weight: 800; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi .foot { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.status-row { display: inline-flex; gap: 6px; flex-wrap: wrap; font-size: 16px; }
.meter { position: relative; height: 7px; background: var(--surface-2); border-radius: 4px; margin-top: 10px; overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--bar); border-radius: 4px; }
@media (max-width: 520px) { .kpi .value { font-size: 21px; } .card { padding: 14px; } .kpi .kpi-ico { display: none; } .kpi .label { padding-right: 0; } }

.alert { border-radius: 12px; padding: 11px 14px; margin-bottom: 14px; display: flex; gap: 10px; align-items: flex-start; }
.alert > span:first-child { flex: none; }
.alert.warn { background: var(--warn-bg); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); }
.alert.info { background: var(--info-bg); border: 1px solid color-mix(in srgb, var(--info) 25%, transparent); }
.alert.bad { background: var(--bad-bg); border: 1px solid color-mix(in srgb, var(--bad) 30%, transparent); }
.alert.good { background: var(--good-bg); border: 1px solid color-mix(in srgb, var(--good) 30%, transparent); }

/* tabelas */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--ink-3); font-weight: 700; background: var(--surface); position: sticky; top: 0; white-space: nowrap; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--ink); }
tbody tr:hover { background: var(--surface-2); }
tr.clickable { cursor: pointer; }
#tVend td:first-child { min-width: 190px; }
#tVend td:nth-child(2) { white-space: nowrap; }
tr.hl { background: var(--warn-bg); }
td input, td select { width: 100%; padding: 5px 7px; min-height: 32px; }
td.qtd { width: 110px; }
tfoot td { font-weight: 700; border-top: 2px solid var(--border); border-bottom: 0; }
.list { margin: 0; padding-left: 18px; display: grid; gap: 7px; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.neutral { background: var(--surface-2); color: var(--ink-2); }
.pill.brand { background: var(--brand-soft); color: var(--brand); }
.pill .ico { font-size: 10px; }

.inbar { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.inbar .track { flex: 1; height: 8px; background: var(--surface-2); border-radius: 4px; position: relative; overflow: hidden; }
.inbar .track i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--bar); border-radius: 0 4px 4px 0; }
.inbar .track b { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--ink-3); }
.inbar span { width: 46px; text-align: right; font-variant-numeric: tabular-nums; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.filters input[type=search] { min-width: 200px; flex: 1; max-width: 360px; }

/* gráficos */
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .axis text { fill: var(--ink-3); font-size: 11px; }
.chart .grid line { stroke: var(--border); stroke-dasharray: 2 3; }
.hbars { display: grid; gap: 9px; }
.hbar { display: grid; grid-template-columns: minmax(110px, 34%) 1fr 96px; gap: 10px; align-items: center; font-size: 13px; }
.hbar .t { height: 14px; background: var(--surface-2); border-radius: 0 4px 4px 0; }
.hbar .t i { display: block; height: 100%; background: var(--bar); border-radius: 0 4px 4px 0; min-width: 2px; }
.hbar:hover .t i { background: var(--brand-hover); }
.hbar .v { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.hbar .k { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tip { position: fixed; z-index: 70; pointer-events: none; background: var(--ink); color: var(--bg); padding: 6px 9px; border-radius: 6px; font-size: 12px; box-shadow: 0 4px 12px rgba(0,0,0,.2); max-width: 280px; }

/* gaveta */
.drawer { position: fixed; inset: 0; background: rgba(5,20,10,.45); z-index: 50; display: flex; justify-content: flex-end; }
.drawer[hidden] { display: none; }
.drawer-panel { background: var(--bg); width: min(720px, 100%); height: 100%; overflow-y: auto; padding: 22px; position: relative; border-left: 5px solid var(--lbx-yellow); }
.drawer-panel h2 { font-size: 20px; padding-right: 48px; }
.drawer .close { position: absolute; right: 16px; top: 16px; }
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; margin: 12px 0; }
@media (max-width: 620px) { .stat-row { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.mini { background: var(--surface-2); border-radius: 12px; padding: 11px 12px; }
.card .mini { background: var(--surface-2); }
.card.soft .mini { background: var(--surface); }
.mini .label { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .4px; font-weight: 700; }
.mini .value { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.mini .value.small-v { font-size: 14px; }
.perfis .mini .value { margin-top: 6px; }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.dl dt { color: var(--ink-3); font-size: 12px; font-weight: 600; }
.dl dd { margin: 0; }
.perfil-head { display: flex; gap: 14px; align-items: center; }
.modos .check { align-items: flex-start; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 10px; z-index: 80; box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: calc(100vw - 32px); }
.toast.ok { background: var(--lbx-green-700); color: #fff; }
.toast.erro { background: var(--bad); color: #fff; }

/* ---------- roteiro ---------- */
.roteiro-head { background: var(--side-bg); color: #fff; border-radius: var(--radius); padding: 18px 18px 14px; margin-bottom: 14px; position: relative; overflow: hidden; }
.roteiro-head h2 { font-size: 18px; }
.roteiro-head .muted { color: rgba(255,255,255,.7); }
.progress { height: 6px; background: rgba(255,255,255,.15); border-radius: 4px; margin: 12px 0; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--lbx-yellow); border-radius: 4px; transition: width .2s; }
.steps { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.step-dot { flex: 1 0 auto; min-width: 56px; padding: 7px 8px; border-radius: 9px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); color: rgba(255,255,255,.75); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.step-dot.done { background: rgba(255,255,255,.18); color: #fff; }
.step-dot.current { background: #fff; color: var(--lbx-green-700); border-color: #fff; }
.step-dot.is-a.current { background: var(--lbx-yellow); color: var(--accent-ink); border-color: var(--lbx-yellow); }
.q-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.q-badge { flex: none; width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; font-weight: 800; font-size: 16px; background: var(--brand); color: var(--brand-ink); }
.q-badge.a { background: var(--accent); color: var(--accent-ink); }
.q-head h2 { font-size: 20px; }
.q-head p { margin: 4px 0 0; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 7px 13px; font: inherit; font-size: 13px; cursor: pointer; min-height: 38px; }
.chip:hover { border-color: var(--brand); }
.chip[aria-pressed=true] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 600; }
.chip[aria-pressed=true] .muted { color: inherit; opacity: .8; }
.tipbox { background: var(--accent-soft); border-left: 4px solid var(--accent); border-radius: 10px; padding: 10px 14px; font-size: 13px; color: var(--ink-2); margin-bottom: 14px; }
.tipbox summary { font-weight: 700; cursor: pointer; color: var(--ink); }
.tipbox ul { margin: 6px 0 0 18px; padding: 0; }
.nav-steps { display: flex; justify-content: space-between; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.check { display: flex; gap: 10px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--border); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.prod-sug { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--border); cursor: pointer; }
.prod-sug input[type=checkbox] { width: 19px; height: 19px; accent-color: var(--brand); }
.prod-sug-r { display: grid; justify-items: end; gap: 3px; }
.summary pre { white-space: pre-wrap; font: 13px/1.55 ui-monospace, Consolas, monospace; background: var(--surface-2); padding: 14px; border-radius: 12px; margin: 0; }
.card.soft header { margin-bottom: 8px; }

/* ---------- carteira ---------- */
.seg-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.prod-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: grid; gap: 8px; align-content: start; box-shadow: var(--shadow); }
.prod-card.is-prem { border-top: 3px solid var(--accent); }
.prod-top { display: flex; gap: 6px; align-items: center; }
.prod-card h4 { font-size: 14px; font-weight: 700; }
.prod-card .meta { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { display: inline-block; font-size: 11px; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); font-weight: 600; }
.tag.strong { background: var(--brand-soft); color: var(--brand); }
.tag.prem { background: var(--accent); color: var(--accent-ink); }
.tag.gap { background: var(--brand-soft); color: var(--brand); }
.prod-card .kv { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; font-size: 11.5px; color: var(--ink-3); padding-top: 8px; border-top: 1px solid var(--border); }
.prod-card .kv b { display: block; font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; }
.fam { margin-bottom: 22px; }
.fam > header { margin-bottom: 10px; }
.fam > header p { margin: 3px 0 0; color: var(--ink-2); font-size: 13px; max-width: 900px; }
.fam-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; background: var(--brand); }
.fam-diesel { background: #1F6F8B; } .fam-moto { background: #C2410C; } .fam-agro { background: #6B8E23; }
.fam-transm { background: #6D28D9; } .fam-graxa { background: #92400E; } .fam-manut { background: #0E7490; }
.fam-ind { background: #475569; } .fam-oem { background: #9F1239; } .fam-leve { background: var(--lbx-green); }

@media print { .side, .topbar, .filters, .nav-steps, .drawer { display: none !important; } .shell { display: block; } body { background: #fff; } .card { box-shadow: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- v3: servidor, regras e Central do Gestor ---------- */
.sync { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.sync::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.sync.on { color: var(--good); background: var(--good-bg); }
.sync.off { color: var(--warn); background: var(--warn-bg); }
#btnSync.girando svg { animation: girar 0.9s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }
.check.plain { border: 0; padding: 4px 0 10px; font-size: 13px; color: var(--ink-2); }
table.regras td { padding: 8px 10px; }
table.regras tr.grupo td { background: var(--surface-2); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--ink-3); }
table.regras select { min-width: 210px; }
select.mudou { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.regras-user summary { cursor: pointer; padding: 6px 0; }
.ranking { display: grid; gap: 6px; }
.rk { display: grid; grid-template-columns: 38px minmax(120px, 1fr) minmax(160px, 2fr); gap: 10px; align-items: center; padding: 6px 8px; border-radius: 10px; }
.rk.eu { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.rk-pos { font-weight: 800; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.rk.eu .rk-pos { color: var(--ink); }
.txt-bad { color: var(--bad); font-weight: 700; }
.txt-warn { color: var(--warn); font-weight: 700; }
textarea.pauta { font: 13px/1.55 ui-monospace, Consolas, monospace; min-height: 420px; }
#tGestor td:first-child { min-width: 180px; }
@media (max-width: 520px) { .rk { grid-template-columns: 30px 1fr; } .rk .inbar { grid-column: 1 / -1; } #syncStatus { display: none; } }
