/* Team Workspace (prefix tm-) — the FAHEEM Hub concept S1–S4 on the brand v3.1 tokens (theme.css):
   surface cards on the canvas, hairlines, small dotted chips, codes and money in tabular mono.
   Colour comes only from semantic tokens, so every rule works in light and in dark (Deep Emerald).
   Never red: unfavourable = clay (--unfav*), attention = --attn*. Logical properties only (RTL ↔ LTR).
   Brand 05.2: icons are never placed inside a coloured tile or circle. */

/* ---------------------------------------------------------------- base bits */
.surface-team { --tm-mono: var(--font-fig); } /* legacy name, kept for other files */
.tm-i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.tm-i.sm { width: 14px; height: 14px; }
.nav-ic .tm-i { display: block; margin: auto; }
/* mixed figures + words («3 س 10 د», «10:30 ص»): figure font, but the text keeps its own direction */
.tm-mono { font-family: var(--font-fig); font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; unicode-bidi: plaintext; }
.tm-ltr { direction: ltr; unicode-bidi: isolate; }
.tm-ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tm-row { display: flex; align-items: center; gap: 8px; }
.tm-row.between { justify-content: space-between; }
.tm-row .grow { flex: 1; }
.tm-col { display: flex; flex-direction: column; gap: 12px; }
.tm-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; font-size: 12px; }
.tm-meta.wrap { gap: 8px; }
.tm-pad { padding: 12px 16px; margin: 0; }
.tm-sep { height: 1px; background: var(--line); margin: 4px 0; }
.tm-ul { margin: 0; padding-inline-start: 24px; display: flex; flex-direction: column; gap: 4px; }
.tm-page .page-in { max-width: 1480px; }
.tm-page .page-h h1 { font-size: 22px; font-weight: 800; color: var(--heading); }
.tm-page .page-h .chans { align-items: center; }
.input.sm { min-height: 36px; padding: 4px 12px; font-size: 13px; }

/* brand line icons in headers and KPI labels: plain, heading colour */
.tm-h3 { display: inline-flex; align-items: center; gap: 8px; }
.tm-h3 .bi, .tm-kpi .k .bi, .tm-kcol-h .bi { color: var(--heading); }

/* cards */
.tm-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); min-width: 0; display: flex; flex-direction: column; }
.tm-card-h { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.tm-card-h .grow { display: flex; flex-direction: column; min-width: 0; }
.tm-card-h h3 { margin: 0; font-size: 15px; font-weight: 800; line-height: 1.4; color: var(--heading); }
.tm-card-f { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); margin-top: auto; }
.tm-card-f.flat { border-top: 0; padding: 4px 0 0; }
.tm-cnt { font: 700 11px/1 var(--font-fig); padding: 4px 8px; border-radius: var(--r-pill); background: var(--surface-3); color: var(--muted); }
.tm-cnt.crit { background: var(--unfav-soft); color: var(--unfav-strong); }
.tm-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.tm-toolbar { display: flex; gap: 12px; flex-wrap: wrap; }
.tm-toolbar .input { flex: 1; min-width: 200px; }

