/* =====================================================================
   Top Bonés: design system
   ===================================================================== */
:root {
  --brand: #e8702a;
  --brand-ink: color-mix(in srgb, var(--brand) 82%, #000);
  --brand-soft: color-mix(in srgb, var(--brand) 12%, #fff);
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e7e9ee;
  --line-2: #eef0f3;
  --track: #eaedf2;          /* fundo de TODAS as barras de progresso (claro) */
  --side-bg: #111317;
  --side-ink: #c9ccd3;
  --side-muted: #6b7079;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .04);
  --shadow-lg: 0 10px 40px rgba(15, 23, 42, .12);
  --ok: #10b981;
  --warn: #f59e0b;
  --bad: #ef4444;
  --info: #0ea5e9;
  --sidebar-w: 256px;
  --bs-body-font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-color: var(--ink);
  --bs-border-color: var(--line);
  --bs-link-color: var(--brand-ink);
  --bs-link-hover-color: var(--brand);
}

/* =====================================================================
   Barras de rolagem: padrão ÚNICO para o sistema inteiro
   Para mudar a aparência de tudo, altere somente estas variáveis.
   ===================================================================== */
:root {
  --scrollbar-size: 6px;
  --scrollbar-size-sm: 5px;                 /* colunas do Kanban, menus e listas internas */
  --scrollbar-radius: 999px;
  --scrollbar-track: transparent;
  --scrollbar-thumb: rgba(0, 0, 0, .18);          /* tema claro */
  --scrollbar-thumb-hover: rgba(0, 0, 0, .30);
  --scrollbar-thumb-active: rgba(0, 0, 0, .40);
}
/* Tema escuro e menu lateral (sempre escuro): thumb branco translúcido */
:root[data-theme="dark"], .sidebar {
  --scrollbar-thumb: rgba(255, 255, 255, .16);
  --scrollbar-thumb-hover: rgba(255, 255, 255, .30);
  --scrollbar-thumb-active: rgba(255, 255, 255, .40);
}
/* Elementos menores usam a barra mais fina, com o mesmo estilo */
.kb-list, .dropdown-menu, .modal-body { --scrollbar-size: var(--scrollbar-size-sm); }

/* Chrome, Edge, Safari */
*::-webkit-scrollbar { width: var(--scrollbar-size); height: var(--scrollbar-size); background: transparent; }
*::-webkit-scrollbar-track { background: var(--scrollbar-track); border-radius: var(--scrollbar-radius); }
*::-webkit-scrollbar-thumb { background-color: var(--scrollbar-thumb); border-radius: var(--scrollbar-radius); min-height: 28px; min-width: 28px; transition: background-color .2s ease; }
*::-webkit-scrollbar-thumb:hover { background-color: var(--scrollbar-thumb-hover); }
*::-webkit-scrollbar-thumb:active { background-color: var(--scrollbar-thumb-active); }
*::-webkit-scrollbar-corner { background: transparent; }
*::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
*::-webkit-resizer { background: transparent; }

/* Firefox (e navegadores sem ::-webkit-scrollbar).
   No Chrome 121+ estas propriedades desativariam o estilo acima, por isso ficam isoladas aqui. */
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track); }
}

html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--bs-body-font-family); font-size: 14px; letter-spacing: -.005em; }
a { text-decoration: none; }
.text-muted { color: var(--muted) !important; }
.fw-800 { font-weight: 800; }
.tabular { font-variant-numeric: tabular-nums; }
.small-caps { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; color: var(--muted); }

