/* ============================================================================
   Sanjivani HR - shared design system
   ----------------------------------------------------------------------------
   Loaded once by HR.Master. Pages must not load their own Bootstrap, Tailwind,
   fonts or icon sets; use the classes below instead of per-page <style> blocks.

   Sections
     1. Tokens (light + dark)
     2. Base / Bootstrap bridge
     3. App layout (sidebar, topbar, content)
     4. Page header, cards, stat tiles, hero banner
     5. Tables (GridView) + pager
     6. Forms + buttons
     7. Badges, alerts, empty state, tabs, avatar, misc
     8. Utilities
     9. Call overlay (SignalR / WebRTC)
    10. Responsive + print
   ============================================================================ */

/* ---------------------------------------------------------------- 1. Tokens */
:root {
    --hr-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    /* brand (from the Sanjivani flower logo) */
    --hr-primary: #ea5a2a;
    --hr-primary-hover: #d24a1d;
    --hr-primary-active: #b93f16;
    --hr-primary-soft: #fdeee7;
    --hr-primary-soft-text: #b93f16;
    --hr-primary-rgb: 234, 90, 42;
    --hr-ring: rgba(234, 90, 42, 0.22);

    /* neutrals */
    --hr-bg: #f4f5f7;
    --hr-surface: #ffffff;
    --hr-surface-2: #f9fafb;
    --hr-hover: #f3f4f6;
    --hr-border: #e5e7eb;
    --hr-border-strong: #d1d5db;
    --hr-text: #111827;
    --hr-text-2: #374151;
    --hr-muted: #6b7280;
    --hr-subtle: #9ca3af;

    /* semantic */
    --hr-success: #16a34a;      --hr-success-soft: #ecfdf3;   --hr-success-text: #15803d;
    --hr-warning: #d97706;      --hr-warning-soft: #fffbeb;   --hr-warning-text: #b45309;
    --hr-danger: #dc2626;       --hr-danger-soft: #fef2f2;    --hr-danger-text: #b91c1c;
    --hr-info: #2563eb;         --hr-info-soft: #eff6ff;      --hr-info-text: #1d4ed8;

    /* shape + elevation */
    --hr-radius-sm: 6px;
    --hr-radius: 10px;
    --hr-radius-lg: 14px;
    --hr-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
    --hr-shadow: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
    --hr-shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.12);

    /* layout */
    --hr-sidebar-w: 256px;
    --hr-sidebar-w-collapsed: 72px;
    --hr-topbar-h: 64px;
    --hr-content-pad: 1.75rem 2rem 2.5rem;
    --hr-transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);

    /* control metrics */
    --hr-control-h: 38px;
    --hr-control-h-sm: 32px;
    --hr-control-h-lg: 44px;

    /* Bootstrap bridge - keeps any BS5 markup on brand */
    --bs-body-font-family: var(--hr-font);
    --bs-body-bg: var(--hr-bg);
    --bs-body-color: var(--hr-text);
    --bs-border-color: var(--hr-border);
    --bs-border-radius: var(--hr-radius-sm);
    --bs-primary: var(--hr-primary);
    --bs-primary-rgb: var(--hr-primary-rgb);
    --bs-link-color: var(--hr-primary);
    --bs-link-hover-color: var(--hr-primary-hover);
    --bs-secondary-color: var(--hr-muted);
    --bs-tertiary-bg: var(--hr-surface-2);
}

body.dark {
    --hr-bg: #0f1116;
    --hr-surface: #171a21;
    --hr-surface-2: #1c2029;
    --hr-hover: #222732;
    --hr-border: #262b36;
    --hr-border-strong: #343a47;
    --hr-text: #e7e9ee;
    --hr-text-2: #c9cdd6;
    --hr-muted: #9aa1ae;
    --hr-subtle: #6b7280;

    --hr-primary-soft: rgba(234, 90, 42, 0.16);
    --hr-primary-soft-text: #ff8b5f;
    --hr-ring: rgba(234, 90, 42, 0.32);

    --hr-success-soft: rgba(22, 163, 74, 0.16);   --hr-success-text: #4ade80;
    --hr-warning-soft: rgba(217, 119, 6, 0.16);   --hr-warning-text: #fbbf24;
    --hr-danger-soft: rgba(220, 38, 38, 0.16);    --hr-danger-text: #f87171;
    --hr-info-soft: rgba(37, 99, 235, 0.16);      --hr-info-text: #60a5fa;

    --hr-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --hr-shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.4);
    --hr-shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);
}

/* --------------------------------------------- 2. Base / Bootstrap bridge */
*, *::before, *::after { box-sizing: border-box; }

html { overflow-x: hidden; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--hr-font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--hr-text);
    background: var(--hr-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a { color: var(--hr-primary); text-decoration: none; }
a:hover { color: var(--hr-primary-hover); }

h1, h2, h3, h4, h5, h6 { color: var(--hr-text); font-weight: 600; line-height: 1.25; margin: 0 0 0.5rem; }

img { max-width: 100%; }

::selection { background: var(--hr-primary-soft); color: var(--hr-primary-soft-text); }

/* thin scrollbars everywhere */
* { scrollbar-width: thin; scrollbar-color: var(--hr-border-strong) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--hr-border-strong); border-radius: 8px; }
*::-webkit-scrollbar-track { background: transparent; }

/* Bootstrap component overrides so BS markup matches the theme */
.btn-primary {
    --bs-btn-bg: var(--hr-primary);
    --bs-btn-border-color: var(--hr-primary);
    --bs-btn-hover-bg: var(--hr-primary-hover);
    --bs-btn-hover-border-color: var(--hr-primary-hover);
    --bs-btn-active-bg: var(--hr-primary-active);
    --bs-btn-active-border-color: var(--hr-primary-active);
    --bs-btn-focus-shadow-rgb: var(--hr-primary-rgb);
}
.btn-outline-primary {
    --bs-btn-color: var(--hr-primary);
    --bs-btn-border-color: var(--hr-primary);
    --bs-btn-hover-bg: var(--hr-primary);
    --bs-btn-hover-border-color: var(--hr-primary);
    --bs-btn-active-bg: var(--hr-primary-active);
    --bs-btn-active-border-color: var(--hr-primary-active);
}
.form-control, .form-select {
    background-color: var(--hr-surface);
    border-color: var(--hr-border-strong);
    color: var(--hr-text);
    border-radius: 8px;
    min-height: var(--hr-control-h);
    font-size: 0.875rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--hr-primary);
    box-shadow: 0 0 0 3px var(--hr-ring);
}
.modal-content {
    background: var(--hr-surface);
    color: var(--hr-text);
    border: 1px solid var(--hr-border);
    border-radius: var(--hr-radius-lg);
    box-shadow: var(--hr-shadow-lg);
}
.modal-header, .modal-footer { border-color: var(--hr-border); }
.modal-title { font-weight: 600; font-size: 1rem; }
.table { --bs-table-bg: transparent; --bs-table-color: var(--hr-text); --bs-table-border-color: var(--hr-border); }
.dropdown-menu { background: var(--hr-surface); border-color: var(--hr-border); box-shadow: var(--hr-shadow-lg); border-radius: var(--hr-radius); }
.dropdown-item { color: var(--hr-text-2); }
.dropdown-item:hover { background: var(--hr-hover); color: var(--hr-text); }

