/* ==========================================================================
   REPRESENTA — Sistema de Catálogos & Simulador de Pedidos
   Design System Comercial & Mobile-First (Modo Claro & Modo Escuro)
   ========================================================================== */

:root {
  /* Paleta Base Light */
  --primary: #059669;
  --primary-hover: #047857;
  --primary-light: #ecfdf5;
  --whatsapp: #25d366;
  --whatsapp-hover: #1eb855;
  
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-muted: #f1f5f9;
  --bg-input: #ffffff;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --border: #e2e8f0;
  --border-focus: #10b981;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --warning: #f59e0b;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 20px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.06);
  --shadow-drawer: 0 -4px 24px rgba(0, 0, 0, 0.15);
  
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   MODO ESCURO (DARK MODE)
   ========================================================================== */
[data-theme="dark"] {
  --primary: #10b981;
  --primary-hover: #059669;
  --primary-light: rgba(16, 185, 129, 0.16);
  --whatsapp: #25d366;
  --whatsapp-hover: #1eb855;

  --bg-body: #0b1120;
  --bg-card: #141f36;
  --bg-muted: #1e293b;
  --bg-input: #0f172a;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-light: #64748b;

  --border: #24344d;
  --border-focus: #10b981;
  --danger: #f87171;
  --danger-light: rgba(239, 68, 68, 0.16);
  --warning: #fbbf24;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 8px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 28px -4px rgba(0, 0, 0, 0.6);
  --shadow-drawer: 0 -6px 32px rgba(0, 0, 0, 0.7);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* ==========================================================================
   TIPOGRAFIA & BOTÕES BASE
   ========================================================================== */
h1, h2, h3, h4, h5 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-main);
}

p {
  color: var(--text-muted);
}

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

button:active, .btn:active {
  transform: scale(0.98);
}

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

.btn-whatsapp {
  background-color: var(--whatsapp);
  color: #ffffff;
}
.btn-whatsapp:hover {
  background-color: var(--whatsapp-hover);
}

.btn-secondary {
  background-color: var(--bg-card);
  border-color: var(--border);
  color: var(--text-main);
}
.btn-secondary:hover {
  background-color: var(--bg-muted);
  border-color: var(--border-focus);
}

.btn-danger {
  background-color: var(--danger-light);
  color: var(--danger);
  border-color: transparent;
}
.btn-danger:hover {
  opacity: 0.9;
}

.btn-icon {
  padding: 8px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}
.btn-icon:hover {
  background: var(--bg-muted);
  color: var(--text-main);
}

/* Botão Toggle Modo Escuro / Claro */
.btn-theme-toggle {
  background: var(--bg-muted);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: var(--radius-full);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition);
}
.btn-theme-toggle:hover {
  border-color: var(--border-focus);
  background: var(--bg-card);
}

.btn-block {
  width: 100%;
}

/* ==========================================================================
   FORMULÁRIOS & CAMPOS
   ========================================================================== */
.form-group {
  margin-bottom: 16px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-main);
  background-color: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.form-control::placeholder {
  color: var(--text-light);
}

.form-text {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.form-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ==========================================================================
   PAINEL ADMIN (index.html)
   ========================================================================== */
.admin-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  padding: 20px;
}

.login-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  text-align: center;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.admin-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-header-title h1 {
  font-size: 22px;
}

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

.marcas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.marca-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
}

.marca-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-focus);
}

.marca-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.marca-logo-thumb {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  object-fit: contain;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  padding: 4px;
}

.marca-logo-placeholder {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  border: 1px solid var(--primary);
}

.marca-info {
  flex: 1;
  overflow: hidden;
}

.marca-nome {
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
}

.marca-slug-badge {
  display: inline-block;
  font-size: 12px;
  font-family: monospace;
  color: var(--text-muted);
  background: var(--bg-muted);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  margin-top: 4px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}
.status-badge.ativo {
  background: var(--primary-light);
  color: var(--primary);
}
.status-badge.inativo {
  background: var(--bg-muted);
  color: var(--text-muted);
}

.marca-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* ==========================================================================
   VITRINE PÚBLICA (catalogo.html)
   ========================================================================== */
