.timesheets-page main { width: min(1500px, 100%); }
.timesheets-page .heading { margin-bottom: 24px; }
.timesheets-page .heading p:last-child { margin: 0; }
.test-badge { display: inline-flex; align-items: center; gap: 9px; padding: 9px 12px; border: 1px solid #d9e3ec; border-radius: 8px; background: var(--surface); color: var(--muted); font-size: 12px; white-space: nowrap; box-shadow: var(--shadow-sm); }
.filters { display: grid; grid-template-columns: minmax(170px, 230px) minmax(260px, 1fr) 210px; gap: 16px; margin-bottom: 20px; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); }
.filters label, .people-bar label, .card label { display: grid; gap: 7px; color: var(--ink-soft); font-size: 12px; font-weight: 650; }
.filters select, .filters input { min-height: 46px; }
.empty-state { padding: 24px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--muted); }
#ts-feedback:empty { display: none; }
#ts-feedback:not(:empty), .status { position: relative; margin-bottom: 16px; padding: 12px 16px 12px 42px; border: 1px solid #c8e2d7; border-radius: 10px; background: var(--success-soft); color: #275e4d; font-size: 13px; line-height: 1.55; }
#ts-feedback:not(:empty)::before, .status::before { content: ""; position: absolute; top: 17px; left: 18px; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(22, 120, 91, .1); }
#ts-feedback.error, .status[data-state="error"], .status[data-state="conflict"] { border-color: #efc4bf; background: var(--danger-soft); color: var(--danger); }
.status[data-state="uncertain"], .status[data-state="queued"], .status[data-state="processing"] { border-color: #ead7af; background: var(--warning-soft); color: var(--warning); }
.status strong { color: inherit; font-weight: 700; }
#ts-editor { padding: 20px 22px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow-sm); }
.people-bar { display: flex; align-items: flex-end; gap: 12px; margin: 18px 0 14px; padding: 14px; border: 1px solid #e4eaf0; border-radius: 10px; background: var(--surface-soft); }
.people-bar label { width: min(100%, 420px); }
.people-bar button { min-height: 44px; }
.table-note { display: flex; align-items: baseline; gap: 12px; margin: 18px 0 12px; }
.table-note strong { flex-shrink: 0; font-size: 13px; }
.table-note span { color: var(--muted); font-size: 12px; }
.table-empty { padding: 36px 22px; border: 1px dashed #b9c9d8; border-radius: 10px; background: #f8fafc; text-align: center; }
.table-empty-icon { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.table-empty-icon svg { width: 28px; height: 28px; }
.table-empty h3 { margin: 0 0 7px; font-size: 16px; }
.table-empty p { max-width: 560px; margin: 0 auto; font-size: 13px; }
.table-wrap { max-height: 620px; margin-top: 14px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
table { min-width: 100%; border-spacing: 0; border-collapse: separate; font-size: 13px; }
th, td { padding: 7px; border-right: 1px solid #e5ebf0; border-bottom: 1px solid #e5ebf0; text-align: center; white-space: nowrap; }
thead th { position: sticky; top: 0; z-index: 2; background: #edf2f7; color: #43536a; font-size: 12px; }
thead th:first-child { z-index: 4; }
th:first-child, td:first-child { position: sticky; left: 0; z-index: 1; min-width: 225px; max-width: 270px; background: var(--surface); box-shadow: 3px 0 5px rgba(15, 23, 42, .035); text-align: left; white-space: normal; }
thead th:first-child { background: #edf2f7; }
td input { width: 62px; min-height: 38px; padding: 7px 4px; font-variant-numeric: tabular-nums; text-align: center; }
td input:disabled { border-color: transparent; background: #f0f3f6; }
td small { display: block; margin-top: 2px; color: var(--muted); }
td .zero { min-height: 30px; margin-top: 6px; padding: 3px 6px; color: var(--muted); font-size: 11px; font-weight: 500; }
td.total { min-width: 78px; background: #f3f6fa; font-weight: 750; font-variant-numeric: tabular-nums; }
.weekend { background: #fff8e9; }
tbody tr:hover td:first-child { background: #f4f8fb; }
.timesheets-page .actions { position: static; margin: 20px -22px -22px; padding: 18px 22px; border-radius: 0 0 13px 13px; background: #f8fafc; box-shadow: none; }
.timesheets-page .actions span { margin-right: auto; color: var(--muted); font-size: 13px; }
.timesheets-page .actions #ts-dirty { display: inline-flex; align-items: center; gap: 8px; }
.timesheets-page .actions #ts-dirty::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #9aa8b8; }
.timesheets-page .actions #ts-dirty.dirty::before { background: var(--warning); }
.timesheets-page .actions span.dirty { color: var(--warning); }
.timesheets-page .actions .primary { margin-left: 0; }
.hint { margin: 14px 0 0; color: var(--muted); font-size: 12px; }
.admin-section { margin-top: 30px; padding: 24px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow-sm); }
.admin-section > summary { display: flex; align-items: baseline; gap: 14px; cursor: pointer; font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.admin-section > summary::after { content: "+"; margin-left: auto; color: var(--subtle); font-size: 22px; font-weight: 400; }
.admin-section[open] > summary::after { content: "−"; }
.admin-section > summary small { color: var(--muted); font-size: 11px; font-weight: 400; letter-spacing: 0; }
.admin-section[open] > summary { margin-bottom: 18px; }
.admin-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.card { padding: 21px; border: 1px solid var(--line); border-radius: 11px; background: #f9fbfd; }
.card h2 { margin: 5px 0 18px; font-size: 18px; }
.card label { margin-bottom: 13px; }
.card > button { margin-top: 4px; }
.date-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.assignments { display: grid; gap: 7px; margin: 22px 0 28px; }
.assignment { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 13px; overflow-wrap: anywhere; }
.assignment button { min-height: 36px; padding: 6px 10px; font-size: 12px; }
.history-head { display: flex; align-items: baseline; gap: 12px; margin-top: 24px; }
.history-head h2 { margin: 0; font-size: 18px; }
.history-head span { color: var(--muted); font-size: 11px; }
.history-row { padding: 12px 2px; border-bottom: 1px solid #e8edf2; color: var(--ink-soft); font-size: 13px; }
.timesheets-page footer { width: min(1500px, 100%); }
@media (max-width: 1000px) {
  .admin-grid { grid-template-columns: 1fr; }
  .card { padding: 20px; }
}
@media (max-width: 700px) {
  .timesheets-page .heading { display: flex; }
  .filters { grid-template-columns: minmax(0, 1fr) 150px; gap: 12px; padding: 16px; }
  .test-badge { display: inline-flex; }
  #ts-editor { padding: 16px; }
  .people-bar { align-items: stretch; flex-direction: column; }
  .people-bar label { width: 100%; }
  .table-note { align-items: flex-start; flex-direction: column; gap: 4px; }
  .timesheets-page .actions { display: grid; grid-template-columns: 1fr; margin: 18px -16px -16px; padding: 18px 16px; }
  .timesheets-page .actions span { grid-column: 1; margin: 0; }
  .timesheets-page .actions button { width: 100%; }
  th:first-child, td:first-child { min-width: 165px; max-width: 180px; }
  .table-wrap { max-height: 560px; }
  .admin-section { padding: 18px; }
  .admin-section > summary { align-items: flex-start; flex-direction: column; gap: 4px; }
  .assignment { align-items: flex-start; }
}
@media (max-width: 520px) {
  .filters { grid-template-columns: 1fr; }
  .filters label { width: 100%; }
  .date-pair { grid-template-columns: 1fr; }
  .history-head { align-items: flex-start; flex-direction: column; gap: 3px; }
  .assignment { flex-direction: column; }
  .assignment button { width: 100%; }
}
