/* ===== Dashboard (12 Oct 2026) — an English, left-to-right screen inside the
   Arabic console. Same paper, surfaces and ink as console.css; the charts
   carry their own validated pair (iPhone #2a78d6, Android #eb6834 on white,
   dataviz method). Proportional figures for the big numbers, tabular in
   tables and axes. Everything is scoped under #t-dash. */

#t-dash { --d-s1:#2a78d6; --d-s2:#eb6834; --d-track:#e3ecf8; --d-grid:#ebe9e3; --d-base:#c3c2b7;
  --d-good:#0f7b3a; --d-good-bg:rgba(12,163,12,0.10); --d-wait:#8A92A3;
  font-family:'IBM Plex Sans Arabic', system-ui, sans-serif; direction:ltr; text-align:left; }
#t-dash h2, #t-dash h3, #t-dash h4 { font-family:'Readex Pro', 'IBM Plex Sans Arabic', system-ui, sans-serif; }

.dtop { display:flex; justify-content:space-between; align-items:flex-end; gap:12px; flex-wrap:wrap; padding:20px 0 14px; }
.dtop h2 { font-size:22px; font-weight:600; letter-spacing:-0.01em; }
.dtop .dsub { color:var(--dim); font-size:13px; margin-top:2px; }
.dact { display:flex; gap:10px; align-items:center; }
.dstamp { color:var(--faint); font-size:12px; }

#dash-body { transition:opacity .15s; }
#dash-body.dloading { opacity:.55; }

.dgrid { display:grid; gap:16px; margin-bottom:16px; }
.d-1-2 { grid-template-columns:minmax(0, 1fr) minmax(0, 2fr); }
.d-1-1 { grid-template-columns:repeat(2, minmax(0, 1fr)); }
.d-3-2 { grid-template-columns:minmax(0, 3fr) minmax(0, 2fr); }
.d-1-1-1 { grid-template-columns:repeat(3, minmax(0, 1fr)); }

.dcard { background:var(--surface); border:1px solid var(--border); border-radius:var(--r); padding:18px 18px 16px; margin:0 0 16px; box-shadow:var(--shadow); min-width:0; }
.dgrid > .dcard { margin:0; }
.dcard h3 { font-size:14.5px; font-weight:600; margin-bottom:10px; }
.dcard h4 { font-size:12.5px; font-weight:600; color:var(--dim); margin:16px 0 8px; text-transform:none; }
.dsub2 { color:var(--dim); font-size:12.5px; line-height:1.55; margin:-4px 0 10px; display:block; }
.dnote { color:var(--faint); font-size:12px; line-height:1.55; margin-top:6px; }
.dnote.dwarn { color:var(--gold-deep); background:var(--gold-wash); border-radius:8px; padding:8px 10px; margin-top:14px; }
.dmuted { color:var(--faint); font-weight:400; font-size:12px; }
.dline { font-size:13.5px; line-height:1.65; color:var(--text); }

/* the round */
.dhero { font-size:48px; font-weight:600; line-height:1.05; letter-spacing:-0.02em; margin-top:4px; }
.dhero-l { color:var(--dim); font-size:12.5px; margin-top:4px; }
.dterms { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:10px 8px; align-items:end; margin-top:16px; padding-top:14px; border-top:1px solid var(--border); }
.dterms dt { color:var(--faint); font-size:11.5px; }
.dterms dd { margin:0; font-size:16px; font-weight:600; }

/* milestones */
.dms { display:flex; flex-direction:column; }
.dm { display:grid; grid-template-columns:minmax(0, 1.25fr) minmax(0, .8fr) minmax(0, 1.2fr); gap:14px; align-items:center; padding:11px 0; border-top:1px solid var(--border); }
.dm:first-child { border-top:0; padding-top:2px; }
.dm-l b { display:block; font-size:13.5px; font-weight:600; }
.dm-l span, .dm-v span { display:block; color:var(--faint); font-size:11.5px; line-height:1.45; }
.dm-v { font-size:19px; font-weight:600; line-height:1.2; }
.dm-m { display:flex; flex-direction:column; gap:5px; }
.dmeter { height:8px; border-radius:4px; background:var(--d-track); overflow:hidden; }
.dmeter i { display:block; height:100%; min-width:2px; border-radius:4px; background:var(--d-s1); }
.dmeter.met i { background:var(--d-good); }
.dmeter.wait i { background:var(--d-wait); }
.dst { font-size:11.5px; color:var(--dim); }
.dst.met { color:var(--d-good); font-weight:600; }
.dst.wait { color:var(--dim); }

