/* ==========================================================================
   Panifício - Gestão de Panificadoras - Modern Design System & Styling
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

:root,
[data-theme="light"] {
  /* Color Palette - Warm Bakery & Luxury Gold Theme (Light Default) */
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: rgba(254, 243, 199, 0.45);
  --bg-subtle: #f1f5f9;
  --bg-subtle-accent: rgba(245, 158, 11, 0.08);
  --border-card: #e2e8f0;
  --border-card-hover: rgba(245, 158, 11, 0.45);

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #334155;

  --accent-amber: #f59e0b;
  --accent-gold: #d97706;
  --accent-gold-light: #fef3c7;
  --accent-rose: #ec4899;
  --accent-emerald: #10b981;
  --accent-emerald-dark: #059669;
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;

  --pdv-bg: #ffffff;
  --pdv-cart-bg: #f8fafc;
  --pdv-touch-btn: #f1f5f9;
  --pdv-touch-btn-hover: #e2e8f0;

  --card-gradient: linear-gradient(135deg, #ffffff, #f8fafc);
  --card-gradient-highlight: linear-gradient(135deg, rgba(254, 243, 199, 0.35), #ffffff);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --glass-backdrop: none;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
}

[data-theme="dark"] {
  /* Dark Theme */
  --bg-main: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.85);
  --bg-card-hover: rgba(51, 65, 85, 0.9);
  --bg-subtle: rgba(15, 23, 42, 0.6);
  --bg-subtle-accent: rgba(15, 23, 42, 0.8);
  --border-card: rgba(255, 255, 255, 0.1);
  --border-card-hover: rgba(245, 158, 11, 0.4);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-light: #cbd5e1;

  --pdv-bg: #1e293b;
  --pdv-cart-bg: #0f172a;
  --pdv-touch-btn: #334155;
  --pdv-touch-btn-hover: #475569;

  --card-gradient: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
  --card-gradient-highlight: linear-gradient(135deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.95));

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
}

html, body, .main-wrapper, .sidebar, * {
  scroll-behavior: auto !important;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.2s ease, color 0.2s ease;
  -webkit-overflow-scrolling: touch;
}

input, select, textarea {
  color: var(--text-main);
  background-color: var(--bg-card);
  border-color: var(--border-card);
}

table th {
  color: var(--text-muted);
}

table td {
  color: var(--text-main);
}

/* Base App Shell */
.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

/* Sidebar Navigation */
.sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border-card);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  z-index: 20;
  height: 100vh;
  overflow-y: auto;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-card);
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-amber), var(--accent-gold));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.brand-title h1 {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}

.brand-title span {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.nav-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--border-card);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.2));
  color: var(--accent-amber);
  border-color: rgba(245, 158, 11, 0.4);
  font-weight: 600;
}

.role-badge-nav {
  margin-left: auto;
  font-size: 0.65rem;
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-amber);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.nav-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.nav-icon {
  font-size: 1.2rem;
}

/* Submenu Dropdown no Hover (Cadastros) */
.nav-item-dropdown {
  position: relative;
  display: flex;
  flex-direction: column;
}

.nav-submenu {
  display: none;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.4rem 0.5rem 0.5rem 1.4rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  margin-top: 0.2rem;
  border-left: 3px solid var(--accent-amber);
  animation: fadeInSubmenu 0.2s ease-in-out;
}

.nav-item-dropdown:hover .nav-submenu,
.nav-item-dropdown.open .nav-submenu {
  display: flex;
}

.nav-item-dropdown:hover .dropdown-chevron,
.nav-item-dropdown.open .dropdown-chevron {
  transform: rotate(180deg);
}

.nav-subitem {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.nav-subitem:hover {
  background: var(--bg-card-hover);
  color: var(--accent-amber);
  border-color: rgba(245, 158, 11, 0.3);
  padding-left: 0.95rem;
}

.nav-subitem.active {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  font-weight: 700;
  border-color: rgba(245, 158, 11, 0.4);
}

@keyframes fadeInSubmenu {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Supplier Badges and Multi-Supplier Container */
.suppliers-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-height: 38px;
  padding: 0.4rem;
  background: var(--bg-card);
  border: 1px dashed var(--border-card);
  border-radius: 6px;
  margin-top: 0.4rem;
}

.supplier-tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: var(--accent-blue);
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.76rem;
  font-weight: 600;
}

.supplier-tag-badge button {
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0 0.15rem;
  display: flex;
  align-items: center;
  line-height: 1;
}

.supplier-tag-badge button:hover {
  color: #dc2626;
  transform: scale(1.15);
}

