/**
 * Smart Hands Cleaning Management System - Modern SaaS Theme
 * Built with Bootstrap 5.3.3 + Custom Professional Enhancements
 * Optimized for cPanel shared hosting, high-density SaaS dashboards, and zero horizontal scrolling.
 */

:root {
    --sh-primary: #0284c7;
    --sh-primary-dark: #0369a1;
    --sh-primary-light: #f0f9ff;
    --sh-primary-border: #bae6fd;
    --sh-success: #059669;
    --sh-success-dark: #047857;
    --sh-success-light: #ecfdf5;
    --sh-success-border: #a7f3d0;
    --sh-warning: #d97706;
    --sh-warning-dark: #b45309;
    --sh-warning-light: #fffbeb;
    --sh-warning-border: #fde68a;
    --sh-danger: #dc2626;
    --sh-danger-dark: #b91c1c;
    --sh-danger-light: #fef2f2;
    --sh-danger-border: #fecaca;
    --sh-info: #0891b2;
    --sh-info-light: #ecfeff;
    --sh-info-border: #a5f3fc;
    --sh-sidebar-bg: #0f172a;
    --sh-sidebar-hover: #1e293b;
    --sh-sidebar-active: #0284c7;
    --sh-sidebar-border: #1e293b;
    --sh-sidebar-width: 260px;
    --sh-body-bg: #f8fafc;
    --sh-card-bg: #ffffff;
    --sh-card-border: #e2e8f0;
    --sh-text-main: #0f172a;
    --sh-text-muted: #64748b;
    --sh-header-height: 62px;
}

/* Global Reset & No-Overflow Rules */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--sh-body-bg);
    color: var(--sh-text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 0.9375rem;
    line-height: 1.55;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Layout Architecture */
.app-wrapper {
    display: flex;
    width: 100%;
    max-width: 100vw;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Sidebar Styles */
.app-sidebar {
    width: var(--sh-sidebar-width);
    background-color: var(--sh-sidebar-bg);
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1045;
    transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
    border-right: 1px solid var(--sh-sidebar-border);
}

.sidebar-brand {
    height: var(--sh-header-height);
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #ffffff;
    font-weight: 700;
    font-size: 1.05rem;
    text-decoration: none;
    border-bottom: 1px solid var(--sh-sidebar-border);
    flex-shrink: 0;
}

.sidebar-brand:hover {
    color: #ffffff;
}

.brand-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: linear-gradient(135deg, #0284c7, #0369a1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.15rem;
    box-shadow: 0 2px 4px rgba(2, 132, 199, 0.25);
}

.sidebar-close-btn {
    display: none;
    color: #94a3b8;
    background: transparent;
    border: none;
    padding: 4px;
    border-radius: 6px;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.sidebar-close-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.85rem 0.65rem;
    scrollbar-width: thin;
    scrollbar-color: #334155 transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

.nav-section-title {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    padding: 0.75rem 0.65rem 0.35rem 0.65rem;
}

.app-sidebar .nav-link {
    color: #94a3b8;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    margin-bottom: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
}

.app-sidebar .nav-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.app-sidebar .nav-link:hover {
    color: #f8fafc;
    background-color: var(--sh-sidebar-hover);
}

.app-sidebar .nav-link.active {
    color: #ffffff;
    background-color: var(--sh-sidebar-active);
    box-shadow: 0 1px 3px rgba(2, 132, 199, 0.35);
    font-weight: 600;
}

.sidebar-footer {
    padding: 0.85rem 1rem;
    border-top: 1px solid var(--sh-sidebar-border);
    background-color: #090e1a;
    flex-shrink: 0;
}

/* Main Content Area */
.app-main {
    flex: 1 1 auto;
    width: calc(100% - var(--sh-sidebar-width));
    margin-left: var(--sh-sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: calc(100% - var(--sh-sidebar-width));
    min-height: 100vh;
    transition: margin-left 0.22s cubic-bezier(0.16, 1, 0.3, 1), width 0.22s cubic-bezier(0.16, 1, 0.3, 1), max-width 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Collapsible Desktop / Tablet Sidebar */
@media (min-width: 992px) {
    body.sidebar-collapsed .app-sidebar {
        transform: translateX(-100%);
    }
    body.sidebar-collapsed .app-main {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
    }
}

/* Top Navbar */
.app-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--sh-card-border);
    padding: 0 1.5rem;
    height: var(--sh-header-height);
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.header-search {
    position: relative;
    max-width: 300px;
    width: 100%;
}

.header-search i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.header-search input {
    padding-left: 2.25rem;
    height: 38px;
    border-radius: 20px;
    border: 1px solid #cbd5e1;
    font-size: 0.85rem;
    background-color: #f8fafc;
}

.header-search input:focus {
    background-color: #ffffff;
    border-color: var(--sh-primary);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* Content Body */
.app-content {
    flex: 1;
    padding: 1.25rem;
    max-width: 100%;
    overflow-x: hidden;
}

@media (min-width: 992px) {
    .app-content {
        padding: 1.5rem 1.75rem;
    }
}

/* Stat Cards */
.stat-card {
    background: #ffffff;
    border: 1px solid var(--sh-card-border);
    border-radius: 12px;
    padding: 1.15rem 1.25rem;
    height: 100%;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: #cbd5e1;
    box-shadow: 0 8px 16px -4px rgba(15, 23, 42, 0.06);
}

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-icon.primary { background-color: var(--sh-primary-light); color: var(--sh-primary); border: 1px solid var(--sh-primary-border); }
.stat-icon.success { background-color: var(--sh-success-light); color: var(--sh-success); border: 1px solid var(--sh-success-border); }
.stat-icon.warning { background-color: var(--sh-warning-light); color: var(--sh-warning); border: 1px solid var(--sh-warning-border); }
.stat-icon.danger  { background-color: var(--sh-danger-light); color: var(--sh-danger); border: 1px solid var(--sh-danger-border); }
.stat-icon.info    { background-color: var(--sh-info-light); color: var(--sh-info); border: 1px solid var(--sh-info-border); }
.stat-icon.secondary { background-color: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }

.stat-val {
    font-size: 1.65rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 0.725rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
}

/* Quick Actions */
.quick-action-btn {
    border: 1px solid var(--sh-card-border);
    background-color: #ffffff;
    color: #1e293b;
    padding: 0.65rem 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: all 0.15s ease;
    min-height: 42px;
    width: 100%;
}

.quick-action-btn:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    color: var(--sh-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.04);
}

.quick-action-btn.primary {
    background-color: var(--sh-primary);
    border-color: var(--sh-primary);
    color: #ffffff;
}

.quick-action-btn.primary:hover {
    background-color: var(--sh-primary-dark);
    border-color: var(--sh-primary-dark);
    color: #ffffff;
}

/* Card Surface Styling */
.card-modern {
    background: #ffffff;
    border: 1px solid var(--sh-card-border);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
    overflow: hidden;
}

.card-modern-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--sh-card-border);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Tables */
.table-card {
    background: #ffffff;
    border: 1px solid var(--sh-card-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.03);
    margin-bottom: 1.25rem;
}

.table-card .card-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--sh-card-border);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.sh-table {
    margin-bottom: 0;
    width: 100%;
}

.sh-table thead th {
    background-color: #f8fafc;
    color: #475569;
    font-size: 0.725rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--sh-card-border);
    white-space: nowrap;
}

.sh-table tbody td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    font-size: 0.875rem;
}

