/* ============================================================
   CAFÉ LEAL — Premium Design System (Corrigido para Sidebar)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  /* Paleta Base (Identidade da Marca) */
  --bg-app: #f5f0e4;
  --bg-sidebar: #2c1a0e;
  --bg-card: #ffffff;
  --card-border: #e0d5bd;

  /* Textos */
  --text-main: #1a0f06;
  --text-dim: #7a6040;
  --text-sidebar: #d4c4a0;
  --text-sidebar-active: #ffffff;

  /* Cores de Ação */
  --gold: #c9a84c;
  --gold-hover: #b59640;
  --gold-light: #fdf7ea;

  --primary: #3d2410;
  --primary-hover: #2c1a0e;

  /* Status */
  --green: #2d6b3f;
  --green-bg: #e0f2e5;
  --red: #9a2020;
  --red-bg: #fce8e8;
  --blue: #3B82F6;
  --blue-bg: rgba(59, 130, 246, 0.1);
  --orange: #f59e0b;
  --orange-bg: rgba(245, 158, 11, 0.1);

  /* Aliases de Compatibilidade (usados no JS) */
  --text-muted: var(--text-dim);
  --border-light: var(--card-border);

  /* Sombras e Efeitos */
  --shadow-sm: 0 1px 3px rgba(44,26,14,0.06), 0 2px 6px rgba(44,26,14,0.03);
  --shadow-md: 0 2px 8px rgba(44,26,14,0.08), 0 4px 16px rgba(44,26,14,0.04);
  --shadow-lg: 0 8px 24px rgba(44,26,14,0.12), 0 12px 32px rgba(44,26,14,0.06);

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --sidebar-w: 260px;
}

/* ============= GLOBAL RESET ============= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
  background-color: var(--bg-app);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
}

/* ============= LOADING ============= */
#loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--gold);
  z-index: 9999;
  transition: width 0.3s ease;
  width: 0;
}

#loading-bar.loading {
  width: 60%;
}

#loading-bar.done {
  width: 100%;
  opacity: 0;
  transition: width 0.2s ease, opacity 0.3s 0.2s;
}

/* ============= LOGIN SCREEN ============= */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: url('https://images.unsplash.com/photo-1497935586351-b67a49e012bf?q=80&w=2000&auto=format&fit=crop') center/cover;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(44, 26, 14, 0.88);
  backdrop-filter: blur(8px);
}

.login-card {
  position: relative;
  background: rgba(255, 248, 235, 0.06);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(201, 168, 76, 0.2);
  padding: 3rem 2.5rem;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 40px rgba(44, 26, 14, 0.4);
  text-align: center;
}

.login-logo {
  width: 100%;
  height: auto;
  max-height: 150px;
  object-fit: contain;
  display: block;
  margin-bottom: 2rem;
  filter: brightness(0) saturate(100%) invert(72%) sepia(38%) saturate(380%) hue-rotate(8deg) brightness(78%);
}

.login-title {
  font-size: 24px;
  font-weight: 700;
  color: #FFF;
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 14px;
  color: #A8A29E;
  margin-bottom: 2rem;
}

.login-field {
  margin-bottom: 1.2rem;
  text-align: left;
}

.login-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #d4c4a0;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.login-field input {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  background: rgba(255, 248, 235, 0.08);
  border: 1px solid rgba(201, 168, 76, 0.25);
  color: #FFF;
  font-size: 15px;
  outline: none;
  transition: all 0.2s;
}

.login-field input:focus {
  border-color: var(--gold);
  background: rgba(201, 168, 76, 0.1);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15);
}

