/* s1timesheet (#6768): the timesheet component (ui-time.js) */
.tsh { display: flex; flex-direction: column; gap: 12px; color: var(--u-ink, #111); }
.tsh-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.tsh-title { font-weight: 700; font-size: 18px; }
.tsh-nav { display: flex; align-items: center; gap: 6px; }
.tsh-month { font-weight: 600; min-width: 74px; text-align: center; }
.tsh-btn { border: 1px solid var(--u-line, #ddd); background: var(--u-card, #fff); color: inherit; border-radius: 8px; padding: 7px 12px; font: inherit; cursor: pointer; min-height: 36px; }
.tsh-btn.is-main { background: var(--u-accent, #4f46e5); border-color: var(--u-accent, #4f46e5); color: #fff; }
.tsh-btn:disabled { opacity: .6; cursor: default; }
.tsh-meta { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0; font-size: 14px; }
.tsh-meta dt { color: var(--u-muted, #666); }
.tsh-meta dd { margin: 0; font-weight: 600; }
.tsh-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--u-line, #ddd); border-radius: 10px; }
.tsh-t { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 620px; }
.tsh-t th, .tsh-t td { padding: 6px 8px; border-bottom: 1px solid var(--u-line, #eee); text-align: center; white-space: nowrap; }
.tsh-t th { background: var(--u-soft, #f6f6f8); font-weight: 600; font-size: 12px; }
.tsh-t td:first-child, .tsh-t th:first-child { text-align: left; }
.tsh-t tr.is-wkend td { background: var(--u-soft, #fafafa); }
.tsh-t tr.is-edit { cursor: pointer; }
.tsh-t tr.is-edit:hover td { background: rgba(79, 70, 229, .06); }
.tsh-t tfoot td { font-weight: 700; border-bottom: 0; }
.tsh-ed-row td { padding: 8px; background: var(--u-soft, #f6f6f8); white-space: normal; text-align: left; }
.tsh-ed { border: 1px solid var(--u-line, #ddd); border-radius: 10px; padding: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.tsh-ed-h { grid-column: 1 / -1; font-weight: 700; }
.tsh-ed label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--u-muted, #666); }
.tsh-ed input { font: inherit; font-size: 15px; padding: 7px 8px; border: 1px solid var(--u-line, #ddd); border-radius: 8px; color: var(--u-ink, #111); background: var(--u-card, #fff); }
.tsh-ed-b { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; }
.tsh-note { color: var(--u-muted, #666); font-size: 13px; margin: 0; grid-column: 1 / -1; }
.tsh-sigs { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 8px; }
.tsh-sig { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.tsh-sig-l { color: var(--u-muted, #666); }
.tsh-sig-line { border-bottom: 1px solid var(--u-ink, #111); min-height: 26px; font-weight: 600; padding-bottom: 2px; }
.tsh-sig-note { font-size: 12px; color: var(--u-muted, #666); }
.tsh-sig.is-void .tsh-sig-note { color: #b42318; }
.tsh-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
@media (max-width: 480px) { .tsh-sigs { grid-template-columns: 1fr; } }
@media print {
  body.tsh-printing * { visibility: hidden; }
  body.tsh-printing .tsh-print-me, body.tsh-printing .tsh-print-me * { visibility: visible; }
  body.tsh-printing .tsh-print-me { position: absolute; left: 0; top: 0; width: 100%; }
  .tsh .no-print { display: none !important; }
  .tsh-wrap { overflow: visible; border: 0; }
  .tsh-t { min-width: 0; font-size: 11px; }
}

/* S3 11-02: the Date column stays put while the table scrolls sideways (phone), a fade at the right edge says there is more,
   and the weekday shows next to each date with weekends shaded, so a blank weekend row never reads as a gap */
.tsh-box { position: relative; }
.tsh-fade { position: absolute; top: 1px; right: 1px; bottom: 1px; width: 36px; pointer-events: none; border-radius: 0 10px 10px 0; opacity: 0; transition: opacity .2s;
  background: linear-gradient(to right, rgba(255, 255, 255, 0), var(--u-card, #fff)); }
.tsh-box.has-more .tsh-fade { opacity: 1; }
.tsh-t th:first-child, .tsh-t td:first-child { position: sticky; left: 0; z-index: 1; background: var(--u-card, #fff); box-shadow: 1px 0 0 var(--u-line, #eee); }
.tsh-t thead th:first-child { background: var(--u-soft, #f6f6f8); }
.tsh-dow { color: var(--u-muted, #666); font-size: 12px; margin-left: 4px; }
.tsh-t tr.is-wkend td, .tsh-t tr.is-wkend td:first-child { background: #f1f2f6; }
.tsh-t tr.tsh-ed-row td:first-child { position: static; box-shadow: none; }
@media print { .tsh-fade { display: none; } .tsh-t th:first-child, .tsh-t td:first-child { position: static; box-shadow: none; } }

/* s1lifebar (#4683): the datespan component (a lifetime bar) */
.dsp { display: flex; flex-direction: column; gap: 6px; }
.dsp-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.dsp-label { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--u-muted, #666); }
.dsp-len { font-weight: 700; font-size: 15px; }
.dsp-track { height: 10px; border-radius: 999px; background: var(--u-soft, #eceef3); overflow: hidden; }
.dsp-fill { height: 100%; border-radius: 999px; }
.dsp-fill.is-open { background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.25) 0 6px, transparent 6px 12px) !important; }
.dsp-ends { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--u-muted, #666); }
.dsp-none { margin: 0; font-size: 13px; color: var(--u-muted, #666); }
.tsh-wrap { background: var(--u-card, #fff); }

/* s1timeoff (#6768): Time off */
.tof { display: grid; gap: 12px; }
.tof-h { margin: 0; font-size: 1.15rem; }
.tof-note { margin: 0; color: var(--u-muted, #667); font-size: .92rem; }
.tof-new { justify-self: start; }
.tof-form { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--u-border, #e5e7eb); border-radius: var(--u-radius, 12px); background: var(--u-card, #fff); }
.tof-form label { display: grid; gap: 4px; font-size: .88rem; font-weight: 600; }
.tof-form .tof-chk { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.tof-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tof-list { display: grid; gap: 8px; }
.tof-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 12px 14px; border: 1px solid var(--u-border, #e5e7eb); border-radius: var(--u-radius, 12px); background: var(--u-card, #fff); }
.tof-row > div { display: grid; gap: 2px; min-width: 0; }
.tof-row span { color: var(--u-muted, #667); font-size: .9rem; }
.tof-row small { color: var(--u-muted, #667); font-size: .82rem; }
.tof-st { font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: #eef0f3; color: #4b5563 !important; white-space: nowrap; }
.tof-st.is-approved { background: #e7f6ec; color: #17803d !important; }
.tof-st.is-denied { background: #fdecec; color: #b42318 !important; }
.tof-st.is-pending { background: #fff4e0; color: #9a5b00 !important; }
.tof-cx { background: none; border: 0; color: var(--u-primary, #2563eb); font-weight: 600; cursor: pointer; padding: 4px; }
@media (max-width: 480px) { .tof-row { grid-template-columns: 1fr auto; } .tof-cx { grid-column: 1 / -1; justify-self: start; } .tof-2 { grid-template-columns: 1fr; } }
.tof-form input[type="text"], .tof-form textarea, .tof-form select { width: 100%; box-sizing: border-box; min-height: 44px; padding: 10px 12px; border: 1px solid var(--u-border, #e5e7eb); border-radius: 10px; background: var(--u-card, #fff); color: inherit; font: inherit; }
.tof-form input[type="text"]:focus, .tof-form textarea:focus, .tof-form select:focus { outline: none; border-color: var(--u-primary, #2563eb); box-shadow: 0 0 0 3px color-mix(in srgb, var(--u-primary, #2563eb) 18%, transparent); }
.tof-form .tof-chk input { width: 18px; height: 18px; min-height: 0; }
/* osdts (#6599): time off balances and the approve mode */
.tof-bal { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.tof-bal > div { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--border, #e5e7eb); border-radius: var(--radius, 12px); background: var(--surface, #fff); }
.tof-bal small, .tof-bal span { color: var(--muted, #667); font-size: .8rem; }
.tof-bal b { font-size: 1.05rem; }
/* #6768 s2leaveview: Entitled / Used / Left */
.tof-bal.is-full dl { display: grid; grid-template-columns: auto auto; gap: 2px 10px; margin: 4px 0 0; }
.tof-bal.is-full dt { color: var(--muted, #667); font-size: .8rem; }
.tof-bal.is-full dd { margin: 0; text-align: right; }
.tof-q { grid-template-columns: 1fr auto; }
.tof-qb { display: flex; gap: 8px; flex-wrap: nowrap; justify-content: flex-end; align-self: start; }
.tof-why { grid-column: 1 / -1; display: grid; gap: 8px; }
.tof-why label { display: grid; gap: 4px; font-size: .88rem; font-weight: 600; }
.tof-why textarea { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--border, #e5e7eb); border-radius: 10px; font: inherit; background: var(--surface, #fff); color: inherit; }
.tof-why .u-button { justify-self: end; }
@media (max-width: 480px) { .tof-q { grid-template-columns: 1fr; } .tof-qb { justify-content: stretch; } .tof-qb .u-button { flex: 1; } }
/* osdts (#6599): weeksheet, the weekly timesheet */
.wks { display: grid; gap: 12px; color: var(--text, #111); }
.wks-h { margin: 0; font-size: 1.15rem; }
.wks-note { margin: 0; color: var(--muted, #667); font-size: .92rem; }
.wks-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: color-mix(in srgb, var(--text, #111) 6%, transparent); justify-self: start; }
.wks-tabs button { border: 0; background: none; font: inherit; font-weight: 600; padding: 8px 14px; border-radius: 9px; cursor: pointer; color: var(--muted, #667); min-height: 40px; }
.wks-tabs button[aria-selected="true"] { background: var(--surface, #fff); color: var(--text, #111); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.wks-tabs small { font-weight: 700; margin-left: 4px; }
.wks-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wks-nav b { text-align: center; }
.wks-arrow { min-width: 44px; min-height: 44px; padding: 0 10px; font-size: 1.2rem; }
.wks-back { justify-self: start; background: none; border: 0; padding: 4px 0; font: inherit; font-weight: 600; color: var(--primary, #2563eb); cursor: pointer; }
.wks-who { font-weight: 700; font-size: 1.05rem; }
.wks-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.wks-sum > div { display: grid; gap: 4px; align-content: start; padding: 10px 12px; border: 1px solid var(--border, #e5e7eb); border-radius: var(--radius, 12px); background: var(--surface, #fff); }
.wks-sum small { color: var(--muted, #667); font-size: .8rem; }
.wks-sum b { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.wks-st { justify-self: start; font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: #eef0f3; color: #4b5563 !important; white-space: nowrap; }
.wks-st.is-submitted { background: #e8f0fe; color: #1d4ed8 !important; }
.wks-st.is-approved { background: #e7f6ec; color: #17803d !important; }
.wks-st.is-returned { background: #fdecec; color: #b42318 !important; }
.wks-st.is-reopened { background: #fff4e0; color: #9a5b00 !important; }
.wks-rn { margin: 0; padding: 10px 12px; border-radius: 10px; background: #fff8eb; font-size: .9rem; }
.wks-days { display: grid; border: 1px solid var(--border, #e5e7eb); border-radius: var(--radius, 12px); background: var(--surface, #fff); overflow: hidden; }
.wks-day { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--border, #eef0f3); }
.wks-day:first-child { border-top: 0; }
.wks-day.is-empty { color: var(--muted, #667); }
.wks-dn { display: grid; }
.wks-dn span { font-size: .8rem; color: var(--muted, #667); }
.wks-es { display: grid; gap: 4px; min-width: 0; }
.wks-e { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-variant-numeric: tabular-nums; }
.wks-e small, .wks-none { color: var(--muted, #667); font-size: .82rem; }
.wks-e em { color: #9a5b00; font-style: normal; font-weight: 600; }
.wks-dt { font-weight: 700; font-variant-numeric: tabular-nums; }
.wks-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.wks-ret { flex-basis: 100%; display: grid; gap: 8px; }
.wks-ret label { display: grid; gap: 4px; font-size: .88rem; font-weight: 600; }
.wks-ret textarea { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--border, #e5e7eb); border-radius: 10px; font: inherit; background: var(--surface, #fff); color: inherit; }
.wks-ret .u-button { justify-self: start; }
.wks-team { display: grid; border: 1px solid var(--border, #e5e7eb); border-radius: var(--radius, 12px); background: var(--surface, #fff); overflow: hidden; }
.wks-p { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 12px 14px; border: 0; border-top: 1px solid var(--border, #eef0f3); background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; min-height: 52px; }
.wks-p:first-child { border-top: 0; }
.wks-p:hover { background: color-mix(in srgb, var(--text, #111) 4%, transparent); }
.wks-pn { display: flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; }
.wks-ph { font-variant-numeric: tabular-nums; font-weight: 700; }
.wks-on { width: 8px; height: 8px; border-radius: 50%; background: #17a34a; flex: none; }
@media (max-width: 480px) { .wks-day { grid-template-columns: 52px 1fr auto; padding: 10px 12px; } .wks-acts .u-button { flex: 1; } .wks-sum b { font-size: 1.05rem; } }
/* s1daymark (#6768): Day type on the sheet's day editor (employer) */
.tsh-mark { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tsh-mark > span { font-size: .85rem; font-weight: 600; color: var(--u-muted, #667); margin-right: 4px; }
.tsh-mark .tsh-btn.is-on { background: var(--u-primary, #2563eb); color: #fff; border-color: var(--u-primary, #2563eb); }
/* s1sheeted (#6768): the day editor pinned to the visible width when the table scrolls sideways */
.tsh-ed.is-pinned { position: sticky; left: 0; box-sizing: border-box; grid-template-columns: 1fr 1fr; }
.tsh-ed.is-pinned .tsh-mark, .tsh-ed.is-pinned .tsh-ed-b, .tsh-ed.is-pinned .tsh-note { grid-column: 1 / -1; }
.tsh-ed.is-pinned .tsh-ed-b { justify-content: stretch; }
.tsh-ed.is-pinned .tsh-ed-b .tsh-btn { flex: 1; }
.tsh-ed input { width: 100%; box-sizing: border-box; min-width: 0; }
/* s1sigdraw (#6768): the signature pad and the drawn signature */
.tsh-pad-ov { position: fixed; inset: 0; z-index: 9999; background: rgba(15, 23, 42, .45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.tsh-pad { width: min(640px, 100%); background: var(--u-card, #fff); border-radius: 14px; padding: 16px; display: grid; gap: 12px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.tsh-pad-h { font-weight: 700; }
.tsh-pad-c { width: 100%; aspect-ratio: 3 / 1; border: 1px dashed var(--u-line, #c8ccd4); border-radius: 10px; background: #fff; touch-action: none; cursor: crosshair; }
.tsh-pad-b { display: flex; gap: 8px; align-items: center; }
.tsh-pad-b span { flex: 1; }
.tsh-sig-img { display: block; max-width: 220px; max-height: 74px; margin: 2px 0; }
@media (max-width: 560px) { .tsh-pad-ov { align-items: flex-end; padding: 0; } .tsh-pad { border-radius: 14px 14px 0 0; } }
@media print { .tsh-sig-img { max-width: 200px; max-height: 66px; } }
/* s1sigprint (#6768): print = the sheet alone, one A4 page, drawn signatures shown */
.tsh-print-root { display: none; }
@media print {
  @page { size: A4 portrait; margin: 8mm; }
  body.tsh-printing > *:not(.tsh-print-root) { display: none !important; }
  body.tsh-printing .tsh-print-root { display: block !important; visibility: visible !important; position: static; width: 100%; }
  body.tsh-printing .tsh-print-root * { visibility: visible !important; }
  .tsh-print-root .no-print, .tsh-print-root .tsh-actions, .tsh-print-root .tsh-ed, .tsh-print-root .tsh-ed-row { display: none !important; }
  .tsh-print-root .tsh-wrap, .tsh-print-root .tsh-box { overflow: visible !important; border: 0; box-shadow: none; }
  .tsh-print-root .tsh-t { min-width: 0 !important; width: 100%; font-size: 8.5pt; border-collapse: collapse; }
  .tsh-print-root .tsh-t th, .tsh-print-root .tsh-t td { padding: 1px 4px !important; line-height: 1.2; }
  .tsh-print-root .tsh-sigs { display: flex !important; gap: 16px; margin-top: 8px; page-break-inside: avoid; }
  .tsh-print-root .tsh-sig { flex: 1; }
  .tsh-print-root .tsh-sig-img { display: block !important; max-width: 180px; max-height: 60px; }
  .tsh-print-root h1, .tsh-print-root h2, .tsh-print-root h3 { margin: 0 0 4px; }
}
@media print { body.tsh-printing, .tsh-print-root, .tsh-print-root > *, .tsh-print-root .tsh-wrap { background: #fff !important; } }

/* s7focus (#7732 / #3497): the focustimer component (ui-time.js): a live focus timer on a record */
.ftm { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--border, #e5e5ea); border-radius: var(--radius, 12px); background: var(--surface, #fff); color: var(--text, #111); }
.ftm.is-plain { padding: 0; border: 0; background: transparent; }
.ftm-t { font-weight: 700; font-size: 15px; line-height: 1.3; }
.ftm-clock { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.ftm-clock small { font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--muted, #666); }
.ftm-clock b { font-size: 40px; line-height: 1.05; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.ftm.is-on .ftm-clock small { color: var(--primary, #4f46e5); }
.ftm.is-paused .ftm-clock b { opacity: .55; }
.ftm.is-break .ftm-clock small { color: #2E7D4F; }
.ftm-spent { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px; font-size: 13px; color: var(--muted, #666); }
.ftm-spent b { color: var(--text, #111); }
.ftm-spent em { font-style: normal; font-weight: 600; color: #B3261E; }
.ftm-bar { height: 6px; border-radius: 99px; background: var(--border, #e5e5ea); overflow: hidden; }
.ftm-bar i { display: block; height: 100%; border-radius: inherit; background: var(--primary, #4f46e5); transition: width .4s ease; }
.ftm.is-over .ftm-bar i { background: #B3261E; }
.ftm-other { margin: 0; font-size: 13px; color: var(--muted, #666); }
.ftm-b { display: flex; flex-wrap: wrap; gap: 8px; }
.ftm-b .u-button { flex: 1 1 120px; min-height: 44px; }
@media (prefers-reduced-motion: reduce) { .ftm-bar i { transition: none; } }