/* Operator Quick PIN Status Bar */
.operator-bar {
  background: var(--bg-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.operator-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.operator-avatar {
  font-size: 1.5rem;
}

.operator-details h4 {
  font-size: 0.85rem;
  font-weight: 600;
}

.operator-details span {
  font-size: 0.72rem;
  color: var(--accent-emerald);
}

.btn-pin-switch {
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-pin-switch:hover {
  background: var(--accent-amber);
  color: #0f172a;
}

/* Main Content Area */
.main-wrapper {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: auto !important;
  overscroll-behavior-y: contain;
  will-change: scroll-position;
}

/* Top Header */
.top-header {
  height: 64px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-card);
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  gap: 0.85rem;
  transform: translateZ(0);
}

.header-brand-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 0 1 auto;
  max-width: 48%;
}

.header-title {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.header-title h2 {
  font-size: clamp(0.92rem, 1.15vw, 1.12rem);
  font-weight: 700;
  margin: 0;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

.header-title p {
  font-size: clamp(0.68rem, 0.8vw, 0.75rem);
  color: var(--text-muted);
  margin: 0.15rem 0 0 0;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
  max-width: 60%;
  justify-content: flex-end;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid var(--border-card);
  background: var(--bg-subtle);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-indicator.online { background-color: var(--accent-emerald); box-shadow: 0 0 8px var(--accent-emerald); }
.status-indicator.warning { background-color: var(--accent-amber); box-shadow: 0 0 8px var(--accent-amber); }

/* Theme Toggle Button */
.btn-icon-theme {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon-theme:hover {
  background: var(--bg-card-hover);
  transform: scale(1.05);
}

/* Page Views */
.page-view {
  display: none;
  padding: 1.5rem 2rem;
  animation: fadeIn 0.25s ease-in-out;
}

.page-view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   PDV / Frente de Caixa Layout
   ========================================================================== */
.pdv-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 1.5rem;
  height: calc(100vh - 110px);
}

.pdv-catalog-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  padding-right: 0.5rem;
}

/* Sector Tabs */
.sector-tabs {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
}

.sector-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.sector-tab:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.sector-tab.active {
  background: var(--accent-amber);
  color: #0f172a;
  border-color: var(--accent-amber);
  font-weight: 700;
}

/* Product Search Bar */
.search-box {
  position: relative;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--accent-amber);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: var(--text-muted);
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.8rem;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-card-hover);
  box-shadow: var(--shadow-sm);
}

.product-img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 0.6rem;
  background-color: var(--bg-subtle);
}

.product-name {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 0.4rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.3em;
}

.product-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.product-price {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent-amber);
}

.bonus-badge {
  font-size: 0.7rem;
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-weight: 600;
}

/* CAIXA - Vendas em Aberto & Busca Ativa */
.caixa-vendas-abertas-container {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  padding: 0.9rem;
  min-height: 380px;
  max-height: calc(100vh - 230px);
}

.caixa-vendas-abertas-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding-right: 0.25rem;
}

.venda-aberta-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: 2px solid var(--border-card);
  border-left: 5px solid var(--accent-amber);
  border-radius: 10px;
  padding: 0.9rem 1.15rem;
  gap: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.venda-aberta-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-amber);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.22);
}

.venda-divider-bold {
  height: 3px;
  background: var(--accent-amber);
  border-radius: 2px;
  margin: 0.75rem 0;
  width: 100%;
  box-shadow: 0 1px 4px rgba(245, 158, 11, 0.35);
}

.venda-aberta-content {
  flex: 1;
  min-width: 0;
}

.venda-aberta-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.venda-ficha-tag {
  font-family: monospace;
  font-size: 0.85rem;
  font-weight: 800;
  color: #0f172a;
  background: var(--accent-amber);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.venda-sector-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
}

.venda-origem-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.venda-aberta-items {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 95%;
}

.venda-aberta-meta {
  font-size: 0.74rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.venda-aberta-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.45rem;
  min-width: 140px;
}

.venda-aberta-price {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.venda-aberta-price .price-currency {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

.venda-aberta-price .price-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent-emerald);
}

.btn-fechar-venda {
  padding: 0.55rem 1rem;
  font-size: 0.88rem;
  font-weight: 800;
  border-radius: 8px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-fechar-venda:hover {
  background: #059669;
  transform: scale(1.03);
}

/* Busca Ativa de Produtos no Caixa */
.caixa-search-results {
  background: var(--bg-card);
  border: 1px solid var(--accent-amber);
  border-radius: 10px;
  margin-top: 0.6rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  animation: fadeInDown 0.2s ease-out;
}

.search-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.95rem;
  border-bottom: 1px solid var(--border-card);
  cursor: pointer;
  transition: background 0.15s;
}

.search-result-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-amber);
}

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

.product-code-pill {
  font-family: monospace;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.12);
  padding: 0.2rem 0.45rem;
  border-radius: 5px;
  border: 1px solid rgba(59, 130, 246, 0.25);
  display: inline-block;
  text-align: center;
}

/* Painel de Ficha Numerada */
.ficha-control-panel {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(245, 158, 11, 0.02));
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 12px;
  padding: 0.85rem 1.1rem;
  margin-bottom: 0.9rem;
  margin-bottom: 0.9rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Cart Panel */
.cart-panel {
  background: var(--pdv-cart-bg);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  padding: 1.2rem;
  box-shadow: var(--shadow-lg);
}

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

.cart-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-clear-cart {
  background: transparent;
  border: none;
  color: #ef4444;
  font-size: 0.8rem;
  cursor: pointer;
  font-weight: 600;
}

.cart-items-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.8rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card);
}

.cart-item-info {
  flex: 1;
}

.cart-item-title {
  font-size: 0.85rem;
  font-weight: 600;
}

.cart-item-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0.8rem;
}

.btn-qty {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: var(--pdv-touch-btn);
  border: 1px solid var(--border-card);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 700;
}

.cart-item-price {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent-amber);
}

/* Cart Footer / Totals */
.cart-totals {
  border-top: 1px solid var(--border-card);
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.total-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.total-row.grand {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-main);
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border-card);
}

.total-row.grand span:last-child {
  color: var(--accent-amber);
}

