:root {
    --sidebar-width: 240px;
    --sidebar-bg: #0b1f33;
    --sidebar-text: #e8eef4;
    --sidebar-text-muted: #8fa3b8;
    --primary: #0d6e6e;
    --primary-hover: #0a5757;
    --accent: #c45c26;
    --border-color: #d7e0ea;
    --page-bg: #eef3f7;
    --app-sidebar-z: 1040;
    --bs-backdrop-zindex: 1050;
    --bs-modal-zindex: 1060;
}

body {
    background: linear-gradient(160deg, #eef3f7 0%, #dce8f0 45%, #e8efe6 100%);
    font-family: "Segoe UI", "Trebuchet MS", sans-serif;
    color: #132033;
    min-height: 100vh;
}

body.app-shell {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.app-shell .app-wrapper {
    height: 100%;
    max-height: 100dvh;
    overflow: hidden;
    display: flex;
    min-height: 0;
}

.app-sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #0b1f33 0%, #122a42 100%);
    color: var(--sidebar-text);
    padding: 1.25rem 1rem;
    z-index: var(--app-sidebar-z);
    flex-shrink: 0;
    overflow-y: auto;
    transition: width 0.25s ease, transform 0.25s ease;
}

.app-sidebar.collapsed { width: 64px; padding: 1.25rem 0.5rem; }
.app-sidebar.collapsed .sidebar-title,
.app-sidebar.collapsed .sp-nav-link-text,
.app-sidebar.collapsed .sp-nav-group-label,
.app-sidebar.collapsed .sp-nav-chevron { display: none; }

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 0.5rem;
}

.sidebar-logo-wrapper { display: flex; align-items: center; gap: 0.65rem; }
a.sidebar-brand-link {
    color: inherit;
    text-decoration: none;
    min-width: 0;
}
a.sidebar-brand-link:hover,
a.sidebar-brand-link:focus {
    color: inherit;
    text-decoration: none;
}
a.sidebar-brand-link:focus-visible {
    outline: 2px solid rgba(94, 234, 212, 0.7);
    outline-offset: 3px;
    border-radius: 0.5rem;
}
.sidebar-logo-mark {
    width: 36px; height: 36px; border-radius: 10px;
    background: transparent; color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    overflow: hidden;
    flex-shrink: 0;
}
.sidebar-logo-mark img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}
.sidebar-title { font-weight: 700; font-size: 0.95rem; letter-spacing: 0.02em; }
.auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.auth-brand-mark {
    width: 56px;
    height: 56px;
    margin-bottom: 0.75rem;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(11, 31, 51, 0.18);
}
.auth-brand-mark svg {
    display: block;
    width: 100%;
    height: 100%;
}
.auth-brand-title {
    font-weight: 700;
    color: #0b1f33;
    letter-spacing: -0.02em;
}
.auth-brand-sub {
    letter-spacing: 0.02em;
}
.auth-logo {
    display: block;
    margin: 0 auto;
    max-width: min(100%, 280px);
    height: auto;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 0.2rem; }
.sidebar-link {
    display: flex; align-items: center; gap: 0.7rem;
    color: var(--sidebar-text-muted);
    text-decoration: none;
    padding: 0.55rem 0.7rem;
    border-radius: 8px;
    font-size: 0.9rem;
}
.sidebar-link:hover, .sidebar-link.active {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
.sidebar-link i,
.sp-nav-link-icon { font-size: 1.05rem; width: 1.25rem; text-align: center; flex-shrink: 0; }
.sidebar-link .sp-nav-link-text { flex: 1 1 auto; min-width: 0; }
.sp-nav-badge {
    flex-shrink: 0;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.35rem;
    text-align: center;
    color: #fff;
}
.sp-nav-badge-danger {
    background: #dc3545;
}
.sp-nav-badge-warning {
    background: #d97706;
}
.app-sidebar.collapsed .sp-nav-badge {
    position: absolute;
    top: 0.25rem;
    right: 0.2rem;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 0.28rem;
    font-size: 0.65rem;
    line-height: 1.1rem;
}

.sp-nav-standalone { margin-bottom: 0.15rem; }
.sp-nav-standalone-split {
    margin-top: 0.55rem;
    padding-top: 0.55rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.sp-nav-group { margin-bottom: 0.15rem; }
.sp-nav-group-toggle {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--sidebar-text-muted);
    padding: 0.55rem 0.7rem;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
}
.sp-nav-group-toggle:hover,
.sp-nav-group-toggle:focus-visible {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
.sp-nav-group-toggle.is-open,
.sp-nav-group-toggle.has-active {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
.sp-nav-group-label { flex: 1; min-width: 0; }
.sp-nav-group-icon { font-size: 1.05rem; width: 1.25rem; text-align: center; flex-shrink: 0; opacity: 0.85; }
.sp-nav-chevron { font-size: 0.75rem; opacity: 0.7; flex-shrink: 0; }
.sp-nav-group-body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.15rem 0 0.35rem 0.35rem;
}
.sp-nav-group-body .sidebar-link {
    padding-left: 0.85rem;
    font-size: 0.86rem;
}

.app-sidebar.collapsed .sp-nav-group-body {
    display: none !important;
}
.app-sidebar.collapsed .sp-nav-group-toggle,
.app-sidebar.collapsed .sidebar-link {
    position: relative;
    justify-content: center;
    padding-left: 0.45rem;
    padding-right: 0.45rem;
}
.app-sidebar.collapsed .sp-nav-group-icon,
.app-sidebar.collapsed .sp-nav-link-icon {
    margin: 0;
}

/* Collapsed rail flyout for grouped items */
.sp-nav-flyout {
    position: fixed;
    z-index: 1060;
    min-width: 220px;
    max-width: min(320px, 90vw);
    max-height: 80vh;
    overflow-y: auto;
    padding: 0;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 4px 8px 24px rgba(0, 0, 0, 0.45);
    display: none;
}
.sp-nav-flyout.show { display: block !important; }
.sp-nav-flyout-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.sp-nav-flyout a.sidebar-link {
    border-radius: 0;
    padding: 0.55rem 1rem;
}
.sp-nav-flyout a.sidebar-link .sp-nav-link-text { display: inline !important; }

.sidebar-close-mobile {
    background: none; border: none; color: #fff; display: none; font-size: 1.2rem;
}

.app-main {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1 1 auto;
}

.app-topbar {
    height: 60px;
    background: rgba(255,255,255,0.92);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(8px);
    flex-shrink: 0;
    gap: 0.5rem;
    overflow: visible;
    position: relative;
    z-index: 1030;
    min-width: 0;
}
.topbar-start {
    min-width: 0;
    overflow: hidden;
}
.topbar-end {
    gap: 0.25rem;
    position: relative;
    z-index: 2;
}
.app-topbar > .d-flex {
    min-width: 0;
}
.topbar-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    line-height: 0;
}
.topbar-brand-mark svg {
    display: block;
    width: 36px;
    height: 36px;
}
.topbar-page-title {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.topbar-project-selector {
    flex: 1 1 auto;
    width: auto;
    max-width: min(22rem, 100%);
    min-width: 0;
}
@media (min-width: 768px) {
    .topbar-project-selector {
        flex: 0 1 auto;
    }
}
.topbar-role-selector {
    flex: 0 0 auto;
    width: max-content;
    max-width: 14rem;
    min-width: 0;
}
.topbar-user-dropdown {
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}
.topbar-user-dropdown .dropdown-menu {
    z-index: 1035;
    min-width: 14rem;
}
.topbar-user-menu-header {
    pointer-events: none;
}
.topbar-user-menu-header .topbar-user-name {
    font-size: 0.95rem;
}
.topbar-user-trigger.dropdown-toggle::after {
    display: none;
}
.topbar-role-menu-item.is-override {
    color: #b45309;
}
.topbar-role-menu-item.is-override .bi-shield-lock {
    color: #b45309;
}
.topbar-role-btn.is-override {
    border-color: rgba(180, 120, 20, 0.45);
    background: #fffbeb;
}
.topbar-role-btn.is-override .topbar-project-btn-icon {
    color: #b45309;
}
.topbar-project-btn {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 40px;
    min-height: 40px;
    padding: 0.35rem 0.7rem;
    border: 1px solid #d5dee8;
    background: #fff;
    color: #334155;
    border-radius: 0.45rem;
    text-align: left;
    font-size: 0.875rem;
    line-height: 1.25;
    box-shadow: none;
    overflow: hidden;
}
.topbar-project-btn:hover,
.topbar-project-btn:focus {
    border-color: var(--primary);
    color: #132033;
    background: #fff;
}
.topbar-project-btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 110, 0.12);
}
.topbar-tour-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    height: 40px;
    min-height: 40px;
    padding: 0.35rem 0.7rem;
    margin-right: 0.35rem;
    border: 1px solid #d5dee8;
    background: #fff;
    color: #0d6e6e;
    border-radius: 0.45rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25;
    flex-shrink: 0;
}
.topbar-tour-btn:hover,
.topbar-tour-btn:focus {
    border-color: var(--primary);
    color: #0b5c5c;
    background: #f4fbfb;
}
.topbar-tour-btn:focus {
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 110, 0.15);
}
.topbar-tour-btn.is-disabled,
.topbar-tour-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.topbar-tour-btn .bi {
    font-size: 1.1rem;
}
.driver-popover.driverjs-theme {
    background: #fff;
    color: #132033;
    border-radius: 0.75rem;
    box-shadow: 0 12px 40px rgba(11, 31, 51, 0.22);
    max-width: min(22rem, calc(100vw - 2rem));
}
.driver-popover.driverjs-theme .driver-popover-title {
    font-size: 1rem;
    font-weight: 650;
    color: #0b1f33;
}
.driver-popover.driverjs-theme .driver-popover-description {
    font-size: 0.875rem;
    color: #475569;
    line-height: 1.45;
}
.driver-popover.driverjs-theme .sp-tour-visual {
    margin: 0 0 0.65rem;
    border-radius: 0.55rem;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}
.driver-popover.driverjs-theme .sp-tour-visual svg {
    display: block;
    width: 100%;
    height: auto;
}
.driver-popover.driverjs-theme .sp-tour-lead {
    margin: 0 0 0.45rem;
    color: #334155;
    font-size: 0.875rem;
    line-height: 1.4;
    font-weight: 500;
}
.driver-popover.driverjs-theme .sp-tour-points {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.35rem;
}
.driver-popover.driverjs-theme .sp-tour-points li {
    position: relative;
    padding: 0.35rem 0.55rem 0.35rem 1.35rem;
    border-radius: 0.4rem;
    background: #f8fafc;
    border: 1px solid #eef2f7;
    color: #475569;
    font-size: 0.8125rem;
    line-height: 1.35;
}
.driver-popover.driverjs-theme .sp-tour-points li::before {
    content: "";
    position: absolute;
    left: 0.55rem;
    top: 0.7rem;
    width: 0.35rem;
    height: 0.35rem;
    border-radius: 50%;
    background: #0d6e6e;
}
.driver-popover.driverjs-theme .driver-popover-next-btn,
.driver-popover.driverjs-theme .driver-popover-done-btn {
    background: #0d6e6e;
    color: #fff;
    border: 0;
    text-shadow: none;
    border-radius: 0.4rem;
    padding: 0.35rem 0.75rem;
}
.driver-popover.driverjs-theme .driver-popover-prev-btn,
.driver-popover.driverjs-theme .driver-popover-close-btn {
    color: #64748b;
    text-shadow: none;
}
.driver-popover.driverjs-theme .driver-popover-progress-text {
    color: #64748b;
    font-size: 0.75rem;
}
/* Driver.js: overlay dims the page; popover must sit above the overlay */
.driver-overlay {
    z-index: 10050 !important;
}
.driver-active-element,
.driver-stage,
#driver-dummy-element {
    z-index: 10055 !important;
}
.driver-popover {
    z-index: 10060 !important;
}
.topbar-project-btn-icon {
    flex: 0 0 auto;
    color: var(--primary);
    font-size: 1rem;
}
.topbar-project-btn-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}
.topbar-project-btn-caret {
    flex: 0 0 auto;
    font-size: 0.75rem;
    color: #7b8ea3;
}
.sp-global-project-list {
    height: min(50vh, 360px);
    min-height: 220px;
    max-height: min(50vh, 360px);
}
.sp-project-item.is-selected {
    border-color: rgba(13, 110, 110, 0.45);
    background: rgba(13, 110, 110, 0.1);
    font-weight: 600;
}

.sidebar-toggle {
    border: 1px solid var(--border-color);
    background: #fff;
    border-radius: 8px;
    width: 40px; height: 40px;
}

.avatar {
    width: 38px; height: 38px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 700;
}

.topbar-user-trigger {
    border: none; background: transparent; padding: 0.25rem;
}
.topbar-user-name { font-size: 0.9rem; font-weight: 600; line-height: 1.2; }
.topbar-user-subtitle { font-size: 0.75rem; line-height: 1.2; }

@media (max-width: 767.98px) {
    .app-topbar {
        padding-left: 0.65rem !important;
        padding-right: 0.65rem !important;
        gap: 0.35rem;
    }
    .topbar-start {
        gap: 0.4rem !important;
    }
    .topbar-project-selector {
        flex: 1 1 auto;
        width: auto;
        max-width: none;
        min-width: 0;
    }
    .topbar-project-btn {
        width: 100%;
        min-width: 0;
        padding: 0.35rem 0.5rem;
    }
    .topbar-tour-btn {
        width: 40px;
        min-width: 40px;
        padding: 0.35rem;
        margin-right: 0;
    }
}

.app-content {
    overflow: auto;
    flex: 1;
    min-height: 0;
    position: relative;
    z-index: 1;
    overscroll-behavior-y: contain;
}

.sp-ptr {
    position: absolute;
    left: 50%;
    top: 0.35rem;
    width: 2.35rem;
    height: 2.35rem;
    margin-left: -1.175rem;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #fff;
    color: var(--primary);
    box-shadow: 0 4px 16px rgba(15, 30, 50, 0.16);
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transform: scale(0.72);
    transition: opacity 0.12s ease, transform 0.12s ease;
}
.sp-ptr.is-visible {
    opacity: 1;
    transform: scale(1);
}
.sp-ptr.is-refreshing .bi {
    animation: sp-ptr-spin 0.7s linear infinite;
}
.sp-ptr .bi {
    font-size: 1.15rem;
    display: block;
    transform-origin: center;
}
@keyframes sp-ptr-spin {
    to { transform: rotate(360deg); }
}
@media (max-width: 767.98px), (pointer: coarse) {
    .sp-ptr {
        display: flex;
    }
}

/* List pages: content fills viewport; table body scrolls */
.app-content:has(> .sp-fill-page) {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}
.sp-fill-page {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
/* Ensure fill-page top doesn't eat the list viewport */
.sp-fill-page-top {
    flex: 0 0 auto;
}
.sp-fill-page-split {
    flex: 1 1 auto;
    min-height: 0;
    margin-left: 0;
    margin-right: 0;
}
.sp-fill-page-split > [class*="col-"] {
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.min-h-0 { min-height: 0 !important; }
.sp-fill-page > .sp-table-card,
.sp-fill-page > .emp-table-card {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.sp-fill-page > .wf-roster {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.page-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.25rem;
    box-shadow: 0 1px 2px rgba(15, 30, 50, 0.04);
}

.sp-table-card {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}
.sp-table-card > .sp-table-scroll,
.sp-table-card > .table-responsive.sp-table-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    border: 0;
    border-radius: 0;
    background: transparent;
}
/* Non-fill pages: keep table panels from blowing past the viewport */
.sp-table-card > .sp-table-scroll {
    max-height: min(65vh, 780px);
}
.sp-fill-page > .sp-table-card > .sp-table-scroll,
.sp-fill-page > .sp-table-card > .table-responsive.sp-table-scroll,
.sp-fill-page > .sp-table-card > .mobile-card-list,
.sp-fill-page > .emp-table-card > .sp-table-scroll,
.sp-fill-page > .emp-table-card > .table-responsive.sp-table-scroll,
.sp-fill-page > .emp-table-card > .mobile-card-list {
    max-height: none;
    flex: 1 1 auto;
    min-height: 0;
}
.sp-table-card > .mobile-card-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 0.85rem;
    overscroll-behavior-y: contain;
}
.sp-table-card > .sp-table-legend-bar {
    flex-shrink: 0;
}
.sp-table-footer {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 1rem;
    border-top: 1px solid var(--border-color);
    background: #f8fafc;
    font-size: 0.8rem;
    color: #64748b;
    border-radius: 0 0 13px 13px;
}
.sp-table-footer-meta {
    font-weight: 500;
}
.sp-table-scroll thead th,
.sp-table-scroll .sp-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--sp-table-header-bg, #f3f6f9);
    background-clip: padding-box;
}