.login-btn {
  width: 100%;
  padding: 14px;
  margin-top: 10px;
  border-radius: 12px;
  background: var(--gold);
  color: #2c1a0e;
  font-weight: 700;
  font-size: 15px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.login-btn:hover {
  background: var(--gold-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(201, 168, 76, 0.35);
}

.login-error {
  color: #FCA5A5;
  font-size: 13px;
  margin-top: 15px;
  min-height: 20px;
}

/* ============= APP LAYOUT ============= */
.app {
  display: none;
  height: 100vh;
  overflow: hidden;
}

.app.active {
  display: block;
}

.app-layout {
  display: flex;
  height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-logo-img {
  width: 100%;
  max-width: 130px;
  height: auto;
  object-fit: contain;
  /* Mesmo filtro do logo do login */
  filter: brightness(0) saturate(100%) invert(72%) sepia(38%) saturate(380%) hue-rotate(8deg) brightness(78%);
}

.sidebar-logo-name {
  font-weight: 700;
  font-size: 18px;
  color: #FFF;
  letter-spacing: -0.5px;
}

.sidebar-nav {
  flex: 1;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.tab {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  color: var(--text-sidebar);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #FFF;
}

.tab.active {
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold);
}

.nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.tab-badge {
  margin-left: auto;
  background: var(--gold);
  color: #000;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
}

.sidebar-user {
  padding: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-weight: 700;
  font-size: 14px;
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.sidebar-user-info {
  flex: 1;
}

.sidebar-user-name {
  font-weight: 600;
  font-size: 13px;
  color: #FFF;
}

.sidebar-user-role {
  font-size: 11px;
  color: var(--text-sidebar);
}

.btn-logout {
  background: none;
  border: none;
  color: var(--text-sidebar);
  cursor: pointer;
  transition: 0.2s;
  padding: 4px;
  border-radius: 4px;
}

.btn-logout:hover {
  color: var(--red);
  background: rgba(239, 68, 68, 0.1);
}

/* MAIN CONTENT */
.main-content {
  flex: 1;
  background: var(--bg-app);
  height: 100vh;
  overflow-y: auto;
  padding: 2rem 3rem;
}

/* PAGES CONTAINER */
.page {
  display: none;
}

.page.active {
  display: block;
  animation: fadeUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* PAGE HEADER */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.page-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-dim);
  font-weight: 500;
}

.page-header-actions {
  display: flex;
  gap: 12px;
}

/* ============= COMPONENTES GERAIS ============= */
.card {
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Buttons */
.btn {
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:active {
  transform: scale(0.97);
}

.btn-gold {
  background: var(--gold);
  color: #000;
}

.btn-gold:hover {
  background: var(--gold-hover);
}

.btn-dark {
  background: var(--text-main);
  color: #FFF;
}

.btn-dark:hover {
  background: #000;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text-main);
}

.btn-ghost:hover {
  background: rgba(0, 0, 0, 0.03);
  border-color: #CCC;
}

.btn-success {
  background: var(--green);
  color: #FFF;
}

.btn-success:hover {
  filter: brightness(0.9);
}

.btn-danger {
  background: var(--red);
  color: #FFF;
}

.btn-danger:hover {
  filter: brightness(0.9);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
}

.btn-full {
  width: 100%;
}

/* Forms */
.form-group {
  margin-bottom: 1.2rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

input,
select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: #FFF;
  font-size: 14px;
  color: var(--text-main);
  transition: all 0.2s;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 4px var(--gold-light);
}

/* Badges */
.badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

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

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

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

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

/* Tabelas (Data Table Clean) */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  padding: 16px 20px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  border-bottom: 2px solid var(--card-border);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--card-border);
  font-size: 14px;
  color: var(--text-main);
  font-weight: 500;
}

.data-table tbody tr:hover td {
  background: rgba(0, 0, 0, 0.01);
}

/* ============= DASHBOARDS (CAIXA E FINANCEIRO) ============= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: #FFF;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.stat-icon-green {
  background: var(--green-bg);
  color: var(--green);
}

.stat-icon-blue {
  background: var(--blue-bg);
  color: var(--blue);
}

.stat-icon-gold {
  background: var(--gold-light);
  color: var(--gold);
}

.stat-icon-purple {
  background: rgba(139, 92, 246, 0.1);
  color: #8B5CF6;
}

.stat-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 4px;
}

.stat-subtext {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* ============= NOVA COMANDA (PDV) ============= */
.comanda-layout-grid {
  display: grid;
  grid-template-columns: 3fr 1.5fr;
  gap: 2rem;
  align-items: start;
}

/* Grid de Produtos Esquerda */
.categoria-pills-wrapper {
  display: flex;
  gap: 8px;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  padding-bottom: 5px;
}

.categoria-pill {
  padding: 10px 20px;
  border-radius: 20px;
  border: 1px solid var(--card-border);
  background: #FFF;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: 0.2s;
  white-space: nowrap;
  color: var(--text-dim);
}

.categoria-pill:hover,
.categoria-pill.active {
  background: var(--text-main);
  color: #FFF;
  border-color: var(--text-main);
}

.produtos-comanda-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1.2rem;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 5px;
}

.produto-card {
  background: #FFF; border: 1px solid var(--card-border); border-radius: 12px;
  padding: 12px 16px; text-align: left; cursor: pointer; transition: 0.2s;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.produto-card:hover { border-color: var(--gold); background: var(--bg-app); transform: translateY(-2px); }
.produto-card-info { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.produto-card-nome { font-weight: 700; font-size: 13px; color: var(--text-main); }
.produto-card-price { font-weight: 800; font-size: 14px; color: var(--gold); }
.produto-card-add { background: var(--gold-light); color: var(--gold); width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; }

/* Carrinho Direita */
.order-panel {
  background: #FFF;
  border-radius: 24px;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--card-border);
  position: sticky;
  top: 2rem;
}

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

.order-receipt-id {
  font-weight: 800;
  font-size: 16px;
}

.order-receipt-count {
  font-weight: 600;
  font-size: 12px;
  color: var(--text-dim);
  background: var(--bg-app);
  padding: 4px 10px;
  border-radius: 12px;
}

.items-list { display: flex; flex-direction: column; gap: 8px; margin: 1rem 0; max-height: 40vh; overflow-y: auto; }
.item-row { display: flex; align-items: flex-start; justify-content: space-between; padding: 12px 0; border-bottom: 1px dashed var(--card-border); gap: 12px; }
.item-row:last-child { border-bottom: none; }
.item-qty { background: var(--gold-light); color: var(--gold); min-width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 13px; font-weight: 800; }
.item-details { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.item-name { font-weight: 700; font-size: 14px; color: var(--text-main); }
.item-note-text { font-size: 11px; color: var(--text-dim); font-style: italic; }
.item-price-col { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.item-price { font-weight: 800; font-size: 14px; color: var(--text-main); }
.item-remove { background: rgba(239, 68, 68, 0.1); border: none; color: var(--red); width: 24px; height: 24px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 14px; cursor: pointer; transition: 0.2s; }
.item-remove:hover { background: var(--red); color: #FFF; }

.order-receipt-footer {
  border-top: 2px dashed var(--card-border);
  padding-top: 1.5rem;
  margin-top: 1rem;
}

.order-total-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.order-total-label {
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.5px;
}

.order-total-value {
  font-weight: 800;
  font-size: 28px;
  color: var(--text-main);
}

.btn-cobrar {
  background: var(--gold);
  color: #000;
  width: 100%;
  padding: 16px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 16px;
  border: none;
  cursor: pointer;
  transition: 0.2s;
}

.btn-cobrar:hover {
  background: var(--gold-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ============= COMANDAS ABERTAS (KANBAN) ============= */
#lista-comandas {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.comanda-card {
  background: #FFF;
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  transition: 0.2s;
}

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

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

.comanda-info h3 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 6px;
}

.comanda-meta {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  display: flex;
  gap: 8px;
}

.comanda-items {
  background: var(--bg-app);
  border-radius: 12px;
  padding: 12px;
  flex: 1;
  margin-bottom: 1.5rem;
  max-height: 180px;
  overflow-y: auto;
}

.comanda-item-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.comanda-item-row:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.comanda-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comanda-total {
  font-weight: 800;
  font-size: 20px;
  text-align: right;
  color: var(--text-main);
}

.comanda-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ============= CAIXA LAYOUT ============= */
.caixa-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-md, 10px);
  gap: 1rem;
}
.caixa-banner > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.caixa-banner > div strong {
  font-size: 14px;
  font-weight: 700;
}
.caixa-banner > div span {
  font-size: 12px;
  color: var(--text-muted);
}
.caixa-banner-aberto {
  background: rgba(34, 197, 94, 0.10);
  border: 1px solid rgba(34, 197, 94, 0.35);
}
.caixa-banner-fechado {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.30);
}

.caixa-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.resumo-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  margin-top: 1rem;
  border-top: 2px dashed var(--card-border);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.mini-stats {
  display: grid;
  gap: 12px;
}

.mini-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  padding: 8px 0;
  border-bottom: 1px solid var(--card-border);
}

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

.mini-stat-row strong {
  color: var(--text-main);
  font-weight: 800;
}

/* ============= MODAIS ============= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal-overlay.open {
  display: flex;
  animation: fadeIn 0.2s;
}

.modal {
  background: #FFF;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
  margin-bottom: 2rem;
  text-align: center;
}

.modal-header h3 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 6px;
}

.modal-header p {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dim);
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 2rem;
}

.modal-actions .btn {
  flex: 1;
  padding: 16px;
  font-size: 15px;
}

.modal-total {
  font-size: 36px;
  font-weight: 800;
  text-align: center;
  color: var(--gold);
  margin: 1.5rem 0;
  background: var(--bg-app);
  padding: 1rem;
  border-radius: 16px;
}

.payment-btn {
  padding: 16px;
  border: 2px solid var(--card-border);
  background: #FFF;
  border-radius: 16px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: 0.2s;
  color: var(--text-dim);
}

.payment-btn:hover {
  border-color: var(--gold);
  color: var(--text-main);
}

.payment-btn.active {
  border-color: var(--gold);
  background: var(--gold-light);
  color: var(--text-main);
}

/* Caixa de desconto no modal de fechamento */
.desconto-box {
  margin: 1.5rem 0;
  padding: 1.5rem;
  background: var(--bg-app);
  border-radius: 16px;
  border: 1px solid var(--card-border);
}

.desconto-box-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.total-final-destaque {
  font-weight: 800;
  font-size: 18px;
  color: var(--green);
}

/* ============= TOASTS ============= */
.toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text-main);
  color: #FFF;
  padding: 14px 28px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 14px;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 3000;
  box-shadow: var(--shadow-lg);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

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

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

/* ============= EMPTY STATES ============= */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 600;
}