.vitrine-body {
  background-color: var(--bg-body);
  overflow: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.vitrine-header {
  height: 64px;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 20;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.vitrine-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
  max-width: 45%;
}

.vitrine-logo {
  height: 40px;
  max-width: 120px;
  object-fit: contain;
}

.vitrine-title {
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
}

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

.btn-pedido-trigger {
  background: var(--primary);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-weight: 700;
  box-shadow: 0 3px 12px rgba(16, 185, 129, 0.35);
  position: relative;
  border: none;
}
.btn-pedido-trigger:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.badge-itens-count {
  background: #ffffff;
  color: #059669;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  margin-left: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.pdf-container {
  flex: 1;
  width: 100%;
  height: calc(100vh - 64px);
  position: relative;
  background: #0f172a;
}

.pdf-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.pdf-fallback {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-body);
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

.pdf-fallback-card {
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 32px 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

/* ==========================================================================
   SIMULADOR DE PEDIDOS (DRAWER / PLANILHA COM MODO DARK E BOTÃO INLINE)
   ========================================================================== */
.drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(5px);
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.drawer-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  bottom: 0;
  right: 0;
  left: 0;
  height: 92vh;
  max-height: 880px;
  background: var(--bg-card);
  color: var(--text-main);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  box-shadow: var(--shadow-drawer);
  z-index: 51;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.25s ease;
  border-top: 1px solid var(--border);
}

@media (min-width: 900px) {
  .drawer {
    left: auto;
    top: 0;
    bottom: 0;
    width: 780px;
    height: 100vh;
    max-height: none;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-left: 1px solid var(--border);
    border-top: none;
    transform: translateX(100%);
  }
}

.drawer-backdrop.active ~ .drawer {
  transform: translateY(0);
}
@media (min-width: 900px) {
  .drawer-backdrop.active ~ .drawer {
    transform: translateX(0);
  }
}

.drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
}

.drawer-title-area h2 {
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.auto-save-indicator {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.drawer-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  -webkit-overflow-scrolling: touch;
  background: var(--bg-body);
}

/* ==========================================================================
   TABELA ESTILO PLANILHA (INTERATIVA)
   ========================================================================== */
.planilha-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.tabela-pedido {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  font-size: 14px;
}

.tabela-pedido thead th {
  background: var(--bg-muted);
  color: var(--text-main);
  padding: 10px 8px;
  text-align: left;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.tabela-pedido tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background-color 0.15s ease;
}

.tabela-pedido tbody tr:hover {
  background-color: var(--bg-muted);
}

.tabela-pedido tbody tr:last-child {
  border-bottom: none;
}

.tabela-pedido td {
  padding: 6px 6px;
  vertical-align: middle;
}

/* Inputs da Planilha */
.tabela-pedido input {
  width: 100%;
  padding: 8px 10px;
  font-size: 13.5px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-main);
  font-family: inherit;
  transition: var(--transition);
}

.tabela-pedido input:focus {
  outline: none;
  border-color: var(--border-focus);
  background: var(--bg-card);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}

.tabela-pedido input::placeholder {
  color: var(--text-light);
}

.col-subtotal {
  font-weight: 800;
  color: var(--primary);
  text-align: right;
  padding-right: 10px !important;
  white-space: nowrap;
  font-size: 14px;
}

/* Botões da Linha: Adicionar (+) e Excluir (✕) */
.linha-acoes {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
}

.btn-add-inline {
  background: var(--primary-light);
  border: 1px solid transparent;
  color: var(--primary);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.btn-add-inline:hover {
  background: var(--primary);
  color: #ffffff;
  transform: scale(1.05);
}

.btn-remove-linha {
  background: transparent;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  line-height: 1;
  transition: var(--transition);
}
.btn-remove-linha:hover {
  color: var(--danger);
  background: var(--danger-light);
}

/* Dica de Teclado Enter */
.dica-teclado {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.kbd-badge {
  background: var(--bg-muted);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-family: monospace;
  font-weight: 700;
  color: var(--text-main);
}

/* Rodapé do Drawer */
.drawer-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.total-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.total-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-muted);
}

.total-valor {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary);
}

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

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

/* ==========================================================================
   MODAIS & OVERLAYS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.modal-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  transform: scale(0.96);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-main);
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

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

.modal-header h3 {
  font-size: 18px;
}

.modal-body {
  padding: 22px;
}

.modal-footer {
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  background: var(--bg-muted);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.qrcode-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0;
}

.qrcode-box {
  padding: 16px;
  background: #ffffff;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 14px;
}

/* ==========================================================================
   TOASTS / FEEDBACKS
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  color: var(--text-main);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInUp 0.3s ease;
  pointer-events: auto;
  border: 1px solid var(--border);
}

.toast.success { border-left: 4px solid #10b981; }
.toast.error { border-left: 4px solid #ef4444; }
.toast.info { border-left: 4px solid #3b82f6; }

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



/* ==========================================================================
   TELA DE LOGIN GLASSMORPHISM COM FUNDO IMAGEM (IMGUR LOCAL)
   ========================================================================== */