/* SweetAlert2 on brand */
.swal2-popup { font-family: var(--hr-font) !important; border-radius: var(--hr-radius-lg) !important; background: var(--hr-surface) !important; color: var(--hr-text) !important; }
.swal2-title { font-size: 1.125rem !important; font-weight: 600 !important; }
.swal2-html-container { font-size: 0.9rem !important; color: var(--hr-muted) !important; }
.swal2-confirm { background: var(--hr-primary) !important; border-radius: 8px !important; box-shadow: none !important; }
.swal2-cancel { border-radius: 8px !important; }

/* ------------------------------------------------------------ 3. App layout */
#wrapper { position: relative; min-height: 100vh; }

#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--hr-sidebar-w);
    background: var(--hr-surface);
    border-right: 1px solid var(--hr-border);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: width var(--hr-transition), transform var(--hr-transition);
}

#sidebar .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    height: var(--hr-topbar-h);
    padding: 0 18px;
    border-bottom: 1px solid var(--hr-border);
    color: var(--hr-text);
    white-space: nowrap;
    overflow: hidden;
    flex-shrink: 0;
}
#sidebar .brand .logo-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 10px;
    background: var(--hr-primary-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
}
#sidebar .brand .logo-icon img { width: 100%; height: 100%; object-fit: contain; }
#sidebar .brand .brand-text { display: flex; flex-direction: column; line-height: 1.15; }
#sidebar .brand .brand-text .text { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
#sidebar .brand .brand-sub { font-size: 11px; font-weight: 500; color: var(--hr-muted); }

#sidebar .side-menu {
    list-style: none;
    margin: 0;
    padding: 12px 12px 24px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
}
#sidebar .side-menu li { margin: 0; }
#sidebar .side-menu li.menu-label {
    padding: 16px 12px 6px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--hr-subtle);
    white-space: nowrap;
}
#sidebar .side-menu li.menu-label:first-child { padding-top: 4px; }

#sidebar .side-menu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 38px;
    padding: 0 12px;
    margin: 2px 0;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--hr-text-2);
    white-space: nowrap;
    overflow: hidden;
    transition: background var(--hr-transition), color var(--hr-transition);
}
#sidebar .side-menu li a i {
    font-size: 19px;
    width: 22px;
    min-width: 22px;
    text-align: center;
    color: var(--hr-subtle);
    transition: color var(--hr-transition);
}
#sidebar .side-menu li a .text { flex: 1; overflow: hidden; text-overflow: ellipsis; }
#sidebar .side-menu li a:hover { background: var(--hr-hover); color: var(--hr-text); }
#sidebar .side-menu li a:hover i { color: var(--hr-text); }
#sidebar .side-menu li.active > a {
    background: var(--hr-primary-soft);
    color: var(--hr-primary-soft-text);
    font-weight: 600;
}
#sidebar .side-menu li.active > a i { color: var(--hr-primary); }

/* submenu */
#sidebar .side-menu .submenu-icon { margin-left: auto; font-size: 16px !important; width: auto !important; min-width: 0 !important; transition: transform var(--hr-transition); }
#sidebar .side-menu .has-submenu.open > a .submenu-icon { transform: rotate(180deg); }
#sidebar .side-menu .submenu {
    list-style: none;
    margin: 0;
    padding: 0 0 0 12px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
#sidebar .side-menu .has-submenu.open > .submenu { max-height: 640px; }
#sidebar .side-menu .submenu li a { height: 34px; font-size: 13px; padding-left: 22px; position: relative; }
#sidebar .side-menu .submenu li a i { font-size: 16px; }
#sidebar .side-menu .submenu li a::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 50%;
    width: 6px;
    height: 6px;
    margin-top: -3px;
    border-radius: 50%;
    background: var(--hr-border-strong);
}
#sidebar .side-menu .submenu li.active > a::before { background: var(--hr-primary); }

/* collapsed sidebar (desktop) */
#sidebar.hide { width: var(--hr-sidebar-w-collapsed); }
#sidebar.hide .brand { padding: 0 18px; justify-content: center; }
#sidebar.hide .brand .brand-text,
#sidebar.hide .side-menu .text,
#sidebar.hide .side-menu .submenu-icon,
#sidebar.hide .side-menu .menu-label,
#sidebar.hide .side-menu .submenu { display: none; }
#sidebar.hide .side-menu { padding: 12px 10px; }
#sidebar.hide .side-menu li a { justify-content: center; padding: 0; }
#sidebar.hide .side-menu li a i { width: auto; }

#sidebar .sidebar-footer {
    border-top: 1px solid var(--hr-border);
    padding: 12px 16px;
    font-size: 11px;
    color: var(--hr-subtle);
    white-space: nowrap;
    overflow: hidden;
}
#sidebar.hide .sidebar-footer { display: none; }

#sidebarOverlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.5);
    z-index: 1035;
}

#content {
    position: relative;
    margin-left: var(--hr-sidebar-w);
    min-height: 100vh;
    transition: margin-left var(--hr-transition);
}
#sidebar.hide ~ #content { margin-left: var(--hr-sidebar-w-collapsed); }

