/* ═══════════════════════════════════════════════════════════════
   LD Materiais — ERP + Loja Online
   Complete stylesheet
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

img, svg, video {
  display: block;
  max-width: 100%;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: inherit;
  text-decoration: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

ul, ol {
  list-style: none;
}

[hidden] {
  display: none !important;
}

/* ── 2. :root variables ── */
:root {
  --accent: #5DADE2;
  --accent-dk: #2E86C1;
  --accent-bg: rgba(93, 173, 226, 0.12);
  --gray-dark: #2D3436;
  --gray: #636E72;
  --gray-light: #B2BEC3;
  --gray-bg: #F4F6F8;
  --gray-border: #DFE6E9;
  --white: #FFFFFF;
  --success: #16a34a;
  --success-bg: rgba(22, 163, 74, 0.12);
  --danger: #dc2626;
  --danger-bg: rgba(220, 38, 38, 0.1);
  --warning: #d97706;
  --warning-bg: rgba(217, 119, 6, 0.12);
  --info: #0284c7;
  --info-bg: rgba(2, 132, 199, 0.1);
  --primary: #2563eb;
  --primary-bg: rgba(37, 99, 235, 0.1);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --shadow: 0 1px 3px rgba(45, 52, 54, 0.08), 0 4px 12px rgba(45, 52, 54, 0.06);
  --shadow-lg: 0 8px 30px rgba(45, 52, 54, 0.12);
  --sidebar-w: 240px;
  --header-h: 60px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --transition: 0.18s ease;
}

/* ── 3. Body & container ── */
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--gray-dark);
  background: var(--gray-bg);
  min-height: 100vh;
}

body[data-app="online"] {
  background: var(--white);
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.muted {
  color: var(--gray);
  font-size: 0.875rem;
}

.mono {
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 0.8125rem;
}

.empty-text,
.empty-grid,
.error-text {
  color: var(--gray);
  font-size: 0.875rem;
  padding: 16px 0;
  text-align: center;
}

.error-text {
  color: var(--danger);
}

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--accent-bg);
  border: 1px solid rgba(93, 173, 226, 0.3);
  font-size: 0.875rem;
  margin-bottom: 12px;
}

/* ── Logo ── */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--gray-dark);
}

.logo__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), var(--accent-dk));
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════
   4. APP LAYOUT — ERP (sistema.html) — CRITICAL
   ═══════════════════════════════════════════════════════════════ */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.app-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ── */
.sidebar {
  background: var(--gray-dark);
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  z-index: 100;
}

.sidebar__logo {
  padding: 20px 16px 8px;
  color: var(--white);
}

.sidebar__logo .logo__icon {
  background: rgba(255, 255, 255, 0.15);
}

.sidebar__subtitle {
  padding: 0 16px 16px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  text-align: left;
  transition: background var(--transition), color var(--transition);
}

.sidebar__item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
}

.sidebar__item.active {
  background: var(--accent);
  color: var(--white);
}

.sidebar__icon {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar__badge {
  margin-left: auto;
  background: var(--danger);
  color: var(--white);
  font-size: 0.6875rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar__footer {
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar__link-online {
  width: 100%;
  justify-content: center;
  color: rgba(255, 255, 255, 0.7) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

.sidebar__link-online:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--white) !important;
}

/* ── App header ── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--header-h);
  padding: 0 24px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-border);
  flex-shrink: 0;
}

.app-header__start {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.sidebar-toggle-btn {
  display: none;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  color: var(--gray-dark);
}

.sidebar-toggle-btn:hover {
  background: var(--gray-bg);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 250;
}

.sidebar-backdrop.visible {
  display: block;
}

.app-header__title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--gray-bg);
  color: var(--gray);
}

.header-badge--warn {
  background: var(--warning-bg);
  color: var(--warning);
}

.header-badge--orders {
  background: var(--accent-bg);
  color: var(--accent-dk);
  cursor: pointer;
}

.cert-indicator .badge {
  font-size: 0.6875rem;
}

/* Low stock panel — aba Estoque */
.estoque-low-stock-panel[hidden] {
  display: none !important;
}

.low-stock-panel {
  margin-bottom: 20px;
  border-left: 4px solid var(--warning, #d97706);
}

.low-stock-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.low-stock-panel__actions {
  flex-shrink: 0;
}

.low-stock-panel__table {
  max-height: 280px;
  overflow: auto;
}

/* Legacy banner (removido do topo) */
#low-stock-alerts:not(.low-stock-banner--visible) {
  display: none;
}

.low-stock-banner {
  background: var(--warning-bg);
  border-bottom: 1px solid rgba(217, 119, 6, 0.25);
  padding: 10px 24px;
  font-size: 0.8125rem;
}

.low-stock-banner__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  align-items: center;
}

.low-stock-banner__item {
  background: var(--white);
  border: 1px solid rgba(217, 119, 6, 0.3);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background var(--transition);
}

.low-stock-banner__item:hover {
  background: var(--warning-bg);
}

.low-stock-banner--smart .low-stock-banner__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.low-stock-banner__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}

.low-stock-banner__item--repor {
  border-color: rgba(220, 38, 38, 0.35);
}

.low-stock-banner__item--stale {
  border-color: rgba(217, 119, 6, 0.4);
  opacity: 0.9;
}

/* Estoque inteligente */
.stock-intel-summary {
  padding: 0 0 12px;
}

.stock-intel-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}

.stock-intel-card {
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}

.stock-intel-card--repor {
  border-color: rgba(220, 38, 38, 0.35);
  background: rgba(220, 38, 38, 0.04);
}

.stock-intel-card--stale {
  border-color: rgba(217, 119, 6, 0.35);
  background: rgba(217, 119, 6, 0.05);
}

.stock-intel-card__value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.stock-intel-card__label {
  font-size: 0.6875rem;
  color: var(--gray);
  margin-top: 4px;
}

.stock-intel-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.stock-intel-hint {
  margin: 0 0 8px;
}

.sub-tab__count {
  display: inline-flex;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: 9px;
  background: var(--gray-border);
  font-size: 0.625rem;
  font-weight: 700;
  align-items: center;
  justify-content: center;
}

.sub-tab.active .sub-tab__count {
  background: var(--accent);
  color: var(--white);
}

