/* Today (redesign Phase 5): small page-specific pieces on top of the design-system today.css rules. Tokens only. */
#todayView { flex: 1; min-height: 0; overflow: auto; padding: var(--s-6) var(--s-8) var(--s-8); background: var(--bg); color: var(--text); }
#todayView .page-head { flex-wrap: wrap; }
#todayView .page-head > div:first-child { flex: 1; min-width: 0; }
#todayView .page-actions { margin-left: auto; }
#todayView .attn-tabs { flex-wrap: wrap; }
#todayView .attn-tabs .seg button { white-space: nowrap; }
#todayView .attn-tabs .card-title { margin-right: 10px; }
#todayView .attn-tabs .link { margin-left: auto; }
#todayView .attn-row .t-name { font-weight: 600; font-size: var(--fs-14); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#todayView .attn-row .t-name .faint { font-weight: 400; font-size: var(--fs-13); }
#todayView .attn-row .amt .faint { font-weight: 400; }
#todayView .attn-row:focus-visible, #todayView .frow:focus-visible, #todayView .inbox-row:focus-visible, #todayView .tl-item:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
#todayView .card-head .link { margin-left: auto; }
#todayView .card-head .hint { margin-left: 8px; }
#todayView .card-head .hint.t-right { margin-left: auto; }
#todayView .stat .v.t-danger { color: var(--danger); }
#todayView .tl-item .faint { font-size: var(--fs-12); }
#todayView .t-more { padding: 10px 20px; }
#todayView .t-grow { min-width: 0; flex: 1; }
#todayView .t-line { display: flex; gap: 8px; }
#todayView .empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 36px 20px; color: var(--text-3); }

@media (max-width: 1100px) {
    #todayView .kpi-row { grid-template-columns: 1fr 1fr; }
    #todayView .today-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    #todayView { padding: var(--s-4); }
    #todayView .page-head { margin-bottom: var(--s-4); }
    #todayView .page-head > div:first-child { flex-basis: 100%; }
    #todayView .page-title { font-size: var(--fs-24); }
    #todayView .page-actions { margin-left: 0; }
    #todayView .kpi-row { grid-template-columns: 1fr; }
    #todayView .stat { min-height: 116px; }
    #todayView .attn-row { grid-template-columns: 32px 1fr auto; }
    #todayView .attn-row > .avatar, #todayView .attn-row > .chev, #todayView .attn-row > span:nth-child(4) { display: none; }
    #todayView .frow { grid-template-columns: 120px 1fr 64px; }
    #todayView .attn-tabs .link { margin-left: 0; }
}

/* Your briefing: a few plain sentences about the person's day, each with one action. */
#todayView .tb { margin-bottom: var(--s-4); }
#todayView .tb .card-title { display: inline-flex; align-items: center; gap: 8px; }
#todayView .tb .card-title .ua-ic { color: var(--brand-text); }
#todayView .tb-list { list-style: none; margin: 0; padding: 6px 0 8px; }
#todayView .tb-item { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 12px; padding: 10px 20px; }
#todayView .tb-item + .tb-item { border-top: 1px solid var(--divider); }
#todayView .tb-ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); }
#todayView .tb-ic.danger { background: var(--danger-soft); color: var(--danger); }
#todayView .tb-ic.warning { background: var(--warning-soft); color: var(--warning); }
#todayView .tb-ic.success { background: var(--success-soft); color: var(--success); }
#todayView .tb-ic.brand { background: var(--brand-soft); color: var(--brand-text); }
#todayView .tb-text { margin: 0; font-size: var(--fs-14); line-height: 1.5; color: var(--text-2); }
#todayView .tb-text b { color: var(--text); font-weight: 600; }
#todayView .tb-deal { border: 0; background: none; padding: 0; font: inherit; color: var(--text); font-weight: 600; cursor: pointer; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
#todayView .tb-deal:hover { color: var(--brand-text); text-decoration-color: currentColor; }
#todayView .tb-act { white-space: nowrap; }
@media (max-width: 640px) {
    #todayView .tb-item { grid-template-columns: 28px 1fr; padding: 10px 14px; }
    #todayView .tb-act { grid-column: 2; justify-self: start; }
    #todayView .tb .hint { display: none; }
}