/* topbar */
#content nav.topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    height: var(--hr-topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 2rem;
    background: var(--hr-surface);
    border-bottom: 1px solid var(--hr-border);
}
.topbar .left-icons { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1; }
.topbar .icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 0;
    background: transparent;
    color: var(--hr-muted);
    font-size: 20px;
    cursor: pointer;
    position: relative;
    transition: background var(--hr-transition), color var(--hr-transition);
}
.topbar .icon-btn:hover { background: var(--hr-hover); color: var(--hr-text); }
.topbar .page-title-nav { display: flex; flex-direction: column; min-width: 0; }
.topbar .page-title-nav .title { font-size: 15.5px; font-weight: 600; color: var(--hr-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .page-title-nav .crumbs { font-size: 12px; color: var(--hr-subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .page-title-nav .crumbs a { color: var(--hr-muted); }
.topbar .page-title-nav .crumbs a:hover { color: var(--hr-primary); }
.topbar .page-title-nav .crumbs .sep { margin: 0 6px; opacity: 0.6; }
.topbar .right-icons { display: flex; align-items: center; gap: 6px; }

.topbar .nav-notification .dot {
    position: absolute;
    top: 7px;
    right: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--hr-danger);
    border: 2px solid var(--hr-surface);
    display: none;
}
.topbar .nav-notification.has-unread .dot { display: block; }

/* theme switch */
.theme-switch { display: inline-flex; align-items: center; gap: 6px; padding: 0 4px; }
.theme-switch .checkbox { display: none; }
.theme-switch .switch-lm {
    position: relative;
    width: 42px;
    height: 24px;
    border-radius: 24px;
    background: var(--hr-border);
    cursor: pointer;
    transition: background var(--hr-transition);
    margin: 0;
}
.theme-switch .switch-lm .ball {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--hr-surface);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    transition: transform var(--hr-transition);
}
.theme-switch .checkbox:checked + .switch-lm { background: var(--hr-primary); }
.theme-switch .checkbox:checked + .switch-lm .ball { transform: translateX(18px); }
.theme-switch i { font-size: 16px; color: var(--hr-subtle); }

/* profile menu */
.profile-container { position: relative; margin-left: 6px; }
.profile-icon {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 6px 4px 4px;
    border-radius: 999px;
    cursor: pointer;
    transition: background var(--hr-transition);
}
.profile-icon:hover { background: var(--hr-hover); }
.profile-icon img, .profile-icon .profile-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
.profile-icon i { font-size: 30px; color: var(--hr-subtle); line-height: 1; }
.profile-icon .profile-meta { display: flex; flex-direction: column; line-height: 1.15; }
.profile-icon .profile-meta .name { font-size: 13px; font-weight: 600; color: var(--hr-text); max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-icon .profile-meta .role { font-size: 11px; color: var(--hr-muted); }
.profile-icon .profile-caret { font-size: 16px; color: var(--hr-subtle); }

.profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 210px;
    background: var(--hr-surface);
    border: 1px solid var(--hr-border);
    border-radius: var(--hr-radius);
    box-shadow: var(--hr-shadow-lg);
    padding: 6px;
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}
.profile-dropdown.active { opacity: 1; visibility: visible; transform: translateY(0); }
.profile-dropdown .dropdown-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--hr-border); margin-bottom: 6px; }
.profile-dropdown .dropdown-head .name { font-size: 13px; font-weight: 600; color: var(--hr-text); }
.profile-dropdown .dropdown-head .role { font-size: 11.5px; color: var(--hr-muted); }
.profile-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--hr-text-2);
    transition: background var(--hr-transition), color var(--hr-transition);
}
.profile-dropdown-item i { font-size: 17px; color: var(--hr-subtle); width: 20px; text-align: center; }
.profile-dropdown-item:hover { background: var(--hr-hover); color: var(--hr-text); }
.profile-dropdown-item:hover i { color: var(--hr-text); }
.profile-dropdown-item.danger { color: var(--hr-danger-text); }
.profile-dropdown-item.danger i { color: var(--hr-danger); }
.profile-dropdown-item.danger:hover { background: var(--hr-danger-soft); }

/* main content region */
#content .main-container {
    padding: var(--hr-content-pad);
    max-width: 1680px;
    margin: 0 auto;
    animation: hrFadeIn 0.25s ease both;
}
@keyframes hrFadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ------------------------------ 4. Page header, cards, stat tiles, banner */
.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}
.page-header h1, .page-header .page-title {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    margin: 0;
    color: var(--hr-text);
}
.page-header .page-subtitle, .page-header p { margin: 0.25rem 0 0; font-size: 0.875rem; color: var(--hr-muted); }
.page-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

