/* ============================================================================
   IT Solutions HRMS — Component styles. Pairs with app.css tokens.
   ============================================================================ */

/* ---------- Buttons ---------- */
.aun-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  font-family: var(--aun-font-body); font-size: 14px; font-weight: 600; line-height: 1;
  padding: 0 var(--sp-4); height: 40px; border-radius: var(--aun-radius-sm);
  border: 1px solid transparent; cursor: pointer; white-space: nowrap; user-select: none;
  transition: transform var(--aun-dur) var(--aun-ease), box-shadow var(--aun-dur) var(--aun-ease),
              background var(--aun-dur) var(--aun-ease), border-color var(--aun-dur) var(--aun-ease), color var(--aun-dur) var(--aun-ease);
}
.aun-btn:active { transform: translateY(1px) scale(.99); }
.aun-btn:disabled { opacity: .55; cursor: not-allowed; }
.aun-btn svg { width: 18px; height: 18px; }
.aun-btn--sm { height: 32px; padding: 0 var(--sp-3); font-size: 13px; }
.aun-btn--lg { height: 48px; padding: 0 var(--sp-6); font-size: 15px; }
.aun-btn--block { width: 100%; }
.aun-btn--icon { width: 40px; padding: 0; }
.aun-btn--icon.aun-btn--sm { width: 32px; }

.aun-btn--primary { background: var(--aun-coral); color: #fff; box-shadow: 0 1px 2px rgba(217,70,52,.3); }
.aun-btn--primary:hover:not(:disabled) { background: var(--aun-coral-strong); box-shadow: var(--aun-shadow-md); transform: translateY(-1px); }
.aun-btn--teal { background: var(--aun-teal); color: #fff; box-shadow: 0 1px 2px rgba(11,138,126,.3); }
.aun-btn--teal:hover:not(:disabled) { background: var(--aun-teal-strong); box-shadow: var(--aun-shadow-md); transform: translateY(-1px); }
.aun-btn--ghost { background: var(--bg-surface); color: var(--txt); border-color: var(--border); }
.aun-btn--ghost:hover:not(:disabled) { border-color: var(--aun-slate); color: var(--txt-strong); }
.aun-btn--ghost.invalid { border-color: var(--aun-danger); }
.aun-btn--subtle { background: transparent; color: var(--txt-muted); }
.aun-btn--subtle:hover:not(:disabled) { background: var(--aun-idle-soft); color: var(--txt-strong); }
.aun-btn--danger { background: var(--aun-danger); color: #fff; }
.aun-btn--danger:hover:not(:disabled) { filter: brightness(.94); box-shadow: var(--aun-shadow-md); }
.aun-btn--success { background: var(--aun-success); color: #fff; }
.aun-btn--success:hover:not(:disabled) { filter: brightness(.94); box-shadow: var(--aun-shadow-md); }
.aun-btn--danger-ghost { background: var(--bg-surface); color: var(--aun-danger); border-color: var(--border); }
.aun-btn--danger-ghost:hover:not(:disabled) { background: var(--aun-danger-soft); border-color: var(--aun-danger); }

/* ---------- Card ---------- */
.aun-card {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--aun-radius);
  box-shadow: var(--aun-shadow-sm); padding: var(--sp-6);
}
.aun-card--flush { padding: 0; overflow: hidden; }
.aun-card--hover { transition: box-shadow var(--aun-dur) var(--aun-ease), transform var(--aun-dur) var(--aun-ease); }
.aun-card--hover:hover { box-shadow: var(--aun-shadow-md); transform: translateY(-2px); }
.aun-card__header { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-4) var(--sp-6); border-bottom: 1px solid var(--border); }
.aun-card__title { font-family: var(--aun-font-head); font-weight: 600; font-size: 16px; color: var(--txt-strong); }
.aun-card__body { padding: var(--sp-6); }

/* ---------- Page header ---------- */
.aun-page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-6); flex-wrap: wrap; }
.aun-page-header__titles { display: flex; flex-direction: column; gap: 2px; }
.aun-page-header__eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--aun-teal-strong); }
.aun-page-header h1 { font-size: 26px; }
.aun-page-header__subtitle { color: var(--txt-muted); font-size: 14px; }
.aun-page-header__actions { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
/* Visit Schedule toolbar: date + Clone yesterday + Add stop must stay on one row on desktop (page-specific,
   not a change to .aun-page-header__actions, so no other page's header is affected). */
.visit-schedule-actions { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: nowrap; white-space: nowrap; }
/* Live Field Map toolbar: Live indicator + date + Compliance must stay on one row on desktop (page-specific,
   not a change to .aun-page-header__actions, so no other page's header is affected). */
.live-map-actions { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: nowrap; white-space: nowrap; }
/* Recruitment toolbar (openings filter + Opening/Candidate buttons): one line on desktop, stacks on phone. */
.recruit-toolbar { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: nowrap; }
@media (max-width: 720px) {
  .recruit-toolbar { flex-wrap: wrap; width: 100%; }
  .recruit-toolbar select { max-width: none !important; flex: 1 1 100%; }
}
/* Roles & Permissions card footer: the permission chip and Clone/Edit/Delete must stay on ONE row.
   The chip is a single label, so it must never wrap mid-text ("7" above "permissions") nor be squeezed as a
   flex item. That alone does not fit: a 333px card leaves 283px of usable width, and the chip (107px) plus the
   three buttons (187px) need 294px. The buttons give back 4px of side padding each — 24px in total — which
   fits with slack to spare for a three-digit count. Page-specific, exactly like the toolbars above, so no
   other pill or button anywhere else in the app is touched. */
.role-card-actions { gap: var(--sp-2); flex-wrap: nowrap; }
.role-card-actions .aun-pill { white-space: nowrap; flex: none; }
.role-card-actions .aun-btn--sm { padding: 0 var(--sp-2); }

/* Performance toolbar (cycle select + New cycle button): one line on desktop, stacks on phone. */
.performance-toolbar { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: nowrap; }
@media (max-width: 720px) {
  .performance-toolbar { flex-wrap: wrap; width: 100%; }
  .performance-toolbar select { max-width: none !important; flex: 1 1 100%; }
}

/* ---------- Stat card ---------- */
.aun-stat { position: relative; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--aun-radius); padding: var(--sp-5); box-shadow: var(--aun-shadow-sm); overflow: hidden; min-width: 0; }
.aun-stat::after { content: ""; position: absolute; inset: 0 0 auto auto; width: 96px; height: 96px; background: radial-gradient(circle at top right, var(--aun-tint, var(--aun-teal-soft)), transparent 70%); opacity: .8; pointer-events: none; }
.aun-stat__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-3); }
.aun-stat__label { font-size: 13px; color: var(--txt-muted); font-weight: 500; }
.aun-stat__icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--aun-tint, var(--aun-teal-soft)); color: var(--aun-accent, var(--aun-teal-strong)); }
.aun-stat__icon svg { width: 20px; height: 20px; }
.aun-stat__value { font-family: var(--aun-font-head); font-size: 30px; font-weight: 700; color: var(--txt-strong); font-variant-numeric: tabular-nums; line-height: 1.1; overflow-wrap: anywhere; }
.aun-stat__delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; margin-top: var(--sp-2); }
.aun-stat__delta--up { color: var(--aun-success); } .aun-stat__delta--down { color: var(--aun-danger); } .aun-stat__delta--flat { color: var(--txt-muted); }