.sh-table tbody tr:hover {
    background-color: #f8fafc;
}

.sh-table tbody tr:last-child td {
    border-bottom: none;
}

/* Avatar Initials */
.avatar-initials {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8125rem;
    background-color: var(--sh-primary-light);
    color: var(--sh-primary);
    border: 1px solid var(--sh-primary-border);
    flex-shrink: 0;
}

/* Subtle Semantic Badges */
.badge-subtle-primary {
    background-color: var(--sh-primary-light);
    color: var(--sh-primary);
    border: 1px solid var(--sh-primary-border);
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
}

.badge-subtle-success {
    background-color: var(--sh-success-light);
    color: var(--sh-success);
    border: 1px solid var(--sh-success-border);
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
}

.badge-subtle-warning {
    background-color: var(--sh-warning-light);
    color: var(--sh-warning);
    border: 1px solid var(--sh-warning-border);
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
}

.badge-subtle-danger {
    background-color: var(--sh-danger-light);
    color: var(--sh-danger);
    border: 1px solid var(--sh-danger-border);
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
}

.badge-subtle-secondary {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
}

/* Status Badges */
.badge-status {
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.badge-status.active {
    background-color: var(--sh-success-light);
    color: var(--sh-success);
    border: 1px solid var(--sh-success-border);
}

.badge-status.inactive {
    background-color: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.badge-status.on-leave {
    background-color: var(--sh-warning-light);
    color: var(--sh-warning);
    border: 1px solid var(--sh-warning-border);
}

.badge-status.maintenance {
    background-color: var(--sh-danger-light);
    color: var(--sh-danger);
    border: 1px solid var(--sh-danger-border);
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.badge-status.active .badge-dot { background-color: var(--sh-success); }
.badge-status.inactive .badge-dot { background-color: #94a3b8; }
.badge-status.on-leave .badge-dot { background-color: var(--sh-warning); }
.badge-status.maintenance .badge-dot { background-color: var(--sh-danger); }

/* Buttons */
.btn {
    font-weight: 500;
    border-radius: 8px;
    padding: 0.5rem 0.95rem;
    font-size: 0.875rem;
    transition: all 0.15s ease;
}

.btn-primary {
    background-color: var(--sh-primary);
    border-color: var(--sh-primary);
    color: #ffffff;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--sh-primary-dark);
    border-color: var(--sh-primary-dark);
    color: #ffffff;
}

/* Modals */
.modal-content {
    border: 1px solid var(--sh-card-border);
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.modal-header {
    border-bottom: 1px solid var(--sh-card-border);
    padding: 1rem 1.25rem;
    background-color: #f8fafc;
}

.modal-footer {
    border-top: 1px solid var(--sh-card-border);
    padding: 0.85rem 1.25rem;
    background-color: #f8fafc;
}

/* Form Controls */
.form-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.35rem;
}

.form-control, .form-select {
    border-color: #cbd5e1;
    font-size: 0.875rem;
    border-radius: 8px;
    padding: 0.5rem 0.85rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--sh-primary);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

/* Empty State Box */
.empty-state-box {
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: #64748b;
}

.empty-state-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: #f1f5f9;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

/* Toast Container */
.toast-container {
    z-index: 1090;
}

/* Responsive Table Scrollbars */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}
.table-responsive::-webkit-scrollbar-track {
    background: #f1f5f9;
}
.table-responsive::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Off-canvas Responsive Sidebar (< 992px) */
@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
    }
    .app-sidebar.show {
        transform: translateX(0);
        box-shadow: 0 0 25px rgba(0, 0, 0, 0.35);
    }
    .sidebar-close-btn {
        display: block;
    }
    .app-main {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
        z-index: 1040;
    }
    .sidebar-overlay.show {
        display: block;
    }
    .header-search {
        display: none;
    }
}

/* Tablet Optimizations (768px to 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .app-content {
        padding: 1.15rem;
    }
    .stat-card {
        padding: 1rem;
    }
}

/* Mobile Touch & Usability Enhancements (< 768px) */
@media (max-width: 767.98px) {
    /* Prevent horizontal page drift */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        position: relative;
    }

    .app-main {
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden;
    }

    .app-header {
        padding: 0 0.85rem;
        height: 58px;
    }

    .app-header h1 {
        max-width: 175px !important;
        font-size: 0.9rem !important;
    }

    .app-content {
        padding: 0.85rem 0.75rem;
        width: 100% !important;
        max-width: 100vw !important;
    }

    /* Stat Cards & KPI Tiles */
    .stat-card {
        padding: 0.9rem 1rem !important;
        border-radius: 12px !important;
        margin-bottom: 0.25rem;
    }

    .stat-val {
        font-size: 1.35rem !important;
        line-height: 1.25 !important;
    }

    .stat-icon {
        width: 38px !important;
        height: 38px !important;
        font-size: 1.1rem !important;
        border-radius: 10px !important;
    }

    .stat-label {
        font-size: 0.78rem !important;
    }

    .stat-helper {
        font-size: 0.72rem !important;
    }

    .kpi-card-elevated {
        padding: 0.95rem 1rem !important;
        border-radius: 12px !important;
    }

    .kpi-icon-wrap {
        width: 38px !important;
        height: 38px !important;
        font-size: 1.1rem !important;
    }

    /* Page Header Titles & Action Button Stacks */
    .breadcrumb {
        font-size: 0.75rem !important;
        margin-bottom: 0.25rem !important;
    }

    h4.fw-bold {
        font-size: 1.2rem !important;
        line-height: 1.3 !important;
    }

    p.text-muted.small {
        font-size: 0.78rem !important;
        line-height: 1.4 !important;
    }

    /* Mobile Page Header Actions: wrap smoothly */
    .d-flex.flex-wrap.justify-content-between.align-items-center.gap-3.mb-4 > div:last-child,
    .page-header-actions {
        width: 100% !important;
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }

    .d-flex.flex-wrap.justify-content-between.align-items-center.gap-3.mb-4 > div:last-child .btn,
    .page-header-actions .btn {
        flex: 1 1 auto !important;
        min-height: 38px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        white-space: nowrap !important;
        font-size: 0.8125rem !important;
        padding: 0.45rem 0.85rem !important;
    }

    /* Horizontal Smooth-Scrolling Status Filter Pills (iOS/Android App Style) */
    .d-flex.flex-wrap.align-items-center.gap-2.mb-3,
    .d-flex.align-items-center.gap-2.mb-3.overflow-x-auto,
    .filter-pills-row,
    .nav-pills:not(.flex-column) {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        gap: 0.45rem !important;
        padding-bottom: 0.4rem !important;
        margin-bottom: 0.85rem !important;
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
    }

    .d-flex.flex-wrap.align-items-center.gap-2.mb-3::-webkit-scrollbar,
    .d-flex.align-items-center.gap-2.mb-3.overflow-x-auto::-webkit-scrollbar,
    .filter-pills-row::-webkit-scrollbar,
    .nav-pills::-webkit-scrollbar {
        display: none !important;
    }

    .d-flex.flex-wrap.align-items-center.gap-2.mb-3 > .btn,
    .d-flex.flex-wrap.align-items-center.gap-2.mb-3 > a.btn,
    .d-flex.align-items-center.gap-2.mb-3.overflow-x-auto > .btn,
    .d-flex.align-items-center.gap-2.mb-3.overflow-x-auto > a.btn,
    .nav-pills > .nav-item {
        flex-shrink: 0 !important;
        white-space: nowrap !important;
        font-size: 0.78rem !important;
        padding: 0.35rem 0.8rem !important;
        border-radius: 9999px !important;
    }

    /* Form Controls: prevent iOS Safari auto-zoom by ensuring minimum 16px font-size */
    .form-control,
    .form-select,
    .form-control-sm,
    .form-select-sm {
        font-size: 16px !important;
        min-height: 40px !important;
        border-radius: 8px !important;
    }

    .input-group-sm > .input-group-text,
    .input-group-sm > .form-control,
    .input-group-sm > .form-select {
        min-height: 40px !important;
        font-size: 16px !important;
    }

    .form-label {
        font-size: 0.78rem !important;
        margin-bottom: 0.25rem !important;
    }

    /* Action Buttons in search/filter bars */
    .btn-sm {
        min-height: 40px !important;
        font-size: 0.84rem !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Tables in mobile cards */
    .table-card .card-header {
        padding: 0.75rem 0.85rem !important;
    }

    .table-card .card-header h6 {
        font-size: 0.875rem !important;
    }

    .sh-table th, .sh-table td,
    .table th, .table td,
    .report-table thead th, .report-table tbody td {
        padding: 0.65rem 0.75rem !important;
        font-size: 0.8125rem !important;
    }

    .sh-table thead th,
    .table thead th {
        font-size: 0.7rem !important;
        letter-spacing: 0.03em !important;
    }

    /* Table action buttons */
    .sh-table td .btn-group,
    .table td .btn-group,
    .sh-table td .d-flex.gap-1 {
        flex-wrap: nowrap !important;
        white-space: nowrap !important;
    }

    .sh-table td .btn-sm,
    .table td .btn-sm {
        min-height: 32px !important;
        padding: 0.3rem 0.55rem !important;
        font-size: 0.78rem !important;
    }

    /* Table horizontal scroll indicator */
    .table-responsive {
        border-radius: inherit;
        -webkit-overflow-scrolling: touch;
        background-image: 
            linear-gradient(to right, #ffffff, #ffffff),
            linear-gradient(to right, #ffffff, #ffffff),
            linear-gradient(to right, rgba(0, 0, 0, 0.08), rgba(255, 255, 255, 0)),
            linear-gradient(to left, rgba(0, 0, 0, 0.08), rgba(255, 255, 255, 0));
        background-position: left center, right center, left center, right center;
        background-repeat: no-repeat;
        background-color: #ffffff;
        background-size: 20px 100%, 20px 100%, 10px 100%, 10px 100%;
        background-attachment: local, local, scroll, scroll;
    }

    /* Dropdowns on mobile screen */
    .dropdown-menu {
        max-width: calc(100vw - 20px) !important;
        margin-left: 10px !important;
        margin-right: 10px !important;
    }

    /* Modals fit small mobile screens */
    .modal-dialog {
        margin: 0.5rem auto !important;
        max-width: 96% !important;
        width: 96% !important;
    }

    .modal-content {
        border-radius: 14px !important;
        max-height: calc(100vh - 1.5rem);
    }

    .modal-header {
        padding: 0.85rem 1rem !important;
    }

    .modal-body {
        padding: 1rem !important;
        max-height: calc(100vh - 160px);
        overflow-y: auto;
    }

    .modal-footer {
        padding: 0.75rem 1rem !important;
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }

    .modal-footer .btn {
        flex: 1 1 calc(50% - 0.5rem) !important;
        min-height: 42px !important;
        white-space: nowrap !important;
    }

    .modal-footer .btn:only-child {
        flex: 1 1 100% !important;
    }

    /* Modal form fields become clean single column on mobile */
    .modal-body .row > [class*="col-"] {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    /* Reports portal mobile adjustments */
    .report-tabs-card {
        border-radius: 12px !important;
    }

    .report-cat-group {
        display: flex !important;
        width: 100% !important;
        gap: 3px !important;
    }

    .report-cat-tab {
        flex: 1 1 auto !important;
        padding: 0.45rem 0.5rem !important;
        font-size: 0.78rem !important;
        justify-content: center !important;
        text-align: center !important;
    }

    .report-cat-tab .badge {
        display: none !important;
    }

    .report-header-icon {
        width: 40px !important;
        height: 40px !important;
        font-size: 1.25rem !important;
        border-radius: 10px !important;
    }

    /* Notification rows on mobile */
    .nav-notif-row {
        padding: 0.65rem 0.75rem !important;
    }

    .notification-item {
        padding: 0.85rem 1rem !important;
    }

    /* Dashboard mobile adjustments */
    .dash-metrics-strip {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        padding: 0.75rem !important;
    }

    .dash-metric-col {
        flex: 1 1 45% !important;
        border-right: none !important;
        border-bottom: 1px solid #e2e8f0;
        padding-bottom: 0.5rem !important;
    }

    .dash-metric-col:last-child,
    .dash-metric-col:nth-last-child(2) {
        border-bottom: none;
    }
}

/* Extra small mobile adjustments (< 576px) */
@media (max-width: 575.98px) {
    .app-content {
        padding: 0.75rem 0.5rem !important;
    }

    .card {
        border-radius: 10px !important;
    }

    .card-body {
        padding: 0.85rem 0.75rem !important;
    }

    .stat-card {
        padding: 0.75rem 0.85rem !important;
    }

    .stat-val {
        font-size: 1.25rem !important;
    }

    /* Compact 2-column or full width grid spacing */
    .row.g-3 {
        --bs-gutter-x: 0.5rem !important;
        --bs-gutter-y: 0.5rem !important;
    }

    .row.g-2 {
        --bs-gutter-x: 0.4rem !important;
        --bs-gutter-y: 0.4rem !important;
    }
}

/* Global Container & Anti-Overflow Rules */
.app-content > .container-fluid,
.app-content > .content-wrapper {
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Ensure no element exceeds its container */
img, svg, canvas, video {
    max-width: 100%;
    height: auto;
}

/* Prevent text from overflowing layout */
.table td, .table th, .card-body, .stat-card, p {
    overflow-wrap: anywhere;
}

/* Dashboard Polish & Executive SaaS Styling */
.dashboard-banner {
    background: #ffffff;
    border: 1px solid var(--sh-card-border);
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

.pulsing-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #10b981;
    position: relative;
    vertical-align: middle;
}
.pulsing-dot::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(16, 185, 129, 0.4);
    animation: pulse-ring 1.8s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}
@keyframes pulse-ring {
    0% { transform: scale(0.8); opacity: 0.8; }
    50% { transform: scale(1.6); opacity: 0; }
    100% { transform: scale(0.8); opacity: 0; }
}

.kpi-card-elevated {
    background: #ffffff;
    border: 1px solid var(--sh-card-border);
    border-radius: 14px;
    padding: 1.25rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
    position: relative;
    overflow: hidden;
}

.kpi-card-elevated:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.07);
    border-color: #cbd5e1;
}

.kpi-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.action-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.95rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.15s ease;
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    color: #334155;
    white-space: nowrap;
}
.action-chip:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    color: #0284c7;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px -1px rgba(15, 23, 42, 0.06);
}
.action-chip.primary {
    background-color: #0284c7;
    border-color: #0284c7;
    color: #ffffff;
}
.action-chip.primary:hover {
    background-color: #0369a1;
    border-color: #0369a1;
    color: #ffffff;
}

