/* CENTRAL GESTÃO ERP UNIVERSAL — Identidade Visual Corporativa */
:root {
  --navy-dark: #0f172a;
  --navy-blue: #1e3a8a;
  --primary-blue: #2563eb;
  --primary-hover: #1d4ed8;
  --accent-blue: #3b82f6;
  --light-blue: #eff6ff;
  --bg-light: #f8fafc;
  --card-bg: #ffffff;
  --border-color: #e2e8f0;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --success: #10b981;
  --success-bg: #ecfdf5;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  background-color: var(--bg-light);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

/* Layout Geral */
.app-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background-color: var(--navy-dark);
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  transition: width 0.25s ease;
  z-index: 50;
  flex-shrink: 0;
}

.sidebar.collapsed {
  width: 72px;
}

.sidebar-header {
  padding: 1.25rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  overflow: hidden;
  white-space: nowrap;
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--accent-blue), var(--navy-blue));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.logo-text {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #ffffff;
}

.logo-sub {
  font-size: 0.65rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-toggle-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.sidebar-menu {
  flex: 1;
  padding: 1rem 0.5rem;
  overflow-y: auto;
}

.menu-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  padding: 0.75rem 0.75rem 0.35rem 0.75rem;
  font-weight: 600;
}

.sidebar.collapsed .menu-section-title {
  display: none;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  color: #cbd5e1;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s ease;
  margin-bottom: 2px;
  text-decoration: none;
  user-select: none;
  position: relative;
}

.menu-item:hover {
  background-color: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}

.menu-item.active {
  background-color: var(--primary-blue);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.menu-item-icon {
  font-size: 1.15rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.menu-item-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar.collapsed .menu-item-label,
.sidebar.collapsed .menu-badge {
  display: none;
}

.menu-badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 9999px;
  font-weight: 600;
  background-color: rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
}

.menu-badge.badge-soon {
  background-color: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Submenu dropdown */
.submenu {
  padding-left: 2.25rem;
  display: none;
}
.submenu.open {
  display: block;
}
.sidebar.collapsed .submenu {
  display: none !important;
}
.submenu-item {
  padding: 0.5rem 0.75rem;
  font-size: 0.825rem;
  color: #94a3b8;
  border-radius: 4px;
  cursor: pointer;
  display: block;
  transition: color 0.15s;
}
.submenu-item:hover, .submenu-item.active {
  color: #38bdf8;
}

/* Conteúdo Principal */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-x: hidden;
}

/* Header */
.top-header {
  height: 64px;
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.context-selectors {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.context-box {
  display: flex;
  flex-direction: column;
}

.context-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.select-clean {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}
.select-clean:focus {
  border-color: var(--primary-blue);
  background: #ffffff;
}

.segment-pills {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}
.segment-pill {
  background: var(--light-blue);
  color: var(--navy-blue);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  border: 1px solid #bfdbfe;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-left: 1rem;
  border-left: 1px solid var(--border-color);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--navy-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
}
.user-role {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Área de Páginas */
.content-body {
  flex: 1;
  padding: 1.75rem;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.page-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--navy-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.page-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* Cards & Containers */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
  margin-bottom: 1.5rem;
}

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  color: var(--navy-dark);
}

.card-body {
  padding: 1.25rem;
}

/* Métricas do Dashboard */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.metric-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  transition: transform 0.15s, box-shadow 0.15s;
}
.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
}

.metric-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--navy-dark);
  line-height: 1.2;
}

.metric-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 0.25rem;
}

.metric-sub {
  font-size: 0.72rem;
  color: var(--success);
  font-weight: 600;
  margin-top: 0.4rem;
}

.metric-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--light-blue);
  color: var(--primary-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  outline: none;
}

.btn-primary {
  background-color: var(--primary-blue);
  color: #fff;
}
.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-secondary {
  background-color: #ffffff;
  border-color: #cbd5e1;
  color: var(--text-main);
}
.btn-secondary:hover {
  background-color: #f8fafc;
  border-color: #94a3b8;
}

.btn-danger {
  background-color: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  background-color: #dc2626;
}

.btn-sm {
  padding: 0.3rem 0.65rem;
  font-size: 0.775rem;
}

/* Tabelas e Filtros */
.table-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.search-input-box {
  position: relative;
  min-width: 280px;
}

.search-input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.85rem;
  outline: none;
}
.search-input:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.search-icon-pos {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.9rem;
}

.data-table-container {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #ffffff;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.data-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tr:hover td {
  background-color: #f8fafc;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.status-badge.active {
  background-color: var(--success-bg);
  color: var(--success);
  border: 1px solid #a7f3d0;
}

.status-badge.inactive {
  background-color: #f3f4f6;
  color: #6b7280;
  border: 1px solid #e5e7eb;
}

/* Modais — Camada superior absoluta a todos os elementos fullscreen */
#modal-container {
  position: relative;
  z-index: 200000 !important;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200000 !important;
  padding: 1rem;
}

.modal-overlay.open {
  display: flex;
}

.modal-content {
  background: #ffffff;
  border-radius: 10px;
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy-dark);
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: #94a3b8;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: #f8fafc;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
}

/* Formulários */
.form-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-label {
  font-size: 0.775rem;
  font-weight: 600;
  color: #334155;
}

.form-control {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  color: var(--text-main);
  outline: none;
}
.form-control:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.col-12 { grid-column: span 12; }
.col-8 { grid-column: span 8; }
.col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; }
.col-3 { grid-column: span 3; }
.col-2 { grid-column: span 2; }

/* Notificações Toasts */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 200;
}

.toast {
  padding: 0.75rem 1.25rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #ffffff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  animation: slideIn 0.2s ease forwards;
}
.toast.success { background-color: var(--success); }
.toast.error { background-color: var(--danger); }
.toast.info { background-color: var(--primary-blue); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Tabs */
.tab-nav {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.25rem;
}
.tab-btn {
  padding: 0.65rem 1rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}
.tab-btn.active {
  color: var(--primary-blue);
  border-bottom-color: var(--primary-blue);
}

/* ==========================================================================
   Comando 003-A: Estilos de Abas em Modais e Recibo Térmico de PDV (80mm)
   ========================================================================== */
.modal-tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 1.25rem;
  overflow-x: auto;
}
.modal-tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  margin-bottom: -2px;
}
.modal-tab-btn:hover {
  color: #1e3a8a;
  border-bottom-color: #cbd5e1;
}
.modal-tab-btn.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
  background: #eff6ff;
  border-radius: 4px 4px 0 0;
}
.modal-tab-pane {
  display: none;
}
.modal-tab-pane.active {
  display: block;
}

/* Recibo Térmico de Frente de Caixa (80mm) */
.pos-receipt-container {
  width: 330px;
  margin: 0 auto;
  background: #ffffff;
  padding: 1.25rem 1rem;
  border: 1px dashed #cbd5e1;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.82rem;
  color: #0f172a;
  line-height: 1.4;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
.pos-receipt-header {
  text-align: center;
  border-bottom: 1px dashed #64748b;
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
}
.pos-receipt-title {
  font-size: 1.05rem;
  font-weight: 800;
  text-transform: uppercase;
}
.pos-receipt-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0;
}
.pos-receipt-table th, .pos-receipt-table td {
  padding: 2px 0;
  font-size: 0.78rem;
}
.pos-receipt-footer {
  text-align: center;
  border-top: 1px dashed #64748b;
  padding-top: 0.75rem;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: #475569;
}

/* ============================================================================
   SISTEMA UNIVERSAL DE IMPRESSÃO PROFISSIONAL (A4, A5, 80MM TÉRMICO E DOCUMENTOS)
   ============================================================================ */

#erp-document-print-area {
  display: none;
}