/* ---------- Pills / badges ---------- */
.aun-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: var(--aun-radius-pill); line-height: 1.5; }
.aun-pill__dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.aun-pill--ok { background: var(--aun-ok-soft); color: var(--aun-ok); }
.aun-pill--warn { background: var(--aun-warn-soft); color: #B6761A; }
.aun-pill--bad { background: var(--aun-bad-soft); color: var(--aun-bad); }
.aun-pill--idle { background: var(--aun-idle-soft); color: var(--aun-slate); }
.aun-pill--info { background: var(--aun-info-soft); color: var(--aun-info); }
.aun-pill--coral { background: var(--aun-coral-soft); color: var(--aun-coral-strong); }
.aun-pill--teal { background: var(--aun-teal-soft); color: var(--aun-teal-strong); }
.aun-badge { display: inline-flex; align-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--aun-radius-pill); background: var(--aun-coral); color: #fff; font-size: 11px; font-weight: 700; justify-content: center; }

/* ---------- Avatar ---------- */
.aun-avatar { display: inline-grid; place-items: center; border-radius: 50%; background: var(--aun-teal-soft); color: var(--aun-teal-strong); font-weight: 600; font-family: var(--aun-font-head); overflow: hidden; flex: none; }
.aun-avatar img { width: 100%; height: 100%; object-fit: cover; }
.aun-avatar--sm { width: 28px; height: 28px; font-size: 11px; }
.aun-avatar--md { width: 38px; height: 38px; font-size: 14px; }
.aun-avatar--lg { width: 56px; height: 56px; font-size: 20px; }

/* ---------- App shell ---------- */
/* Track 1 sizes to the sidebar's own width (`auto`); collapsing swaps that width 264px↔76px and snaps
   instantly. It is deliberately NOT transitioned: Chrome stalls a transition on either
   grid-template-columns (with a `1fr` track) or a grid item's width at its start value — that stall
   was the original "sidebar won't collapse / layout breaks" bug. */
.aun-shell { display: grid; grid-template-columns: auto 1fr; min-height: 100vh; }
.aun-shell__main { display: flex; flex-direction: column; min-width: 0; }
.aun-shell__content { padding: var(--sp-6) var(--sp-8); flex: 1 1 auto; max-width: 1440px; width: 100%; margin: 0 auto; }

/* ---------- Sidebar ---------- */
.aun-sidebar { background: var(--bg-surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: hidden; width: var(--aun-sidebar-w); }
/* flex:none keeps the brand header at the full top-bar height (64px) so its bottom border lines up with
   the top bar's into one continuous line. Without it, a tall nav shrinks this flex item to ~36px. */
.aun-sidebar__brand { display: flex; align-items: center; gap: var(--sp-3); height: var(--aun-topbar-h); flex: none; padding: 0 var(--sp-5); border-bottom: 1px solid var(--border); white-space: nowrap; }
.aun-sidebar__brand-name { font-family: var(--aun-font-head); font-weight: 700; font-size: 16px; color: var(--txt-strong); }
.aun-sidebar__brand-sub { font-size: 11px; color: var(--txt-muted); }
.aun-sidebar__nav { flex: 1 1 auto; overflow-y: auto; padding: var(--sp-3) var(--sp-3) var(--sp-6); display: flex; flex-direction: column; gap: 2px; }
.aun-sidebar__section { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--txt-muted); padding: var(--sp-4) var(--sp-3) var(--sp-2); }
.aun-nav-item { display: flex; align-items: center; gap: var(--sp-3); padding: 10px var(--sp-3); border-radius: var(--aun-radius-sm); color: var(--txt); font-weight: 500; cursor: pointer; transition: background var(--aun-dur) var(--aun-ease), color var(--aun-dur) var(--aun-ease); white-space: nowrap; position: relative; }
.aun-nav-item:hover { background: var(--aun-idle-soft); color: var(--txt-strong); text-decoration: none; }
.aun-nav-item.active { background: var(--aun-coral-soft); color: var(--aun-coral-strong); font-weight: 600; }
.aun-nav-item.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--aun-coral); }
.aun-nav-item__icon { width: 20px; height: 20px; flex: none; display: grid; place-items: center; }
.aun-nav-item__icon svg { width: 20px; height: 20px; }
.aun-nav-item__badge { margin-left: auto; }
/* Desktop collapse = icon-only rail. Scoped to desktop so the mobile off-canvas drawer keeps its labels
   (the one toggle sets both --collapsed and --mobile-open). */
@media (min-width: 1025px) {
  .aun-shell--collapsed .aun-sidebar { width: var(--aun-sidebar-collapsed-w); }
  .aun-shell--collapsed .aun-nav-item__label,
  .aun-shell--collapsed .aun-sidebar__section,
  .aun-shell--collapsed .aun-sidebar__brand-text { display: none; }
  .aun-shell--collapsed .aun-sidebar__brand { justify-content: center; padding: 0; }
}

/* ---------- Top bar ---------- */
.aun-topbar { height: var(--aun-topbar-h); background: color-mix(in srgb, var(--bg-surface) 88%, transparent); backdrop-filter: saturate(1.2) blur(8px); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: var(--sp-4); padding: 0 var(--sp-6); position: sticky; top: 0; z-index: 30; }
.aun-topbar__search { display: flex; align-items: center; gap: var(--sp-2); background: var(--bg); border: 1px solid var(--border); border-radius: var(--aun-radius-pill); padding: 0 var(--sp-4); height: 38px; width: 320px; max-width: 38vw; color: var(--txt-muted); }
.aun-topbar__search input { border: 0; background: transparent; outline: none; font-family: inherit; font-size: 14px; color: var(--txt); width: 100%; }
.aun-iconbtn { width: 38px; height: 38px; border-radius: var(--aun-radius-sm); border: 1px solid transparent; background: transparent; color: var(--txt-muted); display: grid; place-items: center; cursor: pointer; position: relative; transition: background var(--aun-dur) var(--aun-ease), color var(--aun-dur) var(--aun-ease); }
.aun-iconbtn:hover { background: var(--aun-idle-soft); color: var(--txt-strong); }
.aun-iconbtn svg { width: 20px; height: 20px; }
.aun-iconbtn__badge { position: absolute; top: 4px; right: 4px; }
.aun-chip { display: inline-flex; align-items: center; gap: var(--sp-2); height: 38px; padding: 0 var(--sp-3); border-radius: var(--aun-radius-pill); border: 1px solid var(--border); background: var(--bg-surface); cursor: pointer; font-weight: 500; color: var(--txt); transition: border-color var(--aun-dur) var(--aun-ease); }
.aun-chip:hover { border-color: var(--aun-slate); }
/* Keep the top-bar chips on ONE line — truncate long company / user labels with an ellipsis instead of
   wrapping (which overflowed the fixed 38px chip height on medium widths). Scoped to the top bar and
   excluding the icon/avatar (mirrors the 640px icon-only rule's selector). */
