:root{
  --bg0: #f7f7f7;             /* Main Light Background */
  --bg1: #ececec;             /* Card/Secondary Bg */
  --primary: #66686b;         /* Logo Bag Dark Gray */
  --primary-light: #aaaaaa;   /* Light Bag/Accent Gray */
  --text: #333333;            /* Main Text */
  --text-muted: #888888;      /* Muted Text */
  --accent-yellow: #ffe422;   /* Logo Yellow */
  --accent-orange: #ffb233;   /* Logo Orange */
  --white: #fff;          
  --card: #fff;               /* Card Background */
  --card-border: #e0e0e0;
  --stroke: #ebebeb;          
  --shadow: 0 8px 32px rgba(102,104,107,0.20);
  --radius: 20px;
}

*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }

body{
  margin:0;
  min-height:100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Tahoma, Arial, sans-serif;
  color:var(--text);
  background:
    linear-gradient(120deg, var(--bg0) 80%, var(--accent-yellow) 100%);
}

.container{
  width:min(1100px, 94vw);
  margin:0 auto;
  padding: 18px 0 28px;
}

/* ===== Top Bar ===== */
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 12px 0;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width: 220px;
}

.brandLogo{
  width:44px;
  height:44px;
  border-radius:14px;
  border:1px solid var(--card-border);
  background:var(--white);
  display:grid;
  place-items:center;
  box-shadow: 0 6px 18px rgba(102,104,107,0.07);
  overflow:hidden;
  flex: 0 0 auto;
}
.brandLogo img{
  width:85%;
  height:auto;
}

.brandText h1{
  margin:0;
  font-size:16px;
  color:var(--primary);
  line-height:1.2;
  letter-spacing:.3px;
  font-weight:800;
}
.brandText p{
  margin:3px 0 0;
  color:var(--text-muted);
  font-size:12px;
}

/* ===== Nav Tabs ===== */
.nav{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  justify-content:flex-end;
  align-items:center;
}
.nav a,
.nav button{
  border:1px solid var(--card-border);
  background: var(--white);
  color: var(--primary);
  padding: 9px 10px;
  border-radius: 12px;
  font-weight:700;
  text-decoration:none;
  cursor:pointer;
  transition:.15s ease, border-color .2s;
  white-space: nowrap;
}
.nav a:hover,
.nav button:hover{
  transform: translateY(-1px);
  background: var(--accent-yellow);
  color: var(--primary);
  border-color: var(--accent-orange);
}

/* ===== Home page card ===== */
.mainCard{
  margin-top: 10px;
  border-radius: var(--radius);
  border:1px solid var(--card-border);
  background: var(--card);
  box-shadow: var(--shadow);
  overflow:hidden;
}

.grid{
  display:grid;
  grid-template-columns: 1.1fr .9fr;
  gap:0;
}
@media (max-width: 920px){
  .grid{ grid-template-columns: 1fr; }
}

.left{ padding: 22px; }
.right{
  padding: 22px;
  border-left:1px solid var(--card-border);
}
@media (max-width: 920px){
  .right{
    border-left:none;
    border-top:1px solid var(--card-border);
  }
}
[dir="rtl"] .right{
  border-left:none;
  border-right:1px solid var(--card-border);
}
@media (max-width: 920px){
  [dir="rtl"] .right{ border-right:none; }
}

.title{
  margin:0;
  font-size:32px;
  letter-spacing:.2px;
  color: var(--primary);
  font-weight:900;
}
.sub{
  margin: 10px 0 0;
  color: var(--text-muted);
  line-height: 1.8;
  font-size: 15px;
  max-width: 60ch;
}

/* Pill accent (yellow/orange) */
.pill{
  margin-top: 14px;
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding: 10px 14px;
  border-radius: 999px;
  border:1.8px solid var(--accent-yellow);
  background: linear-gradient(90deg, var(--accent-yellow) 60%, var(--accent-orange) 100%);
  font-weight:800;
  font-size: 13.5px;
  color: var(--primary);
  box-shadow: 0 3px 16px rgba(255,228,34,0.09);
}
.dot{
  width:10px;
  height:10px;
  border-radius:50%;
  background: var(--accent-orange);
  box-shadow: 0 0 0 5px rgba(255,178,51,.14);
}

/* Logo/Icon box */
.logoBox{
  border-radius: 18px;
  border:1px solid var(--card-border);
  background: var(--white);
  padding: 16px;
  display:grid;
  place-items:center;
  min-height: 220px;
  box-shadow: 0 4px 18px rgba(102,104,107,0.04);
}
.logoWhite{
  width:min(260px, 70vw);
  aspect-ratio: 1/1;
  border-radius: 18px;
  background:var(--white);
  border:1px solid var(--card-border);
  display:grid;
  place-items:center;
  padding: 18px;
}
.logoWhite img{
  width: 80%;
  height:auto;
}