/* KPI tiles */
.dkpis { display:grid; grid-template-columns:repeat(9, minmax(0, 1fr)); gap:12px; margin-bottom:16px; }
.dkpi { background:var(--surface); border:1px solid var(--border); border-radius:var(--r); padding:14px 14px 12px; box-shadow:var(--shadow); min-width:0; }
.dkpi-l { color:var(--dim); font-size:12px; line-height:1.35; min-height:2.7em; }
.dkpi-v { font-size:28px; font-weight:600; line-height:1.15; margin-top:2px; letter-spacing:-0.01em; }
.dkpi-f { color:var(--faint); font-size:11.5px; margin-top:4px; line-height:1.4; }
.ddelta { font-weight:600; }
.ddelta.good { color:var(--d-good); } .ddelta.bad { color:var(--no); } .ddelta.flat { color:var(--dim); }

/* charts */
.dchart figcaption { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 10px; margin-bottom:6px; }
.dchart figcaption h3 { margin:0; }
.dchart figcaption .dsub2 { margin:0; }
.dlegend { display:flex; gap:14px; margin-left:auto; font-size:12px; color:var(--dim); }
.dlegend span { display:inline-flex; align-items:center; gap:6px; }
.dlegend i { width:10px; height:10px; border-radius:2px; display:inline-block; }
.dplot { position:relative; }
.dplot svg { display:block; max-width:100%; outline:none; }
.dplot svg:focus-visible { outline:2px solid rgba(42,120,214,.45); outline-offset:2px; border-radius:4px; }
.dgridl { stroke:var(--d-grid); stroke-width:1; shape-rendering:crispEdges; }
.dbase { stroke:var(--d-base); stroke-width:1; shape-rendering:crispEdges; }
.dtick { fill:var(--faint); font-size:11px; font-variant-numeric:tabular-nums; }
.dval { fill:var(--text); font-size:11.5px; font-weight:600; }
.dhit { fill:transparent; cursor:crosshair; }
.dtip { position:absolute; top:4px; min-width:140px; background:#fff; border:1px solid var(--hair); border-radius:8px; box-shadow:0 6px 20px -8px rgba(20,25,42,.35); padding:8px 10px; font-size:12px; pointer-events:none; }
.dtip-h { color:var(--dim); font-size:11.5px; margin-bottom:4px; }
.dtip-r { display:flex; align-items:center; gap:7px; line-height:1.6; }
.dtip-r i { width:12px; height:2px; display:inline-block; border-radius:1px; }
.dtip-r b { font-size:13px; min-width:18px; font-variant-numeric:tabular-nums; }
.dtip-r span { color:var(--dim); }
.dtip-x { color:var(--dim); font-size:11.5px; margin-top:3px; border-top:1px solid var(--border); padding-top:3px; }
.dtview { margin-top:8px; }
.dtview summary, .ddefs summary { cursor:pointer; color:var(--dim); font-size:12px; }

/* tables */
.dscroll { overflow-x:auto; -webkit-overflow-scrolling:touch; }
.dtbl { width:100%; border-collapse:collapse; font-size:12.5px; font-variant-numeric:tabular-nums; }
.dtbl th { text-align:left; color:var(--faint); font-weight:500; font-size:11.5px; padding:6px 8px; border-bottom:1px solid var(--hair); white-space:nowrap; }
.dtbl td, .dtbl tbody th { padding:7px 8px; border-bottom:1px solid var(--border); white-space:nowrap; }
.dtbl tbody th { font-weight:500; color:var(--text); }
.dtbl .dnum { text-align:right; }
.dtbl thead th:nth-child(n+4) { text-align:right; }
.dret td { text-align:center; }
.dret td small { display:block; color:var(--faint); font-size:10.5px; line-height:1.2; }
.dret thead th { text-align:center; }
.dret thead th:first-child { text-align:left; }
.dret .dn { color:var(--dim); }
.dna { color:var(--faint); text-align:center; }
.dcamp { max-width:280px; overflow:hidden; text-overflow:ellipsis; text-align:right; font-family:'IBM Plex Sans Arabic', sans-serif; }
.dtag { display:inline-block; font-size:11px; font-weight:600; border-radius:999px; padding:1px 8px; background:var(--alt2); color:var(--text); }
.dtag.installs { background:rgba(42,120,214,.12); color:#1c5cab; }
.dtag.followers { background:rgba(235,104,52,.12); color:#a8441a; }
.dtag.boost { background:var(--alt2); color:var(--dim); }
.dtag.inaccurate { background:var(--no-wash); color:var(--no); }
.dtag.biased { background:var(--gold-wash); color:var(--gold-deep); }

/* retention comparison */
.dcmpt th:first-child { width:55%; }
.dcmpt thead th { text-align:right; }
.dcmpt thead th:first-child { text-align:left; }
.dcmpt tbody th { white-space:normal; }
.dcmpt b { font-size:14.5px; }

/* costs */
.dcosts { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:14px 16px; }
.dcost-v { font-size:24px; font-weight:600; line-height:1.15; }
.dcost-l { font-size:12.5px; color:var(--text); font-weight:500; margin-top:2px; }

/* bars (audience, platforms) */
.dbar { display:grid; grid-template-columns:96px minmax(0, 1fr) 40px; gap:8px; align-items:center; font-size:12.5px; margin:5px 0; }
.dbar > div { height:8px; background:var(--d-track); border-radius:4px; overflow:hidden; }
.dbar i { display:block; height:100%; border-radius:4px; background:var(--d-s1); }
.dbar-n > span { padding-left:12px; color:var(--dim); }   /* a breakdown of the row above it (the 45+ split, 0143) */
.dbar b { text-align:right; font-weight:600; font-variant-numeric:tabular-nums; }

/* followers */
.dfols { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:12px; }
.dfol-v { font-size:28px; font-weight:600; line-height:1.1; }
.dfol-l { color:var(--dim); font-size:12px; }

/* needs attention */
.drep { border-top:1px solid var(--border); padding:10px 0; display:flex; flex-direction:column; gap:6px; }
.drep-c { display:flex; gap:6px; flex-wrap:wrap; align-items:center; }
.drep-q { font-size:13px; line-height:1.6; text-align:right; }
.drep .btn { align-self:flex-start; padding:4px 12px; font-size:12px; }
.dwl { display:flex; justify-content:space-between; align-items:center; gap:10px; border-top:1px solid var(--border); margin-top:12px; padding-top:12px; font-size:12.5px; flex-wrap:wrap; }
.dwl .btn { padding:4px 12px; font-size:12px; }

/* definitions */
.ddefs { color:var(--dim); font-size:12px; margin:4px 0 24px; }
.ddefs ul { margin:8px 0 0; padding-left:18px; line-height:1.7; }

@media (max-width: 1180px) {
  .dkpis { grid-template-columns:repeat(3, minmax(0, 1fr)); }
  .d-1-1-1 { grid-template-columns:repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .d-1-2, .d-1-1, .d-3-2, .d-1-1-1 { grid-template-columns:minmax(0, 1fr); }
  .dkpis { grid-template-columns:repeat(2, minmax(0, 1fr)); }
  .dm { grid-template-columns:minmax(0, 1fr) auto; }
  .dm-m { grid-column:1 / -1; }
  .dhero { font-size:44px; }
}
@media (max-width: 420px) {
  .dcosts, .dfols { grid-template-columns:minmax(0, 1fr); }
}

/* The retention table's phone toggle (founder, 14 Oct; 0144) — the console's
   own segmented control («قصص الليلة»), in the dashboard's scope. */
.dseg { display:inline-flex; border:1px solid var(--border); border-radius:8px; overflow:hidden; margin:2px 0 10px; }
.dseg button { background:transparent; color:var(--dim); border:0; padding:4px 12px; font:inherit; font-size:12.5px; cursor:pointer; }
.dseg button + button { border-left:1px solid var(--border); }
.dseg button.on { background:var(--alt2); color:var(--text); font-weight:600; }
.dseg button:focus-visible { outline:2px solid rgba(42,120,214,.45); outline-offset:-2px; }

/* «يهمّني» (15 Oct 2026): an Arabic card text inside the English dashboard */
.dmarks { table-layout:fixed; width:100%; }
.dmarks th, .dmarks td { white-space:normal; vertical-align:top; }
.dmarks th:nth-child(2), .dmarks td:nth-child(2) { width:52px; }
.dmarks th:nth-child(3), .dmarks td:nth-child(3) { width:92px; }
.dmq { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; direction:rtl; text-align:right; font-size:13px; line-height:1.55; margin-bottom:2px; }

/* line charts (15 Oct 2026; 0152): the milestones' curve and stickiness */
.dln { fill:none; stroke-width:2; stroke-linejoin:round; stroke-linecap:round; }
.dtarget { stroke:var(--d-wait); stroke-width:1.5; stroke-dasharray:5 4; }
.dcross { stroke:var(--d-base); stroke-width:1; }
.dcross.hide, .dpt.hide { display:none; }
