/* Home, the manager's first tab (14 Nov 2026). Built on the real Sales HQ pieces (style.css cards, chips and buttons, admin.css strip tiles and
   target lines); this file only adds the few shapes they do not have. Rules kept: red means needs you and nothing else, green means money or done,
   plain word filters (no boxed chip rows), hairlines for structure, no side border accents, no glow. */

.mh { max-width: 1180px; margin: 0 auto; }

/* the number tiles: the same rules as the strip on the manager pages (admin.css), scoped here because the main app does not load admin.css */
.mh .strip { display: flex; flex-wrap: wrap; gap: 8px; }
.mh .strip-item { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; min-width: 150px; flex: 1 1 150px; }
.mh .strip-item .k { font-size: 12px; color: var(--muted); }
.mh .strip-item .v { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.mh .strip-item .w { font-size: 12px; margin-top: 1px; }
.mh .tablewrap { overflow-x: auto; }
.mh-head h1:focus { outline: none; }
.mh-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.mh-head h1 { font-size: 19px; font-weight: 800; }
.mh-head p { max-width: 70ch; margin-top: 2px; }
.mh h2 { font-size: 15px; }
/* a jump from a Needs you tile lands the section just under the sticky top bar */
.mh-leads, .mh-team, .mh-feed-h { scroll-margin-top: 64px; }
.mh-who { font-weight: 700; }
.mh h3 { font-size: 14px; margin: 18px 0 8px; }
.mh-head .btn { margin-top: 2px; }

/* the Needs you strip: five tiles that are also buttons. The number is red only when something waits. */
.mh-needs { margin-bottom: 14px; }
.mh-needs > h2 { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
button.strip-item.mh-need { text-align: left; color: var(--text); font: inherit; cursor: pointer; display: block; width: auto; }
button.strip-item.mh-need:hover { border-color: var(--line-strong); }
.mh .strip-item.mh-need .k { display: block; font-size: 12px; color: var(--muted); }
.mh .strip-item.mh-need .v { display: block; font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.mh .strip-item.mh-need .w { display: block; font-size: 12px; color: var(--muted); }
.mh .strip-item.mh-need.has .v { color: var(--red); }
.mh .strip-item.mh-need.has .w { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }

/* tiles inside the lead card */
.mh-tiles { margin-bottom: 12px; }
.mh .mh-tile .v { font-size: 24px; }
.mh .mh-tile.bad .v { color: var(--red); }
.mh .mh-tile .w { color: var(--muted); }

/* plain word filters: active is bright with a hairline under it, the rest are grey (carlhauser nav words, Taste Library) */
.mh-words { display: flex; flex-wrap: wrap; gap: 2px 16px; margin: 4px 0 10px; border-bottom: 1px solid var(--line); }
.mh-words button { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; font-size: 14px; padding: 8px 0 7px; min-height: 40px; }
.mh-words button:hover { color: var(--text); }
.mh-words button.on { color: var(--text); border-bottom-color: var(--text); }
.mh-n { font-size: 12px; font-weight: 600; opacity: .75; font-variant-numeric: tabular-nums; margin-left: 2px; }

/* the hand out bar */
.mh-hand { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 0 12px; }
.mh-hand select { width: auto; min-width: 70px; padding: 6px 9px; }
.mh-hand #mh-hand-who { min-width: 150px; }
.mh-hand .btn { margin-top: 0; }
.mh-hand-t { font-size: 13px; color: var(--muted); }
.mh-hand-t b { color: var(--text); }
.mh-hand-note { flex: 1 1 260px; font-size: 12px; }
.mh-confirm { background: var(--panel-2); border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; font-size: 13.5px; }
.mh-confirm p { margin: 0 0 8px; line-height: 1.5; }
.mh-confirm-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mh-confirm-acts .btn { margin-top: 0; }
/* the hand out warning for a setter who is not cleared yet: amber, the colour for worth a look; red stays for what needs the manager */
.mh-confirm.warn { border-color: var(--yellow); background: color-mix(in srgb, var(--yellow) 8%, var(--panel-2)); }

/* the lead rows: one lead per row, who and why on the left, the clock and the buttons on the right */
.mh-leadlist, .mh-feed { list-style: none; padding: 0; margin: 0; }
.mh-lead { display: grid; grid-template-columns: 52px minmax(0, 2.4fr) 84px 118px 150px auto; gap: 8px 14px; align-items: center; padding: 11px 4px; border-top: 1px solid var(--line); }
.mh-lead:last-child { border-bottom: 1px solid var(--line); }
.mh-lead:hover { background: rgba(255, 255, 255, .02); }
.mh-lead-name { font-size: 14px; }
.mh-lead-why { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 3px; }
.mh-score { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mh-prev { margin-top: 3px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 52ch; }
.mh-lead-wait b, .mh-lead-owner b { display: block; font-size: 14px; }
.mh-lead-wait .muted, .mh-lead-owner .muted { font-size: 12px; }
.mh-lead-clock { font-size: 13px; color: var(--muted); }
.mh-lead-clock.red { color: var(--red); font-weight: 700; }
.mh-lead-acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.mh-lead-acts .btn { margin-top: 0; }
.mh-lead-acts select.mh-give { width: auto; max-width: 130px; padding: 5px 8px; font-size: 12px; }
.mh-lead.over .mh-lead-name::after { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--red); margin-left: 8px; vertical-align: middle; }

/* the feed: one line per piece of work (when, who, what, chips), the words open below it, the buttons under that */
.mh-item { padding: 12px 4px; border-top: 1px solid var(--line); }
.mh-item:last-child { border-bottom: 1px solid var(--line); }
.mh-item-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.mh-when { color: var(--muted); font-size: 12px; min-width: 76px; font-variant-numeric: tabular-nums; position: relative; }
.mh-item.need .mh-when::before { content: ""; position: absolute; left: -12px; top: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.mh-line { flex: 1 1 280px; min-width: 0; font-size: 14px; }
.mh-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.mh-item-body { margin: 7px 0 0 86px; }
.mh-quote { margin: 0; padding: 0; font-size: 13.5px; color: var(--text); white-space: pre-wrap; word-break: break-word; max-width: 80ch; }
.mh-quote::before, .mh-quote::after { content: none; }
.mh-reply { margin-top: 4px; font-size: 13px; max-width: 80ch; }
.mh-item-acts { display: flex; flex-wrap: wrap; gap: 6px; margin: 9px 0 0 86px; }
.mh-item-acts .btn { margin-top: 0; text-decoration: none; display: inline-block; }
a.btn.small { display: inline-block; }
.mh-panel { margin: 10px 0 2px 86px; padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; max-width: 640px; }
.mh-panel label.f { margin-top: 0; }
.mh-panel textarea { min-height: 64px; }
.mh-panel .mh-confirm-acts { margin-top: 8px; }
.mh-kpi td { vertical-align: top; }
.mh button.rowbtn { background: none; border: 0; color: var(--text); font-weight: 700; padding: 0; text-align: left; min-height: 0; font-size: 14px; }
.mh button.rowbtn:hover { text-decoration: underline; }
.mh .tgt { font-size: 12px; line-height: 1.35; }
.mh .tgt + .tgt { margin-top: 3px; }
.mh .tgt b { font-size: 14px; font-variant-numeric: tabular-nums; }
.mh .tgt.hit { color: var(--green); }
.mh .tgt.behind { color: var(--yellow); }
.mh .tgt .lbl { color: var(--muted); margin-right: 4px; }
.mh .why { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.mh .griddoc { font-size: 12px; color: var(--muted); max-width: 90ch; }
@media (max-width: 599px) { .mh button.rowbtn { min-height: 44px; } }
.mh-kpi .why { margin-top: 4px; }
.mh .statusmsg { margin: 6px 0 10px; }
.mh .griddoc { margin-top: 8px; }

/* a phone (390px): rows stack, the buttons keep a thumb's height, nothing scrolls sideways */
@media (max-width: 899px) {
  .mh-lead { grid-template-columns: 52px 1fr; }
  .mh-lead > :not(.mh-av):not(.mh-lead-main) { grid-column: 1 / -1; }
  .mh-lead-main, .mh-lead-acts { grid-column: 1 / -1; }
  .mh-lead-acts { justify-content: flex-start; }
}
@media (max-width: 599px) {
  .mh-item-body, .mh-item-acts, .mh-panel { margin-left: 0; }
  .mh-when { min-width: 0; }
  .mh-item.need .mh-when::before { left: -10px; }
  .mh-words button { min-height: 44px; }
  .mh-lead-acts .btn, .mh-item-acts .btn, .mh-confirm-acts .btn, .mh-hand .btn { min-height: 44px; }
  .mh-lead-acts select.mh-give, .mh-hand select { min-height: 44px; }
  button.strip-item.mh-need { flex: 1 1 calc(50% - 8px); min-width: 0; }
  .mh-kpi th, .mh-kpi td { padding: 8px 8px; }
}
@media (prefers-reduced-motion: reduce) { .mh * { transition: none !important; animation: none !important; } }

/* AURA-NATIVE */
/* the lead's face (their Instagram profile picture, kept in HQ from ManyChat) with a small Instagram mark; a link to their Instagram profile.
   No picture, or a picture link that has died, shows their initials on the same circle. */
.mh-av { position: relative; display: block; width: 44px; height: 44px; border-radius: 50%; flex: none; text-decoration: none; }
.mh-av-ini, .mh-av-img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; }
.mh-av-ini { display: flex; align-items: center; justify-content: center; background: linear-gradient(140deg, #8B5CF6, #FF6FA8 60%, #F3B596); }
.mh-av-ini::after { content: attr(data-i); font-size: 15px; font-weight: 600; letter-spacing: .02em; color: #fff; }
.mh-av-img { object-fit: cover; background: #e9e9ef; box-shadow: inset 0 0 0 1px rgba(18, 21, 28, .08); }
.mh-av:hover .mh-av-img, .mh-av:hover .mh-av-ini { box-shadow: 0 0 0 3px rgba(139, 92, 246, .28); }
.mh-av:focus-visible { outline: 2px solid #8B5CF6; outline-offset: 3px; }
.mh-ig { position: absolute; right: -4px; bottom: -4px; width: 19px; height: 19px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #12151C; background: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, .9), 0 4px 10px -3px rgba(28, 39, 64, .45); }
.mh-ig svg { width: 12px; height: 12px; }
@media (hover: none) and (pointer: coarse) { .mh-av { width: 48px; height: 48px; } }

/* the lead list, tidy: picture and Instagram mark on the left, the wait and the clock as a pill, the last message as a quiet quote (picked by Joe 11-20 from three looks) */
.mh-lead-clock { white-space: nowrap; display: inline-flex; align-items: center; justify-self: start; min-height: 26px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: rgba(18, 21, 28, .04); }
.mh-lead-clock.red { background: rgba(184, 22, 93, .08); border-color: rgba(184, 22, 93, .32); color: #B8165D; }
.mh-prev::before { content: "\201C"; }
.mh-prev::after { content: "\201D"; }
