[hidden] { display: none !important; }
/* ---------------------------------------------------------------- tokens (light) */
:root {
  color-scheme: light;
  --bg: #f6f3ec; --card: #fffdf9; --card-2: #faf7f0; --ink: #1c2420; --muted: #66706a; --line: #e7e1d4; --line-2: #d9d2c2;
  --brand: #1f5f46; --brand-2: #174a37; --brand-soft: #e5efe9; --brand-ink: #fff;
  --gold: #b8892b; --gold-soft: #f7eed9;
  --red: #b4431f; --red-soft: #fbeae3; --amber: #a3650b; --amber-soft: #fbf0da;
  --green: #1d7a3a; --green-soft: #e4f3e7; --blue: #2862b8; --blue-soft: #e6eefb; --violet: #6a4ce2; --violet-soft: #efebfd;
  --side: #13241c; --side-2: #1c3328; --side-ink: #d3ddd6; --side-line: #2a4436;
  --radius: 14px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(30,40,30,.05), 0 2px 8px rgba(30,40,30,.05);
  --shadow-lg: 0 12px 40px rgba(20,30,25,.18);
  /* charts */
  --s1: #257de0; --s2: #f47230; --s3: #00b894; --s4: #f2a600; --grid: #ebe6da; --axis: #8b928d;
  --q1: #cce3fd; --q2: #9dc8f7; --q3: #6aabf1; --q4: #338ced; --q5: #2370cd; --q6: #1757ac; --q7: #0e3d7e;
}
/* ---------------------------------------------------------------- tokens (dark) */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121614; --card: #1a201d; --card-2: #202723; --ink: #e9ede9; --muted: #9aa49e; --line: #2b332f; --line-2: #36403a;
  --brand: #3f9b74; --brand-2: #4fb086; --brand-soft: #1f3a2e; --brand-ink: #fff;
  --gold: #d7a84a; --gold-soft: #3a3020;
  --red: #f08a66; --red-soft: #3d231a; --amber: #e6aa4a; --amber-soft: #3a2d17; --green: #5fcf83; --green-soft: #1b3524;
  --blue: #7fb0f5; --blue-soft: #1d2b42; --violet: #a897f2; --violet-soft: #2a2545;
  --side: #0d110f; --side-2: #18201c; --side-ink: #c9d3cd; --side-line: #24302a;
  --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 12px 40px rgba(0,0,0,.5);
  --s1: #338ced; --s2: #e76624; --s3: #00a888; --s4: #d28e05; --grid: #2a312d; --axis: #7f8984;
  --q1: #0e3d7e; --q2: #0f4a96; --q3: #1757ac; --q4: #1b64be; --q5: #2370cd; --q6: #338ced; --q7: #6aabf1;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.6 "Cairo", "Segoe UI", Tahoma, "Noto Sans Arabic", Arial, sans-serif; }
