/* ==========================================================================
   Hajiree UI — design system layer
   Loaded AFTER bootstrap/adminlte/main.css so it re-skins every page.
   Tokens first; components below only use tokens.
   ========================================================================== */

:root {
  /* brand */
  --hj-primary: #2563eb;
  --hj-primary-600: #1d4ed8;
  --hj-primary-50: #eff4ff;
  --hj-primary-100: #dbe7ff;

  /* neutrals */
  --hj-ink: #0f172a;
  --hj-ink-2: #334155;
  --hj-muted: #64748b;
  --hj-faint: #94a3b8;
  --hj-line: #e5e9f0;
  --hj-line-2: #eef1f6;
  --hj-bg: #f6f8fb;
  --hj-surface: #ffffff;

  /* status */
  --hj-ok: #059669;       --hj-ok-bg: #e7f8f1;
  --hj-warn: #b45309;     --hj-warn-bg: #fff4e0;
  --hj-bad: #be123c;      --hj-bad-bg: #ffe9ee;
  --hj-info: #0369a1;     --hj-info-bg: #e5f4fd;
  --hj-violet: #6d28d9;   --hj-violet-bg: #f0e9ff;
  --hj-slate-bg: #eef1f6;

  --hj-radius: 12px;
  --hj-radius-sm: 8px;
  --hj-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);
  --hj-shadow-lg: 0 10px 30px rgba(15, 23, 42, .10);

  --hj-sidebar-w: 256px;

  /* bootstrap bridge */
  --bs-primary: var(--hj-primary);
  --bs-primary-rgb: 37, 99, 235;
  --bs-link-color: var(--hj-primary);
  --bs-link-hover-color: var(--hj-primary-600);
  --bs-body-font-family: 'Inter', 'Noto Sans Devanagari', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bs-body-color: var(--hj-ink-2);
  --bs-body-bg: var(--hj-bg);
  --bs-border-color: var(--hj-line);
  --bs-border-radius: var(--hj-radius-sm);
}

html { -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--bs-body-font-family);
  font-size: 14px;
  line-height: 1.5;
  color: var(--hj-ink-2);
  background: var(--hj-bg) !important;
}
h1, h2, h3, h4, h5, h6 { color: var(--hj-ink); font-weight: 650; letter-spacing: -.01em; }
a { text-decoration: none; }
.text-muted { color: var(--hj-muted) !important; }

/* ---------- App shell ---------- */
.app-wrapper { background: var(--hj-bg); }
.app-main { background: var(--hj-bg); padding-bottom: 2rem; }
.app-content, .app-content-header { padding-left: 1.5rem; padding-right: 1.5rem; }

.app-header {
  background: rgba(255, 255, 255, .92) !important;
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--hj-line) !important;
  box-shadow: none !important;
  min-height: 60px;
}
.app-header .nav-link { color: var(--hj-ink-2); border-radius: var(--hj-radius-sm); }
.app-header .nav-link:hover { background: var(--hj-slate-bg); color: var(--hj-ink); }

.app-footer { background: transparent; border-top: 1px solid var(--hj-line); color: var(--hj-muted); }

/* ---------- Sidebar (light) ---------- */
.app-sidebar {
  background: var(--hj-surface) !important;
  border-right: 1px solid var(--hj-line) !important;
  box-shadow: none !important;
  --lte-sidebar-width: var(--hj-sidebar-w);
}
.app-sidebar .sidebar-brand {
  height: 60px;
  border-bottom: 1px solid var(--hj-line) !important;
  background: transparent;
}
.app-sidebar .brand-link { display: flex; align-items: center; gap: .6rem; padding: 0 1.1rem; color: var(--hj-ink) !important; }
.app-sidebar .brand-image { width: 30px; height: 30px; opacity: 1 !important; box-shadow: none !important; }
.app-sidebar .brand-text { font-weight: 750 !important; font-size: 1.15rem; letter-spacing: -.02em; color: var(--hj-ink); }

.app-sidebar .sidebar-wrapper { padding: .5rem .75rem 2rem; }
.hj-nav-label {
  font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase;
  color: var(--hj-faint); padding: 1rem .75rem .35rem;
}
.app-sidebar .nav-link {
  display: flex; align-items: center; gap: .65rem;
  padding: .5rem .75rem; margin: 1px 0;
  color: var(--hj-ink-2) !important; font-weight: 500;
  border-radius: 9px; transition: background .12s, color .12s;
}
.app-sidebar .nav-link p { margin: 0; font-size: 13.5px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-sidebar .nav-link .nav-icon { width: 20px; margin: 0; font-size: 1.05rem; color: var(--hj-muted); text-align: center; flex: none; }
.app-sidebar .nav-link:hover { background: var(--hj-slate-bg); color: var(--hj-ink) !important; }
.app-sidebar .nav-link.active,
.app-sidebar .menu-open > .nav-link {
  background: var(--hj-primary-50) !important; color: var(--hj-primary-600) !important; font-weight: 600;
}
.app-sidebar .nav-link.active .nav-icon,
.app-sidebar .menu-open > .nav-link .nav-icon { color: var(--hj-primary); }
.app-sidebar .nav-treeview { padding: .15rem 0 .35rem 1.75rem; border-left: 1px solid var(--hj-line); margin-left: 1.45rem; }
.app-sidebar .nav-treeview .nav-link { padding: .38rem .7rem; font-size: 13px; font-weight: 450; }
.app-sidebar .nav-arrow { font-size: .7rem; color: var(--hj-faint); transition: transform .15s; }
.app-sidebar .nav-badge {
  background: var(--hj-bad); color: #fff; font-size: 11px; font-weight: 650;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
}

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 1.5rem 0 1.1rem; }
.page-head h1 { font-size: 1.5rem; margin: 0; }
.page-head .sub { color: var(--hj-muted); margin: .2rem 0 0; }
.page-head .actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* ---------- Cards ---------- */
.card, .hj-card {
  background: var(--hj-surface);
  border: 1px solid var(--hj-line);
  border-radius: var(--hj-radius);
  box-shadow: var(--hj-shadow);
}
.card-header { background: transparent; border-bottom: 1px solid var(--hj-line-2); padding: .9rem 1.1rem; font-weight: 650; color: var(--hj-ink); }
.card-header.bg-primary, .card-header.bg-info, .card-header.bg-success { background: transparent !important; color: var(--hj-ink) !important; }
.card-title { font-size: 1rem; font-weight: 650; color: var(--hj-ink); margin: 0; }
.card-body { padding: 1.1rem; }