/* Your to-dos (the team summary's next actions for this person) */
#todayView .td-todos .card-head { flex-wrap: wrap; padding-bottom: 8px; }
#todayView .td-todos .card-head .hint { margin-left: 8px; }
#todayView .td-todos .card-head .link { margin-left: auto; }
#todayView .td-list { list-style: none; margin: 0; padding: 0 0 6px; }
#todayView .td-item { display: grid; grid-template-columns: 24px 1fr; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--divider); }
#todayView .td-check { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--border-strong); background: var(--surface); color: transparent; display: grid; place-items: center; cursor: pointer; padding: 0; margin-top: 1px; transition: all var(--t-fast); }
#todayView .td-check:hover, #todayView .td-check:focus-visible { border-color: var(--success); color: var(--success); background: var(--success-soft); }
#todayView .td-label { font-size: var(--fs-14); line-height: 1.5; color: var(--text); }
#todayView .td-label .chip { margin-right: 6px; vertical-align: 1px; }
#todayView .td-deals { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
#todayView .td-deal { border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); border-radius: var(--r-pill); padding: 3px 10px; font: inherit; font-size: var(--fs-12); cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#todayView .td-deal:hover { border-color: var(--brand); color: var(--brand-text); }
@media (max-width: 640px) { #todayView .td-todos .card-head .hint { display: none; } #todayView .td-item { padding: 12px 14px; } }

/* Leader Analytics: "Viewing" picker (see Today as another salesperson) */
#todayView .td-viewas { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 4px 0 10px; border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--surface); color: var(--text-2); }
#todayView .td-viewas.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-text); }
#todayView .td-viewas .select { height: 28px; border: 0; background: transparent; color: inherit; font: inherit; font-size: var(--fs-13); font-weight: 500; padding: 0 22px 0 2px; box-shadow: none; }
#todayView .td-viewas .select:focus { outline: none; }
#todayView .td-viewas:focus-within { box-shadow: 0 0 0 3px var(--brand-soft-2); }
#todayView .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#todayView .td-readonly .td-item { grid-template-columns: 10px 1fr; }
#todayView .td-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 8px; background: var(--text-3); }
#todayView .td-dot.danger { background: var(--danger); }
#todayView .td-dot.warning { background: var(--warning); }

/* To-do: "View all" and the full list page (#/tab/today?todo=<kind>) */
#todayView .td-all { border: 0; background: none; color: var(--brand-text); font: inherit; font-size: var(--fs-12); font-weight: 600; padding: 3px 4px; cursor: pointer; display: inline-flex; align-items: center; gap: 2px; }
#todayView .td-all:hover { text-decoration: underline; }
#todayView .td-page .ls-bar { margin-bottom: var(--s-3); }
#todayView .td-kicker { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-12); font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 6px; }
#todayView .td-page-title { font-size: var(--fs-24); }
#todayView .td-page-tools { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-4); }
#todayView .td-page-tools .grow { flex: 1; }
#todayView .ls-search { position: relative; display: flex; align-items: center; min-width: 280px; }
#todayView .ls-search .ua-ic { position: absolute; left: 10px; color: var(--text-3); }
#todayView .ls-search .input { padding-left: 32px; width: 100%; }
#todayView .td-page-card { overflow: hidden; }
#todayView .td-table-wrap { overflow-x: auto; }
#todayView .td-table tbody tr { cursor: pointer; }
#todayView .td-table tbody tr:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
#todayView .td-table th.sortable { cursor: pointer; white-space: nowrap; }
#todayView .td-table td.r, #todayView .td-table th.r { text-align: right; }
#todayView .ls-name { display: inline-flex; align-items: center; gap: 8px; }
#todayView .ls-owner { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
#todayView .td-sub { display: block; font-size: var(--fs-12); color: var(--text-3); font-weight: 400; }
#todayView .td-table .t-danger { color: var(--danger); }
@media (max-width: 640px) { #todayView .ls-search { min-width: 0; flex: 1 1 100%; } }

/* ---- The board: one screen, no scrolling. Cards are filled by urgency (bluer is more urgent, white is clear) and sorted most urgent first. ---- */
#todayView.ub-on { overflow: hidden; padding-bottom: var(--s-6); }
/* Full height, not flex: switching tabs sets an inline display on #todayView. */
#todayView .ub { height: 100%; min-height: 0; width: 100%; max-width: none; display: flex; flex-direction: column; }
#todayView .ub .page-head { align-items: center; margin-bottom: var(--s-4); }
#todayView .ub .page-title { flex: 1; min-width: 0; font-size: var(--fs-24); }
#todayView .ub-grid { flex: 1; min-height: 0; display: grid; gap: var(--s-3); grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); }
#todayView .ub-skel { border-radius: var(--r-lg); height: auto; }
#todayView .ub-card { min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 0; border-radius: var(--r-lg); text-align: left; font: inherit; cursor: pointer; color: var(--urg-text); transition: transform var(--t-fast), box-shadow var(--t-fast); }
#todayView .ub-card.u-now { background: var(--urg-now); }
#todayView .ub-card.u-today { background: var(--urg-today); }
#todayView .ub-card.u-week { background: var(--urg-week); }
#todayView .ub-card.u-ok { background: var(--urg-ok); box-shadow: inset 0 0 0 1px var(--border-strong); }
#todayView .ub-card * { color: inherit; }
#todayView .ub-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
#todayView .ub-card.u-ok:hover { box-shadow: inset 0 0 0 1px var(--border-strong), var(--shadow-2); }
#todayView .ub-card:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
#todayView .ub-card .l { display: flex; align-items: center; gap: 8px; font-size: var(--fs-13); font-weight: 600; }
#todayView .ub-card .l .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#todayView .ub-card .go { margin-left: auto; display: inline-flex; }
#todayView .ub-card .v { margin-top: auto; font-size: var(--fs-32); font-weight: 600; letter-spacing: var(--tracking-display); line-height: 1.1; white-space: nowrap; }
#todayView .ub-card .v small { font-size: var(--fs-14); font-weight: 500; letter-spacing: 0; margin-left: 2px; }
#todayView .ub-card .s { font-size: var(--fs-12); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: none; }
#todayView .ub-card .k { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-11); font-weight: 600; flex: none; }
@media (prefers-reduced-motion: reduce) { #todayView .ub-card { transition: none; } #todayView .ub-card:hover { transform: none; } }
@media (max-height: 760px) {
    #todayView.ub-on { padding-top: var(--s-4); padding-bottom: var(--s-4); }
    #todayView .ub-card { padding: 10px 14px; gap: 2px; }
    #todayView .ub-card .v { font-size: var(--fs-24); }
}
@media (max-width: 1000px) { #todayView .ub-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(4, minmax(0, 1fr)); } }
/* Phones and very short windows can't hold twelve readable cards, so there the board scrolls. */
@media (max-width: 640px), (max-height: 520px) {
    #todayView.ub-on { overflow: auto; }
    #todayView .ub { height: auto; }
    #todayView .ub .page-title { flex-basis: 100%; }
    #todayView .ub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none; grid-auto-rows: 132px; }
}
@media (min-width: 641px) and (max-height: 520px) { #todayView .ub-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