body.login-page-bg {
  margin: 0 !important;
  padding: 20px !important;
  width: 100vw !important;
  min-height: 100vh !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: 
    linear-gradient(135deg, rgba(15, 23, 42, 0.72) 0%, rgba(10, 15, 30, 0.88) 100%),
    url('/img/bg-login.jpg') center center / cover no-repeat fixed !important;
  background-color: #0b1120 !important;
  overflow-x: hidden !important;
}

.login-glow-sphere {
  position: absolute;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.35) 0%, rgba(16, 185, 129, 0) 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1;
  filter: blur(50px);
}

.login-glass-card {
  background: rgba(15, 23, 42, 0.72) !important;
  backdrop-filter: blur(28px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 24px !important;
  box-shadow: 
    0 30px 60px -12px rgba(0, 0, 0, 0.8), 
    inset 0 1px 1px rgba(255, 255, 255, 0.25) !important;
  padding: 44px 34px !important;
  width: 100% !important;
  max-width: 420px !important;
  position: relative !important;
  z-index: 2 !important;
  text-align: center !important;
  color: #ffffff !important;
  margin: auto !important;
}


@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.login-glass-card .brand-badge {
  color: #34d399;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-shadow: 0 0 20px rgba(52, 211, 153, 0.4);
}

.login-glass-card h2 {
  color: #ffffff;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
}

.login-glass-card p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  margin-bottom: 28px;
}

.form-control-glass {
  width: 100%;
  padding: 13px 16px;
  font-size: 15px;
  font-family: inherit;
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  transition: all 0.2s ease;
  margin-bottom: 16px;
}

.form-control-glass:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.15);
  border-color: #34d399;
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.3);
}

.form-control-glass::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.btn-glass-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 15px;
  padding: 14px 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 24px -4px rgba(16, 185, 129, 0.5);
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-glass-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px -4px rgba(16, 185, 129, 0.65);
  background: linear-gradient(135deg, #34d399 0%, #059669 100%);
}

.btn-glass-primary:active {
  transform: scale(0.98);
}

/* ==========================================================================
   PAINEL DASHBOARD /HOME (REDESENHADO & REFINADO)
   ========================================================================== */
.stats-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}

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

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.stat-info h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

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


/* Grid e Cards Refinados do Dashboard */
.stats-banner {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
  gap: 16px !important;
  margin-bottom: 28px !important;
}

.stat-card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  padding: 18px 20px !important;
  box-shadow: var(--shadow-sm) !important;
  display: flex !important;
  align-items: center !important;
  gap: 16px !important;
  transition: var(--transition) !important;
}

.stat-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: var(--shadow-md) !important;
  border-color: var(--border-focus) !important;
}

.marcas-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important;
  gap: 20px !important;
}

.marca-card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  padding: 22px !important;
  box-shadow: var(--shadow-sm) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  transition: var(--transition) !important;
}

.marca-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: var(--shadow-md) !important;
  border-color: var(--border-focus) !important;
}


/* ==========================================================================
   LAYOUT EM 2 COLUNAS LADO A LADO:
   Coluna 1 (Catálogo Virtual) + Coluna 2 (Planilha de Pedidos)
   ========================================================================== */
.vitrine-split-container {
  display: flex;
  flex: 1;
  width: 100%;
  height: calc(100vh - 64px);
  position: relative;
  overflow: hidden;
  background-color: var(--bg-body);
}

