/* ============================================================
   AVENOR Auctions — نظام التصميم
   RTL-first, light theme, Saudi fintech grade
   ============================================================ */

:root {
  /* الألوان */
  --bg: #f7f8fa;
  --card: #ffffff;
  --ink: #17211c;
  --ink-2: #3d4b44;
  --muted: #6b7a72;
  --line: #e5e9e7;
  --line-strong: #d3dad6;

  --green-950: #073527;
  --green-900: #0a4a37;
  --green-700: #0f6b4f;
  --green-600: #12805e;
  --green-500: #17966f;
  --green-100: #d7ece3;
  --green-50: #ecf5f1;

  --gold-700: #a8841b;
  --gold-600: #c9a227;
  --gold-100: #f3e8c6;
  --gold-50: #faf5e4;

  --red-700: #b3261e;
  --red-600: #d4453a;
  --red-100: #f8d7d3;
  --red-50: #fdeeec;

  --blue-700: #1d5a9e;
  --blue-600: #2b6cb0;
  --blue-50: #e9f1fa;

  --gray-chip-bg: #eef1f0;
  --gray-chip-ink: #5b6862;

  /* بنفسجي المظروف المغلق (v0.2) */
  --purple-700: #4c3fbb;
  --purple-600: #5a4ce0;
  --purple-100: #e4e1fb;
  --purple-50: #f0eefe;

  /* كهرماني الاستعجال (v0.2) */
  --amber-700: #b45309;
  --amber-50: #fff5e6;

  /* الأبعاد */
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --shadow: 0 1px 2px rgba(14, 34, 26, 0.04), 0 10px 30px rgba(14, 34, 26, 0.07);
  --shadow-lift: 0 4px 10px rgba(14, 34, 26, 0.08), 0 18px 44px rgba(14, 34, 26, 0.13);
  --header-h: 64px;
  --tabbar-h: 62px;

  /* المسافات (مقياس 8px) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;

  --font: -apple-system, "Segoe UI", Tahoma, Arial, sans-serif;
}

/* ---------- إعادة ضبط ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
h1, h2, h3, h4 { margin: 0 0 var(--sp-3); line-height: 1.35; color: var(--ink); }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 20px; font-weight: 800; }
h3 { font-size: 17px; font-weight: 700; }
p { margin: 0 0 var(--sp-3); }
a { color: var(--green-700); text-decoration: none; }
a:hover { color: var(--green-600); }
img { max-width: 100%; display: block; }
button { font-family: inherit; }
::selection { background: var(--green-100); }

.num, .money, .countdown, input[type="number"], td.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  direction: ltr;
  unicode-bidi: embed;
}

.container { width: 100%; max-width: 1160px; margin-inline: auto; padding-inline: var(--sp-4); }
.app-main { flex: 1; padding-block: var(--sp-5) var(--sp-7); outline: none; }
.is-hidden { display: none !important; }
.text-muted { color: var(--muted); }
.text-danger { color: var(--red-600); }
.text-success { color: var(--green-600); }
.text-gold { color: var(--gold-700); }
.mb-0 { margin-bottom: 0; }

/* ---------- شريط عدم الاتصال ---------- */
.offline-banner {
  position: fixed; top: 0; inset-inline: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center; gap: var(--sp-2);
  background: #3d3325; color: #ffe9b8;
  font-size: 13px; font-weight: 700;
  padding: var(--sp-2) var(--sp-4);
  animation: slideDown .25s ease;
}
@keyframes slideDown { from { transform: translateY(-100%); } to { transform: translateY(0); } }
body.is-offline .live-region { opacity: .55; filter: grayscale(.4); pointer-events: none; }

/* ---------- الترويسة ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: var(--sp-5); height: var(--header-h); }
.brand { display: flex; align-items: center; gap: var(--sp-2); font-size: 20px; font-weight: 800; color: var(--green-900); flex-shrink: 0; }
.brand:hover { color: var(--green-700); }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, var(--green-700), var(--green-900));
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 8px rgba(15, 107, 79, 0.3);
}
.brand-sub { color: var(--gold-600); }

.main-nav { display: flex; align-items: center; gap: var(--sp-1); flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a {
  padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: 14px;
  color: var(--ink-2); white-space: nowrap; transition: background .15s, color .15s;
}
.main-nav a:hover { background: var(--green-50); color: var(--green-900); }
.main-nav a.active { background: var(--green-700); color: #fff; }

.header-actions { display: flex; align-items: center; gap: var(--sp-3); flex-shrink: 0; }
.wallet-chip {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  background: var(--green-50); border: 1px solid var(--green-100);
  color: var(--green-900); font-weight: 800; font-size: 13px;
  padding: 6px 12px; border-radius: 999px; transition: box-shadow .15s;
}
.wallet-chip:hover { box-shadow: var(--shadow); color: var(--green-900); }
.wallet-chip .icon { color: var(--green-700); }

.user-menu { position: relative; }
.user-menu-btn {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding-block: 5px; padding-inline: 12px 8px; /* منطقي: 12px عند الصورة الرمزية و8px عند السهم */
  cursor: pointer; font-size: 14px; font-weight: 700; color: var(--ink);
  transition: border-color .15s;
}
.user-menu-btn:hover { border-color: var(--line-strong); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-600), var(--gold-700));
  color: #fff; font-size: 13px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
.user-dropdown {
  position: absolute; top: calc(100% + 8px); inset-inline-start: 0; min-width: 210px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lift); padding: var(--sp-2); z-index: 120;
}
.user-dropdown .dd-head { padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--line); margin-bottom: var(--sp-2); }
.user-dropdown .dd-name { font-weight: 800; }
.user-dropdown .dd-role { font-size: 12px; color: var(--muted); }
.user-dropdown button, .user-dropdown a {
  display: flex; width: 100%; align-items: center; gap: var(--sp-2);
  background: none; border: 0; text-align: start; cursor: pointer;
  padding: var(--sp-2) var(--sp-3); border-radius: var(--radius-xs);
  font-size: 14px; font-weight: 600; color: var(--ink);
}
.user-dropdown button:hover, .user-dropdown a:hover { background: var(--bg); }
.user-dropdown .dd-logout { color: var(--red-600); }

/* ---------- الأزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 10px 20px; font-size: 15px; font-weight: 800; cursor: pointer;
  transition: background .15s, box-shadow .15s, transform .05s, opacity .15s;
  text-align: center; line-height: 1.4; user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(135deg, #0f6b4f, #0a5940); color: #fff; box-shadow: 0 3px 12px rgba(15, 107, 79, 0.32); }
.btn-primary:hover:not(:disabled) { background: linear-gradient(135deg, #12805e, #0a5940); }
.btn-gold { background: linear-gradient(135deg, #d3ab2a, #b08a1e); color: #fff; box-shadow: 0 3px 12px rgba(201, 162, 39, 0.35); }
.btn-gold:hover:not(:disabled) { background: linear-gradient(135deg, #c9a227, #a8841b); }
.btn-danger { background: var(--red-600); color: #fff; }
.btn-danger:hover:not(:disabled) { background: var(--red-700); }
.btn-outline { background: var(--card); border-color: var(--line-strong); color: var(--ink); }
.btn-outline:hover:not(:disabled) { border-color: var(--green-600); color: var(--green-700); background: var(--green-50); }
.btn-ghost { background: transparent; color: var(--green-700); }
.btn-ghost:hover:not(:disabled) { background: var(--green-50); }
.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: var(--radius-xs); }
.btn-lg { padding: 14px 28px; font-size: 17px; }
.btn-block { width: 100%; }
.btn.is-busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-busy::after {
  content: ""; position: absolute; width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn-outline.is-busy::after, .btn-ghost.is-busy::after { border-color: var(--green-100); border-top-color: var(--green-700); }
@keyframes spin { to { transform: rotate(360deg); } }

.icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.icon svg { display: block; }

/* ---------- البطاقات ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-pad { padding: var(--sp-5); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.section { margin-bottom: var(--sp-6); }
.section-title { display: flex; align-items: center; gap: var(--sp-2); font-size: 20px; font-weight: 800; margin-bottom: var(--sp-4); }
.section-title .icon { color: var(--green-700); }

/* ---------- الرقائق (chips) ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 800; line-height: 1;
  padding: 5px 10px; border-radius: 999px; white-space: nowrap;
}
.chip-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip-live { background: var(--green-50); color: var(--green-700); border: 1px solid var(--green-100); }
.chip-live .chip-dot { animation: pulseDot 1.4s ease infinite; }
@keyframes pulseDot { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
.chip-upcoming { background: var(--blue-50); color: var(--blue-700); }
.chip-ended { background: var(--gray-chip-bg); color: var(--gray-chip-ink); }
.chip-cancelled { background: var(--red-50); color: var(--red-600); }
.chip-awarded { background: var(--gold-50); color: var(--gold-700); border: 1px solid var(--gold-100); }
.chip-reserve-met { background: var(--gold-50); color: var(--gold-700); border: 1px solid var(--gold-100); }
.chip-reserve-not { background: var(--gray-chip-bg); color: var(--gray-chip-ink); }
.chip-leading { background: var(--green-700); color: #fff; }
.chip-outbid { background: var(--red-600); color: #fff; }

/* ---------- النماذج ---------- */
.field { margin-bottom: var(--sp-4); }
.field label { display: block; font-size: 13px; font-weight: 800; color: var(--ink-2); margin-bottom: var(--sp-1); }
.field .hint { font-size: 12px; color: var(--muted); margin-top: var(--sp-1); }
.input, select.input, textarea.input {
  width: 100%; background: var(--card); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 10px 14px; font-size: 15px; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--green-600); box-shadow: 0 0 0 3px var(--green-100); }
