/* WhatsApp Suite Lite dashboard — EvolexAI brand
   Navy ink from the logo, cool paper surface, the electric-blue→cyan gradient reserved
   for the brand mark and the COD chevron funnel only. One family: IBM Plex Sans Arabic. */
:root {
  color-scheme: light;
  --paper: #f3f6fc;
  --panel: #ffffff;
  --ink: #18203b;
  --ink-2: #4a5677;
  --ink-3: #7a86a6;
  --line: #e1e7f3;
  --line-2: #eef2f9;
  --brand-a: #2233ff;
  --brand-b: #12c2ee;
  --focus: #2b5cff;
  /* categorical (validated): cod / cart / review / offers */
  --s-cod: #1d4fe8;
  --s-cart: #e8742f;
  --s-review: #0f9d74;
  --s-offers: #9a5cf0;
  --s-read: #0f9d74;
  /* status (always shown with text + icon) */
  --good: #12804f; --good-bg: #e3f5ec;
  --warn: #9a5b00; --warn-bg: #fdf1dc;
  --bad: #b42335;  --bad-bg: #fbe5e8;
  --radius-l: 18px;
  --radius-s: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #121933; --panel: #1a2240; --ink: #eef2fb; --ink-2: #b5c0dc; --ink-3: #8592b4;
    --line: #2b3558; --line-2: #222b4b; --focus: #6d8dff;
    --s-cod: #4a78ff; --s-cart: #d9692c; --s-review: #169a72; --s-offers: #9a72f2; --s-read: #169a72;
    --good: #5fd39a; --good-bg: #173b33; --warn: #f1b75a; --warn-bg: #3b3020; --bad: #ff8a97; --bad-bg: #42222b;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #121933; --panel: #1a2240; --ink: #eef2fb; --ink-2: #b5c0dc; --ink-3: #8592b4;
  --line: #2b3558; --line-2: #222b4b; --focus: #6d8dff;
  --s-cod: #4a78ff; --s-cart: #d9692c; --s-review: #169a72; --s-offers: #9a72f2; --s-read: #169a72;
  --good: #5fd39a; --good-bg: #173b33; --warn: #f1b75a; --warn-bg: #3b3020; --bad: #ff8a97; --bad-bg: #42222b;
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: 'IBM Plex Sans Arabic', system-ui, 'Segoe UI', sans-serif;
  font-size: 15px; line-height: 1.6; font-feature-settings: 'tnum' 1;
  -webkit-font-smoothing: antialiased;
}
h1, h2, p, dl, dd, ol, ul { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

.page { max-width: 1240px; margin: 0 auto; padding: 20px 28px 40px; }

/* ---------- header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 6px 0 22px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { border-radius: 10px; display: block; }
.brand-name { font-weight: 600; font-size: 16px; letter-spacing: 0.2px; }
.store { color: var(--ink-3); font-size: 13px; }
.controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.live { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.live.on .dot { background: var(--good); box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 60%, transparent); animation: pulse 2.4s ease-out infinite; }
.live.off .dot { background: var(--bad); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 55%, transparent); } 80%, 100% { box-shadow: 0 0 0 8px transparent; } }
.range { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.range button { border: 0; background: none; padding: 6px 14px; border-radius: 999px; cursor: pointer; font-size: 13.5px; color: var(--ink-2); }
.range button[aria-selected="true"] { background: var(--ink); color: var(--panel); font-weight: 500; }
.theme { border: 1px solid var(--line); background: var(--panel); width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--ink-2); }

.demo-note { background: var(--warn-bg); color: var(--warn); border-radius: var(--radius-s); padding: 10px 14px; font-size: 13.5px; margin-bottom: 18px; }
.demo-note code { font-family: inherit; font-weight: 600; }

/* ---------- hero: one sentence, one number */
.hero { display: grid; grid-template-columns: 1fr 320px; gap: 40px; align-items: end; padding: 18px 0 34px; border-bottom: 1px solid var(--line); }
.hero-lead { font-weight: 400; font-size: 22px; color: var(--ink-2); }
.hero-number { display: flex; align-items: baseline; gap: 14px; margin: 4px 0 10px; }
.hero-number > span:first-child {
  font-size: clamp(56px, 9.5vw, 120px); font-weight: 600; line-height: 1; letter-spacing: -1.5px;
  background: linear-gradient(90deg, var(--brand-b), var(--brand-a)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-number .cur { font-size: 26px; font-weight: 500; color: var(--ink-2); }
.hero-sub { color: var(--ink-2); max-width: 62ch; font-size: 16px; }
.hero-sub span { color: var(--ink); font-weight: 600; }

.attention h2 { font-size: 15px; font-weight: 600; margin-bottom: 10px; }
.attention ul { list-style: none; padding: 0; display: grid; gap: 8px; }
.attention li { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--radius-s); font-size: 14px; }
.attention li svg { flex: none; }
.attention .bad { background: var(--bad-bg); color: var(--bad); }
.attention .warn { background: var(--warn-bg); color: var(--warn); }
.attention .good { background: var(--good-bg); color: var(--good); }
.attention b { font-weight: 700; }

/* ---------- section headings */
.sec-head, .panel-head { margin-bottom: 18px; }
h2 { font-size: 19px; font-weight: 600; line-height: 1.35; }
.sec-head p, .panel-head p { color: var(--ink-3); font-size: 13.5px; margin-top: 2px; }

/* ---------- COD chevron funnel (the one bold element) */
.cod { padding: 34px 0; border-bottom: 1px solid var(--line); }
.cod-body { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 36px; align-items: center; }
.funnel { margin: 0; }
.funnel svg { width: 100%; height: auto; display: block; overflow: visible; }
.funnel .lbl-v { font-size: 30px; font-weight: 600; fill: var(--ink); }
.funnel .lbl-t { font-size: 15px; fill: var(--ink-2); }
.funnel .lbl-p { font-size: 13px; fill: var(--ink-3); }
.cod-facts { display: grid; gap: 0; }
.cod-facts > div { padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.cod-facts > div:last-child { border-bottom: 0; }
.cod-facts dt { color: var(--ink-3); font-size: 13.5px; }
.cod-facts dd { font-size: 22px; font-weight: 600; }
.cod-facts dd.hint { font-size: 13.5px; font-weight: 400; color: var(--ink-2); }

/* ---------- panels */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; margin-top: 28px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 20px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 20px 22px; min-width: 0; }

/* charts */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--line-2); stroke-width: 1; }
.chart .axis text { font-size: 11px; fill: var(--ink-3); }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .cross { stroke: var(--ink-3); stroke-width: 1; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-inline-end: 6px; }
.table-view { margin-top: 12px; font-size: 13px; color: var(--ink-2); }
.table-view summary { cursor: pointer; color: var(--ink-3); width: max-content; }
.table-view table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.table-view td, .table-view th { padding: 4px 6px; border-bottom: 1px solid var(--line-2); text-align: start; }
.table-view th { color: var(--ink-3); font-weight: 500; }

