:root {
  --steel: #263238;
  --steel-dark: #1a2327;
  --steel-light: #455a64;
  --orange: #f57c00;
  --orange-dark: #d96b00;
  --bg: #f4f5f6;
  --card: #ffffff;
  --gray-300: #dfe3e6;
  --text: #263238;
  --text-light: #607078;
  --green: #2e7d32;
  --red: #c62828;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  background: var(--steel);
  color: #fff;
  padding: 16px 0;
  border-bottom: 4px solid var(--orange);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.brand {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: #fff;
  text-transform: uppercase;
}
.brand span { color: var(--orange); }
.main-nav { display: flex; gap: 22px; align-items: center; }
.main-nav a {
  color: #dbe3e6;
  font-weight: 600;
  font-size: 0.92rem;
  transition: color .15s;
}
.main-nav a:hover { color: var(--orange); }
.cart-badge {
  background: var(--orange);
  color: #1a2327;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-left: 4px;
}

/* Category bar */
.category-bar {
  background: var(--steel-light);
  overflow-x: auto;
  white-space: nowrap;
}
.category-bar .container { display: flex; gap: 4px; padding-top: 0; padding-bottom: 0; }
.category-bar a {
  display: inline-block;
  color: #eef2f3;
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  border-bottom: 3px solid transparent;
}
.category-bar a:hover, .category-bar a.active { border-bottom-color: var(--orange); color: #fff; }

/* Hero */
.hero {
  background: linear-gradient(120deg, var(--steel) 0%, var(--steel-light) 100%);
  color: #fff;
  padding: 42px 0;
}
.hero h1 { margin: 0 0 8px; font-size: 2rem; }
.hero p { margin: 0; font-size: 1rem; opacity: 0.9; max-width: 560px; }

/* Section titles */
.section-title {
  font-size: 1.3rem;
  margin: 32px 0 16px;
  color: var(--steel);
  border-left: 5px solid var(--orange);
  padding-left: 12px;
  font-weight: 700;
}

/* Product grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
  margin-bottom: 36px;
}
.product-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--gray-300);
  display: flex;
  flex-direction: column;
  transition: transform .15s, box-shadow .15s;
}
.product-card:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(38,50,56,0.12); }
.product-card img { width: 100%; height: 160px; object-fit: contain; background: #fafbfb; padding: 10px; }
.product-card .body { padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-card h3 { margin: 0; font-size: 0.95rem; font-weight: 600; line-height: 1.3; }
.category-tag { font-size: 0.72rem; color: var(--orange-dark); font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; }
.price { font-weight: 800; color: var(--steel); font-size: 1.05rem; }
.stock-note { font-size: 0.78rem; color: var(--text-light); }

/* Buttons */
.btn {
  display: inline-block;
  border: none;
  border-radius: 6px;
  padding: 10px 20px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.9rem;
  text-align: center;
  transition: opacity .15s;
}
.btn:hover { opacity: 0.88; }
.btn-primary { background: var(--orange); color: #fff; }
.btn-secondary { background: var(--steel); color: #fff; }
.btn-outline { background: transparent; border: 2px solid var(--steel); color: var(--steel); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 14px; font-size: 0.82rem; }
.btn-danger { background: var(--red); color: #fff; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* Forms */
.form-group { margin-bottom: 16px; }
label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 0.88rem; color: var(--steel); }
input[type=text], input[type=email], input[type=tel], input[type=number],
input[type=password], textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
}
textarea { resize: vertical; min-height: 90px; }
.error-text { color: var(--red); font-size: 0.82rem; margin-top: 4px; }
.radio-row { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.radio-row label { font-weight: 500; margin: 0; display: flex; align-items: center; gap: 6px; color: var(--text); }
.help-text { font-size: 0.8rem; color: var(--text-light); margin-top: 4px; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; font-size: 0.9rem; }
.alert-success { background: #e8f5e9; color: var(--green); border: 1px solid #c3e6c5; }
.alert-error { background: #fdecea; color: var(--red); border: 1px solid #f5c6c2; }
.alert-info { background: #fff3e0; color: var(--orange-dark); border: 1px solid #ffe0b2; }

/* Cards / tables */
.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--gray-300);
  padding: 22px;
  margin-bottom: 22px;
}
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--gray-300); font-size: 0.9rem; }
th { color: var(--text-light); font-weight: 700; font-size: 0.8rem; text-transform: uppercase; }
.badge { padding: 3px 10px; border-radius: 999px; font-size: 0.76rem; font-weight: 700; }
.badge-pending { background: #fff3e0; color: #b6791a; }
.badge-processing { background: #e3f2fd; color: #1565c0; }
.badge-delivered { background: #e8f5e9; color: var(--green); }
.badge-cancelled { background: #fdecea; color: var(--red); }
.badge-unpaid { background: #fdecea; color: var(--red); }
.badge-paid { background: #e8f5e9; color: var(--green); }
.badge-active { background: #e8f5e9; color: var(--green); }
.badge-inactive { background: #eceff1; color: var(--text-light); }

/* Footer */
.site-footer {
  background: var(--steel-dark);
  color: #c7d0d3;
  padding: 30px 0;
  margin-top: 50px;
  font-size: 0.88rem;
}
.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.site-footer a { color: var(--orange); }
.license-note { opacity: 0.65; font-size: 0.76rem; margin-top: 6px; }

/* Admin layout */
.admin-wrapper { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 225px;
  background: var(--steel-dark);
  color: #cdd6d9;
  padding: 22px 0;
  flex-shrink: 0;
}
.admin-sidebar .brand { padding: 0 22px 22px; display: block; font-size: 1.25rem; }
.admin-sidebar nav a {
  display: block;
  padding: 10px 22px;
  color: #c7d0d3;
  font-weight: 600;
  font-size: 0.9rem;
}
.admin-sidebar nav a:hover, .admin-sidebar nav a.active { background: rgba(255,255,255,0.08); color: #fff; border-left: 3px solid var(--orange); }
.admin-main { flex: 1; padding: 28px; background: var(--bg); }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--card); border: 1px solid var(--gray-300); border-radius: var(--radius); padding: 18px; }
.stat-card .value { font-size: 1.5rem; font-weight: 800; color: var(--orange-dark); }
.stat-card .label { font-size: 0.82rem; color: var(--text-light); }
.login-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.login-box { width: 100%; max-width: 380px; }
.thumb-sm { width: 46px; height: 46px; object-fit: contain; border-radius: 6px; background: #fafbfb; border: 1px solid var(--gray-300); }
.pagination { margin-top: 16px; }
.pagination nav { display: flex; gap: 6px; flex-wrap: wrap; }
.ref-photo-note { font-size: 0.78rem; color: var(--text-light); background: #fff3e0; border: 1px dashed #ffcc80; padding: 8px 10px; border-radius: 6px; margin-bottom: 12px; }
.toggle-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.toggle-row input { width: auto; }
