/* ==========================================================================
   HR Revo design system
   One stylesheet for every app: tokens, layout, sidebar, and components.
   Pages built on templates/layouts/app.html get all of this; legacy pages
   get it through {% legacy_sidebar %} together with hr-legacy.css.
   ========================================================================== */

/* Design tokens (colours, fonts, sizes) live in theme.css - change them there. */

/* ── Base ─────────────────────────────────────────────────────────────── */
.hr-app, .hr-app * { box-sizing: border-box; }
body.hr-app {
  margin: 0;
  font-family: var(--hr-font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--hr-text);
  background: var(--hr-bg);
  -webkit-font-smoothing: antialiased;
}
.hr-app a { color: var(--hr-primary); text-decoration: none; }
.hr-app a:hover { text-decoration: underline; }
.hr-app :focus-visible { outline: 2px solid var(--hr-primary); outline-offset: 2px; }

/* ── Shell layout ─────────────────────────────────────────────────────── */
.hr-shell { display: flex; min-height: 100vh; }
.hr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.hr-topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--hr-topbar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px;
  background: var(--hr-surface);
  border-bottom: 1px solid var(--hr-border);
}
.hr-topbar__title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hr-topbar__context { color: var(--hr-muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hr-topbar__spacer { flex: 1; }
.hr-topbar__user { display: flex; align-items: center; gap: 10px; color: var(--hr-text-2); font-size: 13px; }
.hr-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--hr-primary-soft); color: var(--hr-primary); font-weight: 600; font-size: 12px;
  text-transform: uppercase;
}
.hr-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: var(--hr-radius-sm);
  border: 1px solid transparent; background: transparent; color: var(--hr-text-2);
  cursor: pointer; font-size: 15px;
}
.hr-icon-btn:hover { background: var(--hr-surface-2); border-color: var(--hr-border); text-decoration: none; }

.hr-content { padding: 20px 24px 40px; width: 100%; max-width: none; min-width: 0; }

