/* =========================================================
   E-Commerce – minimal, working CSS (CLEANED)
   Safe full file replacement
   ========================================================= */

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #111827;
  background: #ffffff;
  line-height: 1.45;
}
a { color: #1a73e8; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- layout helpers ---------- */
.container-narrow { max-width: 560px; margin: 24px auto; padding: 0 16px; }
.card { padding: 24px; background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; }
.h2-tight { margin: 0 0 16px; }

/* ---------- forms ---------- */
.form-label { display: block; margin: 12px 0 6px; font-weight: 600; }
.input {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #fff;
}
.input:focus {
  outline: none;
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26,115,232,.15);
}
.actions { margin-top: 16px; }
.actions-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; font-size: 14px; }
.text-muted { color: #6b7280; }
.link { text-decoration: none; }

/* ---------- buttons ---------- */
.btn-primary {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 16px;
  border: 0;
  background: #1a73e8;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary:hover { filter: brightness(0.95); }

/* ---------- flash messages ---------- */
.alert { margin: 12px 0; padding: 10px; border-radius: 8px; border: 1px solid transparent; }
.alert-success { background: #e8fff1; border-color: #b7f3cc; color: #065f46; }
.alert-error   { background: #ffecec; border-color: #ffb3b3; color: #7f1d1d; }

/* ---------- toasts ---------- */
#toasts {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 18px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  min-width: 260px;
  max-width: 92vw;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  box-shadow: 0 6px 24px rgba(0,0,0,.12);
  font-size: 14px;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .25s ease, transform .25s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background:#e8fff1; border-color:#b7f3cc; color:#065f46; }
.toast-error   { background:#ffecec; border-color:#ffb3b3; color:#7f1d1d; }

/* ---------- header / nav ----------
   supports both your old <header><nav> and .site-header/.navbar/.nav-links */
header, .site-header {
  background: #0f172a;
  color: #fff;
  border-bottom: 1px solid #0b1220;
}
header nav, .navbar {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
header nav a, .nav-links a {
  color: #e5e7eb;
  text-decoration: none;
  font-weight: 600;
}
header nav a:hover, .nav-links a:hover { color: #ffffff; }
.brand { color: #fff; font-weight: 800; letter-spacing: .2px; text-decoration: none; }
.nav-links { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.nav-spacer { flex: 1; }
.nav-links a.is-active { color: #ffffff; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }

/* ---------- tables & admin bits ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { border: 1px solid #e5e7eb; padding: 10px; text-align: left; }
.table th { background: #f8fafc; font-weight: 700; }
.table tr:nth-child(even) { background: #fafafa; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; background:#eef2ff; color:#3730a3; }
.btn-danger {
  display:inline-block; padding:8px 12px; border-radius:10px; border:0;
  background:#dc2626; color:#fff; font-weight:600; cursor:pointer; text-decoration:none;
}
.btn-danger:hover { filter: brightness(.95); }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid #e5e7eb;
  color: #6b7280;
  padding: 20px 16px;
  margin-top: 24px;
  text-align: center;
  background: #fff;
}

/* ---------- responsive ---------- */
@media (max-width: 480px) {
  .navbar { gap: 12px; }
  .card { padding: 20px; }
  .actions-row { flex-direction: column; align-items: flex-start; }
}

/* =========================================================
   iOS-friendly inputs (no zoom, clean focus) — keep at end
   ========================================================= */
html { -webkit-text-size-adjust: 100%; } /* avoid unexpected text scaling */

/* Make all common controls 16px to stop iOS auto-zoom */
form input[type="text"],
form input[type="email"],
form input[type="password"],
form input[type="number"],
form input[type="tel"],
form textarea,
form select,
form button {
  font-size: 16px !important;
}

/* Space and focus styles that beat inline attributes */
form input[type="text"],
form input[type="email"],
form input[type="password"],
form input[type="number"],
form input[type="tel"],
form textarea,
form select {
  -webkit-appearance: none !important;
  appearance: none !important;
  background-clip: padding-box !important;
  margin-bottom: 14px !important;
  border-radius: 10px !important;
}

form input[type="text"]:focus,
form input[type="email"]:focus,
form input[type="password"]:focus,
form input[type="number"]:focus,
form input[type="tel"]:focus,
form textarea:focus,
form select:focus {
  outline: none !important;
  border-color: #1a73e8 !important;
  box-shadow: 0 0 0 3px rgba(26,115,232,.22) !important;
}

/* Prevent the glow being clipped by cards */
.card { overflow: visible !important; }

/* Keep autofill from yellowing the field on iOS/Chrome */
input[type="text"]:-webkit-autofill,
input[type="email"]:-webkit-autofill,
input[type="password"]:-webkit-autofill {
  -webkit-text-fill-color: #111827;
  box-shadow: 0 0 0 1000px #fff inset;
  transition: background-color 9999s ease-in-out 0s;
}
/* Scoped H2 icons per section */
.barcode-page .card h2::before { content: "🧾"; }
.settings-page .card h2::before { content: "⚙️"; }
.users-page .card h2::before { content: "👤"; }
.table-scroll { overflow-x: auto; }