/* CC-MOBILE-1 S1 — «النهارده» on the phone, on the house system (Design System v1.0): every colour is a
   shared --lm-d-* token (0 hex), type ≥ 12px, logical properties (RTL/LTR), one orange primary per area,
   controls ≥ 44px. The page has no sidebar or top bar (layout.base) — it is the phone app's whole screen. */

.mt { box-sizing: border-box; min-block-size: 100dvh; max-inline-size: 560px; margin-inline: auto; padding: 12px 16px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; background: var(--lm-d-page); color: var(--lm-d-ink); }
.mt * { box-sizing: border-box; }
.mt [x-cloak] { display: none !important; }
.mt button, .mt textarea { font: inherit; color: inherit; }
.mt a { color: inherit; text-decoration: none; }
.mt-ico { inline-size: 20px; block-size: 20px; flex: none; }

/* header */
.mt-head { display: flex; align-items: center; gap: 8px; padding-block-start: env(safe-area-inset-top); }
.mt-head-t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.mt-title { margin: 0; font-size: 24px; font-weight: 700; }
.mt-sub { font-size: 13px; color: var(--lm-d-muted); }
.mt-ghost { min-block-size: 44px; min-inline-size: 44px; padding-inline: 12px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--lm-d-control-edge); border-radius: 12px; background: var(--lm-d-surface); font-size: 14px; font-weight: 600; cursor: pointer; }
.mt-ghost.is-icon { padding: 0; font-size: 22px; line-height: 1; }
.mt-ghost.is-small { min-block-size: 44px; font-size: 13px; }
.mt-ghost:disabled { opacity: .6; }

/* the two counts */
.mt-counts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mt-count { display: flex; align-items: baseline; gap: 6px; padding: 10px 14px; border: 1px solid var(--lm-d-border); border-radius: 14px; background: var(--lm-d-surface); font-size: 14px; color: var(--lm-d-muted); }
.mt-count b { font-size: 22px; font-weight: 700; color: var(--lm-d-ink); }
.mt-count.is-late { border-color: var(--lm-d-danger); }
.mt-count.is-late b { color: var(--lm-d-danger); }

/* waiting results and toasts */
.mt-pending, .mt-toast { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; font-size: 14px; }
.mt-pending { background: var(--lm-d-info-soft); border: 1px solid var(--lm-d-info); }
.mt-pending span, .mt-toast span { flex: 1; min-width: 0; }
.mt-undo { min-block-size: 44px; padding-inline: 16px; border: 1px solid var(--lm-d-info); border-radius: 10px; background: var(--lm-d-surface); font-weight: 700; color: var(--lm-d-info); cursor: pointer; }
.mt-toast { background: var(--lm-d-surface); border: 1px solid var(--lm-d-border); cursor: pointer; }
.mt-toast.is-ok { background: var(--lm-d-ok-soft); border-color: var(--lm-d-ok); }
.mt-toast.is-danger { background: var(--lm-d-danger-soft); border-color: var(--lm-d-danger); color: var(--lm-d-danger); }

.mt-empty { padding: 24px 16px; border: 1px dashed var(--lm-d-border); border-radius: 14px; text-align: center; color: var(--lm-d-muted); font-size: 15px; }