body { -webkit-tap-highlight-color: transparent; }
/* nothing may make the page wider than the phone (it slid sideways on some phones) */
html, body { overflow-x: hidden; overflow-x: clip; max-width: 100%; }
.main { min-width: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 23px; margin: 0 0 16px; font-weight: 800; }
h2 { font-size: 16.5px; margin: 0 0 12px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
h3 { font-size: 14px; margin: 0 0 8px; color: var(--muted); font-weight: 600; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.ltr { direction: ltr; unicode-bidi: embed; display: inline-block; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/* ---------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { align-self: start; background: var(--side); color: var(--side-ink); padding: 16px 12px; position: sticky; top: 0; height: 100vh; overflow: auto; display: flex; flex-direction: column; }
.logo { font-size: 24px; font-weight: 800; color: #fff; padding: 2px 10px 12px; letter-spacing: .3px; display: flex; align-items: center; gap: 10px; }
.logo span { color: var(--gold); }
.ac-badge { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 0 0 12px; border-radius: 12px; background: var(--side-2); }
.ac-dot { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 14px; flex: none; }
.ac-badge select { flex: 1; background: transparent; color: #fff; border: 0; padding: 2px; font-weight: 700; }
.ac-badge select option { color: #111; }
.ac-badge b { color: #fff; }
.nav a { display: flex; align-items: center; gap: 11px; color: var(--side-ink); padding: 9px 11px; border-radius: 10px; margin-bottom: 2px; font-weight: 600; }
.nav a:hover { background: var(--side-2); text-decoration: none; }
.nav a.active { background: var(--brand); color: #fff; }
.nav .count { margin-inline-start: auto; background: #e5484d; color: #fff; border-radius: 999px; font-size: 11.5px; min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 6px; }
.side .me { border-top: 1px solid var(--side-line); margin-top: auto; padding: 12px 8px 0; font-size: 13px; }
.side .me a { color: #b9c8bf; }
.side .btn { background: var(--side-2); border-color: var(--side-line); color: var(--side-ink); }
.main { padding: 0 28px 80px; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 12px 0; margin-bottom: 8px; background: var(--bg); }
.topbar .search { flex: 1; max-width: 460px; position: relative; }
.topbar .search input { width: 100%; padding-inline-start: 36px; border-radius: 999px; background: var(--card); }
.topbar .search svg { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 700; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; white-space: nowrap; }
.pill.on { background: var(--green-soft); color: var(--green); border-color: transparent; }
.pill.off { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.sup-pill { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 800; font-size: 13px; position: relative; flex: none; }
.avatar .dot { position: absolute; bottom: -1px; inset-inline-end: -1px; border: 2px solid var(--bg); }
.icon-btn { border: 1px solid var(--line); background: var(--card); color: var(--ink); width: 36px; height: 36px; border-radius: 10px; display: inline-grid; place-items: center; cursor: pointer; }
.burger { display: none; }
.offline-bar { position: fixed; top: 0; inset-inline: 0; z-index: 70; background: #f5c451; color: #3b2a00; text-align: center; padding: 6px; font-weight: 700; font-size: 13.5px; }
.bottom-nav { display: none; }
.show-sm { display: none; }

/* ---------------------------------------------------------------- cards & tables */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card { margin-top: 16px; }
.stat { padding: 14px 16px; }
.stat .n { font-size: 27px; font-weight: 800; line-height: 1.2; }
.stat .l { color: var(--muted); font-size: 13px; }
.stat .d { font-size: 12px; margin-top: 2px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: start; padding: 11px 9px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12.5px; color: var(--muted); font-weight: 700; background: var(--card-2); }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--card-2); }
.table-wrap { overflow-x: auto; }
/* phones: the staff table scrolls sideways instead of squeezing names into a thin column */
.team-table { min-width: 720px; }
.team-table td:first-child { min-width: 210px; }
.empty { text-align: center; color: var(--muted); padding: 30px 12px; }
.empty .big { font-size: 40px; line-height: 1; margin-bottom: 8px; }
.empty b { display: block; color: var(--ink); font-size: 15.5px; margin-bottom: 4px; }
.empty .btn { margin-top: 12px; }

/* ---------------------------------------------------------------- forms */
input, select, textarea, button { font: inherit; }
input, select, textarea { border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 8px 11px; background: var(--card); color: var(--ink); min-width: 0; }
textarea { width: 100%; min-height: 72px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 35%, transparent); border-color: var(--brand); }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.field { margin-bottom: 12px; }
.field input, .field select, .field textarea { width: 100%; }
.btn { border: 1px solid var(--line-2); background: var(--card); color: var(--ink); border-radius: var(--radius-sm); padding: 8px 15px; cursor: pointer; white-space: nowrap; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; justify-content: center; }
.btn:hover { background: var(--card-2); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: var(--brand-2); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn.wa { background: #1fa855; border-color: #1fa855; color: #fff; }
.btn.wa:hover { background: #18914a; }
.btn.danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.btn.sm { padding: 5px 11px; font-size: 13px; }
.btn.lg { padding: 11px 18px; font-size: 15.5px; }
.btn:disabled { opacity: .55; cursor: default; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line-2); background: var(--card); border-radius: 999px; padding: 5px 13px; cursor: pointer; font-size: 13px; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.chip .n { background: color-mix(in srgb, currentColor 14%, transparent); border-radius: 999px; padding: 0 7px; font-size: 12px; }

/* ---------------------------------------------------------------- badges */
.badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; background: var(--card-2); color: var(--muted); white-space: nowrap; border: 1px solid var(--line); }
.b-new { background: var(--blue-soft); color: var(--blue); border-color: transparent; }
.b-contacted, .b-interested, .b-no_answer { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.b-trial_booked, .b-trial_done { background: var(--violet-soft); color: var(--violet); border-color: transparent; }
.b-subscribed { background: var(--green-soft); color: var(--green); border-color: transparent; }
.b-not_interested, .b-lost { background: var(--card-2); color: var(--muted); }
.b-red { background: var(--red-soft); color: var(--red); border-color: transparent; }
.b-green { background: var(--green-soft); color: var(--green); border-color: transparent; }
.b-amber { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.b-gold { background: var(--gold-soft); color: var(--gold); border-color: transparent; }
.score { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 24px; border-radius: 7px; font-weight: 800; font-size: 12.5px; }
.s-hi { background: var(--green-soft); color: var(--green); }
.s-mid { background: var(--amber-soft); color: var(--amber); }
.s-lo { background: var(--card-2); color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.dot.ok { background: #22c55e; } .dot.no { background: #a3aaa6; } .dot.warn { background: #f59e0b; }
.flag { font-size: 16px; line-height: 1; }
.clock { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 13px; }
.clock.night { color: var(--red); }
.countdown { font-weight: 800; font-size: 12.5px; border-radius: 999px; padding: 2px 9px; }
.cd-ok { background: var(--green-soft); color: var(--green); } .cd-warn { background: var(--amber-soft); color: var(--amber); } .cd-late { background: var(--red-soft); color: var(--red); }

/* ---------------------------------------------------------------- lead cards (agenda + mobile list) */
.lead-card { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-inline-start: 4px solid var(--line-2); border-radius: 12px; margin-bottom: 8px; background: var(--card); color: inherit; position: relative; transition: transform .15s; touch-action: pan-y; }
.lead-card:hover { border-color: var(--brand); text-decoration: none; }
.lead-card .body { flex: 1; min-width: 0; }
.lead-card .nm { font-weight: 800; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-card .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.lead-card .wa-btn { width: 44px; height: 44px; border-radius: 12px; background: #1fa855; color: #fff; border: 0; display: grid; place-items: center; cursor: pointer; flex: none; }
.st-new { border-inline-start-color: var(--blue); } .st-contacted, .st-no_answer, .st-interested { border-inline-start-color: var(--amber); }
.st-trial_booked, .st-trial_done { border-inline-start-color: var(--violet); } .st-subscribed { border-inline-start-color: var(--green); }
.swipe-hint { position: absolute; inset-block: 0; display: grid; place-items: center; width: 80px; color: #fff; font-weight: 800; font-size: 13px; border-radius: 12px; z-index: -1; }

/* ---------------------------------------------------------------- agenda */
.hello { background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 70%, #000)); color: #fff; border: 0; position: relative; overflow: hidden; }
.hello h1 { margin: 0 0 4px; }
.hello .sub { opacity: .9; }
.hello .goal { margin-top: 12px; max-width: 420px; }
.hello .goal .bar { background: rgba(255,255,255,.22); }
.hello .goal .bar > i { background: var(--gold); }
.hello::after { content: ""; position: absolute; inset-inline-end: -40px; top: -40px; width: 200px; height: 200px; opacity: .1;
  background: repeating-conic-gradient(#fff 0 15deg, transparent 15deg 30deg); border-radius: 50%; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; cursor: pointer; }
.tile .n { font-size: 26px; font-weight: 800; line-height: 1.1; }
.tile .l { font-size: 13px; color: var(--muted); font-weight: 600; }
.tile.on { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 25%, transparent); }
.section-title { display: flex; align-items: center; gap: 8px; font-weight: 800; margin: 18px 0 8px; }

/* ---------------------------------------------------------------- lead page */
.lead-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.lead-head .name { font-size: 23px; font-weight: 800; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; font-size: 14px; }
.kv div:nth-child(odd) { color: var(--muted); }
.kv > div { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.next-step { border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); background: var(--gold-soft); }
.next-step .t { font-weight: 800; font-size: 15.5px; }
.guidance { border: 1px solid color-mix(in srgb, var(--amber) 40%, transparent); background: var(--amber-soft); color: var(--ink); }
.outcomes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.outcomes .btn { flex-direction: column; padding: 10px 6px; font-size: 13px; gap: 4px; }
.feed { display: flex; flex-direction: column; gap: 10px; }
.ev { display: flex; gap: 10px; align-items: flex-start; }
.ev .ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--card-2); color: var(--muted); border: 1px solid var(--line); }
.ev .bx { background: var(--card-2); border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; padding: 8px 12px; font-size: 14px; max-width: 100%; }
.ev .bx .when { color: var(--muted); font-size: 12px; margin-top: 2px; }
.ev.note .bx { background: var(--blue-soft); border-color: transparent; }
.ev.help .bx, .ev.guide .bx { background: var(--amber-soft); border-color: transparent; }
.ev.win .bx { background: var(--green-soft); border-color: transparent; }
.ev.wa .ic { background: #1fa855; color: #fff; border-color: transparent; }
.chat { display: flex; flex-direction: column; gap: 6px; }
.bubble { max-width: 82%; padding: 8px 12px; border-radius: 12px; font-size: 14px; white-space: pre-wrap; }
.bubble.out { background: #d9fdd3; color: #111; align-self: flex-start; }
.bubble.in { background: var(--card); border: 1px solid var(--line); align-self: flex-end; }
.slots { display: flex; flex-wrap: wrap; gap: 6px; }
.slot { border: 1px solid var(--line-2); background: var(--card); border-radius: 9px; padding: 6px 11px; cursor: pointer; font-size: 13px; }
.slot:hover { border-color: var(--brand); background: var(--brand-soft); }
.tpl { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; }
.tpl.on { border-color: #1fa855; box-shadow: 0 0 0 2px rgba(31,168,85,.2); }
.tpl .ar { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 6px; color: var(--muted); font-size: 13px; white-space: pre-wrap; }
.sticky-actions { display: none; }

/* ---------------------------------------------------------------- team / help */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.mcard { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.mcard.alert { border-color: color-mix(in srgb, var(--red) 50%, transparent); }
.mcard .nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0; text-align: center; }
.mcard .nums b { display: block; font-size: 20px; }
.mcard .nums span { font-size: 11.5px; color: var(--muted); }
.help-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.help-item:last-child { border-bottom: 0; }
.group-title { font-weight: 800; margin: 18px 0 8px; display: flex; gap: 8px; align-items: center; }

/* ---------------------------------------------------------------- charts */
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.chart .gl { stroke: var(--grid); stroke-width: 1; }
.chart .lbl { fill: var(--ink); font-weight: 700; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--ink); margin-bottom: 8px; }
.legend i { display: inline-block; width: 12px; height: 4px; border-radius: 2px; vertical-align: middle; margin-inline-end: 6px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 160px) 1fr 54px; gap: 10px; align-items: center; margin-bottom: 7px; font-size: 13.5px; }
.hbar .tr { height: 14px; background: var(--card-2); border-radius: 4px; overflow: hidden; display: flex; gap: 2px; }
.hbar .tr i { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.hbar .v { text-align: end; font-weight: 700; }
.funnel-row { display: grid; grid-template-columns: 120px 1fr 160px; gap: 10px; align-items: center; margin-bottom: 8px; font-size: 14px; }
.funnel-row .tr { height: 30px; position: relative; }
.funnel-row .tr i { display: block; height: 100%; border-radius: 6px; margin-inline: auto; min-width: 4px; }
.funnel-row .drop { font-size: 12px; color: var(--muted); white-space: nowrap; }
.heat { display: grid; grid-template-columns: 56px repeat(24, 1fr); gap: 2px; font-size: 10.5px; }
.heat div { aspect-ratio: 1; border-radius: 3px; }
.heat .h { aspect-ratio: auto; text-align: center; color: var(--muted); overflow: visible; white-space: nowrap; min-width: 0; }
.grid > * { min-width: 0; }
.card:has(> .heat) { overflow: hidden; }
.heat .d { aspect-ratio: auto; color: var(--muted); font-size: 12px; align-self: center; }
.tip { position: fixed; pointer-events: none; background: var(--ink); color: var(--bg); padding: 6px 10px; border-radius: 8px; font-size: 12.5px; z-index: 80; box-shadow: var(--shadow-lg); white-space: nowrap; }
.range { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------------- misc */
.bar { height: 8px; background: var(--card-2); border-radius: 4px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 4px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; }
.tabs a.on { color: var(--brand); border-color: var(--brand); }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.pager { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 12px; }
.sk { background: linear-gradient(90deg, var(--card-2) 25%, var(--line) 50%, var(--card-2) 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 10px; }
@keyframes sk { to { background-position: -200% 0; } }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(circle at 20% 10%, #2a7a5a, transparent 50%), linear-gradient(160deg, #10241a, #1f5f46); }
.login .card { width: min(380px, 100%); padding: 30px; }
.login .logo { color: var(--ink); justify-content: center; padding: 0 0 18px; font-size: 32px; }
.login .logo span { color: var(--gold); }

/* modal & toast */
.modal { position: fixed; inset: 0; background: rgba(10,20,15,.5); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal-card { background: var(--card); border-radius: 18px; width: min(580px, 100%); max-height: 90vh; overflow: auto; padding: 22px; box-shadow: var(--shadow-lg); }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #16201b; color: #fff; padding: 10px 16px; border-radius: 12px; z-index: 60; font-size: 14px; display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow-lg); max-width: calc(100vw - 24px); }
.toast.err { background: var(--red); }
.toast button { background: transparent; color: var(--gold); border: 0; font-weight: 800; cursor: pointer; padding: 0; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: fall 1.6s ease-in forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(540deg); opacity: .7; } }
.ptr { text-align: center; color: var(--muted); font-size: 13px; height: 0; overflow: hidden; transition: height .15s; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 0 0 auto; width: 270px; transform: translateX(100%); visibility: hidden; transition: transform .2s, visibility 0s .2s; z-index: 40; }
  .side.open { transform: none; visibility: visible; transition: transform .2s; box-shadow: var(--shadow-lg); }
  .burger { display: inline-grid; }
  .main { padding: 0 14px 96px; }
  .topbar .search { max-width: none; }
  .topbar .hide-sm { display: none; }
  .kv { grid-template-columns: 100px 1fr; }
  .hide-sm { display: none; }
  .show-sm { display: block; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; inset-inline: 0; z-index: 30; background: var(--card); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11.5px; color: var(--muted); font-weight: 700; position: relative; padding: 4px 0; }
  .bottom-nav a.active { color: var(--brand); }
  .bottom-nav a:hover { text-decoration: none; }
  .bottom-nav svg.i { width: 22px; height: 22px; }
  .bottom-nav .count { position: absolute; top: 0; inset-inline-start: calc(50% + 4px); background: #e5484d; color: #fff; border-radius: 999px; font-size: 10px; min-width: 17px; height: 17px; display: grid; place-items: center; padding: 0 4px; }
  .sticky-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; position: fixed; bottom: calc(62px + env(safe-area-inset-bottom)); inset-inline: 0; padding: 8px 12px; background: var(--card); border-top: 1px solid var(--line); z-index: 29; }
  .sticky-actions .btn { padding: 11px 6px; }
  .has-sticky { padding-bottom: 70px; }
  .m-hide { display: none !important; }
  .lead-head .actions { width: 100%; }
  .lead-head .actions .btn { flex: 1; }
  .outcomes { grid-template-columns: repeat(2, 1fr); }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .funnel-row { grid-template-columns: 96px 1fr 84px; }
  .heat { grid-template-columns: 40px repeat(24, 1fr); font-size: 8px; }
}

/* ✨ اسأل ليدز */
.ai-fab { position: fixed; left: 18px; bottom: 18px; z-index: 35; display: flex; align-items: center; gap: 6px; border: 0; cursor: pointer;
  background: linear-gradient(135deg, #1f5f46, #2f7d5e); color: #fff; padding: 11px 16px; border-radius: 999px; font: inherit; font-size: 14px;
  box-shadow: 0 6px 20px rgba(31,95,70,.35); touch-action: none; user-select: none; -webkit-user-select: none; }
.ai-fab.dragging { cursor: grabbing; opacity: .85; transform: scale(1.08); transition: none; }
.ai-fab span { animation: aispin 6s linear infinite; display: inline-block; }
@keyframes aispin { 0%,85% { transform: rotate(0) scale(1); } 92% { transform: rotate(20deg) scale(1.25); } 100% { transform: rotate(0) scale(1); } }
.ai-fab span { font-size: 17px; }
@media (max-width: 900px) { .ai-fab { bottom: calc(150px + env(safe-area-inset-bottom)); left: 12px; padding: 10px 13px; } .ai-fab b { display: none; } }
.ai-card { display: flex; flex-direction: column; max-height: min(86vh, 760px); width: min(560px, 100%); }
.ai-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.ai-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 200px; padding: 2px; }
.ai-msg { max-width: 88%; padding: 9px 12px; border-radius: 14px; white-space: pre-wrap; line-height: 1.7; font-size: 14.5px; }
.ai-msg.bot { align-self: flex-start; background: var(--brand-soft); border-top-right-radius: 4px; }
.ai-msg.me { align-self: flex-end; background: var(--brand); color: #fff; border-top-left-radius: 4px; }
.ai-msg.typing { opacity: .7; animation: aipulse 1s infinite alternate; }
@keyframes aipulse { to { opacity: .35; } }
.ai-sugg { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.ai-sugg .chip { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 6px 11px; font: inherit; font-size: 13px; cursor: pointer; }
.ai-ask ol { margin: 6px 0 4px; padding-inline-start: 20px; }
.ai-out { align-self: stretch; border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 10px 12px; }
.ai-out-text { white-space: pre-wrap; line-height: 1.7; font-size: 14.5px; margin-top: 4px; }
.ai-out .ar { margin-top: 6px; font-size: 13px; color: var(--muted); }

.perm-btn { position: relative; font-size: 16px; }
.perm-btn .perm-dot { position: absolute; top: 4px; right: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--card); }

.copy-btn { border: 0; background: transparent; cursor: pointer; font-size: 13px; padding: 0 3px; opacity: .7; vertical-align: middle; }
.copy-btn:hover { opacity: 1; }
.b-blue { background: var(--blue-soft); color: var(--blue); border-color: transparent; }