.activity-icon-bubble {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.avatar-circle-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* Flat Uncluttered Dashboard Lists & Metric Strips */
.card-modern-header,
.card-header-modern {
    background-color: #ffffff;
    border-bottom: 1px solid #eef2f6;
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.card-modern-footer,
.card-footer-modern {
    background-color: #f8fafc;
    border-top: 1px solid #eef2f6;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8125rem;
}

/* Balanced Scrollable Dashboard Card Body */
.dash-card-body {
    min-height: 350px;
    max-height: 375px;
    overflow-y: auto;
    position: relative;
}

.dash-card-body::-webkit-scrollbar {
    width: 5px;
}
.dash-card-body::-webkit-scrollbar-track {
    background: #f8fafc;
}
.dash-card-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
.dash-card-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.dash-flat-item {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.15s ease;
}
.dash-flat-item:last-child {
    border-bottom: none;
}
.dash-flat-item:hover {
    background-color: #f8fafc;
}

/* Unified Stat Divider Bar (replaces nested card boxes) */
.dash-metrics-strip {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border-bottom: 1px solid #eef2f6;
    padding: 0.65rem 0.5rem;
}
.dash-metric-col {
    flex: 1;
    text-align: center;
    padding: 0.25rem 0.75rem;
    border-right: 1px solid #e2e8f0;
}
.dash-metric-col:last-child {
    border-right: none;
}
.dash-metric-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 0.15rem;
}

.dash-table {
    margin-bottom: 0;
}
.dash-table th {
    background-color: #f8fafc;
    color: #475569;
    font-size: 0.725rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    border-top: none;
    white-space: nowrap;
}
.dash-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    font-size: 0.8125rem;
}
.dash-table tbody tr:last-child td {
    border-bottom: none;
}
.dash-table tbody tr:hover td {
    background-color: #f8fafc;
}