/* ── Sidebar ──────────────────────────────────────────────────────────── */
.hr-sidebar {
  position: sticky; top: 0; height: 100vh; flex: 0 0 var(--hr-sidebar-w);
  width: var(--hr-sidebar-w);
  display: flex; flex-direction: column;
  background: var(--hr-sidebar-bg); color: var(--hr-sidebar-text);
  font-family: var(--hr-font); font-size: 13.5px; letter-spacing: 0;
  z-index: 40;
  transition: width .15s ease, flex-basis .15s ease;
}
.hr-sidebar__brand {
  display: flex; align-items: center; gap: 10px;
  height: var(--hr-topbar-h); padding: 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  color: #fff; font-weight: 700; font-size: 15px;
}
.hr-sidebar__brand a { color: #fff; text-decoration: none; display: flex; align-items: center; gap: 10px; min-width: 0; }
.hr-sidebar__brand .hr-brand-mark {
  width: 30px; height: 30px; border-radius: 8px; flex: 0 0 30px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--hr-sidebar-active); color: #fff; font-size: 14px;
}
.hr-sidebar__toggle {
  margin-left: auto; color: var(--hr-sidebar-text); background: transparent; border: 0;
  width: 30px; height: 30px; border-radius: 6px; cursor: pointer;
}
.hr-sidebar__toggle:hover { background: var(--hr-sidebar-hover); }
.hr-sidebar__search { padding: 12px 12px 4px; }
.hr-sidebar__search input {
  width: 100%; height: 32px; padding: 0 10px 0 30px;
  border-radius: 6px; border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .06) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%237f8ea5' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.868-3.834zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E") no-repeat 10px center;
  color: #fff; font: inherit; font-size: 13px;
}
.hr-sidebar__search input::placeholder { color: var(--hr-sidebar-muted); }
.hr-sidebar__nav { flex: 1; overflow-y: auto; padding: 6px 8px 24px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.hr-nav-section { margin-top: 14px; }
.hr-nav-section__title {
  padding: 0 10px 6px; color: var(--hr-sidebar-muted);
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
}
.hr-nav-group { border-radius: 6px; }
.hr-nav-group > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 6px; color: var(--hr-sidebar-text); font-weight: 500;
}
.hr-nav-group > summary::-webkit-details-marker { display: none; }
.hr-nav-group > summary:hover { background: var(--hr-sidebar-hover); }
.hr-nav-group > summary .hr-nav-caret { margin-left: auto; font-size: 10px; transition: transform .15s ease; opacity: .7; }
.hr-nav-group[open] > summary .hr-nav-caret { transform: rotate(90deg); }
.hr-nav-group .hr-nav-icon { width: 18px; text-align: center; font-size: 14px; opacity: .9; flex: 0 0 18px; }
.hr-nav-items { list-style: none; margin: 2px 0 6px; padding: 0 0 0 18px; }
.hr-nav-items a {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 10px; border-radius: 6px;
  color: var(--hr-sidebar-text); text-decoration: none; font-size: 13px;
  border-left: 2px solid transparent;
}
.hr-nav-items a i { width: 16px; text-align: center; font-size: 12.5px; opacity: .75; flex: 0 0 16px; }
.hr-nav-items a:hover { background: var(--hr-sidebar-hover); color: #fff; text-decoration: none; }
.hr-nav-items a.is-active { background: var(--hr-sidebar-active); color: #fff; }
.hr-nav-items a.is-active i { opacity: 1; }
.hr-nav-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hr-nav-empty { padding: 10px; color: var(--hr-sidebar-muted); font-size: 12.5px; display: none; }

/* collapsed (icon-only) */
.hr-sidebar-collapsed .hr-sidebar { width: var(--hr-sidebar-w-collapsed); flex-basis: var(--hr-sidebar-w-collapsed); }
.hr-sidebar-collapsed .hr-sidebar .hr-brand-text,
.hr-sidebar-collapsed .hr-sidebar .hr-sidebar__search,
.hr-sidebar-collapsed .hr-sidebar .hr-nav-section__title,
.hr-sidebar-collapsed .hr-sidebar .hr-nav-group > summary .hr-nav-label,
.hr-sidebar-collapsed .hr-sidebar .hr-nav-caret,
.hr-sidebar-collapsed .hr-sidebar .hr-nav-items { display: none; }
.hr-sidebar-collapsed .hr-sidebar .hr-nav-group > summary { justify-content: center; padding: 9px 0; }
.hr-sidebar-collapsed .hr-sidebar__brand { padding: 0; justify-content: center; }
.hr-sidebar-collapsed .hr-sidebar__toggle { margin-left: 0; display: none; }

/* mobile off-canvas */
.hr-sidebar-backdrop { display: none; }
.hr-mobile-only { display: none !important; }
@media (max-width: 960px) {
  .hr-mobile-only { display: inline-flex !important; }
  .hr-sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--hr-shadow-lg); }
  .hr-sidebar-open .hr-sidebar { transform: none; }
  .hr-sidebar-open .hr-sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .4); z-index: 35; }
  .hr-sidebar-collapsed .hr-sidebar { width: var(--hr-sidebar-w); }
  .hr-content { padding: 16px; }
  .hr-topbar { padding: 0 12px; }
}

/* ── Page header ──────────────────────────────────────────────────────── */
.hr-page-header { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; margin-bottom: 16px; }
.hr-page-header__text { flex: 1 1 320px; min-width: 0; }
.hr-page-title { margin: 0; font-size: 20px; font-weight: 650; line-height: 1.3; color: var(--hr-text); }
.hr-page-subtitle { margin: 2px 0 0; color: var(--hr-muted); font-size: 13.5px; }
.hr-page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hr-breadcrumbs { font-size: 12.5px; color: var(--hr-muted); margin-bottom: 4px; }
.hr-breadcrumbs a { color: var(--hr-muted); }