textarea.input { resize: vertical; min-height: 90px; }
.input.input-lg { padding: 13px 16px; font-size: 17px; }
.input[type="number"], .input[type="datetime-local"] { direction: ltr; text-align: right; }
.input-suffix-wrap { position: relative; }
.input-suffix-wrap .input { padding-inline-start: 58px; }
.input-suffix {
  position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%);
  font-size: 13px; font-weight: 800; color: var(--muted); pointer-events: none;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--sp-4); }
.checkbox-row { display: flex; align-items: center; gap: var(--sp-2); font-weight: 700; cursor: pointer; }
.checkbox-row input { width: 18px; height: 18px; accent-color: var(--green-700); cursor: pointer; }

/* ---------- الجداول ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
.table th {
  text-align: start; font-size: 12px; font-weight: 800; color: var(--muted);
  padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line);
  background: #fbfcfc; white-space: nowrap;
}
.table td { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #fafbfa; }
td.num { text-align: end; font-weight: 700; white-space: nowrap; }
.amount-pos { color: var(--green-600); font-weight: 800; }
.amount-neg { color: var(--red-600); font-weight: 800; }

/* ---------- التبويبات ---------- */
.tabs { display: flex; gap: var(--sp-1); background: var(--gray-chip-bg); padding: 4px; border-radius: 999px; width: fit-content; max-width: 100%; overflow-x: auto; }
.tabs button {
  border: 0; background: transparent; cursor: pointer;
  padding: 8px 20px; border-radius: 999px; font-size: 14px; font-weight: 800; color: var(--ink-2);
  transition: background .15s, color .15s; white-space: nowrap;
}
.tabs button:hover { color: var(--green-900); }
.tabs button.active { background: var(--card); color: var(--green-900); box-shadow: var(--shadow); }

/* ---------- شبكة اللوطات ---------- */
.lots-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
.lot-card { display: flex; flex-direction: column; overflow: hidden; color: inherit; transition: box-shadow .18s, transform .18s; }
.lot-card:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); color: inherit; }
.lot-card-media { position: relative; aspect-ratio: 8 / 5; background: var(--green-50); overflow: hidden; }
.lot-card-media img { width: 100%; height: 100%; object-fit: cover; }
.lot-card-chips { position: absolute; top: var(--sp-2); inset-inline-start: var(--sp-2); display: flex; gap: var(--sp-1); flex-wrap: wrap; }
.lot-card-chips .chip { box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.lot-card-body { padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-2); flex: 1; }
.lot-card-cat { font-size: 12px; font-weight: 800; color: var(--muted); }
.lot-card-title { font-size: 15px; font-weight: 800; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.lot-card-price-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2); margin-top: auto; }
.lot-card-price-label { font-size: 12px; color: var(--muted); font-weight: 700; }
.lot-card-price { font-size: 18px; font-weight: 800; color: var(--gold-700); }
.lot-card-meta { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); border-top: 1px solid var(--line); padding-top: var(--sp-2); font-size: 13px; color: var(--muted); font-weight: 700; }
.lot-card-meta .icon { color: var(--green-600); }
.meta-item { display: inline-flex; align-items: center; gap: 5px; }

/* ---------- العد التنازلي ---------- */
.countdown { font-weight: 800; }
.countdown.cd-urgent { color: var(--red-600); animation: cdPulse 1s ease infinite; }
@keyframes cdPulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
.countdown-big {
  font-size: 30px; font-weight: 800; color: var(--green-900); letter-spacing: .5px;
}
.countdown-big.cd-urgent { color: var(--red-600); animation: cdPulse 1s ease infinite; }
.countdown-extended { animation: extendFlash 1.2s ease; }
@keyframes extendFlash {
  0% { background: var(--gold-100); box-shadow: 0 0 0 6px var(--gold-100); }
  100% { background: transparent; box-shadow: 0 0 0 0 transparent; }
}

/* ---------- البطل (hero) ---------- */
.hero {
  background: linear-gradient(135deg, var(--green-950) 0%, var(--green-700) 62%, #12805e 100%);
  border-radius: 24px; color: #fff; padding: var(--sp-7) var(--sp-6);
  margin-bottom: var(--sp-6); position: relative; overflow: hidden;
  box-shadow: 0 16px 44px rgba(7, 53, 39, 0.22);
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(600px 300px at 15% 110%, rgba(201,162,39,.25), transparent 65%),
              radial-gradient(400px 260px at 90% -20%, rgba(255,255,255,.12), transparent 60%);
}
.hero > * { position: relative; }
.hero h1 { color: #fff; font-size: 32px; margin-bottom: var(--sp-2); }
.hero p { color: rgba(255,255,255,.85); font-size: 16px; max-width: 560px; margin-bottom: var(--sp-4); }
.hero .hero-badge {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25);
  color: #ffe9a8; font-size: 13px; font-weight: 800;
  padding: 6px 14px; border-radius: 999px; margin-bottom: var(--sp-4);
}
.hero-actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.hero .btn-gold { box-shadow: 0 4px 16px rgba(0,0,0,.25); }
.hero .btn-hero-ghost { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.35); }
.hero .btn-hero-ghost:hover { background: rgba(255,255,255,.2); }

/* ---------- صفحة اللوط ---------- */
.lot-layout { display: grid; grid-template-columns: 1fr 400px; gap: var(--sp-5); align-items: start; }
.lot-aside { position: sticky; top: calc(var(--header-h) + var(--sp-4)); display: flex; flex-direction: column; gap: var(--sp-4); }

.gallery-main { aspect-ratio: 8 / 5; border-radius: var(--radius); overflow: hidden; background: var(--green-50); border: 1px solid var(--line); }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: var(--sp-2); margin-top: var(--sp-2); overflow-x: auto; padding-bottom: var(--sp-1); }
.gallery-thumbs button {
  width: 84px; aspect-ratio: 8/5; flex-shrink: 0; padding: 0; cursor: pointer;
  border: 2px solid var(--line); border-radius: var(--radius-xs); overflow: hidden; background: var(--green-50);
}
.gallery-thumbs button.active { border-color: var(--green-700); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }

.lot-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); margin-top: var(--sp-4); }
.lot-title-row h1 { margin-bottom: var(--sp-1); }
.lot-actions { display: flex; gap: var(--sp-2); flex-shrink: 0; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--card); color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center;
  transition: color .15s, border-color .15s, background .15s;
}
.icon-btn:hover { border-color: var(--green-600); color: var(--green-700); }
.icon-btn.active { background: var(--red-50); border-color: var(--red-100); color: var(--red-600); }

.attrs-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.attrs-table td { padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--line); }
.attrs-table tr:last-child td { border-bottom: 0; }
.attrs-table td:first-child { color: var(--muted); font-weight: 700; width: 38%; }
.attrs-table td:last-child { font-weight: 700; }

.defects-box {
  background: var(--gold-50); border: 1px solid var(--gold-100);
  border-radius: var(--radius-sm); padding: var(--sp-4);
}
.defects-box h3 { display: flex; align-items: center; gap: var(--sp-2); color: var(--gold-700); font-size: 15px; }
.defects-box p { margin: 0; color: var(--ink-2); white-space: pre-wrap; }

/* صندوق المزايدة */
.bid-panel { border: 2px solid var(--line); transition: border-color .3s, box-shadow .3s; }
.bid-panel.is-leading { border-color: var(--green-600); box-shadow: 0 0 0 4px var(--green-100), var(--shadow); }
.bid-panel.is-outbid { border-color: var(--red-600); box-shadow: 0 0 0 4px var(--red-100), var(--shadow); }
.lead-banner {
  display: flex; align-items: center; justify-content: center; gap: var(--sp-2);
  font-weight: 800; font-size: 15px; border-radius: var(--radius-sm);
  padding: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-3);
}
.lead-banner.leading { background: var(--green-50); color: var(--green-700); }
.lead-banner.outbid { background: var(--red-50); color: var(--red-600); }

