/* =====================================================================
   QUERMESSE PDV — estilos base (mobile first)
   A cor principal vem das configurações (injetada em :root no header).
   ===================================================================== */

:root {
    --primary: #1D4ED8;
    --primary-dark: #1840B1;
    --primary-soft: #E3EAFB;
    --background: #F4F5F7;
    --surface: #FFFFFF;
    --surface-2: #F8F9FB;
    --text: #15181E;
    --text-muted: #5E6573;
    --border: #E2E5EA;
    --border-strong: #CDD2DA;
    --success: #15803D;
    --success-soft: #E5F4EA;
    --danger: #C2271E;
    --danger-soft: #FBE9E8;
    --warning: #A35A00;
    --warning-soft: #FDF1DE;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .06);
    --shadow-lg: 0 12px 32px rgba(16, 24, 40, .16);

    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --tap: 48px;
    --bottom-nav-h: 64px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.45;
    color: var(--text);
    background: var(--background);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 700; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); }
[hidden] { display: none !important; }

:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute; left: 8px; top: 8px; z-index: 100;
    background: var(--surface); padding: 10px 14px; border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg); transform: translateY(-200%); visibility: hidden;
}
.skip-link:focus { transform: none; visibility: visible; }

.icon { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 18px; height: 18px; }
.icon-xl { width: 40px; height: 40px; }

.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-right { text-align: right; }
.show-sm { display: none; }
abbr[title] { text-decoration: none; }
.nowrap { white-space: nowrap; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.stack > * + * { margin-top: 12px; }
.stack-lg > * + * { margin-top: 20px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1 1 auto; min-width: 0; }
.tabular { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------------
   Layout
   --------------------------------------------------------------------- */
.shell { min-width: 0; }

.content {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px 16px calc(var(--bottom-nav-h) + var(--safe-bottom) + 24px);
    outline: none;
}
.layout-bare .content { padding-bottom: calc(24px + var(--safe-bottom)); max-width: 520px; }

.sidebar { display: none; }

.topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px;
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.topbar-brand { flex: none; display: flex; }
.topbar-title { flex: 1 1 auto; min-width: 0; }
.topbar-title h1 { font-size: 1.125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-sub { font-size: .8125rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-admin { flex: none; }

.brand-logo {
    width: 48px; height: 48px; border-radius: 12px; object-fit: contain;
    background: var(--surface); flex: none;
}
.brand-logo--sm { width: 36px; height: 36px; border-radius: 10px; }
.brand-logo--placeholder {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--primary-soft); color: var(--primary);
}

/* Navegação inferior (mobile) */
.bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    height: calc(var(--bottom-nav-h) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: var(--surface);
    border-top: 1px solid var(--border);
}
.bottom-link {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-width: 0; padding: 6px 2px; border: 0; background: none; cursor: pointer;
    color: var(--text-muted); text-decoration: none; font-size: .75rem; font-weight: 600;
}
.bottom-link.is-active { color: var(--primary); }
.bottom-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bottom-link--pdv .bottom-icon {
    display: flex; align-items: center; justify-content: center;
    width: 52px; height: 40px; border-radius: 14px;
    background: var(--primary); color: #fff;
}
.bottom-link--pdv { color: var(--primary); }
.bottom-link--pdv.is-active .bottom-icon { background: var(--primary-dark); }

/* ---------------------------------------------------------------------
   Componentes
   --------------------------------------------------------------------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow);
    min-width: 0;
}
.card-title { font-size: .8125rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 12px; }
.section-title { font-size: 1rem; font-weight: 700; margin: 24px 0 10px; }
.section-title:first-child { margin-top: 0; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: var(--tap); padding: 10px 18px;
    border: 1px solid transparent; border-radius: var(--radius);
    background: var(--surface-2); color: var(--text);
    font-weight: 700; font-size: 1rem; line-height: 1.2; text-decoration: none; text-align: center;
    cursor: pointer; user-select: none; touch-action: manipulation;
    transition: background-color .12s, border-color .12s, transform .06s;
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-outline { background: var(--surface); border-color: var(--border-strong); }
.btn-outline:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn-danger-ghost { background: transparent; color: var(--danger); }
.btn-sm { min-height: 40px; padding: 6px 12px; font-size: .875rem; }
.btn-lg { min-height: 56px; font-size: 1.0625rem; padding: 12px 20px; }
.btn-xl { min-height: 64px; font-size: 1.125rem; }
.btn-block { display: flex; width: 100%; }
.btn-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: var(--tap); height: var(--tap); border: 0; border-radius: var(--radius);
    background: transparent; color: var(--text-muted); cursor: pointer; flex: none;
}
.btn-icon:hover { background: var(--surface-2); color: var(--text); }

.field { display: block; min-width: 0; }
.field + .field { margin-top: 14px; }
.label { display: block; font-size: .875rem; font-weight: 700; margin-bottom: 6px; }
.hint { font-size: .8125rem; color: var(--text-muted); margin-top: 4px; }
.field-error { color: var(--danger); font-size: .875rem; font-weight: 600; min-height: 0; margin-top: 6px; }
.field-error:empty { display: none; }
.input, .select, .textarea {
    display: block; width: 100%; min-height: var(--tap);
    padding: 10px 12px;
    border: 1px solid var(--border-strong); border-radius: var(--radius);
    background: var(--surface); font-size: 16px; /* evita zoom no iOS */
}
.textarea { min-height: 84px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); outline: 2px solid var(--primary-soft); outline-offset: 0; }
.input-lg { min-height: 56px; font-size: 1.25rem; font-weight: 700; }
.input-money { font-variant-numeric: tabular-nums; }
.input-pin { text-align: center; letter-spacing: .4em; font-size: 1.5rem; }
.input-group { display: flex; align-items: stretch; }
.input-group .prefix {
    display: flex; align-items: center; padding: 0 12px;
    border: 1px solid var(--border-strong); border-right: 0;
    border-radius: var(--radius) 0 0 var(--radius);
    background: var(--surface-2); font-weight: 700; color: var(--text-muted);
}
.input-group .input { border-radius: 0 var(--radius) var(--radius) 0; min-width: 0; }
input[type="color"].input { padding: 4px; height: var(--tap); cursor: pointer; }

.switch { display: flex; align-items: center; gap: 12px; min-height: var(--tap); cursor: pointer; font-weight: 600; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track {
    position: relative; width: 48px; height: 28px; border-radius: 999px; flex: none;
    background: var(--border-strong); transition: background-color .15s;
}
.switch-track::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
    background: #fff; box-shadow: var(--shadow); transition: transform .15s;
}
.switch input:checked + .switch-track { background: var(--success); }
.switch input:checked + .switch-track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-track { outline: 3px solid var(--primary); outline-offset: 2px; }

.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: 999px;
    font-size: .75rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
    background: var(--surface-2); color: var(--text-muted); white-space: nowrap;
}
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-primary { background: var(--primary-soft); color: var(--primary-dark); }