.stock-row--repor td:first-child {
  border-left: 3px solid var(--danger, #dc2626);
}

.stock-row--stale td:first-child {
  border-left: 3px solid var(--warning, #d97706);
}

.stock-intel-qty-suggest strong {
  color: var(--accent);
}

/* ── App content & pages ── */
.app-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.page-intro {
  margin-bottom: 24px;
}

.page-intro h2 {
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.page-intro p {
  color: var(--gray);
  font-size: 0.9375rem;
}

.section-subtitle {
  font-size: 1rem;
  font-weight: 600;
  margin: 28px 0 12px;
  color: var(--gray-dark);
}

/* ═══════════════════════════════════════════════════════════════
   5. BUTTONS
   ═══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  transition: background var(--transition), color var(--transition), border-color var(--transition), opacity var(--transition);
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--accent);
  color: var(--white);
}

.btn--primary:hover:not(:disabled) {
  background: var(--accent-dk);
}

.btn--ghost {
  background: transparent;
  color: var(--gray-dark);
  border: 1px solid var(--gray-border);
}

.btn--ghost:hover:not(:disabled) {
  background: var(--gray-bg);
  border-color: var(--gray-light);
}

.btn--sm {
  padding: 6px 12px;
  font-size: 0.8125rem;
}

.btn--block {
  display: flex;
  width: 100%;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-border);
  background: var(--white);
  font-size: 1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.qty-btn:hover {
  background: var(--gray-bg);
}

/* ═══════════════════════════════════════════════════════════════
   6. FORMS
   ═══════════════════════════════════════════════════════════════ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 0;
  flex: 1;
  min-width: 0;
}

.form-group label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-dark);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="password"],
.form-group input[type="search"],
.form-group select,
.form-group textarea,
.form-inline input,
.form-inline select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 0.875rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.form-inline input:focus,
.form-inline select:focus,
.filter-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

.form-group textarea {
  resize: vertical;
  min-height: 72px;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.form-row:last-child {
  margin-bottom: 0;
}

.form-row--align-end {
  align-items: flex-end;
}

.form-row--product-search {
  align-items: flex-end;
}

.form-group--grow {
  flex: 2;
  min-width: 200px;
}

.form-group--qty {
  flex: 0 0 80px;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--gray);
  margin-top: 2px;
}

.products-new-form-wrap {
  margin-bottom: 16px;
  border-color: rgba(37, 99, 235, 0.2);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.04) 0%, var(--white) 100%);
}

.card--highlight {
  border-color: var(--primary, #e85d04);
  background: linear-gradient(180deg, #fff8f3 0%, var(--white) 100%);
}

.fraction-preview {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--gray-bg, #f5f5f5);
  border-radius: var(--radius-sm);
  line-height: 1.5;
}

.fraction-block {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  background: var(--white);
}

.fraction-block--dest {
  border-color: rgba(37, 99, 235, 0.25);
  background: rgba(37, 99, 235, 0.04);
}

.fraction-block__title {
  margin: 0 0 12px;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--gray-dark);
}

.fraction-quick-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 12px;
}

.fraction-rule-chip {
  border: 1px solid var(--primary, #e85d04);
  background: #fff;
  color: var(--primary, #e85d04);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.fraction-rule-chip:hover {
  background: var(--primary, #e85d04);
  color: #fff;
}

.fraction-rule-hint {
  margin-bottom: 12px;
  padding: 8px 12px;
  background: #e8f5e9;
  border-left: 3px solid #2e7d32;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
}

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-overlay.open,
body.login-locked .login-overlay {
  display: flex;
}

body.login-locked .app-layout {
  filter: blur(2px);
  pointer-events: none;
}

.login-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
}

.login-card__logo {
  text-align: center;
  margin-bottom: 20px;
}

.login-card__logo h2 {
  margin: 8px 0 4px;
  font-size: 1.25rem;
}

.btn--block { width: 100%; }

.app-user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 12px;
}

.pdv-commission-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 10px 16px;
  background: linear-gradient(90deg, #fff8f3, #fff);
  border-bottom: 1px solid var(--gray-border);
  font-size: 0.8125rem;
}

.summary-grid--employee {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.summary-card--highlight {
  border-color: var(--primary, #e85d04);
}

.summary-card--commission .summary-card__value {
  color: #2e7d32;
}

.commission-tiers-table {
  max-width: 420px;
  margin-top: 8px;
}

.filter-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 0.875rem;
}

.filter-input--sm {
  padding: 6px 10px;
  font-size: 0.8125rem;
}

.input-sm {
  width: 80px;
  padding: 6px 10px;
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.input-with-btn {
  display: flex;
  gap: 8px;
}

.input-with-btn input {
  flex: 1;
}

.form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.form-inline input,
.form-inline select {
  flex: 1;
  min-width: 120px;
}

/* ═══════════════════════════════════════════════════════════════
   7. MODALS
   ═══════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(45, 52, 54, 0.5);
  backdrop-filter: blur(2px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(12px);
  transition: transform var(--transition);
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

/* Formulário dentro do modal: corpo rola, rodapé fixo */
.modal > form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.modal--checkout {
  max-width: 480px;
  max-height: min(92vh, 720px);
}

.modal--sm {
  max-width: 420px;
}

.modal--wide {
  max-width: 860px;
}

.modal--profile {
  max-width: 960px;
}

.modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--gray-border);
  flex-shrink: 0;
}

.modal__title {
  font-size: 1.125rem;
  font-weight: 700;
}

.modal__close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  font-size: 1.4rem;
  line-height: 1;
  color: var(--gray);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition);
}

.modal__close:hover {
  background: var(--gray-bg);
  color: var(--gray-dark);
}

.modal__body {
  padding: 20px 24px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--gray-border);
  flex-shrink: 0;
}

.modal__footer--split {
  justify-content: space-between;
}

.modal__footer-actions {
  display: flex;
  gap: 10px;
}

/* ═══════════════════════════════════════════════════════════════
   8. TABLES
   ═══════════════════════════════════════════════════════════════ */
.table-wrap {
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 16px;
}

.table-wrap table {
  font-size: 0.875rem;
}

.table-wrap thead {
  background: var(--gray-bg);
}

.table-wrap th {
  padding: 10px 14px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray);
  white-space: nowrap;
  border-bottom: 1px solid var(--gray-border);
}

.table-wrap td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--gray-border);
  vertical-align: middle;
}