.aun-topbar .aun-chip { min-width: 0; }
.aun-topbar .aun-chip > span:not([class*="avatar"]) { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aun-topbar .aun-chip .aun-stack { min-width: 0; }
.aun-topbar .aun-chip .aun-stack > span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Menu (dropdown) ---------- */
.aun-menu { position: absolute; min-width: 220px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--aun-radius-sm); box-shadow: var(--aun-shadow-lg); padding: var(--sp-2); z-index: 50; animation: aun-fade-up 140ms var(--aun-ease) both; }
.aun-menu__item { display: flex; align-items: center; gap: var(--sp-3); padding: 9px var(--sp-3); border-radius: 8px; color: var(--txt); cursor: pointer; font-size: 14px; }
.aun-menu__item:hover { background: var(--aun-idle-soft); color: var(--txt-strong); }
.aun-menu__divider { height: 1px; background: var(--border); margin: var(--sp-2) 0; }
.aun-menu__label { padding: 6px var(--sp-3) 4px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--txt-muted); }
/* Menu items rendered as form <button>s (the branch switcher) — reset native button chrome to match anchors. */
.aun-menu form { margin: 0; }
button.aun-menu__item { width: 100%; border: 0; background: transparent; font: inherit; text-align: left; }
.aun-menu__item.is-active { color: var(--aun-teal); font-weight: 600; }

/* ---------- Branch picker (login step) ---------- */
.aun-branchpick { display: flex; flex-direction: column; gap: var(--sp-3); }
.aun-branchpick__item { display: flex; align-items: center; gap: var(--sp-3); width: 100%; text-align: left; padding: var(--sp-4); border: 1px solid var(--border); border-radius: var(--aun-radius-sm); background: var(--bg-surface); color: var(--txt); cursor: pointer; font: inherit; transition: border-color var(--aun-dur) var(--aun-ease), box-shadow var(--aun-dur) var(--aun-ease), background var(--aun-dur) var(--aun-ease); }
.aun-branchpick__item:hover { border-color: var(--aun-teal); background: var(--aun-idle-soft); }
.aun-branchpick__item:focus-visible { outline: none; border-color: var(--aun-teal); box-shadow: 0 0 0 3px var(--aun-teal-soft); }
.aun-branchpick__item:active { transform: translateY(1px); }
.aun-branchpick__icon { width: 40px; height: 40px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; background: var(--aun-teal-soft); color: var(--aun-teal); }
.aun-branchpick__text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.aun-branchpick__name { display: inline-flex; align-items: center; gap: var(--sp-2); font-weight: 600; color: var(--txt-strong); }
.aun-branchpick__city { font-size: 13px; color: var(--txt-muted); }
.aun-branchpick__item > .aun-icon:last-child { color: var(--txt-muted); flex: 0 0 auto; }

/* ---------- Searchable select ---------- */
.aun-ss { position: relative; }
.aun-ss.is-disabled { opacity: .6; pointer-events: none; }
.aun-ss__trigger { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); text-align: left; cursor: pointer; }
.aun-ss__placeholder { color: var(--txt-muted); }
.aun-ss__caret { color: var(--txt-muted); font-size: 12px; flex: 0 0 auto; }
.aun-ss__backdrop { position: fixed; inset: 0; z-index: 49; }
.aun-ss__menu { left: 0; right: 0; top: calc(100% + 4px); min-width: 0; max-height: 288px; display: flex; flex-direction: column; gap: var(--sp-2); }
.aun-ss__search { height: 36px; }
.aun-ss__list { overflow-y: auto; }
.aun-ss__item { justify-content: space-between; }
.aun-ss__item.is-active { background: var(--aun-idle-soft); color: var(--txt-strong); }
.aun-ss__item.is-selected { color: var(--aun-teal); font-weight: 600; }
.aun-ss__sub { color: var(--txt-muted); font-size: 12px; }
.aun-ss__empty { padding: 9px var(--sp-3); color: var(--txt-muted); font-size: 14px; }

/* ---------- Company logo upload ---------- */
.aun-logo-upload { display: flex; align-items: center; gap: var(--sp-4); margin-bottom: var(--sp-5); }
.aun-logo-preview { width: 88px; height: 88px; flex: 0 0 auto; border: 1px solid var(--border); border-radius: var(--aun-radius-sm); background: var(--bg-canvas); display: grid; place-items: center; overflow: hidden; }
.aun-logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.aun-logo-placeholder { font-family: var(--aun-font-head); font-size: 34px; font-weight: 700; color: var(--aun-teal); }

/* Combined international phone input: [flag + code + chevron] | [number], one shared border + focus ring */
.aun-phone { position: relative; display: flex; align-items: stretch; height: 40px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--aun-radius-sm); transition: border-color var(--aun-dur) var(--aun-ease), box-shadow var(--aun-dur) var(--aun-ease); }
.aun-phone:focus-within { border-color: var(--aun-teal); box-shadow: 0 0 0 3px var(--aun-teal-soft); }
.aun-phone.invalid { border-color: var(--aun-danger); }
.aun-phone__code { display: flex; align-items: center; gap: 6px; width: 116px; flex: 0 0 auto; padding: 0 10px; border: none; background: none; font: inherit; color: var(--txt); cursor: pointer; border-radius: var(--aun-radius-sm) 0 0 var(--aun-radius-sm); }
.aun-phone__code:focus-visible { outline: none; }
.aun-phone__flag { font-size: 16px; line-height: 1; }
.aun-phone__dial { font-variant-numeric: tabular-nums; }
.aun-phone__caret { margin-left: auto; color: var(--txt-muted); font-size: 11px; }
.aun-phone__number { flex: 1 1 auto; min-width: 0; border: none; border-left: 1px solid var(--border); background: none; padding: 0 12px; font: inherit; color: var(--txt); outline: none; }
.aun-phone__number::placeholder { color: var(--txt-muted); }
.aun-phone__menu { left: 0; top: calc(100% + 4px); min-width: 260px; max-width: 92vw; max-height: 288px; display: flex; flex-direction: column; gap: var(--sp-2); }
.aun-phone__option { display: flex; align-items: center; gap: var(--sp-3); }
.aun-phone__option.is-active { background: var(--aun-idle-soft); color: var(--txt-strong); }
.aun-phone__option.is-selected { color: var(--aun-teal); font-weight: 600; }
.aun-phone__name { flex: 1 1 auto; }
.aun-phone__dial-code { color: var(--txt-muted); font-variant-numeric: tabular-nums; }

