/* TEAM (#agent/team): the tm- pieces on top of the Money design system
   (money.css). Tokens are --m-line, --m-surface, --m-ink and friends. */
.tm-app .tm-main { min-width: 0; }
.tm-app.tm-me { display: block; }
.tm-app.tm-me .tm-main { max-width: 1080px; margin: 0 auto; }
.tm-app a { color: inherit; }
.tm-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.tm-grid { gap: 18px; }
.tm-gap { margin-top: 12px; }
.tm-gapb { margin-bottom: 12px; }
.tm-pad { padding: 12px 20px 16px; }
.tm-sub { font-size: 12px; color: var(--m-muted); font-weight: 400; }
.tm-link { color: var(--m-ink); font-weight: 600; text-decoration: none; }
.tm-link:hover { text-decoration: underline; }
.tm-back { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--m-muted); text-decoration: none; margin-bottom: 6px; }
.tm-back svg.i { width: 14px; height: 14px; }
.tm-none { padding: 22px 20px; color: var(--m-muted); font-size: 13px; }
.tm-none.flat { padding: 4px 0; }
.tm-right { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.tm-rowlink { text-decoration: none; color: inherit; }
.tm-rowlink:hover { background: var(--m-surface-2); }
.tm-list .m-row-title { display: flex; align-items: center; gap: 8px; white-space: normal; flex-wrap: wrap; }
.tm-list .m-row-sub { white-space: normal; }
.tm-table td { vertical-align: top; }
.tm-table td .m-btn { margin-left: 4px; }
.tm-dot { display: inline-block; min-width: 16px; padding: 0 5px; border-radius: 999px; background: var(--m-neg); color: #fff; font-size: 10px; line-height: 16px; text-align: center; }
.tm-av { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.tm-av.you { background: var(--m-ink); color: var(--m-surface); font-size: 10px; }
.tm-prog { width: 90px; flex-shrink: 0; }
.tm-prog.wide { width: auto; padding: 0 20px 10px; }
.tm-select { font: inherit; font-size: 12.5px; padding: 7px 10px; border: 1px solid var(--m-line); border-radius: 8px; background: var(--m-surface); color: var(--m-ink); max-width: 220px; }
.tm-select.sm { padding: 4px 8px; font-size: 12px; }

/* figures along the top of a page */
.tm-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0; border-top: 1px solid var(--m-line); border-bottom: 1px solid var(--m-line); padding: 18px 0; }
.tm-fig { display: block; text-decoration: none; padding: 0 18px 0 0; min-width: 0; }
.tm-fig .v { font-size: 26px; font-weight: 600; letter-spacing: -.01em; color: var(--m-ink); font-variant-numeric: tabular-nums; }
.tm-fig .v.warn { color: var(--m-warn); }
.tm-fig .l { font-size: 11.5px; color: var(--m-muted); margin-top: 2px; }
.m-card .tm-figs { border: 0; padding: 0; gap: 14px 0; }
.m-card-head + .tm-note { border-top: 0; padding-top: 0; }
.m-card .tm-fig .v { font-size: 20px; }

/* forms: inputs outside .m-form are unstyled, so Team styles its own */
.tm-formgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.tm-formgrid.one { grid-template-columns: minmax(0, 1fr); }
.tm-formgrid .wide { grid-column: 1 / -1; }
.tm-app .tm-field input:not([type=checkbox]):not([type=radio]):not([type=file]), .tm-app .tm-field select, .tm-app .tm-field textarea, .tm-q input:not([type=checkbox]), .tm-q select {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 13px; padding: 8px 10px; border: 1px solid var(--m-line); border-radius: 8px; background: var(--m-surface); color: var(--m-ink); outline: none; min-height: 36px; }
.tm-app .tm-field textarea { resize: vertical; line-height: 1.5; }
.tm-app .tm-field input:focus, .tm-app .tm-field select:focus, .tm-app .tm-field textarea:focus { border-color: var(--m-accent); }
.tm-app .tm-field input[type=file] { font-size: 12.5px; padding: 10px; border: 1px dashed var(--m-line); border-radius: 8px; width: 100%; box-sizing: border-box; }
.tm-hint, .tm-modalnote { font-size: 11.5px; color: var(--m-muted); line-height: 1.45; }
.tm-modalnote { margin-bottom: 12px; }
.tm-check { align-self: end; min-height: 36px; display: flex; align-items: center; gap: 8px; font-size: 13px; }
.tm-score { display: flex; gap: 6px; }
.tm-score label { position: relative; }
.tm-score input { position: absolute; opacity: 0; inset: 0; }
.tm-score span { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; border: 1px solid var(--m-line); border-radius: 8px; font-weight: 600; font-size: 13px; cursor: pointer; background: var(--m-surface); }
.tm-score input:checked + span { background: var(--m-ink); border-color: var(--m-ink); color: var(--m-surface); }
.tm-score input:focus-visible + span { outline: 2px solid var(--m-accent); outline-offset: 1px; }
.tm-q { display: grid; grid-template-columns: minmax(0, 1fr) 130px auto auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.tm-linkbox { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding: 10px 12px; border: 1px solid var(--m-line); border-radius: 10px; background: var(--m-surface-2); }
.tm-linkbox code { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tm-switchrow { display: flex; gap: 12px; align-items: flex-start; }
.tm-switchrow .m-toggle { flex-shrink: 0; margin-top: 2px; }
.tm-signrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.tm-dangerrow { display: flex; justify-content: flex-end; }

/* the candidate board */
.tm-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(210px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.tm-lane { background: var(--m-surface-2); border: 1px solid var(--m-line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.tm-lane header { display: flex; justify-content: space-between; align-items: center; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--m-muted); padding: 2px 4px 4px; }
.tm-lane header em { font-style: normal; color: var(--m-faint); }
.tm-lane-none { font-size: 12px; color: var(--m-faint); padding: 6px 4px; }
.tm-ccard { display: block; background: var(--m-surface); border: 1px solid var(--m-line); border-radius: 10px; padding: 10px 12px; text-decoration: none; }
.tm-ccard:hover, .tm-pcard:hover { border-color: var(--m-accent); }
.tm-cname { font-weight: 600; font-size: 13.5px; color: var(--m-ink); }
.tm-cmeta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.tm-stages { display: flex; flex-wrap: wrap; gap: 6px; }
.tm-stage { font: inherit; font-size: 12.5px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--m-line); background: var(--m-surface); color: var(--m-muted); cursor: pointer; }
.tm-stage.on { background: var(--m-ink); border-color: var(--m-ink); color: var(--m-surface); font-weight: 600; }
.tm-qa { margin-bottom: 14px; }
.tm-qa .q { font-size: 11.5px; font-weight: 600; color: var(--m-muted); margin-bottom: 3px; }
.tm-qa .a, .tm-body, .tm-notebody { font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.tm-note, .tm-scard { border-top: 1px solid var(--m-line-soft); padding: 10px 0; position: relative; }
.tm-note:first-child { border-top: 0; padding-top: 0; }
.tm-note .tm-sub { display: flex; justify-content: space-between; align-items: center; }
.tm-scard > .m-btn { position: absolute; right: 0; top: 6px; }
.tm-dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: 13px; }
.tm-dl dt { color: var(--m-muted); }
.tm-dl dd { margin: 0; overflow-wrap: anywhere; }
.tm-hist, .tm-ol { margin: 0; padding-left: 18px; font-size: 13px; display: grid; gap: 8px; }
.tm-hist li span { display: block; font-size: 12px; color: var(--m-muted); }
.tm-bars { display: grid; gap: 7px; margin-bottom: 6px; }
.tm-bar { display: grid; grid-template-columns: 120px minmax(0, 1fr) 34px; gap: 10px; align-items: center; font-size: 12.5px; }
.tm-bar i { display: block; height: 8px; border-radius: 999px; background: var(--m-surface-2); overflow: hidden; }
.tm-bar b { display: block; height: 100%; background: var(--m-accent); border-radius: 999px; }
.tm-bar em { font-style: normal; text-align: right; color: var(--m-muted); font-variant-numeric: tabular-nums; }

/* people */
.tm-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.tm-pcard { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--m-line); border-radius: 12px; background: var(--m-surface); text-decoration: none; }
.tm-pcard .tm-av { width: 38px; height: 38px; font-size: 13px; }
.tm-pmain { min-width: 0; }
.tm-tabs { overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
.tm-tabs::-webkit-scrollbar { display: none; }
.tm-tabs .m-tab { text-decoration: none; white-space: nowrap; flex-shrink: 0; }
.tm-step.done .m-row-title { color: var(--m-muted); text-decoration: line-through; }
.tm-tick { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--m-line); background: var(--m-surface); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; padding: 0; color: #fff; }
.tm-tick.on { background: var(--m-pos); border-color: var(--m-pos); }
.tm-tick svg.i { width: 14px; height: 14px; }
.tm-tree { overflow-x: auto; padding-bottom: 6px; }
.tm-tree ul { list-style: none; margin: 0; padding-left: 26px; position: relative; }
.tm-tree > ul { padding-left: 0; }
.tm-tree li { position: relative; padding: 5px 0; }
.tm-tree ul ul > li::before { content: ""; position: absolute; left: -14px; top: 0; bottom: 0; border-left: 1px solid var(--m-line); }
.tm-tree ul ul > li:last-child::before { bottom: auto; height: 26px; }
.tm-tree ul ul > li::after { content: ""; position: absolute; left: -14px; top: 26px; width: 12px; border-top: 1px solid var(--m-line); }
.tm-node { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border: 1px solid var(--m-line); border-radius: 999px; background: var(--m-surface); text-decoration: none; white-space: nowrap; }
.tm-node b { display: block; font-size: 13px; }
.tm-node em { display: block; font-style: normal; font-size: 11.5px; color: var(--m-muted); }
a.tm-node:hover { border-color: var(--m-accent); }

/* time off */
.tm-bal { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.tm-balcard { border: 1px solid var(--m-line); border-radius: 12px; background: var(--m-surface); padding: 14px 16px; }
.tm-balcard .l { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--m-muted); }
.tm-balcard .v { font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; margin: 2px 0; }
.tm-math { font-size: 11.5px; color: var(--m-faint); margin: 6px 0 4px; }
.tm-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.tm-cal-h { font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--m-faint); padding: 0 4px 4px; }
.tm-cal-d { min-height: 86px; border: 1px solid var(--m-line-soft); border-radius: 8px; padding: 5px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tm-cal-d.blank { border: 0; }
.tm-cal-d.off { background: var(--m-surface-2); }
.tm-cal-d.today { border-color: var(--m-accent); }
.tm-cal-d .n { font-size: 11.5px; color: var(--m-muted); }
.tm-cal-d.today .n { color: var(--m-accent); font-weight: 700; }
.tm-chip { display: block; font-size: 10.5px; line-height: 1.3; padding: 2px 6px; border-radius: 5px; background: var(--c, var(--m-accent)); color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-chip.pend { background: repeating-linear-gradient(135deg, var(--c), var(--c) 5px, color-mix(in srgb, var(--c) 60%, #fff) 5px, color-mix(in srgb, var(--c) 60%, #fff) 10px); }
.tm-chip.hol { background: var(--m-surface-2); color: var(--m-muted); border: 1px solid var(--m-line); }

/* timesheets */
.tm-weeknav { display: flex; align-items: center; gap: 8px; }
.tm-weeknav b { font-size: 14px; margin: 0 4px; }
.tm-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.tm-wd { border: 1px solid var(--m-line-soft); border-radius: 8px; padding: 8px; min-height: 84px; min-width: 0; }
.tm-wd .h { font-size: 11px; font-weight: 600; color: var(--m-muted); }
.tm-wd .h span { font-weight: 400; color: var(--m-faint); }
.tm-wd .t { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; margin: 2px 0 4px; }
.tm-entry { position: relative; font-size: 11.5px; background: var(--m-surface-2); border-radius: 6px; padding: 3px 18px 3px 6px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-entry span { color: var(--m-muted); margin-left: 5px; }
.tm-entry button { position: absolute; right: 2px; top: 0; bottom: 0; border: 0; background: none; color: var(--m-muted); cursor: pointer; font-size: 14px; padding: 0 4px; }
.tm-total { text-align: right; font-size: 13px; color: var(--m-muted); }
.tm-total b { color: var(--m-ink); font-size: 16px; margin-left: 8px; }

/* reports */
.tm-cols { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; height: 170px; align-items: end; }
.tm-colbar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; min-width: 0; }
.tm-colbar i { display: block; width: 100%; max-width: 30px; min-height: 2px; background: var(--m-accent); border-radius: 5px 5px 0 0; }
.tm-colbar em { font-style: normal; font-size: 11px; color: var(--m-muted); }
.tm-colbar span { font-size: 10.5px; color: var(--m-faint); }

@media (max-width: 900px) {
  .tm-board { grid-auto-columns: minmax(230px, 78vw); }
}
@media (max-width: 700px) {
  .tm-formgrid { grid-template-columns: minmax(0, 1fr); }
  .tm-q { grid-template-columns: minmax(0, 1fr) auto; }
  .tm-q select { grid-column: 1; }
  .tm-week { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tm-wd { min-height: 0; }
  .tm-wd .t { min-height: 0; }
  .tm-cal-d { min-height: 58px; padding: 3px; }
  .tm-chip { font-size: 9px; padding: 1px 3px; }
  .tm-cal-h { font-size: 9px; padding: 0 1px 3px; }
  .tm-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 0; }
  .tm-bar { grid-template-columns: 96px minmax(0, 1fr) 30px; }
  .tm-app .m-head { flex-wrap: wrap; gap: 10px; }
  .tm-app .m-head .m-actions { flex-wrap: wrap; }
  .tm-list .m-row { flex-wrap: wrap; }
  .tm-right { justify-content: flex-start; }
  .tm-select { max-width: 100%; }
  .tm-app.tm-me .tm-main { padding-bottom: 96px; }
  .tm-app .tm-field input:not([type=checkbox]):not([type=radio]):not([type=file]), .tm-app .tm-field select, .tm-app .tm-field textarea { font-size: 16px; min-height: 44px; }
  .tm-score span { width: 44px; height: 44px; }
}
