/* Printable time sheet — aligned with config/timesheets/timesheet_template.pdf */

:root {
  --ts-ink: #000;
  --ts-rule: #000;
  --ts-paper: #fff;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 11pt;
}

body.timesheet-document-body {
  margin: 0;
  padding: 0;
  font-family: "Times New Roman", Times, serif;
  color: var(--ts-ink);
  background: #d4d4d4;
}

.timesheet-document-nav {
  max-width: 8.5in;
  margin: 0 auto;
  padding: 0.6rem 0.75rem;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.8125rem;
}

.timesheet-document-nav a {
  color: #1e40af;
}

.ts-doc {
  max-width: 8.5in;
  min-height: 10.5in;
  margin: 0 auto 1.5rem;
  padding: 0.55in 0.65in 0.6in;
  background: var(--ts-paper);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.ts-doc__masthead {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding-bottom: 0.35rem;
  margin-bottom: 0.5rem;
  border-bottom: 2px solid var(--ts-rule);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.25;
}

.ts-doc__org {
  flex: 1;
  text-align: left;
  text-transform: none;
}

.ts-doc__form-title {
  flex: 0 0 auto;
  text-align: right;
  white-space: nowrap;
}

.ts-doc__label {
  font-weight: 700;
}

.ts-doc__pay-period {
  margin: 0.65rem 0 0.85rem;
  font-size: 0.95rem;
}

.ts-doc__pair-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.45rem;
  font-size: 0.95rem;
}

.ts-doc__pair {
  flex: 1;
  min-width: 12rem;
}

.ts-doc__pair--right {
  text-align: right;
}

.ts-doc__field--inline {
  margin-left: 0.25rem;
  border-bottom: 1px solid var(--ts-rule);
  padding: 0 0.15rem 0.05rem;
  min-width: 8rem;
  display: inline-block;
}

.ts-doc__pair--right .ts-doc__field--inline {
  min-width: 6rem;
}

.ts-doc__supervisor {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
}

.ts-doc__spacer {
  height: 0.65rem;
}

.ts-doc__grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.88rem;
}

.ts-doc__grid th,
.ts-doc__grid td {
  border: 1px solid var(--ts-rule);
  padding: 0.2rem 0.35rem;
  vertical-align: middle;
}

.ts-doc__grid thead th {
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
  padding: 0.25rem 0.2rem;
}

.ts-doc__th-stacked {
  display: inline-block;
}

.ts-doc__col-date {
  width: 28%;
}

.ts-doc__col-time {
  width: 14%;
}

.ts-doc__col-hours {
  width: 12%;
}

.ts-doc__col-total {
  width: 14%;
}

.ts-doc__num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ts-doc__row-blank td {
  height: 1.35rem;
}

.ts-doc__row-totals td {
  font-weight: 700;
  padding: 0.35rem 0.35rem;
}

.ts-doc__totals-label {
  text-align: right;
  border-right: none;
}

.ts-doc__row-totals .ts-doc__num {
  border-left: none;
}

.ts-doc__footer {
  margin-top: 1.75rem;
  font-size: 0.95rem;
}

.ts-doc__sig-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
}

.ts-doc__sig {
  flex: 1;
  min-width: 14rem;
}

.ts-doc__sig-line {
  display: block;
  margin-top: 0.15rem;
  min-width: 14rem;
  min-height: 1.5rem;
  border-bottom: 1px solid var(--ts-rule);
}

.ts-doc__sig-date {
  flex: 0 0 auto;
  white-space: nowrap;
}

.screen-only {
  display: block;
}

@media print {
  body.timesheet-document-body {
    background: var(--ts-paper);
  }

  .ts-doc {
    margin: 0;
    padding: 0.45in 0.5in;
    box-shadow: none;
    max-width: none;
    min-height: auto;
  }

  .screen-only {
    display: none !important;
  }

  .ts-doc__grid {
    break-inside: avoid;
  }
}