/* Activity item hover & icon accents */
.activity-row {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.15s ease;
}
.activity-row:last-child {
    border-bottom: none;
}
.activity-row:hover {
    background-color: #f8fafc;
}

/* ==========================================================================
   COMPREHENSIVE RESPONSIVE DESIGN SYSTEM (ALL DEVICES & SCREEN SIZES)
   Desktop, Laptop, Tablet, iPad, Mobile, and Small Mobile Screens (320px - 1920px)
   ========================================================================== */

/* 1. Global Viewport & Anti-Overflow Safeguards */
html {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    box-sizing: border-box;
}

*, *::before, *::after {
    box-sizing: inherit;
}

body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
    position: relative;
    -webkit-text-size-adjust: 100%;
}

.app-wrapper {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
}

.app-main {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-x: hidden;
}

.app-content {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    overflow-x: clip;
}

/* Media, embeds, and code containers cannot exceed container bounds */
img, video, canvas, svg {
    max-width: 100% !important;
    height: auto;
}

pre, code {
    max-width: 100% !important;
    overflow-x: auto !important;
    white-space: pre-wrap !important;
    word-break: break-word !important;
}

/* 2. Responsive Tables: System-wide zero overflow guarantee */
.table-responsive {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    margin-bottom: 0;
    position: relative;
}