.table-wrap tbody tr:last-child td {
  border-bottom: none;
}

.table-wrap tbody tr:hover {
  background: rgba(93, 173, 226, 0.04);
}

.table--clickable tbody tr {
  cursor: pointer;
}

.table--clickable tbody tr:hover {
  background: var(--accent-bg);
}

.empty-cell {
  text-align: center;
  color: var(--gray);
  padding: 32px 14px !important;
  font-size: 0.875rem;
}

.product-code {
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  color: var(--gray);
  background: var(--gray-bg);
  padding: 2px 6px;
  border-radius: 4px;
}

.dre-table {
  width: 100%;
  font-size: 0.875rem;
}

.dre-table td {
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-border);
}

.dre-total td {
  border-top: 2px solid var(--gray-dark);
  padding-top: 12px;
}

/* ═══════════════════════════════════════════════════════════════
   9. BADGES & STOCK
   ═══════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.badge--success {
  background: var(--success-bg);
  color: var(--success);
}

.badge--warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge--danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.badge--muted {
  background: var(--gray-bg);
  color: var(--gray);
}

.badge--info {
  background: var(--info-bg);
  color: var(--info);
}

.badge--accent {
  background: var(--accent-bg);
  color: var(--accent-dk);
}

.badge--primary {
  background: var(--primary-bg);
  color: var(--primary);
}

.promo-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--danger);
  color: var(--white);
}

.promo-badge--sm {
  font-size: 0.5625rem;
  padding: 1px 5px;
}

.stock--out,
.product-card__stock--out,
.stock-badge.stock--out {
  color: var(--danger);
}

.stock--low,
.product-card__stock--low,
.stock-badge.stock--low {
  color: var(--warning);
}

.stock--ok,
.product-card__stock--ok,
.stock-badge.stock--ok {
  color: var(--success);
}

.stock-badge {
  display: inline-flex;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 0.6875rem;
  font-weight: 600;
}

.stock-badge.stock--out {
  background: var(--danger-bg);
}

.stock-badge.stock--low {
  background: var(--warning-bg);
}

.stock-badge.stock--ok {
  background: var(--success-bg);
}

/* ═══════════════════════════════════════════════════════════════
   10. CARDS, SUB-TABS, GRIDS
   ═══════════════════════════════════════════════════════════════ */
.card {
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.card h3,
.card h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.sub-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--gray-border);
  padding-bottom: 0;
}

.sub-tab {
  padding: 10px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--transition), border-color var(--transition);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.sub-tab:hover {
  color: var(--gray-dark);
  background: var(--gray-bg);
}

.sub-tab.active {
  color: var(--accent-dk);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.sub-panel {
  display: none;
}

.sub-panel.active {
  display: block;
}

/* Cadastro — layout limpo */
.cadastro-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.cadastro-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 14px 10px;
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  text-align: center;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.cadastro-stat--clickable {
  cursor: pointer;
}

.cadastro-stat--clickable:hover {
  border-color: var(--primary, #5DADE2);
  box-shadow: 0 2px 8px rgba(93, 173, 226, 0.15);
}

.cadastro-stat--alert {
  border-color: #f0c36d;
  background: #fffbf0;
}

.cadastro-stat__icon {
  font-size: 1.25rem;
  line-height: 1;
}

.cadastro-stat__value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--dark);
}

.cadastro-stat__label {
  font-size: 0.72rem;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.cadastro-vendor-hint {
  background: #e8f4fc;
  border: 1px solid #b8dff5;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 0.88rem;
}

.cadastro-form-card {
  margin-bottom: 16px;
}

.cadastro-form-card__head {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-border);
}

.cadastro-form-card__head h3 {
  margin-bottom: 4px;
}

.cadastro-form-card__head .form-hint {
  margin: 0;
}

.cadastro-list-card {
  padding: 0;
  overflow: hidden;
}

.cadastro-list-card .table-wrap {
  margin: 0;
}

.cadastro-empty {
  text-align: center;
  color: var(--gray);
  padding: 32px 16px;
}

.sub-tabs--cadastro {
  gap: 2px;
  background: var(--gray-bg);
  padding: 4px;
  border-radius: var(--radius);
  border-bottom: none;
  margin-bottom: 20px;
}

.sub-tabs--cadastro .sub-tab {
  border-bottom: none;
  margin-bottom: 0;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 0.8125rem;
}

.sub-tabs--cadastro .sub-tab.active {
  background: var(--white);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  color: var(--primary, #5DADE2);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.tag {
  display: inline-flex;
  padding: 4px 12px;
  background: var(--gray-bg);
  border: 1px solid var(--gray-border);
  border-radius: 99px;
  font-size: 0.8125rem;
  color: var(--gray-dark);
}

/* ═══════════════════════════════════════════════════════════════
   11. FILTER BAR & SMART SEARCH
   ═══════════════════════════════════════════════════════════════ */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
}

.filter-bar .filter-input,
.filter-bar .filter-input--sm {
  width: auto;
  min-width: 140px;
  flex: 1;
  max-width: 220px;
}

.filter-bar .smart-search,
.filter-bar .smart-search-host {
  min-width: 140px;
  flex: 1;
  max-width: 220px;
}

.smart-search,
.smart-search-host {
  position: relative;
  width: 100%;
}

.smart-search--inline {
  display: inline-block;
}

.smart-search__input {
  width: 100%;
}

.smart-search__list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 240px;
  overflow-y: auto;
  z-index: 200;
  list-style: none;
}

.smart-search__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: background var(--transition);
}

.smart-search__item:hover,
.smart-search__item.active {
  background: var(--accent-bg);
  color: var(--accent-dk);
}

.smart-search__meta {
  font-size: 0.6875rem;
  color: var(--gray);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════
   12. DRAFT LISTS & SUMMARY
   ═══════════════════════════════════════════════════════════════ */
.draft-list,
.draft-box {
  background: var(--gray-bg);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 16px;
  min-height: 48px;
}

.draft-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--gray-border);
  font-size: 0.875rem;
}

.draft-row:last-child {
  border-bottom: none;
}

.draft-total {
  padding: 8px 4px 4px;
  text-align: right;
  font-size: 0.875rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.summary-card {
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
}

.summary-card__label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray);
  margin-bottom: 6px;
}

.summary-card__value {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--gray-dark);
}

