/* HR App layout — Foundation tokens only; no alternate visual system
   Breakpoints (literals must match css/ui-tokens.css canonical list):
   1600 / 1279 / 1023 / 767 / 429 / 359 */

.hr-app {
  min-height: 100vh;
  background: var(--ui-page-bg);
  color: var(--ui-text-primary);
  /* Layout rhythm — Foundation spacing tokens only */
  --hr-app-header-gap: var(--ui-space-6);
  --hr-app-section-gap: var(--ui-space-8);
  --hr-app-inner-gap: var(--ui-space-4);
}

/* —— App shell —— */
.hr-app-shell {
  display: grid;
  grid-template-columns: var(--ui-sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
  max-width: 100%;
}

.hr-app-shell.is-collapsed {
  grid-template-columns: 72px minmax(0, 1fr);
}

/* Topbar sidebar controls — one responsibility per viewport */
.hr-app-topbar #hr-btn-menu {
  display: none;
}

.hr-app-topbar #hr-btn-collapse {
  display: inline-flex;
}

.hr-app-sidebar {
  background: var(--ui-surface);
  border-right: 1px solid var(--ui-border);
  padding: var(--ui-space-3);
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-2);
  min-width: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.hr-app-sidebar .ui-sidebar {
  border: 0;
  box-shadow: none;
  padding: 0;
  max-width: none;
  background: transparent;
}

.hr-app-nav-group {
  margin-top: var(--ui-space-3);
}

.hr-app-nav-group__label {
  font-size: var(--ui-fs-caption);
  font-weight: 700;
  color: var(--ui-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0 var(--ui-space-3);
  margin-bottom: var(--ui-space-1);
}

.hr-app-nav-sub {
  list-style: none;
  margin: 0;
  padding: 0 0 0 var(--ui-space-4);
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-1);
}

.hr-app-nav-sub .ui-nav__item {
  height: 34px;
  font-size: 12px;
  font-weight: 500;
}

.hr-app-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  max-width: 100%;
}

.hr-app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ui-space-3);
  height: 56px;
  padding: 0 var(--ui-space-6);
  background: var(--ui-surface);
  border-bottom: 1px solid var(--ui-border);
  box-shadow: var(--ui-shadow-sm);
  position: sticky;
  top: 0;
  z-index: 20;
  min-width: 0;
}

.hr-app-topbar > .hr-app-toolbar {
  width: auto;
  flex: 0 0 auto;
}

/* Fluid admin content — fill main column; no orphan right gap */
.hr-app-content {
  padding: var(--ui-space-6);
  width: 100%;
  max-width: none;
  margin: 0;
  box-sizing: border-box;
  min-width: 0;
}

.hr-app-content > .hr-page-header {
  margin: 0 0 var(--hr-app-header-gap);
  width: 100%;
}

.hr-app-content > .hr-page-header .hr-page-header__title {
  margin-top: 0;
}

/* Page header — app-specific; do not grow title block on mobile column layout */
.hr-app .hr-page-header > div:first-child {
  flex: 1 1 220px;
}

.hr-app .hr-page-header__actions {
  flex: 0 0 auto;
}

/* Vertical rhythm for page body */
.hr-app-stack {
  display: flex;
  flex-direction: column;
  gap: var(--hr-app-section-gap);
  min-width: 0;
  max-width: 100%;
  width: 100%;
}

.hr-app-stack > * {
  min-width: 0;
  max-width: 100%;
}

/* Page scripts mount into #page-mount — apply same section rhythm inside */
.hr-app-stack #page-mount {
  display: flex;
  flex-direction: column;
  gap: var(--hr-app-section-gap);
  width: 100%;
  min-width: 0;
}

/* Sections / cards inside app pages */
.hr-app-section,
.hr-app-stack > .ui-card {
  width: 100%;
  box-sizing: border-box;
}

.hr-app-section__title,
.hr-app-stack > .ui-card > .ui-h4:first-child {
  margin: 0 0 var(--hr-app-inner-gap);
}

/* Content grids */
.hr-app-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--ui-space-5);
  width: 100%;
  align-items: stretch;
}

.hr-app-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--ui-space-5);
  width: 100%;
  align-items: stretch;
}

.hr-app-grid-2 > .ui-card,
.hr-app-grid-3 > .ui-card,
.hr-app-grid-2 > .hr-app-section,
.hr-app-grid-3 > .hr-app-section {
  height: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hr-app-grid-2 > .hr-app-section > :last-child,
.hr-app-grid-2 > .ui-card > :last-child {
  flex: 1 1 auto;
}

/* Top-aligned content grid — avoid stretching sparse cards */
.hr-app-grid--start {
  align-items: start;
}

.hr-app-grid--start > .ui-card,
.hr-app-grid--start > .hr-app-section {
  height: auto;
  min-height: 0;
}

.hr-app-grid--start > .hr-app-section > :last-child,
.hr-app-grid--start > .ui-card > :last-child {
  flex: 0 0 auto;
}

.hr-app-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ui-space-2);
  width: 100%;
  min-width: 0;
}

/* Settings / forms — one visual block (fields + save) */
.hr-app-form-panel {
  width: 100%;
  max-width: 44rem;
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-5);
  min-width: 0;
  box-sizing: border-box;
}

.hr-app-form-panel.ui-card {
  padding: var(--ui-space-5);
}

.hr-app-form-panel .hr-app-form,
.hr-app-form-panel #settings-panel {
  max-width: none;
  width: 100%;
  box-sizing: border-box;
}

#schedule-policy .ui-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.hr-app-form-panel .hr-app-form-actions {
  max-width: none;
  width: 100%;
  margin-top: 0;
  padding-top: var(--ui-space-4);
  border-top: 1px solid var(--ui-border);
  justify-content: flex-end;
}

.hr-app-form,
.hr-app #settings-panel {
  max-width: 44rem;
  width: 100%;
}

.hr-app-form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--ui-space-2);
  margin-top: var(--ui-space-4);
  max-width: 44rem;
  width: 100%;
  box-sizing: border-box;
}

/* Compact empty states inside app pages */
.hr-app .hr-empty {
  padding: var(--ui-space-8) var(--ui-space-5);
  min-height: 0;
  box-sizing: border-box;
}

.hr-app .hr-app-section:has(> .hr-empty) {
  padding-bottom: var(--ui-space-5);
}

/* Attention lists stay compact */
.hr-app-section .ui-stack {
  gap: var(--ui-space-3);
}

.hr-app-section .ui-alert {
  margin: 0;
}

/* Tables fill content width */
.hr-app .ui-table-wrap,
.hr-app .hr-table-scroll {
  width: 100%;
  max-width: 100%;
}

.hr-app .ui-table th:last-child,
.hr-app .ui-table td.hr-card-actions {
  text-align: right;
  white-space: nowrap;
}

/* Filter → content rhythm comes from stack gap */
.hr-app-stack > .hr-filter-bar {
  margin: 0;
}

/* Profile: header → tabs → panels (one section gap via #page-mount / .hr-app-stack) */
.hr-app .hr-profile-header {
  margin: 0;
}

.hr-app .hr-profile-header__tabs {
  margin-top: var(--ui-space-4);
}

.hr-app #emp-tab-panels {
  margin-top: 0;
  width: 100%;
  min-width: 0;
}

/* Inner panel stack: KPI → attention → other modules share the same section gap */
.hr-app .emp-panel {
  display: flex;
  flex-direction: column;
  gap: var(--hr-app-section-gap);
  margin-top: 0;
  width: 100%;
  min-width: 0;
}

.hr-app .emp-panel[hidden] {
  display: none;
}

.hr-app .emp-panel .ui-h4 {
  margin: 0 0 var(--ui-space-4);
}

.hr-app .emp-panel .ui-stack {
  margin-top: 0;
  gap: var(--ui-space-4);
}

/* Mobile drawer open — lock page scroll behind overlay */
body.hr-drawer-open {
  overflow: hidden;
}

/* Document category tabs — local horizontal scroll, clear click targets */
.hr-app .hr-doc-tabs.ui-tabs {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: var(--ui-space-2);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  max-width: 100%;
  width: 100%;
  margin-bottom: 0;
}

.hr-app .hr-doc-tabs .ui-tab {
  flex: 0 0 auto;
  white-space: nowrap;
  min-height: 40px;
}

.hr-app .hr-doc-tabs .ui-tab:focus-visible {
  outline: 2px solid var(--ui-primary);
  outline-offset: 2px;
}

/* KPI — count-aware equal columns (fills content width) */
.hr-app .hr-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  gap: var(--ui-space-4);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  align-items: stretch;
}

.hr-app .hr-kpi-row--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hr-app .hr-kpi-row--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hr-app .hr-kpi-row--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.hr-app .hr-kpi-row--5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

/* 6 KPIs: 3×2 until wide desktop, then 6 equal */
.hr-app .hr-kpi-row--6 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hr-app .hr-home-item {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--ui-space-3);
  min-width: 0;
}