.loaderBox{
  margin-top: 14px;
  border-radius: 16px;
  border:1px solid var(--card-border);
  background: var(--bg1);
  padding: 12px;
  display:flex;
  align-items:center;
  gap:12px;
}
.loaderBox img{
  width:54px;
  height:54px;
  object-fit:contain;
}
.loaderBox .t1{ font-weight:900; margin:0; color: var(--primary);}
.loaderBox .t2{
  margin:4px 0 0;
  color:var(--primary-light);
  font-size:12px;
  line-height:1.6;
}

/* ===== Generic page card ===== */
.cardPage{
  margin-top: 10px;
  border-radius: var(--radius);
  border:1px solid var(--card-border);
  background: var(--white);
  box-shadow: var(--shadow);
  overflow:hidden;
}

.cardHeader{
  padding: 18px 22px;
  border-bottom: 1px solid var(--card-border);
  display:flex;
  align-items:center;
  gap:12px;
  background: var(--bg1);
}

.logoWhiteSm{
  width:44px;
  height:44px;
  border-radius:14px;
  border:1px solid var(--card-border);
  background:var(--white);
  display:grid;
  place-items:center;
  overflow:hidden;
  box-shadow: 0 6px 16px rgba(102,104,107,0.07);
  flex: 0 0 auto;
}
.logoWhiteSm img{
  width:85%;
  height:auto;
}
.cardHeader > img{ display:none; }

.cardHeader h2{ margin:0; font-size:18px; color: var(--primary);}
.cardBody{ padding: 18px 22px 22px; }
.cardBody h3{ margin: 18px 0 10px; font-size: 17px; color:var(--primary);}
.cardBody p, .cardBody li, .cardBody label{
  color: var(--text);
  line-height: 1.9;
  font-size: 15px;
}
.cardBody ul{ margin: 8px 0 0; padding-left: 22px; }
[dir="rtl"] .cardBody ul{ padding-left:0; padding-right:22px; }

.box{
  margin-top: 12px;
  border-radius: 14px;
  border:1px solid var(--accent-yellow);
  background: #fffbe8;
  padding: 12px 14px;
  color: var(--primary);
  font-size: 14px;
  line-height: 1.8;
}

a{ color: var(--accent-orange); text-decoration:none; }
a:hover{ text-decoration:underline; }

/* Forms */
.form{ margin-top: 12px; display:grid; gap:10px; max-width: 560px; }
.row{ display:grid; gap:6px; }
input, textarea{
  width:100%;
  padding: 11px 12px;
  border-radius: 12px;
  border:1px solid var(--card-border);
  background: var(--bg1);
  color: var(--text);
  outline:none;
  font-size: 15px;
}
textarea{ min-height: 110px; resize: vertical; }
.actions{ display:flex; gap:10px; flex-wrap:wrap; margin-top: 6px; }
.btn{
  border:1px solid var(--card-border);
  background: var(--white);
  color: var(--primary);
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 800;
  cursor:pointer;
  transition:.15s ease, background-color .22s;
}
.btn:hover{ transform: translateY(-1px); background: var(--accent-yellow);}
.btn.primary{
  border: none;
  background: linear-gradient(90deg, var(--accent-yellow) 60%, var(--accent-orange) 100%);
  box-shadow: 0 8px 18px rgba(255,228,34,0.08);
  color: var(--primary);
}

/* QR */
.qrBox{
  margin-top: 14px;
  border-radius: 16px;
  border:1px solid var(--accent-yellow);
  background: #fffbe8;
  padding: 14px;
  width: fit-content;
  text-align:center;
}
.qrBox img{
  width:150px;
  height:auto;
  border-radius: 10px;
  border:1.5px solid var(--accent-yellow);
  background:#fff;
  padding:6px;
}
.qrLabel{
  margin-top: 10px;
  font-size: 12px;
  color: var(--primary-light);
  line-height: 1.6;
  font-weight: 700;
}

.footer{
  text-align:center;
  padding: 16px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

/* ==========================================================
   MOBILE: force nav to be horizontal scroll (EN + AR)
========================================================== */
@media (max-width: 820px){
  .topbar{
    display:flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 10px !important;
  }

  nav.nav.nav--mobile{
    display:flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;

    width: 100% !important;
    max-width: 100% !important;

    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;

    gap: 8px !important;
    padding: 6px 2px 10px !important;
    margin: 0 !important;

    scrollbar-width: none;
    direction: ltr !important; /* <=== critical for AR scrolling on iOS/Android */
  }
  nav.nav.nav--mobile::-webkit-scrollbar{ display:none; }

  nav.nav.nav--mobile a,
  nav.nav.nav--mobile button{
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    padding: 10px 12px !important;
    border-radius: 14px !important;
    font-size: 13px !important;
  }

  [dir="rtl"] nav.nav.nav--mobile a,
  [dir="rtl"] nav.nav.nav--mobile button{
    direction: rtl !important;
    unicode-bidi: plaintext !important;
    text-align: center !important;
  }

  .left, .right{ padding: 16px; }
  .title{ font-size: 25px;}
}