/* =====================================================================
   رامه الذكية — لوحة التحكم
   Ramh Smart — admin control panel
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

:root { --side-w: 268px; --top-h: 64px; }

body.a-body, body.login-body {
  font-family: var(--font-ar);
  background: var(--bg-1);
  color: var(--text-2);
  font-size: var(--fs-sm);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
ul { list-style: none; }
table { border-collapse: collapse; width: 100%; }
h1, h2, h3, h4, h5 { color: var(--text-1); line-height: 1.3; font-weight: 650; }
:focus-visible { outline: 2px solid var(--cyan-400); outline-offset: 2px; border-radius: 4px; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand-700); }

/* ---------------------------------------------------------------
   تسجيل الدخول
   --------------------------------------------------------------- */
.login-body { display: grid; place-items: center; padding: 1.5rem; position: relative; overflow: hidden; }
.login-bg { position: fixed; inset: 0; z-index: 0; }
.login-bg span { position: absolute; border-radius: 50%; filter: blur(90px); }
.login-bg span:nth-child(1) { width: 520px; height: 520px; top: -180px; inset-inline-start: -120px;
  background: radial-gradient(circle, rgba(37,101,180,.5), transparent 70%); }
.login-bg span:nth-child(2) { width: 460px; height: 460px; bottom: -180px; inset-inline-end: -120px;
  background: radial-gradient(circle, rgba(23,179,209,.35), transparent 70%); }
.login-bg span:nth-child(3) { width: 700px; height: 320px; top: 45%; inset-inline-start: 30%;
  background: radial-gradient(circle, rgba(29,82,151,.28), transparent 70%); }
