/* Analytics (Month Strip) and other page details */

/* =====================================================================================
   Statistics · Concept 6 — Month Strip
   ===================================================================================== */

#statsView > header.ms-top { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; }
#statsView > header.ms-top .page-title { display: flex; align-items: baseline; gap: 10px; margin: 0; }
#statsView > header.ms-top .page-title h1 { margin: 0; }
#statsView > header.ms-top .header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.ms { display: flex; flex-direction: column; gap: 12px; }

/* figures */

/* rankings */

.ms-rk { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: 10.5px; font-weight: 700; color: var(--text-faint); }
.ms-top1 .ms-rk { background: #C99A2E; color: #fff; } .ms-top2 .ms-rk { background: #8E98A6; color: #fff; } .ms-top3 .ms-rk { background: #B0703F; color: #fff; }

/* laptop / tablet */

@media (max-width: 860px) {

    #statsView > header.ms-top .header-actions { margin-left: 0; width: 100%; flex-wrap: nowrap; }
    #statsView > header.ms-top .header-actions > .date-range-filter { flex: 1 1 260px; width: auto; min-width: 0; max-width: none; }
    #statsView > header.ms-top .header-actions > .date-preset-row { flex: 0 0 auto; }
}
@media (max-width: 640px) {

    #statsView > header.ms-top .header-actions { flex-wrap: wrap; }

    #statsView > header.ms-top .header-actions > .date-preset-row { flex: 1 1 140px; } #statsView > header.ms-top .header-actions > .date-preset-row select { width: 100%; }
    #statsView > header.ms-top .header-actions > .date-range-filter { order: 3; flex: 1 1 100%; }

}

/* ---- 6 · No Update 2h+: the red tint and the red clock stay; NO red outline around the card or row ---- */
html body .load-card.stale-highlight:not(#_) { border-color: var(--border) !important; }
html body .data-table tbody tr.stale-row > td:first-child, html body .data-table tbody tr.stale-row > td:not(:first-child) { box-shadow: none !important; }
@media (max-width: 899px) {
    html body .load-list tbody tr.stale-row { border-color: var(--border) !important; }
}

/* ---- 2 · every "pick one" control: the chosen option has blue text, like AM / PM; the others stay neutral ---- */
.view-toggle .view-toggle-btn { color: var(--text-muted); }
.view-toggle .view-toggle-btn.active, .view-toggle .view-toggle-btn[aria-pressed="true"] { color: var(--primary) !important; font-weight: 600; }
.view-toggle .view-toggle-btn.active .ic { color: var(--primary); }
.view-toggle .view-toggle-btn:not(.active):hover { color: var(--text-main); }
#dbTabs .db-tab-btn { color: var(--text-muted); }
#dbTabs .db-tab-btn.active, #dbTabs .db-tab-btn[aria-selected="true"] { color: var(--primary) !important; }
#dbTabs .db-tab-btn.active .ic { color: var(--primary); }
#dbTabs .db-tab-btn:not(.active):hover { color: var(--text-main); }
.dock-tabs .dock-tab.active, .dock-tabs .dock-tab[aria-current="page"] { color: var(--primary) !important; }
.dock-tabs .dock-tab.active .ic { color: var(--primary) !important; }
#loadForm #teamSeg button[aria-checked="true"] { color: var(--tb-primary) !important; font-weight: 700; }
#loadForm #teamSeg button[aria-checked="false"] { color: var(--tb-faint); }
#loadForm #teamSeg button[aria-checked="false"]:not(:disabled):hover, #loadForm .t12-ap button[aria-checked="false"]:not(:disabled):hover { color: var(--tb-text); }
.di-year-tabs .di-ytab.is-selected, .di-year-tabs .di-ytab[aria-pressed="true"] { color: var(--primary) !important; }
.di-year-tabs .di-ytab:not(.is-selected) { color: var(--text-muted); }
.tm-type-opt:has(input:checked) b { color: var(--primary); }

/* ---- 3 · Statistics header without the team buttons and the period-type buttons ---- */
#statsView > header.ms-top .header-actions { margin-left: auto; }
@media (max-width: 860px) {
    #statsView > header.ms-top .header-actions > .date-range-filter { order: 0; }
}
@media (max-width: 640px) {
    #statsView > header.ms-top .header-actions > .date-range-filter { order: 3; flex: 1 1 100%; }
    #statsView > header.ms-top .header-actions > .date-preset-row { flex: 1 1 100%; }
}

/* ---- 8 · Activity Log: "Activity Log (12)"; one block per saved change — who · when, then the changes ---- */
.ih-logt b .lg-n { font-weight: 500; color: var(--tb-faint, var(--text-faint)); margin-left: 2px; }
.ih-logt .ih-open { margin-left: auto; }
.ih-flog .irv-log, .ir-flog .irv-log { display: flex; flex-direction: column; gap: 0; }
.irv-lg.lg-e { display: grid !important; grid-template-columns: minmax(150px, 210px) minmax(0, 1fr); column-gap: 18px; row-gap: 2px; align-items: start;
    padding: 8px 0; border-top: 1px solid var(--tb-line, var(--border)); font-size: 12.5px; line-height: 1.45; }
.irv-lg.lg-e:first-child { border-top: 0; }
.lg-h { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.lg-h .lg-by { font-weight: 600; color: var(--tb-text, var(--text-main)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-h time { font-size: 11.5px; color: var(--tb-faint, var(--text-faint)); white-space: nowrap; font-variant-numeric: tabular-nums; }
ul.lg-c { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
ul.lg-c li { color: var(--tb-text, var(--text-main)); overflow-wrap: anywhere; text-wrap: pretty; }
.lg-k { color: var(--tb-muted, var(--text-muted)); }
.lg-v { color: var(--tb-text, var(--text-main)); font-weight: 600; }
.lg-nw { white-space: nowrap; }
.lg-ar { color: var(--tb-faint, var(--text-faint)); }
@media (max-width: 640px) {
    .irv-lg.lg-e { grid-template-columns: minmax(0, 1fr); row-gap: 4px; padding: 9px 0; }
    .lg-h { flex-direction: row; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; }
    .lg-nw { white-space: normal; }
}

/* List view: the Pickup / Delivery date + time may take two lines (date, then time) instead of being cut off */
.load-list .cell-when { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; line-height: 1.3; }