/* Realtime Bonus Summary in Cart */
.bonus-live-box {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.2));
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.8rem;
  margin-top: 0.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
}

.bonus-live-box strong {
  color: var(--accent-emerald);
}

/* Action Buttons */
.cart-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 1rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-amber), var(--accent-gold));
  color: #0f172a;
  border: none;
  padding: 0.9rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
}

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--text-main);
  padding: 0.9rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
}

/* ==========================================================================
   Dashboard Metrics & Cards
   ========================================================================== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.metric-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

.metric-icon.gold { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }
.metric-icon.emerald { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
.metric-icon.blue { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.metric-icon.purple { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }

.metric-data h3 {
  font-size: 1.4rem;
  font-weight: 800;
}

.metric-data span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Gamification & Leaderboard Section */
.dashboard-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.section-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.leader-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card);
}

.leader-rank {
  font-size: 1.8rem;
}

.leader-details {
  flex: 1;
}

.leader-details h4 {
  font-size: 0.95rem;
  font-weight: 700;
}

.leader-details span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.leader-score {
  text-align: right;
}

.leader-score .amount {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent-amber);
}

.leader-score .bonus {
  font-size: 0.75rem;
  color: var(--accent-emerald);
}

/* Thermal Printer Modal Preview */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 15, 29, 0.85);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.modal-container {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

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

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-card);
  display: flex;
  justify-content: flex-end;
  gap: 0.8rem;
}

/* ESC/POS Thermal Paper Preview Box */
.thermal-paper {
  background: #fffef5;
  color: #111;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  line-height: 1.35;
  padding: 1.5rem;
  border-radius: 4px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  margin: 0 auto;
  white-space: pre-wrap;
  word-break: break-all;
  border-top: 4px dashed #cbd5e1;
  border-bottom: 4px dashed #cbd5e1;
}

.thermal-paper.width-80mm { max-width: 340px; }
.thermal-paper.width-58mm { max-width: 250px; font-size: 0.68rem; }

/* Quick PIN Pad Keypad */
.pin-pad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
  max-width: 280px;
  margin: 1rem auto;
}

.pin-btn {
  height: 60px;
  border-radius: var(--radius-md);
  background: var(--pdv-touch-btn);
  border: 1px solid var(--border-card);
  color: var(--text-main);
  font-size: 1.4rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.pin-btn:hover {
  background: var(--accent-amber);
  color: #0f172a;
}

/* ==========================================================================
   Enhanced UI Styles for Menu Features (Comandas, Fiscal, Estabelecimento)
   ========================================================================== */
.comanda-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

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

.comanda-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-amber), var(--accent-gold));
}

.comanda-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
  font-size: 0.85rem;
}

.comanda-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 1rem;
}

.establishment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.filter-pills-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.filter-pill {
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  background: var(--pdv-touch-btn);
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-pill:hover, .filter-pill.active {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--accent-amber);
  color: var(--accent-amber);
}

.action-btn-sm {
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-card);
  background: var(--pdv-touch-btn);
  color: var(--text-main);
  transition: all 0.15s ease;
}

.action-btn-sm:hover {
  border-color: var(--accent-amber);
  color: var(--accent-amber);
}

.action-btn-danger {
  color: #ef4444 !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}

.action-btn-danger:hover {
  background: rgba(239, 68, 68, 0.15) !important;
}

/* ==========================================================================
   Super Meta & Monthly Bonus Engine Styling (RN-01 a RN-04)
   ========================================================================== */

.bonus-modal-container {
  max-width: 1100px;
  width: 95%;
  max-height: 94vh;
}

.bonus-banner-card {
  background: var(--card-gradient);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.bonus-banner-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #f59e0b, #10b981, #3b82f6);
}

.bonus-metrics-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.bonus-summary-pill {
  background: var(--bg-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  transition: all 0.2s ease;
}

.bonus-summary-pill:hover {
  border-color: var(--border-card-hover);
  transform: translateY(-2px);
}

.bonus-summary-pill .label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.bonus-summary-pill .value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
}

.bonus-summary-pill.gold .value { color: var(--accent-amber); }
.bonus-summary-pill.emerald .value { color: var(--accent-emerald); }
.bonus-summary-pill.blue .value { color: var(--accent-blue); }
.bonus-summary-pill.purple .value { color: #a78bfa; }

/* Progress Gauge / Thermometer */
.bonus-thermometer-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  margin-top: 1.2rem;
}

.bonus-thermometer-track {
  height: 24px;
  background: var(--border-card);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  margin: 0.8rem 0 0.4rem 0;
  display: flex;
}

.bonus-thermometer-base {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #6366f1);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.bonus-thermometer-excess {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #f59e0b);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Rateio Split Card Grid */
.bonus-split-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.8rem;
  margin-top: 0.8rem;
}

.bonus-split-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.bonus-split-card .split-title {
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.bonus-split-card .split-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent-amber);
}

.bonus-split-card .split-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Sector Winner Showcase */
.sector-winner-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(16, 185, 129, 0.1));
  border: 2px solid var(--accent-amber);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.sector-winner-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  background: linear-gradient(135deg, var(--accent-amber), var(--accent-gold));
  color: #0f172a;
  border-radius: 20px;
  font-weight: 800;
  font-size: 0.82rem;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.status-badge-eligible {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
}

.status-badge-ineligible {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
}