/* Coluna 1: Catálogo PDF */
.coluna-catalogo {
  flex: 1;
  width: 100%;
  height: 100%;
  position: relative;
  background: #0f172a;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Coluna 2: Planilha de Digitar Pedido */
.coluna-pedido {
  width: 0;
  max-width: 0;
  opacity: 0;
  visibility: hidden;
  height: 100%;
  background: var(--bg-card);
  color: var(--text-main);
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 30;
}

/* Quando o usuário clica em 'Montar pedido' (Modo 2 Colunas Ativado): */
@media (min-width: 860px) {
  .vitrine-split-container.split-active .coluna-catalogo {
    flex: 0 0 54%;
    width: 54%;
    max-width: 54%;
  }

  .vitrine-split-container.split-active .coluna-pedido {
    flex: 0 0 46%;
    width: 46%;
    max-width: 46%;
    opacity: 1;
    visibility: visible;
  }

  /* Modo Tela Cheia da Planilha */
  .vitrine-split-container.split-fullscreen .coluna-catalogo {
    display: none !important;
  }
  .vitrine-split-container.split-fullscreen .coluna-pedido {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
}



/* ==========================================================================
   MODO CELULAR / MOBILE (< 860px)
   Catálogo 100% da tela e Pedido 100% da tela alternados pela barra inferior
   ========================================================================== */
@media (max-width: 859px) {
  /* No celular, o botão de abrir pedido no topo fica oculto pois a navegação é feita na barra inferior */
  .vitrine-header .btn-pedido-trigger {
    display: none !important;
  }

  .vitrine-split-container {
    display: block !important;
    width: 100% !important;
    width: 100vw !important;
    height: calc(100vh - 64px) !important;
    position: relative !important;
    overflow: hidden !important;
  }

  /* Catálogo ocupa 100% da tela */
  #vitrine-layout-container #coluna-catalogo,
  .vitrine-split-container #coluna-catalogo,
  .coluna-catalogo {
    display: block !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    flex: 1 1 100% !important;
    z-index: 10 !important;
    overflow-x: auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* Planilha de Pedido quando fechada */
  #vitrine-layout-container #coluna-pedido,
  .vitrine-split-container #coluna-pedido,
  .coluna-pedido {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  /* Quando o Pedido estiver ativo no celular (100% da tela) */
  .vitrine-split-container.split-active #coluna-catalogo {
    display: none !important;
  }

  #vitrine-layout-container.vitrine-split-container.split-active #coluna-pedido,
  .vitrine-split-container.split-active #coluna-pedido,
  .vitrine-split-container.split-active .coluna-pedido {
    display: flex !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    flex: 1 1 100% !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    border: none !important;
    border-radius: 0 !important;
    transform: none !important;
    box-shadow: none !important;
    z-index: 20 !important;
  }

  /* Desativa resizer desktop no celular */
  .split-resizer {
    display: none !important;
  }

  /* Espaçamento no corpo e rodapé da planilha para não cobrir a barra inferior */
  .drawer-body {
    padding-bottom: 24px !important;
  }

  .drawer-footer {
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* No mobile, oculta botão de fullscreen pois a planilha já ocupa 100% da tela */
  #btn-toggle-fullscreen {
    display: none !important;
  }

  /* Barra de navegação inferior mobile (Catálogo e Pedido) */
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed !important;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px)) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 99999 !important;
    max-width: calc(100vw - 24px) !important;
    background: rgba(15, 23, 42, 0.94) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.22) !important;
    border-radius: 9999px !important;
    padding: 4px 5px !important;
    gap: 6px !important;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.65), 0 2px 10px rgba(0, 0, 0, 0.4) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    user-select: none !important;
  }

  [data-theme="light"] .mobile-bottom-nav {
    background: rgba(255, 255, 255, 0.96) !important;
    border: 1.5px solid rgba(0, 0, 0, 0.15) !important;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.22), 0 2px 10px rgba(0, 0, 0, 0.1) !important;
  }

  .btn-mobile-nav {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    padding: 9px 18px !important;
    border-radius: 9999px !important;
    border: none !important;
    background: transparent !important;
    color: #94a3b8 !important;
    font-size: 13.5px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
    white-space: nowrap !important;
    outline: none !important;
  }

  @media (max-width: 380px) {
    .btn-mobile-nav {
      padding: 8px 12px !important;
      font-size: 12.5px !important;
      gap: 5px !important;
    }
  }

  [data-theme="light"] .btn-mobile-nav {
    color: #64748b !important;
  }

  .btn-mobile-nav:active {
    transform: scale(0.95) !important;
  }

  .btn-mobile-nav.active {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.5) !important;
  }

  .btn-mobile-nav .nav-icon {
    font-size: 16px !important;
    line-height: 1 !important;
  }

  .btn-mobile-nav .nav-badge {
    background: #ef4444 !important;
    color: #ffffff !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    padding: 2px 7px !important;
    border-radius: 9999px !important;
    line-height: 1 !important;
    border: 1.5px solid rgba(255, 255, 255, 0.5) !important;
  }
}

.planilha-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   MODO DE EXIBIÇÃO: LISTA OU BLOCO (CARDS) NO PAINEL ADMIN
   ========================================================================== */
.view-toggle-group {
  display: inline-flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 3px;
}

.btn-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-view-toggle:hover {
  color: var(--text-main);
}

.btn-view-toggle.active {
  background: #2563eb !important;
  color: #ffffff !important;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.3);
}

/* MODO LISTA (TABELA ESTRUTURADA) */
.marcas-lista-table-wrap {
  width: 100%;
  overflow-x: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.marcas-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.marcas-table th {
  background: var(--bg-muted);
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.marcas-table td {
  padding: 12px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

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

.marcas-table tr:hover {
  background: rgba(37, 99, 235, 0.04);
}

.mini-grade-badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  color: var(--text-muted);
  margin-right: 3px;
}
