/* ==========================================================
   بوابة التاجر — تصميم نظيف ومركّز
   ========================================================== */
:root {
  --color-bg: #0F1115;
  --color-surface: #171A21;
  --color-surface-2: #1F232C;
  --color-border: #2A2F3A;
  --color-text: #E8EAF0;
  --color-muted: #8B92A3;
  --color-primary: #4F8CFF;
  --color-success: #2E9E5B;
  --color-danger: #E5484D;
  --radius: 12px;
  --font-display: "Almarai", sans-serif;
  --font-body: "Tajawal", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
}
button { cursor: pointer; border: none; font-family: inherit; }
.hidden { display: none !important; }
input, select, textarea {
  width: 100%; padding: 10px 13px; border-radius: 9px; font-family: inherit; font-size: 13.5px;
  background: var(--color-surface-2); border: 1px solid var(--color-border); color: var(--color-text);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--color-primary); }

/* ---------- Login ---------- */
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(circle at 30% 20%, rgba(79,140,255,.12), transparent 60%);
}
.login-box {
  width: 100%; max-width: 400px; background: var(--color-surface);
  border: 1px solid var(--color-border); border-radius: 18px; padding: 32px 26px;
}
.login-logo { font-size: 40px; text-align: center; margin-bottom: 10px; }
.login-box h1 { font-family: var(--font-display); font-size: 21px; text-align: center; }
.login-sub { text-align: center; color: var(--color-muted); font-size: 13px; margin: 6px 0 22px; }
.remember-row {
  display: flex; align-items: center; gap: 8px; font-size: 12.5px;
  color: var(--color-muted); margin-bottom: 14px; cursor: pointer;
}
.remember-row input { width: 16px; height: 16px; }
.login-links {
  display: flex; justify-content: space-between; margin-top: 14px; font-size: 12.5px;
}
.login-links span { color: var(--color-muted); text-decoration: underline; cursor: pointer; }
.login-links span:hover { color: var(--color-primary); }
.reset-box { margin-top: 18px; border-top: 1px solid var(--color-border); padding-top: 18px; }

/* ---------- Layout ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; background: var(--color-surface);
  border-bottom: 1px solid var(--color-border); position: sticky; top: 0; z-index: 20;
}
.topbar__brand { display: flex; align-items: center; gap: 11px; }
.topbar__icon { font-size: 24px; }
.topbar__name { font-family: var(--font-display); font-size: 15.5px; }
.topbar__store { font-size: 11.5px; color: var(--color-muted); }

.tabs {
  display: flex; gap: 4px; padding: 0 16px; background: var(--color-surface);
  border-bottom: 1px solid var(--color-border); overflow-x: auto; scrollbar-width: none;
  position: sticky; top: 61px; z-index: 19;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 13px 16px; font-size: 13.5px; font-weight: 600; color: var(--color-muted);
  border-bottom: 2px solid transparent; white-space: nowrap; cursor: pointer;
}
.tab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }

main { padding: 22px 20px 60px; max-width: 1200px; margin: auto; }

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; gap: 12px; flex-wrap: wrap;
}
.page-title { font-family: var(--font-display); font-size: 20px; }
.page-subtitle { font-size: 12.5px; color: var(--color-muted); margin-top: 3px; }
.search-input { margin-bottom: 14px; }

/* ---------- Panels & tables ---------- */
.panel {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius); overflow: hidden;
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  background: var(--color-surface-2); padding: 11px 12px; text-align: right;
  font-size: 11.5px; color: var(--color-muted); font-weight: 700;
  border-bottom: 1px solid var(--color-border);
}
td { padding: 11px 12px; border-bottom: 1px solid var(--color-border); }
tr:last-child td { border-bottom: none; }
.empty-state { text-align: center; color: var(--color-muted); padding: 34px 20px; font-size: 13px; }

