/* ==========================================================================
   Bestfood — Design System
   Tokens → base → layout (sidebar/topbar) → componentes → páginas → utilitários
   A cor primária é definida por empresa via --bf-primary / --bf-primary-rgb.
   ========================================================================== */

:root {
  --bf-primary: #E8590C;
  --bf-primary-rgb: 232, 89, 12;
  --bf-primary-hover: color-mix(in srgb, var(--bf-primary) 86%, #000);
  --bf-primary-soft: rgba(var(--bf-primary-rgb), .10);
  --bf-primary-ring: rgba(var(--bf-primary-rgb), .28);

  --bf-bg: #F6F7F9;
  --bf-surface: #FFFFFF;
  --bf-surface-2: #F9FAFB;
  --bf-border: #E7E9EE;
  --bf-border-strong: #D5D9E0;
  --bf-text: #12141A;
  --bf-text-2: #4B5263;
  --bf-muted: #7A8194;

  --bf-ink: #0E1015;
  --bf-ink-2: #171A21;
  --bf-ink-text: #A9AFBD;
  --bf-ink-border: rgba(255, 255, 255, .06);

  --bf-success: #12A150;
  --bf-warning: #D98E04;
  --bf-danger: #DC3545;
  --bf-info: #2F6FED;

  --bf-radius-sm: 8px;
  --bf-radius: 12px;
  --bf-radius-lg: 16px;
  --bf-shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --bf-shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --bf-shadow-lg: 0 12px 32px -8px rgba(16, 24, 40, .16), 0 4px 8px -4px rgba(16, 24, 40, .06);

  --bf-sidebar-w: 260px;
  --bf-sidebar-w-collapsed: 76px;
  --bf-topbar-h: 64px;

  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-bg: var(--bf-bg);
  --bs-body-color: var(--bf-text);
  --bs-border-color: var(--bf-border);
  --bs-primary: var(--bf-primary);
  --bs-primary-rgb: var(--bf-primary-rgb);
  --bs-link-color: var(--bf-primary);
  --bs-link-color-rgb: var(--bf-primary-rgb);
  --bs-link-hover-color: var(--bf-primary-hover);
  --bs-focus-ring-color: var(--bf-primary-ring);
  --bs-secondary-color: var(--bf-muted);
}

[data-bs-theme="dark"] {
  --bf-bg: #0B0D11;
  --bf-surface: #12151B;
  --bf-surface-2: #161A21;
  --bf-border: #232833;
  --bf-border-strong: #2E3441;
  --bf-text: #ECEEF2;
  --bf-text-2: #B3B9C6;
  --bf-muted: #828A9B;
  --bf-ink: #090A0D;
  --bf-ink-2: #12151B;
  --bf-primary-soft: rgba(var(--bf-primary-rgb), .16);
  --bf-shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --bf-shadow-lg: 0 16px 40px -10px rgba(0, 0, 0, .6);
  --bs-body-bg: var(--bf-bg);
  --bs-body-color: var(--bf-text);
  --bs-border-color: var(--bf-border);
  --bs-secondary-bg: var(--bf-surface-2);
  --bs-tertiary-bg: var(--bf-surface-2);
}

/* ---------- Base ---------- */
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { font-feature-settings: "cv11", "ss01"; letter-spacing: -0.006em; font-size: .9375rem; background: var(--bf-bg); color: var(--bf-text); }
h1, h2, h3, h4, h5, .h1, .h2, .h3, .h4, .h5 { letter-spacing: -0.02em; font-weight: 700; color: var(--bf-text); }
a { text-decoration: none; }
::selection { background: var(--bf-primary-ring); }
:focus-visible { outline: 2px solid var(--bf-primary); outline-offset: 2px; border-radius: 6px; }
.text-muted, .text-secondary { color: var(--bf-muted) !important; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 2000; background: var(--bf-primary); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { left: 12px; }

/* ---------- Botões ---------- */
.btn { --bs-btn-font-weight: 600; --bs-btn-padding-y: .55rem; --bs-btn-padding-x: 1rem; --bs-btn-font-size: .9rem; border-radius: 10px; letter-spacing: -0.01em; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; transition: all .15s ease; }
.btn-sm { --bs-btn-padding-y: .35rem; --bs-btn-padding-x: .7rem; --bs-btn-font-size: .82rem; border-radius: 8px; }
.btn-lg { --bs-btn-padding-y: .8rem; --bs-btn-font-size: 1rem; border-radius: 12px; }
.btn-primary { --bs-btn-bg: var(--bf-primary); --bs-btn-border-color: var(--bf-primary); --bs-btn-hover-bg: var(--bf-primary-hover); --bs-btn-hover-border-color: var(--bf-primary-hover); --bs-btn-active-bg: var(--bf-primary-hover); --bs-btn-active-border-color: var(--bf-primary-hover); --bs-btn-disabled-bg: var(--bf-primary); --bs-btn-disabled-border-color: var(--bf-primary); box-shadow: 0 1px 2px rgba(16,24,40,.08), inset 0 1px 0 rgba(255,255,255,.12); }
.btn-light, .btn-outline-secondary { --bs-btn-bg: var(--bf-surface); --bs-btn-color: var(--bf-text); --bs-btn-border-color: var(--bf-border-strong); --bs-btn-hover-bg: var(--bf-surface-2); --bs-btn-hover-color: var(--bf-text); --bs-btn-hover-border-color: var(--bf-border-strong); --bs-btn-active-bg: var(--bf-surface-2); --bs-btn-active-color: var(--bf-text); box-shadow: var(--bf-shadow-sm); }
.btn-ghost { background: transparent; border: 0; color: var(--bf-text-2); }
.btn-ghost:hover { background: var(--bf-surface-2); color: var(--bf-text); }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: 10px; }
.btn-soft-danger { background: rgba(220,53,69,.08); color: var(--bf-danger); border: 0; }
.btn-soft-danger:hover { background: rgba(220,53,69,.14); color: var(--bf-danger); }
.btn.is-loading { pointer-events: none; opacity: .75; }
.btn.is-loading::before { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: bf-spin .6s linear infinite; }
@keyframes bf-spin { to { transform: rotate(360deg); } }

/* ---------- Formulários ---------- */
.form-label { font-weight: 600; font-size: .84rem; color: var(--bf-text-2); margin-bottom: .4rem; }
.form-control, .form-select { border-radius: 10px; border-color: var(--bf-border-strong); padding: .6rem .85rem; font-size: .92rem; background-color: var(--bf-surface); color: var(--bf-text); box-shadow: var(--bf-shadow-sm); transition: border-color .15s, box-shadow .15s; }
.form-control:focus, .form-select:focus { border-color: var(--bf-primary); box-shadow: 0 0 0 4px var(--bf-primary-ring); background-color: var(--bf-surface); color: var(--bf-text); }
.form-control::placeholder { color: var(--bf-muted); opacity: .8; }
.form-control-lg { padding: .78rem 1rem; font-size: 1rem; border-radius: 12px; }
.form-text { color: var(--bf-muted); font-size: .8rem; }
.form-check-input:checked { background-color: var(--bf-primary); border-color: var(--bf-primary); }
.form-check-input:focus { box-shadow: 0 0 0 4px var(--bf-primary-ring); border-color: var(--bf-primary); }
.form-switch .form-check-input { width: 2.3em; height: 1.25em; }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--bf-muted); pointer-events: none; }
.input-icon > .form-control { padding-left: 2.5rem; }
.input-icon > .toggle-password { position: absolute; right: .4rem; top: 50%; transform: translateY(-50%); }
.invalid-feedback { font-size: .8rem; }