/* ═══════════════════════════════════════════════════════════════
   13. PDV LAYOUT
   ═══════════════════════════════════════════════════════════════ */
.pdv-layout {
  display: grid;
  grid-template-columns: 1fr 340px 280px;
  gap: 16px;
  align-items: start;
  min-height: calc(100vh - var(--header-h) - 80px);
}

.pdv-operator {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.pdv-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pdv-toolbar .filter-input {
  flex: 1;
}

.pdv-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
  overflow-y: auto;
  max-height: calc(100vh - var(--header-h) - 120px);
  padding: 4px;
}

.pdv-products-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 48px 24px;
  text-align: center;
  color: var(--gray);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.pdv-product {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 12px 10px;
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  min-height: 168px;
  font: inherit;
  color: inherit;
}

.pdv-product__photo-wrap {
  width: 100%;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--gray-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pdv-product__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #fff;
}

.pdv-product__photo-wrap img[src$=".svg"] {
  object-fit: contain;
  padding: 10px;
}

.pdv-product__icon {
  font-size: 1.75rem;
  align-self: center;
}

.pdv-product__name {
  width: 100%;
  min-height: 2.4em;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--gray-dark);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.pdv-product:hover:not(.pdv-product--out) {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.pdv-product--out {
  opacity: 0.5;
  cursor: not-allowed;
}

.pdv-product--promo {
  border-color: rgba(220, 38, 38, 0.35);
  background: rgba(220, 38, 38, 0.03);
}

.pdv-product__price {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--accent-dk);
}

.pdv-product__price--promo {
  color: var(--danger);
}

.pdv-product__price-old {
  font-size: 0.6875rem;
  color: var(--gray);
  text-decoration: line-through;
}

.pdv-product__stock {
  font-size: 0.6875rem;
  font-weight: 600;
}

/* PDV Sale panel */
.pdv-sale {
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow);
  max-height: calc(100vh - var(--header-h) - 48px);
}

.pdv-sale__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-border);
  font-weight: 600;
  font-size: 0.9375rem;
  flex-shrink: 0;
}

.pdv-cart-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
  min-height: 120px;
}

.pdv-cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--gray-border);
  font-size: 0.8125rem;
}

.pdv-cart-item--promo {
  background: rgba(220, 38, 38, 0.03);
}

.pdv-cart-item__right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.pdv-cart-item__qty {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pdv-cart-item__price {
  font-weight: 700;
  font-size: 0.8125rem;
  min-width: 70px;
  text-align: right;
}

.pdv-discount-block {
  padding: 12px 16px;
  border-top: 1px solid var(--gray-border);
  background: var(--gray-bg);
}

.pdv-discount-block__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray);
  display: block;
  margin-bottom: 8px;
}

.pdv-discount-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.pdv-discount-row .filter-input--sm {
  flex: 1;
}

.pdv-discount-hint {
  margin-top: 6px;
}

.pdv-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 16px;
  font-size: 0.8125rem;
  color: var(--gray);
}

.pdv-summary-row--discount {
  color: var(--success);
}

.pdv-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-top: 2px solid var(--gray-dark);
  font-size: 1.125rem;
  font-weight: 700;
}

.pdv-sale__actions {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--gray-border);
}

.pdv-sale__actions .btn--primary {
  flex: 1;
}

/* PDV Held sales */
.pdv-held {
  border-top: 1px solid var(--gray-border);
  padding: 12px 16px;
  background: var(--gray-bg);
  max-height: 180px;
  overflow-y: auto;
}

.pdv-held__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.pdv-held__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pdv-held__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.pdv-held__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.75rem;
  min-width: 0;
}

.pdv-held__info strong {
  font-size: 0.8125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdv-held__total {
  font-weight: 700;
  color: var(--accent-dk);
}

.pdv-held__actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.pdv-held__empty {
  font-size: 0.75rem;
  padding: 4px 0;
}

/* Customer display */
.customer-display {
  background: var(--gray-dark);
  color: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--header-h) - 48px);
  box-shadow: var(--shadow-lg);
}

.customer-display__header {
  background: var(--accent-dk);
  padding: 12px 16px;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
}

.customer-display__body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.customer-display__welcome {
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9375rem;
  margin: auto;
}

.customer-display__items {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.customer-display__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.875rem;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.customer-display__row--muted {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8125rem;
}

.customer-display__row--discount {
  color: #86efac;
}

.customer-display__total {
  margin-top: auto;
  padding-top: 16px;
  border-top: 2px solid rgba(255, 255, 255, 0.2);
  display: flex;
  justify-content: space-between;
  font-size: 1.375rem;
  font-weight: 700;
}

.pdv-nfce-cpf {
  margin-bottom: 12px;
}

.pdv-nfce-cpf__toggle {
  margin-bottom: 8px;
}

.pdv-nfce-cpf__field {
  margin-top: 8px;
}

/* ═══════════════════════════════════════════════════════════════
   14. FISCAL & CAIXA
   ═══════════════════════════════════════════════════════════════ */
.fiscal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.cert-status {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.cert-status__icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.cert-status__title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 4px;
}

.cert-status__desc {
  font-size: 0.875rem;
  color: var(--gray);
  margin-bottom: 8px;
}

.cert-form,
.cert-info {
  margin-top: 16px;
}

.caixa-closed,
.caixa-open {
  text-align: center;
}

.caixa-closed h3,
.caixa-open h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.caixa-form {
  max-width: 480px;
  margin: 20px auto 0;
  text-align: left;
}

.caixa-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin: 20px 0;
  text-align: left;
}

.caixa-info p {
  background: var(--gray-bg);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.875rem;
}

.caixa-info strong {
  display: block;
  font-size: 1.125rem;
  margin-top: 4px;
}

.caixa-sales-report {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-border);
}

.caixa-sales-report__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.caixa-sales-report__header .section-subtitle {
  margin: 0;
}

.caixa-sales-report__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.caixa-close-actions {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-border);
}

.caixa-operations {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-border);
}

.caixa-operations__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.caixa-operations__header .section-subtitle {
  margin: 0;
}

.caixa-operations__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.reports-summary__item--highlight {
  background: #e8f8f0;
  border: 1px solid #a8dfc0;
}

.cash-close-summary {
  background: var(--gray-bg);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.cash-close-summary p {
  margin: 4px 0;
}

.cash-close-diff {
  font-size: 0.9rem;
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--gray-bg);
}

