/* ────────────────────────────────────────────────────────────────────────
   HOMEi «متابعة الشركة» (CO-WATCH-1, TSK-0957) — on the house design system.

   One page: the company figures, then one card per department — its status
   word, open · overdue · untouched work and the overdue trend.

   Colours: the design system's own tokens (--lm-d-* in tokens.css, with
   their dark mirror); no colour literal here — the ratchet holds this sheet
   at zero. Text never under 12px. RTL-safe: logical properties only.
   Scoped by `.cw-page` (the page class) and `.cw`.

   Registered as a Filament asset — a change here ships NOTHING until
   `php artisan filament:assets` is run and public/css/app/ is committed in
   the same change.
   ──────────────────────────────────────────────────────────────────────── */

body:has(.cw-page) { background: var(--lm-d-page); }
body:has(.cw-page) .fi-main-ctn { background: transparent; }

.cw { display: flex; flex-direction: column; gap: 14px; color: var(--lm-d-ink); }
.cw :focus-visible { outline: 2px solid var(--lm-d-info); outline-offset: 2px; }
.cw .cw-num { font-variant-numeric: tabular-nums; }
.cw bdi { unicode-bidi: isolate; white-space: nowrap; }
.cw a { color: inherit; text-decoration: none; }
.cw button { font: inherit; color: inherit; cursor: pointer; }
.cw .is-info { color: var(--lm-d-info); }
.cw .is-ok { color: var(--lm-d-ok); }
.cw .is-warn { color: var(--lm-d-warn); }
.cw .is-danger { color: var(--lm-d-danger); }
.cw .is-quiet { color: var(--lm-d-muted); }

/* ── header ── */
.cw-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.cw-head-main { min-inline-size: 0; }
.cw-title { margin: 0; font-size: 28px; font-weight: 700; line-height: 1.3; }
.cw-sub { margin: 4px 0 0; font-size: 14px; color: var(--lm-d-muted); }
.cw-head-links { display: flex; flex-wrap: wrap; gap: 8px; }
.cw-btn {
    display: inline-flex; align-items: center; min-block-size: 44px; padding-inline: 16px;
    border: 1px solid var(--lm-d-control-edge); border-radius: 10px; background: var(--lm-d-surface);
    font-size: 14px; font-weight: 600;
}
.cw-btn:hover { background: var(--lm-d-hover); }

/* ── the company figures ── */
.cw-strip {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    background: var(--lm-d-surface); border: 1px solid var(--lm-d-border); border-radius: 12px; overflow: hidden;
}
.cw-strip-c { display: flex; flex-direction: column; gap: 2px; padding: 12px 18px; border-inline-start: 1px solid var(--lm-d-divider); min-inline-size: 0; }
.cw-strip-c:first-child { border-inline-start: 0; }
.cw-strip-l { font-size: 13px; color: var(--lm-d-muted); }
.cw-strip-v { font-size: 26px; font-weight: 700; line-height: 1.3; }
.cw-strip-s { font-size: 12px; color: var(--lm-d-muted); }
.cw-na {
    align-self: flex-start; padding-inline: 8px; border-radius: 6px; background: var(--lm-d-quiet-bg);
    font-size: 13px; font-weight: 600; color: var(--lm-d-muted);
}

/* ── the ruled card ── */
.cw-card {
    display: flex; flex-direction: column; gap: 12px; padding: 14px 18px 18px;
    background: var(--lm-d-surface); border: 1px solid var(--lm-d-border); border-block-start: 3px solid var(--lm-d-info); border-radius: 12px;
}
.cw-card-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.cw-card-t { margin: 0; font-size: 20px; font-weight: 700; }
.cw-sorts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 4px; background: var(--lm-d-quiet-bg); border-radius: 10px; }
.cw-sorts-l { padding-inline: 8px; font-size: 13px; color: var(--lm-d-muted); }
.cw-pill { min-block-size: 36px; padding-inline: 14px; border: 0; border-radius: 8px; background: transparent; font-size: 14px; font-weight: 600; color: var(--lm-d-muted); }
.cw-pill.is-on { background: var(--lm-d-tab-on-bg); color: var(--lm-d-tab-on-ink); }