.hr-app .hr-home-item__who {
  min-width: 0;
  flex: 1 1 16rem;
  overflow-wrap: anywhere;
}

.hr-app .hr-home-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ui-space-2);
  margin-top: var(--ui-space-2);
}

.hr-app .hr-home-item__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ui-space-2);
}

.hr-app .hr-kpi-row > .ui-stat-card {
  min-width: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  justify-content: flex-start;
  gap: var(--ui-space-2);
  display: flex;
  flex-direction: column;
}

/* KPI / identity as navigation — layout only, Foundation visuals */
a.hr-kpi-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

a.hr-kpi-link:hover,
a.hr-kpi-link:focus-visible {
  outline: 2px solid var(--ui-primary);
  outline-offset: 2px;
}

a.hr-employee-identity--link {
  text-decoration: none;
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: inherit;
  max-width: 100%;
}

a.hr-employee-identity--link:hover .hr-employee-identity__name,
a.hr-employee-identity--link:focus-visible .hr-employee-identity__name {
  color: var(--ui-primary);
  text-decoration: underline;
}

.hr-app-attention-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-start;
  gap: var(--ui-space-3) var(--ui-space-4);
}

.hr-app-attention-row > div:first-child {
  flex: 1 1 12rem;
  min-width: 0;
  max-width: 28rem;
}

.hr-app-attention-row .ui-btn {
  flex: 0 0 auto;
  margin-left: auto;
}

.hr-app .hr-kpi-row .ui-stat-card__value {
  font-variant-numeric: tabular-nums;
  line-height: var(--ui-lh-h2, 1.25);
  min-height: 1.25em;
}

.hr-app .hr-kpi-row .ui-stat-card__label {
  min-height: calc(var(--ui-lh-base) * 2);
}

/* Wide desktop: 6 equal KPIs in one row */
@media (min-width: 1600px) {
  .hr-app .hr-kpi-row--6 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .hr-app .hr-kpi-row--6 .ui-stat-card__label {
    min-height: 0;
  }
}

/* Schedule / availability toolbars */
.hr-app .hr-schedule-wrap,
.hr-app .hr-avail-wrap,
.hr-app .hr-perm-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

/* Reports grid */
.hr-report-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--ui-space-4);
  width: 100%;
  align-items: stretch;
}

.hr-report-cards > .ui-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  box-sizing: border-box;
}

.hr-report-cards > .ui-card .hr-app-toolbar {
  margin-bottom: var(--ui-space-2);
}

.hr-report-cards > .ui-card .ui-btn {
  margin-top: auto;
  align-self: flex-start;
}

.hr-report-dialog {
  width: min(36rem, calc(100vw - 2rem));
  max-width: calc(100vw - 2rem);
}

.hr-report-filters {
  display: grid;
  gap: var(--ui-space-3);
  min-width: 0;
}

.hr-report-filters .ui-field {
  min-width: 0;
}

.hr-report-card__formats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ui-space-2);
  margin-top: var(--ui-space-3);
}

dialog.hr-report-dialog.ui-modal {
  width: min(36rem, calc(100vw - 1.5rem));
  max-width: calc(100vw - 1.5rem);
  max-height: calc(100vh - 1.5rem);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
  background: var(--ui-surface);
  color: inherit;
  box-shadow: var(--ui-shadow-lg);
}

dialog.hr-report-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

dialog.hr-report-dialog[open] {
  display: flex;
  flex-direction: column;
}

dialog.hr-report-dialog[open] > form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: calc(100vh - 1.5rem);
  margin: 0;
  overflow: hidden;
}

dialog.hr-report-dialog .ui-modal__head,
dialog.hr-report-dialog .ui-modal__foot {
  flex: 0 0 auto;
  padding: 14px 18px;
  background: var(--ui-surface);
}

dialog.hr-report-dialog .ui-modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: var(--ui-space-2);
  border-top: 1px solid var(--ui-border);
}

dialog.hr-report-dialog .hr-report-filters {
  overflow: auto;
  padding: 4px 18px 16px;
  min-height: 0;
}

@media (max-width: 767px) {
  dialog.hr-report-dialog .ui-modal__foot {
    flex-wrap: wrap;
  }

  dialog.hr-report-dialog .ui-modal__foot .ui-btn {
    flex: 1 1 auto;
  }
}

/* Settlements */
.hr-app .hr-settlement {
  width: 100%;
  box-sizing: border-box;
}

.hr-app .hr-settlement__lines {
  width: 100%;
}

.hr-app .hr-settlement-group {
  padding-top: var(--ui-space-3);
  color: var(--ui-text-muted);
  font-size: var(--ui-fs-caption);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

/* Notifications — compact topbar panel */
.hr-app-topbar-utils {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--ui-space-3);
  flex-wrap: nowrap;
  min-width: 0;
  flex: 1 1 auto;
}

.hr-app-topbar-utils .ui-lib-user {
  display: inline-flex;
  align-items: center;
  gap: var(--ui-space-2);
}

a.hr-user-chip {
  text-decoration: none;
  color: inherit;
  flex: 0 0 auto;
  max-width: 100%;
  border-radius: var(--ui-radius-sm);
}

a.hr-user-chip:hover .hr-user-chip__login,
a.hr-user-chip:focus-visible .hr-user-chip__login {
  color: var(--ui-primary);
  text-decoration: underline;
}

a.hr-user-chip:focus-visible {
  outline: 2px solid var(--ui-primary);
  outline-offset: 2px;
}

.hr-user-chip__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}

.hr-user-chip__login {
  font-weight: 600;
  color: var(--ui-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 10rem;
}

.hr-user-chip__role {
  font-size: var(--ui-fs-caption);
  color: var(--ui-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 10rem;
}

.hr-app-topbar-utils .ui-icon-btn-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hr-app-notif {
  position: absolute;
  right: 0;
  top: calc(100% + var(--ui-space-2));
  width: 420px;
  max-width: min(420px, calc(100vw - var(--ui-space-6)));
  max-height: calc(100vh - 80px);
  z-index: 40;
  display: none;
  flex-direction: column;
  box-sizing: border-box;
}

.hr-app .hr-app-notif.ui-notif-panel {
  width: 420px;
  max-width: min(420px, calc(100vw - var(--ui-space-6)));
}

.hr-app-notif.is-open {
  display: flex;
}

.hr-app-topbar .ui-notif-dot[hidden] {
  display: none !important;
}

.hr-notif-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--ui-space-3);
  padding: var(--ui-space-3) var(--ui-space-4);
  border-bottom: 1px solid var(--ui-border);
}

.hr-notif-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--ui-text-primary);
}

.hr-notif-unread {
  margin-top: 2px;
  font-size: 12px;
  color: var(--ui-text-muted);
}

.hr-notif-unread:empty {
  display: none;
}

.hr-notif-actions {
  padding: var(--ui-space-2) var(--ui-space-3);
  border-bottom: 1px solid var(--ui-border);
}

.hr-notif-scroll {
  overflow: auto;
  min-height: 0;
  max-height: calc(100vh - 180px);
}

.hr-notif-group {
  padding: var(--ui-space-2) var(--ui-space-4);
  font-size: var(--ui-fs-caption);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ui-text-muted);
  background: var(--ui-n-50);
}

.hr-app .hr-app-notif .hr-notif-item {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: var(--ui-space-3);
}

.hr-app .hr-app-notif .hr-notif-item::before {
  display: none;
}

.hr-app .hr-app-notif .hr-notif-item.is-unread {
  background: var(--ui-n-50);
}

.hr-app .hr-app-notif .hr-notif-item.is-unread .ui-notif-item__title {
  font-weight: 700;
}

.hr-notif-item__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.hr-notif-item__time {
  margin-top: 2px;
  font-size: 11px;
  color: var(--ui-text-muted);
}

.hr-notif-item__dot {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 999px;
  background: var(--ui-primary);
  flex: none;
}

.hr-notif-empty {
  padding: var(--ui-space-6) var(--ui-space-4);
  text-align: center;
}

.hr-notif-empty p {
  margin: 0;
  font-weight: 600;
}

.hr-notif-empty .settings-help {
  margin-top: var(--ui-space-2);
  font-weight: 400;
}

.hr-app .hr-app-notif .ui-notif-item {
  padding: var(--ui-space-3) var(--ui-space-4);
}

.hr-app .hr-app-notif .ui-notif-item:hover {
  background: var(--ui-n-50);
}

.hr-app .hr-app-notif .ui-notif-item__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ui-text-primary);
  line-height: 1.35;
}

.hr-app .hr-app-notif .ui-notif-item__meta {
  font-size: 12px;
  color: var(--ui-text-muted);
  line-height: 1.35;
  margin-top: 0;
}

.hr-app-shell.is-collapsed .hr-app-nav-group__label,
.hr-app-shell.is-collapsed .hr-app-nav-sub,
.hr-app-shell.is-collapsed .ui-sidebar__brand span:last-child,
.hr-app-shell.is-collapsed .ui-nav__item span:not(.ui-badge-count) {
  display: none;
}