.price-display { text-align: center; padding: var(--sp-2) 0 var(--sp-3); }
.price-display .price-label { font-size: 13px; color: var(--muted); font-weight: 700; }
.price-display .price-value { font-size: 34px; font-weight: 800; color: var(--gold-700); line-height: 1.2; }
.price-display .price-value.flash { animation: priceFlash .9s ease; }
@keyframes priceFlash {
  0% { color: var(--green-600); text-shadow: 0 0 18px rgba(23,150,111,.45); transform: scale(1.06); }
  100% { color: var(--gold-700); text-shadow: none; transform: scale(1); }
}
.price-meta { display: flex; justify-content: center; gap: var(--sp-4); font-size: 13px; color: var(--muted); font-weight: 700; }

.countdown-box {
  text-align: center; background: var(--bg); border-radius: var(--radius-sm);
  padding: var(--sp-3); margin-bottom: var(--sp-4); transition: background .3s;
}
.countdown-box .cd-label { font-size: 12px; font-weight: 800; color: var(--muted); margin-bottom: 2px; }

.quick-bids { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); margin-bottom: var(--sp-3); }
.quick-bids button {
  border: 1px solid var(--line-strong); background: var(--card); border-radius: var(--radius-xs);
  padding: 8px 4px; font-size: 13px; font-weight: 800; color: var(--green-900); cursor: pointer;
  transition: background .15s, border-color .15s;
  font-variant-numeric: tabular-nums;
}
.quick-bids button:hover { background: var(--green-50); border-color: var(--green-600); }

.total-line {
  background: var(--bg); border-radius: var(--radius-sm); padding: var(--sp-3);
  font-size: 13px; color: var(--ink-2); margin-bottom: var(--sp-3); line-height: 1.8;
}
.total-line .total-sum { font-weight: 800; color: var(--ink); font-size: 14px; }

.deposit-note { font-size: 12.5px; color: var(--muted); margin-top: var(--sp-2); text-align: center; }

/* سجل المزايدات */
.bids-list { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow-y: auto; }
.bids-list li {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-2); border-bottom: 1px solid var(--line);
  animation: none;
}
.bids-list li:last-child { border-bottom: 0; }
.bids-list li.new-bid { animation: bidIn .5s ease; }
@keyframes bidIn { from { background: var(--green-50); transform: translateY(-4px); opacity: 0; } to { background: transparent; transform: none; opacity: 1; } }
.bid-alias { display: flex; align-items: center; gap: var(--sp-2); font-weight: 800; font-size: 14px; }
.bid-alias .avatar { width: 30px; height: 30px; font-size: 12px; background: linear-gradient(135deg, var(--green-600), var(--green-900)); }
.bid-alias .bid-time { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.bid-amount { font-weight: 800; font-size: 15px; color: var(--ink); }
.bids-list li:first-child .bid-amount { color: var(--gold-700); }

/* الشريط السفلي للجوال */
.mobile-bidbar {
  display: none; position: fixed; bottom: 0; inset-inline: 0; z-index: 90;
  background: var(--card); border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px rgba(14,34,26,.1);
  padding: var(--sp-3) var(--sp-4);
  align-items: center; justify-content: space-between; gap: var(--sp-3);
}
.mobile-bidbar .mb-price { font-size: 18px; font-weight: 800; color: var(--gold-700); }
.mobile-bidbar .mb-cd { font-size: 12px; color: var(--muted); font-weight: 700; }

/* ---------- بطاقات الإحصاءات ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--sp-4); margin-bottom: var(--sp-6); }
.stat-card { padding: var(--sp-4); }
.stat-card .stat-label { font-size: 13px; color: var(--muted); font-weight: 700; margin-bottom: var(--sp-1); display: flex; align-items: center; gap: var(--sp-2); }
.stat-card .stat-label .icon { color: var(--green-600); }
.stat-card .stat-value { font-size: 24px; font-weight: 800; color: var(--ink); }

/* بطاقات المحفظة */
.balance-card { padding: var(--sp-5); position: relative; overflow: hidden; }
.balance-card.available { background: linear-gradient(135deg, var(--green-900), var(--green-700)); color: #fff; border: 0; }
.balance-card.available .bal-label, .balance-card.available .bal-value { color: #fff; }
.balance-card .bal-label { font-size: 13px; font-weight: 800; color: var(--muted); margin-bottom: var(--sp-1); }
.balance-card .bal-value { font-size: 30px; font-weight: 800; }
.balance-card.held .bal-value { color: var(--gold-700); }

/* ترسياتي */
.award-card { padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-3); }
.award-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.award-breakdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-3); background: var(--bg); border-radius: var(--radius-sm); padding: var(--sp-3); }
.award-breakdown > div .bd-label { font-size: 12px; color: var(--muted); font-weight: 700; }
.award-breakdown > div .bd-value { font-weight: 800; font-size: 14px; }
.progress { height: 8px; background: var(--gray-chip-bg); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--green-600), var(--green-700)); border-radius: 999px; transition: width .4s ease; }

/* ---------- الحالات الفارغة والهياكل ---------- */
.empty-state { text-align: center; padding: var(--sp-7) var(--sp-4); color: var(--muted); }
.empty-state .icon { color: var(--line-strong); margin-bottom: var(--sp-3); }
.empty-state h3 { color: var(--ink-2); margin-bottom: var(--sp-1); }
.empty-state p { font-size: 14px; max-width: 380px; margin-inline: auto; }

.skeleton { position: relative; overflow: hidden; background: var(--gray-chip-bg); border-radius: var(--radius-xs); }
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { transform: translateX(100%); } to { transform: translateX(-100%); } }
.skeleton-card { height: 300px; border-radius: var(--radius); }
.skeleton-row { height: 52px; margin-bottom: var(--sp-2); }
.skeleton-block { height: 120px; margin-bottom: var(--sp-3); border-radius: var(--radius); }

/* ---------- التنبيهات (toast) ---------- */
.toast-root {
  position: fixed; bottom: var(--sp-5); inset-inline-start: 50%; transform: translateX(-50%);
  z-index: 400; display: flex; flex-direction: column; gap: var(--sp-2); align-items: center;
  width: min(440px, calc(100vw - 32px));
}
html[dir="rtl"] .toast-root { transform: translateX(50%); }
.toast {
  display: flex; align-items: center; gap: var(--sp-2); width: 100%;
  background: #1f2b25; color: #fff; font-size: 14px; font-weight: 700;
  padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lift); cursor: pointer;
  animation: toastIn .3s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.toast.leaving { opacity: 0; transition: opacity .3s; }