.cw-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cw-chip {
    display: inline-flex; align-items: center; gap: 8px; min-block-size: 36px; padding-inline: 12px;
    border: 1px solid var(--lm-d-control-edge); border-radius: 999px; background: var(--lm-d-surface);
    font-size: 14px; font-weight: 600; color: var(--lm-d-ink);
}
.cw-chip b { font-weight: 700; }
.cw-chip:hover { background: var(--lm-d-chip-bg); }
.cw-chip.is-on { background: var(--lm-d-info-soft); border-color: var(--lm-d-info); color: var(--lm-d-info); }
.cw-note, .cw-empty { margin: 0; font-size: 13px; color: var(--lm-d-muted); }
.cw-empty { padding-block: 18px; font-size: 14px; }

/* ── one card per department ── */
.cw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.cw-dept {
    display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; min-inline-size: 0;
    background: var(--lm-d-surface); border: 1px solid var(--lm-d-border); border-block-start: 3px solid var(--lm-d-control-edge); border-radius: 12px;
    color: var(--lm-d-ink);
}
.cw-dept.is-danger { border-block-start-color: var(--lm-d-danger); }
.cw-dept.is-warn { border-block-start-color: var(--lm-d-warn); }
.cw-dept.is-ok { border-block-start-color: var(--lm-d-ok); }
.cw-dept-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.cw-dept-n { min-inline-size: 0; }
.cw-dept-t { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.4; color: var(--lm-d-ink); }
.cw-dept-p { font-size: 12px; color: var(--lm-d-muted); }
.cw-tag { flex: none; padding: 1px 10px; border: 1px solid transparent; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.cw-tag.is-danger { border-color: var(--lm-d-danger); color: var(--lm-d-danger); }
.cw-tag.is-warn { background: var(--lm-d-warn-soft); color: var(--lm-d-warn); }
.cw-tag.is-ok { background: var(--lm-d-ok-soft); color: var(--lm-d-ok); }
.cw-tag.is-quiet { background: var(--lm-d-quiet-bg); color: var(--lm-d-muted); }

.cw-trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cw-fig { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 6px; background: var(--lm-d-page); border-radius: 10px; min-inline-size: 0; }
.cw-fig .cw-na { align-self: center; }
.cw-fig-v { font-size: 20px; font-weight: 700; line-height: 1.35; color: var(--lm-d-ink); }
.cw-fig-v.is-danger { color: var(--lm-d-danger); }
.cw-fig-v.is-warn { color: var(--lm-d-warn); }
.cw-fig-l { font-size: 12px; color: var(--lm-d-muted); }
.cw-more { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--lm-d-muted); }

.cw-trend { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; padding-block-start: 10px; border-block-start: 1px solid var(--lm-d-divider); }
.cw-trend-l { display: flex; flex-direction: column; gap: 2px; min-inline-size: 0; }
.cw-trend-t { font-size: 12px; color: var(--lm-d-muted); }
.cw-trend-d { font-size: 13px; font-weight: 700; }
.cw-bars { display: flex; align-items: flex-end; gap: 3px; inline-size: 96px; block-size: 32px; flex: none; }
.cw-bar { flex: 1 1 0; min-block-size: 3px; border-radius: 3px 3px 0 0; background: var(--lm-d-control-edge); }
.cw-bar.is-last { background: var(--lm-d-danger); }
.cw-bar.is-missing { block-size: 3px; background: var(--lm-d-divider); }

