/* G Zone Market — أساس التصميم المشترك (ألوان الهوية: فحمي، أخضر الغابة، مريمي، رملي، كريمي؛ الطيني للعروض بس) */
:root {
  --ink: #1e1f1c;
  --forest: #3f4f38;
  --sage: #6f7f5a;
  --sage-l: #c9d3b2;
  --sand: #cdbfa8;
  --cream: #efe8dc;
  --panel: #fbf8f4;
  --line: #e0d4c6;
  --muted: #5f5a52;
  --clay: #a94f2a;
  --ok: #1f7a4d;
  --bad: #b42318;
  --warn: #9a4a12;
  --r: 12px;
  --shadow: 0 1px 2px rgba(30, 31, 28, .06), 0 4px 16px rgba(30, 31, 28, .06);
  font-size: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Readex Pro", "Tajawal", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--cream); color: var(--ink); line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.latin, .num { font-family: "Montserrat", "Readex Pro", system-ui, sans-serif; font-variant-numeric: tabular-nums; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.25; }
h1 { font-size: 1.35rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
a { color: var(--forest); }
:focus-visible { outline: 3px solid var(--sage); outline-offset: 2px; }

/* أزرار — الحد الأدنى 44px */
.btn {
  min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:hover { border-color: var(--sand); }
.btn.primary { background: var(--forest); color: #fff; border-color: var(--forest); }
.btn.primary:hover { background: #33412d; }
.btn.ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn.bad { background: #fff; color: var(--bad); border-color: #e7b4ae; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.big { min-height: 56px; font-size: 1.1rem; padding: 0 22px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.busy::after { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

input, select, textarea {
  min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--sage); outline: none; box-shadow: 0 0 0 3px rgba(111, 127, 90, .25); }
label { display: block; font-size: .9rem; color: var(--muted); margin: 10px 0 4px; }
input.pin { font-size: 1.6rem; letter-spacing: .4em; text-align: center; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.right { margin-inline-start: auto; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; background: var(--sage-l); color: var(--forest); font-weight: 600; }
.pill.ok { background: #e1ead9; color: var(--ok); }
.pill.warn { background: #f6e3d3; color: var(--warn); }
.pill.bad { background: #f8dcd8; color: var(--bad); }
.pill.offer { background: var(--clay); color: #fff; }
.empty { text-align: center; color: var(--muted); padding: 32px 12px; }
table.t { width: 100%; border-collapse: collapse; }
table.t th, table.t td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: middle; }
table.t th { font-size: .85rem; color: var(--muted); font-weight: 600; }

/* نوافذ */
.modal-back { position: fixed; inset: 0; background: rgba(30, 31, 28, .45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal { background: var(--panel); border-radius: 16px; padding: 20px; width: min(520px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal.wide { width: min(860px, 100%); }
.modal-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

/* رسائل */
#toasts { position: fixed; bottom: 16px; inset-inline-start: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow); max-width: 420px; transition: opacity .4s; }
.toast.bad { background: var(--bad); } .toast.ok { background: var(--ok); }
.toast.out { opacity: 0; }

/* الشعار */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.brand .g { width: 36px; height: 36px; border-radius: 9px; background: var(--forest); color: var(--cream); display: grid; place-items: center; font-family: "Montserrat", sans-serif; font-size: 1.2rem; }
.brand .name { font-family: "Montserrat", sans-serif; letter-spacing: .04em; font-size: .95rem; }

@media print { .no-print { display: none !important; } body { background: #fff; } }
input.pin::placeholder { letter-spacing: normal; font-size: 1rem; }
[hidden] { display: none !important; }
a.btn { text-decoration: none; }