@media print {
  body.print-pos-receipt-mode > :not(#pos-receipt-print-area) {
    display: none !important;
  }
  /* 1. MODO TÉRMICO DE PDV (80MM - CUPOM NÃO FISCAL DO FRENTE DE CAIXA) */
  body.print-pos-receipt-mode * {
    visibility: hidden !important;
  }
  body.print-pos-receipt-mode #pos-receipt-print-area,
  body.print-pos-receipt-mode #pos-receipt-print-area * {
    visibility: visible !important;
  }
  body.print-pos-receipt-mode #pos-receipt-print-area,
  body.print-pos-receipt-mode .pos-receipt-container {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 80mm !important;
    margin: 0 !important;
    padding: 3mm !important;
    border: none !important;
    box-shadow: none !important;
    background: #ffffff !important;
    color: #000000 !important;
    font-family: 'Courier New', Courier, monospace !important;
    font-size: 10pt !important;
    line-height: 1.25 !important;
    display: block !important;
  }

  /* 2. MODO DOCUMENTO DEDICADO (#erp-document-print-area) - DANFE, BOLETOS, PROMISSÓRIAS, FICHAS */
  body.print-document-mode * {
    visibility: hidden !important;
  }
  body.print-document-mode #erp-document-print-area,
  body.print-document-mode #erp-document-print-area * {
    visibility: visible !important;
  }
  body.print-document-mode #erp-document-print-area {
    display: block !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 8mm 12mm !important;
    box-sizing: border-box !important;
    background: #ffffff !important;
    color: #000000 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
  }

  /* 3. MODO NORMAL (WINDOW.PRINT() ACIONADO EM QUALQUER TELA OU MODAL SEM OCULTAR TUDO) */
  body:not(.print-pos-receipt-mode):not(.print-document-mode) {
    background: #ffffff !important;
    color: #000000 !important;
  }

  /* Oculta apenas os componentes da interface/navegação/botões */
  body:not(.print-pos-receipt-mode):not(.print-document-mode) .sidebar,
  body:not(.print-pos-receipt-mode):not(.print-document-mode) .top-header,
  body:not(.print-pos-receipt-mode):not(.print-document-mode) .btn,
  body:not(.print-pos-receipt-mode):not(.print-document-mode) button,
  body:not(.print-pos-receipt-mode):not(.print-document-mode) .modal-close-btn,
  body:not(.print-pos-receipt-mode):not(.print-document-mode) .desktop-modal-close-btn,
  body:not(.print-pos-receipt-mode):not(.print-document-mode) .modal-footer,
  body:not(.print-pos-receipt-mode):not(.print-document-mode) .desktop-footer-bar,
  body:not(.print-pos-receipt-mode):not(.print-document-mode) .erp-modal-footer,
  body:not(.print-pos-receipt-mode):not(.print-document-mode) .cadastro-actions-bar,
  body:not(.print-pos-receipt-mode):not(.print-document-mode) .toast-container,
  body:not(.print-pos-receipt-mode):not(.print-document-mode) .sidebar-toggle-btn,
  body:not(.print-pos-receipt-mode):not(.print-document-mode) .aux-tabs-container,
  body:not(.print-pos-receipt-mode):not(.print-document-mode) .tab-nav,
  body:not(.print-pos-receipt-mode):not(.print-document-mode) .erp-tabs-bar,
  body:not(.print-pos-receipt-mode):not(.print-document-mode) .desktop-tabs-header,
  body:not(.print-pos-receipt-mode):not(.print-document-mode) .desktop-tabs-bar,
  body:not(.print-pos-receipt-mode):not(.print-document-mode) .modal-tabs,
  body:not(.print-pos-receipt-mode):not(.print-document-mode) .pos-super-header,
  body:not(.print-pos-receipt-mode):not(.print-document-mode) .pos-super-barcode-bar,
  body:not(.print-pos-receipt-mode):not(.print-document-mode) .pos-super-entity-bar,
  body:not(.print-pos-receipt-mode):not(.print-document-mode) .pos-super-side-actions,
  body:not(.print-pos-receipt-mode):not(.print-document-mode) .pos-super-bottom-bar,
  body:not(.print-pos-receipt-mode):not(.print-document-mode) .pos-super-paymethods,
  body:not(.print-pos-receipt-mode):not(.print-document-mode) .no-print {
    display: none !important;
  }

  /* Impressão direta de modais abertos */
  body:not(.print-pos-receipt-mode):not(.print-document-mode) .modal-overlay.open {
    position: static !important;
    display: block !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }
  body:not(.print-pos-receipt-mode):not(.print-document-mode) .modal-content {
    position: static !important;
    box-shadow: none !important;
    border: none !important;
    max-width: 100% !important;
    width: 100% !important;
    max-height: none !important;
    overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
  }
  body:not(.print-pos-receipt-mode):not(.print-document-mode) .modal-header {
    background: transparent !important;
    border-bottom: 2px solid #000000 !important;
    color: #000000 !important;
    padding: 0 0 6px 0 !important;
    margin-bottom: 12px !important;
  }
  body:not(.print-pos-receipt-mode):not(.print-document-mode) .modal-title {
    color: #000000 !important;
    font-size: 13pt !important;
  }
  body:not(.print-pos-receipt-mode):not(.print-document-mode) .modal-body {
    padding: 0 !important;
    background: transparent !important;
    overflow: visible !important;
  }

  /* Impressão de listagens e telas principais */
  body:not(.print-pos-receipt-mode):not(.print-document-mode) .main-wrapper,
  body:not(.print-pos-receipt-mode):not(.print-document-mode) .content-body {
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  body:not(.print-pos-receipt-mode):not(.print-document-mode) .card {
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  body:not(.print-pos-receipt-mode):not(.print-document-mode) .data-table-container {
    border: 1px solid #334155 !important;
    overflow: visible !important;
  }
  body:not(.print-pos-receipt-mode):not(.print-document-mode) .data-table {
    border-collapse: collapse !important;
    width: 100% !important;
    font-size: 9pt !important;
  }
  body:not(.print-pos-receipt-mode):not(.print-document-mode) .data-table th,
  body:not(.print-pos-receipt-mode):not(.print-document-mode) .data-table td {
    border: 1px solid #cbd5e1 !important;
    color: #000000 !important;
    padding: 5px 6px !important;
  }
  body:not(.print-pos-receipt-mode):not(.print-document-mode) .data-table th {
    background: #f1f5f9 !important;
    font-weight: 700 !important;
  }
  body:not(.print-pos-receipt-mode):not(.print-document-mode) .data-table th:last-child,
  body:not(.print-pos-receipt-mode):not(.print-document-mode) .data-table td:last-child {
    display: none !important;
  }
}

/* ============================================================================
   ESTILOS EXCLUSIVOS CONFORME TELAS DE REFERÊNCIA (PRINTS DO CLIENTE)
   PDV Supermercado, Modais Desktop com Abas Numeradas e Janela Pedido de Venda
   ============================================================================ */

/* 1. PDV Supermercado (Captura image_51ac1a.jpg) */
.pos-supermarket-container {
  display: flex;
  flex-direction: column;
  background: #f1f5f9;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  font-family: inherit;
}

.pos-super-header {
  background: #003366;
  color: #ffffff;
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pos-super-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.pos-super-badge {
  background: #2563eb;
  color: #fff;
  font-size: 0.75rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-weight: 700;
}
.pos-super-subtitle {
  font-size: 0.75rem;
  color: #93c5fd;
  font-weight: 600;
}
.pos-super-info {
  display: flex;
  gap: 1.5rem;
  font-size: 0.85rem;
  color: #e2e8f0;
}
.pos-super-header-actions {
  display: flex;
  gap: 0.5rem;
}
.btn-pos-head {
  background: #1e40af;
  color: #fff;
  border: 1px solid #3b82f6;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.btn-pos-head:hover {
  background: #2563eb;
}
.btn-pos-head.danger {
  background: #dc2626;
  border-color: #ef4444;
}
.btn-pos-head.danger:hover {
  background: #b91c1c;
}

.pos-super-barcode-bar {
  background: #ffffff;
  padding: 0.75rem 1.25rem;
  border-bottom: 2px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.pos-super-barcode-icon {
  font-size: 1.5rem;
  color: #475569;
}
.pos-super-barcode-input {
  flex: 1;
  font-size: 1.15rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  outline: none;
  font-weight: 600;
}
.pos-super-barcode-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.pos-super-entity-bar {
  background: #f8fafc;
  padding: 0.5rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pos-super-entity-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.pos-super-main {
  display: grid;
  grid-template-columns: 1fr 340px;
  background: #ffffff;
  min-height: 440px;
}
.pos-super-items-col {
  display: flex;
  border-right: 1px solid #e2e8f0;
}
.pos-super-table-wrap {
  flex: 1;
  overflow-y: auto;
  max-height: 480px;
}
.pos-super-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.pos-super-table th {
  background: #f1f5f9;
  color: #334155;
  font-weight: 700;
  padding: 0.6rem 0.75rem;
  border-bottom: 2px solid #cbd5e1;
  text-align: left;
}
.pos-super-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
}
.pos-super-table tr:hover {
  background: #f8fafc;
}

.pos-super-side-actions {
  width: 110px;
  background: #f8fafc;
  border-left: 1px solid #e2e8f0;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.btn-pos-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 0.25rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  text-align: center;
  gap: 0.25rem;
}
.btn-pos-side.red {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}
.btn-pos-side.red:hover {
  background: #fecaca;
}
.btn-pos-side.blue {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #bae6fd;
}
.btn-pos-side.blue:hover {
  background: #bae6fd;
}

.pos-super-totals-col {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  background: #ffffff;
}
.pos-super-subtotal-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
  color: #475569;
  margin-bottom: 0.35rem;
}
.pos-super-grand-total-box {
  margin: 1rem 0;
  padding: 0.75rem 0;
  border-top: 1px solid #e2e8f0;
  border-bottom: 2px dashed #cbd5e1;
}
.pos-super-grand-total-label {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
}
.pos-super-grand-total-value {
  font-size: 2.25rem;
  font-weight: 900;
  color: #1d4ed8;
  text-align: right;
  line-height: 1.1;
}

.pos-super-paymethods {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.btn-pos-pay {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 700;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-pos-pay:hover {
  background: #e2e8f0;
}
.btn-pos-pay.active {
  background: #dcfce7;
  color: #15803d;
  border-color: #86efac;
}

.pos-super-bottom-bar {
  background: #f8fafc;
  border-top: 2px solid #e2e8f0;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.btn-pos-action {
  padding: 0.65rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.btn-pos-action:hover {
  background: #f1f5f9;
}
.btn-pos-action.primary {
  background: #2563eb;
  color: #ffffff;
  border-color: #1d4ed8;
}
.btn-pos-action.primary:hover {
  background: #1d4ed8;
}
.btn-pos-action.success {
  background: #059669;
  color: #ffffff;
  border-color: #047857;
  font-size: 1.05rem;
  padding: 0.75rem 1.5rem;
}
.btn-pos-action.success:hover {
  background: #047857;
}

/* 2. Janelas e Modais no Estilo Desktop Clássico (Prints 1 a 10) */
.desktop-window-container {
  background: #dbeafe;
  border: 1px solid #93c5fd;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}
.desktop-window-header {
  background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
  color: #ffffff;
  padding: 0.4rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 0.95rem;
}
.desktop-tabs-header {
  display: flex;
  background: #eff6ff;
  border-bottom: 1px solid #bfdbfe;
  padding: 0.25rem 0.5rem 0 0.5rem;
  gap: 0.25rem;
}
.desktop-tab-btn {
  padding: 0.4rem 0.85rem;
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
}
.desktop-tab-btn.active {
  background: #ffffff;
  border-color: #bfdbfe;
  color: #1d4ed8;
  border-bottom: 2px solid #ffffff;
  margin-bottom: -1px;
}
.desktop-window-body {
  background: #ffffff;
  padding: 1.25rem;
}
.desktop-fieldset {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}
.desktop-legend {
  font-size: 0.82rem;
  font-weight: 700;
  color: #3b82f6;
  padding: 0 0.35rem;
}
.desktop-footer-bar {
  background: #f1f5f9;
  border-top: 1px solid #cbd5e1;
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.btn-desktop-save {
  background: #16a34a;
  color: #ffffff;
  border: 1px solid #15803d;
  padding: 0.55rem 1.25rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}
.btn-desktop-save:hover {
  background: #15803d;
}
.btn-desktop-cancel {
  background: #ef4444;
  color: #ffffff;
  border: 1px solid #dc2626;
  padding: 0.55rem 1.25rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}
.btn-desktop-cancel:hover {
  background: #dc2626;
}

/* ============================================================================
   COMANDO 007 — MENU LATERAL COMPACTO, ORGANIZADO E INTELIGENTE
   Submenus recolhíveis (Accordion), Hover Flyout e acesso rápido ao PDV
   ============================================================================ */

:root {
  --sidebar-width: 235px;
  --sidebar-collapsed-width: 60px;
  --sidebar-item-height: 32px;
}

.sidebar {
  width: var(--sidebar-width);
  background: #0f172a;
  border-right: 1px solid #1e293b;
  display: flex;
  flex-direction: column;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-x: hidden;
  z-index: 1000;
  user-select: none;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.sidebar-header {
  padding: 0.65rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #1e293b;
  background: #090d16;
}

.sidebar-menu {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.4rem 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

/* Scrollbar fina para o menu lateral */
.sidebar-menu::-webkit-scrollbar {
  width: 4px;
}
.sidebar-menu::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-menu::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}

/* Botão de Destaque / Acesso Rápido ao PDV */
.sidebar-pdv-btn {
  background: linear-gradient(135deg, #1d4ed8 0%, #059669 100%);
  color: #ffffff !important;
  font-weight: 700 !important;
  padding: 0.5rem 0.65rem !important;
  border-radius: 6px !important;
  margin: 0.25rem 0.25rem 0.5rem 0.25rem;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.3);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.sidebar-pdv-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(5, 150, 105, 0.45);
}
.sidebar-pdv-btn .menu-item-icon {
  font-size: 1.15rem;
}

/* Grupo do Menu Lateral (Accordion) */
.menu-group {
  display: flex;
  flex-direction: column;
  border-radius: 6px;
  position: relative;
}

.menu-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.42rem 0.65rem;
  min-height: var(--sidebar-item-height);
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.menu-group-header:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
}

.menu-group-header.active-group {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
}

.menu-group-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  overflow: hidden;
  white-space: nowrap;
}

.menu-group-chevron {
  font-size: 0.6rem;
  color: #64748b;
  transition: transform 0.2s ease;
}

.menu-group.open .menu-group-chevron {
  transform: rotate(90deg);
  color: #38bdf8;
}

.menu-group-submenu {
  display: none;
  flex-direction: column;
  padding-left: 1.25rem;
  border-left: 2px solid #1e293b;
  margin-left: 1rem;
  margin-top: 0.15rem;
  margin-bottom: 0.25rem;
  gap: 0.1rem;
}

.menu-group.open .menu-group-submenu {
  display: flex;
}

/* Item individual do menu e submenu */
.menu-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.38rem 0.65rem;
  min-height: var(--sidebar-item-height);
  color: #cbd5e1;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 5px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.menu-item.active {
  background: #2563eb !important;
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.4);
}

.menu-item-icon {
  font-size: 0.95rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.menu-item-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Hover flutuante quando o menu lateral estiver recolhido (Collapsed Flyout) */
.sidebar.collapsed .menu-group-submenu {
  display: none;
}

.sidebar.collapsed .menu-group:hover .menu-group-submenu,
.sidebar.collapsed .menu-group.hovering .menu-group-submenu {
  display: flex !important;
  position: absolute;
  left: 58px;
  top: 0;
  width: 200px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  padding: 0.4rem;
  margin: 0;
  z-index: 1050;
}

.sidebar.collapsed .menu-group-chevron,
.sidebar.collapsed .menu-item-label,
.sidebar.collapsed .sidebar-header .logo-sub,
.sidebar.collapsed .sidebar-header .logo-text {
  display: none;
}

.sidebar.collapsed .menu-group-header {
  justify-content: center;
  padding: 0.45rem 0;
}
.sidebar.collapsed .menu-item {
  justify-content: center;
  padding: 0.45rem 0;
}
.sidebar.collapsed .menu-group:hover .menu-item {
  justify-content: flex-start;
  padding: 0.38rem 0.65rem;
}
.sidebar.collapsed .menu-group:hover .menu-item-label {
  display: inline;
}

/* Modais Desktop com Abas Numeradas e Estilo Corporativo */
.desktop-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.desktop-modal-window {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
  width: 100%;
  max-width: 980px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #cbd5e1;
}

.desktop-modal-titlebar {
  background: linear-gradient(180deg, #1e3a8a 0%, #0f2b5c 100%);
  color: #ffffff;
  padding: 0.5rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.desktop-modal-close-btn {
  background: #dc2626;
  border: none;
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
}
.desktop-modal-close-btn:hover {
  background: #b91c1c;
}

.desktop-tabs-bar {
  background: #f1f5f9;
  border-bottom: 2px solid #cbd5e1;
  padding: 0.35rem 0.65rem 0 0.65rem;
  display: flex;
  gap: 0.3rem;
  flex-shrink: 0;
  overflow-x: auto;
}

.desktop-tab-item {
  padding: 0.45rem 0.85rem;
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.desktop-tab-item:hover {
  background: #f8fafc;
  color: #1e40af;
}

.desktop-tab-item.active {
  background: #ffffff;
  border-color: #2563eb;
  color: #1d4ed8;
  border-bottom: 2px solid #ffffff;
  margin-bottom: -2px;
}

.desktop-modal-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  background: #ffffff;
}

.desktop-modal-footer {
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

/* ==========================================================================
   PDV TELA CHEIA (FULLSCREEN F11) E RETORNO COM ESC — CENTRAL GESTÃO ERP
   ========================================================================== */
body.pos-fullscreen-active {
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: #f1f5f9 !important;
}

body.pos-fullscreen-active .sidebar,
body.pos-fullscreen-active .sidebar-collapsed,
body.pos-fullscreen-active .top-nav,
body.pos-fullscreen-active .topbar,
body.pos-fullscreen-active .header,
body.pos-fullscreen-active header {
  display: none !important;
}

body.pos-fullscreen-active .app-container {
  padding: 0 !important;
  margin: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  overflow: hidden !important;
  display: block !important;
}

body.pos-fullscreen-active .main-content,
body.pos-fullscreen-active #page-content {
  margin: 0 !important;
  padding: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

body.pos-fullscreen-active .pos-supermarket-container {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 99999 !important;
  border-radius: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  display: flex !important;
  flex-direction: column !important;
  background: #f1f5f9 !important;
}

body.pos-fullscreen-active .pos-super-main {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: calc(100vh - 195px) !important;
  max-height: calc(100vh - 195px) !important;
  overflow: hidden !important;
}

body.pos-fullscreen-active .pos-super-table-wrap {
  flex: 1 1 auto !important;
  max-height: calc(100vh - 215px) !important;
  overflow-y: auto !important;
}

body.pos-fullscreen-active .pos-super-totals-col {
  height: calc(100vh - 195px) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow-y: auto !important;
}

body.pos-fullscreen-active .pos-super-bottom-bar {
  flex-shrink: 0 !important;
}

/* Dropdown de pesquisa de produtos pelo teclado */
.pos-search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 2px solid #2563eb;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  max-height: 220px;
  overflow-y: auto;
  z-index: 100000;
}
.pos-dropdown-item {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}
.pos-dropdown-item:hover, .pos-dropdown-item.active {
  background: #eff6ff;
  color: #1e3a8a;
  font-weight: 700;
  border-left: 4px solid #2563eb;
}

/* Modais de Fluxo de Teclado (Cliente, Vendedor, Pagamento) */
.pos-list-select-item {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  transition: background 0.1s ease;
}
.pos-list-select-item:hover, .pos-list-select-item.active-item {
  background: #eff6ff;
  color: #1e40af;
  font-weight: 700;
  border-left: 4px solid #2563eb;
}

.pos-pay-method-card {
  border: 2px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.75rem 0.5rem;
  text-align: center;
  cursor: pointer;
  background: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  color: #334155;
  transition: all 0.15s ease;
}
.pos-pay-method-card:hover, .pos-pay-method-card.active-method {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1e3a8a;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.15);
}

/* ============================================================================
   COMANDO 010: AJUSTE DO LAYOUT DO PDV — CARRINHO AMPLIADO E FAIXA CENTRALIZADA
   ============================================================================ */

/* Cabeçalho Compacto */
.pos-super-header {
  background: #003366;
  color: #ffffff;
  padding: 0.45rem 1rem !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.pos-super-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.15rem !important;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.pos-super-info {
  display: flex;
  gap: 1.25rem !important;
  font-size: 0.82rem !important;
  color: #e2e8f0;
}

/* Faixa de Produto, Quantidade e Adicionar Centralizada e Alinhada */
.pos-super-barcode-bar {
  background: #ffffff;
  padding: 0.45rem 1.25rem !important;
  border-bottom: 2px solid #e2e8f0;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 0.75rem !important;
  flex-shrink: 0;
}
.pos-barcode-field-group {
  flex: 0 1 540px !important;
  max-width: 560px !important;
  position: relative;
  display: flex;
  align-items: center;
}
.pos-super-barcode-input {
  width: 100%;
  font-size: 1.1rem !important;
  padding: 0.5rem 0.75rem !important;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  outline: none;
  font-weight: 700;
}
.pos-super-barcode-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.pos-qty-field-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.pos-qty-field-group label {
  font-weight: 800;
  color: #334155;
  font-size: 0.9rem;
}
.pos-super-qty-input {
  width: 85px !important;
  font-size: 1.15rem !important;
  padding: 0.5rem 0.4rem !important;
  text-align: center;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  font-weight: 800;
  outline: none;
}
.pos-super-qty-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.btn-pos-add-item {
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 0.55rem 1.15rem;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: background 0.15s ease;
}
.btn-pos-add-item:hover {
  background: #1d4ed8;
}

/* Faixa Superior Interativa de Cliente e Vendedor */
.pos-super-entity-bar {
  background: #f8fafc;
  padding: 0.35rem 1rem !important;
  border-bottom: 1px solid #cbd5e1;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 1.5rem !important;
  flex-shrink: 0;
}
.pos-entity-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}
.pos-entity-label {
  font-size: 0.85rem;
  font-weight: 800;
  color: #334155;
  white-space: nowrap;
}
.pos-entity-search-wrap {
  flex: 1;
  position: relative;
  max-width: 420px;
}
.pos-entity-input {
  width: 100%;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 5px;
  background: #ffffff;
  color: #1e293b;
  outline: none;
}
.pos-entity-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

/* Área Principal e Carrinho Ampliado para Visualizar Mais Produtos */
.pos-super-main {
  display: grid !important;
  grid-template-columns: 1fr 450px !important; /* Carrinho reduzido ~10% e área de pagamentos ampliada */
  background: #ffffff;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
}
body.pos-fullscreen-active .pos-super-main {
  height: calc(100vh - 185px) !important;
  max-height: calc(100vh - 185px) !important;
}
.pos-super-items-col {
  display: flex;
  flex: 1;
  min-height: 0;
  border-right: 2px solid #e2e8f0;
}
.pos-super-table-wrap {
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  max-height: none !important;
  height: 100% !important;
}
.pos-super-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.pos-super-table th {
  position: sticky;
  top: 0;
  background: #f1f5f9;
  color: #334155;
  font-weight: 800;
  padding: 0.5rem 0.65rem !important;
  border-bottom: 2px solid #cbd5e1;
  text-align: left;
  z-index: 10;
}
.pos-super-table td {
  padding: 0.45rem 0.65rem !important;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.88rem;
}
.pos-super-table tr:hover {
  background: #f8fafc;
}

/* Coluna de Totais */
.pos-super-totals-col {
  padding: 0.85rem 1rem !important;
  display: flex !important;
  flex-direction: column !important;
  background: #ffffff;
  overflow-y: auto;
  border-left: 1px solid #e2e8f0;
}
.pos-super-subtotal-row {
  display: flex;
  justify-content: space-between;
  font-size: 1rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 0.35rem;
}
.pos-super-grand-total-box {
  background: #1e3a8a;
  color: #ffffff;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  text-align: center;
  margin: 0.5rem 0 0.85rem 0;
  box-shadow: 0 4px 6px rgba(30, 58, 138, 0.2);
}
.pos-super-grand-total-label {
  font-size: 0.8rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #93c5fd;
  font-weight: 800;
}
.pos-super-grand-total-value {
  font-size: 2.2rem;
  font-weight: 900;
  color: #ffffff;
}

/* Barra Inferior de Ações */
.pos-super-bottom-bar {
  background: #f8fafc;
  padding: 0.45rem 1rem !important;
  border-top: 2px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-shrink: 0;
}
.btn-pos-action {
  background: #ffffff;
  color: #334155;
  border: 1.5px solid #cbd5e1;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}
.btn-pos-action:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}
.btn-pos-action.success {
  background: #059669;
  color: #ffffff;
  border-color: #059669;
}
.btn-pos-action.success:hover {
  background: #047857;
}

/* Caixa de Pré-Visualização de Comprovante Não Fiscal */
.pos-receipt-preview-box {
  background: #ffffff;
  color: #000000;
  font-family: 'Courier New', Courier, monospace;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  padding: 1.25rem 1rem;
  border: 1px dashed #64748b;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  font-size: 0.85rem;
  line-height: 1.35;
}

/* ==========================================================================
   CADASTROS V1.0.1 — PADRÃO VISUAL PROFISSIONAL, SEÇÕES LÓGICAS E RESPONSIVIDADE
   ========================================================================== */

.cadastro-form-container {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.cadastro-section {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.cadastro-section-header {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cadastro-section-badge {
  background: #2563eb;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cadastro-section-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.cadastro-section-subtitle {
  font-size: 0.8rem;
  color: #64748b;
  margin-left: auto;
}

.cadastro-section-body {
  padding: 1rem;
}

.cadastro-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.cadastro-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.85rem;
}

.cadastro-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
}

.cadastro-grid-row {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

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

.cadastro-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
  min-width: 170px;
}

.cadastro-field.flex-1 { flex: 1; }
.cadastro-field.flex-2 { flex: 2; }
.cadastro-field.flex-3 { flex: 3; }
.cadastro-field.w-sm { flex: 0 0 110px; }
.cadastro-field.w-md { flex: 0 0 180px; }
.cadastro-field.w-lg { flex: 0 0 240px; }

.cadastro-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.cadastro-label .required {
  color: #ef4444;
  font-weight: bold;
}

.cadastro-input,
.cadastro-select,
.cadastro-textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background-color: #ffffff;
  color: #1e293b;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.cadastro-input:focus,
.cadastro-select:focus,
.cadastro-textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.cadastro-input[readonly] {
  background-color: #f1f5f9;
  cursor: not-allowed;
  color: #64748b;
}

.cadastro-actions-bar {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
  margin-top: 0.5rem;
}

.aux-tabs-container {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 1.25rem;
}

.aux-tab-button {
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: #64748b;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.aux-tab-button:hover {
  color: #2563eb;
  background: #f8fafc;
}

.aux-tab-button.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
  background: #eff6ff;
}

.aux-tab-badge {
  background: #e2e8f0;
  color: #475569;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 12px;
}

.aux-tab-button.active .aux-tab-badge {
  background: #2563eb;
  color: #ffffff;
}

@media (max-width: 768px) {
  .cadastro-grid-2,
  .cadastro-grid-3,
  .cadastro-grid-4 {
    grid-template-columns: 1fr;
  }
  .cadastro-field {
    min-width: 100%;
  }
}

/* ==========================================================================
   BADGES DE CONECTIVIDADE E CONTINGÊNCIA OFFLINE PARA PDV NO NOTEBOOK
   ========================================================================== */

.pos-network-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.8rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: default;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  line-height: 1;
}

.pos-network-badge.online {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

.pos-network-badge.offline {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
  animation: pulse-offline-border 2s infinite;
}

.pos-network-badge.sync-pending {
  background: #fffbeb;
  color: #92400e;
  border-color: #fde68a;
  cursor: pointer;
}

.pos-network-badge.sync-pending:hover {
  background: #fef3c7;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.pos-network-badge.syncing {
  background: #eff6ff;
  color: #1e40af;
  border-color: #bfdbfe;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.pulse-dot.green { background: #10b981; box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25); }
.pulse-dot.yellow { background: #f59e0b; box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25); }
.pulse-dot.red { background: #ef4444; box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25); }

@keyframes pulse-offline-border {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Badges e Tags de Status Modernas */
.badge-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.badge-warning { background: #fef9c3; color: #a16207; border: 1px solid #fef08a; }
.badge-danger { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.badge-info { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.badge-secondary { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }

.badge {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

/* ============================================================================
   PADRONIZAÇÃO GLOBAL DOS MODAIS E QUADROS DE CADASTRO (ESTILO ERP CLÁSSICO)
   Garante alinhamento milimétrico e impede que qualquer campo saia do quadro
   ============================================================================ */

.modal-content {
  max-width: 960px !important;
  width: 96vw !important;
  max-height: 92vh !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  box-sizing: border-box !important;
  border-radius: 8px !important;
  border: 1px solid #94a3b8 !important;
}

.modal-header {
  background: linear-gradient(180deg, #4b6cb7 0%, #182848 100%) !important;
  color: #ffffff !important;
  padding: 0.65rem 1.15rem !important;
  border-bottom: 1px solid #1e293b !important;
}

.modal-title {
  color: #ffffff !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em;
}

.modal-close-btn {
  background: #dc2626 !important;
  color: #ffffff !important;
  border: 1px solid #b91c1c !important;
  border-radius: 4px !important;
  width: 30px !important;
  height: 24px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  cursor: pointer !important;
}

.modal-close-btn:hover {
  background: #b91c1c !important;
}

.modal-body {
  padding: 0.85rem !important;
  background: #e8eff7 !important;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
}

/* Blindagem universal contra overflow horizontal em grids e fieldsets */
.modal-body *,
.erp-window *,
.desktop-window-container *,
.cadastro-form-container * {
  box-sizing: border-box !important;
}

.modal-body fieldset,
.erp-fieldset,
.desktop-fieldset,
.cadastro-section {
  min-width: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
  border: 1px solid #b0c4de !important;
  border-radius: 6px !important;
  background: #f4f8fc !important;
  padding: 0.65rem 0.75rem 0.75rem 0.75rem !important;
  margin: 0 0 0.65rem 0 !important;
}

.erp-legend,
.desktop-legend {
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  color: #1e3a8a !important;
  padding: 0 0.45rem !important;
  background: transparent !important;
  width: auto !important;
  margin-bottom: 0 !important;
}

/* Abas estilo ERP das capturas de tela */
.erp-tabs-bar,
.desktop-tabs-header,
.desktop-tabs-bar {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 0.25rem !important;
  background: #d8e4f0 !important;
  padding: 0.35rem 0.5rem 0 0.5rem !important;
  border: 1px solid #b0c4de !important;
  border-bottom: none !important;
  border-radius: 6px 6px 0 0 !important;
}

.erp-tab-btn,
.desktop-tab-btn,
.desktop-tab-item {
  padding: 0.42rem 0.9rem !important;
  background: #e2ecf5 !important;
  border: 1px solid #b0c4de !important;
  border-bottom: none !important;
  border-radius: 5px 5px 0 0 !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  color: #334155 !important;
  cursor: pointer !important;
  transition: all 0.12s ease !important;
}

.erp-tab-btn:hover,
.desktop-tab-btn:hover,
.desktop-tab-item:hover {
  background: #f1f5f9 !important;
  color: #1d4ed8 !important;
}

.erp-tab-btn.active,
.desktop-tab-btn.active,
.desktop-tab-item.active {
  background: #f4f8fc !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
  border-bottom: 2px solid #f4f8fc !important;
  margin-bottom: -1px !important;
  box-shadow: 0 -2px 0 #2563eb inset !important;
}

.erp-tab-panel,
.desktop-window-body,
.desktop-modal-content {
  background: #eaf1f8 !important;
  border: 1px solid #b0c4de !important;
  border-radius: 0 0 6px 6px !important;
  padding: 0.85rem !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
}

/* Grids alinhados que nunca saem do quadro */
.erp-row-grid,
.modal-body div[style*="display: grid"],
.modal-body div[style*="display:grid"] {
  display: grid !important;
  gap: 0.5rem !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin-bottom: 0.5rem !important;
  align-items: end !important;
}

.erp-row-grid > *,
.modal-body div[style*="display: grid"] > *,
.modal-body div[style*="display:grid"] > * {
  min-width: 0 !important;
  max-width: 100% !important;
}

.modal-body label,
.erp-label,
.cadastro-label {
  display: block !important;
  font-size: 0.74rem !important;
  font-weight: 600 !important;
  color: #1e293b !important;
  margin-bottom: 0.2rem !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.modal-body input:not([type="checkbox"]):not([type="radio"]),
.modal-body select,
.modal-body textarea,
.erp-input,
.erp-select {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: 31px !important;
  padding: 0.25rem 0.5rem !important;
  font-size: 0.81rem !important;
  color: #0f172a !important;
  background-color: #ffffff !important;
  border: 1px solid #94a3b8 !important;
  border-radius: 4px !important;
  box-sizing: border-box !important;
}

.modal-body textarea {
  height: auto !important;
  min-height: 68px !important;
  padding: 0.45rem 0.6rem !important;
}

.modal-body input:focus,
.modal-body select:focus,
.modal-body textarea:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2) !important;
  outline: none !important;
}

.modal-body input[readonly] {
  background-color: #e2e8f0 !important;
  color: #475569 !important;
}

/* Rodapé estilo ERP das capturas (Gravar à esquerda, Cancelar à direita) */
.erp-modal-footer,
.desktop-footer-bar,
.modal-body .modal-footer,
.cadastro-actions-bar {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  background: #dce6f2 !important;
  border: 1px solid #b0c4de !important;
  border-radius: 6px !important;
  padding: 0.55rem 0.85rem !important;
  margin: 0.65rem 0 0 0 !important;
  gap: 0.75rem !important;
}

.btn-erp-gravar,
.btn-desktop-save {
  background: linear-gradient(180deg, #4b8bbe 0%, #2b5b84 100%) !important;
  color: #ffffff !important;
  border: 1px solid #1e3a8a !important;
  border-radius: 5px !important;
  padding: 0.45rem 1.15rem !important;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.4rem !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15) !important;
}

.btn-erp-gravar:hover,
.btn-desktop-save:hover {
  background: linear-gradient(180deg, #3b76a6 0%, #1e4263 100%) !important;
}

.btn-erp-cancelar,
.btn-desktop-cancel {
  background: linear-gradient(180deg, #5a82a6 0%, #365878 100%) !important;
  color: #ffffff !important;
  border: 1px solid #1e3a8a !important;
  border-radius: 5px !important;
  padding: 0.45rem 1.15rem !important;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.4rem !important;
}

.btn-erp-cancelar:hover,
.btn-desktop-cancel:hover {
  background: linear-gradient(180deg, #dc2626 0%, #991b1b 100%) !important;
  border-color: #7f1d1d !important;
}

@media (max-width: 820px) {
  .modal-body div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
}

/* Correção pontual dos campos inseridos dentro de labels nos modais.
   Mantém o visual ERP existente, evita cortar controles pelo overflow/ellipsis.
   Não altera a aparência dos rótulos simples ou do menu. */
.modal-body label:has(input),
.modal-body label:has(select),
.modal-body label:has(textarea) {
  overflow: visible !important;
  white-space: normal !important;
  text-overflow: clip !important;
}


/* Lista de produtos: preserva a tabela original e alinha as cinco ações */
.product-compact-row{cursor:default}
.product-compact-row:hover td{background-color:#f6faff}
.product-compact-row td:nth-child(1),.product-compact-row td:nth-child(2){cursor:pointer}
.product-actions-cell{white-space:nowrap;text-align:right;vertical-align:middle}
.product-compact-actions{display:flex;flex-flow:row nowrap;align-items:center;justify-content:flex-end;gap:3px;min-width:202px}
.product-compact-actions .btn{display:inline-flex;align-items:center;justify-content:center;min-width:30px;width:31px;height:32px;padding:3px;border-radius:5px;font-size:13px;line-height:1;flex:none}
.product-editor-tabs{margin-bottom:.75rem;gap:0;overflow-x:auto;scrollbar-width:thin}
.product-editor-tabs .modal-tab-btn{padding:.50rem .60rem;font-size:.76rem}
.product-editor-pane{min-height:180px}
.product-editor-readonly td{padding:7px 9px;font-size:.82rem}
.product-editor-modal .form-grid{gap:.65rem}
.product-editor-modal .form-group{margin-bottom:.35rem}
.product-editor-modal .form-label{font-size:.77rem}
.product-editor-modal .modal-footer{margin-top:0 !important}
@media(max-width:750px){.product-compact-actions .btn{width:28px;min-width:28px}}


/* Cadastros gerenciais: larguras previsíveis e ações numa linha. */
.cg-finance-header {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.25rem;
}
.cg-finance-header > div:first-child { flex: 1 1 320px; min-width: 0; }
.cg-finance-header > div:last-child { flex: 0 0 auto; }
.cg-finance-scroll {
  width: 100%; max-width: 100%;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.cg-finance-table {
  width: 100% !important;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: .83rem;
}
.cg-finance-table thead tr { height: 52px; background: #f8fafc; }
.cg-finance-table tbody tr { height: 62px; }
.cg-finance-table th,
.cg-finance-table td {
  padding: .68rem .7rem !important;
  vertical-align: middle !important;
  box-sizing: border-box;
  line-height: 1.35;
}
.cg-finance-table th {
  color: #334155;
  font-weight: 700;
  white-space: nowrap;
}
.cg-finance-table td { overflow-wrap: break-word; }
.cg-finance-table td .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 27px;
  padding: 3px 9px;
  border-radius: 6px;
  white-space: nowrap;
  vertical-align: middle;
}
.cg-finance-table th:last-child,
.cg-finance-table td:last-child { text-align: right; }
.cg-finance-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  width: 100%;
}
.cg-finance-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  height: 34px;
  min-width: 83px;
  margin: 0;
  padding: 0 9px !important;
  border-radius: 7px;
  font-size: .77rem;
  font-weight: 600;
  line-height: 1.15;
  white-space: nowrap;
  box-sizing: border-box;
}
.cg-finance-actions .btn:nth-child(2) { min-width: 91px; }
.cg-finance-actions .btn:nth-child(3) { min-width: 83px; }

/* Formas de pagamento: sem empilhar os 3 botões. */
.cg-finance-table--payments { min-width: 1550px; }
.cg-finance-table--payments th:nth-child(1) { width: 10%; }
.cg-finance-table--payments th:nth-child(2) { width: 16%; }
.cg-finance-table--payments th:nth-child(3) { width: 10%; }
.cg-finance-table--payments th:nth-child(4) { width: 11%; }
.cg-finance-table--payments th:nth-child(5) { width: 9%; }
.cg-finance-table--payments th:nth-child(6) { width: 9%; }
.cg-finance-table--payments th:nth-child(7) { width: 9%; }
.cg-finance-table--payments th:nth-child(8) { width: 6%; }
.cg-finance-table--payments th:nth-child(9) { width: 20%; }
.cg-finance-table--payments td:nth-child(1),
.cg-finance-table--payments td:nth-child(3),
.cg-finance-table--payments td:nth-child(5),
.cg-finance-table--payments td:nth-child(6),
.cg-finance-table--payments td:nth-child(8) { white-space: nowrap; }

/* Condições de pagamento. */
.cg-finance-table--terms { min-width: 1280px; }
.cg-finance-table--terms th:nth-child(1) { width: 9%; }
.cg-finance-table--terms th:nth-child(2) { width: 20%; }
.cg-finance-table--terms th:nth-child(3) { width: 10%; }
.cg-finance-table--terms th:nth-child(4) { width: 12%; }
.cg-finance-table--terms th:nth-child(5) { width: 9%; }
.cg-finance-table--terms th:nth-child(6) { width: 9%; }
.cg-finance-table--terms th:nth-child(7) { width: 6%; }
.cg-finance-table--terms th:nth-child(8) { width: 25%; }

/* Plano de contas. */
.cg-finance-table--chart { min-width: 1170px; }
.cg-finance-table--chart th:nth-child(1) { width: 14%; }
.cg-finance-table--chart th:nth-child(2) { width: 24%; }
.cg-finance-table--chart th:nth-child(3) { width: 12%; }
.cg-finance-table--chart th:nth-child(4) { width: 17%; }
.cg-finance-table--chart th:nth-child(5) { width: 8%; }
.cg-finance-table--chart th:nth-child(6) { width: 25%; }

/* Centros de custo: mantém o alinhamento da referência. */
.cg-finance-table--centers { min-width: 1000px; }
.cg-finance-table--centers th:nth-child(1) { width: 13%; }
.cg-finance-table--centers th:nth-child(2) { width: 44%; }
.cg-finance-table--centers th:nth-child(3) { width: 13%; }
.cg-finance-table--centers th:nth-child(4) { width: 30%; }

@media (max-width: 768px) {
  .cg-finance-header .btn { width: 100%; }
  .cg-finance-header > div:last-child { width: 100%; }
  .cg-finance-table th,
  .cg-finance-table td { padding: .55rem .6rem !important; }
}


/* Comercial & Vendas — barras de ações com rolagem horizontal segura */
#tab-orders .data-table-container, #tab-quotes .data-table-container,
#tab-salespeople .data-table-container, #tab-prices .data-table-container,
#tab-pos-sales .data-table-container, #returns-table-container {
  overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch;
}
#tab-orders .data-table, #tab-quotes .data-table, #tab-salespeople .data-table,
#tab-prices .data-table, #tab-pos-sales .data-table { min-width: 1080px; }
#tab-orders td:last-child, #tab-quotes td:last-child, #tab-salespeople td:last-child,
#tab-prices td:last-child, #tab-pos-sales td:last-child { white-space:nowrap; text-align:right; }
#tab-orders td:last-child .btn, #tab-quotes td:last-child .btn,
#tab-salespeople td:last-child .btn, #tab-prices td:last-child .btn,
#tab-pos-sales td:last-child .btn { margin:2px 3px; min-height:30px; }
@media(max-width:850px) {
  #tab-orders, #tab-quotes, #tab-salespeople, #tab-prices { max-width:100%; }
}

#presales-table-container {max-width:100%;overflow-x:auto;}
#presales-table-container table {min-width:920px;}
#presales-table-container td:last-child {white-space:nowrap;text-align:right;}

/* Agenda do Dia - layout horizontal com alinhamento v20261017 */
.agenda-do-dia-window { width:100%; min-width:0; background:#f8fafc; color:#26374d; }
.agenda-do-dia-window .agenda-header {min-height:55px; padding:10px 16px !important; gap:10px !important;}
.agenda-do-dia-window .agenda-header > div:first-child {min-width:0;}
.agenda-do-dia-window .agenda-header > div:last-child {flex-shrink:0; gap:12px !important;}
.agenda-do-dia-window .agenda-header label,
.agenda-do-dia-window .agenda-header label span {color:#f1f5f9 !important; white-space:normal !important; overflow:visible !important; text-overflow:clip !important;}
.agenda-do-dia-window .agenda-header input[type=checkbox] {width:15px !important; height:15px !important; flex:0 0 auto; accent-color:#3b82f6;}
.agenda-do-dia-window .agenda-nav {display:flex; align-items:stretch; min-width:0; width:100%; background:#d8e4f0; border-bottom:1px solid #b0c4de;}
.agenda-do-dia-window .agenda-tabs-scroll {flex:1 1 auto; min-width:0; overflow-x:auto; overflow-y:hidden; scrollbar-color:#97accb #d8e4f0; scrollbar-width:thin; overscroll-behavior-x:contain;}
.agenda-do-dia-window .agenda-tabs-scroll::-webkit-scrollbar {height:7px;}
.agenda-do-dia-window .agenda-tabs-scroll::-webkit-scrollbar-thumb {background:#97accb; border-radius:6px;}
.agenda-do-dia-window .erp-tabs-bar.agenda-tabs-track {display:flex !important; flex-wrap:nowrap !important; width:max-content !important; min-width:100% !important; box-sizing:border-box !important; margin:0 !important; padding:6px 8px 0 !important; gap:5px !important; border:0 !important; background:transparent !important; align-items:stretch !important;}
.agenda-do-dia-window .agenda-tabs-track[data-align="left"] {justify-content:flex-start !important;}
.agenda-do-dia-window .agenda-tabs-track[data-align="center"] {justify-content:center !important;}
.agenda-do-dia-window .agenda-tabs-track[data-align="right"] {justify-content:flex-end !important;}
.agenda-do-dia-window .agenda-tabs-track .erp-tab-btn {display:inline-flex !important; flex:0 0 auto !important; align-items:center !important; gap:5px; padding:9px 11px !important; min-height:42px; border-radius:6px 6px 0 0 !important; white-space:nowrap !important; line-height:1.2 !important; margin:0 !important;}
.agenda-do-dia-window .agenda-tabs-track .erp-tab-btn.active {border-bottom:2px solid #2563eb !important; box-shadow:0 -2px 0 #2563eb inset !important;}
.agenda-do-dia-window .agenda-tabs-track .badge {margin-left:2px !important; flex-shrink:0;}
.agenda-do-dia-window .agenda-nav-actions {display:flex; flex:0 0 auto; align-items:center; gap:4px; padding:5px 7px; border-left:1px solid #b0c4de; background:#eaf1f8;}
.agenda-do-dia-window .agenda-nav-actions button {width:29px; height:34px; padding:0; border:1px solid #b0c4de; border-radius:5px; background:white; color:#1e3a8a; font-size:22px; cursor:pointer;}
.agenda-do-dia-window .agenda-nav-actions button:hover {background:#dbeafe;}
.agenda-do-dia-window .agenda-align-select,.modal-body .agenda-do-dia-window .agenda-align-select {width:95px !important; min-width:95px !important; max-width:95px !important; height:34px !important; padding:3px 5px !important; font-size:12px !important; color:#1e3a8a !important; background:white !important; border:1px solid #b0c4de !important; border-radius:5px !important;}
.agenda-do-dia-window .erp-tab-panel {padding:16px !important; background:#f8fafc !important; min-height:165px;}
.agenda-do-dia-window .agenda-pane-heading,
.agenda-do-dia-window .agenda-pane-info {display:flex !important; flex-wrap:wrap !important; align-items:center !important; gap:10px 15px !important;}
.agenda-do-dia-window .agenda-pane-heading > div:first-child,
.agenda-do-dia-window .agenda-pane-info > span:first-child {flex:1 1 390px; min-width:0;}
.agenda-do-dia-window .agenda-pane-heading > .btn {flex:0 0 auto; max-width:265px; white-space:normal;}
.agenda-do-dia-window .agenda-pane-info > a {flex:0 1 360px; min-width:0; overflow-wrap:anywhere;}
.agenda-do-dia-window .agenda-stock-kpis {grid-template-columns:minmax(155px,1fr) minmax(180px,1fr) minmax(275px,2fr) !important; align-items:stretch !important; gap:12px !important;}
.agenda-do-dia-window .agenda-stock-kpis > div:last-child {display:flex !important; flex-wrap:wrap; gap:10px;}
.agenda-do-dia-window .agenda-stock-kpis > div:last-child > div {flex:1 1 170px; min-width:0;}
.agenda-do-dia-window .agenda-banks {gap:12px !important;}
.agenda-do-dia-window .agenda-banks > div:first-child {flex:1 1 530px; min-width:0;}
.agenda-do-dia-window .agenda-banks > div:last-child {flex-wrap:wrap;}
.modal-body .agenda-do-dia-window div.agenda-payments,
.agenda-do-dia-window div.agenda-payments {display:grid !important; grid-template-columns:minmax(0,1fr) !important; align-items:start !important; gap:16px !important;}
.agenda-do-dia-window .agenda-payments > div {min-width:0 !important; align-self:start !important;}
.agenda-do-dia-window .agenda-payments > div > div:first-child {display:flex !important; flex-wrap:wrap !important; align-items:center !important; gap:10px !important; min-height:35px;}
.agenda-do-dia-window .table-responsive {width:100%; max-width:100%; min-width:0; overflow-x:auto !important; overflow-y:hidden;}
.agenda-do-dia-window .data-table {width:100%; border-collapse:collapse;}
.agenda-do-dia-window .data-table th,.agenda-do-dia-window .data-table td {padding:12px 10px; vertical-align:middle; line-height:1.35;}
.agenda-do-dia-window .data-table .btn {white-space:normal; text-align:center;}
.agenda-dialog .erp-modal-footer {display:flex !important; flex-wrap:wrap !important; justify-content:space-between !important; align-items:center !important; gap:12px !important; padding:12px 18px !important; margin:0 !important;}
.agenda-dialog .erp-modal-footer > span {flex:1 1 300px;}
@media(max-width:850px) {
 .agenda-do-dia-window .agenda-stock-kpis {grid-template-columns:repeat(2,minmax(0,1fr)) !important;}
 .agenda-do-dia-window .agenda-stock-kpis > div:last-child {grid-column:1/-1;}
}
@media(max-width:620px) {
 .agenda-do-dia-window .agenda-header > div:first-child {flex:1 1 100%;}
 .agenda-do-dia-window .agenda-header > div:last-child {flex:1 1 100%; justify-content:space-between;}
 .agenda-do-dia-window .agenda-nav-actions {padding:3px; gap:2px;}
 .agenda-do-dia-window .agenda-align-select,.modal-body .agenda-do-dia-window .agenda-align-select {width:78px !important; min-width:78px !important; max-width:78px !important;}
 .agenda-do-dia-window .erp-tab-panel {padding:10px !important;}
 .agenda-do-dia-window .agenda-stock-kpis {grid-template-columns:minmax(0,1fr) !important;}
 .agenda-do-dia-window .agenda-stock-kpis > div:last-child {grid-column:auto;}
 .agenda-do-dia-window .agenda-pane-heading > .btn {width:100%; max-width:none;}
}

/* Dashboard company identity auto */
.dashboard-company-header {flex-wrap:wrap !important; gap:14px !important; align-items:center !important;}
.dashboard-company-header > div:first-child {flex:1 1 480px; min-width:0;}
.dashboard-company-eyebrow {font-size:.68rem; font-weight:800; color:#476083; letter-spacing:.08em; margin-bottom:4px;}
.dashboard-company-title {display:block !important; font-size:clamp(1.15rem,1.8vw,1.65rem) !important; line-height:1.3 !important; overflow-wrap:anywhere;}
.dashboard-company-subtitle {color:#526580 !important; font-size:.84rem !important; line-height:1.5 !important; overflow-wrap:anywhere;}
@media(max-width:650px){.dashboard-company-header>div{width:100%;}}

/* Operação: atalhos abaixo dos indicadores, quatro por linha no desktop. */
.dashboard-operation-card { margin-top: 1rem; }
.dashboard-operation-shortcuts { display: grid !important; grid-template-columns:repeat(4,minmax(0,1fr)); gap: .75rem; align-items:stretch; }
.dashboard-operation-shortcuts .btn { width:100%; min-width:0; min-height:44px; white-space:normal; justify-content:center; text-align:center; }
@media(max-width:1120px){.dashboard-operation-shortcuts{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:620px){.dashboard-operation-shortcuts{grid-template-columns:minmax(0,1fr);}}


/* Alinhamento exclusivo dos filtros da Curva ABC. */
.abc-controls-layout { display:flex; align-items:flex-end; flex-wrap:wrap; gap:.875rem; width:100%; }
.abc-controls-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:end; gap:.875rem; flex:1 1 580px; min-width:0; }
.abc-control-group { display:flex; flex-direction:column; justify-content:flex-end; gap:6px; min-width:0; }
.abc-control-label { display:block; min-height:1.2rem; margin:0; font-size:.72rem; font-weight:700; color:#1e3a8a; line-height:1.35; }
.abc-control-select.form-control { box-sizing:border-box; display:block; width:100%; max-width:100%; min-width:0; height:38px; min-height:38px; font-size:.8rem; }
.abc-controls-action { flex:0 0 auto; align-self:flex-end; }
@media(max-width:680px) {
 .abc-controls-fields { grid-template-columns:minmax(0,1fr); flex-basis:100%; }
 .abc-control-label { min-height:0; }
}

/* Painel das sessões de caixa — padrão visual Central Gestão ERP */
.cash-session-dashboard{background:#fff;border:1px solid #e2e8f0;border-radius:10px;padding:20px!important}
.cash-session-dashboard-heading,.cash-session-top,.cash-session-movement-title{display:flex;align-items:center;justify-content:space-between;gap:14px}
.cash-session-dashboard-heading h3{font-size:1.12rem;font-weight:750;color:#142440;margin:0}
.cash-session-dashboard-heading p,.cash-session-top p{color:#64748b;font-size:.82rem;margin:5px 0 0}
.cash-session-count{font-size:.77rem;background:#eef3fb;color:#24529b;border-radius:20px;padding:6px 11px;font-weight:650}
.cash-session-card{background:#fff;border:1px solid #dce4ef;border-radius:10px;margin-top:16px;padding:18px;box-shadow:0 2px 5px #14244008}
.cash-session-top{border-bottom:1px solid #e6ecf4;padding-bottom:14px;margin-bottom:16px}
.cash-session-top h4{font-weight:750;font-size:1.05rem;color:#142440;margin:0}
.cash-session-open{font-size:.77rem;font-weight:700;color:#047857;background:#ecfdf5;border:1px solid #bbf7d0;border-radius:20px;padding:6px 11px;white-space:nowrap}
.cash-session-stats{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px}
.cash-session-stat{background:#f8fafd;border:1px solid #e2e8f0;border-radius:8px;padding:13px;min-width:0}
.cash-session-stat span,.cash-session-method span{display:block;color:#64748b;font-size:.78rem;margin-bottom:7px}
.cash-session-stat strong{display:block;color:#142440;font-size:1.15rem;overflow-wrap:anywhere}
.cash-session-stat:last-child{border-color:#bfd3fb;background:#f0f5ff}
.cash-session-stat:last-child strong{color:#2457bd}
.cash-session-card h5{font-size:.9rem;color:#203551;margin:19px 0 10px;font-weight:750}
.cash-session-methods{display:flex;gap:10px;flex-wrap:wrap}
.cash-session-method{background:#fff;border:1px solid #dfe7f0;border-radius:7px;padding:10px 14px;min-width:150px}
.cash-session-method strong{color:#203551;font-size:1rem}
.cash-session-movement-title{margin-top:18px}
.cash-session-movement-title h5{margin:0 0 10px}
.cash-session-movement-title>span,.cash-session-muted{font-size:.78rem;color:#64748b}
.cash-session-table{border:1px solid #e2e8f0;border-radius:8px;overflow-x:auto}
.cash-session-table table{width:100%;margin:0}
.cash-session-table thead th{background:#f3f6fa;color:#344663;font-size:.78rem}
.cash-session-table tbody tr:nth-child(even){background:#fafcff}
.cash-session-table td,.cash-session-table th{padding:11px 13px}
.cash-session-money{text-align:right!important;font-variant-numeric:tabular-nums;white-space:nowrap}
.cash-session-type{font-weight:650;color:#24529b;font-size:.77rem}
.cash-session-note{font-size:.78rem;color:#64748b;border-top:1px solid #edf1f6;margin:14px 0 0;padding-top:12px}
.cash-session-error{color:#b91c1c}
@media(max-width:1050px){.cash-session-stats{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:650px){.cash-session-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.cash-session-top,.cash-session-dashboard-heading{align-items:flex-start;flex-direction:column}.cash-session-card{padding:12px}.cash-session-stat strong{font-size:1rem}}

/* Controles realmente desabilitados e confirmação pendente do servidor */
button:disabled,.btn:disabled,input[type="submit"]:disabled {
 opacity:.58 !important; cursor:not-allowed !important;filter:grayscale(.35);
}
button[aria-busy="true"],.btn[aria-busy="true"]{cursor:progress !important;}

/* PDV: errors and sale confirmations stay visible above the fullscreen cashier. */
body.pos-fullscreen-active .toast-container { z-index: 300000 !important; }


/* FINANCEIRO 2026-10-20 — tabelas sempre contidas no painel */
#tab-rec, #tab-pay { width:100%; max-width:100%; min-width:0; overflow:hidden; box-sizing:border-box; }
#tab-rec .card, #tab-pay .card,
#tab-rec .card-body, #tab-pay .card-body {width:100%; max-width:100%; min-width:0; box-sizing:border-box;}
#tab-rec .finance-titles-scroll, #tab-pay .finance-titles-scroll {
  display:block; width:100%; max-width:100%; min-width:0; overflow-x:auto; overflow-y:visible;
  box-sizing:border-box; overscroll-behavior-x:contain; -webkit-overflow-scrolling:touch;
}
#tab-rec .finance-titles-scroll > .data-table,
#tab-pay .finance-titles-scroll > .data-table {
  width:100%; min-width:1080px; border-collapse:collapse; table-layout:auto;
}
#tab-rec .data-table td, #tab-pay .data-table td {vertical-align:middle;}
#tab-rec .data-table td:first-child, #tab-pay .data-table td:first-child {font-variant-numeric:tabular-nums; font-weight:700;}
#tab-rec .finance-actions-cell, #tab-pay .finance-actions-cell {
  min-width:185px; max-width:270px; white-space:normal; text-align:right;
}
#tab-rec .finance-actions-cell .btn, #tab-pay .finance-actions-cell .btn {
  margin:2px 1px; padding:.35rem .48rem; white-space:nowrap; font-size:.76rem;
}
#page-content:has(#tab-rec) {width:100%; max-width:100%; min-width:0; overflow-x:hidden;}
#page-content:has(#tab-rec) .tab-nav {max-width:100%; min-width:0; overflow-x:auto; flex-wrap:wrap;}
@media(max-width:800px) {
 #tab-rec .finance-titles-scroll > .data-table,#tab-pay .finance-titles-scroll > .data-table {min-width:980px;}
 #tab-rec .finance-actions-cell,#tab-pay .finance-actions-cell {min-width:175px;}
}

/* v144: clique fora da janela não fecha; só um aviso visual de que é preciso usar Fechar/Cancelar/Salvar */
@keyframes cgModalHold{0%,100%{transform:none}25%{transform:scale(1.012)}60%{transform:scale(.996)}}
.modal-content.modal-hold{animation:cgModalHold .28s ease}
