/* سوق بنقرة — خطوط النظام العربية = صفر طلبات خطوط، أسرع تحميل */
:root {
  --bg: #F4EFE5;
  --surface: #FFFDF8;
  --surface-2: #ECE5D4;
  --ink: #1C2A26;
  --muted: #70685A;
  --teal: #135A4E;
  --teal-strong: #0C423A;
  --teal-deep: #082E29;
  --brass: #B4761F;
  --brass-strong: #8F5D16;
  --gold: #E9B45C;
  --line: #DFD6C2;
  --danger: #A63B2A;
  --ok: #2E6E4F;
  --on-teal: #EAF2EF;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(28, 42, 38, .08);
  --shadow-lg: 0 8px 24px rgba(28, 42, 38, .14);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131A18;
    --surface: #1B2422;
    --surface-2: #232E2B;
    --ink: #E8E4D8;
    --muted: #9A9482;
    --teal: #17695C;
    --teal-strong: #0F4C42;
    --teal-deep: #0A332C;
    --brass: #C98A2E;
    --brass-strong: #E0A64B;
    --gold: #E9B45C;
    --line: #2E3936;
    --danger: #C65B48;
    --ok: #5FBF8F;
    --on-teal: #D9E5E1;
    --shadow: 0 1px 3px rgba(0, 0, 0, .3);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, .4);
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "Noto Sans Arabic", "Noto Kufi Arabic", Tahoma, Arial, sans-serif;
  line-height: 1.7;
  font-size: 16px;
}
a { color: var(--teal); }
img { max-width: 100%; display: block; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

button, input, select, textarea { font-family: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- الهيدر ---------- */
.site-head {
  background: linear-gradient(180deg, var(--teal) 0%, var(--teal-strong) 100%);
  color: #fff;
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow-lg);
}
.head-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; white-space: nowrap; }
.logo-mark { font-size: 26px; }
.logo-text { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.logo-text em { font-style: normal; color: var(--gold); }

.country-form select {
  background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.25);
  border-radius: 20px; padding: 7px 14px; font-size: 14px; cursor: pointer; max-width: 160px;
}
.country-form select option { color: var(--ink); background: var(--surface); }
.country-form button { margin-inline-start: 6px; border: none; border-radius: 20px; padding: 7px 14px; cursor: pointer; }

.head-search { display: flex; flex: 1; min-width: 180px; }
.head-search input {
  flex: 1; border: none; border-radius: 10px 0 0 10px; padding: 10px 16px; font-size: 15px;
  background: #fff; color: #1C2A26; min-width: 0;
}
.head-search input:focus { outline: 2px solid var(--gold); }
.head-search button {
  border: none; background: var(--brass); color: #fff; padding: 10px 16px;
  border-radius: 0 10px 10px 0; font-size: 16px; cursor: pointer;
}
.head-search button:hover { background: var(--brass-strong); }

.head-nav { display: flex; align-items: center; gap: 14px; }
.head-nav a { color: var(--on-teal); text-decoration: none; font-size: 14.5px; }
.head-nav a:hover { color: #fff; text-decoration: underline; }
.nav-register { border: 1px solid rgba(255,255,255,.35); border-radius: 20px; padding: 5px 14px; }
.nav-register:hover { background: rgba(255,255,255,.1); text-decoration: none !important; }
.btn-post {
  background: var(--brass); color: #fff !important; padding: 9px 18px; border-radius: 10px;
  font-weight: 700; text-decoration: none !important; white-space: nowrap; font-size: 15px !important;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.btn-post:hover { background: var(--brass-strong); }
.btn-post.big { display: block; width: 100%; border: none; font-size: 17px !important; padding: 13px; cursor: pointer; border-radius: 10px; }
.inline-form { display: inline; }
.linklike { background: none; border: none; color: var(--on-teal); font-size: 14.5px; cursor: pointer; padding: 0; text-decoration: underline; }

/* ---------- الهيرو ---------- */
.hero {
  text-align: center;
  margin: 0 -16px;
  padding: 52px 20px 46px;
  background:
    radial-gradient(ellipse 900px 380px at 50% -80px, rgba(233,180,92,.16), transparent),
    linear-gradient(180deg, var(--teal-deep), var(--teal-strong));
  color: #fff;
}
.hero h1 { font-size: clamp(28px, 5vw, 44px); margin: 0 0 8px; font-weight: 800; letter-spacing: -.02em; }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero p { color: var(--on-teal); margin: 0 0 24px; font-size: 17px; }
.hero-search { display: flex; max-width: 560px; margin: 0 auto; box-shadow: var(--shadow-lg); border-radius: 12px; }
.hero-search input {
  flex: 1; border: none; border-radius: 12px 0 0 12px; padding: 15px 20px; font-size: 16px;
  background: #fff; color: #1C2A26; min-width: 0;
}
.hero-search button {
  border: none; background: var(--brass); color: #fff; padding: 15px 30px;
  border-radius: 0 12px 12px 0; font-size: 16px; font-weight: 800; cursor: pointer;
}
.hero-search button:hover { background: var(--brass-strong); }

/* ---------- شبكة الأقسام ---------- */
.cat-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 12px; padding: 26px 0 8px;
}
.cat-tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 12px 14px; text-align: center; text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow); transition: transform .15s, border-color .15s, box-shadow .15s;
}
.cat-tile:hover { transform: translateY(-3px); border-color: var(--brass); box-shadow: var(--shadow-lg); }
.cat-icon {
  font-size: 26px; display: inline-grid; place-items: center;
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--surface-2), transparent);
  border: 1px solid var(--line);
}
.cat-name { font-weight: 700; display: block; margin-top: 8px; font-size: 15px; }
.cat-count { color: var(--muted); font-size: 12.5px; display: block; }