/* ---------- KPI tiles ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .9rem; }
.kpi {
  display: flex; flex-direction: column; gap: .35rem; text-decoration: none; color: inherit;
  background: var(--hj-surface); border: 1px solid var(--hj-line); border-radius: var(--hj-radius);
  padding: 1rem 1.1rem; box-shadow: var(--hj-shadow); transition: transform .12s, box-shadow .12s, border-color .12s;
}
a.kpi:hover { transform: translateY(-1px); box-shadow: var(--hj-shadow-lg); border-color: var(--hj-primary-100); }
.kpi .kpi-top { display: flex; align-items: center; justify-content: space-between; color: var(--hj-muted); font-size: 12.5px; font-weight: 550; }
.kpi .kpi-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: .95rem; }
.kpi .kpi-num { font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; color: var(--hj-ink); line-height: 1.1; }
.kpi .kpi-foot { font-size: 12px; color: var(--hj-muted); }
.kpi.ok .kpi-ico { background: var(--hj-ok-bg); color: var(--hj-ok); }
.kpi.bad .kpi-ico { background: var(--hj-bad-bg); color: var(--hj-bad); }
.kpi.warn .kpi-ico { background: var(--hj-warn-bg); color: var(--hj-warn); }
.kpi.info .kpi-ico { background: var(--hj-info-bg); color: var(--hj-info); }
.kpi.violet .kpi-ico { background: var(--hj-violet-bg); color: var(--hj-violet); }
.kpi.slate .kpi-ico { background: var(--hj-slate-bg); color: var(--hj-ink-2); }

/* ---------- Status pills ---------- */
.pill { display: inline-flex; align-items: center; gap: .35rem; padding: .18rem .6rem; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.pill-ok { background: var(--hj-ok-bg); color: var(--hj-ok); }
.pill-bad { background: var(--hj-bad-bg); color: var(--hj-bad); }
.pill-warn { background: var(--hj-warn-bg); color: var(--hj-warn); }
.pill-info { background: var(--hj-info-bg); color: var(--hj-info); }
.pill-violet { background: var(--hj-violet-bg); color: var(--hj-violet); }
.pill-slate { background: var(--hj-slate-bg); color: var(--hj-ink-2); }

/* ---------- Avatar ---------- */
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: inline-grid; place-items: center;
  background: var(--hj-primary-100); color: var(--hj-primary-600); font-weight: 650; font-size: 12.5px; text-transform: uppercase;
}
.person { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.person .nm { font-weight: 600; color: var(--hj-ink); line-height: 1.2; }
.person .sm { font-size: 12px; color: var(--hj-muted); }

/* ---------- Tables ---------- */
.table { --bs-table-bg: transparent; color: var(--hj-ink-2); margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .7rem .9rem; border-bottom-color: var(--hj-line-2); vertical-align: middle; }
.table thead th {
  background: #fafbfd; color: var(--hj-muted); font-size: 11.5px; font-weight: 650;
  text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--hj-line); white-space: nowrap;
}
.table-hover > tbody > tr:hover > * { background: #f8faff; }
.table-responsive { border-radius: var(--hj-radius); }

/* ---------- Buttons ---------- */
.btn { border-radius: 9px; font-weight: 550; padding: .45rem .9rem; font-size: 13.5px; }
.btn-sm { padding: .3rem .65rem; font-size: 12.5px; border-radius: 8px; }
.btn-primary { background: var(--hj-primary); border-color: var(--hj-primary); }
.btn-primary:hover, .btn-primary:focus { background: var(--hj-primary-600); border-color: var(--hj-primary-600); }
.btn-info { background: var(--hj-primary); border-color: var(--hj-primary); color: #fff; }
.btn-info:hover { background: var(--hj-primary-600); border-color: var(--hj-primary-600); color: #fff; }
.btn-outline-secondary, .btn-default { background: var(--hj-surface); border: 1px solid var(--hj-line); color: var(--hj-ink-2); }
.btn-outline-secondary:hover, .btn-default:hover { background: var(--hj-slate-bg); color: var(--hj-ink); border-color: var(--hj-line); }
.btn-success { background: var(--hj-ok); border-color: var(--hj-ok); }
.btn-danger { background: var(--hj-bad); border-color: var(--hj-bad); }
.btn-icon { width: 32px; height: 32px; padding: 0; display: inline-grid; place-items: center; }

/* ---------- Forms ---------- */
.form-label { font-weight: 550; color: var(--hj-ink-2); font-size: 13px; margin-bottom: .3rem; }
.form-control, .form-select {
  border-radius: 9px; border-color: var(--hj-line); padding: .5rem .75rem; font-size: 14px; background-color: var(--hj-surface); color: var(--hj-ink);
}
.form-control:focus, .form-select:focus { border-color: var(--hj-primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
.form-text, .help-text { color: var(--hj-muted); font-size: 12px; }
.select2-container--bootstrap-5 .select2-selection { border-radius: 9px !important; border-color: var(--hj-line) !important; min-height: 38px; }
.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5.select2-container--open .select2-selection { border-color: var(--hj-primary) !important; box-shadow: 0 0 0 3px rgba(37, 99, 235, .15) !important; }

/* ---------- Filter bar (replaces six stacked dropdowns) ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; padding: .85rem 1.1rem; border-bottom: 1px solid var(--hj-line-2); }
.filter-bar .search { position: relative; flex: 1 1 260px; max-width: 360px; }
.filter-bar .search i { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--hj-faint); }
.filter-bar .search input { padding-left: 2.2rem; }
.filter-bar .form-select { width: auto; min-width: 150px; }

/* ---------- Badges / alerts ---------- */
.badge { font-weight: 600; border-radius: 999px; padding: .3em .65em; }
.alert { border-radius: var(--hj-radius-sm); border: 1px solid transparent; }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--hj-muted); }
.empty-state .ico { width: 56px; height: 56px; border-radius: 16px; background: var(--hj-primary-50); color: var(--hj-primary); display: inline-grid; place-items: center; font-size: 1.5rem; margin-bottom: .9rem; }
.empty-state h3 { font-size: 1.05rem; margin-bottom: .25rem; }
.empty-state p { max-width: 380px; margin: 0 auto 1rem; }

/* ---------- Toasts (alertify) ---------- */
.ajs-message { border-radius: 10px !important; box-shadow: var(--hj-shadow-lg) !important; font-weight: 550; }
.ajs-message.ajs-success { background: #059669 !important; }
.ajs-message.ajs-error { background: #be123c !important; }
.ajs-message.ajs-warning { background: #b45309 !important; }

/* ---------- Pagination ---------- */
.page-link { border-radius: 8px !important; margin: 0 2px; border-color: var(--hj-line); color: var(--hj-ink-2); }
.page-item.active .page-link { background: var(--hj-primary); border-color: var(--hj-primary); }

/* ---------- Misc ---------- */
.dropdown-menu { border: 1px solid var(--hj-line); border-radius: var(--hj-radius-sm); box-shadow: var(--hj-shadow-lg); }
.nav-tabs { border-bottom-color: var(--hj-line); }
.nav-tabs .nav-link { color: var(--hj-muted); font-weight: 550; border: 0; border-bottom: 2px solid transparent; }
.nav-tabs .nav-link.active { color: var(--hj-primary-600); border-bottom-color: var(--hj-primary); background: transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d3dae6; border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }

@media (max-width: 991.98px) {
  .app-content, .app-content-header { padding-left: 1rem; padding-right: 1rem; }
  .page-head h1 { font-size: 1.3rem; }
}

/* ==========================================================================
   Shared screen layer (restyle pass): lists, forms, reports, auth, errors.
   Legacy markup (card-header.bg-light, table-bordered, badge bg-*, btn-action)
   is re-skinned here so every old screen picks up the system look, and new
   templates use the explicit .hj-* components below.
   ========================================================================== */

/* page wrapper used by restyled screens */
.hj-page { padding: 0 1.5rem 2rem; }
.hj-page.narrow { max-width: 860px; margin: 0 auto; }
.hj-page.medium { max-width: 1080px; margin: 0 auto; }
.hj-page .page-head { margin-top: 1.25rem; }
.page-head .crumbs { font-size: 12.5px; color: var(--hj-muted); margin-bottom: .2rem; }
.page-head .crumbs a { color: var(--hj-muted); }
.page-head .crumbs a:hover { color: var(--hj-primary); }

/* tables: .hj-table is the explicit class; legacy .table inside cards gets the same treatment */
.hj-table, .card .table, .report-table { --bs-table-bg: transparent; font-size: 13.5px; }
.hj-table > :not(caption) > * > * { padding: .7rem .9rem; border-bottom-color: var(--hj-line-2); vertical-align: middle; }
.hj-table thead th, .card .table thead th, .report-table thead th {
  background: #fafbfd; color: var(--hj-muted); font-size: 11.5px; font-weight: 650;
  text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--hj-line); white-space: nowrap;
}
.hj-table tbody tr:hover > * { background: #f8faff; }
.hj-table .num, .report-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.hj-table .mono { font-variant-numeric: tabular-nums; }
.hj-table tfoot td, .hj-table tfoot th { background: #fafbfd; font-weight: 650; color: var(--hj-ink); border-top: 1px solid var(--hj-line); }
.card .table-bordered > :not(caption) > * { border-width: 0 0 1px; }
.card .table-bordered > :not(caption) > * > * { border-width: 0 0 1px; }
.card .table-bordered { border: 0; }
.card .table-sm > :not(caption) > * > * { padding: .6rem .9rem; }
.table-light, .table > thead.table-light > tr > *, .table > .table-light > * { --bs-table-bg: #fafbfd; --bs-table-color: var(--hj-muted); }
.hj-table td.actions, .hj-table th.actions { text-align: right; white-space: nowrap; width: 1%; }

/* legacy card header variants -> flat header */
.card-header.bg-light, .card-header.bg-white, .card-header.bg-secondary, .card-header.bg-dark,
.card-header.bg-warning, .card-header.bg-danger { background: transparent !important; color: var(--hj-ink) !important; }
.card-header h5, .card-header h6 { margin: 0; font-size: 1rem; }
.card-header .card-title { color: var(--hj-ink); }
.card-footer { background: transparent; border-top: 1px solid var(--hj-line-2); }
.hj-card-title { font-size: .95rem; font-weight: 650; color: var(--hj-ink); display: flex; align-items: center; gap: .5rem; }
.hj-card-title i { color: var(--hj-primary); }

/* soft badges: bootstrap solid badges -> status pill look */
.badge.bg-success, .badge.text-bg-success { background: var(--hj-ok-bg) !important; color: var(--hj-ok) !important; }
.badge.bg-danger, .badge.text-bg-danger { background: var(--hj-bad-bg) !important; color: var(--hj-bad) !important; }
.badge.bg-warning, .badge.text-bg-warning { background: var(--hj-warn-bg) !important; color: var(--hj-warn) !important; }
.badge.bg-info, .badge.text-bg-info { background: var(--hj-info-bg) !important; color: var(--hj-info) !important; }
.badge.bg-primary, .badge.text-bg-primary { background: var(--hj-primary-50) !important; color: var(--hj-primary-600) !important; }
.badge.bg-secondary, .badge.text-bg-secondary, .badge.bg-dark, .badge.text-bg-dark, .badge.bg-light, .badge.text-bg-light { background: var(--hj-slate-bg) !important; color: var(--hj-ink-2) !important; }

/* row action buttons (btn-action) in the system look */
.btn-action { width: 32px !important; height: 32px !important; border-radius: 8px !important; border: 1px solid var(--hj-line) !important; background: var(--hj-surface) !important; color: var(--hj-ink-2) !important; }
.btn-action:hover { background: var(--hj-slate-bg) !important; color: var(--hj-ink) !important; }
.btn-action-edit:hover, .btn-action-view:hover { color: var(--hj-primary) !important; border-color: var(--hj-primary-100) !important; background: var(--hj-primary-50) !important; }
.btn-action-delete { color: var(--hj-bad) !important; }
.btn-action-delete:hover { background: var(--hj-bad-bg) !important; color: var(--hj-bad) !important; }
.btn-action-send { color: var(--hj-violet) !important; }
.btn-action-send:hover { background: var(--hj-violet-bg) !important; }
.btn-outline-primary { color: var(--hj-primary); border-color: var(--hj-primary-100); }
.btn-outline-primary:hover { background: var(--hj-primary); border-color: var(--hj-primary); }
.btn-outline-danger { border-color: #f6c7d1; }
.btn-outline-success { border-color: #b8e6d3; }
.btn-warning { background: var(--hj-warn-bg); border-color: var(--hj-warn-bg); color: var(--hj-warn); }
.btn-warning:hover { background: #ffe8c2; color: var(--hj-warn); border-color: #ffe8c2; }
.btn-secondary { background: var(--hj-slate-bg); border-color: var(--hj-slate-bg); color: var(--hj-ink-2); }
.btn-secondary:hover { background: #e2e7ef; border-color: #e2e7ef; color: var(--hj-ink); }
.btn-link { color: var(--hj-muted); }
.btn-link:hover { color: var(--hj-primary); }

/* segmented status tabs (replaces the multicolor btn-group status filters) */
.hj-seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--hj-slate-bg); border-radius: 10px; }
.hj-seg a { padding: .3rem .8rem; border-radius: 8px; font-size: 13px; font-weight: 550; color: var(--hj-ink-2); }
.hj-seg a:hover { color: var(--hj-ink); }
.hj-seg a.on { background: var(--hj-surface); color: var(--hj-primary-600); box-shadow: var(--hj-shadow); }

/* filter bar variants */
.filter-bar .spacer { flex: 1; }
.filter-bar .form-control, .filter-bar .form-select { width: auto; min-width: 140px; }
.filter-bar .search .form-control { width: 100%; }
.filter-bar label.fl { display: flex; align-items: center; gap: .4rem; font-size: 12.5px; color: var(--hj-muted); margin: 0; }
.hj-filter-panel { padding: 1rem 1.1rem; border-bottom: 1px solid var(--hj-line-2); background: #fcfdff; border-radius: var(--hj-radius) var(--hj-radius) 0 0; }
.hj-filter-panel .form-label { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--hj-muted); }

/* forms */
.hj-form .form-section { margin-bottom: 1.25rem; }
.hj-form .form-section > h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--hj-muted); font-weight: 650; margin: 0 0 .75rem; padding-bottom: .5rem; border-bottom: 1px solid var(--hj-line-2); }
.hj-form .form-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--hj-line-2); }
.hj-req, .form-label .req { color: var(--hj-bad); font-weight: 700; margin-left: .15rem; }
label.required::after, .form-label.required::after { content: ' *'; color: var(--hj-bad); font-weight: 700; }
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--hj-bad) !important; }
.errorlist { list-style: none; padding: 0; margin: .25rem 0 0; color: var(--hj-bad); font-size: 12.5px; }
.invalid-feedback { color: var(--hj-bad); font-size: 12.5px; }
.form-check-input:checked { background-color: var(--hj-primary); border-color: var(--hj-primary); }

/* report summary strip */
.hj-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.hj-stat { background: var(--hj-surface); border: 1px solid var(--hj-line); border-radius: var(--hj-radius); padding: .8rem 1rem; box-shadow: var(--hj-shadow); }
.hj-stat .l { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--hj-muted); font-weight: 650; }
.hj-stat .v { font-size: 1.5rem; font-weight: 700; color: var(--hj-ink); line-height: 1.15; font-variant-numeric: tabular-nums; }
.hj-stat .n { font-size: 12px; color: var(--hj-muted); }
.stat-value { color: var(--hj-ink); }

/* key/value detail list */
.hj-dl { display: grid; grid-template-columns: minmax(120px, 200px) 1fr; gap: .5rem 1rem; margin: 0; }
.hj-dl dt { color: var(--hj-muted); font-weight: 550; font-size: 13px; }
.hj-dl dd { margin: 0; color: var(--hj-ink); }

/* auth layout */
.hj-auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--hj-bg); }
.hj-auth-aside { background: linear-gradient(145deg, #1e3a8a 0%, #2563eb 60%, #3b82f6 100%); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; }
.hj-auth-aside h2 { color: #fff; font-size: 2rem; line-height: 1.2; max-width: 16ch; }
.hj-auth-aside p { color: rgba(255,255,255,.82); max-width: 40ch; }
.hj-auth-aside ul { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .6rem; }
.hj-auth-aside li { display: flex; gap: .6rem; align-items: center; color: rgba(255,255,255,.92); }
.hj-auth-aside li i { width: 26px; height: 26px; border-radius: 8px; background: rgba(255,255,255,.16); display: grid; place-items: center; font-size: .8rem; }
.hj-auth-brand { display: flex; align-items: center; gap: .6rem; font-weight: 750; font-size: 1.3rem; color: #fff; letter-spacing: -.02em; }
.hj-auth-brand img { width: 34px; height: 34px; }
.hj-auth-main { display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; }
.hj-auth-card { width: 100%; max-width: 410px; }
.hj-auth-card.wide { max-width: 760px; }
.hj-auth-card .mob-brand { display: none; align-items: center; gap: .5rem; font-weight: 750; font-size: 1.2rem; color: var(--hj-ink); margin-bottom: 1.5rem; }
.hj-auth-card .mob-brand img { width: 30px; height: 30px; }
.hj-auth-card h1 { font-size: 1.5rem; margin-bottom: .25rem; }
.hj-auth-card .lead-sub { color: var(--hj-muted); margin-bottom: 1.5rem; }
.hj-auth-card .form-control { padding: .65rem .85rem; }
.hj-auth-card .btn-lg { padding: .65rem 1rem; font-size: 14.5px; }
.hj-auth-foot { margin-top: 1.25rem; text-align: center; color: var(--hj-muted); font-size: 13px; }
.hj-pw { position: relative; }
.hj-pw .form-control { padding-right: 2.6rem; }
.hj-pw button { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--hj-muted); width: 34px; height: 34px; }

/* error pages */
.hj-error { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 2rem 1rem; }
.hj-error .code { font-size: 5rem; font-weight: 800; letter-spacing: -.04em; color: var(--hj-primary-100); line-height: 1; }
.hj-error h1 { font-size: 1.4rem; margin: .5rem 0 .4rem; }
.hj-error p { color: var(--hj-muted); max-width: 42ch; margin: 0 auto 1.25rem; }
.hj-error.standalone { min-height: 100vh; background: var(--hj-bg); }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .hj-auth { grid-template-columns: 1fr; }
  .hj-auth-aside { display: none; }
  .hj-auth-card .mob-brand { display: flex; }
}
@media (max-width: 767.98px) {
  .app-content, .app-content-header, .hj-page { padding-left: .85rem; padding-right: .85rem; }
  .page-head { align-items: flex-start; }
  .page-head h1 { font-size: 1.3rem; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1 1 auto; }
  .filter-bar .search { max-width: none; flex-basis: 100%; }
  .filter-bar .form-select, .filter-bar .form-control { flex: 1 1 140px; width: 100%; }
  .hj-dl { grid-template-columns: 1fr; gap: .15rem; }
  .hj-dl dd { margin-bottom: .6rem; }
  .card-body { padding: .9rem; }
  .table-responsive { -webkit-overflow-scrolling: touch; }
  .container-fluid.px-0 > .p-4, .container-fluid.px-0 > .p-3, .container-fluid > .p-4 { padding: .85rem !important; }
}

/* ==========================================================================
   reports batch
   ========================================================================== */
.hj-table.sticky-first thead th:first-child,
.hj-table.sticky-first tbody td:first-child { position: sticky; left: 0; z-index: 2; background: var(--hj-surface, #fff); box-shadow: 1px 0 0 var(--hj-line-2); }
.hj-table.sticky-first thead th:first-child { z-index: 3; background: #fafbfd; }
.hj-table.sticky-first tbody tr:hover > td:first-child { background: #f8faff; }
.report-table .badge.rounded-pill { font-weight: 600; font-size: 12px; padding: .3rem .65rem; }
.report-table .badge.rounded-pill.border { border-color: transparent !important; }
.hj-page .hj-stats + .card, .hj-page .card + .hj-stats { margin-top: 0; }
@media (max-width: 767.98px) {
  .hj-page { padding-left: .85rem; padding-right: .85rem; }
  .hj-filter-panel .btn { flex: 1 1 auto; }
}

/* ==========================================================================
   Batch A+B (application + posting screens)
   ========================================================================== */
.day-chip { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--hj-line); border-radius: 999px;
  padding: .2rem .7rem; margin: .15rem .15rem .15rem 0; font-size: 12.5px; background: var(--hj-surface); cursor: pointer; }
.day-chip:hover { border-color: var(--hj-primary-100); background: var(--hj-primary-50); }
.day-chip input { margin: 0; }
.emp-card .card-header { background: #fafbfd !important; }
.hj-table td .btn-icon + .btn-icon { margin-left: .25rem; }

/* duty roster grid (posting/duty_roster/duty_roster_list.html) */
#roster-table th { text-align: center; padding: .5rem .35rem; }
#roster-table th[rowspan] { text-align: left; }
#roster-table td:not(.roster-cell) { white-space: nowrap; }
.roster-cell .cell-inner { min-width: 44px; max-width: 110px; text-align: center; }
.roster-cell { vertical-align: middle !important; min-width: 46px; }
.roster-cell.has-entry { background: #f6f8fc !important; }
.roster-cell .cell-inner { min-height: 26px; display: flex; align-items: center; justify-content: center; font-size: 0.78em; }
.roster-cell.editable { cursor: pointer; }
.roster-cell.editable:hover { outline: 2px solid var(--hj-primary); outline-offset: -2px; }
.roster-cell .add-plus { font-size: 1.1em; opacity: 0.4; }
.roster-cell.editable:hover .add-plus { opacity: 1; }

/* ==========================================================================
   Batch: salary / leave allocation / inbox / master setup / file manager
   ========================================================================== */

/* settings rows (master setup): label + help left, control right */
.set-row { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(200px, 1fr); gap: .5rem 1.5rem; align-items: center; padding: .85rem 0; border-bottom: 1px solid var(--hj-line-2); }
.set-row:last-child { border-bottom: 0; }
.set-row .lbl .form-label { font-weight: 600; color: var(--hj-ink); font-size: 13.5px; }
.set-row .lbl .form-text { margin: .1rem 0 0; }
.set-row .ctl .form-control, .set-row .ctl .form-select { max-width: 280px; }
.set-row .ctl.form-switch { padding-left: 2.5em; }
.set-row .ctl-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; }
.set-row .ctl-split .form-control, .set-row .ctl-split .form-select { max-width: none; }
.hj-savebar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: .5rem; padding: .75rem 1rem; margin-top: 1rem; background: rgba(255,255,255,.94); backdrop-filter: blur(6px); border: 1px solid var(--hj-line); border-radius: var(--hj-radius); box-shadow: var(--hj-shadow-lg); }
.hj-savebar .spacer { flex: 1; }
@media (max-width: 767.98px) {
  .set-row { grid-template-columns: minmax(0, 1fr); }
  .set-row .ctl .select2-container { width: 100% !important; }
  .set-row .ctl .form-control, .set-row .ctl .form-select { max-width: none; }
}

/* tables that collapse to stacked cards on phones (use data-label on each td) */
.hj-tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; white-space: nowrap; }
.hj-tabs .nav-link .pill { margin-left: .25rem; padding: .05rem .5rem; }
.hj-tabs .nav-link .pill::before { display: none; }
.inbox-decide { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; }
.hj-table.stack td.reason { max-width: 240px; white-space: normal; }
@media (max-width: 767.98px) {
  .hj-table.stack thead { display: none; }
  .hj-table.stack, .hj-table.stack tbody, .hj-table.stack tr, .hj-table.stack td { display: block; width: 100%; }
  .hj-table.stack tr { padding: .75rem .9rem; border-bottom: 1px solid var(--hj-line); }
  .hj-table.stack td { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .2rem 0; border: 0; text-align: right; white-space: normal; }
  .hj-table.stack td::before { content: attr(data-label); flex: none; color: var(--hj-muted); font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; text-align: left; }
  .hj-table.stack td.decide { display: block; padding-top: .6rem; text-align: left; }
  .hj-table.stack td.decide::before { content: none; }
  .hj-table.stack td.reason { max-width: none; }
}

/* empty state inside a table: stay centred in the viewport when the table scrolls horizontally on phones */
@media (max-width: 767.98px) {
  .hj-table td.p-0 > .empty-state { position: sticky; left: 0; width: calc(100vw - 1.95rem); }
}

/* ==========================================================================
   analytics  (HJCharts widgets, tiles, filter bar, dashboard grid)
   Owner: W2 chart layer. Mobile-first; checked at 390px and 1440px, light + dark.
   Docs: docs/attendance-platform/15-chart-components.md
   ========================================================================== */
:root {
  /* colour-blind-safe categorical palette (Okabe-Ito based) */
  --hj-c1: #0072B2; --hj-c2: #E69F00; --hj-c3: #009E73; --hj-c4: #CC79A7;
  --hj-c5: #56B4E9; --hj-c6: #D55E00; --hj-c7: #8C7F00; --hj-c8: #6B7280;
  /* product-wide meaning of colour: same hues on every chart, tile, pill and calendar */
  --hj-sem-present: #009E73; --hj-sem-late: #E69F00; --hj-sem-absent: #D55E00; --hj-sem-leave: #0072B2;
  --hj-sem-holiday: #CC79A7; --hj-sem-overtime: #56B4E9; --hj-sem-wfh: #6A5ACD; --hj-sem-official: #8C7F00;
  --hj-sem-off: #94A3B8; --hj-sem-halfday: #B45309;
  --hj-grid: rgba(100, 116, 139, .18);
}
/* dark: opt in with data-bs-theme="dark" (Bootstrap 5.3 convention), data-theme="dark" or html.hj-dark */
[data-bs-theme="dark"], [data-theme="dark"], html.hj-dark {
  color-scheme: dark;
  --hj-primary: #6ea0ff; --hj-primary-600: #9dbdff; --hj-primary-50: #16233f; --hj-primary-100: #1f3358;
  --hj-ink: #f1f5f9; --hj-ink-2: #cbd5e1; --hj-muted: #94a3b8; --hj-faint: #64748b;
  --hj-line: #263244; --hj-line-2: #1d2738; --hj-bg: #0b1220; --hj-surface: #111a2b;
  --hj-ok: #34d399; --hj-ok-bg: #0f2e25; --hj-warn: #fbbf24; --hj-warn-bg: #33270c;
  --hj-bad: #fb7185; --hj-bad-bg: #3a1620; --hj-info: #38bdf8; --hj-info-bg: #0c2a3a;
  --hj-violet: #a78bfa; --hj-violet-bg: #251c45; --hj-slate-bg: #1a2436;
  --hj-shadow: 0 1px 2px rgba(0, 0, 0, .35); --hj-shadow-lg: 0 10px 30px rgba(0, 0, 0, .5);
  --hj-c1: #4DA3E8; --hj-c2: #F0B429; --hj-c3: #19C39A; --hj-c4: #E39BC4;
  --hj-c5: #7CCBF2; --hj-c6: #F0793A; --hj-c7: #D4C23A; --hj-c8: #9CA3AF;
  --hj-sem-present: #19C39A; --hj-sem-late: #F0B429; --hj-sem-absent: #F0793A; --hj-sem-leave: #4DA3E8;
  --hj-sem-holiday: #E39BC4; --hj-sem-overtime: #7CCBF2; --hj-sem-wfh: #9C8CF0; --hj-sem-official: #D4C23A;
  --hj-sem-off: #7C8AA0; --hj-sem-halfday: #E0903A;
  --hj-grid: rgba(148, 163, 184, .18);
}

.hj-plot { position: relative; }
.hj-datatable.hj-sr { display: block; }
.hj-sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hj-muted { color: var(--hj-muted); }
.hj-noscroll { overflow: hidden; }

/* buttons / links used inside widgets */
.hj-btn { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--hj-primary); background: var(--hj-primary); color: #fff; border-radius: var(--hj-radius-sm); padding: .4rem .8rem; font-weight: 600; font-size: 13px; line-height: 1.2; cursor: pointer; text-decoration: none; }
.hj-btn:hover { background: var(--hj-primary-600); color: #fff; }
[data-bs-theme="dark"] .hj-btn, [data-theme="dark"] .hj-btn, html.hj-dark .hj-btn { color: #0b1220; }
[data-bs-theme="dark"] .hj-btn--ghost, [data-theme="dark"] .hj-btn--ghost, html.hj-dark .hj-btn--ghost { color: var(--hj-ink-2); }
.hj-btn--sm { padding: .28rem .6rem; font-size: 12.5px; }
.hj-btn--ghost { background: transparent; color: var(--hj-ink-2); border-color: var(--hj-line); }
.hj-btn--ghost:hover { background: var(--hj-slate-bg); color: var(--hj-ink); }
.hj-link { background: none; border: 0; padding: 0; color: var(--hj-primary); font-size: 12.5px; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.hj-iconbtn { width: 44px; height: 44px; display: inline-grid; place-items: center; border: 0; background: transparent; border-radius: var(--hj-radius-sm); color: var(--hj-muted); cursor: pointer; }
.hj-iconbtn:hover, .hj-iconbtn[aria-expanded="true"] { background: var(--hj-slate-bg); color: var(--hj-ink); }
.hj-widget :focus-visible, .hj-filterbar :focus-visible, .hj-customize :focus-visible { outline: 2px solid var(--hj-primary); outline-offset: 2px; }

/* ---------- grid ---------- */
.hj-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: .9rem; align-items: start; }
.hj-grid > .hj-cell, .hj-grid > .hj-widget { grid-column: span 12; min-width: 0; }
.hj-cell[hidden] { display: none; }
.hj-cell > .hj-widget { height: 100%; }
@media (min-width: 576px) { .hj-grid > .hj-cell { grid-column: span var(--hj-span-md, 6); } .hj-grid > .hj-widget { grid-column: span min(var(--hj-span, 6), 12); } }
@media (min-width: 992px) { .hj-grid > .hj-cell { grid-column: span var(--hj-span, 6); } }
.hj-grid-tools { display: flex; justify-content: flex-end; margin-bottom: .6rem; }
.hj-customize { position: relative; }
.hj-customize > summary { list-style: none; cursor: pointer; }
.hj-customize > summary::-webkit-details-marker { display: none; }
.hj-customize-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: min(320px, calc(100vw - 2rem)); max-height: 60vh; overflow: auto; background: var(--hj-surface); border: 1px solid var(--hj-line); border-radius: var(--hj-radius); box-shadow: var(--hj-shadow-lg); padding: .75rem; display: grid; gap: .1rem; }
.hj-customize-item { display: flex; gap: .55rem; align-items: center; padding: .4rem .25rem; font-size: 13px; min-height: 36px; }

/* ---------- widget card ---------- */
.hj-widget { position: relative; background: var(--hj-surface); border: 1px solid var(--hj-line); border-radius: var(--hj-radius); box-shadow: var(--hj-shadow); color: var(--hj-ink-2); padding: .85rem 1rem 0; display: flex; flex-direction: column; min-width: 0; }
.hj-w-head { display: flex; align-items: flex-start; gap: .5rem; }
.hj-w-titles { flex: 1; min-width: 0; padding-top: .15rem; }
.hj-w-title { margin: 0; font-size: .95rem; font-weight: 650; color: var(--hj-ink); line-height: 1.3; }
.hj-w-sub { margin: .1rem 0 0; font-size: 12px; color: var(--hj-muted); }
.hj-w-actions { display: flex; align-items: center; margin: -.3rem -.45rem 0 0; }
.hj-w-menuwrap { position: relative; }
.hj-w-menu { position: absolute; right: 0; top: calc(100% - 2px); z-index: 30; min-width: 190px; background: var(--hj-surface); border: 1px solid var(--hj-line); border-radius: var(--hj-radius-sm); box-shadow: var(--hj-shadow-lg); padding: .3rem; display: grid; }
.hj-w-menu[hidden] { display: none; }
.hj-w-menu button, .hj-w-menu a { display: flex; align-items: center; gap: .55rem; width: 100%; text-align: left; border: 0; background: transparent; color: var(--hj-ink-2); padding: .55rem .65rem; min-height: 40px; border-radius: 6px; font-size: 13px; text-decoration: none; cursor: pointer; }
.hj-w-menu button:hover, .hj-w-menu a:hover { background: var(--hj-slate-bg); color: var(--hj-ink); }
.hj-w-kpi { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem .7rem; margin: .35rem 0 .1rem; }
.hj-w-kpi[hidden] { display: none; }
.hj-kpi-value { font-size: 1.9rem; line-height: 1.1; font-weight: 700; letter-spacing: -.02em; color: var(--hj-ink); font-variant-numeric: tabular-nums; }
.hj-kpi-caption { flex-basis: 100%; font-size: 12px; color: var(--hj-muted); }
.hj-kpi-spark { margin-left: auto; width: 84px; height: 26px; }
.hj-w-filters:empty { display: none; }
.hj-w-filters { margin-top: .5rem; }
.hj-w-body { position: relative; flex: 1; min-height: 80px; margin-top: .5rem; }
.hj-w-plot { position: relative; }
.hj-w-plot[hidden], .hj-w-state[hidden] { display: none; }
.hj-w-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .6rem 0 .7rem; margin-top: .4rem; border-top: 1px solid var(--hj-line-2); font-size: 11.5px; color: var(--hj-muted); }
.hj-asof[hidden] { display: none; }
.hj-w-more { color: var(--hj-primary); font-weight: 600; text-decoration: none; margin-left: auto; white-space: nowrap; }
.hj-w-more:hover { text-decoration: underline; }
.hj-badge { flex: none; display: inline-flex; align-items: center; gap: .3rem; font-size: 11px; font-weight: 650; padding: .15rem .5rem; border-radius: 999px; background: var(--hj-info-bg); color: var(--hj-info); margin-top: .2rem; }
.hj-badge[hidden] { display: none; }
.hj-badge.is-warn { background: var(--hj-warn-bg); color: var(--hj-warn); }
.hj-widget.is-loading::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--hj-primary), transparent); background-size: 40% 100%; background-repeat: no-repeat; animation: hj-bar 1.1s linear infinite; }
@keyframes hj-bar { from { background-position: -40% 0; } to { background-position: 140% 0; } }

/* expand to fullscreen */
.hj-widget.is-expanded { position: fixed; inset: 0; z-index: 1080; border-radius: 0; padding: 1rem 1.25rem 0; overflow: auto; box-shadow: none; }
.hj-widget.is-expanded .hj-w-body { min-height: 60vh; }
.hj-widget.is-expanded .hj-canvas-box { height: calc(100vh - 220px) !important; }
@media (min-width: 992px) { .hj-widget.is-expanded { inset: 3vh 4vw; border-radius: var(--hj-radius); box-shadow: 0 0 0 100vmax rgba(15, 23, 42, .55), var(--hj-shadow-lg); } }

/* ---------- KPI tile ---------- */
.hj-tile { padding: .8rem 1rem .85rem; transition: transform .12s, box-shadow .12s, border-color .12s; }
.hj-tile:has(.hj-tile-link):hover { transform: translateY(-1px); box-shadow: var(--hj-shadow-lg); border-color: var(--hj-primary-100); }
.hj-tile-top { display: flex; align-items: center; justify-content: space-between; gap: .4rem; }
.hj-tile-label { margin: 0; font-size: 12.5px; font-weight: 600; color: var(--hj-muted); }
.hj-tile .hj-w-kpi { margin: .25rem 0 0; }
.hj-tile .hj-kpi-value { font-size: 1.75rem; }
.hj-tile-body { min-height: 0; margin-top: 0; }
.hj-tile-body .hj-w-state { padding: .15rem 0; min-height: 0; flex-direction: row; justify-content: flex-start; text-align: left; gap: .4rem; }
.hj-tile-body .hj-state-icon { font-size: .9rem; }
.hj-tile-body .hj-state-msg { font-size: 12px; margin: 0; }
.hj-tile-asof { display: block; margin-top: .35rem; font-size: 11px; color: var(--hj-faint); }
.hj-tile-link { position: absolute; inset: 0; border-radius: inherit; z-index: 1; }
.hj-tile-link:focus-visible { outline: 2px solid var(--hj-primary); outline-offset: 2px; }

/* delta chip: arrow + sign + text, colour is never the only signal */
.hj-delta { display: inline-flex; align-items: center; gap: .25rem; padding: .12rem .5rem; border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--hj-slate-bg); color: var(--hj-ink-2); font-variant-numeric: tabular-nums; }
.hj-delta.is-good { background: var(--hj-ok-bg); color: var(--hj-ok); }
.hj-delta.is-bad { background: var(--hj-bad-bg); color: var(--hj-bad); }
.hj-delta-arrow { font-size: .65rem; }

/* ---------- states ---------- */
.hj-w-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; min-height: 140px; padding: 1rem; text-align: center; color: var(--hj-muted); }
.hj-state-icon { font-size: 1.6rem; line-height: 1; color: var(--hj-faint); }
.hj-w-state.is-error .hj-state-icon { color: var(--hj-bad); }
.hj-state-msg { margin: 0; font-size: 13px; max-width: 28ch; }
.hj-skel { width: 100%; display: grid; gap: .6rem; }
.hj-skel > span { display: block; height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--hj-line-2) 25%, var(--hj-line) 37%, var(--hj-line-2) 63%); background-size: 400% 100%; animation: hj-shimmer 1.4s ease infinite; }
.hj-skel > span:nth-child(1) { width: 40%; } .hj-skel > span:nth-child(2) { height: 90px; } .hj-skel > span:nth-child(3) { width: 70%; }
@keyframes hj-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) {
  .hj-skel > span, .hj-widget.is-loading::after { animation: none; }
  .hj-tile, .hj-tile:has(.hj-tile-link):hover { transition: none; transform: none; }
}