/* ── the six core sections ── */
.cw .is-ink { color: var(--lm-d-ink); }
.cw-card--plain { border-block-start-width: 1px; border-block-start-color: var(--lm-d-border); }
.cw-card-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cw-btn--sm { min-block-size: 36px; padding-inline: 12px; font-size: 13px; }
.cw-secs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.cw-sec { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; min-inline-size: 0; background: var(--lm-d-page); border: 1px solid var(--lm-d-divider); border-radius: 12px; }
.cw-sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.cw-sec-t { margin: 0; font-size: 17px; font-weight: 700; color: var(--lm-d-ink); }
.cw-sec-open { flex: none; font-size: 13px; font-weight: 600; color: var(--lm-d-info); }
.cw-sec-open:hover { text-decoration: underline; }
.cw-rows { display: flex; flex-direction: column; margin: 0; }
.cw-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-block: 6px; border-block-start: 1px solid var(--lm-d-divider); }
.cw-row:first-child { border-block-start: 0; }
.cw-row-l { min-inline-size: 0; font-size: 14px; color: var(--lm-d-ink); }
.cw-row-l a:hover { text-decoration: underline; }
.cw-row-v { flex: none; margin: 0; font-size: 16px; font-weight: 700; }

/* ── the money blocks (each shown only with its owner's permission) ── */
.cw-card--money { border-block-start-color: var(--lm-d-ok); }
.cw-row-v { display: inline-flex; align-items: baseline; gap: 8px; }
.cw-row-n { padding-inline: 8px; border-radius: 999px; background: var(--lm-d-quiet-bg); font-size: 12px; font-weight: 700; color: var(--lm-d-muted); }

/* ── tabs + the live dashboard ── */
.cw-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; align-self: flex-start; background: var(--lm-d-quiet-bg); border-radius: 12px; }
.cw-tab { display: inline-flex; align-items: center; gap: 8px; min-block-size: 44px; padding-inline: 20px; border: 0; border-radius: 9px; background: transparent; font-size: 15px; font-weight: 700; color: var(--lm-d-muted); }
.cw-tab.is-on { background: var(--lm-d-tab-on-bg); color: var(--lm-d-tab-on-ink); }
.cw-live-dot { inline-size: 9px; block-size: 9px; border-radius: 50%; background: var(--lm-d-ok); flex: none; }
.cw-live { display: flex; flex-direction: column; gap: 14px; }
.cw-livebar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; background: var(--lm-d-surface); border: 1px solid var(--lm-d-border); border-radius: 12px; }
.cw-livebar-main { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.cw-live-state { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--lm-d-muted); }
.cw-live-state .cw-live-dot { background: var(--lm-d-control-edge); }
.cw-live-state.is-on { color: var(--lm-d-ok); }
.cw-live-state.is-on .cw-live-dot { background: var(--lm-d-ok); animation: cw-pulse 1.8s ease-in-out infinite; }
@keyframes cw-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.cw-counters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.cw-counter { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; background: var(--lm-d-surface); border: 1px solid var(--lm-d-border); border-block-start: 3px solid var(--lm-d-info); border-radius: 12px; min-inline-size: 0; }
.cw-live-cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 14px; align-items: start; }
.cw-hubs { display: flex; flex-direction: column; }
.cw-hub { display: flex; flex-direction: column; gap: 6px; padding-block: 12px; border-block-start: 1px solid var(--lm-d-divider); }
.cw-hub:first-child { border-block-start: 0; padding-block-start: 0; }
.cw-hub-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.cw-hub-t { margin: 0; font-size: 16px; font-weight: 700; color: var(--lm-d-ink); }
.cw-hub-t a:hover { text-decoration: underline; }
.cw-hub-v { font-size: 20px; font-weight: 700; color: var(--lm-d-ink); }
.cw-hub-of { font-size: 13px; font-weight: 500; color: var(--lm-d-muted); }
.cw-track { block-size: 8px; background: var(--lm-d-quiet-bg); border-radius: 999px; overflow: hidden; }
.cw-track-fill { display: block; block-size: 100%; border-radius: 999px; background: var(--lm-d-info); transition: inline-size 0.5s ease; }
.cw-track-fill.is-ok { background: var(--lm-d-ok); }
.cw-track-fill.is-warn { background: var(--lm-d-warn); }
.cw-feed { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.cw-ev { display: flex; align-items: center; gap: 10px; padding-block: 8px; border-block-start: 1px solid var(--lm-d-divider); }
.cw-ev:first-child { border-block-start: 0; }
.cw-ev-dot { inline-size: 9px; block-size: 9px; border-radius: 50%; background: var(--lm-d-dot); flex: none; }
.cw-ev-dot.is-ok { background: var(--lm-d-ok); }
.cw-ev-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; min-inline-size: 0; flex: 1 1 auto; font-size: 14px; }
.cw-ev-hub { font-weight: 700; color: var(--lm-d-ink); }
.cw-ev-what { color: var(--lm-d-ink); }
.cw-ev-out { color: var(--lm-d-muted); }
.cw-ev-n { flex: none; padding-inline: 8px; border-radius: 999px; background: var(--lm-d-quiet-bg); font-size: 13px; font-weight: 700; color: var(--lm-d-ink); }
.cw-ev-when { flex: none; font-size: 12px; color: var(--lm-d-muted); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .cw-live-state.is-on .cw-live-dot { animation: none; } .cw-track-fill { transition: none; } }