.toast .icon { flex-shrink: 0; }
.toast-success .icon { color: #6fdcb2; }
.toast-error { background: #3d1f1c; }
.toast-error .icon { color: #ff9d92; }
.toast-info .icon { color: #9fc5ec; }
.toast-warn { background: #3d3325; }
.toast-warn .icon { color: #ffd97a; }

/* ---------- النوافذ المنبثقة ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 350;
  background: rgba(13, 26, 20, 0.55); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: var(--sp-4);
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-lift);
  width: 100%; max-width: 460px; max-height: 85vh; overflow-y: auto;
  animation: modalIn .25s ease;
}
.modal.modal-wide { max-width: 640px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; }
.modal-close { background: none; border: 0; cursor: pointer; color: var(--muted); padding: var(--sp-1); border-radius: var(--radius-xs); display: flex; }
.modal-close:hover { color: var(--ink); background: var(--bg); }
.modal-body { padding: var(--sp-5); }
.modal-actions { display: flex; gap: var(--sp-3); justify-content: flex-start; padding: 0 var(--sp-5) var(--sp-5); }

/* ---------- صفحة الدخول ---------- */
.login-wrap { max-width: 440px; margin: var(--sp-6) auto; }
.login-card { padding: var(--sp-6); text-align: center; }
.login-logo {
  width: 72px; height: 72px; margin: 0 auto var(--sp-4); border-radius: 22px;
  background: linear-gradient(135deg, var(--green-700), var(--green-900));
  color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(15,107,79,.35);
}
.login-card h1 { font-size: 22px; }
.login-card .login-sub { color: var(--muted); font-size: 14px; margin-bottom: var(--sp-5); }
.login-form { text-align: start; }
.btn-nafath {
  width: 100%; padding: 14px; font-size: 16px;
  background: linear-gradient(135deg, #12805e, #0a4a37);
  box-shadow: 0 6px 18px rgba(15,107,79,.35);
}
.seed-hint { margin-top: var(--sp-5); background: var(--bg); border-radius: var(--radius-sm); padding: var(--sp-4); text-align: start; }
.seed-hint h4 { font-size: 13px; color: var(--muted); margin-bottom: var(--sp-2); }
.seed-hint .seed-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2);
  padding: var(--sp-1) 0; font-size: 13px; font-weight: 700;
}
.seed-hint .seed-id { color: var(--green-700); font-weight: 800; font-variant-numeric: tabular-nums; direction: ltr; }
.seed-fill { border: 0; background: none; color: var(--blue-600); cursor: pointer; font-size: 12px; font-weight: 800; padding: 2px 6px; border-radius: 6px; }
.seed-fill:hover { background: var(--blue-50); }

/* ---------- وسم إفصاح / ملاحظات ---------- */
.note-box {
  display: flex; gap: var(--sp-2); align-items: flex-start;
  background: var(--blue-50); border-radius: var(--radius-sm);
  padding: var(--sp-3) var(--sp-4); font-size: 13px; color: var(--blue-700); font-weight: 700;
}
.note-box .icon { margin-top: 2px; flex-shrink: 0; }

/* ---------- مُدخلات مفاتيح/قيم (attrs) ---------- */
.kv-row { display: grid; grid-template-columns: 1fr 1fr 40px; gap: var(--sp-2); margin-bottom: var(--sp-2); align-items: center; }
.kv-remove { width: 36px; height: 36px; border-radius: var(--radius-xs); border: 1px solid var(--line-strong); background: var(--card); color: var(--red-600); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.kv-remove:hover { background: var(--red-50); border-color: var(--red-100); }

/* منتقي الوسائط */
.media-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-2); }
.media-picker button {
  padding: 0; border: 2px solid var(--line); border-radius: var(--radius-xs);
  overflow: hidden; cursor: pointer; background: var(--green-50); aspect-ratio: 8/5; position: relative;
}
.media-picker button.selected { border-color: var(--green-700); box-shadow: 0 0 0 3px var(--green-100); }
.media-picker button.selected::after {
  content: "✓"; position: absolute; top: 4px; inset-inline-start: 4px;
  width: 20px; height: 20px; background: var(--green-700); color: #fff;
  border-radius: 50%; font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.media-picker img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- عناصر متفرقة ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-5); flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
.stack { display: flex; flex-direction: column; gap: var(--sp-4); }
.row { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.divider { border: 0; border-top: 1px solid var(--line); margin: var(--sp-4) 0; }
.badge-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--red-600); color: #fff; font-size: 11px; font-weight: 800;
}
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: var(--sp-3); display: flex; align-items: center; gap: var(--sp-1); }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--green-700); }

/* ---------- التذييل ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--card); margin-top: auto; }
.footer-inner { padding-block: var(--sp-5); text-align: center; }
.footer-brand { font-weight: 800; color: var(--green-900); margin-bottom: var(--sp-1); }
.footer-note { font-size: 13px; color: var(--muted); max-width: 620px; margin: 0 auto var(--sp-2); }
.footer-copy { font-size: 12px; color: var(--muted); }

/* ============================================================
   الاستجابة (Responsive)
   ============================================================ */
@media (max-width: 1000px) {
  .lots-grid { grid-template-columns: repeat(2, 1fr); }
  .lot-layout { grid-template-columns: 1fr; }
  .lot-aside { position: static; }
  .media-picker { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 680px) {
  h1 { font-size: 22px; }
  .hero { padding: var(--sp-6) var(--sp-4); }
  .hero h1 { font-size: 24px; }
  .lots-grid { grid-template-columns: 1fr; }
  .form-row, .form-row-3, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .award-breakdown { grid-template-columns: repeat(2, 1fr); }
  .header-inner { gap: var(--sp-3); }
  .brand-text { display: none; }
  .main-nav a { padding: 6px 10px; font-size: 13px; }
  .wallet-chip .wallet-chip-label { display: none; }
  .user-menu-btn .user-name-label { display: none; }
  .mobile-bidbar.visible { display: flex; }
  .app-main.has-bidbar { padding-bottom: 96px; }
  .countdown-big { font-size: 24px; }
  .price-display .price-value { font-size: 28px; }
  .media-picker { grid-template-columns: repeat(2, 1fr); }
  .card-pad { padding: var(--sp-4); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ===== Open Banking ===== */

/* حقول ونصوص الآيبان — لاتينية الاتجاه دائماً */
.iban-input {
  direction: ltr; text-align: left;
  font-variant-numeric: tabular-nums; letter-spacing: .8px;
  padding-right: 40px;
}
.iban-wrap { position: relative; }
.iban-check {
  position: absolute; top: 50%; right: 12px; transform: translateY(-50%);
  color: var(--green-600); display: none; pointer-events: none;
}
.iban-wrap.valid .iban-check { display: inline-flex; }
.iban-wrap.valid .input { border-color: var(--green-600); }
.iban-text {
  direction: ltr; unicode-bidi: embed;
  font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap;
}

/* صفوف الحسابات البنكية */
.bank-account-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3); padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.bank-account-row:last-child { border-bottom: 0; }
.bank-account-meta { font-size: 13px; margin-top: 2px; }

/* رقائق التوثيق والقناة */
.chip-default { background: var(--gold-50); color: var(--gold-700); border: 1px solid var(--gold-100); }
.chip-rail { background: var(--green-50); color: var(--green-700); border: 1px solid var(--green-100); }

/* عناوين فرعية داخل البطاقات */
.subhead {
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: 14px; font-weight: 800; color: var(--ink-2);
  margin-bottom: var(--sp-3);
}
.subhead .icon { color: var(--green-700); }

/* نافذة موافقة البنك (محاكاة PIS) */
.consent-bank { font-size: 18px; font-weight: 800; color: var(--green-900); text-align: center; }
.consent-amount { font-size: 30px; font-weight: 800; color: var(--gold-700); text-align: center; margin-bottom: var(--sp-3); }

/* الخط الزمني الحي لحالة التحويل */
.payout-track {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: var(--sp-4); margin-top: var(--sp-4);
}
.payout-timeline { display: flex; margin: var(--sp-4) 0 var(--sp-2); }
.pt-step { flex: 1; text-align: center; position: relative; min-width: 0; }
.pt-step:not(:first-child)::before {
  content: ""; position: absolute; top: 15px;
  inset-inline-start: -50%; width: 100%; height: 3px;
  background: var(--line-strong);
}
.pt-dot {
  position: relative; z-index: 1;
  width: 32px; height: 32px; margin: 0 auto var(--sp-2);
  border-radius: 50%; background: var(--card);
  border: 2px solid var(--line-strong); color: var(--muted);
  font-size: 13px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums;
}
.pt-label { font-size: 12.5px; font-weight: 800; color: var(--muted); }
.pt-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.pt-step.pt-done .pt-dot { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.pt-step.pt-done .pt-label { color: var(--green-900); }
.pt-step.pt-done::before, .pt-step.pt-current::before { background: var(--green-700); }
.pt-step.pt-current .pt-dot {
  border-color: var(--green-600); color: var(--green-700);
  animation: ptPulse 1.4s ease infinite;
}
.pt-step.pt-current .pt-label { color: var(--green-900); }
.pt-step.pt-current .pt-sub { color: var(--green-700); font-weight: 700; }
.pt-step.pt-failed .pt-dot { background: var(--red-600); border-color: var(--red-600); color: #fff; }
.pt-step.pt-failed::before { background: var(--red-600); }
.pt-step.pt-failed .pt-label, .pt-step.pt-failed .pt-sub { color: var(--red-600); }
@keyframes ptPulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--green-100); }
  50% { box-shadow: 0 0 0 8px var(--green-100); }
}

/* مراجع مزود الدفع وملاحظات الخلايا الصغيرة */
.provider-ref {
  font-size: 11.5px; color: var(--muted);
  direction: ltr; unicode-bidi: embed; font-variant-numeric: tabular-nums;
}
.cell-sub { font-size: 11.5px; margin-top: 2px; }

@media (max-width: 680px) {
  .pt-dot { width: 26px; height: 26px; font-size: 12px; }
  .pt-step:not(:first-child)::before { top: 12px; }
  .pt-label { font-size: 11px; }
}

/* ============================================================
   الدفعة الثانية (v0.2) — إشعارات، مظروف مغلق، وكالة، معاينة،
   فرصة ثانية، نزاعات، حساب، قواعد، فاتورة، تنقل جوال
   ============================================================ */

/* ---------- استعجال العد التنازلي: كهرماني < 5 دقائق ---------- */
.countdown.cd-soon, .countdown-big.cd-soon { color: var(--amber-700); }

/* ---------- جرس الإشعارات ---------- */
.bell-btn {
  position: relative; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: var(--card); color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.bell-btn:hover { border-color: var(--green-600); color: var(--green-700); background: var(--green-50); }
.bell-badge {
  position: absolute; top: -4px; inset-inline-start: -4px;
  min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px;
  background: var(--red-600); color: #fff; font-size: 10.5px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--card); font-variant-numeric: tabular-nums;
  animation: badgePop .25s ease;
}
@keyframes badgePop { from { transform: scale(.5); } to { transform: scale(1); } }

/* لوحة الإشعارات */
.notif-panel {
  position: fixed; top: calc(var(--header-h) + 8px);
  inset-inline-end: max(16px, calc((100vw - 1160px) / 2));
  width: 400px; max-width: calc(100vw - 24px);
  max-height: min(560px, 78vh);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lift); z-index: 250;
  display: flex; flex-direction: column; overflow: hidden;
  animation: modalIn .22s ease;
}
.notif-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line);
}
.notif-head .icon { color: var(--green-700); }
.notif-list { overflow-y: auto; padding: var(--sp-2); flex: 1; }
.notif-item {
  display: flex; width: 100%; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-3); border: 0; border-radius: var(--radius-sm);
  background: none; cursor: pointer; text-align: start; font-family: inherit;
  transition: background .12s; position: relative;
}
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: var(--green-50); }
.notif-item.unread:hover { background: var(--green-100); }
.notif-item + .notif-item { margin-top: 2px; }
.notif-icon {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px;
  background: var(--gray-chip-bg); color: var(--gray-chip-ink);
  display: inline-flex; align-items: center; justify-content: center;
}
.notif-item.tone-success .notif-icon { background: var(--green-50); color: var(--green-700); }
.notif-item.tone-warn .notif-icon { background: var(--amber-50); color: var(--amber-700); }
.notif-item.tone-danger .notif-icon { background: var(--red-50); color: var(--red-600); }
.notif-item.tone-gold .notif-icon { background: var(--gold-50); color: var(--gold-700); }
.notif-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.notif-title { font-weight: 800; font-size: 13.5px; color: var(--ink); line-height: 1.45; }
.notif-text {
  font-size: 12.5px; color: var(--muted); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.notif-time { font-size: 11px; color: var(--muted); font-weight: 700; }
.notif-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--green-600);
  flex-shrink: 0; margin-top: 6px; display: none;
}
.notif-item.unread .notif-dot { display: block; }