/* ---------- Cards ---------- */
.card { --bs-card-bg: var(--bf-surface); --bs-card-border-color: var(--bf-border); --bs-card-border-radius: var(--bf-radius-lg); --bs-card-inner-border-radius: calc(var(--bf-radius-lg) - 1px); box-shadow: var(--bf-shadow); }
.card-header { background: transparent; border-bottom-color: var(--bf-border); padding: 1rem 1.25rem; }
.card-body { padding: 1.25rem; }
.card-title { font-size: 1rem; font-weight: 700; margin: 0; }
.card-subtitle { font-size: .83rem; color: var(--bf-muted); margin-top: .15rem; }
.card-hover { transition: transform .15s ease, box-shadow .15s ease, border-color .15s; }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--bf-shadow-lg); border-color: var(--bf-border-strong); }

/* KPI */
.kpi { position: relative; overflow: hidden; }
.kpi .kpi-label { font-size: .8rem; font-weight: 600; color: var(--bf-muted); text-transform: uppercase; letter-spacing: .04em; }
.kpi .kpi-value { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; margin-top: .35rem; }
.kpi .kpi-foot { font-size: .8rem; color: var(--bf-muted); margin-top: .35rem; }
.kpi .kpi-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--bf-primary-soft); color: var(--bf-primary); font-size: 1.15rem; }
.meter { height: 6px; border-radius: 99px; background: var(--bf-surface-2); border: 1px solid var(--bf-border); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--bf-primary); border-radius: 99px; transition: width .6s ease; }
.meter.is-warn > span { background: var(--bf-warning); }
.meter.is-full > span { background: var(--bf-danger); }

/* ---------- Badges ---------- */
.badge { font-weight: 600; letter-spacing: 0; padding: .38em .62em; border-radius: 7px; }
.badge-soft { background: var(--bf-surface-2); color: var(--bf-text-2); border: 1px solid var(--bf-border); }
.badge-soft-primary { background: var(--bf-primary-soft); color: var(--bf-primary); }
.badge-soft-success { background: rgba(18,161,80,.1); color: var(--bf-success); }
.badge-soft-warning { background: rgba(217,142,4,.12); color: #B37400; }
.badge-soft-danger { background: rgba(220,53,69,.1); color: var(--bf-danger); }
.badge-soft-info { background: rgba(47,111,237,.1); color: var(--bf-info); }
[data-bs-theme="dark"] .badge-soft-warning { color: #F2B544; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: currentColor; }

/* ---------- Tabelas ---------- */
.table { --bs-table-bg: transparent; --bs-table-color: var(--bf-text); --bs-table-border-color: var(--bf-border); --bs-table-hover-bg: var(--bf-surface-2); margin: 0; font-size: .9rem; }
.table > thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--bf-muted); font-weight: 600; background: var(--bf-surface-2); border-bottom-width: 1px; padding: .7rem 1rem; white-space: nowrap; }
.table > tbody td { padding: .85rem 1rem; vertical-align: middle; }
.table > tbody tr:last-child td { border-bottom: 0; }
.table-card { border-radius: var(--bf-radius-lg); overflow: hidden; }

/* Avatar */
.avatar { width: 36px; height: 36px; border-radius: 10px; display: inline-grid; place-items: center; font-weight: 700; font-size: .8rem; background: var(--bf-primary-soft); color: var(--bf-primary); flex-shrink: 0; }
.avatar-sm { width: 30px; height: 30px; border-radius: 8px; font-size: .72rem; }
.avatar-lg { width: 56px; height: 56px; border-radius: 16px; font-size: 1.1rem; }

