
:root {
  /* ── LEGACY TOKENS (kept for bridge — do not remove) ── */
  --black: #191919; --sage: #9BA38E; --grey: #B3B3B3;
  --lgrey: #CCCCCC; --white: #FFFFFF; --label: #999999;
  --row-h: 52px; --hdr-h: 90px; --ctrl-h: 32px;

  /* ── FT DESIGN SYSTEM (Phase 1) ───────────────────────
     New canonical tokens. Use these for all new CSS.
     Legacy hex values are being migrated to these incrementally.
     ──────────────────────────────────────────────────── */

  /* Ink & surface */
  --ft-ink:          #191919;  /* primary text, headers, bars */
  --ft-ink-2:        #333333;  /* secondary text */
  --ft-muted:        #999999;  /* labels, meta */
  --ft-muted-2:      #B3B3B3;  /* softer meta (= legacy --grey) */
  --ft-surface:      #FFFFFF;  /* page / card background */
  --ft-surface-alt:  #FAFAFA;  /* subtle zebra / hover */
  --ft-surface-2:    #F5F5F5;  /* deeper hover / disabled bg */

  /* Lines — unified greys, replacing var(--ft-line) / var(--ft-line-soft) / var(--ft-line-soft) / var(--ft-line-strong) */
  --ft-line:         var(--ft-line);  /* default hairline (table rows, card edges) */
  --ft-line-soft:    var(--ft-line-soft);  /* softer divider (rare) */
  --ft-line-strong:  var(--ft-line-strong);  /* input borders, stronger dividers */

  /* Brand */
  --ft-brand:        #9BA38E;  /* sage — primary action */
  --ft-brand-ink:    #FFFFFF;  /* text on brand */

  /* Semantic */
  --ft-err:          #E24B4A;  /* destructive / errors */
  --ft-warn:         #7C3A10;  /* warning strip (viewing-other) */
  --ft-ok:           #2E7D32;  /* success */

  /* Focus */
  --ft-focus:        #9BA38E;  /* focus ring color (= brand) */
  --ft-focus-ring:   0 0 0 2px rgba(155, 163, 142, 0.35);

  /* Radius & shadow */
  --ft-r-sm: 2px;
  --ft-r-md: 4px;
  --ft-r-lg: 8px;
  --ft-shadow-1: 0 1px 2px rgba(0,0,0,0.06);
  --ft-shadow-2: 0 4px 16px rgba(0,0,0,0.08);
  --ft-shadow-pop: 0 8px 32px rgba(0,0,0,0.12);

  /* Space scale */
  --ft-s-1: 4px;
  --ft-s-2: 8px;
  --ft-s-3: 12px;
  --ft-s-4: 16px;
  --ft-s-5: 24px;
  --ft-s-6: 32px;
  --ft-s-7: 48px;

  /* Type scale */
  --ft-t-micro: 10px;
  --ft-t-small: 11px;
  --ft-t-body:  13px;
  --ft-t-body2: 14px;
  --ft-t-h3:    16px;
  --ft-t-h2:    18px;
  --ft-t-h1:    22px;

  /* Letter spacing (uppercase labels) */
  --ft-ls-label: 0.08em;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: 'Forma', sans-serif; font-weight: 400; background: var(--white);
       color: var(--black); font-size: 14px; display: flex; flex-direction: column; }
button, select, input { font-family: 'Forma', sans-serif; }
select { -webkit-appearance: none; appearance: none; }
::selection { background: #e0e0e0; color: var(--black); }

/* ── LOADING ── */
#loading { display: flex; align-items: center; justify-content: center;
           height: 100vh; flex-direction: column; gap: 12px; }
.spinner { width: 28px; height: 28px; border: 2px solid var(--lgrey);
           border-top-color: var(--sage); border-radius: 50%;
           animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 12px; color: var(--grey); letter-spacing: 0.04em; }

/* ── FETCH INDICATOR ── */
#fetch-bar { position: fixed; top: 0; left: 0; right: 0; height: 5px;
             background: var(--sage); z-index: 999;
             transform: scaleX(0); transform-origin: left;
             transition: transform 0.3s ease, opacity 0.3s ease; opacity: 0; }
#fetch-bar.active { opacity: 1; animation: fetchProgress 4s ease-out forwards; }
@keyframes fetchProgress { 0%{transform:scaleX(0)} 100%{transform:scaleX(0.92)} }
#fetch-bar.done { transform: scaleX(1) !important; opacity: 0;
                  transition: transform 0.15s ease, opacity 0.5s ease 0.15s;
                  animation: none; }

/* ── AUTH ERROR ── */
#auth-error { display: none; align-items: center; justify-content: center;
              height: 100vh; flex-direction: column; gap: 16px; text-align: center; padding: 32px; }
#auth-error h2 { font-size: 18px; font-weight: 700; }
#auth-error p { font-size: 13px; color: var(--grey); }

/* ── MAIN APP ── */
#app { display: none; flex-direction: column; height: 100%; overflow: hidden; width: 100%; }

/* ── HEADER ── */
.app-header { background: var(--black); padding: 12px max(24px, calc((100% - 1200px) / 2 + 24px)); height: 48px;
              display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
              transition: background 0.2s; }
.app-header.viewing-other { background: #7c3a10; }
.wordmark { font-weight: 700; font-size: 15px; letter-spacing: 0.05em; color: var(--white); }
.wordmark-wrap { display: flex; align-items: baseline; gap: 10px; }
#viewing-label { font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.75);
                 letter-spacing: 0.03em; display: none; }
.header-right { display: flex; align-items: center; gap: 16px; }
.nav-view-label { font-weight: 700; font-size: 13px; color: var(--sage); letter-spacing: 0.02em; pointer-events: none; }
.staff-chips { display: flex; gap: 4px; }
.chip { width: 28px; height: 28px; border-radius: 50%; font-size: 10px; font-weight: 700;
        cursor: pointer; border: 1.5px solid #444; color: #555; background: none;
        letter-spacing: 0; display: flex; align-items: center; justify-content: center;
        padding: 0; flex-shrink: 0; }
.chip.active { background: var(--sage); border-color: var(--sage); color: var(--white); }
.user-pill { font-size: 11px; color: var(--grey); }

/* ── WEEK NAV ── */
.week-nav { background: var(--black); border-bottom: none;
            padding: 0 max(24px, calc((100% - 1200px) / 2 + 24px)); height: 40px; display: flex; align-items: center;
            justify-content: flex-start; gap: 8px; flex-shrink: 0; }