/* ---------- المظروف المغلق ---------- */
.chip-sealed { background: var(--purple-50); color: var(--purple-700); border: 1px solid var(--purple-100); }
.sealed-secret {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--purple-700); font-weight: 800; font-size: 13.5px;
}
.sealed-secret-big { display: flex; justify-content: center; font-size: 19px; padding: var(--sp-3) 0 var(--sp-2); }
.lot-card-sealed .lot-card-media { background: var(--purple-50); }

.sealed-banner {
  display: flex; gap: var(--sp-3); align-items: flex-start;
  background: linear-gradient(135deg, var(--purple-50), #ffffff);
  border: 1px solid var(--purple-100); border-radius: var(--radius);
  padding: var(--sp-4); color: var(--ink-2);
}
.sealed-banner .sb-icon { color: var(--purple-700); flex-shrink: 0; margin-top: 2px; }
.sealed-banner strong { color: var(--purple-700); display: block; margin-bottom: 2px; }
.sealed-banner p { font-size: 13.5px; }

.sealed-explainer {
  display: flex; gap: var(--sp-2); align-items: flex-start;
  background: var(--purple-50); border: 1px solid var(--purple-100);
  border-radius: var(--radius-sm); padding: var(--sp-3);
  font-size: 13px; color: var(--ink-2); margin-bottom: var(--sp-3);
}
.sealed-explainer .icon { color: var(--purple-700); flex-shrink: 0; margin-top: 2px; }
.sealed-explainer strong { color: var(--purple-700); }

.btn-sealed {
  background: linear-gradient(135deg, var(--purple-600), var(--purple-700));
  color: #fff; box-shadow: 0 3px 12px rgba(90, 76, 224, 0.35);
}
.btn-sealed:hover:not(:disabled) { background: linear-gradient(135deg, #6a5ce8, var(--purple-700)); }

.sealed-lockbox {
  text-align: center; background: linear-gradient(160deg, var(--purple-50), #ffffff);
  border: 2px dashed var(--purple-100); border-radius: var(--radius);
  padding: var(--sp-5) var(--sp-4); margin-bottom: var(--sp-3);
}
.sealed-lockbox .sl-icon { color: var(--purple-700); margin-bottom: var(--sp-1); display: flex; justify-content: center; }
.sealed-lockbox .sl-label { font-size: 12px; font-weight: 800; color: var(--muted); }
.sealed-lockbox .sl-amount { font-size: 28px; font-weight: 800; color: var(--purple-700); line-height: 1.3; }
.sealed-lockbox .sl-sub { font-size: 12.5px; color: var(--muted); font-weight: 700; margin-top: 2px; }

.lead-banner.sealed-locked { background: var(--purple-50); color: var(--purple-700); }
.bid-panel.is-leading:has(.sealed-locked) { border-color: var(--purple-600); box-shadow: 0 0 0 4px var(--purple-100), var(--shadow); }

.sealed-reveal {
  display: flex; gap: var(--sp-3); align-items: flex-start;
  background: var(--purple-50); border: 1px solid var(--purple-100);
  border-radius: var(--radius-sm); padding: var(--sp-4);
}
.sealed-reveal .icon { color: var(--purple-700); flex-shrink: 0; margin-top: 2px; }
.sealed-reveal.is-winner { background: var(--gold-50); border-color: var(--gold-100); }
.sealed-reveal.is-winner .icon { color: var(--gold-600); }
.sealed-reveal .sr-title { font-weight: 800; font-size: 15px; margin-bottom: 2px; }
.sealed-reveal .sr-sub { font-size: 13.5px; color: var(--ink-2); }
.sealed-reveal .sr-btn { margin-top: var(--sp-2); }

.note-box.warn-note { background: var(--red-50); color: var(--red-700); margin-bottom: var(--sp-3); }
.bid-alias-row { gap: 6px; flex-wrap: nowrap; }

/* ---------- المزايدة بالوكالة ---------- */
.proxy-panel {
  margin-top: var(--sp-4); border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--bg); overflow: hidden;
}
.proxy-toggle {
  display: flex; width: 100%; align-items: center; gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4); background: none; border: 0; cursor: pointer;
  font-family: inherit; font-weight: 800; font-size: 14px; color: var(--ink);
  transition: background .12s;
}
.proxy-toggle:hover { background: var(--green-50); }
.proxy-toggle > .icon { color: var(--green-700); }
.proxy-toggle-label { flex: 1; text-align: start; }
.proxy-chevron { color: var(--muted); display: inline-flex; }
.proxy-body { padding: 0 var(--sp-4) var(--sp-4); }
.proxy-points { margin: 0 0 var(--sp-3); padding-inline-start: 18px; font-size: 12.5px; color: var(--ink-2); }
.proxy-points li { margin-bottom: 3px; }
.proxy-cap {
  display: flex; align-items: center; gap: 6px;
  background: var(--green-50); border: 1px solid var(--green-100); color: var(--green-900);
  border-radius: var(--radius-xs); padding: var(--sp-2) var(--sp-3);
  font-size: 13px; font-weight: 700; margin-bottom: var(--sp-3);
}
.proxy-form { display: flex; gap: var(--sp-2); }
.proxy-form .input-suffix-wrap { flex: 1; }
.proxy-tag {
  display: inline-flex; align-items: center; gap: 3px;
  background: var(--blue-50); color: var(--blue-700);
  font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 999px;
  white-space: nowrap;
}

/* ---------- بطاقة الكود (تذكرة معاينة/استلام) ---------- */
.ticket-card {
  position: relative; text-align: center; overflow: hidden;
  background: linear-gradient(160deg, var(--gold-50), #ffffff);
  border: 2px dashed var(--gold-600); border-radius: var(--radius);
  padding: var(--sp-5) var(--sp-5); margin: var(--sp-3) 0;
}
.ticket-punch {
  position: absolute; width: 22px; height: 22px; top: 50%; transform: translateY(-50%);
  background: var(--card); border: 2px dashed var(--gold-600); border-radius: 50%;
}
.ticket-punch.tp-start { inset-inline-start: -13px; }
.ticket-punch.tp-end { inset-inline-end: -13px; }
.ticket-label { font-size: 12.5px; font-weight: 800; color: var(--muted); margin-bottom: var(--sp-1); }
.ticket-code {
  font-size: 28px; font-weight: 800; letter-spacing: 2px; color: var(--gold-700);
  font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: embed;
}
.ticket-sub { font-size: 12.5px; color: var(--ink-2); font-weight: 700; margin-top: var(--sp-1); }

/* ---------- عروض الفرصة الثانية ---------- */
.offer-card { padding: var(--sp-5); margin-bottom: var(--sp-4); }
.offer-card.is-open { border: 2px solid var(--gold-600); box-shadow: 0 0 0 4px var(--gold-100), var(--shadow); }
.offer-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-2); }
.offer-spark { color: var(--gold-600); display: inline-flex; }
.offer-desc { font-size: 13.5px; color: var(--ink-2); }
.offer-price-row {
  display: flex; gap: var(--sp-6); align-items: flex-end; flex-wrap: wrap;
  background: var(--bg); border-radius: var(--radius-sm);
  padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-3);
}
.offer-price { font-size: 24px; font-weight: 800; color: var(--gold-700); line-height: 1.3; }
.offer-cd { font-size: 18px; }
.offer-actions { margin-top: var(--sp-1); }

