/*
 * Agency Timesheet history workspace v1.
 */

.agency-timesheet-history-workspace {
  display: grid;
  gap: 16px;
}

.agency-timesheet-history-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.agency-timesheet-history-head > div > span {
  display: block;
  margin-bottom: 7px;
  color: #4d6788;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.agency-timesheet-history-head h2 {
  margin: 0;
  color: #102b55;
  font-size: 29px;
  line-height: 1.16;
}

.agency-timesheet-history-head p {
  max-width: 620px;
  margin: 8px 0 0;
  color: #667a96;
  font-size: 14px;
  line-height: 1.55;
}

.agency-timesheet-history-head > strong {
  flex: 0 0 auto;
  padding: 8px 11px;
  border: 1px solid #d7e1ed;
  border-radius: 999px;
  background: #f7f9fc;
  color: #647793;
  font-size: 10px;
}

.agency-timesheet-history-tools {
  display: grid;
  grid-template-columns:
    minmax(220px, 1fr)
    minmax(420px, auto);
  gap: 12px;
  padding: 16px;
  border: 1px solid #dce5ef;
  border-radius: 14px;
  background: #ffffff;
}

.agency-timesheet-history-search,
.agency-timesheet-history-dates label {
  display: grid;
  gap: 6px;
}

.agency-timesheet-history-search > span,
.agency-timesheet-history-dates label > span {
  color: #58708f;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.agency-timesheet-history-search input,
.agency-timesheet-history-dates input {
  width: 100%;
  min-height: 42px;
  box-sizing: border-box;
  border: 1px solid #cbd8e8;
  border-radius: 9px;
  background: #ffffff;
  color: #172b4d;
  font: inherit;
  font-size: 12px;
  padding: 8px 10px;
}

.agency-timesheet-history-search input:focus,
.agency-timesheet-history-dates input:focus {
  outline: 3px solid rgba(52, 120, 246, 0.15);
  border-color: #3478f6;
}

.agency-timesheet-history-dates {
  display: grid;
  grid-template-columns:
    minmax(135px, 1fr)
    minmax(135px, 1fr)
    auto;
  align-items: end;
  gap: 8px;
}

.agency-timesheet-history-dates button {
  min-height: 42px;
  border: 1px solid #cbd8e8;
  border-radius: 9px;
  background: #f7f9fc;
  color: #49617e;
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  padding: 8px 12px;
  white-space: nowrap;
}

.agency-timesheet-history-filters {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.agency-timesheet-history-filters::-webkit-scrollbar {
  display: none;
}

.agency-timesheet-history-filters button {
  flex: 0 0 auto;
  min-height: 34px;
  border: 1px solid #d3deeb;
  border-radius: 999px;
  background: #ffffff;
  color: #60748f;
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  padding: 7px 12px;
}

.agency-timesheet-history-filters button.is-active {
  border-color: #183967;
  background: #183967;
  color: #ffffff;
}

.agency-timesheet-history-message {
  padding: 11px 13px;
  border: 1px solid #d7e1ed;
  border-radius: 9px;
  background: #f7f9fc;
  color: #516985;
  font-size: 11px;
  font-weight: 700;
}

.agency-timesheet-history-message.is-error {
  border-color: #efb1b1;
  background: #fff2f2;
  color: #9b3030;
}

.agency-timesheet-history-summary {
  display: grid;
  grid-template-columns:
    repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.agency-timesheet-history-summary article {
  padding: 14px 15px;
  border: 1px solid #dce5ef;
  border-radius: 12px;
  background: #ffffff;
}

.agency-timesheet-history-summary strong,
.agency-timesheet-history-summary span {
  display: block;
}

.agency-timesheet-history-summary strong {
  overflow: hidden;
  color: #102b55;
  font-size: 18px;
  line-height: 1.25;
  text-overflow: ellipsis;
}

.agency-timesheet-history-summary span {
  margin-top: 5px;
  color: #71819a;
  font-size: 10px;
  font-weight: 700;
}

.agency-timesheet-history-summary article.is-margin strong {
  color: #06966b;
}

.agency-timesheet-history-results {
  display: grid;
  gap: 12px;
}

.agency-timesheet-history-folder {
  overflow: hidden;
  border: 1px solid #dce5ef;
  border-radius: 14px;
  background: #ffffff;
}

.agency-timesheet-history-folder summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  background: #f7f9fc;
  color: #17365f;
  cursor: pointer;
  list-style: none;
}

.agency-timesheet-history-folder summary::-webkit-details-marker {
  display: none;
}

.agency-timesheet-history-folder summary span {
  font-size: 13px;
  font-weight: 850;
}

.agency-timesheet-history-folder summary strong {
  color: #72829a;
  font-size: 10px;
}

.agency-timesheet-history-folder-body {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.agency-timesheet-history-card {
  border: 1px solid #e0e7f0;
  border-radius: 11px;
  background: #ffffff;
}

.agency-timesheet-history-card-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
}

.agency-timesheet-history-identity strong,
.agency-timesheet-history-identity span,
.agency-timesheet-history-identity small {
  display: block;
}

.agency-timesheet-history-identity strong {
  color: #102b55;
  font-size: 14px;
}

.agency-timesheet-history-identity span {
  margin-top: 4px;
  color: #5f7390;
  font-size: 11px;
}

.agency-timesheet-history-identity small {
  margin-top: 4px;
  color: #8a98ac;
  font-size: 9px;
}

.agency-timesheet-history-status {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: #edf2f8;
  color: #516985;
  font-size: 8px;
  font-weight: 850;
  text-transform: uppercase;
}

.agency-timesheet-history-status.is-needs_review,
.agency-timesheet-history-status.is-changes_requested {
  background: #fff0d5;
  color: #956000;
}

.agency-timesheet-history-status.is-ready {
  background: #e8f1ff;
  color: #2365c5;
}

.agency-timesheet-history-status.is-submitted {
  background: #f0ebff;
  color: #6a45b8;
}

.agency-timesheet-history-status.is-approved {
  background: #e5f8f0;
  color: #087e5c;
}

.agency-timesheet-history-metrics {
  display: grid;
  grid-template-columns:
    repeat(5, minmax(0, 1fr));
  gap: 1px;
  border-top: 1px solid #e5ebf2;
  border-bottom: 1px solid #e5ebf2;
  background: #e5ebf2;
}

.agency-timesheet-history-metrics > div {
  min-width: 0;
  padding: 10px 12px;
  background: #fbfcfe;
}

.agency-timesheet-history-metrics span,
.agency-timesheet-history-metrics strong {
  display: block;
}

.agency-timesheet-history-metrics span {
  color: #8795a9;
  font-size: 8px;
  font-weight: 750;
  text-transform: uppercase;
}

.agency-timesheet-history-metrics strong {
  margin-top: 4px;
  overflow: hidden;
  color: #17365f;
  font-size: 11px;
  text-overflow: ellipsis;
}

.agency-timesheet-history-metrics .is-margin strong {
  color: #07855f;
}

.agency-timesheet-history-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
}

.agency-timesheet-history-card-footer span {
  color: #8795a9;
  font-size: 9px;
}

.agency-timesheet-history-card-footer button {
  border: 1px solid #bfd0e5;
  border-radius: 8px;
  background: #ffffff;
  color: #265b9f;
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 850;
  padding: 7px 10px;
}

.agency-timesheet-history-card-footer button:hover {
  border-color: #3478f6;
  color: #1f68d6;
}

.agency-timesheet-history-loading,
.agency-timesheet-history-empty {
  display: flex;
  min-height: 190px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 24px;
  border: 1px dashed #d3deeb;
  border-radius: 13px;
  background: #ffffff;
  color: #71819a;
  font-size: 12px;
  text-align: center;
}

.agency-timesheet-history-empty strong {
  color: #17365f;
  font-size: 14px;
}

.agency-timesheet-history-empty span {
  max-width: 360px;
  margin-top: 6px;
  line-height: 1.55;
}

@media (max-width: 820px) {
  .agency-timesheet-history-tools {
    grid-template-columns: 1fr;
  }

  .agency-timesheet-history-dates {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .agency-timesheet-history-dates button {
    grid-column: 1 / -1;
  }

  .agency-timesheet-history-metrics {
    grid-template-columns:
      repeat(3, minmax(0, 1fr));
  }

  .agency-timesheet-history-metrics > div:nth-child(4),
  .agency-timesheet-history-metrics > div:nth-child(5) {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .agency-timesheet-history-head {
    display: grid;
    gap: 10px;
  }

  .agency-timesheet-history-head h2 {
    font-size: 24px;
  }

  .agency-timesheet-history-head > strong {
    justify-self: start;
  }

  .agency-timesheet-history-summary {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .agency-timesheet-history-card-main {
    display: grid;
  }

  .agency-timesheet-history-status {
    justify-self: start;
  }

  .agency-timesheet-history-metrics {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .agency-timesheet-history-metrics > div:last-child {
    grid-column: 1 / -1;
  }

  .agency-timesheet-history-card-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .agency-timesheet-history-card-footer button {
    min-height: 40px;
    width: 100%;
  }
}

@media (max-width: 390px) {
  .agency-timesheet-history-dates {
    grid-template-columns: 1fr;
  }

  .agency-timesheet-history-dates button {
    grid-column: auto;
  }

  .agency-timesheet-history-summary {
    grid-template-columns: 1fr;
  }
}