.hr-card {
    background: var(--hr-surface);
    border: 1px solid var(--hr-border);
    border-radius: var(--hr-radius-lg);
    box-shadow: var(--hr-shadow);
    margin-bottom: 1.25rem;
}
.hr-card:last-child { margin-bottom: 0; }
.hr-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--hr-border);
}
.hr-card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--hr-text);
}
.hr-card-title i { font-size: 18px; color: var(--hr-subtle); }
.hr-card-title .hr-badge { margin-left: 4px; }
.hr-card-subtitle { margin: 2px 0 0; font-size: 0.8125rem; color: var(--hr-muted); font-weight: 400; }
.hr-card-tools { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.hr-card-body { padding: 1.25rem; }
.hr-card-body.flush, .hr-card-body.p-0 { padding: 0; }
.hr-card-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--hr-border);
    background: var(--hr-surface-2);
    border-radius: 0 0 var(--hr-radius-lg) var(--hr-radius-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.hr-card.is-link { display: block; color: inherit; transition: transform var(--hr-transition), box-shadow var(--hr-transition), border-color var(--hr-transition); }
.hr-card.is-link:hover { transform: translateY(-2px); box-shadow: var(--hr-shadow-lg); border-color: var(--hr-border-strong); color: inherit; }

/* stat tile */
.stat-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.125rem 1.25rem;
    background: var(--hr-surface);
    border: 1px solid var(--hr-border);
    border-radius: var(--hr-radius-lg);
    box-shadow: var(--hr-shadow);
    color: inherit;
    min-width: 0;
}
a.stat-card { transition: transform var(--hr-transition), box-shadow var(--hr-transition); }
a.stat-card:hover { transform: translateY(-2px); box-shadow: var(--hr-shadow-lg); color: inherit; }
.stat-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: var(--hr-primary-soft);
    color: var(--hr-primary);
}
.stat-icon.is-success { background: var(--hr-success-soft); color: var(--hr-success); }
.stat-icon.is-warning { background: var(--hr-warning-soft); color: var(--hr-warning); }
.stat-icon.is-danger { background: var(--hr-danger-soft); color: var(--hr-danger); }
.stat-icon.is-info { background: var(--hr-info-soft); color: var(--hr-info); }
.stat-icon.is-neutral { background: var(--hr-hover); color: var(--hr-muted); }
.stat-body { flex: 1; min-width: 0; }
.stat-label { font-size: 0.8125rem; font-weight: 500; color: var(--hr-muted); margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-value { font-size: 1.625rem; font-weight: 700; letter-spacing: -0.02em; color: var(--hr-text); line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-trend { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 0.75rem; font-weight: 500; color: var(--hr-muted); }
.stat-trend.up { color: var(--hr-success-text); }
.stat-trend.down { color: var(--hr-danger-text); }
.stat-desc { margin-top: 6px; font-size: 0.8125rem; color: var(--hr-muted); line-height: 1.45; }
.stat-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; font-size: 0.8125rem; font-weight: 600; color: var(--hr-primary); }
.stat-link i { transition: transform var(--hr-transition); }
a.stat-card:hover .stat-link i { transform: translateX(3px); }

/* hero banner (dashboard greeting) */
.hero-banner {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
    padding: 1.75rem 2rem;
    margin-bottom: 1.5rem;
    border-radius: var(--hr-radius-lg);
    background: linear-gradient(135deg, #fff3ec 0%, #ffe4d6 55%, #ffd2bd 100%);
    border: 1px solid #fcd9c7;
}
body.dark .hero-banner { background: linear-gradient(135deg, #2a1a13 0%, #3a1f14 60%, #4a2415 100%); border-color: #4a2a1c; }
.hero-banner::after {
    content: "";
    position: absolute;
    right: -60px;
    top: -60px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: rgba(234, 90, 42, 0.12);
    pointer-events: none;
}
.hero-text { position: relative; z-index: 1; }
.hero-date { font-size: 0.8125rem; font-weight: 500; color: var(--hr-primary-soft-text); margin-bottom: 8px; }
.hero-title { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; color: var(--hr-text); margin: 0 0 4px; }
.hero-sub { font-size: 0.9rem; color: var(--hr-text-2); margin: 0; }
.hero-stats { position: relative; z-index: 1; display: flex; gap: 0.75rem; flex-wrap: wrap; }
.hero-stat {
    min-width: 150px;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 12px;
}
body.dark .hero-stat { background: rgba(23, 26, 33, 0.7); border-color: rgba(255, 255, 255, 0.06); }
.hero-stat .stat-icon { width: 34px; height: 34px; min-width: 34px; font-size: 18px; border-radius: 9px; margin-bottom: 10px; }
.hero-stat .stat-value { font-size: 1.375rem; }
.hero-stat .stat-label { margin-bottom: 0; }

/* ------------------------------------------------------ 5. Tables + pager */
.hr-table-wrap {
    width: 100%;
    overflow: auto;
    border-radius: 0 0 var(--hr-radius-lg) var(--hr-radius-lg);
}
.hr-card > .hr-table-wrap:first-child, .hr-card-body.flush > .hr-table-wrap { border-radius: var(--hr-radius-lg); }
.hr-card-header + .hr-table-wrap { border-radius: 0 0 var(--hr-radius-lg) var(--hr-radius-lg); }
.hr-table-wrap.is-scroll { max-height: 560px; }

/* GridView renders <table class="hr-table"> with <tr><th> header rows and a
   nested pager table. The selectors below cover that markup exactly. */
table.hr-table {
    width: 100%;
    border-collapse: collapse !important;
    border: 0 !important;
    font-size: 0.8125rem;
    color: var(--hr-text-2);
    background: var(--hr-surface);
}
table.hr-table th, table.hr-table td {
    border: 0 !important;
    border-bottom: 1px solid var(--hr-border) !important;
    padding: 0.7rem 1rem;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}
table.hr-table th, table.hr-table tr.hr-table-head td {
    background: var(--hr-surface-2);
    color: var(--hr-muted);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    position: sticky;
    top: 0;
    z-index: 2;
}
table.hr-table th a { color: inherit; }
table.hr-table th a:hover { color: var(--hr-primary); }
table.hr-table td { color: var(--hr-text-2); }
table.hr-table tr:hover > td { background: var(--hr-hover); }
table.hr-table tr.hr-row-selected > td, table.hr-table tr.row-highlight > td { background: var(--hr-primary-soft) !important; }
table.hr-table td.hr-num, table.hr-table th.hr-num, table.hr-table .col-money { text-align: right; font-variant-numeric: tabular-nums; }
table.hr-table td.hr-strong { color: var(--hr-text); font-weight: 600; }
table.hr-table td.hr-wrap, table.hr-table .col-address { white-space: normal; min-width: 220px; }
table.hr-table.is-compact th, table.hr-table.is-compact td { padding: 0.45rem 0.75rem; }
table.hr-table.is-striped tr:nth-child(even) > td { background: var(--hr-surface-2); }
table.hr-table.is-striped tr:hover > td { background: var(--hr-hover); }
table.hr-table input[type="checkbox"] { accent-color: var(--hr-primary); width: 15px; height: 15px; }
table.hr-table .hr-table-empty { padding: 0; }

/* inline action buttons inside rows */
table.hr-table .hr-btn { height: var(--hr-control-h-sm); padding: 0 0.7rem; font-size: 0.78rem; }
table.hr-table .hr-btn-icon { width: var(--hr-control-h-sm); }

/* pager row (PagerStyle-CssClass="hr-pager") */
table.hr-table tr.hr-pager:hover > td { background: var(--hr-surface); }
table.hr-table tr.hr-pager > td {
    background: var(--hr-surface);
    border-bottom: 0 !important;
    padding: 0.6rem 1rem;
    text-transform: none;
    letter-spacing: 0;
}
/* keep the pager visible while a wide table is scrolled horizontally */
table.hr-table tr.hr-pager table {
    width: auto;
    margin: 0;
    position: sticky;
    left: 1rem;
    border-collapse: separate !important;
    border-spacing: 4px 0;
    background: transparent;
}
table.hr-table tr.hr-pager table td { border: 0 !important; padding: 0; background: transparent !important; }
table.hr-table tr.hr-pager a, table.hr-table tr.hr-pager span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 0.6rem;
    border-radius: 7px;
    border: 1px solid var(--hr-border);
    background: var(--hr-surface);
    color: var(--hr-text-2);
    font-size: 0.8125rem;
    font-weight: 500;
    transition: background var(--hr-transition), border-color var(--hr-transition);
}
table.hr-table tr.hr-pager a:hover { background: var(--hr-hover); border-color: var(--hr-border-strong); color: var(--hr-text); }
table.hr-table tr.hr-pager span { background: var(--hr-primary); border-color: var(--hr-primary); color: #fff; }

/* footer/summary row (ShowFooter="true") */
table.hr-table tr.hr-table-foot > td { background: var(--hr-surface-2); font-weight: 600; color: var(--hr-text); }

/* table toolbar */
.hr-table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--hr-border);
}
.hr-table-count { font-size: 0.8125rem; color: var(--hr-muted); }
.hr-table-count strong { color: var(--hr-text); }

/* ------------------------------------------------------ 6. Forms + buttons */
.hr-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin-bottom: 1rem; }
.hr-field.mb-0 { margin-bottom: 0; }
.hr-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--hr-text-2);
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    gap: 4px;
}
.hr-label .req { color: var(--hr-danger); }
.hr-help { font-size: 0.75rem; color: var(--hr-muted); }
.hr-error { font-size: 0.75rem; color: var(--hr-danger-text); }

