/* ==============================================================
   Webpedidos - Skinão Grill - Design System & Painel do Caixa
   Estilo Moderno, Responsivo e Otimizado para Operação Rápida
   ============================================================== */

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

:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --bg-hover: #334155;
  --border-color: #334155;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --primary: #f43f5e;
  --primary-hover: #e11d48;
  --primary-glow: rgba(244, 63, 94, 0.3);
  
  --accent: #f59e0b;
  --success: #10b981;
  --info: #0ea5e9;
  --danger: #ef4444;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.4);
}

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

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* NAVBAR SUPERIOR */
.navbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
}

.nav-logo-badge {
  background: linear-gradient(135deg, #f43f5e, #fb923c);
  color: white;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 0 15px var(--primary-glow);
}

.nav-title {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.5px;
}

.nav-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

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

.live-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--success);
}

.live-dot {
  width: 8px;
  height: 8px;
  background-color: var(--success);
  border-radius: 50%;
  animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

/* BOTÕES GERAIS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff;
  box-shadow: 0 2px 8px var(--primary-glow);
}
.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-main);
}
.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: #475569;
}

.btn-success {
  background: var(--success);
  color: white;
}
.btn-success:hover {
  filter: brightness(1.1);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

/* ÁREA DE CONTÊINER PRINCIPAL */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  width: 100%;
}

/* CARDS DE ESTATÍSTICAS / STATUS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s;
}
.stat-card:hover {
  transform: translateY(-2px);
}

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

.stat-pendente .stat-icon { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.stat-preparo .stat-icon { background: rgba(14, 165, 233, 0.15); color: #0ea5e9; }
.stat-concluido .stat-icon { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.stat-total .stat-icon { background: rgba(244, 63, 94, 0.15); color: #f43f5e; }

.stat-val {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
}

/* ALERTA DE NOVO PEDIDO EM DESTAQUE */
.banner-alerta-pedidos {
  display: none;
  background: linear-gradient(135deg, #e11d48, #b91c1c);
  color: white;
  border-radius: var(--radius-lg);
  padding: 16px 24px;
  margin-bottom: 24px;
  box-shadow: 0 8px 24px rgba(225, 29, 72, 0.4);
  animation: shake 0.6s ease infinite alternate;
  align-items: center;
  justify-content: space-between;
}

@keyframes shake {
  0% { transform: scale(1); }
  100% { transform: scale(1.01); }
}

/* FILTROS E BUSCA */
.filter-bar {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.filter-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn.active, .filter-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* GRID DE PEDIDOS */
.orders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
}

.order-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.order-card:hover {
  border-color: #475569;
  box-shadow: var(--shadow-md);
}

.order-card.status-pendente {
  border-left: 4px solid var(--accent);
}
.order-card.status-preparo {
  border-left: 4px solid var(--info);
}
.order-card.status-concluido {
  border-left: 4px solid var(--success);
}
.order-card.status-cancelado {
  border-left: 4px solid var(--dim);
  opacity: 0.7;
}

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

.order-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-delivery { background: rgba(14, 165, 233, 0.2); color: #38bdf8; }
.badge-retirada { background: rgba(168, 85, 247, 0.2); color: #c084fc; }
.badge-mesa { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }

.badge-pendente { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.badge-preparo { background: rgba(14, 165, 233, 0.2); color: #38bdf8; }
.badge-concluido { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.badge-cancelado { background: rgba(100, 116, 139, 0.2); color: #94a3b8; }

.order-client {
  margin-bottom: 12px;
}
.client-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}
.client-address {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.order-items-preview {
  background: rgba(15, 23, 42, 0.5);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 13px;
  margin-bottom: 14px;
}

.order-item-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.order-footer-details {
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.order-total-val {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}

.order-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* FORMULÁRIOS E TELAS DE LOGIN/CONFIG */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at top right, #1e1b4b, #0f172a);
}

.auth-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.form-group {
  margin-bottom: 18px;
}

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

.form-control {
  width: 100%;
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #fff;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 18px;
}
.alert-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}
.alert-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

/* IFRAME OCULTO DE IMPRESSÃO */
#printFrame {
  display: none;
}