.nav-item-monthly-bonus {
  position: relative;
}

.nav-item-monthly-bonus::after {
  content: "NOVO";
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 0.62rem;
  font-weight: 800;
  background: var(--accent-amber);
  color: #0f172a;
  padding: 1px 4px;
  border-radius: 4px;
}

/* Password Requirements Visual Box */
.pwd-requirements-box {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-card);
  padding: 0.55rem 0.8rem;
  border-radius: 6px;
  font-size: 0.76rem;
  margin-top: 0.4rem;
}

.pwd-req-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: #ef4444;
  transition: all 0.2s ease;
}

.pwd-req-item.valid {
  color: #10b981;
  font-weight: 600;
}

.pwd-req-item .icon {
  font-size: 0.85rem;
  width: 14px;
  display: inline-block;
  text-align: center;
}

/* User Management Dashboard Action Banner */
.user-manager-card {
  background: var(--card-gradient);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.user-manager-card:hover {
  border-color: var(--accent-blue);
}

/* Ranking de Campeões e Relatório de Vendas */
.champion-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

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

.champion-card.rank-1 {
  border-color: rgba(245, 158, 11, 0.5);
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.12), var(--bg-card));
}

.champion-card.rank-2 {
  border-color: rgba(96, 165, 250, 0.5);
  background: linear-gradient(145deg, rgba(96, 165, 250, 0.12), var(--bg-card));
}

.champion-card.rank-3 {
  border-color: rgba(203, 213, 225, 0.4);
  background: linear-gradient(145deg, rgba(203, 213, 225, 0.12), var(--bg-card));
}

.champion-card.rank-sector {
  border-color: rgba(167, 139, 250, 0.5);
  background: linear-gradient(145deg, rgba(167, 139, 250, 0.12), var(--bg-card));
}

/* Print Styles for Crisp White & Black Reports with Bold Borders */
@media print {
  body * {
    visibility: hidden;
  }
  #report-pdf-printable-content, #report-pdf-printable-content *,
  #orcamento-pdf-printable-content, #orcamento-pdf-printable-content *,
  #thermal-paper-content, #thermal-paper-content * {
    visibility: visible;
  }
  #thermal-paper-content {
    position: absolute;
    left: 0;
    top: 0;
    width: 320px !important;
    background: #ffffff !important;
    color: #000000 !important;
    font-family: 'Courier New', Courier, monospace !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
    padding: 10px !important;
    box-shadow: none !important;
    border: none !important;
  }
  #report-pdf-printable-content,
  #orcamento-pdf-printable-content {
    position: absolute;
    left: 0;
    top: 0;
    width: 100% !important;
    background: #ffffff !important;
    color: #000000 !important;
    box-shadow: none !important;
    border: 2px solid #000000 !important;
    padding: 15px !important;
  }
  #report-pdf-printable-content table,
  #orcamento-pdf-printable-content table {
    border: 2px solid #000000 !important;
    width: 100% !important;
    border-collapse: collapse !important;
  }
  #report-pdf-printable-content th,
  #orcamento-pdf-printable-content th {
    border: 1.5px solid #000000 !important;
    background: #e2e8f0 !important;
    color: #000000 !important;
    font-weight: 800 !important;
  }
  #report-pdf-printable-content td,
  #orcamento-pdf-printable-content td {
    border: 1px solid #000000 !important;
    color: #000000 !important;
  }
}

/* Establishment Status Badges */
.status-badge-ativo {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.status-badge-suspenso {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* Comanda Caixa Card */
.caixa-comanda-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s ease;
  position: relative;
}

.caixa-comanda-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-emerald);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.15);
}

.caixa-comanda-card.waiting-long {
  border-color: rgba(245, 158, 11, 0.5);
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.1), var(--bg-card));
}

.establishment-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s ease;
}

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

.establishment-card.active-unit {
  border-color: var(--accent-emerald);
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.1), var(--bg-card));
}

.establishment-card.suspended-unit {
  border-color: rgba(245, 158, 11, 0.4);
  opacity: 0.85;
}

/* Orçamentos & Encomendas Design System */
.orcamento-layout-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
@media (max-width: 1150px) {
  .orcamento-layout-grid {
    grid-template-columns: 1fr;
  }
}

.calc-mode-selector {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-subtle);
  padding: 0.35rem;
  border-radius: 8px;
  border: 1px solid var(--border-card);
}

.calc-mode-btn {
  flex: 1;
  padding: 0.6rem 0.8rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.calc-mode-btn.active {
  background: var(--accent-amber);
  color: #0f172a;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.3);
}

.badge-orcamento-status {
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  text-transform: uppercase;
}
.badge-orcamento-status.pendente {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.4);
}
.badge-orcamento-status.aprovado {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.4);
}
.badge-orcamento-status.producao {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(59, 130, 246, 0.4);
}
.badge-orcamento-status.pronto {
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-purple);
  border: 1px solid rgba(139, 92, 246, 0.4);
}
.badge-orcamento-status.finalizado {
  background: rgba(100, 116, 139, 0.2);
  color: var(--text-light);
  border: 1px solid var(--border-card);
}
.badge-orcamento-status.cancelado {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

/* ==========================================================================
   Mobile & Smartphone Responsive Design System (Google Chrome & Safari iOS/Android)
   ========================================================================== */

/* Mobile Hamburger Menu Toggle Button */
.btn-mobile-menu {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--accent-amber);
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
  touch-action: manipulation;
}