.hr-input,
.hr-select,
.hr-textarea {
    display: block;
    width: 100%;
    height: var(--hr-control-h);
    padding: 0 0.75rem;
    font: 400 0.875rem/1.4 var(--hr-font);
    color: var(--hr-text);
    background: var(--hr-surface);
    border: 1px solid var(--hr-border-strong);
    border-radius: 8px;
    outline: none;
    transition: border-color var(--hr-transition), box-shadow var(--hr-transition), background var(--hr-transition);
    -webkit-appearance: none;
    appearance: none;
}
.hr-input::placeholder, .hr-textarea::placeholder { color: var(--hr-subtle); }
.hr-input:hover, .hr-select:hover, .hr-textarea:hover { border-color: var(--hr-subtle); }
.hr-input:focus, .hr-select:focus, .hr-textarea:focus { border-color: var(--hr-primary); box-shadow: 0 0 0 3px var(--hr-ring); }
.hr-input[readonly], .hr-input:disabled, .hr-select:disabled, .hr-textarea:disabled, .hr-input.is-readonly {
    background: var(--hr-surface-2);
    color: var(--hr-muted);
    cursor: not-allowed;
}
.hr-input.is-invalid, .hr-select.is-invalid, .hr-textarea.is-invalid { border-color: var(--hr-danger); }
.hr-input.is-invalid:focus { box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18); }
.hr-input.is-sm, .hr-select.is-sm { height: var(--hr-control-h-sm); font-size: 0.8125rem; }
.hr-input.is-lg, .hr-select.is-lg { height: var(--hr-control-h-lg); font-size: 0.95rem; }
textarea.hr-input, .hr-textarea { height: auto; min-height: 96px; padding: 0.6rem 0.75rem; resize: vertical; line-height: 1.5; }

select.hr-input, .hr-select {
    padding-right: 2.25rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 16px;
    cursor: pointer;
}
select.hr-input[multiple], .hr-select[multiple] { height: auto; padding: 0.4rem; background-image: none; }
select.hr-input option, .hr-select option { background: var(--hr-surface); color: var(--hr-text); }

input.hr-input[type="date"], input.hr-input[type="time"], input.hr-input[type="month"] { padding-right: 0.5rem; }
input.hr-input[type="date"]::-webkit-calendar-picker-indicator { opacity: 0.6; cursor: pointer; }
body.dark input[type="date"]::-webkit-calendar-picker-indicator,
body.dark input[type="time"]::-webkit-calendar-picker-indicator { filter: invert(1); }

input.hr-input[type="file"] { padding: 0; line-height: var(--hr-control-h); cursor: pointer; }
input.hr-input[type="file"]::file-selector-button {
    height: 100%;
    margin-right: 0.75rem;
    padding: 0 0.9rem;
    border: 0;
    border-right: 1px solid var(--hr-border-strong);
    background: var(--hr-surface-2);
    color: var(--hr-text-2);
    font: 500 0.8125rem var(--hr-font);
    cursor: pointer;
}

/* input with leading icon */
.hr-input-group { position: relative; }
.hr-input-group > i { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); font-size: 17px; color: var(--hr-subtle); pointer-events: none; }
.hr-input-group > .hr-input { padding-left: 2.25rem; }
.hr-input-group.is-trailing > i { left: auto; right: 0.75rem; }
.hr-input-group.is-trailing > .hr-input { padding-left: 0.75rem; padding-right: 2.25rem; }

/* checkbox / radio */
.hr-check { display: inline-flex; align-items: center; gap: 8px; font-size: 0.875rem; color: var(--hr-text-2); cursor: pointer; }
.hr-check input[type="checkbox"], .hr-check input[type="radio"], input.hr-checkbox {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--hr-primary);
    cursor: pointer;
}
/* asp:CheckBox renders <span class="hr-check"><input/><label/></span> */
.hr-check label { margin: 0; cursor: pointer; font-weight: 500; }
.hr-check-list { display: flex; flex-direction: column; gap: 6px; }
.hr-check-list.is-inline { flex-direction: row; flex-wrap: wrap; gap: 6px 18px; }

/* filter bar: label + control cells that auto-wrap */
.hr-filter-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.75rem 1rem;
    align-items: end;
}
.hr-filter-bar .hr-field { margin-bottom: 0; }
.hr-filter-bar .hr-filter-actions { display: flex; gap: 0.5rem; align-items: end; }
.hr-filter-bar .hr-filter-actions .hr-btn { flex: 1; }

/* form grid */
.hr-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.25rem; }
.hr-form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hr-form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hr-form-grid .span-2 { grid-column: span 2; }
.hr-form-grid .span-full { grid-column: 1 / -1; }
.hr-form-section { padding-top: 0.5rem; margin: 0.75rem 0 1rem; border-top: 1px solid var(--hr-border); }
.hr-form-section-title { font-size: 0.8125rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--hr-muted); margin: 0.75rem 0 1rem; }
.hr-form-actions { display: flex; justify-content: flex-end; gap: 0.5rem; flex-wrap: wrap; padding-top: 1rem; margin-top: 0.5rem; border-top: 1px solid var(--hr-border); }
.hr-form-actions.is-start { justify-content: flex-start; }

/* buttons: work for <a>, <button> and asp:Button (<input type=submit>) */
.hr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    height: var(--hr-control-h);
    padding: 0 1rem;
    border: 1px solid transparent;
    border-radius: 8px;
    font: 500 0.875rem/1 var(--hr-font);
    color: var(--hr-text);
    background: var(--hr-surface);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
    vertical-align: middle;
    transition: background var(--hr-transition), border-color var(--hr-transition), color var(--hr-transition), box-shadow var(--hr-transition), transform 0.1s ease;
}
.hr-btn i { font-size: 18px; line-height: 1; }
.hr-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--hr-ring); }
.hr-btn:active { transform: translateY(1px); }
.hr-btn:disabled, .hr-btn[disabled], .hr-btn.aspNetDisabled { opacity: 0.55; cursor: not-allowed; pointer-events: none; }

