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

:root {
  --bg-main: #0f172a;
  --bg-card: #1e293b;
  --bg-hover: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #ef4444;
  --primary-hover: #dc2626;
  --success: #10b981;
  --warning: #f59e0b;
  --info: #3b82f6;
  --border: #334155;
  --radius: 12px;
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

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

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

/* Header Navbar Responsiva */
.navbar {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-wrap: wrap;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 18px;
  color: #fff;
  text-decoration: none;
}

.brand-badge {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: #fff;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  color: #fff;
  background-color: var(--bg-hover);
}

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

.sound-toggle.muted {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--primary);
}

/* Layout Principal */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 16px;
  width: 100%;
  flex: 1;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, background-color 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

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

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

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

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

.btn-secondary:hover {
  background-color: #475569;
}

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

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* Kanban Board de Pedidos Responsivo */
.kanban-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.kanban-col {
  background-color: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  max-height: 80vh;
}

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

.kanban-title {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.col-count {
  background-color: var(--bg-hover);
  color: var(--text-muted);
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
}

.kanban-body {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

/* Card do Pedido */
.order-card {
  background-color: #0f172a;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: transform 0.2s, border-color 0.2s;
  animation: fadeIn 0.3s ease;
}

.order-card:hover {
  border-color: #475569;
}

.order-card.new-pending {
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
  animation: pulseRed 1.5s infinite;
}

@keyframes pulseRed {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.order-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border);
}

.order-id {
  font-weight: 800;
  font-size: 16px;
  color: #fff;
}

.order-time {
  font-size: 12px;
  color: var(--text-muted);
}

.customer-info {
  margin-bottom: 12px;
}

.customer-name {
  font-weight: 700;
  font-size: 15px;
  color: #f1f5f9;
}

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

.customer-address {
  font-size: 12px;
  color: #cbd5e1;
  background-color: var(--bg-hover);
  padding: 8px;
  border-radius: 6px;
  margin-top: 6px;
}

.order-items-list {
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.order-item-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.order-item-qty {
  font-weight: 700;
  color: var(--primary);
  margin-right: 6px;
}

.order-total-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-weight: 700;
}

.total-price {
  font-size: 16px;
  color: var(--success);
}

.order-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.order-actions .btn {
  flex: 1;
  justify-content: center;
}

/* Modais e Formulários */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  padding: 16px;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 550px;
  box-shadow: var(--shadow);
  max-height: 90vh;
  overflow-y: auto;
}

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

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

.form-control {
  width: 100%;
  padding: 10px 14px;
  background-color: #0f172a;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

/* Media Queries Responsivas (Mobile & Tablet) */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-menu {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

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

  .kanban-col {
    max-height: none;
  }
}