/* Centered chromeless page (change password) */
.aun-setup-center { min-height: 100vh; display: grid; place-items: center; padding: var(--sp-6); background: var(--bg-canvas); }

/* ---------- Setup wizard (chromeless layout + stepper) ---------- */
.aun-setup-shell { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg-canvas); }
.aun-setup-topbar { height: var(--aun-topbar-h); display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); padding: 0 var(--sp-6); background: var(--bg-surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; }
.aun-setup-topbar__actions { display: flex; align-items: center; gap: var(--sp-2); }
.aun-setup-main { width: 100%; max-width: 860px; margin: 0 auto; padding: var(--sp-6); }

.aun-wizard { display: flex; flex-direction: column; gap: var(--sp-5); }
.aun-stepper { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.aun-stepper__item { display: flex; align-items: center; gap: var(--sp-2); padding: 6px var(--sp-3); border-radius: var(--aun-radius-pill); border: 1px solid var(--border); background: var(--bg-surface); color: var(--txt-muted); font-size: 13px; font-weight: 600; }
.aun-stepper__item.is-active { border-color: var(--aun-teal); color: var(--aun-teal); background: var(--aun-teal-soft); }
.aun-stepper__item.is-done { color: var(--aun-teal); }
.aun-stepper__item.is-clickable { cursor: pointer; }
.aun-stepper__item.is-clickable:hover { border-color: var(--aun-teal); }
.aun-stepper__num { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--aun-idle-soft); color: inherit; font-size: 12px; }
.aun-stepper__item.is-active .aun-stepper__num, .aun-stepper__item.is-done .aun-stepper__num { background: var(--aun-teal); color: #fff; }

.aun-wizard__card { padding: var(--sp-6); }
.aun-wizard__title { font-family: var(--aun-font-head); font-size: 20px; color: var(--txt-strong); }
.aun-wizard__sub { margin: 4px 0 var(--sp-5); }
.aun-wizard__footer { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-top: var(--sp-6); padding-top: var(--sp-5); border-top: 1px solid var(--border); }
.aun-wizard__list { list-style: none; margin: var(--sp-3) 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.aun-wizard__list li { display: flex; align-items: center; gap: var(--sp-2); font-size: 14px; }
.aun-wizard__chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-3); }
.aun-chip-static { display: inline-flex; align-items: center; height: 30px; padding: 0 var(--sp-3); border-radius: var(--aun-radius-pill); background: var(--aun-idle-soft); color: var(--txt-strong); font-size: 13px; font-weight: 500; }
.aun-hr { height: 1px; background: var(--border); margin: var(--sp-5) 0; }

.aun-summary { display: flex; flex-direction: column; }
.aun-summary__logo { margin-bottom: var(--sp-4); }
.aun-summary__logo img { max-height: 64px; max-width: 180px; object-fit: contain; }
.aun-summary__row { display: flex; gap: var(--sp-4); padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.aun-summary__label { flex: 0 0 200px; color: var(--txt-muted); }
.aun-summary__value { color: var(--txt-strong); font-weight: 500; }

.aun-callout { display: flex; gap: var(--sp-3); align-items: flex-start; margin-top: var(--sp-5); padding: var(--sp-4); border-radius: var(--aun-radius-sm); font-size: 14px; }
.aun-callout--warning { background: var(--aun-warning-soft); color: var(--txt-strong); border: 1px solid color-mix(in srgb, var(--aun-warning) 40%, transparent); }
.aun-callout--warning svg { color: var(--aun-warning); flex: 0 0 auto; }

@media (max-width: 560px) { .aun-stepper__label { display: none; } .aun-summary__label { flex-basis: 120px; } }

/* Dashboard "complete setup" reminder (shown when setup was skipped) */
.aun-reminder { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-5); border-radius: var(--aun-radius-sm); background: var(--aun-warning-soft); border: 1px solid color-mix(in srgb, var(--aun-warning) 40%, transparent); font-size: 14px; }
.aun-reminder__icon { color: var(--aun-warning); display: grid; place-items: center; }
.aun-reminder__text { flex: 1 1 auto; color: var(--txt-strong); }
.aun-reminder__close { background: none; border: none; cursor: pointer; color: var(--txt-muted); font-size: 20px; line-height: 1; padding: 0 4px; }

/* ---------- Forms ---------- */
.aun-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--sp-4); align-self: flex-start; }
.aun-field__label { font-size: 13px; font-weight: 600; color: var(--txt-strong); }
.req { color: var(--aun-coral); margin-left: 2px; }
.aun-field__hint { font-size: 12px; color: var(--txt-muted); }
.aun-field__error { font-size: 12px; color: var(--aun-danger); font-weight: 500; }
.aun-field__hint, .aun-field__error { display: block; min-height: 18px; }
.aun-input, .aun-select, .aun-textarea {
  font-family: inherit; font-size: 14px; color: var(--txt); background: var(--bg-surface);
  border: 1px solid var(--border); border-radius: var(--aun-radius-sm); padding: 0 var(--sp-3); height: 40px; width: 100%;
  transition: border-color var(--aun-dur) var(--aun-ease), box-shadow var(--aun-dur) var(--aun-ease);
}
.aun-textarea { height: auto; min-height: 88px; padding: var(--sp-3); resize: vertical; }
.aun-input:focus, .aun-select:focus, .aun-textarea:focus { outline: none; border-color: var(--aun-teal); box-shadow: 0 0 0 3px var(--aun-teal-soft); }
.aun-input.invalid, .aun-select.invalid, .aun-textarea.invalid, .invalid .aun-input { border-color: var(--aun-danger); }
.aun-input::placeholder, .aun-textarea::placeholder { color: var(--txt-muted); }
.aun-input[type="number"]::-webkit-outer-spin-button, .aun-input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.aun-input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.aun-input-group { position: relative; display: flex; align-items: center; }
.aun-input-group__icon { position: absolute; left: 12px; color: var(--txt-muted); display: grid; place-items: center; pointer-events: none; }
.aun-input-group__icon ~ .aun-input { padding-left: 40px; }
/* On/off switch — an accessible styled checkbox for boolean settings (label wraps input + track + text). */
.aun-switch { display: inline-flex; align-items: flex-start; gap: var(--sp-2); cursor: pointer; }
.aun-switch > input { position: absolute; opacity: 0; width: 0; height: 0; }
.aun-switch__track { position: relative; flex: 0 0 auto; width: 38px; height: 22px; margin-top: 1px; border-radius: 999px; background: var(--border); transition: background var(--aun-dur) var(--aun-ease); }
.aun-switch__track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform var(--aun-dur) var(--aun-ease); }
.aun-switch > input:checked + .aun-switch__track { background: var(--aun-teal); }
.aun-switch > input:checked + .aun-switch__track::after { transform: translateX(16px); }
.aun-switch > input:focus-visible + .aun-switch__track { box-shadow: 0 0 0 3px var(--aun-teal-soft); }
/* Manager review drawer: goal/comments content left, its rating dropdown right, same row on desktop. */
.review-2col { display: grid; grid-template-columns: 1fr 170px; gap: var(--sp-3); align-items: start; }
@media (max-width: 720px) {
  .review-2col { grid-template-columns: 1fr; }
}