.hr-btn-primary { background: var(--hr-primary); border-color: var(--hr-primary); color: #fff; box-shadow: var(--hr-shadow-sm); }
.hr-btn-primary:hover { background: var(--hr-primary-hover); border-color: var(--hr-primary-hover); color: #fff; }
.hr-btn-secondary { background: var(--hr-surface); border-color: var(--hr-border-strong); color: var(--hr-text-2); box-shadow: var(--hr-shadow-sm); }
.hr-btn-secondary:hover { background: var(--hr-hover); color: var(--hr-text); border-color: var(--hr-subtle); }
.hr-btn-outline { background: transparent; border-color: var(--hr-primary); color: var(--hr-primary); }
.hr-btn-outline:hover { background: var(--hr-primary-soft); color: var(--hr-primary-soft-text); }
.hr-btn-ghost { background: transparent; border-color: transparent; color: var(--hr-text-2); }
.hr-btn-ghost:hover { background: var(--hr-hover); color: var(--hr-text); }
.hr-btn-success { background: var(--hr-success); border-color: var(--hr-success); color: #fff; }
.hr-btn-success:hover { background: #15803d; border-color: #15803d; color: #fff; }
.hr-btn-danger { background: var(--hr-danger); border-color: var(--hr-danger); color: #fff; }
.hr-btn-danger:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.hr-btn-danger-soft { background: var(--hr-danger-soft); border-color: transparent; color: var(--hr-danger-text); }
.hr-btn-danger-soft:hover { background: var(--hr-danger); color: #fff; }
.hr-btn-success-soft { background: var(--hr-success-soft); border-color: transparent; color: var(--hr-success-text); }
.hr-btn-success-soft:hover { background: var(--hr-success); color: #fff; }
.hr-btn-info-soft { background: var(--hr-info-soft); border-color: transparent; color: var(--hr-info-text); }
.hr-btn-info-soft:hover { background: var(--hr-info); color: #fff; }
.hr-btn-dark { background: var(--hr-text); border-color: var(--hr-text); color: var(--hr-surface); }
.hr-btn-dark:hover { background: var(--hr-text-2); border-color: var(--hr-text-2); color: var(--hr-surface); }

.hr-btn-sm { height: var(--hr-control-h-sm); padding: 0 0.75rem; font-size: 0.8125rem; border-radius: 7px; }
.hr-btn-sm i { font-size: 16px; }
.hr-btn-lg { height: var(--hr-control-h-lg); padding: 0 1.25rem; font-size: 0.95rem; }
.hr-btn-block { width: 100%; }
.hr-btn-icon { width: var(--hr-control-h); padding: 0; }
.hr-btn-icon.hr-btn-sm { width: var(--hr-control-h-sm); }
.hr-btn-group { display: inline-flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

/* icon + asp:Button pairing: <span class="hr-btn hr-btn-secondary"><i/> <asp:Button CssClass="hr-btn-inner"/></span> */
.hr-btn .hr-btn-inner { background: transparent; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }

/* ---------------------- 7. Badges, alerts, empty state, tabs, avatar, misc */
.hr-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    line-height: 1.4;
    white-space: nowrap;
    background: var(--hr-hover);
    color: var(--hr-text-2);
}
.hr-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.8; }
.hr-badge.no-dot::before { display: none; }
.hr-badge-success { background: var(--hr-success-soft); color: var(--hr-success-text); }
.hr-badge-warning { background: var(--hr-warning-soft); color: var(--hr-warning-text); }
.hr-badge-danger { background: var(--hr-danger-soft); color: var(--hr-danger-text); }
.hr-badge-info { background: var(--hr-info-soft); color: var(--hr-info-text); }
.hr-badge-primary { background: var(--hr-primary-soft); color: var(--hr-primary-soft-text); }
.hr-badge-neutral { background: var(--hr-hover); color: var(--hr-muted); }
.hr-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--hr-hover); color: var(--hr-text-2); font-size: 0.7rem; font-weight: 600; }

.hr-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    border-radius: var(--hr-radius);
    border: 1px solid var(--hr-border);
    background: var(--hr-surface-2);
    color: var(--hr-text-2);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}
.hr-alert i { font-size: 19px; line-height: 1.3; flex-shrink: 0; }
.hr-alert strong { color: inherit; }
.hr-alert-success { background: var(--hr-success-soft); border-color: transparent; color: var(--hr-success-text); }
.hr-alert-warning { background: var(--hr-warning-soft); border-color: transparent; color: var(--hr-warning-text); }
.hr-alert-danger { background: var(--hr-danger-soft); border-color: transparent; color: var(--hr-danger-text); }
.hr-alert-info { background: var(--hr-info-soft); border-color: transparent; color: var(--hr-info-text); }
.hr-alert:empty { display: none; }

/* asp:Label messages: give them the alert look when they have text */
.hr-msg { display: block; margin-top: 0.75rem; font-size: 0.85rem; font-weight: 500; }
.hr-msg:empty { display: none; }
.hr-msg.text-danger, .hr-msg.is-error { color: var(--hr-danger-text); }
.hr-msg.text-success, .hr-msg.is-success { color: var(--hr-success-text); }

.hr-empty {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--hr-muted);
}
.hr-empty i { font-size: 40px; color: var(--hr-border-strong); display: block; margin-bottom: 0.75rem; }
.hr-empty .hr-empty-title { font-size: 0.95rem; font-weight: 600; color: var(--hr-text-2); margin-bottom: 4px; }
.hr-empty p { margin: 0; font-size: 0.8125rem; }

.hr-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--hr-border); margin-bottom: 1.25rem; overflow-x: auto; }
.hr-tabs a, .hr-tabs button, .hr-tabs .hr-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 0.9rem;
    margin-bottom: -1px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--hr-muted);
    font: 500 0.875rem var(--hr-font);
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--hr-transition), border-color var(--hr-transition);
}
.hr-tabs a:hover, .hr-tabs button:hover { color: var(--hr-text); }
.hr-tabs .active, .hr-tabs .is-active { color: var(--hr-primary); border-bottom-color: var(--hr-primary); font-weight: 600; }

.hr-pills { display: inline-flex; gap: 4px; padding: 4px; background: var(--hr-hover); border-radius: 10px; }
.hr-pills a, .hr-pills button, .hr-pills .hr-pill { padding: 0.35rem 0.8rem; border-radius: 7px; border: 0; background: transparent; font: 500 0.8125rem var(--hr-font); color: var(--hr-muted); cursor: pointer; }
.hr-pills .active, .hr-pills .is-active { background: var(--hr-surface); color: var(--hr-text); box-shadow: var(--hr-shadow-sm); }

