/* =====================================================================
   NS Distribuidora · Sistema visual "Balcão" (v3.0)
   Arquivo único de estilos do Portal do Vendedor e do Portal do Cliente.
   Tokens centralizados em :root; tema escuro em [data-theme="dark"].
   ===================================================================== */

:root {
    --font: "Instrument Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

    --bg: #f2f1ed;
    --surface: #ffffff;
    --surface-2: #f8f7f4;
    --sunken: #ebe9e3;
    --line: #e3e0d8;
    --line-strong: #cdc9bd;
    --ink: #16181b;
    --ink-2: #44474d;
    --ink-3: #6e727a;
    --ink-4: #9a9ea5;

    --accent: #0a7a5d;
    --accent-strong: #065c46;
    --accent-ink: #ffffff;
    --accent-soft: #e0f1ea;
    --accent-line: #a9d8c6;

    --promo: #c2410c;
    --promo-soft: #fdece0;
    --warn: #9a6200;
    --warn-soft: #fbf0d5;
    --danger: #c22a2a;
    --danger-soft: #fbe5e3;
    --info: #2d58c9;
    --info-soft: #e6ecfb;

    --rail: #111316;
    --rail-2: #1b1e22;
    --rail-ink: #c4c8ce;
    --rail-ink-strong: #ffffff;

    --overlay: rgba(17, 19, 22, .48);
    --shadow-1: 0 1px 2px rgba(17, 19, 22, .06);
    --shadow-2: 0 8px 24px -8px rgba(17, 19, 22, .18), 0 2px 6px rgba(17, 19, 22, .06);
    --shadow-3: 0 24px 64px -16px rgba(17, 19, 22, .35);

    --r-sm: 4px;
    --r: 7px;
    --r-lg: 12px;

    --rail-w: 76px;
    --top-h: 64px;
    --order-w: 384px;
    --tabbar-h: 62px;

    --ease: cubic-bezier(.2, .8, .2, 1);
    color-scheme: light;
}

[data-theme="dark"] {
    --bg: #0d0f11;
    --surface: #15181b;
    --surface-2: #1a1d21;
    --sunken: #0a0c0d;
    --line: #252a2f;
    --line-strong: #353b42;
    --ink: #eceef0;
    --ink-2: #b6bbc2;
    --ink-3: #868c94;
    --ink-4: #5e646b;

    --accent: #36c59b;
    --accent-strong: #5fd8b3;
    --accent-ink: #03130d;
    --accent-soft: rgba(54, 197, 155, .13);
    --accent-line: rgba(54, 197, 155, .4);

    --promo: #ff8a4c;
    --promo-soft: rgba(255, 138, 76, .13);
    --warn: #f0b443;
    --warn-soft: rgba(240, 180, 67, .13);
    --danger: #ff6b6b;
    --danger-soft: rgba(255, 107, 107, .13);
    --info: #7ea2ff;
    --info-soft: rgba(126, 162, 255, .13);

    --rail: #08090a;
    --rail-2: #15181b;
    --overlay: rgba(0, 0, 0, .62);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-2: 0 10px 28px -8px rgba(0, 0, 0, .6);
    --shadow-3: 0 28px 70px -12px rgba(0, 0, 0, .75);
    color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.45;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}
