:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --ink: #1f2430;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #b8860b;      /* brass/gold — hardware store feel */
  --brand-dark: #8a6508;
  --accent: #16324f;     /* deep steel blue */
  --ok: #15803d;
  --warn: #b45309;
  --danger: #b91c1c;
  --radius: 12px;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

/* Layout shell -------------------------------------------------------------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--accent); color: #dbe4ee;
  display: flex; flex-direction: column;
  padding: 20px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 20px; }
.brand-mark {
  background: var(--brand); color: #fff; font-weight: 700;
  width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center; font-size: 15px;
}
.brand-text { font-size: 18px; font-weight: 700; color: #fff; }
nav { display: flex; flex-direction: column; gap: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  color: #cbd6e2; text-decoration: none; font-size: 15px;
}
.nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-link.is-active { background: var(--brand); color: #fff; }
.nav-ico { width: 20px; text-align: center; opacity: .9; }
.logout { margin-top: auto; padding-top: 16px; }
.logout button {
  width: 100%; padding: 10px; border: 1px solid rgba(255,255,255,.2);
  background: transparent; color: #cbd6e2; border-radius: 10px; cursor: pointer;
}
.logout button:hover { background: rgba(255,255,255,.08); color: #fff; }

.content { flex: 1; min-width: 0; }
.topbar {
  background: var(--panel); border-bottom: 1px solid var(--line);
  padding: 16px 28px;
}
.topbar h1 { margin: 0; font-size: 20px; }
.page { padding: 24px 28px; }

/* Cards & stats ------------------------------------------------------------- */
.grid { display: grid; gap: 16px; }
.stats { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px;
}
.stat .stat-label { color: var(--muted); font-size: 13px; }
.stat .stat-value { font-size: 26px; font-weight: 700; margin-top: 6px; }
.stat .stat-value.gold { color: var(--brand-dark); }

/* Panels & tables ----------------------------------------------------------- */
.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 22px;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.panel-head h2 { margin: 0; font-size: 16px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 11px 14px; text-align: right; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: #fafafa; color: var(--muted); font-weight: 600; white-space: nowrap; }
tbody tr:hover { background: #fafbfc; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* Badges -------------------------------------------------------------------- */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: #eef2f7; color: #334155;
}
.badge.ok { background: #dcfce7; color: var(--ok); }
.badge.warn { background: #fef3c7; color: var(--warn); }
.badge.off { background: #f1f5f9; color: #64748b; }
.badge.danger { background: #fee2e2; color: var(--danger); }
.status-pending { background: #fef3c7; color: var(--warn); }
.status-confirmed { background: #e0f2fe; color: #0369a1; }
.status-shipping { background: #ede9fe; color: #6d28d9; }
.status-delivered { background: #dcfce7; color: var(--ok); }
.status-cancelled { background: #fee2e2; color: var(--danger); }

/* Buttons & forms ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); cursor: pointer; font-size: 14px;
  text-decoration: none;
}
.btn:hover { background: #f8fafc; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-danger { color: var(--danger); border-color: #f3c6c6; }
.btn-danger:hover { background: #fef2f2; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

form.inline { display: inline; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line);
  border-radius: 9px; font: inherit; background: #fff; color: var(--ink);
}
.field textarea { min-height: 90px; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; }
.form-actions { display: flex; gap: 10px; margin-top: 8px; }

.thumb {
  width: 42px; height: 42px; border-radius: 8px; object-fit: cover;
  background: #eef2f7; border: 1px solid var(--line);
}
.thumb-fallback { display: grid; place-items: center; color: var(--muted); font-size: 18px; }

/* Login --------------------------------------------------------------------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: var(--accent); }
.login-card { width: 340px; background: #fff; border-radius: 16px; padding: 28px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.login-card .brand-mark { margin: 0 auto 14px; }
.login-card h1 { text-align: center; font-size: 20px; margin: 0 0 4px; }
.login-card p { text-align: center; color: var(--muted); margin: 0 0 20px; font-size: 14px; }
.login-error { background: #fee2e2; color: var(--danger); padding: 9px 12px; border-radius: 9px; font-size: 13px; margin-bottom: 14px; text-align: center; }

.empty { text-align: center; color: var(--muted); padding: 40px; }

@media (max-width: 720px) {
  .sidebar { width: 64px; }
  .brand-text, .nav-link span:last-child { display: none; }
  .field-row { grid-template-columns: 1fr; }
}