.stat-tile {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1rem 1.15rem;
}
.stat-tile .stat-value { font-size: 1.6rem; font-weight: 700; color: var(--primary); }
.stat-tile .stat-label { color: #64748b; font-size: 0.85rem; }

/* Dashboard */
.sp-dashboard {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: none;
}
.sp-dashboard > .sp-dashboard-hero {
    margin-bottom: 0;
}
.sp-dashboard-dot {
    margin: 0 0.35rem;
    color: #94a3b8;
}
.sp-dashboard-scope {
    font-weight: 600;
    color: #334155;
}
.sp-dashboard-scope.is-all {
    display: inline-flex;
    align-items: center;
    padding: 0.12rem 0.55rem;
    border-radius: 999px;
    background: rgba(13, 110, 110, 0.12);
    color: #0d6e6e;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.sp-dashboard-hero.is-portfolio {
    background:
        linear-gradient(135deg, rgba(11, 31, 51, 0.08) 0%, rgba(13, 110, 110, 0.1) 38%, #fff 74%),
        #fff;
}
.sp-dashboard-hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    flex: 0 0 auto;
    padding-top: 0.15rem;
}
.sp-dashboard-portfolio-lead {
    margin-top: 0.55rem;
    max-width: 40rem;
    color: #64748b;
    font-size: 0.84rem;
    line-height: 1.45;
}
.sp-dashboard-scope-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(13, 110, 110, 0.22);
    border-radius: 12px;
    background: linear-gradient(90deg, rgba(13, 110, 110, 0.08), rgba(246, 248, 251, 0.9));
}
.sp-dashboard-scope-banner-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #0d6e6e;
    color: #fff;
}
.sp-dashboard-scope-banner-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #0b1f33;
}
.sp-dashboard-scope-banner-text {
    margin-top: 0.1rem;
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.4;
}
.sp-dash-stats-accordion {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    --bs-accordion-bg: transparent;
    --bs-accordion-border-color: transparent;
    --bs-accordion-btn-bg: #fff;
    --bs-accordion-active-bg: #fff;
    --bs-accordion-btn-focus-box-shadow: 0 0 0 0.2rem rgba(13, 110, 110, 0.15);
}
.sp-dash-stats-item {
    border: 1px solid #e4ebf2 !important;
    border-radius: 0.85rem !important;
    overflow: hidden;
    background: #fff;
}
.sp-dash-stats-item + .sp-dash-stats-item {
    margin-top: 0;
}
.sp-dash-stats-toggle {
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    font-weight: 600;
    color: #0b1f33;
    box-shadow: none !important;
}
.sp-dash-stats-toggle:not(.collapsed) {
    color: #0b1f33;
    border-bottom: 1px solid #eef2f6;
}
.sp-dash-stats-toggle::after {
    margin-left: 0.5rem;
}
.sp-dash-stats-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.55rem;
    background: #eef6f6;
    color: #0d6e6e;
    flex-shrink: 0;
}
.sp-dash-stats-toggle-label {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
}
.sp-dash-stats-toggle-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-right: 0.35rem;
    flex-shrink: 0;
}
.sp-dash-stats-count {
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
}
.sp-dash-stats-body {
    padding: 0.85rem 1rem 1rem;
    background: #f8fafc;
}
.sp-dashboard-stats-grid.is-portfolio {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.sp-dashboard.is-all-projects .sp-dash-stat {
    padding: 0.85rem 0.9rem;
}
.sp-dashboard.is-all-projects .sp-dash-stat-value {
    font-size: 1.45rem;
}
.sp-dashboard.is-all-projects .sp-dash-stat-label {
    font-size: 0.82rem;
}
.sp-dashboard.is-all-projects .sp-dash-stat-hint {
    font-size: 0.7rem;
}
.sp-dash-projects {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.sp-dash-project-org + .sp-dash-project-org {
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e8eef4;
}
.sp-dash-project-org-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 0.4rem;
}
.sp-dash-project-org-toggle {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    border: 0;
    background: transparent;
    padding: 0 0 0.4rem;
    text-align: left;
    cursor: pointer;
    color: inherit;
}
.sp-dash-project-org-toggle:hover .sp-dash-project-org-label,
.sp-dash-project-org-toggle:focus-visible .sp-dash-project-org-label {
    color: #0d6e6e;
}
.sp-dash-project-org-toggle:focus-visible {
    outline: 2px solid rgba(13, 110, 110, 0.35);
    outline-offset: 2px;
    border-radius: 0.25rem;
}
.sp-dash-project-org-more {
    font-size: 0.68rem;
    font-weight: 650;
    color: #94a3b8;
    margin-left: auto;
}
.sp-dash-project-org-chevron {
    font-size: 0.85rem;
    color: #94a3b8;
    transition: transform 0.15s ease;
}
.sp-dash-project-org-toggle[aria-expanded="true"] .sp-dash-project-org-chevron {
    transform: rotate(180deg);
}
.sp-dash-project-org-toggle[aria-expanded="true"] .sp-dash-project-org-more {
    visibility: hidden;
}
.sp-dash-project {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    text-align: left;
    border: 1px solid #e4ebf2;
    border-radius: 0.7rem;
    background: #fff;
    padding: 0.7rem 0.8rem;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.sp-dash-project:hover,
.sp-dash-project:focus-visible {
    border-color: rgba(13, 110, 110, 0.4);
    background: #f4fbfb;
}
.sp-dash-project-main {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}
.sp-dash-project-code {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #0d6e6e;
}
.sp-dash-project-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sp-dash-project-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
    color: #94a3b8;
}
.sp-dash-project-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: #eef6f6;
    color: #0d6e6e;
    font-size: 0.68rem;
    font-weight: 650;
    white-space: nowrap;
}
.sp-dash-project-chip.is-warn {
    background: #fff7ed;
    color: #c2410c;
}
.sp-dash-project-chip.is-muted {
    background: #f1f5f9;
    color: #64748b;
}
@media (max-width: 991.98px) {
    .sp-dashboard-stats-grid.is-portfolio {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .sp-dashboard-hero.is-portfolio {
        flex-wrap: wrap;
    }
    .sp-dashboard-hero-actions {
        width: 100%;
    }
}
@media (max-width: 575.98px) {
    .sp-dashboard-stats-grid.is-portfolio {
        grid-template-columns: 1fr;
    }
}
.sp-dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
}
.sp-dash-stat {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-height: 100%;
    padding: 1rem 1.05rem;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 30, 50, 0.03);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.sp-dash-stat.is-link:hover {
    border-color: rgba(13, 110, 110, 0.35);
    box-shadow: 0 6px 18px rgba(15, 30, 50, 0.06);
    transform: translateY(-1px);
    color: inherit;
}
.sp-dash-stat-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #eef6f6;
    color: var(--primary);
    font-size: 1.05rem;
}
.sp-dash-stat-warn .sp-dash-stat-icon {
    background: #fff7ed;
    color: #c2410c;
}
.sp-dash-stat-value {
    font-size: 1.7rem;
    font-weight: 720;
    line-height: 1.1;
    color: #0b1f33;
    letter-spacing: -0.02em;
}
.sp-dash-stat-warn .sp-dash-stat-value {
    color: #9a3412;
}
.sp-dash-stat-label {
    margin-top: 0.2rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: #334155;
}
.sp-dash-stat-hint {
    margin-top: 0.15rem;
    font-size: 0.75rem;
    color: #94a3b8;
    line-height: 1.35;
}
.sp-dash-stat-chevron {
    margin-left: auto;
    color: #94a3b8;
    font-size: 0.85rem;
    align-self: center;
}
.sp-dashboard-panel {
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 30, 50, 0.03);
}
.sp-dashboard-panel-head {
    padding: 0.95rem 1.15rem;
    background: #f6f8fb;
    border-bottom: 1px solid var(--border-color);
}
.sp-dashboard-panel-title {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 650;
    color: #0b1f33;
}
.sp-dashboard-panel-sub {
    margin-top: 0.2rem;
    font-size: 0.8rem;
    color: #64748b;
}
.sp-dashboard-panel-body {
    padding: 0.85rem;
}
.sp-dash-actions {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.sp-dash-action {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid transparent;
    border-radius: 0.75rem;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.sp-dash-action:hover {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: inherit;
}
.sp-dash-action-icon {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(145deg, #0b1f33 0%, #143552 55%, #0d6e6e 140%);
    color: #f4f8fb;
    font-size: 1rem;
}
.sp-dash-action-title {
    display: block;
    font-size: 0.92rem;
    font-weight: 650;
    color: #0b1f33;
}
.sp-dash-action-desc {
    display: block;
    margin-top: 0.1rem;
    font-size: 0.78rem;
    color: #64748b;
}
.sp-dash-action-arrow {
    margin-left: auto;
    color: #94a3b8;
    font-size: 0.9rem;
}
.sp-dash-modules {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.sp-dash-module {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.7rem 0.75rem;
    border-radius: 0.7rem;
    background: #f8fafc;
}
.sp-dash-module-status {
    flex-shrink: 0;
    min-width: 2.75rem;
    padding: 0.18rem 0.45rem;
    border-radius: 999px;
    text-align: center;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.sp-dash-module-status.is-live {
    background: rgba(13, 110, 110, 0.12);
    color: #0d6e6e;
}
.sp-dash-module-status.is-next {
    background: #e2e8f0;
    color: #475569;
}
.sp-dash-module-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 650;
    color: #0b1f33;
}
.sp-dash-module-note {
    display: block;
    margin-top: 0.1rem;
    font-size: 0.76rem;
    color: #64748b;
    line-height: 1.35;
}

@media (max-width: 991.98px) {
    .sp-dashboard-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 575.98px) {
    .sp-dashboard-stats-grid {
        grid-template-columns: 1fr;
    }
    .sp-dash-stat-hint {
        display: none;
    }
}

.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

.table-responsive {
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: #fff;
    overflow: auto;
    /* Cap height so the wrapper scrolls vertically and sticky headers engage */
    max-height: min(65vh, 780px);
}
.page-card > .table-responsive {
    border: 0;
    border-radius: 0;
}

.table {
    --sp-table-header-bg: #f3f6f9;
    --sp-table-header-fg: #4a5d70;
    --sp-table-border: #e2e8f0;
    --sp-table-row-hover: #f0f7f7;
    --sp-table-selected: #e4f3f3;
    margin-bottom: 0;
    font-size: 0.9rem;
    border-color: var(--sp-table-border);
}
.table > :not(caption) > * > * {
    border-bottom-color: var(--sp-table-border);
    padding: 0.7rem 0.85rem;
    vertical-align: middle;
}

.table thead th,
.sp-table thead th {
    background: var(--sp-table-header-bg);
    font-size: 0.72rem;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--sp-table-header-fg);
    /* sticky keeps headers visible on scroll and still anchors sort/resize handles */
    position: sticky;
    top: 0;
    z-index: 3;
    white-space: nowrap;
    user-select: none;
    border-bottom: 1px solid #cfd8e3 !important;
    box-shadow: inset 0 -1px 0 #cfd8e3;
}
.table thead th.sp-th-sortable {
    cursor: pointer;
    padding-right: 1.75rem;
}
.table thead th.sp-th-sortable.sp-th-has-filter {
    padding-right: 2.65rem;
}
.table thead th.sp-th-sortable:hover {
    background: #e8eef4;
    color: #2c3e50;
}
.sp-th-sort {
    position: absolute;
    right: 10px;
    top: 50%;
    width: 0.7rem;
    height: 0.9rem;
    transform: translateY(-50%);
    opacity: 0.3;
    pointer-events: none;
}
.sp-th-filter {
    position: absolute;
    right: 1.35rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.15rem;
    height: 1.15rem;
    padding: 0;
    border: 0;
    border-radius: 0.25rem;
    background: transparent;
    color: #64748b;
    opacity: 0.45;
    line-height: 1;
    cursor: pointer;
}
.sp-th-filter:hover,
.sp-th-filter:focus-visible {
    opacity: 1;
    color: var(--primary);
    background: rgba(13, 110, 110, 0.08);
    outline: none;
}
.sp-th-filter.is-active {
    opacity: 1;
    color: var(--primary);
}
.sp-th-filter i {
    font-size: 0.72rem;
    pointer-events: none;
}
.sp-th-sort::before,
.sp-th-sort::after {
    content: '';
    position: absolute;
    left: 50%;
    width: 0;
    height: 0;
    border-left: 0.28rem solid transparent;
    border-right: 0.28rem solid transparent;
    transform: translateX(-50%);
}
.sp-th-sort::before {
    top: 0.05rem;
    border-bottom: 0.28rem solid currentColor;
    opacity: 0.4;
}
.sp-th-sort::after {
    bottom: 0.05rem;
    border-top: 0.28rem solid currentColor;
    opacity: 0.4;
}
.sp-table thead th.is-sorted-asc .sp-th-sort,
.sp-table thead th.is-sorted-desc .sp-th-sort {
    opacity: 1;
    color: var(--primary);
}
.sp-table thead th.is-sorted-asc .sp-th-sort::before { opacity: 1; }
.sp-table thead th.is-sorted-asc .sp-th-sort::after { opacity: 0.2; }
.sp-table thead th.is-sorted-desc .sp-th-sort::before { opacity: 0.2; }
.sp-table thead th.is-sorted-desc .sp-th-sort::after { opacity: 1; }
.sp-table thead th.is-sorted-asc,
.sp-table thead th.is-sorted-desc {
    background: #e7f1f1;
    color: var(--primary);
}

.table tbody tr:nth-child(even) {
    background: #fafbfc;
}
.table.table-hover > tbody > tr:hover > * {
    --bs-table-bg-state: var(--sp-table-row-hover);
    background-color: var(--sp-table-row-hover);
}
.table tbody tr.row-clickable { cursor: pointer; }
.sp-report-person-link {
    font-weight: 600;
    text-decoration: none;
}
.sp-report-person-link:hover,
.sp-report-person-link:focus-visible {
    text-decoration: underline;
}
.table tbody tr.row-selected,
.table tbody tr.row-selected:hover > * {
    background: var(--sp-table-selected) !important;
}
.table tbody td {
    color: #1e2a3a;
}

.col-resize-handle {
    position: absolute;
    right: -4px;
    top: 0;
    width: 14px;
    height: 100%;
    cursor: col-resize;
    z-index: 5;
    touch-action: none;
}
.col-resize-handle::after {
    content: '';
    position: absolute;
    top: 22%;
    bottom: 22%;
    left: 50%;
    width: 2px;
    transform: translateX(-50%);
    background: transparent;
    border-radius: 1px;
    transition: background 0.15s ease;
}
.sp-table thead th:hover .col-resize-handle::after,
.sp-table thead th.is-resizing .col-resize-handle::after {
    background: #94a3b8;
}
.sp-table thead th.is-resizing {
    background: #e2eef0;
}
body.sp-col-resizing {
    cursor: col-resize !important;
    user-select: none !important;
}
body.sp-col-resizing * {
    cursor: col-resize !important;
}
body.sp-col-resizing .sp-table-scroll,
body.sp-col-resizing .table-responsive {
    overflow-x: auto !important;
}

/* Dense settings / catalog tables */
.table.table-sm > :not(caption) > * > * {
    padding: 0.5rem 0.7rem;
}
.table.table-sm thead th {
    font-size: 0.68rem;
}

.mobile-card-list .m-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.9rem 1rem;
    margin-bottom: 0.65rem;
}
.mobile-card-list .m-card.row-clickable {
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.mobile-card-list .m-card.row-clickable:hover,
.mobile-card-list .m-card.row-clickable:focus-visible {
    border-color: rgba(13, 110, 110, 0.4);
    box-shadow: 0 2px 8px rgba(15, 30, 50, 0.06);
    outline: none;
}
.mobile-card-list .m-card-title { font-weight: 650; }
.mobile-card-list .m-card-meta { font-size: 0.82rem; color: #64748b; }

.settings-nav-card {
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(15, 30, 50, 0.03);
}
.settings-nav .list-group-item.active {
    background: var(--primary);
    border-color: var(--primary);
}
.settings-nav-group + .settings-nav-group {
    border-top: 1px solid var(--border-color);
}
.settings-nav-group-label {
    padding: 0.65rem 1rem 0.35rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
}
.settings-nav-group .list-group-item {
    border-left: 0;
    border-right: 0;
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
}
.settings-nav-group:last-child .list-group-item:last-child {
    border-bottom: 0;
}

/* Shared settings section chrome (roles-inspired) */
.sp-settings-section,
.sp-roles-settings {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.sp-settings-hero,
.sp-roles-hero,
.sp-ers-hero {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem 1.15rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 70%);
}
.sp-settings-hero-icon,
.sp-roles-hero-icon,
.sp-ers-hero-icon,
.sp-bs-hero-icon {
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 0.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(145deg, #0b1f33 0%, #143552 55%, #0d6e6e 140%);
    color: #f4f8fb;
    font-size: 1.15rem;
}
.sp-settings-hero-body {
    flex: 1 1 auto;
    min-width: 0;
}
.sp-settings-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
    padding-top: 0.15rem;
}
.sp-settings-section > .alert {
    margin: 0;
}
.sp-settings-note,
.sp-roles-note {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
    border-radius: 0.65rem;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.84rem;
}
.sp-settings-note .bi,
.sp-roles-note .bi {
    margin-top: 0.1rem;
    color: #64748b;
}
.sp-settings-panel {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 30, 50, 0.03);
}
.sp-settings-panel-head {
    padding: 0.95rem 1.15rem;
    background: #f6f8fb;
    border-bottom: 1px solid var(--border-color);
}
.sp-settings-panel-title {
    font-size: 0.95rem;
    font-weight: 650;
    color: #0b1f33;
}
.sp-settings-panel-sub {
    margin-top: 0.2rem;
    font-size: 0.8rem;
    color: #64748b;
}
.sp-settings-panel-body {
    padding: 1.15rem;
}
.sp-settings-panel.page-card {
    padding: 1.15rem;
}
.sp-settings-panel.sp-table-card,
.sp-settings-panel.page-card.sp-table-card {
    padding: 0;
}
.sp-settings-panel > .table,
.sp-settings-panel-body > .table {
    margin-bottom: 0;
}

/* Fit tables inside settings/cards — no desktop horizontal scrollbar */
.sp-settings-section .table-responsive,
.sp-settings-section .sp-table-scroll,
.sp-settings-panel .table-responsive,
.sp-table-fit-wrap {
    max-width: 100%;
}
.sp-settings-section .table-responsive:not(.sp-roles-matrix-scroll):not(.sp-allow-x-scroll),
.sp-settings-panel .table-responsive:not(.sp-roles-matrix-scroll):not(.sp-allow-x-scroll),
.sp-table-fit-wrap:not(.sp-allow-x-scroll) {
    overflow-x: hidden;
    overflow-y: auto;
}
.sp-settings-panel-body > .table-responsive:not(.border):not(.sp-ers-table-wrap) {
    border: 0;
    border-radius: 0;
    background: transparent;
    max-height: none;
}
.sp-settings-section table.table:not([data-sp-resize="1"]),
.sp-settings-section .sp-table:not([data-sp-resize="1"]),
.sp-table-fit:not([data-sp-resize="1"]) {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
}
.sp-settings-section .sp-table tbody td,
.sp-table-fit tbody td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sp-settings-section .sp-table:not([data-sp-resize="1"]) thead th,
.sp-table-fit:not([data-sp-resize="1"]) thead th {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sp-settings-section .sp-table tbody td.table-row-actions,
.sp-settings-section .sp-table tbody td.text-end,
.sp-settings-section .sp-table tbody td.text-nowrap,
.sp-settings-section .sp-table tbody td.ers-dev-project-cell,
.sp-settings-section .sp-table tbody td.ctr-col-check,
.sp-settings-section .sp-table tbody td.proj-col-check,
.sp-settings-section .sp-table tbody td.emp-col-check,
.sp-settings-section .sp-table thead th.ctr-col-check,
.sp-settings-section .sp-table thead th.proj-col-check,
.sp-settings-section .sp-table thead th.emp-col-check,
.sp-table-fit tbody td.table-row-actions,
.sp-table-fit tbody td.text-end,
.sp-table-fit tbody td.text-nowrap,
.sp-table-fit tbody td.ers-dev-project-cell,
.sp-table-fit tbody td.ctr-col-check,
.sp-table-fit tbody td.proj-col-check,
.sp-table-fit tbody td.emp-col-check,
.sp-table-fit thead th.ctr-col-check,
.sp-table-fit thead th.proj-col-check,
.sp-table-fit thead th.emp-col-check {
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
}
.sp-settings-section .sp-table:not([data-sp-resize="1"]) .col-resize-handle,
.sp-table-fit:not([data-sp-resize="1"]) .col-resize-handle {
    display: none !important;
}
.sp-table[data-sp-resize="1"] {
    table-layout: fixed;
}
.sp-table[data-sp-resize="1"] thead th {
    position: relative;
    overflow: visible;
}
.sp-table-fit-wrap.sp-allow-x-scroll {
    overflow-x: auto;
}
@media (max-width: 767.98px) {
    .sp-settings-section .table-responsive:not(.sp-roles-matrix-scroll),
    .sp-settings-panel .table-responsive:not(.sp-roles-matrix-scroll),
    .sp-table-fit-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

.sp-roles-legend {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex-shrink: 0;
    padding-top: 0.15rem;
}
.sp-roles-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}
.sp-roles-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: #cbd5e1;
    border: 1px solid #94a3b8;
}
.sp-roles-dot.is-on {
    background: var(--primary);
    border-color: var(--primary);
}
.sp-roles-matrix-wrap {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}
.sp-roles-matrix-scroll {
    max-height: min(70vh, 720px);
    overflow: auto;
}
.sp-roles-matrix {
    width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}
.sp-roles-matrix thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #edf2f7;
    color: #334155;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: none;
    border-bottom: 1px solid #d7e0ea;
    padding: 0.7rem 0.45rem;
    vertical-align: middle;
}
.sp-roles-matrix .sp-roles-perm-col {
    width: 34%;
    min-width: 12rem;
    text-align: left;
    padding-left: 1rem !important;
    padding-right: 0.75rem !important;
}
.sp-roles-matrix .sp-roles-role-col {
    width: 11%;
    min-width: 4.5rem;
}
.sp-roles-matrix thead .sp-roles-perm-col {
    position: sticky;
    left: 0;
    z-index: 4;
    background: #edf2f7;
    box-shadow: 1px 0 0 #d7e0ea;
}
.sp-roles-role-short {
    display: none;
}
.sp-roles-matrix tbody th.sp-roles-perm-col {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #fff;
    box-shadow: 1px 0 0 #eef2f6;
    font-weight: 500;
    color: #1e293b;
    vertical-align: middle;
}
.sp-roles-matrix tbody tr.sp-roles-perm-row.is-stripe th.sp-roles-perm-col,
.sp-roles-matrix tbody tr.sp-roles-perm-row.is-stripe > td {
    background: #fafbfc;
}
.sp-roles-matrix tbody tr.sp-roles-perm-row.is-stripe th.sp-roles-perm-col {
    background: #fafbfc;
}
.sp-roles-matrix tbody td {
    padding: 0.45rem 0.35rem;
    border-bottom: 1px solid #eef2f6;
    vertical-align: middle;
}
.sp-roles-matrix tbody tr.sp-roles-perm-row:hover > td,
.sp-roles-matrix tbody tr.sp-roles-perm-row:hover > th.sp-roles-perm-col {
    background: #f0f7f7 !important;
}
.sp-roles-group-row th {
    position: sticky;
    left: 0;
    z-index: 1;
    background: #f1f5f9 !important;
    color: #475569;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 0 !important;
    border-bottom: 1px solid #e2e8f0;
    border-top: 1px solid #e2e8f0;
}
.sp-roles-group-toggle {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    margin: 0;
    padding: 0.6rem 1rem;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    text-align: left;
    cursor: pointer;
}
.sp-roles-group-toggle:hover {
    background: #e8eef5;
}
.sp-roles-group-toggle:focus-visible {
    outline: 2px solid #0d6e6e;
    outline-offset: -2px;
}
.sp-roles-group-chevron {
    flex: 0 0 auto;
    font-size: 0.85rem;
    color: #64748b;
    transition: transform 0.15s ease;
}
.sp-roles-group-row.is-open .sp-roles-group-chevron {
    transform: rotate(90deg);
}
.sp-roles-group-label {
    flex: 1 1 auto;
    min-width: 0;
}
.sp-roles-group-count {
    flex: 0 0 auto;
    min-width: 1.4rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: #e2e8f0;
    color: #475569;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0;
    text-align: center;
    text-transform: none;
}
.sp-roles-perm-label {
    display: block;
    line-height: 1.3;
    font-size: 0.875rem;
}
.sp-roles-perm-key {
    display: block;
    margin-top: 0.1rem;
    font-size: 0.68rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: #94a3b8;
    font-weight: 400;
}
.sp-roles-switch {
    display: inline-flex;
    justify-content: center;
    width: 100%;
    min-height: 1.5rem;
    padding-left: 2.1rem;
}
.sp-roles-switch .form-check-input {
    width: 2.1rem;
    height: 1.15rem;
    margin-left: -2.1rem;
    cursor: pointer;
}
.sp-roles-switch .form-check-input:disabled {
    opacity: 0.55;
    cursor: wait;
}
.sp-roles-matrix-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 1rem;
    border-top: 1px solid var(--border-color);
    background: #fafbfc;
}
@media (max-width: 991.98px) {
    .sp-settings-hero,
    .sp-roles-hero,
    .sp-ers-hero {
        flex-wrap: wrap;
    }
    .sp-settings-hero-actions {
        width: 100%;
    }
    .sp-roles-legend {
        flex-direction: row;
        gap: 0.85rem;
        width: 100%;
    }
    .sp-roles-role-full {
        display: none;
    }
    .sp-roles-role-short {
        display: inline;
    }
    .sp-roles-matrix .sp-roles-perm-col {
        width: 42%;
    }
    .sp-roles-perm-key {
        display: none;
    }
}

/* ERS Integration settings */
.sp-ers-settings {
    max-width: 960px;
}
.sp-ers-panel {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 30, 50, 0.03);
}
.sp-ers-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.95rem 1.15rem;
    background: #f6f8fb;
    border-bottom: 1px solid var(--border-color);
}
.sp-ers-panel-title {
    font-size: 0.95rem;
    font-weight: 650;
    color: #0b1f33;
}
.sp-ers-panel-sub {
    margin-top: 0.2rem;
    font-size: 0.8rem;
    color: #64748b;
}
.sp-ers-panel-body {
    padding: 1.15rem;
}
.sp-ers-bucket-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
}
.sp-ers-bucket-chip.is-idle {
    background: #eef2f6;
    color: #4a5d70;
    border-color: #d7e0ea;
}
.sp-ers-bucket-chip.is-busy {
    background: #e4f3f3;
    color: #0a5757;
    border-color: #b7d9d9;
}
.sp-ers-bucket-toolbar {
    display: grid;
    grid-template-columns: minmax(10rem, 12.5rem) minmax(10rem, 12.5rem) auto minmax(14rem, 1fr);
    gap: 0 1.15rem;
    align-items: start;
    margin-bottom: 1.15rem;
    padding-bottom: 1.1rem;
    border-bottom: 1px solid var(--border-color);
}
.sp-ers-bucket-field {
    display: grid;
    grid-template-rows: 1.15rem 1.95rem 1.15rem;
    align-items: center;
    min-width: 0;
}
.sp-ers-bucket-field .form-label {
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #4a5d70;
    margin: 0;
    line-height: 1.15rem;
    align-self: end;
}
.sp-ers-bucket-field .form-text {
    font-size: 0.72rem;
    margin: 0;
    line-height: 1.15rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sp-ers-bucket-field .input-group {
    height: 1.95rem;
}
.sp-ers-bucket-field .form-control,
.sp-ers-bucket-field .input-group-text {
    height: 1.95rem;
    min-height: 1.95rem;
}
.sp-ers-bucket-field .input-group-text {
    font-size: 0.72rem;
    font-weight: 600;
    color: #4a5d70;
    background: #f3f6f9;
    min-width: 2.6rem;
    justify-content: center;
    padding-left: 0.55rem;
    padding-right: 0.55rem;
}
.sp-ers-bucket-save .btn {
    height: 1.95rem;
    padding: 0 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}
.sp-ers-bucket-health-control {
    display: flex;
    align-items: center;
    height: 1.95rem;
    min-width: 0;
}
.sp-ers-bucket-meter {
    height: 0.38rem;
    width: 100%;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}
.sp-ers-bucket-meter-fill {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #0d6e6e, #1d4f7c);
    transition: width 0.45s ease;
}
.sp-ers-bucket-block + .sp-ers-bucket-block {
    margin-top: 1.1rem;
}
.sp-ers-bucket-block-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.45rem;
}
.sp-ers-bucket-block-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #4a5d70;
    margin: 0 0 0.45rem;
}
.sp-ers-bucket-block-head .sp-ers-bucket-block-title {
    margin-bottom: 0;
}
.sp-ers-bucket-block-hint {
    font-size: 0.72rem;
    color: #64748b;
}
.sp-ers-bucket-empty {
    font-size: 0.8rem;
    color: #64748b;
    padding: 0.7rem 0.85rem;
    border: 1px dashed #d7e0ea;
    border-radius: 10px;
    background: #fbfcfd;
}
.sp-ers-bucket-endpoints {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}
.sp-ers-bucket-endpoints.is-empty {
    border: 0;
    background: transparent;
}
.sp-ers-bucket-ep {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.65rem 1rem;
    padding: 0.62rem 0.85rem;
    border-bottom: 1px solid #e8eef4;
    background: #fff;
}
.sp-ers-bucket-ep:last-child {
    border-bottom: 0;
}
.sp-ers-bucket-ep.is-due {
    background: #f0f7f7;
}
.sp-ers-bucket-ep-name {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8rem;
    font-weight: 600;
    color: #0b1f33;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sp-ers-bucket-ep-count {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #0a5757;
    background: #e4f3f3;
    border-radius: 999px;
    min-width: 1.55rem;
    padding: 0.14rem 0.45rem;
    text-align: center;
    white-space: nowrap;
}
.sp-ers-bucket-ep-wait {
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
    color: #4a5d70;
    text-align: right;
    min-width: 4.5rem;
}
.sp-ers-bucket-ep-wait.is-due {
    color: #0d6e6e;
    font-weight: 650;
}
.sp-ers-bucket-table-wrap {
    max-height: none;
}
.sp-ers-bucket-table-wrap .table {
    font-size: 0.82rem;
}
.sp-ers-bucket-table-wrap .table thead th {
    font-size: 0.68rem;
}
.sp-ers-bucket-table-wrap .table tbody td {
    padding: 0.55rem 0.75rem;
}
.sp-ers-bucket-id {
    font-variant-numeric: tabular-nums;
    color: #64748b;
    font-size: 0.78rem;
}
.sp-ers-bucket-status {
    display: inline-flex;
    align-items: center;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: #eef2f6;
    color: #4a5d70;
}
.sp-ers-bucket-status.is-pending {
    background: #eef2f6;
    color: #4a5d70;
}
.sp-ers-bucket-status.is-running {
    background: #e4f3f3;
    color: #0a5757;
}
.sp-ers-bucket-status.is-failed {
    background: #fde8e8;
    color: #9b1c1c;
}
.ers-bucket-row {
    cursor: pointer;
}
.ers-bucket-row:hover td {
    background: #f0f7f7;
}
.ers-bucket-countdown {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}
@media (max-width: 767.98px) {
    .sp-ers-bucket-toolbar {
        grid-template-columns: 1fr 1fr;
        row-gap: 0.65rem;
    }
    .sp-ers-bucket-health {
        grid-column: 1 / -1;
    }
    .sp-ers-bucket-ep {
        grid-template-columns: minmax(0, 1fr) auto;
    }
    .sp-ers-bucket-ep-wait {
        grid-column: 1 / -1;
        text-align: left;
        min-width: 0;
    }
}
.sp-ers-subhead {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    font-weight: 650;
    color: #1e293b;
    margin: 0 0 0.35rem;
}
.sp-ers-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.45rem;
    border-radius: 0.35rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.sp-ers-badge-core {
    background: #e4f3f3;
    color: #0d6e6e;
}
.sp-ers-badge-extra {
    background: #eef2f7;
    color: #475569;
}
.sp-ers-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}
.sp-ers-check {
    padding: 0.65rem 0.85rem;
    background: #f8fafc;
    border: 1px solid #e8eef4;
    border-radius: 0.65rem;
}
.sp-ers-debug {
    max-height: 320px;
    overflow: auto;
    white-space: pre-wrap;
    background: #0b1f33;
    color: #e8eef4;
    border-radius: 0.65rem;
    padding: 0.85rem 1rem;
    font-size: 0.78rem;
    margin-bottom: 0;
}
.sp-ers-table-wrap {
    border: 1px solid var(--border-color);
    border-radius: 0.65rem;
    overflow-x: hidden;
    overflow-y: auto;
    max-width: 100%;
}
.sp-ers-map-table {
    margin-bottom: 0;
}
.sp-ers-map-table thead th {
    background: #f3f6f9;
}
.sp-ers-key {
    font-size: 0.8rem;
    font-weight: 600;
    color: #0f172a !important;
    background: #f1f5f9;
    border-radius: 0.3rem;
    padding: 0.12rem 0.35rem;
}
.sp-ers-key-ers {
    background: #eef7f7;
    color: #0d5c5c !important;
}
.sp-ers-dir {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    white-space: nowrap;
}
.sp-ers-row-warn td {
    background: #fffbeb;
}
.sp-ers-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.sp-ers-form .form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #334155;
}
.page-card:has(.sp-ers-settings),
.page-card:has(.sp-bs-settings) {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

/* BuildSmart Integration settings */
.sp-bs-settings {
    max-width: 960px;
}
.sp-bs-hero-icon {
    background: linear-gradient(145deg, #1a2744 0%, #2d4a7a 55%, #2563eb 140%);
}
.sp-bs-status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.sp-bs-status-pill.is-ready {
    background: #dbeafe;
    color: #1d4ed8;
}
.sp-bs-status-pill.is-pending {
    background: #fef3c7;
    color: #b45309;
}
.sp-bs-summary-card {
    height: 100%;
    border: 1px solid var(--border-color);
    border-radius: 0.85rem;
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
    padding: 0.95rem 1rem;
}
.sp-bs-summary-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 0.35rem;
}
.sp-bs-summary-value {
    font-size: 0.98rem;
    font-weight: 650;
    color: #0f172a;
    line-height: 1.35;
    word-break: break-word;
}
.sp-bs-summary-hint {
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: #64748b;
}
.sp-bs-org-select {
    min-height: calc(1.5em + 0.75rem + 2px);
}
.sp-bs-org-select-multi {
    min-height: 10.5rem;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.sp-bs-org-picker .sp-bs-org-select:not(.sp-bs-org-select-multi) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.sp-bs-org-picker {
    align-items: stretch;
}
.sp-bs-org-picker .sp-bs-org-refresh {
    flex: 0 0 auto;
    width: calc(1.5em + 0.75rem + 2px);
    min-height: calc(1.5em + 0.75rem + 2px);
    align-self: stretch;
    height: auto;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}
.sp-bs-org-picker .sp-bs-org-refresh i {
    font-size: 1.05rem;
    line-height: 1;
}
.sp-bs-org-picker .sp-bs-org-refresh:hover:not(:disabled) {
    background: #eef2ff;
    border-color: #6366f1;
    color: #4338ca;
}
.sp-bs-spin {
    animation: sp-bs-spin 0.75s linear infinite;
}
@keyframes sp-bs-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.tooltip.sp-bs-refresh-tip .tooltip-inner {
    max-width: 260px;
    padding: 0.65rem 0.8rem;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1.35;
    border-radius: 0.65rem;
    background: linear-gradient(160deg, #1e3a8a 0%, #2563eb 50%, #1d4ed8 100%);
    border: 1px solid rgba(191, 219, 254, 0.35);
    box-shadow:
        0 10px 28px rgba(37, 99, 235, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}
.tooltip.sp-bs-refresh-tip .tooltip-inner .sp-bs-refresh-tip-title {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #bfdbfe;
    margin-bottom: 0.25rem;
}
.tooltip.sp-bs-refresh-tip .tooltip-inner .sp-bs-refresh-tip-body {
    color: #fff;
}
.tooltip.sp-bs-refresh-tip .tooltip-arrow::before {
    border-top-color: #1e3a8a;
}
.tooltip.sp-bs-refresh-tip.bs-tooltip-bottom .tooltip-arrow::before {
    border-bottom-color: #1d4ed8;
}
.sp-bs-endpoint-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: #eef2ff;
    color: #4338ca;
}
.sp-bs-uri-input {
    background: #f8fafc;
}
.sp-bs-msg {
    min-height: 1.25rem;
}

.flash-message-container {
    position: fixed; top: 12px; right: 12px; z-index: 2000; max-width: 380px;
}

.auth-shell .auth-main {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(145deg, #0b1f33 0%, #1a3a52 40%, #0d6e6e 100%);
}
.auth-card {
    background: #fff; border-radius: 16px; padding: 2rem;
    width: 100%; max-width: 420px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}

.form-switch .form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }

.signature-pad {
    border: 1px dashed #94a3b8; border-radius: 8px; background: #fafafa; width: 100%; height: 160px; touch-action: none;
}

/* Induction workflow wizard (vendor-style milestones + large option cards) */
.sp-wf-modal .modal-content {
    border: 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 28px 72px rgba(11, 31, 51, 0.28);
}
.sp-wf-dialog {
    max-width: min(920px, calc(100vw - 1.5rem));
}
.sp-wf-dialog .modal-body.sp-wf-body,
#workflowModal .sp-modal-body {
    background:
        radial-gradient(1200px 280px at 0% 0%, rgba(13, 110, 110, 0.06), transparent 55%),
        linear-gradient(180deg, #f7fafb 0%, #ffffff 42%);
    padding: 1.15rem 1.35rem 1.45rem;
}
.sp-wf-pane {
    animation: spWfPaneIn 0.22s ease;
}
@keyframes spWfPaneIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.sp-wf-person {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    border: 1px solid #d7e5e5;
    background: linear-gradient(135deg, #ffffff 0%, #f3fafa 100%);
    box-shadow: 0 1px 2px rgba(15, 30, 50, 0.04);
}
.sp-wf-person > div {
    min-width: 0;
    flex: 1 1 auto;
}
.sp-wf-person-name {
    font-weight: 700;
    color: #0f172a;
    font-size: 1.05rem;
    line-height: 1.3;
    letter-spacing: -0.01em;
}
.sp-wf-person-meta {
    color: #64748b;
    font-size: 0.875rem;
    margin-top: 0.15rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sp-wf-person-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.sp-wf-steps-nav {
    margin-bottom: 1.15rem;
    padding: 0.95rem 0.75rem 0.65rem;
    background: linear-gradient(180deg, #eef7f7 0%, #f7fbfb 100%);
    border: 1px solid #d5e8e8;
    border-radius: 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.sp-wf-steps {
    list-style: none;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin: 0;
    padding: 0;
    gap: 0.25rem;
}
.sp-wf-step {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    z-index: 1;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: inherit;
}
.sp-wf-step:not(:first-child)::before {
    content: '';
    position: absolute;
    /* Sit just under the marker circles (vendor wizard style) */
    top: 37px;
    right: 50%;
    width: 100%;
    height: 3px;
    background: #cbd5e1;
    z-index: 0;
}
.sp-wf-step.is-done:not(:first-child)::before,
.sp-wf-step.is-line-done:not(:first-child)::before {
    background: linear-gradient(90deg, #198754, #20c997);
}
.sp-wf-step-n {
    position: relative;
    z-index: 1;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    background: #fff;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.sp-wf-step-check {
    display: none;
    font-size: 1rem;
    line-height: 1;
}
.sp-wf-step.is-active .sp-wf-step-n {
    border-color: var(--primary, #0d6e6e);
    background: var(--primary, #0d6e6e);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(13, 110, 110, 0.18);
}
.sp-wf-step.is-done .sp-wf-step-n {
    border-color: #198754;
    background: #198754;
    color: #fff;
    box-shadow: none;
}
.sp-wf-step.is-done.is-active .sp-wf-step-n {
    box-shadow: 0 0 0 4px rgba(25, 135, 84, 0.18);
}
.sp-wf-step.is-done .sp-wf-step-num {
    display: none;
}
.sp-wf-step.is-done .sp-wf-step-check {
    display: inline-flex;
}
.sp-wf-step-l {
    margin-top: 0.45rem;
    font-size: 0.72rem;
    font-weight: 650;
    color: #64748b;
    line-height: 1.25;
    max-width: 5.75rem;
}
.sp-wf-step.is-active .sp-wf-step-l {
    color: var(--primary, #0d6e6e);
}
.sp-wf-step.is-done .sp-wf-step-l {
    color: #198754;
}

.sp-wf-step-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1rem;
    padding: 0.8rem 0.95rem;
    background: linear-gradient(135deg, #f4faf9 0%, #eef7f7 100%);
    border: 1px solid #d5e8e8;
    border-radius: 12px;
}
.sp-wf-step-icon {
    width: 2.85rem;
    height: 2.85rem;
    flex: 0 0 2.85rem;
    border-radius: 0.75rem;
    background: #dff3f3;
    color: var(--primary, #0d6e6e);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: inset 0 0 0 1px rgba(13, 110, 110, 0.08);
}
.sp-wf-step-title {
    margin: 0;
    font-weight: 700;
    color: #0f172a;
    font-size: 1.02rem;
    letter-spacing: -0.01em;
}
.sp-wf-step-subtitle {
    margin: 0.2rem 0 0;
    color: #64748b;
    font-size: 0.85rem;
}

.sp-wf-q-progress {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.85rem;
}
.sp-wf-q-dot {
    flex: 1 1 0;
    height: 6px;
    border-radius: 999px;
    background: #e2e8f0;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
.sp-wf-q-dot.is-done {
    background: #198754;
}
.sp-wf-q-dot.is-active {
    background: var(--primary, #0d6e6e);
    box-shadow: 0 0 0 3px rgba(13, 110, 110, 0.16);
}

.sp-wf-q {
    margin-bottom: 0.35rem;
    padding: 1.05rem 1.1rem;
    border: 1px solid #dce6ef;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 30, 50, 0.04);
}
.sp-wf-q-title {
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.9rem;
    line-height: 1.4;
    font-size: 1.05rem;
}
.sp-wf-opts {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.sp-wf-opt {
    position: relative;
    margin: 0;
    min-height: 3rem;
}
.sp-wf-opt input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}
.sp-wf-opt-label {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    width: 100%;
    margin: 0;
    padding: 0.9rem 1rem;
    border: 1.5px solid #d7e0ea;
    border-radius: 12px;
    background: #fff;
    color: #1e293b;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.sp-wf-opt-mark {
    width: 1.4rem;
    height: 1.4rem;
    flex: 0 0 1.4rem;
    margin-top: 0.08rem;
    border-radius: 50%;
    border: 2px solid #94a3b8;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.sp-wf-opt-mark::after {
    content: '';
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: transparent;
    transition: background-color 0.15s ease;
}
.sp-wf-opt-text {
    flex: 1 1 auto;
    min-width: 0;
    padding-top: 0.05rem;
}
.sp-wf-opt-label:hover {
    border-color: rgba(13, 110, 110, 0.45);
    background: #f4faf9;
}
.sp-wf-opt-label:active {
    transform: scale(0.995);
}
.sp-wf-opt input:focus-visible + .sp-wf-opt-label {
    border-color: var(--primary, #0d6e6e);
    box-shadow: 0 0 0 3px rgba(13, 110, 110, 0.18);
}
.sp-wf-opt input:checked + .sp-wf-opt-label {
    border-color: var(--primary, #0d6e6e);
    background: linear-gradient(180deg, #eef8f8 0%, #e5f4f4 100%);
    box-shadow: 0 0 0 1px rgba(13, 110, 110, 0.22), 0 6px 16px rgba(13, 110, 110, 0.08);
}
.sp-wf-opt input:checked + .sp-wf-opt-label .sp-wf-opt-mark {
    border-color: var(--primary, #0d6e6e);
    background: var(--primary, #0d6e6e);
    box-shadow: inset 0 0 0 2px #fff;
}
.sp-wf-opt input:checked + .sp-wf-opt-label .sp-wf-opt-mark::after {
    background: #fff;
}
.sp-wf-opt input:checked + .sp-wf-opt-label .sp-wf-opt-text {
    color: #0f172a;
    font-weight: 650;
}

.sp-wf-pass-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
    padding: 0.6rem 0.8rem;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-size: 0.875rem;
    color: #475569;
}
.sp-wf-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.55rem;
    margin-top: 1.05rem;
    padding-top: 0.95rem;
    border-top: 1px solid #eef2f6;
}
.sp-wf-actions .btn {
    min-height: 2.6rem;
    min-width: 7.5rem;
    font-weight: 600;
    border-radius: 0.65rem;
}
#workflowModal .modal-footer.sp-modal-footer-has-tour {
    flex-wrap: nowrap;
    gap: 0.5rem;
}
#workflowModal .sp-modal-footer-actions {
    flex-wrap: nowrap;
    min-width: 0;
}
#workflowModal .sp-modal-footer-actions .btn {
    min-height: 2.25rem;
    min-width: 0;
    font-weight: 600;
    border-radius: 0.65rem;
    white-space: nowrap;
}
.sp-wf-sig-wrap {
    position: relative;
}
.sp-wf-sig-wrap .signature-pad {
    display: block;
    width: 100%;
    min-height: 200px;
    height: 200px;
    border: 1.5px solid #cbd5e1;
    border-radius: 14px;
    background:
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: inset 0 1px 2px rgba(15, 30, 50, 0.04);
    touch-action: none;
    cursor: crosshair;
}
.sp-wf-sig-clear {
    position: absolute;
    top: 0.45rem;
    right: 0.45rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    min-height: 1.85rem;
    padding: 0.18rem 0.58rem;
    border-radius: 999px;
    border: 1px solid #d7e0ea;
    background: rgba(255, 255, 255, 0.94);
    color: #475569;
    font-size: 0.75rem;
    font-weight: 650;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(15, 30, 50, 0.1);
}
.sp-wf-sig-clear .bi {
    font-size: 0.9rem;
}
.sp-wf-sig-clear:hover,
.sp-wf-sig-clear:focus {
    background: #fff;
    color: #0f172a;
    border-color: #94a3b8;
}
.sp-wf-card {
    padding: 1rem 1.05rem;
    border: 1px solid #dce6ef;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 30, 50, 0.04);
}
.sp-wf-badge-frame {
    width: 100%;
    min-height: 480px;
    height: min(70vh, 560px);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    background: #f8fafc;
}
.sp-wf-sig-hint {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0 4.75rem;
    text-align: center;
}
.sp-wf-sig-wrap.is-signed .sp-wf-sig-hint {
    display: none;
}
.sp-wf-video {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #d7e0ea;
    background: #0f172a;
}

@media (max-width: 575.98px) {
    .sp-wf-dialog {
        margin: 0.5rem;
        max-width: calc(100vw - 1rem);
    }
    .sp-wf-dialog .modal-body.sp-wf-body,
    #workflowModal .sp-modal-body {
        padding: 0.9rem 0.9rem 1.1rem;
    }
    .sp-wf-person {
        padding: 0.8rem 0.85rem;
    }
    .sp-wf-step-n {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    .sp-wf-step:not(:first-child)::before {
        top: 31px;
    }
    .sp-wf-step-l {
        font-size: 0.62rem;
        max-width: 4.35rem;
    }
    .sp-wf-opt-label {
        padding: 1rem 1.05rem;
        min-height: 3.4rem;
        font-size: 0.98rem;
    }
    .sp-wf-opt-mark {
        width: 1.55rem;
        height: 1.55rem;
        flex-basis: 1.55rem;
    }
    .sp-wf-opt-mark::after {
        width: 0.65rem;
        height: 0.65rem;
    }
    .sp-wf-q {
        padding: 0.9rem;
    }
    .sp-wf-actions {
        flex-direction: column-reverse;
    }
    .sp-wf-actions .btn {
        width: 100%;
        min-width: 0;
    }
    #workflowModal .modal-footer.sp-modal-footer-has-tour {
        gap: 0.4rem;
        padding: 0.65rem 0.8rem 0.8rem;
    }
    #workflowModal .sp-modal-tour-btn {
        min-height: 2.15rem;
        padding: 0.32rem 0.65rem;
        font-size: 0.78rem;
    }
    #workflowModal .sp-modal-footer-actions {
        gap: 0.35rem;
    }
    #workflowModal .sp-modal-footer-actions .btn {
        min-height: 2.15rem;
        padding: 0.32rem 0.7rem;
        font-size: 0.875rem;
    }
    .sp-wf-sig-wrap .signature-pad {
        min-height: 220px;
        height: 220px;
    }
}
.sp-visitor-sig-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #fff;
    padding: 0.65rem;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}
.sp-visitor-sig-card .signature-pad {
    display: block;
    border-radius: 8px;
    border: 1px dashed #94a3b8;
    background: #fafafa;
}
.sp-project-item-meta {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.1rem;
}

.card-designer-preview {
    border: 1px solid var(--border-color); border-radius: 8px; background: #fff;
    aspect-ratio: 54 / 86; max-width: 280px; position: relative; overflow: hidden;
}
.card-designer-preview .cd-field {
    position: absolute; font-size: 11px; color: #111;
}

.card-designer-stage {
    display: flex;
    justify-content: center;
    padding: 0.75rem;
    background:
        linear-gradient(45deg, #e2e8f0 25%, transparent 25%),
        linear-gradient(-45deg, #e2e8f0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e2e8f0 75%),
        linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    border-radius: 10px;
    overflow: visible;
}
.card-designer-canvas {
    position: relative;
    width: min(100%, 520px);
    aspect-ratio: 85.6 / 53.98;
    background: #fff;
    border: 2px solid #1e293b;
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(15, 30, 50, 0.18);
    overflow: hidden;
    touch-action: none;
    user-select: none;
}
.card-designer-canvas.is-bg-overflow {
    overflow: visible;
    z-index: 1;
}
.card-designer-canvas--badge {
    width: min(100%, 320px);
    aspect-ratio: 54 / 86;
    border-radius: 12px;
}
.card-designer-canvas--badge-landscape {
    width: min(100%, 480px);
    aspect-ratio: 86 / 54;
    border-radius: 12px;
}
.card-designer-canvas.has-snap-grid {
    /* visual grid applied as background layers from the designer JS */
}
.badge-side-tabs .nav-link {
    padding: 0.35rem 0.85rem;
    font-size: 0.875rem;
}
.badge-designer-toolbar .btn {
    min-width: 2rem;
    padding-left: 0.45rem;
    padding-right: 0.45rem;
}
.tooltip.badge-tip .tooltip-inner {
    max-width: 240px;
    padding: 0.55rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    border-radius: 0.5rem;
    background: #0f172a;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.28);
}
.tooltip.badge-tip .tooltip-arrow::before {
    border-top-color: #0f172a;
}

/* Invalid SA ID in tables */
td.sp-id-invalid,
.sp-id-invalid-mark {
    box-sizing: border-box;
}
td.sp-id-invalid {
    border: 2px solid #dc3545 !important;
    background: rgba(220, 53, 69, 0.07);
    box-shadow: inset 0 0 0 1px rgba(220, 53, 69, 0.2);
}
td.sp-id-invalid.sp-id-editable {
    cursor: cell;
}
td.sp-id-invalid.sp-id-editable:hover {
    background: rgba(220, 53, 69, 0.12);
}
td.sp-id-invalid .sp-id-invalid-mark {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #b42318;
    font-weight: 600;
}
td.sp-id-invalid .sp-id-invalid-icon {
    font-size: 0.95rem;
    flex-shrink: 0;
    cursor: help;
}
td.sp-id-invalid.sp-id-editing {
    padding: 0.15rem 0.25rem !important;
    cursor: text;
    border-color: #2563eb !important;
    background: #fff;
    box-shadow: inset 0 0 0 1px #2563eb;
    outline: none;
}
td.sp-id-invalid.sp-id-edit-error {
    border-color: #dc3545 !important;
    box-shadow: inset 0 0 0 1px #dc3545;
}
td.sp-id-invalid .sp-id-inline-input {
    width: 100%;
    min-width: 8.5rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    padding: 0.2rem 0.3rem;
}
td.sp-id-invalid .sp-id-inline-input:focus {
    box-shadow: none;
    border-color: transparent;
}
.tooltip.sp-id-tip .tooltip-inner {
    max-width: 280px;
    padding: 0.7rem 0.85rem;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1.35;
    border-radius: 0.65rem;
    background: linear-gradient(160deg, #7f1d1d 0%, #991b1b 45%, #450a0a 100%);
    border: 1px solid rgba(254, 202, 202, 0.35);
    box-shadow:
        0 10px 28px rgba(127, 29, 29, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}
.tooltip.sp-id-tip .tooltip-inner .sp-id-tip-title {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #fecaca;
    margin-bottom: 0.25rem;
}
.tooltip.sp-id-tip .tooltip-inner .sp-id-tip-body {
    color: #fff;
}
.tooltip.sp-id-tip .tooltip-arrow::before {
    border-top-color: #7f1d1d;
}
.tooltip.sp-id-tip.bs-tooltip-bottom .tooltip-arrow::before {
    border-bottom-color: #7f1d1d;
}
.tooltip.sp-id-tip.bs-tooltip-start .tooltip-arrow::before {
    border-left-color: #7f1d1d;
}
.tooltip.sp-id-tip.bs-tooltip-end .tooltip-arrow::before {
    border-right-color: #7f1d1d;
}
.cd-field-text--wrap {
    white-space: pre-wrap !important;
    text-overflow: clip;
    overflow: auto;
    line-height: 1.25;
}
.cd-field-text--clamp2 {
    white-space: normal !important;
    overflow: hidden !important;
    text-overflow: ellipsis;
    display: -webkit-box !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    line-height: 1.25;
    word-break: break-word;
}
.cd-field-box {
    position: absolute;
    box-sizing: border-box;
    border: 1px dashed rgba(13, 110, 110, 0.55);
    background: rgba(13, 110, 110, 0.08);
    border-radius: 4px;
    padding: 2px 4px;
    cursor: move;
    overflow: hidden;
    line-height: 1.2;
    color: #0f172a;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.cd-field-box.selected {
    border: 2px solid var(--primary);
    background: rgba(13, 110, 110, 0.16);
    z-index: 50;
}
.cd-field-box.has-box-style.selected {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}
.cd-field-box.is-photo,
.cd-field-box.is-image,
.cd-field-box.is-qr {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: rgba(148, 163, 184, 0.25);
    padding: 0;
}
.cd-field-box.is-image.has-box-style {
    background-color: transparent;
}
.cd-field-box.is-shape {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.cd-shape-label {
    font-size: 10px;
    color: #64748b;
    pointer-events: none;
    opacity: 0.85;
}
.cd-field-box.is-qr {
    background: #fff;
    padding: 2px;
}
.cd-qr-host {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    overflow: hidden;
}
.cd-qr-host img,
.cd-qr-host canvas,
.cd-qr-host table {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
}
.cd-field-text {
    display: block;
    pointer-events: none;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cd-field-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    display: block;
}
.cd-resize {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 2px 0 0 0;
    cursor: nwse-resize;
}
.badge-field-context-menu {
    position: fixed;
    z-index: 1080;
    display: none;
    min-width: 160px;
    padding: 0.35rem;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 0.55rem;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
}
.badge-field-context-menu.show { display: block; }
.badge-field-context-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    border: 0;
    background: transparent;
    border-radius: 0.4rem;
    padding: 0.45rem 0.65rem;
    font-size: 0.875rem;
    text-align: left;
    cursor: pointer;
}
.badge-field-context-item:hover {
    background: rgba(220, 53, 69, 0.08);
}
.palette-btn { margin-bottom: 0.25rem; }
.form-label-sm { font-size: 0.75rem; margin-bottom: 0.15rem; }

.gate-result-panel {
    border-left: 4px solid var(--primary);
    background: #fff;
    border-radius: 12px;
    padding: 1rem;
}

.sidebar-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1035;
}
.sidebar-backdrop.show { display: block; }

@media (max-width: 991.98px) {
    .app-sidebar {
        position: fixed; top: 0; left: 0; bottom: 0;
        transform: translateX(-100%);
        width: min(280px, 86vw);
        padding: 1.25rem 1rem;
    }
    .app-sidebar.mobile-open { transform: translateX(0); }
    /* Desktop “collapsed rail” cookie must not apply in the mobile drawer */
    .app-sidebar.collapsed {
        width: min(280px, 86vw);
        padding: 1.25rem 1rem;
    }
    .app-sidebar.collapsed .sidebar-title,
    .app-sidebar.collapsed .sp-nav-link-text,
    .app-sidebar.collapsed .sp-nav-group-label,
    .app-sidebar.collapsed .sp-nav-chevron {
        display: revert;
    }
    .app-sidebar.collapsed .sp-nav-group-body {
        display: block !important;
    }
    .app-sidebar.collapsed .sp-nav-group-body.d-none {
        display: none !important;
    }
    .app-sidebar.collapsed .sp-nav-group-toggle,
    .app-sidebar.collapsed .sidebar-link {
        justify-content: flex-start;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    .app-sidebar.collapsed .sp-nav-badge {
        position: static;
        transform: none;
        margin-left: auto;
    }
    .sidebar-close-mobile { display: inline-flex; }
}

/* Modal stacking safety */
.modal { z-index: var(--bs-modal-zindex); }
.modal-backdrop { z-index: var(--bs-backdrop-zindex); }

/* Row Quick Actions (Fleet-style overflow menu) */
.table-row-actions {
    width: 3.5rem !important;
    min-width: 3.5rem !important;
    max-width: 3.5rem !important;
    padding-left: 0.25rem !important;
    padding-right: 0.35rem !important;
    text-align: center !important;
    vertical-align: middle;
    white-space: nowrap;
    box-sizing: border-box;
}
.table-row-actions-wide {
    width: 5.75rem !important;
    min-width: 5.75rem !important;
    max-width: 5.75rem !important;
}
.table-row-actions-xwide {
    width: 7.75rem !important;
    min-width: 7.75rem !important;
    max-width: 7.75rem !important;
}
.sp-icon-btn {
    width: 2rem;
    height: 2rem;
    min-width: 2rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.55rem;
}
.sp-icon-btn .bi {
    font-size: 0.95rem;
    line-height: 1;
}
.sp-table thead th.table-row-actions {
    padding-right: 0.45rem !important;
    letter-spacing: 0.02em;
}
.sp-table tbody td.table-row-actions {
    /* Match other cells — do not paint a separate plate behind icons */
    background: transparent !important;
    background-color: transparent !important;
}
.sp-table.table-hover > tbody > tr:hover > td.table-row-actions,
.sp-table tbody tr.row-selected > td.table-row-actions,
.table.table-hover > tbody > tr:hover > td.table-row-actions,
.table tbody tr.row-selected > td.table-row-actions {
    /* Keep hover/selected in sync with sibling cells */
    background-color: var(--bs-table-bg-state, var(--sp-table-row-hover)) !important;
}
.table tbody tr.row-selected > td.table-row-actions,
.table tbody tr.row-selected:hover > td.table-row-actions {
    background-color: var(--sp-table-selected) !important;
}
/* Table legend: single button above the table */
.sp-table-legend-bar {
    display: flex;
    align-items: center;
    padding: 0.45rem 0.85rem;
    border-bottom: 1px solid var(--bs-border-color-translucent, rgba(0, 0, 0, 0.08));
    background: var(--bs-tertiary-bg, rgba(0, 0, 0, 0.02));
}
.sp-table-legend-wrap {
    width: 100%;
    overflow-x: hidden;
}
.sp-table-legend-table {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
    margin-bottom: 0;
}
.sp-table-legend-table thead th,
.sp-table-legend-table tbody td {
    overflow: visible;
    text-overflow: clip;
    vertical-align: middle;
    padding-left: 0.85rem;
    padding-right: 0.85rem;
}
.sp-table-legend-table col.sp-table-legend-col-icon,
.sp-table-legend-table .sp-table-legend-col-icon {
    width: 3.5rem;
    max-width: 3.5rem;
    text-align: center;
    white-space: nowrap;
    padding-left: 0.65rem;
    padding-right: 0.35rem;
}
.sp-table-legend-table col.sp-table-legend-col-action,
.sp-table-legend-table .sp-table-legend-col-action {
    width: 9.75rem;
    max-width: 9.75rem;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: normal;
    line-height: 1.3;
}
.sp-table-legend-table col.sp-table-legend-col-hint,
.sp-table-legend-table .sp-table-legend-col-hint {
    width: auto;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: break-word;
    line-height: 1.4;
}
.sp-table-legend-table .sp-icon-btn,
.sp-table-legend-table .sp-row-actions-menu-btn {
    pointer-events: none;
    cursor: default;
}
.sp-row-actions-menu-btn {
    width: 2rem;
    height: 2rem;
    min-width: 2rem;
    min-height: 2rem;
    padding: 0;
    border-radius: 0.55rem;
    border-color: transparent;
    color: #5b6b7c;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: none;
}
.sp-row-actions-menu-btn .bi {
    font-size: 1.1rem;
    line-height: 1;
}
.sp-row-actions-menu-btn:hover,
.sp-row-actions-menu-btn:focus-visible {
    color: var(--primary);
    border-color: rgba(13, 110, 110, 0.35);
    background: #eef7f7;
    box-shadow: 0 0 0 3px rgba(13, 110, 110, 0.12);
}
.sp-row-actions-menu-btn:active {
    transform: translateY(1px);
}
.sp-icon-btn.btn-outline-secondary,
.sp-icon-btn.btn-outline-danger {
    background-color: transparent;
}
.sp-icon-btn.btn-outline-secondary:hover,
.sp-icon-btn.btn-outline-secondary:focus-visible {
    background-color: #eef7f7;
}
.sp-icon-btn.btn-outline-danger:hover,
.sp-icon-btn.btn-outline-danger:focus-visible {
    background-color: rgba(220, 53, 69, 0.08);
}
.sp-table {
    width: 100%;
    max-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.sp-table tbody td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sp-table tbody td.table-row-actions,
.sp-table tbody td.sp-id-invalid,
.sp-table tbody td.ctr-col-check,
.sp-table tbody td.proj-col-check,
.sp-table tbody td.emp-col-check,
.sp-table tbody td.ind-col-check,
.sp-table tbody td.pb-col-check,
.sp-table tbody td.vc-col-check,
.sp-table thead th.ctr-col-check,
.sp-table thead th.proj-col-check,
.sp-table thead th.emp-col-check,
.sp-table thead th.ind-col-check,
.sp-table thead th.pb-col-check,
.sp-table thead th.vc-col-check {
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
}

.emp-page-title {
    letter-spacing: -0.02em;
    color: #10233a;
}
.emp-page-head {
    padding-bottom: 0.15rem;
}

/* Shared page heading (matches dashboard hero) */
.sp-page-head,
.sp-dashboard-hero {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 1.1rem 1.2rem;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background:
        linear-gradient(135deg, rgba(13, 110, 110, 0.08) 0%, rgba(11, 31, 51, 0.04) 42%, #fff 72%),
        #fff;
    margin-bottom: 0.85rem;
}
.sp-ers-pending-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    position: relative;
}
.sp-ers-pending-btn .sp-ers-pending-count {
    min-width: 1.25rem;
    font-size: 0.7rem;
    font-weight: 700;
}
.sp-page-head-actions .sp-ers-pending-btn {
    border-color: #e0a800;
    color: #7a5b00;
    background: #fffbeb;
}
.sp-page-head-actions .sp-ers-pending-btn:hover,
.sp-page-head-actions .sp-ers-pending-btn:focus {
    border-color: #c69500;
    color: #5c4300;
    background: #fff3cd;
}
.sp-page-head-icon,
.sp-dashboard-hero-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(145deg, #0b1f33 0%, #143552 55%, #0d6e6e 140%);
    color: #f4f8fb;
    font-size: 1.2rem;
}
.sp-page-head-body,
.sp-dashboard-hero-body {
    flex: 1 1 auto;
    min-width: 0;
}
.sp-page-head-kicker,
.sp-dashboard-kicker {
    margin: 0 0 0.25rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #0d6e6e;
}
.sp-page-title {
    margin: 0 0 0.25rem;
    letter-spacing: -0.02em;
    color: #10233a;
    font-weight: 700;
    line-height: 1.25;
}
.sp-page-head-sub {
    margin: 0;
    color: #64748b;
    font-size: 0.8125rem;
    line-height: 1.4;
    max-width: 44rem;
}
.sp-page-head-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    flex: 0 1 auto;
    max-width: 100%;
    padding-top: 0.1rem;
}
.sp-page-head-actions .btn {
    white-space: nowrap;
    box-shadow: none;
}
.sp-page-head-actions .btn-sm {
    padding: 0.42rem 0.8rem;
    font-size: 0.875rem;
    border-radius: 0.5rem;
}
.sp-page-head-actions .btn-primary {
    box-shadow: 0 1px 2px rgba(11, 31, 51, 0.12);
}
.sp-page-head-actions .small.text-muted {
    width: 100%;
    text-align: right;
    order: -1;
}

@media (max-width: 991.98px) {
    /* Compact page heads — prioritize list/table space */
    .sp-page-head,
    .sp-dashboard-hero {
        align-items: center;
        gap: 0.65rem;
        padding: 0.7rem 0.85rem;
        margin-bottom: 0.55rem;
    }
    .sp-page-head-icon,
    .sp-dashboard-hero-icon {
        width: 2.15rem;
        height: 2.15rem;
        border-radius: 0.55rem;
        font-size: 1rem;
    }
    .sp-page-head-kicker,
    .sp-dashboard-kicker,
    .sp-dashboard-hero-body > .text-muted.small {
        display: none !important;
    }
    .sp-page-head-sub {
        display: block !important;
        margin: 0.15rem 0 0;
        font-size: 0.72rem;
        line-height: 1.3;
        color: #64748b;
        max-width: none;
    }
    .sp-page-title,
    .sp-dashboard-hero-body .h3 {
        margin: 0;
        font-size: 1.15rem;
        line-height: 1.2;
    }
    .sp-page-head-actions {
        width: auto;
        max-width: 55%;
        flex: 0 1 auto;
        justify-content: flex-end;
        margin: 0;
        padding: 0;
        border: 0;
        gap: 0.35rem;
    }
    .sp-page-head-actions .btn {
        flex: 0 1 auto;
        min-width: 0;
        width: auto;
        padding: 0.32rem 0.55rem;
        font-size: 0.78rem;
        justify-content: center;
    }
    .sp-page-head-actions .btn .bi {
        margin-right: 0.2rem !important;
    }
    .sp-page-head-actions .small.text-muted {
        display: none !important;
    }
}
@media (max-width: 575.98px) {
    .sp-page-head,
    .sp-dashboard-hero {
        padding: 0.6rem 0.75rem;
        gap: 0.55rem;
        margin-bottom: 0.45rem;
    }
    .sp-page-title,
    .sp-dashboard-hero-body .h3 {
        font-size: 1.05rem;
    }
    .sp-page-head-actions {
        max-width: 58%;
    }
    /* Multi-button heads: keep buttons compact, allow wrap under title row only if needed */
    .sp-page-head:has(.sp-page-head-actions .btn ~ .btn) {
        flex-wrap: wrap;
    }
    .sp-page-head:has(.sp-page-head-actions .btn ~ .btn) .sp-page-head-body {
        flex: 1 1 calc(100% - 3rem);
    }
    .sp-page-head:has(.sp-page-head-actions .btn ~ .btn) .sp-page-head-actions {
        width: 100%;
        max-width: none;
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    .sp-page-head:has(.sp-page-head-actions .btn ~ .btn) .sp-page-head-actions .btn {
        flex: 0 1 auto;
        width: auto;
    }
}

/* Settings heroes: keep actions tidy on mobile */
@media (max-width: 767.98px) {
    .sp-settings-hero,
    .sp-roles-hero,
    .sp-ers-hero {
        flex-wrap: wrap;
    }
    .sp-settings-hero-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
        gap: 0.45rem;
        padding-top: 0.15rem;
    }
    .sp-settings-hero-actions .btn {
        width: 100%;
        justify-content: center;
        white-space: nowrap;
    }
}

/* Employees page — toolbar + table */
.emp-toolbar,
.sp-search-toolbar {
    padding: 0.75rem 0.9rem;
    background: #fff;
    border-color: var(--border-color);
    box-shadow: 0 1px 2px rgba(15, 30, 50, 0.03);
}
.emp-toolbar-main {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) minmax(0, 2.4fr);
    gap: 0.75rem 0.85rem;
    align-items: end;
}
.sp-search-toolbar-main {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 0.55rem 0.65rem;
}
.sp-search-toolbar-search {
    flex: 1 1 14rem;
    min-width: 0;
}
.sp-search-toolbar-side {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 0.45rem;
    flex: 1 1 auto;
    min-width: 0;
}
.sp-search-toolbar-filter {
    flex: 1 1 9rem;
    min-width: 0;
    max-width: 16rem;
}
.sp-settings-panel-body > .sp-search-toolbar {
    padding: 0;
    background: transparent;
    box-shadow: none;
    border: 0;
}
.emp-toolbar-filters-host {
    min-width: 0;
}
/* Type / company / screening: mobile filter sheet only (desktop uses column filters).
   Status stays visible on desktop so Terminated/Pending can be loaded from the API. */
#empFiltersDesktopHost .emp-filter-sheet-only {
    display: none !important;
}
#empFiltersDesktopHost .emp-toolbar-filters {
    grid-template-columns: minmax(8.5rem, 11rem) minmax(12rem, 16rem) auto;
    justify-content: start;
    align-items: end;
}
#empFiltersDesktopHost .emp-filter-reset {
    align-items: stretch;
}
#empFiltersDesktopHost .emp-filter-reset .btn {
    align-self: flex-end;
    white-space: nowrap;
}
.emp-toolbar-filters {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.55rem 0.65rem;
    align-items: end;
}
#vcToolbar .emp-toolbar-filters,
#indToolbar .emp-toolbar-filters {
    grid-template-columns: repeat(2, minmax(160px, 220px));
    justify-content: start;
}
.emp-toolbar-mobile-actions {
    display: none;
    flex: 0 0 auto;
    align-items: end;
    gap: 0.4rem;
}
.emp-toolbar-mobile-actions > .btn,
.emp-toolbar-mobile-actions .btn-group,
.emp-toolbar-mobile-actions .btn-group > .btn {
    width: auto;
}
.emp-toolbar-icon-btn {
    width: 2.35rem;
    height: 2.35rem;
    min-width: 2.35rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.55rem;
    border: 1px solid #d5dee8;
    background: #fff;
    color: #475569;
    position: relative;
    line-height: 1;
}
.emp-toolbar-icon-btn:hover,
.emp-toolbar-icon-btn:focus-visible {
    border-color: rgba(13, 110, 110, 0.45);
    color: var(--primary);
    background: #f4fbfb;
}
.emp-toolbar-icon-btn .bi {
    font-size: 1rem;
    margin: 0 !important;
}
.emp-toolbar-icon-btn.dropdown-toggle::after {
    display: none;
}
.emp-toolbar-icon-btn .emp-toolbar-icon-badge {
    position: absolute;
    top: -0.3rem;
    right: -0.3rem;
    min-width: 1.05rem;
    height: 1.05rem;
    padding: 0 0.28rem;
    font-size: 0.62rem;
    line-height: 1.05rem;
    border-radius: 999px;
}
.emp-toolbar-icon-btn .visually-hidden-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
#spToolbarFiltersModalBody .sp-search-toolbar-filter {
    max-width: none;
    width: 100%;
    flex: none;
    margin-bottom: 0.85rem;
}
#spToolbarFiltersModalBody .sp-search-toolbar-filter:last-child {
    margin-bottom: 0;
}
#empFiltersModal .emp-toolbar-filters,
#vcFiltersModal .emp-toolbar-filters,
#indFiltersModal .emp-toolbar-filters {
    grid-template-columns: 1fr;
    gap: 0.85rem;
}
.emp-toolbar-foot-hint {
    font-size: 0.78rem;
}
.emp-field-label {
    display: block;
    margin-bottom: 0.22rem;
    font-size: 0.65rem;
    font-weight: 650;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #7b8ea3;
}
.emp-search-wrap {
    position: relative;
}
.emp-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    font-size: 0.9rem;
}
.emp-search-input {
    padding-left: 2.05rem;
    border-radius: 0.55rem;
    border-color: #d5dee8;
    min-height: 2.35rem;
}
.emp-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.15rem rgba(13, 110, 110, 0.12);
}
.emp-company-filter {
    position: relative;
}
.emp-company-filter .emp-search-input {
    padding-right: 2.15rem;
}
.emp-company-filter-clear {
    position: absolute;
    right: 0.15rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    color: #7b8ea3;
    line-height: 1;
}
.emp-company-filter-clear:hover {
    color: #334155;
}

/* Fancy desktop tooltips */
.tooltip.sp-tip {
    --bs-tooltip-bg: #0b1f33;
    --bs-tooltip-color: #f8fafc;
    --bs-tooltip-opacity: 1;
    --bs-tooltip-padding-x: 0.75rem;
    --bs-tooltip-padding-y: 0.45rem;
    --bs-tooltip-font-size: 0.74rem;
    --bs-tooltip-border-radius: 0.5rem;
    --bs-tooltip-max-width: 16rem;
}
.tooltip.sp-tip .tooltip-inner {
    box-shadow: 0 12px 32px rgba(15, 30, 50, 0.28);
    font-weight: 550;
    letter-spacing: 0.02em;
}
.tooltip.sp-tip .tooltip-arrow::before {
    border-top-color: #0b1f33 !important;
    border-bottom-color: #0b1f33 !important;
}
.tooltip.sp-tip.bs-tooltip-start .tooltip-arrow::before {
    border-left-color: #0b1f33 !important;
}
.tooltip.sp-tip.bs-tooltip-end .tooltip-arrow::before {
    border-right-color: #0b1f33 !important;
}
.emp-company-filter-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 0.25rem);
    z-index: 30;
    max-height: 16rem;
    overflow: auto;
    margin: 0;
    padding: 0.25rem;
    list-style: none;
    background: #fff;
    border: 1px solid #cfd9e4;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1.25rem rgba(15, 23, 42, 0.12);
}
.emp-company-filter-menu .emp-company-filter-option {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    border-radius: 0.35rem;
    padding: 0.45rem 0.65rem;
    font-size: 0.875rem;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.emp-company-filter-menu .emp-company-filter-option:hover,
.emp-company-filter-menu .emp-company-filter-option.is-active {
    background: #eef6f6;
    color: #0d6e6e;
}
.emp-company-filter-menu .emp-company-filter-option.is-selected {
    font-weight: 600;
}
.emp-company-filter-menu .emp-company-filter-empty {
    padding: 0.55rem 0.65rem;
    font-size: 0.85rem;
    color: #64748b;
}
.emp-toolbar .form-control,
.emp-toolbar .form-select,
.sp-search-toolbar .form-control,
.sp-search-toolbar .form-select {
    border-color: #cfd9e4;
    background: #fff;
    min-height: 2.35rem;
    box-shadow: none;
    border-radius: 0.55rem;
}
.emp-toolbar .form-control:focus,
.emp-toolbar .form-select:focus,
.sp-search-toolbar .form-control:focus,
.sp-search-toolbar .form-select:focus {
    border-color: rgba(13, 110, 110, 0.45);
    box-shadow: 0 0 0 0.15rem rgba(13, 110, 110, 0.12);
}
.emp-toolbar-foot {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem 1rem;
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e4ebf2;
    min-height: 3.5rem;
}
.emp-toolbar-foot-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem 1rem;
    width: 100%;
}
.emp-toolbar.has-bulk-selection .emp-toolbar-foot-main {
    visibility: hidden;
}
.emp-invalid-check .form-check-label {
    color: #475569;
    font-size: 0.875rem;
}
.emp-bulk-bar {
    position: absolute;
    inset: 0.75rem 0 0 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem 0.75rem;
    margin: 0;
    padding: 0.65rem 1rem;
    border-radius: 10px;
    background: rgba(13, 110, 110, 0.06);
    border: 1px solid rgba(13, 110, 110, 0.14);
    z-index: 2;
}
.emp-bulk-bar[hidden] {
    display: none !important;
}
.emp-bulk-count {
    font-size: 0.82rem;
    font-weight: 650;
    color: var(--primary);
    min-width: 5.5rem;
}
.emp-bulk-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.emp-table-card {
    border-color: #cfd9e4;
    box-shadow: 0 1px 2px rgba(15, 30, 50, 0.04), 0 10px 28px rgba(15, 40, 70, 0.05);
    position: relative;
}
.emp-table-card > .sp-table-footer {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    background: #f4f7fa;
    color: #526579;
}
.emp-table-card > .sp-table-legend-bar {
    position: relative;
    z-index: 6;
    flex-shrink: 0;
}
.emp-table.sp-table {
    --sp-table-header-bg: #edf3f6;
    --sp-table-header-fg: #3f5368;
    --sp-table-row-hover: #f3f8f8;
    --sp-table-selected: #e2f1f1;
    font-size: 0.875rem;
}
.emp-table-card > .sp-table-scroll,
.emp-table-card > .table-responsive.sp-table-scroll {
    contain: layout paint;
    overflow-x: auto;
    overflow-y: auto;
}
.emp-col-filter-list {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    max-height: min(50vh, 22rem);
    overflow: auto;
    padding: 0.25rem 0.15rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #f8fafc;
}
.emp-col-filter-item {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin: 0;
    padding: 0.35rem 0.55rem;
    border-radius: 0.35rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: #1e293b;
}
.emp-col-filter-item:hover {
    background: #eef2f7;
}
.emp-col-filter-item .form-check-input {
    margin-top: 0.2rem;
    flex-shrink: 0;
}
.emp-col-filter-label {
    min-width: 0;
    word-break: break-word;
}
.emp-table tbody tr {
    content-visibility: auto;
    contain-intrinsic-size: auto 42px;
}
.emp-table thead th {
    padding-top: 0.72rem;
    padding-bottom: 0.72rem;
    border-bottom: 1px solid #c5d1de !important;
}
.emp-table tbody td {
    padding-top: 0.62rem;
    padding-bottom: 0.62rem;
    color: #1f2d3d;
    border-bottom-color: #e8eef4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.emp-table tbody tr:last-child > * {
    border-bottom-color: transparent;
}
.emp-cell-name .emp-name {
    font-weight: 600;
    color: #132033;
}
.emp-cell-mono {
    font-variant-numeric: tabular-nums;
    font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
    font-size: 0.82rem;
    color: #334155;
}
.emp-cell-company {
    color: #334155;
}
.emp-cell-project {
    color: #334155;
    font-size: 0.84rem;
}
.emp-cell-muted {
    color: #64748b;
}
.emp-chip {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    border: 1px solid #d5dee8;
    background: #f4f7fa;
    color: #334155;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.emp-chip-type {
    background: #eef6f6;
    border-color: #c7dddc;
    color: #0d5f5f;
    text-transform: capitalize;
}
.emp-chip-ok {
    background: #e8f7ef;
    border-color: #b7e0c7;
    color: #176b3a;
}
.emp-chip-warn {
    background: #fff6e8;
    border-color: #edd2a4;
    color: #8a5a10;
}
.emp-chip-bad {
    background: #fdecec;
    border-color: #efc0c0;
    color: #9b2c2c;
}
.emp-chip-muted {
    background: #f1f5f9;
    border-color: #d8e0ea;
    color: #64748b;
    text-transform: none;
}
#employeesTable tbody tr.emp-selected > *,
#employeesTable tbody tr.emp-selected:hover > * {
    background-color: var(--sp-table-selected) !important;
    box-shadow: inset 3px 0 0 var(--primary);
}