.hr-app-shell.is-collapsed .ui-nav__item {
  justify-content: center;
  padding: 0;
}

/* —— Auth / login —— */
.hr-auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 0.42fr) minmax(0, 0.58fr);
  background: var(--ui-page-bg);
}

.hr-auth__brand {
  background: var(--ui-primary);
  color: var(--ui-text-inverse);
  padding: var(--ui-space-8) var(--ui-space-6);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.hr-auth__brand::before {
  content: "";
  position: absolute;
  inset: -20% auto auto -10%;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.hr-auth__brand::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -60px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}

.hr-auth__brand-inner {
  position: relative;
  z-index: 1;
}

.hr-auth__brand h1 {
  margin: var(--ui-space-6) 0 var(--ui-space-3);
  font-size: var(--ui-fs-h1);
  line-height: var(--ui-lh-h1);
  font-weight: var(--ui-fw-h1);
}

.hr-auth__brand p {
  margin: 0;
  max-width: 28ch;
  font-size: var(--ui-fs-lg);
  line-height: var(--ui-lh-lg);
  opacity: 0.92;
}

.hr-auth__panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--ui-space-8) var(--ui-space-6);
  min-width: 0;
}

.hr-auth__card {
  width: 100%;
  max-width: 420px;
}

.hr-auth__card .ui-h2 {
  margin: 0 0 var(--ui-space-2);
}

.hr-auth__card .ui-stack {
  gap: var(--ui-space-4);
}

.hr-auth__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--ui-space-2);
  margin: var(--ui-space-4) 0;
}

.hr-auth__hint {
  margin-top: var(--ui-space-5);
  font-size: var(--ui-fs-sm);
  color: var(--ui-text-secondary);
}

.hr-auth__card .ui-alert:not([hidden]) {
  margin: 0 0 var(--ui-space-4);
}

/* Kiosk terminal — physical scanner sits above the display */
html:has(body.hr-kiosk-page),
body.hr-kiosk-page {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #f4f7fb;
}

.hr-kiosk {
  --kiosk-bg: #f4f7fb;
  --kiosk-line: #d5e2ef;
  --kiosk-ink: var(--ui-text-primary);
  height: 100vh;
  height: 100dvh;
  max-width: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0;
  padding: 0;
  box-sizing: border-box;
  background: var(--kiosk-bg);
  color: var(--kiosk-ink);
  overflow: hidden;
}

.hr-kiosk__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ui-space-4);
  min-width: 0;
  padding: 0.85rem 1.75rem;
  background: var(--ui-surface);
  border-bottom: 1px solid var(--kiosk-line);
  box-shadow: 0 1px 0 rgba(27, 97, 209, 0.04);
}

.hr-kiosk__brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.hr-kiosk__marklet {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--ui-radius-lg);
  background: var(--ui-text-primary);
  color: var(--ui-surface);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.hr-kiosk__brand-name,
.hr-kiosk__brand-sub,
.hr-kiosk__sys {
  display: block;
}

.hr-kiosk__brand-name {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.hr-kiosk__brand-sub,
.hr-kiosk__sys {
  color: var(--ui-text-secondary);
  font-size: 0.95rem;
}

.hr-kiosk__sys {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: 0.85rem;
  padding-left: 0.85rem;
  border-left: 1px solid var(--kiosk-line);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hr-kiosk__clock {
  text-align: right;
  min-width: 0;
}

.hr-kiosk__clock .hr-kiosk__time {
  display: block;
  min-width: 7.4ch;
  font-size: clamp(2rem, 3.2vw, 3.15rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: 0;
}

.hr-kiosk__date {
  margin-top: 0.3rem;
  color: var(--ui-text-secondary);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.hr-kiosk__stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 1rem 1.5rem 0.75rem;
  overflow: hidden;
  text-align: center;
  background:
    radial-gradient(ellipse 46% 42% at 50% 42%, rgba(27, 97, 209, 0.09), transparent 68%),
    var(--kiosk-bg);
}

.hr-kiosk__wash {
  position: absolute;
  width: 28rem;
  height: 18rem;
  left: 8%;
  bottom: 8%;
  border-radius: 999px;
  background: rgba(27, 97, 209, 0.06);
  filter: blur(28px);
  pointer-events: none;
}

.hr-kiosk__chassis {
  position: relative;
  z-index: 1;
  width: min(56rem, 100%);
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.hr-kiosk__module {
  width: min(54rem, 100%);
  min-height: 22.5rem;
  max-height: none;
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  background: var(--ui-surface);
  border: 1px solid rgba(27, 97, 209, 0.16);
  border-radius: var(--ui-radius-xl);
  box-shadow:
    0 18px 48px rgba(27, 97, 209, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.8);
}

.hr-kiosk__module:has([data-state="service"]) {
  width: min(36rem, 100%);
  min-height: 0;
  max-height: none;
  flex: 0 1 auto;
}

.hr-kiosk__cue {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 100%;
  padding: 0.85rem 1rem 0.35rem;
  pointer-events: none;
  color: var(--ui-primary);
  background: linear-gradient(180deg, rgba(27, 97, 209, 0.07), transparent);
}

.hr-kiosk__cue-stem {
  width: 2px;
  height: 0.85rem;
  background: var(--ui-primary);
}

.hr-kiosk__cue-arrow {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 0.8;
}

.hr-kiosk__cue-label {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--kiosk-ink);
}

.hr-kiosk__cue-sub {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ui-text-secondary);
}

.hr-kiosk__scanmark {
  position: relative;
  width: 7.25rem;
  height: 7.25rem;
  margin-top: 0.35rem;
  flex: 0 0 auto;
}

.hr-kiosk__corner {
  position: absolute;
  width: 1.35rem;
  height: 1.35rem;
  border: 3px solid var(--ui-primary);
}

.hr-kiosk__corner--tl { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; }
.hr-kiosk__corner--tr { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 6px 0 0; }
.hr-kiosk__corner--bl { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 6px; }
.hr-kiosk__corner--br { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 6px 0; }

.hr-kiosk__scanmark-core {
  position: absolute;
  inset: 1.7rem;
  border-radius: 10px;
  background:
    linear-gradient(var(--ui-primary), var(--ui-primary)) 18% 22% / 22% 22% no-repeat,
    linear-gradient(var(--ui-primary), var(--ui-primary)) 62% 22% / 18% 18% no-repeat,
    linear-gradient(var(--ui-primary), var(--ui-primary)) 22% 62% / 18% 18% no-repeat,
    linear-gradient(var(--kiosk-line), var(--kiosk-line)) 58% 58% / 22% 22% no-repeat,
    var(--ui-primary-soft);
}

.hr-kiosk__beam {
  position: absolute;
  left: 1.15rem;
  right: 1.15rem;
  height: 2px;
  top: 46%;
  background: linear-gradient(90deg, transparent, rgba(27, 97, 209, 0.85), transparent);
  box-shadow: 0 8px 16px rgba(27, 97, 209, 0.18);
  animation: hr-kiosk-beam 2.8s ease-in-out infinite;
}

.hr-kiosk__title {
  margin: 0;
  max-width: 16ch;
  font-size: clamp(2.35rem, 3vw, 3.35rem);
  line-height: 1.05;
  font-weight: 800;
}

.hr-kiosk__title--login {
  font-size: clamp(2rem, 3vw, 2.6rem);
}

.hr-kiosk__lead,
.hr-kiosk__help,
.hr-kiosk__status,
.hr-kiosk__path-label,
.hr-kiosk__since,
.hr-kiosk__verb {
  margin: 0;
  max-width: 36rem;
}

.hr-kiosk__lead,
.hr-kiosk__since,
.hr-kiosk__path-label {
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  color: var(--ui-text-secondary);
}

.hr-kiosk__verb {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ui-text-secondary);
}

.hr-kiosk__status {
  display: inline-flex;
  align-items: center;
  gap: var(--ui-space-2);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  color: var(--ui-text-secondary);
}

.hr-kiosk__ready {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0.15rem 0 0;
  padding: 0.85rem 1.2rem;
  border-radius: 999px;
  background: var(--ui-success-soft);
  color: var(--ui-text-primary);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-align: left;
}

.hr-kiosk__ready strong {
  display: block;
  font-size: 1.12rem;
}

.hr-kiosk__ready-sub {
  display: block;
  margin-top: 0.1rem;
  color: var(--ui-text-secondary);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0;
}

.hr-kiosk__dot {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 999px;
  background: var(--ui-success);
  animation: hr-kiosk-pulse 2.4s ease-in-out infinite;
  flex: 0 0 auto;
}

.hr-kiosk__panel {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.7rem;
  padding: 0.4rem 1.75rem 1.35rem;
  background: transparent;
  border: 0;
  box-shadow: none;
  animation: hr-kiosk-in 180ms ease;
}

.hr-kiosk__panel[data-state="idle"] .hr-kiosk__path {
  margin-top: 0.2rem;
  min-width: min(26rem, 100%);
  padding-top: 0.75rem;
  border-top: 1px solid var(--kiosk-line);
}

.hr-kiosk__path {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  max-width: 100%;
}

.hr-kiosk__path-kicker {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ui-text-secondary);
}