.empty-state-full {
  text-align: center;
  padding: 6rem 2rem;
  background: #FFF;
  border: 1px dashed var(--card-border);
  border-radius: var(--radius-lg);
  margin: 2rem 0;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
}

.empty-desc {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dim);
}

/* Utility */
.text-green {
  color: var(--green) !important;
}

.text-red {
  color: var(--red) !important;
}

/* Tabs de Compras */
.compras-tab { display: flex; gap: 24px; border-bottom: 2px solid var(--card-border); padding-bottom: 0; margin-bottom: 24px; }
.compras-tab .tab { padding: 12px 4px; background: none; border: none; font-size: 15px; font-weight: 700; color: var(--text-dim); cursor: pointer; transition: 0.2s; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.compras-tab .tab:hover { color: var(--text-main); }
.compras-tab .tab.active { color: var(--text-main); border-bottom-color: var(--gold); }

/* ============= MOBILE HEADER ============= */
.mobile-header {
  display: none;
}

/* ============= SIDEBAR OVERLAY ============= */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

.sidebar-overlay.active {
  display: block;
}

/* ============= RESPONSIVIDADE MOBILE ============= */
@media (max-width: 768px) {
  .mobile-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 1rem;
    height: 56px;
    background: var(--bg-sidebar);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .mobile-header-logo {
    height: 32px;
    filter: brightness(0) saturate(100%) invert(72%) sepia(38%) saturate(380%) hue-rotate(8deg) brightness(78%);
  }

  .hamburger-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 4px;
  }

  .hamburger-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--gold);
    border-radius: 2px;
    transition: 0.2s;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

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

  .app-layout {
    display: block;
  }

  .main-content {
    padding: 1.25rem 1rem;
    padding-top: calc(56px + 1.25rem);
    height: 100vh;
    width: 100%;
  }

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

  .produtos-comanda-grid {
    max-height: 40vh;
  }

  .produtos-table-wrapper,
  .data-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .data-table th,
  .data-table td {
    padding: 12px 10px;
    font-size: 13px;
  }

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

  .caixa-grid > * {
    min-width: 0;
  }

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

  #historico-list {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}