@media (max-width: 1199.98px) {
    .emp-toolbar-main {
        grid-template-columns: 1fr;
    }
    .emp-toolbar-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    #vcToolbar .emp-toolbar-filters,
    #indToolbar .emp-toolbar-filters {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
    }
}
@media (max-width: 767.98px) {
    .sp-fill-page-top {
        flex: 0 0 auto;
    }
    .sp-fill-page > .emp-table-card {
        flex: 1 1 auto;
        min-height: 0;
    }
    .emp-toolbar,
    .sp-search-toolbar {
        padding: 0.65rem 0.75rem;
    }
    .emp-toolbar-main,
    .sp-search-toolbar-main {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 0.45rem;
        grid-template-columns: none;
    }
    .emp-toolbar-search,
    .sp-search-toolbar-search {
        display: block !important;
        flex: 1 1 auto;
        min-width: 0;
        order: 1;
    }
    .emp-toolbar-search .emp-field-label,
    .sp-search-toolbar-search .emp-field-label {
        display: none;
    }
    .emp-toolbar-search .emp-search-wrap,
    .sp-search-toolbar-search .emp-search-wrap {
        width: 100%;
    }
    .emp-toolbar-mobile-actions,
    .sp-toolbar-mobile-icons {
        display: flex;
        flex: 0 0 auto;
        align-items: center;
        gap: 0.4rem;
        order: 2;
    }
    .emp-toolbar-filters-host {
        display: none !important;
    }
    .emp-toolbar-foot-main {
        min-height: 0;
    }
    .emp-toolbar-foot:not(:has(.emp-bulk-bar:not([hidden]))) {
        display: none;
    }
    .sp-search-toolbar-side {
        display: contents;
    }
    .sp-search-toolbar .sp-search-toolbar-filter,
    .sp-search-toolbar-main > .sp-search-toolbar-filter {
        display: none !important;
    }
    #btnFilterAtt {
        display: none !important;
    }
    .sp-search-toolbar-main > .emp-toolbar-icon-btn,
    .sp-search-toolbar-side > .emp-toolbar-icon-btn {
        order: 3;
        flex: 0 0 auto;
        align-self: center;
    }
    .emp-page-head {
        gap: 0.5rem !important;
    }
    .emp-page-head .btn {
        font-size: 0.875rem;
    }
}
@media (min-width: 768px) {
    .sp-toolbar-mobile-icons,
    .sp-toolbar-filter-toggle {
        display: none !important;
    }
}
@media (max-width: 575.98px) {
    .emp-toolbar-filters {
        grid-template-columns: 1fr;
    }
    .emp-toolbar-foot {
        align-items: stretch;
    }
    .emp-toolbar-actions .btn-group,
    .emp-toolbar-actions .btn {
        width: 100%;
    }
}