/* ---------- Layout: Sidebar ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--bf-sidebar-w); background: var(--bf-ink); color: var(--bf-ink-text); display: flex; flex-direction: column; z-index: 1040; transition: width .2s ease, transform .25s ease; border-right: 1px solid var(--bf-ink-border); }
.sidebar-brand { height: var(--bf-topbar-h); display: flex; align-items: center; gap: .7rem; padding: 0 1.25rem; color: #fff; font-weight: 800; font-size: 1.1rem; letter-spacing: -0.03em; border-bottom: 1px solid var(--bf-ink-border); flex-shrink: 0; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; background: linear-gradient(135deg, var(--bf-primary), color-mix(in srgb, var(--bf-primary) 60%, #FFB347)); color: #fff; box-shadow: 0 6px 16px -4px rgba(var(--bf-primary-rgb), .55); font-size: 1.05rem; }
.sidebar-company { margin: .9rem .9rem .3rem; padding: .65rem .75rem; border-radius: 12px; background: var(--bf-ink-2); border: 1px solid var(--bf-ink-border); display: flex; align-items: center; gap: .65rem; color: #fff; width: calc(100% - 1.8rem); text-align: left; }
.sidebar-company:hover { border-color: rgba(255,255,255,.12); }
.sidebar-company .meta { min-width: 0; flex: 1; }
.sidebar-company .name { font-weight: 600; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-company .role { font-size: .74rem; color: var(--bf-ink-text); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: .5rem .75rem 1rem; scrollbar-width: thin; scrollbar-color: #2a2f3a transparent; }
.nav-section { font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; font-weight: 700; color: #5D6475; padding: 1.1rem .75rem .45rem; white-space: nowrap; }
.nav-link-bf { display: flex; align-items: center; gap: .75rem; padding: .58rem .75rem; border-radius: 10px; color: var(--bf-ink-text); font-weight: 500; font-size: .9rem; position: relative; white-space: nowrap; transition: background .15s, color .15s; }
.nav-link-bf i { font-size: 1.08rem; width: 20px; text-align: center; flex-shrink: 0; }
.nav-link-bf:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-link-bf.active { background: rgba(var(--bf-primary-rgb), .14); color: #fff; }
.nav-link-bf.active i { color: var(--bf-primary); }
.nav-link-bf.active::before { content: ""; position: absolute; left: -.75rem; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--bf-primary); }
.sidebar-footer { padding: .9rem; border-top: 1px solid var(--bf-ink-border); }
.sidebar-plan { padding: .8rem .9rem; border-radius: 12px; background: linear-gradient(135deg, rgba(var(--bf-primary-rgb), .18), rgba(var(--bf-primary-rgb), .04)); border: 1px solid rgba(var(--bf-primary-rgb), .22); color: #fff; font-size: .82rem; }
.sidebar-plan .muted { color: var(--bf-ink-text); font-size: .76rem; }

.main { flex: 1; margin-left: var(--bf-sidebar-w); min-width: 0; display: flex; flex-direction: column; transition: margin-left .2s ease; }

/* Recolhido */
.sidebar-collapsed .sidebar { width: var(--bf-sidebar-w-collapsed); }
.sidebar-collapsed .main { margin-left: var(--bf-sidebar-w-collapsed); }
.sidebar-collapsed .sidebar .hide-collapsed { display: none !important; }
.sidebar-collapsed .nav-link-bf { justify-content: center; padding: .65rem; }
.sidebar-collapsed .nav-section { text-align: center; padding: .9rem 0 .3rem; font-size: 0; }
.sidebar-collapsed .nav-section::after { content: ""; display: block; width: 18px; height: 1px; background: #2a2f3a; margin: 0 auto; }
.sidebar-collapsed .sidebar-company { justify-content: center; padding: .55rem; }
.sidebar-collapsed .sidebar-brand { justify-content: center; padding: 0; }

/* ---------- Topbar ---------- */
.topbar { position: sticky; top: 0; z-index: 1030; height: var(--bf-topbar-h); display: flex; align-items: center; gap: .75rem; padding: 0 1.5rem; background: color-mix(in srgb, var(--bf-bg) 82%, transparent); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--bf-border); }
.search-trigger { display: flex; align-items: center; gap: .6rem; height: 40px; min-width: 300px; padding: 0 .55rem 0 .85rem; border-radius: 11px; background: var(--bf-surface); border: 1px solid var(--bf-border); color: var(--bf-muted); font-size: .88rem; box-shadow: var(--bf-shadow-sm); transition: border-color .15s; }
.search-trigger:hover { border-color: var(--bf-border-strong); color: var(--bf-text-2); }
.kbd { font-family: inherit; font-size: .7rem; font-weight: 600; padding: .15rem .4rem; border-radius: 6px; border: 1px solid var(--bf-border); background: var(--bf-surface-2); color: var(--bf-muted); }
.content { padding: 1.75rem 1.5rem 3rem; max-width: 1440px; width: 100%; margin: 0 auto; }

.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-title { font-size: 1.55rem; font-weight: 800; letter-spacing: -0.03em; margin: 0; }
.page-subtitle { color: var(--bf-muted); margin: .3rem 0 0; font-size: .92rem; }
.breadcrumb-bf { font-size: .8rem; color: var(--bf-muted); margin-bottom: .4rem; display: flex; gap: .4rem; align-items: center; }
.breadcrumb-bf a { color: var(--bf-muted); }
.breadcrumb-bf a:hover { color: var(--bf-text); }

/* Dropdowns */
.dropdown-menu { --bs-dropdown-bg: var(--bf-surface); --bs-dropdown-border-color: var(--bf-border); --bs-dropdown-link-hover-bg: var(--bf-surface-2); --bs-dropdown-link-active-bg: var(--bf-primary-soft); --bs-dropdown-link-active-color: var(--bf-primary); --bs-dropdown-link-color: var(--bf-text); border-radius: 14px; box-shadow: var(--bf-shadow-lg); padding: .4rem; font-size: .9rem; }
.dropdown-item { border-radius: 9px; padding: .5rem .7rem; display: flex; align-items: center; gap: .6rem; }
.dropdown-header { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }

/* Modais */
.modal-content { border-radius: 18px; border: 1px solid var(--bf-border); background: var(--bf-surface); box-shadow: var(--bf-shadow-lg); }
.modal-header { border-bottom-color: var(--bf-border); padding: 1.1rem 1.4rem; }
.modal-body { padding: 1.4rem; }
.modal-footer { border-top-color: var(--bf-border); padding: .9rem 1.4rem; }
.modal-backdrop.show { opacity: .45; backdrop-filter: blur(2px); }