.table-responsive::-webkit-scrollbar {
    height: 6px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.table-responsive table {
    margin-bottom: 0;
    width: 100%;
}

/* Modern & Clean Table Base Standards */
.table-modern {
    width: 100%;
    margin-bottom: 0;
    border-collapse: collapse;
}

.table-modern th {
    background-color: #f8fafc;
    color: #475569;
    font-size: 0.725rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--sh-card-border);
    white-space: nowrap;
}

.table-modern td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    font-size: 0.875rem;
}

.table-modern tbody tr:hover {
    background-color: #f8fafc;
}

/* Prevent Column Overlap on Small Screens */
@media (max-width: 991.98px) {
    .table-responsive > table:not(.table-fit):not(.table-borderless):not(.table-sm) {
        min-width: 680px;
    }
    .table-responsive > table.report-table,
    .table-responsive > table.table-custom,
    .table-responsive > table.table-wide {
        min-width: 780px;
    }
}

@media (max-width: 575.98px) {
    .table-responsive > table:not(.table-fit):not(.table-borderless):not(.table-sm) {
        min-width: 640px;
    }
    .table-responsive > table.report-table,
    .table-responsive > table.table-custom,
    .table-responsive > table.table-wide {
        min-width: 740px;
    }
}

/* Ensure Table Headers Stay Crystal-Clear and Never Stack Awkwardly */
.table th,
.sh-table th,
.table-modern th,
.report-table th,
.table-custom th {
    white-space: nowrap !important;
    vertical-align: middle;
    font-size: 0.725rem !important;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Long text wrap properly: Client Names, Addresses, Descriptions */
.table td,
.sh-table td,
.table-modern td,
.report-table td,
.table-custom td {
    vertical-align: middle;
}

.table-responsive table td .text-truncate {
    white-space: normal !important;
    text-overflow: clip !important;
    word-break: break-word !important;
    max-width: 260px !important;
    line-height: 1.35;
}

/* Action column protection: Buttons stay accessible and usable */
.table td.text-end,
.sh-table td.text-end,
.table-modern td.text-end,
.report-table td.text-end,
.table-custom td.text-end,
.table th.text-end,
.sh-table th.text-end,
.table-modern th.text-end,
.report-table th.text-end,
.table-custom th.text-end,
.table td:last-child,
.sh-table td:last-child,
.table-modern td:last-child,
.table th:last-child,
.sh-table th:last-child,
.table-modern th:last-child {
    white-space: nowrap !important;
}

/* Table action buttons shouldn't break or warp table rows */
.table td .btn-group,
.sh-table td .btn-group,
.table-modern td .btn-group,
.report-table td .btn-group,
.table td .btn-group-sm {
    display: inline-flex !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    vertical-align: middle;
}

.table td .btn,
.sh-table td .btn,
.table-modern td .btn,
.report-table td .btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 32px;
    padding: 0.25rem 0.55rem;
    font-size: 0.8125rem;
    white-space: nowrap !important;
}