.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sec-title { font-size: 21px; font-weight: 800; margin: 22px 0 14px; }
.sec-link { font-size: 14px; }
.page-title { font-size: clamp(22px, 4vw, 30px); font-weight: 800; margin: 22px 0 14px; }

/* ---------- البطاقات ---------- */
.cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
  gap: 14px; padding-bottom: 10px;
}
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; color: var(--ink); box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card-img { aspect-ratio: 4/3; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.card:hover .card-img img { transform: scale(1.04); }
.noimg { font-size: 44px; opacity: .45; }
.card-body { padding: 11px 13px 13px; }
.card-price { color: var(--brass-strong); font-weight: 800; font-size: 16.5px; }
.card-title {
  font-size: 15px; font-weight: 600; margin: 4px 0; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.6em;
}
.card-meta { color: var(--muted); font-size: 13px; }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 34px; text-align: center; color: var(--muted); }
.more {
  display: block; text-align: center; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px; margin: 8px 0 24px; text-decoration: none; font-weight: 700;
}
.more:hover { border-color: var(--brass); }

/* ---------- الفلاتر والفتات ---------- */
.crumbs { color: var(--muted); font-size: 14px; padding-top: 14px; }
.crumbs a { color: var(--muted); }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 18px; }
.filter-bar input[type=search], .filter-bar select {
  padding: 10px 13px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; background: var(--surface); color: var(--ink); flex: 1; min-width: 140px;
}
.filter-bar button {
  background: var(--teal); color: #fff; border: none; border-radius: 10px; padding: 10px 24px;
  font-size: 15px; font-weight: 700; cursor: pointer;
}
.filter-bar button:hover { background: var(--teal-strong); }
.results-note { color: var(--muted); }

/* ---------- صفحة الإعلان ---------- */
.ad { display: grid; grid-template-columns: 1fr 330px; gap: 22px; align-items: start; padding: 10px 0 30px; }
@media (max-width: 820px) { .ad { grid-template-columns: 1fr; } }
.ad-side { position: sticky; top: 76px; }
@media (max-width: 820px) { .ad-side { position: static; } }
.gallery-main { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface-2); height: auto; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; }
.gallery-thumbs img { width: 92px; height: 70px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.noimg-big { aspect-ratio: 4/3; display: grid; place-items: center; background: var(--surface-2); border-radius: var(--radius); font-size: 80px; opacity: .4; }
.ad-title { font-size: clamp(20px, 3.5vw, 28px); font-weight: 800; margin: 16px 0 4px; }
.ad-meta { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.ad-attrs {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 0 0 16px;
}
.ad-attrs dt { color: var(--muted); font-size: 13px; }
.ad-attrs dd { margin: 0; font-weight: 700; }
.ad-desc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; white-space: pre-wrap; word-break: break-word; }

.price-box {
  background: linear-gradient(135deg, var(--teal-strong), var(--teal-deep));
  color: #fff; border-radius: var(--radius); padding: 18px; text-align: center;
}
.ad-price { font-size: 25px; font-weight: 800; color: var(--gold); }
.seller-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: 12px; }
.seller-name { font-weight: 700; margin: 0 0 10px; }
.reveal summary {
  background: var(--brass); color: #fff; border-radius: 10px; padding: 11px; text-align: center;
  font-weight: 700; cursor: pointer; list-style: none;
}
.reveal summary::-webkit-details-marker { display: none; }
.reveal[open] summary { background: var(--surface-2); color: var(--muted); font-size: 13px; }
.phone { display: block; text-align: center; font-size: 22px; font-weight: 800; margin-top: 8px; color: var(--teal); }
@media (prefers-color-scheme: dark) { .phone { color: var(--gold); } }
.safety { color: var(--muted); font-size: 12.5px; margin: 12px 0 0; line-height: 1.6; }
.owner-actions { margin-top: 12px; }
.report { margin-top: 12px; font-size: 14px; }
.report summary { color: var(--muted); cursor: pointer; }
.report textarea { width: 100%; margin: 8px 0; }
.report button { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 14px; color: var(--ink); cursor: pointer; }
.notice { background: rgba(46,110,79,.12); border: 1px solid var(--ok); color: var(--ok); border-radius: 10px; padding: 10px 14px; margin: 14px 0; }
.notice.err { background: rgba(166,59,42,.1); border-color: var(--danger); color: var(--danger); }

