/* EJA Services — the components, as plain classes over the tokens (tokens.css first, then this). */
body { margin: 0; font-family: var(--font-ui); background: var(--bg); color: var(--text); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
.eja-num { direction: ltr; unicode-bidi: isolate; white-space: nowrap; }   /* money, phone numbers, codes: left to right, even in Arabic */
.eja-row { display: flex; flex-wrap: wrap; gap: var(--space-8); align-items: center; }
.eja-pad { padding: var(--space-16); }

/* buttons: one filled per view; the rest quiet */
.eja-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap-min); padding: 0 18px; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: var(--radius-12); background: transparent; color: var(--text);
  font-family: inherit; font-size: 15px; font-weight: 700; line-height: 1.3; cursor: pointer; }
.eja-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.eja-btn:disabled { opacity: .6; cursor: default; }
.eja-btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.eja-btn-primary { background: var(--brand-fill); border-color: var(--brand-fill); color: var(--on-brand); }
.eja-btn-danger { background: var(--bad-fill); border-color: var(--bad-fill); color: var(--on-brand); }
.eja-btn-wa { background: var(--whatsapp); border-color: var(--whatsapp); color: #ffffff; min-height: 48px; }
.eja-btn-new { border: 0; background: var(--brand-fill); color: var(--on-brand); font-size: 14px; font-weight: 800; box-shadow: var(--shadow-fill); }

/* the one card */
.eja-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-14); box-shadow: var(--shadow-card); padding: var(--space-16); }
.eja-card-t { font-size: 14.5px; font-weight: 800; margin: 0 0 4px; }
.eja-card-m { font-size: 11.5px; color: var(--muted2); }

/* figure tiles (Home) */
.eja-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--space-8); }
.eja-stat { background: var(--card); border: 0; border-radius: var(--radius-16); padding: 14px 14px 12px; box-shadow: var(--shadow-card); min-width: 0; }
.eja-stat-n { font-size: 28px; font-weight: 800; line-height: 1.1; color: var(--brand); }
.eja-stat-n.bad { color: var(--bad); }
.eja-stat-n.wait { color: var(--wait); }
.eja-stat-l { font-size: 13px; font-weight: 600; color: var(--muted2); margin-top: 2px; }

/* amount pills: who owes whom */
.eja-amt { display: inline-flex; align-items: center; gap: var(--space-7); max-width: 100%; padding: 3px 9px; border-radius: var(--radius-pill); font-size: 13px; }
.eja-amt b { font-family: var(--font-mono); font-weight: 800; }
.eja-amt.owes { background: var(--bad-soft); color: var(--bad); }
.eja-amt.mine { background: var(--brand-soft); color: var(--brand); }

/* chips */
.eja-chip { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1px solid transparent; border-radius: var(--radius-pill);
  background: var(--brand-soft); color: var(--brand); font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.eja-chip.on { background: var(--brand-fill); border-color: var(--brand-fill); color: var(--on-brand); }
.eja-chip:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* the six code boxes: always left to right, even in Arabic */
.eja-code { display: flex; gap: var(--space-7); justify-content: center; direction: ltr; }
.eja-code input { width: min(var(--code-w), 12vw); height: var(--code-h); padding: 0; box-sizing: border-box; text-align: center;
  font-family: var(--font-mono); font-size: 22px; font-weight: 800; border: 1.5px solid var(--code-empty-line); border-radius: var(--radius-10);
  background: var(--card); color: var(--text); outline: none; }
.eja-code input.full, .eja-code input:focus { border-color: var(--brand); }

/* fields */
.eja-field { display: grid; gap: 6px; }
.eja-field label { font-size: 13px; font-weight: 600; color: var(--muted); }
.eja-input { width: 100%; box-sizing: border-box; min-height: var(--field-min); padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-12);
  background: var(--bg2); color: var(--text); font-family: inherit; font-size: 16px; }
.eja-input:focus { outline: none; border-color: var(--brand); }
.eja-field small { font-size: 11.5px; color: var(--muted2); }

/* popups */
.eja-scrim { background: var(--scrim); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.eja-pop { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-22); box-shadow: var(--shadow-pop); overflow: hidden; }
.eja-pop-hd { position: relative; padding: 20px 22px 12px; font-size: 16px; font-weight: 800; letter-spacing: .2px; }
.eja-pop-hd::after { content: ""; position: absolute; left: 22px; right: 22px; bottom: 0; height: 2px; background: linear-gradient(90deg, var(--gold), rgba(224,161,30,0)); }
.eja-pop[dir="rtl"] .eja-pop-hd::after { background: linear-gradient(270deg, var(--gold), rgba(224,161,30,0)); }
.eja-pop-bd { padding: 16px 22px 4px; font-size: 15.5px; line-height: 1.6; white-space: pre-wrap; }
.eja-pop-ft { display: flex; gap: var(--space-10); justify-content: flex-end; padding: 16px 22px 20px; }
.eja-pop-b { flex: 1 1 0; min-width: 0; min-height: var(--pop-button); padding: 13px 18px; border: 0; border-radius: var(--radius-14);
  font-family: inherit; font-size: 15px; font-weight: 700; line-height: 1.3; cursor: pointer; }
