/* NP Logistics — Preparação e Armazenamento */
:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --primary: #111827;
  --primary-hover: #374151;
  --accent: #2563eb;
  --accent-light: #dbeafe;
  --success: #16a34a;
  --success-light: #dcfce7;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --muted: #6b7280;
  --border: #e5e7eb;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,.08);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--primary);
  min-height: 100vh;
}

/* Nav */
.nav {
  background: var(--primary);
  color: white;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand { font-weight: 700; font-size: 15px; white-space: nowrap; }
.nav-brand span { color: #60a5fa; }
.nav-links { display: flex; gap: 4px; flex-wrap: wrap; }
.nav-links a {
  color: #d1d5db;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  transition: background .15s;
}
.nav-links a:hover, .nav-links a.active { background: #374151; color: white; }
.nav-links a.active { font-weight: 600; }

/* Layout */
.page { max-width: 1200px; margin: 0 auto; padding: 24px 16px; }
.page-title { font-size: 22px; font-weight: 700; margin-bottom: 20px; }

/* Cards */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; font-size: 11px; }

/* Stats grid */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 16px;
  box-shadow: var(--shadow);
  text-align: center;
}
.stat-value { font-size: 28px; font-weight: 700; line-height: 1; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat.blue .stat-value { color: var(--accent); }
.stat.green .stat-value { color: var(--success); }
.stat.orange .stat-value { color: var(--warning); }
.stat.red .stat-value { color: var(--danger); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: var(--radius-sm);
  border: none; cursor: pointer; font-size: 14px; font-weight: 600;
  text-decoration: none; transition: background .15s, transform .1s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-accent { background: var(--accent); color: white; }
.btn-accent:hover { background: #1d4ed8; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #15803d; }
.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover { background: #b45309; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-outline { background: transparent; border: 2px solid var(--border); color: var(--primary); }
.btn-outline:hover { border-color: var(--primary); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 14px 24px; font-size: 16px; }
.btn-xl { padding: 18px 32px; font-size: 18px; min-width: 180px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; padding: 10px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); border-bottom: 2px solid var(--border); }
td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:hover td { background: #f9fafb; }
tr:last-child td { border-bottom: none; }

/* Badges */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge-blue { background: var(--accent-light); color: var(--accent); }
.badge-green { background: var(--success-light); color: var(--success); }
.badge-orange { background: var(--warning-light); color: var(--warning); }
.badge-red { background: var(--danger-light); color: var(--danger); }
.badge-gray { background: #f3f4f6; color: var(--muted); }

/* Forms */
.form-group { margin-bottom: 16px; }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--muted); }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 2px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px;
  transition: border-color .15s;
  background: white;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; min-height: 80px; }

/* Filter bar */
.filter-bar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end;
  margin-bottom: 16px;
}
.filter-bar input, .filter-bar select { width: auto; flex: 1; min-width: 140px; }

/* Product row */
.product-row { display: flex; align-items: center; gap: 12px; }
.product-img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: #f3f4f6; flex-shrink: 0; }
.product-info .name { font-weight: 600; font-size: 14px; }
.product-info .sku { font-size: 12px; color: var(--muted); font-family: monospace; }

/* Scan area */
.scan-field {
  display: flex; gap: 8px; margin-bottom: 16px;
}
.scan-field input {
  font-size: 18px; font-family: monospace; letter-spacing: 1px;
  flex: 1;
}
.scan-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }

/* Scan feedback */
.scan-feedback {
  border-radius: var(--radius-sm); padding: 16px; margin: 12px 0;
  font-size: 16px; font-weight: 600; text-align: center;
  display: none;
}
.scan-feedback.ok { background: var(--success-light); color: var(--success); display: block; }
.scan-feedback.error { background: var(--danger-light); color: var(--danger); display: block; }
.scan-feedback.warn { background: var(--warning-light); color: var(--warning); display: block; }

/* Number input large */
.qty-input { font-size: 24px; text-align: center; padding: 12px; font-weight: 700; }

/* Prep station actions grid */
.action-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

/* Alert */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 14px; margin-bottom: 16px;
}
.alert-info { background: var(--accent-light); color: var(--accent); }
.alert-warning { background: var(--warning-light); color: var(--warning); }
.alert-danger { background: var(--danger-light); color: var(--danger); }
.alert-success { background: var(--success-light); color: var(--success); }

/* Progress bar */
.progress { background: var(--border); border-radius: 999px; height: 8px; overflow: hidden; margin: 8px 0; }
.progress-bar { height: 100%; border-radius: 999px; background: var(--accent); transition: width .3s; }

/* Label preview */
.label-preview {
  border: 2px dashed var(--border); border-radius: var(--radius-sm);
  padding: 16px; background: white; font-family: monospace;
  text-align: center;
}
.label-preview .product-name { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.label-preview .sku-text { font-size: 18px; font-weight: 900; letter-spacing: 2px; margin: 8px 0; }
.label-preview .barcode-wrap { margin: 8px 0; }
.label-preview .qty-text { font-size: 13px; color: var(--muted); }

/* Loading */
.loading { color: var(--muted); text-align: center; padding: 40px; font-size: 14px; }
.spinner {
  width: 32px; height: 32px; margin: 0 auto 12px;
  border: 3px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Empty */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-icon { font-size: 40px; margin-bottom: 12px; }

/* Responsive */
@media (max-width: 640px) {
  .nav-links a { font-size: 12px; padding: 5px 8px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .action-grid { grid-template-columns: 1fr 1fr; }
  .page { padding: 16px 12px; }
}

/* Print */
@media print {
  .nav, .filter-bar, .btn, .no-print { display: none !important; }
  .card { box-shadow: none; border: 1px solid #ccc; }
  .label-preview { border: 2px solid black; }
}