/* Command palette */
.cmdk .modal-dialog { max-width: 620px; margin-top: 10vh; }
.cmdk-input { border: 0; border-bottom: 1px solid var(--bf-border); border-radius: 0; padding: 1.1rem 1.25rem 1.1rem 3rem; font-size: 1.02rem; box-shadow: none !important; background: transparent; }
.cmdk-input:focus { border-color: var(--bf-border); }
.cmdk-search-icon { position: absolute; left: 1.2rem; top: 1.15rem; color: var(--bf-muted); font-size: 1.05rem; }
.cmdk-list { max-height: 380px; overflow-y: auto; padding: .5rem; }
.cmdk-item { display: flex; align-items: center; gap: .8rem; padding: .65rem .8rem; border-radius: 10px; color: var(--bf-text); cursor: pointer; }
.cmdk-item i { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--bf-surface-2); border: 1px solid var(--bf-border); color: var(--bf-text-2); }
.cmdk-item.active, .cmdk-item:hover { background: var(--bf-primary-soft); color: var(--bf-text); }
.cmdk-item.active i { color: var(--bf-primary); border-color: rgba(var(--bf-primary-rgb), .3); }
.cmdk-group { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--bf-muted); padding: .6rem .8rem .3rem; }

/* Toasts */
.toast-stack { position: fixed; top: 1rem; right: 1rem; z-index: 2000; display: flex; flex-direction: column; gap: .6rem; width: min(380px, calc(100vw - 2rem)); }
.bf-toast { display: flex; gap: .75rem; align-items: flex-start; padding: .85rem 1rem; border-radius: 14px; background: var(--bf-surface); border: 1px solid var(--bf-border); box-shadow: var(--bf-shadow-lg); font-size: .9rem; animation: bf-toast-in .25s ease; }
.bf-toast .ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; }
.bf-toast.success .ic { background: rgba(18,161,80,.12); color: var(--bf-success); }
.bf-toast.danger .ic { background: rgba(220,53,69,.12); color: var(--bf-danger); }
.bf-toast.warning .ic { background: rgba(217,142,4,.14); color: var(--bf-warning); }
.bf-toast.info .ic { background: rgba(47,111,237,.12); color: var(--bf-info); }
.bf-toast .close { margin-left: auto; background: none; border: 0; color: var(--bf-muted); padding: 0 .2rem; }
.bf-toast.hide { animation: bf-toast-out .2s ease forwards; }
@keyframes bf-toast-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
@keyframes bf-toast-out { to { opacity: 0; transform: translateX(16px); } }

/* Estados vazios */
.empty-state { text-align: center; padding: 3rem 1.5rem; }
.empty-state .ic { width: 64px; height: 64px; border-radius: 18px; display: inline-grid; place-items: center; font-size: 1.6rem; background: var(--bf-primary-soft); color: var(--bf-primary); margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: .35rem; }
.empty-state p { color: var(--bf-muted); max-width: 420px; margin: 0 auto 1.25rem; font-size: .9rem; }

/* Skeleton */
.skeleton { position: relative; overflow: hidden; background: var(--bf-surface-2); border-radius: 8px; min-height: 12px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); animation: bf-shimmer 1.3s infinite; }
[data-bs-theme="dark"] .skeleton::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.05), transparent); }
@keyframes bf-shimmer { to { transform: translateX(100%); } }

/* Checklist */
.checklist-item { display: flex; gap: .9rem; align-items: center; padding: .85rem 0; border-bottom: 1px dashed var(--bf-border); color: var(--bf-text); }
.checklist-item:last-child { border-bottom: 0; }
.checklist-item .check { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--bf-border-strong); display: grid; place-items: center; flex-shrink: 0; color: transparent; }
.checklist-item.done .check { background: var(--bf-success); border-color: var(--bf-success); color: #fff; }
.checklist-item.done .title { text-decoration: line-through; color: var(--bf-muted); }
.checklist-item .title { font-weight: 600; font-size: .9rem; }
.checklist-item .desc { font-size: .8rem; color: var(--bf-muted); }

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 1rem 1.5rem; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--bf-primary); box-shadow: 0 0 0 4px var(--bf-primary-soft); }
.timeline li::after { content: ""; position: absolute; left: 8.5px; top: 18px; bottom: 0; width: 1px; background: var(--bf-border); }
.timeline li:last-child::after { display: none; }
.timeline .t-title { font-size: .87rem; font-weight: 600; }
.timeline .t-meta { font-size: .78rem; color: var(--bf-muted); }

/* Matriz de permissões */
.perm-group { border: 1px solid var(--bf-border); border-radius: var(--bf-radius); overflow: hidden; }
.perm-group-head { background: var(--bf-surface-2); padding: .7rem 1rem; display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: .86rem; border-bottom: 1px solid var(--bf-border); }
.perm-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .65rem 1rem; border-bottom: 1px solid var(--bf-border); font-size: .88rem; }
.perm-row:last-child { border-bottom: 0; }
.perm-row code { font-size: .74rem; color: var(--bf-muted); background: none; }
.seg { display: inline-flex; background: var(--bf-surface-2); border: 1px solid var(--bf-border); border-radius: 9px; padding: 2px; }
.seg input { display: none; }
.seg label { padding: .25rem .6rem; font-size: .75rem; font-weight: 600; border-radius: 7px; cursor: pointer; color: var(--bf-muted); }
.seg input:checked + label { background: var(--bf-surface); color: var(--bf-text); box-shadow: var(--bf-shadow-sm); }
.seg input.grant:checked + label { color: var(--bf-success); }
.seg input.revoke:checked + label { color: var(--bf-danger); }