.cash-close-diff--ok {
  background: #e8f8f0;
  color: #1a6b3c;
}

.cash-close-diff--over {
  background: #fff8e6;
  color: #8a6d00;
}

.cash-close-diff--under {
  background: #fdecea;
  color: #b42318;
}

.xml-preview {
  margin: 16px 0;
  padding: 16px;
  background: var(--gray-bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-border);
}

/* ═══════════════════════════════════════════════════════════════
   15. ORDERS (Pedidos Online)
   ═══════════════════════════════════════════════════════════════ */
.orders-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 16px;
}

.online-order-row {
  cursor: pointer;
  transition: background var(--transition);
}

.online-order-row:hover {
  background: var(--accent-bg) !important;
}

.online-order-row--cancelado {
  opacity: 0.6;
}

.online-order-row--entregue {
  opacity: 0.75;
}

.order-address-cell {
  max-width: 180px;
  font-size: 0.8125rem;
  color: var(--gray);
}

.order-hint {
  font-size: 1rem;
  margin-left: 4px;
}

.order-alert {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 0.875rem;
}

.order-alert--card {
  background: var(--info-bg);
  border: 1px solid rgba(2, 132, 199, 0.25);
}

.order-alert--cash {
  background: var(--warning-bg);
  border: 1px solid rgba(217, 119, 6, 0.3);
}

.order-alert--pix {
  background: var(--success-bg);
  border: 1px solid rgba(22, 163, 74, 0.25);
}

.order-change {
  margin-top: 6px;
  font-size: 1rem;
}

.order-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.order-detail-section {
  margin-bottom: 20px;
}

.order-detail-section h4 {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray);
  margin-bottom: 8px;
}

.pick-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--gray-bg);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.pick-item {
  display: grid;
  grid-template-columns: 40px 1fr auto auto;
  gap: 8px;
  align-items: center;
  font-size: 0.875rem;
  padding: 6px 0;
  border-bottom: 1px solid var(--gray-border);
}

.pick-item:last-child {
  border-bottom: none;
}

.pick-item__qty {
  font-weight: 700;
  color: var(--accent-dk);
}

.pick-item__name {
  font-weight: 500;
}

.pick-total {
  margin-top: 12px;
  font-size: 1rem;
  text-align: right;
}

.order-history {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.order-history__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.8125rem;
  padding: 6px 0;
  border-bottom: 1px solid var(--gray-border);
}

.promo-items-cell {
  max-width: 200px;
  font-size: 0.8125rem;
  color: var(--gray);
}

/* ═══════════════════════════════════════════════════════════════
   16. PROFILE MODAL
   ═══════════════════════════════════════════════════════════════ */
.profile-stock-alert {
  margin-top: 6px;
}

.profile-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  align-items: start;
}

.profile-layout__photos {
  position: sticky;
  top: 0;
}

.profile-section-title {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-section {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--gray-border);
}

.profile-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.profile-section--admin {
  background: var(--gray-bg);
  border-radius: var(--radius-sm);
  padding: 16px;
  border: 1px solid var(--gray-border);
}

.profile-margin {
  font-size: 0.875rem;
  color: var(--gray);
  margin-bottom: 12px;
}

.photo-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.photo-placeholder {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 32px;
  background: var(--gray-bg);
  border: 2px dashed var(--gray-border);
  border-radius: var(--radius-sm);
  font-size: 2rem;
  color: var(--gray-light);
}

.photo-placeholder span {
  font-size: 0.8125rem;
  color: var(--gray);
}

.photo-thumb {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid var(--gray-border);
  aspect-ratio: 1;
}

.photo-thumb--main {
  border-color: var(--accent);
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-thumb__badge {
  position: absolute;
  top: 4px;
  left: 4px;
  background: var(--accent);
  color: var(--white);
  font-size: 0.5625rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.photo-thumb__actions {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 2px;
  padding: 4px;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity var(--transition);
}

.photo-thumb:hover .photo-thumb__actions {
  opacity: 1;
}

.photo-thumb__actions .btn {
  flex: 1;
  font-size: 0.625rem !important;
  padding: 3px 4px !important;
  color: var(--white) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
}

.photo-upload-btn {
  width: 100%;
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════════
   17. TOAST
   ═══════════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--gray-dark);
  color: var(--white);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  max-width: 360px;
  animation: toast-in 0.25s ease;
  pointer-events: auto;
}

.toast--success {
  background: var(--success);
}

.toast--error {
  background: var(--danger);
}

.toast--warning {
  background: var(--warning);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ═══════════════════════════════════════════════════════════════
   18. CHECKOUT (Online)
   ═══════════════════════════════════════════════════════════════ */
.checkout-notice {
  font-size: 0.875rem;
  color: var(--gray);
  padding: 10px 14px;
  background: var(--gray-bg);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  border-left: 3px solid var(--accent);
}

.checkout-delivery-zone {
  background: var(--accent-bg);
  border-left-color: var(--accent-dk);
  color: var(--accent-dk);
  font-weight: 500;
}

.delivery-banner__pickup {
  color: #166534;
}

.fulfillment-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.checkbox-row:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-bg);
}

.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.checkbox-row span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.875rem;
}

.checkbox-row span strong {
  font-size: 0.9375rem;
}

.form-label-block {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.checkout-pickup-notice {
  background: #ecfdf5;
  border-left-color: #059669;
  color: #065f46;
}

/* Banner de entrega — loja online */
.delivery-banner-wrap {
  padding-top: 12px;
  padding-bottom: 4px;
}

.delivery-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border: 2px solid #f97316;
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.15);
}

.delivery-banner__icon {
  font-size: 1.75rem;
  line-height: 1;
  flex-shrink: 0;
}

.delivery-banner__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.875rem;
  color: #9a3412;
}

.delivery-banner__text strong {
  color: #c2410c;
}

.delivery-banner__price,
.delivery-banner__free,
.delivery-banner__cement {
  display: block;
}

.delivery-banner__free strong {
  color: #15803d;
}

.delivery-summary {
  width: 100%;
  padding: 12px 14px;
  background: var(--gray-bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-border);
  font-size: 0.875rem;
}