/* ── Cards ────────────────────────────────────────────────────────────── */
.hr-card {
  background: var(--hr-surface); border: 1px solid var(--hr-border);
  border-radius: var(--hr-radius); box-shadow: var(--hr-shadow);
}
.hr-card + .hr-card { margin-top: 16px; }
.hr-card__header { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--hr-border); }
.hr-card__title { margin: 0; font-size: 15px; font-weight: 600; }
.hr-card__body { padding: 16px; }
.hr-card__footer { padding: 12px 16px; border-top: 1px solid var(--hr-border); background: var(--hr-surface-2); border-radius: 0 0 var(--hr-radius) var(--hr-radius); }

.hr-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.hr-stat { background: var(--hr-surface); border: 1px solid var(--hr-border); border-radius: var(--hr-radius); padding: 14px 16px; }
.hr-stat__label { color: var(--hr-muted); font-size: 12.5px; }
.hr-stat__value { font-size: 22px; font-weight: 650; margin-top: 2px; font-variant-numeric: tabular-nums; }

/* ── Buttons (also normalises Bootstrap .btn) ─────────────────────────── */
.hr-btn, .hr-app .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--hr-control-h); padding: 0 14px;
  border-radius: var(--hr-radius-sm); border: 1px solid var(--hr-border-strong);
  background: var(--hr-surface); color: var(--hr-text);
  font: 500 13.5px/1 var(--hr-font); white-space: nowrap;
  cursor: pointer; text-decoration: none; user-select: none;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease;
  -webkit-appearance: none; appearance: none;
}
.hr-btn:hover, .hr-app .btn:hover { background: var(--hr-surface-2); text-decoration: none; }
.hr-btn:disabled, .hr-btn.is-disabled, .hr-app .btn:disabled { opacity: .55; cursor: not-allowed; }
.hr-btn--primary, .hr-app .btn-primary { background: var(--hr-primary); border-color: var(--hr-primary); color: #fff; }
.hr-btn--primary:hover, .hr-app .btn-primary:hover { background: var(--hr-primary-hover); border-color: var(--hr-primary-hover); color: #fff; }
.hr-btn--success, .hr-app .btn-success { background: var(--hr-success); border-color: var(--hr-success); color: #fff; }
.hr-btn--success:hover, .hr-app .btn-success:hover { filter: brightness(.93); background: var(--hr-success); color: #fff; }
.hr-btn--danger, .hr-app .btn-danger { background: var(--hr-danger); border-color: var(--hr-danger); color: #fff; }
.hr-btn--danger:hover, .hr-app .btn-danger:hover { filter: brightness(.93); background: var(--hr-danger); color: #fff; }
.hr-btn--ghost { border-color: transparent; background: transparent; color: var(--hr-text-2); }
.hr-btn--ghost:hover { background: var(--hr-surface-2); }
.hr-btn--sm, .hr-app .btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.hr-btn--icon { width: var(--hr-control-h); padding: 0; }
.hr-btn--sm.hr-btn--icon { width: 30px; }
.hr-app .btn-secondary, .hr-app .btn-outline-secondary, .hr-app .btn-light { background: var(--hr-surface); border-color: var(--hr-border-strong); color: var(--hr-text); }
.hr-app .btn-warning { background: var(--hr-warning); border-color: var(--hr-warning); color: #fff; }
.hr-app .btn-info { background: var(--hr-info); border-color: var(--hr-info); color: #fff; }

/* ── Forms ────────────────────────────────────────────────────────────── */
.hr-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hr-label, .hr-field > label { font-size: 12.5px; font-weight: 500; color: var(--hr-text-2); }
.hr-help { font-size: 12px; color: var(--hr-muted); }
.hr-error { font-size: 12px; color: var(--hr-danger); }
.hr-input, .hr-select, .hr-textarea,
.hr-app .form-control, .hr-app .form-select,
.hr-field input:not([type=checkbox]):not([type=radio]):not([type=file]),
.hr-field select, .hr-field textarea {
  width: 100%; min-height: var(--hr-control-h); padding: 6px 10px;
  border: 1px solid var(--hr-border-strong); border-radius: var(--hr-radius-sm);
  background-color: var(--hr-surface); color: var(--hr-text);
  font: 400 13.5px/1.4 var(--hr-font);
  transition: border-color .12s ease, box-shadow .12s ease;
}
.hr-textarea, .hr-field textarea { min-height: 80px; resize: vertical; }
.hr-input:focus, .hr-select:focus, .hr-textarea:focus,
.hr-app .form-control:focus, .hr-app .form-select:focus,
.hr-field input:focus, .hr-field select:focus, .hr-field textarea:focus {
  outline: none; border-color: var(--hr-primary); box-shadow: 0 0 0 3px rgba(31, 78, 140, .15);
}
.hr-field select[multiple] { min-height: 120px; }
.hr-check { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; }
.hr-check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--hr-primary); }
.hr-form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px 16px; }
.hr-form-grid .hr-span-all { grid-column: 1 / -1; }
.hr-form-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* ── Filter bar: same size & look on every page ───────────────────────── */
.hr-filters {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px 12px; align-items: end;
  padding: 12px 14px; margin-bottom: 14px;
  background: var(--hr-surface); border: 1px solid var(--hr-border); border-radius: var(--hr-radius);
}
.hr-filters__actions { display: flex; gap: 8px; align-items: end; }

/* ── Tables ───────────────────────────────────────────────────────────── */
.hr-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.hr-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.hr-table th {
  position: sticky; top: 0; z-index: 1;
  text-align: left; font-weight: 600; font-size: 12px; color: var(--hr-text-2);
  text-transform: uppercase; letter-spacing: .03em;
  background: var(--hr-surface-2); padding: 10px 12px; border-bottom: 1px solid var(--hr-border); white-space: nowrap;
}
.hr-table td { padding: 10px 12px; border-bottom: 1px solid var(--hr-border); vertical-align: middle; }
.hr-table tbody tr:hover td { background: #fafbfd; }
.hr-table tbody tr:last-child td { border-bottom: 0; }
.hr-table .hr-num { text-align: right; font-variant-numeric: tabular-nums; }
.hr-table .hr-actions { white-space: nowrap; text-align: right; }

.hr-empty { text-align: center; padding: 40px 16px; color: var(--hr-muted); }
.hr-empty i { font-size: 28px; opacity: .5; display: block; margin-bottom: 8px; }

/* ── Badges ───────────────────────────────────────────────────────────── */
.hr-badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
  background: var(--hr-surface-2); color: var(--hr-text-2); border: 1px solid var(--hr-border);
}
.hr-badge--pending { background: var(--hr-warning-soft); color: var(--hr-warning); border-color: transparent; }
.hr-badge--approved, .hr-badge--success { background: var(--hr-success-soft); color: var(--hr-success); border-color: transparent; }
.hr-badge--rejected, .hr-badge--danger { background: var(--hr-danger-soft); color: var(--hr-danger); border-color: transparent; }
.hr-badge--info, .hr-badge--draft { background: var(--hr-info-soft); color: var(--hr-info); border-color: transparent; }

/* ── Alerts / messages / toasts ───────────────────────────────────────── */
.hr-alert { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: var(--hr-radius-sm); margin-bottom: 12px; border: 1px solid transparent; font-size: 13.5px; }
.hr-alert--success { background: var(--hr-success-soft); color: var(--hr-success); }
.hr-alert--error, .hr-alert--danger { background: var(--hr-danger-soft); color: var(--hr-danger); }
.hr-alert--warning { background: var(--hr-warning-soft); color: var(--hr-warning); }
.hr-alert--info, .hr-alert--debug { background: var(--hr-info-soft); color: var(--hr-info); }
.hr-alert__close { margin-left: auto; background: none; border: 0; color: inherit; cursor: pointer; opacity: .7; }

.hr-toasts { position: fixed; right: 16px; bottom: 16px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.hr-toast { background: var(--hr-text); color: #fff; padding: 10px 14px; border-radius: var(--hr-radius-sm); box-shadow: var(--hr-shadow-lg); font-size: 13.5px; animation: hr-toast-in .18s ease; }
.hr-toast--error { background: var(--hr-danger); }
.hr-toast--success { background: var(--hr-success); }
@keyframes hr-toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── Pagination ───────────────────────────────────────────────────────── */
.hr-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--hr-border); font-size: 13px; color: var(--hr-muted); }
.hr-pagination__links { display: flex; gap: 4px; }
.hr-pagination a, .hr-pagination span.is-current {
  min-width: 32px; height: 32px; padding: 0 8px; border-radius: var(--hr-radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--hr-border); color: var(--hr-text-2); background: var(--hr-surface); text-decoration: none;
}
.hr-pagination a:hover { background: var(--hr-surface-2); text-decoration: none; }
.hr-pagination span.is-current { background: var(--hr-primary); border-color: var(--hr-primary); color: #fff; }

/* ── Tabs ─────────────────────────────────────────────────────────────── */
.hr-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--hr-border); margin-bottom: 16px; overflow-x: auto; }
.hr-tabs a { padding: 9px 14px; color: var(--hr-text-2); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 500; text-decoration: none; }
.hr-tabs a:hover { color: var(--hr-text); text-decoration: none; }
.hr-tabs a.is-active { color: var(--hr-primary); border-bottom-color: var(--hr-primary); }

/* ── Key/value lists & diffs ──────────────────────────────────────────── */
.hr-dl { display: grid; grid-template-columns: minmax(140px, max-content) 1fr; gap: 8px 20px; margin: 0; }
.hr-dl dt { color: var(--hr-muted); font-size: 13px; }
.hr-dl dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.hr-old { color: var(--hr-danger); text-decoration: line-through; text-decoration-color: rgba(180, 35, 24, .4); }
.hr-new { color: var(--hr-success); font-weight: 500; }

/* ── Utilities ────────────────────────────────────────────────────────── */
.hr-muted { color: var(--hr-muted); }
.hr-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hr-grow { flex: 1; }
.hr-mt { margin-top: 16px; }
.hr-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.hr-hidden { display: none !important; }
.hr-spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: hr-spin .6s linear infinite; }
@keyframes hr-spin { to { transform: rotate(360deg); } }
.htmx-request .hr-when-idle { display: none; }
.hr-when-loading { display: none; }
.htmx-request .hr-when-loading { display: inline-block; }

@media (prefers-reduced-motion: reduce) {
  .hr-app *, .hr-app *::before, .hr-app *::after { animation: none !important; transition: none !important; }
}
@media print {
  .hr-sidebar, .hr-topbar, .hr-page-actions, .hr-filters { display: none !important; }
  .hr-content { padding: 0; }
}

/* ── Checkbox / radio lists (CheckboxSelectMultiple) ──────────────────── */
.hr-choice-list { display: flex; flex-wrap: wrap; gap: 6px 10px; padding: 4px 0; }
.hr-choice-list > div { display: contents; }
.hr-choice-list label {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px;
  border: 1px solid var(--hr-border-strong); border-radius: 999px; background: var(--hr-surface);
  font-size: 13px; cursor: pointer; font-weight: 400; color: var(--hr-text);
}
.hr-choice-list input { accent-color: var(--hr-primary); margin: 0; }
.hr-choice-list label:has(input:checked) { border-color: var(--hr-primary); background: var(--hr-primary-soft); }

/* ==========================================================================
   Visual layer (v3): glass top bar, tech accents, page search, guidance
   ========================================================================== */
body.hr-app { font-size: var(--hr-font-size); background: var(--hr-bg-pattern), var(--hr-bg); background-attachment: fixed; }
.hr-content { max-width: var(--hr-content-max); }
/* Wide monitors: page wrappers inside the layout use the full width (old pages capped them at 1200-1600px). */
.hr-content :is(.container, .container-sm, .container-md, .container-lg, .container-xl, .container-xxl,
  .roadmap-container, .task-container, .history-section) { max-width: none !important; }
.hr-page-title { font-size: var(--hr-title-size); letter-spacing: -.01em; }

/* Top bar */
.hr-topbar {
  background: var(--hr-glass);
  -webkit-backdrop-filter: saturate(160%) blur(10px); backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid rgba(226, 232, 240, .8);
  height: var(--hr-topbar-h);
}
.hr-topbar__brand { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none !important; }
.hr-topbar__brand-name { font-weight: 700; font-size: 15px; color: var(--hr-text); letter-spacing: .01em; white-space: nowrap; }
.hr-topbar__brand-tag { font-size: 11px; font-weight: 600; color: var(--hr-accent); background: var(--hr-accent-soft); padding: 2px 8px; border-radius: 999px; letter-spacing: .04em; }
.hr-topbar__divider { width: 1px; height: 22px; background: var(--hr-border); }
.hr-topbar__context { font-size: 13px; color: var(--hr-muted); }
.hr-search-btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 38px; width: min(420px, 38vw); padding: 0 10px 0 12px;
  border: 1px solid var(--hr-border); border-radius: 10px; background: var(--hr-surface);
  color: var(--hr-muted); font: 400 13.5px var(--hr-font); cursor: pointer; text-align: left;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04); transition: border-color .12s, box-shadow .12s;
}
.hr-search-btn:hover { border-color: var(--hr-accent); box-shadow: var(--hr-glow); }
.hr-search-btn span { flex: 1; }
.hr-kbd { font: 600 11px var(--hr-font); color: var(--hr-text-2); background: var(--hr-surface-2); border: 1px solid var(--hr-border); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; }
@media (max-width: 760px) {
  .hr-search-btn { width: 38px; padding: 0; justify-content: center; }
  .hr-search-btn span, .hr-search-btn .hr-kbd, .hr-topbar__brand-tag, .hr-topbar__divider, .hr-topbar__context { display: none; }
}

/* Sidebar accents */
.hr-sidebar { background: var(--hr-sidebar-bg); box-shadow: inset -1px 0 0 rgba(148, 163, 184, .08); }
.hr-sidebar__brand .hr-brand-mark { background: var(--hr-gradient); box-shadow: 0 0 18px rgba(6, 182, 212, .35); }
.hr-nav-items a { position: relative; transition: background-color .12s, color .12s; }
.hr-nav-items a.is-active { background: var(--hr-sidebar-active); color: var(--hr-sidebar-active-text); box-shadow: inset 0 0 0 1px rgba(34, 211, 238, .18); }
.hr-nav-items a.is-active::before { content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 3px; border-radius: 3px; background: var(--hr-sidebar-active-bar); box-shadow: 0 0 10px var(--hr-sidebar-active-bar); }
.hr-nav-items a.needs-entity { opacity: .78; }
.hr-nav-section__title { color: var(--hr-sidebar-muted); }

/* Buttons: tech gradient for primary */
.hr-btn--primary, .hr-app .btn-primary { background: var(--hr-gradient); border-color: transparent; box-shadow: 0 4px 14px rgba(37, 99, 235, .25); }
.hr-btn--primary:hover, .hr-app .btn-primary:hover { background: var(--hr-gradient); filter: brightness(1.06); border-color: transparent; }
.hr-btn { height: var(--hr-control-h); border-radius: var(--hr-radius-sm); }
.hr-btn--sm, .hr-app .btn-sm { height: var(--hr-control-h-sm); }

/* Cards */
.hr-card { border-color: rgba(226, 232, 240, .9); }
.hr-card--hover { transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.hr-card--hover:hover { transform: translateY(-2px); box-shadow: var(--hr-shadow-lg); border-color: rgba(6, 182, 212, .35); }
.hr-section-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--hr-muted); margin: 24px 0 10px; }
.hr-section-title:first-child { margin-top: 4px; }
.hr-launch-card__icon { width: 40px; height: 40px; border-radius: 11px; flex: 0 0 40px; display: inline-flex; align-items: center; justify-content: center; background: var(--hr-primary-soft); color: var(--hr-primary); font-size: 16px; }