/* ---------- plots ---------- */
.hj-plot-inner[hidden] { display: none; }
.hj-canvas-box { position: relative; height: var(--hj-h, 260px); width: 100%; }
.hj-canvas { display: block; }
.hj-datatable-visible { position: static !important; width: auto !important; height: auto !important; margin: 0 !important; clip: auto !important; overflow: auto; white-space: normal; display: block; max-height: 340px; font-size: 12.5px; }
.hj-datatable-visible th, .hj-datatable-visible td { padding: .3rem .6rem; border-bottom: 1px solid var(--hj-line-2); text-align: right; }
.hj-datatable-visible th:first-child, .hj-datatable-visible td:first-child { text-align: left; }
.hj-datatable-visible caption { color: var(--hj-muted); text-align: left; }

.hj-legend { list-style: none; margin: .6rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem .9rem; font-size: 12px; color: var(--hj-ink-2); }
.hj-legend-item { display: inline-flex; align-items: center; gap: .35rem; }
.hj-swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.hj-legend-val { font-weight: 650; color: var(--hj-ink); font-variant-numeric: tabular-nums; }

.hj-ring-wrap { position: relative; width: min(100%, 190px); margin: 0 auto; aspect-ratio: 1; }
.hj-ring { width: 100%; height: 100%; display: block; }
.hj-ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; }
.hj-ring-num { font-size: 1.7rem; font-weight: 700; color: var(--hj-ink); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hj-ring-sub { font-size: 11.5px; color: var(--hj-muted); }
.hj-plot--ring .hj-legend { justify-content: center; }
.hj-gauge-wrap { width: min(100%, 260px); margin: 0 auto; text-align: center; }
.hj-gauge { width: 100%; height: auto; display: block; }
.hj-gauge-val { font-size: 1.6rem; font-weight: 700; color: var(--hj-ink); margin-top: -.9rem; font-variant-numeric: tabular-nums; }
.hj-gauge-sub { font-size: 12px; color: var(--hj-muted); }

.hj-heat-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.hj-heat { border-collapse: separate; border-spacing: 2px; width: 100%; font-size: 11.5px; }
.hj-heat th { font-weight: 600; color: var(--hj-muted); padding: .2rem .35rem; white-space: nowrap; text-align: center; }
.hj-heat th.hj-heat-row { text-align: left; position: sticky; left: 0; background: var(--hj-surface); z-index: 1; padding-right: .6rem; color: var(--hj-ink-2); max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
.hj-heat-cell { text-align: center; padding: .38rem .3rem; border-radius: 4px; min-width: 30px; font-variant-numeric: tabular-nums; font-weight: 550; }
.hj-heat-cell.is-empty { color: var(--hj-faint); background: var(--hj-line-2); }
.is-link { cursor: pointer; } .hj-heat-cell.is-link:hover, .hj-cal-cell.is-link:hover { outline: 2px solid var(--hj-primary); outline-offset: -1px; }
.hj-heat-key { display: flex; align-items: center; gap: .5rem; margin-top: .55rem; font-size: 11px; color: var(--hj-muted); }
.hj-heat-bar { flex: 0 1 140px; height: 8px; border-radius: 4px; }
.hj-cal { border-collapse: separate; border-spacing: 3px; width: 100%; table-layout: fixed; }
.hj-cal th { font-size: 11px; font-weight: 600; color: var(--hj-muted); text-align: center; padding-bottom: .2rem; }
.hj-cal-cell { height: 38px; text-align: center; vertical-align: middle; border-radius: 6px; background: var(--hj-line-2); font-size: 12px; font-weight: 600; color: var(--hj-ink); }
.hj-cal-cell.is-empty { background: transparent; }

.hj-progress, .hj-list, .hj-funnel, .hj-cards { list-style: none; margin: 0; padding: 0; }
.hj-progress-item { margin-bottom: .75rem; }
.hj-progress-head { display: flex; justify-content: space-between; gap: .5rem; font-size: 12.5px; margin-bottom: .25rem; }
.hj-progress-label { color: var(--hj-ink-2); } .hj-progress-val { font-weight: 650; color: var(--hj-ink); font-variant-numeric: tabular-nums; }
.hj-progress-track { height: 8px; border-radius: 999px; background: var(--hj-line-2); overflow: hidden; }
.hj-progress-fill { height: 100%; border-radius: inherit; }
.hj-list-item { border-bottom: 1px solid var(--hj-line-2); }
.hj-list-item:last-child { border-bottom: 0; }
.hj-list-main { display: flex; align-items: center; gap: .6rem; padding: .55rem 0; color: inherit; text-decoration: none; min-width: 0; }
a.hj-list-main:hover .hj-list-label { color: var(--hj-primary-600); text-decoration: underline; }
.hj-list.is-ranked .hj-list-item { display: grid; grid-template-columns: 1fr; position: relative; }
.hj-list.is-ranked .hj-list-main { padding-left: 2rem; }
.hj-rank { position: absolute; left: 0; top: .55rem; width: 1.4rem; height: 1.4rem; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--hj-slate-bg); color: var(--hj-ink-2); }
.hj-list-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hj-list-label { font-weight: 600; color: var(--hj-ink); font-size: 13px; overflow-wrap: anywhere; }
.hj-list-sub { font-size: 12px; color: var(--hj-muted); }
.hj-list-val { font-weight: 700; color: var(--hj-ink); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 13px; }
.hj-list-bar { height: 4px; margin: -.25rem 0 .55rem 2rem; background: var(--hj-line-2); border-radius: 999px; overflow: hidden; }
.hj-list-bar > span { display: block; height: 100%; border-radius: inherit; }
.hj-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.hj-pill { font-size: 11px; font-weight: 650; padding: .1rem .5rem; border-radius: 999px; background: var(--hj-slate-bg); color: var(--hj-ink-2); white-space: nowrap; }
.hj-funnel-step { display: grid; grid-template-columns: minmax(70px, 28%) 1fr 3.2rem; align-items: center; gap: .5rem; margin-bottom: .45rem; font-size: 12.5px; }
.hj-funnel-label { color: var(--hj-ink-2); }
.hj-funnel-track { display: flex; justify-content: center; }
.hj-funnel-bar { display: flex; align-items: center; justify-content: center; height: 30px; border-radius: 6px; min-width: 38px; text-decoration: none; }
.hj-funnel-val { font-weight: 700; color: #fff; text-shadow: 0 1px 1px rgba(0, 0, 0, .35); font-variant-numeric: tabular-nums; }
.hj-funnel-pct { color: var(--hj-muted); text-align: right; font-variant-numeric: tabular-nums; }
.hj-table-scroll { overflow-x: auto; }
.hj-mini-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.hj-mini-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--hj-muted); font-weight: 650; padding: .4rem .5rem; border-bottom: 1px solid var(--hj-line); white-space: nowrap; }
.hj-mini-table td { padding: .5rem; border-bottom: 1px solid var(--hj-line-2); color: var(--hj-ink-2); }
.hj-mini-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.hj-kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .6rem; }
.hj-kpi-mini { background: var(--hj-slate-bg); border-radius: var(--hj-radius-sm); padding: .6rem .75rem; }
.hj-kpi-mini-label { font-size: 11.5px; color: var(--hj-muted); }
.hj-kpi-mini-val { font-size: 1.35rem; font-weight: 700; color: var(--hj-ink); font-variant-numeric: tabular-nums; }
.hj-card-big { font-size: 2.2rem; font-weight: 700; color: var(--hj-ink); }