.week-nav-left { display: flex; align-items: center; gap: 8px; flex: 1; }
.week-label { font-weight: 700; font-size: 13px; color: var(--white); }
.week-controls { display: flex; align-items: center; gap: 8px; }
.week-pill { display: flex; border: 1px solid #777; border-radius: 20px; overflow: hidden; height: 28px; }
.week-pill .nav-btn { width: 28px; background: var(--black); border: none;
  color: var(--white); cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.week-pill .today-btn { padding: 0 14px; background: var(--black);
  border: none; border-left: 1px solid #777; border-right: 1px solid #777;
  color: var(--white); font-size: 11px; font-weight: 700;
  font-family: 'Forma', sans-serif; cursor: pointer; white-space: nowrap; }
.week-pill .today-btn.on-today { background: var(--sage); border-color: var(--sage); }

/* ── TIMER BAR (desktop) ── */
.timer-bar { background: var(--black); border-bottom: none;
             padding: 0; display: flex; align-items: center; flex-shrink: 0;
             overflow: visible; min-width: 0; }
/* Single view: spacer/gap hidden, controls full width */
.timer-left-spacer { display: none; }
.timer-divider-gap { display: none; }
.timer-controls { flex: 1; display: flex; align-items: center; gap: 10px;
                  padding: 10px max(24px, calc((100% - 1200px) / 2 + 24px)); overflow: visible; min-width: 0; background: var(--black); }
/* Timer chips — pill on the wrap, select/input transparent inside */
.timer-field-wrap { position: relative; display: flex; align-items: center; min-width: 0;
                    border: 1px solid #777; border-radius: 20px; background: var(--black); }
.timer-field-wrap.wide { flex: 2; } .timer-field-wrap.mid { flex: 1.5; } .timer-field-wrap.note-wrap { flex: 2; }
.timer-field-wrap.time-wrap { flex-shrink: 0; width: 120px; }
.timer-select, .timer-note, .timer-start-chip {
  background: transparent; border: none; border-radius: 0;
  color: var(--white); font-size: 12px; padding: 7px 0;
  margin: 0 20px; flex: 1; min-width: 0; box-sizing: border-box;
  appearance: none; -webkit-appearance: none;
  font-family: 'Forma', sans-serif; cursor: pointer;
}
.timer-note { cursor: text; }
.timer-select:focus, .timer-note:focus, .timer-start-chip:focus { outline: none; }
.timer-start-chip { text-align: center; margin: 0 14px; }
.timer-select option { background: #191919 !important; color: #ffffff !important; }
.timer-select optgroup { background: #191919; color: #cccccc; }
/* Chip filled → sage on wrap */
.timer-field-wrap.chip-filled { background: var(--sage); border-color: var(--sage); }
/* Chip unassigned (timer running, no value) → amber border on wrap */
.timer-field-wrap.unassigned { border-color: #EF9F27; }
.timer-field-dot { position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
                   width: 7px; height: 7px; border-radius: 50%; background: var(--sage);
                   pointer-events: none; z-index: 2; display: none; }
.timer-controls.running .timer-field-dot { display: block; animation: statusPulse 1.8s ease-in-out infinite; }
.timer-controls.running .timer-field-wrap.chip-filled .timer-field-dot { background: var(--white); }
.timer-controls.running .timer-field-wrap.unassigned .timer-field-dot { background: #EF9F27; }
.timer-controls.running .timer-field-wrap > select,
.timer-controls.running .timer-field-wrap > input { padding-left: 22px; }
.timer-display { font-weight: 700; font-size: 22px; color: var(--sage);
                 min-width: 80px; text-align: center; cursor: default; }
.timer-display.idle { color: #555; }
.timer-bar input[type="text"]::placeholder { color: rgba(255,255,255,0.4); }
.timer-start-chip { text-align: center; }
/* Custom timer dropdowns */
.t-chip-face { flex: 1; padding: 7px 20px; cursor: pointer; min-width: 0;
               font-size: 12px; color: var(--white); user-select: none;
               display: flex; align-items: center; }
.t-chip-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-chip-face.placeholder .t-chip-label { color: rgba(255,255,255,0.4); }
.t-dd-list { position: absolute; top: calc(100% + 4px); left: 0; min-width: 100%;
             background: var(--white); border: 1px solid #ccc; border-radius: 8px;
             max-height: 280px; overflow-y: auto; z-index: 1000; display: none; }
.t-dd-list.open { display: block; }
.t-dd-item { padding: 7px 14px; font-size: 12px; color: var(--black); cursor: pointer; white-space: nowrap; }
.t-dd-item:hover, .t-dd-item:focus { background: #f0f0f0; outline: none; }
.t-dd-item.t-sel { color: var(--sage); }
.t-dd-div { padding: 3px 14px; font-size: 8px; color: #bbb;
            border-top: 1px solid #e8e8e8; margin-top: 2px; letter-spacing: 0.05em; background: var(--white); }
.t-dd-search-wrap { padding: 6px 10px 5px; border-bottom: 1px solid #eee; background: var(--white); position: sticky; top: 0; z-index: 1; }
.t-dd-search { width: 100%; border: none; outline: none; font-size: 12px; font-family: 'Forma', sans-serif; color: var(--black); background: transparent; padding: 0; }
.t-dd-search::placeholder { color: var(--lgrey); }
/* Scrollbar inside dropdown list */
.t-dd-list::-webkit-scrollbar { width: 5px; }
.t-dd-list::-webkit-scrollbar-track { background: transparent; }
.t-dd-list::-webkit-scrollbar-thumb { background: #ccc; border-radius: 8px; }
/* Timer button: always sage, swaps triangle ↔ square icon only */
.start-btn { width: 32px; height: 32px; background: var(--sage); border: none;
             cursor: pointer; display: flex; align-items: center; justify-content: center;
             color: var(--white); flex-shrink: 0; border-radius: 50%; }
.timer-cancel-btn {
  width: 32px; height: 32px; border-radius: 50%; background: none;
  border: 1px solid #777; cursor: pointer; color: var(--grey);
  font-size: 13px; font-weight: 700; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  line-height: 1; padding-bottom: 1px;
}
.timer-cancel-btn:hover { border-color: #777; color: var(--grey); }
.timer-split-btn {
  width: 32px; height: 32px; border-radius: 50%; background: none;
  border: 1px solid #777; cursor: pointer; color: var(--grey);
  font-size: 13px; font-weight: 700; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  line-height: 1; padding-bottom: 1px;
}
.timer-split-btn:hover { border-color: #777; color: var(--grey); }

/* ── GRID WRAPPER ── */
.grid-wrapper { flex: 1; overflow-y: auto; overflow-x: hidden; scrollbar-gutter: stable both-edges; min-height: 0; }
.grid-wrapper.chip-loading { opacity: 0.35; pointer-events: none; transition: opacity 0.15s; }
.grid-wrapper-inner { width: 100%; max-width: 1200px; margin: 0 auto; }
/* Side-by-side split disabled — single-column layout always */

/* ── STATUS VIEW ── */
.status-view { display: none; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.status-view-inner { display: flex; flex-direction: column; flex: 1; overflow-y: auto; padding: 24px; max-width: 1200px; width: 100%; align-self: center; }
.status-view-hdr { background: var(--black); height: 52px; min-height: 52px; padding: 0 max(24px, calc((100% - 1200px) / 2 + 24px)); display: flex; align-items: center;
                   justify-content: space-between; flex-shrink: 0; color: var(--white); }
.status-view-title { font-size: 15px; font-weight: 700; color: var(--sage); }
#status-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
/* ── MOBILE VIEWING BANNER ── */
#mob-viewing-banner { display: none; background: var(--sage); color: var(--white);
  text-align: center; font-size: 12px; font-weight: 700;
  letter-spacing: 0.05em; padding: 6px 16px; flex-shrink: 0; }
/* ── BUDGET HEALTH STRIP ── */
#budget-health-strip { background: var(--white); border-bottom: 2px solid var(--black); box-sizing: border-box; }
.bhs-main { display: grid; grid-template-columns: 190px 1fr 1fr 120px 100px; min-height: 90px; align-items: stretch; }
.bhs-main.bhs-merged { grid-template-columns: 190px 2fr 120px 100px; }
.bhs-bar-col { border-right: 1px solid var(--ft-line-soft); }
.bhs-col2 { padding: 10px 12px; border-right: 1px solid var(--ft-line-soft); display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.bhs-col2 .bhs-proj { font-size: 12px; font-weight: 700; color: var(--black); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bhs-col2 .bhs-stage { font-size: 11px; color: var(--black); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bhs-col2 .bhs-proj[onclick]:hover, .bhs-col2 .bhs-stage[onclick]:hover { text-decoration: underline dotted; text-underline-offset: 2px; }
.bhs-col2 .bhs-status { display: flex; align-items: center; gap: 5px; margin-top: 4px; }
.bhs-col2 .bhs-status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.bhs-col2 .bhs-status-lbl { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.bhs-mid { padding: 8px 12px; display: flex; flex-direction: column; justify-content: center; }
.bhs-mid-lbl { font-size: 10px; font-weight: 700; color: var(--label); letter-spacing: .04em; text-transform: uppercase; margin-bottom: 4px; }
.bhs-mid-val { font-size: 18px; font-weight: 700; color: var(--black); }
.bhs-mid-sub { font-size: 11px; color: var(--black); margin-top: 2px; }
.bhs-bars { padding: 6px 12px; display: flex; flex-direction: column; justify-content: center; gap: 4px; border-right: 1px solid var(--ft-line-soft); position: relative; }
/* Single continuous reference line at the 100%-of-budget column. Spans the
   full vertical extent of the project's bars so it reads as one line, not
   per-row segments. Position: track starts at 96px (label) + 12px (container
   pad-left) = 108px from the left; track-width is the container minus
   label(96) + val(160) + horizontal-pad(2×12) = 280px. The 100% mark sits at
   (100/scale)% across the track, surfaced via the --mark-pct custom property. */
.bhs-bars-100-line {
  position: absolute;
  top: 6px; bottom: 6px;
  width: 1.5px;
  background: #b6b6b6;
  pointer-events: none;
  left: calc(108px + (100% - 280px) * var(--mark-pct, 100) / 100);
  transform: translateX(-50%);
  z-index: 2;
}
.bhs-bar-row { display: flex; align-items: center; gap: 0; height: 24px; }
.bhs-bar-lbl { width: 96px; flex-shrink: 0; font-size: 11px; color: var(--black); text-align: right; padding-right: 8px; white-space: nowrap; }
.bhs-bar-track { flex: 1; height: 9px; background: var(--ft-line); border-radius: 0; position: relative; overflow: visible; }
.bhs-bar-fill { position: absolute; top: 0; left: 0; height: 100%; }
.bhs-bar-lag  { position: absolute; top: 0; height: 100%; background: var(--sage); opacity: .3; }
.bhs-bar-over { position: absolute; top: 0; height: 100%; background: #E24B4A; opacity: .55; }
.bhs-bar-mark { position: absolute; top: -2px; width: 1px; height: 13px; background: #666; }
.bhs-bar-tick { position: absolute; top: 0; width: 1.5px; height: 100%; background: var(--black); z-index: 3; }
.bhs-bar-val { width: 160px; flex-shrink: 0; font-size: 11px; padding-left: 10px; white-space: nowrap; overflow: hidden; }
.bhs-bar-val strong { font-weight: 700; font-size: 14px; margin-right: 6px; }
.bhs-bar-val .muted { font-size: 11px; color: var(--black); }
.bhs-col5 { padding: 10px 10px; border-right: 1px solid var(--ft-line-soft); display: flex; flex-direction: column; justify-content: center; }
.bhs-col6 { padding: 10px 10px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.bhs-notes-row { height: 28px; padding: 0 12px; display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--ft-line); overflow: hidden; }
.bhs-notes-row .bhs-note-lbl { font-size: 9px; font-weight: 700; color: var(--label); letter-spacing: .06em; text-transform: uppercase; flex-shrink: 0; }
.bhs-notes-row .bhs-note-txt { font-size: 11px; font-weight: 700; color: var(--black); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bhs-note-input { flex: 1; font-size: 11px; font-weight: 700; color: var(--black); background: transparent; border: none; outline: none; font-family: inherit; min-width: 0; padding: 0; }
.bhs-note-input:focus { background: rgba(0,0,0,0.04); border-radius: 2px; padding: 0 3px; }
.bhs-chip { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; font-size: 8px; font-weight: 700; flex-shrink: 0; }

/* ── BUDGET SIDE PANEL ── */
#budget-panel { display:none; width:260px; flex-shrink:0; flex-direction:column;
                overflow-y:auto; background:#fff; border-left:1px solid var(--ft-line); }
#budget-panel.visible { display:flex; }
.bp-hdr { height:44px; padding:0 14px; border-bottom:1px solid var(--ft-line); background:#f5f5f5;
          display:flex; align-items:center; justify-content:space-between; flex-shrink:0; }
.bp-proj { font-size:10px; color:var(--grey); letter-spacing:.03em; margin-bottom:1px; }
.bp-stage { font-size:12px; font-weight:700; }
.bp-tl { display:flex; flex-direction:column; align-items:flex-end; gap:2px; }
.bp-tl-dot { width:10px; height:10px; border-radius:50%; }
.bp-tl-dot.green { background:#639922; }
.bp-tl-dot.amber { background:#EF9F27; }
.bp-tl-dot.red   { background:#E24B4A; }
.bp-tl-dot.none  { background:var(--ft-line-strong); }
.bp-tl-lbl { font-size:9px; color:var(--grey); letter-spacing:.03em; }
.bp-sec { padding:10px 14px; border-bottom:1px solid var(--ft-line-soft); }
.bp-sec-ttl { font-size:9px; font-weight:700; letter-spacing:.08em; text-transform:uppercase;
              color:var(--grey); margin-bottom:10px; }
.bh-track { position:relative; height:20px; background:var(--ft-line); border-radius:3px;
            overflow:hidden; margin-bottom:6px; }
.bh-top { position:absolute; top:0; left:0; height:11px; border-radius:3px 0 0 0; }
.bh-lag { position:absolute; top:0; height:11px; opacity:.4; }
.bh-bot { position:absolute; bottom:0; left:0; height:9px; display:flex;
          align-items:center; padding-left:5px; overflow:hidden; }
.bh-divider { position:absolute; top:11px; left:0; right:0; height:.5px; background:#d0d0d0; }
.bh-legend { display:flex; flex-direction:column; gap:4px; margin-bottom:8px; }
.bh-leg-row { display:flex; align-items:center; gap:5px; }
.bh-leg-sw { width:10px; height:6px; border-radius:1px; flex-shrink:0; }
.bh-leg-txt { font-size:10px; color:var(--grey); flex:1; }
.bh-leg-val { font-size:10px; font-weight:700; }
.bh-callout { padding:6px 8px; border-radius:4px; background:#fef3e2;
              display:flex; align-items:center; justify-content:space-between; margin-top:6px; }
.bp-staff-row { display:flex; align-items:center; gap:7px; padding:4px 0; }
.bp-si { width:22px; height:22px; border-radius:50%; display:flex; align-items:center;
         justify-content:center; font-size:9px; font-weight:700; flex-shrink:0;
         border:1px solid rgba(0,0,0,.08); }
.bp-sname { flex:1; font-size:11px; }
.bp-sbar-wrap { width:60px; height:5px; background:var(--ft-line); border-radius:3px; overflow:hidden; }
.bp-sbar-fill { height:100%; border-radius:3px; }
.bp-shrs { font-size:11px; width:44px; text-align:right; flex-shrink:0; color:var(--grey); }
.bp-shrs.viewer { font-weight:700; color:var(--black); }
.bp-shrs.warn   { color:#EF9F27; }
.bp-dl-row { display:flex; align-items:center; justify-content:space-between; }
.bp-dl-date { font-size:12px; font-weight:700; }
.bp-dl-days { font-size:11px; color:var(--grey); }
.bp-hpd { margin-top:6px; padding:7px 9px; background:#fafafa; border-radius:4px;
          display:flex; align-items:center; justify-content:space-between; }
.bp-hpd-val { font-size:14px; font-weight:700; }
.bp-hpd-lbl { font-size:10px; color:var(--grey); }
.bp-dl-note { font-size:10px; color:var(--grey); margin-top:5px; line-height:1.4; }
.bp-notes-body { font-size:11px; line-height:1.5; color:#666; background:#fafafa;
                 border-radius:4px; padding:7px 9px; font-weight:600; }
.bp-mention { display:inline-block; padding:0 5px; border-radius:3px;
              font-size:10px; font-weight:700; }
.bp-nb-section { padding:14px; display:flex; flex-direction:column; align-items:center;
                 gap:10px; text-align:center; }
.bp-nb-title { font-size:12px; font-weight:700; }
.bp-nb-sub { font-size:11px; color:var(--grey); line-height:1.4; }
.bp-req-btn { padding:8px 16px; background:var(--black); color:var(--white); border:none;
              font-size:12px; font-weight:700; cursor:pointer; width:100%;
              font-family:inherit; }

/* ── WEEK GRID ── */
.week-grid { display: grid; grid-template-columns: 210px repeat(7,1fr); min-width: 980px; align-content: start; border-left: 2px solid var(--black); border-right: 2px solid var(--black); border-bottom: 2px solid var(--black); }
.toggle-cell { background: #f5f5f5; border-bottom: 2px solid var(--black);
               border-right: 2px solid var(--black); height: var(--hdr-h);
               display: grid; grid-template-columns: 1fr 1fr; padding: 0;
               position: sticky; top: 0; z-index: 4; }
/* Toggle buttons: centred, shorter labels */
.toggle-btn { padding: 0; font-size: 12px; font-weight: 700;
              cursor: pointer; border: none; background: none; color: #666;
              height: 100%; display: flex; align-items: center; justify-content: center; }
.toggle-btn:first-child { border-right: 1px solid var(--lgrey); }
.toggle-btn.active { color: var(--black); background: #ececec; }
.day-header { background: #f5f5f5; border-bottom: 2px solid var(--black);
              border-right: 1px solid var(--lgrey); padding: 8px 10px;
              text-align: center; height: var(--hdr-h);
              display: flex; flex-direction: column; align-items: center; justify-content: center;
              position: sticky; top: 0; z-index: 4; }
.day-name { font-size: 9px; font-weight: 700; letter-spacing: 0.12em;
            text-transform: uppercase; color: #666; }
.day-date { font-weight: 700; font-size: 20px; line-height: 1.1; margin-top: 1px; }
.day-total { display: none; }
.day-edit-btn { margin-top: 4px; font-size: 9px; font-weight: 400; color: #666;
                cursor: pointer; background: none; border: none; text-decoration: underline; }
.day-edit-btn:hover { color: var(--black); }
.day-overlap-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #f97316; margin-top: 3px; flex-shrink: 0;
}
.project-label { background: var(--white); border-right: 2px solid var(--black);
                 border-bottom: 1px solid var(--lgrey); padding: 0 14px;
                 display: flex; align-items: center; height: var(--row-h);
                 position: sticky; left: 0; z-index: 2; }
.proj-name { font-size: 12px; font-weight: 700; }
.proj-stage { font-size: 11px; color: var(--grey); margin-top: 2px; }
.time-cell { border-right: 1px solid var(--lgrey); border-bottom: 1px solid var(--lgrey);
             padding: 0; height: var(--row-h); position: relative;
             background: var(--white); cursor: pointer;
             display: flex; align-items: center; justify-content: center; }
.time-cell:hover { background: #f9f9f9; }
.time-cell.has-entry { background: #f4f5f2; }
.time-cell.today-col { background: #f9faf8; }
.time-cell.today-col.has-entry { background: #eef0eb; }
.time-cell.weekend { background: #fafafa; cursor: default; }
.entry-pill { background: none; color: var(--black); padding: 0;
              font-size: 13px; font-weight: 700; display: flex;
              align-items: center; justify-content: center;
              cursor: pointer; width: 100%; height: 100%; }
.entry-pill.nonbill { color: var(--grey); }
.entry-note { font-size: 10px; color: var(--grey); margin-top: 3px;
              overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.add-entry-plus { position: absolute; bottom: 5px; right: 7px;
                  font-size: 16px; color: var(--lgrey); line-height: 1; }
.time-cell:hover .add-entry-plus { color: var(--sage); }
.week-total-label { background: var(--lgrey); border-right: 2px solid var(--black);
                    border-bottom: 2px solid var(--black); padding: 0 14px 0 14px;
                    display: flex; flex-direction: column; justify-content: center;
                    font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
                    text-transform: uppercase; color: var(--grey);
                    height: 52px; position: sticky; top: var(--hdr-h); z-index: 3; }
.week-total-label-num { font-size: 22px; font-weight: 700; color: var(--black);
                        letter-spacing: 0; text-transform: none; margin-top: 1px; }
.week-total-cell { background: var(--lgrey); border-right: 1px solid #bbb;
                   border-bottom: 2px solid var(--black); display: flex;
                   align-items: center; justify-content: center;
                   font-size: 15px; font-weight: 700; height: 52px;
                   position: sticky; top: var(--hdr-h); z-index: 3; }

/* ── DAY VIEW ── */
.day-view { min-width: 0; border-left: 2px solid var(--black); border-right: 2px solid var(--black); border-bottom: 2px solid var(--black); }
.day-view-header { display: grid; grid-template-columns: 210px 1fr;
                   border-bottom: 2px solid var(--black); background: #f5f5f5; height: var(--hdr-h); }
.day-view-toggle { display: grid; grid-template-columns: 1fr 1fr;
                   border-right: 2px solid var(--black); height: 100%; }
.day-view-date-cell { padding: 0 12px; display: flex;
                      align-items: center; justify-content: flex-start; gap: 10px; }
.day-view-date-txt { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.day-view-date-txt { font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.day-nav-btns { display: flex; gap: 6px; }
.day-nav-btn { width: 26px; height: 26px; border: 1px solid var(--lgrey);
               background: var(--white); cursor: pointer; font-size: 12px;
               color: var(--black); display: flex; align-items: center; justify-content: center; }
/* Unified control height for all day-entry row elements */
.day-entry-row { display: grid; grid-template-columns: 210px 1fr;
                 border-bottom: 1px solid var(--lgrey); min-height: var(--row-h); background: var(--white); }
/* Hide save/play/delete on existing entries until hover or active */
.day-entry-row .btn-save,
.day-entry-row .btn-restart,
.day-entry-row .btn-del { opacity: 0; transition: opacity 0.15s; }
.day-entry-row:hover .btn-save,
.day-entry-row:hover .btn-restart,
.day-entry-row:hover .btn-del,
.day-entry-row.row-active .btn-save,
.day-entry-row.row-active .btn-restart,
.day-entry-row.row-active .btn-del { opacity: 1; }
/* New entry row and inline edit row: always show save button */
.new-entry-row .btn-save,
.new-entry-row .btn-del,
.day-entry-row.editing .btn-save,
.day-entry-row.editing .btn-del { opacity: 1 !important; }
.day-entry-project { padding: 0 14px; border-right: 2px solid var(--black);
                     display: flex; flex-direction: column; justify-content: center; position: relative; }
.day-entry-project::after { content: ''; position: absolute;
                             bottom: -1px; right: -2px; height: 1px; width: 2px;
                             background: var(--black); z-index: 1; pointer-events: none; }
.day-entry-proj-name { font-size: 12px; font-weight: 700; }
.day-entry-stage { font-size: 11px; color: var(--black); margin-top: 2px; }
.day-entry-detail { padding: 0 12px; display: flex; align-items: center; gap: 6px; }
.time-sep { color: var(--grey); flex-shrink: 0; display: flex; align-items: center; }
/* All interactive controls share identical height, border, background */
.time-input, .note-input, .btn-save, .btn-play, .btn-del {
  height: var(--ctrl-h); border: 1px solid var(--lgrey); background: #f9f9f9;
  box-sizing: border-box; font-family: 'Forma', sans-serif; }
.time-input { width: 88px; padding: 0 6px; font-size: 12px; font-weight: 700;
              color: var(--black); text-align: center; flex-shrink: 0; }
.time-input:focus { outline: 1px solid var(--sage); background: var(--white); }
.note-input { flex: 1; min-width: 80px; padding: 0 8px; font-size: 12px; color: var(--black); border: 1px solid var(--lgrey); }
.note-input:focus { outline: 1px solid var(--sage); background: var(--white); }
.note-input::placeholder { color: var(--lgrey); }
/* Save: square icon button, sage icon, same border/bg as inputs */
.btn-save { width: var(--ctrl-h); display: flex; align-items: center; justify-content: center;
            cursor: pointer; color: var(--sage); flex-shrink: 0; border: 1px solid var(--lgrey); background: #f9f9f9; }
.btn-save:hover { background: var(--sage); color: var(--white); border-color: var(--sage); }
/* Play: same box, sage icon */
.btn-play { width: var(--ctrl-h); display: flex; align-items: center; justify-content: center;
            cursor: pointer; font-size: 11px; color: var(--sage); flex-shrink: 0; }
.btn-play:hover { border-color: var(--sage); background: var(--sage); color: var(--white); }
/* Delete: same box, grey X */
.btn-del { width: var(--ctrl-h); display: flex; align-items: center; justify-content: center;
           cursor: pointer; color: var(--grey); flex-shrink: 0; font-size: 13px; font-weight: 700;
           border: 1px solid var(--lgrey); background: #f9f9f9; }
.btn-del:hover { color: var(--ft-err); border-color: var(--ft-err); background: #fff0f0; }
/* Round play/restart button in day view rows */
.btn-restart { width: var(--ctrl-h); height: var(--ctrl-h); border-radius: 50%;
               background: var(--sage); border: none; cursor: pointer;
               display: flex; align-items: center; justify-content: center;
               flex-shrink: 0; }
.btn-restart:hover { background: var(--black); }
/* Duration badge: coloured block, same height, flush left */
.dur-badge { height: var(--ctrl-h); min-width: 44px; padding: 0 4px;
             background: none; color: var(--black);
             font-size: 13px; font-weight: 700; text-align: right;
             display: flex; align-items: center; justify-content: flex-end;
             flex-shrink: 0; }
.dur-badge.nonbill { color: var(--grey); }
/* Live timer badge keeps its colour */
.live-entry-dur { background: none !important; color: var(--sage) !important; }
/* Mobile entry row buttons — identical box style */
.mob-play-btn { width: 36px; height: 36px; background: #f9f9f9; border: 1px solid var(--lgrey);
                display: flex; align-items: center; justify-content: center;
                cursor: pointer; flex-shrink: 0; overflow: visible; padding: 0; }
.mob-play-btn:hover { border-color: var(--sage); background: var(--sage); }
.mob-play-btn:hover svg polygon { fill: var(--white); }
.add-row { display: grid; grid-template-columns: 210px 1fr;
           border-bottom: 1px solid var(--lgrey); background: #fafafa;
           height: var(--row-h); cursor: pointer; }
.add-row:hover { background: #f4f5f2; }
.add-row-left { padding: 0 14px; display: flex; align-items: center;
                font-size: 12px; font-weight: 700; color: var(--sage);
                gap: 8px; border-right: 2px solid var(--black); }
.add-row-right { padding: 0 16px; display: flex; align-items: center;
                 font-size: 12px; color: var(--lgrey); }
.day-total-row { display: grid; grid-template-columns: 210px 1fr;
                 border-bottom: 2px solid var(--black); background: var(--lgrey); height: 52px; }
.day-total-lbl { padding: 0 14px; display: flex; flex-direction: column; justify-content: center;
                 font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
                 text-transform: uppercase; color: #666;
                 border-right: 2px solid var(--black); }
.day-total-lbl-num { font-size: 22px; font-weight: 700; color: var(--black);
                     letter-spacing: 0; text-transform: none; margin-top: 1px; }
.day-total-val { padding: 0 16px; display: flex; align-items: center;
                 font-size: 14px; font-weight: 700; color: #666; }

/* ── NEW ENTRY ROW (inline) ── */
.new-entry-row { display: grid; grid-template-columns: 210px 1fr;
                 border-bottom: 1px solid var(--lgrey); background: #f6faf7; }
.new-entry-left { padding: 10px 14px; border-right: 2px solid var(--black);
                  display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.new-entry-sel { width: 100%; padding: 4px 8px; border: 1px solid var(--lgrey);
                 font-size: 12px; font-family: 'Forma', sans-serif;
                 color: var(--black); background: #f9f9f9; height: var(--ctrl-h); box-sizing: border-box; }
/* Entry-row TDD chip — light variant of the timer-bar TDD overlay */
.entry-tdd-wrap { position: relative; display: flex; align-items: center; min-width: 0;
                  border: 1px solid var(--lgrey); background: #f9f9f9;
                  height: var(--ctrl-h); box-sizing: border-box; }
.entry-tdd-wrap > .t-chip-face { flex: 1; padding: 4px 8px; cursor: pointer; min-width: 0;
                                  font-size: 12px; color: var(--black); user-select: none;
                                  display: flex; align-items: center; }
.entry-tdd-wrap > .t-chip-face > .t-chip-label { overflow: hidden; text-overflow: ellipsis;
                                                  white-space: nowrap; flex: 1; color: var(--black); }
.entry-tdd-wrap > .t-chip-face.placeholder > .t-chip-label { color: var(--grey); }
.entry-tdd-wrap > .t-chip-face::after { content: ''; flex-shrink: 0; margin-left: 6px;
                                         width: 0; height: 0;
                                         border-left: 4px solid transparent;
                                         border-right: 4px solid transparent;
                                         border-top: 5px solid var(--grey); }
.entry-tdd-wrap > .t-chip-face:focus { outline: none; }
.entry-tdd-wrap:focus-within { border-color: var(--sage); }
.new-entry-right { padding: 0 12px; display: flex; align-items: center; gap: 6px; min-height: var(--row-h); }
.day-entry-project:hover .day-entry-proj-name { text-decoration: underline dotted; text-underline-offset: 2px; }
.day-entry-project:hover .day-entry-stage { text-decoration: underline dotted; text-underline-offset: 2px; }
.day-entry-row.editing { background: #f6faf7; }
.day-entry-row.editing .day-entry-project { background: #f6faf7; }

/* ── MOBILE ── */
@media (max-width: 767px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: flex !important; }
  #app { overflow: hidden; }
  .app-header { padding: 44px 20px 12px; }
  .wordmark { font-size: 16px; }
  .week-nav { display: none; }
  .timer-bar { display: none; }
  .grid-wrapper { display: none; }
  #mobile-view { display: flex; flex-direction: column; flex: 1; overflow: hidden; }
  .mob-day-nav { background: var(--black); padding: 0 12px 14px;
                 display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
  .mob-day-label { text-align: right; flex: 1; min-width: 0; }
  .mob-day-label-date { font-weight: 700; font-size: 15px; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mob-day-label-sub { font-size: 10px; color: var(--grey); margin-top: 1px; }
  .mob-nav-icons { display: flex; align-items: center; gap: 2px; flex-shrink: 0;
                   margin-left: 4px; padding-left: 8px; border-left: 1px solid #333; }
  .mob-nav-ic { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
                background: none; border: none; padding: 0; border-radius: 6px; cursor: pointer; }
  .mob-nav-ic:active { background: rgba(255,255,255,0.08); }
  .mob-nav-btn { width: 32px; height: 32px; border: 1px solid #444; background: none;
                 color: var(--grey); font-size: 16px; display: flex;
                 align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
  .mob-nav-pill { display: flex; align-items: center; border: 1px solid #777;
                  border-radius: 20px; overflow: hidden;
                  background: var(--black); flex-shrink: 0; }
  .mob-nav-pill .mob-nav-btn { width: 32px; height: 30px; border: none; color: var(--white); }
  .mob-today-btn { padding: 0 10px; height: 30px; border: none;
                   border-left: 1px solid #777; border-right: 1px solid #777;
                   background: var(--black); color: var(--white);
                   font-size: 11px; font-weight: 700; font-family: 'Forma', sans-serif;
                   cursor: pointer; letter-spacing: 0.04em; flex-shrink: 0; }
  .mob-today-btn.on-today { background: var(--sage); border-color: var(--sage); }
  /* Mobile bottom-timer chips start white (light-on-light) and flip to
     sage when a project / stage is selected. The :not(.chip-filled)
     guard is critical — without it the white-background rule would also
     apply to the filled state, leaving white text on a white wrap. */
  .mob-bottom-timer .timer-field-wrap:not(.chip-filled) { background: var(--white); border-color: var(--lgrey); }
  .mob-bottom-timer .timer-field-wrap:not(.chip-filled) .t-chip-face { color: var(--black); }
  .mob-bottom-timer .timer-field-wrap:not(.chip-filled) .t-chip-face.placeholder .t-chip-label { color: var(--grey); }
  .mob-bottom-timer .t-dd-list { top: auto; bottom: calc(100% + 4px); max-height: 200px; }
  .mob-week-strip { background: #111; padding: 10px 20px;
                    display: flex; gap: 6px; flex-shrink: 0; border-bottom: 1px solid #222; }
  .mob-week-day { flex: 1; text-align: center; padding: 6px 4px; border-radius: 4px; cursor: pointer; }
  .mob-week-day.active { background: var(--sage); }
  .mob-wday-name { font-size: 9px; font-weight: 700; letter-spacing: 0.08em;
                   text-transform: uppercase; color: var(--grey); }
  .mob-week-day.active .mob-wday-name { color: rgba(255,255,255,0.7); }
  .mob-wday-num { font-size: 16px; font-weight: 700; color: var(--white); line-height: 1.2; }
  .mob-wday-hrs { font-size: 9px; color: var(--grey); margin-top: 1px; }
  .mob-week-day.active .mob-wday-hrs { color: rgba(255,255,255,0.6); }
  .mob-scroll { flex: 1; overflow-y: auto; padding-bottom: 145px; -webkit-overflow-scrolling: touch; }
  .mob-day-total-hdr { padding: 10px 20px; background: var(--lgrey); border-bottom: 1px solid #ccc;
                       display: flex; align-items: center; justify-content: space-between; }
  .mob-day-total-lbl { font-size: 11px; font-weight: 700; }
  .mob-day-total-val { font-size: 12px; font-weight: 700; }
  .mob-entry-row { padding: 14px 20px; border-bottom: 1px solid var(--lgrey);
                   background: var(--white); display: flex; align-items: center;
                   gap: 12px; min-height: 56px; }
  .mob-entry-info { flex: 1; cursor: pointer; }
  .mob-entry-proj { font-size: 13px; font-weight: 700; }
  .mob-entry-stage { font-size: 11px; color: var(--black); margin-top: 2px; }
  .mob-entry-note { font-size: 11px; color: var(--grey); margin-top: 2px; font-style: italic; }
  .mob-entry-times { text-align: right; flex-shrink: 0; }
  .mob-entry-dur { font-size: 15px; font-weight: 700; }
  .mob-entry-range { font-size: 10px; color: var(--grey); margin-top: 2px; }
  .mob-edit-btn { width: 36px; height: 36px; background: #f9f9f9; border: 1px solid var(--lgrey);
                  display: flex; align-items: center; justify-content: center;
                  cursor: pointer; font-size: 14px; color: var(--grey); flex-shrink: 0; }
  .mob-add-row { padding: 14px 20px; border-bottom: 1px solid var(--lgrey);
                 background: #fafafa; display: flex; align-items: center;
                 gap: 10px; cursor: pointer; min-height: 56px; }
  .mob-add-icon { width: 28px; height: 28px; background: var(--sage); border-radius: 50%;
                  display: flex; align-items: center; justify-content: center;
                  color: var(--white); font-size: 18px; flex-shrink: 0; }
  .mob-add-lbl { font-size: 12px; font-weight: 700; color: var(--sage); }
  .mob-bottom-timer { position: fixed; bottom: 0; left: 0; right: 0; background: var(--white);
                      border-top: 2px solid var(--black); padding: 10px 16px 28px 16px; z-index: 40; }
  .mob-timer-row1 { display: flex; gap: 8px; margin-bottom: 8px; }
  .mob-timer-sel { flex: 1; padding: 9px 10px; border: 1px solid var(--lgrey);
                   font-size: 13px; background: #f9f9f9; color: var(--black); min-width: 0; }
  .mob-timer-row2 { display: flex; align-items: center; gap: 4px; }
  .mob-timer-note { flex: 1; min-width: 0; height: 42px; padding: 0 14px; border: 1px solid var(--lgrey);
                    border-radius: 21px; font-size: 13px; color: var(--black); background: #f9f9f9; box-sizing: border-box;
                    transition: padding 0.2s ease; }
  /* Note takes the full row width while being edited; the other chips on
     row 2 collapse out of the way and reappear on blur. */
  #m-timer-start, #m-timer-disp, #m-start-btn, #m-live-dot {
    transition: max-width 0.2s ease, opacity 0.2s ease, padding 0.2s ease, margin 0.2s ease;
    overflow: hidden;
  }
  .mob-timer-row2:has(#m-timer-note:focus) #m-timer-start,
  .mob-timer-row2:has(#m-timer-note:focus) #m-timer-disp,
  .mob-timer-row2:has(#m-timer-note:focus) #m-start-btn,
  .mob-timer-row2:has(#m-timer-note:focus) #m-live-dot {
    max-width: 0; min-width: 0; opacity: 0; padding: 0 !important;
    margin: 0 !important; border: 0 !important;
  }
  .mob-timer-disp { font-weight: 700; font-size: 18px; color: var(--sage);
                    min-width: 56px; text-align: center; flex-shrink: 0; }
  .mob-timer-disp.idle { color: var(--lgrey); }
  /* Mobile timer button: right edge aligned with row1 */
  .mob-start-btn { width: 42px; height: 42px; background: var(--sage); border: none;
                   border-radius: 50%; cursor: pointer; display: flex;
                   align-items: center; justify-content: center;
                   color: var(--white); flex-shrink: 0; margin-right: 0; }
  /* edit sheet */
  .mob-sheet-overlay { position: fixed; inset: 0; background: rgba(25,25,25,0.5);
                       z-index: 60; display: none; align-items: flex-end; }
  .mob-sheet-overlay.open { display: flex; }
  .mob-sheet { background: var(--white); width: 100%; border-radius: 20px 20px 0 0;
               padding: 0 0 32px; box-shadow: 0 -8px 32px rgba(0,0,0,0.12); }
  .mob-sheet-handle { width: 36px; height: 4px; background: var(--lgrey);
                      border-radius: 2px; margin: 12px auto 0; }
  .mob-sheet-hdr { padding: 16px 20px 12px; display: flex; align-items: center;
                   justify-content: space-between; border-bottom: 1px solid var(--lgrey); }
  .mob-sheet-title { font-size: 14px; font-weight: 700; }
  .mob-sheet-del { font-size: 11px; font-weight: 700; color: var(--ft-err); background: none; border: none; cursor: pointer; touch-action: manipulation; }
  .mob-sheet-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
  .mob-field-group { display: flex; flex-direction: column; gap: 5px; }
  .mob-field-lbl { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; color: var(--grey); }
  .mob-field-input { padding: 10px 12px; border: 1px solid var(--lgrey); font-size: 14px; color: var(--black); background: #f9f9f9; width: 100%; touch-action: manipulation; }
  .mob-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .mob-sheet-save { margin: 0 20px; padding: 14px; background: var(--black); color: var(--white);
                    border: none; font-size: 14px; font-weight: 700; cursor: pointer; width: calc(100% - 40px); touch-action: manipulation; }
}
@media (min-width: 768px) {
  .mobile-only { display: none !important; }
  #mobile-view { display: none !important; }
  .mob-sheet-overlay { display: none !important; }
}

/* ── CUSTOM CONFIRM DIALOG ── */
#confirm-overlay {
  position: fixed; inset: 0; background: rgba(25,25,25,0.45);
  z-index: 200; display: none; align-items: center; justify-content: center;
}
#confirm-overlay.open { display: flex; }
#confirm-box {
  background: var(--white); padding: 28px 32px 24px;
  max-width: 320px; width: calc(100% - 48px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
#confirm-msg { font-size: 14px; font-weight: 700; margin-bottom: 20px; line-height: 1.4; }
#confirm-btns { display: flex; gap: 10px; justify-content: flex-end; }
#confirm-ok   { padding: 8px 20px; background: var(--ft-err); color: var(--white);
                border: none; font-size: 12px; font-weight: 700; cursor: pointer;
                font-family: 'Forma', sans-serif; }
#confirm-cancel { padding: 8px 16px; background: none; color: var(--grey);
                  border: 1px solid var(--lgrey); font-size: 12px; font-weight: 700;
                  cursor: pointer; font-family: 'Forma', sans-serif; }

/* ── CALENDAR PICKER ── */
#cal-overlay {
  position: fixed; inset: 0; background: rgba(25,25,25,0.35);
  z-index: 300; display: none; align-items: flex-start; justify-content: center;
}
#cal-overlay.open { display: flex; }
#cal-box {
  background: var(--white); margin-top: 88px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  width: 280px; padding: 0;
}
.cal-header {
  background: var(--sage); color: var(--white);
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; font-size: 13px; font-weight: 700;
}
.cal-nav { background: none; border: none; color: var(--white);
           font-size: 16px; cursor: pointer; padding: 0 6px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); padding: 8px; gap: 2px; }
.cal-dow { text-align: center; font-size: 9px; font-weight: 700; color: var(--grey);
           letter-spacing: 0.08em; padding: 4px 0; text-transform: uppercase; }
.cal-day { text-align: center; font-size: 12px; padding: 6px 2px; cursor: pointer; }
.cal-day:hover { background: var(--lgrey); }
.cal-day.today { font-weight: 700; color: var(--sage); }
.cal-day.selected { background: var(--sage); color: var(--white); font-weight: 700; }
.cal-day.other-month { color: var(--lgrey); }
.cal-day.empty { cursor: default; }
@media (max-width: 767px) {
  #cal-box { margin-top: 120px; width: 300px; }
}

/* ── VIEWING-AS BANNER ── */
#viewing-banner { display: none !important; }


/* ── CONFLICT DIALOG ── */
#conflict-overlay {
  position: fixed; inset: 0; background: rgba(25,25,25,0.45);
  z-index: 200; display: none; align-items: center; justify-content: center;
}
#conflict-overlay.open { display: flex; }
#conflict-box {
  background: var(--white); padding: 28px 32px 24px;
  max-width: 380px; width: calc(100% - 48px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
#conflict-title { font-size: 13px; font-weight: 700; margin-bottom: 8px; color: var(--black); }
#conflict-detail { font-size: 12px; color: var(--grey); margin-bottom: 20px; line-height: 1.6; }
#conflict-btns { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
#conflict-keep { padding: 8px 16px; background: none; color: var(--grey);
  border: 1px solid var(--lgrey); font-size: 12px; font-weight: 700;
  cursor: pointer; font-family: 'Forma', sans-serif; }
#conflict-stop { padding: 8px 16px; background: var(--black); color: var(--white);
  border: none; font-size: 12px; font-weight: 700;
  cursor: pointer; font-family: 'Forma', sans-serif; }


/* ── STALE TIMER (CROSS-DAY) DIALOG ── */
#stale-timer-overlay {
  position: fixed; inset: 0; background: rgba(25,25,25,0.45);
  z-index: 200; display: none; align-items: center; justify-content: center;
}
#stale-timer-overlay.open { display: flex; }
#stale-timer-box {
  background: var(--white); padding: 28px 32px 24px;
  max-width: 420px; width: calc(100% - 48px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
#stale-timer-title { font-size: 13px; font-weight: 700; margin-bottom: 8px; color: var(--black); }
#stale-timer-detail { font-size: 12px; color: var(--grey); margin-bottom: 20px; line-height: 1.6; }
#stale-timer-pickers { margin-bottom: 16px; }
#stale-timer-pickers .stl-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
#stale-timer-pickers .stl-lbl { width: 80px; font-size: 11px; color: var(--grey);
  text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
#stale-timer-pickers .stl-input { flex: 1; height: 32px; padding: 0 10px;
  border: 1px solid var(--lgrey); background: #fafafa; font-family: 'Forma', sans-serif;
  font-size: 13px; color: var(--black); outline: none; }
#stale-timer-pickers .stl-input:focus { border-color: var(--sage); background: var(--white); }
#stale-error { font-size: 11px; color: #B33A3A; margin-top: 6px; min-height: 14px; }
#stale-timer-btns { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
#stale-continue { padding: 8px 16px; background: none; color: var(--grey);
  border: 1px solid var(--lgrey); font-size: 12px; font-weight: 700;
  cursor: pointer; font-family: 'Forma', sans-serif; }
#stale-set-end { padding: 8px 16px; background: none; color: var(--black);
  border: 1px solid var(--black); font-size: 12px; font-weight: 700;
  cursor: pointer; font-family: 'Forma', sans-serif; }
#stale-confirm { padding: 8px 16px; background: var(--black); color: var(--white);
  border: none; font-size: 12px; font-weight: 700;
  cursor: pointer; font-family: 'Forma', sans-serif; }


/* ── SETTINGS VIEW ── */
.settings-view {
  display: none; flex-direction: column; flex: 1; min-height: 0; overflow: hidden;
}
.settings-tabs {
  background: var(--black); display: flex; align-items: center; gap: 8px; padding: 0 max(24px, calc((100% - 1200px) / 2 + 24px));
  height: 52px; min-height: 52px; flex-shrink: 0;
}
.stab { padding: 6px 16px; border: 1px solid #777; border-radius: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: 0; text-transform: none;
  color: rgba(255,255,255,0.5); cursor: pointer; font-family: 'Forma', sans-serif; }
.stab.active { background: var(--sage); border-color: var(--sage); color: var(--white); }
.stab:hover:not(.active) { color: var(--white); }
.settings-content { flex: 1; overflow-y: auto; overflow-x: hidden; max-width: 1200px; width: 100%; align-self: center; }
.h-black-spacer { background: var(--black); height: 40px; min-height: 40px; flex-shrink: 0; }
.stab-panel { display: none; }
.stab-panel.active { display: block; }
.s-section-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px 8px 38px; border-bottom: 2px solid var(--ft-line-soft); background: #fafafa;
  position: sticky; top: 0; z-index: 5;
  height: 48px; box-sizing: border-box;
}
.s-section-title {
  font-size: 9px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--label);
}
.s-add-btn {
  padding: 5px 14px; font-size: 11px; font-weight: 700; background: var(--black);
  color: var(--white); border: none; cursor: pointer; letter-spacing: 0; font-family: 'Forma', sans-serif;
}
.s-add-btn:hover { background: var(--sage); }
.s-table { width: 100%; border-collapse: collapse; }
/* Projects subtab: fixed layout so the colgroup widths actually pin the
   billable/status columns under their section-hdr labels. The default
   table-layout:auto sizes columns by content (e.g. the 28px toggle), which
   shrinks col 2/3 well to the left of the BILLABLE/STATUS labels. */
.s-projects-table { table-layout: fixed; }
.s-projects-table tbody td { overflow: hidden; text-overflow: ellipsis; }
.s-table thead th {
  font-size: 9px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--label); padding: 8px 10px; text-align: left; white-space: nowrap;
  border-bottom: 2px solid var(--ft-line-soft); background: #fafafa;
}
.s-table thead th.s-th-center { text-align: center; }
.s-table tbody td { padding: 0; border-bottom: 1px solid var(--ft-line-soft); vertical-align: middle; }
.s-table tbody tr:hover td { background: #fafafa; }
.s-table tbody tr.s-inactive td { opacity: 0.5; }
.s-table tbody tr.s-inactive:hover td { opacity: 0.7; background: #fafafa; }
.s-td { padding: 10px 16px; display: flex; align-items: center; gap: 0; height: 46px; }
.s-name-input {
  border: none; background: transparent; font-size: 13px; font-weight: 700;
  color: var(--black); outline: none; cursor: pointer; width: 100%;
  font-family: 'Forma', sans-serif;
}
.s-name-input:focus { background: #f0f5ee; padding: 2px 6px; outline: 1px solid var(--sage); cursor: text; }
.s-status-pill {
  display: inline-flex; align-items: center; font-size: 9px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 10px;
  border-radius: 999px;
}
.s-status-pill.active { background: #edf2ea; color: var(--sage); }
.s-status-pill.archived { background: #f5f5f5; color: var(--grey); }
.s-status-pill.inactive { background: #f5f5f5; color: var(--grey); }
.s-toggle-track {
  width: 28px; height: 16px; background: var(--lgrey); border-radius: 8px;
  position: relative; cursor: pointer; flex-shrink: 0; transition: background 0.15s;
}
.s-toggle-track.on { background: var(--sage); }
.s-toggle-thumb {
  position: absolute; top: 2px; left: 2px; width: 12px; height: 12px;
  background: white; border-radius: 50%; transition: left 0.15s;
}
.s-toggle-track.on .s-toggle-thumb { left: 14px; }
.s-row-actions { display: flex; gap: 4px; opacity: 0; transition: opacity 0.1s; }
.s-table tbody tr:hover .s-row-actions { opacity: 1; }
/* Drag handle for staff reordering — column 1 of each active-staff tbody. */
.s-table .s-drag-handle { width: 24px; text-align: center; color: var(--lgrey);
                          cursor: grab; user-select: none; opacity: 0.55; transition: opacity 0.1s, color 0.1s; }
.s-table .s-staff-tbody:hover .s-drag-handle { opacity: 1; color: var(--grey); }
.s-table .s-staff-tbody.s-dragging { opacity: 0.4; }
.s-table .s-staff-tbody.s-dragging .s-drag-handle { cursor: grabbing; }
.s-act-btn {
  font-size: 10px; font-weight: 700; letter-spacing: 0; padding: 4px 12px;
  border: 1px solid var(--lgrey); border-radius: 999px;
  background: none; color: var(--grey);
  cursor: pointer; font-family: 'Forma', sans-serif;
  display: inline-flex; align-items: center; justify-content: center;
  line-height: 1.2; height: 22px; white-space: nowrap;
}
.s-act-btn:hover { border-color: var(--black); color: var(--black); }
/* Danger variant — used on the deactivate button inside the expand panel. */
.s-act-btn.s-act-btn-danger { border-color: #d9b3b3; color: #a04040; }
.s-act-btn.s-act-btn-danger:hover { border-color: #a04040; color: #a04040; background: #fce6e6; }

/* ── Staff table: two-tier expandable rows ─────────────────────────────
   The collapsed row (.s-staff-row) shows essentials; the expand row
   (.s-staff-expand-row) is hidden until admin clicks the chevron. Inside
   the expand panel, sections are stacked vertically; fields inside each
   section flow horizontally on wide viewports and wrap on narrow ones. */
.s-table.s-table-expand th.r { text-align: right; }
.s-table .s-staff-row { cursor: pointer; transition: background 0.08s; }
.s-table .s-staff-row:hover { background: #fafafa; }
.s-table .s-staff-row td { padding: 8px 12px; vertical-align: middle; }
.s-table .s-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid rgba(0,0,0,.12);
  cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; letter-spacing: 0.02em;
}
.s-name-stack { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.s-name        { font-size: 13px; font-weight: 700; color: var(--black); line-height: 1.2; }
.s-name-meta   { font-size: 10px; color: var(--grey); letter-spacing: 0.03em;
                 text-transform: uppercase; font-weight: 700; line-height: 1.2; }
.s-headline-rate { font-size: 13px; font-weight: 700; }
/* Chevron — small, square-ish, neutral colour so it doesn't compete with
   the danger / save buttons that appear in the expand panel. */
.s-chev-btn {
  width: 28px; padding: 0; font-size: 11px;
  border-color: transparent; color: var(--grey);
}
.s-table .s-staff-row:hover .s-chev-btn { border-color: var(--ft-line-strong); color: var(--black); }

/* Expand row — single full-width cell with the inset panel. */
.s-staff-expand-row td { padding: 0; border-bottom: 1px solid var(--ft-line); background: #f9f9f9; }
.s-staff-expand-panel {
  padding: 14px 22px 16px;
  display: flex; flex-direction: column; gap: 14px;
}
.s-staff-expand-section {
  display: flex; flex-direction: column; gap: 6px;
  padding: 8px 0; border-bottom: 1px dashed #e4e2dc;
}
.s-staff-expand-section:last-child { border-bottom: none; }
.s-staff-expand-h {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--grey);
  display: flex; align-items: baseline; gap: 10px;
}
.s-section-sub {
  font-size: 10px; font-weight: 400; color: var(--lgrey);
  letter-spacing: 0; text-transform: none;
}
/* Field grid inside a section — flows horizontally, wraps as needed. */
.s-staff-expand-grid {
  display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-end;
}
.s-field {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--grey);
}
.s-field-in {
  border: 1px solid var(--ft-line-soft);
  padding: 4px 8px;
  font-size: 12px; font-weight: 700;
  border-radius: 3px;
  background: #fff;
  font-family: 'Forma', sans-serif;
  color: var(--black);
}
.s-field-in:focus { outline: none; border-color: var(--ft-line-strong); }
.s-field .s-role-sel { background: #fff; }
.s-field-readonly {
  font-size: 12px; font-weight: 700;
  padding: 5px 8px;
  color: var(--black);
  letter-spacing: 0; text-transform: none;
}
.s-staff-expand-actions {
  display: flex; justify-content: flex-end; gap: 10px; align-items: center;
}
.s-proj-label { font-size: 12px; font-weight: 400; }
.s-proj-expand td { padding: 0 16px 8px; background: #fafafa; border-bottom: 1px solid var(--ft-line); }
.s-proj-expand-inner { padding: 4px 0; }
.s-divider-row td {
  padding: 6px 16px 4px; background: #f5f5f5 !important; font-size: 9px;
  font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--label); border-bottom: 1px solid var(--ft-line);
}
.s-add-row td { padding: 0; border-bottom: none; background: #fafafa; }
.s-add-row-inner { display: flex; align-items: center; gap: 8px; padding: 10px 16px; height: 46px; }
.s-add-input {
  flex: 1; border: 1px solid var(--ft-line-strong); padding: 5px 10px; font-size: 12px;
  color: var(--black); background: var(--white); outline: none; font-family: 'Forma', sans-serif;
}
.s-add-input:focus { border-color: var(--sage); }
.s-add-input::placeholder { color: var(--lgrey); }
.s-add-save {
  padding: 5px 14px; font-size: 11px; font-weight: 700; background: var(--sage);
  color: var(--white); border: none; cursor: pointer; font-family: 'Forma', sans-serif;
}
.s-add-cancel {
  font-size: 11px; font-weight: 700; color: var(--grey); background: none;
  border: none; cursor: pointer; font-family: 'Forma', sans-serif;
}
.s-add-cancel:hover { color: var(--black); }
.s-exit-btn {
  padding: 6px 14px; background: none; border: 1px solid #555; color: var(--grey);
  font-size: 12px; font-weight: 700; cursor: pointer; font-family: 'Forma', sans-serif;
  letter-spacing: 0; flex-shrink: 0;
}
.s-exit-btn:hover { border-color: var(--white); color: var(--white); }
/* Stages two-column layout */
.s-stages-layout { display: grid; grid-template-columns: 1fr 1fr; }
.s-stage-col { border-right: 1px solid var(--ft-line); }
.s-stage-col:last-child { border-right: none; }
.s-stage-col-hdr {
  padding: 14px 16px 10px; border-bottom: 1px solid var(--ft-line); background: #fafafa;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 4;
}
.s-stage-col-title {
  font-size: 9px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--label);
}
.s-stage-item {
  display: flex; align-items: center; gap: 8px; padding: 0 16px;
  border-bottom: 1px solid var(--ft-line-soft); height: 46px;
}
.s-stage-item:hover { background: #fafafa; }
.s-stage-item.s-stage-inactive { opacity: 0.4; }
.s-stage-order { font-size: 9px; font-weight: 700; color: var(--label); width: 16px; text-align: right; flex-shrink: 0; }
.s-stage-arrows { display: flex; flex-direction: column; gap: 1px; flex-shrink: 0; opacity: 0; transition: opacity 0.1s; }
.s-stage-item:hover .s-stage-arrows { opacity: 1; }
.s-arr-btn {
  width: 14px; height: 13px; background: none; border: none; cursor: pointer;
  color: var(--grey); font-size: 9px; display: flex; align-items: center; justify-content: center;
}
.s-arr-btn:hover { color: var(--black); }
.s-stage-name { flex: 1; font-size: 12px; font-weight: 700; }
.s-stage-name-input {
  flex: 1; border: none; background: transparent; font-size: 12px; font-weight: 700;
  color: var(--black); outline: none; cursor: pointer; font-family: 'Forma', sans-serif;
}
.s-stage-name-input:focus { background: #f0f5ee; padding: 0 4px; outline: 1px solid var(--sage); cursor: text; }
.s-stage-actions { display: flex; gap: 4px; opacity: 0; transition: opacity 0.1s; }
.s-stage-item:hover .s-stage-actions { opacity: 1; }
.s-stage-add-row {
  display: flex; align-items: center; gap: 8px; padding: 10px 16px;
  background: #fafafa; border-top: 1px dashed var(--ft-line-strong);
}
.s-stage-add-input {
  flex: 1; border: 1px solid var(--ft-line-strong); padding: 5px 8px; font-size: 12px;
  background: var(--white); outline: none; font-family: 'Forma', sans-serif;
}
.s-stage-add-input:focus { border-color: var(--sage); }
.s-stage-add-input::placeholder { color: var(--lgrey); }
.s-stage-inactive-divider {
  padding: 5px 16px 3px; background: #f5f5f5; font-size: 9px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--label);
  border-top: 1px solid var(--ft-line); border-bottom: 1px solid var(--ft-line);
}
.s-role-sel {
  border: 1px solid var(--ft-line); padding: 3px 8px; font-size: 11px; color: var(--black);
  background: #fafafa; cursor: pointer; appearance: none; -webkit-appearance: none;
  font-family: 'Forma', sans-serif;
}
.s-role-sel:focus { outline: 1px solid var(--sage); }
.s-staff-note {
  padding: 10px 24px; font-size: 11px; color: var(--grey);
  background: #fafafa; border-bottom: 1px solid var(--ft-line); font-style: italic;
}

/* ── FILTER / MASS-EDIT VIEW ── */
/* ── NAV ICON BUTTONS ── */
.nav-icon-btn {
  position: relative; width: 36px; height: 48px; border: none; background: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; padding: 0;
}
.nav-icon-btn svg { display: block; }
.nav-icon-btn .nav-tip {
  position: absolute; bottom: 6px; left: 50%;
  transform: translateX(-50%) translateY(calc(100% + 2px));
  background: var(--white); color: var(--black);
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em;
  padding: 3px 8px; white-space: nowrap;
  pointer-events: none; opacity: 0;
  transition: opacity 0.12s, transform 0.12s;
  z-index: 20; font-family: 'Forma', sans-serif;
}
.nav-icon-btn .nav-tip::before {
  content: ''; position: absolute; top: -5px; left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-bottom-color: var(--white); border-top: none;
}
.nav-icon-btn:hover .nav-tip {
  opacity: 1;
  transform: translateX(-50%) translateY(calc(100% + 6px));
}
.nav-icon-btn.active svg { }
.flt-nav-btn { padding: 6px 14px; background: var(--black); border: 1px solid #777;
  color: rgba(255,255,255,0.6); font-size: 12px; font-weight: 700; cursor: pointer;
  font-family: 'Forma', sans-serif; border-radius: 20px; }
.flt-nav-btn:hover { border-color: #777; color: rgba(255,255,255,0.6); }

#filter-view {
  display: none; flex-direction: column; flex: 1; min-height: 0; overflow: hidden;
}

.flt-preset-pill { display: flex; border: 1px solid #777; border-radius: 20px; overflow: hidden; height: 28px; flex-shrink: 0; }
.flt-pp-arrow { width: 28px; background: var(--black); border: none; color: var(--white);
  cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.flt-preset-pill .flt-pp-arrow:last-child { border-left: 1px solid #777; }
.flt-preset { padding: 0 10px; background: var(--black); border: none; border-left: 1px solid #777;
  color: rgba(255,255,255,0.6); font-size: 11px; font-weight: 700;
  font-family: 'Forma', sans-serif; cursor: pointer; white-space: nowrap; }
.flt-preset.active { background: var(--sage); color: var(--white); }
.flt-controls-bar {
  background: var(--black); padding: 0 max(24px, calc((100% - 1200px) / 2 + 24px)); height: 40px; min-height: 40px; display: flex; align-items: center;
  flex-wrap: nowrap; gap: 8px; flex-shrink: 0;
}
.flt-criteria-bar {
  background: var(--black); height: 52px; min-height: 52px; padding: 0 max(24px, calc((100% - 1200px) / 2 + 24px)); display: flex; align-items: center;
  flex-wrap: nowrap; gap: 8px; flex-shrink: 0; border-bottom: 2px solid #2a2a2a;
}
.flt-ctrl-label {
  font-size: 10px; font-weight: 700; color: var(--grey); letter-spacing: 0.06em; flex-shrink: 0;
}
.flt-date-input { padding: 5px 12px; border: 1px solid #777; border-radius: 20px;
  font-size: 12px; font-family: 'Forma', sans-serif;
  color: var(--white); background: var(--black); width: 96px; text-align: center; }
.flt-date-input::placeholder { color: rgba(255,255,255,0.4); }
.flt-date-sep { color: #777; font-size: 14px; }
.flt-ctrl-select {
  padding: 5px 8px; border: 1px solid #555; font-size: 12px; font-family: 'Forma', sans-serif;
  color: var(--white); background: #2a2a2a; min-width: 160px;
}
.flt-ctrl-sep { width: 1px; height: 20px; background: #3a3a3a; flex-shrink: 0; }
.flt-staff-chips-wrap { display: flex; gap: 4px; flex-shrink: 0; }
.flt-staff-chip {
  width: 28px; height: 28px; border-radius: 50%; font-size: 10px; font-weight: 700;
  cursor: pointer; border: 1.5px solid #444; color: #555; background: none;
  letter-spacing: 0; font-family: 'Forma', sans-serif;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.flt-staff-chip.active { color: var(--white); }
.flt-staff-all {
  width: 28px; height: 28px; border-radius: 50%; font-size: 9px; font-weight: 700;
  cursor: pointer; border: 1.5px solid #777; color: rgba(255,255,255,0.5); background: none;
  letter-spacing: 0; font-family: 'Forma', sans-serif;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.flt-staff-all.active { color: var(--white); border-color: var(--white); }
.flt-run-btn { padding: 6px 14px; background: var(--black); border: 1px solid #777;
  color: rgba(255,255,255,0.6); font-size: 12px; font-weight: 700; cursor: pointer;
  font-family: 'Forma', sans-serif; border-radius: 20px; flex-shrink: 0; }
.flt-run-btn:hover { border-color: #777; color: rgba(255,255,255,0.6); }
.flt-run-btn.active { background: var(--sage); border-color: var(--sage); color: var(--white); }
.flt-run-btn.active:hover { background: var(--sage); border-color: var(--sage); }
.flt-exit-btn {
  padding: 6px 14px; background: none; border: 1px solid #555; color: var(--grey);
  font-size: 12px; font-weight: 700; cursor: pointer; font-family: 'Forma', sans-serif;
  letter-spacing: 0; flex-shrink: 0; margin-left: auto;
}
.flt-exit-btn:hover { border-color: var(--white); color: var(--white); }
.flt-print-btn { padding: 6px 14px; background: var(--black); border: 1px solid #777;
  color: rgba(255,255,255,0.6); font-size: 12px; font-weight: 700; cursor: pointer;
  font-family: 'Forma', sans-serif; border-radius: 20px; flex-shrink: 0; }
.flt-print-btn:hover { border-color: #777; color: rgba(255,255,255,0.6); }
.flt-print-btn.active { background: var(--sage); border-color: var(--sage); color: var(--white); }
.flt-print-btn.active:hover { background: var(--sage); border-color: var(--sage); }

/* Results area */
.flt-results-wrap { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow-y: auto; overflow-x: auto; max-width: 1200px; width: 100%; align-self: center; }

.flt-summary-bar {
  padding: 10px 24px; background: var(--lgrey); border-bottom: 2px solid var(--black);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.flt-summary-count { font-size: 12px; color: var(--black); font-weight: 700; margin-right: 6px; }
.flt-summary-text { font-size: 12px; font-weight: 700; color: var(--black); }
.flt-summary-sub  { font-size: 11px; color: var(--grey); margin-left: 8px; font-weight: 400; }
.flt-select-all-btn {
  font-size: 11px; font-weight: 700; color: var(--sage); cursor: pointer;
  background: none; border: none; font-family: 'Forma', sans-serif; padding: 0;
}
.flt-select-all-btn:hover { text-decoration: underline; }

.flt-table-wrap { flex: none; overflow: visible; }

.flt-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.flt-table thead th {
  background: #fafafa; color: var(--label); font-size: 9px; font-weight: 700;
  letter-spacing: 0.09em; text-transform: uppercase; padding: 8px 10px;
  text-align: left; position: sticky; top: 0; z-index: 2; white-space: nowrap;
  border-bottom: 2px solid var(--ft-line-soft);
}
.flt-table thead th:first-child { width: 44px; text-align: center; }
.flt-table thead th.flt-th-hrs { text-align: right; }
.flt-table tbody td {
  padding: 10px 12px; border-bottom: 1px solid var(--lgrey); font-size: 12px;
  color: var(--black); vertical-align: middle;
}
.flt-table tbody td:first-child { text-align: center; }
.flt-table tbody tr:hover td   { background: #f9faf8; }
.flt-table tbody tr.flt-row-sel td { background: #edf2ea; }
.flt-td-proj { font-weight: 700; white-space: nowrap; }
.flt-td-stage { color: var(--grey); white-space: nowrap; }
.flt-td-hrs  { font-weight: 700; text-align: right; white-space: nowrap; }
.flt-td-hrs.nonbill { color: var(--grey); }
.flt-td-time   { color: var(--grey); white-space: nowrap; font-size: 11px; }
.flt-td-date   { white-space: nowrap; }
.flt-td-note   { color: var(--grey); font-size: 11px; font-style: italic; min-width: 120px; }
.flt-note-input { width: 100%; min-width: 120px; border: none; background: transparent; font-size: 11px; font-style: italic; color: var(--grey); padding: 0; outline: none; box-sizing: border-box; }
.flt-note-input:focus { background: var(--white); border: 1px solid var(--lgrey); border-radius: 3px; padding: 1px 4px; outline: 1px solid var(--sage); font-style: normal; color: var(--black); }
.flt-note-input::placeholder { color: var(--lgrey); }
.flt-td-person { white-space: nowrap; font-size: 11px; color: var(--grey); }
.flt-table thead th.flt-sortable {
  cursor: pointer; user-select: none;
}
.flt-table thead th.flt-sortable:hover { background: #f5f5f5; color: var(--black); }
.flt-table thead th.flt-sort-active    { color: var(--black); }
/* Sort diamond: SVG with two stacked triangles */
.flt-sort-icon { display: inline-block; vertical-align: middle; margin-left: 5px; position: relative; top: -1px; }
.flt-sort-icon svg { display: block; }
.flt-sort-up   { transition: opacity 0.1s; }
.flt-sort-down { transition: opacity 0.1s; }
/* Person subtotal rows */
.flt-person-total td {
  background: #f0f2ed !important; font-weight: 700; font-size: 11px;
  color: var(--grey); border-bottom: 2px solid var(--lgrey);
  border-top: 1px solid #d0d5c8;
}
.flt-person-total td:last-child { color: var(--black); font-size: 13px; }
body.flt-print-mode .flt-table thead th:first-child,
body.flt-print-mode .flt-table tbody td:first-child,
body.flt-print-mode .flt-person-total td:first-child { display: none; }

.flt-empty, .flt-loading {
  padding: 64px 24px; text-align: center; color: var(--grey); font-size: 13px;
}
.flt-success {
  padding: 64px 24px; text-align: center; color: var(--sage); font-size: 14px; font-weight: 700;
}

/* Action bar */
.flt-action-bar {
  display: none; align-items: center; gap: 12px; padding: 12px 24px;
  background: var(--black); border-top: 2px solid var(--sage); flex-shrink: 0; flex-wrap: wrap;
}
.flt-action-bar.open { display: flex; }
.flt-sel-count { color: var(--sage); font-size: 12px; font-weight: 700; flex-shrink: 0; min-width: 150px; }
.flt-action-label { color: var(--grey); font-size: 10px; font-weight: 700; letter-spacing: 0.06em; flex-shrink: 0; }
.flt-action-sel {
  padding: 5px 8px; border: 1px solid #555; font-size: 12px; font-family: 'Forma', sans-serif;
  color: var(--white); background: #2a2a2a; min-width: 160px;
}
.flt-move-btn {
  padding: 7px 20px; background: var(--sage); border: none; color: var(--white);
  font-size: 12px; font-weight: 700; cursor: pointer; font-family: 'Forma', sans-serif;
  letter-spacing: 0.04em; flex-shrink: 0;
}
.flt-move-btn:hover { background: #8a9280; }

/* Move confirmation dialog */
#flt-move-overlay {
  position: fixed; inset: 0; background: rgba(25,25,25,0.65);
  z-index: 250; display: none; align-items: center; justify-content: center;
}
#flt-move-overlay.open { display: flex; }
#flt-move-box {
  background: var(--white); padding: 32px 36px; max-width: 440px; width: calc(100% - 48px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}
.flt-dlg-title  { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.flt-dlg-detail { font-size: 12px; color: var(--grey); margin-bottom: 16px; line-height: 1.6; }
.flt-dlg-warning {
  background: #fff9e6; border-left: 3px solid #e8b400; padding: 10px 14px;
  margin-bottom: 20px; font-size: 12px; color: #6b4f00; line-height: 1.5;
}
.flt-dlg-confirm-lbl {
  font-size: 10px; font-weight: 700; color: var(--grey); letter-spacing: 0.08em; margin-bottom: 6px;
}
#flt-move-word {
  width: 100%; padding: 10px 12px; border: 2px solid var(--lgrey); font-size: 15px;
  font-weight: 700; letter-spacing: 0.12em; font-family: 'Forma', sans-serif;
  box-sizing: border-box; margin-bottom: 18px; text-transform: uppercase;
}
#flt-move-word:focus { outline: none; border-color: var(--sage); }
.flt-dlg-btns { display: flex; gap: 10px; justify-content: flex-end; }
#flt-dlg-cancel {
  padding: 9px 18px; background: none; color: var(--grey); border: 1px solid var(--lgrey);
  font-size: 12px; font-weight: 700; cursor: pointer; font-family: 'Forma', sans-serif;
}
#flt-dlg-confirm {
  padding: 9px 20px; background: var(--sage); color: var(--white); border: none;
  font-size: 12px; font-weight: 700; font-family: 'Forma', sans-serif;
  opacity: 0.35; pointer-events: none; transition: opacity 0.12s;
}
#flt-dlg-confirm.ready { opacity: 1; pointer-events: auto; cursor: pointer; }
#flt-dlg-confirm.ready:hover { background: var(--black); }

/* ── FILTER COMBOBOX (dark controls bar variant) ── */
.flt-cmb-wrap { position: relative; display: flex; align-items: center; min-width: 160px;
  border: 1px solid #777; border-radius: 20px; background: var(--black); flex-shrink: 0; }
.flt-cmb-wrap.chip-filled { background: var(--sage); border-color: var(--sage); }
/* flt-dd-list: body-appended fixed-position dropdown for filter comboboxes */
.flt-dd-list { position: fixed; z-index: 9999; background: var(--white);
  border: 1px solid #ccc; border-radius: 8px; max-height: 280px; overflow-y: auto;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18); display: none; min-width: 180px; }
.flt-dd-list.open { display: block; }
.flt-dd-list::-webkit-scrollbar { width: 5px; }
.flt-dd-list::-webkit-scrollbar-track { background: transparent; }
.flt-dd-list::-webkit-scrollbar-thumb { background: #ccc; border-radius: 8px; }

/* ── FILTER SUMMARY (visible in both regular and print) ── */
.flt-filter-summary {
  padding: 0 24px 12px; border-bottom: 1px solid var(--lgrey);
  display: none; /* shown after results load */
}
.flt-filter-summary.payrun-layout { display: flex; gap: 32px; align-items: flex-start; }
.flt-filter-summary-inner { max-width: 520px; flex-shrink: 0; }
.payrun-text-col { flex: 0 0 300px; padding-top: 0; }

/* ── DUPLICATE ENTRY HIGHLIGHT ── */
.dup-warning { background: #fff7ed !important; }
.dup-warning .day-entry-project { background: #fff7ed !important; }
.dup-badge { font-size: 9px; font-weight: 700; color: #f97316; letter-spacing: 0.06em;
  text-transform: uppercase; margin-top: 2px; }
.mob-entry-row.dup-warning { background: #fff7ed; }

/* ── DUPLICATE ENTRY HIGHLIGHT ── */
.dup-warning { background: #fff7ed !important; }
.dup-warning .day-entry-project { background: #fff7ed !important; }
.dup-badge { font-size: 9px; font-weight: 700; color: #f97316; letter-spacing: 0.06em;
  text-transform: uppercase; margin-top: 2px; }
.mob-entry-row.dup-warning { background: #fff7ed; }

/* ── LEAVE TYPE HIGHLIGHT (day + week views) ── */
.day-entry-row.leave-type { background: #ede8f5; }
.day-entry-row.leave-type .day-entry-project { background: #ede8f5; }
.time-cell.leave-type { background: #ede8f5 !important; }
.time-cell.leave-type .entry-pill { color: #7c5cbf; }

/* ── PENDING / ERROR / CANCELLING STATES ── */
/* Pending (saving): row stays fully interactive — only a small inline badge shows the save state */
.day-entry-row.entry-pending, .mob-entry-row.entry-pending { /* no pointer-events lock; user can keep editing */ }
/* Deleting / cancelling: content fades but borders stay at full strength.
   Opacity on the row itself would fade both the thick black border-right and the
   grey border-bottom, so we apply it only to the content children instead. */
.day-entry-row.entry-deleting, .mob-entry-row.entry-deleting,
.day-entry-row.entry-cancelling, .mob-entry-row.entry-cancelling {
  pointer-events: none;
}
/* Project cell content fades — .day-entry-project itself is NOT targeted
   so its border-right (thick black vertical line) remains at full opacity */
.day-entry-row.entry-deleting .day-entry-proj-name,
.day-entry-row.entry-deleting .day-entry-stage,
.day-entry-row.entry-deleting .entry-status-indicator,
.day-entry-row.entry-deleting .day-entry-detail,
.day-entry-row.entry-cancelling .day-entry-proj-name,
.day-entry-row.entry-cancelling .day-entry-stage,
.day-entry-row.entry-cancelling .entry-status-indicator,
.day-entry-row.entry-cancelling .day-entry-detail { opacity: 0.2; }
/* Mobile */
.mob-entry-row.entry-deleting .mob-entry-info,
.mob-entry-row.entry-deleting .mob-entry-times,
.mob-entry-row.entry-cancelling .mob-entry-info,
.mob-entry-row.entry-cancelling .mob-entry-times { opacity: 0.2; }
.day-entry-row.entry-error .day-entry-proj-name::after,
.mob-entry-row.entry-error .mob-entry-proj::after {
  content: ''; display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: #E24B4A; margin-left: 6px; vertical-align: middle; }
.entry-status-indicator { font-size: 10px; font-weight: 700; margin-top: 3px; cursor: pointer; }
.entry-status-indicator.saving { color: var(--grey); }
.entry-status-indicator.error { color: #E24B4A; }
.entry-status-indicator.error-amber { color: #EF9F27; }
.entry-status-indicator.cancelling { color: #E24B4A; }
.entry-spinner { display: inline-block; width: 10px; height: 10px; border: 2px solid var(--lgrey);
  border-top-color: var(--sage); border-radius: 50%; animation: spin 0.8s linear infinite;
  vertical-align: middle; margin-right: 3px; }
.entry-status-indicator { display: inline-flex; align-items: center; gap: 0; }
@keyframes entrySuccessFlash {
  0%   { background-color: rgba(155,163,142,0.18); }
  55%  { background-color: rgba(155,163,142,0.18); }
  100% { background-color: transparent; }
}
.day-entry-row.entry-success, .mob-entry-row.entry-success {
  animation: entrySuccessFlash 700ms ease forwards; }

/* ── UNDO TOAST ── */
#undo-toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--black); color: var(--white); padding: 10px 16px; border-radius: 4px;
  font-size: 13px; display: none; align-items: center; gap: 14px; z-index: 9999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
#undo-toast.visible { display: flex; }
#undo-toast .undo-btn { background: var(--sage); color: var(--white); border: none;
  padding: 5px 12px; font-family: 'Forma', sans-serif; font-size: 12px; font-weight: 700;
  cursor: pointer; letter-spacing: 0.04em; }
#undo-toast .undo-btn:hover { background: #8a937e; }

/* ── OVERLAP SNAP-TO-FIX hammer ── tiny button anchored at the right edge
   of an overlapping time chip. Clicking snaps that chip to the partner
   entry's adjacent boundary so the two rows become flush. Only renders
   when the overlap involves exactly two entries (a one-pair cluster).
   Desktop puts the icon inside the time input via a wrapping cell;
   mobile renders it inline with the time text. */
.time-chip-wrap { position: relative; display: inline-flex; align-items: center; flex-shrink: 0; }
/* Start-time hammer sits on the LEFT of the input; end-time hammer on the
   right. Input gains padding on whichever side hosts the icon so the
   number doesn't run into it. */
.time-chip-wrap.time-chip-wrap-start .time-input { padding-left: 22px; }
.time-chip-wrap.time-chip-wrap-end   .time-input { padding-right: 22px; }
.time-fix-btn { position: absolute; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; padding: 0; border: none; background: none; cursor: pointer;
  color: #f97316; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 3px; }
.time-chip-wrap.time-chip-wrap-start .time-fix-btn { left: 3px; }
.time-chip-wrap.time-chip-wrap-end   .time-fix-btn { right: 3px; }
.time-fix-btn:hover { background: rgba(249, 115, 22, 0.12); }
.time-fix-btn svg { display: block; }
.mob-time-fix { display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; padding: 0; border: none; background: none; cursor: pointer;
  color: #f97316; margin: 0 3px; border-radius: 3px; vertical-align: middle; }
.mob-time-fix:hover, .mob-time-fix:active { background: rgba(249, 115, 22, 0.12); }
.mob-time-fix svg { display: block; }

/* ── DISCARD WARNING ── */
#discard-warning { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: none;
  align-items: center; justify-content: center; z-index: 9998; }
#discard-warning.visible { display: flex; }
#discard-warning .dw-box { background: var(--white); padding: 24px; max-width: 360px;
  border: 1px solid var(--lgrey); }
#discard-warning .dw-msg { font-size: 13px; margin-bottom: 16px; }
#discard-warning .dw-btns { display: flex; gap: 8px; justify-content: flex-end; }
#discard-warning button { padding: 8px 16px; font-family: 'Forma', sans-serif; font-size: 12px;
  font-weight: 700; cursor: pointer; border: 1px solid var(--lgrey); background: var(--white); }
#discard-warning button.dw-discard { background: var(--black); color: var(--white); border-color: var(--black); }

/* ── STALE RESULTS OVERLAY ── */
.flt-results-wrap { position: relative; }
.flt-stale-overlay { position: absolute; inset: 0; z-index: 10; background: transparent; cursor: default; display: none; }
.flt-stale-overlay.visible { display: block; }
.flt-stale-pill { position: absolute; top: 25%; left: 50%; transform: translate(-50%, -50%);
  background: var(--black); color: var(--white); font-size: 12px; padding: 10px 20px;
  white-space: nowrap; z-index: 11; pointer-events: none; }
.flt-results-wrap.stale > *:not(.flt-stale-overlay) { opacity: 0.35; pointer-events: none; }
.flt-run-btn.stale-hint, .flt-print-btn.stale-hint {
  border: 1.5px solid var(--sage) !important; position: relative; }
.flt-run-btn.stale-hint::after, .flt-print-btn.stale-hint::after {
  content: ''; position: absolute; top: 3px; right: 3px; width: 6px; height: 6px;
  background: var(--sage); border-radius: 50%; }

/* ── STAFF STATUS VIEW ── */
.status-card { background: var(--white); border: 1px solid var(--ft-line-soft); border-radius: 6px; padding: 16px; }
.status-card-hdr { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.status-avatar { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 14px; font-weight: 700; flex-shrink: 0; border: 1px solid rgba(0,0,0,.08); }
.status-name { font-size: 14px; font-weight: 700; }
.status-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #639922; display: inline-block;
  margin-left: 6px; animation: statusPulse 2s ease-in-out infinite; }
@keyframes statusPulse { 0%,100%{opacity:1} 50%{opacity:.4} }
.live-rec-dot { width:7px;height:7px;border-radius:50%;background:var(--sage);flex-shrink:0;
                animation:statusPulse 1.8s ease-in-out infinite;display:none; }
.status-info { font-size: 12px; line-height: 1.6; }
.status-info .muted { color: var(--grey); }
.status-duration { font-size: 18px; font-weight: 700; color: var(--sage); }
.status-last { color: var(--grey); font-size: 11px; }
.status-project { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--ft-line); }

/* ── SHARED DASHBOARD VIEW ── */
.dash-view { display: none; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.dash-view.visible { display: flex; }
.checklist-view { display: none; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.checklist-view.visible { display: flex; }
.checklist-view-hdr { background: var(--black); height: 52px; min-height: 52px; flex-shrink: 0; }
.dash-viewer-bar { background: var(--black); height: 52px; min-height: 52px; padding: 0 max(20px, calc((100% - 1200px) / 2 + 20px)); display: flex; align-items: center;
  gap: 8px; flex-shrink: 0; }
.dash-viewer-label { font-size: 9px; font-weight: 700; color: var(--label); letter-spacing: .06em;
  text-transform: uppercase; white-space: nowrap; }
.dash-viewer-hint { font-size: 10px; color: #555; margin-left: auto; }
.svc-chip { width: 28px; height: 28px; border-radius: 50%; font-size: 10px; font-weight: 700;
  cursor: pointer; background: none; border: 1.5px solid #777; color: #777;
  font-family: inherit; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; }
.svc-chip.active { color: var(--white); }
.dash-thead { display: grid; grid-template-columns: 180px 320px 1fr 220px;
  padding: 8px 10px 8px 38px; background: #fafafa; border-bottom: 2px solid var(--ft-line-soft);
  font-size: 9px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--label); align-items: center; flex-shrink: 0; max-width: 1200px; width: 100%; align-self: center;
  height: 48px; box-sizing: border-box; }
.dash-scroll { flex: 1; overflow-y: auto; max-width: 1200px; width: 100%; align-self: center; }
.dash-card { display: grid; grid-template-columns: 180px 320px 1fr 220px;
  border-bottom: 1px solid var(--ft-line-soft); align-items: stretch; }
.dash-card:hover { background: #fafafa; }
.dc-pt   { padding: 14px 10px 14px 6px; display: flex; flex-direction: column; }
.dc-proj { font-size: 13px; font-weight: 700; color: var(--black); line-height: 1.2; }
.dc-stage { font-size: 11px; color: var(--grey); margin-top: 3px; }
.dc-staff { padding: 14px 12px 14px 0; border-right: 1px solid var(--ft-line-soft);
  display: flex; flex-direction: column; overflow: visible; min-height: 120px; }
.staff-inner { display: flex; gap: 0; align-items: flex-start; }
.staff-labels { width: 64px; flex-shrink: 0; display: flex; flex-direction: column; padding-right: 6px; }
.slbl { font-size: 9px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--label); line-height: 1; white-space: nowrap; display: flex; align-items: center; }
.slbl-init   { height: 16px; }
.slbl-logged { height: 18px; }
.slbl-budget { height: 16px; }
.slbl-bar    { height: 60px; }
.staff-bars-col { display: flex; gap: 12px; align-items: flex-start; overflow: visible; }
.sp-col { display: flex; flex-direction: column; align-items: center; }
.sp-init-row   { height: 16px; display: flex; align-items: center; justify-content: center; }
.sp-logged-row { height: 18px; display: flex; align-items: center; justify-content: center; }
.sp-budget-row { height: 16px; display: flex; align-items: center; justify-content: center; }
.sp-bar-row    { height: 60px; display: flex; align-items: flex-start; justify-content: center; overflow: visible; }
.sp-init       { font-size: 9px; font-weight: 700; text-align: center; }
.sp-logged-val { font-size: 11px; font-weight: 700; text-align: center; line-height: 1; }
.sp-budget-val { font-size: 10px; color: var(--lgrey); text-align: center; line-height: 1; }
.sp-bar { position: relative; height: 60px; border-radius: 3px; background: var(--ft-line);
  border: 1px solid #d4d4d4; overflow: visible; flex-shrink: 0; }
.sp-bar-fill     { position: absolute; top: 0; left: 0; right: 0; border-radius: 2px 2px 0 0; }
.sp-bar-overflow { position: absolute; top: 100%; left: -1px; right: -1px; background: #E24B4A;
  opacity: .65; border: 1px solid #c0392b; border-top: none; border-radius: 0 0 3px 3px; }
.staff-stats { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.stat-row { display: flex; align-items: center; }
.stat-lbl { width: 64px; flex-shrink: 0; font-size: 9px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--label); padding-right: 6px; white-space: nowrap; }
.stat-val { font-size: 10px; font-weight: 700; }
.dc-team { padding: 12px 16px; border-right: 1px solid var(--ft-line-soft);
  display: flex; flex-direction: column; justify-content: flex-start; }
.dc-team-layout { display: grid; grid-template-columns: 1fr 100px; gap: 12px; align-items: start; }
.prog-wrap  { display: flex; flex-direction: column; gap: 3px; }
.prog-upper { height: 8px; border-radius: 3px; overflow: hidden; display: flex; background: var(--ft-line); }
.prog-spend-container { position: relative; height: 7px; margin-top: 4px; background: var(--ft-line);
  border-radius: 3px; border: 1px solid #d0d0d0; overflow: visible; }
.prog-spend-fill-normal { position: absolute; top: -1px; left: -1px; height: calc(100% + 2px); border-radius: 3px; }
.prog-spend-fill-over   { position: absolute; top: -1px; left: calc(100% + 1px); height: calc(100% + 2px);
  background: #E24B4A; border-radius: 0 3px 3px 0; }
.prog-labels { margin-top: 5px; display: flex; flex-direction: column; }
.prog-lbl    { font-size: 10px; font-weight: 700; line-height: 1.8; white-space: nowrap; }
.team-right  { display: flex; flex-direction: column; gap: 8px; }
.rem-block   { display: flex; flex-direction: column; align-items: flex-end; }
.rem-hrs  { font-size: 16px; font-weight: 700; line-height: 1; }
.rem-lbl  { font-size: 9px; color: var(--label); margin-top: 1px; text-align: right; letter-spacing: .02em; }
.rem-hpd  { font-size: 10px; color: #666; margin-top: 2px; text-align: right; font-weight: 500; }
.dl-block { display: flex; flex-direction: column; align-items: flex-end; }
.dl-date  { font-size: 11px; font-weight: 700; text-align: right; }
.dl-days  { font-size: 10px; color: var(--lgrey); margin-top: 1px; text-align: right; }
.dc-notes       { padding: 8px 10px; display: flex; flex-direction: column; }
.dash-note-ta   { width: 100%; flex: 1; border: 1px solid var(--ft-line-soft); border-radius: 3px;
  padding: 6px 8px; font-size: 11px; font-weight: 500; color: #444; line-height: 1.5;
  font-family: 'Forma', sans-serif; resize: none; background: #fafafa; box-sizing: border-box; }
.dash-note-ta:focus { outline: none; border-color: var(--sage); background: #fff; }
.dash-no-budget-pill { display: inline-flex; align-items: center; padding: 3px 8px; background: #f5f5f5;
  font-size: 10px; color: var(--lgrey); font-weight: 700; }
.dash-empty { padding: 48px 24px; text-align: center; color: var(--grey); font-size: 12px; }

.dash-bhs-item { padding: 10px 0; border-bottom: 1px solid var(--ft-line); }
.dash-bhs-item:last-child { border-bottom: none; }
.dash-proj-wrap { border-bottom: 3px solid #d0d0d0; }
.dash-proj-wrap:last-child { border-bottom: none; }
.dash-bhs-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; padding: 0 12px; }
.dash-bhs-pt { display: flex; flex-direction: column; }
.dash-bhs-proj { font-size: 11px; font-weight: 600; color: var(--black); }
.dash-bhs-stage { font-size: 11px; color: var(--grey); margin-top: 1px; }
.dash-tl-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ── PRINT VIEW ── */
.flt-print-header  { display: none; padding: 20px 24px 12px; flex-shrink: 0; border-bottom: 2px solid var(--black); }
.flt-print-header h2 { font-size: 18px; font-weight: 700; margin-bottom: 2px; }
.flt-print-header p  { font-size: 12px; color: var(--grey); }

.flt-person-summary { width: 100%; border-collapse: collapse; margin-bottom: 0; }
.flt-person-summary th {
  font-size: 9px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--label); padding: 0 8px; text-align: left; white-space: nowrap;
  background: #fafafa; border-bottom: 2px solid var(--ft-line-soft);
  height: 48px; box-sizing: border-box;
}
.flt-person-summary th:last-child { text-align: right; }
.flt-person-summary td { padding: 7px 8px; border-bottom: 1px solid var(--lgrey); font-size: 12px; }
.flt-person-summary td:last-child { text-align: right; font-weight: 700; }
.flt-person-summary tr.psum-total td {
  font-weight: 700; border-top: 2px solid var(--black); border-bottom: none;
  background: #f5f5f5;
}

body.flt-print-mode .flt-controls-bar  { display: none !important; }
body.flt-print-mode .flt-criteria-bar  { display: none !important; }
body.flt-print-mode .flt-action-bar    { display: none !important; }
body.flt-print-mode .flt-summary-bar   { display: none !important; }
body.flt-print-mode .flt-select-all-btn { display: none !important; }
body.flt-print-mode .flt-print-header  { display: block; }
body.flt-print-mode .flt-filter-summary { padding: 12px 24px; border-bottom: 1px solid var(--lgrey); }
body.flt-print-mode .flt-table-wrap    { overflow: visible !important; flex: none !important; height: auto !important; max-height: none !important; }
body.flt-print-mode .flt-results-wrap  { overflow: visible !important; flex: none !important; height: auto !important; }
body.flt-print-mode #filter-view       { overflow: visible !important; height: auto !important; flex: none !important; }
body.flt-print-mode #app               { overflow: visible !important; height: auto !important; }
body.flt-print-mode .grid-wrapper      { overflow: visible !important; }
body.flt-print-mode .flt-table thead th:first-child,
body.flt-print-mode .flt-table tbody td:first-child,
body.flt-print-mode .flt-person-total td:first-child { display: none; }
body.flt-print-mode .flt-row-sel td    { background: none !important; }
/* In print: hide entry count, show only total hours in summary text */
body.flt-print-mode .flt-summary-count { display: none; }
/* Person header rows in grouped sort — appear above entries */
.flt-person-header td {
  background: #f0f2ed !important; font-weight: 700; font-size: 12px;
  color: var(--black); border-top: 2px solid var(--black);
  border-bottom: 1px solid #d0d5c8; padding: 8px 12px;
}
.flt-person-header .flt-ph-arrow { color: var(--sage); margin-left: 6px; font-size: 11px; }
body.flt-print-mode .flt-person-header td:first-child { display: none; }
.flt-person-subtotal td {
  background: #e8ebe4; font-size: 11px; color: var(--black); font-weight: 600;
  padding: 5px 12px; border-top: 1px solid #cdd2c6; border-bottom: 2px solid var(--black);
}
body.flt-print-mode .flt-person-subtotal td:first-child { display: none; }

@media print {
  * { -webkit-user-select: text !important; user-select: text !important; }
  .app-header, .week-nav, .timer-bar, .grid-wrapper, #mobile-view,
  .flt-controls-bar, .flt-action-bar, .flt-summary-bar,
  #confirm-overlay, #conflict-overlay, #stale-timer-overlay, #flt-move-overlay { display: none !important; }
  body.flt-print-mode .flt-print-header  { display: block !important; }
  body.flt-print-mode .flt-filter-summary { display: block !important; padding: 12px 24px; }
  #filter-view { display: flex !important; flex-direction: column !important; overflow: visible !important; height: auto !important; }
  #app         { overflow: visible !important; height: auto !important; flex: none !important; }
  html, body   { height: auto !important; overflow: visible !important; }
  .flt-table-wrap   { overflow: visible !important; flex: none !important; height: auto !important; max-height: none !important; }
  .flt-results-wrap { overflow: visible !important; flex: none !important; height: auto !important; }
  .flt-table thead th:first-child,
  .flt-table tbody td:first-child { display: none !important; }
  .flt-row-sel td { background: none !important; }
  a { text-decoration: none; }
  .flt-table { page-break-inside: auto; }
  .flt-row   { page-break-inside: avoid; }
  .flt-person-header { page-break-after: avoid; }
}