/* Page guidance banner */
.hr-guide {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 12px 16px; margin: 0 0 16px;
  border-radius: var(--hr-radius); border: 1px solid rgba(6, 182, 212, .25);
  background: linear-gradient(90deg, rgba(6, 182, 212, .08), rgba(37, 99, 235, .05) 60%, transparent), var(--hr-surface);
}
.hr-guide__icon { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--hr-gradient); color: #fff; font-size: 14px; }
.hr-guide__path { font-size: 12px; color: var(--hr-muted); }
.hr-guide__title { font-weight: 600; font-size: 14px; color: var(--hr-text); }
.hr-guide__text { font-size: 13px; color: var(--hr-text-2); margin-top: 1px; }
.hr-guide__close { margin-left: auto; background: none; border: 0; color: var(--hr-muted); cursor: pointer; padding: 4px; }
.hr-guide.is-hidden { display: none; }

/* Page search (command palette) */
.hr-palette { position: fixed; inset: 0; z-index: 2000; display: none; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px; background: rgba(15, 23, 42, .45); }
.hr-palette.is-open { display: flex; }
.hr-palette__box { width: min(640px, 100%); background: var(--hr-surface); border-radius: 14px; box-shadow: var(--hr-shadow-lg); border: 1px solid var(--hr-border); overflow: hidden; }
.hr-palette__input { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--hr-border); color: var(--hr-muted); }
.hr-palette__input input { flex: 1; height: 54px; border: 0; outline: none; font: 400 16px var(--hr-font); color: var(--hr-text); background: transparent; }
.hr-palette__list { max-height: 56vh; overflow-y: auto; padding: 6px; margin: 0; list-style: none; }
.hr-palette__group { padding: 10px 10px 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--hr-muted); }
.hr-palette__item a { display: flex; gap: 12px; align-items: center; padding: 9px 10px; border-radius: 9px; color: var(--hr-text); text-decoration: none; }
.hr-palette__item a > i { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: var(--hr-surface-2); color: var(--hr-text-2); font-size: 13px; }
.hr-palette__item.is-selected a, .hr-palette__item a:hover { background: var(--hr-primary-soft); text-decoration: none; }
.hr-palette__item.is-selected a > i { background: var(--hr-gradient); color: #fff; }
.hr-palette__text { min-width: 0; }
.hr-palette__label { font-weight: 500; font-size: 14px; }
.hr-palette__desc { font-size: 12px; color: var(--hr-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hr-palette__foot { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--hr-border); font-size: 12px; color: var(--hr-muted); background: var(--hr-surface-2); }
.hr-palette__empty { padding: 26px; text-align: center; color: var(--hr-muted); }
.hr-palette mark { background: rgba(6, 182, 212, .22); color: inherit; border-radius: 3px; padding: 0 1px; }

/* Switch toggles (Access Control) */
.hr-switch { position: relative; display: inline-flex; cursor: pointer; }
.hr-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.hr-switch__track { width: 38px; height: 22px; border-radius: 999px; background: var(--hr-border-strong); position: relative; transition: background .15s; }
.hr-switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .3); transition: transform .15s; }
.hr-switch input:checked + .hr-switch__track { background: var(--hr-gradient); }
.hr-switch input:checked + .hr-switch__track::after { transform: translateX(16px); }
.hr-switch input:focus-visible + .hr-switch__track { box-shadow: var(--hr-glow); }
.hr-ac-col { width: 92px; text-align: center !important; }
.hr-ac-colhead { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; text-transform: none; letter-spacing: 0; font-size: 12.5px; }
.hr-ac-group { margin-bottom: 14px; }
.hr-card.hr-ac-group + .hr-card.hr-ac-group { margin-top: 0; }
.hr-savebar { position: sticky; bottom: 12px; z-index: 20; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 16px; margin-top: 16px; border-radius: var(--hr-radius); background: var(--hr-glass); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid var(--hr-border); box-shadow: var(--hr-shadow-lg); }
.hr-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Legacy pages get the same top bar */
body.hr-legacy > header { display: none !important; }
body.hr-legacy:not(.hr-converted) .hr-topbar { position: fixed; left: var(--hr-sidebar-w); right: 0; top: 0; z-index: 45; transition: left .15s ease; }
body.hr-legacy.hr-legacy-collapsed:not(.hr-converted) .hr-topbar { left: var(--hr-sidebar-w-collapsed); }
body.hr-legacy:not(.hr-converted) .wrapper { padding-top: var(--hr-topbar-h); }
@media (max-width: 960px) { body.hr-legacy:not(.hr-converted) .hr-topbar { left: var(--hr-sidebar-w-collapsed); } }