/* Employees: keep columns within page; actions pinned narrow */
#employeesTable.sp-table-fit col.emp-col-name,
#employeesTable col.emp-col-name {
    width: 11%;
    min-width: 160px;
}
#employeesTable th[data-col-key="full_name"],
#employeesTable td.emp-cell-name {
    min-width: 160px;
}
#employeesTable.sp-table-fit col.emp-col-type { width: 6%; }
#employeesTable.sp-table-fit col.emp-col-job { width: 8%; }
#employeesTable.sp-table-fit col.emp-col-phone { width: 8%; }
#employeesTable.sp-table-fit col.emp-col-pin { width: 5%; }
#employeesTable.sp-table-fit col.emp-col-export { width: 6%; }
#employeesTable.sp-table-fit col.emp-col-id { width: 9%; }
#employeesTable.sp-table-fit col.emp-col-company { width: 8%; }
#employeesTable.sp-table-fit col.emp-col-project { width: 10%; }
#employeesTable.sp-table-fit col.emp-col-emergency { width: 9%; }
#employeesTable.sp-table-fit col.emp-col-screening { width: 7%; }
#employeesTable.sp-table-fit col.emp-col-status { width: 6%; }
#employeesTable.sp-table-fit col.emp-col-modified { width: 8%; }
#employeesTable.sp-table-fit col.emp-col-actions { width: 3.25rem; }
#employeesTable.sp-table-fit col.emp-col-check { width: 2.5rem; }
#employeesTable.sp-table-fit th.emp-col-actions,
#employeesTable.sp-table-fit td.emp-col-actions,
#employeesTable.sp-table-fit th.table-row-actions,
#employeesTable.sp-table-fit td.table-row-actions {
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
}