.checkout-delivery-box .delivery-summary {
  background: linear-gradient(135deg, #fff7ed 0%, #fff 100%);
  border: 2px solid #f97316;
  margin-bottom: 16px;
}

.delivery-summary__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  gap: 12px;
}

.delivery-summary__row--free span:last-child {
  color: #15803d;
  font-weight: 700;
}

.delivery-summary__total {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--gray-border);
  font-size: 1rem;
}

.delivery-summary__hint {
  margin: 8px 0 0;
  padding: 8px 10px;
  background: #ecfdf5;
  border-radius: var(--radius-sm);
  color: #166534;
  font-size: 0.8125rem;
}

.delivery-summary__hint--free {
  background: #dcfce7;
}

.delivery-summary__warn {
  margin: 0 0 8px;
  padding: 8px 10px;
  background: #fef3c7;
  border-radius: var(--radius-sm);
  color: #92400e;
  font-size: 0.8125rem;
}

#cart-footer {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

#cart-footer .btn--primary {
  width: 100%;
}

.delivery-summary--compact {
  margin-top: 8px;
  max-width: 320px;
}

.checkout-section-title {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 20px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gray-border);
}

.input-readonly {
  background: var(--bg);
  color: var(--muted);
  cursor: not-allowed;
  border-color: var(--border);
}

.form-group select.filter-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.9375rem;
}

.checkout-total,
.checkout-total-inline {
  font-size: 1rem;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--gray-border);
}

.checkout-total-inline {
  border-top: none;
  padding-top: 0;
}

.checkout-change--ok {
  color: var(--success) !important;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════
   19. ONLINE STORE — Header, Hero, Stats, etc.
   ═══════════════════════════════════════════════════════════════ */
.header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--gray-border);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 64px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav__link {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray);
  transition: color var(--transition), background var(--transition);
}

.nav__link:hover {
  color: var(--gray-dark);
  background: var(--gray-bg);
}

.nav__link--accent {
  color: var(--accent-dk);
  font-weight: 600;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-menu-btn {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-border);
  background: var(--white);
  font-size: 1.25rem;
  cursor: pointer;
}

.nav--mobile-open {
  display: flex !important;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border-bottom: 1px solid var(--gray-border);
  padding: 12px 16px;
  box-shadow: var(--shadow-md);
  z-index: 199;
}

.nav__link--staff {
  color: var(--gray);
  font-size: 0.8125rem;
}

.footer__links {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  font-size: 0.875rem;
}

.footer__links a {
  color: var(--accent-dk);
  font-weight: 500;
}

.login-card__store-link {
  text-align: center;
  margin-top: 12px;
  font-size: 0.9375rem;
}

.login-card__store-link a {
  color: var(--accent-dk);
  font-weight: 600;
}

.cart-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-border);
  background: var(--white);
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), border-color var(--transition);
}

.cart-btn:hover {
  background: var(--accent-bg);
  border-color: var(--accent);
}

.cart-btn__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--accent);
  color: var(--white);
  font-size: 0.625rem;
  font-weight: 700;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-btn__badge[data-count="0"] {
  display: none;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--gray-dark) 0%, #1a252f 50%, var(--accent-dk) 100%);
  color: var(--white);
  padding: 72px 0 80px;
  margin-bottom: 40px;
}

.hero__tag {
  display: inline-block;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 20px;
}

.hero__title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
}

.hero__subtitle {
  font-size: 1.0625rem;
  color: rgba(255, 255, 255, 0.75);
  max-width: 560px;
  margin-bottom: 32px;
  line-height: 1.6;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero .btn--primary {
  background: var(--white);
  color: var(--accent-dk);
}

.hero .btn--primary:hover {
  background: var(--accent-bg);
}

.hero .btn--ghost {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.35);
}

.hero .btn--ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: -32px 0 48px;
  position: relative;
  z-index: 1;
}

.stat {
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  padding: 20px 24px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat__value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-dk);
  margin-bottom: 4px;
}

.stat__label {
  font-size: 0.8125rem;
  color: var(--gray);
  font-weight: 500;
}

/* Sections */
.section {
  padding: 48px 0;
}

.section__header {
  margin-bottom: 28px;
}

.section__title {
  font-size: 1.625rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.section__desc {
  color: var(--gray);
  font-size: 0.9375rem;
}

/* Categories */
.categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 16px;
  background: var(--white);
  border: 2px solid var(--gray-border);
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.category-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.category-card.active {
  border-color: var(--accent);
  background: var(--accent-bg);
}

.category-card__icon {
  font-size: 2rem;
}

.category-card__name {
  font-size: 0.875rem;
  font-weight: 600;
}

.category-card__count {
  font-size: 0.75rem;
  color: var(--gray);
}

/* Filters & Products grid */
.filters {
  margin-bottom: 24px;
}

.filters .filter-input {
  max-width: 400px;
}

.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

/* Product card */
.product-card {
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
}

.product-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.product-card__image {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-bg);
  font-size: 3rem;
  overflow: hidden;
}

.product-card__image--clickable {
  cursor: pointer;
}

.product-card__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #fff;
}

.product-card__image img[src$=".svg"] {
  object-fit: contain;
  padding: 12px;
}

.product-card__body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.product-card__category {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-dk);
}

.product-card__name {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
}

.product-card__brand {
  font-size: 0.8125rem;
  color: var(--gray);
}

.product-card__desc {
  font-size: 0.8125rem;
  color: var(--gray);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card__unit {
  font-size: 0.75rem;
  color: var(--gray-light);
}

.product-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
}

.product-card__price {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--gray-dark);
}

.product-card__price--promo {
  color: var(--danger);
}

.product-card__price-old {
  font-size: 0.8125rem;
  color: var(--gray);
  text-decoration: line-through;
  margin-left: 4px;
}

.product-card__stock {
  font-size: 0.6875rem;
  font-weight: 600;
}

.product-card__actions {
  display: flex;
  gap: 8px;
  padding: 0 16px 16px;
}

.product-card__actions--dual .btn {
  flex: 1;
  font-size: 0.8125rem;
  padding: 8px 10px;
}