/* insight card */
.hj-cards { display: grid; gap: .6rem; }
.hj-insight { display: block; background: var(--hj-surface); border: 1px solid var(--hj-line); border-left: 4px solid var(--hj-info); border-radius: var(--hj-radius-sm); padding: .75rem .9rem; text-decoration: none; color: inherit; }
.hj-insight.is-warn, .hj-insight.is-warning { border-left-color: var(--hj-warn); }
.hj-insight.is-critical { border-left-color: var(--hj-bad); }
.hj-insight-head { display: flex; align-items: flex-start; gap: .5rem; }
.hj-insight-sev { color: var(--hj-info); } .hj-insight.is-warn .hj-insight-sev, .hj-insight.is-warning .hj-insight-sev { color: var(--hj-warn); } .hj-insight.is-critical .hj-insight-sev { color: var(--hj-bad); }
.hj-insight-title { margin: 0; font-size: .9rem; font-weight: 650; color: var(--hj-ink); }
.hj-insight-body { margin: .35rem 0 0; font-size: 13px; color: var(--hj-ink-2); }
.hj-insight-evidence { margin: .4rem 0 0; padding-left: 1.1rem; font-size: 12.5px; color: var(--hj-muted); }
.hj-insight-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }

/* ---------- filter bar ---------- */
.hj-filterbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem .9rem; background: var(--hj-surface); border: 1px solid var(--hj-line); border-radius: var(--hj-radius); padding: .65rem .8rem; margin-bottom: .9rem; }
.hj-seg--btns { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
.hj-seg--btns button { border: 0; background: transparent; padding: .38rem .8rem; min-height: 36px; border-radius: 8px; font-size: 13px; font-weight: 550; color: var(--hj-ink-2); white-space: nowrap; cursor: pointer; }
.hj-seg--btns button:hover { color: var(--hj-ink); }
.hj-seg--btns button[aria-pressed="true"] { background: var(--hj-surface); color: var(--hj-primary-600); box-shadow: var(--hj-shadow); }
.hj-fb-custom { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem; }
.hj-fb-custom[hidden], .hj-fb-range[hidden] { display: none; }
.hj-fb-range { display: flex; gap: .5rem; flex-wrap: wrap; }
.hj-fb-selects { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem .75rem; }
.hj-fb-field { display: grid; gap: .15rem; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--hj-muted); }
.hj-fb-field .form-select, .hj-fb-field .form-control { min-width: 130px; text-transform: none; letter-spacing: 0; font-weight: 400; }
.hj-fb-switch { display: flex; align-items: center; gap: .4rem; margin: 0 0 .3rem; font-size: 13px; }
.hj-fb-reset { align-self: center; }
@media (max-width: 575.98px) {
  .hj-filterbar { padding: .6rem; } .hj-fb-field { flex: 1 1 130px; } .hj-fb-field .form-select, .hj-fb-field .form-control { min-width: 0; width: 100%; }
  .hj-widget { padding-left: .85rem; padding-right: .85rem; }
  .hj-funnel-step { grid-template-columns: 1fr 2.8rem; } .hj-funnel-label { grid-column: 1 / -1; }
}