.btn-mobile-menu:hover, .btn-mobile-menu:active {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--accent-amber);
}

/* Close Button inside Mobile Sidebar */
.btn-close-sidebar-mobile {
  display: none;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #ef4444;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  margin-left: auto;
  transition: all 0.2s ease;
  touch-action: manipulation;
}

.btn-close-sidebar-mobile:active {
  transform: scale(0.9);
}

/* Sidebar Backdrop Overlay on Mobile */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 29, 0.8);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(60px + env(safe-area-inset-bottom, 0px));
  background: var(--bg-card);
  border-top: 1px solid var(--border-card);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  z-index: 950;
  padding: 0 0.5rem;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  justify-content: space-around;
  align-items: center;
  box-shadow: var(--shadow-lg);
}

.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem 0.2rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  touch-action: manipulation;
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-item:active {
  transform: scale(0.92);
}

.mobile-nav-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.mobile-nav-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.mobile-nav-item.active {
  color: var(--accent-amber);
}

.mobile-nav-item.active .mobile-nav-icon {
  transform: scale(1.15);
  filter: drop-shadow(0 2px 8px rgba(245, 158, 11, 0.5));
}

/* Sticky Floating Mobile Cart Bar */
.mobile-cart-float-bar {
  display: none;
  position: fixed;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  left: 0.8rem;
  right: 0.8rem;
  z-index: 850;
  background: var(--card-gradient);
  border: 1px solid var(--accent-amber);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  box-shadow: var(--shadow-lg);
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  animation: slideUpFloat 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

@keyframes slideUpFloat {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive Container Utilities */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
}

/* Medium Displays & Laptops (<= 1280px) */
@media (max-width: 1280px) {
  .top-header {
    padding: 0 1rem;
    gap: 0.6rem;
  }
  .header-brand-wrap {
    max-width: 44%;
  }
  .header-title h2 {
    font-size: 0.98rem;
  }
  .header-title p {
    font-size: 0.7rem;
  }
  .header-actions {
    gap: 0.35rem;
  }
  .status-pill {
    padding: 0.25rem 0.5rem;
    font-size: 0.72rem;
  }
  .btn-pin-switch {
    padding: 0.25rem 0.5rem;
    font-size: 0.72rem;
  }
}

/* Tablet & Mobile Breakpoint (<= 992px) */
@media (max-width: 992px) {
  .app-shell {
    display: block !important;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 290px;
    max-width: 85vw;
    height: 100vh;
    height: 100dvh;
    background: var(--bg-card);
    border-right: 1px solid var(--border-card);
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 12px 0 32px rgba(0, 0, 0, 0.7);
    display: flex !important;
    padding-top: max(1.2rem, env(safe-area-inset-top));
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .btn-mobile-menu {
    display: inline-flex;
  }

  .btn-close-sidebar-mobile {
    display: inline-flex;
  }

  .main-wrapper {
    height: 100vh;
    height: 100dvh;
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-bottom-nav {
    display: flex;
  }

  .dashboard-sections {
    grid-template-columns: 1fr;
  }

  .pdv-layout {
    grid-template-columns: 1fr;
    height: auto;
    gap: 1.2rem;
  }
}

/* Smartphones Breakpoint (<= 768px - iPhone, Samsung Galaxy, Pixel, Safari & Chrome) */
@media (max-width: 768px) {
  /* Prevent iOS Safari automatic zoom on form focus */
  input, select, textarea {
    font-size: 16px !important;
  }

  .top-header {
    height: auto;
    min-height: 58px;
    padding: 0.6rem 0.8rem;
    padding-top: max(0.6rem, env(safe-area-inset-top));
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .header-brand-wrap {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
  }

  .header-title h2 {
    font-size: 1.05rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header-title p {
    display: none;
  }

  .header-actions {
    gap: 0.35rem;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.25rem;
    scrollbar-width: none;
    justify-content: flex-start;
    flex-wrap: nowrap;
  }

  .header-actions::-webkit-scrollbar {
    display: none;
  }

  .status-pill {
    padding: 0.25rem 0.55rem;
    font-size: 0.72rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .page-view {
    padding: 0.8rem 0.65rem;
  }

  /* PDV Catalog on Smartphones */
  .sector-tabs {
    padding-bottom: 0.4rem;
    -webkit-overflow-scrolling: touch;
  }

  .sector-tab {
    padding: 0.5rem 0.8rem;
    font-size: 0.78rem;
    min-height: 38px;
    flex-shrink: 0;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.6rem !important;
  }

  .product-card {
    padding: 0.6rem;
    touch-action: manipulation;
  }

  .product-img {
    height: 85px;
  }

  .product-name {
    font-size: 0.82rem;
    height: 2.2em;
  }

  .product-price {
    font-size: 0.95rem;
  }

  .cart-panel {
    border-radius: var(--radius-md);
    padding: 1rem;
    box-shadow: none;
    border: 1px solid var(--border-card);
  }

  .cart-actions {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .btn-primary, .btn-secondary {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Manager Dashboard on Smartphones */
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.6rem !important;
    margin-bottom: 1.2rem;
  }

  .metric-card {
    padding: 0.75rem;
    gap: 0.6rem;
  }

  .metric-icon {
    width: 38px;
    height: 38px;
    font-size: 1.25rem;
    flex-shrink: 0;
  }

  .metric-data h3 {
    font-size: 1.05rem;
  }

  .metric-data span {
    font-size: 0.68rem;
  }

  /* Manager Executive Horizontal Bar on Smartphones */
  #dashboard-executive-modules-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.8rem !important;
    padding: 1rem !important;
  }

  #dashboard-executive-modules-bar > div:last-child {
    flex-direction: column !important;
    width: 100% !important;
    gap: 0.5rem !important;
  }

  #btn-dash-extrato-bonus, #btn-dash-pool-premiacao {
    width: 100% !important;
    justify-content: center !important;
    min-height: 48px !important;
  }

  /* Forecast Card on Smartphones */
  #manager-monthly-forecast-card {
    padding: 1rem !important;
  }

  #manager-monthly-forecast-card > div:first-child {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  #manager-monthly-forecast-card > div:last-child {
    grid-template-columns: 1fr !important;
    gap: 0.8rem !important;
  }

  /* Ranking Cards on Smartphones */
  .champions-grid {
    grid-template-columns: 1fr !important;
  }

  /* Comandas on Smartphones */
  .comandas-grid {
    grid-template-columns: 1fr !important;
  }

  /* Modals on Smartphones (Touch-friendly Bottom Sheet) */
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .modal-container {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 90vh !important;
    max-height: 90dvh !important;
    margin: 0 !important;
    border-radius: 18px 18px 0 0 !important;
    animation: slideUpModal 0.25s ease-out;
  }

  @keyframes slideUpModal {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  .modal-header {
    padding: 1rem !important;
  }

  .modal-body {
    padding: 1rem 0.9rem !important;
    -webkit-overflow-scrolling: touch;
    max-height: calc(90dvh - 120px);
  }

  .modal-footer {
    padding: 0.9rem 1rem !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
  }

  .modal-footer button {
    width: 100% !important;
    min-height: 46px;
  }

  /* Touch Keypad / PIN pad on Mobile */
  .pin-pad-grid {
    gap: 0.6rem;
    max-width: 100%;
  }

  .pin-btn {
    height: 52px;
  }

  /* Tables container scrolling */
  table {
    min-width: 540px;
  }
}

/* Extra small smartphones (<= 380px) */
@media (max-width: 380px) {
  .product-grid {
    grid-template-columns: 1fr !important;
  }

  .metrics-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ==========================================================================
   Módulo de Auditoria - Estilos & UI Premium
   ========================================================================== */

.audit-row {
  cursor: pointer;
  transition: background-color 0.18s ease, transform 0.1s ease;
  border-bottom: 1px solid var(--border-card);
}

.audit-row:hover {
  background-color: var(--bg-card-hover) !important;
}

.audit-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 6px;
  padding: 0.3rem 0.65rem;
  font-weight: 700;
  font-size: 0.78rem;
  white-space: nowrap;
}

.audit-day-pill {
  display: inline-block;
  background: rgba(245, 158, 11, 0.18);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 4px;
  padding: 0.12rem 0.45rem;
  font-weight: 800;
  font-size: 0.73rem;
  text-transform: capitalize;
}

.audit-time-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.audit-date-btn {
  background: var(--pdv-touch-btn);
  border: 1px solid var(--border-card);
  color: var(--text-light);
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.audit-date-btn:hover {
  border-color: var(--accent-amber);
  color: var(--text-main);
}

.audit-date-btn.active {
  background: var(--accent-amber);
  color: #0f172a;
  border-color: var(--accent-amber);
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spinning {
  display: inline-block;
  animation: spin 1s linear infinite;
}

/* ==========================================================================
   Módulo de Gestão de Buffet & Restaurante
   ========================================================================== */
.buffet-table-chip {
  background: var(--pdv-touch-btn);
  border: 1px solid var(--border-card);
  color: var(--text-light);
  padding: 0.45rem 0.8rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.buffet-table-chip:hover {
  border-color: var(--accent-amber);
  color: var(--text-main);
  transform: translateY(-1px);
}

.buffet-table-chip.active {
  background: var(--accent-amber);
  color: #0f172a;
  border-color: var(--accent-amber);
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.buffet-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

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

.buffet-item-card.has-items {
  border-color: var(--accent-amber);
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.1), var(--bg-card));
}

.buffet-qty-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 1rem 0 0.5rem 0;
}

.buffet-qty-btn {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--pdv-touch-btn);
  border: 1px solid var(--border-card);
  color: var(--text-main);
  font-size: 1.2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.buffet-qty-btn:hover {
  background: var(--accent-amber);
  color: #0f172a;
  border-color: var(--accent-amber);
}

.buffet-qty-btn:active {
  transform: scale(0.95);
}

.buffet-qty-input {
  width: 55px;
  height: 38px;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 800;
  border-radius: 8px;
  border: 1px solid var(--border-card);
  background: var(--bg-subtle);
  color: var(--text-main);
}

.buffet-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  transition: transform 0.2s ease;
}

.buffet-stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-card-hover);
}

.buffet-order-card {
  transition: all 0.2s ease;
}

.buffet-order-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

/* ==========================================================================
   Tela de Autenticação Primária & Inicial do Sistema
   ========================================================================== */
body.auth-mode {
  overflow: hidden !important;
}

body.auth-mode .app-shell {
  pointer-events: none;
}

body.auth-mode .top-header,
body.auth-mode #btn-logout-user,
body.auth-mode #user-profile-badge {
  pointer-events: auto !important;
  cursor: pointer !important;
}