/* ── the five cards across the top ── */
.cw-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.cw-kpi {
    display: flex; flex-direction: column; gap: 6px; padding: 12px 16px; min-inline-size: 0;
    background: var(--lm-d-surface); border: 1px solid var(--lm-d-border); border-block-start: 3px solid var(--lm-d-control-edge); border-radius: 12px;
    transition: transform .18s ease, box-shadow .18s ease;
}
.cw-kpi:hover { transform: translateY(-3px); box-shadow: 0 10px 24px var(--lm-d-shadow); }
.cw-kpi.is-info { border-block-start-color: var(--lm-d-info); }
.cw-kpi.is-danger { border-block-start-color: var(--lm-d-danger); }
.cw-kpi.is-warn { border-block-start-color: var(--lm-d-warn); }
.cw-kpi.is-ai { border-block-start-color: var(--lm-d-ai); }
.cw-kpi.is-ok { border-block-start-color: var(--lm-d-ok); }
.cw-kpi-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cw-kpi-l { font-size: 13px; font-weight: 600; color: var(--lm-d-muted); }
.cw-kpi-d { padding-inline: 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.cw-kpi-d.is-good { background: var(--lm-d-ok-soft); color: var(--lm-d-ok); }
.cw-kpi-d.is-bad { background: var(--lm-d-danger-soft); color: var(--lm-d-danger); }
.cw-kpi-d.is-same { background: var(--lm-d-quiet-bg); color: var(--lm-d-muted); }
.cw-kpi-v { font-size: 26px; font-weight: 700; line-height: 1.3; }
.cw-kpi.is-info .cw-kpi-v { color: var(--lm-d-info); }
.cw-kpi.is-danger .cw-kpi-v { color: var(--lm-d-danger); }
.cw-kpi.is-warn .cw-kpi-v { color: var(--lm-d-warn); }
.cw-kpi.is-ai .cw-kpi-v { color: var(--lm-d-ai); }
.cw-kpi.is-ok .cw-kpi-v { color: var(--lm-d-ok); }
.cw-kpi-u { font-size: 13px; font-weight: 500; color: var(--lm-d-muted); }
.cw-kpi-s { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--lm-d-muted); }
.cw-kpi-w { font-style: normal; }
.cw-spark { display: flex; align-items: flex-end; gap: 3px; block-size: 28px; }
.cw-spark-c { flex: 1 1 0; min-block-size: 3px; border-radius: 3px 3px 0 0; background: currentColor; opacity: .45; }
.cw-spark-c.is-last { opacity: 1; }
.cw-spark-c.is-missing { block-size: 3px; background: var(--lm-d-divider); opacity: 1; }
.cw-kpi.is-info .cw-spark { color: var(--lm-d-info); }
.cw-kpi.is-danger .cw-spark { color: var(--lm-d-danger); }
.cw-kpi.is-warn .cw-spark { color: var(--lm-d-warn); }

