.employee-section-tabs {
  width: max-content;
  max-width: 100%;
  min-height: 3.75rem;
  align-items: stretch;
  justify-content: center;
  margin: 0 auto var(--space-8);
  overflow-x: auto;
  padding: 0 0 0.35rem;
  scrollbar-width: thin;
  gap: 0.18rem;
}

.employee-section-tab {
  min-width: 10rem;
  min-height: 3.35rem;
  padding: 0.65rem 1.1rem;
  border-radius: 0.68rem;
  font-size: 0.82rem;
  font-weight: 540;
  gap: 0.55rem;
}

.employee-section-tab small {
  display: inline-flex;
  min-width: 1.55rem;
  min-height: 1.45rem;
  align-items: center;
  justify-content: center;
  padding: 0.1rem 0.42rem;
  border-radius: 999px;
  background: #eef3f8;
  color: #6a7b90;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
}

.employee-section-tab.is-active small {
  background: var(--color-blue-soft);
  color: var(--color-blue);
}

.attendance-page,
.database-page {
  width: 100%;
  max-width: 100rem;
}

.attendance-page {
  padding-bottom: 5.8rem;
}

.attendance-list-header,
.database-list-header,
.employee-record-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-8);
}

.attendance-list-header,
.database-list-header {
  min-height: 5.2rem;
  padding-bottom: 0;
  border-bottom: 0;
}

.attendance-list-header h2,
.database-list-header h2,
.employee-record-header h2 {
  margin: 0;
  color: var(--color-text);
  letter-spacing: -0.035em;
}

.attendance-list-header h2,
.database-list-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
}