.hr-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--hr-primary-soft);
    color: var(--hr-primary-soft-text);
    font-size: 0.8rem;
    font-weight: 600;
    overflow: hidden;
    flex-shrink: 0;
}
.hr-avatar img { width: 100%; height: 100%; object-fit: cover; }
.hr-avatar.is-sm { width: 28px; height: 28px; font-size: 0.7rem; }
.hr-avatar.is-lg { width: 56px; height: 56px; font-size: 1.1rem; }
.hr-avatar.is-xl { width: 96px; height: 96px; font-size: 1.75rem; }

/* person cell in tables */
.hr-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hr-person .hr-person-name { font-weight: 600; color: var(--hr-text); }
.hr-person .hr-person-sub { font-size: 0.75rem; color: var(--hr-muted); }

/* list rows (activity feeds, approvals) */
.hr-list { display: flex; flex-direction: column; }
.hr-list-item { display: flex; align-items: center; gap: 12px; padding: 0.75rem 0; border-bottom: 1px solid var(--hr-border); }
.hr-list-item:last-child { border-bottom: 0; }
.hr-list-item .hr-list-body { flex: 1; min-width: 0; }
.hr-list-item .hr-list-title { font-size: 0.875rem; font-weight: 600; color: var(--hr-text); }
.hr-list-item .hr-list-sub { font-size: 0.8125rem; color: var(--hr-muted); }
.hr-list-item .hr-list-meta { font-size: 0.75rem; color: var(--hr-subtle); margin-top: 2px; }
.hr-list-item .hr-list-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }
.hr-list.is-scroll { max-height: 340px; overflow-y: auto; padding-right: 6px; }

/* description list / key-value */
.hr-kv { display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1.25rem; font-size: 0.875rem; }
.hr-kv dt { color: var(--hr-muted); font-weight: 500; margin: 0; }
.hr-kv dd { color: var(--hr-text); margin: 0; font-weight: 500; }

/* step rail */
.hr-steps { display: flex; gap: 0; counter-reset: step; margin-bottom: 1.5rem; }
.hr-step { flex: 1; display: flex; align-items: center; gap: 10px; font-size: 0.8125rem; color: var(--hr-muted); position: relative; }
.hr-step::before { counter-increment: step; content: counter(step); width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--hr-border-strong); background: var(--hr-surface); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 0.75rem; }
.hr-step::after { content: ""; flex: 1; height: 1px; background: var(--hr-border); margin: 0 10px; }
.hr-step:last-child::after { display: none; }
.hr-step.is-active { color: var(--hr-text); font-weight: 600; }
.hr-step.is-active::before { background: var(--hr-primary); border-color: var(--hr-primary); color: #fff; }
.hr-step.is-done::before { background: var(--hr-success); border-color: var(--hr-success); color: #fff; }

/* progress */
.hr-progress { height: 6px; border-radius: 6px; background: var(--hr-hover); overflow: hidden; }
.hr-progress > span { display: block; height: 100%; background: var(--hr-primary); border-radius: 6px; }

/* dividers, misc */
.hr-divider { height: 1px; background: var(--hr-border); margin: 1rem 0; border: 0; }
.hr-kbd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.75rem; padding: 1px 6px; border-radius: 4px; background: var(--hr-hover); border: 1px solid var(--hr-border); }
.hr-loading { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--hr-border-strong); border-top-color: var(--hr-primary); border-radius: 50%; animation: hrSpin 0.8s linear infinite; }
@keyframes hrSpin { to { transform: rotate(360deg); } }

/* UpdateProgress overlay */
.hr-update-progress {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.55);
}
body.dark .hr-update-progress { background: rgba(15, 17, 22, 0.55); }
.hr-update-progress .box { display: flex; align-items: center; gap: 10px; padding: 0.75rem 1rem; background: var(--hr-surface); border: 1px solid var(--hr-border); border-radius: var(--hr-radius); box-shadow: var(--hr-shadow-lg); font-size: 0.875rem; }