#employeesTable col.emp-col-name { width: 11%; min-width: 160px; }
#employeesTable col.emp-col-type { width: 6%; }
#employeesTable col.emp-col-job { width: 8%; }
#employeesTable col.emp-col-phone { width: 8%; }
#employeesTable col.emp-col-pin { width: 5%; }
#employeesTable col.emp-col-export { width: 7%; }
#employeesTable col.emp-col-id { width: 9%; }
#employeesTable col.emp-col-company { width: 8%; }
#employeesTable col.emp-col-project { width: 10%; }
#employeesTable col.emp-col-emergency { width: 9%; }
#employeesTable col.emp-col-screening { width: 8%; }
#employeesTable col.emp-col-status { width: 7%; }
#employeesTable col.emp-col-modified { width: 9%; }
#employeesTable col.emp-col-actions { width: 3.5rem; min-width: 3.5rem; max-width: 3.5rem; }
#employeesTable .emp-cell-modified {
    color: var(--bs-secondary-color, #6c757d);
    font-size: 0.875rem;
}

/* Visitors table column widths */
#visitorsTable col.vis-col-name { width: 12%; }
#visitorsTable col.vis-col-company { width: 10%; }
#visitorsTable col.vis-col-id { width: 9%; }
#visitorsTable col.vis-col-phone { width: 8%; }
#visitorsTable col.vis-col-host { width: 10%; }
#visitorsTable col.vis-col-purpose { width: 12%; }
#visitorsTable col.vis-col-project { width: 10%; }
#visitorsTable col.vis-col-checked { width: 10%; }
#visitorsTable col.vis-col-checked-out { width: 10%; }
#visitorsTable col.vis-col-created { width: 9%; }
#visitorsTable col.vis-col-status { width: 7%; }
#visitorsTable col.vis-col-actions { width: 3.5rem; min-width: 3.5rem; max-width: 3.5rem; }