.hr-kiosk__path-route {
  font-size: 1.05rem;
  font-weight: 700;
}

.hr-kiosk__tiles {
  width: min(54rem, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  flex: 0 0 auto;
}

.hr-kiosk__tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  min-height: 6.5rem;
  padding: 0.95rem 1rem;
  text-align: left;
  background: var(--ui-surface);
  border: 1px solid var(--kiosk-line);
  border-radius: var(--ui-radius-xl);
  box-shadow: 0 8px 22px rgba(17, 24, 39, 0.04);
}

.hr-kiosk__tile strong {
  font-size: 1rem;
}

.hr-kiosk__tile span:last-child {
  color: var(--ui-text-secondary);
  font-size: 0.92rem;
}

.hr-kiosk__tile-icon {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.25rem;
  border-radius: 8px;
  background: var(--ui-primary-soft);
  color: var(--ui-primary);
}

.hr-kiosk__tile-icon svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.hr-kiosk .ui-avatar--xl {
  width: 5.25rem;
  height: 5.25rem;
  font-size: 1.45rem;
}

.hr-kiosk__presence {
  margin: 0;
  font-size: clamp(2rem, 3.4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.05;
}

.hr-kiosk__panel[data-kiosk-action="START_WORK"] .hr-kiosk__presence {
  color: var(--ui-success);
}

.hr-kiosk__panel[data-kiosk-action="END_WORK"] .hr-kiosk__presence {
  color: var(--ui-danger);
}

.hr-kiosk__actions,
.hr-kiosk__panel--login #login-form {
  width: min(32rem, 100%);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.hr-kiosk__actions .ui-btn {
  min-height: 4.5rem;
  width: 100%;
  font-size: 1.3rem;
  font-weight: 800;
}

.hr-kiosk__btn-break,
.hr-kiosk__presence-break {
  background: var(--ui-info);
  border-color: var(--ui-info);
  color: #fff;
}

.hr-kiosk__presence-break {
  background: transparent;
  border: 0;
  color: var(--ui-info);
}

.hr-kiosk__break-len {
  margin: 0;
  color: var(--ui-text-secondary);
  font-size: 1.05rem;
  font-weight: 700;
}

.hr-kiosk__panel--login {
  width: 100%;
  align-items: stretch;
  text-align: left;
  justify-content: center;
  gap: 0.6rem;
  padding: 1.5rem 1.5rem 1.35rem;
}

.hr-kiosk__lock {
  align-self: center;
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 999px;
  background: var(--ui-primary-soft);
  color: var(--ui-primary);
}

.hr-kiosk__lock svg {
  width: 1.45rem;
  height: 1.45rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.hr-kiosk__panel--login .ui-btn {
  min-height: 3.15rem;
  width: 100%;
  font-size: 1.05rem;
  font-weight: 800;
}

.hr-kiosk__service-kicker {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--ui-primary);
  text-align: center;
}

.hr-kiosk__pass {
  display: flex;
  gap: 0.5rem;
}

.hr-kiosk__pass .ui-input {
  flex: 1 1 auto;
}

.hr-kiosk__pass .ui-btn {
  width: auto;
  min-height: 3.15rem;
  padding-inline: 1rem;
}

.hr-kiosk__panel--login .hr-kiosk__title,
.hr-kiosk__panel--login .hr-kiosk__lead,
.hr-kiosk__panel--login .hr-auth__hint {
  text-align: center;
}

.hr-kiosk__panel--login .ui-input {
  min-height: 3.15rem;
  font-size: 1.1rem;
}

.hr-kiosk__meter {
  width: min(32rem, 100%);
  height: 0.4rem;
  border-radius: 999px;
  background: #e7eef6;
  overflow: hidden;
}

.hr-kiosk__meter span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--ui-success);
  transition: width 0.25s linear;
}

.hr-kiosk__meter span.is-indeterminate {
  width: 40%;
  animation: hr-kiosk-scan 1.2s ease-in-out infinite;
}

.hr-kiosk__panel[data-kiosk-action="END_WORK"] .hr-kiosk__meter span {
  background: var(--ui-danger);
}

.hr-kiosk__panel.is-urgent .hr-kiosk__remain {
  color: var(--ui-warning-hover);
}

.hr-kiosk__panel.is-urgent .hr-kiosk__meter span {
  background: var(--ui-warning);
}

.hr-kiosk__remain {
  margin: 0;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--ui-text-secondary);
}