/* ---------- الفورمات ---------- */
.post-form, .auth-box { max-width: 620px; margin: 0 auto 40px; }
.post-form {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 24px 26px 28px; margin-top: 20px; box-shadow: var(--shadow);
}
.auth-box {
  max-width: 440px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 26px 28px 24px; margin-top: 36px; box-shadow: var(--shadow); text-align: center;
}
.auth-tabs { display: flex; border-bottom: 2px solid var(--line); margin-bottom: 18px; }
.auth-tabs a {
  flex: 1; padding: 10px; text-decoration: none; color: var(--muted); font-weight: 700;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.auth-tabs a.active { color: var(--brass-strong); border-bottom-color: var(--brass); }
.auth-alt { color: var(--muted); font-size: 14px; margin-top: 16px; }

.post-form label, .auth-box label { display: block; margin: 14px 0 4px; font-weight: 700; text-align: right; }
.post-form small, .auth-box small { color: var(--muted); font-weight: 400; }
.post-form input, .post-form select, .post-form textarea,
.auth-box input, .report textarea {
  width: 100%; padding: 10px 13px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; background: var(--bg); color: var(--ink); margin-top: 4px;
}
.post-form input:focus, .post-form select:focus, .post-form textarea:focus, .auth-box input:focus {
  outline: 2px solid var(--brass); border-color: var(--brass);
}
.cat-attrs { border: 1px solid var(--line); border-radius: var(--radius); margin-top: 18px; padding: 4px 16px 16px; background: var(--bg); }
.cat-attrs legend { font-weight: 700; padding: 0 6px; }
.attr-group h4 { margin: 12px 0 0; color: var(--teal); }
@media (prefers-color-scheme: dark) { .attr-group h4 { color: var(--gold); } }
.post-form .btn-post.big { margin-top: 22px; }

/* ---------- إعلاناتي + الإدارة ---------- */
.my-list { display: grid; gap: 10px; margin-bottom: 30px; }
.my-row {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.my-row.removed { opacity: .55; }
.my-title { font-weight: 700; flex: 1; min-width: 180px; }
.my-meta { color: var(--muted); font-size: 13.5px; }
.btn-danger { background: var(--danger); color: #fff; border: none; border-radius: 8px; padding: 8px 16px; font-weight: 700; cursor: pointer; }
.btn-danger:hover { filter: brightness(.9); }
.sm { padding: 5px 12px; font-size: 13.5px; }
button.sm { border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); border-radius: 8px; cursor: pointer; }
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 24px; }
.admin-table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 14.5px; }
.admin-table th, .admin-table td { text-align: right; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.admin-table thead th { background: var(--surface-2); }
.admin-table .actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- الفوتر ---------- */
.site-foot { background: var(--teal-deep); color: var(--on-teal); margin-top: 36px; padding: 34px 0 0; font-size: 14px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 26px; padding-bottom: 24px; }
@media (max-width: 820px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .foot-grid { grid-template-columns: 1fr; } }
.foot-logo { font-size: 20px; font-weight: 800; color: #fff; margin: 0 0 8px; }
.foot-logo em { font-style: normal; color: var(--gold); }
.foot-about p { margin: 0; line-height: 1.8; }
.foot-col h4 { color: #fff; margin: 0 0 10px; font-size: 15px; }
.foot-col a { display: inline-block; color: var(--on-teal); text-decoration: none; margin: 0 0 6px 14px; }
.foot-col a:hover { color: var(--gold); }
.foot-safety { margin: 0; line-height: 1.8; }
.foot-bottom { border-top: 1px solid rgba(255,255,255,.12); padding: 14px 16px; text-align: center; opacity: .7; }

/* ---------- لوحة التحكم ---------- */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 8px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; text-align: center; box-shadow: var(--shadow);
}
.stat-n { display: block; font-size: 28px; font-weight: 800; color: var(--brass-strong); }
.stat-l { color: var(--muted); font-size: 13.5px; }

.mod-list { display: grid; gap: 12px; margin-bottom: 26px; }
.mod-card {
  display: grid; grid-template-columns: 130px 1fr auto; gap: 14px; align-items: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow);
}
@media (max-width: 640px) { .mod-card { grid-template-columns: 1fr; } }
.mod-img { aspect-ratio: 4/3; background: var(--surface-2); border-radius: 8px; overflow: hidden; display: grid; place-items: center; }
.mod-img img { width: 100%; height: 100%; object-fit: cover; }
.mod-title { font-weight: 700; font-size: 16px; }
.mod-meta { color: var(--muted); font-size: 13px; margin: 4px 0; }
.mod-desc { font-size: 14px; margin: 6px 0 0; color: var(--ink); }
.mod-actions { display: grid; gap: 8px; min-width: 120px; }
.btn-ok { background: var(--ok); color: #fff; border: none; border-radius: 8px; padding: 8px 16px; font-weight: 700; cursor: pointer; }
.btn-ok:hover { filter: brightness(.9); }

.badge { border-radius: 12px; padding: 2px 10px; font-size: 12.5px; font-weight: 700; }
.badge-active { background: rgba(46,110,79,.15); color: var(--ok); }
.badge-pending { background: rgba(180,118,31,.15); color: var(--brass-strong); }
.badge-rejected, .badge-removed { background: rgba(166,59,42,.12); color: var(--danger); }

.acct-h { font-size: 17px; font-weight: 800; margin: 6px 0 2px; text-align: right; }

/* ---------- زر جوجل ---------- */
.or-sep { display: flex; align-items: center; gap: 12px; color: var(--muted); margin: 18px 0 14px; font-size: 13px; }
.or-sep::before, .or-sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 10px; padding: 11px; background: var(--bg);
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 15px;
}
.btn-google:hover { border-color: var(--brass); }

/* ---------- تخطيط لوحة التحكم ---------- */
.dash-grid { display: grid; grid-template-columns: 230px 1fr; gap: 22px; align-items: start; padding: 20px 0 40px; }
@media (max-width: 860px) { .dash-grid { grid-template-columns: 1fr; } }
.dash-side {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); position: sticky; top: 76px;
}
@media (max-width: 860px) { .dash-side { position: static; } }
.dash-side h3 { margin: 0 0 12px; font-size: 16px; }
.dash-side nav { display: grid; gap: 4px; }
.dash-side a {
  display: block; padding: 9px 12px; border-radius: 8px; text-decoration: none;
  color: var(--ink); font-size: 14.5px; font-weight: 600;
}
.dash-side a:hover { background: var(--surface-2); }
.dash-side a.active { background: var(--teal); color: #fff; }
.dash-ver { margin: 14px 0 0; color: var(--muted); font-size: 12.5px; text-align: center; }
.dash-main { min-width: 0; }

.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 22px; box-shadow: var(--shadow);
}
.panel-note { color: var(--muted); font-size: 14px; margin: 0 0 12px; line-height: 1.9; }
.panel label { display: block; font-weight: 700; margin: 10px 0 4px; }
.panel input[type=text], .panel input[type=file] {
  width: 100%; padding: 10px 13px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--ink); font-size: 15px; margin-bottom: 8px;
}
.big-btn { display: block; width: 100%; padding: 13px; font-size: 16px; border-radius: 10px; border: none; cursor: pointer; font-weight: 800; }
.rules { margin: 0 0 16px; padding-inline-start: 22px; color: var(--ink); font-size: 14px; line-height: 2; }
.rules code, .panel-note code {
  background: var(--surface-2); padding: 1px 6px; border-radius: 5px;
  font-family: ui-monospace, Consolas, monospace; font-size: 13px; direction: ltr; display: inline-block;
}

.log-tabs { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.log-tabs a {
  padding: 8px 16px; border-radius: 8px; text-decoration: none; font-weight: 700; font-size: 14px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink);
}
.log-tabs a.active { background: var(--teal); color: #fff; border-color: var(--teal); }
.log-view {
  background: #10181A; color: #C9D8D3; border-radius: var(--radius); padding: 16px;
  font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; line-height: 1.8;
  overflow-x: auto; white-space: pre-wrap; word-break: break-word; direction: ltr; text-align: left;
  max-height: 640px; overflow-y: auto;
}
.form-note { color: var(--muted); font-size: 13.5px; text-align: center; margin: 12px 0 0; }
a.btn-ok { display: inline-block; text-decoration: none; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