#inductionsTable col.ind-col-check { width: 2.75rem; }
#inductionsTable col.ind-col-person { width: 16%; }
#inductionsTable col.ind-col-type { width: 12%; }
#inductionsTable col.ind-col-project { width: 22%; }
#inductionsTable col.ind-col-template { width: 18%; }
#inductionsTable col.ind-col-status { width: 12%; }
#inductionsTable col.ind-col-valid { width: 12%; }
#inductionsTable col.ind-col-actions { width: 7.75rem; min-width: 7.75rem; max-width: 7.75rem; }
#inductionsTable th.ind-col-check,
#inductionsTable td.ind-col-check {
    width: 2.75rem;
    min-width: 2.75rem;
    max-width: 2.75rem;
    text-align: center;
    vertical-align: middle;
    overflow: visible !important;
    text-overflow: clip !important;
    padding-left: 0.55rem !important;
    padding-right: 0.55rem !important;
}
#inductionsTable th.ind-col-check .form-check-input,
#inductionsTable td.ind-col-check .form-check-input {
    float: none;
    margin: 0;
}

#printBadgesTable col.pb-col-check { width: 2.75rem; }
#printBadgesTable col.pb-col-person { width: 20%; }
#printBadgesTable col.pb-col-type { width: 12%; }
#printBadgesTable col.pb-col-company { width: 16%; }
#printBadgesTable col.pb-col-project { width: 22%; }
#printBadgesTable col.pb-col-template { width: 18%; }
#printBadgesTable col.pb-col-valid { width: 12%; }
#printBadgesTable th.pb-col-check,
#printBadgesTable td.pb-col-check {
    width: 2.75rem;
    min-width: 2.75rem;
    max-width: 2.75rem;
    text-align: center;
    vertical-align: middle;
    overflow: visible !important;
    text-overflow: clip !important;
    padding-left: 0.55rem !important;
    padding-right: 0.55rem !important;
}
#printBadgesTable th.pb-col-check .form-check-input,
#printBadgesTable td.pb-col-check .form-check-input {
    float: none;
    margin: 0;
}

#tplTable col.tpl-col-name { width: 40%; }
#tplTable col.tpl-col-pass { width: 16%; }
#tplTable col.tpl-col-valid { width: 22%; }
#tplTable col.tpl-col-active { width: 12%; }
#tplTable col.tpl-col-actions { width: 5.75rem; min-width: 5.75rem; max-width: 5.75rem; }
#tplTable th.table-row-actions,
#tplTable td.table-row-actions {
    width: 5.75rem;
    min-width: 5.75rem;
    max-width: 5.75rem;
}

#projectsTable col.proj-col-check { width: 2.75rem; }
#projectsTable col.proj-col-name { width: 34%; }
#projectsTable col.proj-col-org { width: 22%; }
#projectsTable col.proj-col-status { width: 12%; }
#projectsTable col.proj-col-synced { width: 21%; }
#projectsTable col.proj-col-actions { width: 4%; }
#projectsTable th.proj-col-check,
#projectsTable td.proj-col-check {
    width: 2.75rem;
    min-width: 2.75rem;
    max-width: 2.75rem;
    text-align: center;
    vertical-align: middle;
    overflow: visible !important;
    text-overflow: clip !important;
}
#projectsTable th.proj-col-check .form-check-input,
#projectsTable td.proj-col-check .form-check-input {
    float: none;
    margin: 0;
}

#employeesTable col.emp-col-check { width: 2.75rem; }
#employeesTable th.emp-col-check,
#employeesTable td.emp-col-check {
    width: 2.75rem;
    min-width: 2.75rem;
    max-width: 2.75rem;
    text-align: center;
    vertical-align: middle;
    overflow: visible !important;
    text-overflow: clip !important;
}
#employeesTable th.emp-col-check .form-check-input,
#employeesTable td.emp-col-check .form-check-input {
    float: none;
    margin: 0;
}

#contractorsTable col.ctr-col-check { width: 2.75rem; }
#contractorsTable th.ctr-col-check,
#contractorsTable td.ctr-col-check {
    width: 2.75rem;
    min-width: 2.75rem;
    max-width: 2.75rem;
    text-align: center;
    vertical-align: middle;
    overflow: visible !important;
    text-overflow: clip !important;
}
#contractorsTable th.ctr-col-check .form-check-input,
#contractorsTable td.ctr-col-check .form-check-input {
    float: none;
    margin: 0;
}

#visitorCardsTable col.vc-col-check { width: 2.75rem; }
#visitorCardsTable th.vc-col-check,
#visitorCardsTable td.vc-col-check {
    width: 2.75rem;
    text-align: center;
    vertical-align: middle;
    padding-left: 0.65rem;
    padding-right: 0.35rem;
}
#visitorCardsTable th.vc-col-check .form-check-input,
#visitorCardsTable td.vc-col-check .form-check-input {
    float: none;
    margin: 0;
}

#spRowActionsModalBody,
.emp-bulk-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}
.emp-bulk-actions-search .emp-search-wrap {
    max-width: 100%;
}
.sp-row-actions-modal {
    background: linear-gradient(165deg, #f8fafc 0%, #fff 38%, #fff 100%);
}
.sp-row-action-tile {
    font-weight: 500;
    border-radius: 0.85rem !important;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
    cursor: pointer;
}
.sp-row-action-tile:hover {
    transform: translateY(-1px);
    border-color: rgba(13, 110, 110, 0.35) !important;
    box-shadow: 0 0.4rem 1rem rgba(15, 23, 42, 0.08) !important;
    background-color: #f7fbfb !important;
}
.sp-row-action-tile:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(13, 110, 110, 0.22) !important;
    border-color: rgba(13, 110, 110, 0.45) !important;
}
.sp-row-action-tile-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}
.sp-row-action-tile-label {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.25;
    letter-spacing: -0.01em;
}
.sp-row-action-tile-hint {
    font-size: 0.75rem;
    line-height: 1.35;
    color: var(--bs-secondary-color);
    font-weight: 400;
}
@media (max-width: 575.98px) {
    #spRowActionsModalBody,
    .emp-bulk-actions-grid {
        grid-template-columns: 1fr;
    }
}

/* Professional shared modal treatment */
.sp-modal .modal-content {
    border: 0;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(11, 31, 51, 0.22);
}
.sp-modal-header {
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1.25rem 1.35rem 1rem;
    background: linear-gradient(135deg, #0b1f33 0%, #143552 55%, #0d6e6e 140%);
    color: #f4f8fb;
    border-bottom: 0;
}
.sp-modal-header .btn-close {
    filter: invert(1) grayscale(1);
    opacity: 0.75;
}
.sp-modal-header .btn-close:hover { opacity: 1; }
.modal-footer.sp-modal-footer-has-tour,
.sp-modal-footer.sp-modal-footer-has-tour {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem 0.85rem;
}
.sp-modal-footer-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-left: auto;
}
.sp-modal-tour-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    flex-shrink: 0;
    min-height: 2.25rem;
    padding: 0.4rem 0.9rem;
    margin: 0;
    border: 1px solid #0b1f33;
    background: #0b1f33;
    color: #fff;
    border-radius: 0.45rem;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.01em;
    box-shadow: 0 1px 2px rgba(11, 31, 51, 0.12);
}
.sp-modal-tour-btn:hover,
.sp-modal-tour-btn:focus {
    background: #132a42;
    border-color: #132a42;
    color: #fff;
}
.sp-modal-tour-btn:focus {
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(11, 31, 51, 0.22);
}
.sp-modal-tour-btn:active {
    background: #091828;
    border-color: #091828;
    color: #fff;
}
.sp-modal-tour-btn.is-disabled,
.sp-modal-tour-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}
.sp-modal-tour-btn .bi {
    font-size: 0.95rem;
    line-height: 1;
}
.sp-modal-tour-label {
    display: inline;
}
/* Welcome: keep topbar under backdrop (project selector stays dimmed).
   Only the floated Tour control + tip sit above the dim. */
.topbar-tour-btn.is-welcome-pulse,
.topbar-tour-btn.is-welcome-float {
    box-shadow: 0 0 0 0 rgba(13, 110, 110, 0.55);
    animation: spWelcomeTourPulse 1.15s ease-out infinite;
    pointer-events: none;
}
.topbar-tour-btn.is-welcome-float {
    position: fixed !important;
    margin: 0 !important;
    /* Above Bootstrap backdrop (1050) + modal (1055); below flash toasts. */
    z-index: 1080 !important;
}
.sp-welcome-tour-ph {
    display: inline-block;
    flex-shrink: 0;
    visibility: hidden;
    pointer-events: none;
}
@keyframes spWelcomeTourPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(13, 110, 110, 0.65), 0 0 0 0 rgba(94, 234, 212, 0.35);
        filter: brightness(1);
    }
    45% {
        box-shadow: 0 0 0 10px rgba(13, 110, 110, 0), 0 0 0 18px rgba(94, 234, 212, 0);
        filter: brightness(1.18);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(13, 110, 110, 0), 0 0 0 0 rgba(94, 234, 212, 0);
        filter: brightness(1);
    }
}
.sp-welcome-tour-tip {
    position: fixed;
    z-index: 1081;
    pointer-events: none;
}
.sp-welcome-tour-tip[hidden] {
    display: none !important;
}
.sp-welcome-tour-tip-card {
    position: relative;
    background: #fff;
    color: #132033;
    border-radius: 0.75rem;
    box-shadow: 0 12px 40px rgba(11, 31, 51, 0.22);
    border: 1px solid #e2e8f0;
    padding: 0.75rem 0.9rem 0.85rem;
    max-width: 100%;
}
.sp-welcome-tour-tip-card::before {
    content: "";
    position: absolute;
    top: -6px;
    right: 1.1rem;
    width: 12px;
    height: 12px;
    background: #fff;
    border-left: 1px solid #e2e8f0;
    border-top: 1px solid #e2e8f0;
    transform: rotate(45deg);
}
.sp-welcome-tour-tip-card strong {
    display: block;
    font-size: 0.9375rem;
    font-weight: 650;
    color: #0b1f33;
    margin-bottom: 0.25rem;
}
.sp-welcome-tour-tip-card p {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: #475569;
}
.sp-welcome-tour-callout {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.85rem 0.95rem;
    border-radius: 0.7rem;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
}
.sp-welcome-tour-preview {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem;
    border-radius: 0.45rem;
    background: #0b1f33;
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 650;
    line-height: 1;
    letter-spacing: 0.01em;
    box-shadow: 0 1px 2px rgba(11, 31, 51, 0.18);
}
.sp-welcome-tour-preview .bi {
    color: #5eead4;
    font-size: 0.95rem;
}
.sp-welcome-tour-copy {
    min-width: 0;
}
.sp-welcome-tour-copy strong {
    display: block;
    color: #0b1f33;
    font-size: 0.8125rem;
    font-weight: 650;
    letter-spacing: 0.01em;
    margin-bottom: 0.2rem;
}
.sp-welcome-tour-copy p {
    margin: 0;
    font-size: 0.8125rem;
    color: #475569;
    line-height: 1.35;
}
.sp-welcome-optout {
    margin-top: 0.9rem;
}
.sp-welcome-optout .form-check-label {
    font-size: 0.8125rem;
    color: #64748b;
}
.sp-modal-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
    font-size: 1.2rem;
    flex-shrink: 0;
}
.sp-modal-subtitle {
    margin-top: 0.2rem;
    font-size: 0.8125rem;
    color: rgba(244, 248, 251, 0.78);
}
.sp-modal-body {
    padding: 1.25rem 1.35rem 0.5rem;
    background: #f8fafc;
}
.sp-modal-section {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0.85rem;
    padding: 1rem 1.1rem 1.15rem;
    margin-bottom: 0.9rem;
}
.sp-modal-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 0.85rem;
}
.sp-modal-body .form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.3rem;
}
.sp-modal-body .form-control,
.sp-modal-body .form-select {
    border-color: #cfd9e3;
    border-radius: 0.55rem;
}
.sp-modal-body .form-control:focus,
.sp-modal-body .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 110, 0.15);
}
.sp-modal-footer {
    padding: 0.9rem 1.35rem 1.15rem;
    background: #fff;
    border-top: 1px solid var(--border-color);
}

@media (min-width: 992px) {
    .sp-modal-3col.modal-dialog {
        max-width: min(960px, calc(100vw - 2rem));
    }

    /* Check-in visitor: fit step-1 fields without body scroll on desktop */
    #visitorModal .modal-dialog {
        max-width: min(920px, calc(100vw - 2rem));
        margin: 0.75rem auto;
        height: auto;
        max-height: none;
    }
    #visitorModal .modal-dialog.modal-dialog-scrollable .modal-content {
        max-height: none;
        overflow: visible;
    }
    #visitorModal .modal-dialog.modal-dialog-scrollable .modal-body {
        overflow: visible;
    }
    #visitorModal .sp-modal-header {
        padding: 0.85rem 1.15rem 0.7rem;
    }
    #visitorModal .sp-modal-body {
        padding: 0.85rem 1.15rem 0.35rem;
    }
    #visitorModal .sp-modal-footer {
        padding: 0.7rem 1.15rem 0.85rem;
    }
    #visitorModal .sp-modal-section {
        padding: 0.7rem 0.85rem 0.75rem;
        margin-bottom: 0.65rem;
        border-radius: 0.7rem;
    }
    #visitorModal .sp-modal-section-title {
        margin-bottom: 0.45rem;
    }
    #visitorModal .sp-modal-body .form-label {
        margin-bottom: 0.2rem;
    }
    #visitorModal .sp-modal-body .form-control,
    #visitorModal .sp-modal-body .form-select {
        min-height: calc(1.5em + 0.65rem + 2px);
        padding-top: 0.35rem;
        padding-bottom: 0.35rem;
    }
    #visitorModal .sp-modal-body .form-text {
        margin-top: 0.2rem;
        font-size: 0.75rem;
    }
    #visitorModal .vis-checkin-profile {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        gap: 0.85rem 1.1rem;
        align-items: start;
    }
    #visitorModal .vis-checkin-photo .vis-photo-picker {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: flex-start;
        gap: 0.5rem;
    }
    #visitorModal .vis-checkin-photo .sp-photo-preview {
        width: 6.5rem;
        height: 7.85rem;
        max-width: none;
        margin-inline: 0;
    }
    #visitorModal #visitorIdSection .form-text:empty {
        display: none;
    }
}