/* Paleta de cores */
.swatches { display: flex; gap: .6rem; flex-wrap: wrap; }
.swatch { width: 38px; height: 38px; border-radius: 12px; border: 2px solid transparent; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); position: relative; }
.swatch.active { border-color: var(--bf-text); }
.swatch.active::after { content: "\F26E"; font-family: bootstrap-icons; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 1.1rem; }

/* Tabs */
.nav-tabs-bf { border-bottom: 1px solid var(--bf-border); gap: .25rem; }
.nav-tabs-bf .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--bf-muted); font-weight: 600; font-size: .9rem; padding: .7rem .9rem; margin-bottom: -1px; border-radius: 0; background: none; }
.nav-tabs-bf .nav-link:hover { color: var(--bf-text); }
.nav-tabs-bf .nav-link.active { color: var(--bf-text); border-bottom-color: var(--bf-primary); }

/* Banner de aviso */
.notice { display: flex; gap: .85rem; align-items: center; padding: .85rem 1.1rem; border-radius: 14px; border: 1px solid; font-size: .9rem; }
.notice-warning { background: rgba(217,142,4,.08); border-color: rgba(217,142,4,.28); }
.notice-danger { background: rgba(220,53,69,.07); border-color: rgba(220,53,69,.26); }
.notice-info { background: var(--bf-primary-soft); border-color: rgba(var(--bf-primary-rgb), .25); }

/* Paginação */
.pagination { --bs-pagination-color: var(--bf-text-2); --bs-pagination-bg: var(--bf-surface); --bs-pagination-border-color: var(--bf-border); --bs-pagination-hover-bg: var(--bf-surface-2); --bs-pagination-hover-color: var(--bf-text); --bs-pagination-active-bg: var(--bf-primary); --bs-pagination-active-border-color: var(--bf-primary); --bs-pagination-focus-box-shadow: 0 0 0 4px var(--bf-primary-ring); --bs-pagination-border-radius: 9px; font-size: .86rem; gap: 4px; }
.pagination .page-link { border-radius: 9px !important; }

/* ==========================================================================
   Autenticação
   ========================================================================== */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--bf-surface); }
