.timesheet-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.timesheet-summary-item {
  min-width: 0;
  padding: 18px 20px;
}

.timesheet-summary-item > span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
}

.timesheet-summary-item > strong {
  display: block;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}

.timesheet-summary-item > strong small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
}

.timesheet-summary-money > strong {
  font-size: 24px;
}

@media (max-width: 760px) {
  .timesheet-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .timesheet-summary-item {
    padding: 15px 16px;
  }

  .timesheet-summary-item > strong,
  .timesheet-summary-money > strong {
    font-size: 20px;
  }
}

/* Compact timesheet table */

.timesheet-table {
  width: 100%;
  font-variant-numeric: tabular-nums;
}

.timesheet-table thead th {
  height: 34px;
  padding: 7px 12px;
  font-size: 10px;
  white-space: nowrap;
}

.timesheet-table tbody tr {
  height: 50px;
}

.timesheet-table tbody td {
  height: 50px;
  padding: 7px 12px;
  vertical-align: middle;
  line-height: 1.25;
  white-space: nowrap;
}

.timesheet-table .sub {
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.2;
}

.timesheet-table .badge {
  padding-block: 4px;
}

.timesheet-rate-unit {
  margin-left: 2px;
  color: var(--muted);
  font-size: 10px;
}

.timesheet-amount {
  font-weight: 600;
}

@media (max-width: 760px) {
  .timesheet-table {
    min-width: 760px;
  }

  .timesheet-table thead th,
  .timesheet-table tbody td {
    padding-inline: 10px;
  }
}

/* Timesheet mobile accordion */

.timesheet-mobile {
  display: none;
}

@media (max-width: 760px) {
  .timesheet-desktop {
    display: none;
  }

  .timesheet-mobile {
    display: grid;
    gap: 8px;
  }

  .timesheet-mobile-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
  }

  .timesheet-mobile-summary {
    min-height: 68px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 18px;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    cursor: pointer;
    list-style: none;
  }

  .timesheet-mobile-summary::-webkit-details-marker {
    display: none;
  }

  .timesheet-mobile-summary-main {
    min-width: 0;
    display: grid;
    gap: 3px;
  }

  .timesheet-mobile-summary-main strong {
    font-size: 14px;
    font-weight: 600;
  }

  .timesheet-mobile-summary-main span {
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .timesheet-mobile-summary-meta {
    display: grid;
    gap: 3px;
    text-align: right;
    font-variant-numeric: tabular-nums;
  }

  .timesheet-mobile-summary-meta strong {
    font-size: 14px;
    font-weight: 600;
  }

  .timesheet-mobile-summary-meta span {
    color: var(--muted);
    font-size: 10px;
  }

  .timesheet-mobile-body {
    padding: 0 14px 14px;
    border-top: 1px solid var(--line);
  }

  .timesheet-mobile-employee {
    padding: 12px 0 4px;
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
  }

  .timesheet-mobile-details {
    display: grid;
    margin: 6px 0 0;
  }

  .timesheet-mobile-details > div {
    min-height: 38px;
    display: grid;
    grid-template-columns: minmax(90px, 0.8fr) minmax(0, 1.2fr);
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid var(--line);
  }

  .timesheet-mobile-details > div:last-child {
    border-bottom: 0;
  }

  .timesheet-mobile-details dt {
    color: var(--muted);
    font-size: 11px;
  }

  .timesheet-mobile-details dd {
    margin: 0;
    color: var(--text);
    font-size: 12px;
    font-weight: 500;
    text-align: right;
    font-variant-numeric: tabular-nums;
  }

  .timesheet-mobile-details .timesheet-mobile-amount {
    font-weight: 600;
  }

  .timesheet-mobile-edit {
    width: 100%;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    text-align: left;
  }
}

@media (max-width: 760px) {
  .timesheet-list-card {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }

  .timesheet-mobile-card {
    background: var(--surface);
  }
}

/* Timesheet day groups */

.timesheet-grouped-table .timesheet-day-row {
  height: auto;
}

.timesheet-grouped-table .timesheet-day-row > td {
  height: auto;
  padding: 0;
  border-bottom: 0;
  background: var(--surface-soft);
}

.timesheet-day-head {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 9px 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.timesheet-day-row:first-child .timesheet-day-head {
  border-top: 0;
}

.timesheet-day-head > strong {
  font-size: 12px;
  font-weight: 650;
  text-transform: capitalize;
}

.timesheet-day-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.timesheet-day-meta strong {
  color: var(--text);
  font-size: 11px;
  font-weight: 650;
}

.timesheet-shift-row td:first-child {
  padding-left: 18px;
}

/* Timesheet desktop polish */

.timesheet-desktop .table-wrap {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
}

.timesheet-grouped-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

.timesheet-grouped-table thead th {
  background: color-mix(in srgb, var(--surface-soft) 82%, var(--text) 4%);
  border-bottom: 1px solid var(--line);
}

.timesheet-grouped-table thead th:first-child {
  border-top-left-radius: 18px;
}

.timesheet-grouped-table thead th:last-child {
  border-top-right-radius: 18px;
}

.timesheet-day-row > td {
  background: color-mix(in srgb, var(--surface-soft) 88%, var(--text) 3%);
}

.timesheet-day-head {
  background: color-mix(in srgb, var(--surface-soft) 92%, var(--text) 2%);
}

.timesheet-shift-row td {
  background: var(--surface);
}

.timesheet-shift-row:hover td {
  background: color-mix(in srgb, var(--surface) 92%, var(--blue) 8%);
}

.timesheet-grouped-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 18px;
}

.timesheet-grouped-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 18px;
}

/* Timesheet theme tuning */

:root {
  --timesheet-head-bg: #f3f6f9;
  --timesheet-day-bg: #f7f9fb;
  --timesheet-row-hover: #f3f8fe;
}

[data-theme='dark'] {
  --timesheet-head-bg: #202a36;
  --timesheet-day-bg: #1b2530;
  --timesheet-row-hover: #1b2a3a;
}

.timesheet-desktop .table-wrap {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
}

.timesheet-grouped-table thead th {
  background: var(--timesheet-head-bg);
  border-bottom: 1px solid var(--line);
}

.timesheet-day-row > td,
.timesheet-day-head {
  background: var(--timesheet-day-bg);
}

.timesheet-shift-row td {
  background: var(--surface);
}

.timesheet-shift-row:hover td {
  background: var(--timesheet-row-hover);
}

/* Timesheet day status */

.timesheet-day-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.timesheet-day-status {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--muted);
}

.timesheet-day-status.complete {
  background: #4caf7a;
}

.timesheet-day-status.partial {
  background: #e3a23b;
}

.timesheet-day-status.pending {
  background: #a9b3bf;
}

[data-theme='dark'] .timesheet-day-status.complete {
  background: #67c993;
}

[data-theme='dark'] .timesheet-day-status.partial {
  background: #f0b95a;
}

[data-theme='dark'] .timesheet-day-status.pending {
  background: #687787;
}

.timesheet-mobile-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.timesheet-mobile-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 8px;
}

.timesheet-mobile-status-dot.done {
  background: #57c288;
}

.timesheet-mobile-status-dot.partial {
  background: #f2a65a;
}

.timesheet-mobile-status-dot.pending {
  background: #7f8da3;
}

.timesheet-row-actions,
.timesheet-mobile-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.badge.timesheet-no-show {
  background: color-mix(in srgb, #e05252 12%, transparent);
  color: #c83f3f;
}

.timesheet-no-show-action {
  color: #c83f3f;
}

.timesheet-mobile-status-dot.no-show {
  background: #d84b4b;
}