/* ---------- Table ---------- */
.aun-table-wrap { overflow-x: auto; border-radius: var(--aun-radius); border: 1px solid var(--border); background: var(--bg-surface); }
.aun-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.aun-table thead th { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--txt-muted); padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--bg-surface); position: sticky; top: 0; }
.aun-table thead th.text-center { text-align: center; }
.aun-table thead th.text-right { text-align: right; }
.aun-table tbody td { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border); color: var(--txt); vertical-align: middle; }
.aun-table tbody tr:last-child td { border-bottom: 0; }
.aun-table tbody tr { transition: background var(--aun-dur) var(--aun-ease); }
.aun-table tbody tr:hover { background: var(--aun-idle-soft); }
.aun-table--compact tbody td, .aun-table--compact thead th { padding: 6px var(--sp-3); }
.aun-table th.sortable { cursor: pointer; user-select: none; }
.aun-table th.sortable:hover { color: var(--txt-strong); }
.aun-table__num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Toolbar / pagination ---------- */
.aun-toolbar { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-4); }
.aun-pagination { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--border); flex-wrap: wrap; }
.aun-pagination__pages { display: flex; align-items: center; gap: 4px; }

/* ---------- Modal / Drawer ---------- */
/* Above .aun-drawer (101): a Modal/ConfirmDialog (e.g. Drawer's own discard-changes confirmation) must be
   able to interrupt an open drawer and stay visible on top of it. */
.aun-overlay { position: fixed; inset: 0; background: var(--overlay); backdrop-filter: blur(2px); z-index: 102; display: grid; place-items: center; padding: var(--sp-4); animation: aun-fade-in 140ms var(--aun-ease) both; }
.aun-modal { background: var(--bg-surface); border-radius: var(--aun-radius-lg); box-shadow: var(--aun-shadow-lg); width: 100%; max-width: 520px; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; animation: aun-fade-up 180ms var(--aun-ease) both; }
.aun-modal--lg { max-width: 760px; } .aun-modal--sm { max-width: 400px; }
.aun-modal__header { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-5) var(--sp-6); border-bottom: 1px solid var(--border); }
.aun-modal__title { font-family: var(--aun-font-head); font-weight: 600; font-size: 18px; }
.aun-modal__body { padding: var(--sp-6); overflow-y: auto; }
.aun-modal__footer { display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-2); padding: var(--sp-4) var(--sp-6); border-top: 1px solid var(--border); }
.aun-drawer-overlay { position: fixed; inset: 0; background: var(--overlay); z-index: 100; animation: aun-fade-in 140ms var(--aun-ease) both; }
.aun-drawer { position: fixed; top: 0; right: 0; height: 100vh; width: 440px; max-width: 92vw; background: var(--bg-surface); box-shadow: var(--aun-shadow-lg); z-index: 101; display: flex; flex-direction: column; animation: aun-slide-in 220ms var(--aun-ease) both; }
.aun-drawer.emp-drawer { width: 400px; }
/* Bulk-import wizard: a results table needs room, like the conveyance drawer. */
.aun-drawer.import-drawer { width: 720px; }
@media (max-width: 1024px) { .aun-drawer.import-drawer { width: 100vw; max-width: 100vw; } }
.aun-drawer.recruit-drawer { width: 400px; }
.aun-drawer.payroll-drawer { width: 400px; }
.aun-drawer.loan-drawer { width: 400px; }
.aun-drawer.review-drawer { width: 400px; }
.aun-drawer.performance-drawer { width: 400px; }
.aun-drawer.documents-drawer { width: 400px; }
@media (max-width: 1024px) { .aun-drawer.documents-drawer { width: 100vw; max-width: 100vw; } }
.aun-drawer.stop-drawer { width: 400px; }
@media (max-width: 1024px) { .aun-drawer.stop-drawer { width: 100vw; max-width: 100vw; } }
/* Conveyance claim drawer: several expense lines (type, date, amounts, receipt) need more room than a one-field form. */
.aun-drawer.conveyance-drawer { width: 560px; }
@media (max-width: 1024px) { .aun-drawer.conveyance-drawer { width: 100vw; max-width: 100vw; } }
/* One expense line inside a claim, in both the entry form and the read-only view. */
.conv-line { display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-4); border: 1px solid var(--border); border-radius: var(--aun-radius-sm); background: var(--bg-surface); margin-bottom: var(--sp-3); }
.conv-line:focus { outline: none; }
.conv-line--invalid { border-color: var(--aun-danger); }
/* .aun-field is align-self:flex-start with its own bottom margin — in this flex column that would shrink each field to
   its content width and double the spacing, so let fields fill the card and leave the spacing to `gap`. */
.conv-line > .aun-field { align-self: stretch; }
.conv-line .aun-field { margin-bottom: 0; }
.conv-figures { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); }
.conv-figure { display: flex; flex-direction: column; gap: 2px; }
.conv-figure__label { font-size: 12px; color: var(--txt-muted); }
.conv-figure__value { font-variant-numeric: tabular-nums; font-weight: 600; }
.conv-figure--approved .conv-figure__value { color: var(--aun-teal-strong); }
/* Geo-fence zone drawer: the full-width page map must stay clickable underneath (drop the zone centre /
   draw a polygon) while the drawer is open, so this drawer's backdrop is transparent and non-blocking
   instead of a click-to-close scrim. It's closed via the drawer's X or the Cancel button. */
.aun-drawer-overlay:has(+ .aun-drawer.geo-drawer) { background: transparent; pointer-events: none; }
@keyframes aun-slide-in { from { transform: translateX(100%); } to { transform: none; } }
.aun-drawer__header { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-5) var(--sp-6); border-bottom: 1px solid var(--border); }
.aun-drawer__body { padding: var(--sp-6); overflow-y: auto; flex: 1 1 auto; }
.aun-drawer__footer { display: flex; gap: var(--sp-2); justify-content: flex-end; padding: var(--sp-4) var(--sp-6); border-top: 1px solid var(--border); }

