/* ============ الخطوط (مستضافة محليًا، لا CDN) ============ */
@font-face {
  font-family: 'Tajawal';
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/tajawal-arabic-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Tajawal';
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/tajawal-arabic-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Tajawal';
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/tajawal-arabic-700-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Reem Kufi';
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/reem-kufi-arabic-700-normal.woff2') format('woff2');
}

/* ============ الألوان: أسود وذهبي، مطابقة لهوية الشعار ============ */
:root {
  --bg: #08080a;
  --bg-soft: #0e0e11;
  --panel: #131316;
  --panel-2: #1a1a1e;
  --line: rgba(212, 175, 90, 0.16);
  --line-strong: rgba(212, 175, 90, 0.32);
  --gold-1: #f3dfa4;
  --gold-2: #c79a3f;
  --gold-solid: #d4af5a;
  --ink: #f4ecd8;
  --muted: #a99a76;
  --danger: #e6684f;
  --danger-bg: rgba(230, 104, 79, 0.12);
  --success: #58b78a;
  --success-bg: rgba(88, 183, 138, 0.12);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-lift: 0 24px 60px -28px rgba(0, 0, 0, 0.65);
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Tajawal', Tahoma, Arial, sans-serif;
  line-height: 1.75;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

h1, h2, h3, .display {
  font-family: 'Reem Kufi', 'Tajawal', sans-serif;
  font-weight: 700;
  margin: 0;
}
.gold-text {
  background: linear-gradient(120deg, var(--gold-1), var(--gold-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.center-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

/* ============ شريط علوي بسيط ============ */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  background: rgba(8, 8, 10, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; }
.topbar .brand img { width: 34px; height: 34px; border-radius: 8px; }
.topbar nav { display: flex; gap: 10px; align-items: center; }

/* ============ أزرار ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: 15.5px; font-weight: 700;
  padding: 12px 26px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none;
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s, filter .25s, background .25s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.98); }
.btn-gold {
  background: linear-gradient(120deg, var(--gold-1), var(--gold-2));
  color: #14110a;
  box-shadow: 0 14px 30px -12px rgba(212, 175, 90, 0.55);
}
.btn-gold:hover { filter: brightness(1.08); box-shadow: 0 18px 36px -12px rgba(212, 175, 90, 0.7); }
.btn-outline {
  background: transparent; color: var(--ink); border-color: var(--line-strong);
}
.btn-outline:hover { background: var(--panel-2); border-color: var(--gold-solid); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: rgba(230,104,79,.35); }
.btn-danger:hover { background: rgba(230,104,79,.2); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 13.5px; }

/* ============ بطاقات ولوحات ============ */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.panel-narrow { max-width: 460px; width: 100%; }
.panel-wide { max-width: 720px; width: 100%; }

/* ============ نماذج ============ */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 7px; font-weight: 500; }
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="password"],
.field input[type="number"],
.field textarea,
.field select {
  width: 100%; font-family: inherit; font-size: 15.5px; color: var(--ink);
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--gold-solid); box-shadow: 0 0 0 3px rgba(212,175,90,.15);
}
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.field .error { font-size: 13px; color: var(--danger); margin-top: 6px; }
.field.has-error input, .field.has-error select { border-color: var(--danger); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

.file-drop {
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius-md);
  padding: 20px; text-align: center; cursor: pointer; background: var(--bg-soft);
  transition: border-color .2s, background .2s;
}
.file-drop input[type="file"] { display: none; }
.file-drop:hover, .file-drop.drag-over { border-color: var(--gold-solid); background: var(--panel-2); }
.file-drop .file-name { color: var(--gold-1); font-size: 13.5px; margin-top: 6px; }

.alert { border-radius: var(--radius-sm); padding: 13px 16px; font-size: 14.5px; margin-bottom: 18px; }
.alert-error { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(230,104,79,.3); }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(88,183,138,.3); }

/* ============ خطوات التسجيل ============ */
.steps { display: flex; gap: 8px; margin-bottom: 28px; }
.steps .step { flex: 1; height: 4px; border-radius: 4px; background: var(--panel-2); overflow: hidden; }
.steps .step .fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--gold-1), var(--gold-2)); transition: width .5s cubic-bezier(.2,.8,.2,1); }
.wizard-page { display: none; }
.wizard-page.active { display: block; animation: fadeSlide .45s cubic-bezier(.2,.8,.2,1); }
@keyframes fadeSlide { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.wizard-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; }