/* chips, tags, dots, avatars */
.tm-chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--r-pill); font-size: 11.5px; font-weight: 700; white-space: nowrap; background: var(--surface-3); color: var(--muted); }
.tm-chip::before { content: ""; width: 6px; height: 6px; border-radius: var(--r-pill); background: currentColor; flex: none; }
.tm-chip.plain::before { display: none; }
.tm-chip.ok { background: var(--accent-soft); color: var(--accent-text); }
.tm-chip.warn { background: var(--attn-soft); color: var(--attn); }
.tm-chip.crit { background: var(--unfav-soft); color: var(--unfav-strong); }
.tm-chip.info { background: var(--info-soft); color: var(--info); }
.tm-chip.champ { background: var(--attn-soft); color: var(--attn); }
.tm-chip.muted { background: var(--surface-3); color: var(--muted); }
.tm-tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: var(--r-1); font: 500 11px/1 var(--font-fig); background: var(--surface-3); color: var(--muted); white-space: nowrap; unicode-bidi: plaintext; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.tm-tag.ar { font-family: var(--font); font-size: 11.5px; font-weight: 700; }
.tm-tag.dark { background: var(--brand-bg-3); color: var(--on-brand-2); font-family: var(--font); font-size: 11.5px; }
.tm-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.tm-dot::before { content: ""; width: 7px; height: 7px; border-radius: var(--r-pill); background: currentColor; }
.tm-dot.crit { color: var(--unfav); } .tm-dot.warn { color: var(--attn); } .tm-dot.muted { color: var(--muted-2); } .tm-dot.ok { color: var(--accent-text); }
/* avatars: initials on soft brand fills (readable in both themes) */
.tm-av { width: 32px; height: 32px; border-radius: var(--r-pill); display: inline-grid; place-items: center; font-weight: 800; font-size: 12px; flex: none; background: var(--surface-3); color: var(--heading); }
.tm-av.sm { width: 24px; height: 24px; font-size: 10.5px; }
.tm-av.xl { width: 60px; height: 60px; font-size: 22px; }
.tm-av.c1 { background: var(--accent-soft); color: var(--accent-text); }
.tm-av.c2 { background: var(--unfav-soft); color: var(--unfav-strong); }
.tm-av.c3 { background: var(--info-soft); color: var(--info); }
.tm-av.c4 { background: var(--attn-soft); color: var(--attn); }
.tm-av.c5 { background: var(--surface-3); color: var(--heading); }
.tm-av.c6 { background: var(--brand-bg-3); color: var(--on-brand); }
.tm-stack { display: flex; }
.tm-stack .tm-av { border: 2px solid var(--surface); }
.tm-stack .tm-av + .tm-av { margin-inline-start: -8px; }
/* a channel / file / device glyph: a plain icon, no tile */
.tm-chic { width: 24px; min-height: 24px; display: grid; place-items: center; color: var(--muted); flex: none; font-size: 12px; }
.tm-chic.sm { width: 20px; min-height: 20px; }
.tm-chic.num { width: auto; min-width: 24px; font-weight: 700; color: var(--heading); }
.tm-ib { width: 36px; height: 36px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: var(--r-1); display: grid; place-items: center; cursor: pointer; }
.tm-ib.sm { width: 32px; height: 32px; border-color: transparent; background: transparent; }
.tm-ib:hover { color: var(--text); border-color: var(--muted-2); }
.late-tx { color: var(--unfav); font-weight: 700; }
.tm-big { font: 600 22px/1.1 var(--font-fig); color: var(--heading); }
.tm-huge { font: 600 44px/1 var(--font-fig); color: var(--heading); }

/* segmented control + filters */
.tm-seg { display: inline-flex; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-1); gap: 2px; flex-wrap: wrap; }
.tm-seg button { border: 0; background: none; min-height: 36px; padding: 0 12px; border-radius: var(--r-1); font: 700 12.5px var(--font); color: var(--muted); cursor: pointer; white-space: nowrap; }
.tm-seg button:hover { color: var(--text); }
.tm-seg button.on { background: var(--surface); color: var(--heading); box-shadow: 0 0 0 1px var(--line); }
.tm-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tm-filters .input { width: 200px; }
.tm-filter { display: inline-flex; align-items: center; gap: 6px; height: var(--control-h); padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-1); background: var(--surface); font-size: 13px; color: var(--muted); }
.tm-filter select { border: 0; background: none; font: inherit; font-weight: 700; color: var(--text); max-width: 180px; cursor: pointer; }
.tm-filter select option { background: var(--surface); color: var(--text); }
.tm-filter.lbl { border-style: dashed; }
.tm-keys kbd { font: 500 11px/1 var(--font-fig); border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: var(--r-1); padding: 3px 6px; }