/* Chips (filtros / categorias) */
.chips {
    display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px;
    margin: 0 -2px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
    flex: none; min-height: 40px; padding: 8px 16px;
    border: 1px solid var(--border-strong); border-radius: 999px;
    background: var(--surface); font-weight: 700; font-size: .9375rem; cursor: pointer; white-space: nowrap;
    touch-action: manipulation;
}
.chip[aria-pressed="true"], .chip.is-active { background: var(--text); border-color: var(--text); color: #fff; }

/* Segmentado (tipo de operação / abas) */
.segmented {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px;
    padding: 4px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border);
}
.segmented button {
    min-height: 44px; padding: 6px 8px; border: 0; border-radius: 9px; background: transparent;
    font-weight: 700; font-size: .9375rem; color: var(--text-muted); cursor: pointer; line-height: 1.15;
}
.segmented button[aria-pressed="true"], .segmented button[aria-selected="true"] {
    background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(16, 24, 40, .14);
}

/* Opções grandes (pagamento, operador) */
.options { display: grid; gap: 10px; }
.options-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.option {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    min-height: 76px; padding: 10px 6px;
    border: 2px solid var(--border); border-radius: var(--radius);
    background: var(--surface); cursor: pointer; font-weight: 700; text-align: center;
    touch-action: manipulation; min-width: 0;
}
.option .icon { width: 26px; height: 26px; color: var(--text-muted); }
.option[aria-pressed="true"], .option[aria-checked="true"] { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); }
.option[aria-pressed="true"] .icon, .option[aria-checked="true"] .icon { color: var(--primary); }

.grid-2, .grid-3 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }

