/* اعمل من بنها — public version */
:root {
  --navy: #09254A;
  --navy2: #0E3A6E;
  --gold: #FFC400;
  --gold-dark: #E0A800;
  --bg: #F4F6F8;
  --card: #FFFFFF;
  --text: #1C2733;
  --muted: #667085;
  --border: #E3E8EE;
  --green: #1E8E5A;
  --red: #C0392B;
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { direction: rtl; }
body {
  font-family: 'Cairo', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}
a { color: var(--navy2); text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 15px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
label { font-weight: 700; font-size: 14px; display: block; margin-bottom: 5px; }

/* header */
header { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 10px rgba(0,0,0,.2); }
.header-inner { max-width: 1200px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.logo { font-size: 24px; font-weight: 900; color: #fff; white-space: nowrap; }
.logo span { color: var(--gold); }
.logo small { display: block; font-size: 11px; font-weight: 400; color: #C7D3E0; }
nav.main-nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav.main-nav a { color: #D7E2EE; padding: 7px 11px; border-radius: 8px; font-size: 14.5px; font-weight: 700; }
nav.main-nav a:hover, nav.main-nav a.active { background: rgba(255,255,255,.14); color: #fff; }
.header-spacer { flex: 1; }
.btn { display: inline-block; border: none; border-radius: 10px; padding: 10px 18px; font-weight: 800; font-size: 15px; transition: .15s; }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: var(--gold-dark); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy2); }
.btn-ghost { background: #fff; color: var(--navy); border: 1.5px solid var(--navy); }
.btn-danger { background: var(--red); color: #fff; }
.btn-green { background: var(--green); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 13.5px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.google-btn { display: inline-flex; align-items: center; gap: 10px; background: #fff; color: #1F2937; border: 1px solid #DADCE0; border-radius: 10px; padding: 10px 18px; font-weight: 800; font-size: 15px; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.google-btn:hover { background: #F8F9FA; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; color: #fff; font-weight: 700; font-size: 14px; }
.user-chip img { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--gold); object-fit: cover; }

/* layout */
.container { max-width: 1200px; margin: 0 auto; padding: 18px 16px 60px; }
.hero { background: linear-gradient(135deg, var(--navy) 0%, var(--navy2) 100%); color: #fff; border-radius: var(--radius); padding: 34px 26px; text-align: center; margin-bottom: 20px; }
.hero h1 { font-size: 30px; font-weight: 900; }
.hero h1 span { color: var(--gold); }
.hero p { color: #D7E2EE; font-size: 17px; margin-top: 6px; }
.notice { border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; font-size: 14.5px; font-weight: 700; }
.notice.warn { background: #FFF7E0; border: 1px solid #F0D060; color: #7A5B00; }
.notice.info { background: #E8F0FE; border: 1px solid #A8C4F0; color: #174EA6; }
.notice.error { background: #FDECEA; border: 1px solid #F5A9A2; color: #8B1A12; }
.notice.ok { background: #E6F4EA; border: 1px solid #A3D9B1; color: #137333; }

/* categories */
.cat-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.cat-chip { background: #fff; border: 1.5px solid var(--border); border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: 14px; color: var(--navy); }
.cat-chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.cat-chip .count { color: var(--muted); font-size: 12px; }
.cat-chip.active .count { color: var(--gold); }

/* filters */
.filters { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; align-items: end; }
.filters .field { display: flex; flex-direction: column; }

/* listing grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s; }
.card:hover { box-shadow: 0 6px 20px rgba(9,37,74,.14); }
.card .thumb { position: relative; aspect-ratio: 4/3; background: #DCE3EA; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 13px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h3 { font-size: 16.5px; line-height: 1.5; }
.card .price { font-size: 19px; font-weight: 900; color: var(--navy); }
.card .meta { color: var(--muted); font-size: 13.5px; }
.card .foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 8px; }
.badge { display: inline-block; font-size: 12px; font-weight: 800; border-radius: 999px; padding: 2px 9px; }
.badge-gold { background: var(--gold); color: var(--navy); }
.badge-navy { background: var(--navy); color: #fff; }
.badge-demo { background: #FFF3CD; color: #7A5B00; border: 1px dashed #D9A400; }
.badge-green { background: #E6F4EA; color: #137333; }
.badge-red { background: #FDECEA; color: #8B1A12; }
.badge-grey { background: #EEF1F4; color: var(--muted); }
.views { color: var(--muted); font-size: 13px; }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty h2 { color: var(--navy); margin-bottom: 8px; }

/* detail */
.detail { display: grid; grid-template-columns: 1.2fr .8fr; gap: 20px; align-items: start; }
.detail .gallery img { border-radius: var(--radius); width: 100%; aspect-ratio: 4/3; object-fit: cover; background: #DCE3EA; }
.detail .thumbs { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.detail .thumbs img { width: 76px; height: 58px; object-fit: cover; border-radius: 8px; border: 2px solid transparent; cursor: pointer; }
.detail .thumbs img.sel { border-color: var(--gold); }
.panel { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.panel h2 { font-size: 19px; margin-bottom: 8px; }
.panel h3 { font-size: 16px; margin-bottom: 8px; }
.seller-row { display: flex; align-items: center; gap: 10px; }
.seller-row .avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--navy); color: var(--gold); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 900; }
.kv { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--border); padding: 7px 0; font-size: 14.5px; }
.kv:last-child { border-bottom: none; }
.kv b { color: var(--navy); }

/* forms */
.form-card { max-width: 680px; margin: 0 auto; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.form-card h2 { margin-bottom: 4px; }
.form-card .sub { color: var(--muted); margin-bottom: 16px; font-size: 14.5px; }
.field { margin-bottom: 14px; }
.field .hint { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.field-error { color: var(--red); font-size: 13px; font-weight: 700; margin-top: 4px; display: none; }
.field.invalid .field-error { display: block; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--red); }
.photo-preview { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.photo-preview img { width: 90px; height: 70px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }

/* tables (admin) */
table.admin { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; font-size: 14px; }
table.admin th, table.admin td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: right; vertical-align: top; }
table.admin th { background: var(--navy); color: #fff; font-size: 13.5px; }
table.admin tr:hover td { background: #F6F8FA; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tab { background: #fff; border: 1.5px solid var(--border); border-radius: 999px; padding: 7px 15px; font-weight: 800; font-size: 14px; color: var(--navy); }
.tab.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* plans */
.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.plan-card { background: #fff; border: 2px solid var(--border); border-radius: var(--radius); padding: 20px; position: relative; }
.plan-card.hot { border-color: var(--gold); box-shadow: 0 6px 22px rgba(255,196,0,.25); }
.plan-card h3 { font-size: 19px; }
.plan-card .plan-price { font-size: 30px; font-weight: 900; color: var(--navy); }
.plan-card .plan-price small { font-size: 14px; color: var(--muted); font-weight: 700; }
.plan-card ul { list-style: none; margin: 12px 0; }
.plan-card li { padding: 5px 0; font-size: 14.5px; }
.plan-card li::before { content: '✓ '; color: var(--green); font-weight: 900; }

/* messages */
.chat-list { display: grid; gap: 10px; }
.chat-item { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; cursor: pointer; }
.chat-item:hover { border-color: var(--gold); }
.msg-thread { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.msg { max-width: 75%; padding: 9px 13px; border-radius: 12px; margin-bottom: 8px; font-size: 15px; }
.msg.mine { background: var(--navy); color: #fff; margin-right: auto; }
.msg.theirs { background: #EEF1F4; }
.msg .time { display: block; font-size: 11px; opacity: .7; margin-top: 3px; }

/* footer */
footer { background: var(--navy); color: #C7D3E0; margin-top: 30px; }
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 26px 16px; font-size: 14px; display: flex; gap: 24px; flex-wrap: wrap; justify-content: space-between; }
footer b { color: #fff; }
footer a { color: var(--gold); }

@media (max-width: 760px) {
  .detail { grid-template-columns: 1fr; }
  .hero h1 { font-size: 23px; }
  .logo { font-size: 20px; }
}