/* ------------------------------------------------------------ 8. Utilities */
.hr-grid { display: grid; gap: 1.25rem; }
.hr-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hr-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hr-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hr-grid-auto { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.hr-grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.hr-grid-main.is-reverse { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.hr-grid > .hr-card { margin-bottom: 0; }

.hr-row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.hr-row.between { justify-content: space-between; }
.hr-row.end { justify-content: flex-end; }
.hr-stack { display: flex; flex-direction: column; gap: 0.75rem; }
.hr-grow { flex: 1; min-width: 0; }

.hr-muted { color: var(--hr-muted) !important; }
.hr-subtle { color: var(--hr-subtle) !important; }
.hr-text-primary { color: var(--hr-primary) !important; }
.hr-text-success { color: var(--hr-success-text) !important; }
.hr-text-danger { color: var(--hr-danger-text) !important; }
.hr-text-warning { color: var(--hr-warning-text) !important; }
.hr-text-sm { font-size: 0.8125rem !important; }
.hr-text-xs { font-size: 0.75rem !important; }
.hr-strong { font-weight: 600 !important; color: var(--hr-text); }
.hr-num { font-variant-numeric: tabular-nums; text-align: right; }
.hr-truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hr-nowrap { white-space: nowrap; }
.hr-hidden, .hr-hide { display: none !important; }
.hr-mt-0 { margin-top: 0 !important; } .hr-mt-1 { margin-top: 0.5rem !important; } .hr-mt-2 { margin-top: 1rem !important; } .hr-mt-3 { margin-top: 1.5rem !important; }
.hr-mb-0 { margin-bottom: 0 !important; } .hr-mb-1 { margin-bottom: 0.5rem !important; } .hr-mb-2 { margin-bottom: 1rem !important; } .hr-mb-3 { margin-bottom: 1.5rem !important; }
.hr-w-auto { width: auto !important; }
.hr-w-100 { width: 100% !important; }
.hr-max-sm { max-width: 520px; }
.hr-max-md { max-width: 760px; }
.hr-max-lg { max-width: 1040px; }
.hr-mx-auto { margin-left: auto; margin-right: auto; }
.hr-scroll-y { overflow-y: auto; }
.hr-rounded { border-radius: var(--hr-radius); }
.hr-surface { background: var(--hr-surface); }
.hr-surface-2 { background: var(--hr-surface-2); }

/* ------------------------------------------- 8b. Runtime classes from code-behind */
/* These class names are assigned in .aspx.cs files (lblMessage.CssClass = ...,
   e.Row.CssClass = ...). Keep them styled here so no server code has to change. */
.message, .message-label { display: block; margin-top: 0.75rem; font-size: 0.85rem; font-weight: 500; }
.message:empty, .message-label:empty { display: none; }
.message.error, .message-label.error-message, .alert-error, .hr-msg.error { color: var(--hr-danger-text); }
.message.success, .hr-msg.success { color: var(--hr-success-text); }
.alert.alert-error { background: var(--hr-danger-soft); border-color: transparent; color: var(--hr-danger-text); border-radius: var(--hr-radius); }
.alert.alert-error:empty { display: none; }

.card-trend { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 0.75rem; font-weight: 500; color: var(--hr-muted); }
.card-trend.positive { color: var(--hr-success-text); }
.card-trend.negative { color: var(--hr-danger-text); }
.card-trend.neutral { color: var(--hr-muted); }

table.hr-table tr.row-holiday > td { background: var(--hr-info-soft); }
table.hr-table tr.row-leave > td { background: var(--hr-warning-soft); }
table.hr-table tr.row-absent > td { background: var(--hr-danger-soft); }
table.hr-table tr.row-late > td { background: var(--hr-primary-soft); }
table.hr-table tr.row-disabled > td { opacity: 0.55; }
table.hr-table tr.grand-total-row > td { background: var(--hr-surface-2); font-weight: 700; color: var(--hr-text); }
table.hr-table .row-legend { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; margin-right: 6px; }

/* ------------------------------------------- 9. Call overlay (SignalR/WebRTC) */
#incomingCallModal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(11, 20, 26, 0.85);
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
.call-card {
    width: 340px;
    padding: 40px;
    border-radius: 16px;
    background: #202c33;
    color: #e9edef;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}
.call-card .call-avatar {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: #00a884;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #fff;
    animation: pulse-ring 1.5s infinite;
}
.call-card h3 { margin: 0 0 5px; font-weight: 500; color: #e9edef; }
.call-card p { font-size: 18px; margin: 0 0 30px; color: #8696a0; }
.call-card .call-actions { display: flex; justify-content: space-around; }
.call-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    cursor: pointer;
}
.call-btn.reject, .call-btn.end { background: #ef4444; }
.call-btn.accept { background: #22c55e; animation: bounce 2s infinite; }
.call-btn.accept i { transform: rotate(270deg); }

#activeCallWindow {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 340px;
    z-index: 9998;
    background: #111b21;
    border: 1px solid #2a3942;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
#activeCallWindow .call-head { padding: 15px; background: #202c33; color: #e9edef; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #2a3942; }
#activeCallWindow .call-head .lock { display: flex; align-items: center; gap: 10px; }
#activeCallWindow .call-head .lock i { color: #8696a0; font-size: 12px; }
#activeCallWindow .call-head span { font-size: 14px; font-weight: 500; }
#callDuration { color: #00a884; display: none; }
#videoContainer { position: relative; width: 100%; height: 450px; background: #000; }
#remoteVideo { width: 100%; height: 100%; object-fit: cover; display: none; }
#localVideo { width: 100px; height: 150px; object-fit: cover; position: absolute; bottom: 20px; right: 20px; border: 2px solid #202c33; border-radius: 10px; display: none; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5); }
#audioCallPlaceholder { position: absolute; inset: 0; background: #111b21; display: flex; flex-direction: column; align-items: center; justify-content: center; }
#audioCallPlaceholder .call-avatar { width: 120px; height: 120px; border-radius: 50%; background: #202c33; display: flex; align-items: center; justify-content: center; margin-bottom: 30px; font-size: 4rem; color: #8696a0; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); animation: none; }
#audioCallPlaceholder h3 { color: #e9edef; margin: 0 0 10px; font-weight: 500; }
#audioCallPlaceholder p { color: #8696a0; margin: 0; }
#activeCallWindow .call-foot { padding: 20px; background: #202c33; display: flex; justify-content: center; gap: 30px; }

@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(0, 168, 132, 0.7); }
    70% { box-shadow: 0 0 0 20px rgba(0, 168, 132, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 168, 132, 0); }
}
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* ----------------------------------------------------- 10. Responsive + print */
@media (max-width: 1200px) {
    .hr-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hr-form-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 992px) {
    .hr-grid-3, .hr-grid-main, .hr-grid-main.is-reverse { grid-template-columns: 1fr; }
    .hr-form-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hero-banner { padding: 1.5rem; }
}
@media (max-width: 768px) {
    :root { --hr-content-pad: 1.25rem 1rem 2rem; }
    #sidebar { transform: translateX(-100%); width: 280px; box-shadow: none; }
    #sidebar.hide { transform: translateX(-100%); width: 280px; }
    #wrapper.sidebar-open #sidebar { transform: translateX(0); box-shadow: var(--hr-shadow-lg); }
    #wrapper.sidebar-open #sidebarOverlay { display: block; }
    #content, #sidebar.hide ~ #content { margin-left: 0; }
    #content nav.topbar { padding: 0 1rem; }
    .topbar .page-title-nav .crumbs { display: none; }
    .profile-icon .profile-meta, .profile-icon .profile-caret { display: none; }
    .hr-grid-2, .hr-grid-4 { grid-template-columns: 1fr; }
    .hr-form-grid, .hr-form-grid.cols-3, .hr-form-grid.cols-4 { grid-template-columns: 1fr; }
    .hr-form-grid .span-2 { grid-column: auto; }
    .hero-title { font-size: 1.375rem; }
    .hero-stats { width: 100%; }
    .hero-stat { flex: 1; min-width: 120px; }
    .page-header { align-items: flex-start; flex-direction: column; }
    .page-actions { width: 100%; }
    .hr-card-header { padding: 0.8rem 1rem; }
    .hr-card-body { padding: 1rem; }
    .hr-table-toolbar { padding: 0.75rem 1rem; }
    .hr-steps { flex-direction: column; gap: 0.5rem; }
    .hr-step::after { display: none; }
}
@media (max-width: 480px) {
    .theme-switch i { display: none; }
    .hr-filter-bar { grid-template-columns: 1fr; }
}

@media print {
    #sidebar, #sidebarOverlay, #content nav.topbar, .page-actions, .hr-card-tools, .hr-table-toolbar .hr-btn, .no-print, #activeCallWindow, #incomingCallModal { display: none !important; }
    #content { margin-left: 0 !important; }
    #content .main-container { padding: 0 !important; max-width: none !important; animation: none; }
    body { background: #fff; color: #000; }
    .hr-card, .stat-card { box-shadow: none !important; border-color: #cbd5e1 !important; break-inside: avoid; }
    table.hr-table th, table.hr-table td { border-bottom: 1px solid #cbd5e1 !important; white-space: normal; }
    table.hr-table th { position: static; }
    table.hr-table tr.hr-pager { display: none; }
    .hr-table-wrap.is-scroll { max-height: none; overflow: visible; }
}
