:root {
  --hr-ink: #181b19;
  --hr-muted: #687169;
  --hr-line: #dfe4de;
  --hr-paper: #ffffff;
  --hr-canvas: #f4f5f1;
  --hr-accent: #b66b00;
  --hr-accent-soft: #fff3d8;
  --hr-success: #177347;
  --hr-danger: #b42318;
}

[hidden] { display: none !important; }

.hr-startup,
.hr-access-message {
  min-height: 100vh;
  display: grid;
  place-content: center;
  gap: 16px;
  text-align: center;
  color: var(--hr-ink);
  background: var(--hr-canvas);
}

.hr-spinner {
  width: 34px;
  height: 34px;
  margin: auto;
  border: 3px solid #e5e7eb;
  border-top-color: var(--hr-accent);
  border-radius: 50%;
  animation: hr-spin .8s linear infinite;
}

@keyframes hr-spin { to { transform: rotate(360deg); } }

.hr-access-message img { width: 190px; margin: 0 auto 10px; }
.hr-access-message h1 { margin: 0; font-size: 30px; }
.hr-access-message p { margin: 0; color: var(--hr-muted); }
.hr-access-message a { color: var(--hr-accent); font-weight: 800; }

.hr-app-shell {
  min-height: 100vh;
  background: var(--hr-canvas);
  color: var(--hr-ink);
}

.hr-sidebar {
  position: fixed;
  z-index: 50;
  inset: 0 auto 0 0;
  width: 320px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: #1c1e1d;
  color: #fff;
  border-right: 1px solid #303331;
}

.hr-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 24px 20px;
}

.hr-sidebar-header img { width: 190px; max-height: 58px; object-fit: contain; object-position: left center; }
.hr-sidebar-header button { display: none; }

.hr-organization {
  margin: 10px 14px 22px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #434644;
  border-radius: 16px;
  background: #242725;
}

.hr-organization > span {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  background: #e3a426;
  color: #171917;
  font-weight: 900;
}