.eja-pop-b:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.eja-pop-ok { background: var(--brand-fill); color: var(--on-brand); }
.eja-pop-no { background: transparent; color: var(--text); border: 1px solid var(--line); }
.eja-pop-danger { background: var(--bad-fill); color: var(--on-brand); }
@media (max-width: 380px) { .eja-pop-ft { flex-direction: column-reverse; } }

/* the floating bottom bar: Home · Sales · ＋ · Business · More */
.eja-bar { display: flex; align-items: center; gap: var(--space-2); max-width: var(--bar-max); margin: 0 auto; padding: var(--space-6);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-18); box-shadow: var(--shadow-bar); }
.eja-bar-side { flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: var(--space-2); }
.eja-bar-side > button { flex: 1 1 0; min-width: 0; min-height: var(--pop-button); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 0; background: transparent; color: var(--muted2); font-family: inherit; font-size: 11px; font-weight: 600; border-radius: var(--radius-12); padding: 4px 1px; white-space: nowrap; cursor: pointer; }
.eja-bar-side > button.on { color: var(--brand); font-weight: 800; }
.eja-bar-plus { flex: 0 0 64px; min-height: var(--pop-button); display: flex; align-items: center; justify-content: center; padding: 0; border: 0; background: transparent; cursor: pointer; }
.eja-bar-plus > span { width: var(--plus); height: var(--plus); margin-top: -30px; border-radius: 28px; background: var(--brand-fill); color: var(--on-brand);
  display: flex; align-items: center; justify-content: center; border: 4px solid var(--bg); box-shadow: var(--shadow-plus); box-sizing: border-box; }

/* a public page's head: the logo on its plate, one thin gold line */
.eja-head { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--card); }
.eja-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--gold); }
.eja-head img { width: 52px; height: 52px; object-fit: contain; border-radius: var(--radius-14); background: var(--logo-plate); }
.eja-head b { display: block; font-size: 16px; font-weight: 800; }
.eja-head span { font-size: 12px; color: var(--muted2); }

/* line icons: main stroke currentColor, the accent stroke gold */
.eja-ic { width: 22px; height: 22px; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.eja-ic .m { stroke: currentColor; }
.eja-ic .g { stroke: var(--gold); }

/* EJA's own list (common.js, as the sales system): opened by any <select>; small letters, groups, a tick, a search. */
.eja-pick { display: grid; gap: 10px; min-width: min(420px, 78vw); }
.eja-pick-list { display: grid; gap: 2px; max-height: min(60vh, 520px); overflow: auto; }
.eja-pick-group { margin: 8px 0 2px; padding: 0 10px; font-size: 11px; font-weight: 700; color: var(--muted); }
.eja-pick-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 10px 12px; border: 0;
  border-radius: var(--radius-12); background: none; color: var(--text); font: inherit; font-size: 14px; line-height: 1.35; text-align: start; cursor: pointer; }
.eja-pick-item:hover { background: var(--bg2); }
.eja-pick-item.on { background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); font-weight: 700; }
.eja-pick-item svg { flex: none; color: var(--brand); }
.eja-pick-item:disabled { opacity: .5; cursor: default; }
.eja-pick-none { margin: 8px 0; color: var(--muted); text-align: center; }
.eja-pick-group + .eja-pick-item, .eja-pick-item + .eja-pick-item { margin: 0; }

/* The person's letter, top right, and its menu (common.js meMount: My account; EJA Services AI Agent has the same) */
.eja-me { position: relative; }
.eja-avatar { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--brand-fill); color: var(--on-brand); font: inherit;
  font-weight: 800; font-size: 16px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.eja-me-menu { position: absolute; inset-inline-end: 0; top: 48px; z-index: 60; min-width: 230px; display: grid; gap: 2px; padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-16); box-shadow: var(--shadow-card); }
.eja-me-menu[hidden] { display: none; }
.eja-me-who { margin: 0 0 4px; padding: 8px 12px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.eja-me-item { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--radius-12);
  background: none; color: var(--text); font: inherit; font-size: 14px; text-align: start; cursor: pointer; }
.eja-me-item:hover { background: var(--bg2); }
.eja-me-item svg { color: var(--brand); flex: none; }