.login { position: relative; z-index: 1; width: 100%; max-width: 420px; }
.login__card {
  background: rgba(30,42,61,.92); border: 1px solid var(--line-2); border-radius: var(--r-xl);
  padding: 2.2rem; box-shadow: var(--sh-xl); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
.login__head { display: flex; align-items: center; gap: .9rem; margin-bottom: 1.8rem; }
.login__head b { display: block; color: var(--text-1); font-size: var(--fs-lg); }
.login__head span { color: var(--text-4); font-size: var(--fs-2xs); letter-spacing: .06em; }
.login__form { display: grid; gap: 1rem; }
.login__back { display: flex; align-items: center; justify-content: center; gap: .4rem;
  margin-top: 1.6rem; color: var(--text-4); font-size: var(--fs-xs); }
.login__back:hover { color: var(--brand-300); }
.login__back svg { width: 15px; height: 15px; }
[dir="rtl"] .login__back svg { transform: scaleX(-1); }

/* ---------------------------------------------------------------
   عناصر أساسية
   --------------------------------------------------------------- */
.a-field { display: grid; gap: .4rem; }
.a-field > span, .a-field > label { font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); }
.a-field input, .a-field select, .a-field textarea,
.a-input, .a-select, .a-textarea {
  width: 100%; padding: .7rem .85rem; border-radius: var(--r-sm);
  background: var(--bg-0); border: 1px solid var(--line-2); color: var(--text-1);
  font-size: var(--fs-sm); transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.a-textarea { min-height: 100px; resize: vertical; line-height: 1.8; font-family: inherit; }
.a-field input:focus, .a-field select:focus, .a-field textarea:focus,
.a-input:focus, .a-select:focus, .a-textarea:focus {
  outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(46,122,209,.16);
}
.a-select { appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238296B0' stroke-width='2.6'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left .8rem center; padding-inline-start: 2rem; }
.a-hint { font-size: var(--fs-3xs); color: var(--text-4); }
.a-req { color: var(--danger); }

.a-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .62rem 1.1rem; border-radius: var(--r-sm); font-size: var(--fs-xs); font-weight: 600;
  background: var(--surface-2); color: var(--text-1); border: 1px solid var(--line-2);
  transition: all var(--t-fast); white-space: nowrap;
}
.a-btn svg { width: 16px; height: 16px; flex: none; }
.a-btn:hover { border-color: var(--line-3); background: var(--surface-3); }
.a-btn--primary { background: var(--grad-brand); border-color: transparent; color: #fff;
  box-shadow: 0 6px 18px -8px rgba(46,122,209,.8); }
.a-btn--primary:hover { filter: brightness(1.08); }
.a-btn--ghost { background: transparent; }
.a-btn--danger { background: rgba(232,89,95,.14); border-color: rgba(232,89,95,.35); color: #F5A9AC; }
.a-btn--danger:hover { background: var(--danger); color: #fff; border-color: transparent; }
.a-btn--ok { background: rgba(41,192,138,.14); border-color: rgba(41,192,138,.35); color: #8FE3C4; }
.a-btn--sm { padding: .4rem .75rem; font-size: var(--fs-3xs); }
.a-btn--lg { padding: .8rem 1.5rem; font-size: var(--fs-sm); }
.a-btn--block { width: 100%; }
.a-btn--icon { padding: .45rem; width: 32px; height: 32px; }
.a-btn[disabled] { opacity: .5; pointer-events: none; }

.a-chip {
  display: inline-flex; align-items: center; gap: .3rem; padding: .22rem .6rem;
  border-radius: var(--r-pill); font-size: var(--fs-3xs); font-weight: 600;
  background: rgba(126,165,214,.1); border: 1px solid var(--line-1); color: var(--text-3);
}
.a-chip--new { background: rgba(46,122,209,.18); color: #7FB6F0; border-color: rgba(46,122,209,.35); }
.a-chip--in_review { background: rgba(233,169,60,.15); color: #F0C578; border-color: rgba(233,169,60,.32); }
.a-chip--contacted { background: rgba(23,179,209,.15); color: #7CE3F5; border-color: rgba(23,179,209,.32); }
.a-chip--quoted { background: rgba(148,110,220,.16); color: #C1A6F0; border-color: rgba(148,110,220,.34); }
.a-chip--won { background: rgba(41,192,138,.16); color: #8FE3C4; border-color: rgba(41,192,138,.34); }
.a-chip--lost, .a-chip--closed { background: rgba(126,165,214,.08); color: var(--text-4); }
.a-chip--urgent { background: rgba(232,89,95,.18); color: #F5A9AC; border-color: rgba(232,89,95,.36); }
.a-chip--high { background: rgba(233,169,60,.16); color: #F0C578; }
.a-chip--ok { background: rgba(41,192,138,.16); color: #8FE3C4; }
.a-chip--off { background: rgba(126,165,214,.07); color: var(--text-4); }

.a-alert { display: flex; gap: .6rem; padding: .8rem 1rem; border-radius: var(--r-sm); font-size: var(--fs-xs); margin-bottom: 1rem; }
.a-alert svg { width: 17px; height: 17px; flex: none; margin-top: .1rem; }
.a-alert--err { background: var(--danger-dim); border: 1px solid rgba(232,89,95,.3); color: #F5A9AC; }
.a-alert--ok { background: var(--ok-dim); border: 1px solid rgba(41,192,138,.3); color: #8FE3C4; }
.a-alert--warn { background: var(--warn-dim); border: 1px solid rgba(233,169,60,.3); color: #F0C578; }
.a-alert--info { background: var(--info-dim); border: 1px solid rgba(78,151,228,.3); color: #A8CBF5; }

.a-card { background: var(--surface-1); border: 1px solid var(--line-1); border-radius: var(--r-lg); }
.a-card__head { padding: 1rem 1.2rem; border-bottom: 1px solid var(--line-1);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.a-card__head h3 { font-size: var(--fs-md); }
.a-card__body { padding: 1.2rem; }

/* ---------------------------------------------------------------
   الهيكل
   --------------------------------------------------------------- */
.a-shell { display: flex; min-height: 100vh; }

.a-side {
  width: var(--side-w); flex: none; background: var(--bg-0);
  border-inline-end: 1px solid var(--line-1);
  display: flex; flex-direction: column; position: fixed; inset-block: 0; inset-inline-start: 0;
  z-index: 60; transition: transform var(--t-base) var(--ease);
}
.a-side__head { height: var(--top-h); display: flex; align-items: center; justify-content: space-between;
  padding-inline: 1.1rem; border-bottom: 1px solid var(--line-1); flex: none; }
.a-brand { display: flex; align-items: center; gap: .6rem; }
.a-brand b { display: block; color: var(--text-1); font-size: var(--fs-sm); }
.a-brand small { display: block; color: var(--text-4); font-size: var(--fs-3xs); }
.a-side__close { display: none; color: var(--text-3); }
.a-side__close svg { width: 18px; height: 18px; }

.a-nav { flex: 1; overflow-y: auto; padding: 1rem .7rem; }
.a-nav__group { margin-bottom: 1.3rem; }
.a-nav__title { font-size: var(--fs-3xs); color: var(--text-4); letter-spacing: .12em;
  text-transform: uppercase; padding: 0 .7rem; margin-bottom: .5rem; }
.a-nav__link {
  display: flex; align-items: center; gap: .65rem; width: 100%;
  padding: .58rem .7rem; border-radius: var(--r-sm); color: var(--text-3);
  font-size: var(--fs-xs); font-weight: 550; transition: all var(--t-fast); text-align: start;
}
.a-nav__link:hover { background: rgba(126,165,214,.07); color: var(--text-1); }
.a-nav__link.is-active { background: var(--grad-brand-soft); color: var(--brand-300);
  box-shadow: inset 0 0 0 1px rgba(46,122,209,.25); }
.a-nav__ico { display: grid; place-items: center; flex: none; }
.a-nav__link svg { width: 17px; height: 17px; }
.a-nav__label { flex: 1; }
.a-nav__badge { background: var(--danger); color: #fff; font-size: var(--fs-3xs); font-weight: 700;
  min-width: 20px; height: 20px; border-radius: 99px; display: grid; place-items: center; padding: 0 .35rem; }
.a-side__foot { padding: .7rem; border-top: 1px solid var(--line-1); display: grid; gap: .2rem; }

.a-main { flex: 1; min-width: 0; margin-inline-start: var(--side-w); display: flex; flex-direction: column; }

.a-top {
  height: var(--top-h); flex: none; position: sticky; top: 0; z-index: 40;
  background: rgba(17,26,43,.9); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line-1);
  display: flex; align-items: center; gap: 1rem; padding-inline: 1.3rem;
}
.a-top__title { font-size: var(--fs-md); font-weight: 650; color: var(--text-1); }
.a-top__actions { margin-inline-start: auto; display: flex; align-items: center; gap: .7rem; }
.a-burger { display: none; color: var(--text-2); }
.a-burger svg { width: 20px; height: 20px; }

.a-search { position: relative; }
.a-search input { width: 230px; padding: .5rem 2.2rem .5rem .8rem; border-radius: var(--r-pill);
  background: var(--surface-1); border: 1px solid var(--line-2); color: var(--text-1); font-size: var(--fs-xs); }
.a-search input:focus { outline: none; border-color: var(--brand-500); width: 300px; }
.a-search svg { position: absolute; inset-inline-end: .75rem; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--text-4); pointer-events: none; }

.a-user { display: flex; align-items: center; gap: .55rem; padding-inline-start: .7rem;
  border-inline-start: 1px solid var(--line-1); }
.a-avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--grad-brand); color: #fff; font-weight: 700; font-size: var(--fs-sm); }
.a-user__txt b { display: block; color: var(--text-1); font-size: var(--fs-xs); }
.a-user__txt small { display: block; color: var(--text-4); font-size: var(--fs-3xs); }

.a-content { flex: 1; padding: 1.4rem; }
.a-loading { display: flex; align-items: center; gap: .6rem; color: var(--text-4); padding: 3rem; justify-content: center; }
.a-spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2);
  border-top-color: var(--brand-500); animation: aspin .7s linear infinite; }
@keyframes aspin { to { transform: rotate(360deg); } }

.a-page__head { display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.3rem; }
.a-page__head h2 { font-size: var(--fs-xl); }
.a-page__head p { color: var(--text-4); font-size: var(--fs-xs); margin-top: .2rem; }
.a-page__actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------------------------------------------------------------
   بطاقات الإحصاء
   --------------------------------------------------------------- */
.a-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .9rem; margin-bottom: 1.3rem; }
.a-stat { background: var(--surface-1); border: 1px solid var(--line-1); border-radius: var(--r-lg);
  padding: 1.1rem 1.2rem; position: relative; overflow: hidden; transition: all var(--t-base); }
.a-stat:hover { border-color: var(--line-3); transform: translateY(-2px); }
.a-stat__ico { width: 36px; height: 36px; border-radius: var(--r-sm); display: grid; place-items: center;
  background: var(--grad-brand-soft); color: var(--brand-300); border: 1px solid var(--line-1); margin-bottom: .7rem; }
.a-stat__ico svg { width: 18px; height: 18px; }
.a-stat b { display: block; font-size: 1.9rem; font-weight: 750; color: var(--text-1); line-height: 1.1;
  font-variant-numeric: tabular-nums; }
.a-stat span { display: block; font-size: var(--fs-2xs); color: var(--text-4); margin-top: .2rem; }
.a-stat--accent { background: linear-gradient(140deg, rgba(46,122,209,.16), var(--surface-1) 65%); border-color: rgba(46,122,209,.3); }
.a-stat--danger .a-stat__ico { background: var(--danger-dim); color: var(--danger); }
.a-stat--ok .a-stat__ico { background: var(--ok-dim); color: var(--ok); }
.a-stat--warn .a-stat__ico { background: var(--warn-dim); color: var(--warn); }

/* رسم بياني بسيط */
.a-chart { display: flex; align-items: flex-end; gap: 3px; height: 130px; padding-top: .5rem; }
.a-chart__bar { flex: 1; background: linear-gradient(180deg, var(--brand-500), rgba(46,122,209,.15));
  border-radius: 3px 3px 0 0; min-height: 3px; position: relative; transition: background var(--t-fast); }
.a-chart__bar:hover { background: linear-gradient(180deg, var(--cyan-400), rgba(23,179,209,.2)); }
.a-chart__bar span { position: absolute; bottom: 100%; inset-inline-start: 50%; transform: translateX(-50%);
  background: var(--surface-3); color: var(--text-1); font-size: var(--fs-3xs); padding: .15rem .4rem;
  border-radius: 4px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity var(--t-fast); }
.a-chart__bar:hover span { opacity: 1; }

.a-bars { display: grid; gap: .6rem; }
.a-bar__row { display: grid; grid-template-columns: 1fr auto; gap: .5rem; font-size: var(--fs-xs); }
.a-bar__track { grid-column: 1/-1; height: 6px; border-radius: 99px; background: var(--bg-0); overflow: hidden; }
.a-bar__fill { height: 100%; border-radius: 99px; background: var(--grad-brand); }

/* ---------------------------------------------------------------
   الجداول
   --------------------------------------------------------------- */
.a-toolbar { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.a-toolbar .a-input, .a-toolbar .a-select { width: auto; min-width: 150px; }
.a-tabs { display: flex; gap: .3rem; flex-wrap: wrap; margin-bottom: 1rem;
  border-bottom: 1px solid var(--line-1); padding-bottom: .6rem; }
.a-tab { padding: .42rem .85rem; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 600;
  color: var(--text-3); border: 1px solid transparent; transition: all var(--t-fast); }
.a-tab:hover { background: rgba(126,165,214,.07); color: var(--text-1); }
.a-tab.is-active { background: var(--grad-brand); color: #fff; }
.a-tab .n { opacity: .7; font-size: .85em; margin-inline-start: .25rem; font-family: var(--font-mono); }

.a-tablewrap { background: var(--surface-1); border: 1px solid var(--line-1); border-radius: var(--r-lg); overflow: hidden; }
.a-table { font-size: var(--fs-xs); }
.a-table th { background: var(--bg-0); color: var(--text-3); font-weight: 600; text-align: start;
  padding: .75rem .9rem; border-bottom: 1px solid var(--line-2); white-space: nowrap; font-size: var(--fs-3xs);
  letter-spacing: .03em; position: sticky; top: 0; z-index: 2; }
.a-table th.sortable { cursor: pointer; user-select: none; }
.a-table th.sortable:hover { color: var(--text-1); }
.a-table td { padding: .7rem .9rem; border-bottom: 1px solid var(--line-1); color: var(--text-2); vertical-align: middle; }
.a-table tbody tr { transition: background var(--t-fast); }
.a-table tbody tr:hover { background: rgba(126,165,214,.045); }
.a-table tbody tr.is-selected { background: rgba(46,122,209,.1); }
.a-table tbody tr:last-child td { border-bottom: 0; }
.a-table .col-check { width: 40px; }
.a-table .col-actions { width: 1%; white-space: nowrap; }
.a-table .col-img { width: 62px; }
.a-table__img { width: 46px; height: 34px; border-radius: 5px; object-fit: contain;
  background: var(--bg-0); border: 1px solid var(--line-1); padding: 2px; }
.a-table__ph { width: 46px; height: 34px; border-radius: 5px; background: var(--bg-0);
  border: 1px solid var(--line-1); display: grid; place-items: center; color: var(--text-4); }
.a-table__ph svg { width: 16px; height: 16px; }
.a-table strong { color: var(--text-1); font-weight: 600; }
.a-table .mono { font-family: var(--font-mono); font-size: var(--fs-3xs); color: var(--cyan-400); }
.a-rowbtns { display: flex; gap: .25rem; }

.a-check { width: 16px; height: 16px; accent-color: var(--brand-500); cursor: pointer; }

.a-switch { position: relative; display: inline-block; width: 38px; height: 21px; cursor: pointer; }
.a-switch input { opacity: 0; width: 0; height: 0; }
.a-switch i { position: absolute; inset: 0; background: var(--surface-3); border-radius: 99px;
  transition: background var(--t-fast); border: 1px solid var(--line-2); }
.a-switch i::before { content: ''; position: absolute; width: 15px; height: 15px; border-radius: 50%;
  background: var(--text-3); top: 2px; inset-inline-start: 2px; transition: all var(--t-fast); }
.a-switch input:checked + i { background: var(--brand-600); border-color: var(--brand-500); }
.a-switch input:checked + i::before { background: #fff; inset-inline-start: 19px; }

.a-empty { text-align: center; padding: 3rem 1rem; color: var(--text-4); }
.a-empty svg { width: 44px; height: 44px; margin: 0 auto .8rem; opacity: .35; }

.a-pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .8rem 1rem; border-top: 1px solid var(--line-1); flex-wrap: wrap; font-size: var(--fs-xs); color: var(--text-4); }
.a-pager__btns { display: flex; gap: .3rem; }
.a-pager__btn { min-width: 32px; height: 32px; border-radius: var(--r-sm); border: 1px solid var(--line-2);
  color: var(--text-2); font-size: var(--fs-xs); display: grid; place-items: center; padding: 0 .5rem; }
.a-pager__btn:hover { border-color: var(--brand-500); color: var(--text-1); }
.a-pager__btn.is-active { background: var(--grad-brand); border-color: transparent; color: #fff; }
.a-pager__btn[disabled] { opacity: .35; pointer-events: none; }

.a-bulkbar { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  padding: .7rem 1rem; background: rgba(46,122,209,.12); border: 1px solid rgba(46,122,209,.3);
  border-radius: var(--r-sm); margin-bottom: .8rem; font-size: var(--fs-xs); color: var(--text-1); }

/* ---------------------------------------------------------------
   النوافذ والدُرج
   --------------------------------------------------------------- */
.a-overlay { position: fixed; inset: 0; background: rgba(8,13,24,.72); z-index: 70;
  opacity: 0; visibility: hidden; transition: all var(--t-base); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.a-overlay.is-open { opacity: 1; visibility: visible; }

.a-drawer { position: fixed; inset-block: 0; inset-inline-end: 0; width: min(680px, 100vw);
  background: var(--bg-1); border-inline-start: 1px solid var(--line-2); z-index: 80;
  transform: translateX(100%); transition: transform var(--t-base) var(--ease-out);
  display: flex; flex-direction: column; box-shadow: var(--sh-xl); }
[dir="rtl"] .a-drawer { transform: translateX(-100%); }
.a-drawer.is-open { transform: none !important; }
.a-drawer__inner { flex: 1; overflow-y: auto; }
.a-drawer__head { position: sticky; top: 0; z-index: 3; background: var(--bg-0);
  border-bottom: 1px solid var(--line-1); padding: 1rem 1.3rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.a-drawer__head h3 { font-size: var(--fs-md); }
.a-drawer__head small { color: var(--text-4); font-size: var(--fs-3xs); display: block; }
.a-drawer__body { padding: 1.3rem; }
.a-drawer__foot { position: sticky; bottom: 0; background: var(--bg-0); border-top: 1px solid var(--line-1);
  padding: .85rem 1.3rem; display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; }

.a-modal { position: fixed; inset: 0; z-index: 90; display: none; align-items: center; justify-content: center; padding: 1.5rem; }
.a-modal.is-open { display: flex; }
.a-modal__box { background: var(--surface-1); border: 1px solid var(--line-2); border-radius: var(--r-lg);
  width: min(560px, 100%); max-height: 88vh; overflow-y: auto; box-shadow: var(--sh-xl); }
.a-modal__head { padding: 1.1rem 1.3rem; border-bottom: 1px solid var(--line-1); }
.a-modal__head h3 { font-size: var(--fs-md); }
.a-modal__body { padding: 1.3rem; display: grid; gap: 1rem; }
.a-modal__foot { padding: .9rem 1.3rem; border-top: 1px solid var(--line-1);
  display: flex; gap: .6rem; justify-content: flex-end; }

/* نموذج التحرير */
.a-formgroups { display: flex; gap: .3rem; flex-wrap: wrap; margin-bottom: 1.2rem;
  border-bottom: 1px solid var(--line-1); padding-bottom: .6rem; }
.a-form { display: grid; gap: 1.05rem; }
.a-form__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.a-form__section { display: none; }
.a-form__section.is-active { display: grid; gap: 1.05rem; }

/* رفع الصور */
.a-upload { border: 1.5px dashed var(--line-2); border-radius: var(--r-md); padding: 1.1rem;
  text-align: center; color: var(--text-4); font-size: var(--fs-xs); cursor: pointer; transition: all var(--t-fast); }
.a-upload:hover, .a-upload.is-over { border-color: var(--brand-500); background: rgba(46,122,209,.07); color: var(--text-2); }
.a-upload svg { width: 26px; height: 26px; margin: 0 auto .4rem; opacity: .6; }
.a-imgprev { position: relative; display: inline-block; margin-top: .6rem; }
.a-imgprev img { max-height: 110px; border-radius: var(--r-sm); border: 1px solid var(--line-2);
  background: var(--bg-0); padding: 4px; }
.a-imgprev button { position: absolute; top: -8px; inset-inline-end: -8px; width: 24px; height: 24px;
  border-radius: 50%; background: var(--danger); color: #fff; display: grid; place-items: center; }
.a-imgprev button svg { width: 12px; height: 12px; }

.a-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .6rem; margin-top: .8rem; }
.a-gallery figure { position: relative; aspect-ratio: 4/3; border-radius: var(--r-sm); overflow: hidden;
  border: 1px solid var(--line-1); background: var(--bg-0); }
.a-gallery img { width: 100%; height: 100%; object-fit: cover; }
.a-gallery button { position: absolute; top: 4px; inset-inline-end: 4px; width: 22px; height: 22px;
  border-radius: 50%; background: rgba(232,89,95,.9); color: #fff; display: grid; place-items: center; }
.a-gallery button svg { width: 11px; height: 11px; }

/* قوائم القيم */
.a-listedit { display: grid; gap: .4rem; }
.a-listedit__row { display: flex; gap: .4rem; }
.a-listedit__row input { flex: 1; }
.a-kv__row { display: grid; grid-template-columns: 1fr 1fr auto; gap: .4rem; }

/* منتقي الأيقونات */
.a-iconpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: .35rem;
  max-height: 210px; overflow-y: auto; padding: .5rem; background: var(--bg-0);
  border: 1px solid var(--line-2); border-radius: var(--r-sm); }
.a-iconpick button { aspect-ratio: 1; border-radius: var(--r-xs); display: grid; place-items: center;
  color: var(--text-3); border: 1px solid transparent; transition: all var(--t-fast); }
.a-iconpick button:hover { background: var(--surface-2); color: var(--text-1); }
.a-iconpick button.is-active { background: var(--grad-brand); color: #fff; }
.a-iconpick svg { width: 19px; height: 19px; }

/* الخط الزمني للطلب */
.a-timeline { display: grid; gap: 0; position: relative; padding-inline-start: 1.6rem; }
.a-timeline::before { content: ''; position: absolute; inset-inline-start: 5px; top: 6px; bottom: 6px;
  width: 1px; background: var(--line-2); }
.a-timeline__item { position: relative; padding-bottom: 1.1rem; }
.a-timeline__item::before { content: ''; position: absolute; inset-inline-start: -1.6rem; top: .35rem;
  width: 11px; height: 11px; border-radius: 50%; background: var(--bg-1); border: 2px solid var(--brand-500); }
.a-timeline__item b { color: var(--text-1); font-size: var(--fs-xs); }
.a-timeline__item small { display: block; color: var(--text-4); font-size: var(--fs-3xs); }
.a-timeline__item p { color: var(--text-3); font-size: var(--fs-xs); margin-top: .25rem; white-space: pre-wrap; }

.a-kvlist { display: grid; gap: 0; font-size: var(--fs-xs); }
.a-kvlist > div { display: grid; grid-template-columns: 38% 1fr; gap: .6rem;
  padding: .55rem 0; border-bottom: 1px solid var(--line-1); }
.a-kvlist > div:last-child { border-bottom: 0; }
.a-kvlist dt { color: var(--text-4); }
.a-kvlist dd { color: var(--text-1); word-break: break-word; }

/* مكتبة الوسائط */
.a-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .8rem; }
.a-media figure { border: 1px solid var(--line-1); border-radius: var(--r-sm); overflow: hidden;
  background: var(--surface-1); position: relative; }
.a-media__img { aspect-ratio: 4/3; background: var(--bg-0); display: grid; place-items: center; }
.a-media__img img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.a-media figcaption { padding: .45rem .6rem; font-size: var(--fs-3xs); color: var(--text-4);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-media__acts { position: absolute; top: 5px; inset-inline-end: 5px; display: flex; gap: .25rem; opacity: 0; transition: opacity var(--t-fast); }
.a-media figure:hover .a-media__acts { opacity: 1; }
.a-media__acts button { width: 24px; height: 24px; border-radius: var(--r-xs);
  background: rgba(11,18,32,.85); border: 1px solid var(--line-2); color: var(--text-2); display: grid; place-items: center; }
.a-media__acts button:hover { color: #fff; border-color: var(--brand-500); }
.a-media__acts svg { width: 12px; height: 12px; }

/* التنبيهات */
.a-toasts { position: fixed; bottom: 20px; inset-inline-end: 20px; z-index: 100; display: grid; gap: .5rem; }
.a-toast { display: flex; align-items: center; gap: .6rem; padding: .8rem 1.1rem; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text-1);
  font-size: var(--fs-xs); box-shadow: var(--sh-lg); animation: toastin .3s var(--ease-out);
  max-width: 380px; }
.a-toast svg { width: 17px; height: 17px; flex: none; }
.a-toast--ok { border-color: rgba(41,192,138,.4); }
.a-toast--ok svg { color: var(--ok); }
.a-toast--err { border-color: rgba(232,89,95,.4); }
.a-toast--err svg { color: var(--danger); }
@keyframes toastin { from { opacity: 0; transform: translateY(14px); } }

/* شبكة عامة */
.a-grid { display: grid; gap: 1rem; }
.a-grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.a-grid--3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.a-mt { margin-top: 1rem; } .a-mt2 { margin-top: 1.6rem; }
.a-muted { color: var(--text-4); }
.a-mono { font-family: var(--font-mono); }
.a-right { margin-inline-start: auto; }
.a-nowrap { white-space: nowrap; }

/* ---------------------------------------------------------------
   الاستجابة
   --------------------------------------------------------------- */
@media (max-width: 1000px) {
  .a-side { transform: translateX(-100%); }
  [dir="rtl"] .a-side { transform: translateX(100%); }
  .a-side.is-open { transform: none !important; }
  .a-side__close { display: block; }
  .a-main { margin-inline-start: 0; }
  .a-burger { display: block; }
  .a-search { display: none; }
  .a-user__txt { display: none; }
}
@media (max-width: 620px) {
  .a-content { padding: .9rem; }
  .a-stats { grid-template-columns: repeat(2, 1fr); }
  .a-table { font-size: var(--fs-3xs); }
  .a-tablewrap { overflow-x: auto; }
  .a-table { min-width: 640px; }
  .a-drawer { width: 100vw; }
}

/* ---------------------------------------------------------------
   الثيم والألوان
   --------------------------------------------------------------- */
.a-presets { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .7rem; }
.a-preset {
  text-align: start; padding: .95rem 1rem; border-radius: var(--r-md);
  background: var(--bg-0); border: 1px solid var(--line-2); transition: all var(--t-fast);
}
.a-preset:hover { border-color: var(--brand-500); transform: translateY(-2px); }
.a-preset.is-active { border-color: var(--brand-500); box-shadow: 0 0 0 1px var(--brand-500) inset, var(--glow-brand); }
.a-preset b { display: block; color: var(--text-1); font-size: var(--fs-xs); margin-bottom: .2rem; }
.a-preset small { display: block; color: var(--text-4); font-size: var(--fs-3xs); line-height: 1.6; }
.a-preset__dots { display: flex; gap: .3rem; margin-bottom: .6rem; }
.a-preset__dots i { width: 22px; height: 22px; border-radius: 6px; border: 1px solid rgba(255,255,255,.14); }

.a-colorrow { display: flex; align-items: center; gap: .8rem; }
.a-colorrow__txt { flex: 1; min-width: 0; }
.a-colorrow__txt b { display: block; color: var(--text-1); font-size: var(--fs-xs); }
.a-colorrow__txt small { display: block; color: var(--text-4); font-size: var(--fs-3xs); }
.a-colorpick {
  width: 46px; height: 40px; padding: 3px; border-radius: var(--r-sm); flex: none;
  background: var(--bg-0); border: 1px solid var(--line-2); cursor: pointer;
}
.a-colorpick::-webkit-color-swatch-wrapper { padding: 0; }
.a-colorpick::-webkit-color-swatch { border: 0; border-radius: 5px; }
.a-colorhex { width: 104px; flex: none; text-transform: uppercase; font-family: var(--font-mono); font-size: var(--fs-xs); }

.a-range { width: 100%; height: 5px; border-radius: 99px; appearance: none; background: var(--surface-3); cursor: pointer; }
.a-range::-webkit-slider-thumb {
  appearance: none; width: 17px; height: 17px; border-radius: 50%;
  background: var(--grad-brand); border: 2px solid var(--bg-0); box-shadow: 0 2px 8px rgba(0,0,0,.5);
}

/* معاينة الثيم */
.a-preview {
  --p-bg:#111A2B; --p-surface:#1B2739; --p-brand:#2E7AD1; --p-accent:#38D0EA;
  --p-text:#EAF1FA; --p-radius:12px; --p-line:rgba(255,255,255,.15); --p-glow:1;
  background: var(--p-bg); border: 1px solid var(--p-line); border-radius: var(--r-md);
  overflow: hidden; direction: rtl;
}
.a-preview__nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: .6rem .8rem; border-bottom: 1px solid var(--p-line);
}
.a-preview__logo { width: 42px; height: 12px; border-radius: 3px; background: var(--p-brand); }
.a-preview__links { display: flex; gap: .35rem; }
.a-preview__links i { width: 24px; height: 6px; border-radius: 3px; background: var(--p-text); opacity: .3; }
.a-preview__hero { padding: 1rem .9rem 1.1rem; }
.a-preview__eyebrow {
  display: inline-block; font-size: 9px; padding: .2rem .5rem; border-radius: 99px;
  color: var(--p-accent); background: color-mix(in srgb, var(--p-accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--p-accent) 28%, transparent); margin-bottom: .5rem;
}
.a-preview__hero h4 { color: var(--p-text); font-size: var(--fs-md); margin-bottom: .3rem; }
.a-preview__hero p { color: var(--p-text); opacity: .62; font-size: 10.5px; line-height: 1.7; margin-bottom: .7rem; }
.a-preview__btns { display: flex; gap: .4rem; }
.a-preview__btns b, .a-preview__btns u {
  font-size: 10px; padding: .38rem .8rem; border-radius: 99px; text-decoration: none;
}
.a-preview__btns b {
  color: #fff; background: linear-gradient(135deg, var(--p-brand), var(--p-accent));
  box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--p-brand) calc(80% * var(--p-glow)), transparent);
}
.a-preview__btns u { color: var(--p-text); border: 1px solid var(--p-line); }
.a-preview__cards { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; padding: 0 .9rem .9rem; }
.a-preview__cards > div {
  background: var(--p-surface); border: 1px solid var(--p-line);
  border-radius: var(--p-radius); padding: .7rem;
}
.a-preview__cards span {
  display: block; width: 24px; height: 24px; border-radius: calc(var(--p-radius) * .6); margin-bottom: .45rem;
  background: color-mix(in srgb, var(--p-brand) 22%, transparent);
  border: 1px solid color-mix(in srgb, var(--p-brand) 34%, transparent);
}
.a-preview__cards b { display: block; color: var(--p-text); font-size: 10.5px; margin-bottom: .2rem; }
.a-preview__cards small { display: block; color: var(--p-text); opacity: .55; font-size: 9.5px; line-height: 1.6; }

/* الصلاحيات */
.a-perms { display: grid; gap: .7rem; max-height: 340px; overflow-y: auto; padding-inline-end: .3rem; }
.a-permgroup { background: var(--bg-0); border: 1px solid var(--line-1); border-radius: var(--r-sm); padding: .7rem .8rem; }
.a-permgroup__head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .5rem; }
.a-permgroup__head b { color: var(--brand-300); font-size: var(--fs-xs); }
.a-permgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .35rem; }
.a-permitem { display: flex; align-items: center; gap: .45rem; font-size: var(--fs-xs); color: var(--text-2); cursor: pointer; padding: .2rem 0; }
.a-permitem:hover { color: var(--text-1); }

/* مهمة متأخرة */
.a-card.is-overdue { border-color: rgba(232,89,95,.4); }

/* ===============================================================
   واجهة الجوال للفنيين والموظفين — شريط سفلي وتحديث بلمسة
   =============================================================== */
.a-tabbar { display: none; }

@media (max-width: 1000px) {
  .a-tabbar {
    position: fixed; inset-inline: 0; bottom: 0; z-index: 70;
    display: grid; grid-template-columns: repeat(5, 1fr);
    background: rgba(var(--rgb-bg-0), .96);
    -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--line-2);
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -8px 30px -12px rgba(0,0,0,.75);
  }
  .a-tabbar__item {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .18rem;
    padding: .55rem .2rem .5rem; color: var(--text-4);
    font-size: 10.5px; font-weight: 600; text-align: center;
    transition: color var(--t-fast); position: relative; min-height: 58px;
  }
  .a-tabbar__item svg { width: 21px; height: 21px; }
  .a-tabbar__ico { position: relative; display: block; }
  .a-tabbar__item.is-active { color: var(--brand-300); }
  .a-tabbar__item.is-active::before {
    content: ''; position: absolute; top: 0; inset-inline: 26%;
    height: 3px; border-radius: 0 0 4px 4px; background: var(--grad-brand);
  }
  .a-tabbar__item:active { color: var(--text-1); }
  .a-tabbar__dot {
    position: absolute; top: -3px; inset-inline-end: -5px;
    width: 9px; height: 9px; border-radius: 50%; background: var(--danger);
    border: 2px solid var(--bg-0);
  }

  .a-content { padding-bottom: 84px; }
  .a-side { padding-bottom: 70px; }
  .a-top { position: sticky; }

  /* النوافذ تصبح ورقة سفلية على الجوال */
  .a-modal { align-items: flex-end; padding: 0; }
  .a-modal__box {
    width: 100%; max-width: none; max-height: 92vh;
    border-radius: var(--r-xl) var(--r-xl) 0 0; border-bottom: 0;
    animation: sheetUp .28s var(--ease-out);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  @keyframes sheetUp { from { transform: translateY(100%); } }
  .a-modal__box::before {
    content: ''; display: block; width: 42px; height: 4px; border-radius: 99px;
    background: var(--line-3); margin: .6rem auto -.2rem;
  }
  .a-modal__foot { position: sticky; bottom: 0; background: var(--surface-1); }
  .a-modal__foot .a-btn { flex: 1; justify-content: center; padding-block: .8rem; }

  .a-drawer { width: 100vw; }

  /* لمسات أكبر */
  .a-btn { padding: .7rem 1.15rem; }
  .a-btn--sm { padding: .5rem .9rem; font-size: var(--fs-2xs); }
  .a-field input, .a-field select, .a-field textarea,
  .a-input, .a-select, .a-textarea { padding: .85rem 1rem; font-size: 16px; }
  .a-check { width: 20px; height: 20px; }
}

/* ---- بطاقة مهمة بنمط التطبيق ---- */
.t-card {
  background: var(--surface-1); border: 1px solid var(--line-1);
  border-radius: var(--r-lg); overflow: hidden; transition: border-color var(--t-fast);
}
.t-card.is-overdue { border-color: rgba(232,89,95,.45); }
.t-card.is-done { opacity: .62; }
.t-card__top { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; padding: .8rem .95rem 0; }
.t-card__body { padding: .7rem .95rem .5rem; }
.t-card__body h4 { font-size: var(--fs-md); line-height: 1.5; }
.t-card__meta { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin-top: .45rem; font-size: var(--fs-2xs); color: var(--text-4); }
.t-card__meta span { display: inline-flex; align-items: center; gap: .3rem; }
.t-card__meta svg { width: 13px; height: 13px; }
.t-card__desc { color: var(--text-3); font-size: var(--fs-xs); line-height: 1.8; margin-top: .5rem; }

.t-prog { padding: 0 .95rem .6rem; }
.t-prog__row { display: flex; justify-content: space-between; font-size: var(--fs-3xs); color: var(--text-4); margin-bottom: .3rem; }
.t-prog__track { height: 7px; border-radius: 99px; background: var(--bg-0); overflow: hidden; }
.t-prog__fill { height: 100%; border-radius: 99px; background: var(--grad-brand); transition: width .4s var(--ease-out); }

.t-card__acts {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--line-1); border-top: 1px solid var(--line-1);
}
.t-card__acts button, .t-card__acts a {
  display: flex; align-items: center; justify-content: center; gap: .35rem;
  padding: .75rem .4rem; background: var(--surface-1); color: var(--text-2);
  font-size: var(--fs-2xs); font-weight: 600; transition: all var(--t-fast);
}
.t-card__acts button svg { width: 16px; height: 16px; }
.t-card__acts button:hover, .t-card__acts button:active { background: var(--surface-3); color: var(--text-1); }
.t-card__acts .is-primary { color: var(--brand-300); }
.t-card__acts .is-ok { color: var(--ok); }

/* أزرار نسبة سريعة */
.t-quick { display: grid; grid-template-columns: repeat(5, 1fr); gap: .4rem; }
.t-quick button {
  padding: .75rem .3rem; border-radius: var(--r-sm); border: 1px solid var(--line-2);
  background: var(--bg-0); color: var(--text-2); font-weight: 700; font-size: var(--fs-sm);
  font-family: var(--font-mono); transition: all var(--t-fast);
}
.t-quick button:hover, .t-quick button.is-on {
  border-color: var(--brand-500); background: rgba(var(--rgb-brand), .16); color: var(--text-1);
}

.t-status { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: .4rem; }
.t-status button {
  padding: .7rem .4rem; border-radius: var(--r-sm); border: 1px solid var(--line-2);
  background: var(--bg-0); color: var(--text-3); font-size: var(--fs-2xs); font-weight: 600;
  transition: all var(--t-fast);
}
.t-status button.is-on { border-color: var(--brand-500); background: rgba(var(--rgb-brand), .18); color: var(--text-1); }

/* رأس مختصر لموظف الميدان */
.t-hero {
  background: linear-gradient(150deg, rgba(var(--rgb-brand), .18), var(--surface-1) 65%);
  border: 1px solid var(--line-2); border-radius: var(--r-lg);
  padding: 1.1rem 1.2rem; margin-bottom: 1rem;
}
.t-hero h2 { font-size: var(--fs-lg); }
.t-hero p { color: var(--text-3); font-size: var(--fs-xs); margin-top: .2rem; }
.t-hero__row { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-top: .9rem; }
.t-hero__cell { text-align: center; padding: .55rem .3rem; border-radius: var(--r-sm); background: rgba(var(--rgb-bg-0), .5); }
.t-hero__cell b { display: block; font-size: var(--fs-lg); color: var(--text-1); font-variant-numeric: tabular-nums; }
.t-hero__cell span { display: block; font-size: 10px; color: var(--text-4); margin-top: .1rem; }
.t-hero__cell.is-danger b { color: var(--danger); }
.t-hero__cell.is-ok b { color: var(--ok); }

/* معاينة صور المستندات */
.doc-prev { margin-top: .5rem; position: relative; display: inline-block; }
.doc-prev img {
  max-height: 110px; max-width: 220px; border-radius: var(--r-sm);
  background: #fff; padding: 8px; border: 1px solid var(--line-2);
}
.doc-prev button {
  position: absolute; top: -8px; inset-inline-end: -8px; width: 24px; height: 24px;
  border-radius: 50%; background: var(--danger); color: #fff; display: grid; place-items: center;
}
.doc-prev button svg { width: 12px; height: 12px; }

/* =====================================================================
   التحليلات — كلمات البحث واحتمالية العميل
   ===================================================================== */
.an-row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.an-row--end { align-items: flex-end; }
.an-link { color: var(--brand-300); }
.an-link:hover { text-decoration: underline; }

.an-range, .an-filter { display: flex; gap: .3rem; flex-wrap: wrap; }
.an-filter { margin-top: 1rem; }
.an-range__b {
  font: inherit; font-size: var(--fs-3xs); font-weight: 600; cursor: pointer;
  color: var(--text-3); background: var(--surface-2);
  border: 1px solid var(--line-2); border-radius: var(--r-pill);
  padding: .35rem .8rem; transition: all .16s;
}
.an-range__b:hover { color: var(--text-1); border-color: var(--brand-600); }
.an-range__b.is-on { color: var(--text-on-brand); background: var(--brand-600); border-color: var(--brand-600); }

.an-trend { font-size: var(--fs-3xs); font-weight: 700; margin-inline-start: .35rem; }
.an-trend.is-up { color: var(--ok); }
.an-trend.is-down { color: var(--danger); }

.an-chart { width: 100%; height: 180px; display: block; overflow: visible; }

/* شريط الاحتمالية */
.an-prob { display: flex; align-items: center; gap: .5rem; }
.an-prob__track { flex: 1; height: 6px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; min-width: 60px; }
.an-prob__fill { display: block; height: 100%; border-radius: inherit; transition: width .5s cubic-bezier(.4,0,.2,1); }
.an-prob__fill.is-ok     { background: linear-gradient(90deg, var(--ok), #6ee7b7); }
.an-prob__fill.is-urgent { background: linear-gradient(90deg, var(--warn), #fbbf24); }
.an-prob__fill.is-accent { background: linear-gradient(90deg, var(--brand-600), var(--brand-400)); }
.an-prob__fill.is-muted  { background: var(--line-3); }
.an-prob > b { font-size: var(--fs-3xs); color: var(--text-2); font-variant-numeric: tabular-nums; min-width: 34px; text-align: end; }

/* نيّة الكلمة */
.an-intent {
  font-size: var(--fs-3xs); font-weight: 700; padding: .18rem .5rem;
  border-radius: var(--r-xs); border: 1px solid currentColor; white-space: nowrap;
}
.an-intent.is-transactional { color: #6ee7b7; }
.an-intent.is-commercial    { color: #93c5fd; }
.an-intent.is-local         { color: #c4b5fd; }
.an-intent.is-brand         { color: #fbbf24; }
.an-intent.is-informational { color: var(--text-4); }
.an-intent.is-irrelevant    { color: #f5a9ac; }

/* مسار التحوّل */
.an-funnel { display: grid; gap: 1rem; }
.an-funnel__top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .35rem; }
.an-funnel__top b { font-size: var(--fs-xs); color: var(--text-1); }
.an-funnel__top span { font-size: var(--fs-sm); font-weight: 700; color: var(--text-1); font-variant-numeric: tabular-nums; }
.an-funnel__track { height: 10px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.an-funnel__track > i { display: block; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-700), var(--brand-400)); transition: width .6s; }
.an-funnel__foot { display: flex; justify-content: space-between; margin-top: .3rem; font-size: var(--fs-3xs); color: var(--text-4); }
.an-funnel__foot .is-drop { color: var(--warn); }

/* تصنيف الزوّار */
.an-bands { display: grid; gap: .6rem; }
.an-band {
  display: flex; gap: .9rem; align-items: center; padding: .75rem .9rem;
  border: 1px solid var(--line-1); border-radius: var(--r-md); background: var(--surface-2);
  border-inline-start: 3px solid var(--line-3);
}
.an-band.is-ok     { border-inline-start-color: var(--ok); }
.an-band.is-urgent { border-inline-start-color: var(--warn); }
.an-band.is-accent { border-inline-start-color: var(--brand-500); }
.an-band__n { text-align: center; min-width: 54px; }
.an-band__n b { display: block; font-size: 1.3rem; color: var(--text-1); font-variant-numeric: tabular-nums; }
.an-band__n span { font-size: var(--fs-3xs); color: var(--text-4); }
.an-band__t { flex: 1; }
.an-band__t b { display: block; font-size: var(--fs-xs); color: var(--text-1); margin-bottom: .15rem; }
.an-band__t b small { color: var(--text-4); font-weight: 500; }
.an-band__t span { font-size: var(--fs-3xs); color: var(--text-3); line-height: 1.6; }

/* بطاقات العملاء المحتملين */
.an-leads { display: grid; gap: .7rem; }
.an-lead {
  display: flex; gap: 1rem; align-items: flex-start;
  padding: 1rem 1.1rem; border: 1px solid var(--line-1); border-radius: var(--r-lg);
  background: var(--surface-1); border-inline-start: 3px solid var(--line-3);
}
.an-lead.is-ok     { border-inline-start-color: var(--ok); }
.an-lead.is-urgent { border-inline-start-color: var(--warn); }
.an-lead.is-accent { border-inline-start-color: var(--brand-500); }
.an-lead__score { text-align: center; min-width: 62px; flex: none; }
.an-lead__score b { display: block; font-size: 1.55rem; line-height: 1; color: var(--text-1); font-variant-numeric: tabular-nums; }
.an-lead__score b small { font-size: .8rem; color: var(--text-4); }
.an-lead__score span { font-size: var(--fs-3xs); color: var(--text-3); }
.an-lead__body { flex: 1; min-width: 0; }
.an-lead__head { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .4rem; }
.an-lead__head b { font-size: var(--fs-sm); color: var(--text-1); }
.an-lead__meta { display: flex; gap: .9rem; flex-wrap: wrap; font-size: var(--fs-3xs); color: var(--text-4); }
.an-lead__meta span { display: inline-flex; align-items: center; gap: .3rem; }
.an-lead__meta svg { width: 13px; height: 13px; }
.an-lead__ev { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .55rem; }
.an-lead__ev span {
  font-size: var(--fs-3xs); color: var(--brand-200);
  background: rgba(var(--rgb-brand), .13); border: 1px solid rgba(var(--rgb-brand), .25);
  padding: .18rem .5rem; border-radius: var(--r-pill);
}
.an-lead__why { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .55rem; }
.an-lead__why span {
  font-size: var(--fs-3xs); color: var(--text-3);
  border: 1px dashed var(--line-2); padding: .18rem .5rem; border-radius: var(--r-xs);
}
.an-lead__why span b { color: var(--ok); }
.an-lead__why span.is-neg b { color: var(--danger); }
.an-lead__more { flex: none; align-self: center; }

/* رحلة الزائر */
.an-jhead {
  display: flex; gap: 1.1rem; align-items: center; padding: 1rem;
  border-radius: var(--r-md); background: var(--surface-2);
  border-inline-start: 3px solid var(--line-3); margin-bottom: 1rem;
}
.an-jhead.is-ok     { border-inline-start-color: var(--ok); }
.an-jhead.is-urgent { border-inline-start-color: var(--warn); }
.an-jhead.is-accent { border-inline-start-color: var(--brand-500); }
.an-jhead > div:first-child { text-align: center; min-width: 66px; }
.an-jhead > div:first-child b { display: block; font-size: 1.6rem; color: var(--text-1); }
.an-jhead > div:first-child span { font-size: var(--fs-3xs); color: var(--text-4); }
.an-jhead__meta { display: grid; gap: .3rem; font-size: var(--fs-3xs); color: var(--text-3); }
.an-jhead__meta span { display: inline-flex; align-items: center; gap: .4rem; }
.an-jhead__meta svg { width: 13px; height: 13px; color: var(--text-4); }

.an-timeline { display: grid; gap: .4rem; position: relative; }
.an-timeline__i {
  display: flex; gap: .7rem; align-items: center;
  padding: .6rem .75rem; border: 1px solid var(--line-1); border-radius: var(--r-sm);
  background: var(--surface-2);
}
.an-timeline__ic { display: grid; place-items: center; width: 28px; height: 28px; flex: none;
  border-radius: var(--r-xs); background: var(--surface-3); color: var(--text-3); }
.an-timeline__ic svg { width: 14px; height: 14px; }
.an-timeline__i.is-ev .an-timeline__ic { background: rgba(var(--rgb-brand), .16); color: var(--brand-300); }
.an-timeline__i.is-search .an-timeline__ic { background: var(--warn-dim); color: var(--warn); }
.an-timeline__i > div { flex: 1; min-width: 0; }
.an-timeline__i b { display: block; font-size: var(--fs-3xs); color: var(--text-1); font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-timeline__i span { font-size: var(--fs-3xs); color: var(--text-4); }
.an-timeline__i em { font-size: var(--fs-3xs); color: var(--text-4); font-style: normal; flex: none; }
.a-table tr.is-current { background: rgba(var(--rgb-brand), .08); }

@media (max-width: 700px) {
  .an-lead { flex-wrap: wrap; }
  .an-lead__more { width: 100%; }
  .an-jhead { flex-wrap: wrap; }
}

.an-bars { display: flex; gap: 1.2rem; align-items: flex-end; justify-content: center; height: 170px; padding: 0 1rem; }
.an-bars__i { display: flex; flex-direction: column; align-items: center; gap: .4rem; height: 100%; justify-content: flex-end; min-width: 70px; }
.an-bars__col {
  width: 54px; border-radius: var(--r-sm) var(--r-sm) 0 0;
  background: linear-gradient(180deg, var(--brand-400), var(--brand-700));
  display: flex; align-items: flex-start; justify-content: center; padding-top: .3rem;
  transition: height .5s cubic-bezier(.4,0,.2,1);
}
.an-bars__col span { font-size: var(--fs-3xs); font-weight: 700; color: var(--text-on-brand); }
.an-bars__i em { font-size: var(--fs-3xs); color: var(--text-4); font-style: normal; }