.hr-organization div { min-width: 0; display: grid; gap: 3px; }
.hr-organization strong,
.hr-organization small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hr-organization small { color: #b8bdb9; }

.hr-sidebar nav { padding: 0 12px 24px; }
.hr-nav-group { margin-bottom: 24px; }
.hr-nav-group h2 { margin: 0 12px 10px; color: #aeb4af; font-size: 12px; letter-spacing: .11em; text-transform: uppercase; }

.hr-nav-item {
  min-height: 46px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 13px;
  border-radius: 12px;
  color: #d5d9d5;
  text-decoration: none;
  font-size: 15px;
}

.hr-nav-item:hover { background: #292d2a; color: #fff; }
.hr-nav-item.is-active { background: #e4a729; color: #171917; }
.hr-nav-item span { width: 20px; text-align: center; font-size: 17px; }
.hr-nav-item strong { font-weight: 750; }

.hr-sidebar-footer {
  margin-top: auto;
  padding: 20px 24px 24px;
  display: grid;
  gap: 4px;
  border-top: 1px solid #343735;
}

.hr-sidebar-footer small,
.hr-sidebar-footer span { color: #aeb4af; }
.hr-sidebar-footer button {
  margin-top: 14px;
  padding: 10px 0;
  border: 0;
  background: none;
  color: #fff;
  text-align: left;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.hr-app-content { min-height: 100vh; margin-left: 320px; }
.hr-mobile-header { display: none; }

.hr-page { max-width: 1480px; margin: auto; padding: 44px 54px 70px; }
.hr-page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.hr-page-header h1 { margin: 3px 0 8px; font-size: clamp(38px, 4vw, 58px); letter-spacing: -.045em; }
.hr-page-header > div > p:last-child { margin: 0; color: var(--hr-muted); font-size: 16px; }
.hr-eyebrow { margin: 0; color: var(--hr-accent); font-size: 12px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }

.hr-month-field { display: grid; gap: 7px; min-width: 205px; font-size: 12px; font-weight: 800; }
.hr-month-field input,
.hr-form-grid input,
.hr-form-grid select {
  height: 44px;
  padding: 0 12px;
  border: 1px solid #cfd5ce;
  border-radius: 9px;
  background: #fff;
  color: var(--hr-ink);
  font: inherit;
}

.hr-month-field input:focus,
.hr-form-grid input:focus,
.hr-form-grid select:focus { outline: 3px solid #f3d79d; border-color: var(--hr-accent); }

.hr-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 24px; }
.hr-metrics article { min-height: 132px; padding: 22px; display: grid; align-content: center; gap: 7px; background: var(--hr-paper); border: 1px solid var(--hr-line); border-top: 4px solid #df9417; border-radius: 15px; box-shadow: 0 10px 30px rgba(31, 36, 31, .05); }
.hr-metrics article > span { color: #596159; font-weight: 700; }
.hr-metrics strong { font-size: 34px; line-height: 1; }
.hr-metrics small { color: var(--hr-muted); }

.hr-alert { margin: 0 0 20px; padding: 13px 16px; border-radius: 10px; font-weight: 700; }
.hr-alert--error { color: #8b1b13; background: #feeceb; border: 1px solid #fac5c1; }
.hr-alert--success { color: #0e5e38; background: #e8f7ef; border: 1px solid #b4e4ca; }
.hr-alert--info { color: #67420a; background: var(--hr-accent-soft); border: 1px solid #efd198; }

.hr-panel { background: var(--hr-paper); border: 1px solid var(--hr-line); border-radius: 16px; overflow: hidden; box-shadow: 0 12px 34px rgba(31, 36, 31, .055); }
.hr-tabs { padding: 7px; display: flex; gap: 6px; border-bottom: 1px solid var(--hr-line); background: #fafbf9; }
.hr-tabs button { min-width: 130px; min-height: 44px; padding: 0 20px; border: 0; border-radius: 10px; background: transparent; color: #596159; font: inherit; font-weight: 800; cursor: pointer; }
.hr-tabs button.is-active { background: #1b1e1c; color: #fff; }
.hr-tab-panel { padding-bottom: 10px; }
.hr-panel-header { padding: 24px 26px; display: flex; align-items: end; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--hr-line); }
.hr-panel-header h2 { margin: 5px 0 0; font-size: 27px; }
.hr-panel-header > small { color: var(--hr-muted); }

.hr-editor { margin: 22px 24px; border: 1px solid #e2b968; border-radius: 14px; background: #fffbf2; overflow: hidden; }
.hr-editor-header { padding: 18px 20px; display: flex; justify-content: space-between; align-items: start; border-bottom: 1px solid #edd8ad; }
.hr-editor-header h3 { margin: 4px 0; font-size: 22px; }
.hr-editor-header span { color: var(--hr-muted); }
.hr-editor-header button { width: 38px; height: 38px; border: 1px solid #d8c7a6; border-radius: 9px; background: #fff; font-size: 22px; cursor: pointer; }
.hr-editor form { padding: 20px; }
.hr-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.hr-form-grid label { display: grid; gap: 7px; color: #3f463f; font-size: 12px; font-weight: 800; }
.hr-form-actions { margin-top: 20px; display: flex; justify-content: flex-end; gap: 10px; }
.hr-primary-button,
.hr-secondary-button,
.hr-row-action { min-height: 40px; padding: 0 17px; border-radius: 9px; font: inherit; font-weight: 850; cursor: pointer; }
.hr-primary-button { border: 1px solid var(--hr-accent); background: var(--hr-accent); color: #fff; }
.hr-secondary-button { border: 1px solid #cfd5ce; background: #fff; color: var(--hr-ink); }
.hr-row-action { min-height: 34px; padding: 0 14px; border: 1px solid #d8a344; background: #fff9eb; color: #774700; }
.hr-primary-button:disabled { opacity: .65; cursor: wait; }

.hr-table-scroll { width: 100%; overflow-x: auto; }
.hr-table { width: 100%; border-collapse: collapse; min-width: 820px; }
.hr-table th { padding: 13px 18px; background: #f7f8f5; color: #687169; text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.hr-table td { padding: 15px 18px; border-top: 1px solid #e8ebe7; color: #343a35; vertical-align: middle; }
.hr-table td strong,
.hr-table td small { display: block; }
.hr-table td small { margin-top: 3px; color: var(--hr-muted); }
.hr-table tbody tr:hover { background: #fffdf8; }
.hr-empty-cell { padding: 40px !important; color: var(--hr-muted) !important; text-align: center; }
.hr-status { display: inline-flex; padding: 5px 9px; border-radius: 999px; background: #eef1ed; color: #555e56; font-size: 12px; font-weight: 850; white-space: nowrap; }
.hr-status--active,
.hr-status--present { background: #e5f5ec; color: var(--hr-success); }
.hr-status--inactive,
.hr-status--absent { background: #feeceb; color: var(--hr-danger); }
.hr-status--leave,
.hr-status--half_day,
.hr-status--late { background: #fff1d2; color: #855300; }

.hr-sidebar-overlay { display: none; }

@media (max-width: 1100px) {
  .hr-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hr-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .hr-sidebar { width: min(88vw, 320px); transform: translateX(-105%); transition: transform .2s ease; }
  .hr-sidebar.is-open { transform: translateX(0); }
  .hr-sidebar-header button { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 10px; background: #fff; font-size: 23px; }
  .hr-sidebar-overlay { position: fixed; z-index: 40; inset: 0; border: 0; background: rgba(0, 0, 0, .45); }
  .hr-sidebar-overlay.is-visible { display: block; }
  .hr-app-content { margin-left: 0; }
  .hr-mobile-header { height: 70px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--hr-line); }
  .hr-mobile-header button { width: 42px; height: 42px; border: 1px solid var(--hr-line); border-radius: 10px; background: #fff; font-size: 20px; }
  .hr-mobile-header > span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; background: #dfa221; font-weight: 900; }
  .hr-page { padding: 26px 16px 50px; }
  .hr-page-header { align-items: stretch; flex-direction: column; }
  .hr-page-header h1 { font-size: 42px; }
  .hr-month-field { width: 100%; }
  .hr-metrics { grid-template-columns: 1fr 1fr; gap: 10px; }
  .hr-metrics article { min-height: 118px; padding: 16px; }
  .hr-metrics strong { font-size: 28px; }
  .hr-tabs button { min-width: 0; flex: 1; padding: 0 10px; }
  .hr-panel-header { padding: 20px; align-items: start; flex-direction: column; }
  .hr-editor { margin: 14px; }
  .hr-editor form { padding: 16px; }
  .hr-form-grid { grid-template-columns: 1fr; }
  .hr-form-actions { flex-direction: column-reverse; }
  .hr-form-actions button { width: 100%; }
}

@media (max-width: 430px) {
  .hr-metrics { grid-template-columns: 1fr; }
}