.hr-kiosk__facts {
  width: min(34rem, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.hr-kiosk__fact {
  padding: 0.7rem 0.75rem;
  border-radius: var(--ui-radius-lg);
  background: var(--kiosk-bg);
  border: 1px solid var(--kiosk-line);
}

.hr-kiosk__fact span {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--ui-text-secondary);
}

.hr-kiosk__fact strong {
  display: block;
  margin-top: 0.15rem;
  font-size: 1.05rem;
}

.hr-kiosk__when {
  margin: 0;
  font-size: clamp(2.4rem, 4.5vw, 3.6rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.hr-kiosk__mark {
  width: 5rem;
  height: 5rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 2.4rem;
  font-weight: 800;
  background: var(--ui-surface);
}

.hr-kiosk__mark--ok {
  color: var(--ui-success);
  box-shadow: 0 0 0 8px rgba(25, 163, 74, 0.12);
  border: 2px solid var(--ui-success);
}

.hr-kiosk__mark--out {
  color: var(--ui-danger);
  box-shadow: 0 0 0 8px rgba(239, 68, 68, 0.12);
  border: 2px solid var(--ui-danger);
}

.hr-kiosk__mark--bad {
  color: var(--ui-danger);
  box-shadow: 0 0 0 8px rgba(239, 68, 68, 0.1);
  border: 2px solid var(--ui-danger);
}

.hr-kiosk__mark--warn {
  color: var(--ui-warning-hover);
  box-shadow: 0 0 0 8px rgba(245, 158, 11, 0.16);
  border: 2px solid var(--ui-warning);
}

.hr-kiosk .hr-qr-result__name {
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  font-weight: 800;
}

.hr-kiosk__foot {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 0.55rem 1.75rem;
  background: var(--ui-surface);
  border-top: 1px solid var(--kiosk-line);
  color: var(--ui-text-secondary);
  font-size: 0.85rem;
  font-weight: 700;
}

.hr-kiosk__foot-item,
.hr-kiosk__foot-note,
.hr-kiosk__foot-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.hr-kiosk__foot-note {
  justify-content: center;
}

.hr-kiosk__foot-mark {
  justify-content: flex-end;
  letter-spacing: 0.14em;
}

.hr-kiosk__dot--still {
  width: 0.55rem;
  height: 0.55rem;
  animation: none;
}

.hr-kiosk__hint {
  margin: 0;
  color: var(--ui-text-secondary);
  font-size: 1rem;
}

.hr-kiosk__live {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hr-kiosk__scan {
  position: fixed;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hr-kiosk .ui-btn:focus-visible,
.hr-kiosk .ui-input:focus-visible {
  outline: 2px solid var(--ui-focus, currentColor);
  outline-offset: 3px;
}

@keyframes hr-kiosk-pulse {
  0%,
  100% { opacity: 1; }
  50% { opacity: 0.45; }
}

@keyframes hr-kiosk-in {
  from { transform: translateY(8px); }
  to { transform: none; }
}

@keyframes hr-kiosk-beam {
  0%,
  100% { transform: translateY(-1.4rem); opacity: 0.35; }
  50% { transform: translateY(1.4rem); opacity: 1; }
}

@keyframes hr-kiosk-scan {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(280%); }
}

@media (prefers-reduced-motion: reduce) {
  .hr-kiosk__dot,
  .hr-kiosk__panel,
  .hr-kiosk__beam,
  .hr-kiosk__meter span.is-indeterminate {
    animation: none;
  }

  .hr-kiosk__meter span {
    transition: none;
  }
}

@media (max-height: 820px) {
  .hr-kiosk__title {
    font-size: 2rem;
  }

  .hr-kiosk__module {
    min-height: 0;
    max-height: none;
    flex: 0 1 auto;
  }

  .hr-kiosk__panel {
    gap: 0.45rem;
    padding: 0.35rem 1.1rem 0.9rem;
  }

  .hr-kiosk__scanmark {
    width: 5.5rem;
    height: 5.5rem;
  }

  .hr-kiosk .ui-avatar--xl {
    width: 3.6rem;
    height: 3.6rem;
  }

  .hr-kiosk__actions .ui-btn {
    min-height: 3.4rem;
    font-size: 1.1rem;
  }

  .hr-kiosk__tile {
    min-height: 0;
    padding: 0.65rem 0.75rem;
  }

  .hr-kiosk__mark {
    width: 3.6rem;
    height: 3.6rem;
    font-size: 1.7rem;
  }
}

@media (max-width: 900px) {
  .hr-kiosk__tiles,
  .hr-kiosk__facts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .hr-kiosk__top,
  .hr-kiosk__stage,
  .hr-kiosk__foot {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .hr-kiosk__marklet,
  .hr-kiosk__sys {
    display: none;
  }

  .hr-kiosk__clock .hr-kiosk__time {
    font-size: 1.55rem;
    min-width: 0;
  }

  .hr-kiosk__date {
    font-size: 0.72rem;
  }

  .hr-kiosk__foot {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0.45rem 0.85rem;
  }

  .hr-kiosk__foot-mark,
  .hr-kiosk__foot-item {
    display: none;
  }

  .hr-kiosk__stage {
    padding: 0.65rem 0.75rem 0.4rem;
  }

  .hr-kiosk__module {
    min-height: 0;
  }

  .hr-kiosk__scanmark {
    width: 5.25rem;
    height: 5.25rem;
  }
}

/* —— Tablet —— */
@media (max-width: 1023px) {
  .hr-app-shell {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .hr-app-shell:not(.is-mobile-open) .hr-app-nav-group__label,
  .hr-app-shell:not(.is-mobile-open) .hr-app-nav-sub,
  .hr-app-shell:not(.is-mobile-open) .ui-sidebar__brand span:last-child,
  .hr-app-shell:not(.is-mobile-open) .ui-nav__item span:not(.ui-badge-count) {
    display: none;
  }

  .hr-app-shell:not(.is-mobile-open) .ui-nav__item {
    justify-content: center;
    padding: 0;
  }

  .hr-app {
    --hr-app-header-gap: var(--ui-space-5);
    --hr-app-section-gap: var(--ui-space-6);
  }

  .hr-app-content {
    padding: var(--ui-space-5);
  }

  .hr-app-topbar {
    padding: 0 var(--ui-space-5);
  }

  .hr-app .hr-kpi-row,
  .hr-app .hr-kpi-row--2,
  .hr-app .hr-kpi-row--3,
  .hr-app .hr-kpi-row--4,
  .hr-app .hr-kpi-row--5,
  .hr-app .hr-kpi-row--6 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .hr-auth {
    grid-template-columns: 1fr;
  }

  .hr-auth__brand {
    min-height: 180px;
    padding: var(--ui-space-5);
  }

  .hr-auth__brand h1 {
    font-size: var(--ui-fs-h2);
    line-height: var(--ui-lh-h2);
    margin-top: var(--ui-space-3);
  }

  .hr-auth__panel {
    padding: var(--ui-space-6) var(--ui-space-5);
  }
}

/* —— Mobile —— */
@media (max-width: 767px) {
  /* Desktop collapse must NEVER shrink the mobile content column */
  .hr-app-shell,
  .hr-app-shell.is-collapsed {
    grid-template-columns: 1fr;
  }

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

  .hr-app-topbar #hr-btn-menu {
    display: inline-flex;
  }

  .hr-app-topbar #hr-btn-collapse {
    display: none;
  }

  .hr-app {
    --hr-app-header-gap: var(--ui-space-5);
    --hr-app-section-gap: var(--ui-space-5);
  }

  .hr-app-content {
    padding: var(--ui-space-4);
  }

  .hr-app-topbar {
    padding: 0 var(--ui-space-4);
  }

  /* Mobile: title block must NOT flex-grow (was causing huge empty gap) */
  .hr-app .hr-page-header {
    flex-direction: column;
    align-items: stretch;
    gap: var(--ui-space-3);
  }

  .hr-app .hr-page-header > div:first-child {
    flex: 0 0 auto;
  }

  .hr-app .hr-page-header__actions {
    width: 100%;
  }

  .hr-app .hr-page-header__actions .ui-btn {
    flex: 1 1 100%;
    min-height: 44px;
  }

  .hr-app .hr-kpi-row .ui-stat-card__label {
    min-height: 0;
  }

  .hr-app-grid-2,
  .hr-app-grid-3 {
    grid-template-columns: 1fr;
    gap: var(--ui-space-4);
  }

  .hr-app .hr-kpi-row,
  .hr-app .hr-kpi-row--2,
  .hr-app .hr-kpi-row--3,
  .hr-app .hr-kpi-row--4,
  .hr-app .hr-kpi-row--5,
  .hr-app .hr-kpi-row--6 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--ui-space-3);
  }

  .hr-app-form-panel {
    max-width: none;
  }

  .hr-app-notif,
  .hr-app .hr-app-notif.ui-notif-panel {
    position: fixed;
    top: 64px;
    right: 8px;
    left: 8px;
    width: auto;
    max-width: none;
    max-height: calc(100vh - 80px);
  }

  .hr-notif-scroll {
    max-height: calc(100vh - 180px);
  }

  .hr-app-topbar-utils .ui-lib-user.hr-user-chip span.hr-user-chip__text,
  .hr-app-topbar-utils .ui-lib-user.hr-user-chip span.hr-user-chip__login {
    display: block;
    max-width: 6.5rem;
  }

  .hr-app-topbar-utils .ui-lib-user.hr-user-chip span.hr-user-chip__text {
    display: flex;
  }

  .hr-app-topbar-utils .ui-lib-user.hr-user-chip span.hr-user-chip__role {
    display: none;
  }

  .hr-report-cards {
    grid-template-columns: 1fr;
  }

  .hr-auth__brand {
    display: none;
  }

  .hr-auth__panel {
    padding: var(--ui-space-5) var(--ui-space-4);
    align-items: flex-start;
    padding-top: var(--ui-space-8);
  }

  .hr-kiosk {
    padding: 0;
  }
}

@media (max-width: 359px) {
  .hr-app .hr-kpi-row,
  .hr-app .hr-kpi-row--2,
  .hr-app .hr-kpi-row--3,
  .hr-app .hr-kpi-row--4,
  .hr-app .hr-kpi-row--5,
  .hr-app .hr-kpi-row--6 {
    grid-template-columns: 1fr;
  }
}

/* Monthly schedule board — layout only, Foundation controls stay canonical. */
.hr-month {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: var(--ui-space-3);
  width: 100%;
  min-width: 0;
  align-items: start;
}

.hr-month__main,
.hr-month__side {
  min-width: 0;
}

.hr-month__side {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-2);
}

.hr-month__side .ui-card {
  padding: var(--ui-space-3);
}

.hr-month__side .ui-h4 {
  margin: 0;
}

.hr-period {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}

.hr-period__badge {
  text-transform: none;
  letter-spacing: 0;
}

.hr-period__version {
  font-size: var(--ui-fs-caption);
  color: var(--ui-text-secondary);
}

.hr-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hr-metrics li {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.hr-metrics span {
  font-size: var(--ui-fs-caption);
  color: var(--ui-text-muted);
}

.hr-metrics strong {
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.hr-cover-label,
.hr-cover-value {
  margin: 8px 0 0;
  font-size: var(--ui-fs-caption);
}

.hr-cover-value {
  margin-top: 0;
  font-size: 16px;
  font-weight: 700;
}

.hr-month-options {
  display: flex;
  align-items: center;
  min-height: 32px;
}

.hr-month-toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--ui-space-2);
  width: 100%;
  min-width: 0;
}

.hr-month-toolbar select.ui-input {
  width: 180px;
  flex: 0 0 180px;
}

.hr-month-toolbar__nav,
.hr-month-toolbar__filters,
.hr-month-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ui-space-2);
  min-width: 0;
}

.hr-month-toolbar__filters {
  flex: 1 1 220px;
}

.hr-month-toolbar__actions {
  margin-left: auto;
}

.hr-month-toolbar__search {
  position: relative;
  flex: 1 1 160px;
  min-width: 140px;
  max-width: 320px;
}

.hr-month-toolbar__search .ui-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.hr-month-toolbar__search .ui-input {
  padding-left: 32px;
  width: 100%;
}

.hr-cal-scroll {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
}

.hr-cal {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
  overflow: hidden;
  min-width: 720px;
}

.hr-cal__dow,
.hr-day {
  background: var(--ui-surface);
  min-width: 0;
  border-right: 1px solid var(--ui-border);
  border-bottom: 1px solid var(--ui-border);
}

.hr-cal__dow:nth-child(7n),
.hr-day:nth-child(7n) {
  border-right: 0;
}

.hr-cal__dow {
  padding: 6px var(--ui-space-2);
  font-size: var(--ui-fs-caption);
  font-weight: 700;
  color: var(--ui-text-muted);
}

.hr-dow-short { display: none; }

.hr-day {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 68px;
  height: auto;
  overflow: visible;
  padding: 4px 6px 6px;
  box-sizing: border-box;
}

.hr-day.is-muted {
  opacity: 0.38;
}

.hr-day.is-today {
  box-shadow: inset 0 0 0 2px var(--ui-primary);
}