/* Listas em cards */
.list { display: grid; gap: 10px; }
.list-item {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; min-height: 64px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    min-width: 0;
}
.list-item.is-inactive { opacity: .62; }
.list-item-main { flex: 1 1 auto; min-width: 0; }
.list-item-title { font-weight: 700; overflow-wrap: anywhere; }
.list-item-sub { font-size: .875rem; color: var(--text-muted); }
.list-item-aside { flex: none; text-align: right; }
button.list-item { width: 100%; text-align: left; cursor: pointer; font: inherit; }
button.list-item:hover { border-color: var(--border-strong); }

.empty {
    padding: 32px 16px; text-align: center; color: var(--text-muted);
    border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); background: var(--surface);
}
.empty .icon { width: 36px; height: 36px; margin: 0 auto 8px; display: block; }

.alert {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 12px 14px; border-radius: var(--radius); font-weight: 600;
    background: var(--warning-soft); color: var(--warning);
}
.alert-danger { background: var(--danger-soft); color: var(--danger); }
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-info { background: var(--primary-soft); color: var(--primary-dark); }

/* Indicadores */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 14px; min-width: 0;
}
.stat-label { font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); }
.stat-value { font-size: 1.375rem; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-sub { font-size: .8125rem; color: var(--text-muted); }
.stat--primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.stat--primary .stat-label, .stat--primary .stat-sub { color: rgba(255, 255, 255, .85); }

.kv { display: grid; gap: 0; }
.kv-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.kv-row:last-child { border-bottom: 0; }
.kv-row dt, .kv-row .k { color: var(--text-muted); font-weight: 600; }
.kv-row dt .icon { vertical-align: -3px; margin-right: 4px; }
.kv-row dd, .kv-row .v { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kv-row--total { font-size: 1.125rem; }
.kv-row--total .k { color: var(--text); }

.rank { display: grid; gap: 8px; }
.rank-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.rank-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-bar { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.rank-bar span { display: block; height: 100%; background: var(--primary); border-radius: 99px; }

/* Tabela (desktop) */
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); background: var(--surface-2); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------------------------------------------------------------------
   Modal / bottom sheet
   --------------------------------------------------------------------- */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 18, 25, .5); }
.modal-panel {
    position: relative; width: 100%; max-width: 560px;
    max-height: 92vh; max-height: 92dvh;
    display: flex; flex-direction: column;
    background: var(--surface); border-radius: 20px 20px 0 0;
    box-shadow: var(--shadow-lg);
    animation: sheet-in .18s ease-out;
}
@keyframes sheet-in { from { transform: translateY(24px); } to { transform: none; } }
.modal-header {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 12px 8px 8px 20px; flex: none;
}
.modal-header h2 { font-size: 1.125rem; }
.modal-body { padding: 4px 20px 16px; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; flex: 1 1 auto; min-height: 0; }
.modal-footer {
    flex: none; display: grid; gap: 10px;
    padding: 12px 20px calc(12px + var(--safe-bottom));
    border-top: 1px solid var(--border); background: var(--surface);
}
.modal-footer-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.modal-footer-2 > [hidden] ~ * { grid-column: 1 / -1; }
.row-between > .btn { flex: none; white-space: nowrap; }
body.modal-open { overflow: hidden; }

.menu-list { display: grid; gap: 4px; padding-bottom: calc(16px + var(--safe-bottom)); }
.menu-item {
    display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 8px 12px;
    border: 0; border-radius: var(--radius); background: none; cursor: pointer;
    color: var(--text); text-decoration: none; font-weight: 600; text-align: left; width: 100%;
}
.menu-item:hover { background: var(--surface-2); }
.menu-item .icon { color: var(--text-muted); }