/* ============ صفحة الهبوط ============ */
.hero { padding: 90px 0 60px; text-align: center; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(700px 420px at 85% -10%, rgba(212,175,90,.14), transparent 60%),
    radial-gradient(560px 380px at 5% 110%, rgba(212,175,90,.08), transparent 60%);
}
.hero-logo { width: 150px; height: 150px; margin: 0 auto 26px; opacity: 0; }
.hero h1 { font-size: clamp(32px, 5vw, 54px); margin-bottom: 16px; }
.hero p.lead { color: var(--muted); font-size: 18px; max-width: 560px; margin: 0 auto 34px; }
.hero-ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* بطاقات اختيار نوع الحساب */
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 10px; }
@media (max-width: 700px) { .choice-grid { grid-template-columns: 1fr; } }
.choice-card {
  position: relative; display: block; text-decoration: none; color: inherit;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 34px 26px; text-align: center; overflow: hidden;
  transition: transform .4s cubic-bezier(.2,.8,.2,1), border-color .3s, box-shadow .4s;
}
.choice-card:hover { transform: translateY(-6px); border-color: var(--gold-solid); box-shadow: var(--shadow-lift); }
.choice-card .icon-wrap {
  width: 88px; height: 88px; margin: 0 auto 20px; border-radius: 24px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, var(--panel-2), var(--bg-soft));
  border: 1px solid var(--line-strong);
  transition: transform .5s cubic-bezier(.2,.8,.2,1);
}
.choice-card:hover .icon-wrap { transform: rotate(-6deg) scale(1.06); }
.choice-card svg { width: 42px; height: 42px; stroke: var(--gold-1); }
.choice-card h3 { font-size: 20px; margin-bottom: 8px; }
.choice-card p { color: var(--muted); font-size: 14.5px; }

/* ============ OTP ============ */
.otp-inputs { display: flex; gap: 10px; justify-content: center; direction: ltr; margin: 22px 0; }
.otp-inputs input {
  width: 48px; height: 58px; text-align: center; font-size: 26px; font-weight: 700;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
.otp-inputs input:focus { outline: none; border-color: var(--gold-solid); box-shadow: 0 0 0 3px rgba(212,175,90,.15); }
.otp-timer { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.otp-timer.expired { color: var(--danger); }

/* ============ الاتفاقية ============ */
.agreement-box {
  max-height: 340px; overflow-y: auto; background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 20px 22px; font-size: 15px; color: var(--ink); line-height: 2;
}
.agreement-box h3 { font-size: 18px; margin-bottom: 10px; }
.checkbox-row { display: flex; align-items: center; gap: 10px; margin: 18px 0; }
.checkbox-row input { width: 18px; height: 18px; accent-color: var(--gold-solid); }

/* ============ حالة قيد المراجعة ============ */
.status-icon { width: 84px; height: 84px; margin: 0 auto 22px; }

/* ============ لوحات التحكم ============ */
.dash-shell { display: flex; min-height: 100vh; }
.dash-sidebar {
  width: 240px; flex-shrink: 0; background: var(--bg-soft); border-inline-end: 1px solid var(--line);
  padding: 20px 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.dash-sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 8px 10px 22px; font-weight: 700; }
.dash-sidebar .brand img { width: 32px; height: 32px; border-radius: 8px; }
.dash-sidebar a.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: var(--radius-sm);
  color: var(--muted); text-decoration: none; font-size: 14.5px; margin-bottom: 4px; transition: background .2s, color .2s;
}
.dash-sidebar a.nav-link:hover, .dash-sidebar a.nav-link.active { background: var(--panel-2); color: var(--ink); }
.dash-main { flex: 1; padding: 28px 32px; max-width: 100%; overflow-x: hidden; }
.dash-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; flex-wrap: wrap; gap: 12px; }
.dash-header h1 { font-size: 24px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 20px; }
.stat-card .num { font-size: 30px; font-weight: 700; font-family: 'Reem Kufi'; }
.stat-card .label { color: var(--muted); font-size: 13.5px; margin-top: 4px; }