body.auth-mode #modal-auth-login {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(10, 15, 29, 0.95) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  z-index: 2147483647 !important; /* Maximum possible z-index */
  align-items: center !important;
  justify-content: center !important;
  padding: 1.5rem !important;
  overflow-y: auto !important;
}

body.auth-mode #modal-auth-login .modal-container {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  max-width: 580px !important;
  width: 100% !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(245, 158, 11, 0.15) !important;
  border: 1px solid rgba(245, 158, 11, 0.45) !important;
  background-color: var(--bg-card, #1e293b) !important;
  z-index: 2147483647 !important;
}





/* --- GERENTE IA MODAL CHAT --- */
.ai-widget-container, #gemini-ai-widget, #ai-widget { display: none !important; opacity: 0 !important; pointer-events: none !important; visibility: hidden !important; }
.ai-messages { flex: 1; padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; font-size: 0.85rem; }
.ai-msg { padding: 8px 12px; border-radius: 8px; max-width: 85%; }
.ai-msg.bot { background: rgba(245, 158, 11, 0.1); color: var(--text-main); align-self: flex-start; border: 1px solid rgba(245, 158, 11, 0.2); border-bottom-left-radius: 2px; }
.ai-msg.user { background: var(--pdv-btn-primary); color: #fff; align-self: flex-end; border-bottom-right-radius: 2px; }
.ai-input-area { padding: 10px; border-top: 1px solid var(--border-card); display: flex; gap: 8px; background: var(--bg-card); }
.ai-input-area input { flex: 1; padding: 8px 12px; border: 1px solid var(--border-card); border-radius: 6px; background: var(--pdv-touch-btn); color: var(--text-main); font-size: 0.85rem; }
.ai-input-area button { background: var(--accent-amber); color: #000; border: none; border-radius: 6px; padding: 0 12px; font-weight: 600; cursor: pointer; transition: 0.2s; }
.ai-input-area button:hover { opacity: 0.8; }

/* ==========================================================================
   TERMINAL FRENTE DE CAIXA FULLSCREEN (PADRÃO COMERCIAL)
   ========================================================================== */
body.caixa-fullscreen-mode .sidebar,
body.role-caixa .sidebar,
body.caixa-mode .sidebar {
  display: none !important;
}

body.caixa-fullscreen-mode .sidebar-backdrop,
body.role-caixa .sidebar-backdrop,
body.caixa-mode .sidebar-backdrop {
  display: none !important;
}

body.caixa-fullscreen-mode #btn-mobile-menu,
body.role-caixa #btn-mobile-menu,
body.caixa-mode #btn-mobile-menu {
  display: none !important;
}

body.caixa-fullscreen-mode .mobile-bottom-nav,
body.role-caixa .mobile-bottom-nav,
body.caixa-mode .mobile-bottom-nav,
body.caixa-fullscreen-mode .mobile-cart-float-bar,
body.role-caixa .mobile-cart-float-bar,
body.caixa-mode .mobile-cart-float-bar {
  display: none !important;
}

body.caixa-fullscreen-mode .main-wrapper,
body.role-caixa .main-wrapper,
body.caixa-mode .main-wrapper {
  margin: 0 !important;
  padding: 0 !important;
  width: 100vw !important;
  max-width: 100vw !important;
}

body.caixa-fullscreen-mode .top-header,
body.role-caixa .top-header,
body.caixa-mode .top-header {
  display: flex !important;
  position: relative !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

body.caixa-fullscreen-mode #view-pdv,
body.role-caixa #view-pdv,
body.caixa-mode #view-pdv {
  width: 100vw !important;
  min-height: calc(100vh - 75px) !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}

/* POS Terminal Container */
.caixa-pos-terminal-container {
  display: grid;
  grid-template-columns: 1fr 390px;
  width: 100%;
  height: 100%;
  min-height: calc(100vh - 75px);
  background: #f1f5f9;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  overflow: hidden;
  box-sizing: border-box;
}

body.caixa-fullscreen-mode .caixa-pos-terminal-container {
  min-height: calc(100vh - 75px);
  height: calc(100vh - 75px);
}

/* Ocultação garantida dos botões de outros setores no modo Caixa */
body.caixa-fullscreen-mode .nav-item[data-view="balcao"],
body.caixa-fullscreen-mode .nav-item[data-view="buffet"],
body.caixa-fullscreen-mode .nav-item[data-view="orcamentos"],
body.role-caixa .nav-item[data-view="balcao"],
body.role-caixa .nav-item[data-view="buffet"],
body.role-caixa .nav-item[data-view="orcamentos"] {
  display: none !important;
}

/* Painel Esquerdo (Branco - Itens e Scanner) */
.caixa-pos-left {
  background: #ffffff;
  display: flex;
  flex-direction: column;
  padding: 0.9rem 1.4rem;
  border-right: 2px solid #cbd5e1;
  overflow: hidden;
  height: 100%;
  box-sizing: border-box;
}

/* Topo do Painel Esquerdo: Busca de Produtos */
.caixa-pos-topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid #e2e8f0;
}