/* ── the wide section cards ── */
.cw-rich { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.cw-rich-c { gap: 14px; }
.cw-rich-c.tone-info { border-block-start-color: var(--lm-d-info); }
.cw-rich-c.tone-ai { border-block-start-color: var(--lm-d-ai); }
.cw-rich-c .cw-card-t { font-size: 22px; }
.cw-card-when { font-size: 14px; font-weight: 500; color: var(--lm-d-muted); }
.cw-rich-top { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.cw-rich-t { margin-block-end: 6px; font-size: 13px; font-weight: 600; color: var(--lm-d-ink); }
.cw-rich-th { display: flex; justify-content: space-between; gap: 8px; }
.cw-donut {
    flex: none; display: flex; align-items: center; justify-content: center; inline-size: 90px; block-size: 90px; border-radius: 50%;
    background: conic-gradient(currentColor calc(var(--p) * 1%), var(--lm-d-divider) 0);
}
.cw-donut.is-info { color: var(--lm-d-info); }
.cw-donut.is-ok { color: var(--lm-d-ok); }
.cw-donut-in { display: flex; flex-direction: column; align-items: center; justify-content: center; inline-size: 70px; block-size: 70px; border-radius: 50%; background: var(--lm-d-surface); }
.cw-donut-n { font-size: 18px; font-weight: 700; line-height: 1.1; color: var(--lm-d-ink); }
.cw-donut-l { font-size: 12px; color: var(--lm-d-muted); }
.cw-keylist { flex: 1 1 180px; display: flex; flex-direction: column; gap: 5px; min-inline-size: 0; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--lm-d-ink); }
.cw-keylist li { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cw-keylist-l { display: inline-flex; align-items: center; gap: 8px; min-inline-size: 0; }
.cw-keylist b { font-weight: 700; }
.cw-sq { display: inline-block; inline-size: 10px; block-size: 10px; border-radius: 3px; flex: none; background: var(--lm-d-control-edge); }
.cw-sq.is-ok { background: var(--lm-d-ok); }
.cw-sq.is-warn { background: var(--lm-d-warn); }
.cw-sq.is-info { background: var(--lm-d-info); }
.cw-sq.is-danger { background: var(--lm-d-danger); }
.cw-sq.is-accent { background: var(--lm-d-accent); }
.cw-sq.is-quiet { background: var(--lm-d-control-edge); }
.cw-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; }
.cw-tile { display: flex; flex-direction: column; min-inline-size: 0; padding: 6px 10px; border: 1px solid transparent; border-radius: 10px; background: var(--lm-d-quiet-bg); color: var(--lm-d-muted); }
.cw-tile.is-ok { background: var(--lm-d-ok-soft); color: var(--lm-d-ok); }
.cw-tile.is-warn { background: var(--lm-d-warn-soft); border-color: var(--lm-d-warn); color: var(--lm-d-warn); }
.cw-tile.is-info { background: var(--lm-d-info-soft); color: var(--lm-d-info); }
.cw-tile.is-outline { background: var(--lm-d-surface); border-color: var(--lm-d-danger); color: var(--lm-d-danger); }
.cw-tile-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 700; }
.cw-tile-s { font-size: 12px; }
.cw-week { display: flex; align-items: flex-end; gap: 8px; block-size: 84px; }
.cw-week-d { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; min-inline-size: 0; block-size: 100%; }
.cw-week-b { display: flex; align-items: flex-end; justify-content: center; gap: 3px; inline-size: 100%; flex: 1 1 auto; }
.cw-week-c { inline-size: 40%; max-inline-size: 18px; min-block-size: 2px; border-radius: 4px 4px 0 0; background: var(--lm-d-info); }
.cw-week-c.is-ok { background: var(--lm-d-ok); }
.cw-week-l { font-size: 12px; color: var(--lm-d-muted); }
.cw-boxes { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.cw-box { display: flex; flex-direction: column; gap: 2px; min-inline-size: 0; padding: 8px 12px; border-radius: 10px; background: var(--lm-d-page); color: var(--lm-d-ink); text-decoration: none; }
.cw-box.is-warn { background: var(--lm-d-warn-soft); }
.cw-box.is-danger { background: var(--lm-d-danger-soft); }
.cw-box.is-ok { background: var(--lm-d-ok-soft); }
.cw-box-v { font-size: 24px; font-weight: 700; line-height: 1.3; }
.cw-box.is-warn .cw-box-v { color: var(--lm-d-warn); }
.cw-box.is-danger .cw-box-v { color: var(--lm-d-danger); }
.cw-box.is-ok .cw-box-v { color: var(--lm-d-ok); }
.cw-box-l { font-size: 12px; color: var(--lm-d-muted); }
.cw-stack { display: flex; block-size: 18px; border-radius: 6px; overflow: hidden; background: var(--lm-d-divider); }
.cw-stack-p { display: block; block-size: 100%; background: var(--lm-d-control-edge); }
.cw-stack-p.is-ok { background: var(--lm-d-ok); }
.cw-stack-p.is-warn { background: var(--lm-d-warn); }
.cw-stack-p.is-accent { background: var(--lm-d-accent); }
.cw-stack-p.is-danger { background: var(--lm-d-danger); }
.cw-stack-k { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--lm-d-ink); }
.cw-stack-k li { display: inline-flex; align-items: center; gap: 6px; }
.cw-sechead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.cw-rich--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cw-rich-c.tone-danger { border-block-start-color: var(--lm-d-danger); }
.cw-rich-c.tone-warn { border-block-start-color: var(--lm-d-warn); }
.cw-rich-c.tone-accent { border-block-start-color: var(--lm-d-accent); }
.cw-box.is-info { background: var(--lm-d-info-soft); }
.cw-box.is-info .cw-box-v { color: var(--lm-d-info); }
.cw-stages { display: flex; flex-direction: column; gap: 8px; }
.cw-stage { display: block; padding: 8px 12px; border-radius: 10px; background: var(--lm-d-page); color: var(--lm-d-ink); text-decoration: none; }
.cw-stage-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.cw-stage-l { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.cw-stage-n { display: inline-flex; align-items: center; justify-content: center; inline-size: 22px; block-size: 22px; border-radius: 50%; font-size: 12px; color: var(--lm-d-on-accent); background: var(--lm-d-info); }
.cw-stage-n.is-accent { background: var(--lm-d-accent); }
.cw-stage-n.is-ok { background: var(--lm-d-ok); }
.cw-stage-v { font-size: 18px; font-weight: 700; }
.cw-stage-track { display: block; block-size: 8px; margin-block-start: 4px; border-radius: 999px; background: var(--lm-d-divider); overflow: hidden; }
.cw-stage-fill { display: block; block-size: 100%; border-radius: 999px; background: var(--lm-d-info); }
.cw-stage-fill.is-ai { background: var(--lm-d-ai); }
.cw-stage-fill.is-ok { background: var(--lm-d-ok); }
.cw-stage-fill.is-accent { background: var(--lm-d-accent); }
.cw-stack-p.is-ai, .cw-sq.is-ai { background: var(--lm-d-ai); }
.cw-stack-k a { color: inherit; }
.cw-rich-c.tone-ok { border-block-start-color: var(--lm-d-ok); }
.cw-boxes--money { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.cw-box-v--money { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; font-size: 20px; }
@media (min-width: 1024px) { .cw-rich--3 > :last-child:nth-child(3n + 1) { grid-column: 1 / -1; } }
.cw a.cw-stage, .cw a.cw-box { color: var(--lm-d-ink); text-decoration: none; }
.cw a.cw-stage:hover, .cw a.cw-box:hover { filter: brightness(.97); }
@media (prefers-reduced-motion: reduce) { .cw-kpi { transition: none; } .cw-kpi:hover { transform: none; } }

/* ── waiting on a decision ── */
.cw-card--decide { border-block-start-color: var(--lm-d-danger); }
.cw-decide { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.cw-decide-i { display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-inline-size: 0; background: var(--lm-d-page); border: 1px solid var(--lm-d-divider); border-radius: 12px; }
.cw-decide-n { flex: none; min-inline-size: 44px; font-size: 26px; font-weight: 800; line-height: 1.1; text-align: center; color: var(--lm-d-danger); }
.cw-decide-l { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-inline-size: 0; font-size: 15px; font-weight: 600; color: var(--lm-d-ink); }
.cw-decide-s { font-size: 13px; font-weight: 600; color: var(--lm-d-muted); }

/* ── the two small charts ── */
.cw-glance { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 24px; align-items: start; }
.cw-ring-box, .cw-share-box { margin: 0; min-inline-size: 0; }
.cw-glance-t { margin-block-end: 10px; font-size: 15px; font-weight: 700; color: var(--lm-d-ink); }
.cw-ring-row { display: flex; align-items: center; gap: 18px; }
.cw-ring { inline-size: 132px; block-size: 132px; flex: none; }
.cw-ring-base, .cw-ring-arc { fill: none; stroke-width: 5; }
.cw-ring-base { stroke: var(--lm-d-divider); }
.cw-ring-arc { stroke: var(--lm-d-dot); }
.cw-ring-arc.is-danger { stroke: var(--lm-d-danger); }
.cw-ring-arc.is-warn { stroke: var(--lm-d-warn); }
.cw-ring-arc.is-ok { stroke: var(--lm-d-ok); }
.cw-ring-arc.is-quiet { stroke: var(--lm-d-control-edge); }
.cw-ring-n { font-size: 12px; font-weight: 800; fill: var(--lm-d-ink); }
.cw-legend { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 14px; color: var(--lm-d-ink); }
.cw-legend li { display: flex; align-items: center; gap: 8px; }
.cw-legend b { font-weight: 700; }
.cw-dot { inline-size: 10px; block-size: 10px; border-radius: 50%; flex: none; background: var(--lm-d-dot); }
.cw-dot.is-danger { background: var(--lm-d-danger); }
.cw-dot.is-warn { background: var(--lm-d-warn); }
.cw-dot.is-ok { background: var(--lm-d-ok); }
.cw-dot.is-quiet { background: var(--lm-d-control-edge); }
.cw-share { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.cw-share-i { display: grid; grid-template-columns: minmax(0, 9em) minmax(0, 1fr) 3.5em 7em; align-items: center; gap: 10px; font-size: 14px; }
.cw-share-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--lm-d-ink); }
.cw-share-track { display: block; block-size: 10px; border-radius: 999px; background: var(--lm-d-divider); overflow: hidden; }
.cw-share-fill { display: block; block-size: 100%; border-radius: 999px; background: var(--lm-d-danger); }
.cw-share-v { font-weight: 700; color: var(--lm-d-ink); text-align: end; }
.cw-share-s { font-size: 13px; color: var(--lm-d-muted); text-align: end; }

/* ── narrow screens ── */
@media (max-width: 1023px) {
    .cw-glance { grid-template-columns: minmax(0, 1fr); }
    .cw-rich { grid-template-columns: minmax(0, 1fr); }
    .cw-rich--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cw-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cw-live-cols { grid-template-columns: minmax(0, 1fr); }
    .cw-secs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cw-strip-c:nth-child(odd) { border-inline-start: 0; }
    .cw-strip-c:nth-child(n + 3) { border-block-start: 1px solid var(--lm-d-divider); }
}
@media (max-width: 640px) {
    .cw-title { font-size: 24px; }
    .cw-pill, .cw-chip, .cw-btn--sm { min-block-size: 44px; }
    .cw-secs { grid-template-columns: minmax(0, 1fr); }
    .cw-rich--3 { grid-template-columns: minmax(0, 1fr); }
    .cw-decide { grid-template-columns: minmax(0, 1fr); }
    .cw-share-i { grid-template-columns: minmax(0, 1fr) 3.5em; }
    .cw-share-track { grid-column: 1 / -1; grid-row: 2; }
    .cw-share-s { display: none; }
    .cw-grid { grid-template-columns: minmax(0, 1fr); }
}

/* OWNER-DAILY-1: the daily report's money row — one card per figure, bars for the week where the owner answers by day */
.cw-mcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
@media (min-width: 1400px) { .cw-mcards { grid-template-columns: repeat(var(--cw-mcard-cols, 6), minmax(0, 1fr)); } }
.cw-mcard { min-inline-size: 0; box-sizing: border-box; display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; background: var(--lm-d-surface); border: 1px solid var(--lm-d-border); border-block-start: 3px solid var(--cw-mcard-tone); border-radius: 12px; color: var(--lm-d-ink); text-decoration: none; --cw-mcard-tone: var(--lm-d-ok); }
.cw-mcard.tone-info { --cw-mcard-tone: var(--lm-d-info); }
.cw-mcard.tone-warn { --cw-mcard-tone: var(--lm-d-warn); }
.cw-mcard.tone-ai { --cw-mcard-tone: var(--lm-d-ai); }
.cw-mcard.tone-danger { --cw-mcard-tone: var(--lm-d-danger); }
.cw a.cw-mcard:hover { filter: brightness(.97); }
.cw-mcard-l { font-size: 13px; font-weight: 600; color: var(--lm-d-muted); }
.cw-mcard-v { font-size: 22px; font-weight: 700; line-height: 1.4; color: var(--cw-mcard-tone); }
.cw-mcard-b { display: flex; align-items: flex-end; gap: 3px; block-size: 26px; }
.cw-mcard-c { flex: 1 1 0; min-block-size: 3px; border-radius: 3px 3px 0 0; background: var(--cw-mcard-tone); opacity: .4; }
.cw-mcard-c.is-on { opacity: 1; }
.cw-mcard-s { font-size: 12px; color: var(--lm-d-muted); margin-block-start: auto; }

/* «تقرير المالك اليومي»: «الوارد والصادر» — seven days, two bars a day, the picked day's figures above */
.cw-flow { border-block-start: 3px solid var(--lm-d-ok); display: flex; flex-direction: column; gap: 10px; }
.cw-flow-w { font-size: 14px; font-weight: 500; color: var(--lm-d-muted); }
.cw-flow-k { display: inline-flex; gap: 12px; font-size: 13px; color: var(--lm-d-muted); }
.cw-flow-dot { display: inline-block; inline-size: 10px; block-size: 10px; border-radius: 3px; }
.cw-flow-dot.is-in, .cw-flow-bar.is-in { background: var(--lm-d-ok); }
.cw-flow-dot.is-out, .cw-flow-bar.is-out { background: var(--lm-d-ai); }
.cw-flow-tiles { display: none; flex-wrap: wrap; align-items: stretch; gap: 8px; }
.cw-flow-tiles.is-on { display: flex; }
.cw-flow-day { flex: 1 1 100%; font-size: 13px; font-weight: 600; color: var(--lm-d-muted); }
.cw-flow-tile { flex: 1 1 110px; min-inline-size: 0; display: flex; flex-direction: column; gap: 2px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--lm-d-border); color: var(--lm-d-ink); text-decoration: none; }
.cw-flow-tile.is-in { background: var(--lm-d-ok-soft); border-color: transparent; }
.cw-flow-tile.is-out { background: var(--lm-d-ai-bg); border-color: transparent; }
.cw-flow-l { font-size: 12px; color: var(--lm-d-muted); }
.cw-flow-v { font-size: 18px; font-weight: 700; }
.cw-flow-tile.is-in .cw-flow-v, .cw-flow-v.is-up { color: var(--lm-d-ok); }
.cw-flow-tile.is-out .cw-flow-v { color: var(--lm-d-ai); }
.cw-flow-v.is-down { color: var(--lm-d-danger); }
.cw-flow-bars { display: flex; align-items: stretch; gap: 8px; block-size: 150px; }
.cw-flow-col { flex: 1 1 0; min-inline-size: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; padding: 4px 0 2px; border: 0; border-radius: 8px; background: transparent; font: inherit; color: var(--lm-d-muted); cursor: pointer; }
.cw-flow-col.is-on { background: var(--lm-d-info-soft); color: var(--lm-d-ink); font-weight: 700; }
.cw-flow-col:focus-visible { outline: 2px solid var(--lm-d-info); outline-offset: 2px; }
.cw-flow-pair { flex: 1 1 auto; inline-size: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.cw-flow-bar { display: block; inline-size: 42%; max-inline-size: 22px; min-block-size: 3px; border-radius: 5px 5px 0 0; opacity: .7; }
.cw-flow-col.is-on .cw-flow-bar { opacity: 1; }
.cw-flow-d { font-size: 12px; }
