/* Work is displayed on the calendar; entry and submission controls open on demand. */
.timesheet-editor { margin:1.25rem 0; border:1px solid var(--line-strong,var(--line)); border-radius:var(--app-radius,6px); background:var(--surface); overflow:clip; }
.ts-heading { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:1.25rem 1.25rem 0; }
.ts-heading h3 { margin:0; font:700 1.125rem var(--font-ui,var(--body)); }
.ts-toolbar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:.5rem 1rem; padding:.75rem 1.25rem 1rem; }
.ts-navigation { display:flex; align-items:center; gap:.25rem; }
.ts-navigation h4 { min-width:11rem; margin:0 .25rem; font:700 .9375rem var(--font-ui,var(--body)); text-align:center; }
.timesheet-editor .ts-arrow { width:44px; padding:.6rem; }
.ts-arrow svg { width:20px; height:20px; }
.ts-navigation>.button:last-child { margin-left:.5rem; }
.ts-help { margin:0; color:var(--muted); font-size:.8125rem; font-weight:400; line-height:1.6; }
.ts-message { margin:0 1.25rem 1rem; padding:.75rem 1rem; border:1px solid var(--line); border-radius:4px; color:var(--text); background:var(--surface-subtle,var(--paper)); font-size:.8125rem; line-height:1.5; }
.ts-message.is-error { border-color:var(--error-line,#e4b7bd); color:var(--error,var(--danger)); background:var(--error-bg,#fff0f2); }
.ts-calendar { margin:0 1.25rem; border:1px solid var(--line); border-radius:4px; overflow:hidden; }
.ts-weekdays,.ts-month-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); }
.ts-weekdays { background:var(--surface-subtle,var(--paper)); border-bottom:1px solid var(--line); }
.ts-weekdays span { padding:.65rem .25rem; color:var(--muted); font-size:.75rem; font-weight:600; text-align:center; }
.timesheet-editor .ts-day { display:flex; flex-direction:column; align-items:stretch; justify-content:flex-start; gap:.5rem; min-width:0; min-height:130px; padding:.55rem; border:0; border-radius:0; border-right:1px solid var(--line); border-bottom:1px solid var(--line); background:var(--surface); color:var(--text); text-align:left; font:500 .8125rem var(--font-ui,var(--body)); cursor:pointer; }
.ts-day:nth-child(7n) { border-right:0; }
.ts-day:nth-last-child(-n+7) { border-bottom:0; }
.timesheet-editor .ts-day.is-weekend { background:var(--surface-subtle,var(--paper)); }
.timesheet-editor .ts-day:hover:not(:disabled) { background:var(--violet-pale,#e9ffda); }
.timesheet-editor .ts-day.is-selected { background:var(--violet-pale,#e9ffda); }
.timesheet-editor .ts-day.is-other-month { color:var(--muted); background:var(--surface-subtle,var(--paper)); }
.timesheet-editor .ts-day:disabled { color:var(--muted); cursor:default; opacity:.55; }
.ts-day-number { display:grid; place-items:center; align-self:flex-start; width:28px; height:28px; border-radius:50%; font-size:.8125rem; font-weight:600; }
.ts-day.is-today .ts-day-number { background:var(--violet); color:white; }
.ts-event { display:grid; gap:.2rem; min-width:0; padding:.45rem .5rem; border-radius:4px; color:var(--text); background:var(--surface-subtle,var(--paper)); }
.ts-event strong { font-size:.8125rem; font-variant-numeric:tabular-nums; }
.ts-event-description { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.75rem; font-weight:400; line-height:1.5; }
.ts-event-status { font-size:.6875rem; font-weight:600; }
.ts-event[data-state="DRAFT"] { background:var(--surface-muted); color:var(--muted); }
.ts-event[data-state="SUBMITTED"] { background:var(--action-soft); color:var(--action); }
.ts-event[data-state="APPROVED"] { background:var(--success-bg); color:var(--success); }
.ts-event[data-state="CHANGES_REQUESTED"] { background:var(--warning-bg); color:var(--warning); }
.ts-agenda { display:none; }
.ts-footer { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:1rem 1.25rem; }
.ts-totals { display:grid; gap:.2rem; }
.ts-totals strong { font-size:.9375rem; font-variant-numeric:tabular-nums; }
.ts-totals>span { font-size:.75rem; color:var(--muted); }
.timesheet-editor :is(button,input,select,textarea):focus-visible { outline:2px solid var(--violet); outline-offset:3px; }
.timesheet-editor ::selection { background:var(--violet); color:white; }
.ts-dialog { box-sizing:border-box; width:calc(100% - 2rem); max-width:540px; max-height:90dvh; padding:0; border:1px solid var(--line); border-radius:8px; color:var(--text); background:var(--surface); box-shadow:0 16px 48px var(--shadow); }
.ts-dialog::backdrop { background:var(--overlay); }
.ts-dialog form { margin:0; }
.ts-dialog-heading { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:1rem 1.25rem; border-bottom:1px solid var(--line); }
.ts-dialog-heading h3 { margin:0; font:700 1.125rem var(--font-ui,var(--body)); }
.ts-dialog-body { display:grid; gap:1.1rem; padding:1.25rem; }
.ts-dialog .ts-message { margin-top:0; }
.ts-field { display:grid; gap:.45rem; min-width:0; font-size:.8125rem; font-weight:600; }
.ts-field :is(input,select,textarea) { box-sizing:border-box; width:100%; min-width:0; min-height:44px; padding:.6rem .7rem; border:1px solid var(--line-strong,var(--line)); border-radius:var(--app-radius,6px); background:var(--surface); color:var(--text); caret-color:var(--violet); font:400 .9375rem var(--font-ui,var(--body)); }
.ts-field textarea { min-height:80px; resize:vertical; line-height:1.6; }
.ts-form-pair { display:grid; grid-template-columns:1fr 1fr; gap:1rem; }
.ts-dialog-actions { position:sticky; bottom:0; display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:.5rem; padding:1rem 1.25rem; border-top:1px solid var(--line); background:var(--surface); z-index:1; }
.ts-delete-work { margin-right:auto; }
.ts-repeat,.ts-adjust-period { margin:0; padding-top:.75rem; border-top:1px solid var(--line); }
.ts-repeat>summary,.ts-adjust-period>summary { font-size:.8125rem; min-height:36px; }
.ts-repeat[open],.ts-adjust-period[open] { display:grid; gap:.85rem; }
.ts-repeat-days { display:flex; flex-wrap:wrap; gap:.5rem .75rem; margin:0; padding:.5rem 0; border:0; }
.ts-repeat-days legend { font-size:.8125rem; font-weight:600; }
.ts-repeat-days label { display:flex; align-items:center; gap:.3rem; min-height:44px; font-size:.8125rem; }
.ts-repeat-days input { width:18px; height:18px; min-height:18px; margin:0; accent-color:var(--violet); }
.ts-repeat-preview { padding:1rem; background:var(--surface-subtle,var(--paper)); border-radius:4px; font-size:.8125rem; }
.ts-repeat-preview>strong { display:block; margin-bottom:.25rem; }
.ts-repeat-preview ul { display:grid; gap:.45rem; max-height:180px; overflow:auto; margin:.75rem 0 0; padding-left:1.2rem; }
.ts-review-total,.ts-recorded-quantity { font-size:1.5rem; font-variant-numeric:tabular-nums; }
.ts-review-range { margin:-.65rem 0 0; color:var(--muted); font-size:.8125rem; }
.ts-review-table-scroll { max-height:260px; overflow:auto; border:1px solid var(--line); border-radius:4px; }
.ts-review-table { width:100%; border-collapse:collapse; font-size:.8125rem; }
.ts-review-table th { position:sticky; top:0; background:var(--surface-subtle,var(--paper)); font-size:.75rem; text-align:left; }
.ts-review-table :is(th,td) { padding:.65rem .75rem; border-bottom:1px solid var(--line); vertical-align:top; }
.ts-review-table td:first-child,.ts-review-table td:nth-child(2) { white-space:nowrap; }
.ts-review-table td:last-child { overflow-wrap:anywhere; }
.ts-review-note { margin:0; padding:.75rem; border-radius:4px; background:var(--warning-bg); color:var(--warning); font-size:.8125rem; line-height:1.6; }
.ts-dialog-date { margin:0; font-size:.9375rem; }
.ts-readonly-state { margin:0; color:var(--muted); font-size:.8125rem; }
.timesheet-editor [hidden] { display:none !important; }
@media(max-width:1050px) {
  .timesheet-editor .ts-day { min-height:112px; padding:.4rem; }
  .ts-event { padding:.4rem .3rem; }
  .ts-event strong { font-size:.75rem; }
  .ts-event-status { font-size:.625rem; }
}
@media(max-width:700px) {
  .ts-heading { padding:1rem 1rem 0; }
  .ts-heading h3 { font-size:1rem; }
  .ts-toolbar { padding:.5rem 1rem .75rem; }
  .ts-navigation { display:grid; grid-template-columns:44px minmax(0,1fr) 44px; width:100%; }
  .ts-navigation h4 { min-width:0; margin:0; font-size:.875rem; }
  .ts-navigation>.button:last-child { grid-column:1/-1; justify-self:center; min-height:36px; margin:.15rem 0 0; padding:.35rem .8rem; font-size:.75rem; }
  .ts-toolbar>.ts-help { display:none; }
  .ts-calendar { margin:0 1rem; }
  .ts-weekdays span { padding:.5rem .1rem; font-size:.6875rem; }
  .timesheet-editor .ts-day { min-height:76px; gap:.2rem; padding:.25rem .15rem; }
  .ts-day-number { align-self:center; width:26px; height:26px; font-size:.75rem; }
  .ts-event { gap:0; padding:.2rem .1rem; text-align:center; }
  .ts-event strong { font-size:.625rem; line-height:1.4; }
  .ts-event-description,.ts-event .ts-event-status { display:none; }
  .ts-agenda { display:grid; gap:.5rem; margin:.85rem 1rem 0; padding:.85rem 0 0; border-top:1px solid var(--line); font-size:.8125rem; }
  .timesheet-editor .ts-agenda-entry { display:flex; align-items:flex-start; flex-direction:column; gap:.4rem; min-width:0; padding:.65rem .75rem; text-align:left; overflow-wrap:anywhere; font-weight:500; font-size:.8125rem; }
  .ts-footer { align-items:flex-start; flex-direction:column; gap:.75rem; padding:1rem; }
  .ts-footer>.button { width:100%; }
  .ts-dialog { position:fixed; inset:auto 0 0; width:100%; max-width:none; max-height:92dvh; margin:0; border-radius:12px 12px 0 0; padding-bottom:env(safe-area-inset-bottom); }
  .ts-dialog-heading { padding:.85rem 1rem; }
  .ts-dialog-body { gap:1rem; padding:1rem; }
  .ts-dialog-actions { padding:.85rem 1rem; }
  .ts-field :is(input,select,textarea) { font-size:1rem; }
  .ts-delete-work { flex-basis:100%; justify-content:flex-start; padding-left:0; }
  .ts-review-table :is(th,td) { padding:.6rem .5rem; font-size:.75rem; }
  .ts-form-pair { gap:.75rem; }
}