.hr-day__today {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hr-day.is-saturday {
  background: var(--ui-n-50);
}

.hr-day[data-kind="nontrading"],
.hr-day[data-kind="holiday"] {
  background: color-mix(in srgb, var(--ui-danger-soft) 42%, var(--ui-surface));
}

.hr-day[data-kind="trading"] {
  background: color-mix(in srgb, var(--ui-success-soft) 45%, var(--ui-surface));
}

.hr-day[data-kind="unconfigured"] {
  background: var(--ui-n-50);
}

.hr-day__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.hr-day__num {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.hr-day__meta,
.hr-day__gap {
  margin: 0;
  font-size: 10px;
  line-height: 1.25;
  color: var(--ui-text-secondary);
}

.hr-day__gap {
  margin-top: auto;
}

.hr-day-add {
  min-width: 22px;
  min-height: 22px;
  padding: 0;
  margin-left: auto;
  border-color: transparent;
  background: transparent;
  color: var(--ui-text-muted);
}

.hr-day-more {
  align-self: flex-start;
  margin-top: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ui-text-secondary);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.hr-day-add:focus-visible,
.hr-day-more:focus-visible,
.hr-shift-chip:focus-visible {
  outline: 2px solid var(--ui-primary);
  outline-offset: 1px;
}

.hr-shift-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  width: 100%;
  min-height: 22px;
  border: 0;
  border-radius: var(--ui-radius-md);
  padding: 2px 6px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
}

.hr-shift-chip__time {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.hr-shift-chip__count {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
}

.hr-shift-chip__count .ui-icon {
  width: 12px;
  height: 12px;
}

.hr-shift-chip__draft {
  font-size: 10px;
  font-weight: 700;
}

.hr-legend-swatch {
  width: 14px;
  height: 14px;
  min-height: 0;
  min-width: 14px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  pointer-events: none;
  flex: none;
}

.hr-legend-swatch.is-gap {
  background: var(--ui-warning-soft);
  border: 1px solid var(--ui-border);
}

.hr-shift-chip[data-band="morning"] {
  background: var(--ui-info-soft);
  color: var(--ui-info-hover);
}

.hr-shift-chip[data-band="day"] {
  background: var(--ui-success-soft);
  color: var(--ui-success-hover);
}

.hr-shift-chip[data-band="afternoon"] {
  background: var(--ui-status-accent-bg);
  color: var(--ui-status-accent-fg);
}

.hr-shift-chip[data-band="night"] {
  background: var(--ui-n-800);
  color: #fff;
}

.hr-month-mobile { display: none; }

.hr-cover-meter {
  width: 100%;
  height: 8px;
  accent-color: var(--ui-success);
}

.hr-month-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hr-month-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--ui-fs-caption);
}

@media (min-width: 1101px) {
  .hr-month__side {
    position: sticky;
    top: var(--ui-space-3);
    align-self: start;
  }
}

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

  .hr-month-toolbar,
  .hr-month-toolbar__filters {
    flex-wrap: wrap;
  }

  .hr-month-toolbar select.ui-input,
  .hr-month-toolbar__search {
    width: auto;
    max-width: none;
    flex: 1 1 200px;
  }
}

@media (hover: hover) and (pointer: fine) {
  .hr-day-add {
    opacity: 0;
  }

  .hr-day:hover .hr-day-add,
  .hr-day:focus-within .hr-day-add,
  .hr-day-add:focus-visible {
    opacity: 1;
  }
}

@media (max-width: 860px) {
  .hr-cal { min-width: 0; }
  .hr-dow-full { display: none; }
  .hr-dow-short { display: inline; }
}

@media (max-width: 720px) {
  .hr-cal-scroll { display: none; }
  .hr-month-mobile { display: block; }
  .hr-dow-full { display: none; }
  .hr-dow-short { display: inline; }
  .hr-day-add,
  .hr-shift-chip {
    min-height: 36px;
    opacity: 1;
  }

  .hr-day-add {
    border-color: var(--ui-border);
    background: var(--ui-surface);
  }

  .hr-month-toolbar select.ui-input {
    width: 100%;
    flex-basis: 100%;
  }
  .hr-month-toolbar__actions {
    margin-left: 0;
    width: 100%;
  }
}

.schedule-print-only { display: none; }

@media print {
  @page { size: A4 landscape; margin: 8mm; }

  .hr-app-sidebar,
  .hr-app-topbar,
  .hr-page-header,
  .schedule-screen-only,
  .ui-modal-overlay {
    display: none !important;
  }

  .schedule-print-only { display: block !important; }

  .hr-app-shell,
  .hr-app-main,
  .hr-app-content,
  .hr-app-stack {
    display: block !important;
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: #fff !important;
  }

  .hr-print-head h1 {
    margin: 0 0 4px;
    font-size: 14px;
  }

  .hr-print-head p,
  .hr-print-legend {
    margin: 0 0 2px;
    font-size: 9px;
  }

  .hr-print-grid {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 7.5px;
    line-height: 1.2;
  }

  .hr-print-grid th,
  .hr-print-grid td {
    border: 1px solid #666;
    padding: 1px;
    text-align: center;
    vertical-align: top;
    color: #000;
    background: #fff;
  }

  .hr-print-grid thead { display: table-header-group; }
  .hr-print-grid tr { break-inside: avoid; page-break-inside: avoid; }

  .hr-print-grid th[scope="row"] {
    width: 28mm;
    text-align: left;
    font-weight: 600;
  }

  .hr-print-num,
  .hr-print-dow,
  .hr-print-mark { display: block; }

  .hr-print-grid .is-weekend { box-shadow: inset 0 -2px 0 #000; font-weight: 700; }
  .hr-print-grid .is-holiday .hr-print-mark { font-weight: 700; }
  .hr-print-grid td.is-out { color: #444; }
}

/* Employee RCP QR — light plate so modules stay black on white in any theme */
.hr-rcp-qr {
  max-width: 100%;
  margin-bottom: var(--ui-space-4);
}

.hr-rcp-qr__plate {
  box-sizing: border-box;
  width: min(312px, 100%);
  margin: var(--ui-space-3) 0;
  padding: 16px;
  background: #ffffff;
}

.hr-rcp-qr__plate canvas {
  display: block;
  width: 100% !important;
  height: auto !important;
  max-width: 280px;
  background: #ffffff;
  image-rendering: pixelated;
}

@media (prefers-color-scheme: dark) {
  .hr-rcp-qr__plate,
  .hr-rcp-qr__plate canvas {
    background: #ffffff;
  }
}

/* Global operation toasts. Host is fixed; ui-alert itself stays in normal flow. */
.hr-toast-host {
  position: fixed;
  top: calc(56px + 16px);
  right: 24px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(420px, calc(100vw - 48px));
  max-width: 420px;
  pointer-events: none;
}

.hr-toast {
  pointer-events: auto;
  width: 100%;
  box-shadow: var(--ui-shadow-md, 0 8px 24px rgba(15, 23, 42, 0.12));
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.hr-toast.is-in {
  opacity: 1;
  transform: none;
}

.hr-toast.is-out {
  opacity: 0;
  transform: none;
}

.hr-toast__text {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.hr-toast .ui-alert__close {
  flex: 0 0 auto;
}

@media (max-width: 767px) {
  .hr-toast-host {
    top: calc(56px + env(safe-area-inset-top) + 12px);
    right: 16px;
    left: 16px;
    width: auto;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hr-toast {
    transition: none;
    transform: none;
  }
}

/* Settings workspace — composition only. Domain tabs stay in the page; this nav is not the app sidebar. */
.settings-page {
  width: 100%;
  max-width: 1200px;
  min-width: 0;
}

.settings-page .ui-tabs {
  flex-wrap: wrap;
}

.settings-workspace {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-4);
  min-width: 0;
}

.settings-workspace__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--ui-space-3);
}

.settings-search {
  width: min(320px, 100%);
  margin: 0;
}

.settings-workspace__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--ui-space-6);
  align-items: start;
  min-width: 0;
}

@media (min-width: 768px) {
  .settings-workspace__body:has(.settings-nav) {
    grid-template-columns: 220px minmax(0, 1fr);
  }
}

.settings-workspace__body:not(:has(.settings-nav)) .settings-content {
  max-width: 720px;
}

.settings-nav {
  position: sticky;
  top: 72px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.settings-nav__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ui-space-2);
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--ui-radius-md);
  background: transparent;
  color: var(--ui-text-secondary);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
}

.settings-nav__item.is-active {
  background: var(--ui-selected-bg);
  color: var(--ui-text-primary);
}

.settings-section-picker {
  display: none;
}

.settings-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-4);
}

.settings-page [hidden] {
  display: none !important;
}

.settings-card {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-4);
  min-width: 0;
}

.settings-help {
  margin: 0;
  color: var(--ui-text-secondary);
  font-size: var(--ui-fs-sm);
  line-height: var(--ui-lh-sm);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--ui-space-2);
  padding-top: var(--ui-space-3);
  border-top: 1px solid var(--ui-border);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}