.attendance-list-header > div:first-child > p:last-child,
.database-list-header > div:first-child > p:last-child,
.employee-record-identity > p:last-child {
  margin: 0.45rem 0 0;
  color: var(--color-muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

.employee-section-eyebrow {
  margin: 0 0 0.4rem !important;
  color: var(--color-blue) !important;
  font-size: 0.64rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.1em !important;
  line-height: 1.2 !important;
  text-transform: uppercase;
}

.attendance-device-actions,
.database-header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.attendance-device-actions {
  min-height: 3rem;
  padding: 0;
  border: 0;
}

.device-state {
  min-height: 2.55rem;
  padding: 0.5rem 0.8rem;
  border: 1px solid #cde8db;
  border-radius: 0.65rem;
  background: #f4fbf7;
  color: #276b4d;
  font-size: 0.76rem;
}

.sync-button {
  min-height: 2.65rem;
}

.attendance-toolbar {
  max-width: 78rem;
  grid-template-columns: minmax(13rem, 0.72fr) minmax(20rem, 1.35fr) minmax(14rem, 0.8fr) auto;
  align-items: end;
  margin: var(--space-6) 0 var(--space-8);
}

.database-toolbar {
  max-width: 72rem;
  grid-template-columns: minmax(22rem, 1.55fr) minmax(14rem, 0.72fr) auto;
  align-items: end;
  margin: var(--space-6) 0 var(--space-8);
}

.attendance-control-label,
.database-search-control > span,
.database-filter-control > span {
  font-size: 0.7rem;
}

.attendance-control input,
.database-search-control input,
.database-filter-control select {
  min-height: 3rem;
  font-size: 0.84rem;
}

.attendance-table,
.database-table {
  min-width: 76rem;
}

.attendance-table th,
.database-table th {
  padding: 0 1rem 0.82rem;
  font-size: 0.68rem;
  letter-spacing: 0.035em;
}

.attendance-table td,
.database-table td {
  height: 5.25rem;
  padding: 0.9rem 1rem;
  border-bottom-color: #e7edf3;
  font-size: 0.79rem;
}

.attendance-table th:first-child,
.attendance-table td:first-child,
.database-table th:first-child,
.database-table td:first-child { width: 3.6rem; padding-right: 0.3rem; padding-left: 0.4rem; }
.database-table th:nth-child(2),
.database-table td:nth-child(2) { width: 22%; }
.database-table th:nth-child(3),
.database-table td:nth-child(3) { width: 21%; }
.database-table th:nth-child(4),
.database-table td:nth-child(4) { width: 25%; }
.database-table th:nth-child(5),
.database-table td:nth-child(5) { width: 14%; }
.database-table th:nth-child(6),
.database-table td:nth-child(6) { width: 18%; }

.attendance-table th:last-child,
.attendance-table td:last-child,
.database-table th:last-child,
.database-table td:last-child {
  padding-right: 0;
}

.attendance-table th:first-child,
.attendance-table td:first-child {
  width: 40%;
  padding-left: 1rem;
}

.attendance-table th:nth-child(2),
.attendance-table td:nth-child(2),
.attendance-table th:nth-child(3),
.attendance-table td:nth-child(3) {
  width: 18%;
}

.attendance-table th:last-child,
.attendance-table td:last-child {
  width: 24%;
}

.attendance-table tbody tr {
  transition: background-color var(--transition-fast), box-shadow var(--transition-fast);
}

.attendance-table tbody tr:hover {
  background: rgb(234 244 255 / 48%);
  box-shadow: inset 0.25rem 0 0 var(--color-blue);
}

.database-table tbody tr[data-employee-id] {
  transition: background-color var(--transition-fast), box-shadow var(--transition-fast);
}

.database-table tbody tr[data-employee-id]:hover,
.database-table tbody tr[data-employee-id]:focus-visible {
  background: rgb(234 244 255 / 48%);
  box-shadow: inset 0.25rem 0 0 var(--color-blue);
  outline: none;
}

.database-employee-link {
  font-size: 0.82rem;
  font-weight: 640;
}

.attendance-employee-name,
.database-primary-value {
  font-size: 0.82rem;
}

.attendance-employee-id,
.database-employee-id,
.database-secondary-value {
  font-size: 0.67rem;
}

.employment-status,
.document-health,
.contract-status,
.attendance-status {
  min-height: 1.8rem;
  padding: 0.28rem 0.68rem;
  font-size: 0.67rem;
  font-weight: 680;
}

.attendance-report-footer-inner {
  max-width: 100rem;
}

.database-record-view {
  animation: employee-record-enter 240ms var(--ease-out) both;
}

.back-to-list-button {
  min-height: 2.6rem;
  margin-bottom: var(--space-5);
  padding: 0.45rem 0.7rem;
  border-radius: 0.6rem;
  font-size: 0.75rem;
  gap: 0;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.back-to-list-button [aria-hidden="true"] {
  display: none;
}

.back-to-list-button:hover {
  background: var(--color-blue-faint);
  color: var(--color-blue);
  transform: none;
}

.employee-record-header {
  min-height: 7.3rem;
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--color-border-strong);
}

.employee-record-title-row {
  gap: var(--space-3);
}

.employee-record-header h2 {
  max-width: 56rem;
  font-size: 1.55rem;
  font-weight: 700;
}

.record-tabs {
  margin-top: var(--space-6);
  gap: var(--space-8);
}

.record-tab {
  padding: 0.7rem 0.1rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.record-panel {
  padding-top: var(--space-8);
}

.record-section {
  width: 100%;
  max-width: 100rem;
}

.record-section-heading {
  min-height: 3.4rem;
  margin-bottom: var(--space-3);
}

.record-section-heading h3 {
  font-size: 1rem;
  font-weight: 680;
  letter-spacing: -0.035em;
}

.record-fields {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.record-field,
.record-field:nth-child(odd),
.record-field:nth-child(even) {
  min-height: 5.5rem;
  padding: 1.2rem var(--space-6) 1.2rem 0;
  border-right: 0;
  border-left: 0;
}

.record-field:not(:nth-child(3n + 1)) {
  padding-left: var(--space-6);
  border-left: 1px solid var(--color-border);
}

.record-field-label {
  font-size: 0.66rem;
  font-weight: 650;
}

.record-field-value {
  font-size: 0.82rem;
}

.record-table th:first-child,
.record-table td:first-child {
  padding-left: 1.35rem;
}

.record-table tbody tr:hover {
  background: rgb(234 244 255 / 48%);
}

.dialog-close-button {
  font-size: 0;
}

.dialog-close-button::before {
  content: "\00D7";
  font-size: 1.4rem;
}

@keyframes employee-record-enter {
  from {
    opacity: 0;
    transform: translateY(0.3rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 72rem) {
  .employee-section-tabs {
    width: 100%;
    justify-content: flex-start;
  }

  .attendance-list-header,
  .database-list-header,
  .employee-record-header {
    flex-direction: column;
  }

  .attendance-device-actions,
  .database-header-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 56rem) {
  .employee-section-tabs {
    margin-bottom: var(--space-6);
  }

  .attendance-toolbar,
  .database-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .record-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .record-field,
  .record-field:nth-child(odd),
  .record-field:nth-child(even),
  .record-field:not(:nth-child(3n + 1)) {
    padding-right: var(--space-5);
    padding-left: 0;
    border-left: 0;
  }

  .record-field:nth-child(even) {
    padding-left: var(--space-5);
    border-left: 1px solid var(--color-border);
  }
}

@media (max-width: 30rem) {
  .employee-section-tab {
    min-width: 8.7rem;
    flex: 0 0 auto;
  }

  .attendance-device-actions,
  .database-header-actions {
    width: 100%;
  }

  .attendance-device-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .device-state,
  .sync-button,
  .database-header-actions > * {
    justify-content: center;
  }

  .database-header-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .attendance-toolbar,
  .database-toolbar,
  .record-fields {
    grid-template-columns: 1fr;
  }

  .record-tabs {
    gap: var(--space-6);
  }

  .record-field,
  .record-field:nth-child(odd),
  .record-field:nth-child(even),
  .record-field:not(:nth-child(3n + 1)) {
    padding-right: 0;
    padding-left: 0;
    border-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .database-record-view {
    animation: none;
  }
}