/* progress */
.tm-prog-wrap { display: flex; align-items: center; gap: 12px; }
.tm-prog { flex: 1; height: 6px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.tm-prog i { display: block; height: 100%; background: var(--accent); border-radius: var(--r-pill); transition: width .3s; }
.tm-prog-wrap .xs { white-space: nowrap; }

/* KPI strip (brand: at most 4 in a row, each with one comparison) */
.tm-kpis { flex-direction: row; flex-wrap: wrap; }
.tm-kpi { flex: 1 1 170px; padding: 16px; display: flex; flex-direction: column; gap: 4px; border-inline-start: 1px solid var(--line); min-width: 0; }
.tm-kpi:first-child { border-inline-start: 0; }
.tm-kpi .k { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); font-weight: 700; }
.tm-kpi .v { font: 600 24px/1.2 var(--font-fig); color: var(--heading); unicode-bidi: plaintext; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-kpi .s { font-size: 12px; color: var(--muted); }
.tm-kpi.crit .v { color: var(--unfav); } .tm-kpi.warn .v { color: var(--attn); } .tm-kpi.ok .v { color: var(--accent-text); }

/* notes */
.tm-note { display: flex; align-items: center; gap: 8px; margin: 12px 16px 0; padding: 8px 12px; border-radius: var(--r-1); background: var(--surface-2); border: 1px solid var(--line); color: var(--text); font-size: 13px; white-space: pre-wrap; }
.tm-note.ok { background: var(--accent-soft); border-color: var(--accent-soft-2); color: var(--heading); }
.tm-note.warn { background: var(--attn-soft); border-color: var(--attn); color: var(--unfav-strong); }
.tm-pad .tm-note { margin: 0; }
.tm-notetx { background: var(--attn-soft); color: var(--text); border-radius: var(--r-1); padding: 4px 8px; white-space: pre-wrap; }

/* ---------------------------------------------------------------- S1 my day */
.tm-home .page-body > .hero { margin-bottom: 0; }
/* chips on the emerald hero band */
.hero .tm-chip { background: var(--brand-rule); color: var(--on-brand); }
.hero .tm-chip.ok::before { background: var(--accent); }
.hero .tm-chip.warn::before, .hero .tm-chip.crit::before { background: var(--champ); }
.tm-shift { display: grid; grid-template-columns: minmax(230px, .8fr) minmax(0, 1.2fr) minmax(330px, 1.3fr); overflow: hidden; }
.tm-shift.solo { display: block; }
.tm-shift > * { padding: 12px 16px; }
.tm-st { display: flex; align-items: center; gap: 12px; border-inline-end: 1px solid var(--line); }
.tm-st .grow { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tm-stic { display: grid; place-items: center; color: var(--accent-text); flex: none; }
.tm-stic .tm-i { width: 24px; height: 24px; }
.tm-l1 { display: flex; align-items: center; gap: 8px; font-size: 13px; min-width: 0; flex-wrap: wrap; }
.tm-l1 b { font-weight: 800; color: var(--heading); }
.tm-line { display: flex; flex-direction: column; justify-content: center; gap: 8px; border-inline-end: 1px solid var(--line); min-width: 0; }
.tm-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); align-items: center; }
.tm-legend b { color: var(--heading); font-size: 12.5px; }
.tm-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tm-legend i { width: 8px; height: 8px; border-radius: var(--r-pill); display: inline-block; }
.tm-legend i.w, .tm-tl i.w { background: var(--accent); }
.tm-legend i.b, .tm-tl i.b { background: var(--chart-4); }
.tm-legend i.r { background: var(--surface-3); border: 1px solid var(--line); }
.tm-tl { position: relative; height: 10px; border-radius: var(--r-pill); background: var(--surface-3); overflow: visible; }
.tm-tl i { position: absolute; top: 0; bottom: 0; display: block; border-radius: var(--r-pill); min-width: 2px; }
.tm-tl i.now { width: 2px; top: -3px; bottom: -3px; background: var(--text); }
.tm-tl-l { display: flex; justify-content: space-between; font: 500 10.5px/1 var(--font-fig); color: var(--muted-2); }
/* the timer: an emerald ground in both themes */
.tm-timer { display: flex; align-items: center; gap: 16px; background: var(--brand-bg); color: var(--on-brand); min-width: 0; }
.tm-shift.solo .tm-timer { border-radius: var(--r-2); }
.tm-timer .grow { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.tm-tlbl { font-size: 11.5px; color: var(--on-brand-3); display: flex; align-items: center; gap: 6px; }
.tm-rec { width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--accent); box-shadow: 0 0 0 4px var(--brand-rule); animation: tm-pulse 1.4s ease-in-out infinite; }
@keyframes tm-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .tm-rec { animation: none; } }
.tm-ttask { font-size: 14px; font-weight: 800; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--on-brand); }
.tm-tsub { font-size: 12px; color: var(--on-brand-2); display: flex; align-items: center; gap: 6px; min-width: 0; }
.tm-clock { font: 600 28px/1 var(--font-fig); letter-spacing: .02em; direction: ltr; white-space: nowrap; color: var(--on-brand); }
.tm-clock.idle { color: var(--on-brand-3); }
.tm-tbtn { width: var(--control-h); height: var(--control-h); border-radius: var(--r-1); display: grid; place-items: center; background: var(--brand-bg-3); color: var(--on-brand); border: 1px solid var(--brand-rule); cursor: pointer; flex: none; }
.tm-tbtn.stop { background: var(--surface); color: var(--unfav-strong); border-color: var(--unfav); }
.tm-tbtn.go { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tm-tbtn.go:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.tm-tbtn.stop:hover { background: var(--unfav-soft); }
.tm-tform { display: flex; gap: 8px; min-width: 0; }
.tm-tform .input { min-height: 36px; padding: 4px 8px; font-size: 13px; background: var(--brand-bg-3); border-color: var(--brand-rule); color: var(--on-brand); min-width: 0; flex: 1; }
.tm-tform .input::placeholder { color: var(--on-brand-3); }
.tm-tform select.input option { background: var(--surface); color: var(--text); }
/* three columns */
.tm-day { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr) minmax(0, .95fr); gap: 16px; align-items: start; }
.tm-colw { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
/* SLA queue */
.tm-q { display: flex; flex-direction: column; }
.tm-qi { display: flex; align-items: center; gap: 12px; padding-block: 8px; padding-inline: 16px 14px; border: 0; border-bottom: 1px solid var(--line-2); background: none; text-align: start; cursor: pointer; width: 100%; color: inherit; font: inherit; min-width: 0; }
.tm-qi:last-child { border-bottom: 0; }
.tm-qi:hover { background: var(--surface-2); }
.tm-qi .grow { display: flex; flex-direction: column; min-width: 0; }
.tm-sev { width: 3px; align-self: stretch; border-radius: var(--r-pill); background: var(--line); flex: none; }
.tm-sev.ok { background: var(--accent); } .tm-sev.warn { background: var(--attn); } .tm-sev.crit { background: var(--unfav); }
.tm-snip { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.tm-qr { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
/* client tiles */
.tm-ctiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; padding: 12px 16px 16px; }
.tm-ctile { border: 1px solid var(--line); border-radius: var(--r-1); padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); color: var(--text); text-decoration: none; transition: border-color .15s, box-shadow .15s; min-width: 0; }
.tm-ctile:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.tm-ctile.lg { padding: 16px; border-radius: var(--r-2); }
.tm-nm { font-size: 14px; font-weight: 800; line-height: 1.35; color: var(--heading); }
.tm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.tm-snip2 { margin: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; white-space: pre-line; }
/* task rows */
.tm-tl-list { display: flex; flex-direction: column; }
.tm-trow { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); min-width: 0; border-inline-start: 3px solid transparent; }
.tm-trow:last-child { border-bottom: 0; }
.tm-trow .grow { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tm-trow .grow > b { font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
.tm-trow.late { border-inline-start-color: var(--unfav); }
.tm-trow.done .grow > b { color: var(--muted); text-decoration: line-through; }
.tm-check { width: 24px; height: 24px; border-radius: var(--r-1); border: 1.5px solid var(--muted-2); background: var(--surface); color: transparent; display: grid; place-items: center; cursor: pointer; flex: none; padding: 0; }
.tm-check .tm-i { width: 14px; height: 14px; stroke-width: 2.5; }
.tm-check:hover { border-color: var(--accent); color: var(--accent-text); }
/* review summary + end-of-day report */
.tm-revsum { display: flex; align-items: center; gap: 16px; padding: 16px; }
.tm-revsum .grow { display: flex; flex-direction: column; gap: 2px; }
.tm-form { display: flex; flex-direction: column; gap: 12px; padding: 12px 16px; }
.tm-form textarea.input { min-height: 0; font-size: 13.5px; }
.tm-eod.nudge { border-color: var(--attn); box-shadow: 0 0 0 3px var(--attn-soft); }

/* ---------------------------------------------------------------- S2 document review */
.tm-review { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr) minmax(300px, 380px); gap: 16px; align-items: start; }
.tm-rq-tools { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); }
.tm-rq-list { display: flex; flex-direction: column; max-height: calc(100vh - 260px); overflow-y: auto; }
.tm-rqi { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line-2); background: none; text-align: start; cursor: pointer; color: inherit; font: inherit; width: 100%; border-inline-start: 3px solid transparent; }
.tm-rqi:hover { background: var(--surface-2); }
.tm-rqi.on { background: var(--accent-soft); border-inline-start-color: var(--accent); }
.tm-rqi .grow { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tm-rqi .grow b { font-size: 13px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* file-type badge: outlined, the kind's colour on the text and rule (no filled tile) */
.tm-docic { width: 36px; height: 42px; border-radius: var(--r-1); display: grid; place-items: center; font: 700 10px/1 var(--font-fig); flex: none; background: var(--surface); border: 1.5px solid currentColor; color: var(--muted); }
.tm-docic.pdf { color: var(--unfav); } .tm-docic.img { color: var(--info); } .tm-docic.xls { color: var(--accent-text); } .tm-docic.doc { color: var(--heading); }
.tm-rp-h { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.tm-rp-h .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tm-docname { font: 600 13px/1.4 var(--font-fig); direction: ltr; text-align: start; word-break: break-all; unicode-bidi: plaintext; color: var(--heading); }
.tm-pipe { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 12px 16px 4px; }
.tm-pipe-s { display: flex; flex-direction: column; gap: 6px; font-size: 11px; color: var(--muted); }
.tm-pipe-s i { height: 4px; border-radius: var(--r-pill); background: var(--line); }
.tm-pipe-s.done i { background: var(--accent); }
.tm-pipe-s.now i { background: var(--accent-soft-2); box-shadow: inset 0 0 0 1px var(--accent); }
.tm-pipe-s.now span { color: var(--accent-text); font-weight: 700; }
.tm-pipe-s.soon span { color: var(--muted-2); }
.tm-viewer { margin: 12px 16px; min-height: 320px; border: 1px dashed var(--line); border-radius: var(--r-1); background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.tm-ph { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 24px; max-width: 420px; }
.tm-ph .tm-docic { width: 54px; height: 64px; font-size: 13px; }
.tm-ph b { font-size: 14px; overflow-wrap: anywhere; color: var(--heading); }
.tm-ph p { margin: 0; }
.tm-img { display: block; max-width: 100%; max-height: 70vh; object-fit: contain; background: var(--surface); }
.tm-drive { display: flex; flex-direction: column; gap: 4px; margin: 0 16px 16px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-1); background: var(--surface-2); }
.tm-path { font: 500 11px/1.5 var(--font-fig); color: var(--muted); direction: ltr; text-align: start; word-break: break-all; }
.tm-path.b { color: var(--text); font-weight: 600; }
.tm-fields { display: flex; flex-direction: column; padding: 4px 16px 0; }
.tm-fr { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.tm-fr > span { color: var(--muted); font-weight: 700; font-size: 12.5px; }
.tm-fr .input { min-height: var(--control-h); padding: 6px 12px; font-size: 13.5px; }
.tm-money { display: grid; grid-template-columns: minmax(0, 1fr) 84px; gap: 8px; }
.tm-rf-act { display: flex; flex-direction: column; gap: 8px; padding: 16px; }
.tm-rf-act .tm-row .btn { flex: 1; padding: 0 12px; font-size: 13px; }
.tm-wide { width: 100%; }

/* ---------------------------------------------------------------- kanban (S3 tasks, S4 sales) */
.tm-kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 16px; align-items: start; overflow-x: auto; padding-bottom: 8px; }
.tm-kanban.sales { grid-auto-columns: minmax(185px, 1fr); gap: 12px; }
.tm-kanban.sales .tm-kcol { padding: 8px; }
.tm-kanban.sales .tm-kcard { padding: 12px; }
.tm-kcol { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-2); padding: 12px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.tm-kcol-h { display: flex; align-items: center; gap: 8px; font-size: 13.5px; padding: 2px 4px; }
.tm-kcol-h b { font-weight: 800; flex: 1; color: var(--heading); }
.tm-kdot { width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--muted-2); flex: none; }
.tm-kdot.info { background: var(--info); } .tm-kdot.ok { background: var(--accent); } .tm-kdot.warn { background: var(--attn); } .tm-kdot.crit { background: var(--unfav); }
.tm-kcount { font: 600 11px/1 var(--font-fig); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 4px 8px; color: var(--muted); }
.tm-ksub { font-size: 12px; color: var(--muted); padding: 0 4px; margin-top: -8px; }
.tm-kbody { display: flex; flex-direction: column; gap: 12px; }
.tm-kempty { text-align: center; padding: 12px 0; margin: 0; }
.tm-kcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-1); padding: 12px; display: flex; flex-direction: column; gap: 8px; border-inline-end: 3px solid transparent; min-width: 0; }
.tm-kcard[data-pri=high] { border-inline-end-color: var(--unfav); }
.tm-kcard[data-pri=medium] { border-inline-end-color: var(--attn); }
.tm-kcard.done { border-inline-end-color: var(--accent); }
.tm-kcard.late { background: color-mix(in srgb, var(--unfav-soft) 45%, var(--surface)); }
.tm-ktitle { font-size: 14px; font-weight: 800; line-height: 1.45; overflow-wrap: anywhere; color: var(--heading); }
.tm-kcard.done .tm-ktitle { color: var(--muted); }
.tm-kdet { margin: 0; font-size: 12.5px; color: var(--muted); background: var(--surface-2); border-radius: var(--r-1); padding: 6px 8px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; white-space: pre-line; }
.tm-kact { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; border-top: 1px solid var(--line-2); padding-top: 8px; }
.tm-kact .btn.sm { min-height: 34px; padding: 0 12px; font-size: 12.5px; }
.tm-kadd { border: 1px dashed var(--muted-2); background: transparent; border-radius: var(--r-1); min-height: var(--control-h); padding: 0 12px; color: var(--muted); font: 700 13px var(--font); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; }
.tm-kadd:hover { color: var(--accent-text); border-color: var(--accent); background: var(--surface); }
.tm-ksum .tm-kcard { gap: 8px; }
.tm-bar-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.tm-bar-row .late-tx { grid-column: 2 / -1; margin-top: -4px; }
.tm-val { display: flex; align-items: baseline; gap: 6px; padding: 8px 12px; border-radius: var(--r-1); background: var(--surface-2); border: 1px solid var(--line-2); }
.tm-val b { font-size: 13.5px; color: var(--heading); }
.tm-lead .tm-ktitle { font-size: 14.5px; }
.tm-late-row td { background: color-mix(in srgb, var(--unfav-soft) 45%, var(--surface)); }