/* ---------- الترسيات: أدوات ونقل الملكية ---------- */
.award-tools {
  display: flex; gap: var(--sp-2); flex-wrap: wrap;
  border-top: 1px solid var(--line); padding-top: var(--sp-3);
}
.award-extra { gap: var(--sp-3); }
.transfer-box { display: flex; flex-direction: column; gap: var(--sp-2); align-items: flex-start; }
.deal-done {
  display: flex; gap: var(--sp-3); align-items: center;
  background: linear-gradient(135deg, var(--green-50), var(--gold-50));
  border: 1px solid var(--green-100); border-radius: var(--radius-sm);
  padding: var(--sp-4); color: var(--green-900);
}
.deal-done > .icon { color: var(--gold-600); flex-shrink: 0; }
.deal-done .dd-sub { font-size: 13px; color: var(--ink-2); }

/* ---------- مواعيد المعاينة ---------- */
.appts-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-4); }
.appt-card .ticket-card { margin-bottom: 0; }

/* ---------- صفحة الحساب ---------- */
.profile-card { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; }
.profile-main { display: flex; align-items: center; gap: var(--sp-4); }
.avatar-lg { width: 56px; height: 56px; font-size: 22px; border-radius: 18px; }
.profile-name { font-weight: 800; font-size: 18px; }
.profile-meta { display: flex; gap: var(--sp-3); color: var(--muted); font-size: 13px; font-weight: 700; flex-wrap: wrap; }
.kyc-verified {
  display: flex; gap: var(--sp-3); align-items: center;
  background: var(--green-50); border: 1px solid var(--green-100);
  border-radius: var(--radius-sm); padding: var(--sp-4); color: var(--green-900);
}
.kyc-verified > .icon { color: var(--green-700); flex-shrink: 0; }
.license-row { border-top: 1px solid var(--line); padding: var(--sp-3) 0; }
.license-row:last-child { padding-bottom: 0; }
.license-no { font-size: 13px; margin-top: 2px; }
.license-form { display: flex; gap: var(--sp-2); margin-top: var(--sp-2); }
.license-form .input { flex: 1; }
.dispute-card {}
.dispute-desc { color: var(--ink-2); white-space: pre-wrap; font-size: 14px; }
.resolution-box {
  background: var(--blue-50); border-radius: var(--radius-xs);
  padding: var(--sp-3); font-size: 13.5px; color: var(--blue-700); margin-bottom: var(--sp-2);
}
.dispute-date { font-size: 12.5px; }
.eligibility-icon { display: flex; justify-content: center; color: var(--green-700); margin-bottom: var(--sp-3); }

/* ---------- صفحة القواعد والرسوم ---------- */
.rules-intro { max-width: 560px; }
.rules-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-4); }
.rule-card { padding: var(--sp-5); }
.rule-icon {
  width: 44px; height: 44px; border-radius: 14px;
  background: var(--green-50); color: var(--green-700);
  display: flex; align-items: center; justify-content: center; margin-bottom: var(--sp-3);
}
.rule-example { background: var(--bg); border-radius: var(--radius-xs); padding: var(--sp-3); font-size: 12.5px; color: var(--ink-2); }
table.table.tiers-table { min-width: 0; }

/* ---------- الفاتورة ---------- */
.invoice-page { max-width: 720px; margin-inline: auto; padding: var(--sp-6); }
.invoice-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap;
  border-bottom: 2px solid var(--green-900); padding-bottom: var(--sp-4); margin-bottom: var(--sp-4);
}
.invoice-brand { display: flex; align-items: center; gap: var(--sp-3); }
.inv-brand-name { font-weight: 800; font-size: 18px; color: var(--green-900); }
.inv-brand-sub { font-size: 12px; color: var(--muted); }
.invoice-meta { text-align: start; }
.inv-number { font-weight: 800; font-size: 16px; }
.inv-date { font-size: 13px; color: var(--muted); }
.inv-status { font-size: 13px; font-weight: 800; color: var(--gold-700); }
.invoice-parties { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); margin-bottom: var(--sp-4); }
.inv-party { background: var(--bg); border-radius: var(--radius-sm); padding: var(--sp-3) var(--sp-4); }
.inv-party-label { font-size: 11.5px; font-weight: 800; color: var(--muted); margin-bottom: 2px; }
.inv-party-name { font-weight: 800; }
.inv-party-sub { font-size: 12.5px; color: var(--muted); }
.invoice-lot { background: var(--bg); border-radius: var(--radius-sm); padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-4); }
.inv-lot-title { font-weight: 800; font-size: 16px; }
.inv-lot-link { font-size: 13px; }
.invoice-table { width: 100%; border-collapse: collapse; margin-bottom: var(--sp-4); font-size: 14.5px; }
.invoice-table td { padding: var(--sp-3) var(--sp-2); border-bottom: 1px solid var(--line); }
.invoice-table td:last-child { text-align: end; font-weight: 700; }
.invoice-table .inv-total-row td {
  border-top: 2px solid var(--green-900); border-bottom: 2px solid var(--green-900); font-size: 16px;
}
.inv-transfer { margin-bottom: var(--sp-3); }
.invoice-footnote {
  display: flex; gap: 6px; align-items: flex-start;
  font-size: 12px; color: var(--muted);
  border-top: 1px dashed var(--line-strong); padding-top: var(--sp-3); margin-top: var(--sp-2);
}

/* ---------- البطل: رقائق الإحصاءات ---------- */
.hero-stats { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-4); }
.hero-stat {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22);
  color: #fff; font-size: 13px; font-weight: 700;
  padding: 7px 14px; border-radius: 999px; backdrop-filter: blur(4px);
}
.hero-stat .icon { color: #ffe9a8; }
.hero-stat strong { color: #ffe9a8; }

/* ---------- رقائق تصفية الفئات ---------- */
.cat-chips { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-5); }
.cat-chip {
  border: 1px solid var(--line-strong); background: var(--card); color: var(--ink-2);
  border-radius: 999px; padding: 7px 16px; font-size: 13.5px; font-weight: 800; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.cat-chip:hover { border-color: var(--green-600); color: var(--green-700); }
.cat-chip.active { background: var(--green-700); border-color: var(--green-700); color: #fff; }

/* ---------- روابط التذييل ---------- */
.footer-links {
  display: flex; gap: var(--sp-4); justify-content: center; flex-wrap: wrap;
  margin-bottom: var(--sp-2); font-size: 13px; font-weight: 700;
}

/* ---------- شريط التنقل السفلي (جوال) ---------- */
.mobile-tabbar {
  display: none; position: fixed; bottom: 0; inset-inline: 0; z-index: 95;
  background: var(--card); border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgba(14, 34, 26, .06);
  padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px));
}
.mobile-tabbar .tab-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 4px; min-height: 48px; border-radius: var(--radius-xs);
  font-size: 11px; font-weight: 800; color: var(--muted);
  transition: color .15s, background .15s;
}
.mobile-tabbar .tab-item.active { color: var(--green-700); background: var(--green-50); }

/* ---------- الورقة السفلية (bottom sheet) ---------- */
.modal-overlay.overlay-sheet { align-items: flex-end; padding: 0; }
.modal.modal-sheet {
  max-width: 640px; width: 100%; margin-inline: auto;
  border-radius: 20px 20px 0 0; max-height: 88vh;
  animation: sheetUp .28s ease;
}
.modal.modal-sheet::before {
  content: ""; display: block; width: 44px; height: 4px; border-radius: 999px;
  background: var(--line-strong); margin: 10px auto 0;
}
@keyframes sheetUp { from { transform: translateY(48px); opacity: .5; } to { transform: none; opacity: 1; } }