/* the lists */
.mt-list { display: flex; flex-direction: column; gap: 8px; }
.mt-list-h { margin: 4px 0 0; display: flex; align-items: baseline; gap: 8px; font-size: 16px; font-weight: 700; }
.mt-list-h.is-late { color: var(--lm-d-danger); }
.mt-list-h small { font-size: 12px; font-weight: 400; color: var(--lm-d-muted); }
.mt-row { display: flex; align-items: stretch; gap: 8px; padding: 8px; border: 1px solid var(--lm-d-border); border-inline-start: 4px solid var(--lm-d-info); border-radius: 14px; background: var(--lm-d-surface); }
.mt-row.is-late { border-inline-start-color: var(--lm-d-danger); }
.mt-row.is-pending { opacity: .55; }
.mt-row-main { flex: 1; min-width: 0; min-block-size: 44px; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 4px 6px; border: 0; background: none; text-align: start; cursor: pointer; }
div.mt-row-main { cursor: default; }
.mt-name { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-meta { font-size: 13px; color: var(--lm-d-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-meta.is-soft { font-size: 12px; }
.mt-row-act { display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.mt-call { min-block-size: 48px; min-inline-size: 72px; padding-inline: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--lm-d-ok); border-radius: 12px; background: var(--lm-d-ok-soft); color: var(--lm-d-ok); font-size: 15px; font-weight: 700; }
.mt-call.is-icon { min-inline-size: 48px; padding: 0; }

/* the result sheet — a bottom sheet over the list */
.mt-scrim { position: fixed; inset: 0; z-index: 40; background: var(--lm-d-overlay); }
.mt-sheet { position: fixed; inset-inline: 0; inset-block-end: 0; z-index: 41; max-inline-size: 560px; max-block-size: 92dvh; margin-inline: auto; display: flex; flex-direction: column; border-radius: 20px 20px 0 0; background: var(--lm-d-surface); box-shadow: var(--lm-d-sheet-shadow); }
.mt-sheet-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px 10px; border-block-end: 1px solid var(--lm-d-divider); }
.mt-sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 12px 16px; display: flex; flex-direction: column; gap: 14px; }
.mt-sheet-foot { display: flex; flex-direction: column; gap: 8px; padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); border-block-start: 1px solid var(--lm-d-divider); background: var(--lm-d-page); }
.mt-note { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--lm-d-info-soft); font-size: 14px; }
.mt-note small { display: block; font-size: 12px; color: var(--lm-d-muted); }

.mt-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mt-btns.is-three { grid-template-columns: 1fr 1fr 1fr; }
.mt-btn { min-block-size: 64px; padding: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 1px solid var(--lm-d-control-edge); border-radius: 14px; background: var(--lm-d-surface); font-size: 17px; font-weight: 700; cursor: pointer; }
.mt-btn small { font-size: 12px; font-weight: 400; color: var(--lm-d-muted); }
.mt-btn.is-ok { border-color: var(--lm-d-ok); color: var(--lm-d-ok); }
.mt-btn.is-on { border-width: 2px; border-color: var(--lm-d-info); background: var(--lm-d-info-soft); color: var(--lm-d-ink); }

.mt-sec { display: flex; flex-direction: column; gap: 8px; }
.mt-label { font-size: 14px; font-weight: 700; }
.mt-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mt-chip { min-block-size: 44px; padding: 8px 14px; border: 1px solid var(--lm-d-control-edge); border-radius: 22px; background: var(--lm-d-surface); font-size: 14px; cursor: pointer; text-align: start; }
.mt-chip.is-on { border-color: var(--lm-d-tab-on-bg); background: var(--lm-d-tab-on-bg); color: var(--lm-d-tab-on-ink); }
.mt-chip.is-ghost { border-style: dashed; color: var(--lm-d-muted); }
.mt-hint { font-size: 13px; color: var(--lm-d-muted); }
.mt-hint.is-warn { color: var(--lm-d-warn); }
.mt-hint.is-link { min-block-size: 44px; display: inline-flex; align-items: center; color: var(--lm-d-info); text-decoration: underline; }
.mt-input { inline-size: 100%; padding: 10px 12px; border: 1px solid var(--lm-d-control-edge); border-radius: 12px; background: var(--lm-d-surface); font-size: 16px; resize: vertical; }

.mt-sum { font-size: 13px; color: var(--lm-d-muted); }
.mt-primary, .mt-secondary { min-block-size: 52px; inline-size: 100%; padding-inline: 16px; border-radius: 14px; font-size: 16px; font-weight: 700; cursor: pointer; }
/* white on the house orange is 3.1:1 — a pass only as large text (WCAG AA ≥ 18.66px bold), so the primary is 19px
   (review 10/11); a link styled as the primary keeps white (`.mt a` would otherwise make it ink, 3.7:1) */
.mt-primary, .mt a.mt-primary { border: 0; background: var(--lm-d-accent); color: var(--lm-d-on-accent); font-size: 19px; }
.mt-secondary { border: 1px solid var(--lm-d-control-edge); background: var(--lm-d-surface); }
.mt-primary:disabled, .mt-secondary:disabled { opacity: .5; cursor: not-allowed; }
.mt-empty.is-soft { padding: 12px 16px; font-size: 14px; }

