.hr-body {
  min-height: 100svh;
  background:
    linear-gradient(90deg, rgba(7, 17, 31, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, #e9f6ff 0%, #f7fbfd 52%, #edf7ee 100%);
  background-size: 88px 88px, auto;
}

[hidden] {
  display: none !important;
}

.hr-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(1220px, calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  padding: 14px 0;
  background: rgba(233, 246, 255, 0.88);
  backdrop-filter: blur(18px);
}

.hr-header-actions,
.heading-meta,
.dashboard-controls,
.login-row,
.section-title-row {
  display: flex;
  align-items: center;
}

.hr-header-actions {
  gap: 12px;
}

.hr-link,
.hr-ghost {
  border: 0;
  background: transparent;
  color: rgba(7, 17, 31, 0.72);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.hr-link:hover,
.hr-ghost:hover {
  color: var(--blue-deep);
}

.hr-shell {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 72px;
}

.hr-login {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(320px, 0.62fr);
  gap: 42px;
  align-items: end;
  min-height: calc(100svh - 160px);
}

.hr-login h1,
.hr-dashboard h1 {
  margin-bottom: 18px;
  font-size: 4rem;
}

.login-copy {
  max-width: 520px;
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.7;
}

.login-form,
.data-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 22px 54px rgba(7, 38, 72, 0.12);
}

.login-form {
  padding: 28px;
}

.login-form label,
.dashboard-controls label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.login-row {
  gap: 10px;
}

.login-form input,
.dashboard-controls input {
  min-height: 46px;
  border: 1px solid rgba(7, 17, 31, 0.16);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
}

.login-form input {
  width: 100%;
  padding: 0 14px;
}

.dashboard-controls input {
  width: 170px;
  padding: 0 12px;
}

.hr-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 16px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.hr-button.primary {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 16px 32px rgba(7, 17, 31, 0.2);
}

.hr-button.secondary {
  border-color: rgba(7, 17, 31, 0.14);
  background: #fff;
  color: var(--ink);
}

.hr-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(7, 17, 31, 0.18);
}

.hr-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.hr-status {
  min-height: 24px;
  margin: 14px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.hr-status.error {
  color: #a12c2c;
}

.hr-dashboard {
  display: grid;
  gap: 16px;
}

.dashboard-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding: 28px 0 8px;
}

.heading-meta {
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-weight: 700;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(7, 17, 31, 0.14);
  border-radius: 999px;
  padding: 4px 10px;
  background: #fff;
  color: var(--blue-deep);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.dashboard-controls {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.auto-toggle {
  min-height: 46px;
  grid-template-columns: auto auto;
  align-items: center;
  border: 1px solid rgba(7, 17, 31, 0.14);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
}

.auto-toggle input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--blue-deep);
}

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

.metric-card {
  min-height: 132px;
  border: 1px solid rgba(7, 17, 31, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  padding: 18px;
}

.metric-card span {
  display: block;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  font-size: 1.8rem;
  line-height: 1.1;
}

.metric-card.warning {
  border-color: rgba(161, 44, 44, 0.28);
  background: #fff7f4;
}

.data-section {
  overflow: hidden;
}

.section-title-row {
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(7, 17, 31, 0.1);
}

.section-title-row h2 {
  margin: 0;
  font-family: "Bai Jamjuree", sans-serif;
  font-size: 1.08rem;
  line-height: 1.25;
}

.section-title-row span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.table-wrap {
  overflow-x: auto;
}

.hr-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.hr-table th,
.hr-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(7, 17, 31, 0.08);
  text-align: left;
  vertical-align: top;
}

.hr-table th {
  color: var(--muted);
  background: #f6fbff;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.hr-table td {
  color: var(--ink-soft);
  font-weight: 600;
}

.hr-table td[data-align="right"],
.hr-table th[data-align="right"] {
  text-align: right;
}

.empty-state {
  margin: 0;
  padding: 22px;
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 1060px) {
  .dashboard-heading,
  .hr-login {
    grid-template-columns: 1fr;
  }

  .dashboard-controls {
    justify-content: flex-start;
  }

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

@media (max-width: 640px) {
  .hr-body {
    background-size: 54px 54px, auto;
  }

  .hr-header,
  .hr-shell {
    width: min(100% - 24px, 1220px);
  }

  .hr-header {
    min-height: 66px;
  }

  .hr-login h1,
  .hr-dashboard h1 {
    font-size: 2.45rem;
  }

  .login-row,
  .dashboard-controls,
  .summary-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .dashboard-controls input,
  .hr-button {
    width: 100%;
  }

  .metric-card {
    min-height: 112px;
  }

  .section-title-row {
    align-items: flex-start;
    flex-direction: column;
  }
}