.tip { position: fixed; z-index: 10; pointer-events: none; background: var(--ink); color: var(--panel); font-size: 12.5px; line-height: 1.5;
  padding: 8px 10px; border-radius: 8px; box-shadow: 0 6px 18px rgba(16, 24, 56, 0.18); max-width: 240px; }
.tip b { font-weight: 600; }
.tip .k { display: inline-block; width: 10px; height: 3px; border-radius: 2px; vertical-align: middle; margin-inline-end: 6px; }

/* live feed */
.feed { list-style: none; padding: 0; display: grid; gap: 2px; max-height: 360px; overflow: auto; }
.feed li { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.feed li:last-child { border-bottom: 0; }
.feed .ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--line-2); }
.feed .ic i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.feed .when { color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.feed .who { color: var(--ink-3); font-size: 12px; direction: ltr; unicode-bidi: isolate; }
.feed li.new { animation: arrive 1.2s ease-out; }
@keyframes arrive { from { background: color-mix(in srgb, var(--brand-b) 16%, transparent); } to { background: transparent; } }

/* flows table */
.flows { display: grid; gap: 14px; }
.flow-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
.flow-name { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.flow-name i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.flow-meta { color: var(--ink-3); font-size: 12.5px; }
.flow-rev { font-weight: 600; text-align: end; }
.flow-bars { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.bar-cell { font-size: 12px; color: var(--ink-3); }
.bar-cell .track { height: 6px; border-radius: 4px; background: var(--line-2); margin-top: 4px; overflow: hidden; }
.bar-cell .fill { height: 100%; border-radius: 4px; }
.bar-cell b { color: var(--ink); font-weight: 600; }

/* small panels */
.stat { font-size: 34px; font-weight: 600; line-height: 1.1; }
.stat small { font-size: 15px; font-weight: 400; color: var(--ink-2); margin-inline-start: 6px; }
.sub { color: var(--ink-2); font-size: 13.5px; margin-top: 6px; }
.steps { list-style: none; padding: 0; margin-top: 14px; display: grid; gap: 10px; }
.steps li { display: grid; grid-template-columns: 1fr auto; font-size: 13.5px; color: var(--ink-2); }
.steps .track { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--line-2); margin-top: 4px; overflow: hidden; }
.steps .fill { height: 100%; border-radius: 4px; background: var(--s-cart); }
.stars { display: flex; gap: 3px; margin: 8px 0 4px; }
.split { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; margin-top: 12px; }
.split span { display: block; height: 100%; }
.split-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12.5px; color: var(--ink-2); margin-top: 8px; }
.split-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-inline-end: 5px; vertical-align: middle; }