.auth-aside { position: relative; overflow: hidden; background: #0C0D11; color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; isolation: isolate; }
.auth-aside::before { content: ""; position: absolute; inset: -20%; z-index: -2;
  background:
    radial-gradient(40% 35% at 20% 15%, rgba(var(--bf-primary-rgb), .55), transparent 70%),
    radial-gradient(35% 30% at 85% 30%, rgba(255, 179, 71, .30), transparent 70%),
    radial-gradient(45% 40% at 60% 95%, rgba(var(--bf-primary-rgb), .35), transparent 70%);
  filter: blur(20px); animation: bf-float 18s ease-in-out infinite alternate; }
.auth-aside::after { content: ""; position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%); }
@keyframes bf-float { to { transform: translate3d(3%, -2%, 0) rotate(4deg); } }
.auth-brand { display: flex; align-items: center; gap: .75rem; font-weight: 800; font-size: 1.25rem; letter-spacing: -0.03em; }
.auth-headline { font-size: clamp(2rem, 3.2vw, 2.9rem); font-weight: 800; line-height: 1.08; letter-spacing: -0.04em; max-width: 520px; color: #fff; }
.auth-headline span { background: linear-gradient(90deg, #fff, color-mix(in srgb, var(--bf-primary) 50%, #FFD199)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-lead { color: rgba(255,255,255,.68); font-size: 1.02rem; max-width: 460px; margin-top: 1rem; }
.auth-features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; max-width: 520px; margin-top: 2.2rem; }
.auth-feature { padding: .9rem 1rem; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); backdrop-filter: blur(6px); font-size: .86rem; color: rgba(255,255,255,.85); display: flex; gap: .6rem; align-items: center; }
.auth-feature i { color: color-mix(in srgb, var(--bf-primary) 70%, #FFD199); font-size: 1.1rem; }
.auth-foot { color: rgba(255,255,255,.45); font-size: .8rem; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 2.5rem 1.5rem; background: var(--bf-surface); }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.035em; }
.auth-card .lead-sm { color: var(--bf-muted); font-size: .95rem; margin-bottom: 1.75rem; }
.auth-divider { display: flex; align-items: center; gap: .75rem; color: var(--bf-muted); font-size: .8rem; margin: 1.5rem 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--bf-border); }
.auth-wide .auth-card { max-width: 560px; }
.step-pill { display: inline-flex; align-items: center; gap: .4rem; font-size: .76rem; font-weight: 700; color: var(--bf-primary); background: var(--bf-primary-soft); padding: .3rem .65rem; border-radius: 99px; margin-bottom: 1rem; }

/* Admin (variação de marca) */
.admin-theme .sidebar { background: #0A0B10; }
.admin-badge { font-size: .62rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: .2rem .45rem; border-radius: 6px; background: rgba(255,255,255,.08); color: #fff; }

/* Página de erro */
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 2rem; text-align: center; }
.error-code { font-size: 5.5rem; font-weight: 900; letter-spacing: -0.06em; line-height: 1; background: linear-gradient(135deg, var(--bf-primary), color-mix(in srgb, var(--bf-primary) 50%, #FFB347)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Responsivo ---------- */
.sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); width: var(--bf-sidebar-w) !important; }
  .sidebar-open .sidebar { transform: none; box-shadow: var(--bf-shadow-lg); }
  .sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1035; }
  .main { margin-left: 0 !important; }
  .sidebar-collapsed .sidebar .hide-collapsed { display: revert !important; }
  .search-trigger { min-width: 0; }
  .search-trigger .label, .search-trigger .kbd { display: none; }
  .content { padding: 1.25rem 1rem 2.5rem; }
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
}
@media (max-width: 575.98px) {
  .page-title { font-size: 1.3rem; }
  .topbar { padding: 0 1rem; }
  .table-responsive-stack thead { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Impressão */
@media print {
  .sidebar, .topbar, .toast-stack, .no-print { display: none !important; }
  .main { margin: 0 !important; }
  body { background: #fff; }
}

/* Marca Bestfood (logo) */
.brand-logo { height: 50px; width: auto; display: block; }
.brand-icon { width: 40px; height: 40px; border-radius: 10px; object-fit: contain; display: none; }
.sidebar-collapsed .brand-icon { display: block; }
.sidebar-collapsed .brand-logo { display: none; }
.auth-brand img { width: auto; max-width: 100%; }
.logo-dark-only { display: none; }
[data-bs-theme="dark"] .logo-dark-only { display: inline-block; }
[data-bs-theme="dark"] .logo-light-only { display: none; }
@media (max-width: 991.98px) {
  .sidebar-collapsed .brand-icon { display: none; }
  .sidebar-collapsed .brand-logo { display: block !important; }
}
.admin-badge-soft { background: var(--bf-primary-soft); color: var(--bf-primary); }
.company-logo { object-fit: contain; background: #fff; padding: 2px; }
.logo-preview { width: 96px; height: 96px; border-radius: 16px; border: 1px dashed var(--bf-border); display: grid; place-items: center; background: var(--bf-surface-2); overflow: hidden; }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--bf-surface-2); border: 1px solid var(--bf-border); flex-shrink: 0; display: inline-grid; place-items: center; color: var(--bf-muted); }
.thumb-lg { width: 160px; height: 160px; border-radius: 16px; }
.seg .btn { border: 0; color: var(--bf-muted); --bs-btn-padding-y: .3rem; --bs-btn-font-size: .78rem; }
.seg .btn.active { background: var(--bf-surface); color: var(--bf-text); box-shadow: var(--bf-shadow-sm); }
.text-nowrap-cells td:not(:first-child), .text-nowrap-cells th { white-space: nowrap; }
@media print {
  .sidebar, .topbar, .d-print-none, .toast-stack, .sidebar-backdrop { display: none !important; }
  .main { margin-left: 0 !important; }
  .content { padding: 0 !important; max-width: none; }
  .card { box-shadow: none !important; break-inside: avoid; }
  body { background: #fff !important; }
}
[hidden] { display: none !important; }

/* ---------- Cardápio online (painel) ---------- */
.tpl-card { display: flex; gap: .85rem; padding: .85rem; border: 1px solid var(--bf-border, #e5e7eb); border-radius: .85rem; cursor: pointer; height: 100%; position: relative; transition: border-color .15s, box-shadow .15s; }
.tpl-card input { position: absolute; opacity: 0; pointer-events: none; }
.tpl-card:has(input:checked) { border-color: var(--bf-primary); box-shadow: 0 0 0 3px rgba(var(--bf-primary-rgb), .15); }
.tpl-card:has(input:focus-visible) { outline: 2px solid var(--bf-primary); outline-offset: 2px; }
.tpl-card.is-locked { cursor: not-allowed; opacity: .6; }
.tpl-info { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.tpl-info small { color: var(--bf-muted, #6b7280); line-height: 1.35; }
.tpl-thumb { flex: 0 0 64px; height: 84px; border-radius: .5rem; overflow: hidden; display: flex; flex-direction: column; gap: 4px; padding: 6px; border: 1px solid rgba(0,0,0,.06); }
.tpl-thumb i { display: block; border-radius: 3px; }
.tpl-thumb-minimalista { background: #fff; }
.tpl-thumb-minimalista i { height: 8px; background: #e5e7eb; }
.tpl-thumb-minimalista i:first-child { height: 12px; width: 60%; margin: 0 auto 4px; background: #111; }
.tpl-thumb-fastfood { background: #fff7ed; }
.tpl-thumb-fastfood i:first-child { height: 22px; background: #ea580c; }
.tpl-thumb-fastfood i:not(:first-child) { height: 20px; background: #fdba74; }
.tpl-thumb-gourmet { background: #16130f; }
.tpl-thumb-gourmet i:first-child { height: 30px; background: linear-gradient(#3b2f22, #16130f); }
.tpl-thumb-gourmet i:not(:first-child) { height: 4px; background: #c8a46a; margin-top: 6px; }
.tpl-thumb-sweet { background: #fdf2f8; }
.tpl-thumb-sweet i:first-child { height: 20px; background: #f9a8d4; border-radius: 0 0 50% 50%; }
.tpl-thumb-sweet i:not(:first-child) { height: 16px; width: 16px; border-radius: 50%; background: #c4b5fd; }
.qr-box { width: 200px; max-width: 100%; aspect-ratio: 1; background: #fff; border-radius: .75rem; padding: .25rem; }
.qr-box svg { width: 100%; height: 100%; display: block; }
.qr-print-sheet { display: none; }
@media print {
  body.printing-qr * { visibility: hidden; }
  body.printing-qr .qr-print-sheet, body.printing-qr .qr-print-sheet * { visibility: visible; }
  body.printing-qr .qr-print-sheet { display: flex !important; justify-content: center; position: fixed; inset: 0; padding-top: 2cm; background: #fff; }
  .qr-print-card { border: 2px dashed #999; border-radius: 1rem; padding: 1.2cm 1.5cm; text-align: center; width: 11cm; font-family: system-ui, sans-serif; }
  .qr-print-nome { font-size: 22pt; font-weight: 700; }
  .qr-print-sub { font-size: 12pt; color: #444; margin: .2cm 0 .5cm; }
  .qr-box-print { width: 7cm; margin: 0 auto; }
  .qr-print-url { margin-top: .4cm; font-size: 10pt; color: #333; word-break: break-all; }
}

/* ---------- Precificação (visão geral e estúdio) ---------- */
.pz-tone-danger { background: rgba(220,53,69,.1) !important; color: var(--bf-danger) !important; }
.pz-tone-warning { background: rgba(217,142,4,.12) !important; color: #B37400 !important; }
.pz-tone-muted { background: var(--bf-surface-2) !important; color: var(--bf-muted) !important; }
.pz-bg-danger { background: var(--bf-danger); } .pz-bg-warning { background: var(--bf-warning); } .pz-bg-success { background: var(--bf-success); }

.pz-welcome { background: radial-gradient(120% 120% at 100% 0%, var(--bf-primary-soft) 0%, transparent 55%), var(--bf-surface); }
.pz-steps { list-style: none; counter-reset: pz; padding: 0; margin: 0; display: grid; gap: .9rem; }
.pz-steps li { counter-increment: pz; position: relative; padding: .9rem 1rem .9rem 3.4rem; border: 1px solid var(--bf-border); border-radius: var(--bf-radius); background: var(--bf-surface); }
.pz-steps li::before { content: counter(pz); position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); width: 1.75rem; height: 1.75rem; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .85rem; background: var(--bf-primary-soft); color: var(--bf-primary); }
.pz-steps strong { display: block; font-size: .92rem; }
.pz-steps span { display: block; font-size: .84rem; color: var(--bf-muted); }

.pz-tabs { display: flex; flex-wrap: wrap; gap: .25rem; }
.pz-tab { padding: .35rem .7rem; border-radius: 999px; font-size: .8rem; font-weight: 600; color: var(--bf-text-2); text-decoration: none; border: 1px solid transparent; }
.pz-tab span { display: inline-block; min-width: 1.3rem; padding: 0 .35rem; margin-left: .2rem; border-radius: 999px; background: var(--bf-surface-2); color: var(--bf-muted); font-size: .72rem; text-align: center; }
.pz-tab:hover { background: var(--bf-surface-2); color: var(--bf-text); }
.pz-tab.active { background: var(--bf-primary-soft); color: var(--bf-primary); border-color: rgba(var(--bf-primary-rgb), .2); }
.pz-tab.active span { background: var(--bf-primary); color: #fff; }
.pz-table td { padding-top: .8rem; padding-bottom: .8rem; }
.pz-mbar { position: relative; height: 8px; border-radius: 999px; background: var(--bf-surface-2); border: 1px solid var(--bf-border); overflow: visible; }
.pz-mbar-fill { position: absolute; inset: 0 auto 0 0; border-radius: 999px; }
.pz-mbar-meta { position: absolute; top: -4px; width: 2px; height: 14px; margin-left: -1px; background: var(--bf-text); opacity: .55; border-radius: 1px; }

.pz-insights-list { display: grid; gap: .75rem; }
.pz-insight { display: flex; gap: .85rem; align-items: flex-start; padding: .9rem 1rem; border-radius: var(--bf-radius); border: 1px solid var(--bf-border); background: var(--bf-surface); }
.pz-insight-icon { flex-shrink: 0; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 1.05rem; }
.pz-insight-title { font-weight: 700; font-size: .9rem; line-height: 1.3; }
.pz-insight-text { font-size: .83rem; color: var(--bf-text-2); margin-top: .2rem; line-height: 1.45; }
.pz-insight-link { display: inline-block; margin-top: .45rem; font-size: .8rem; font-weight: 600; text-decoration: none; }
.pz-insight-danger { border-color: rgba(220,53,69,.25); } .pz-insight-danger .pz-insight-icon { background: rgba(220,53,69,.1); color: var(--bf-danger); }
.pz-insight-warning { border-color: rgba(217,142,4,.3); } .pz-insight-warning .pz-insight-icon { background: rgba(217,142,4,.12); color: #B37400; }
.pz-insight-success .pz-insight-icon { background: rgba(18,161,80,.1); color: var(--bf-success); }
.pz-insight-info .pz-insight-icon { background: rgba(47,111,237,.1); color: var(--bf-info); }
.pz-insight-primary { border-color: rgba(var(--bf-primary-rgb), .25); } .pz-insight-primary .pz-insight-icon { background: var(--bf-primary-soft); color: var(--bf-primary); }
.pz-formula { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; padding: .7rem .85rem; border-radius: var(--bf-radius-sm); background: var(--bf-surface-2); border: 1px dashed var(--bf-border-strong); text-align: center; }

/* Parâmetros */
.pz-section { padding-bottom: 1.25rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--bf-border); }
.pz-section-title { font-weight: 700; font-size: .92rem; margin-bottom: .85rem; display: flex; align-items: center; gap: .45rem; }
.pz-section-title i { color: var(--bf-primary); }
.pz-section-title span { font-weight: 500; font-size: .78rem; color: var(--bf-muted); }
.pz-option { display: block; height: 100%; padding: .7rem .85rem; border: 1px solid var(--bf-border); border-radius: var(--bf-radius); cursor: pointer; transition: border-color .15s, background .15s; }
.pz-option strong { display: block; font-size: .86rem; }
.pz-option span { display: block; font-size: .76rem; color: var(--bf-muted); margin-top: .15rem; }
.btn-check:checked + .pz-option { border-color: var(--bf-primary); background: var(--bf-primary-soft); box-shadow: 0 0 0 1px var(--bf-primary) inset; }
.btn-check:focus-visible + .pz-option { box-shadow: 0 0 0 .2rem var(--bf-primary-ring); }

/* Estúdio — receita */
.pz-yield { display: flex; align-items: center; gap: .5rem; padding: .3rem .4rem .3rem .75rem; border: 1px solid var(--bf-border); border-radius: 999px; background: var(--bf-surface-2); font-size: .85rem; font-weight: 600; }
.pz-yield label { color: var(--bf-muted); margin: 0; }
.pz-yield input { width: 74px; text-align: center; font-weight: 700; border-radius: 999px; }
.pz-yield span { color: var(--bf-text-2); padding-right: .35rem; }
.pz-ing-head { grid-template-columns: minmax(0, 1fr) 96px 150px 96px 34px; gap: .5rem; padding: 0 .1rem .4rem; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--bf-muted); }
.pz-ing { padding: .65rem 0; border-top: 1px solid var(--bf-border); }
.pz-ing:first-child { border-top: 0; }
.pz-ing-main { display: grid; grid-template-columns: minmax(0, 1fr) 96px 150px 96px 34px; gap: .5rem; align-items: center; }
.pz-ing-cost { text-align: right; font-weight: 700; font-size: .88rem; font-variant-numeric: tabular-nums; }
.pz-ing-sub { display: flex; align-items: center; gap: .75rem; margin-top: .4rem; min-height: 18px; }
.pz-share { width: 120px; height: 5px; border-radius: 999px; background: var(--bf-surface-2); overflow: hidden; flex-shrink: 0; }
.pz-share span { display: block; height: 100%; width: 0; background: rgba(var(--bf-primary-rgb), .55); border-radius: 999px; transition: width .25s ease; }
.pz-share span.alto { background: var(--bf-primary); }
.pz-ing-meta { font-size: .76rem; color: var(--bf-muted); flex-grow: 1; }
.pz-ing-perda { display: none; align-items: center; gap: .3rem; font-size: .76rem; color: var(--bf-muted); white-space: nowrap; }
.pz-ing-perda input { width: 64px; }
.pz-com-perdas .pz-ing-perda { display: inline-flex; }
.pz-empty { display: flex; align-items: center; gap: .9rem; padding: 1.1rem; border: 1px dashed var(--bf-border-strong); border-radius: var(--bf-radius); color: var(--bf-muted); }
.pz-empty i { font-size: 1.6rem; color: var(--bf-primary); }
.pz-empty strong { display: block; color: var(--bf-text); font-size: .9rem; }
.pz-empty span { display: block; font-size: .82rem; }
@media (max-width: 767.98px) {
  .pz-ing-main { grid-template-columns: 1fr 1fr 34px; }
  .pz-ing-main [data-ing] { grid-column: 1 / -1; }
  .pz-ing-main .pz-ing-cost { grid-column: 1 / 3; text-align: left; }
  .pz-ing-main [data-remove] { grid-row: 3; grid-column: 3; }
}

/* Estúdio — painel de preço */
.pz-sticky { position: sticky; top: calc(var(--bf-topbar-h) + 1rem); }
@media (max-width: 1199.98px) { .pz-sticky { position: static; } }
.pz-hero { border-color: rgba(var(--bf-primary-rgb), .22); background: radial-gradient(140% 90% at 100% 0%, var(--bf-primary-soft) 0%, transparent 60%), var(--bf-surface); box-shadow: var(--bf-shadow-lg); }
.pz-eyebrow { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--bf-muted); }
.pz-price { font-size: 2.75rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; margin: .3rem 0 .25rem; color: var(--bf-text); font-variant-numeric: tabular-nums; }
.pz-slider .form-range { accent-color: var(--bf-primary); }
.pz-slider .form-range::-webkit-slider-thumb { background: var(--bf-primary); }
.pz-slider .form-range::-moz-range-thumb { background: var(--bf-primary); }
.pz-slider-value { font-weight: 800; font-size: 1.05rem; color: var(--bf-primary); font-variant-numeric: tabular-nums; }
.pz-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.pz-chip { text-align: left; padding: .55rem .7rem; border-radius: var(--bf-radius-sm); border: 1px solid var(--bf-border); background: var(--bf-surface); color: var(--bf-text); transition: border-color .15s, background .15s; }
.pz-chip span { display: block; font-size: .72rem; font-weight: 600; color: var(--bf-muted); }
.pz-chip strong { display: block; font-size: .95rem; font-variant-numeric: tabular-nums; }
.pz-chip small { display: block; font-size: .7rem; color: var(--bf-muted); }
.pz-chip:hover { border-color: var(--bf-border-strong); }
.pz-chip.active { border-color: var(--bf-primary); background: var(--bf-primary-soft); }
.pz-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--bf-border); border: 1px solid var(--bf-border); border-radius: var(--bf-radius); overflow: hidden; }
.pz-stat { background: var(--bf-surface); padding: .7rem .8rem; }
.pz-stat .l { display: block; font-size: .72rem; color: var(--bf-muted); font-weight: 600; }
.pz-stat .v { display: block; font-size: 1.02rem; font-weight: 800; margin-top: .15rem; font-variant-numeric: tabular-nums; }
@media (max-width: 575.98px) { .pz-stats { grid-template-columns: repeat(2, 1fr); } .pz-price { font-size: 2.2rem; } }
.pz-split { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--bf-surface-2); gap: 2px; }
.pz-split-empty { flex: 1; }
.pz-seg { display: block; height: 100%; transition: width .3s ease; }
.pz-seg-ing, .pz-legend .pz-seg-ing { background: #F59F00; }
.pz-seg-emb, .pz-legend .pz-seg-emb { background: #A47148; }
.pz-seg-tax, .pz-legend .pz-seg-tax { background: #7C8DB5; }
.pz-seg-fix, .pz-legend .pz-seg-fix { background: #9C6ADE; }
.pz-seg-luc, .pz-legend .pz-seg-luc { background: var(--bf-success); }
.pz-seg-pre, .pz-legend .pz-seg-pre { background: var(--bf-danger); }
.pz-legend { display: flex; flex-wrap: wrap; gap: .35rem 1rem; }
.pz-leg { font-size: .76rem; color: var(--bf-text-2); display: inline-flex; align-items: center; gap: .35rem; }
.pz-leg i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.pz-leg small { color: var(--bf-muted); }
.pz-ing-preview { padding: .65rem .85rem; border-radius: var(--bf-radius-sm); background: var(--bf-primary-soft); font-size: .86rem; min-height: 2.6rem; }
.pz-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
/* Janelas roláveis: corpo encolhe e rola; cabeçalho e rodapé ficam fixos */
.modal-dialog-scrollable form.modal-content { display: flex; flex-direction: column; overflow: hidden; }
.modal-dialog-scrollable form.modal-content > .modal-body { overflow-y: auto; min-height: 0; flex: 1 1 auto; }