/* ---------------------------------------------------------------------
   Shell
   --------------------------------------------------------------------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--side-bg); color: var(--side-ink);
  position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; padding: 20px 14px 14px; z-index: 1040;
  transition: transform .25s ease; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; padding: 2px 8px 18px; }
.brand:hover { color: #fff; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.brand-logo { height: 34px; max-width: 120px; object-fit: contain; border-radius: 8px; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -.02em; }
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--side-muted); padding: 14px 10px 6px; font-weight: 600; }
.side-link { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; color: var(--side-ink); font-weight: 500; font-size: 13.5px; }
.side-link i { font-size: 16px; opacity: .8; width: 18px; text-align: center; }
.side-link:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.side-link.active { background: rgba(255, 255, 255, .08); color: #fff; box-shadow: inset 2px 0 0 var(--brand); }
.side-link.active i { color: var(--brand); opacity: 1; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; margin-top: 14px; border-top: 1px solid rgba(255, 255, 255, .07); }
.side-user-info { flex: 1; min-width: 0; line-height: 1.2; }
.side-user-info strong { display: block; color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-info small { color: var(--side-muted); font-size: 11.5px; }
.side-user .btn-icon { color: var(--side-ink); }
.btn-new-order { box-shadow: 0 6px 18px color-mix(in srgb, var(--brand) 35%, transparent); }

.topbar {
  position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: 12px;
  padding: 12px 28px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
}
.top-search { position: relative; flex: 1; max-width: 460px; }
.top-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted-2); }
.top-search input { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 8px 12px 8px 36px; font-size: 13.5px; outline: none; }
.top-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.content { padding: 8px 28px 48px; }

.btn-icon { background: none; border: 0; padding: 6px; border-radius: 8px; color: var(--muted); line-height: 1; cursor: pointer; }
.btn-icon:hover { background: rgba(0, 0, 0, .05); color: var(--ink); }
.sidebar-backdrop { display: none; }
.fab {
  position: fixed; right: 18px; bottom: 18px; width: 58px; height: 58px; border-radius: 50%; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-size: 26px; box-shadow: 0 10px 28px color-mix(in srgb, var(--brand) 45%, transparent); z-index: 1030;
}
.fab:hover { color: #fff; }

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  body.sidebar-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 1035; }
  .main { margin-left: 0; }
  .topbar { padding: 10px 16px; }
  .content { padding: 4px 16px 96px; }
}

/* ---------------------------------------------------------------------
   Componentes
   --------------------------------------------------------------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 12px 0 22px; }
.page-title { font-size: 24px; font-weight: 800; letter-spacing: -.03em; margin: 0; }
.page-sub { color: var(--muted); margin: 2px 0 0; }

.card-x { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-x-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; flex-wrap: wrap; }
.card-x-title { font-size: 15px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.card-x-sub { font-size: 12.5px; color: var(--muted); margin: 2px 0 0; }
.card-x-body { padding: 18px 20px 20px; }

.btn { border-radius: 10px; font-weight: 600; font-size: 13.5px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn-lg { font-size: 15px; padding: 11px 18px; border-radius: 12px; }
.btn-sm { font-size: 12.5px; border-radius: 8px; }
.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brand:hover, .btn-brand:focus { background: var(--brand-ink); border-color: var(--brand-ink); color: #fff; }
.btn-light { background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); }
.btn-light:hover { background: var(--surface-2); border-color: #dfe2e8; }
.btn-ghost { background: transparent; border: 0; color: var(--muted); }
.btn-ghost:hover { background: rgba(0, 0, 0, .04); color: var(--ink); }

.form-control, .form-select { border-radius: 10px; border-color: var(--line); font-size: 14px; padding: 9px 12px; }
.form-control-lg { font-size: 15px; padding: 11px 14px; border-radius: 12px; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.form-label { font-weight: 600; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { box-shadow: 0 0 0 3px var(--brand-soft); border-color: var(--brand); }
.input-group-text { background: var(--surface-2); border-color: var(--line); border-radius: 10px; color: var(--muted); font-size: 13px; }
.req::after { content: " *"; color: var(--bad); }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

.avatar { border-radius: 50%; object-fit: cover; flex-shrink: 0; display: inline-block; background: #e2e8f0; }
.avatar-initials { display: inline-grid; place-items: center; font-weight: 700; letter-spacing: -.02em; }
.avatar-ring { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--ring, var(--line)); }

/* Badges */
.badge-soft { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; line-height: 1.4; }
.pay-none { background: #fef2f2; color: #b91c1c; }
.pay-partial { background: #fffbeb; color: #b45309; }
.pay-half { background: #eff6ff; color: #1d4ed8; }
.pay-full { background: #ecfdf5; color: #047857; }
.prio-urgent { background: #ef4444; color: #fff; letter-spacing: .04em; font-size: 10.5px; }
.prio-normal { background: #f1f5f9; color: #64748b; letter-spacing: .04em; font-size: 10.5px; }
.badge-status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap;
  background: color-mix(in srgb, var(--st) 12%, #fff); color: color-mix(in srgb, var(--st) 75%, #000); }
.badge-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--st); }

.due { font-size: 12px; font-weight: 600; white-space: nowrap; }
.due-ok { color: var(--muted); }
.due-soon { color: #b45309; }
.due-late { color: #dc2626; }
.due-done { color: var(--muted-2); font-weight: 500; }

/* Progress */
.bar { height: 8px; background: var(--track); border-radius: 99px; overflow: hidden; position: relative; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: var(--brand); transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.bar.bar-lg { height: 12px; }
.bar.ok > span { background: var(--ok); }
.bar-marker { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); opacity: .35; border-radius: 2px; }

/* Tabela */
.table-x { margin: 0; font-size: 13.5px; }
.table-x thead th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; background: var(--surface-2);
  border-bottom: 1px solid var(--line); padding: 10px 12px; white-space: nowrap; }
.table-x thead th a { color: inherit; }
.table-x thead th a:hover { color: var(--ink); }
.table-x td { padding: 12px; vertical-align: middle; border-color: var(--line-2); }
.table-x tbody tr { transition: background .12s; }
.table-x tbody tr:hover { background: #fafbfc; }
.table-x tbody tr[data-href] { cursor: pointer; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 0 0 var(--radius) var(--radius); }
.thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted-2); flex-shrink: 0; }
.thumb-pdf { color: #dc2626; font-size: 20px; }
.order-num { white-space: nowrap; font-weight: 700; font-size: 12.5px; color: var(--ink); font-variant-numeric: tabular-nums; }

/* Estados vazios */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty i { font-size: 40px; color: #cbd5e1; display: block; margin-bottom: 10px; }
.empty h6 { color: var(--ink); font-weight: 700; margin-bottom: 4px; }

/* Filtros */
.chip-group { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; font-weight: 600;
  color: var(--ink-2); background: var(--surface); cursor: pointer; user-select: none; transition: all .12s; }
.chip span:hover { border-color: #cfd4dc; }
.chip input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip input:focus-visible + span { box-shadow: 0 0 0 3px var(--brand-soft); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; }
.filter-panel { border-top: 1px solid var(--line-2); }
.view-toggle { display: inline-flex; background: #e9ebef; padding: 3px; border-radius: 10px; }
.view-toggle a { padding: 6px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.view-toggle a.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }

.pagination .page-link { border-radius: 8px !important; margin: 0 2px; border: 0; color: var(--ink-2); font-weight: 600; font-size: 13px; }
.pagination .active .page-link { background: var(--ink); color: #fff; }

/* Toasts */
.toast-container { z-index: 2000; }
.app-toast { border: 0; border-radius: 12px; box-shadow: var(--shadow-lg); background: #fff; min-width: 300px; font-size: 13.5px; }
.app-toast > div > i { font-size: 18px; }
.toast-success > div > i { color: var(--ok); }
.toast-danger > div > i { color: var(--bad); }
.toast-warning > div > i { color: var(--warn); }
.toast-info > div > i { color: var(--info); }
.btn-close-sm { font-size: 10px; margin-top: 3px; }
.confirm-icon { width: 52px; height: 52px; border-radius: 50%; background: #fef2f2; color: #dc2626; display: grid; place-items: center; font-size: 22px; margin: 0 auto 12px; }
.modal-content { border: 0; border-radius: 18px; box-shadow: var(--shadow-lg); }

/* Skeleton / loading */
.skeleton { background: linear-gradient(90deg, #eef0f3 25%, #f6f7f9 50%, #eef0f3 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }
.is-loading { pointer-events: none; opacity: .7; }
.is-loading .spinner-border { display: inline-block !important; }

/* ---------------------------------------------------------------------
   Dashboard
   --------------------------------------------------------------------- */
.hero {
  background: radial-gradient(1200px 300px at 100% -40%, color-mix(in srgb, var(--brand) 35%, transparent), transparent 60%), #14161b;
  color: #fff; border-radius: 20px; padding: 26px 28px; position: relative; overflow: hidden;
}
.hero-grid { display: grid; grid-template-columns: 1.1fr 2fr; gap: 28px; align-items: center; }
.hero small { color: #9aa0aa; }
.hero-big { font-size: 44px; font-weight: 800; letter-spacing: -.04em; line-height: 1; margin: 6px 0; font-variant-numeric: tabular-nums; }
.hero-big small { font-size: 16px; color: #9aa0aa; font-weight: 600; letter-spacing: 0; }
.hero-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: rgba(255, 255, 255, .08); border-radius: 14px; overflow: hidden; }
.hero-kpi { background: #1a1d23; padding: 14px 16px; }
.hero-kpi .v { font-size: 20px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hero-kpi .l { font-size: 11.5px; color: #9aa0aa; font-weight: 500; }
.trend { font-size: 11.5px; font-weight: 700; padding: 2px 7px; border-radius: 99px; display: inline-flex; align-items: center; gap: 2px; }
.trend.up { background: rgba(16, 185, 129, .15); color: #34d399; }
.trend.down { background: rgba(239, 68, 68, .15); color: #f87171; }
.trend.flat { background: rgba(148, 163, 184, .15); color: #cbd5e1; }
.card-x .trend.up { color: #047857; background: #ecfdf5; }
.card-x .trend.down { color: #b91c1c; background: #fef2f2; }

.ops { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.ops.ops-2 { grid-template-columns: repeat(2, 1fr); }
.op { display: flex; align-items: center; gap: 14px; padding: 16px 18px; color: var(--ink); }
.op:hover { color: var(--ink); border-color: #dfe2e8; }
.op-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; flex-shrink: 0; }
.op .v { font-size: 22px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.op .l { font-size: 12.5px; color: var(--muted); font-weight: 500; }

.perf-row { display: grid; grid-template-columns: 28px 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.perf-row:last-child { border-bottom: 0; }
.perf-pos { font-weight: 800; color: var(--muted-2); font-size: 13px; text-align: center; font-variant-numeric: tabular-nums; }
.perf-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.perf-meta { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.perf-pct { font-size: 18px; font-weight: 800; letter-spacing: -.02em; text-align: right; min-width: 64px; font-variant-numeric: tabular-nums; }
.level-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: var(--brand-soft); color: var(--brand-ink); text-transform: uppercase; letter-spacing: .04em; }

/* Pódio */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 10px; padding-top: 8px; }
.podium-col { text-align: center; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.podium-col .avatar { margin-bottom: 10px; }
.podium-name { font-weight: 700; font-size: 13.5px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.podium-val { font-size: 12px; color: var(--muted); margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.podium-step { width: 100%; border-radius: 14px 14px 6px 6px; display: flex; align-items: flex-start; justify-content: center; padding-top: 12px; font-size: 26px; font-weight: 800; color: #fff; }
.podium-1 .podium-step { height: 132px; background: linear-gradient(180deg, #f5b700, #e89b00); box-shadow: 0 12px 30px rgba(245, 183, 0, .35); }
.podium-2 .podium-step { height: 96px; background: linear-gradient(180deg, #b8c0cc, #97a1b0); }
.podium-3 .podium-step { height: 72px; background: linear-gradient(180deg, #d99a6c, #b9794b); }
.podium-1 .avatar { --ring: #f5b700; }
.podium-2 .avatar { --ring: #b8c0cc; }
.podium-3 .avatar { --ring: #d99a6c; }
.podium-crown { color: #f5b700; font-size: 22px; line-height: 1; margin-bottom: 4px; }
.podium-empty .podium-step { background: #eef0f3 !important; box-shadow: none !important; color: #cbd5e1; }

.rank-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; }
.rank-row:nth-child(odd) { background: var(--surface-2); }
.rank-pos { width: 26px; height: 26px; border-radius: 8px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; font-weight: 800; font-size: 12px; flex-shrink: 0; }
.rank-row:nth-child(1) .rank-pos { background: #f5b700; border-color: #f5b700; color: #fff; }
.rank-row:nth-child(2) .rank-pos { background: #a7b0bd; border-color: #a7b0bd; color: #fff; }
.rank-row:nth-child(3) .rank-pos { background: #c98556; border-color: #c98556; color: #fff; }

.goal-ring { position: relative; width: 132px; height: 132px; flex-shrink: 0; }
/* Blocos que são escuros nos dois temas usam a mesma trilha do tema escuro */
.hero, .sum-box { --track: #272b34; }
.goal-ring svg { transform: rotate(-90deg); }
.goal-ring circle:first-child { stroke: var(--track); }
.goal-ring .center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.goal-ring .center b { font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1; display: block; }
.goal-ring .center small { font-size: 11px; color: var(--muted); }

.level-steps { display: flex; gap: 4px; margin-top: 10px; }
.level-steps > div { flex: 1; text-align: center; font-size: 10px; font-weight: 700; color: var(--muted-2); }
.level-steps > div::before { content: ""; display: block; height: 6px; border-radius: 4px; background: var(--track); margin-bottom: 5px; }
.level-steps > div.on { color: var(--brand-ink); }
.level-steps > div.on::before { background: var(--brand); }


.stat-mini { padding: 14px 16px; border-radius: 14px; background: var(--surface-2); }
.stat-mini .v { white-space: nowrap; font-size: 20px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-mini .l { font-size: 12px; color: var(--muted); }

.list-line { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-2); color: var(--ink); }
.list-line:last-child { border-bottom: 0; }
.list-line:hover { color: var(--ink); }
.list-line:hover .ll-title { color: var(--brand-ink); }
.ll-title { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ll-sub { font-size: 12px; color: var(--muted); }

.period-picker { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.period-picker .form-select, .period-picker .form-control { width: auto; padding: 6px 30px 6px 10px; font-size: 13px; }
.period-picker .form-control { padding-right: 10px; }

@media (max-width: 1199.98px) {
  .hero-grid { grid-template-columns: 1fr; }
  .ops { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 575.98px) {
  .hero { padding: 20px; border-radius: 16px; }
  .hero-big { font-size: 36px; }
  .hero-kpis { grid-template-columns: 1fr 1fr; }
  .hero-kpi { padding: 12px; }
  .hero-kpi .v { font-size: 15px; white-space: nowrap; }
  .ops { gap: 10px; }
  .op { padding: 12px; gap: 10px; }
  .op .v { font-size: 18px; }
  .op-ic { width: 36px; height: 36px; font-size: 16px; }
  .perf-row { grid-template-columns: 20px 36px minmax(0, 1fr); }
  .perf-row { position: relative; }
  .perf-row .perf-pct { position: absolute; right: 0; top: 14px; font-size: 16px; min-width: 0; }
  .perf-row .perf-name { padding-right: 52px; }
  .podium-1 .podium-step { height: 104px; }
  .podium-2 .podium-step { height: 76px; }
  .podium-3 .podium-step { height: 58px; }
  .page-title { font-size: 21px; }
}

/* ---------------------------------------------------------------------
   Kanban
   --------------------------------------------------------------------- */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; min-height: calc(100vh - 230px); }
.kb-col { flex: 0 0 292px; background: #eceef2; border-radius: 16px; display: flex; flex-direction: column; max-height: calc(100vh - 200px); scroll-snap-align: start; }
.kb-head { padding: 12px 14px 10px; display: flex; align-items: center; gap: 8px; }
.kb-head .dot { width: 9px; height: 9px; border-radius: 50%; }
.kb-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-count { font-size: 12px; font-weight: 700; color: var(--muted); background: #fff; padding: 1px 8px; border-radius: 99px; font-variant-numeric: tabular-nums; }
.kb-list { padding: 4px 10px 12px; overflow-y: auto; -webkit-overflow-scrolling: touch; flex: 1; min-height: 80px; display: flex; flex-direction: column; gap: 10px; }
.kb-more { font-size: 12px; text-align: center; padding: 4px 0 10px; }
.kb-card { flex-shrink: 0; background: #fff; border-radius: 13px; box-shadow: 0 1px 2px rgba(15, 23, 42, .06); border: 1px solid transparent; cursor: grab; overflow: hidden; transition: box-shadow .15s, border-color .15s, transform .15s; position: relative; }
.kb-card:hover { box-shadow: 0 6px 18px rgba(15, 23, 42, .08); border-color: var(--line); }
.kb-card.urgent { box-shadow: inset 3px 0 0 var(--bad), 0 1px 2px rgba(15, 23, 42, .06); }
.kb-card.locked { cursor: pointer; }
.kb-img { height: 118px; background: #f3f4f6 center/cover no-repeat; display: grid; place-items: center; color: #cbd5e1; font-size: 28px; border-bottom: 1px solid var(--line-2); }
.kb-img.pdf { background: #fff5f5; color: #dc2626; flex-direction: column; font-size: 26px; }
.kb-img.pdf small { font-size: 11px; font-weight: 600; }
.kb-body { padding: 11px 12px 12px; }
.kb-name { font-weight: 700; font-size: 13.5px; line-height: 1.3; margin-bottom: 2px; letter-spacing: -.01em; }
.kb-client { font-size: 12px; color: var(--muted); margin-bottom: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
.kb-qty { font-size: 12.5px; font-weight: 700; }
.kb-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--line-2); }
.kb-seller { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); font-weight: 600; min-width: 0; }
.kb-seller span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-pay { height: 4px; border-radius: 4px; background: var(--track); overflow: hidden; margin-top: 8px; }
.kb-pay > span { display: block; height: 100%; background: var(--ok); }
.kb-ghost { opacity: .35; border: 2px dashed var(--brand) !important; }
.kb-chosen { transform: rotate(1.5deg); box-shadow: var(--shadow-lg) !important; }
.kb-list.drop-hint { background: color-mix(in srgb, var(--brand) 6%, transparent); border-radius: 12px; }
.kb-empty { font-size: 12px; color: var(--muted-2); text-align: center; padding: 18px 0; border: 1.5px dashed #d6d9df; border-radius: 12px; }
.kb-card.saving::after { content: ""; position: absolute; inset: 0; background: rgba(255, 255, 255, .6); }

@media (max-width: 575.98px) {
  .kb-col { flex-basis: 84vw; }
}

/* ---------------------------------------------------------------------
   Pedido
   --------------------------------------------------------------------- */
.item-row { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 14px; padding: 14px; position: relative; }
.item-row + .item-row { margin-top: 10px; }
.item-row .btn-remove { position: absolute; top: 8px; right: 8px; }
.item-idx { font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.sum-box { background: #14161b; color: #fff; border-radius: 16px; padding: 18px; }
.sum-box .row-l { display: flex; justify-content: space-between; font-size: 13px; color: #aab0ba; padding: 4px 0; }
.sum-box .row-l b { color: #fff; font-variant-numeric: tabular-nums; }
.sum-box .big { font-size: 26px; font-weight: 800; letter-spacing: -.03em; color: #fff; }
.sticky-side { position: sticky; top: 76px; }
.prio-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.prio-switch label { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px; text-align: center; font-weight: 700; cursor: pointer; font-size: 13px; transition: all .12s; }
.prio-switch input { display: none; }
.prio-switch input:checked + label.p-normal { border-color: var(--ink); background: var(--ink); color: #fff; }
.prio-switch input:checked + label.p-urgent { border-color: var(--bad); background: var(--bad); color: #fff; }
.dropzone { border: 1.5px dashed #cfd4dc; border-radius: 14px; padding: 22px; text-align: center; color: var(--muted); cursor: pointer; transition: all .15s; background: var(--surface-2); }
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.dropzone i { font-size: 26px; display: block; margin-bottom: 4px; }
.dropzone img { max-height: 140px; border-radius: 10px; margin-top: 10px; }
.days-left { font-size: 12px; font-weight: 700; margin-top: 4px; }

.layout-preview { background: var(--surface-2); border-radius: 14px; overflow: hidden; display: grid; place-items: center; min-height: 240px; border: 1px solid var(--line-2); }
.layout-preview img { max-width: 100%; max-height: 520px; object-fit: contain; display: block; }
.layout-preview.pdf { flex-direction: column; color: #dc2626; padding: 40px; text-align: center; }
.layout-preview.pdf > i { font-size: 54px; }
.file-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.file-strip a { display: block; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; font-size: 13.5px; }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; font-weight: 600; }
.pay-meter { display: flex; align-items: center; gap: 14px; }
.pay-meter .pct { font-size: 30px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 16px 24px; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--line); box-shadow: 0 0 0 3px #fff; }
.timeline li::after { content: ""; position: absolute; left: 9px; top: 16px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline li.t-status::before { background: var(--brand); }
.timeline li.t-payment::before { background: var(--ok); }
.timeline time { display: block; font-size: 11.5px; color: var(--muted); }

@media (max-width: 575.98px) {
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
}

/* ---------------------------------------------------------------------
   Auth
   --------------------------------------------------------------------- */
.auth-body { background: #fff; }
.auth-wrap { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }
.auth-side { background: radial-gradient(900px 500px at 0% 100%, color-mix(in srgb, var(--brand) 40%, transparent), transparent 60%), #111317; color: #fff; display: flex; align-items: center; padding: 56px; }
.auth-side-inner { max-width: 480px; }
.auth-headline { font-size: 40px; font-weight: 800; letter-spacing: -.04em; line-height: 1.08; }
.auth-headline span { color: var(--brand); }
.auth-sub { color: #aab0ba; font-size: 15px; margin: 16px 0 28px; line-height: 1.6; }
.auth-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; color: #d6d9df; }
.auth-points i { color: var(--brand); margin-right: 10px; }
.auth-main { display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-title { font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
@media (max-width: 991.98px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { padding: 28px 20px; }
  .auth-side .auth-headline { font-size: 26px; }
  .auth-points, .auth-sub { display: none; }
  .auth-side .brand { margin-bottom: 12px !important; }
}

/* ---------------------------------------------------------------------
   Impressão
   --------------------------------------------------------------------- */
@media print {
  .sidebar, .topbar, .fab, .no-print, .toast-container { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; }
  body { background: #fff; }
  .card-x { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
}

/* =====================================================================
   Tema escuro (data-theme="dark" em <html>), alternado pelo botão da barra superior
   ===================================================================== */
.theme-toggle { font-size: 17px; padding: 8px; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0f13;
  --surface: #15181e;
  --surface-2: #1a1e26;
  --ink: #e8eaef;
  --ink-2: #c5cad4;
  --muted: #8b93a1;
  --muted-2: #667080;
  --line: #262b35;
  --line-2: #21252e;
  --track: #272b34;          /* fundo de TODAS as barras de progresso (escuro) */
  --side-bg: #090a0d;
  --brand-soft: color-mix(in srgb, var(--brand) 16%, #15181e);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .55);
  --bs-body-bg: #0d0f13;
  --bs-body-color: #e8eaef;
  --bs-border-color: #262b35;
  --bs-secondary-bg: #1a1e26;
  --bs-tertiary-bg: #15181e;
  --bs-emphasis-color: #fff;
  --bs-link-color: color-mix(in srgb, var(--brand) 80%, #fff);
  --bs-link-hover-color: var(--brand);
  --bs-modal-bg: #15181e;
  --bs-dropdown-bg: #1a1e26;
  --bs-dropdown-link-hover-bg: #232833;
}
[data-theme="dark"] .card-x { border-color: var(--line); }
[data-theme="dark"] .topbar { background: color-mix(in srgb, var(--bg) 88%, transparent); }
[data-theme="dark"] .top-search input { background: var(--surface); color: var(--ink); }
[data-theme="dark"] .top-search input::placeholder, [data-theme="dark"] .form-control::placeholder { color: var(--muted-2); }
[data-theme="dark"] .form-control, [data-theme="dark"] .form-select { background-color: var(--bg); color: var(--ink); border-color: var(--line); }
[data-theme="dark"] .form-control:focus, [data-theme="dark"] .form-select:focus { background-color: var(--bg); color: var(--ink); }
[data-theme="dark"] .form-control:disabled { background-color: var(--surface-2); }
[data-theme="dark"] .form-control-color { background: var(--bg); }
[data-theme="dark"] .input-group-text { background: var(--surface-2); border-color: var(--line); color: var(--muted); }
[data-theme="dark"] .btn-light { background: var(--surface-2); border-color: var(--line); color: var(--ink-2); }
[data-theme="dark"] .btn-light:hover { background: #232833; border-color: #323846; color: var(--ink); }
[data-theme="dark"] .btn-icon:hover, [data-theme="dark"] .btn-ghost:hover { background: rgba(255, 255, 255, .06); }
[data-theme="dark"] .btn-dark { background: var(--ink); border-color: var(--ink); color: var(--bg); }
[data-theme="dark"] .modal-content, [data-theme="dark"] .dropdown-menu { border: 1px solid var(--line); }
[data-theme="dark"] .modal-footer, [data-theme="dark"] .modal-header { border-color: var(--line) !important; }
[data-theme="dark"] .btn-close { filter: invert(1) grayscale(1) brightness(1.6); }
[data-theme="dark"] .app-toast { background: var(--surface-2); border: 1px solid var(--line); }
[data-theme="dark"] .confirm-icon { background: rgba(239, 68, 68, .14); }
[data-theme="dark"] .nav-pills .nav-link { color: var(--muted); }
[data-theme="dark"] .nav-pills .nav-link.active { background: var(--surface-2); color: var(--ink); }
[data-theme="dark"] .alert-warning { background: rgba(245, 158, 11, .1); border-color: rgba(245, 158, 11, .3); color: #fbbf24; }
[data-theme="dark"] .alert-danger { background: rgba(239, 68, 68, .1); border-color: rgba(239, 68, 68, .3); color: #f87171; }
[data-theme="dark"] .alert-success { background: rgba(16, 185, 129, .1); border-color: rgba(16, 185, 129, .3); color: #34d399; }
[data-theme="dark"] .alert-info { background: rgba(14, 165, 233, .1); border-color: rgba(14, 165, 233, .3); color: #38bdf8; }
[data-theme="dark"] .text-dark { color: var(--ink) !important; }
[data-theme="dark"] .text-success { color: #34d399 !important; }
[data-theme="dark"] .text-danger { color: #f87171 !important; }
[data-theme="dark"] .text-warning { color: #fbbf24 !important; }
[data-theme="dark"] .border-top, [data-theme="dark"] .border-bottom, [data-theme="dark"] .border { border-color: var(--line) !important; }
[data-theme="dark"] hr { border-color: var(--line); opacity: 1; }
[data-theme="dark"] code { color: #f0abfc; }

/* Tabelas, listas e estados */
[data-theme="dark"] .table-x tbody tr:hover { background: rgba(255, 255, 255, .025); }
[data-theme="dark"] .table-x td, [data-theme="dark"] .table-x th { color: var(--ink); }
[data-theme="dark"] .table-x thead th { color: var(--muted); }
[data-theme="dark"] .empty i { color: #374050; }
[data-theme="dark"] .avatar { background: #2a303b; }
[data-theme="dark"] .avatar-ring { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--ring, var(--line)); }
[data-theme="dark"] .avatar-initials { filter: brightness(.88) saturate(.9); }
[data-theme="dark"] .thumb { background: var(--surface-2); border-color: var(--line); }
[data-theme="dark"] .skeleton { background: linear-gradient(90deg, #1a1e26 25%, #232833 50%, #1a1e26 75%); background-size: 200% 100%; }
[data-theme="dark"] .bar-marker { background: var(--ink); }
[data-theme="dark"] .prio-normal { background: #232833; color: var(--muted); }

/* Selos */
[data-theme="dark"] .pay-none { background: rgba(239, 68, 68, .14); color: #f87171; }
[data-theme="dark"] .pay-partial { background: rgba(245, 158, 11, .14); color: #fbbf24; }
[data-theme="dark"] .pay-half { background: rgba(59, 130, 246, .16); color: #7db4ff; }
[data-theme="dark"] .pay-full { background: rgba(16, 185, 129, .14); color: #34d399; }
[data-theme="dark"] .badge-status { background: color-mix(in srgb, var(--st) 18%, #15181e); color: color-mix(in srgb, var(--st) 60%, #fff); }
[data-theme="dark"] .due-soon { color: #fbbf24; }
[data-theme="dark"] .due-late { color: #f87171; }
[data-theme="dark"] .card-x .trend.up { background: rgba(16, 185, 129, .14); color: #34d399; }
[data-theme="dark"] .card-x .trend.down { background: rgba(239, 68, 68, .14); color: #f87171; }

/* Filtros */
[data-theme="dark"] .chip span { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
[data-theme="dark"] .chip span:hover { border-color: #384051; }
[data-theme="dark"] .chip input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
[data-theme="dark"] .view-toggle { background: var(--surface-2); }
[data-theme="dark"] .view-toggle a.active { background: #2a303b; color: var(--ink); box-shadow: none; }
[data-theme="dark"] .pagination .page-link { background: transparent; color: var(--ink-2); }
[data-theme="dark"] .pagination .active .page-link { background: var(--brand); color: #fff; }
[data-theme="dark"] .pagination .disabled .page-link { color: var(--muted-2); }
[data-theme="dark"] .prio-switch label { background: var(--bg); color: var(--ink-2); }
[data-theme="dark"] .prio-switch input:checked + label.p-normal { background: #2a303b; border-color: #3a4252; color: var(--ink); }
[data-theme="dark"] .dropzone { background: var(--bg); border-color: #333a48; }

/* Dashboard */
[data-theme="dark"] .hero { border: 1px solid var(--line); }
[data-theme="dark"] .op-ic { background: rgba(255, 255, 255, .06) !important; }
[data-theme="dark"] .op:hover { border-color: #323846; }
[data-theme="dark"] .stat-mini { background: var(--surface-2); }
[data-theme="dark"] .rank-row:nth-child(odd) { background: var(--surface-2); }
[data-theme="dark"] .rank-pos { background: var(--surface); }
[data-theme="dark"] .podium-empty .podium-step { background: var(--surface-2) !important; color: #374050; }
[data-theme="dark"] .avatar-initials[style*="#f1f5f9"] { background: var(--surface-2) !important; color: var(--muted-2) !important; }
[data-theme="dark"] .sum-box { border: 1px solid var(--line); }

/* Kanban */
[data-theme="dark"] .kb-col { background: #101319; border: 1px solid var(--line-2); }
[data-theme="dark"] .kb-count { background: var(--surface-2); }
[data-theme="dark"] .kb-card { background: var(--surface); border-color: var(--line); box-shadow: none; }
[data-theme="dark"] .kb-card:hover { border-color: #384051; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
[data-theme="dark"] .kb-card.urgent { box-shadow: inset 3px 0 0 var(--bad); }
[data-theme="dark"] .kb-img { background-color: var(--surface-2); border-color: var(--line-2); }
[data-theme="dark"] .kb-img.pdf { background: rgba(239, 68, 68, .08); }
[data-theme="dark"] .kb-empty { border-color: #2c323d; }
[data-theme="dark"] .kb-card.saving::after { background: rgba(0, 0, 0, .45); }
[data-theme="dark"] .layout-preview.pdf { color: #f87171; }
[data-theme="dark"] .timeline li::before { box-shadow: 0 0 0 3px var(--surface); }

/* Login */
[data-theme="dark"] .auth-body, [data-theme="dark"] .auth-main { background: var(--bg); }
[data-theme="dark"] .auth-title { color: var(--ink); }
[data-theme="dark"] .btn-outline-secondary { color: var(--muted); border-color: var(--line); }

/* Formulário de pedido (simplificado) */
.order-form { max-width: 860px; }
.total-line { font-size: 13px; color: var(--muted); padding: 2px 2px 0; }
.total-line b { color: var(--ink); font-size: 15px; font-variant-numeric: tabular-nums; }

/* =====================================================================
   Responsivo: celular e tablet
   ===================================================================== */
.table-x { --bs-table-bg: transparent; --bs-table-color: var(--ink); --bs-table-hover-bg: transparent; --bs-table-striped-bg: transparent; }

/* ---- Lista de pedidos em cards (celular) */
.order-cards { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.oc { display: block; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px; color: var(--ink); -webkit-tap-highlight-color: transparent; }
.oc:hover { color: var(--ink); }
.oc:active { border-color: var(--brand); }
.oc-urgent { box-shadow: inset 3px 0 0 var(--bad); }
.oc-top { display: flex; gap: 10px; align-items: flex-start; }
.oc .thumb { width: 52px; height: 52px; }
.oc-title { flex: 1; min-width: 0; }
.oc-name { font-weight: 700; font-size: 15px; line-height: 1.25; letter-spacing: -.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.oc-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.oc-num { font-size: 11px; color: var(--muted); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; letter-spacing: .02em; margin-bottom: 2px; }
.oc-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.oc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.oc-grid small { display: block; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; margin-bottom: 1px; }
.oc-grid b { font-size: 14px; font-variant-numeric: tabular-nums; }
.oc-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-2); font-size: 12.5px; font-weight: 600; color: var(--ink-2); }

/* ---- Kanban: abas por status (celular) */
.kb-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 16px 12px; margin: 0 -16px; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; scroll-padding-left: 16px; scrollbar-width: none; }
.kb-tabs::-webkit-scrollbar { display: none; }
.kb-tab { flex: 0 0 auto; scroll-snap-align: start; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 600; white-space: nowrap; min-height: 40px; }
.kb-tab .dot { width: 8px; height: 8px; border-radius: 50%; }
.kb-tab b { font-size: 11.5px; background: var(--surface-2); color: var(--muted); border-radius: 99px; padding: 1px 7px; font-variant-numeric: tabular-nums; }
.kb-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.kb-tab.active b { background: rgba(255, 255, 255, .22); color: #fff; }
.kb-move { padding: 10px 0 0; }
.kb-move .form-select { min-height: 42px; }

@media (max-width: 767.98px) {
  /* Kanban: uma coluna por vez, largura total */
  .kanban { display: block; overflow: visible; min-height: 0; padding-bottom: 0; }
  .kb-col { display: none; flex: none; width: 100%; max-height: none; background: transparent !important; border: 0 !important; }
  .kb-col.is-active { display: block; }
  .kb-head { display: none; }
  .kb-list { padding: 0; overflow: visible; gap: 12px; min-height: 0; }
  .kb-card { cursor: pointer; }
  .kb-img { height: 100px; }
  .kb-name { font-size: 15px; }
  .kb-empty { padding: 28px 0; font-size: 13px; }

  /* Lista em cards: sem moldura dupla */
  .card-x:has(> .order-cards) { background: transparent; border: 0; box-shadow: none; }
  .card-x > .order-cards { padding: 0; }
  .card-x:has(> .order-cards) > nav { border: 0 !important; padding-left: 0 !important; padding-right: 0 !important; }

  /* Filtros */
  .filters-top > .top-search { flex: 1 1 100%; max-width: none; }
  .filters-top .btn { flex: 1 1 auto; }
  .filters-top .view-toggle { width: 100%; margin-left: 0 !important; }
  .filters-top .view-toggle a { flex: 1; justify-content: center; padding: 9px 12px; }
  .filter-panel .row > [class*="col-"] { flex: 0 0 50%; max-width: 50%; }
  .filter-panel .row > .col-xl-2:only-child { flex: 0 0 100%; max-width: 100%; }

  /* Tamanhos de toque; 16px evita o zoom automático do iOS nos campos */
  .btn { min-height: 42px; }
  .btn-sm { min-height: 38px; }
  .btn-icon { min-width: 40px; min-height: 40px; display: inline-grid; place-items: center; }
  .form-control, .form-select, .top-search input { font-size: 16px; min-height: 46px; }
  .form-control-sm, .form-select-sm { min-height: 42px; }
  .chip span { padding: 9px 14px; }
  .page-head { margin: 8px 0 16px; gap: 10px; }
  .page-head > .d-flex, .page-head .btn { max-width: 100%; }
  .card-x-head { padding: 16px 16px 0; }
  .card-x-body { padding: 16px; }
  .topbar { padding: 8px 16px; }
  .top-search { max-width: none; }

  /* Menu lateral */
  .sidebar { width: min(84vw, 300px); }
  body.sidebar-open { overflow: hidden; }

  /* Detalhes do pedido (modal em tela cheia) */
  #orderModal .modal-header { padding: 16px 16px 0 !important; }
  #orderModal .modal-body { padding: 12px 16px 24px !important; }
  #orderModal .page-title { font-size: 20px; }
  .fab { bottom: calc(16px + env(safe-area-inset-bottom)); right: 16px; width: 52px; height: 52px; font-size: 24px; }
  .content { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
}

@media (min-width: 768px) {
  .kb-tabs { display: none !important; }
}

/* Telas muito estreitas (320px) */
@media (max-width: 359.98px) {
  .content { padding-left: 12px; padding-right: 12px; }
  .topbar { padding-left: 12px; padding-right: 12px; }
  .op .v { font-size: 16px; }
  .oc-grid { gap: 8px 10px; }
  .hero-kpi .v { font-size: 13.5px; }
}

/* ---- Tabelas viram cards empilhados no celular (data-label = rótulo do campo) */
@media (max-width: 767.98px) {
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
  .table-stack tr:last-child { border-bottom: 0; }
  .table-stack td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 0 !important; border: 0 !important; text-align: right !important; }
  .table-stack td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 500; text-align: left; flex-shrink: 0; }
  .table-stack td.ts-title { display: block; text-align: left !important; padding-bottom: 8px !important; font-size: 15px; }
  .table-stack td.ts-actions { justify-content: flex-end; padding-top: 8px !important; }
  .table-stack td.ts-hide { display: none; }
  .table-stack tr:has(> .cat-handle) { position: relative; }
  .table-stack td.cat-handle { position: absolute; top: 8px; right: 8px; width: auto; padding: 0 !important; }
  .table-stack tr:has(> .cat-handle) td.ts-title { padding-right: 44px !important; }
  .table-wrap:has(> .table-stack) { overflow-x: visible; }
}

@media (max-width: 767.98px) {
  /* Seletor de período: mês/ano lado a lado, semana embaixo em largura total */
  .period-picker { width: 100%; gap: 8px; }
  .period-picker > i { display: none; }
  .period-picker .form-select { flex: 1 1 0; width: auto; min-width: 0; }
  .period-picker > span { flex: 0 0 100%; font-size: 12px; margin: 2px 0 -4px !important; }
  .period-picker input[type="date"] { flex: 1 1 100%; width: 100%; }
  .period-picker .btn { flex: 1 1 100%; }
}

@media (max-width: 767.98px) {
  /* Campos com botão embutido empilham (ex.: envio de layout) */
  .input-group:has(> input[type="file"]) { flex-wrap: wrap; gap: 8px; }
  .input-group:has(> input[type="file"]) > .form-control { flex: 1 1 100%; border-radius: 10px !important; }
  .input-group:has(> input[type="file"]) > .btn { flex: 1 1 100%; border-radius: 10px !important; }
}

/* =====================================================================
   Aplicativo (PWA) e notificações
   ===================================================================== */
.side-badge, .bell-badge { background: var(--brand); color: #fff; font-size: 10.5px; font-weight: 700; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px; display: inline-grid; place-items: center; line-height: 1; font-variant-numeric: tabular-nums; }
.side-badge { margin-left: auto; }
.side-badge[hidden], .bell-badge[hidden] { display: none; }
.bell { position: relative; font-size: 17px; }
.bell-badge { position: absolute; top: 0; right: -2px; box-shadow: 0 0 0 2px var(--bg); }
.side-install { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 12px; padding: 9px 10px; border: 1px dashed rgba(255, 255, 255, .16); border-radius: 10px; background: transparent; color: var(--side-ink); font-size: 13px; font-weight: 500; }
.side-install:hover { border-color: var(--brand); color: #fff; }
.side-install[hidden] { display: none; }
.side-install i { color: var(--brand); }

.notif-list { list-style: none; margin: 0; padding: 0; }
.notif { display: flex; align-items: flex-start; gap: 14px; padding: 15px 20px; color: var(--ink); border-bottom: 1px solid var(--line-2); }
.notif-list li:last-child .notif { border-bottom: 0; }
.notif:hover { background: var(--surface-2); color: var(--ink); }
.notif.unread { background: color-mix(in srgb, var(--brand) 5%, transparent); }
.notif-ic { width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center; font-size: 18px; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.notif-ic.sm { width: 36px; height: 36px; font-size: 16px; border-radius: 10px; }
.notif-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.notif-title { font-weight: 600; font-size: 14.5px; line-height: 1.35; }
.notif-body { font-size: 13px; color: var(--muted); }
.notif-time { font-size: 11.5px; color: var(--muted-2); margin-top: 2px; }
.notif-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); margin-top: 7px; flex-shrink: 0; }
.chip span.is-on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
[data-theme="dark"] .chip span.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }

.push-status { font-size: 13px; font-weight: 600; color: var(--muted); }
.push-status[data-tone="on"] { color: var(--ok); }
.push-status[data-tone="bad"] { color: var(--bad); }
.pref-switch { width: 2.6em; height: 1.4em; cursor: pointer; }
.pref-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.pref-group .pref-row:last-child { border-bottom: 0; }
.pref-master { padding-top: 0; }
.pref-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; cursor: pointer; margin: 0; }
.pref-text b { font-weight: 600; font-size: 14px; }
.pref-text small { font-size: 12.5px; color: var(--muted); }
.ios-steps { padding-left: 20px; margin: 0; display: grid; gap: 10px; font-size: 14px; }

/* Aplicativo instalado: respeita as áreas seguras do iPhone (entalhe e barra inferior) */
@media (display-mode: standalone) {
  body { overscroll-behavior-y: none; }
  .topbar { padding-top: calc(12px + env(safe-area-inset-top)); }
  .sidebar { padding-top: calc(20px + env(safe-area-inset-top)); padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .content { padding-bottom: calc(48px + env(safe-area-inset-bottom)); }
}
@media (max-width: 767.98px) {
  .notif { padding: 14px 16px; gap: 12px; }
  .pref-row { align-items: flex-start; }
  .pref-row .form-check { padding-top: 2px; }
}

/* ---- Lista de pedidos (computador e notebook): mesmas informações, agrupadas em colunas empilhadas */
.orders-table { table-layout: auto; width: 100%; }
.orders-table th, .orders-table td { padding: 12px 14px; }
.orders-table td { vertical-align: middle; }
.orders-table .c-order { min-width: 250px; }
.orders-table .c-qty { min-width: 92px; }
.orders-table .c-dates { min-width: 148px; }
.orders-table .c-team { min-width: 130px; }
.orders-table .c-status { min-width: 128px; }
.orders-table .c-money { min-width: 132px; }
.orders-table .c-actions { width: 76px; }
.cell-stack { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.cell-sub { font-size: 12px; color: var(--muted); font-weight: 400; }
.cell-name { line-height: 1.3; overflow-wrap: anywhere; }
.cell-badges { gap: 6px; }
.th-links { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.th-links > * + *::before { content: "/"; margin-right: 8px; opacity: .35; font-weight: 400; }
.orders-table thead th { white-space: normal; }
.orders-table .thumb { width: 46px; height: 46px; }
@media (max-width: 1440px) and (min-width: 992px) {
  :root { --sidebar-w: 232px; }
  .content, .topbar { padding-left: 20px; padding-right: 20px; }
  .orders-table th, .orders-table td { padding: 11px 10px; }
  .orders-table .c-order { min-width: 210px; }
  .orders-table .thumb { width: 40px; height: 40px; }
}
@media (max-width: 1199.98px) and (min-width: 992px) {
  :root { --sidebar-w: 208px; }
  .orders-table th, .orders-table td { padding: 10px 8px; }
  .orders-table .c-order { min-width: 186px; }
  .orders-table .c-qty { min-width: 78px; }
  .orders-table .c-dates { min-width: 124px; }
  .orders-table .c-team { min-width: 100px; }
  .orders-table .c-status { min-width: 112px; }
  .orders-table .c-money { min-width: 112px; }
  .orders-table .c-actions { width: 44px; }
  .orders-table .c-actions .btn { display: block; padding: 3px 6px; }
}

/* Base neutra mantém os logos legíveis no tema escuro sem criar brilho ao redor. */
.carrier-logo { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; padding: 3px 5px; border: 1px solid #dfe4ea; border-radius: 5px; background: #f4f6f8; }
.carrier-logo img { height: var(--h, 22px); max-width: 104px; width: auto; object-fit: contain; display: block; }
/* Na tabela de fretes, a área fixa alinha os nomes e equilibra logos de proporções diferentes. */
.shipping-carrier-cell .carrier-logo { box-sizing: border-box; width: 92px; height: 30px; padding: 3px 5px; }
.shipping-carrier-cell .carrier-logo img { width: 80px; height: 22px; object-fit: contain; }

/* Usuários e permissões */
.role-admin { background: color-mix(in srgb, var(--brand) 16%, transparent); color: var(--brand-ink); }
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-opt { cursor: pointer; margin: 0; }
.role-opt input { position: absolute; opacity: 0; pointer-events: none; }
.role-opt span { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); height: 100%; }
.role-opt span b { font-size: 14.5px; }
.role-opt span small { font-size: 12.5px; color: var(--muted); }
.role-opt input:checked + span { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, var(--surface)); }
.role-opt input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 30%, transparent); }
.perm-groups { display: grid; gap: 18px; }
.perm-title { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding-bottom: 6px; border-bottom: 1px solid var(--line-2); }
.perm-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line-2); cursor: pointer; margin: 0; }
.perm-group .perm-row:last-child { border-bottom: 0; }
.perm-row.is-disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 575.98px) { .role-pick { grid-template-columns: 1fr; } }

/* =====================================================================
   Dashboard da equipe (novo)
   ===================================================================== */
.dx { display: flex; flex-direction: column; gap: 22px; }
.dx-date { color: var(--muted); font-size: 13px; font-weight: 600; margin: 0 0 2px; }
.dx-grid { display: grid; gap: 14px; }
.dx-g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dx-g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.dx-g2 { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 18px; }
.dx-g2.alt { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.dx-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px 26px; min-width: 0; }
.dx-col-gap { display: flex; flex-direction: column; gap: 16px; }
.dx-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.dx-head h2 { margin: 0; font-size: 16px; font-weight: 800; }
.dx-sub, .dx-muted { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.dx-sub { margin-top: 2px; }
.dx-link { font-size: 12.5px; font-weight: 700; color: var(--brand-ink); }
.dx-chip { border: 1px solid var(--line); border-radius: 99px; padding: 3px 11px; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.dx-num, .dx-today-txt b, .dx-kv b, .dx-stats b, .dx-ring b, .dx-pct, .dx-stage b, .dx-rank .end > b, .dx-podium .blk span, .dx-note b {
  font-family: "Fira Sans Condensed", "Arial Narrow", Inter, sans-serif; font-variant-numeric: tabular-nums;
}
.tone-bad { --t: var(--bad); } .tone-warn { --t: var(--warn); } .tone-info { --t: var(--info); } .tone-ok { --t: var(--ok); } .tone-n { --t: var(--muted); }
.dx-tone { background: color-mix(in srgb, var(--t) 15%, transparent); color: color-mix(in srgb, var(--t) 78%, var(--ink)); }
.dx-warn { color: color-mix(in srgb, var(--t, var(--warn)) 80%, var(--ink)); font-weight: 700; }

/* Para resolver hoje */
.dx-today { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); transition: border-color .15s, transform .15s; }
.dx-today:hover { color: var(--ink); border-color: color-mix(in srgb, var(--t) 55%, var(--line)); transform: translateY(-1px); }
.dx-ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 21px; flex-shrink: 0; }
.dx-ic.sm { width: 34px; height: 34px; border-radius: 10px; font-size: 16px; }
.dx-today-txt { flex-grow: 1; min-width: 0; }
.dx-today-txt b { display: block; font-size: 34px; line-height: 1; font-weight: 700; }
.dx-today-txt small { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; font-weight: 600; }
.dx-go { color: var(--muted); }

/* Meta do mês */
.dx-big { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.dx-num { font-weight: 800; font-size: 76px; line-height: .95; letter-spacing: -.02em; }
.dx-num.sm { font-size: 30px; font-weight: 700; line-height: 1; letter-spacing: 0; }
.dx-num.sm small { color: var(--muted); font-size: 16px; font-weight: 600; font-family: Inter, sans-serif; }
.dx-of { color: var(--muted); font-size: 18px; font-weight: 600; }
.dx-pct { margin-left: auto; font-weight: 700; font-size: 40px; color: var(--brand); }
.dx-meter { position: relative; margin-top: 14px; padding: 38px 0 32px; }
.dx-flag { position: absolute; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.dx-flag-goal { top: 0; height: 38px; }
.dx-flag-goal { padding-left: 8px; border-left: 2px solid var(--ink-2); color: var(--ink-2); }
.dx-flag-goal.end { transform: translateX(-100%); padding: 0 8px 0 0; border-left: 0; border-right: 2px solid var(--ink-2); text-align: right; }
.dx-flag-proj.start { transform: none; padding: 0 0 0 8px; border-right: 0; border-left: 2px dashed currentColor; text-align: left; }
.dx-flag-proj { top: auto; bottom: 0; height: 32px; display: flex; align-items: flex-end; transform: translateX(-100%); padding-right: 8px; border-right: 2px dashed currentColor; text-align: right; color: color-mix(in srgb, var(--t) 80%, var(--ink)); }
.dx-track { position: relative; height: 20px; border-radius: 99px; background: var(--track); overflow: hidden; }
.dx-fill { position: absolute; left: 0; top: 0; height: 100%; border-radius: 99px; background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 70%, #000), var(--brand)); min-width: 6px; transition: width .8s ease; }
.dx-proj { position: absolute; top: 0; height: 100%; background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--brand) 45%, transparent) 0 6px, transparent 6px 12px); }
.dx-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 6px; }
.dx-stats > div { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.dx-stats small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.dx-stats b { display: block; margin-top: 2px; font-size: 24px; font-weight: 700; }
.dx-stats .dx-warn b { color: color-mix(in srgb, var(--warn) 80%, var(--ink)); }

/* Meta da semana */
.dx-week { display: flex; flex-direction: column; gap: 18px; }
.dx-week .dx-head { margin: 0; }
.dx-ringrow { display: flex; align-items: center; gap: 22px; }
.dx-ring { position: relative; width: 136px; height: 136px; border-radius: 50%; flex-shrink: 0; background: conic-gradient(var(--brand) var(--deg), var(--track) 0); }
.dx-ring > div { position: absolute; inset: 13px; border-radius: 50%; background: var(--surface); display: grid; place-content: center; text-align: center; }
.dx-ring b { font-size: 36px; line-height: 1; font-weight: 800; }
.dx-ring small { color: var(--muted); font-size: 11.5px; font-weight: 600; }
.dx-ringtxt { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.dx-days { display: flex; gap: 8px; }
.dx-day { flex: 1; text-align: center; }
.dx-col { height: 72px; display: flex; align-items: flex-end; }
.dx-col i { display: block; width: 100%; border-radius: 5px 5px 2px 2px; background: color-mix(in srgb, var(--brand) 55%, transparent); }
.dx-day.today i { background: var(--brand); }
.dx-day.future i { background: var(--track); }
.dx-day span { display: block; margin-top: 6px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.dx-day.today span { color: var(--ink); font-weight: 800; }

/* Indicadores */
.dx-kpi { padding: 16px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.dx-capt { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.dx-capt h2 { margin: 0; font-size: 16px; font-weight: 800; }
.dx-capt span { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.dx-kl { color: var(--muted); font-size: 12.5px; font-weight: 700; }
.dx-kv { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; min-height: 32px; }
.dx-kv b { font-size: 28px; line-height: 1; font-weight: 700; white-space: nowrap; }
.dx-spark { display: flex; align-items: flex-end; gap: 3px; height: 30px; width: 58px; flex-shrink: 0; }
.dx-spark i { flex: 1; min-width: 0; border-radius: 2px; background: color-mix(in srgb, var(--brand) 38%, transparent); }
.dx-spark i.on { background: var(--brand); }
.dx-delta { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: color-mix(in srgb, var(--t, var(--muted)) 78%, var(--ink)); flex-wrap: wrap; }
.dx-delta span { color: var(--muted); font-weight: 600; }

/* Gráfico */
.dx-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.dx-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dx-legend i { display: inline-block; }
.dx-legend .bar { width: 10px; height: 10px; border-radius: 3px; background: color-mix(in srgb, var(--brand) 55%, transparent); }
.dx-legend .line { width: 16px; height: 3px; border-radius: 2px; background: var(--brand); }
.dx-legend .dash { width: 16px; border-top: 2px dashed var(--muted); }
.dx-chart { margin-top: 20px; padding: 0 54px 0 48px; }
.dx-plot { position: relative; height: 250px; }
.dx-grid-line { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.dx-grid-line span { position: absolute; top: -8px; font-size: 11px; font-weight: 600; color: var(--muted); }
.dx-grid-line .l { left: -48px; width: 40px; text-align: right; }
.dx-grid-line .r { right: -54px; width: 48px; }
.dx-bars { position: absolute; inset: 0; display: flex; align-items: flex-end; }
.dx-bars > div { flex: 1; height: 100%; display: flex; justify-content: center; align-items: flex-end; }
.dx-bars i { display: block; width: 62%; border-radius: 4px 4px 0 0; background: color-mix(in srgb, var(--brand) 45%, transparent); }
.dx-bars i.today { background: var(--brand); }
.dx-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.dx-plot polyline { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.dx-plot .goal { stroke: var(--muted); stroke-width: 1.6; stroke-dasharray: 5 4; }
.dx-plot .proj { stroke: var(--brand); stroke-width: 2; stroke-dasharray: 2 4; }
.dx-plot .cum { stroke: var(--brand); stroke-width: 2.6; }
.dx-dot { position: absolute; width: 12px; height: 12px; margin: 0 0 -6px -6px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px var(--surface); }
.dx-xlabels { display: flex; margin-top: 8px; }
.dx-xlabels span { flex: 1; text-align: center; font-size: 11px; font-weight: 600; color: var(--muted); }

/* Etapas */
.dx-stack { display: flex; gap: 3px; height: 14px; }
.dx-stack i { flex-basis: 0; border-radius: 4px; }
.dx-stage { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); color: var(--ink); }
.dx-stage:hover { color: var(--ink); }
.dx-stage i { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dx-stage span { flex-grow: 1; font-weight: 700; font-size: 13.5px; }
.dx-stage small { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.dx-stage b { min-width: 30px; text-align: right; font-size: 22px; font-weight: 700; }
.dx-note { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: 13px; font-weight: 600; color: var(--muted); }
.dx-note b { color: var(--ink); font-size: 20px; }

/* Ranking */
.dx-seg { display: flex; padding: 3px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); }
.dx-seg button { border: 0; height: 32px; padding: 0 15px; border-radius: 8px; background: transparent; color: var(--muted); font-weight: 700; font-size: 12.5px; cursor: pointer; }
.dx-seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .15); }
.dx-rows { margin-top: 10px; }
.dx-rows[hidden], [data-sub][hidden] { display: none; }
.dx-rank { display: grid; grid-template-columns: 22px 38px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); color: var(--ink); }
.dx-rank:hover { color: var(--ink); }
.dx-rank .pos { font-family: "Fira Sans Condensed", sans-serif; font-weight: 800; font-size: 22px; text-align: center; color: var(--muted); }
.dx-rank .pos.first { color: var(--brand); }
.dx-rank .mid { min-width: 0; }
.dx-rank .top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.dx-rank .top b { font-size: 14px; }
.dx-rank .top small { color: var(--muted); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.dx-bar { display: block; height: 8px; border-radius: 99px; background: var(--track); }
.dx-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 70%, #000), var(--brand)); }
.dx-rank .end { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; min-width: 80px; }
.dx-rank .end > b { font-size: 21px; line-height: 1; font-weight: 700; }
.dx-lv { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px; font-size: 11px; font-weight: 700; color: var(--ink-2); }
.dx-lv i { width: 8px; height: 8px; border-radius: 50%; }

/* Atenção */
.dx-count { min-width: 24px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.dx-att { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-top: 1px solid var(--line); color: var(--ink); }
.dx-att:hover { color: var(--ink); }
.dx-att .l { min-width: 0; flex-grow: 1; }
.dx-att .t { display: flex; align-items: center; gap: 8px; }
.dx-att .t small { color: var(--muted); font-size: 12.5px; font-weight: 700; }
.dx-att .t b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dx-att .t em { font-style: normal; padding: 1px 7px; border-radius: 6px; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; }
.dx-att .s { display: block; margin-top: 3px; color: var(--muted); font-size: 12.5px; }
.dx-att .r { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; }
.dx-due { padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 800; white-space: nowrap; }
.dx-att .st { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 12px; font-weight: 600; }
.dx-att .st i { width: 8px; height: 8px; border-radius: 50%; }

/* Atividade e pódio */
.dx-act { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); color: var(--ink); }
.dx-act:hover { color: var(--ink); }
.dx-act .tx { flex-grow: 1; font-size: 13.5px; color: var(--ink-2); min-width: 0; }
.dx-act .tx b { color: var(--ink); font-weight: 800; }
.dx-act time { color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.dx-podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; margin-top: 18px; min-height: 250px; }
.dx-podium > div { width: 30%; max-width: 150px; text-align: center; }
.dx-podium .avatar { margin: 0 auto 8px; box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--ring, var(--line)); }
.dx-podium .p1 { --ring: #f2b705; } .dx-podium .p2 { --ring: #b8c0cc; } .dx-podium .p3 { --ring: #d99a6c; }
.dx-podium b { display: block; font-weight: 800; font-size: 13.5px; }
.dx-podium small { display: block; color: var(--muted); font-size: 12px; font-weight: 700; margin: 1px 0 8px; }
.dx-podium .blk { border-radius: 12px 12px 0 0; background: linear-gradient(180deg, var(--brand), color-mix(in srgb, var(--brand) 55%, #000)); display: grid; place-items: start center; padding-top: 10px; }
.dx-podium .p1 .blk { height: 150px; } .dx-podium .p2 .blk { height: 112px; } .dx-podium .p3 .blk { height: 84px; }
.dx-podium .blk span { font-weight: 800; font-size: 44px; line-height: 1; color: #fff; }

@media (max-width: 1199.98px) {
  .dx-g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 991.98px) {
  .dx-g2, .dx-g2.alt { grid-template-columns: minmax(0, 1fr); }
  .dx-g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dx-g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dx-g5 > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 767.98px) {
  .dx { gap: 16px; }
  .dx-card { padding: 18px 16px; border-radius: 16px; }
  .dx-num { font-size: 56px; }
  .dx-pct { font-size: 30px; }
  .dx-of { font-size: 14px; }
  .dx-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dx-stats b { font-size: 22px; }
  .dx-today { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; min-height: 104px; }
  .dx-today .dx-go { display: none; }
  .dx-today-txt b { font-size: 30px; }
  .dx-ic { width: 38px; height: 38px; font-size: 18px; }
  .dx-ring { width: 112px; height: 112px; }
  .dx-ring > div { inset: 11px; }
  .dx-ring b { font-size: 30px; }
  .dx-ringrow { gap: 16px; }
  .dx-kpi { padding: 14px; }
  .dx-kv { flex-wrap: wrap; gap: 6px; }
  .dx-kv b { font-size: 22px; }
  .dx-spark { width: 36px; height: 22px; }
  .dx-chart { padding: 0 4px 0 34px; margin-top: 14px; }
  .dx-plot { height: 180px; }
  .dx-grid-line .l { left: -34px; width: 28px; font-size: 10px; }
  .dx-grid-line .r { display: none; }
  .dx-xlabels span { font-size: 10px; }
  .dx-rank { grid-template-columns: 20px 36px minmax(0, 1fr) auto; gap: 10px; }
  .dx-rank .end { min-width: 64px; }
  .dx-rank .end > b { font-size: 18px; }
  .dx-flag { font-size: 10.5px; }
  .dx-att .t em { display: none; }
}

/* Etiqueta do pedido (pós-venda) */
.order-tag { background: color-mix(in srgb, var(--brand) 14%, transparent); color: color-mix(in srgb, var(--brand) 80%, var(--ink)); font-weight: 600; vertical-align: middle; }

/* Lista de pedidos agrupada por status */
.order-groups { display: flex; flex-direction: column; gap: 10px; }
.og-head { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 6px 2px; color: var(--ink); cursor: pointer; }
.og-caret { font-size: 11px; color: var(--muted); transition: transform .15s ease; }
.og.open .og-caret { transform: rotate(90deg); }
.og-pill { display: inline-flex; align-items: center; gap: 6px; background: var(--c); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; padding: 4px 10px; border-radius: 6px; line-height: 1.3; }
.og-pill i { font-size: 11px; }
.og-count { color: var(--muted); font-size: 13px; font-weight: 600; }
.og-head:hover .og-count { color: var(--ink); }
.og-body { margin-top: 6px; overflow: hidden; }
.og-foot { display: flex; justify-content: center; padding: 0; }
.og-foot:has(.og-more:not([hidden])), .og-foot.busy { padding: 10px; border-top: 1px solid var(--line); }
.og-loading { display: none; color: var(--muted); font-size: 13px; align-items: center; gap: 8px; }
.og-foot.busy .og-loading { display: inline-flex; }

/* Cadastros: ordem de exibição por arrastar */
.cat-handle { cursor: grab; color: var(--muted); font-size: 18px; text-align: center; touch-action: none; user-select: none; }
.cat-handle i { display: inline-flex; padding: 6px; border-radius: 8px; }
.cat-handle:hover i { color: var(--ink); background: var(--surface-2); }
.cat-ghost { opacity: .4; }
.cat-chosen { background: var(--surface-2); }

/* Lista de pedidos: status clicável */
.status-btn { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; }
.status-btn .bi-chevron-down { font-size: 10px; transition: transform .15s ease; }
.status-btn[aria-expanded="true"] .bi-chevron-down { transform: rotate(180deg); }
.status-btn:hover .badge-soft, .status-btn:hover > span:first-child { filter: brightness(1.15); }
.status-menu .dropdown-menu .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.oc { cursor: pointer; }
.row-moved, .row-moved > td { background: color-mix(in srgb, var(--brand) 12%, transparent) !important; transition: background 1.5s ease; }

/* Anexos do pedido: quadrados do mesmo tamanho + botão "+" */
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.att-grid-sm { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.att-tile { position: relative; aspect-ratio: 1; margin: 0; border: 1.5px dashed var(--line); border-radius: 12px; background: var(--surface-2); overflow: hidden; cursor: pointer; transition: border-color .15s, background .15s; }
.att-tile:hover, .att-tile.over { border-color: var(--brand); background: var(--brand-soft); }
.att-tile.filled { border-style: solid; }
.att-view { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); font-size: 12px; text-decoration: none; }
.att-view > .bi { font-size: 24px; }
.att-view img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.att-pdf { font-size: 32px; color: #ef4444; margin-bottom: 14px; }
.att-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 5px; background: linear-gradient(transparent, rgba(0,0,0,.72)); color: #fff; font-size: 11px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.att-remove { position: absolute; top: 5px; right: 5px; z-index: 2; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.62); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; padding: 0; }
.att-remove:hover { background: #ef4444; }
.att-tile form { margin: 0; }
.att-add-cell { display: flex; align-items: center; justify-content: flex-start; aspect-ratio: 1; }
.att-add-cell[hidden] { display: none; }
.att-add { width: 44px; height: 44px; border-radius: 50%; border: 1.5px dashed var(--brand); background: transparent; color: var(--brand); font-size: 20px; display: flex; align-items: center; justify-content: center; transition: background .15s; }
.att-add:hover { background: var(--brand-soft); }
/* Miniatura de PDF: mostra o topo da página */
.thumb-doc { object-position: top; }
.kb-img.doc { background-position: top center; }
.att-view .att-cap { font-weight: 600; color: var(--ink); }
.att-view .att-hint { font-size: 11px; opacity: .8; }
.att-remove[hidden] { display: none; }
.tooltip { pointer-events: none; }
/* Quantidade na lista e no Kanban: nome do produto sem estourar a coluna */
.orders-table .qty-items { display: block; max-width: 170px; white-space: normal; line-height: 1.25; word-break: break-word; }
.kb-qty { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Etiqueta do pedido + botão "+" */
.order-tags { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; vertical-align: middle; margin-left: 2px; }
.order-tags .order-tag { font-size: .68rem; padding: 2px 7px; }
.tag-add { border: 1px dashed color-mix(in srgb, var(--ink) 30%, transparent); background: transparent; color: var(--muted, #6b7280); border-radius: 999px; font-size: .68rem; line-height: 1; padding: 3px 7px; cursor: pointer; }
.tag-add:hover { border-color: var(--brand); color: var(--brand); }
.tag-pop { position: absolute; z-index: 2000; width: 270px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.2); padding: 10px; }
.tag-pop-list { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.tag-x { border: 0; background: transparent; color: inherit; font-size: 1rem; line-height: 1; padding: 0 0 0 2px; cursor: pointer; opacity: .7; }
.tag-x:hover { opacity: 1; }

/* Carteira de clientes */
.wl-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.wl-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: var(--ink); transition: transform .15s, border-color .15s; }
.wl-card:hover { color: var(--ink); border-color: var(--brand); transform: translateY(-1px); }
.wl-key { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }
.wl-bars { display: flex; align-items: flex-end; gap: 8px; height: 190px; }
.wl-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; min-width: 0; }
.wl-pair { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.wl-pair i { width: 40%; max-width: 14px; min-height: 2px; border-radius: 4px 4px 0 0; transition: height .3s; }
.wl-col span { font-size: 11px; color: var(--muted); text-transform: capitalize; }
.wl-rank { display: grid; grid-template-columns: 20px minmax(0, 1fr) 90px 44px; gap: 10px; align-items: center; padding: 7px 0; font-size: 13.5px; }
.wl-rank b { text-align: right; font-variant-numeric: tabular-nums; }
.wl-track { height: 8px; border-radius: 99px; background: var(--track); overflow: hidden; }
.wl-track i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.wl-b { font-size: 10.5px; font-weight: 600; vertical-align: middle; }
.wl-bar { position: sticky; top: 8px; z-index: 20; margin-bottom: 12px; }
.wl-bar-in { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 12px; box-shadow: var(--shadow-lg); }
.wl-bar-in a { color: var(--brand); }
.wl-hist { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); color: var(--ink); }
.wl-preview { background: #dcf8c6; color: #111; border-radius: 12px; padding: 10px; white-space: pre-wrap; word-break: break-word; font-size: 14px; }
.wl-preview img { max-width: 100%; border-radius: 8px; margin-bottom: 8px; display: block; }
@media (max-width: 991.98px) {
  .wl-table tr { position: relative; }
  .wl-table td.ts-title-chk { position: absolute; top: 12px; right: 14px; width: auto; padding: 0 !important; }
  .wl-table td.ts-title { padding-right: 36px !important; }
}