/* ---------------------------------------------------------------- other team screens */
.tm-files { display: flex; flex-direction: column; gap: 12px; padding: 12px 16px; }
.tm-file { display: flex; flex-direction: column; gap: 4px; }
.tm-file .file { max-width: 100%; }
.tm-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; padding: 12px 16px; }
.tm-person-chip { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: var(--r-1); }
.tm-person-chip > div { display: flex; flex-direction: column; min-width: 0; }
.tm-mini { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2px 12px; font-size: 13px; }
.tm-mini li { color: var(--muted); }
.tm-mini li.done { color: var(--accent-text); }
/* close checklist */
.tm-month { width: auto; min-width: 180px; }
.tm-checklist { display: flex; flex-direction: column; }
.tm-ck { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.tm-ck:last-child { border-bottom: 0; }
.tm-ck-main { flex: 1; min-width: 220px; display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.tm-ck-main input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.tm-ck-main .grow { display: flex; flex-direction: column; gap: 2px; }
.tm-ck.done .tm-ck-main b { color: var(--muted); text-decoration: line-through; }
.tm-ck-act { display: flex; gap: 4px; }
/* time: bars start at zero; other days in a brand tint, today in the green */
.tm-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; align-items: end; }
.tm-wd { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tm-wbar { height: 110px; width: 100%; max-width: 40px; background: var(--surface-3); border-radius: var(--r-1); display: flex; align-items: flex-end; overflow: hidden; }
.tm-wbar i { display: block; width: 100%; background: var(--chart-3); }
.tm-wd.today .tm-wbar i { background: var(--accent); }
.tm-wd.today > .xs:not(.muted) { font-weight: 800; color: var(--accent-text); }
.tm-date { width: auto; }
.tm-total td { background: transparent; }
.tm-total .rule-total { padding-bottom: 2px; }
.tm-team { display: flex; flex-direction: column; gap: 12px; }
.tm-person { border: 1px solid var(--line); border-radius: var(--r-1); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.tm-person-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tm-person-h .grow { flex: 1; min-width: 120px; display: flex; flex-direction: column; }
/* T-split (day | week) inside a person card */
.tm-tacct { max-width: 360px; }
.tm-tacct > * { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; }
.tm-tacct b { color: var(--heading); }
.tm-eod-d summary { cursor: pointer; font-weight: 700; font-size: 13px; color: var(--accent-text); }
.tm-eod-d { display: flex; flex-direction: column; gap: 4px; }
.tm-eod-d div { margin-top: 4px; }
/* knowledge base */
.tm-read { padding: 24px; }
.tm-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.9; color: var(--text); }
.tm-editor { min-height: 260px; font-size: 14px; line-height: 1.8; }
/* account */
.tm-me { display: flex; align-items: center; gap: 16px; padding: 16px; border-bottom: 1px solid var(--line); }
.tm-me .grow { display: flex; flex-direction: column; }
.tm-me h2 { margin: 0; font-size: 18px; color: var(--heading); }
.tm-kvs { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; padding: 16px 16px 0; }
.tm-kv { display: flex; flex-direction: column; gap: 2px; padding: 12px; background: var(--surface-2); border-radius: var(--r-1); min-width: 0; }
.tm-kv b { overflow-wrap: anywhere; color: var(--heading); }

/* ---------------------------------------------------------------- exports + documents register */
.tm-xp-end { justify-content: flex-end; }
.tm-toggle { cursor: pointer; color: var(--text); font-weight: 700; }
.tm-toggle input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.tm-reg-notes { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tm-clay { display: inline-block; font-size: 11.5px; line-height: 1.5; padding: 2px 8px; border-radius: var(--r-1); background: var(--unfav-soft); color: var(--unfav-strong); white-space: normal; }
.tm-reg-acct { margin: 0; }
.tm-reg-acct > div { display: flex; flex-direction: column; gap: 6px; padding: 12px 16px; }
.tm-reg-acct-h { font-weight: 800; color: var(--heading); margin-bottom: 2px; }
.tm-reg-acct-t { border-top: 1px solid var(--line-2); padding-top: 6px; }
.tm-reg-acct-t b { color: var(--heading); }
@media (max-width: 760px) {
  .tm-reg-acct.t-acct { grid-template-columns: 1fr; }
  .tm-reg-acct.t-acct > * + * { border-inline-start: 0; border-top: 1px solid var(--line); }
}

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1280px) {
  .tm-day { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
  .tm-day > .tm-colw:last-child { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
  .tm-shift { grid-template-columns: minmax(210px, .8fr) minmax(0, 1.2fr); }
  .tm-shift .tm-timer { grid-column: 1 / -1; }
  .tm-line { border-inline-end: 0; }
  .tm-review { grid-template-columns: minmax(260px, 320px) minmax(0, 1fr); }
  .tm-review .tm-rf { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .tm-split, .tm-day { grid-template-columns: 1fr; }
  .tm-review { grid-template-columns: 1fr; }
  .tm-rq-list { max-height: 300px; }
  .tm-shift { grid-template-columns: 1fr; }
  .tm-st { border-inline-end: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 760px) {
  .tm-page .page-h { align-items: flex-start; }
  .tm-page .page-h h1 { font-size: 19px; }
  .tm-grid { grid-template-columns: 1fr; }
  .tm-kanban, .tm-kanban.sales { grid-auto-columns: minmax(80vw, 1fr); scroll-snap-type: x mandatory; }
  .tm-kcol { scroll-snap-align: start; }
  .tm-kpi { flex-basis: 45%; border-inline-start: 0; border-top: 1px solid var(--line-2); }
  .tm-kpi .v { font-size: 20px; }
  .tm-timer { flex-wrap: wrap; }
  .tm-timer .grow { flex-basis: 100%; }
  .tm-clock { font-size: 24px; flex: 1; }
  .tm-tform { flex-direction: column; }
  .tm-trow, .tm-qi { padding-inline: 12px; }
  .tm-qi .tm-l1 .muted { display: none; }
  .tm-filters .input { width: 100%; }
  .tm-filter select { max-width: 130px; }
  .tm-week { gap: 4px; }
  .tm-wbar { height: 80px; }
  .tm-read { padding: 16px; }
  .tm-ck { padding-inline: 12px; }
  .tm-fr { grid-template-columns: 84px minmax(0, 1fr); }
  .tm-pipe { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tm-keys { display: none; }
}

/* v0.12 — tasks: time on cards, the task detail dialog, "working now" */
.modal .card.wide { max-width: 760px; }
button.tm-ktitle { all: unset; font-weight: 700; color: var(--heading); cursor: pointer; text-align: start; overflow-wrap: anywhere; }
button.tm-ktitle:hover { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
button.tm-ktitle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.tm-ktime { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 12px; }
.tm-ktime-v { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.tm-ktime-v svg { width: 14px; height: 14px; }
.tm-live { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--accent-text); font-size: 12px; font-weight: 700; min-width: 0; max-width: 100%; }
.tm-live .tm-rec { width: 6px; height: 6px; box-shadow: 0 0 0 3px var(--brand-rule); flex: none; }
.tm-live.btnlike { border: 1px solid var(--line); cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; }
.tm-livebox { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.tm-bar-sub { grid-column: 2 / -1; margin-top: -4px; }
.tm-tdet-sec { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.tm-det { white-space: pre-wrap; background: var(--surface-2); border-radius: var(--r-1); padding: 10px 12px; margin: 0; }
.tm-scroll { overflow-x: auto; max-height: 280px; overflow-y: auto; }
.btn.crit-tx { color: var(--unfav-strong); }
.btn.crit-tx:hover { background: var(--unfav-soft); }
.modal .card-b > .row { flex-wrap: wrap; align-items: center; }
.tm-kpi .v .tm-vtxt { font: 700 17px/1.3 var(--font-ar); letter-spacing: 0; }

/* v0.17 — tasks: the board (open work), the archive, attachments on Drive */
.tm-board2 { grid-template-columns: repeat(2, minmax(250px, 1fr)) minmax(240px, .9fr); }
@media (max-width: 900px) { .tm-board2 { grid-template-columns: 1fr; } }
.tm-segn { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-inline-start: 6px; border-radius: var(--r-pill); background: var(--accent-soft, rgba(46, 125, 82, .14)); color: var(--accent-text); font-size: 10.5px; }
.tm-archlink { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); padding: 4px 10px; border-radius: var(--r-pill); border: 1px solid var(--line); }
.tm-archlink:hover { color: var(--heading); border-color: var(--accent); }
.tm-archlink b { color: var(--heading); }
.tm-archbig { all: unset; cursor: pointer; display: block; }
.tm-archbig:hover { color: var(--accent-text); }
.tm-arch-sum { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tm-ell2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 46ch; }
.tm-act { white-space: nowrap; display: flex; gap: 6px; justify-content: flex-end; }
.tm-files { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-size: 12px; }
.tm-files svg { width: 13px; height: 13px; }
.tm-files-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-1); overflow: hidden; }
.tm-frow { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--line); min-width: 0; }
.tm-frow:last-child { border-bottom: 0; }
.tm-frow .grow { display: flex; flex-direction: column; min-width: 0; }
.tm-frow .grow b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-fkind { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); font: 700 9.5px/1 var(--font-fig); color: var(--heading); letter-spacing: .03em; }
.tm-drop { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; padding: 14px; border: 1.5px dashed var(--line); border-radius: var(--r-1); color: var(--muted); font-size: 13px; transition: border-color .2s, background-color .2s; }
.tm-drop.on { border-color: var(--accent); background: var(--accent-soft, rgba(46, 125, 82, .08)); color: var(--heading); }
.tm-drop svg { width: 16px; height: 16px; }
.tm-uploading { font-size: 12.5px; color: var(--accent-text); font-weight: 700; display: flex; align-items: center; gap: 10px; }
.tm-uploading .cx-bar { flex: 1; height: 6px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.tm-uploading .cx-bar i { display: block; height: 100%; background: var(--accent); }
.tm-flink { color: var(--accent-text); }
.tm-tdet-sec .mono { font-size: 11.5px; }
.tm-arch td { white-space: nowrap; } .tm-arch td:first-child { white-space: normal; min-width: 220px; } .tm-arch td:nth-child(2) { white-space: normal; min-width: 140px; }

/* ------------------------------------------------------------------ v0.29 · the task board: four columns, drag & drop (team.js boardDrag) */
.tm-boardwrap { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tm-khint { display: flex; align-items: center; gap: 6px; margin: 0; }
.tm-board4 { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: repeat(4, minmax(230px, 1fr)) minmax(230px, .85fr); overflow-x: auto; }
@media (max-width: 1599px) {
  .tm-board4 { grid-template-columns: repeat(4, minmax(220px, 1fr)); }
  .tm-board4 > .tm-ksum { grid-column: 1 / -1; }
}
.tm-board4 .tm-kcol { min-height: 180px; transition: background .15s, border-color .15s, box-shadow .15s; }
.tm-board4 .tm-kcol.k-review { background: color-mix(in srgb, var(--attn-soft) 40%, var(--surface-2)); }
.tm-board4 .tm-kcol.k-closed { background: color-mix(in srgb, var(--accent-soft) 35%, var(--surface-2)); }
.tm-board4 .tm-kbody { display: flex; flex-direction: column; gap: 10px; min-height: 60px; }
.tm-board4 .tm-kcol.drop { border: 2px dashed var(--accent); background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface-2)); box-shadow: inset 0 0 0 4px color-mix(in srgb, var(--accent) 8%, transparent); }
.tm-board4 .tm-kcard[data-id] { cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.tm-kdot.warn { background: var(--attn); }
.tm-kcard.done .tm-ktitle .ic { color: var(--accent); vertical-align: -2px; }
.tm-kcard.done.lated { border-inline-end-color: var(--unfav); }
.tm-kcard.tm-dragging { opacity: .3; }
.tm-ghost { position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; margin: 0; opacity: .97; cursor: grabbing;
  box-shadow: 0 24px 44px -14px rgba(11, 42, 28, .55), 0 0 0 2px var(--accent); transition: none !important; }
html.tm-dragging-on, html.tm-dragging-on * { cursor: grabbing !important; }
@media (prefers-reduced-motion: no-preference) { .tm-kcard.tm-landed { animation: tm-land .32s cubic-bezier(.22, 1, .36, 1); } }
@keyframes tm-land { from { transform: scale(1.04); box-shadow: 0 0 0 3px var(--accent); } }
@media (max-width: 760px) {
  .tm-kanban.tasks.tm-board4 { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: minmax(84vw, 1fr); overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; }
  .tm-kanban.tasks.tm-board4 > .tm-kcol { scroll-snap-align: start; }
  .tm-kanban.tasks.tm-board4 > .tm-ksum { grid-column: auto; }
}
.tm-kwait { display: flex; align-items: center; gap: 6px; margin: 0; padding-block-start: 6px; border-block-start: 1px solid var(--line); }