table.data-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.data-table th { text-align: right; color: var(--muted); font-weight: 500; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.data-table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data-table tr:hover td { background: rgba(255,255,255,.02); }

.badge { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.badge-pending { background: rgba(212,175,90,.15); color: var(--gold-1); }
.badge-approved { background: var(--success-bg); color: var(--success); }
.badge-rejected { background: var(--danger-bg); color: var(--danger); }
.badge-suspended { background: rgba(255,255,255,.08); color: var(--muted); }

.filter-tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.filter-tabs a { padding: 8px 16px; border-radius: 999px; font-size: 13.5px; text-decoration: none; color: var(--muted); border: 1px solid var(--line); }
.filter-tabs a.active { background: var(--panel-2); color: var(--gold-1); border-color: var(--gold-solid); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state svg { width: 64px; height: 64px; margin-bottom: 16px; opacity: .6; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.product-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.product-card .thumb { height: 150px; background: var(--bg-soft) center/cover no-repeat; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.product-card .body { padding: 16px; }
.product-card h4 { font-size: 16px; margin-bottom: 6px; }
.product-card .price { color: var(--gold-1); font-weight: 700; }
.product-card .tiers { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.product-card .actions { display: flex; gap: 8px; margin-top: 14px; }
.product-card.inactive { opacity: .5; }

.tier-row { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 10px; align-items: center; margin-bottom: 10px; }
@media (max-width: 600px) { .tier-row { grid-template-columns: 1fr 1fr; } }

.package-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.package-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 20px; display: flex; flex-direction: column; }
.package-card .top-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.package-card h4 { font-size: 18px; }
.package-card .price { color: var(--gold-1); font-weight: 700; font-size: 20px; margin: 8px 0; }
.package-card .items-list { color: var(--muted); font-size: 13.5px; line-height: 2; flex: 1; margin-bottom: 14px; }
.package-card .add-form { display: flex; gap: 8px; align-items: center; }
.package-card .add-form input[type="number"] {
  width: 70px; padding: 10px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--bg-soft); color: var(--ink); font-family: inherit;
}
.cart-line { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cart-line .name { font-weight: 700; }
.cart-line .qty-form { display: flex; align-items: center; gap: 8px; }
.cart-line .qty-form input { width: 64px; padding: 8px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--bg-soft); color: var(--ink); }
.cart-total { display: flex; justify-content: space-between; align-items: center; padding-top: 18px; font-size: 19px; font-weight: 700; }
.timeline { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.timeline .tl-step { flex: 1; min-width: 120px; text-align: center; padding: 12px; border-radius: var(--radius-sm); background: var(--bg-soft); border: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.timeline .tl-step.done { color: var(--success); border-color: rgba(88,183,138,.35); background: var(--success-bg); }
.iban-box { background: var(--bg-soft); border: 1px solid var(--line-strong); border-radius: var(--radius-md); padding: 20px; margin: 18px 0; }
.iban-box dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; }
.iban-box dt { color: var(--muted); font-size: 13.5px; }
.iban-box dd { margin: 0; font-weight: 700; }
.swatch { display: inline-block; vertical-align: middle; border-radius: 50%; }
.row-actions { display: flex; gap: 6px; }
.field input[type="color"] { width: 100%; height: 48px; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-soft); cursor: pointer; }

.doc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin: 16px 0 24px; }
.doc-list a { display: block; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; text-align: center; text-decoration: none; color: var(--muted); font-size: 13px; transition: border-color .2s, color .2s; }
.doc-list a:hover { border-color: var(--gold-solid); color: var(--gold-1); }
.doc-list svg { width: 28px; height: 28px; margin: 0 auto 8px; }

.footer-note { text-align: center; color: var(--muted); font-size: 13px; padding: 30px 0; }

/* ============ نافذة منبثقة عامة (اختيار مطبخ، إلخ) ============ */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6);
  align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal-box {
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
  max-width: 460px; width: 100%; max-height: 80vh; display: flex; flex-direction: column; overflow: hidden;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-header h3 { font-size: 17px; }
.modal-close { background: none; border: none; color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1; }
.modal-list { overflow-y: auto; padding: 10px; }
.modal-list .empty-state { padding: 30px 10px; }
.modal-option {
  display: block; width: 100%; text-align: right; background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 8px; cursor: pointer; color: var(--ink);
  font-family: inherit; font-size: 14.5px; transition: border-color .2s, background .2s;
}
.modal-option:hover { border-color: var(--gold-solid); background: var(--panel-2); }
.modal-option .phone { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.kitchen-picker-trigger { display: flex; align-items: center; justify-content: space-between; }

/* ============ فئات مساعدة (بديل عن أي style مضمّن، بسبب CSP الصارم) ============ */
.page-title { font-size: 32px; margin-bottom: 14px; }
.page-lead { color: var(--muted); font-size: 16px; }
.card-title { font-size: 24px; margin-bottom: 6px; }
.card-sub { color: var(--muted); margin-bottom: 26px; }
.step-title { font-size: 17px; margin-bottom: 18px; }
.section-block { max-width: 600px; margin: 0 auto 44px; }
.spacer-lg { padding-top: 64px; padding-bottom: 80px; }
.nav-empty { display: inline-block; }
.ltr-input { direction: ltr; text-align: left; }
.reason-input {
  width: 100%; margin-bottom: 10px; padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--bg-soft); color: var(--ink); font-family: inherit; font-size: 14.5px;
}
.link-muted { color: var(--muted); text-decoration: underline; font-size: 14px; }
.text-center { text-align: center; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