/* Links styled as buttons keep button colours (the generic link colour must not win) */
.hr-app a.hr-btn { color: var(--hr-text); text-decoration: none; }
.hr-app a.hr-btn--primary, .hr-app a.hr-btn--success, .hr-app a.hr-btn--danger,
.hr-app a.hr-btn--primary:hover, .hr-app a.hr-btn--success:hover, .hr-app a.hr-btn--danger:hover { color: #fff; }
.hr-app a.hr-btn--ghost { color: var(--hr-text-2); }
.hr-palette__input input:focus, .hr-palette__input input:focus-visible { outline: none; box-shadow: none; }

/* ── Dashboards & reports (components/dashboard_layout.html) ──────────── */
.hr-dashboard__filters { padding: 14px 16px; margin-bottom: 16px; }
.hr-dashboard__filters:not(:has(input:not([type=hidden]), select, textarea)) { display: none; }
.hr-dashboard__kpis:empty, .hr-dashboard__charts:empty, .hr-dashboard__report:empty { display: none; }
.hr-dashboard__charts { margin-bottom: 16px; }
.hr-chart-card { background: var(--hr-surface); border: 1px solid var(--hr-border); border-radius: var(--hr-radius); box-shadow: var(--hr-shadow); padding: 14px 16px; }
.hr-chart-card__title { margin: 0 0 10px; font-size: 14px; font-weight: 600; }
.hr-chart-card__canvas { position: relative; height: 280px; }
.hr-stat--good .hr-stat__value { color: var(--hr-success); }
.hr-stat--warn .hr-stat__value { color: var(--hr-warning); }
.hr-stat--bad  .hr-stat__value { color: var(--hr-danger); }
.hr-stat__icon { float: right; color: var(--hr-muted); font-size: 18px; }
@media print {
  .hr-dashboard__filters, .hr-guide { display: none !important; }
  .hr-chart-card { break-inside: avoid; box-shadow: none; }
}

/* ── Notification bell (top bar) ──────────────────────────────────────── */
.hr-bell { position: relative; }
.hr-bell__count { position: absolute; top: 1px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px;
  background: var(--hr-danger); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center;
  box-shadow: 0 0 0 2px var(--hr-surface); font-family: var(--hr-font); }
.hr-notice { display: flex; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--hr-border); text-decoration: none; color: inherit; }
.hr-notice:first-child { border-top: 0; }
.hr-notice:hover { background: var(--hr-surface-2); text-decoration: none; }
.hr-notice.is-unread { background: var(--hr-primary-soft); }
.hr-notice__icon { flex: 0 0 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--hr-surface-2); color: var(--hr-primary); }
.hr-notice__title { font-weight: 600; }
.hr-notice__msg { color: var(--hr-text-2); font-size: 13px; white-space: pre-line; }
.hr-notice__time { color: var(--hr-muted); font-size: 12px; margin-left: auto; white-space: nowrap; }

/* ── Task Management workspace switcher (menu) ────────────────────────── */
.hr-ws { margin: 2px 0 6px; }
.hr-ws__card { display: flex !important; align-items: center; gap: 10px; padding: 8px 10px !important; border-radius: 10px;
  background: var(--hr-sidebar-active); border: 1px solid rgba(34, 211, 238, .25); color: #fff !important; }
.hr-ws__card:hover { background: rgba(6, 182, 212, .24); text-decoration: none; }
.hr-ws__icon { flex: 0 0 28px; height: 28px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--hr-gradient); color: #fff; }
.hr-ws__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; flex: 1; }
.hr-ws__name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hr-ws__hint { font-size: 11px; color: var(--hr-sidebar-text); opacity: .8; }
html.hr-sidebar-collapsed .hr-ws__text, html.hr-sidebar-collapsed .hr-ws__card > .fa-arrows-rotate { display: none; }