/* PO 10/11: the lists' order by «تاريخ الإسناد» — newest first, one tap flips it */
.mt-order { display: flex; flex-wrap: wrap; gap: 8px; }
.mt-order .mt-chip { font-size: 13px; }

/* the way back to «النهارده» on every other HOMEi page inside the installed app (navigation/head) — above the
   mobile pill, at the reading start, ≥ 44px */
.mt-back { position: fixed; z-index: 60; inset-inline-start: 16px; inset-block-end: calc(96px + env(safe-area-inset-bottom)); min-block-size: 44px; padding-inline: 18px; display: inline-flex; align-items: center; border-radius: 22px; background: var(--lm-d-accent); color: var(--lm-d-on-accent); font-size: 15px; font-weight: 700; text-decoration: none; box-shadow: var(--lm-d-sheet-shadow); }

/* CC-MOBILE-2 — the day's progress, the search, the person at a glance on each card, «اتصل بالتالي» */
.mt-progress { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border: 1px solid var(--lm-d-border); border-radius: 14px; background: var(--lm-d-surface); }
.mt-progress-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.mt-progress-top b { font-size: 24px; font-weight: 700; }
.mt-progress-top small { font-size: 14px; font-weight: 500; color: var(--lm-d-muted); }
.mt-bar { block-size: 8px; border-radius: 4px; background: var(--lm-d-quiet-bg); overflow: hidden; }
.mt-bar span { display: block; block-size: 100%; border-radius: 4px; background: var(--lm-d-accent); }
.mt-search { display: flex; align-items: center; gap: 8px; min-block-size: 44px; padding-inline: 12px; border: 1px solid var(--lm-d-control-edge); border-radius: 12px; background: var(--lm-d-surface); color: var(--lm-d-muted); }
.mt-search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 16px; color: var(--lm-d-ink); outline: none; }
.mt-chipline { display: flex; flex-wrap: wrap; gap: 4px; }
.mt-tag { display: inline-flex; align-items: center; min-block-size: 22px; padding-inline: 8px; border-radius: 11px; font-size: 12px; font-weight: 700; background: var(--lm-d-quiet-bg); color: var(--lm-d-muted); }
/* red on its soft tint is 4.2:1 at 12px — on the surface with a red edge it is 4.8:1 (review 10/11) */
.mt-tag.is-temp-hot { background: var(--lm-d-surface); color: var(--lm-d-danger); box-shadow: inset 0 0 0 1px var(--lm-d-danger); }
.mt-tag.is-temp-warm { background: var(--lm-d-warn-soft); color: var(--lm-d-warn); }
.mt-tag.is-temp-cold { background: var(--lm-d-info-soft); color: var(--lm-d-info); }
.mt-tag.is-score { background: var(--lm-d-tab-on-bg); color: var(--lm-d-tab-on-ink); }
.mt-tag.is-fresh { background: var(--lm-d-ok-soft); color: var(--lm-d-ok); }
.mt-tag.is-urgent { background: var(--lm-d-surface); color: var(--lm-d-danger); box-shadow: inset 0 0 0 1px var(--lm-d-danger); }
.mt-tag.is-cold, .mt-tag.is-transferred { background: var(--lm-d-info-soft); color: var(--lm-d-info); }
.mt-dir { font-size: 13px; font-weight: 600; color: var(--lm-d-tab-on-bg); }
.mt-nextbar { position: sticky; inset-block-end: calc(8px + env(safe-area-inset-bottom)); display: flex; }
.mt-nextbar .mt-primary { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

/* CC-MOBILE-3 — the app's bottom tabs (every app screen), and «المحادثات» = the inbox's own phone screen in the app */
.mt-tabs { position: fixed; z-index: 40; inset-inline: 0; inset-block-end: 0; display: flex; justify-content: center; gap: 4px; padding: 6px 12px calc(6px + env(safe-area-inset-bottom)); background: var(--lm-d-surface); border-block-start: 1px solid var(--lm-d-control-edge); }
.mt-tab { flex: 1; max-inline-size: 160px; min-block-size: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 12px; color: var(--lm-d-muted); font-size: 12px; font-weight: 600; text-decoration: none; }
/* the label in ink (orange on its tint was 2.9:1), the icon keeps the accent */
.mt-tab.is-on { color: var(--lm-d-tab-on-bg); background: var(--lm-d-accent-soft); font-weight: 700; }
.mt-tab.is-on .mt-tab-svg { color: var(--lm-d-accent); }
.mt-tab-ico { position: relative; display: inline-flex; }
.mt-tab-svg { inline-size: 24px; block-size: 24px; }
.mt-tab-badge { position: absolute; inset-block-start: -6px; inset-inline-end: -14px; min-inline-size: 18px; block-size: 18px; padding-inline: 4px; border-radius: 9px; background: var(--lm-d-danger); color: var(--lm-d-on-accent); font-size: 12px; line-height: 18px; text-align: center; }
.mt:has(.mt-tabs) { padding-block-end: calc(88px + env(safe-area-inset-bottom)); }
.mt:has(.mt-tabs) .mt-nextbar { inset-block-end: calc(76px + env(safe-area-inset-bottom)); }

.mt-app { box-sizing: border-box; min-block-size: 100dvh; padding: env(safe-area-inset-top) 12px 0; background: var(--lm-d-page); }
.mt-app .cvw[data-view="list"] { --cv-mobile-h: calc(100dvh - 76px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
.mt-app .cvw:not([data-view="list"]) { --cv-mobile-h: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
.mt-app:has(.cvw:not([data-view="list"])) .mt-tabs { display: none; }
/* iPhone zooms the whole page into any field under 16px when it takes focus (tried 10/11 on the note box); the inbox's
   own field rules (`.cv-composer textarea` 13.5px, `.cv-search input[type=text]` 13px) print later in the page, so the app's rule is stronger */
.mt-app .cvw input:not([type=checkbox]):not([type=radio]), .mt-app .cvw textarea, .mt-app .cvw select { font-size: 16px; }

/* CC-MOBILE-4 S2 — the visit sheet's «اتعملت / متمّتش / اتأجلت» */
.mt-seg { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--lm-d-surface); border: 1px solid var(--lm-d-control-edge); }
.mt-seg-b { flex: 1; min-block-size: 44px; border: 0; border-radius: 9px; background: transparent; font-size: 15px; font-weight: 700; cursor: pointer; }
.mt-seg-b.is-on { background: var(--lm-d-tab-on-bg); color: var(--lm-d-tab-on-ink); }
.mt-sec-group { display: flex; flex-direction: column; gap: 12px; }

/* CC-MOBILE-5 S5 — «المكالمات» and «أنا» */
.mt-tag.is-ok { background: var(--lm-d-ok-soft); color: var(--lm-d-ok); }
.mt-tag.is-warn { background: var(--lm-d-warn-soft); color: var(--lm-d-warn); }
.mt-avatar { inline-size: 52px; block-size: 52px; flex: none; border-radius: 26px; display: inline-flex; align-items: center; justify-content: center; background: var(--lm-d-tab-on-bg); color: var(--lm-d-tab-on-ink); font-size: 22px; font-weight: 700; }
.mt-card { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border: 1px solid var(--lm-d-control-edge); border-radius: 16px; background: var(--lm-d-surface); }
.mt-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mt-tile { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 12px; background: var(--lm-d-page); }
.mt-tile b { font-size: 24px; font-weight: 700; }
.mt-tile span { font-size: 13px; color: var(--lm-d-muted); }
.mt-links { padding-block: 4px; gap: 0; }
.mt-link { min-block-size: 52px; display: flex; align-items: center; border: 0; border-block-end: 1px solid var(--lm-d-control-edge); background: none; padding: 0; font-size: 15px; font-weight: 600; text-align: start; cursor: pointer; inline-size: 100%; }
.mt-link-form { margin: 0; }
.mt-link-form .mt-link { border-block-end: 0; }
.mt-link.is-danger { color: var(--lm-d-danger); }

/* CC-MOBILE-8 — «يومي» on the phone: attendance / next step cards, the month funnel rows */
.mt-card.is-warn { border-color: var(--lm-d-warn); background: var(--lm-d-warn-soft); }
.mt-link-inline { color: var(--lm-d-info); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.mt-funnel-row { display: flex; align-items: baseline; gap: 10px; padding-block: 6px; border-block-end: 1px solid var(--lm-d-control-edge); }
.mt-funnel-row:last-child { border-block-end: 0; }
.mt-funnel-row b { min-inline-size: 64px; font-size: 20px; }
.mt-funnel-row span { font-size: 13px; color: var(--lm-d-muted); }

/* CC-MOBILE-9 — the old-late pile and the «ليد جديد» banner */
.mt-older { min-block-size: 52px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border: 1px dashed var(--lm-d-control-edge); border-radius: 14px; background: var(--lm-d-surface); color: var(--lm-d-muted); font-size: 14px; font-weight: 600; text-align: start; cursor: pointer; }
.mt-older small { color: var(--lm-d-info); font-size: 13px; }
.mt-fresh { position: sticky; inset-block-start: calc(8px + env(safe-area-inset-top)); z-index: 30; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: var(--lm-d-info-soft); color: var(--lm-d-info); font-size: 14px; font-weight: 700; box-shadow: var(--lm-d-sheet-shadow); }

/* CC-MOBILE-10 — a manager's direction on top of the day, and the team row's direction form */
.mt-card.is-direction { border-color: var(--lm-d-info); background: var(--lm-d-info-soft); }
.mt-direct { inline-size: 100%; flex-basis: 100%; }
[data-mt-team-row] { flex-wrap: wrap; }
[data-mt-team-row] .mt-row-main { flex: 1 1 60%; }

/* CC-MOBILE-11 — a visit's result one tap from its card */
.mt-row:has(.mt-row-quick) { flex-wrap: wrap; }
.mt-row:has(.mt-row-quick) .mt-row-main { flex: 1 1 60%; }
.mt-row-quick { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-block-start: 4px; border-block-start: 1px dashed var(--lm-d-control-edge); }

/* CC-MOBILE-11 — «المحادثات»: «تمت المعالجة ← اللي بعدها» one tap in the thread, rows swipe (right done, left snooze) */
.mt-app .cv-handled-next { padding: 2px 10px 8px; }
.mt-app .cv-btn-handled { inline-size: 100%; min-block-size: 44px; border-radius: 12px; border: 1px solid var(--lm-d-ok); background: var(--lm-d-ok-soft); color: var(--lm-d-ok); font-size: 15px; font-weight: 700; cursor: pointer; }
.mt-app a.cv-item { transition: transform .15s ease, background-color .15s ease; }
.mt-app a.cv-item.is-swipe-done { background: var(--lm-d-ok-soft); }
.mt-app a.cv-item.is-swipe-later { background: var(--lm-d-warn-soft); }
.mt-swipe-hint { display: none; position: fixed; z-index: 39; inset-inline: 0; inset-block-end: calc(66px + env(safe-area-inset-bottom)); margin: 0; padding: 2px 16px; text-align: center; font-size: 12px; color: var(--lm-d-muted); }
.mt-app:has(.cvw[data-view="list"]) .mt-swipe-hint { display: block; }
.mt-app:has(.mt-swipe-hint) .cvw[data-view="list"] { --cv-mobile-h: calc(100dvh - 98px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }

/* CC-MOBILE-12 — the lead's need in the call sheet */
.mt-need { padding: 10px 12px; border: 1px solid var(--lm-d-control-edge); border-radius: 14px; background: var(--lm-d-surface); }
.mt-need-head { min-block-size: 44px; inline-size: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 0; background: none; padding: 0; font-size: 15px; font-weight: 700; text-align: start; cursor: pointer; }
.mt-need-head small { font-size: 12px; font-weight: 600; color: var(--lm-d-muted); }
.mt-need-range { display: flex; gap: 8px; align-items: center; }
.mt-need-range .mt-input { flex: 1; min-inline-size: 0; }