/* dev sandbox */
.hj-sandbox-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.hj-sandbox h2 { font-size: 1rem; margin: 1.5rem 0 .6rem; text-transform: uppercase; letter-spacing: .06em; color: var(--hj-muted); }

/* employee form */
/* ==========================================================================
   Employee add/edit form (WP6): tabbed, one form, rail + panels, sticky bar.
   Markup: personal/templates/details/employee_form.html + tabs/*.html
   Behaviour: core/static/js/hj-employee-form.js
   ========================================================================== */
/* AdminLTE's .app-main is overflow:auto, which would trap position:sticky; the window is the scroller here. */
.app-main:has(.hj-ef), .app-main.hj-ef-host { overflow: visible !important; }
.hj-ef { --ef-top: 0px; --ef-bar-h: 64px; padding-left: 1.25rem; padding-right: 1.25rem; max-width: none; }
.hj-ef [hidden] { display: none !important; }
.hj-ef-muted { color: var(--hj-muted); font-weight: 400; }

/* ---- header ---- */
.hj-ef-head { position: sticky; top: var(--ef-top); z-index: 30; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1.5rem;
  margin: 1rem 0 .9rem; padding: .7rem 1rem; background: color-mix(in srgb, var(--hj-surface) 94%, transparent); backdrop-filter: saturate(160%) blur(8px);
  border: 1px solid var(--hj-line); border-radius: var(--hj-radius); box-shadow: var(--hj-shadow); }
.hj-ef-head-main { display: flex; align-items: center; gap: 1rem; min-width: 0; flex: 1 1 340px; }
.hj-ef-back { display: inline-flex; align-items: center; gap: .15rem; color: var(--hj-muted); font-size: 13px; white-space: nowrap; padding: .25rem .4rem .25rem 0; border-radius: 6px; }
.hj-ef-back:hover { color: var(--hj-primary); }
.hj-ef-who { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.hj-ef-avatar { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--hj-primary-50); color: var(--hj-primary); display: grid; place-items: center; overflow: hidden; font-size: 1.4rem; border: 1px solid var(--hj-line); }
.hj-ef-avatar img { width: 100%; height: 100%; object-fit: cover; }
.hj-ef-who-text { min-width: 0; }
.hj-ef-name { margin: 0; font-size: 1.1rem; line-height: 1.25; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hj-ef-meta { display: flex; align-items: center; gap: .5rem; margin-top: .1rem; font-size: 12px; color: var(--hj-muted); }
.hj-ef-code { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.hj-ef-status { background: var(--hj-ok-bg); color: var(--hj-ok); }
.hj-ef-head-side { display: flex; align-items: center; gap: .75rem; }
.hj-ef-meter-wrap { position: relative; }
.hj-ef-meter { display: flex; align-items: center; gap: .6rem; padding: .35rem .6rem; border: 1px solid var(--hj-line); background: var(--hj-surface); border-radius: 999px; cursor: pointer; color: var(--hj-ink-2); }
.hj-ef-meter:hover { border-color: var(--hj-primary); }
.hj-ef-meter-label { font-size: 12px; color: var(--hj-muted); }
.hj-ef-meter-track { display: block; width: 110px; height: 8px; border-radius: 999px; background: var(--hj-line-2); overflow: hidden; }
.hj-ef-meter-fill { display: block; height: 100%; border-radius: inherit; background: var(--hj-ok); transition: width .3s ease; }
.hj-ef-meter-pct { font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; min-width: 2.6ch; text-align: right; color: var(--hj-ink); }
.hj-ef-checklist { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; width: min(380px, calc(100vw - 2rem)); max-height: 60vh; overflow: auto; background: var(--hj-surface); border: 1px solid var(--hj-line); border-radius: var(--hj-radius); box-shadow: var(--hj-shadow-lg); padding: .8rem 1rem; }
.hj-ef-checklist-title { margin: 0 0 .4rem; font-weight: 650; color: var(--hj-ink); }
.hj-ef-checklist ul { list-style: none; margin: 0; padding: 0; }
.hj-ef-checklist li a, .hj-ef-checklist li button { display: flex; justify-content: space-between; gap: .75rem; width: 100%; padding: .4rem .35rem; border: 0; background: none; text-align: left; color: var(--hj-ink-2); border-radius: 6px; font-size: 13px; cursor: pointer; }
.hj-ef-checklist li a:hover, .hj-ef-checklist li button:hover { background: var(--hj-primary-50); color: var(--hj-primary-600); }
.hj-ef-checklist li small { color: var(--hj-faint); }

/* ---- banners ---- */
.hj-ef-banners:empty { display: none; }
.hj-ef-summary { margin-bottom: .9rem; padding: .85rem 1rem; border: 1px solid color-mix(in srgb, var(--hj-bad) 40%, transparent); border-left: 4px solid var(--hj-bad); background: var(--hj-bad-bg); color: var(--hj-ink); border-radius: var(--hj-radius-sm); }
.hj-ef-summary:focus { outline: 2px solid var(--hj-bad); outline-offset: 2px; }
.hj-ef-summary-head { display: flex; align-items: center; gap: .5rem; color: var(--hj-bad); }
.hj-ef-summary-list { margin: .5rem 0 0; padding-left: 1.4rem; font-size: 13px; }
.hj-ef-summary-list a { color: var(--hj-ink); text-decoration: underline; text-underline-offset: 2px; }
.hj-ef-summary-tab { color: var(--hj-muted); }
.hj-ef-draft { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: .9rem; padding: .6rem 1rem; border: 1px solid var(--hj-line); border-left: 4px solid var(--hj-info); background: var(--hj-info-bg); border-radius: var(--hj-radius-sm); font-size: 13px; color: var(--hj-ink); }
.hj-ef-draft i { color: var(--hj-info); }
.hj-ef-draft > span { flex: 1 1 220px; }

/* ---- layout ---- */
.hj-ef-layout { display: grid; grid-template-columns: 252px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.hj-ef-nav { position: sticky; top: calc(var(--ef-top) + 88px); max-height: calc(100vh - var(--ef-top) - 164px - var(--ef-bar-h) - 12px); overflow: auto; padding: .5rem; background: var(--hj-surface); border: 1px solid var(--hj-line); border-radius: var(--hj-radius); box-shadow: var(--hj-shadow); scrollbar-width: thin; }
.hj-ef-jump { display: none; }
.hj-ef-find { position: relative; margin: .1rem .1rem .5rem; }
.hj-ef-find > i { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--hj-faint); font-size: .85rem; pointer-events: none; }
.hj-ef-find .form-control { padding-left: 2rem; height: 36px; font-size: 13px; }
.hj-ef-find-list { position: absolute; z-index: 45; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: .25rem; list-style: none; max-height: 280px; overflow: auto; background: var(--hj-surface); border: 1px solid var(--hj-line); border-radius: var(--hj-radius-sm); box-shadow: var(--hj-shadow-lg); }
.hj-ef-find-list li { padding: .4rem .55rem; border-radius: 6px; cursor: pointer; font-size: 13px; display: flex; justify-content: space-between; gap: .5rem; }
.hj-ef-find-list li small { color: var(--hj-faint); }
.hj-ef-find-list li[aria-selected="true"], .hj-ef-find-list li:hover { background: var(--hj-primary-50); color: var(--hj-primary-600); }
.hj-ef-group + .hj-ef-group { margin-top: .35rem; }
.hj-ef-group-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--hj-faint); padding: .55rem .65rem .2rem; }
.hj-ef-tab { display: flex; align-items: center; gap: .6rem; width: 100%; min-height: 36px; padding: .3rem .6rem; margin: 1px 0; border: 0; border-radius: 9px; background: transparent; color: var(--hj-ink-2); text-align: left; font-size: 13.5px; font-weight: 500; cursor: pointer; position: relative; }
.hj-ef-tab:hover { background: var(--hj-slate-bg); color: var(--hj-ink); }
.hj-ef-tab:focus-visible, .hj-ef-hjbtn:focus-visible { outline: 2px solid var(--hj-primary); outline-offset: -2px; }
.hj-ef-tab[aria-selected="true"] { background: var(--hj-primary-50); color: var(--hj-primary-600); font-weight: 650; }
.hj-ef-tab[aria-selected="true"]::before { content: ""; position: absolute; left: -2px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--hj-primary); }
.hj-ef-tab-icon { flex: none; width: 20px; text-align: center; color: var(--hj-muted); font-size: 1rem; }
.hj-ef-tab[aria-selected="true"] .hj-ef-tab-icon { color: var(--hj-primary); }
.hj-ef-tab-label { flex: 1; min-width: 0; line-height: 1.25; }
.hj-ef-tab-marks { display: inline-flex; align-items: center; gap: .3rem; flex: none; }
.hj-ef-err-badge { display: inline-flex; align-items: center; gap: .1rem; min-width: 22px; justify-content: center; padding: .05rem .4rem; border-radius: 999px; background: var(--hj-bad); color: #fff; font-size: 11px; font-weight: 700; }
.hj-ef-count { min-width: 20px; text-align: center; padding: .05rem .4rem; border-radius: 999px; background: var(--hj-slate-bg); color: var(--hj-ink-2); font-size: 11px; font-weight: 650; font-variant-numeric: tabular-nums; }
.hj-ef-dirty { width: 8px; height: 8px; border-radius: 50%; background: var(--hj-warn); box-shadow: 0 0 0 2px var(--hj-warn-bg); }
.hj-ef-tick { color: var(--hj-ok); font-size: .95rem; line-height: 1; }

/* ---- panels ---- */
.hj-ef-main { min-width: 0; }
.hj-ef-panel { background: transparent; scroll-margin-top: calc(var(--ef-top) + 88px); }
.hj-ef-panel:focus { outline: none; }
.hj-ef-panel-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .4rem 1rem; margin: 0 0 .85rem; }
.hj-ef-panel-title { margin: 0; font-size: 1.25rem; font-weight: 700; letter-spacing: -.015em; }
.hj-ef-panel-title:focus { outline: none; }
.hj-ef-panel-intro { margin: .15rem 0 0; color: var(--hj-muted); font-size: 13px; }
.hj-ef-scope { display: inline-flex; align-items: center; gap: .35rem; font-size: 12px; font-weight: 600; color: var(--hj-primary-600); background: var(--hj-primary-50); border-radius: 999px; padding: .2rem .65rem; }
.hj-ef-scope--own { color: var(--hj-ink-2); background: var(--hj-slate-bg); }
.hj-ef-note { display: flex; gap: .55rem; align-items: flex-start; margin: 0 0 .9rem; padding: .6rem .85rem; border-radius: var(--hj-radius-sm); background: var(--hj-info-bg); color: var(--hj-ink-2); font-size: 13px; }
.hj-ef-note i { color: var(--hj-info); margin-top: .1rem; }
.hj-ef-secs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); gap: 1rem; align-items: start; }
.hj-ef-sec { background: var(--hj-surface); border: 1px solid var(--hj-line); border-radius: var(--hj-radius); box-shadow: var(--hj-shadow); padding: 1rem 1.15rem 1.15rem; min-width: 0; }
.hj-ef-sec--rows { grid-column: 1 / -1; }
.hj-ef-sec-title { margin: 0 0 .85rem; font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--hj-muted); }
.hj-ef-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .95rem 1.1rem; }
.hj-ef-span2 { grid-column: span 2; }
.hj-ef-f { min-width: 0; }
.hj-ef-label { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin-bottom: .3rem; }
.hj-ef-label .form-label { margin: 0; }
.hj-ef-f .form-control, .hj-ef-f .form-select { width: 100%; min-height: 40px; }
.hj-ef-f .select2-container { width: 100% !important; }
.hj-ef-f textarea.form-control { min-height: 84px; }
.hj-ef-help { margin-top: .25rem; font-size: 12px; color: var(--hj-muted); line-height: 1.35; }
.hj-ef-err { color: var(--hj-bad); font-size: 12.5px; font-weight: 500; }
.hj-ef-err:empty { display: none; }
.hj-ef-err span { display: block; margin-top: .25rem; }
.hj-ef-err span::before { content: "\26A0\FE0E "; }
.hj-ef-warn { margin-top: .25rem; font-size: 12.5px; color: var(--hj-warn); font-weight: 500; }
.hj-ef-f.has-error .form-control, .hj-ef-f.has-error .form-select, .hj-ef-f.has-error .select2-selection { border-color: var(--hj-bad) !important; }
.hj-ef-pill { display: inline-block; font-size: 10.5px; font-weight: 700; padding: .05rem .45rem; border-radius: 999px; background: var(--hj-slate-bg); color: var(--hj-ink-2); letter-spacing: .02em; }
.hj-ef-pill--warn { background: var(--hj-warn-bg); color: var(--hj-warn); }
.hj-ef-lock { color: var(--hj-faint); font-size: .75rem; }
.hj-ef-switch { padding-top: 1.45rem; min-height: 40px; display: flex; align-items: center; gap: .6rem; padding-left: 0; }
.hj-ef-switch .form-check-input { float: none; margin: 0; width: 2.6rem; height: 1.4rem; flex: none; cursor: pointer; }
.hj-ef-switch .form-check-label { cursor: pointer; font-size: 13.5px; color: var(--hj-ink); }
.hj-ef-f--switch { align-self: start; padding-top: 1.7rem; }
.hj-ef-f--switch .hj-ef-switch { padding-top: 0; min-height: 40px; }
.hj-ef-f .select2-selection__rendered { padding-right: 2.4rem !important; }
.hj-ef-ro { min-height: 40px; display: flex; align-items: center; padding: .1rem .75rem; border-radius: 9px; background: var(--hj-slate-bg); color: var(--hj-ink); font-size: 14px; }
.hj-ef-ro.is-empty { color: var(--hj-faint); }
.hj-ef-masked { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem .9rem; min-height: 40px; padding: .1rem .75rem; border-radius: 9px; background: var(--hj-slate-bg); }
.hj-ef-mask-text { font-variant-numeric: tabular-nums; letter-spacing: .06em; color: var(--hj-ink); font-size: 14px; flex: 1 1 auto; word-break: break-all; }
.hj-ef-newval { display: grid; gap: .25rem; }
.hj-ef-date { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.hj-ef-date .form-control { flex: 1 1 140px; min-width: 130px; }
.hj-ef-adprev { font-size: 12px; color: var(--hj-muted); white-space: nowrap; }
.hj-ef-dup { margin-top: .4rem; padding: .5rem .7rem; border-radius: var(--hj-radius-sm); font-size: 12.5px; background: var(--hj-warn-bg); color: var(--hj-ink); border-left: 3px solid var(--hj-warn); }
.hj-ef-dup.is-block { background: var(--hj-bad-bg); border-left-color: var(--hj-bad); }
.hj-ef-dup a { font-weight: 650; text-decoration: underline; text-underline-offset: 2px; }
.hj-ef-dup ul { margin: 0; padding-left: 1rem; }

.hj-ef-dupbanner { margin-bottom: .9rem; padding: .7rem 1rem; border: 1px solid var(--hj-line); border-left: 4px solid var(--hj-warn); background: var(--hj-warn-bg); border-radius: var(--hj-radius-sm); font-size: 13px; color: var(--hj-ink); }
.hj-ef-dupbanner.is-block { border-left-color: var(--hj-bad); background: var(--hj-bad-bg); }
.hj-ef-dupbanner-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .3rem; }
.hj-ef-dupbanner ul { margin: 0 0 .4rem; padding-left: 1.2rem; }
.hj-ef-dupbanner a { font-weight: 650; text-decoration: underline; text-underline-offset: 2px; }
.hj-ef-dupconfirm { display: flex; align-items: center; gap: .5rem; margin: 0; font-weight: 600; cursor: pointer; }
.hj-ef-f.is-dim { opacity: .55; }
.hj-ef-masked--inline { margin-top: .3rem; min-height: 0; padding: 0; background: none; }
.hj-ef-masked--inline .hj-ef-mask-text { flex: 0 1 auto; padding: .2rem .55rem; border-radius: 6px; background: var(--hj-slate-bg); }