body.modal-open { overflow: hidden; }
::selection { background: var(--accent); color: var(--accent-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
img { max-width: 100%; }
h1, h2, h3 { margin: 0; letter-spacing: -.015em; }
p { margin: 0; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ns-num, .code-chip, kbd { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.ns-icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Botões ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 40px; padding: 0 16px;
    border: 1px solid var(--line-strong); border-radius: var(--r);
    background: var(--surface); color: var(--ink);
    font-weight: 600; font-size: 14px; white-space: nowrap;
    transition: background-color .15s, border-color .15s, color .15s, transform .1s;
}
.btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--ink-4); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover:not(:disabled) { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.secondary { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.btn.secondary:hover:not(:disabled) { background: var(--ink-2); border-color: var(--ink-2); }
.btn.ghost { background: transparent; border-color: var(--line-strong); }
.btn.danger-soft { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.btn.danger-soft:hover:not(:disabled) { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.small-btn { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn.wide { width: 100%; min-height: 48px; font-size: 15px; }

/* ---------- Campos ---------- */
label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
input:not([type=checkbox]):not([type=radio]), select, textarea {
    width: 100%; min-height: 40px; padding: 8px 12px;
    background: var(--surface); color: var(--ink);
    border: 1px solid var(--line-strong); border-radius: var(--r);
    font-size: 14px; font-weight: 500;
    transition: border-color .15s, box-shadow .15s, background-color .15s;
}
input::placeholder, textarea::placeholder { color: var(--ink-4); font-weight: 400; }
input:hover:not(:focus):not([readonly]), select:hover, textarea:hover { border-color: var(--ink-4); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[readonly] { background: var(--surface-2); color: var(--ink-3); }
input.invalid, .invalid input { border-color: var(--danger) !important; box-shadow: 0 0 0 3px var(--danger-soft) !important; }
textarea { resize: vertical; min-height: 80px; }
select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; flex: none; }
.field-hint { font-size: 12px; font-weight: 400; color: var(--ink-3); }
.form-error {
    margin: 0; padding: 10px 12px; border-radius: var(--r);
    background: var(--danger-soft); color: var(--danger);
    font-size: 13px; font-weight: 600; border-left: 3px solid var(--danger);
}

/* ---------- Toast ---------- */
.toast {
    position: fixed; z-index: 200; left: calc(var(--rail-w) + 24px); bottom: 24px;
    max-width: min(440px, calc(100vw - 32px));
    padding: 13px 16px 13px 18px; border-radius: var(--r);
    background: var(--rail); color: #fff; box-shadow: var(--shadow-3);
    font-size: 14px; font-weight: 500;
    border-left: 4px solid var(--info);
    opacity: 0; transform: translateY(12px); pointer-events: none;
    transition: opacity .2s, transform .25s var(--ease);
}
.toast.show { opacity: 1; transform: none; pointer-events: auto; }
.toast.success { border-left-color: #36c59b; }
.toast.error { border-left-color: #ff6b6b; }
.toast.warning, .toast.warn { border-left-color: #f0b443; }

/* ---------- Badges / chips ---------- */
.code-chip {
    display: inline-flex; align-items: center; padding: 1px 6px; border-radius: var(--r-sm);
    background: var(--sunken); color: var(--ink-2); font-size: 11.5px; font-weight: 500; letter-spacing: .01em;
}
.count-badge, .cv-badge {
    display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
    font-size: 11.5px; font-weight: 700; white-space: nowrap;
    background: var(--sunken); color: var(--ink-2);
}
.cv-badge-green { background: var(--accent-soft); color: var(--accent); }
.cv-badge-red { background: var(--danger-soft); color: var(--danger); }
.cv-badge-gold { background: var(--warn-soft); color: var(--warn); }
.cv-badge-neutral { background: var(--sunken); color: var(--ink-3); }
.cv-promo-tag {
    display: inline-flex; align-items: center; padding: 1px 6px; border-radius: var(--r-sm);
    background: var(--promo); color: #fff; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.cv-promo-tag-sm { font-size: 9.5px; padding: 0 5px; }
.eyebrow, .cv-sheet-eyebrow, .cv-order-eyebrow, .cv-promo-eyebrow, .cv-row-eyebrow, .cv-chip-label {
    display: block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3);
}

/* =====================================================================
   LOGIN
   ===================================================================== */
.cv-auth {
    min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}
.cv-auth-side {
    order: -1; position: relative; overflow: hidden;
    background: var(--rail); color: var(--rail-ink);
    padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
}
.cv-auth-side::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image: linear-gradient(var(--rail-2) 1px, transparent 1px), linear-gradient(90deg, var(--rail-2) 1px, transparent 1px);
    background-size: 44px 44px; mask-image: linear-gradient(160deg, rgba(0,0,0,.9), transparent 70%);
    -webkit-mask-image: linear-gradient(160deg, rgba(0,0,0,.9), transparent 70%);
}
.cv-auth-side > * { position: relative; z-index: 1; }
.ns-auth-brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.ns-auth-brand strong { display: block; font-size: 15px; }
.ns-auth-brand small { display: block; font-size: 12px; color: var(--rail-ink); }
.ns-auth-claim { font-size: clamp(30px, 3.4vw, 46px); line-height: 1.08; font-weight: 600; color: #fff; letter-spacing: -.03em; max-width: 14ch; }
.ns-auth-claim em { font-style: normal; color: #36c59b; }
.ns-auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.ns-auth-points li { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.ns-auth-points li span { font-family: var(--mono); font-size: 11px; color: #36c59b; border: 1px solid #2a2f35; border-radius: var(--r-sm); padding: 2px 6px; }
.cv-auth-card {
    display: flex; flex-direction: column; justify-content: center;
    width: 100%; max-width: 460px; margin: 0 auto; padding: 48px 32px;
    animation: ns-rise .5s var(--ease) both;
}
.cv-auth-brand { display: none; }
.cv-auth-card h1 { font-size: 28px; font-weight: 650; margin-bottom: 8px; }
.cv-auth-sub { color: var(--ink-3); margin-bottom: 32px; font-size: 15px; }
.cv-auth-card form { display: grid; gap: 18px; }
.cv-auth-card form input { min-height: 48px; font-size: 16px; font-family: var(--mono); letter-spacing: .04em; }
.cv-auth-foot { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-3); }
.ns-auth-theme { position: absolute; top: 20px; right: 20px; }
.ns-mark { width: 38px; height: 38px; flex: none; display: block; }
.ns-mark-lg { width: 46px; height: 46px; }

/* =====================================================================
   SHELL: trilho lateral + área principal
   ===================================================================== */
.cv-shell { min-height: 100vh; padding-left: var(--rail-w); }

.ns-rail {
    position: fixed; z-index: 60; inset: 0 auto 0 0; width: var(--rail-w);
    background: var(--rail); color: var(--rail-ink);
    display: flex; flex-direction: column; align-items: stretch; padding: 14px 8px;
    gap: 4px;
}
.ns-rail-logo { display: flex; justify-content: center; padding: 2px 0 14px; margin-bottom: 6px; border-bottom: 1px solid var(--rail-2); }
.ns-rail-group { display: flex; flex-direction: column; gap: 4px; }
.ns-rail-sep { height: 1px; background: var(--rail-2); margin: 8px 6px; }
.ns-rail-spacer { flex: 1; }
.ns-rail-item {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
    width: 100%; padding: 9px 2px 7px; border: 0; border-radius: var(--r);
    background: transparent; color: var(--rail-ink);
    font-size: 10.5px; font-weight: 600; letter-spacing: .01em; text-align: center; line-height: 1.15;
    transition: background-color .15s, color .15s;
}
.ns-rail-item:hover { background: var(--rail-2); color: var(--rail-ink-strong); }
.ns-rail-item.is-current { color: var(--rail-ink-strong); background: var(--rail-2); }
.ns-rail-item.is-current::before { content: ""; position: absolute; left: -8px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: #36c59b; }
.ns-rail-item .ns-icon { width: 22px; height: 22px; }
.ns-rail-item.has-promos::after {
    content: ""; position: absolute; top: 7px; right: calc(50% - 16px); width: 8px; height: 8px; border-radius: 50%;
    background: #ff8a4c; box-shadow: 0 0 0 2px var(--rail); animation: ns-pulse 2s infinite;
}
.ns-rail-user {
    display: grid; place-items: center; width: 36px; height: 36px; margin: 6px auto 2px; border-radius: 50%;
    background: #36c59b; color: #03130d; font-weight: 700; font-size: 14px;
}
.ns-rail-more { display: none; }

.ns-main { min-width: 0; }

/* Barra superior */
.cv-header {
    position: sticky; top: 0; z-index: 40;
    height: var(--top-h); display: flex; align-items: center; gap: 20px;
    padding: 0 24px; background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}
.cv-header-brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: none; }
.cv-header-brand .ns-mark { display: none; }
.cv-header-brand strong { display: block; font-size: 15px; font-weight: 650; }
.cv-header-brand small { display: block; font-size: 11.5px; color: var(--ink-3); font-weight: 500; }
.cv-search {
    position: relative; flex-direction: row; align-items: center; gap: 0;
    font-weight: 500; color: var(--ink-3);
}
.cv-search > span[aria-hidden] {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    font-size: 18px; line-height: 1; color: var(--ink-3); pointer-events: none;
}
.cv-search input { padding-left: 38px !important; }
.cv-header-search { flex: 1; max-width: 680px; }
.cv-header-search input { min-height: 42px; background: var(--surface); border-color: var(--line-strong); font-size: 14.5px; padding-right: 70px !important; }
.cv-search-kbd {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    padding: 2px 6px; font-size: 11px; color: var(--ink-3);
    border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: var(--r-sm); background: var(--surface-2);
}
.cv-header-actions { margin-left: auto; display: flex; align-items: center; gap: 18px; flex: none; }
.cv-header-stat { display: flex; flex-direction: column; align-items: flex-end; padding-right: 18px; border-right: 1px solid var(--line); }
.cv-header-stat-label { font-size: 11px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.cv-header-stat-value { font-family: var(--mono); font-size: 16px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.cv-header-user { display: flex; align-items: center; gap: 10px; }
.cv-header-avatar { display: none; }
.cv-header-user-name { font-weight: 600; font-size: 13.5px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-header-user small { display: block; font-size: 11px; color: var(--ink-3); font-weight: 500; }

/* Faixa de contexto do pedido (documento) */
.cv-toolbar {
    display: flex; align-items: stretch; gap: 0;
    margin: 18px 24px 0; background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1);
    overflow: hidden;
}
.cv-chip {
    position: relative; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 2px;
    min-width: 0; padding: 11px 18px 11px 46px; border: 0; border-right: 1px solid var(--line); border-radius: 0;
    background: transparent; text-align: left; font-weight: 500; color: var(--ink);
    transition: background-color .15s;
}
button.cv-chip:hover, label.cv-chip:hover { background: var(--surface-2); }
.cv-chip > .ns-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.cv-chip strong { font-size: 14.5px; font-weight: 650; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-chip small { font-size: 12px; color: var(--ink-3); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#btn-cliente-chip { flex: 1.6; }
#btn-escolher-tabela { flex: 1; }
.cv-chip.needs-attention { background: var(--warn-soft); }
.cv-chip.needs-attention strong { color: var(--warn); }
.cv-chip.needs-attention::after { content: "Obrigatório"; position: absolute; right: 14px; top: 12px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--warn); }
.cv-chip-toggle { cursor: pointer; flex: none; }
.cv-chip-toggle-row { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.cv-switch { position: relative; display: inline-flex; width: 34px; height: 20px; flex: none; }
.cv-switch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.cv-switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong); transition: background-color .15s; }
.cv-switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-1); transition: transform .2s var(--ease); }
.cv-switch input:checked + i { background: var(--accent); }
.cv-switch input:checked + i::after { transform: translateX(14px); }
.cv-switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.cv-chip-status { flex-direction: row; align-items: center; gap: 14px; background: var(--info-soft); padding-left: 18px; flex: none; }
.cv-chip-status strong { color: var(--info); }
.cv-chip-cancel { border: 1px solid currentColor; background: transparent; color: var(--info); border-radius: var(--r-sm); padding: 4px 10px; font-size: 12px; font-weight: 700; }
.cv-chip-cancel:hover { background: var(--info); color: #fff; border-color: var(--info); }
.cv-toolbar-spacer { flex: 0; }
.cv-toolbar .cv-chip:last-child { border-right: 0; }

/* =====================================================================
   ÁREA DE TRABALHO: catálogo + pedido
   ===================================================================== */
.cv-workspace {
    display: grid; grid-template-columns: minmax(0, 1fr) var(--order-w);
    gap: 20px; padding: 18px 24px 40px; align-items: start;
}
.cv-catalog {
    min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
    box-shadow: var(--shadow-1);
}
.cv-catalog-head {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
    padding: 18px 20px 14px;
}
.cv-catalog-head .eyebrow { color: var(--accent); }
.cv-catalog-head h1 { font-size: 22px; font-weight: 650; margin-top: 2px; }
.cv-catalog-meta { color: var(--ink-3); font-size: 12.5px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.cv-catalog-meta:empty { display: none; }
.cv-catalog-controls { display: flex; align-items: center; gap: 14px; flex: 1; justify-content: flex-end; max-width: 620px; }
.cv-catalog-controls .cv-search { flex: 1; }
.cv-view-toggle { display: inline-flex; padding: 3px; gap: 2px; background: var(--sunken); border-radius: var(--r); }
.cv-view-btn { display: grid; place-items: center; width: 34px; height: 30px; border: 0; border-radius: 5px; background: transparent; color: var(--ink-3); transition: background-color .15s, color .15s; }
.cv-view-btn svg { width: 15px; height: 15px; }
.cv-view-btn[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
#slot-busca-mobile:empty { display: none; }
#slot-busca-mobile { padding: 0 16px 12px; }
#slot-busca-mobile .cv-header-search { max-width: none; }

.cv-catalog-filtros {
    display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px;
    padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface-2);
}
.cv-filtro-select { flex: 1 1 160px; max-width: 240px; gap: 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.cv-filtro-select select { min-height: 34px; font-size: 13px; text-transform: none; letter-spacing: 0; }
.cv-filtro-limpar { min-height: 34px; padding: 0 12px; border: 0; background: transparent; color: var(--danger); font-weight: 700; font-size: 13px; border-radius: var(--r); }
.cv-filtro-limpar:hover { background: var(--danger-soft); }
.cv-filter-toggle { flex-direction: row; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink); cursor: pointer; }

.cv-free-banner {
    display: flex; align-items: flex-start; gap: 12px; margin: 0; padding: 12px 20px;
    border-top: 1px solid var(--line); background: var(--warn-soft); color: var(--ink); font-size: 13px;
}
.cv-free-banner > span[aria-hidden] { display: grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 50%; background: var(--warn); color: #fff; font-weight: 800; font-size: 12px; }
.cv-free-banner strong { color: var(--warn); }

/* Cabeçalho de colunas do catálogo (só na vista lista) */
.ns-cols {
    position: sticky; top: var(--top-h); z-index: 5;
    display: grid; grid-template-columns: 48px minmax(0, 1fr) 96px 168px 44px; gap: 14px; align-items: center;
    padding: 8px 20px; background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3);
}
.ns-cols .r { text-align: right; }
.cv-catalog:has(#lista-produtos.is-grid) .ns-cols,
.cv-catalog:has(#lista-produtos > .cv-state) .ns-cols { display: none; }

/* Linha de produto */
.cv-product-list { display: flex; flex-direction: column; }
.cv-product {
    position: relative;
    display: grid; grid-template-columns: 48px minmax(0, 1fr) 96px 168px 44px; gap: 14px; align-items: center;
    padding: 8px 20px; border-bottom: 1px solid var(--line);
    transition: background-color .12s;
    animation: ns-fade .25s ease both;
}
.cv-product:hover { background: var(--surface-2); }
.cv-product:last-child { border-bottom: 0; }
.cv-product.is-promo { background: linear-gradient(90deg, var(--promo-soft), transparent 42%); }
.cv-product.is-promo::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--promo); }
.cv-product.is-out-of-stock .cv-product-body, .cv-product.is-out-of-stock .cv-product-media, .cv-product.is-out-of-stock .cv-product-price { opacity: .5; }
.cv-product-media {
    position: relative; display: grid; place-items: center; width: 48px; height: 48px; padding: 0; overflow: hidden;
    border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); color: var(--ink-4);
    font-family: var(--mono); font-size: 11px; font-weight: 700;
}
.cv-product-media img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.cv-product-media.has-image { cursor: zoom-in; }
.cv-product-media.has-image:hover { border-color: var(--accent); }
.cv-product-media.is-loading::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 70%, transparent), transparent);
    animation: ns-shimmer 1.2s infinite;
}
.cv-product-body { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 8px; min-width: 0; }
.cv-product-body .code-chip { padding: 0 5px; font-size: 11px; }
/* Validade da mercadoria (só na tela do vendedor). Longe do vencimento mostra só
   a data; dentro da janela de aviso o texto vai do laranja (início do aviso) ao
   vermelho (30 dias ou menos) conforme --venc (0% a 100%, calculado no servidor). */
.cv-validade { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.cv-validade.is-alerta {
    --venc: 0%;
    padding: 1px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
    color: var(--promo); background: var(--promo-soft);
    color: color-mix(in srgb, var(--danger) var(--venc), var(--promo));
    background: color-mix(in srgb, var(--danger-soft) var(--venc), var(--promo-soft));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 30%, transparent);
}
.cv-validade.is-vencido { background: var(--danger); color: var(--surface); box-shadow: none; letter-spacing: .02em; }
.cv-validade-previa { min-height: 28px; display: flex; align-items: center; }
.cv-product-name { order: -1; flex-basis: 100%; font-weight: 600; font-size: 14px; line-height: 1.3; color: var(--ink); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cv-product-sub { font-size: 12px; color: var(--ink-3); }
.cv-product-inorder { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11.5px; font-weight: 700; }
.cv-product-stock { text-align: right; font-variant-numeric: tabular-nums; }
.cv-product-stock small { display: none; }
.cv-product-stock strong { font-family: var(--mono); font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.cv-product-stock.is-out strong { font-family: var(--font); font-size: 12px; font-weight: 700; color: var(--danger); text-transform: uppercase; letter-spacing: .04em; }
.cv-product-price { display: flex; flex-direction: column; align-items: flex-end; text-align: right; font-family: var(--mono); font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--ink); }
.cv-price-old, .cv-old-price { font-size: 12px; font-weight: 400; color: var(--ink-3); text-decoration: line-through; }
.cv-price-promo { color: var(--promo); font-weight: 700; }
.cv-product-add {
    display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
    border: 1.5px solid var(--accent); border-radius: var(--r); background: transparent; color: var(--accent);
    font-size: 20px; font-weight: 500; line-height: 1;
    transition: background-color .15s, color .15s, transform .1s;
}
.cv-product-add:hover:not(:disabled) { background: var(--accent); color: var(--accent-ink); }
.cv-product-add:active:not(:disabled) { transform: scale(.94); }
.cv-product-add:disabled { border-color: var(--line-strong); color: var(--ink-4); opacity: .7; }

/* Preço digitado (TABELA LIVRE / COERÊNCIA DE VENDA) */
.cv-free-price { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-family: var(--font); }
.cv-free-price.is-empty small { font-size: 11.5px; color: var(--ink-3); font-weight: 500; text-align: right; }
.cv-free-price-chip {
    display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px;
    border: 1.5px dashed var(--warn); border-radius: var(--r); background: var(--warn-soft); color: var(--warn);
    font-family: var(--mono); font-weight: 700; font-size: 14px;
}
.cv-free-price-chip.is-set { border-style: solid; border-color: var(--line-strong); background: var(--surface); color: var(--ink); }
.cv-free-price-chip:hover:not(:disabled) { border-color: var(--accent); }
.cv-free-price-x { font-weight: 400; color: var(--ink-3); font-size: 13px; }
.cv-free-price-markup { font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 0 5px; border-radius: 3px; }
.cv-free-price-markup.is-negative { color: var(--danger); background: var(--danger-soft); }
.cv-free-price-field { flex-direction: row; align-items: center; gap: 4px; font-family: var(--mono); color: var(--ink-3); }
.cv-free-price-field input { width: 110px; min-height: 32px; padding: 4px 8px; text-align: right; font-family: var(--mono); font-weight: 600; }
.cv-free-price-ref { border: 0; background: transparent; padding: 0; font-size: 11.5px; color: var(--info); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; text-decoration-color: color-mix(in srgb, var(--info) 40%, transparent); }
.cv-free-price-custo, .cv-promo-ref { font-size: 11.5px; color: var(--ink-3); font-weight: 500; }
.cv-free-price-cliente { border: 0; background: var(--accent-soft); color: var(--accent); border-radius: 3px; padding: 1px 6px; font-size: 11px; font-weight: 700; }

/* Vista em grade */
.cv-product-list.is-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 0; background: var(--surface); border-top: 1px solid var(--line); border-radius: 0 0 var(--r-lg) var(--r-lg); overflow: hidden; }
.cv-product-list.is-grid > .cv-state, .cv-product-list.is-grid > .cv-skeleton { grid-column: 1 / -1; background: var(--surface); }
.is-grid .cv-product {
    grid-template-columns: 1fr auto; grid-template-areas: "media media" "body body" "stock stock" "price add";
    gap: 8px; padding: 14px; border: 0; background: var(--surface); align-content: start;
    box-shadow: inset -1px -1px 0 var(--line);
}
.is-grid .cv-product:hover { background: var(--surface-2); }
.is-grid .cv-product.is-promo { background: var(--surface); box-shadow: inset 0 3px 0 var(--promo), inset -1px -1px 0 var(--line); }
.is-grid .cv-product.is-promo::before { display: none; }
.is-grid .cv-product-media { grid-area: media; width: 100%; height: 132px; }
.is-grid .cv-product-body { grid-area: body; }
.is-grid .cv-product-stock { grid-area: stock; text-align: left; display: flex; gap: 6px; align-items: baseline; }
.is-grid .cv-product-stock small { display: inline; font-size: 11.5px; color: var(--ink-3); }
.is-grid .cv-product-price { grid-area: price; align-items: flex-start; text-align: left; }
.is-grid .cv-free-price { align-items: flex-start; }
.is-grid .cv-product-add { grid-area: add; align-self: end; }

/* Carregamento e estados vazios */
.cv-skeleton { display: grid; gap: 0; }
.cv-skeleton-row { height: 66px; border-bottom: 1px solid var(--line); position: relative; overflow: hidden; background: var(--surface); }
.cv-skeleton-row::before { content: ""; position: absolute; left: 20px; top: 14px; width: 40px; height: 40px; border-radius: var(--r); background: var(--sunken); }
.cv-skeleton-row::after { content: ""; position: absolute; left: 76px; top: 22px; height: 10px; width: 46%; border-radius: 3px; background: var(--sunken); box-shadow: 0 16px 0 -1px var(--sunken); }
.cv-skeleton-row { background-image: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface-2) 90%, transparent), transparent); background-size: 50% 100%; background-repeat: no-repeat; animation: ns-skeleton 1.3s infinite; }
.cv-state {
    display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px;
    padding: 48px 24px; color: var(--ink-3);
}
.cv-state-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 6px; border-radius: 50%; border: 1px dashed var(--line-strong); font-family: var(--mono); font-weight: 700; font-size: 13px; color: var(--ink-3); }
.cv-state-title { font-size: 14.5px; font-weight: 600; color: var(--ink-2); max-width: 46ch; }
.cv-state-desc { font-size: 13px; max-width: 46ch; }
.cv-state.is-error .cv-state-title { color: var(--danger); }
.cv-state.is-error::before { content: "!"; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--danger-soft); color: var(--danger); font-weight: 800; margin-bottom: 4px; }
.cv-catalog-foot { padding: 12px 20px; border-top: 1px solid var(--line); color: var(--ink-4); font-size: 12px; }

/* =====================================================================
   PAINEL DO PEDIDO (ticket)
   ===================================================================== */
.cv-order {
    position: sticky; top: calc(var(--top-h) + 18px);
    max-height: calc(100vh - var(--top-h) - 36px);
    display: flex; flex-direction: column; min-height: 0;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-2);
    overflow: hidden;
}
.cv-order-close { display: none; }
.cv-order-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 16px 18px; background: var(--rail); color: #fff;
}
.cv-order-head .cv-order-eyebrow { color: #36c59b; }
.cv-order-head h2 { font-size: 17px; font-weight: 650; }
.cv-order-head .count-badge { background: var(--rail-2); color: #fff; font-family: var(--mono); font-weight: 600; }
.cv-order-empty {
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px;
    padding: 36px 24px; color: var(--ink-3); font-size: 13px;
}
.cv-order-empty > div { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 8px; border-radius: 50%; background: var(--surface); border: 1.5px dashed var(--line-strong); font-size: 18px; color: var(--ink-3); }
.cv-order-empty strong { color: var(--ink-2); font-size: 14px; background: var(--surface); padding: 0 6px; }
.cv-order-empty span { background: var(--surface); padding: 0 6px; }
.cv-order-list { flex: 1; min-height: 60px; overflow-y: auto; counter-reset: item; overscroll-behavior: contain; }
.cv-order-item {
    counter-increment: item; position: relative;
    padding: 12px 16px 12px 44px; border-bottom: 1px dashed var(--line-strong);
    animation: ns-fade .2s ease both;
}
.cv-order-item::before {
    content: counter(item, decimal-leading-zero); position: absolute; left: 14px; top: 13px;
    font-family: var(--mono); font-size: 11px; color: var(--ink-4); font-weight: 600;
}
.cv-order-item-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.cv-order-item-top > div { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-width: 0; }
.cv-order-item-code { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.cv-order-item-name { flex-basis: 100%; font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.cv-order-item-table { font-size: 10.5px; font-weight: 700; padding: 0 5px; border-radius: 3px; background: var(--info-soft); color: var(--info); }
.cv-order-remove { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink-4); font-size: 18px; line-height: 1; }
.cv-order-remove:hover { background: var(--danger-soft); color: var(--danger); }
.cv-order-item-controls { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.cv-qty { display: inline-flex; align-items: stretch; border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.cv-qty button { width: 32px; border: 0; background: var(--surface-2); color: var(--ink-2); font-size: 16px; font-weight: 600; transition: background-color .12s; }
.cv-qty button:hover { background: var(--sunken); color: var(--ink); }
.cv-qty input { width: 58px !important; min-height: 32px !important; padding: 0 4px !important; border: 0 !important; border-left: 1px solid var(--line) !important; border-right: 1px solid var(--line) !important; border-radius: 0 !important; text-align: center; font-family: var(--mono); font-weight: 600; box-shadow: none !important; }
.cv-order-item-price { display: flex; flex-direction: column; align-items: flex-end; text-align: right; font-variant-numeric: tabular-nums; }
.cv-order-item-price small { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.cv-order-item-price strong { font-family: var(--mono); font-size: 15px; font-weight: 700; }
.cv-order-item-livre .cv-free-price-chip { flex-direction: row; min-height: 0; padding: 4px 8px; }
.cv-order-item-livre .cv-free-price-chip > span { display: flex; flex-direction: column; align-items: flex-end; }
.cv-order-discount { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: 12px; font-weight: 500; color: var(--ink-3); }
.cv-order-discount > div { display: flex; align-items: center; gap: 4px; font-family: var(--mono); }
.cv-order-discount input { width: 96px !important; min-height: 30px !important; padding: 2px 8px !important; text-align: right; font-family: var(--mono); font-size: 13px !important; }
.cv-order-foot { border-top: 1px solid var(--line); background: var(--surface-2); padding: 14px 16px 16px; display: grid; gap: 12px; }
.cv-order-note-toggle {
    display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 10px;
    padding: 9px 12px; border: 1px dashed var(--line-strong); border-radius: var(--r); background: var(--surface);
    font-size: 13px; font-weight: 600; color: var(--ink-2); text-align: left;
}
.cv-order-note-toggle:hover { border-color: var(--accent); color: var(--ink); }
.cv-order-note-toggle small { font-size: 11.5px; color: var(--ink-3); font-weight: 500; }
.cv-order-note-toggle[aria-expanded="true"] { border-style: solid; }
.cv-order-note textarea { margin-top: 8px; min-height: 72px; font-size: 13.5px; }
.cv-order-totals { display: grid; gap: 4px; font-size: 13px; }
.cv-order-totals > div { display: flex; justify-content: space-between; align-items: baseline; color: var(--ink-3); }
.cv-order-totals strong { font-family: var(--mono); font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cv-order-discount-total strong { color: var(--danger); }
.cv-order-grand { margin-top: 6px; padding-top: 10px; border-top: 2px solid var(--ink); }
.cv-order-grand span { color: var(--ink); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
.cv-order-grand strong { font-size: 24px; font-weight: 700; color: var(--ink); letter-spacing: -.02em; }
.cv-order-hint { font-size: 11.5px; color: var(--ink-3); text-align: center; }
.cv-order-backdrop, .cv-order-trigger { display: none; }
.cv-pulse { animation: ns-bump .45s var(--ease); }

/* =====================================================================
   GAVETAS (drawers) e diálogos
   ===================================================================== */
.cv-sheet { position: fixed; inset: 0; z-index: 100; display: flex; justify-content: flex-end; }
.cv-sheet-backdrop { position: absolute; inset: 0; background: var(--overlay); animation: ns-fade .2s ease both; }
.cv-sheet-panel {
    position: relative; z-index: 1; display: flex; flex-direction: column;
    width: min(560px, 100%); height: 100%; background: var(--surface);
    box-shadow: var(--shadow-3); border-left: 1px solid var(--line);
    animation: ns-drawer .32s var(--ease) both; overflow: hidden;
}
.cv-sheet-wide { width: min(1080px, 100%); }
.cv-sheet-head {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 18px 22px; border-bottom: 1px solid var(--line); flex: none;
}
.cv-sheet-head h2 { font-size: 19px; font-weight: 650; margin-top: 2px; }
.cv-sheet-close {
    display: grid; place-items: center; width: 36px; height: 36px; flex: none;
    border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink-2);
    font-size: 20px; line-height: 1; transition: background-color .15s, color .15s;
}
.cv-sheet-close:hover { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.cv-sheet-search { margin: 16px 22px 8px; flex: none; }
.cv-sheet-search input { min-height: 44px; }
.cv-sheet-toolbar { display: flex; justify-content: flex-end; padding: 0 22px 8px; flex: none; }
.cv-sheet-hint { margin: 10px 22px; color: var(--ink-3); font-size: 12.5px; flex: none; }
.cv-sheet-hint:empty { display: none; }
.cv-sheet-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid var(--line); }
#cliente-busca-view { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.cv-sheet-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }

/* Linhas de lista (clientes, pedidos, tabelas, vendedores) */
.cv-row {
    display: flex; align-items: center; gap: 14px; width: 100%;
    padding: 12px 22px; border: 0; border-bottom: 1px solid var(--line); background: transparent;
    text-align: left; color: var(--ink); transition: background-color .12s;
}
.cv-row:hover:not(:disabled) { background: var(--surface-2); }
.cv-row:disabled { opacity: .55; }
.cv-row.is-selected, .cv-row.is-table-selected { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.cv-row.is-table-free .cv-row-main strong::after { content: "modo especial"; margin-left: 8px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--warn); background: var(--warn-soft); padding: 1px 5px; border-radius: 3px; vertical-align: 2px; }
.cv-row-avatar { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: var(--r); background: var(--sunken); color: var(--ink-2); font-weight: 700; font-size: 14px; }
.cv-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cv-row-main strong { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-row-main > span:not(.cv-row-eyebrow) { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-row-eyebrow { font-family: var(--mono); color: var(--accent); letter-spacing: .02em; text-transform: none; font-size: 11.5px; }
.cv-row-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-size: 12.5px; color: var(--ink-3); text-align: right; }
.cv-row-side strong { font-family: var(--mono); font-size: 14.5px; color: var(--ink); font-weight: 700; }
.cv-row-discount { color: var(--danger); font-weight: 600; font-size: 12px; }
.cv-row-arrow { font-size: 12px; font-weight: 700; color: var(--accent); padding: 4px 10px; border: 1px solid var(--accent-line); border-radius: var(--r-sm); }
.cv-row-check { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 13px; }
.cv-row-voltar strong { color: var(--ink-3); font-weight: 600; }
.cv-suggest-list { border: 1px solid var(--line-strong); border-radius: var(--r); max-height: 220px; overflow-y: auto; background: var(--surface); box-shadow: var(--shadow-2); }
.cv-suggest-list .cv-row { padding: 9px 12px; }
/* A lista rolável fica dentro de um bloco próprio: como item direto do grid do
   formulário (rolável e de altura limitada), sua linha era espremida a 0px. */
.cv-combo > .cv-suggest-list { margin-top: 6px; }

/* Formulário de cliente novo */
#form-cliente-novo { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.cv-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 14px; padding: 20px 22px; overflow-y: auto; flex: 1; }
.cv-form-span2 { grid-column: span 2; }
.ns-form-section { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.ns-form-section:first-child { margin-top: 0; }
.ns-form-section::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.ns-req { color: var(--danger); font-weight: 700; }
.cv-form-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); flex: none; }

/* Painel gerencial */
.cv-manager-tools { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 22px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.cv-manager-tools strong { display: block; font-size: 13.5px; }
.cv-manager-tools span { display: block; font-size: 12px; color: var(--ink-3); }
.cv-manager-tabs { display: flex; gap: 4px; padding: 0 22px; border-bottom: 1px solid var(--line); flex: none; }
.cv-manager-tab { position: relative; padding: 12px 6px; margin-right: 14px; border: 0; background: transparent; color: var(--ink-3); font-weight: 600; font-size: 13.5px; }
.cv-manager-tab:hover { color: var(--ink); }
.cv-manager-tab.active { color: var(--ink); }
.cv-manager-tab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); }
.cv-manager-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); }
.cv-manager-pane { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--surface-2); }
.cv-manager-pane-title { padding: 16px 18px 8px; }
.cv-manager-pane-title strong { display: block; font-size: 13.5px; }
.cv-manager-pane-title span { font-size: 12px; color: var(--ink-3); }
.cv-manager-search { margin: 4px 18px 12px; }
.cv-manager-list { flex: 1; overflow-y: auto; border-top: 1px solid var(--line); }
.cv-manager-list .cv-row { padding: 10px 18px; }
.cv-manager-editor { min-width: 0; overflow-y: auto; }
.cv-manager-selected { display: flex; align-items: center; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.cv-manager-selected small { display: block; font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.cv-manager-selected strong { display: block; font-size: 16px; }
.cv-manager-selected span { display: block; font-size: 12.5px; color: var(--ink-3); }
#gerencial-editor > .cv-sheet-hint { margin: 16px 22px 10px !important; }
.cv-table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; padding: 0 22px 16px; }
.cv-table-option { position: relative; flex-direction: row; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--r); cursor: pointer; background: var(--surface); transition: border-color .15s, background-color .15s; }
.cv-table-option:hover { border-color: var(--accent); }
.cv-table-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.cv-table-option span { display: flex; flex-direction: column; }
.cv-table-option strong { color: var(--ink); font-size: 13.5px; }
.cv-table-option small { font-weight: 500; color: var(--ink-3); font-size: 11.5px; }
.cv-table-option b { display: none; }
#gerencial-coerencia-venda + span { font-weight: 600; }
.cv-manager-client-config { display: grid; gap: 16px; padding: 20px 22px; max-width: 620px; }
.cv-manager-client-config small { font-weight: 400; color: var(--ink-3); }
.cv-manager-status span { display: block; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.cv-manager-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cv-manager-link { display: grid; gap: 6px; padding: 14px; border-radius: var(--r); background: var(--accent-soft); border: 1px solid var(--accent-line); }
.cv-manager-link strong { color: var(--accent); }
.cv-manager-link span { font-size: 12.5px; color: var(--ink-2); }
.cv-manager-link > div { display: flex; gap: 8px; }
.cv-manager-link input { font-family: var(--mono); font-size: 12px !important; }
.cv-manager-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); flex: none; font-size: 12.5px; color: var(--ink-3); }

/* Painel de imagens */
.cv-admin-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 360px minmax(0, 1fr); }
.cv-admin-search-pane { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--surface-2); }
.cv-admin-list { flex: 1; overflow-y: auto; border-top: 1px solid var(--line); }
.cv-admin-list .cv-row { padding: 10px 18px; }
.cv-admin-editor { overflow-y: auto; }
#form-admin-imagem { display: grid; gap: 18px; padding: 22px; max-width: 640px; }
.cv-admin-heading { display: grid; gap: 4px; justify-items: start; }
.cv-admin-heading h3 { font-size: 18px; }
.cv-admin-heading small { font-family: var(--mono); color: var(--ink-3); }
.cv-admin-preview { position: relative; display: grid; place-items: center; height: 280px; border: 1px solid var(--line); border-radius: var(--r-lg); background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 20px 20px; overflow: hidden; }
.cv-admin-preview img { max-height: 100%; object-fit: contain; }
.cv-admin-placeholder { display: grid; justify-items: center; gap: 6px; color: var(--ink-4); }
.cv-admin-placeholder span { font-family: var(--mono); font-size: 28px; font-weight: 700; }
.cv-admin-origin { position: absolute; left: 10px; bottom: 10px; padding: 3px 8px; border-radius: var(--r-sm); background: var(--rail); color: #fff; font-size: 11.5px; }
.cv-admin-origin:empty { display: none; }
.cv-admin-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

/* Promoções (admin) */
.cv-promo-body { padding: 0; }
.cv-promo-card { border-bottom: 1px solid var(--line); padding: 20px 22px; display: grid; gap: 14px; }
.cv-promo-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.cv-promo-card-head h3 { font-size: 16px; margin: 2px 0 4px; }
.cv-promo-card-head p { font-size: 12.5px; color: var(--ink-3); max-width: 70ch; }
.cv-promo-card-head p + p { margin-top: 8px; }
.cv-promo-eyebrow b { color: var(--accent); }
.cv-promo-card-acoes { display: flex; align-items: center; gap: 12px; flex: none; }
.cv-promo-label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); margin-bottom: 8px; }
.cv-promo-nota { display: block; font-size: 12px; color: var(--ink-3); font-weight: 400; margin-top: 6px; }
.cv-promo-sugestao { color: var(--info); }
.cv-promo-auto-config, .cv-promo-field { display: block; }
.cv-promo-dias { display: flex; flex-wrap: wrap; gap: 6px; }
.cv-promo-dia { display: flex; flex-direction: column; align-items: center; min-width: 62px; padding: 7px 8px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); color: var(--ink-2); font-weight: 700; font-size: 13px; transition: background-color .12s, border-color .12s, color .12s; }
.cv-promo-dia small { font-size: 10.5px; font-weight: 500; color: var(--ink-3); }
.cv-promo-dia:hover:not(:disabled) { border-color: var(--accent); }
.cv-promo-dia.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.cv-promo-dia.is-on small { color: inherit; opacity: .8; }
.cv-promo-dia.is-today { box-shadow: inset 0 -3px 0 var(--promo); }
.cv-promo-dia:disabled { opacity: .4; }
.cv-promo-semanas { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.cv-promo-manuais { display: grid; gap: 8px; }
.cv-promo-manual { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: grid; gap: 8px; background: var(--surface); }
.cv-promo-manual.is-ativa { border-left: 3px solid var(--accent); }
.cv-promo-manual.is-agendada { border-left: 3px solid var(--info); }
.cv-promo-manual.is-encerrada { opacity: .78; }
.cv-promo-manual-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cv-promo-manual-head > div:first-child { display: flex; align-items: center; gap: 8px; }
.cv-promo-manual-acoes { display: flex; gap: 6px; flex-wrap: wrap; }
.cv-promo-dias-resumo { display: flex; flex-wrap: wrap; gap: 4px; }
.cv-promo-dia-chip { font-size: 11.5px; padding: 1px 7px; border-radius: 3px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.cv-promo-dia-chip.is-past { background: var(--sunken); color: var(--ink-4); text-decoration: line-through; }
.cv-promo-dia-chip.is-today { background: var(--promo); color: #fff; }
.cv-promo-detalhes summary, .cv-promo-encerradas summary, .cv-promo-retirados summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--ink-2); padding: 4px 0; }
.cv-promo-encerradas { margin-top: 8px; }
.cv-promo-encerradas > .cv-promo-manual { margin-top: 8px; }
.cv-promo-items { display: grid; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.cv-promo-items:empty { display: none; }
.cv-promo-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
.cv-promo-item:last-child { border-bottom: 0; }
.cv-promo-item-main { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 3px 8px; }
.cv-promo-item-main strong { font-size: 13.5px; }
.cv-promo-item-main small { flex-basis: 100%; font-size: 12px; color: var(--ink-3); }
.cv-promo-precos { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; font-family: var(--mono); color: var(--ink-2); }
.cv-promo-precos strong, .cv-promo-efeito strong { color: var(--promo); }
.cv-promo-check { flex-direction: row; align-items: center; gap: 8px; cursor: pointer; }
.cv-promo-pos { display: grid; place-items: center; min-width: 24px; height: 24px; border-radius: 50%; background: var(--sunken); font-family: var(--mono); font-size: 11px; color: var(--ink-2); }
.cv-promo-retirados { padding: 0; }
.cv-promo-editor { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.cv-promo-editor .cv-promo-body { padding: 20px 22px; display: grid; gap: 22px; align-content: start; }
.cv-promo-resultados { margin-top: 6px; border: 1px solid var(--line-strong); border-radius: var(--r); max-height: 260px; overflow-y: auto; box-shadow: var(--shadow-2); }
.cv-promo-resultados .cv-row { padding: 9px 14px; }
.cv-promo-selecionados { display: grid; gap: 8px; margin-top: 10px; }
.cv-promo-contagem { font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.cv-promo-sel { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: grid; gap: 8px; background: var(--surface); }
.cv-promo-sel-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.cv-promo-sel-top > div { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cv-promo-sel-top strong { font-size: 13.5px; }
.cv-promo-remover { border: 0; background: transparent; color: var(--danger); font-weight: 700; font-size: 12.5px; padding: 4px 8px; border-radius: var(--r-sm); }
.cv-promo-remover:hover { background: var(--danger-soft); }
.cv-promo-sel-ref { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--ink-3); font-family: var(--mono); }
.cv-promo-sel-preco { flex-direction: row; align-items: center; gap: 10px; }
.cv-promo-sel-preco input { width: 140px; font-family: var(--mono); text-align: right; }
.cv-promo-sel-alerta, .is-alerta { display: block; color: var(--danger); font-size: 12px; font-weight: 700; }
.cv-promo-sel-aviso { color: var(--warn); font-size: 12px; }
.cv-promo-efeito { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; font-family: var(--mono); color: var(--ink-2); padding: 8px 10px; background: var(--surface-2); border-radius: var(--r-sm); }
.cv-promo-efeito-titulo { flex-basis: 100%; font-family: var(--font); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }

/* Histórico de vendas */
.cv-hv-scroll { overflow-x: auto; }
.cv-hv-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.cv-hv-table th { position: sticky; top: 0; background: var(--surface-2); text-align: right; padding: 9px 12px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); border-bottom: 1px solid var(--line); white-space: nowrap; }
.cv-hv-table th:nth-child(-n+3) { text-align: left; }
.cv-hv-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.cv-hv-table tbody tr:hover td { background: var(--surface-2); }
.cv-hv-num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
/* Coluna "Preço real" em destaque (cabeçalho e linhas): fundo na cor de destaque,
   moldura fina nas laterais e valor em negrito. */
.cv-hv-table .cv-hv-real {
    background: var(--accent-soft);
    background: color-mix(in srgb, var(--accent) 11%, var(--surface));
    box-shadow: inset 1px 0 0 var(--accent-line), inset -1px 0 0 var(--accent-line);
}
.cv-hv-table th.cv-hv-real { background: color-mix(in srgb, var(--accent) 17%, var(--surface-2)); color: var(--accent-strong); }
.cv-hv-table td.cv-hv-real { color: var(--accent-strong); font-weight: 700; }
.cv-hv-table tbody tr:hover td.cv-hv-real { background: color-mix(in srgb, var(--accent) 19%, var(--surface)); }
/* Faixas de cor da margem e do custo (mesmas de vendas/movimento.php), pelos tokens do tema. */
.cv-hv-margem { font-weight: 600; }
.cv-hv-margem-vermelho { color: var(--danger); }
.cv-hv-margem-laranja { color: var(--promo); }
.cv-hv-margem-amarelo { color: var(--warn); }
.cv-hv-margem-neutro { color: var(--ink); }
.cv-hv-margem-verde { color: var(--accent); }
.cv-hv-margem-azul { color: var(--info); }
.cv-hv-margem-nd, .cv-hv-mudo { color: var(--ink-3); }
.cv-hv-custo-menor { color: var(--accent); }
.cv-hv-custo-maior { color: var(--danger); }
.cv-hv-nome { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }

/* Imagem ampliada e sucesso: diálogos centrais */
.cv-sheet:has(.cv-sheet-image), .cv-sheet:has(.cv-success) { justify-content: center; align-items: center; padding: 20px; }
.cv-sheet-image, .cv-success { height: auto; max-height: calc(100vh - 40px); border-radius: var(--r-lg); border: 1px solid var(--line); animation: ns-pop .28s var(--ease) both; }
.cv-sheet-image { width: min(760px, 100%); }
.cv-image-stage { display: grid; place-items: center; padding: 20px; background: #fff; min-height: 300px; max-height: 70vh; }
.cv-image-stage img { max-height: calc(70vh - 40px); object-fit: contain; user-select: none; }
.cv-image-source { padding: 10px 22px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); }
.cv-success { align-items: center; text-align: center; gap: 8px; padding: 36px 28px 28px; }
.cv-success-icon { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 10px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 30px; font-weight: 700; animation: ns-pop .5s .1s var(--ease) both; }
.cv-success h2 { font-size: 26px; }
.cv-success h2 span { font-family: var(--mono); color: var(--accent); }
.cv-success p { margin-bottom: 14px; }

/* ---------- Animações ---------- */
@keyframes ns-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ns-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes ns-drawer { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ns-sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ns-pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ns-shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes ns-skeleton { from { background-position: -50% 0; } to { background-position: 150% 0; } }
@keyframes ns-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes ns-bump { 0% { transform: scale(1); } 40% { transform: scale(1.04); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* =====================================================================
   RESPONSIVO
   ===================================================================== */
@media (max-width: 1240px) {
    :root { --order-w: 340px; }
    .cv-header-stat { display: none; }
    .ns-cols, .cv-product { grid-template-columns: 44px minmax(0, 1fr) 80px 150px 40px; gap: 12px; }
    .cv-product-media { width: 44px; height: 44px; }
}

/* Pedido vira gaveta inferior (o JS usa o mesmo ponto: 900px) */
@media (max-width: 900px) {
    .cv-workspace { grid-template-columns: 1fr; padding-bottom: 110px; }
    .cv-order {
        position: fixed; z-index: 90; left: 0; right: 0; bottom: 0; top: auto;
        max-height: 88vh; height: 88vh; border-radius: 16px 16px 0 0; border: 0;
        transform: translateY(105%); transition: transform .32s var(--ease); visibility: hidden;
    }
    .cv-order.is-open { transform: none; visibility: visible; }
    .cv-order-close {
        display: grid; place-items: center; position: absolute; z-index: 2; top: 12px; right: 12px;
        width: 34px; height: 34px; border: 0; border-radius: var(--r); background: var(--rail-2); color: #fff; font-size: 20px;
    }
    .cv-order-head { padding-right: 60px; }
    .cv-order-backdrop { display: block; position: fixed; inset: 0; z-index: 85; background: var(--overlay); opacity: 0; pointer-events: none; transition: opacity .25s; }
    .cv-order-backdrop.show { opacity: 1; pointer-events: auto; }
    .cv-order-trigger {
        display: flex; align-items: center; justify-content: space-between; gap: 14px;
        position: fixed; z-index: 70; left: calc(var(--rail-w) + 12px); right: 12px; bottom: 14px;
        padding: 10px 12px 10px 18px; min-height: 56px; border: 0; border-radius: var(--r-lg);
        background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-3); text-align: left;
        animation: ns-sheet-up .3s var(--ease) both;
    }
    .cv-order-trigger[hidden] { display: none !important; }
    .cv-order-trigger small { display: block; font-size: 11.5px; opacity: .85; font-weight: 600; }
    .cv-order-trigger strong { font-size: 15px; }
    .cv-order-trigger-total { font-family: var(--mono); padding: 8px 12px; border-radius: var(--r); background: rgba(0, 0, 0, .16); }
    .toast { right: 16px; bottom: 82px; max-width: none; }
}

@media (max-width: 1024px) {
    .cv-search-kbd { display: none; }
    .cv-header-search input { padding-right: 12px !important; }
    .cv-toolbar { flex-wrap: wrap; }
    .cv-chip, #btn-cliente-chip, #btn-escolher-tabela { flex: 1 1 45%; border-bottom: 1px solid var(--line); }
    .cv-chip-toggle { flex: 1 1 45%; }
    .cv-manager-layout, .cv-admin-layout { grid-template-columns: 260px minmax(0, 1fr); }
}

/* Celular: trilho vira barra de abas inferior */
@media (max-width: 760px) {
    :root { --top-h: 58px; }
    body { font-size: 14.5px; }
    .cv-shell { padding-left: 0; padding-bottom: var(--tabbar-h); }
    .ns-rail {
        inset: auto 0 0 0; width: auto; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
        flex-direction: row; padding: 4px 6px env(safe-area-inset-bottom); gap: 0;
        border-top: 1px solid var(--rail-2);
    }
    .ns-rail-logo, .ns-rail-sep, .ns-rail-spacer, .ns-rail-user { display: none; }
    .ns-rail-group { flex-direction: row; flex: 1; gap: 0; }
    .ns-rail-group > .ns-rail-item { flex: 1; }
    .ns-rail-item { padding: 8px 2px 6px; font-size: 10.5px; }
    .ns-rail-item.is-current::before { left: 25%; right: 25%; top: -4px; bottom: auto; width: auto; height: 3px; border-radius: 0 0 3px 3px; }
    .ns-rail-more { display: flex; flex: 1; }
    .ns-rail-group-sec {
        position: absolute; right: 8px; bottom: calc(100% + 8px); z-index: 2;
        flex-direction: column; min-width: 210px; padding: 6px; gap: 2px;
        background: var(--rail); border: 1px solid var(--rail-2); border-radius: var(--r-lg); box-shadow: var(--shadow-3);
        opacity: 0; transform: translateY(8px); pointer-events: none; visibility: hidden;
        transition: opacity .18s, transform .2s var(--ease), visibility .2s;
    }
    .ns-rail.is-more-open .ns-rail-group-sec { opacity: 1; transform: none; pointer-events: auto; visibility: visible; }
    .ns-rail-group-sec .ns-rail-item { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 12px 12px; font-size: 14px; text-align: left; }
    .ns-rail-group-sec .ns-rail-item.is-current::before { display: none; }

    .cv-header { padding: 0 14px; gap: 10px; }
    .cv-header-brand .ns-mark { display: block; width: 32px; height: 32px; }
    .cv-header-user { gap: 6px; }
    .cv-header-user-name { max-width: 120px; font-size: 12.5px; }
    .cv-header-user small { display: none; }

    .cv-toolbar { margin: 12px 12px 0; border-radius: var(--r); }
    .cv-chip, #btn-cliente-chip, #btn-escolher-tabela { flex: 1 1 100%; padding: 10px 14px 10px 44px; border-right: 0; }
    .cv-chip-toggle { flex: 1 1 100%; }
    .cv-chip-status { flex: 1 1 100%; justify-content: space-between; }
    .cv-workspace { padding: 12px 12px 120px; gap: 12px; }
    .cv-catalog { border-radius: var(--r); }
    .cv-catalog-head { padding: 14px 16px 12px; align-items: center; flex-wrap: wrap; }
    .cv-catalog-controls { flex-basis: 100%; }
    div.cv-chip:not(.cv-chip-status) { flex: 1 1 45%; border-right: 1px solid var(--line); }
    .cv-catalog-head h1 { font-size: 19px; }
    .cv-catalog-controls { flex-direction: column; align-items: stretch; gap: 10px; max-width: none; }
    .cv-catalog-filtros { padding: 10px 16px; }
    .cv-filtro-select { flex: 1 1 calc(50% - 10px); max-width: none; }
    .cv-free-banner { padding: 10px 16px; }
    .ns-cols { display: none; }
    .cv-product {
        grid-template-columns: 52px minmax(0, 1fr) auto; grid-template-areas: "media body add" "media stock price";
        gap: 4px 12px; padding: 12px 14px; align-items: start;
    }
    .cv-product-media { grid-area: media; width: 52px; height: 52px; }
    .cv-product-body { grid-area: body; }
    .cv-product-stock { grid-area: stock; text-align: left; display: flex; align-items: baseline; gap: 5px; align-self: center; }
    .cv-product-stock small { display: inline; font-size: 11.5px; color: var(--ink-3); }
    .cv-product-price { grid-area: price; align-self: center; }
    .cv-product-add { grid-area: add; width: 44px; height: 44px; justify-self: end; }
    .cv-product-list.is-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .is-grid .cv-product { grid-template-areas: "media media" "body body" "stock stock" "price add"; grid-template-columns: 1fr auto; padding: 12px; }
    .is-grid .cv-product-media { height: 110px; width: 100%; }
    .cv-order-trigger { left: 12px; bottom: calc(var(--tabbar-h) + 10px + env(safe-area-inset-bottom)); }
    .toast { left: 12px; right: 12px; top: calc(var(--top-h) + 8px); bottom: auto; transform: translateY(-12px); }
    .toast.show { transform: none; }
    body.modal-open .toast { top: auto; bottom: 16px; }
    .ns-rail { z-index: 75; }

    /* Gavetas viram folhas inferiores */
    .cv-sheet { align-items: flex-end; }
    .cv-sheet-panel, .cv-sheet-wide { width: 100%; height: 94vh; height: 94dvh; border-left: 0; border-radius: 16px 16px 0 0; animation-name: ns-sheet-up; }
    .cv-sheet-head { padding: 14px 16px; }
    .cv-sheet-head h2 { font-size: 17px; }
    .cv-sheet-search { margin: 12px 16px 6px; }
    .cv-sheet-hint { margin: 8px 16px; }
    .cv-sheet-toolbar { padding: 0 16px 8px; }
    .cv-sheet-toolbar .btn { width: 100%; }
    .cv-row { padding: 12px 16px; }
    .cv-form-grid { grid-template-columns: 1fr; padding: 16px; }
    .cv-form-span2 { grid-column: auto; }
    .cv-form-actions { padding: 12px 16px; }
    .cv-form-actions .btn { flex: 1; }
    .cv-manager-layout, .cv-admin-layout { grid-template-columns: 1fr; }
    .cv-manager-pane, .cv-admin-search-pane { border-right: 0; border-bottom: 1px solid var(--line); max-height: 42vh; }
    .cv-manager-tools { padding: 10px 16px; }
    .cv-manager-tabs { padding: 0 16px; }
    .cv-manager-foot { flex-direction: column; align-items: stretch; padding: 12px 16px; }
    .cv-manager-foot .btn { width: 100%; }
    .cv-table-grid { padding: 0 16px 14px; grid-template-columns: 1fr; }
    .cv-manager-client-config, #form-admin-imagem { padding: 16px; }
    .cv-promo-card { padding: 16px; }
    .cv-promo-card-head { flex-direction: column; }
    .cv-promo-editor .cv-promo-body { padding: 16px; }
    .cv-promo-dia { min-width: calc(25% - 6px); }
    .cv-sheet:has(.cv-sheet-image) .cv-sheet-panel, .cv-sheet:has(.cv-success) .cv-sheet-panel { height: auto; border-radius: var(--r-lg); animation-name: ns-pop; }
    .cv-sheet:has(.cv-sheet-image), .cv-sheet:has(.cv-success) { align-items: center; padding: 14px; }

    /* Login empilhado */
    .cv-auth { grid-template-columns: 1fr; }
    .cv-auth-side { padding: 28px 24px 30px; gap: 18px; }
    .ns-auth-claim { font-size: 28px; }
    .ns-auth-points { display: none; }
    .cv-auth-card { padding: 28px 22px 40px; }
}

@media (max-width: 420px) {
    .cv-header-user-name { display: none; }
    .cv-product-price { font-size: 14px; }
}

@media print {
    .ns-rail, .cv-header, .cv-toolbar, .cv-order-trigger, .toast { display: none !important; }
    .cv-shell { padding: 0; }
}