/* ---------- الشريط السفلي للوط (جوال) ---------- */
.mobile-bidbar .mb-sealed {
  display: flex; align-items: center; gap: 5px;
  font-size: 14px; font-weight: 800; color: var(--purple-700);
}

/* ---------- جداول ← بطاقات على الجوال ---------- */
@media (max-width: 680px) {
  .table-cards table { min-width: 0; }
  .table-cards thead { display: none; }
  .table-cards tbody { display: block; }
  .table-cards tr { display: block; padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); }
  .table-cards tr:last-child { border-bottom: 0; }
  .table-cards td {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--sp-3); border: 0; padding: 4px 0; text-align: start;
  }
  .table-cards td.num { text-align: end; }
  .table-cards td[data-label]::before {
    content: attr(data-label); font-size: 12px; font-weight: 800; color: var(--muted); flex-shrink: 0;
  }
  .table-cards tbody tr:hover { background: transparent; }
}

/* ---------- استجابة v0.2 ---------- */
@media (max-width: 1000px) {
  .rules-grid { grid-template-columns: 1fr; }
  .appts-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  /* الترويسة المكثفة: شعار + جرس + قائمة (التنقل عبر الشريط السفلي) */
  .main-nav { display: none; }
  .mobile-tabbar { display: flex; }
  .app-main { padding-bottom: calc(var(--tabbar-h) + var(--sp-7)); }
  .app-main.has-bidbar { padding-bottom: calc(var(--tabbar-h) + 110px); }
  .mobile-bidbar { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }
  .site-footer { padding-bottom: var(--tabbar-h); }

  /* أهداف لمس ≥ 44px */
  .btn { min-height: 44px; }
  .btn-sm { min-height: 38px; }
  .icon-btn { width: 44px; height: 44px; }
  .bell-btn { width: 44px; height: 44px; }
  .quick-bids button { min-height: 44px; }
  .cat-chip { min-height: 40px; }
  .notif-item { min-height: 56px; }

  /* لوحة الإشعارات: ملء الشاشة */
  .notif-panel {
    top: 0; inset-inline: 0; width: 100%; max-width: 100%;
    height: 100dvh; max-height: 100dvh; border-radius: 0; border: 0;
  }

  /* بطاقات وعناصر */
  .invoice-page { padding: var(--sp-4); }
  .invoice-parties { grid-template-columns: 1fr; }
  .offer-price-row { gap: var(--sp-4); }
  .profile-card { flex-direction: column; align-items: flex-start; }
  .ticket-code { font-size: 23px; letter-spacing: 1px; }
  .hero-stats { gap: var(--sp-1); }
  .hero-stat { font-size: 12px; padding: 6px 11px; }
}

