/* واجهة المنصّة — للهاتف أولاً، وبخصائص منطقية فتعمل RTL وLTR. */
:root {
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --surface: #ffffff;
  --page: #f6f7f9;
  --brand: #0f766e;
  --brand-ink: #ffffff;
  --danger: #b91c1c;
  --ok: #15803d;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, "Segoe UI", "Noto Sans Arabic", Tahoma, sans-serif;
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--page);
}

h1 { font-size: 1.6rem; line-height: 1.3; margin: .5rem 0 1rem; }
h2 { font-size: 1.2rem; margin: 2rem 0 .75rem; }
a { color: var(--brand); }

.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .75rem 1rem;
  background: var(--surface);
  border-block-end: 1px solid var(--line);
}
.bar__brand { font-weight: 700; text-decoration: none; color: var(--ink); }

.page { max-width: 640px; margin-inline: auto; padding: 1rem 1rem 4rem; }

.muted { color: var(--muted); font-size: .95rem; }
.site-id { text-align: end; }

.link { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); cursor: pointer; text-decoration: underline; }

.notice { padding: .75rem 1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.notice--success { border-color: var(--ok); }
.notice--error { border-color: var(--danger); color: var(--danger); }

.form { display: grid; gap: 1.25rem; }
.field { display: grid; gap: .35rem; border: 0; padding: 0; margin: 0; min-width: 0; }
.field__label { font-weight: 600; }
.field__label--small { font-weight: 400; font-size: .95rem; }
.field__hint { color: var(--muted); font-size: .9rem; }
.field__error { color: var(--danger); font-size: .95rem; font-weight: 600; }

.input {
  width: 100%;
  min-height: 52px;
  padding: .6rem .8rem;
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid #9ca3af;
  border-radius: var(--radius);
}
.input:focus-visible, .button:focus-visible, .link:focus-visible, a:focus-visible { outline: 3px solid #5eead4; outline-offset: 2px; }
textarea.input { min-height: 8rem; }

.button {
  display: inline-block;
  min-height: 52px;
  padding: .7rem 1.4rem;
  font: inherit;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  color: var(--brand-ink);
  background: var(--brand);
  border: 2px solid var(--brand);
  border-radius: var(--radius);
  cursor: pointer;
}
.button[disabled] { opacity: .45; cursor: not-allowed; }
.button--quiet { color: var(--brand); background: transparent; }
.button--danger { background: var(--danger); border-color: var(--danger); }

.actions { display: grid; gap: .75rem; margin-block: 1.5rem; }
.actions form { display: grid; }

.cards, .steps, .problems { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.card, .steps__item {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  padding: .8rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.card__title { font-weight: 700; }
.problems li { padding: .6rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }

.badge { font-size: .85rem; padding: .1rem .6rem; border-radius: 999px; border: 1px solid var(--line); }
.badge--live { color: var(--ok); border-color: var(--ok); }
.badge--draft { color: var(--muted); }

.choice { display: flex; align-items: center; gap: .6rem; min-height: 44px; }
.choice input, .swatch input { width: 1.3rem; height: 1.3rem; }

.address { display: flex; align-items: center; gap: .4rem; direction: ltr; }
.address__domain { color: var(--muted); white-space: nowrap; }

.field__preview { display: block; border-radius: var(--radius); border: 1px solid var(--line); margin-block-end: .5rem; height: auto; }

.list { gap: .9rem; }
.list__row { display: grid; gap: .6rem; padding: .8rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }

.swatches { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; }
.swatch { display: flex; align-items: center; gap: .5rem; min-height: 44px; }
.swatch__colour { width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 1px solid var(--line); }

.order { display: flex; align-items: center; gap: .75rem; }
.order__position { width: 4.5rem; min-height: 44px; text-align: center; }

.danger { margin-block-start: 3rem; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.danger summary { cursor: pointer; color: var(--danger); }

@media (min-width: 640px) {
  .actions { grid-template-columns: repeat(3, auto); justify-content: start; }
  .swatches { grid-template-columns: repeat(3, 1fr); }
}
/* === الرسائل === */
.messages { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.messages__item {
    padding: 0.9rem 1rem;
    border: 1px solid var(--line, #e5e7eb);
    border-radius: 10px;
    background: #fff;
}
.messages__item--new { border-inline-start: 4px solid var(--brand, #0d9488); }
.messages__head { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.messages__head time { color: #6b7280; font-size: 0.8rem; }
.messages__contact { display: flex; gap: 1rem; margin: 0.2rem 0 0.6rem; font-size: 0.85rem; }
.messages__body { margin: 0 0 0.6rem; white-space: pre-line; }

/* الزوّار — أرقام قليلة تُقرأ بنظرة، لا لوحة قياس */
.stats { display: flex; flex-wrap: wrap; gap: 1.5rem; margin: 0 0 .5rem; }
.stats__figure { margin: 0; color: var(--muted, #64748b); }
.stats__figure strong { font-size: 1.6rem; color: inherit; display: block; line-height: 1.2; }
.stats__pages { margin: .25rem 0 .5rem; padding-inline-start: 1.1rem; color: var(--muted, #64748b); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: .5rem .6rem; text-align: start; border-bottom: 1px solid #e2e8f0; vertical-align: middle; }
.activity { margin: .25rem 0 1rem; padding-inline-start: 1.1rem; color: var(--muted, #64748b); font-size: .9rem; }