.settings-span {
  grid-column: 1 / -1;
}

.settings-hours-wrap {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
}

.settings-hours {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.settings-hours__row {
  display: grid;
  grid-template-columns: minmax(140px, 1.4fr) 72px minmax(112px, 1fr) minmax(112px, 1fr) 84px 84px;
  gap: 8px 10px;
  align-items: center;
  min-width: 680px;
}

.settings-hours__row .ui-input {
  width: 100%;
  min-width: 0;
}

.settings-hours__head {
  color: var(--ui-text-muted);
  font-size: 12px;
  font-weight: 700;
}

.settings-hours__name {
  font-weight: 600;
  font-size: 13px;
}

.settings-hours__lab {
  display: none;
}

.settings-rule {
  display: grid;
  grid-template-columns: minmax(160px, 1.6fr) minmax(88px, 140px) minmax(120px, 180px);
  gap: 8px 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--ui-border);
}

.settings-rule__name {
  font-size: 13px;
  font-weight: 600;
}

.settings-hit {
  background: var(--ui-selected-bg);
  border-radius: var(--ui-radius-sm);
}

.settings-advanced {
  border-top: 1px solid var(--ui-border);
  padding-top: var(--ui-space-3);
}

.settings-advanced summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.hr-app .settings-page #settings-panel,
.hr-app .settings-page .settings-content {
  max-width: none;
  width: 100%;
}

@media (max-width: 767px) {
  .settings-workspace__body {
    grid-template-columns: minmax(0, 1fr);
  }

  .settings-nav {
    display: none;
  }

  .settings-section-picker {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .settings-grid,
  .settings-rule {
    grid-template-columns: minmax(0, 1fr);
  }

  .settings-hours {
    gap: 0;
  }

  .settings-hours__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    min-width: 0;
    padding: 12px 0;
    border-top: 1px solid var(--ui-border);
  }

  .settings-hours__row.settings-hours__head {
    display: none;
  }

  .settings-hours__name {
    grid-column: 1 / -1;
  }

  .settings-hours__lab {
    display: block;
    margin-bottom: 4px;
    color: var(--ui-text-muted);
    font-size: 12px;
    font-weight: 600;
  }
}

.requests-workspace {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-4);
  min-width: 0;
}

.requests-tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  max-width: 100%;
}

.requests-tabs .ui-tab {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  white-space: nowrap;
  text-decoration: none;
}

.requests-toolbar .hr-filter-bar__search {
  flex: 1 1 240px;
  max-width: 420px;
}

.requests-toolbar .hr-filter-bar__filters {
  display: flex;
  flex: 1 1 16rem;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ui-space-2);
  min-width: 0;
  max-width: 100%;
}

.requests-toolbar .hr-filter-bar__filters select.ui-input,
.requests-toolbar .hr-filter-bar__filters input.ui-input {
  width: auto;
  flex: 1 1 9.5rem;
  min-width: 0;
  max-width: 100%;
}

.requests-type {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.requests-workspace tr.is-pending > td:first-child {
  box-shadow: inset 3px 0 0 var(--ui-warning, #b45309);
}

.requests-summary {
  max-width: 28rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.requests-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--ui-space-2);
  color: var(--ui-text-muted);
}

.requests-modal {
  width: min(720px, calc(100vw - 32px));
  max-height: min(85vh, 820px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.requests-modal__body {
  overflow: auto;
  min-height: 0;
}

.requests-modal .ui-modal__foot {
  flex-wrap: wrap;
}

.requests-modal__status {
  margin-top: 6px;
}

.requests-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--ui-space-3) var(--ui-space-4);
  margin: 0;
}

.requests-fields .is-wide {
  grid-column: 1 / -1;
}

.requests-fields dt {
  color: var(--ui-text-muted);
  font-size: 12px;
  font-weight: 600;
}

.requests-fields dd {
  margin: 2px 0 0;
  white-space: pre-wrap;
}

.requests-amount {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 var(--ui-space-3);
}

.requests-timeline {
  list-style: none;
  margin: var(--ui-space-3) 0 0;
  padding: 0;
}

.requests-timeline li {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 8px;
}

.requests-timeline li span {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--ui-border-strong, var(--ui-border));
}

.requests-timeline strong {
  display: block;
  font-size: 14px;
}

.requests-timeline p {
  margin: 0;
  color: var(--ui-text-muted);
  font-size: 13px;
}

.requests-chooser {
  display: grid;
  gap: var(--ui-space-2);
}

.requests-choice {
  display: flex;
  align-items: center;
  gap: var(--ui-space-3);
  padding: var(--ui-space-3);
  text-decoration: none;
  color: inherit;
}

.requests-choice small {
  display: block;
  color: var(--ui-text-muted);
  font-size: 13px;
}

.requests-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--ui-space-3);
}

.requests-form-grid .is-wide {
  grid-column: 1 / -1;
}

.requests-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--ui-space-3);
  margin-bottom: var(--ui-space-3);
}

.requests-compare div {
  padding: var(--ui-space-3);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-md);
}

.requests-compare span {
  display: block;
  color: var(--ui-text-muted);
  font-size: 12px;
  font-weight: 600;
}

.requests-workspace .ui-table-wrap {
  overflow-x: auto;
}

.requests-workspace .hr-employee-identity__text {
  min-width: 0;
}

.requests-workspace .hr-employee-identity__name,
.requests-workspace .hr-employee-identity__role {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 767px) {
  .requests-toolbar .hr-filter-bar__search {
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
  }

  .requests-toolbar .hr-filter-bar__filters,
  .requests-toolbar .hr-filter-bar__filters select.ui-input {
    width: 100%;
    max-width: none;
  }

  .requests-fields,
  .requests-form-grid,
  .requests-compare {
    grid-template-columns: minmax(0, 1fr);
  }

  .requests-modal {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 24px);
  }

  .requests-summary {
    white-space: normal;
  }
}

@media (min-width: 768px) and (max-width: 1100px) {
  .requests-workspace .requests-col-extra {
    display: none;
  }

  .requests-workspace .ui-table {
    table-layout: fixed;
    width: 100%;
  }

  .requests-workspace .ui-table th,
  .requests-workspace .ui-table td {
    overflow: hidden;
  }

  .requests-workspace .requests-summary {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

.finance-workspace {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-4);
  min-width: 0;
}

.finance-tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  max-width: 100%;
}

.finance-tabs .ui-tab {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  white-space: nowrap;
  text-decoration: none;
}

.finance-toolbar .hr-filter-bar__search {
  flex: 1 1 220px;
  max-width: 360px;
}

.finance-toolbar .hr-filter-bar__filters {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ui-space-2);
}

.finance-toolbar .hr-filter-bar__filters select.ui-input {
  width: auto;
  min-width: 10.5rem;
}

.finance-month {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.finance-month span {
  min-width: 9rem;
  text-align: center;
  font-weight: 600;
}

.finance-note {
  margin: 0;
  color: var(--ui-text-muted);
  font-size: 0.875rem;
}

.finance-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--ui-space-3);
}

.finance-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  margin: 16px 0 0;
}

.finance-fields div {
  min-width: 0;
}

.finance-fields .is-wide {
  grid-column: 1 / -1;
}

.finance-fields dt {
  color: var(--ui-text-muted);
  font-size: 0.75rem;
}

.finance-fields dd {
  margin: 2px 0 0;
}

.finance-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 16px;
}

.finance-summary div {
  padding: 8px 10px;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
}

.finance-summary span {
  display: block;
  color: var(--ui-text-muted);
  font-size: 0.75rem;
}

.finance-workspace tr.is-inactive {
  opacity: 0.55;
}

.finance-workspace .ui-table {
  width: 100%;
}

.finance-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