/* ---------- الطباعة (الفاتورة) ---------- */
@media print {
  .site-header, .site-footer, .mobile-tabbar, .mobile-bidbar,
  .toast-root, .offline-banner, .notif-panel, #modal-root, .no-print { display: none !important; }
  body { background: #fff; }
  .app-main { padding: 0; }
  .invoice-page {
    border: 0; box-shadow: none; max-width: 100%; padding: 0;
  }
  .ticket-card { break-inside: avoid; }
  a { color: inherit; }
}

/* ===== i18n: مبدل اللغة + تصحيحات LTR ===== */
.lang-toggle {
  min-width: 40px; height: 34px; padding: 0 10px; border-radius: 10px;
  border: 1px solid var(--border, #dfe3e8); background: var(--card, #fff);
  font-weight: 700; font-size: 13px; cursor: pointer; color: var(--ink, #17202a);
  transition: background .15s ease, border-color .15s ease;
}
.lang-toggle:hover { border-color: var(--primary, #0f6b4f); color: var(--primary, #0f6b4f); }
html[dir='ltr'] body { letter-spacing: 0; }

/* ------------------------------------------------------------
   تصحيحات اتجاه LTR
   الورقة كُتبت RTL-أولاً وتعتمد الخصائص المنطقية في معظمها
   (inset-inline-*, padding-inline-*, margin-inline, text-align: start/end)
   فتنقلب تلقائياً مع dir. ما يلي حالات لا تكفي فيها الخصائص المنطقية:
   إما لأن العنصر نفسه مثبّت على dir=ltr (الحقول الرقمية والآيبان)،
   أو لأن العرف البصري نفسه يختلف بين الاتجاهين (شارة الجرس).
   ------------------------------------------------------------ */

/* الحقول الرقمية والتاريخ: محتواها LTR دائماً، لكن محاذاتها يجب أن
   تتبع اتجاه الصفحة لا اتجاه الحقل — لذا نصحّحها صراحةً في LTR.
   (في RTL تبقى text-align: right المعلنة أعلاه = بداية الصفحة) */
html[dir='ltr'] .input[type="number"],
html[dir='ltr'] .input[type="datetime-local"] { text-align: left; }

/* شارة عدد الإشعارات: العرف أن تكون في الزاوية الخارجية العليا —
   inset-inline-start تعطي اليمين في RTL (صحيح) واليسار في LTR (غير معتاد)،
   فنثبّتها على الطرف الآخر في LTR لتبقى أعلى-يمين في الاتجاهين. */
html[dir='ltr'] .bell-badge { inset-inline-start: auto; inset-inline-end: -4px; }

/* حقل الآيبان: الحقل وعلامة التحقق مثبّتان فيزيائياً عن قصد
   (right/padding-right) لأن الآيبان يُكتب LTR في الاتجاهين معاً،
   وعلامة الصح تلزم نهاية الحقل البصرية — لا تُحوَّل لخصائص منطقية. */

/* التذييل والبطل والشبكات وأشرطة الجوال والنوافذ والتنبيهات
   تعتمد flex/grid والخصائص المنطقية فتنقلب من نفسها مع dir. */

/* ===== التشخيص والإبلاغ عن المشاكل ===== */
.toast-report {
  margin-inline-start: auto; padding: 4px 10px; border-radius: 8px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.45); background: rgba(255,255,255,.15);
  color: inherit; font: inherit; font-size: 12px; font-weight: 700; white-space: nowrap;
}
.toast-report:hover { background: rgba(255,255,255,.28); }
.diag-report .diag-errline {
  display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px;
  background: #fdf2f2; color: #a02020; font-size: 13px; margin-block: 8px 12px;
}
.diag-shot-preview { margin-top: 10px; }
.diag-shot-preview img {
  max-width: 100%; border-radius: 10px; border: 1px solid var(--border, #dfe3e8);
  display: block;
}

/* ============================================================
   v1.1 — قوالب السمات، الحدود الأربعة، ورفع الملفات
   ============================================================ */

.mb-2 { margin-bottom: var(--sp-2); }

/* ---------- علامة الإلزام ورسائل الحقول ---------- */
.req-star { color: var(--red-600); font-weight: 800; }
.field-error {
  margin-top: var(--sp-1); font-size: 12px; font-weight: 700;
  color: var(--red-700); background: var(--red-50);
  border-radius: var(--radius-xs); padding: 6px 10px;
}
.has-error > .input,
.has-error .input.input-error { border-color: var(--red-600); box-shadow: 0 0 0 3px var(--red-50); }
.has-error > label { color: var(--red-700); }
.hint.hint-error { color: var(--red-700); font-weight: 800; }

/* ---------- حقل برقم ووحدة ---------- */
.unit-wrap { position: relative; display: block; }
.unit-wrap .input { padding-inline-end: 60px; }
.unit-chip {
  position: absolute; inset-inline-end: 8px; top: 50%; transform: translateY(-50%);
  background: var(--gray-chip-bg); color: var(--gray-chip-ink);
  border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 800;
  pointer-events: none; white-space: nowrap;
}
.unit-tag { color: var(--muted); font-size: 12px; font-weight: 700; }

/* ---------- اختيار متعدد برقائق ---------- */
.chip-choices { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip-choice {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 6px 12px; font-size: 13px; font-weight: 700; background: var(--card);
  transition: border-color .15s, background .15s;
}
.chip-choice input { width: 16px; height: 16px; accent-color: var(--green-700); cursor: pointer; margin: 0; }
.chip-choice.is-on,
.chip-choice:has(input:checked) { border-color: var(--green-600); background: var(--green-50); color: var(--green-900); }
.chip-choice:hover { border-color: var(--green-600); }

/* ---------- مجموعات حقول القالب ---------- */
.attr-form-group { margin-bottom: var(--sp-5); }
.attr-form-group:last-child { margin-bottom: 0; }
.attr-group-title {
  font-size: 13px; font-weight: 800; color: var(--green-900);
  text-transform: none; margin: 0 0 var(--sp-3);
  padding-bottom: var(--sp-2); border-bottom: 1px solid var(--line);
}
.attr-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--sp-4); }
.attr-form-grid > .attr-field:only-child { grid-column: 1 / -1; }
.attr-field:has(.bounds-form),
.attr-field:has(.chip-choices),
.attr-field:has(textarea) { grid-column: 1 / -1; }

/* ---------- الحدود والأطوال: نموذج الإدخال ---------- */
.bounds-form {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: var(--sp-3); background: #fbfcfc;
}
.bounds-head, .bounds-row {
  display: grid; grid-template-columns: 76px 1fr 150px; gap: var(--sp-2); align-items: center;
}
.bounds-head { font-size: 12px; font-weight: 800; color: var(--muted); margin-bottom: var(--sp-2); }
.bounds-row { margin-bottom: var(--sp-2); }
.bounds-row:last-child { margin-bottom: 0; }
.bounds-side { font-size: 13px; font-weight: 800; color: var(--ink-2); }
.bounds-form .input { padding: 8px 12px; font-size: 14px; }
.bounds-form .unit-wrap .input { padding-inline-end: 44px; }

/* ---------- عرض السمات ---------- */
.attrs-view .attr-group { margin-bottom: var(--sp-4); }
.attrs-view .attr-group:last-child { margin-bottom: 0; }
.bounds-view { margin-top: var(--sp-3); }
.bounds-view-title { font-size: 13px; font-weight: 800; color: var(--ink-2); margin-bottom: var(--sp-1); }
.bounds-table th {
  text-align: start; font-size: 12px; font-weight: 800; color: var(--muted);
  padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--line);
}
.bounds-table td:first-child { width: 26%; }
.bounds-table td:last-child { font-weight: 700; white-space: nowrap; }

/* ---------- صندوق رفع الملفات ---------- */
.upload-trigger { display: inline-flex; position: relative; overflow: hidden; }
.upload-input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.upload-list { display: flex; flex-direction: column; gap: var(--sp-2); margin-top: var(--sp-3); }
.upload-item {
  display: flex; align-items: center; gap: var(--sp-3);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: var(--sp-2); background: var(--card);
}
.upload-item.upload-failed { border-color: var(--red-100); background: var(--red-50); }
.upload-thumb {
  width: 56px; height: 44px; flex-shrink: 0; object-fit: cover;
  border-radius: var(--radius-xs); background: var(--green-50);
}
.upload-thumb-doc { display: flex; align-items: center; justify-content: center; color: var(--green-700); }
.upload-meta { flex: 1; min-width: 0; }
.upload-name {
  font-size: 13px; font-weight: 700; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.upload-sub { display: flex; align-items: center; gap: var(--sp-2); font-size: 12px; margin-top: 2px; flex-wrap: wrap; }
.upload-sub .chip { font-size: 11px; padding: 1px 8px; }
.upload-chip-done { background: var(--green-100); color: var(--green-900); }
.upload-chip-failed { background: var(--red-100); color: var(--red-700); }
.upload-chip-pending, .upload-chip-uploading, .upload-chip-compressing { background: var(--blue-50); color: var(--blue-700); }
.upload-bar { height: 4px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: 6px; }
.upload-bar span { display: block; height: 100%; width: 40%; border-radius: 999px; background: var(--green-600); animation: upload-slide 1.1s ease-in-out infinite; }
@keyframes upload-slide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(260%); }
}
.upload-actions { display: flex; align-items: center; gap: var(--sp-1); flex-shrink: 0; }
.upload-item .field-error { margin-top: 4px; }

/* ---------- كتلة الالتزامات النظامية (عقار / ترخيص إعلان) ---------- */
.re-block {
  border: 1px solid var(--gold-100); border-radius: var(--radius);
  background: var(--gold-50); padding: var(--sp-4);
}
.re-block > h3, .re-block > h4 {
  display: flex; align-items: center; gap: var(--sp-2);
  color: var(--gold-700); margin-bottom: var(--sp-3);
}

/* ---------- إعدادات الأصل المتقدمة (طي) ---------- */
.adv-wrap { border-top: 1px dashed var(--line-strong); padding-top: var(--sp-3); margin-top: var(--sp-3); }
.adv-toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }
.adv-toggle .icon { transition: transform .18s; }
.adv-body { margin-top: var(--sp-3); }

@media (max-width: 680px) {
  .attr-form-grid { grid-template-columns: 1fr; }
  .bounds-head { display: none; }
  .bounds-row { grid-template-columns: 68px 1fr; gap: var(--sp-2) var(--sp-2); }
  .bounds-row .unit-wrap { grid-column: 2; }
  .bounds-form { padding: var(--sp-2); }
  .upload-thumb { width: 44px; height: 36px; }
  .upload-item { gap: var(--sp-2); }
}

/* ---------- شارات القيم المصفوفة (الخدمات) ---------- */
.value-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.chip-attr { background: var(--green-50); color: var(--green-900); font-size: 12px; padding: 2px 10px; }

/* ---------- إفصاح التقبيل (خلو الرجل) ---------- */
.keymoney-banner {
  border: 1px solid var(--gold-100); border-inline-start: 4px solid var(--gold-600);
  background: var(--gold-50); border-radius: var(--radius-sm);
  padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-4);
}
.keymoney-banner.km-pending { border-color: var(--amber-700); background: var(--amber-50); }
.km-head { display: flex; align-items: center; gap: var(--sp-2); color: var(--gold-700); margin-bottom: var(--sp-2); }
.keymoney-banner.km-pending .km-head { color: var(--amber-700); }
.km-intro { font-size: 13px; color: var(--ink-2); margin-bottom: var(--sp-2); }
.km-table { font-size: 13px; background: var(--card); border-radius: var(--radius-xs); }
.km-table td { padding: 6px var(--sp-3); }
.km-warn {
  display: flex; align-items: flex-start; gap: var(--sp-2); margin-top: var(--sp-2);
  background: var(--amber-50); color: var(--amber-700);
  border: 1px solid var(--amber-700); border-radius: var(--radius-xs);
  padding: var(--sp-2) var(--sp-3); font-size: 13px; font-weight: 800;
}
.km-warn .icon { flex-shrink: 0; margin-top: 2px; }

/* أساس السعر في شريط الجوال */
.mb-basis { font-size: 11px; font-weight: 800; color: var(--muted); line-height: 1.2; }

/* الإخفاء بسمة hidden يجب أن يغلب أي display في القواعد الخاصة
   (زر .btn بـdisplay:flex كان يظهر رغم hidden). */
[hidden] { display: none !important; }

/* ═══ شاشة الدخول بمسارين ═══ */
.login-panes { margin-top: var(--sp-3); }
.login-pane { display: flex; flex-direction: column; gap: var(--sp-3); }

.provider-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.btn-provider {
  display: flex; align-items: center; justify-content: center; gap: var(--sp-2);
  width: 100%; padding: 13px var(--sp-3); font-size: 15px; font-weight: 800;
  background: var(--card); color: var(--ink);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  cursor: pointer; transition: border-color .15s, background .15s, transform .06s;
}
.btn-provider:hover { border-color: var(--green-600); background: var(--green-50); }
.btn-provider:active { transform: translateY(1px); }
.btn-provider .icon { flex-shrink: 0; }
.badge-muted {
  font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 999px;
  background: var(--gray-chip-bg); color: var(--muted); letter-spacing: .02em;
}

/* فاصل «أو» بخطين على الجانبين */
.or-sep { display: flex; align-items: center; gap: var(--sp-3); color: var(--muted); font-size: 12px; }
.or-sep::before, .or-sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.code-hint { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--green-600); }

/* التبويبان: عميل / مشرف */
.login-card .tabs {
  display: flex; gap: 4px; padding: 4px; margin-top: var(--sp-3);
  background: var(--gray-chip-bg); border-radius: var(--radius-sm);
}
.login-card .tab {
  flex: 1; padding: 9px var(--sp-2); border: 0; border-radius: calc(var(--radius-sm) - 4px);
  background: transparent; color: var(--muted); font: 800 13px/1 inherit; cursor: pointer;
  transition: background .15s, color .15s;
}
.login-card .tab.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.login-card .tab:hover:not(.active) { color: var(--ink-2); }

@media (max-width: 480px) {
  .btn-provider { font-size: 14px; padding: 12px var(--sp-2); }
  .login-card .tab { font-size: 12px; }
}