.caixa-pos-brand-banner {
  display: none !important;
}

.caixa-pos-search-wrap {
  display: flex;
  align-items: center;
  position: relative;
  min-width: 320px;
  max-width: 440px;
  width: 100%;
}

.caixa-pos-search-input {
  width: 100%;
  padding: 0.6rem 2.8rem 0.6rem 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  border: 2px solid #94a3b8;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.caixa-pos-search-input:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2);
}

.caixa-pos-search-btn {
  position: absolute;
  right: 6px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #facc15;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Banner de Destaque do Produto Escaneado */
.caixa-current-product-banner {
  text-align: center;
  padding: 0.65rem 0.5rem;
  background: #f8fafc;
  border-radius: 8px;
  margin: 0.6rem 0 0.5rem 0;
  border: 1px dashed #cbd5e1;
}

.caixa-current-product-name {
  font-size: 1.45rem;
  font-weight: 900;
  color: #1e3a8a;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tabela dos Produtos Escaneados */
.caixa-pos-table-wrap {
  flex: 1;
  overflow-y: auto;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  margin-bottom: 0.6rem;
}

.caixa-pos-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  text-align: left;
}

.caixa-pos-table th {
  background: #f1f5f9;
  color: #1e293b;
  font-weight: 800;
  padding: 0.6rem 0.7rem;
  border-bottom: 2px solid #cbd5e1;
  text-transform: uppercase;
  font-size: 0.78rem;
  position: sticky;
  top: 0;
  z-index: 2;
}

.caixa-pos-table td {
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid #e2e8f0;
  color: #0f172a;
  font-weight: 600;
}

.caixa-pos-table tr:nth-child(even) td {
  background: #f8fafc;
}

.caixa-pos-table tr:hover td {
  background: #eff6ff;
}

.caixa-btn-excluir-item {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #f87171;
  border-radius: 4px;
  padding: 0.22rem 0.55rem;
  font-weight: 800;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.15s;
}

.caixa-btn-excluir-item:hover {
  background: #ef4444;
  color: #ffffff;
}

/* Barra inferior do painel esquerdo: utilitários */
.caixa-pos-bottom-utils {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px solid #e2e8f0;
  font-size: 0.85rem;
}

/* Painel Direito (Dark Navy - Totais, Logo e Ações) */
.caixa-pos-right {
  background: #0b1f38;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  padding: 1rem 1.3rem;
  gap: 0.85rem;
  overflow-y: auto;
  box-sizing: border-box;
  height: 100%;
}

.caixa-pos-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  color: #94a3b8;
  font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  padding-bottom: 0.45rem;
}

