/* =====================================================================
   Grossi — mobile-first B2B UI (works RTL + LTR via logical props)
   ===================================================================== */
:root {
  --brand: #0b6e4f;
  --brand-dark: #08513a;
  --brand-soft: #e7f3ee;
  --accent: #f2a541;
  --accent-dark: #d98a1f;
  --ink: #16242f;
  --muted: #64748b;
  --line: #e5e9ef;
  --bg: #f6f8fa;
  --card: #ffffff;
  --verified: #1d8cf8;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .05);
  --bs-primary: var(--brand);
  --bs-primary-rgb: 11, 110, 79;
  --bs-link-color: var(--brand);
  --bs-link-color-rgb: 11, 110, 79;
  --bs-link-hover-color: var(--brand-dark);
  --bs-body-font-family: 'Cairo', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

body { background: var(--bg); color: var(--ink); font-family: var(--bs-body-font-family); -webkit-font-smoothing: antialiased; padding-bottom: 72px; }
@media (min-width: 992px) { body { padding-bottom: 0; } }
a { text-decoration: none; }
.min-w-0 { min-width: 0; }
.text-accent { color: var(--accent-dark) !important; }
.text-verified { color: var(--verified) !important; }
.bg-soft { background: #eef3f1; }

/* ---------- Numbers & prices (RTL-safe) ----------
   Every price/number is rendered by formatPrice()/formatNumber() as
   <span dir="ltr" class="numeric-value">…</span>; isolate it from the surrounding RTL text. */
.numeric-value { direction: ltr; unicode-bidi: isolate; white-space: nowrap; display: inline-block; }
[dir=rtl] input[type=number], [dir=rtl] input[inputmode=numeric], [dir=rtl] input[inputmode=decimal], [dir=rtl] input[inputmode=tel] { direction: ltr; text-align: right; }
[dir=rtl] .input-group-text { unicode-bidi: plaintext; }

/* ---------- Buttons ---------- */
.btn { border-radius: 10px; font-weight: 600; }
.btn-lg { padding: .7rem 1.25rem; font-size: 1.02rem; }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark); --bs-btn-active-bg: var(--brand-dark); --bs-btn-disabled-bg: var(--brand); }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); --bs-btn-active-bg: var(--brand); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #1f1300; }
.btn-accent:hover, .btn-accent:focus { background: var(--accent-dark); border-color: var(--accent-dark); color: #1f1300; }
.btn-whatsapp { background: #25d366; border-color: #25d366; color: #fff; }
.btn-whatsapp:hover { background: #1da851; border-color: #1da851; color: #fff; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; border-radius: 10px; color: var(--ink); background: transparent; border: 0; }
.btn-icon:hover { background: var(--brand-soft); color: var(--brand); }
.btn-user { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--line); border-radius: 999px; padding: .2rem .7rem .2rem .25rem; background: #fff; }
[dir=rtl] .btn-user { padding: .2rem .25rem .2rem .7rem; }
.form-control, .form-select { border-radius: 10px; border-color: #d6dde5; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(11, 110, 79, .15); }
.form-control-lg, .form-select-lg { min-height: 52px; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.nav-pills .nav-link.active { background: var(--brand); }
.page-link { color: var(--brand); }
.active > .page-link, .page-link.active { background: var(--brand); border-color: var(--brand); }
.progress-bar { background: var(--brand); }

/* ---------- Header ---------- */
.site-header { background: rgba(255, 255, 255, .96); backdrop-filter: saturate(180%) blur(8px); border-bottom: 1px solid var(--line); z-index: 1030; }
.site-header .navbar { padding: .55rem 0; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--brand), #13a174); color: #fff; font-size: 1.1rem; flex: none; }
.brand-mark-lg { width: 56px; height: 56px; font-size: 1.6rem; border-radius: 16px; }
.brand-name { font-weight: 800; font-size: 1.2rem; color: var(--ink); letter-spacing: -.2px; }
.header-search { position: relative; flex: 1; max-width: 420px; margin-inline: 1.25rem; }
.header-search i { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.header-search .form-control { padding-inline-start: 36px; background: var(--bg); border-color: transparent; }
.site-header .nav-link { font-weight: 600; color: var(--ink); }
.site-header .nav-link.active, .site-header .nav-link:hover { color: var(--brand); }
.count-badge { position: absolute; top: 2px; inset-inline-end: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #e53935; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.avatar-sm, .avatar-md { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 800; flex: none; }
.avatar-sm { width: 30px; height: 30px; font-size: .85rem; }
.avatar-md { width: 42px; height: 42px; font-size: 1rem; }
@media (max-width: 991.98px) {
  .site-header .navbar-collapse { order: 10; width: 100%; }
}

/* ---------- Mobile bottom nav ---------- */
.bottom-nav { position: fixed; bottom: 0; inset-inline: 0; z-index: 1030; display: flex; justify-content: space-around; align-items: flex-end; background: #fff; border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; color: var(--muted); font-size: .7rem; font-weight: 600; position: relative; }
.bottom-nav a i { font-size: 1.3rem; }
.bottom-nav a.active { color: var(--brand); }
.bottom-nav .bn-cta { flex: none; width: 54px; height: 54px; border-radius: 50%; background: var(--accent); color: #1f1300; justify-content: center; margin-top: -24px; box-shadow: 0 6px 16px rgba(242, 165, 65, .45); }
.bottom-nav .bn-cta i { font-size: 1.6rem; }
.count-dot { position: absolute; top: -2px; inset-inline-end: 22%; min-width: 16px; height: 16px; border-radius: 8px; background: #e53935; color: #fff; font-size: 10px; line-height: 16px; text-align: center; padding: 0 4px; }

/* ---------- Hero ---------- */
.hero { background: radial-gradient(1200px 400px at 85% -10%, rgba(242, 165, 65, .25), transparent 60%), linear-gradient(135deg, #073d2c 0%, var(--brand) 60%, #13976d 100%); color: #fff; padding: 2.5rem 0 1.5rem; }
@media (min-width: 992px) { .hero { padding: 4rem 0 2rem; } }
.hero-kicker { display: inline-flex; gap: .4rem; align-items: center; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); padding: .25rem .8rem; border-radius: 999px; font-size: .85rem; font-weight: 600; margin-bottom: 1rem; }
.hero-kicker i { color: var(--accent); }
.hero-title { font-weight: 800; font-size: clamp(1.9rem, 5.5vw, 3.2rem); line-height: 1.2; margin-bottom: .75rem; }
.hero-sub { font-size: 1.1rem; opacity: .88; max-width: 560px; }
.hero-search { position: relative; display: flex; gap: .5rem; background: #fff; padding: .4rem; border-radius: 14px; margin-top: 1.25rem; max-width: 620px; box-shadow: 0 10px 30px rgba(0, 0, 0, .15); }
.hero-search i { position: absolute; inset-inline-start: 18px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.hero-search .form-control { border: 0; padding-inline-start: 38px; font-size: 1.02rem; min-height: 46px; box-shadow: none; }
.hero-search .btn { white-space: nowrap; }
.hero-search-sm { margin-top: 0; }
.hero-examples { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .8rem; }
.hero-examples a { color: #fff; background: rgba(255, 255, 255, .12); padding: .15rem .65rem; border-radius: 999px; font-size: .82rem; }
.hero-examples a:hover { background: rgba(255, 255, 255, .25); }
.hero .btn-outline-light:hover { color: var(--brand); }
.hero-demo { background: rgba(255, 255, 255, .97); color: var(--ink); border-radius: 18px; padding: 1rem; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.demo-rfq { background: var(--brand-soft); border-radius: 12px; padding: .8rem 1rem; margin-bottom: .6rem; }
.demo-offer { display: flex; gap: .75rem; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: .6rem .8rem; margin-top: .5rem; }
.demo-offer.best { border-color: var(--brand); background: #f3fbf7; }
.hero-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; margin-top: 2rem; }
@media (min-width: 768px) { .hero-stats { grid-template-columns: repeat(4, 1fr); } }
.hero-stats div { background: rgba(255, 255, 255, .1); border-radius: 12px; padding: .75rem 1rem; }
.hero-stats strong { display: block; font-size: 1.5rem; font-weight: 800; }
.hero-stats span { font-size: .85rem; opacity: .85; }

.page-hero { background: linear-gradient(135deg, #073d2c, var(--brand)); color: #fff; padding: 1.75rem 0; }
.page-hero h1 { font-size: clamp(1.4rem, 4vw, 2rem); }
.hero-icon { width: 60px; height: 60px; border-radius: 16px; background: rgba(255, 255, 255, .15); display: inline-flex; align-items: center; justify-content: center; font-size: 1.8rem; flex: none; }

/* ---------- Sections ---------- */
.section { padding: 2.5rem 0; }
@media (min-width: 992px) { .section { padding: 3.5rem 0; } }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; gap: 1rem; }
.section-head h2 { font-size: clamp(1.2rem, 3vw, 1.6rem); font-weight: 800; margin: 0; }
.section-head a { font-weight: 600; white-space: nowrap; }
.cta-band { background: linear-gradient(135deg, var(--brand-dark), var(--brand)); color: #fff; }

.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
@media (min-width: 576px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 992px) { .cat-grid { grid-template-columns: repeat(7, 1fr); } }
.cat-tile { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .25rem; padding: 1rem .5rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); transition: border-color .15s, transform .15s; }
.cat-tile:hover { border-color: var(--brand); transform: translateY(-2px); color: var(--brand); }
.cat-tile i { font-size: 1.7rem; color: var(--brand); }
.cat-tile span { font-weight: 700; font-size: .92rem; line-height: 1.3; }
.cat-tile small { color: var(--muted); font-size: .72rem; }

.how-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 1.5rem; }
.how-card-alt { background: #fffaf2; border-color: #f6dfb8; }
.how-steps { list-style: none; padding: 0; margin: 0 0 1.25rem; }
.how-steps li { display: flex; gap: .9rem; margin-bottom: 1rem; }
.how-steps li b { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.how-card-alt .how-steps li b { background: var(--accent); color: #1f1300; }
.how-steps p { margin: 0; color: var(--muted); font-size: .9rem; }
.loop-flow { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; }
.loop-step { display: flex; align-items: center; gap: .4rem; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: .45rem .9rem; font-weight: 600; font-size: .9rem; }
.loop-step i { color: var(--brand); }
.loop-step:not(:last-child)::after { content: '→'; margin-inline-start: .5rem; color: var(--muted); }
[dir=rtl] .loop-step:not(:last-child)::after { content: '←'; }
.feature-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; height: 100%; }
.feature-box i { font-size: 1.6rem; color: var(--brand); display: block; margin-bottom: .5rem; }

/* ---------- Cards ---------- */
.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.rfq-card { transition: border-color .15s, box-shadow .15s; }
.rfq-card:hover { border-color: var(--brand); box-shadow: 0 6px 20px rgba(11, 110, 79, .1); }
.rfq-card.is-matched { border-inline-start: 4px solid var(--accent); }
.cat-chip { display: inline-flex; align-items: center; gap: .3rem; background: var(--brand-soft); color: var(--brand); border-radius: 999px; padding: .15rem .65rem; font-size: .78rem; font-weight: 700; }
.rfq-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; background: var(--bg); border-radius: 10px; padding: .6rem; }
.rfq-facts span, .facts-grid span, .offer-metrics span { display: block; color: var(--muted); font-size: .72rem; }
.rfq-facts strong { font-size: .84rem; }
.facts-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
@media (min-width: 768px) { .facts-grid { grid-template-columns: repeat(3, 1fr); } }
.facts-grid > div { background: var(--bg); border-radius: 10px; padding: .6rem .8rem; }
.facts-grid strong { font-size: .98rem; }
.spec-chip { display: inline-block; background: #fff7e8; border: 1px solid #f6dfb8; border-radius: 8px; padding: .1rem .55rem; font-weight: 600; font-size: .88rem; }
.raw-quote { background: #fffaf2; border-inline-start: 3px solid var(--accent); padding: .6rem .9rem; border-radius: 8px; color: #6b4b16; margin: 0; }

.product-card { overflow: hidden; }
.product-thumb { display: block; position: relative; aspect-ratio: 1 / 1; background: #eef2f5; overflow: hidden; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.product-card:hover .product-thumb img { transform: scale(1.04); }
.thumb-placeholder { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; background: linear-gradient(135deg, #e7f3ee, #f4f7f9); color: var(--brand); font-size: 2.6rem; opacity: .8; }
.thumb-badge { position: absolute; top: 8px; inset-inline-start: 8px; }
.price-line { font-weight: 800; color: var(--brand); font-size: 1.05rem; }
.price-big { font-size: 1.8rem; font-weight: 800; color: var(--brand); }
.price-big small { font-size: .95rem; color: var(--muted); font-weight: 600; }

.logo-img { border-radius: 12px; object-fit: cover; border: 1px solid var(--line); background: #fff; flex: none; }
.logo-initials { display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; background: linear-gradient(135deg, var(--brand-soft), #d5ece2); color: var(--brand); font-weight: 800; flex: none; }

/* ---------- Badges ---------- */
.badge { font-weight: 700; }
.badge-sm { font-size: .68rem; padding: .3em .55em; }
.badge-verified { background: #e6f2ff; color: #0b63c4; }
.badge-top { background: #fff3d6; color: #9a6200; }
.badge-fast { background: #e8f8ef; color: #127a45; }
.badge-new { background: #fdeee4; color: #b4521b; }
.badge-best { background: var(--brand); color: #fff; }
.badges-row { display: flex; flex-wrap: wrap; gap: .3rem; }
.stars { color: #f5a623; white-space: nowrap; }
.stars small { color: var(--muted); }
.status-badge { font-size: .72rem; }

/* ---------- Filters & chips ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem; box-shadow: var(--shadow); }
.filter-bar > .form-control, .filter-bar > .form-select { flex: 1 1 160px; }
.filter-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); position: sticky; top: 80px; }
.chip-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .8rem; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink); font-size: .85rem; font-weight: 600; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip-sm { padding: .1rem .55rem; font-size: .76rem; }
.rfq-nudge { display: flex; align-items: center; gap: .8rem; background: #fffaf2; border: 1px dashed #f0c27a; border-radius: var(--radius); padding: .75rem 1rem; }
.rfq-nudge > i { font-size: 1.4rem; color: var(--accent-dark); }
.rfq-nudge-big { padding: 1.1rem 1.25rem; }
@media (max-width: 575.98px) { .rfq-nudge { flex-wrap: wrap; } .rfq-nudge .btn { width: 100%; } }

/* ---------- Detail pages ---------- */
.detail-card { border-radius: 18px; }
.side-box { border-radius: 16px; }
@media (min-width: 992px) { .offer-form-card { position: sticky; top: 84px; } }
.offer-live-total { display: flex; justify-content: space-between; align-items: center; background: var(--brand-soft); border-radius: 10px; padding: .6rem .9rem; margin: .9rem 0 .5rem; }
.offer-live-total strong { font-size: 1.2rem; color: var(--brand); }
.offer-card.is-best { border: 2px solid var(--brand); }
.offer-card.is-accepted { border: 2px solid #198754; background: #f4fbf6; }
.offer-card.is-dim { opacity: .6; }
.offer-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; margin-top: .9rem; }
@media (min-width: 576px) { .offer-metrics { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 992px) { .offer-metrics { grid-template-columns: repeat(6, 1fr); } }
.offer-metrics > div { background: var(--bg); border-radius: 10px; padding: .5rem .7rem; }
.offer-metrics strong { font-size: .92rem; }
.offer-msg { background: #fafbfc; border-radius: 10px; padding: .6rem .8rem; margin: .75rem 0 0; font-size: .92rem; color: #374151; }
.offer-total { min-width: 120px; }
.compare-table table { min-width: 640px; }
.compare-table th { font-size: .78rem; color: var(--muted); font-weight: 700; white-space: nowrap; background: #fafbfc; }
.compare-table { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.sort-group .btn { font-weight: 600; }
.match-item { display: flex; align-items: center; gap: .6rem; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .55rem .7rem; }

.gallery-main { aspect-ratio: 1 / 1; background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-thumbs { display: flex; gap: .5rem; margin-top: .6rem; overflow-x: auto; }
.gallery-thumbs button { border: 1px solid var(--line); border-radius: 10px; padding: 0; overflow: hidden; width: 70px; height: 70px; flex: none; background: #fff; }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }

.supplier-hero { background: linear-gradient(135deg, #073d2c, var(--brand)); color: #fff; padding: 1.75rem 0; }
.supplier-hero .badge.text-bg-light { color: var(--ink) !important; }
.stat-strip { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
@media (min-width: 768px) { .stat-strip { grid-template-columns: repeat(4, 1fr); } }
.stat-strip > div { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; text-align: center; }
.stat-strip strong { display: block; font-size: 1.4rem; font-weight: 800; }
.stat-strip span { font-size: .82rem; color: var(--muted); }
.info-list { list-style: none; padding: 0; margin: 0; }
.info-list li { display: grid; grid-template-columns: 22px 1fr auto; gap: .5rem; align-items: center; padding: .45rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.info-list li:last-child { border: 0; }
.info-list span { color: var(--muted); }
.info-list strong { text-align: end; }
.review-item { border-bottom: 1px solid var(--line); padding: .8rem 0; }
.review-item:last-child { border: 0; }

/* ---------- Forms ---------- */
.form-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 1.25rem; box-shadow: var(--shadow); }
@media (min-width: 768px) { .form-card { padding: 1.75rem; } }
.smart-input { background: linear-gradient(135deg, #fffaf2, #fff); border: 1px solid #f6dfb8; border-radius: 14px; padding: 1rem; }
.more-details summary { cursor: pointer; font-weight: 700; color: var(--brand); list-style: none; }
.more-details summary::-webkit-details-marker { display: none; }
.auth-card { max-width: 440px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 1.5rem; box-shadow: var(--shadow); }
.auth-card-wide { max-width: 720px; }
@media (min-width: 768px) { .auth-card { padding: 2rem 2.25rem; } }
.role-picker { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.role-option input { position: absolute; opacity: 0; }
.role-option span { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .2rem; border: 2px solid var(--line); border-radius: 14px; padding: 1rem .5rem; cursor: pointer; height: 100%; transition: border-color .15s, background .15s; }
.role-option span i { font-size: 1.8rem; color: var(--brand); }
.role-option span small { color: var(--muted); font-size: .78rem; line-height: 1.3; }
.role-option input:checked + span { border-color: var(--brand); background: var(--brand-soft); }
.role-option input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.demo-box { background: #f1f5f9; border-radius: 12px; padding: .75rem 1rem; font-size: .85rem; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .4rem; }
.check-grid-sm { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); max-height: 260px; overflow-y: auto; padding: .25rem; border: 1px solid var(--line); border-radius: 10px; }
.check-tile { position: relative; margin: 0; }
.check-tile input { position: absolute; opacity: 0; }
.check-tile span { display: block; border: 1px solid var(--line); border-radius: 10px; padding: .4rem .6rem; cursor: pointer; font-size: .85rem; background: #fff; }
.check-tile input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.check-tile input:focus-visible + span { outline: 2px solid var(--brand); }
.img-edit { position: relative; width: 90px; height: 90px; }
.img-edit img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.img-edit .btn { position: absolute; top: 4px; inset-inline-end: 4px; padding: 0 .3rem; line-height: 1.2; }
#imgPreview img { width: 70px; height: 70px; object-fit: cover; border-radius: 8px; }
.star-input { display: inline-flex; flex-direction: row-reverse; gap: .15rem; }
[dir=rtl] .star-input { flex-direction: row-reverse; }
.star-input input { display: none; }
.star-input label { font-size: 1.8rem; color: #d1d5db; cursor: pointer; }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: #f5a623; }

/* ---------- Dashboard ---------- */
.side-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: .75rem; position: sticky; top: 80px; box-shadow: var(--shadow); }
.side-user { display: flex; gap: .7rem; align-items: center; padding: .5rem .5rem .9rem; border-bottom: 1px solid var(--line); margin-bottom: .5rem; }
.side-nav a { display: flex; align-items: center; gap: .7rem; padding: .55rem .75rem; border-radius: 10px; color: var(--ink); font-weight: 600; font-size: .93rem; }
.side-nav a i { font-size: 1.1rem; color: var(--muted); }
.side-nav a:hover { background: var(--bg); }
.side-nav a.active { background: var(--brand-soft); color: var(--brand); }
.side-nav a.active i { color: var(--brand); }
.dash-tabs { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .6rem; margin-bottom: .6rem; scrollbar-width: none; }
.dash-tabs::-webkit-scrollbar { display: none; }
.dash-tabs a { flex: none; padding: .35rem .8rem; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink); font-size: .82rem; font-weight: 600; white-space: nowrap; }
.dash-tabs a.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: 1.25rem; }
.welcome-card { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; background: linear-gradient(135deg, #073d2c, var(--brand)); color: #fff; border-radius: 18px; padding: 1.25rem 1.5rem; }
.stat-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; color: var(--ink); height: 100%; box-shadow: var(--shadow); transition: border-color .15s; }
a.stat-card:hover { border-color: var(--brand); color: var(--ink); }
.stat-card i { font-size: 1.3rem; color: var(--brand); width: 40px; height: 40px; border-radius: 10px; background: var(--brand-soft); display: inline-flex; align-items: center; justify-content: center; margin-bottom: .6rem; }
.stat-card strong { font-size: 1.45rem; font-weight: 800; line-height: 1.2; word-break: break-word; }
.stat-card span { color: var(--muted); font-size: .84rem; }
.empty-state { text-align: center; padding: 2.5rem 1rem; background: #fff; border: 1px dashed #cfd8e3; border-radius: var(--radius); }
.empty-state i { font-size: 2.4rem; color: #9fb3c8; }
.empty-state p { color: var(--muted); margin: .5rem 0 1rem; }
.thumb-sm { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; display: inline-flex; font-size: 1.1rem; }
.notif-item { display: flex; gap: .8rem; align-items: center; padding: .85rem 1rem; }
.notif-item.unread { background: #f3fbf7; }
.notif-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.unread-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); flex: none; }
.order-steps { display: flex; justify-content: space-between; position: relative; max-width: 520px; }
.order-steps::before { content: ''; position: absolute; top: 17px; inset-inline: 30px; height: 3px; background: var(--line); }
.ostep { position: relative; display: flex; flex-direction: column; align-items: center; gap: .3rem; z-index: 1; }
.ostep span { width: 36px; height: 36px; border-radius: 50%; background: #fff; border: 3px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: var(--muted); }
.ostep.done span { background: var(--brand); border-color: var(--brand); color: #fff; }
.ostep small { font-weight: 600; font-size: .78rem; }
.pro-box { background: linear-gradient(135deg, #fff7e8, #fff); border: 1px solid #f6dfb8; border-radius: 12px; padding: .8rem 1rem; }
.fav-btn.is-fav, .fav-btn.is-fav i { color: #e53935; }
.fav-corner { position: absolute; top: 8px; inset-inline-end: 8px; z-index: 3; background: #fff; }

/* ---------- Subscriptions ---------- */
.plan-card { position: relative; border-radius: 18px; transition: border-color .15s, transform .15s; }
.plan-card:hover { border-color: var(--brand); }
.plan-featured { border: 2px solid var(--accent); box-shadow: 0 10px 30px rgba(242, 165, 65, .18); }
.plan-current { border: 2px solid var(--brand); }
.plan-ribbon { position: absolute; top: -12px; inset-inline-end: 16px; background: var(--accent); color: #1f1300; font-size: .75rem; font-weight: 800; padding: .2rem .7rem; border-radius: 999px; }
.plan-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: .35rem; margin-bottom: .25rem; }
.plan-amount { font-size: 1.9rem; font-weight: 800; color: var(--brand); line-height: 1.1; }
.plan-period { color: var(--muted); font-weight: 600; }
.plan-features { list-style: none; padding: 0; margin: 0 0 1rem; }
.plan-features li { display: flex; gap: .5rem; padding: .3rem 0; font-size: .92rem; }
.plan-features i { color: var(--brand); flex: none; margin-top: .15rem; }
.sub-status-icon { font-size: 2rem; color: var(--brand); }
.sub-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
@media (min-width: 768px) { .sub-grid { grid-template-columns: repeat(5, 1fr); } }
.sub-grid > div { background: var(--bg); border-radius: 10px; padding: .6rem .8rem; }
.sub-grid span { display: block; color: var(--muted); font-size: .72rem; }
.sub-grid strong { font-size: .98rem; }
.sub-status-active { border-inline-start: 4px solid #198754; }
.sub-status-pending { border-inline-start: 4px solid #ffc107; }
.sub-status-expired, .sub-status-cancelled { border-inline-start: 4px solid #dc3545; }
.sub-notice { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; background: #fff7e8; border: 1px solid #f6dfb8; border-radius: 12px; padding: .8rem 1rem; }
.sub-notice > i { font-size: 1.4rem; color: var(--accent-dark); }
.sub-notice-compact { padding: .5rem .75rem; font-size: .9rem; }
.price-inline { min-width: 170px; max-width: 210px; }

/* ---------- Orders board / inventory / team (mobile-first, big touch targets) ---------- */
.dash-group-title { font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: .25rem 0 .5rem; }
.stat-card.stat-warn { border-color: #f6dfb8; background: #fffaf2; }
.stat-card.stat-warn i { background: #fff1d6; color: var(--accent-dark); }
.stat-card.stat-danger { border-color: #f5c2c7; background: #fff5f5; }
.stat-card.stat-danger i { background: #fde2e4; color: #c62828; }
.stat-card.stat-accent { border-color: var(--accent); background: #fffaf2; }
.board-counters { display: grid; grid-template-columns: repeat(5, 1fr); gap: .5rem; }
.board-counter { display: flex; flex-direction: column; align-items: center; gap: .1rem; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .5rem .25rem; color: var(--ink); text-align: center; }
.board-counter i { font-size: 1.2rem; color: var(--brand); }
.board-counter strong { font-size: 1.25rem; line-height: 1.1; }
.board-counter span { font-size: .68rem; color: var(--muted); font-weight: 600; line-height: 1.2; }
.board-new { border-color: #f5c2c7; } .board-new i { color: #c62828; }
.board-title { font-size: 1.05rem; font-weight: 800; margin: .5rem 0 .75rem; display: flex; align-items: center; gap: .4rem; }
.order-card { border-inline-start: 5px solid var(--line); }
.order-card.order-new { border-inline-start-color: #dc3545; }
.order-card.order-accepted { border-inline-start-color: #198754; }
.order-card.order-preparing { border-inline-start-color: #ffc107; }
.order-card.order-shipped { border-inline-start-color: #0dcaf0; }
.order-items { list-style: none; padding: 0; margin: 0 0 .5rem; }
.order-items li { display: flex; justify-content: space-between; gap: .5rem; padding: .35rem 0; border-bottom: 1px dashed var(--line); font-size: 1rem; }
.order-note { background: #fffaf2; border-radius: 8px; padding: .4rem .6rem; margin-bottom: .5rem; }
.order-actions { display: grid; gap: .5rem; }
.order-actions .btn-lg { min-height: 52px; font-size: 1.05rem; }
.order-steps-5 { max-width: 640px; }
.timeline { list-style: none; padding: 0; margin: 0; border-inline-start: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 .7rem .9rem; }
[dir=rtl] .timeline li { padding: 0 .9rem .7rem 0; }
.timeline li::before { content: ''; position: absolute; top: .45rem; inset-inline-start: -6px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.stock-box { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: .9rem; }
.inv-card.inv-low { border-color: #f6dfb8; }
.inv-card.inv-out { border-color: #f5c2c7; }
.inv-numbers { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; }
.inv-numbers > div { background: var(--bg); border-radius: 10px; padding: .45rem .5rem; text-align: center; }
.inv-numbers span { display: block; font-size: .68rem; color: var(--muted); font-weight: 600; }
.inv-numbers strong { font-size: 1.1rem; }
.inv-numbers .inv-available { background: var(--brand-soft); }
.inv-numbers .inv-available strong { color: var(--brand); }
.adj-form .btn-lg, .adj-form .form-control-lg { min-height: 50px; }
.move-item { display: flex; align-items: center; gap: .75rem; }
.move-qty { min-width: 74px; font-weight: 800; font-size: 1.05rem; }
.move-qty.neg { color: #c62828; }
.move-qty.pos { color: #198754; }
.order-box { background: #fff; border: 2px solid var(--accent); border-radius: 14px; padding: 1rem; }
.worker-card .btn { min-height: 44px; }
@media (max-width: 575.98px) {
  .board-counters { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .3rem; }
  .board-counter span { font-size: .6rem; }
  .inv-numbers strong { font-size: 1rem; }
}

/* ---------- Delivery by wilaya / promotions / moderation ---------- */
.delivery-head, .delivery-row { display: grid; grid-template-columns: 28px 1fr 130px 100px; gap: .5rem; align-items: center; }
.delivery-head { font-size: .75rem; color: var(--muted); font-weight: 700; padding: 0 .6rem .3rem; }
.delivery-rows { max-height: 60vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; }
.delivery-row { padding: .45rem .6rem; border-bottom: 1px solid var(--line); background: #fff; }
.delivery-row:last-child { border-bottom: 0; }
.delivery-row.on { background: var(--brand-soft); }
@media (max-width: 575.98px) {
  .delivery-row { grid-template-columns: 28px 1fr 1fr; }
  .delivery-row label { grid-column: 2 / 4; }
  .delivery-row input[type=number]:first-of-type { grid-column: 2; }
}
.promo-card { border: 2px dashed var(--accent); background: #fffdf8; }
.report-actions { display: flex; flex-wrap: wrap; gap: .3rem; }

/* Tables become cards on small screens */
@media (max-width: 767.98px) {
  .table-mobile thead { display: none; }
  .table-mobile, .table-mobile tbody, .table-mobile tr, .table-mobile td { display: block; width: 100%; }
  .table-mobile tr { border-bottom: 1px solid var(--line); padding: .6rem .75rem; }
  .table-mobile td { border: 0; padding: .2rem 0; text-align: start !important; }
  .table-mobile td[data-label]::before { content: attr(data-label); display: block; font-size: .72rem; color: var(--muted); font-weight: 600; }
  .table-mobile td.thumb-cell { display: none; }
}

/* ---------- Messages ---------- */
.chat-wrap { overflow: hidden; }
.chat-list { border-inline-end: 1px solid var(--line); max-height: 70vh; overflow-y: auto; }
.chat-item { display: flex; gap: .7rem; align-items: center; padding: .8rem 1rem; border-bottom: 1px solid var(--line); color: var(--ink); }
.chat-item:hover { background: var(--bg); }
.chat-item.active { background: var(--brand-soft); }
.chat-pane { display: flex; flex-direction: column; min-height: 60vh; max-height: 75vh; }
.chat-head { display: flex; align-items: center; gap: .5rem; padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
.chat-body { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .5rem; background: #f8faf9; }
.bubble { max-width: 80%; padding: .55rem .8rem; border-radius: 14px; font-size: .93rem; }
.bubble small { display: block; font-size: .7rem; opacity: .7; margin-top: .2rem; }
.bubble.mine { align-self: flex-end; background: var(--brand); color: #fff; border-end-end-radius: 4px; }
.bubble.theirs { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-end-start-radius: 4px; }
.bubble-ref { display: inline-block; font-size: .72rem; color: inherit; opacity: .85; margin-bottom: .2rem; }
.chat-form { display: flex; gap: .5rem; padding: .75rem; border-top: 1px solid var(--line); background: #fff; }
.chat-form textarea { resize: none; }

/* ---------- Footer & misc ---------- */
.site-footer { background: #0e1b22; color: #cbd5e1; padding: 2.5rem 0 1rem; margin-top: 3rem; }
.site-footer h6 { color: #fff; font-weight: 700; margin-bottom: .8rem; }
.site-footer a { color: #cbd5e1; }
.site-footer a:hover { color: #fff; }
.site-footer li { margin-bottom: .4rem; font-size: .92rem; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 1.5rem; padding-top: 1rem; font-size: .82rem; color: #94a3b8; text-align: center; }
.is-dashboard .site-footer { margin-top: 1rem; }
.error-code { font-size: 5rem; font-weight: 800; color: var(--brand); line-height: 1; }
.breadcrumb { margin-bottom: .75rem; }
.alert { border-radius: 12px; }
.report-box a { cursor: pointer; }
.dropdown-menu { border-radius: 12px; border-color: var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, .08); }
.dropdown-item.active, .dropdown-item:active { background: var(--brand); }
[dir=rtl] .me-1 { margin-left: .25rem !important; margin-right: 0 !important; }
[dir=rtl] .me-2 { margin-left: .5rem !important; margin-right: 0 !important; }