/* ---------- Buttons ---------- */
.btn {
  padding: 10px 18px; border-radius: 9px; font-size: 13.5px; font-weight: 700;
  font-family: inherit; transition: opacity .15s;
}
.btn:hover { opacity: .88; }
.btn--primary { background: var(--color-primary); color: #fff; }
.btn--ghost { background: var(--color-surface-2); color: var(--color-text); border: 1px solid var(--color-border); }
.btn--danger { background: var(--color-danger); color: #fff; }
.btn--sm { padding: 6px 12px; font-size: 12px; }
.btn-row { display: flex; gap: 6px; flex-wrap: wrap; }

.badge { padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge--active { background: rgba(46,158,91,.15); color: var(--color-success); }
.badge--cancelled { background: rgba(229,72,77,.15); color: var(--color-danger); }
.badge--pending { background: rgba(232,98,44,.15); color: #E8622C; }

/* ---------- Stats ---------- */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 13px; margin-bottom: 20px; }
.stat-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius); padding: 15px;
}
.stat-card__label { font-size: 11.5px; color: var(--color-muted); margin-bottom: 5px; }
.stat-card__value { font-family: var(--font-display); font-size: 20px; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center; padding: 24px 16px; overflow-y: auto;
}
.modal-box {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 16px; padding: 22px; width: 100%; max-width: 620px; margin: auto;
}
.modal-box h2 { font-family: var(--font-display); font-size: 18px; margin-bottom: 16px; }
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 12.5px; color: var(--color-muted); margin-bottom: 6px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.error-text { color: var(--color-danger); font-size: 12.5px; margin-top: 10px; }
.upload-note {
  font-size: 12px; color: var(--color-muted); background: var(--color-surface-2);
  border: 1px solid var(--color-border); border-radius: 9px; padding: 9px 11px; line-height: 1.7;
}
.img-preview-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 9px; }
.thumb { width: 34px; height: 34px; border-radius: 7px; object-fit: cover; vertical-align: middle; margin-left: 8px; }
.product-name-cell { display: flex; align-items: center; }

/* ---------- Attributes (نفس نظام لوحة الأدمن) ---------- */
.attrs-block { border: 1px solid var(--color-border); border-radius: 12px; padding: 14px; background: var(--color-surface-2); }
.attrs-hint { font-size: 12px; color: var(--color-muted); line-height: 1.7; margin-bottom: 10px; }
.attrs-empty { font-size: 12.5px; color: var(--color-muted); padding: 12px; text-align: center; border: 1px dashed var(--color-border); border-radius: 10px; margin-top: 8px; }
.attrs-templates { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.attr-tpl-chip {
  background: var(--color-surface); border: 1px solid var(--color-border); color: var(--color-text);
  padding: 7px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; font-family: inherit;
}
.attr-tpl-chip:hover { border-color: var(--color-primary); color: var(--color-primary); }
.attr-card { border: 1px solid var(--color-border); border-radius: 10px; padding: 11px; margin-top: 9px; background: var(--color-surface); }
.attr-card__head { display: flex; gap: 8px; align-items: center; margin-bottom: 9px; }
.attr-name-input { flex: 1; }
.attr-type-select { width: auto; padding: 8px 10px; font-size: 12.5px; }
.attr-values { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.attr-val-chip {
  display: inline-flex; align-items: center; gap: 5px; background: var(--color-surface-2);
  border: 1px solid var(--color-border); padding: 5px 10px; border-radius: 999px; font-size: 12px;
}
.attr-val-chip b { cursor: pointer; opacity: .5; font-size: 11px; }
.attr-val-chip b:hover { opacity: 1; color: var(--color-danger); }
.attr-val-dot { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(128,128,128,.4); display: inline-block; }
.attr-val-add { min-width: 165px; flex: 1; padding: 6px 10px; border-radius: 999px; font-size: 12px; background: transparent; border: 1px dashed var(--color-border); }

.combos-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; flex-wrap: wrap; gap: 8px; }
.combos-title { font-weight: 700; font-size: 13.5px; }
.combos-total { font-size: 11.5px; color: var(--color-muted); }
.combos-bulk { display: flex; gap: 7px; margin-bottom: 9px; }
.combos-bulk input { width: 165px; }
.combos-table-wrap { max-height: 320px; overflow-y: auto; border: 1px solid var(--color-border); border-radius: 10px; }
.combos-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.combos-table thead th { position: sticky; top: 0; background: var(--color-surface-2); z-index: 1; padding: 9px 8px; }
.combos-table td { padding: 6px 8px; }
.combo-label span { display: inline-block; background: var(--color-surface-2); padding: 2px 8px; border-radius: 6px; font-size: 11.5px; margin-left: 3px; }
.combo-in { min-width: 68px; padding: 6px 8px; border-radius: 7px; font-size: 12px; }
.combo-del { background: transparent; color: var(--color-muted); font-size: 13px; padding: 4px 6px; }
.combo-del:hover { color: var(--color-danger); }

/* ---------- Vendor orders ---------- */
.vorder-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius); padding: 15px; margin-bottom: 13px;
}
.vorder-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 11px; flex-wrap: wrap; gap: 8px; }
.vorder-num { font-family: var(--font-display); font-size: 14.5px; }
.vorder-date { font-size: 11.5px; color: var(--color-muted); }
.vorder-item {
  display: flex; justify-content: space-between; padding: 8px 0;
  border-bottom: 1px dashed var(--color-border); font-size: 13px;
}
.vorder-item:last-child { border-bottom: none; }
.vorder-opt { font-size: 11.5px; color: var(--color-muted); }