/* photo */
.hj-ef-photo-row { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.hj-ef-photo { width: 104px; height: 104px; flex: none; border-radius: 50%; overflow: hidden; background: var(--hj-primary-50); color: var(--hj-primary); display: grid; place-items: center; font-size: 3rem; border: 2px solid var(--hj-line); }
.hj-ef-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hj-ef-photo-actions { display: grid; gap: .35rem; justify-items: start; }
.hj-ef-photo-actions .hj-ef-help { margin: 0; }

/* rows */
.hj-ef-rows-bar { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .6rem; }
.hj-ef-rows-count { font-size: 12.5px; color: var(--hj-muted); }
.hj-ef-rows-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .75rem; }
.hj-ef-row { position: relative; display: flex; flex-direction: column; gap: .35rem; padding: .8rem .9rem; border: 1px solid var(--hj-line); border-radius: var(--hj-radius-sm); background: var(--hj-surface); }
.hj-ef-row:hover { border-color: var(--hj-primary-100); box-shadow: var(--hj-shadow); }
.hj-ef-row-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.hj-ef-row-title { margin: 0; font-size: 14px; font-weight: 650; color: var(--hj-ink); line-height: 1.3; overflow-wrap: anywhere; }
.hj-ef-row-sub { margin: 0; font-size: 12.5px; color: var(--hj-muted); }
.hj-ef-row-dl { display: grid; grid-template-columns: auto 1fr; gap: .15rem .7rem; margin: .2rem 0 0; font-size: 12.5px; }
.hj-ef-row-dl dt { color: var(--hj-muted); font-weight: 500; } .hj-ef-row-dl dd { margin: 0; color: var(--hj-ink-2); overflow-wrap: anywhere; }
.hj-ef-row-badges { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .15rem; }
.hj-ef-chip { font-size: 11px; font-weight: 650; padding: .1rem .5rem; border-radius: 999px; background: var(--hj-slate-bg); color: var(--hj-ink-2); }
.hj-ef-chip--ok { background: var(--hj-ok-bg); color: var(--hj-ok); } .hj-ef-chip--warn { background: var(--hj-warn-bg); color: var(--hj-warn); }
.hj-ef-chip--bad { background: var(--hj-bad-bg); color: var(--hj-bad); } .hj-ef-chip--info { background: var(--hj-info-bg); color: var(--hj-info); }
.hj-ef-row-actions { display: flex; gap: .15rem; flex: none; margin: -.25rem -.35rem 0 0; }
.hj-ef-row-actions .hj-iconbtn { width: 34px; height: 34px; }
.hj-ef-row-actions .hj-iconbtn:hover { background: var(--hj-slate-bg); color: var(--hj-ink); }
.hj-ef-row-actions .hj-iconbtn.is-danger:hover { background: var(--hj-bad-bg); color: var(--hj-bad); }
.hj-ef-row-file { display: flex; align-items: center; gap: .5rem; margin-top: .2rem; font-size: 12.5px; }
.hj-ef-row-file img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; border: 1px solid var(--hj-line); }
.hj-ef-row.is-saving { opacity: .6; pointer-events: none; }
.hj-ef-skel { grid-column: 1 / -1; display: grid; gap: .5rem; }
.hj-ef-skel span { display: block; height: 58px; border-radius: var(--hj-radius-sm); background: linear-gradient(90deg, var(--hj-line-2), var(--hj-slate-bg), var(--hj-line-2)); background-size: 200% 100%; animation: hj-ef-shim 1.4s linear infinite; }
@keyframes hj-ef-shim { to { background-position: -200% 0; } }
.hj-ef-empty, .hj-ef-rows-fail { display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: 1.4rem 1rem; text-align: center; color: var(--hj-muted); border: 1px dashed var(--hj-line); border-radius: var(--hj-radius-sm); }
.hj-ef-empty i { font-size: 1.6rem; color: var(--hj-faint); } .hj-ef-empty p, .hj-ef-rows-fail p { margin: 0; }
.hj-ef-locked { display: flex; align-items: center; flex-wrap: wrap; gap: .8rem 1rem; padding: 1rem 1.1rem; border-radius: var(--hj-radius-sm); background: var(--hj-slate-bg); }
.hj-ef-locked > i { font-size: 1.6rem; color: var(--hj-primary); } .hj-ef-locked > div { flex: 1 1 220px; }
.hj-ef-locked p { margin: 0; } .hj-ef-locked-title { font-weight: 650; color: var(--hj-ink); }

/* panel footer: previous / next */
.hj-ef-panel-foot { display: flex; justify-content: space-between; gap: .5rem; margin-top: 1rem; }
.hj-ef-panel-foot .hj-btn[hidden] { display: none; }

/* ---- sticky action bar ---- */
.hj-ef-bar { position: sticky; bottom: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem; margin-top: 1.1rem; padding: .7rem 1rem; min-height: var(--ef-bar-h);
  background: color-mix(in srgb, var(--hj-surface) 95%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--hj-line); border-radius: var(--hj-radius); box-shadow: var(--hj-shadow-lg); }
.hj-ef-bar-status { display: flex; align-items: center; gap: .55rem; font-size: 13px; color: var(--hj-ink-2); min-width: 0; }
.hj-ef-dot-state { width: 9px; height: 9px; border-radius: 50%; background: var(--hj-faint); flex: none; }
.hj-ef-bar.is-dirty .hj-ef-dot-state { background: var(--hj-warn); box-shadow: 0 0 0 3px var(--hj-warn-bg); }
.hj-ef-bar.is-error .hj-ef-dot-state { background: var(--hj-bad); box-shadow: 0 0 0 3px var(--hj-bad-bg); }
.hj-ef-bar.is-saved .hj-ef-dot-state { background: var(--hj-ok); }
.hj-ef-bar-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.hj-ef-save { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.15; padding-top: .35rem; padding-bottom: .3rem; }
.hj-ef-save-main { font-weight: 650; } .hj-ef-save-sub { font-size: 10.5px; opacity: .85; font-weight: 500; letter-spacing: .02em; }

