.history-modes, .history-shortcuts, .history-pages, .history-result-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.history-modes {
  margin: 12px 0;
}
.history-modes [aria-pressed="true"] {
  background: #174d3e;
  color: white;
}
.history-panel {
  background: white;
  padding: 16px;
  border: 1px solid #d4dfd7;
  border-radius: 14px;
}
.history-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
  align-items: end;
}
.history-filters label {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-size: 15px;
}
.history-filters input, .history-filters select {
  width: 100%;
  min-width: 0;
}
.history-help {
  color: #52685c;
  font-size: 14px;
  line-height: 1.6;
  margin: 12px 0;
}
.history-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.history-summary span {
  background: #e8f0e8;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
}
.history-result-title {
  justify-content: space-between;
  margin-top: 22px;
}
.history-result-title span {
  font-size: 14px;
}
.history-table-wrap {
  border: 1px solid #d4dfd7;
  border-radius: 12px;
  overflow: hidden;
}
.history-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: white;
}
.history-table th, .history-table td {
  text-align: left;
  padding: 14px 10px;
  border-bottom: 1px solid #e2e8e3;
  vertical-align: top;
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.55;
}
.history-table th {
  background: #e8f0e8;
  font-size: 14px;
}
.history-table th:first-child {
  width: 25%;
}
.history-table small {
  display: block;
  font-size: 13px;
  color: #52685c;
  margin-top: 4px;
}
.history-status {
  display: inline-block;
  border-radius: 6px;
  padding: 4px 8px;
  background: #eef1ef;
  font-weight: 600;
  font-size: 14px;
}
.history-status.present {
  background: #e4f1e6;
  color: #1e623a;
}
.history-status.leave {
  background: #fff2cd;
  color: #80530c;
}
.history-status.absent {
  background: #fbe9e5;
  color: #8e352d;
}
.history-transfer {
  display: block;
  font-size: 13px;
  color: #346c85;
  margin-bottom: 4px;
}
.history-pages {
  justify-content: space-between;
  margin: 20px 0;
}
.history-pages span {
  font-size: 14px;
}
.history-empty {
  text-align: center;
  padding: 30px 16px;
  border: 1px dashed #b6c8ba;
  border-radius: 12px;
  background: white;
}
.history-empty p {
  line-height: 1.6;
  margin: 12px 0 18px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
@media (max-width: 650px) {
  .history-filters .history-search, .history-filters > button {
    grid-column: 1 / -1;
  }
  .history-panel {
    padding: 12px;
  }
  .history-shortcuts button {
    padding: 9px;
    font-size: 14px;
    flex: 1;
  }
  .history-table-wrap {
    border: 0;
    border-radius: 0;
    overflow: visible;
  }
  .history-table, .history-table tbody {
    display: block;
    background: transparent;
  }
  .history-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .history-table tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: white;
    margin-bottom: 12px;
    border: 1px solid #d4dfd7;
    border-radius: 12px;
    padding: 12px;
    gap: 12px;
  }
  .history-table td {
    display: block;
    border: 0;
    padding: 0;
    min-width: 0;
  }
  .history-table .history-person {
    font-size: 17px;
  }
  .history-table .history-date {
    text-align: right;
  }
  .history-table .history-note {
    grid-column: 1 / -1;
    border-top: 1px solid #e2e8e3;
    padding-top: 10px;
  }
  .history-note::before {
    content: 'Ghi chú: ';
    color: #52685c;
  }
}
@media (max-width: 380px) {
  .history-filters {
    grid-template-columns: minmax(0, 1fr);
  }
}