/* ---------- Toast ---------- */
.aun-toast-host { position: fixed; top: var(--sp-5); right: var(--sp-5); z-index: 200; display: flex; flex-direction: column; gap: var(--sp-3); width: 360px; max-width: calc(100vw - 32px); }
.aun-toast { display: flex; gap: var(--sp-3); align-items: flex-start; background: var(--bg-surface); border: 1px solid var(--border); border-left: 4px solid var(--aun-info); border-radius: var(--aun-radius-sm); box-shadow: var(--aun-shadow-lg); padding: var(--sp-4); animation: aun-slide-in 220ms var(--aun-ease) both; }
.aun-toast--success { border-left-color: var(--aun-success); } .aun-toast--success .aun-toast__icon { color: var(--aun-success); }
.aun-toast--error { border-left-color: var(--aun-danger); } .aun-toast--error .aun-toast__icon { color: var(--aun-danger); }
.aun-toast--warning { border-left-color: var(--aun-warning); } .aun-toast--warning .aun-toast__icon { color: var(--aun-warning); }
.aun-toast--info .aun-toast__icon { color: var(--aun-info); }
.aun-toast__icon { flex: none; margin-top: 1px; }
.aun-toast__title { font-weight: 600; color: var(--txt-strong); margin-bottom: 2px; }
.aun-toast__msg { font-size: 13px; color: var(--txt-muted); }
.aun-toast__close { margin-left: auto; cursor: pointer; color: var(--txt-muted); background: none; border: 0; }

/* ---------- Skeleton ---------- */
.aun-skeleton { background: linear-gradient(90deg, var(--aun-idle-soft) 25%, color-mix(in srgb, var(--aun-idle-soft) 60%, var(--bg-surface)) 37%, var(--aun-idle-soft) 63%); background-size: 800px 100%; animation: aun-shimmer 1.4s infinite linear; border-radius: 8px; }
.aun-skeleton--text { height: 12px; margin: 6px 0; } .aun-skeleton--title { height: 20px; width: 40%; } .aun-skeleton--circle { border-radius: 50%; }

/* ---------- Empty state ---------- */
.aun-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--sp-3); padding: var(--sp-12) var(--sp-6); }
.aun-empty__art { width: 88px; height: 88px; border-radius: 24px; display: grid; place-items: center; background: linear-gradient(135deg, var(--aun-coral-soft), var(--aun-teal-soft)); color: var(--aun-teal-strong); }
.aun-empty__art svg { width: 40px; height: 40px; }
.aun-empty__title { font-family: var(--aun-font-head); font-weight: 600; font-size: 17px; color: var(--txt-strong); }
.aun-empty__text { color: var(--txt-muted); max-width: 360px; }

/* ---------- Spinner ---------- */
.aun-spinner { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: aun-spin .7s linear infinite; display: inline-block; }

/* ---------- Auth (split-panel login) ---------- */
.aun-auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.aun-auth__brandpanel { position: relative; overflow: hidden; background: linear-gradient(140deg, var(--aun-coral) 0%, var(--aun-coral-strong) 40%, var(--aun-teal-strong) 100%); color: #fff; padding: var(--sp-12); display: flex; flex-direction: column; justify-content: space-between; }
.aun-auth__brandpanel::before { content: ""; position: absolute; width: 520px; height: 520px; right: -160px; top: -160px; border-radius: 50%; background: rgba(255,255,255,.12); }
.aun-auth__brandpanel::after { content: ""; position: absolute; width: 340px; height: 340px; left: -120px; bottom: -120px; border-radius: 50%; background: rgba(255,255,255,.08); }
.aun-auth__brandmark { display: flex; align-items: center; gap: var(--sp-3); position: relative; z-index: 1; }
.aun-auth__headline { position: relative; z-index: 1; max-width: 420px; }
.aun-auth__headline h2 { color: #fff; font-size: 36px; line-height: 1.15; }
.aun-auth__headline p { color: rgba(255,255,255,.85); font-size: 16px; margin-top: var(--sp-4); }
.aun-auth__features { position: relative; z-index: 1; display: flex; flex-direction: column; gap: var(--sp-3); }
.aun-auth__feature { display: flex; align-items: center; gap: var(--sp-3); color: rgba(255,255,255,.92); }
.aun-auth__feature-dot { width: 28px; height: 28px; border-radius: 8px; background: rgba(255,255,255,.18); display: grid; place-items: center; }
.aun-auth__formpanel { display: flex; align-items: center; justify-content: center; padding: var(--sp-8); background: var(--bg); }
.aun-auth__form { width: 100%; max-width: 380px; }
.aun-auth__form h1 { font-size: 26px; margin-bottom: var(--sp-1); }
.aun-auth__form .sub { color: var(--txt-muted); margin-bottom: var(--sp-6); }

/* ---------- Blazor error UI ---------- */
#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000; background: var(--aun-ink); color: #fff; padding: var(--sp-3) var(--sp-5); box-shadow: var(--aun-shadow-lg); align-items: center; gap: var(--sp-4); }
#blazor-error-ui.show, #blazor-error-ui[style*="block"] { display: flex; }
#blazor-error-ui .reload { color: var(--aun-teal); font-weight: 600; }
#blazor-error-ui .dismiss { cursor: pointer; margin-left: auto; font-size: 18px; }

/* ---------- Responsive ---------- */
.aun-sidebar__toggle, .aun-mobile-only { display: none; }
/* The scrim is ALWAYS fixed (so it is never a grid item) and hidden by default; it appears only as the
   mobile drawer backdrop. This is what stops the toggle from breaking the desktop grid: when the shell
   renders the scrim div, it must not occupy a grid cell. */
.aun-scrim { position: fixed; inset: 0; background: var(--overlay); z-index: 110; display: none; }
@media (max-width: 1024px) {
  .aun-shell { grid-template-columns: 1fr; }
  .aun-sidebar { position: fixed; z-index: 120; width: var(--aun-sidebar-w); transform: translateX(-100%); transition: transform var(--aun-dur) var(--aun-ease); }
  .aun-shell--mobile-open .aun-sidebar { transform: none; box-shadow: var(--aun-shadow-lg); }
  .aun-shell--mobile-open .aun-scrim { display: block; }
  .aun-mobile-only { display: inline-grid; }
  .aun-topbar__search { width: 180px; }
  /* Cap the chip labels on medium widths so a long company/user name truncates rather than eating the bar. */
  .aun-topbar .aun-chip > span:not([class*="avatar"]) { max-width: 150px; }
  /* Add/Edit employee modal: stack its 2-column field grid on tablet + phone. */
  .emp-form-grid { grid-template-columns: 1fr !important; }
  /* Add stop drawer: same 2-column-to-1-column collapse. */
  .stop-form-grid { grid-template-columns: 1fr !important; }
  /* Report builder: Entity + Columns side-by-side row, same 2-column-to-1-column collapse. */
  .report-builder-fields { grid-template-columns: 1fr !important; }
  /* Employee Overview snapshot tiles: force-horizontal on desktop (below), stack below tablet width. */
  .emp-ov-stats-2, .emp-ov-stats-3, .emp-ov-stats-4 { grid-template-columns: 1fr !important; }
  /* Visit Schedule toolbar: allow wrapping again below desktop widths. */
  .visit-schedule-actions { flex-wrap: wrap; white-space: normal; }
  /* Live Field Map toolbar: allow wrapping again below desktop widths. */
  .live-map-actions { flex-wrap: wrap; white-space: normal; }
}
@media (max-width: 720px) {
  .aun-auth { grid-template-columns: 1fr; }
  .aun-auth__brandpanel { display: none; }
  .aun-shell__content { padding: var(--sp-4); overflow-x: hidden; }
  .aun-topbar { padding: 0 var(--sp-4); }
  .aun-topbar__search { display: none; }
  /* On phones, stack any 2-column dashboard/content grids into a single column. */
  .aun-grid[style*="2fr"] { grid-template-columns: 1fr !important; }
}
@media (max-width: 640px) {
  /* Collapse top-bar chips to just their icon/avatar so the bar never overflows on phones.
     Hides the text label (company name, user name/role) and the trailing chevron. */
  .aun-topbar .aun-chip > span:not([class*="avatar"]) { display: none; }
  .aun-topbar .aun-chip > .aun-icon:last-child { display: none; }
  .aun-topbar .aun-chip { gap: 0; padding: 0 var(--sp-2); }
}

/* ── Geo-punch & zones ─────────────────────────────────────────────────── */
.geo-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: var(--sp-5); align-items: start; }
.geo-stage {
  position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: var(--aun-radius);
  overflow: hidden; background: #0E161D; display: grid; place-items: center;
}
.geo-stage video, .geo-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.geo-stage__placeholder { display: grid; gap: var(--sp-2); place-items: center; color: var(--aun-idle); }
.geo-stage__gps {
  position: absolute; left: var(--sp-3); bottom: var(--sp-3); z-index: 2;
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: var(--aun-radius-pill);
  background: rgba(14,22,29,.72); color: #fff; font-size: 12px; backdrop-filter: blur(6px);
}
.geo-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--sp-4); }
.geo-tile { padding: 0; overflow: hidden; }
.geo-tile img { width: 100%; height: 130px; object-fit: cover; display: block; background: var(--aun-idle-soft); }
.geo-tile__body { padding: var(--sp-3); display: grid; gap: 4px; }
.aun-mapview { z-index: 0; }
.leaflet-container { font-family: var(--aun-font-body); border-radius: var(--aun-radius); }
/* Draggable polygon vertex handle for the geo-fence builder (two classes beat Leaflet's .leaflet-div-icon). */
.leaflet-marker-icon.aun-vtx-handle {
  background: var(--aun-coral); border: 2px solid #fff; border-radius: 50%;
  box-shadow: 0 1px 4px rgba(21, 32, 43, .45); cursor: grab;
}
.leaflet-marker-icon.aun-vtx-handle:active { cursor: grabbing; }
/* The first vertex turns teal once 3+ points exist — click it to close the shape (Google-Earth style). */
.leaflet-marker-icon.aun-vtx-close {
  background: var(--aun-teal); border: 3px solid #fff; cursor: pointer;
  box-shadow: 0 0 0 3px var(--aun-teal-soft), 0 1px 5px rgba(21, 32, 43, .5);
}
@media (max-width: 900px) { .geo-grid { grid-template-columns: 1fr; } }