/* ---- dialogs ---- */
.hj-ef-overlay { position: fixed; inset: 0; z-index: 1060; display: grid; place-items: center; padding: 1rem; background: rgba(15, 23, 42, .5); }
.hj-ef-modal { width: min(760px, 100%); max-height: calc(100vh - 2rem); display: flex; flex-direction: column; background: var(--hj-surface); border-radius: var(--hj-radius); box-shadow: var(--hj-shadow-lg); outline: none; }
.hj-ef-modal--crop { width: min(420px, 100%); }
.hj-ef-modal-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .8rem 1rem .8rem 1.25rem; border-bottom: 1px solid var(--hj-line); }
.hj-ef-modal-head h2 { margin: 0; font-size: 1.05rem; }
.hj-ef-modal-body { padding: 1rem 1.25rem 1.1rem; overflow: auto; display: block; }
.hj-ef-modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--hj-line-2); }
.hj-ef-modal-foot .hj-ef-muted { margin-right: auto; font-size: 12.5px; }
.hj-ef-crop { width: 320px; max-width: 100%; margin: 0 auto; aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: #111; touch-action: none; cursor: grab; }
.hj-ef-crop:active { cursor: grabbing; } .hj-ef-crop canvas { width: 100%; height: 100%; display: block; }
.hj-ef-zoom { display: flex; align-items: center; gap: .75rem; margin: .9rem auto 0; max-width: 320px; font-size: 12.5px; color: var(--hj-muted); }
.hj-ef-zoom input { flex: 1; }
body.hj-ef-modal-open { overflow: hidden; }
body.hj-ef-modal-open .select2-dropdown, body.hj-ef-modal-open .ndp-nepali-box, body.hj-ef-modal-open .ndp-nepali-calendar-div { z-index: 1080 !important; }
.hj-ef-modal .hj-ef-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.hj-ef-modal .hj-ef-rowfield, .hj-ef-modal .mb-3 { margin-bottom: .85rem; }

/* toasts */
.hj-ef-toasts { position: fixed; z-index: 1090; right: 1rem; bottom: calc(var(--ef-bar-h) + 1rem); display: grid; gap: .5rem; max-width: min(360px, calc(100vw - 2rem)); pointer-events: none; }
.hj-ef-toast { pointer-events: auto; padding: .6rem .9rem; border-radius: var(--hj-radius-sm); background: var(--hj-ink); color: var(--hj-surface); font-size: 13px; box-shadow: var(--hj-shadow-lg); animation: hj-ef-in .18s ease-out; }
.hj-ef-toast.is-bad { background: var(--hj-bad); color: #fff; } .hj-ef-toast.is-ok { background: var(--hj-ok); color: #fff; }
@keyframes hj-ef-in { from { opacity: 0; transform: translateY(6px); } }

/* ---- responsive ---- */
@media (min-width: 1700px) {
  .hj-ef-layout { grid-template-columns: 272px minmax(0, 1fr); gap: 1.5rem; }
  .hj-ef-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}
@media (max-width: 991.98px) {
  .hj-ef { padding-left: .75rem; padding-right: .75rem; }
  .hj-ef-layout { grid-template-columns: minmax(0, 1fr); gap: .75rem; }
  .hj-ef-nav { position: sticky; top: calc(var(--ef-top) + var(--ef-head-h, 74px)); z-index: 25; max-height: none; overflow: visible; padding: .35rem; border-radius: var(--hj-radius-sm); }
  .hj-ef-find { display: none; }
  .hj-ef-tablist { display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; padding-bottom: 2px; }
  .hj-ef-tablist::-webkit-scrollbar { display: none; }
  .hj-ef-group { display: contents; }
  .hj-ef-group-label { display: none; }
  .hj-ef-tab { width: auto; flex: none; white-space: nowrap; min-height: 44px; padding: .4rem .8rem; scroll-snap-align: center; }
  .hj-ef-tab[aria-selected="true"]::before { left: 10px; right: 10px; top: auto; bottom: 2px; width: auto; height: 3px; }
  .hj-ef-tab-icon { display: none; }
  .hj-ef-head { position: static; }
  .hj-ef-meter-label { display: none; }
  .hj-ef-back span { display: none; }
}
@media (max-width: 767.98px) {
  .hj-ef-jump { display: block; margin-bottom: .35rem; }
  .hj-ef-jump .form-select { min-height: 44px; }
  .hj-ef-head { padding: .55rem .7rem; margin-top: .6rem; gap: .4rem; }
  .hj-ef-head-main { flex-basis: 100%; }
  .hj-ef-head-side { width: 100%; justify-content: space-between; }
  .hj-ef-meter-track { width: 90px; }
  .hj-ef-grid { grid-template-columns: minmax(0, 1fr); }
  .hj-ef-span2 { grid-column: auto; }
  .hj-ef-secs { grid-template-columns: minmax(0, 1fr); }
  .hj-ef-sec { padding: .85rem .9rem 1rem; }
  .hj-ef-f .form-control, .hj-ef-f .form-select, .hj-ef-f .select2-selection { min-height: 44px !important; font-size: 16px; }
  .hj-ef-rows-list { grid-template-columns: minmax(0, 1fr); }
  .hj-ef-bar { border-radius: var(--hj-radius-sm); padding: .55rem .7rem; }
  .hj-ef-bar-status { flex: 1 1 100%; }
  .hj-ef-bar-actions { width: 100%; }
  .hj-ef-bar-actions .btn { flex: 1; min-height: 44px; }
  .hj-ef-cancel { flex: 0 0 auto !important; }
  .hj-ef-overlay { padding: 0; place-items: stretch; }
  .hj-ef-modal { width: 100%; max-height: none; height: 100%; border-radius: 0; }
  .hj-ef-modal--crop { height: auto; align-self: center; }
  .hj-ef-toasts { left: 1rem; right: 1rem; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hj-ef *, .hj-ef *::before, .hj-ef *::after, .hj-ef-toast { animation: none !important; transition: none !important; }
}
@media (forced-colors: active) {
  .hj-ef-tab[aria-selected="true"] { outline: 2px solid Highlight; }
  .hj-ef-err-badge { border: 1px solid CanvasText; }
}
@media print {
  .hj-ef-nav, .hj-ef-bar, .hj-ef-panel-foot, .hj-ef-head-side, .hj-ef-back, .hj-ef-scope, .hj-ef-banners, .hj-ef-toasts, .hj-ef-overlay, .hj-ef-row-actions, .hj-ef-rows-bar .hj-btn,
  .hj-ef-reveal, .hj-ef-change, .hj-ef-note { display: none !important; }
  .hj-ef-layout { display: block; }
  .hj-ef-panel[hidden] { display: block !important; }
  .hj-ef-panel { break-inside: avoid-page; margin-bottom: 1rem; }
  .hj-ef-head { position: static; box-shadow: none; border: 0; padding: 0; }
  .hj-ef-sec { box-shadow: none; break-inside: avoid; }
  .hj-ef-f .form-control, .hj-ef-f .form-select { border: 0; border-bottom: 1px solid #999; border-radius: 0; background: none; appearance: none; }
}
/* /employee form */

/* ---- Report chart strip (W6) ---------------------------------------------------------------- */
.hj-rc { padding: .75rem 1rem 1rem; }
.hj-rc-bar { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem .9rem; }
.hj-rc-title { font-size: 1rem; font-weight: 650; margin: 0; color: var(--hj-ink); display: flex; align-items: center; gap: .4rem; }
.hj-rc-note { flex: 1; min-width: 12rem; font-size: 12px; color: var(--hj-muted); }
.hj-rc-panel { margin-top: .75rem; }
.hj-rc-panel[hidden] { display: none; }
.hj-rc.is-collapsed { padding-bottom: .75rem; }
.hj-rc [data-hj-act="refresh"] { display: none; }
.hj-rc .hj-widget { box-shadow: none; }
@media (max-width: 575.98px) { .hj-rc { padding: .65rem .65rem .8rem; } .hj-rc-note { display: none; } }
@media print { .hj-rc-toggle, .hj-rc .hj-w-actions { display: none !important; } .hj-rc-panel[hidden] { display: block !important; } .hj-rc .hj-widget { break-inside: avoid; } }

/* --- WP:W3 --- phone navbar: the right-hand nav (AD/BS switch, fullscreen, language, bell, user) was 25px wider than a 390px screen */
@media (max-width: 575.98px) {
  .app-header .navbar-nav.ms-auto > .nav-item:has([data-lte-toggle="fullscreen"]) { display: none; }
  .app-header .navbar-nav.ms-auto .nav-link { padding-left: .4rem; padding-right: .4rem; }
  .app-header .navbar-nav.ms-auto { flex-wrap: nowrap; }
}

/* global search */
.hj-gs-trigger { display: flex; align-items: center; gap: .55rem; min-width: 280px; height: 36px; padding: 0 .6rem 0 .8rem;
  margin-left: .5rem; background: var(--hj-slate-bg); border: 1px solid var(--hj-line); border-radius: var(--hj-radius-sm);
  color: var(--hj-muted); font-size: .86rem; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.hj-gs-trigger:hover, .hj-gs-trigger:focus-visible { border-color: var(--hj-primary); outline: none; box-shadow: 0 0 0 3px var(--hj-primary-50); color: var(--hj-ink-2); }
.hj-gs-trigger-text { flex: 1; text-align: start; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* tablet / small laptop: icon + shortcut only, so the top bar (search, Reports, AD/BS, language, bell, user) fits without sideways scroll */
@media (max-width: 1199.98px) { .hj-gs-trigger { min-width: 0; } .hj-gs-trigger-text { display: none; } }
.hj-gs-kbd, .hj-gs-foot kbd, .hj-gs-x { font-weight: 600; font-size: .68rem; line-height: 1; font-family: inherit; padding: .22rem .4rem; border-radius: 5px;
  background: var(--hj-surface); border: 1px solid var(--hj-line); color: var(--hj-muted); box-shadow: 0 1px 0 var(--hj-line); }
.hj-gs-icon { font-size: 1.1rem; background: none; border: 0; color: inherit; }
.hj-gs-lock { overflow: hidden; }
.hj-gs[hidden] { display: none !important; }
.hj-gs { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: flex-start; justify-content: center; padding: 10vh 1rem 1rem; }
.hj-gs-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .5); backdrop-filter: blur(2px); }
.hj-gs-panel { position: relative; width: 100%; max-width: 680px; max-height: 76vh; display: flex; flex-direction: column;
  background: var(--hj-surface); color: var(--hj-ink); border: 1px solid var(--hj-line); border-radius: 14px; box-shadow: var(--hj-shadow-lg); overflow: hidden; }
.hj-gs-head { display: flex; align-items: center; gap: .6rem; padding: .35rem .9rem; border-bottom: 1px solid var(--hj-line); }
.hj-gs-glass { color: var(--hj-muted); font-size: 1.05rem; }
.hj-gs-input { flex: 1; min-width: 0; height: 48px; border: 0; outline: 0; background: transparent; color: var(--hj-ink); font-size: 1.02rem; }
.hj-gs-input::placeholder { color: var(--hj-faint); }
.hj-gs-x { cursor: pointer; }
.hj-gs-spin { width: 16px; height: 16px; border: 2px solid var(--hj-line); border-top-color: var(--hj-primary); border-radius: 50%; animation: hj-gs-rot .7s linear infinite; }
@keyframes hj-gs-rot { to { transform: rotate(360deg); } }
.hj-gs-chips { display: flex; gap: .35rem; padding: .5rem .9rem; overflow-x: auto; border-bottom: 1px solid var(--hj-line); }
.hj-gs-chip { flex: none; border: 1px solid var(--hj-line); background: transparent; color: var(--hj-muted); border-radius: 999px; padding: .2rem .7rem; font-size: .78rem; cursor: pointer; }
.hj-gs-chip.is-on { background: var(--hj-primary-50); border-color: var(--hj-primary); color: var(--hj-primary); font-weight: 600; }
.hj-gs-body { overflow-y: auto; flex: 1; min-height: 120px; }
.hj-gs-list { list-style: none; margin: 0; padding: .3rem .45rem .6rem; }
.hj-gs-sec { padding: .65rem .6rem .25rem; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--hj-faint); }
.hj-gs-opt { display: flex; align-items: center; gap: .7rem; padding: .5rem .6rem; border-radius: 9px; cursor: pointer; }
.hj-gs-opt.is-active { background: var(--hj-primary-50); box-shadow: inset 3px 0 0 var(--hj-primary); }
.hj-gs-ic, .hj-gs-av { flex: none; width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--hj-slate-bg); color: var(--hj-primary); font-size: 1rem; }
.hj-gs-av { border-radius: 50%; background: var(--hj-violet-bg); color: var(--hj-violet); font-size: .74rem; font-weight: 700; }
.hj-gs-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hj-gs-lbl { font-size: .92rem; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hj-gs-lbl mark, .hj-sbf-hl mark, .sidebar-menu p mark { background: var(--hj-warn-bg); color: var(--hj-warn); padding: 0 1px; border-radius: 3px; }
.hj-gs-sub { font-size: .76rem; color: var(--hj-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hj-gs-type { flex: none; font-size: .66rem; font-weight: 650; padding: .12rem .45rem; border-radius: 999px; background: var(--hj-slate-bg); color: var(--hj-muted); }
.hj-gs-badge { flex: none; font-size: .68rem; font-weight: 650; padding: .12rem .5rem; border-radius: 999px; }
.hj-gs-ok { background: var(--hj-ok-bg); color: var(--hj-ok); } .hj-gs-warn { background: var(--hj-warn-bg); color: var(--hj-warn); }
.hj-gs-star { flex: none; border: 0; background: transparent; color: var(--hj-faint); padding: .25rem; border-radius: 6px; cursor: pointer; opacity: 0; }
.hj-gs-opt:hover .hj-gs-star, .hj-gs-opt.is-active .hj-gs-star, .hj-gs-star.is-on { opacity: 1; }
.hj-gs-star.is-on { color: var(--hj-warn); }
.hj-gs-msg { padding: 1.2rem; }
.hj-gs-empty { text-align: center; color: var(--hj-muted); padding: 1rem .5rem; }
.hj-gs-empty > .bi { font-size: 1.8rem; color: var(--hj-faint); }
.hj-gs-empty-t { font-weight: 650; color: var(--hj-ink); margin: .5rem 0 .2rem; } .hj-gs-empty-h { font-size: .84rem; margin: 0 0 .8rem; }
.hj-gs-empty-k { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--hj-faint); margin: 0 0 .4rem; }
.hj-gs-sugg { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; }
.hj-gs-sg, .hj-gs-retry { border: 1px solid var(--hj-line); background: var(--hj-slate-bg); color: var(--hj-ink-2); padding: .3rem .75rem; border-radius: 999px; font-size: .82rem; text-decoration: none; cursor: pointer; }
.hj-gs-sg:hover, .hj-gs-retry:hover { border-color: var(--hj-primary); color: var(--hj-primary); }
.hj-gs-foot { display: flex; gap: 1rem; padding: .5rem .9rem; border-top: 1px solid var(--hj-line); font-size: .72rem; color: var(--hj-muted); }
.hj-gs-foot kbd { margin-right: .2rem; } .hj-gs-foot-r { margin-left: auto; }
@media (max-width: 767.98px) {
  .hj-gs { padding: 0; }
  .hj-gs-panel { max-width: none; max-height: none; height: 100%; border-radius: 0; border: 0; }
  .hj-gs-foot { display: none; }
  .hj-gs-star { opacity: 1; }
  .hj-gs-input { font-size: 16px; } /* no iOS zoom */
}
@media (prefers-reduced-motion: reduce) { .hj-gs-spin { animation-duration: 2s; } }
/* sidebar "Filter menu" */
.hj-sbf { position: relative; padding: .6rem .8rem 0; }
.hj-sbf-ico { position: absolute; left: 1.35rem; top: 1.12rem; font-size: .8rem; color: var(--hj-faint); pointer-events: none; }
.hj-sbf-input { width: 100%; height: 34px; padding: 0 .6rem 0 2rem; border-radius: var(--hj-radius-sm); border: 1px solid var(--hj-line);
  background: var(--hj-slate-bg); color: var(--hj-ink); font-size: .84rem; }
.hj-sbf-input:focus { outline: none; border-color: var(--hj-primary); box-shadow: 0 0 0 3px var(--hj-primary-50); }
.hj-sbf-empty { font-size: .8rem; color: var(--hj-muted); padding: .6rem .2rem 0; }
.hj-sbf-empty a { color: var(--hj-primary); }
.sidebar-menu li[hidden] { display: none !important; }

/* datepicker */
.hj-dp-input { cursor: pointer; }
.hj-dp { position: fixed; z-index: 2100; width: 304px; max-width: calc(100vw - 16px); background: var(--hj-surface); color: var(--hj-ink);
  border: 1px solid var(--hj-line); border-radius: var(--hj-radius); box-shadow: var(--hj-shadow-lg); padding: .6rem .6rem .5rem; font-size: .84rem; outline: none; }
.hj-dp[hidden], .hj-dp-backdrop[hidden] { display: none !important; }
.hj-dp-head { display: grid; grid-template-columns: 32px 1fr 96px 32px; gap: .3rem; align-items: center; margin-bottom: .45rem; }
.hj-dp-head .hj-dp-month[hidden] { display: none; }
.hj-dp-nav { height: 32px; border: 1px solid var(--hj-line); border-radius: var(--hj-radius-sm); background: var(--hj-slate-bg); color: var(--hj-ink); font-size: 1.1rem; line-height: 1; cursor: pointer; }
.hj-dp-nav:hover, .hj-dp-btn:hover { border-color: var(--hj-primary); color: var(--hj-primary); }
.hj-dp-sel { height: 32px; min-width: 0; border: 1px solid var(--hj-line); border-radius: var(--hj-radius-sm); background: var(--hj-surface); color: var(--hj-ink); padding: 0 .35rem; font-size: .84rem; }
.hj-dp-wd, .hj-dp-row { display: grid; grid-template-columns: repeat(7, 1fr); }
.hj-dp-wd span { text-align: center; font-size: .7rem; font-weight: 600; color: var(--hj-muted); padding: .2rem 0; }
.hj-dp-wd .is-sat, .hj-dp-cell.is-sat .hj-dp-n { color: var(--hj-bad); }
.hj-dp-grid { min-height: 252px; }
.hj-dp-cell { position: relative; height: 42px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  border: 1px solid transparent; border-radius: var(--hj-radius-sm); background: transparent; color: var(--hj-ink); padding: 0; cursor: pointer; line-height: 1.1; }
.hj-dp-cell.is-pad { cursor: default; }
.hj-dp-n { font-size: .9rem; font-weight: 600; }
.hj-dp-sub { font-size: .6rem; color: var(--hj-faint); font-weight: 500; }
.hj-dp-cell:hover:not(.is-pad):not(.is-off) { background: var(--hj-primary-50); }
.hj-dp-cell:focus-visible, .hj-dp-mcell:focus-visible, .hj-dp-btn:focus-visible, .hj-dp-nav:focus-visible, .hj-dp-sel:focus-visible { outline: 2px solid var(--hj-primary); outline-offset: 1px; }
.hj-dp-cell.is-today { border-color: var(--hj-primary); }
.hj-dp-cell.is-inrange { background: var(--hj-primary-50); border-radius: 0; }
.hj-dp-cell.is-sel, .hj-dp-cell.is-rstart, .hj-dp-cell.is-rend { background: var(--hj-primary); color: #fff; border-radius: var(--hj-radius-sm); }
.hj-dp-cell.is-sel .hj-dp-n, .hj-dp-cell.is-rstart .hj-dp-n, .hj-dp-cell.is-rend .hj-dp-n { color: #fff; }
.hj-dp-cell.is-sel .hj-dp-sub, .hj-dp-cell.is-rstart .hj-dp-sub, .hj-dp-cell.is-rend .hj-dp-sub { color: rgba(255, 255, 255, .85); }
.hj-dp-cell.is-off { opacity: .35; cursor: not-allowed; text-decoration: line-through; }
.hj-dp-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; min-height: 252px; align-content: start; }
.hj-dp-mcell { height: 46px; border: 1px solid var(--hj-line); border-radius: var(--hj-radius-sm); background: var(--hj-slate-bg); color: var(--hj-ink); cursor: pointer; }
.hj-dp-mcell:hover { border-color: var(--hj-primary); }
.hj-dp-mcell.is-today { border-color: var(--hj-primary); }
.hj-dp-mcell.is-sel { background: var(--hj-primary); color: #fff; border-color: var(--hj-primary); }
.hj-dp-msg { min-height: 1.1rem; font-size: .74rem; color: var(--hj-bad); padding: .15rem .1rem 0; }
.hj-dp-foot { display: flex; align-items: center; gap: .4rem; border-top: 1px solid var(--hj-line); padding-top: .45rem; flex-wrap: wrap; }
.hj-dp-btn { height: 30px; padding: 0 .7rem; border: 1px solid var(--hj-line); border-radius: var(--hj-radius-sm); background: var(--hj-slate-bg); color: var(--hj-ink); font-size: .78rem; cursor: pointer; }
.hj-dp-sec { display: flex; align-items: center; gap: .3rem; font-size: .72rem; color: var(--hj-muted); margin: 0 auto 0 .2rem; cursor: pointer; }
.hj-dp-sec[hidden] { display: none; }
.hj-dp-close { display: none; }
.hj-dp-backdrop { position: fixed; inset: 0; z-index: 2090; background: rgba(15, 23, 42, .45); }
@media (max-width: 576px) {
  .hj-dp { left: 0 !important; right: 0 !important; top: auto !important; bottom: 0; width: 100%; max-width: none; border-radius: var(--hj-radius) var(--hj-radius) 0 0;
    padding: .8rem .8rem calc(.7rem + env(safe-area-inset-bottom)); max-height: 92vh; overflow-y: auto; }
  .hj-dp-cell { height: 46px; } .hj-dp-n { font-size: 1rem; }
  .hj-dp-sel, .hj-dp-nav { height: 40px; font-size: 1rem; }
  .hj-dp-head { grid-template-columns: 40px 1fr 92px 40px; }
  .hj-dp-btn { height: 38px; }
  .hj-dp-close { display: inline-block; }
}
@media (prefers-reduced-motion: no-preference) { .hj-dp.is-open { animation: hj-dp-in .12s ease-out; } @keyframes hj-dp-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } } }
input.hj-dp-input[aria-invalid="true"] { border-color: var(--hj-bad); }

/* nepali calendar */
.hjcal-toolbar { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.hjcal-nav, .hjcal-opts { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.hjcal-nav .form-select { width: auto; min-width: 7.5rem; }
.hjcal-nav .form-select#hjcal-year { min-width: 6rem; }
.hjcal-opts .btn.active, .hjcal-opts .btn[aria-pressed="true"] { background: var(--hj-primary); border-color: var(--hj-primary); color: #fff; }
.hjcal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.25rem; align-items: start; }
.hjcal-main, .hjcal-panel { background: var(--hj-surface); border: 1px solid var(--hj-line); border-radius: var(--hj-radius); padding: 1rem; }
.hjcal-panel { position: sticky; top: 1rem; }
.hjcal-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem 1rem; margin-bottom: .75rem; }
.hjcal-heading h2 { font-size: 1.6rem; font-weight: 700; margin: 0; color: var(--hj-ink); }
.hjcal-heading p { margin: 0; color: var(--hj-muted); font-size: .95rem; }
.hjcal-board { border: 1px solid var(--hj-line); border-radius: 10px; overflow: hidden; }
.hjcal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.hjcal-headrow { background: var(--hj-slate-bg); }
.hjcal-wd { padding: .5rem .25rem; text-align: center; font-weight: 600; font-size: .85rem; color: var(--hj-ink-2); }
.hjcal-wd.is-sat { color: var(--hj-bad); }
.hjcal-wd .short { display: none; }
.hjcal-cell { position: relative; min-height: 96px; padding: .35rem .45rem; border-top: 1px solid var(--hj-line-2); border-left: 1px solid var(--hj-line-2); background: var(--hj-surface); cursor: pointer; display: flex; flex-direction: column; gap: .1rem; outline: none; }
.hjcal-row > .hjcal-cell:first-child { border-left: 0; }
.hjcal-cell.is-pad { background: var(--hj-bg); cursor: default; }
.hjcal-cell:hover { background: var(--hj-primary-50); }
.hjcal-cell:focus-visible { box-shadow: inset 0 0 0 2px var(--hj-primary); }
.hjcal-cell.is-selected { background: var(--hj-primary-50); box-shadow: inset 0 0 0 2px var(--hj-primary-100); }
.hjcal-cell.is-off { background: var(--hj-slate-bg); }
.hjcal-cell.is-sat .hjcal-num, .hjcal-cell.is-off .hjcal-num, .hjcal-cell.is-holiday .hjcal-num { color: var(--hj-bad); }
.hjcal-cell.is-holiday { background: var(--hj-bad-bg); }
.hjcal-cell.has-leave { box-shadow: inset 3px 0 0 var(--hj-sem-leave); }
.hjcal-cell.is-today .hjcal-num { background: var(--hj-primary); color: #fff; border-radius: 999px; min-width: 2rem; height: 2rem; display: inline-flex; align-items: center; justify-content: center; padding: 0 .35rem; }
.hjcal-num { font-size: 1.35rem; font-weight: 700; line-height: 2rem; color: var(--hj-ink); align-self: flex-start; }
.hjcal-sec { position: absolute; top: .4rem; right: .5rem; font-size: .72rem; color: var(--hj-muted); text-align: right; }
.hjcal-sec b { font-weight: 600; }
.hjcal-hols { display: flex; flex-direction: column; gap: 2px; margin-top: auto; }
.hjcal-hol { font-size: .7rem; line-height: 1.15; padding: 1px 4px; border-radius: 4px; background: var(--hj-bad-bg); color: var(--hj-bad); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hjcal-hol-company { background: var(--hj-violet-bg); color: var(--hj-violet); }
.hjcal-hol.is-partial { background: var(--hj-warn-bg); color: var(--hj-warn); }
.hjcal-more { font-size: .68rem; color: var(--hj-muted); }
.hjcal-dots { display: none; gap: 3px; margin-top: auto; justify-content: center; }
.hjcal-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--hj-sem-holiday); flex: none; }
.hjcal-dot-national { background: var(--hj-bad); } .hjcal-dot-company { background: var(--hj-violet); }
.hjcal-dot-leave { background: var(--hj-sem-leave); } .hjcal-dot-off { background: var(--hj-sem-off); } .hjcal-dot-work { background: var(--hj-sem-present); }
.hjcal-note { margin: .75rem 0 0; padding: .5rem .75rem; border-radius: 8px; background: var(--hj-warn-bg); color: var(--hj-warn); font-size: .85rem; }
.hjcal-legend { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem 1rem; padding: 0; margin: .75rem 0 0; font-size: .8rem; color: var(--hj-muted); }
.hjcal-sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.hjcal-sw.sw-today { background: var(--hj-primary); border-radius: 50%; } .hjcal-sw.sw-off { background: var(--hj-slate-bg); border: 1px solid var(--hj-line); }
.hjcal-sw.sw-national { background: var(--hj-bad-bg); border: 1px solid var(--hj-bad); } .hjcal-sw.sw-company { background: var(--hj-violet-bg); border: 1px solid var(--hj-violet); }
.hjcal-sw.sw-leave { background: var(--hj-sem-leave); }
.hjcal-keys { margin: .5rem 0 0; font-size: .75rem; color: var(--hj-faint); }
.hjcal-panel-date .big { font-size: 1.4rem; font-weight: 700; color: var(--hj-ink); }
.hjcal-panel-date .sub { color: var(--hj-muted); margin-bottom: .75rem; }
.hjcal-dl { display: grid; grid-template-columns: auto 1fr; gap: .2rem .75rem; font-size: .88rem; margin: 0 0 .5rem; }
.hjcal-dl dt { color: var(--hj-muted); font-weight: 500; } .hjcal-dl dd { margin: 0; color: var(--hj-ink); }
.hjcal-h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--hj-muted); margin: 1rem 0 .4rem; }
.hjcal-muted { color: var(--hj-muted); font-size: .88rem; margin: 0; }
.hjcal-hlist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; }
.hjcal-hlist li { display: flex; gap: .55rem; align-items: flex-start; font-size: .9rem; }
.hjcal-hlist li .hjcal-dot { margin-top: .4rem; }
.hjcal-hlist li span, .hjcal-hlist li em { display: block; font-size: .78rem; color: var(--hj-muted); font-style: normal; }
.hjcal-hlist li em { color: var(--hj-warn); }
@media (max-width: 991px) { .hjcal-layout { grid-template-columns: 1fr; } .hjcal-panel { position: static; } }
@media (max-width: 575px) {
  .hjcal-main, .hjcal-panel { padding: .6rem; }
  .hjcal-heading h2 { font-size: 1.3rem; }
  .hjcal-wd .long { display: none; } .hjcal-wd .short { display: inline; } .hjcal-wd { font-size: .75rem; padding: .4rem 0; }
  .hjcal-cell { min-height: 58px; padding: .2rem .25rem; align-items: center; }
  .hjcal-num { font-size: 1rem; line-height: 1.6rem; align-self: center; }
  .hjcal-cell.is-today .hjcal-num { min-width: 1.7rem; height: 1.7rem; }
  .hjcal-sec { position: static; font-size: .62rem; } .hjcal-sec b { display: none; }
  .hjcal-hols { display: none; } .hjcal-dots { display: flex; }
  .hjcal-nav .form-select { min-width: 0; flex: 1 1 5.5rem; }
}
@media print {
  .no-print, .hjcal-panel, .hjcal-keys, .page-head .actions { display: none !important; }
  .hjcal-layout { display: block; } .hjcal-main { border: 0; padding: 0; }
  .hjcal-cell { min-height: 90px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .hjcal-hols { display: flex !important; } .hjcal-dots { display: none !important; }
}
.hjmini .hjmini-bs { font-size: 1.25rem; font-weight: 700; color: var(--hj-ink); }
.hjmini .hjmini-ad { color: var(--hj-muted); font-size: .85rem; margin-bottom: .6rem; }
.hjmini .hjmini-month { font-weight: 600; font-size: .85rem; margin-bottom: .25rem; }
.hjmini-grid { width: 100%; table-layout: fixed; text-align: center; font-size: .75rem; }
.hjmini-grid th { color: var(--hj-muted); font-weight: 500; padding: 2px 0; }
.hjmini-grid td { padding: 3px 0; color: var(--hj-ink-2); }
.hjmini-grid td.is-off, .hjmini-grid td.is-hol { color: var(--hj-bad); }
.hjmini-grid td.is-today { background: var(--hj-primary); color: #fff; border-radius: 6px; font-weight: 700; }
.hjmini-next { list-style: none; padding: 0; margin: .6rem 0 0; font-size: .8rem; }
.hjmini-next li { display: flex; gap: .5rem; } .hjmini-next b { color: var(--hj-bad); white-space: nowrap; }
.hjmini-next em { color: var(--hj-warn); font-style: normal; }
.hjmini-link { display: inline-block; margin-top: .5rem; font-size: .8rem; }
.hjcal-nav .form-select { width: auto; flex: 0 1 auto; }