.table td .btn-group-sm > .btn {
    min-height: 30px !important;
    padding: 0.25rem 0.5rem !important;
}

/* Dates, Badges, Monospace IDs and Amounts stay intact */
.table td .badge,
.sh-table td .badge,
.table-modern td .badge,
.report-table td .badge,
.table td .font-monospace,
.sh-table td .font-monospace,
.table td .badge-subtle-primary,
.table td .badge-subtle-success,
.table td .badge-subtle-warning,
.table td .badge-subtle-danger {
    white-space: nowrap !important;
    display: inline-flex;
    align-items: center;
}

/* Responsive Table Pagination */
.pagination {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 0.25rem !important;
    margin-bottom: 0 !important;
}

.pagination .page-item .page-link {
    min-width: 36px !important;
    min-height: 36px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.35rem 0.65rem !important;
    font-size: 0.825rem !important;
    border-radius: 6px !important;
}

/* Responsive Filter Bars & Search Controls */
.table-filter-card .card-body,
.table-card .card-header {
    flex-wrap: wrap;
    gap: 0.75rem;
}

@media (max-width: 767.98px) {
    .table-card .card-header {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    .table-card .card-header > div,
    .table-card .card-header > form,
    .table-card .card-header > .d-flex {
        width: 100% !important;
    }
    .table-card .card-header input[type="search"],
    .table-card .card-header input[type="text"],
    .table-card .card-header select {
        width: 100% !important;
    }
}

/* 3. Dropdown Menus Responsiveness: Keep within viewport */
.dropdown-menu {
    max-width: calc(100vw - 20px) !important;
    word-wrap: break-word;
}

@media (max-width: 575.98px) {
    .dropdown-menu-end {
        right: 0 !important;
        left: auto !important;
    }
}

/* 4. Large Tablets & Desktops (992px and above) */
@media (min-width: 992px) {
    .app-sidebar {
        transform: translateX(0);
    }
    .sidebar-overlay {
        display: none !important;
    }
    .sidebar-close-btn {
        display: none !important;
    }
}

/* 5. Tablets & iPads (768px to 991.98px) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .app-main {
        margin-left: 0 !important;
        width: 100% !important;
    }
    .app-content {
        padding: 1.25rem 1rem !important;
    }
    .stat-card {
        padding: 1.1rem !important;
    }
    .stat-val {
        font-size: 1.45rem !important;
    }
}

/* 6. Mobile Devices (< 768px) */
@media (max-width: 767.98px) {
    .app-main {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .app-content {
        padding: 0.85rem 0.65rem !important;
    }

    /* Clean, legible headings */
    h1, .h1 { font-size: 1.45rem !important; }
    h2, .h2 { font-size: 1.3rem !important; }
    h3, .h3 { font-size: 1.2rem !important; }
    h4, .h4 { font-size: 1.125rem !important; }
    h5, .h5 { font-size: 1rem !important; }
    h6, .h6 { font-size: 0.9rem !important; }

    /* Forms become clean single column for vertical thumb scrolling */
    .modal-body .row > [class*="col-"]:not(.col-auto):not(.keep-col),
    .form-card .row > [class*="col-"]:not(.col-auto):not(.keep-col),
    form.responsive-form .row > [class*="col-"]:not(.col-auto):not(.keep-col) {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    /* Touch-friendly inputs: minimum 40px height, 16px font to stop Safari auto-zoom */
    .form-control,
    .form-select,
    .form-control-sm,
    .form-select-sm {
        min-height: 42px !important;
        font-size: 16px !important;
    }

    /* Buttons: comfortable touch targets */
    .btn:not(.btn-sm):not(.p-0) {
        min-height: 42px !important;
        padding: 0.5rem 1rem !important;
    }

    .btn-sm {
        min-height: 38px !important;
        padding: 0.4rem 0.75rem !important;
    }

    /* Page Header Actions & Top Action Bars */
    .page-header-actions,
    .d-flex.flex-wrap.justify-content-between.align-items-center.gap-3.mb-4 > div:last-child {
        width: 100% !important;
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }

    .page-header-actions .btn,
    .d-flex.flex-wrap.justify-content-between.align-items-center.gap-3.mb-4 > div:last-child .btn {
        flex: 1 1 auto !important;
        justify-content: center !important;
    }

    /* Modals on Mobile */
    .modal-dialog {
        margin: 0.5rem auto !important;
        max-width: 96% !important;
        width: 96% !important;
    }

    .modal-content {
        max-height: calc(100vh - 1rem) !important;
        border-radius: 12px !important;
        overflow: hidden;
    }

    .modal-body {
        max-height: calc(100vh - 150px) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 1rem 0.85rem !important;
    }

    .modal-footer {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        padding: 0.75rem 0.85rem !important;
    }

    .modal-footer .btn {
        flex: 1 1 calc(50% - 0.5rem) !important;
        min-height: 42px !important;
    }

    .modal-footer .btn:only-child {
        flex: 1 1 100% !important;
    }

    /* Stat Cards & Metric Tiles */
    .stat-card {
        padding: 0.85rem 0.95rem !important;
        border-radius: 12px !important;
    }

    .stat-val {
        font-size: 1.25rem !important;
        line-height: 1.25 !important;
    }

    /* Filter Form Elements: stack or fill */
    form[method="GET"] .row.g-2 > [class*="col-"] {
        flex: 1 1 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    form[method="GET"] .btn {
        width: 100% !important;
        min-height: 40px !important;
    }
}

/* 7. Small Mobile Screens (< 480px and down to 320px) */
@media (max-width: 479.98px) {
    .app-header {
        padding: 0 0.65rem !important;
        height: 54px !important;
    }

    .app-header h1 {
        max-width: 140px !important;
        font-size: 0.85rem !important;
    }

    .app-content {
        padding: 0.65rem 0.4rem !important;
    }

    .card {
        border-radius: 10px !important;
    }

    .card-body,
    .card-header,
    .card-footer {
        padding: 0.75rem 0.65rem !important;
    }

    .stat-card {
        padding: 0.75rem 0.65rem !important;
    }

    .stat-icon {
        width: 34px !important;
        height: 34px !important;
        font-size: 1rem !important;
    }

    .stat-val {
        font-size: 1.15rem !important;
    }

    .stat-label {
        font-size: 0.75rem !important;
    }

    .stat-helper {
        font-size: 0.7rem !important;
    }

    /* Modal buttons become 100% width on small screens */
    .modal-footer .btn {
        flex: 1 1 100% !important;
        width: 100% !important;
    }

    /* Notifications dropdown: full width on small screens */
    #notifDropdownMenu + .dropdown-menu {
        width: calc(100vw - 16px) !important;
        max-width: calc(100vw - 16px) !important;
        right: -8px !important;
        left: auto !important;
    }

    /* Reports tabs on extra small mobile */
    .report-cat-group {
        flex-direction: column !important;
        width: 100% !important;
    }

    .report-cat-tab {
        width: 100% !important;
        text-align: left !important;
        justify-content: flex-start !important;
    }
}

/* 8. Staff Portal & Mobile Architecture */
.staff-dashboard-header {
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.staff-header-quick-bar {
    -ms-overflow-style: none;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    display: flex;
}

@media (min-width: 992px) {
    .staff-header-quick-bar {
        flex-wrap: wrap !important;
    }
}

.staff-header-quick-bar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.staff-header-quick-bar .btn:active {
    transform: scale(0.97);
}

/* Staff KPI 2-Column Responsive Cards */
.staff-kpi-card {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.9) !important;
    border-radius: 14px !important;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.staff-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -4px rgba(15, 23, 42, 0.09) !important;
    border-color: #cbd5e1 !important;
}

@media (max-width: 575.98px) {
    .staff-kpi-card {
        padding: 0.8rem 0.85rem !important;
        border-radius: 12px !important;
    }
}

/* Staff Responsive Job Card Table */
@media (max-width: 767.98px) {
    .staff-dashboard-header {
        border-radius: 16px !important;
        margin-bottom: 1rem !important;
    }

    .staff-dashboard-header .card-body {
        padding: 1rem !important;
    }

    .staff-header-quick-bar {
        padding-bottom: 0.25rem;
    }

    .staff-header-quick-bar .btn {
        font-size: 0.78rem !important;
        padding: 0.45rem 0.85rem !important;
        white-space: nowrap !important;
        min-height: 40px !important;
    }

    #active-shift-card {
        border-radius: 16px !important;
    }

    #active-shift-card .card-body {
        padding: 1.15rem !important;
    }

    #active-shift-card .display-6 {
        font-size: 2rem !important;
    }

    /* Staff Jobs Schedule Mobile Cards */
    .staff-jobs-card-body {
        padding: 0 !important;
        background-color: transparent !important;
    }

    .staff-jobs-mobile-container {
        padding: 0.75rem !important;
        background-color: #f8fafc;
        display: flex;
        flex-direction: column;
        gap: 0.85rem;
    }

    .staff-job-mobile-card {
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 16px !important;
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05) !important;
        transition: all 0.2s ease !important;
        overflow: hidden;
    }

    .staff-job-mobile-card.table-warning,
    .staff-job-mobile-card.bg-warning-subtle,
    .staff-job-mobile-card.border-warning {
        border: 1.5px solid #f59e0b !important;
        background: #fffdf5 !important;
        box-shadow: 0 4px 14px rgba(245, 158, 11, 0.12) !important;
    }

    .staff-job-mobile-card .meta-metric-box {
        background: #f8fafc;
        border: 1px solid #f1f5f9;
        border-radius: 10px;
        padding: 0.55rem 0.7rem;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .staff-job-mobile-card.border-warning .meta-metric-box {
        background: #ffffff;
        border-color: #fde68a;
    }

    .staff-job-mobile-card .btn-start-work,
    .staff-job-mobile-card .btn-finish-work {
        min-height: 46px !important;
        font-size: 0.95rem !important;
        font-weight: 700 !important;
        border-radius: 12px !important;
        letter-spacing: 0.02em !important;
    }

    /* Transform Upcoming Schedule table on mobile */
    .table-modern.staff-upcoming-responsive thead {
        display: none !important;
    }

    .table-modern.staff-upcoming-responsive tbody tr {
        display: block !important;
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 12px !important;
        padding: 0.85rem !important;
        margin-bottom: 0.65rem !important;
    }

    .table-modern.staff-upcoming-responsive tbody td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 0.25rem 0 !important;
        border: none !important;
    }

    /* Transform History & Payments tables on mobile */
    .table-modern.staff-history-responsive thead {
        display: none !important;
    }

    .table-modern.staff-history-responsive tbody tr {
        display: block !important;
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 12px !important;
        padding: 0.85rem !important;
        margin-bottom: 0.65rem !important;
    }

    .table-modern.staff-history-responsive tbody td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 0.25rem 0 !important;
        border: none !important;
    }
}

/* Site Access Pass Card */
.site-pass-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1rem 1.15rem;
    transition: all 0.18s ease;
}

@media (max-width: 575.98px) {
    .site-pass-card {
        padding: 0.85rem 0.85rem !important;
        border-radius: 12px !important;
    }
}

.site-pass-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.copy-pin-btn {
    cursor: pointer;
    transition: all 0.15s ease;
}

.copy-pin-btn:active {
    transform: scale(0.95);
}

/* Staff Pulse Dot */
.staff-pulse-dot {
    position: relative;
    display: inline-block;
}

.staff-pulse-dot::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: inherit;
    animation: staffPulse 2s infinite ease-out;
    opacity: 0.7;
}

/* Staff job card desktop table view enhancements */
@media (min-width: 768px) {
    .staff-job-meta-label {
        display: none !important;
    }
    .staff-job-action-cell div {
        width: auto !important;
    }
    .staff-job-action-cell .btn,
    .staff-job-action-cell .badge {
        width: auto !important;
        min-width: 135px !important;
    }
}

@keyframes staffPulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(2.4);
        opacity: 0;
    }
}