/* ── Field tracking ── */
.aun-statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--sp-4); }
/* Employee Overview snapshot cards: each card is sized (via inline flex-basis) to roughly fit its own
   tile count, so the tiles below force a FIXED horizontal column count instead of .aun-statgrid's own
   auto-fit — auto-fit would collapse to 1 column once a card's own width drops below ~2x150px, which is
   exactly what made these tiles stack vertically before. Collapsed back to 1 column below tablet width
   in the @media(max-width:1024px) block above, matching this file's established collapse convention. */
.emp-ov-stats { display: grid; gap: var(--sp-3); }
.emp-ov-stats-2 { grid-template-columns: repeat(2, 1fr); }
.emp-ov-stats-3 { grid-template-columns: repeat(3, 1fr); }
.emp-ov-stats-4 { grid-template-columns: repeat(4, 1fr); }
/* Tablet: fixed 3-up so a 5-tile row wraps to a balanced 3+2 instead of an orphaned 4+1 (auto-fit's
   in-between count), then a single column on small phones. */
@media (min-width: 481px) and (max-width: 1024px) { .aun-statgrid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 480px) { .aun-statgrid { grid-template-columns: 1fr; } }

/* Branch Payroll Progress: 5 status-count tiles keep the shared .aun-statgrid rules above unchanged
   (that's exactly the tile count they were already tuned for). Gross/Net get their own always-2-up
   "money" treatment below — larger, tinted, more breathing room than a plain status count. */
.aun-statgrid--money { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5); }
.aun-statgrid--money .aun-stat {
  padding: var(--sp-6);
  background: var(--aun-tint, var(--aun-teal-soft));
  box-shadow: var(--aun-shadow-md);
}
.aun-statgrid--money .aun-stat__label { font-size: 14px; font-weight: 600; color: var(--txt-strong); }
.aun-statgrid--money .aun-stat__value { font-size: clamp(30px, 6vw, 36px); }
@media (max-width: 480px) {
  .aun-statgrid--money { grid-template-columns: 1fr; }
}
.geo-seq { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--aun-teal-soft); color: var(--aun-teal-strong); font-size: 12px; font-weight: 700; }
.aun-progress { height: 6px; border-radius: 999px; background: var(--aun-idle-soft); overflow: hidden; }
.aun-progress__bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--aun-teal), var(--aun-coral)); transition: width .4s var(--aun-ease); }
.geo-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--aun-idle); display: inline-block; }
.geo-live-dot.on { background: var(--aun-ok); box-shadow: 0 0 0 0 rgba(24,169,87,.6); animation: aun-pulse-dot 1.8s infinite; }
@keyframes aun-pulse-dot { 0% { box-shadow: 0 0 0 0 rgba(24,169,87,.5); } 70% { box-shadow: 0 0 0 7px rgba(24,169,87,0); } 100% { box-shadow: 0 0 0 0 rgba(24,169,87,0); } }

/* ── Recruitment kanban ── */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(180px, 1fr)); gap: var(--sp-3); align-items: start; overflow-x: auto; }
.kanban__col { background: var(--bg); border: 1px solid var(--border); border-radius: var(--aun-radius); padding: var(--sp-3); min-height: 120px; }
.kanban__head { display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: 13px; margin-bottom: var(--sp-3); color: var(--txt-strong); }
.kanban__count { background: var(--aun-teal-soft); color: var(--aun-teal-strong); border-radius: 999px; padding: 1px 8px; font-size: 12px; }
.kanban__card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 10px; padding: var(--sp-3); margin-bottom: var(--sp-3); box-shadow: var(--aun-shadow-sm); }
.kanban__empty { text-align: center; color: var(--txt-muted); padding: var(--sp-4) 0; }

/* ── Reports ── */
.aun-cardgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--sp-4); }
/* Dashboard "Today's attendance feed": the table (desktop) is swapped for a compact card list on phones. */
.dash-feed-cards { display: none; }
.dash-feed-card { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) 0; border-bottom: 1px solid var(--border); }
.dash-feed-card:last-child { border-bottom: 0; }
.dash-feed-card__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) {
  .dash-feed-table { display: none; }
  .dash-feed-cards { display: flex; flex-direction: column; }
}
.report-card { display: flex; flex-direction: column; gap: var(--sp-2); align-items: flex-start; min-height: 150px; }
.report-card__icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--aun-teal-soft); color: var(--aun-teal-strong); }
.aun-divider { height: 1px; background: var(--border); margin: var(--sp-1) 0; }