@media (min-width: 768px) and (max-width: 1200px) {
  .finance-workspace .ui-table {
    table-layout: fixed;
    width: 100%;
  }

  .finance-workspace .ui-table th:first-child,
  .finance-workspace .ui-table td:first-child {
    width: 22%;
  }

  .finance-workspace .ui-table td.hr-card-actions {
    width: 8.5rem;
  }

  .finance-workspace .hr-employee-identity__name,
  .finance-workspace .hr-employee-identity__role {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

.finance-modal {
  display: flex;
  flex-direction: column;
  width: min(640px, calc(100vw - 32px));
  max-height: min(85vh, 820px);
}

.finance-modal .ui-modal__body {
  overflow: auto;
  min-height: 0;
}

@media (max-width: 767px) {
  .finance-toolbar .hr-filter-bar__search {
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
  }

  .finance-month {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    width: 100%;
  }

  .finance-month > .ui-btn:last-child {
    grid-column: 1 / -1;
  }

  .hr-mobile-cards td.hr-card-actions .finance-actions {
    width: 100%;
    flex-direction: column;
  }

  .hr-mobile-cards td.hr-card-actions .finance-actions .ui-btn {
    width: 100%;
  }

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

  .finance-overlay {
    padding: 8px;
    box-sizing: border-box;
  }

  .finance-modal {
    width: 100%;
    max-width: 100%;
    max-height: calc(100vh - 16px);
    box-sizing: border-box;
  }
}

.profile-page {
  display: grid;
  gap: var(--ui-space-4);
  min-width: 0;
  max-width: 100%;
}

.profile-page .ui-tabs {
  flex-wrap: nowrap;
  max-width: 100%;
  overflow-x: auto;
}

.profile-page .ui-tab {
  flex: 0 0 auto;
  white-space: nowrap;
}

.profile-page .ui-tab:focus-visible {
  outline: 2px solid var(--ui-primary);
  outline-offset: 2px;
}

.profile-page .hr-employee-identity {
  align-items: flex-start;
}

.profile-nowrap {
  white-space: nowrap;
}

.profile-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.profile-summary .ui-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-summary__value {
  font-weight: 600;
  color: var(--ui-text-primary);
  overflow-wrap: anywhere;
}

a.profile-summary__link {
  text-decoration: none;
  color: inherit;
}

a.profile-summary__link:hover .profile-summary__value,
a.profile-summary__link:focus-visible .profile-summary__value {
  color: var(--ui-primary);
}

a.profile-summary__link:focus-visible {
  outline: 2px solid var(--ui-primary);
  outline-offset: 2px;
}

@media (max-width: 767px) {
  .profile-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.profile-auth-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  min-width: 0;
}

.profile-page .ui-input {
  width: 100%;
  max-width: 28rem;
  box-sizing: border-box;
}

.account-security {
  display: grid;
  gap: 16px;
  max-width: none;
  min-width: 0;
}

.account-security__head,
.account-security__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.account-security__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 12px 0;
}

.account-security__facts dt {
  color: var(--ui-text-muted);
  font-size: var(--ui-fs-caption);
}

.account-security .ui-input,
.hr-auth__card .ui-input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

dialog.account-dialog {
  border: 0;
  max-width: calc(100vw - 24px);
}

dialog.account-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

dialog.hr-doc-dialog.ui-modal {
  width: min(760px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
  background: var(--ui-surface);
  color: inherit;
  box-shadow: var(--ui-shadow-lg);
}

dialog.hr-doc-dialog--preview.ui-modal {
  width: min(960px, calc(100vw - 16px));
}

dialog.hr-doc-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

dialog.hr-doc-dialog[open] {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 16px);
  overflow: hidden;
}

dialog#hr-doc-detail[open],
dialog#hr-doc-preview[open] {
  top: 16px;
  bottom: auto;
  height: calc(100vh - 48px);
  max-height: calc(100vh - 48px);
  margin: 0 auto;
}

dialog.hr-doc-dialog[open] > form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: calc(100vh - 16px);
  margin: 0;
  overflow: hidden;
}

dialog.hr-doc-dialog .ui-modal__head,
dialog.hr-doc-dialog .ui-modal__foot {
  flex: 0 0 auto;
  padding: 14px 18px;
  background: var(--ui-surface);
}

dialog.hr-doc-dialog .ui-modal__foot {
  flex-wrap: wrap;
}

.hr-doc-dialog__body {
  flex: 1 1 auto;
  overflow: auto;
  min-height: 0;
  max-height: calc(100vh - 280px);
  padding: 0 18px 18px;
}

dialog#hr-doc-detail[open] .hr-doc-dialog__body,
dialog#hr-doc-preview[open] .hr-doc-dialog__body {
  max-height: none;
}

.hr-doc-choice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--ui-border);
}

.hr-doc-choice strong,
.hr-doc-choice .ui-body-sm {
  display: block;
}

.hr-doc-choice .ui-body-sm {
  margin: 4px 0 0;
  color: var(--ui-text-muted);
}

.hr-doc-meta {
  display: grid;
  grid-template-columns: minmax(140px, 200px) minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0 0 16px;
}

.hr-doc-meta dt {
  color: var(--ui-text-muted);
  font-size: var(--ui-fs-caption);
}

.hr-doc-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.hr-doc-toolbar,
.hr-doc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.hr-doc-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 240px);
  gap: 12px;
  margin: 12px 0;
}

.hr-doc-preview__frame {
  width: 100%;
  height: min(72vh, 840px);
  border: 0;
  background: var(--ui-n-100, #f4f6f8);
}

.hr-doc-hash {
  display: block;
  overflow-wrap: anywhere;
  font-family: ui-monospace, monospace;
  font-size: 12px;
}

.hr-doc-page .ui-tabs {
  margin-bottom: 12px;
}

@media (min-width: 1024px) {
  .hr-doc-page .ui-table {
    width: 100%;
    table-layout: fixed;
  }

  .hr-doc-page .ui-table th,
  .hr-doc-page .ui-table td {
    overflow-wrap: anywhere;
  }

  .hr-doc-page .ui-table th:last-child,
  .hr-doc-page .ui-table td.hr-card-actions {
    width: 6.5rem;
    white-space: nowrap;
  }

  .hr-doc-page .ui-table.hr-req-table th:last-child,
  .hr-doc-page .ui-table.hr-req-table td.hr-card-actions,
  .ui-table.hr-req-table th:last-child,
  .ui-table.hr-req-table td.hr-card-actions {
    width: 28%;
    white-space: normal;
    vertical-align: top;
  }

  .ui-table.hr-req-table td {
    vertical-align: top;
  }
}

@media (max-width: 767px) {
  .hr-doc-meta,
  .hr-doc-filters {
    grid-template-columns: 1fr;
  }

  dialog.hr-doc-dialog .ui-modal__foot {
    flex-wrap: wrap;
  }

  dialog.hr-doc-dialog .ui-modal__foot,
  .hr-doc-actions,
  .hr-doc-toolbar {
    align-items: stretch;
  }

  dialog.hr-doc-dialog .ui-modal__foot .ui-btn,
  .hr-doc-actions .ui-btn,
  .hr-doc-toolbar .ui-btn {
    flex: 1 1 auto;
  }
}

.hr-company-docs {
  min-width: 0;
}

.hr-company-docs__toolbar {
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.hr-company-docs__toolbar > .ui-input {
  width: auto;
  flex: 1 1 11rem;
  min-width: 0;
  max-width: 16rem;
}

.hr-company-docs__toolbar > .ui-input:first-child {
  flex-basis: 16rem;
  max-width: 22rem;
}

.hr-company-docs__toolbar > .ui-btn {
  flex: 0 0 auto;
  width: auto;
}

.hr-company-docs .ui-table-wrap,
dialog.hr-doc-dialog .ui-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.hr-company-docs td {
  overflow-wrap: break-word;
}

.hr-cdoc-hash {
  max-width: 16rem;
  overflow-wrap: anywhere;
}

dialog#hr-cdoc-detail.ui-modal {
  width: min(1080px, calc(100vw - 24px));
}

dialog#hr-cdoc-detail .ui-table td,
dialog#hr-cdoc-detail .ui-table th {
  vertical-align: top;
}

dialog#hr-cdoc-detail .ui-table td:nth-child(1),
dialog#hr-cdoc-detail .ui-table td:nth-child(2),
dialog#hr-cdoc-detail .ui-table td:nth-child(5),
dialog#hr-cdoc-detail .ui-table td:nth-child(6),
dialog#hr-cdoc-detail .ui-table td:nth-child(7) {
  white-space: nowrap;
}

.hr-company-docs .ui-table td.hr-card-actions,
.hr-company-docs .ui-table th:last-child {
  white-space: normal;
}

dialog#hr-cdoc-detail[open] {
  top: 16px;
  bottom: auto;
  height: calc(100vh - 32px);
  max-height: calc(100vh - 32px);
  margin: 0 auto;
}

dialog#hr-cdoc-detail[open] .hr-doc-dialog__body {
  max-height: none;
}

@media (max-width: 760px) {
  .hr-company-docs__toolbar > .ui-input,
  .hr-company-docs__toolbar > .ui-input:first-child {
    flex: 1 1 100%;
    max-width: none;
    width: 100%;
  }

  .hr-company-docs .ui-table-wrap {
    overflow-x: visible;
  }

  .hr-company-docs .ui-table thead {
    display: none;
  }

  .hr-company-docs .ui-table,
  .hr-company-docs .ui-table tbody,
  .hr-company-docs .ui-table tr,
  .hr-company-docs .ui-table td {
    display: block;
    width: 100%;
  }

  .hr-company-docs .ui-table tr {
    margin-bottom: 12px;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-md);
    padding: 8px 0;
  }

  .hr-company-docs .ui-table td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border: 0;
  }

  .hr-company-docs .ui-table td::before {
    content: attr(data-label);
    font-weight: 600;
    flex: 0 0 42%;
  }

  .hr-company-docs .ui-table td.hr-card-actions {
    display: block;
  }

  .hr-company-docs .ui-table td.hr-card-actions::before {
    display: block;
    margin-bottom: 8px;
  }
}