.vis-checkin-profile {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.visitor-detail-photo {
    width: 7.5rem;
    height: 9rem;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color, #e2e8f0);
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}
.visitor-detail-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.visitor-detail-photo--empty {
    color: #94a3b8;
    font-size: 2.25rem;
}
.vis-checkin-photo .sp-photo-picker,
.vis-photo-picker {
    margin-bottom: 0;
}
.vis-photo-picker {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 0.5rem;
    position: relative;
}
.vis-photo-capture-btn {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    padding: 0;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.vis-photo-capture-btn:hover,
.vis-photo-capture-btn:focus-visible {
    border-color: rgba(13, 110, 110, 0.55);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 110, 0.15);
    outline: 0;
}
.vis-photo-capture-btn:active {
    transform: scale(0.99);
}
.vis-photo-capture-btn .sp-photo-placeholder {
    pointer-events: none;
}
.vis-photo-clear {
    flex: 0 0 auto;
    align-self: flex-start;
}
.vis-checkin-photo .sp-photo-preview,
#employeeModal .emp-photo-picker .sp-photo-preview {
    width: 5.75rem;
    height: 6.85rem;
}

.emp-photo-upload,
.emp-photo-clear {
    flex: 0 0 auto;
    align-self: flex-start;
}

#employeeModal .emp-photo-picker .vis-photo-capture-btn:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

@media (min-width: 576px) {
    .vis-checkin-photo .sp-photo-preview,
    #employeeModal .emp-photo-picker .sp-photo-preview {
        width: 6.5rem;
        height: 7.85rem;
    }
}

@media (max-width: 575.98px) {
    #visitorModal .vis-checkin-photo {
        padding-bottom: 0.15rem;
    }
    #visitorModal .vis-checkin-fields {
        padding-top: 0.15rem;
        border-top: 1px solid #e8eef4;
    }
    #visitorModal .vis-checkin-fields .sp-modal-section-title {
        margin-top: 0.65rem;
    }
    .vis-checkin-photo .sp-photo-preview,
    #employeeModal .emp-photo-picker .sp-photo-preview {
        width: 6.25rem;
        height: 7.5rem;
    }
    .vis-photo-clear,
    .emp-photo-clear,
    .emp-photo-upload {
        width: 2.6rem;
        height: 2.6rem;
        font-size: 1.05rem;
    }
}

.sp-photo-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 1.15rem;
    align-items: center;
}
.sp-photo-preview {
    width: 112px;
    height: 136px;
    border-radius: 0.75rem;
    border: 1.5px dashed #cbd5e1;
    background:
        linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    box-shadow: inset 0 1px 2px rgba(15, 30, 50, 0.04);
}
.sp-photo-preview.has-photo {
    border-style: solid;
    border-color: var(--border-color);
    background: #0f172a;
    box-shadow: 0 1px 3px rgba(15, 30, 50, 0.12);
}
.sp-photo-preview img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
    z-index: 1;
}
.sp-photo-preview.has-photo img {
    display: block;
}
.sp-photo-placeholder {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem;
    text-align: center;
    pointer-events: none;
}
.sp-photo-preview.has-photo .sp-photo-placeholder {
    display: none;
}
.sp-photo-placeholder-icon {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 0.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 1.15rem;
    box-shadow: 0 1px 2px rgba(15, 30, 50, 0.05);
}
.sp-photo-placeholder-label {
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.02em;
    color: #64748b;
}
.sp-photo-actions {
    flex: 1 1 200px;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    min-width: 0;
}
.sp-photo-btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}
.sp-photo-btn-row .btn {
    border-radius: 0.5rem;
    font-weight: 600;
    padding: 0.35rem 0.7rem;
}
.emp-docs-section-head {
    margin-bottom: 0.85rem;
}
.emp-docs-section #empDocumentsHint {
    max-width: none;
}
.emp-docs-residency-prompt {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border: 1px dashed #c5d0dc;
    border-radius: 0.85rem;
    padding: 1rem 1.05rem;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.emp-docs-residency-prompt-title {
    font-weight: 650;
    font-size: 0.95rem;
    color: #0b1f33;
}
.emp-docs-residency-prompt-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.emp-docs-residency-prompt-actions .btn {
    font-weight: 600;
}
.emp-docs-list {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}
.emp-doc-slot {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    padding: 0.95rem 1rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.emp-doc-slot.is-required.is-empty,
.emp-doc-slot.is-expired {
    background: #fef2f2;
    border-color: #fecaca;
}
.emp-doc-slot.is-complete {
    background: #ecfdf3;
    border-color: #bbf7d0;
}
.emp-doc-slot:not(.d-none):hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}
.emp-doc-slot.is-busy {
    opacity: 0.65;
    pointer-events: none;
}
.emp-doc-slot-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.7rem;
}
.emp-doc-slot-title-wrap {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    min-width: 0;
}
.emp-doc-slot-icon {
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 0.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(13, 110, 110, 0.1);
    color: #0d6e6e;
    font-size: 1.05rem;
}
.emp-doc-thumb {
    position: relative;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.5rem;
    overflow: hidden;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef2f6;
    border: 1px solid #e2e8f0;
    color: #0d6e6e;
    text-decoration: none;
}
.emp-doc-thumb-img,
.emp-doc-thumb-frame {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 0;
    pointer-events: none;
}
.emp-doc-thumb-frame {
    transform: scale(0.35);
    transform-origin: top left;
    width: 286%;
    height: 286%;
}
.emp-doc-thumb-badge {
    position: absolute;
    right: 1px;
    bottom: 1px;
    width: 1.05rem;
    height: 1.05rem;
    border-radius: 0.25rem;
    background: rgba(185, 28, 28, 0.92);
    color: #fff;
    font-size: 0.62rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.emp-doc-thumb-file {
    font-size: 1.15rem;
}
.emp-doc-slot-title {
    font-weight: 650;
    font-size: 0.92rem;
    color: #0b1f33;
    line-height: 1.3;
    padding-top: 0.25rem;
}
.emp-doc-req {
    font-weight: 700;
}
.emp-doc-slot-body {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.emp-doc-file-row,
.emp-doc-expiry-row,
.emp-doc-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}
.emp-doc-file-name {
    flex: 1 1 8rem;
    min-width: 0;
    font-size: 0.8125rem;
    color: #475569;
}
.emp-doc-expiry-row .form-label {
    flex: 0 0 auto;
    font-size: 0.75rem;
    color: #64748b;
    margin: 0;
}
.emp-doc-expiry-row .emp-doc-expiry {
    flex: 1 1 10rem;
    max-width: none;
    width: 100%;
}
.emp-doc-actions .emp-doc-upload {
    font-weight: 600;
}
#empDocumentsSection.emp-docs-readonly .emp-doc-ctrl {
    display: none !important;
}
#empErsPendingModal .sp-table-fit-wrap,
#empErsPendingModal .table-responsive {
    width: 100%;
    max-width: 100%;
}
#empErsPendingTable {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
}
#empErsPendingTable th,
#empErsPendingTable td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#empErsPendingTable th:nth-child(1),
#empErsPendingTable td:nth-child(1) { width: 28%; }
#empErsPendingTable th:nth-child(2),
#empErsPendingTable td:nth-child(2) { width: 12%; }
#empErsPendingTable th:nth-child(3),
#empErsPendingTable td:nth-child(3) { width: 18%; }
#empErsPendingTable th:nth-child(4),
#empErsPendingTable td:nth-child(4) { width: auto; }
#empErsPendingTable th:nth-child(5),
#empErsPendingTable td:nth-child(5) {
    width: 3.5rem;
    overflow: visible;
    text-overflow: clip;
}
#employeeModal .emp-photo-section .emp-photo-picker {
    padding: 0.9rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.9rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    gap: 0.85rem;
    align-items: stretch;
    transition: border-color 0.15s ease, background 0.15s ease;
}
#employeeModal .emp-photo-section .emp-photo-picker.is-empty {
    background: #fef2f2;
    border-color: #fecaca;
}
#employeeModal .emp-photo-section .emp-photo-picker.is-complete {
    background: #ecfdf3;
    border-color: #bbf7d0;
}
#employeeModal .emp-photo-section .emp-photo-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.55rem;
    min-width: 0;
}
#employeeModal .emp-photo-section .emp-photo-btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}
#employeeModal .emp-photo-section .emp-photo-hint {
    margin: 0;
    font-size: 0.78rem;
    color: #64748b;
}
.sp-field-feedback {
    min-height: 1.1em;
    margin-top: 0.25rem;
}
.emp-camera-dialog {
    max-width: min(360px, calc(100vw - 1.5rem));
    margin: 0.5rem auto;
}
.emp-camera-dialog .modal-content {
    max-height: calc(100vh - 1rem);
    max-height: calc(100dvh - 1rem);
    display: flex;
    flex-direction: column;
}
.emp-camera-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
}
.sp-camera-stage {
    position: relative;
    background: #0f172a;
    border-radius: 0.65rem;
    overflow: hidden;
    height: min(52vh, 340px);
    height: min(52dvh, 340px);
    width: auto;
    aspect-ratio: 3 / 4;
    max-width: 100%;
    margin: 0 auto;
}
.sp-camera-stage video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.sp-camera-stage video.sp-camera-mirror {
    transform: scaleX(-1);
}
.sp-camera-flip {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
.sp-camera-flip-label {
    font-size: 0.75rem;
    font-weight: 600;
}
.emp-camera-device-wrap {
    margin-top: 0.65rem;
}
.emp-camera-device-wrap .form-label {
    margin-bottom: 0.25rem;
}
.sp-camera-msg {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(transparent, rgba(15, 23, 42, 0.85));
    color: #e2e8f0 !important;
    font-size: 0.8rem;
}
.sp-id-scan-dialog {
    max-width: min(420px, calc(100vw - 1.5rem));
}
.sp-id-scan-stage {
    aspect-ratio: 4 / 3;
    height: min(48vh, 320px);
    height: min(48dvh, 320px);
}
.sp-id-scan-stage video {
    transform: none;
    object-fit: cover;
}
.sp-id-scan-frame {
    pointer-events: none;
    position: absolute;
    inset: 18% 10%;
    border: 2px solid rgba(255, 255, 255, 0.85);
    border-radius: 0.55rem;
    box-shadow: 0 0 0 999px rgba(15, 23, 42, 0.28);
}
.sp-id-scan-btn {
    min-width: 2.65rem;
}
.sp-id-scan-btn .bi {
    font-size: 1.05rem;
}

/* Dual-list project picker */
.sp-project-picker-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: space-between;
}
.sp-project-picker-toolbar .input-group {
    flex: 1 1 220px;
    max-width: 100%;
}
.sp-project-pane {
    border: 1px solid var(--border-color);
    border-radius: 0.65rem;
    background: #f8fafc;
    overflow: hidden;
    min-height: 220px;
    display: flex;
    flex-direction: column;
}
.sp-project-pane-head {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #64748b;
    padding: 0.45rem 0.7rem;
    background: #eef3f7;
    border-bottom: 1px solid var(--border-color);
}
.sp-project-list {
    flex: 1 1 auto;
    height: 240px;
    min-height: 240px;
    max-height: 240px;
    overflow: auto;
    padding: 0.35rem;
}
.sp-project-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    border: 0;
    background: #fff;
    border-radius: 0.45rem;
    padding: 0.45rem 0.55rem;
    margin-bottom: 0.25rem;
    text-align: left;
    font-size: 0.84rem;
    color: #132033;
    border: 1px solid transparent;
    cursor: pointer;
}
.sp-project-item:hover {
    border-color: rgba(13, 110, 110, 0.35);
    background: rgba(13, 110, 110, 0.06);
}
.sp-project-item.is-linked {
    background: rgba(13, 110, 110, 0.08);
}
.sp-project-item.is-selected {
    border-color: rgba(13, 110, 110, 0.45);
    background: rgba(13, 110, 110, 0.1);
}
.emp-import-people-list {
    height: min(50vh, 360px);
    min-height: 240px;
    max-height: min(50vh, 360px);
}
.emp-import-person-item {
    align-items: flex-start;
}
.emp-import-person-item .emp-import-person-check {
    margin-top: 0.2rem;
    pointer-events: none;
}
.sp-project-item-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* Children must not sit above the row button as separate hit targets */
.sp-project-item > * {
    pointer-events: none;
}
.sp-dept-picker-list {
    max-height: 360px;
}
.sp-dept-picker-list .sp-project-item-label {
    white-space: normal;
}
.sp-project-item-action {
    color: var(--primary);
    flex-shrink: 0;
}
.sp-project-item.is-linked .sp-project-item-action {
    color: #b45309;
}
.sp-project-empty {
    padding: 1.25rem 0.75rem;
    text-align: center;
}
.sp-azure-picker-results {
    max-height: min(52vh, 420px);
    overflow-y: auto;
    border: 1px solid rgba(19, 32, 51, 0.08);
    border-radius: 0.5rem;
}
.sp-azure-picker-results .list-group-item {
    border-left: 0;
    border-right: 0;
}
.sp-azure-picker-results .list-group-item:first-child {
    border-top: 0;
}
.sp-azure-picker-results .list-group-item:last-child {
    border-bottom: 0;
}
#userModal #userFirst[readonly],
#userModal #userLast[readonly],
#userModal #userEmail[readonly],
#contractorModal #cName[readonly],
#contractorModal #cReg[readonly],
#contractorModal #cVat[readonly],
#contractorModal #cContact[readonly],
#contractorModal #cEmail[readonly],
#contractorModal #cPhone[readonly] {
    background-color: #f4f6f8;
    cursor: default;
}

/* Login modal: allowed projects preview table */
.sp-allowed-projects {
    border-radius: 0.65rem;
    overflow: hidden;
    background: #fff;
}
.sp-allowed-projects .card-header {
    border-bottom: 1px solid rgba(19, 32, 51, 0.08);
}
.sp-allowed-projects-table-wrap {
    max-height: 11.5rem;
    overflow: auto;
    width: 100%;
}
.sp-allowed-projects-table {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
    font-size: 0.8125rem;
}
.sp-allowed-projects-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f4f7fa;
    color: #526579;
    font-size: 0.68rem;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid #cfd8e3 !important;
    white-space: nowrap;
}
.sp-allowed-projects-table col.sp-allowed-projects-col-code,
.sp-allowed-projects-table .sp-allowed-projects-col-code,
.sp-allowed-projects-table .sp-allowed-projects-code {
    width: 7rem;
    max-width: 7rem;
}
.sp-allowed-projects-table col.sp-allowed-projects-col-name,
.sp-allowed-projects-table .sp-allowed-projects-col-name {
    width: auto;
}
.sp-allowed-projects-table tbody td {
    border-bottom-color: #e8eef4;
    color: #1f2d3d;
    vertical-align: middle;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: break-word;
}
.sp-allowed-projects-table tbody tr:last-child td {
    border-bottom: 0;
}
.sp-allowed-projects-code {
    font-variant-numeric: tabular-nums;
    font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
}
.sp-allowed-projects-empty td {
    padding: 0.85rem 0.75rem;
}