/* ── Export menu (shared Excel / CSV / PDF split button) ── */
.aun-exportmenu { position: relative; display: inline-block; }
.aun-exportmenu__backdrop { position: fixed; inset: 0; z-index: 49; background: transparent; border: 0; cursor: default; }
.aun-exportmenu__menu { top: calc(100% + 6px); right: 0; min-width: 170px; z-index: 50; }

/* ── Charts (inline SVG / CSS — no JS library; colours come from tokens so dark mode is automatic; the global
      prefers-reduced-motion rule already collapses these animations) ── */
.aun-chartcard { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
.aun-chartcard__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.aun-chartcard__title { margin: 0; font-size: 15px; }
.aun-chartgrid { display: grid; gap: var(--sp-4); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 720px) { .aun-chartgrid { grid-template-columns: minmax(0, 1fr); } }

.aun-chart { width: 100%; }
.aun-chart__svg { width: 100%; height: auto; display: block; overflow: visible; }
.aun-chart__grid { stroke: var(--border); stroke-width: 1; }
.aun-chart__tick { fill: var(--txt-muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.aun-chart__line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: aun-chart-draw 900ms var(--aun-ease) forwards; }
.aun-chart__line--teal { stroke: var(--aun-teal); } .aun-chart__line--coral { stroke: var(--aun-coral); } .aun-chart__line--info { stroke: var(--aun-info); }
.aun-chart__area { opacity: .14; }
.aun-chart__area--teal { fill: var(--aun-teal); } .aun-chart__area--coral { fill: var(--aun-coral); } .aun-chart__area--info { fill: var(--aun-info); }
.aun-chart__dot { fill: var(--bg-surface); stroke-width: 2; }
.aun-chart__dot--teal { stroke: var(--aun-teal); } .aun-chart__dot--coral { stroke: var(--aun-coral); } .aun-chart__dot--info { stroke: var(--aun-info); }
@keyframes aun-chart-draw { to { stroke-dashoffset: 0; } }
@keyframes aun-chart-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.aun-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.aun-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.aun-bars__row { display: grid; grid-template-columns: minmax(70px, 34%) 1fr auto; align-items: center; gap: var(--sp-3); font-size: 13px; }
.aun-bars__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--txt); }
.aun-bars__track { height: 10px; background: var(--aun-idle-soft); border-radius: 99px; overflow: hidden; }
.aun-bars__bar { display: block; height: 100%; border-radius: 99px; transform-origin: left; animation: aun-chart-grow 700ms var(--aun-ease) both; }
.aun-bars__value { min-width: 2ch; text-align: right; color: var(--txt-strong); font-weight: 600; }

.aun-chart-c0 { background: var(--aun-teal); } .aun-chart-c1 { background: var(--aun-coral); } .aun-chart-c2 { background: var(--aun-info); }
.aun-chart-c3 { background: var(--aun-warning); } .aun-chart-c4 { background: var(--aun-success); } .aun-chart-c5 { background: var(--aun-slate); }
.aun-chart-s0 { stroke: var(--aun-teal); } .aun-chart-s1 { stroke: var(--aun-coral); } .aun-chart-s2 { stroke: var(--aun-info); }
.aun-chart-s3 { stroke: var(--aun-warning); } .aun-chart-s4 { stroke: var(--aun-success); } .aun-chart-s5 { stroke: var(--aun-slate); }

.aun-donut { display: flex; align-items: center; gap: var(--sp-5); flex-wrap: wrap; }
.aun-donut__svg { width: 160px; height: 160px; flex: none; }
.aun-donut__ring { stroke: var(--border); }
.aun-donut__slice { transition: stroke-dasharray .6s var(--aun-ease); }
.aun-donut__total { font-size: 6px; font-weight: 700; fill: var(--txt-strong); font-variant-numeric: tabular-nums; }
.aun-donut__caption { font-size: 2.6px; fill: var(--txt-muted); }
.aun-donut__legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.aun-donut__swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; }

/* Tiny inline arrow buttons (column reorder chips in the Report Builder). */
.aun-linkbtn { border: 0; background: transparent; color: var(--txt-muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; }
.aun-linkbtn:hover:not(:disabled) { color: var(--aun-teal); }
.aun-linkbtn:disabled { opacity: .35; cursor: default; }

/* Dashboard two-column layout: both columns stretch to the same height and the LAST card of each column grows to
   fill it, so there is never an empty gap under the shorter column (the old separate-rows layout left one). */
.dash-cols > .dash-col > .aun-card:last-child { flex: 1 1 auto; }
/* Long team tables scroll inside their card (header stays put) instead of stretching the whole dashboard column. */
.dash-scroll { max-height: 520px; overflow: auto; }
.dash-scroll thead th { position: sticky; top: 0; z-index: 1; background: var(--bg-surface); }

/* ── Employee import wizard ── */
.imp-steps { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-5); flex-wrap: wrap; }
.imp-step { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--txt-muted); }
.imp-step__dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: var(--aun-idle-soft); color: var(--txt-muted); }
.imp-step.is-active { color: var(--txt-strong); font-weight: 600; }
.imp-step.is-active .imp-step__dot { background: var(--aun-teal); color: #fff; }
.imp-step.is-done .imp-step__dot { background: var(--aun-success); color: #fff; }
.imp-step + .imp-step::before { content: ""; width: 24px; height: 1px; background: var(--border); margin-right: 4px; align-self: center; }
.imp-issues { margin: 0; padding-left: var(--sp-4); font-size: 12.5px; }
.imp-issues li { margin: 2px 0; }
.imp-issues .is-warning { color: var(--txt-muted); }
.imp-issues .is-error { color: var(--aun-danger); }
.imp-tablewrap { max-height: 46vh; overflow: auto; border: 1px solid var(--border); border-radius: var(--aun-radius-sm); }
.imp-tablewrap thead th { position: sticky; top: 0; z-index: 1; background: var(--bg-surface); }
/* Import wizard on small screens: wrap the footer actions instead of clipping them, show the four summary tiles 2×2, and drop the
   step connectors that would otherwise orphan on a second line. */
.import-drawer .aun-drawer__footer { flex-wrap: wrap; justify-content: flex-end; }
.import-drawer .aun-statgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }   /* beats the generic tablet 3-column rule: 4 tiles must not wrap 3+1 */
@media (max-width: 720px) {
  .import-drawer .aun-statgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
  .import-drawer .aun-stat { padding: var(--sp-3) var(--sp-4); }
}
@media (max-width: 480px) {
  .imp-step + .imp-step::before { display: none; }
  .imp-steps { gap: var(--sp-4); }
}
