:root {
  --accent: #f5a623;
  --ink: #1d2433;
  --muted: #6b7385;
  --line: #e6e8ee;
  --bg: #f6f7fb;
  --card: #ffffff;
  --ok: #16a34a;
  --bad: #dc2626;
  --radius: 14px;
  font-family: 'Tajawal', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); line-height: 1.6; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.hidden { display: none !important; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.narrow { max-width: 560px; margin: 24px auto; }
@media (max-width: 600px) { .narrow { margin: 0; border-radius: 0; border: 0; min-height: 100vh; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: #fff; border-radius: 10px;
  padding: 9px 16px; cursor: pointer; font-weight: 500; text-decoration: none;
}
.btn:hover { border-color: #c9cdd8; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(.95); border-color: var(--accent); }
.btn-block { width: 100%; padding: 13px; font-size: 1.05rem; }
.btn:disabled { opacity: .6; cursor: default; }
.btn-ok { color: var(--ok); }
.btn-bad { color: var(--bad); }

input[type=text], input[type=number], input[type=tel], input[type=password], textarea, select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff;
}
textarea { resize: vertical; min-height: 80px; }
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-weight: 500; margin-bottom: 4px; }

/* ---------- Review page ---------- */
.review-page h1 { font-size: 1.4rem; margin: 0 0 4px; }
.product { border-top: 1px solid var(--line); padding: 18px 0; }
.product-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.product-head img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; background: var(--bg); }
.product-head strong { display: block; }
.stars-input { display: flex; gap: 4px; margin: 6px 0 12px; }
.stars-input button {
  border: 0; background: none; padding: 0; cursor: pointer; font-size: 2.1rem; line-height: 1; color: #d6d9e0;
}
.stars-input button.on { color: var(--accent); }
.photo-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.photo-row img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
.photo-add {
  display: inline-flex; align-items: center; gap: 6px; border: 1px dashed #c9cdd8; border-radius: 10px;
  padding: 8px 12px; cursor: pointer; color: var(--muted); font-size: .9rem;
}
.photo-add input { display: none; }
.thanks { text-align: center; padding: 40px 10px; }
.thanks .big { font-size: 3rem; }
.error { color: var(--bad); margin-top: 10px; }

/* ---------- Dashboard ---------- */
.dash { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; }
.dash header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.dash header h1 { font-size: 1.35rem; margin: 0; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); font-size: .8rem; }
.badge.approved, .badge.sent, .badge.completed { color: var(--ok); }
.badge.rejected, .badge.failed { color: var(--bad); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat .num { font-size: 1.7rem; font-weight: 700; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.active { border-bottom-color: var(--accent); font-weight: 700; }
.filters { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.filters .btn.active { border-color: var(--accent); color: var(--accent); }
.review-item { display: grid; gap: 6px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.review-item .top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.review-item .stars { color: var(--accent); letter-spacing: 2px; }
.review-item .photos { display: flex; gap: 6px; flex-wrap: wrap; }
.review-item .photos img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; }
.review-item .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.reply-box { background: var(--bg); border-radius: 10px; padding: 8px 12px; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: start; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-wrap { overflow-x: auto; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 20px; }
pre.snippet { background: #10141f; color: #e8ecf5; padding: 14px; border-radius: 10px; overflow-x: auto; direction: ltr; text-align: left; font-size: .85rem; }
.toast { position: fixed; bottom: 20px; inset-inline-start: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 10; }
[dir=rtl] .toast { transform: translateX(50%); }
.empty { padding: 40px 10px; text-align: center; color: var(--muted); }