.caixa-pos-logo-card {
  background: #ffffff;
  color: #0f172a;
  border-radius: 10px;
  padding: 0.55rem 1rem;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.caixa-pos-logo-card .logo-codec-badge {
  display: none !important;
}

.caixa-pos-qty-section {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.caixa-pos-qty-label {
  font-size: 0.92rem;
  font-weight: 700;
  color: #e2e8f0;
}

.caixa-pos-qty-box {
  width: 100%;
  padding: 0.35rem 0.5rem;
  text-align: center;
  font-size: 2.2rem;
  font-weight: 900;
  background: #ffffff;
  color: #0f172a;
  border: 3px solid #1e3a8a;
  border-radius: 8px;
  outline: none;
  box-sizing: border-box;
}

/* Dois cards brancos lado a lado */
.caixa-pos-dual-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.caixa-pos-white-box {
  background: #ffffff;
  color: #0f172a;
  border: 2px solid #1e3a8a;
  border-radius: 8px;
  padding: 0.4rem 0.5rem;
  text-align: center;
}

.caixa-pos-white-box-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 0.15rem;
  text-transform: uppercase;
}

.caixa-pos-white-box-value {
  font-size: 1.35rem;
  font-weight: 900;
  color: #0f172a;
  white-space: nowrap;
}

.caixa-pos-shortcuts-hint {
  font-size: 0.74rem;
  color: #38bdf8;
  text-align: center;
  font-weight: 600;
  line-height: 1.3;
}

/* Caixa Grande Amarela para TOTAL */
.caixa-pos-total-section {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: auto;
}

.caixa-pos-total-label {
  font-size: 0.88rem;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 1px;
}

.caixa-pos-total-banner {
  background: #facc15;
  color: #000000;
  border: 2px solid #ca8a04;
  border-radius: 8px;
  padding: 0.55rem 0.8rem;
  text-align: center;
  font-size: 2.45rem;
  font-weight: 950;
  box-shadow: 0 4px 12px rgba(250, 204, 21, 0.4);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* Botões de Ação F7 e F12 */
.caixa-pos-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.caixa-btn-f7 {
  background: #38bdf8;
  color: #0f172a;
  border: none;
  border-radius: 8px;
  padding: 0.8rem 1rem;
  font-size: 1.15rem;
  font-weight: 900;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(56, 189, 248, 0.35);
  transition: transform 0.1s, background-color 0.2s;
  text-transform: uppercase;
}

.caixa-btn-f7:hover {
  background: #0ea5e9;
  transform: translateY(-1px);
}

.caixa-btn-f12 {
  background: #4ade80;
  color: #0f172a;
  border: none;
  border-radius: 8px;
  padding: 0.8rem 1rem;
  font-size: 1.15rem;
  font-weight: 900;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(74, 222, 128, 0.35);
  transition: transform 0.1s, background-color 0.2s;
  text-transform: uppercase;
}

.caixa-btn-f12:hover {
  background: #22c55e;
  transform: translateY(-1px);
}