/* Toasts */
.toast-region {
    position: fixed; left: 12px; right: 12px; z-index: 80;
    top: calc(12px + env(safe-area-inset-top, 0px));
    display: grid; gap: 8px; justify-items: center; pointer-events: none;
}
.toast {
    display: flex; align-items: center; gap: 10px; max-width: 480px; width: 100%;
    padding: 12px 16px; border-radius: var(--radius);
    background: var(--text); color: #fff; font-weight: 600;
    box-shadow: var(--shadow-lg); pointer-events: auto;
    animation: toast-in .18s ease-out;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warning { background: #7A4300; }
@keyframes toast-in { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* PIN */
.pin-gate { max-width: 400px; margin: 24px auto; text-align: center; display: grid; gap: 12px; justify-items: center; padding: 28px 20px; }
.pin-gate-icon { width: 72px; height: 72px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--primary-soft); color: var(--primary); }
.pin-form { width: 100%; display: grid; gap: 10px; }

/* ---------------------------------------------------------------------
   Tela inicial / abertura
   --------------------------------------------------------------------- */
.welcome { text-align: center; padding: 16px 0 8px; display: grid; justify-items: center; gap: 6px; }
.welcome .brand-logo { width: 96px; height: 96px; border-radius: 20px; margin-bottom: 8px; }
.welcome-igreja { font-size: 1.125rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
.welcome-evento { font-size: .9375rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .06em; }
.welcome-app { font-size: .8125rem; color: var(--text-muted); font-weight: 600; }

.operator-list { display: grid; gap: 10px; }
.operator {
    display: flex; align-items: center; gap: 12px; width: 100%;
    min-height: 64px; padding: 10px 14px;
    border: 2px solid var(--border); border-radius: var(--radius); background: var(--surface);
    text-align: left; cursor: pointer; font-weight: 700; font-size: 1.0625rem;
}
.operator[aria-checked="true"] { border-color: var(--primary); background: var(--primary-soft); }
.operator-avatar {
    width: 40px; height: 40px; border-radius: 50%; flex: none;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-2); color: var(--text-muted); font-weight: 800;
}
.operator[aria-checked="true"] .operator-avatar { background: var(--primary); color: #fff; }
.operator-name { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }

.sticky-actions {
    position: sticky; bottom: 0; padding: 12px 0 calc(4px + var(--safe-bottom));
    background: linear-gradient(to top, var(--background) 75%, transparent);
}

/* ---------------------------------------------------------------------
   PDV
   --------------------------------------------------------------------- */
.pdv { display: grid; gap: 12px; min-width: 0; }
.pdv-main { min-width: 0; }
.pdv-categories { position: sticky; top: 57px; z-index: 10; background: var(--background); padding: 4px 0 6px; }
.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.product {
    position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 8px;
    min-height: 104px; padding: 14px; min-width: 0;
    border: 2px solid var(--border); border-radius: var(--radius-lg); background: var(--surface);
    text-align: left; cursor: pointer; touch-action: manipulation; user-select: none;
    transition: border-color .12s, transform .06s;
}
.product:active { transform: scale(.97); }
.product.in-cart { border-color: var(--primary); }
.product-name { font-weight: 700; font-size: 1rem; line-height: 1.25; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.product-price { font-weight: 800; font-size: 1.125rem; color: var(--primary-dark); font-variant-numeric: tabular-nums; }
.product-qty {
    position: absolute; bottom: 12px; right: 10px; min-width: 30px; height: 30px; padding: 0 7px;
    border-radius: 999px; background: var(--primary); color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .875rem;
}
.product.bump { animation: bump .18s ease-out; }
@keyframes bump { 50% { transform: scale(.95); } }

.cart-bar {
    position: fixed; left: 12px; right: 12px; z-index: 25;
    bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 10px);
    display: flex; align-items: center; gap: 12px;
    min-height: 64px; padding: 8px 8px 8px 16px;
    border-radius: var(--radius-lg); background: var(--text); color: #fff;
    box-shadow: var(--shadow-lg);
}
.cart-bar-info { flex: 1 1 auto; min-width: 0; line-height: 1.2; }
.cart-bar-count { font-size: .8125rem; opacity: .8; font-weight: 600; }
.cart-bar-total { font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.cart-bar .btn { flex: none; }
.cart-bar.is-empty { background: var(--surface); color: var(--text-muted); border: 1px solid var(--border); box-shadow: var(--shadow); }
.page-pdv .content { padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 96px); }

.cart-panel { display: none; }
.cart-items { display: grid; gap: 0; }
.cart-item {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center;
    padding: 12px 0; border-bottom: 1px solid var(--border);
}
.cart-item:last-child { border-bottom: 0; }
.cart-item-name { font-weight: 700; overflow-wrap: anywhere; }
.cart-item-unit { font-size: .8125rem; color: var(--text-muted); }
.cart-item-sub { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; }
.qty button { width: 44px; height: 44px; border: 0; background: var(--surface); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.qty button:active { background: var(--surface-2); }
.qty output { min-width: 36px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.cart-item-actions { display: flex; align-items: center; gap: 4px; }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 0 4px; border-top: 2px solid var(--text); margin-top: 4px; }
.cart-total-label { font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.cart-total-value { font-size: 1.625rem; font-weight: 800; font-variant-numeric: tabular-nums; }

.checkout-total { text-align: center; padding: 6px 0 14px; }
.checkout-total-label { font-size: .8125rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.checkout-total-value { font-size: 2.25rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.quick-values { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.quick-values .btn { min-height: 44px; padding: 6px; font-size: .9375rem; }
.change-box {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    margin-top: 12px; padding: 14px 16px; border-radius: var(--radius);
    background: var(--success-soft); color: var(--success);
}
.change-box.is-invalid { background: var(--danger-soft); color: var(--danger); }
.change-label { font-weight: 800; text-transform: uppercase; letter-spacing: .04em; font-size: .875rem; }
.change-value { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.summary-items { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-weight: 600; }

.success {
    text-align: center; display: grid; justify-items: center; gap: 8px; padding: 12px 0 4px;
}
.success-icon { width: 76px; height: 76px; border-radius: 50%; background: var(--success-soft); color: var(--success); display: flex; align-items: center; justify-content: center; }
.success-icon .icon { width: 44px; height: 44px; stroke-width: 2.4; }
.success-title { font-size: 1.25rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--success); }
.success-number { font-size: 1rem; font-weight: 700; color: var(--text-muted); }
.success-total { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.success-meta { font-weight: 700; }

/* ---------------------------------------------------------------------
   Vendas
   --------------------------------------------------------------------- */
.filters { display: grid; gap: 10px; margin-bottom: 14px; }
.filters-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.filters-grid .field + .field { margin-top: 0; }
.sale-card { padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-width: 0; }
.sale-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.sale-number { font-weight: 800; font-size: 1.0625rem; }
.sale-meta { font-size: .875rem; color: var(--text-muted); }
.sale-items { margin: 8px 0; padding: 0; list-style: none; font-size: .9375rem; }
.sale-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.sale-total { font-size: 1.125rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.sale-note { font-size: .8125rem; color: var(--text-muted); margin-top: 4px; overflow-wrap: anywhere; }
.sales-table { display: none; }

/* Fechamento */
.diff-box { padding: 16px; border-radius: var(--radius); text-align: center; background: var(--surface-2); }
.diff-box.is-ok { background: var(--success-soft); color: var(--success); }
.diff-box.is-neg { background: var(--danger-soft); color: var(--danger); }
.diff-box.is-pos { background: var(--warning-soft); color: var(--warning); }
.diff-label { font-size: .8125rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.diff-value { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.expected-box { text-align: center; padding: 16px; border-radius: var(--radius); background: var(--primary-soft); color: var(--primary-dark); }

/* Relatórios */
.report-header { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.report-header img { width: 56px; height: 56px; object-fit: contain; border-radius: 10px; flex: none; }
.report-header h1 { font-size: 1.0625rem; text-transform: uppercase; letter-spacing: .02em; }
.report-header p { font-size: .875rem; color: var(--text-muted); }
.report-products { display: grid; gap: 0; }
.rp-row {
    display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, 52px); gap: 6px; align-items: center;
    padding: 10px 0; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums;
}
.rp-row > span:not(:first-child) { text-align: right; font-weight: 700; }
.rp-row > span:first-child { font-weight: 600; overflow-wrap: anywhere; }
.rp-head { font-size: .6875rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); border-bottom: 2px solid var(--border-strong); }
.rp-head > span:not(:first-child) { font-weight: 800; }
.rp-foot { font-weight: 800; border-bottom: 0; }

/* Configurações */
.logo-preview {
    width: 140px; height: 140px; border-radius: var(--radius-lg);
    border: 1px dashed var(--border-strong); background: var(--surface-2);
    display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--text-muted);
}
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.loading { padding: 24px; text-align: center; color: var(--text-muted); }
.btn.is-loading { position: relative; color: transparent !important; }
.btn.is-loading::after {
    content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, .5); border-top-color: #fff; animation: spin .7s linear infinite;
}
.btn-outline.is-loading::after, .btn-ghost.is-loading::after { border-color: var(--border); border-top-color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Cadeado nos itens de menu restritos ao administrador */
.nav-lock { color: var(--text-muted); opacity: .75; margin-left: auto; }
.menu-item .nav-lock { margin-left: auto; }
.bottom-link { position: relative; }
.nav-lock--bottom { position: absolute; top: 4px; right: calc(50% - 22px); width: 13px; height: 13px; margin: 0; }
