/* Time Tracker: layout on top of the shared kit. */
.tt { max-width: 1100px; }
.tt-timer {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 18px 0 12px; padding: 10px;
  border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.tt-timer.on { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.tt-desc { flex: 1; min-width: 200px; border-color: transparent !important; background: transparent !important; font-size: 15px !important; }
.tt-desc:focus { background: var(--surface-2) !important; }
.tt-proj { width: auto; max-width: 220px; }
.tt-bill { font-weight: 800; font-size: 15px; }
.tt-bill[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }
.tt-tagbtn span:empty { display: none; }
.tt-clock { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 92px; text-align: end; letter-spacing: -.01em; }
.tt-go { min-width: 92px; height: 42px; }
.tt-timer.on .tt-go, .tt-timer.on .tt-go:hover:not(:disabled) { background: var(--danger); color: #fff; box-shadow: none; }
.tt-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }

/* entries */
.tt-day { margin-bottom: 14px; padding: 4px 0; }
.tt-dayhead { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px 8px; color: var(--text-2); font-size: 13px; font-weight: 650; }
.tt-dayhead b { color: var(--text); font-variant-numeric: tabular-nums; }
.tt-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto 112px 76px 34px; gap: 10px; align-items: center;
  padding: 9px 14px; border-top: 1px solid var(--line); cursor: pointer;
}
.tt-row:hover { background: var(--surface-2); }
.tt-row.run { background: var(--accent-soft); }
.tt-main { min-width: 0; }
.tt-main b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-main b.none { color: var(--text-3); font-weight: 500; }
.tt-pj { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.tt-tags { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.tt-tags .chip { padding: 1px 8px; font-size: 11.5px; }
.tt-billed { font-weight: 800; color: var(--accent); width: 14px; text-align: center; }
.tt-billed.off { color: transparent; }
.tt-span { color: var(--text-3); font-size: 12.5px; text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tt-dur { text-align: end; font-weight: 650; font-variant-numeric: tabular-nums; }
.tt-play { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); }
.tt-play:hover { background: var(--accent-soft); color: var(--accent); }
.tt-play svg { width: 14px; height: 14px; }
.tt-weektotal { display: flex; justify-content: space-between; color: var(--text-2); font-size: 13px; margin: 0 4px 10px; }
.tt-weektotal b { color: var(--text); font-variant-numeric: tabular-nums; }

/* timesheet */
.tt-weekbar { margin-bottom: 12px; }
.tt-weekbar h2 { margin: 0; min-width: 190px; text-align: center; font-size: 17px; }
.tt-sheet td, .tt-sheet th { text-align: end; white-space: nowrap; }
.tt-sheet td:first-child, .tt-sheet th:first-child { text-align: start; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.tt-sheet td.cell { cursor: pointer; color: var(--text-2); }
.tt-sheet td.cell:hover { background: var(--accent-soft); color: var(--text); }
.tt-sheet td.cell.zero { color: var(--text-3); }
.tt-sheet th.today { color: var(--accent); }
.tt-sheet tr.tot td { font-weight: 700; color: var(--text); border-bottom: 0; }

/* reports */
.tt-filters { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; padding: 12px 14px; }
.tt-filters .input, .tt-filters .select { min-height: 36px; padding: 6px 10px; font-size: 13px; }
.tt-filters .select { padding-right: 28px; }
.rep-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.rep-bar:last-child { border-bottom: 0; }
.rep-bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.rep-bar b { font-variant-numeric: tabular-nums; font-weight: 600; text-align: end; }
.rep-bar small { color: var(--text-3); font-weight: 500; margin-inline-start: 6px; }
.rep-bar .track { grid-column: 1 / -1; height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.rep-bar .track i { display: block; height: 100%; border-radius: 6px; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--text-3); font-size: 11px; font-family: var(--font); }
.chart .grid { stroke: var(--line); }
.chart .bar { fill: var(--accent); }

/* lists */
.li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.li:last-child { border-bottom: 0; }
.li .grow { min-width: 0; }
.li b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li span.faint { display: block; }
.li.arch { opacity: .55; }

/* sheets and popovers */
.tt-sheetm { width: min(540px, 100%); }
.tt-sheetm h2 { margin-bottom: 14px; }
.tt-sheetm .stack { gap: 12px; }
.tt-sheetm .foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.tt-sheetm .foot .left { margin-inline-end: auto; }
.tt-sheetm.wide { width: min(720px, 100%); }
.tagpick { display: flex; flex-wrap: wrap; gap: 6px; }
.tagpick button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.tt-pop { position: fixed; z-index: 75; width: min(280px, calc(100vw - 16px)); padding: 12px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-pop); display: grid; gap: 10px; animation: s3-pop 160ms var(--ease); }
.g3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; align-items: center; font-size: 13.5px; color: var(--text-2); }
.inv-lines td input { width: 100%; }

/* printed invoice */
.tt-print { display: none; }
@media print {
  body.printing main > *:not(#printArea) { display: none !important; }
  body.printing .tt-print { display: block; color: #111; font-size: 12.5pt; }
  .tt-print h1 { font-size: 24pt; margin: 0 0 4px; }
  .tt-print table { width: 100%; border-collapse: collapse; margin-top: 18px; }
  .tt-print th, .tt-print td { padding: 7px 6px; border-bottom: 1px solid #ccc; text-align: start; vertical-align: top; }
  .tt-print .num { text-align: end; white-space: nowrap; }
  .tt-print .parties { display: flex; justify-content: space-between; gap: 24px; margin-top: 18px; white-space: pre-wrap; }
  .tt-print .tot td { border: 0; font-weight: 700; }
  .tt-print .notes { margin-top: 20px; white-space: pre-wrap; color: #333; }
}

@media (max-width: 900px) { .tt-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .tt-timer { gap: 6px; }
  .tt-desc { flex-basis: 100%; }
  .tt-proj { flex: 1; max-width: none; }
  .tt-clock { font-size: 18px; min-width: 0; flex: 1; }
  .tt-go { flex-basis: 100%; height: 46px; font-size: 15px; }
  .tt-row { grid-template-columns: minmax(0, 1fr) auto 30px; grid-template-areas: "main dur play" "tags span play"; row-gap: 2px; padding-inline: 12px; }
  .tt-row .tt-main { grid-area: main; } .tt-row .tt-dur { grid-area: dur; } .tt-row .tt-play { grid-area: play; }
  .tt-row .tt-tags { grid-area: tags; justify-content: flex-start; } .tt-row .tt-span { grid-area: span; }
  .tt-row .tt-billed { display: none; }
  .tt-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tt-nav .seg { width: 100%; order: 5; }
  .tt-nav .seg button { flex: 1; padding: 6px 4px; }
  .tt-weekbar h2 { min-width: 0; flex: 1; font-size: 15px; }
  .g3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
