/* ==========================================================
   ERIFY.NG — Orange / White theme
   ========================================================== */

:root {
  --orange: #ff7a00;
  --orange-dark: #e56700;
  --orange-light: #fff1e6;
  --orange-soft: #ffe4cc;
  --bg: #ffffff;
  --surface: #fff8f2;
  --text: #1a1a1a;
  --text-muted: #6b6b6b;
  --border: #f0dcc9;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --radius: 14px;
  --shadow: 0 4px 16px rgba(255, 122, 0, 0.10);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

[data-theme="dark"] {
  --orange: #ff8c1a;
  --orange-dark: #ff7a00;
  --orange-light: #2a1a0d;
  --orange-soft: #3a230f;
  --bg: #14100c;
  --surface: #1c1712;
  --text: #f5ede4;
  --text-muted: #b8a999;
  --border: #33261a;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s ease, color 0.2s ease;
}

a { color: var(--orange); text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 20px;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.1s ease, opacity 0.15s ease;
  text-align: center;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-dark); }
.btn-outline { background: transparent; border: 1.5px solid var(--orange); color: var(--orange); }
.btn-outline:hover { background: var(--orange-light); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-danger { background: var(--danger); color: #fff; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
.navbar .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; color: var(--text); }
.brand span { color: var(--orange); }
.navbar-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--orange-light); border: none; cursor: pointer; color: var(--orange);
}
.wallet-chip {
  background: var(--orange-light);
  color: var(--orange-dark);
  font-weight: 700;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 20px;
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.category-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 8px;
  text-align: center;
  color: var(--text);
}
.category-card .icon { font-size: 26px; color: var(--orange); margin-bottom: 6px; }
.category-card .name { font-size: 12.5px; font-weight: 600; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  color: var(--text);
}
.product-card .thumb {
  height: 100px;
  background: var(--orange-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; color: var(--orange);
}
.product-card .info { padding: 12px; }
.product-card .name { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.product-card .price { color: var(--orange-dark); font-weight: 800; font-size: 16px; }
.product-card .stock { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 16px; }
label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  font-family: var(--font);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange); }

/* ---------- Alerts ---------- */
.alert { padding: 12px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; }
.alert-success { background: #e8f8ee; color: var(--success); border: 1px solid #b7ebc6; }
.alert-error { background: #fdecec; color: var(--danger); border: 1px solid #f6c2c2; }
.alert-info { background: var(--orange-light); color: var(--orange-dark); border: 1px solid var(--orange-soft); }

/* ---------- Bottom nav (mobile) ---------- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-around;
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  z-index: 200;
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 10.5px; color: var(--text-muted); flex: 1;
}
.bottom-nav a.active { color: var(--orange); }
.bottom-nav .nav-icon { font-size: 19px; }

/* ---------- Tables (admin) ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 700; }
.badge-success { background: #e8f8ee; color: var(--success); }
.badge-warning { background: #fff5e0; color: var(--warning); }
.badge-danger { background: #fdecec; color: var(--danger); }
.badge-orange { background: var(--orange-light); color: var(--orange-dark); }

/* ---------- Admin layout ---------- */
.admin-wrap { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 230px; background: var(--surface); border-right: 1px solid var(--border);
  padding: 20px 14px; flex-shrink: 0;
}
.admin-sidebar a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px; color: var(--text); font-size: 14px; font-weight: 600;
  margin-bottom: 2px;
}
.admin-sidebar a.active, .admin-sidebar a:hover { background: var(--orange-light); color: var(--orange-dark); }
.admin-content { flex: 1; padding: 24px; max-width: 100%; overflow-x: auto; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.stat-card .value { font-size: 24px; font-weight: 800; color: var(--orange-dark); }
.stat-card .label { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }

@media (max-width: 768px) {
  .category-grid { grid-template-columns: repeat(3, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-sidebar { display: none; }
  .admin-wrap.sidebar-open .admin-sidebar { display: block; position: fixed; inset: 0 20% 0 0; z-index: 300; }
  body { padding-bottom: 64px; }
}
@media (min-width: 769px) {
  .bottom-nav { display: none; }
}