/* Induction quiz builder */
.sp-quiz-page { max-width: 920px; }
.sp-quiz-toolbar .form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.3rem;
}
.sp-quiz-editor {
    padding: 0;
    overflow: hidden;
    background: #f8fafc;
}
.sp-quiz-editor-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    padding: 1rem 1.25rem;
    background: #fff;
    border-bottom: 1px solid var(--border-color);
}
.sp-quiz-editor-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1.25rem 1.1rem;
    background: #fff;
    border-top: 1px solid var(--border-color);
}
.sp-quiz-q-list {
    padding: 1rem 1.15rem 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.sp-quiz-q {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0.85rem;
    padding: 0;
    box-shadow: 0 1px 2px rgba(15, 30, 50, 0.03);
    overflow: hidden;
}
.sp-quiz-q-head {
    display: flex;
    align-items: stretch;
    gap: 0.15rem;
    padding: 0.45rem 0.45rem 0.45rem 0.35rem;
    background: #fff;
}
.sp-quiz-q.is-open .sp-quiz-q-head {
    border-bottom: 1px solid #e8eef4;
    background: #fbfcfd;
}
.sp-quiz-q-toggle {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 0.35rem 0.4rem;
    border-radius: 0.55rem;
    cursor: pointer;
    color: inherit;
}
.sp-quiz-q-toggle:hover,
.sp-quiz-q-toggle:focus-visible {
    background: #f1f5f9;
    outline: none;
}
.sp-quiz-q-summary {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.sp-quiz-q-preview {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1f2d3d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sp-quiz-q-meta {
    font-size: 0.75rem;
    color: #64748b;
}
.sp-quiz-q-chevron {
    flex-shrink: 0;
    color: #94a3b8;
    transition: transform 0.18s ease;
}
.sp-quiz-q.is-open .sp-quiz-q-chevron {
    transform: rotate(180deg);
    color: #64748b;
}
.sp-quiz-q-body {
    padding: 1rem 1.1rem 1.05rem;
}
.sp-quiz-q-num {
    width: 2rem;
    height: 2rem;
    border-radius: 0.55rem;
    background: #e8f2f2;
    color: var(--primary, #0d6e6e);
    font-weight: 700;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sp-quiz-q-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
}
.sp-quiz-q .form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.3rem;
}
.sp-quiz-options-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.45rem;
}
.sp-quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.sp-quiz-opt {
    display: grid;
    grid-template-columns: 1.5rem 2rem minmax(0, 1fr) 2rem;
    gap: 0.35rem;
    align-items: center;
    padding: 0.35rem 0.4rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.6rem;
    background: #fbfcfd;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.sp-quiz-opt.is-correct {
    border-color: #9dccc8;
    background: #f0faf8;
}
.sp-quiz-opt-correct {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    cursor: pointer;
}
.sp-quiz-opt .o-text {
    border-color: #d5dee8;
}
.sp-quiz-opt .btn-del-opt {
    opacity: 0.55;
}
.sp-quiz-opt .btn-del-opt:hover:not(:disabled) {
    opacity: 1;
    color: #b42318 !important;
}
.sp-quiz-empty-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 0.85rem;
    border-radius: 0.85rem;
    background: #e8f2f2;
    color: var(--primary, #0d6e6e);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}
.sp-quiz-empty-inline {
    padding: 1.5rem 0.5rem 1.75rem;
    text-align: center;
    font-size: 0.9rem;
}
@media (max-width: 575.98px) {
    .sp-quiz-editor-head,
    .sp-quiz-editor-foot {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .sp-quiz-q-list { padding-left: 0.85rem; padding-right: 0.85rem; }
}

.sp-quiz-q-handle,
.sp-quiz-opt-handle {
    width: 1.5rem;
    height: 1.75rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    flex-shrink: 0;
    border-radius: 0.35rem;
}
.sp-quiz-q-handle:hover,
.sp-quiz-opt-handle:hover,
.sp-quiz-q-handle:focus-visible,
.sp-quiz-opt-handle:focus-visible {
    color: #475569;
    background: #eef2f7;
    outline: none;
}
.sp-quiz-q-handle:active,
.sp-quiz-opt-handle:active {
    cursor: grabbing;
}
.sp-quiz-ghost {
    opacity: 0.45;
}
.sp-quiz-chosen {
    box-shadow: 0 6px 18px rgba(15, 30, 50, 0.12);
}
.sp-quiz-drag {
    opacity: 1;
}

/* ── Excel import modal ───────────────────────────────────────── */
.sp-import-modal {
  overflow: hidden !important;
}
.sp-import-modal .sp-import-dialog {
  max-width: min(1120px, calc(100vw - 1.5rem));
  width: calc(100% - 1.5rem);
  height: calc(100dvh - 2rem);
  max-height: calc(100dvh - 2rem);
  margin: 1rem auto;
  display: flex;
  align-items: stretch;
}
.sp-import-content {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}
.sp-import-header {
  flex-shrink: 0;
  border-bottom: 1px solid #e8eef5;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}
.sp-import-body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden !important;
}
.sp-import-footer {
  flex-shrink: 0;
  border-top: 1px solid #e8eef5;
  background: #f8fafc;
}
.sp-import-steps {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
  padding: 0.15rem 0.15rem 0.75rem;
  border-bottom: 1px solid #eef2f7;
}
.sp-import-step {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border: 0;
  background: transparent;
  padding: 0.2rem 0.15rem;
  color: #94a3b8;
  font-size: 0.84rem;
  font-weight: 600;
}
.sp-import-step:disabled { opacity: 0.55; }
.sp-import-step-num {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
}
.sp-import-step.is-active { color: #0f172a; }
.sp-import-step.is-active .sp-import-step-num,
.sp-import-step.is-done .sp-import-step-num {
  background: #0e7490;
  color: #fff;
}
.sp-import-step.is-done { color: #0e7490; }
.sp-import-step-rule {
  flex: 1 1 auto;
  height: 1px;
  background: #e2e8f0;
  max-width: 4rem;
}
.sp-import-modal [data-sp-import-pane="1"] {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
.sp-import-modal [data-sp-import-pane="2"] {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.sp-import-upload {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(12rem, 15rem);
  gap: 1rem;
  align-items: stretch;
}
.sp-import-upload-copy {
  border: 1px dashed #cbd5e1;
  border-radius: 0.9rem;
  background: linear-gradient(160deg, #f8fafc 0%, #ffffff 55%, #f0f9fb 100%);
  padding: 1.35rem 1.25rem 1.2rem;
  text-align: center;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.sp-import-upload-copy.has-file {
  background: #ecfdf5;
  border-color: #86efac;
  border-style: solid;
}
.sp-import-upload-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 0.85rem;
  border-radius: 0.85rem;
  display: grid;
  place-items: center;
  background: #ecfeff;
  color: #0e7490;
  font-size: 1.35rem;
  border: 1px solid #cffafe;
}
.sp-import-upload-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}
.sp-import-upload-lead {
  margin: 0 auto 1rem;
  max-width: 28rem;
  color: #64748b;
  font-size: 0.88rem;
  line-height: 1.45;
}
.sp-import-upload-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.sp-import-file-name { font-size: 0.82rem; }
.sp-import-file-name.has-file {
  color: #047857;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.35;
  word-break: break-word;
}
.sp-import-required-card {
  border: 1px solid #e2e8f0;
  border-radius: 0.9rem;
  background: #fff;
  padding: 0.95rem 1rem;
}
.sp-import-required-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.55rem;
}
.sp-import-required-list {
  margin: 0;
  padding-left: 1.1rem;
  color: #334155;
  font-size: 0.86rem;
  line-height: 1.55;
}
.sp-import-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  flex-shrink: 0;
  padding: 0.7rem 0.85rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #f8fafc;
}
.sp-import-toolbar-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.sp-import-sheet-label {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: #475569;
}
.sp-import-sheet-select {
  min-width: 11rem;
  background: #fff;
}
.sp-import-toolbar-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: #64748b;
}
.sp-import-toolbar-sep { color: #cbd5e1; }
.sp-import-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  flex-shrink: 0;
  max-height: 4.5rem;
  overflow: auto;
}
.sp-import-legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 600;
}
.sp-import-legend-chip.is-required {
  border-color: #fecaca;
  color: #b91c1c;
  background: #fff7f7;
}
.sp-import-legend-chip.is-mapped {
  border-color: #a5f3fc;
  color: #0e7490;
  background: #ecfeff;
}
.sp-import-req { color: #dc2626; }
.sp-import-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  overflow: auto;
  background: #fff;
}
.sp-import-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.82rem;
}
.sp-import-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f1f5f9;
  border-bottom: 1px solid #dbe3ee;
  border-right: 1px solid #e8eef5;
  padding: 0.55rem 0.55rem 0.65rem;
  min-width: 9.5rem;
  max-width: 14rem;
  vertical-align: top;
}
.sp-import-table thead th.sp-import-rownum-head {
  position: sticky;
  left: 0;
  top: 0;
  z-index: 4;
  min-width: 2.75rem;
  max-width: 3.25rem;
  width: 2.75rem;
  text-align: center;
  padding: 0.55rem 0.35rem;
  background: #e2e8f0;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
}
.sp-import-table thead th.is-mapped {
  background: #ecfeff;
  box-shadow: inset 0 -2px 0 #06b6d4;
}
.sp-import-rownum {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 2.75rem;
  max-width: 3.25rem;
  width: 2.75rem;
  padding: 0.45rem 0.35rem !important;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.75rem;
  color: #64748b;
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #f1f5f9;
}
.sp-import-data-row.is-header-row td,
.sp-import-data-row.is-header-row .sp-import-rownum {
  background: #ecfeff !important;
  color: #0f172a;
  font-weight: 650;
  box-shadow: inset 3px 0 0 #0e7490;
}
.sp-import-data-row.is-above-header td {
  color: #94a3b8;
  background: #fcfcfd;
}
.sp-import-data-row.is-above-header .sp-import-rownum {
  color: #94a3b8;
  background: #f1f5f9;
}
.sp-import-header-select {
  min-width: 6.5rem;
  background: #fff;
}
.sp-import-col-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sp-import-col-select {
  font-size: 0.78rem;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  background: #fff;
}
.sp-import-unique-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0.4rem 0 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
  user-select: none;
}
.sp-import-unique-wrap .form-check-input {
  margin: 0;
  cursor: pointer;
}
.sp-import-unique-wrap .form-check-label {
  cursor: pointer;
}
.sp-import-legend-chip.is-unique {
  border-color: #fdba74;
  color: #c2410c;
  background: #fff7ed;
}
.sp-import-unique-tag {
  font-weight: 800;
  color: #ea580c;
}
.sp-import-table tbody td.is-duplicate {
  background: #fef2f2 !important;
  color: #b91c1c;
  font-weight: 650;
  box-shadow: inset 0 0 0 1px #fecaca;
}
.sp-import-data-row.is-duplicate-row .sp-import-rownum {
  background: #fee2e2;
  color: #b91c1c;
}
.sp-import-dup-hint {
  flex-shrink: 0;
}
.sp-import-table tbody td {
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid #f1f5f9;
  border-right: 1px solid #f8fafc;
  color: #334155;
  white-space: nowrap;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sp-import-table tbody tr:nth-child(even) td { background: #fbfdff; }
.sp-import-table tbody td.is-mapped {
  background: #f0fdfa;
  color: #0f172a;
  font-weight: 550;
}
.sp-import-empty {
  text-align: center;
  color: #94a3b8;
  padding: 1.5rem !important;
}
.sp-import-modal [data-sp-import-error] { flex-shrink: 0; }
@media (max-width: 768px) {
  .sp-import-modal .sp-import-dialog {
    height: calc(100dvh - 1rem);
    max-height: calc(100dvh - 1rem);
    margin: 0.5rem auto;
  }
  .sp-import-upload { grid-template-columns: 1fr; }
  .sp-import-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .sp-import-sheet-select {
    min-width: 0;
    width: 100%;
  }
}

/* Badge QR scanner */
.sp-badge-scanner {
    width: 100%;
    max-width: none;
}
.sp-badge-scanner-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: min(70vh, 36rem);
    min-height: 16rem;
    overflow: hidden;
    border-radius: 0.85rem;
    background: #0b1f33;
    border: 1px solid #d5dee8;
}
.sp-badge-scanner-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.sp-badge-scanner-frame {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(72%, 22rem);
    height: min(72%, 22rem);
    transform: translate(-50%, -50%);
    z-index: 2;
    border: 2px solid rgba(255, 255, 255, 0.85);
    border-radius: 0.75rem;
    box-shadow: 0 0 0 999px rgba(11, 31, 51, 0.35);
    pointer-events: none;
}
.sp-badge-scanner-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #cbd5e1;
    background: rgba(11, 31, 51, 0.72);
    font-size: 0.9rem;
}
.sp-badge-scanner-overlay .bi {
    font-size: 2rem;
    opacity: 0.85;
}
@media (max-width: 767.98px) {
    .sp-badge-scanner-stage {
        aspect-ratio: 3 / 4;
        max-height: min(65vh, 32rem);
    }
    .sp-badge-scanner-frame {
        width: min(78%, 18rem);
        height: min(55%, 18rem);
    }
}

.wf-roster {
    padding: 0;
    overflow: hidden;
}
.wf-roster-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    overscroll-behavior-y: contain;
}
.wf-roster > .sp-table-footer {
    flex-shrink: 0;
}
.wf-company-acc {
    --bs-accordion-border-color: var(--border-color);
    --bs-accordion-btn-bg: #fff;
    --bs-accordion-active-bg: #f8fafc;
    --bs-accordion-btn-focus-box-shadow: 0 0 0 0.2rem rgba(13, 110, 110, 0.12);
}
.wf-company-item {
    border-left: 0;
    border-right: 0;
}
.wf-company-item:first-child {
    border-top: 0;
}
.wf-company-acc .accordion-header {
    display: flex;
    align-items: stretch;
}
.wf-company-acc .accordion-button {
    gap: 0.75rem;
    font-weight: 600;
    color: #0b1f33;
    flex: 1 1 auto;
    min-width: 0;
}
.wf-company-del {
    flex-shrink: 0;
    align-self: center;
    margin-right: 0.85rem;
}
.wf-revoke-btn {
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 600;
}
.wf-company-label {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
}
.wf-company-meta {
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748b;
    margin-right: 0.5rem;
    flex-shrink: 0;
}
.wf-company-body {
    padding: 0.75rem 1rem 1rem;
    background: #f8fafc;
}
.wf-project-block {
    background: #fff;
    border: 1px solid #e4ebf2;
    border-radius: 0.75rem;
    overflow: hidden;
    margin-bottom: 0.75rem;
}
.wf-project-block:last-child {
    margin-bottom: 0;
}
.wf-project-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0.65rem 0.9rem;
    font-size: 0.92rem;
    font-weight: 600;
    color: #0b1f33;
    background: #fff;
    border-bottom: 1px solid #eef2f6;
}
.wf-project-count {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
}
.wf-roster-cards {
    padding: 0.65rem;
}
.wf-project-block .table {
    margin: 0;
}

.auth-shell:has(.sub-invite-fill) {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}
.auth-shell:has(.sub-invite-fill) .auth-main {
    min-height: 0;
    height: 100%;
    max-height: 100dvh;
    align-items: stretch;
    justify-content: center;
    padding: 1.25rem;
    overflow: hidden;
}
.auth-shell:has(.sub-invite-fill) .auth-main > .container {
    max-width: 960px;
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding-left: 0;
    padding-right: 0;
}
.sub-invite-card {
    max-width: 720px;
}
.sub-invite-card.sub-invite-fill {
    max-width: none;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    border-top: 3px solid #0d6e6e;
}
.sub-invite-brand {
    flex: 0 0 auto;
    margin-bottom: 0.85rem;
}
.sub-invite-card:not(.sub-invite-fill) .sub-invite-brand .sub-invite-logo {
    margin: 0 auto;
}
.sub-invite-fill .sub-invite-brand {
    padding: 1.15rem 1.25rem 0;
}
.sub-invite-logo {
    display: block;
    max-height: 48px;
    max-width: min(100%, 168px);
    width: auto;
    height: auto;
    object-fit: contain;
    flex-shrink: 0;
}
.sub-invite-head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem 1.15rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e4ebf2;
    background:
        linear-gradient(135deg, rgba(13, 110, 110, 0.07) 0%, rgba(11, 31, 51, 0.03) 48%, #fff 78%),
        #fff;
}
.sub-invite-head-body {
    flex: 1 1 auto;
    min-width: 0;
}
.sub-invite-kicker {
    margin: 0 0 0.12rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #0d6e6e;
    line-height: 1.2;
}
.sub-invite-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #0b1f33;
    line-height: 1.25;
    text-align: left;
}
.sub-invite-sub {
    margin: 0.28rem 0 0;
    color: #64748b;
    font-size: 0.8125rem;
    line-height: 1.4;
    text-align: left;
}
.sub-invite-sep {
    margin: 0 0.35rem;
    color: #94a3b8;
}
.sub-invite-expiry {
    white-space: nowrap;
}
.sub-invite-head-actions {
    flex-shrink: 0;
    margin-left: auto;
}
.sub-invite-head-actions .btn {
    white-space: nowrap;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(13, 110, 110, 0.18);
}
.si-people-panel {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0.85rem 1.25rem 0;
}
.si-people-table-wrap {
    border: 1px solid #e4ebf2;
    border-radius: 0.75rem 0.75rem 0 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    background: #fff;
}
.sub-invite-card .mobile-card-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 0 0.5rem;
}
.sub-invite-card .sp-table-footer {
    margin: 0;
    border-radius: 0 0 16px 16px;
}
@media (max-width: 767.98px) {
    .auth-shell:has(.sub-invite-fill) .auth-main {
        padding: 0.75rem;
    }
    .sub-invite-head {
        flex-wrap: wrap;
        align-items: flex-start;
        padding: 0.9rem 1rem;
        gap: 0.75rem;
    }
    .sub-invite-head-actions {
        margin-left: 0;
        width: 100%;
    }
    .sub-invite-head-actions .btn {
        width: 100%;
    }
    .si-people-panel {
        padding: 0.75rem 1rem 0;
    }
    .sub-invite-card .sp-table-footer {
        margin: 0;
    }
    .sub-invite-title {
        font-size: 1.05rem;
    }
}
.si-people-table {
    margin: 0;
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed;
}
.si-people-table col.si-col-name { width: 28%; }
.si-people-table col.si-col-job { width: 22%; }
.si-people-table col.si-col-nat { width: 20%; }
.si-people-table col.si-col-id { width: 22%; }
.si-people-table col.si-col-actions { width: 8%; }
.si-people-table thead th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    background: #f8fafc;
    border-bottom-color: #e4ebf2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
}
.si-people-table tbody td {
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.si-people-table thead th.table-row-actions,
.si-people-table tbody td.table-row-actions {
    width: 2.75rem;
    min-width: 2.75rem;
    max-width: 2.75rem;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
    overflow: visible;
    text-align: center;
}
.sub-invite-card .mobile-card-list .m-card:last-child {
    margin-bottom: 0;
}
.si-person-row {
    cursor: pointer;
}
.si-person-row:hover,
.si-person-row:focus-visible {
    background: #f3fafa;
}
.si-person-row:focus-visible {
    outline: 2px solid #0d6e6e;
    outline-offset: -2px;
}
.inv-company-wrap {
    position: relative;
}
.inv-company-menu {
    position: absolute;
    z-index: 1080;
    left: 0;
    right: 0;
    top: calc(100% + 2px);
    max-height: 240px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #d7e5e5;
    border-radius: 0.5rem;
    box-shadow: 0 10px 28px rgba(11, 31, 51, 0.14);
    padding: 0.25rem 0;
}
.inv-company-opt {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 0.5rem 0.85rem;
    font-size: 0.9rem;
    color: #10233a;
    line-height: 1.35;
}
.inv-company-opt:hover,
.inv-company-opt:focus {
    background: #f3fafa;
    outline: none;
}

/* ERS Devices: Excel-style project allocation cells */
#ersDevicesTable col.ers-dev-col-project {
    width: 22%;
}
#ersDevicesTableWrap {
    max-height: min(70vh, 720px);
    overflow: auto;
}
#ersDevicesTable.sp-table[data-sp-resize="1"] thead th {
    position: sticky;
    top: 0;
    z-index: 6;
    background: var(--sp-table-header-bg, #eef3f7);
    background-clip: padding-box;
}
#ersDevicesTable tbody td.ers-dev-project-cell {
    position: relative;
    overflow: visible;
    cursor: pointer;
    user-select: none;
    padding-right: 1.2rem;
}
#ersDevicesTable tbody td.ers-dev-project-cell .ers-dev-project-label {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#ersDevicesTable tbody td.ers-dev-project-cell .ers-dev-project-label.is-empty {
    color: #94a3b8;
}
#ersDevicesTable tbody td.ers-dev-project-cell.is-range {
    background: rgba(13, 110, 110, 0.10);
    box-shadow: inset 2px 0 0 #0d6e6e, inset -2px 0 0 #0d6e6e;
}
#ersDevicesTable tbody td.ers-dev-project-cell.is-range-start {
    box-shadow: inset 2px 0 0 #0d6e6e, inset -2px 0 0 #0d6e6e, inset 0 2px 0 #0d6e6e;
}
#ersDevicesTable tbody td.ers-dev-project-cell.is-range-end {
    box-shadow: inset 2px 0 0 #0d6e6e, inset -2px 0 0 #0d6e6e, inset 0 -2px 0 #0d6e6e;
}
#ersDevicesTable tbody td.ers-dev-project-cell.is-range-start.is-range-end {
    box-shadow: inset 0 0 0 2px #0d6e6e;
}
#ersDevicesTable tbody td.ers-dev-project-cell.is-selected {
    background: #e7f4f4;
    z-index: 3;
}
#ersDevicesTable tbody td.ers-dev-project-cell.is-fill-preview {
    background: rgba(13, 110, 110, 0.18);
    box-shadow: inset 0 0 0 1px rgba(13, 110, 110, 0.55);
}
#ersDevicesTable .ers-dev-project-caret {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: #0d6e6e;
    line-height: 1;
    font-size: 0.7rem;
    cursor: pointer;
    z-index: 4;
}
#ersDevicesTable .ers-dev-project-caret:hover {
    color: #0a5555;
}
#ersDevicesTable .ers-dev-fill-handle {
    position: absolute;
    right: 1px;
    bottom: 1px;
    width: 8px;
    height: 8px;
    background: #0d6e6e;
    border: 1px solid #fff;
    box-shadow: 0 0 0 1px #0d6e6e;
    cursor: crosshair;
    z-index: 5;
    touch-action: none;
}
body.ers-dev-filling {
    cursor: crosshair;
    user-select: none;
}
body.ers-dev-filling #ersDevicesTable tbody td.ers-dev-project-cell {
    cursor: crosshair;
}