.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--ink-3); font-size: 12.5px; margin-top: 28px; }

/* number changed: one short highlight, answering a real change */
.tick { animation: tick 0.9s ease-out; border-radius: 4px; }
@keyframes tick { from { background: color-mix(in srgb, var(--brand-b) 28%, transparent); } to { background: transparent; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 980px) {
  .hero, .cod-body, .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .hero { gap: 22px; }
}
@media (max-width: 560px) {
  .page { padding: 14px 16px 30px; }
  .range button { padding: 6px 10px; }
  .flow-bars { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- logout + login page */
.logout { border: 1px solid var(--line); background: var(--panel); color: var(--ink-2); height: 36px; padding: 0 14px; border-radius: 18px; font: inherit; font-size: 13.5px; cursor: pointer; }
.logout:hover { color: var(--ink); border-color: var(--ink-3); }
.logout:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 32px 28px 22px; }
.login-mark { display: flex; justify-content: center; margin-bottom: 8px; }
.login-mark svg { width: 84px; height: 84px; }
.login h1 { font-size: 22px; font-weight: 700; text-align: center; margin: 0 0 6px; }
.login-sub { text-align: center; color: var(--ink-2); font-size: 14px; margin: 0 0 22px; }
.login form { display: grid; gap: 6px; }
.login label { font-size: 13.5px; font-weight: 500; color: var(--ink-2); margin-top: 8px; }
.login input { font: inherit; font-size: 15px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-s); height: 44px; padding: 0 12px; text-align: left; }
.login input:focus { outline: 2px solid var(--focus); outline-offset: 1px; border-color: transparent; }
.login button { margin-top: 16px; height: 46px; border: 0; border-radius: var(--radius-s); font: inherit; font-size: 15.5px; font-weight: 600; color: #fff; cursor: pointer;
  background: linear-gradient(90deg, var(--brand-a), var(--brand-b)); }
.login button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.login button:disabled { opacity: .7; cursor: progress; }
.login-error { margin: 10px 0 0; background: var(--bad-bg); color: var(--bad); border-radius: var(--radius-s); padding: 9px 12px; font-size: 13.5px; }
.login-foot { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 22px 0 0; font-size: 12.5px; color: var(--ink-3); }
.login-foot img { border-radius: 5px; }