/* Modules section */
.modules {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.module-card {
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.module-card__title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.module-card__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.module-card__list li {
  font-size: 0.875rem;
  color: var(--gray);
  padding-left: 16px;
  position: relative;
}

.module-card__list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 700;
}

/* Footer */
.footer {
  background: var(--gray-dark);
  color: rgba(255, 255, 255, 0.7);
  padding: 40px 0;
  margin-top: 48px;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.footer .logo {
  color: var(--white);
}

.footer__text {
  font-size: 0.875rem;
}

.footer__whatsapp {
  color: #25d366;
  font-weight: 600;
}

.footer__whatsapp:hover {
  color: #1ebe57;
}

.wa-float {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px 12px 14px;
  background: #25d366;
  color: #fff;
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.45);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.wa-float:hover {
  background: #1ebe57;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.55);
}

/* Oculta WhatsApp fora da pagina principal (carrinho, checkout, produto) */
.wa-float--hidden,
body:has(#cart-modal.open) #wa-float-btn,
body:has(#checkout-modal.open) #wa-float-btn,
body:has(#product-detail-modal.open) #wa-float-btn {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.wa-float__icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.wa-float__label {
  line-height: 1;
}

@media (max-width: 640px) {
  .wa-float {
    right: 16px;
    bottom: 16px;
    padding: 14px;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    justify-content: center;
  }

  .wa-float__label {
    display: none;
  }

  .wa-float__icon {
    width: 30px;
    height: 30px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   20. CART (Online modal)
   ═══════════════════════════════════════════════════════════════ */
.cart-empty {
  text-align: center;
  color: var(--gray);
  padding: 32px 0;
  font-size: 0.9375rem;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-border);
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item__icon {
  font-size: 1.75rem;
  flex-shrink: 0;
}

.cart-item__info {
  flex: 1;
  min-width: 0;
}

.cart-item__name {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.cart-item__price {
  font-size: 0.8125rem;
  color: var(--gray);
}

.cart-item__qty {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.cart-total {
  font-size: 1.0625rem;
  font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════════
   21. PRODUCT DETAIL MODAL
   ═══════════════════════════════════════════════════════════════ */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}

.product-detail__gallery {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--gray-bg);
}

.product-detail__gallery--empty {
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
}

.product-detail__main {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  background: var(--gray-bg);
}

.product-detail__thumbs {
  display: flex;
  gap: 8px;
  padding: 10px;
  overflow-x: auto;
}

.product-detail__thumbs img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity var(--transition), border-color var(--transition);
}

.product-detail__thumbs img.active,
.product-detail__thumbs img:hover {
  opacity: 1;
  border-color: var(--accent);
}

.product-detail__info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-detail__brand {
  font-size: 0.9375rem;
  color: var(--gray);
}

.product-detail__price {
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.product-detail__section h4 {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray);
  margin-bottom: 6px;
}

.product-detail__section p {
  font-size: 0.875rem;
  color: var(--gray-dark);
  line-height: 1.6;
}

.product-detail__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.8125rem;
  color: var(--gray);
}

/* ═══════════════════════════════════════════════════════════════
   22. RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
  .pdv-layout {
    grid-template-columns: 1fr 300px;
  }

  .customer-display {
    display: none;
  }
}

@media (max-width: 1024px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .sidebar-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .sidebar {
    position: fixed;
    left: -100%;
    width: min(var(--sidebar-w), 88vw);
    max-width: 300px;
    transition: left var(--transition);
    z-index: 300;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
  }

  .sidebar.open {
    left: 0;
  }

  body.sidebar-open {
    overflow: hidden;
  }

  .pdv-layout {
    grid-template-columns: 1fr;
  }

  .pdv-products {
    max-height: 360px;
  }

  .pdv-sale {
    max-height: none;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .order-detail-grid {
    grid-template-columns: 1fr;
  }

  .profile-layout {
    grid-template-columns: 1fr;
  }

  .profile-layout__photos {
    position: static;
  }

  .product-detail {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .app-content {
    padding: 16px;
  }

  .app-header {
    padding: 0 16px;
  }

  .header {
    position: sticky;
  }

  .header__inner {
    position: relative;
    height: 56px;
  }

  .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .nav {
    display: none;
  }

  .header__staff-link,
  .hero__staff-link,
  .nav__link--staff,
  .footer__staff-link {
    display: none !important;
  }

  .hero__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero__actions .btn--primary {
    width: 100%;
  }

  .hero {
    padding: 48px 0 56px;
  }

  .stats {
    grid-template-columns: 1fr 1fr;
    margin-top: -24px;
  }

  .products {
    grid-template-columns: 1fr;
  }

  .categories {
    grid-template-columns: repeat(2, 1fr);
  }

  .modal {
    max-height: 92vh;
    min-height: 0;
    border-radius: var(--radius) var(--radius) 0 0;
    align-self: flex-end;
  }

  .modal--checkout {
    max-height: 92vh;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal__header,
  .modal__body,
  .modal__footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .form-row {
    flex-direction: column;
  }

  .form-group--qty {
    flex: 1;
  }

  .filter-bar .filter-input,
  .filter-bar .smart-search,
  .filter-bar .smart-search-host {
    max-width: none;
    min-width: 0;
  }

  .pdv-discount-row {
    flex-wrap: wrap;
  }

  .modal__footer--split {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .modal__footer-actions {
    flex-direction: column;
  }

  .fiscal-actions {
    flex-direction: column;
  }

  .fiscal-actions .btn {
    width: 100%;
  }

  .sub-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .sub-tab {
    flex-shrink: 0;
  }

  .toast-container {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .toast {
    max-width: none;
  }
}

@media (max-width: 480px) {
  .stats {
    grid-template-columns: 1fr;
  }

  .hero__actions {
    flex-direction: column;
  }

  .hero__actions .btn {
    width: 100%;
  }

  .categories {
    grid-template-columns: 1fr;
  }

  .product-card__actions--dual {
    flex-direction: column;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .pick-item {
    grid-template-columns: 36px 1fr;
    grid-template-rows: auto auto;
  }

  .pick-item__unit,
  .pick-item__price {
    grid-column: 2;
  }
}

/* Print utilities */
@media print {
  .sidebar,
  .app-header,
  .toast-container,
  .modal-overlay {
    display: none !important;
  }

  .app-layout {
    display: block;
  }

  .app-content {
    padding: 0;
  }

  .page {
    display: block !important;
  }
}

.whatsapp-settings-card .whatsapp-status-panel { margin: 12px 0; }
.whatsapp-qr-wrap { text-align: center; margin: 12px 0; padding: 12px; background: var(--gray-bg, #f5f5f5); border-radius: var(--radius); }

/* Sidebar simplificado */
.sidebar__section-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.45);
  padding: 12px 16px 4px;
  margin: 0;
}
.sidebar__toggle-more {
  display: block;
  width: calc(100% - 24px);
  margin: 8px 12px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.82rem;
  cursor: pointer;
}
.sidebar__toggle-more:hover { background: rgba(255, 255, 255, 0.1); }
.sidebar__more-group { display: none; }
.sidebar__more-group--open { display: block; }
.sidebar__item--hidden { display: none; }
.sidebar__item--more.sidebar__item--hidden { display: none; }
.sidebar__more-group--open .sidebar__item--more { display: flex; }

/* Alertas operacionais */
.alert-banner {
  padding: 10px 16px;
  border-radius: var(--radius);
  margin-bottom: 12px;
  font-size: 0.9rem;
}
.alert-banner--warning {
  background: #fff3cd;
  border: 1px solid #ffc107;
  color: #664d03;
}
.alert-banner a { color: inherit; font-weight: 600; }

.fiscal-gestaoclick-banner {
  background: #e8f4fc;
  border: 1px solid var(--primary, #5DADE2);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.clickable-row { cursor: pointer; }
.clickable-row:hover { background: rgba(93, 173, 226, 0.08); }

.reports-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.reports-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.reports-summary__item {
  background: var(--surface-2, #f4f6f8);
  border-radius: var(--radius, 8px);
  padding: 10px 12px;
}

.reports-summary__label {
  font-size: 0.75rem;
  color: var(--muted, #6b7280);
  margin-bottom: 2px;
}

.reports-summary__value {
  font-size: 1.05rem;
  font-weight: 600;
}

.reports-section-title {
  font-size: 0.9rem;
  margin: 16px 0 8px;
  color: var(--muted, #6b7280);
}

.order-quick-btn { margin-left: 8px; vertical-align: middle; }

.backup-card .form-row { gap: 8px; flex-wrap: wrap; }
.backup-card label.btn { cursor: pointer; }

/* Financeiro — dashboard */
.finance-gc-banner {
  background: #e8f4fc;
  border: 1px solid var(--primary, #5DADE2);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 0.88rem;
}
.finance-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.finance-period-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.finance-mode-toggle { display: flex; gap: 4px; }
.finance-period-label {
  font-weight: 600;
  color: var(--gray-dark);
  font-size: 0.95rem;
}
.finance-kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.summary-card--clickable {
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.summary-card--clickable:hover {
  border-color: var(--primary, #5DADE2);
  box-shadow: 0 4px 12px rgba(93, 173, 226, 0.15);
}
.summary-card__meta {
  font-size: 0.78rem;
  color: var(--gray);
  margin-top: 6px;
}
.summary-card__value--pos { color: #1e8449; }
.summary-card__value--neg { color: #c0392b; }
.finance-trend { font-size: 0.78rem; font-weight: 600; }
.finance-trend--up { color: #1e8449; }
.finance-trend--down { color: #c0392b; }
.finance-trend--neutral { color: var(--gray); }
.finance-overdue { color: #c0392b; font-weight: 600; }
.finance-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin: 20px 0;
}
.finance-chart-card h4 {
  margin: 0 0 16px;
  font-size: 0.95rem;
}
.finance-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 140px;
  padding-top: 8px;
}
.finance-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}
.finance-bar {
  width: 100%;
  max-width: 36px;
  background: linear-gradient(180deg, var(--primary, #5DADE2), #3498db);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
}
.finance-bar-label {
  font-size: 0.7rem;
  color: var(--gray);
  margin-top: 6px;
}
.finance-cat-list { display: flex; flex-direction: column; gap: 10px; }
.finance-cat-row {
  display: grid;
  grid-template-columns: 90px 1fr 80px;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}
.finance-cat-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.finance-cat-track {
  height: 8px;
  background: #eee;
  border-radius: 4px;
  overflow: hidden;
}
.finance-cat-track--blue .finance-cat-fill { background: var(--primary, #5DADE2); }
.finance-cat-fill {
  height: 100%;
  background: #e67e22;
  border-radius: 4px;
}
.finance-cat-val {
  text-align: right;
  font-weight: 600;
  font-size: 0.8rem;
}
.finance-year-strip { margin-top: 8px; }
.finance-year-strip h4 { margin: 0 0 12px; }
.summary-grid--compact {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.dre-table--full { width: 100%; }
.dre-table--full td:last-child { text-align: right; white-space: nowrap; }
.dre-table--detail { width: 100%; }
.dre-table--detail td:last-child { text-align: right; }
.dre-subtotal td { border-top: 2px solid var(--gray-border); }
.finance-gc-hint { margin-top: 12px; }

/* Importar / Exportar */
.import-export-card { grid-column: 1 / -1; }
.io-toolbar-card {
  margin-bottom: 16px;
  padding: 14px 16px;
}
.io-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.io-toolbar__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.875rem;
}
.io-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.io-table-wrap { margin-top: 12px; }
.io-table .io-mod-desc { font-size: 0.8rem; }
.io-actions {
  white-space: nowrap;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.io-import-label { cursor: pointer; margin: 0; }
.io-help {
  margin-top: 16px;
  font-size: 0.88rem;
}
.io-help summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--primary, #5DADE2);
}
.io-help-list {
  margin: 10px 0 0 18px;
  line-height: 1.6;
}
.whatsapp-qr-img { max-width: 280px; width: 100%; height: auto; border-radius: 8px; }
.checkout-change--ok { color: #27ae60; font-weight: 600; }

/* Parcelas — despesas e compras */
.payable-form .form-group label {
  display: block;
  font-size: 0.82rem;
  margin-bottom: 4px;
  color: var(--text-muted, #888);
}
.purchase-payment-block h4 {
  margin: 0 0 12px;
}
.installment-table-wrap {
  margin-top: 8px;
}
.installment-table .input-sm {
  width: 100%;
  min-width: 110px;
}
.form-group--align-end {
  display: flex;
  align-items: flex-end;
}
.profile-section--locked {
  opacity: 0.72;
}
.pdv-payment-line {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.order-alert--credit {
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  padding: 12px;
  border-radius: 8px;
  margin: 12px 0;
}
.admin-cash-overview h3 {
  margin-top: 0;
}
