/**
 * DEPO CSS - PT Cipta Sinergi Sejahtera
 * Core Design System & Custom Styles
 */

:root {
    /* Color Palette */
    --primary-color: #1a365d;
    --secondary-color: #2b6cb0;
    --accent-color: #f6ad55;
    --bg-light: #f7fafc;
    --text-main: #2d3748;
    --text-muted: #64748b;
    --border-color: #e2e8f0;

    /* Semantic Tokens */
    --success-light: #c6f6d5;
    --success-text: #276749;
    --success-border: #38a169;
    --success-bg: #e6f9e6;
    
    --info-light: #bee3f8;
    --info-text: #2a4365;
    
    --warning-light: #fefcbf;
    --warning-text: #975a16;
    --warning-border: #dd6b20;
    
    --danger-light: #fed7e2;
    --danger-text: #97266d;
    --danger-border: #e53e3e;
    --danger-bg: #fff5f5;
    --danger-text-alt: #c53030;
    
    --purple-light: #e9d8fd;
    --purple-text: #553c9a;
    
    --teal-light: #e6fffa;
    --teal-text: #319795;
    
    --dark-light: #e2e8f0;

    /* Shadows & Transitions */
    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.07);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.15);
    --transition-base: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.shadow-card {
    box-shadow: var(--shadow-card) !important;
}

body {
    background-color: var(--bg-light);
    color: var(--text-main);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Sidebar Navigation Core */
.sidebar {
    min-height: 100vh;
    height: 100vh;
    background: linear-gradient(180deg, #102a4e 0%, #173b6a 50%, #132f55 100%);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    z-index: 1020;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.12);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.38s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: width, transform;
    overflow-x: hidden;
    overflow-y: hidden;
}

/* Custom Scrollbar for Sidebar Nav Container */
.sidebar-nav-container {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.6rem 0.5rem 1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}
.sidebar-nav-container::-webkit-scrollbar {
    width: 5px;
}
.sidebar-nav-container::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-nav-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
.sidebar-nav-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Universal Modal Scrollbar & Layout Fixes */
.modal {
    overflow-y: auto !important;
}
.modal-dialog {
    margin-top: 1.75rem;
    margin-bottom: 1.75rem;
}
.modal-dialog-scrollable {
    max-height: calc(100vh - 3.5rem) !important;
}
.modal-dialog-scrollable .modal-content {
    max-height: 100% !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    border: none;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
}
/* Ensure <form> tags wrapping or inside .modal-content participate in flexbox so .modal-body scrolls properly */
.modal-dialog-scrollable .modal-content > form,
.modal-dialog-scrollable > form > .modal-content,
.modal-dialog-scrollable > form {
    display: flex !important;
    flex-direction: column !important;
    max-height: 100% !important;
    overflow: hidden !important;
    width: 100% !important;
    flex: 1 1 auto !important;
}
.modal-dialog-scrollable .modal-body {
    overflow-y: auto !important;
    flex: 1 1 auto !important;
    max-height: none !important;
}
/* Make scrollbars visible and elegant on modal-body and modal */
.modal-body::-webkit-scrollbar,
.modal::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.modal-body::-webkit-scrollbar-track,
.modal::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}
.modal-body::-webkit-scrollbar-thumb,
.modal::-webkit-scrollbar-thumb {
    background: #b0bec5;
    border-radius: 4px;
}
.modal-body::-webkit-scrollbar-thumb:hover,
.modal::-webkit-scrollbar-thumb:hover {
    background: #78909c;
}

/* Sidebar Navigation Items */
.sidebar-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.45);
    padding: 0.75rem 0.85rem 0.25rem;
    display: block;
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
    max-height: 30px;
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                padding 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.75);
    padding: 0.62rem 0.85rem;
    border-radius: 10px;
    margin: 0.12rem 0.25rem;
    font-size: 0.88rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    position: relative;
    white-space: nowrap;
    text-decoration: none;
    overflow: hidden;
    transition: background-color 0.2s ease,
                color 0.2s ease,
                padding 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                margin 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                border-radius 0.2s ease;
}

.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    transform: translateX(3px);
}

.sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-weight: 600;
    box-shadow: inset 3px 0 0 #60a5fa, 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sidebar .nav-link i {
    width: 22px;
    font-size: 1.1rem;
    text-align: center;
    margin-right: 0.75rem;
    color: #93c5fd;
    flex-shrink: 0;
    transition: transform 0.2s ease,
                margin-right 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                font-size 0.25s ease;
}

.sidebar .nav-text {
    display: inline-block;
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 1;
    transform: translateX(0);
    transition: max-width 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar .dropdown-indicator {
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                max-width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 1;
    max-width: 20px;
    overflow: hidden;
    display: inline-block;
}

.sidebar .nav-link:hover i {
    transform: scale(1.12);
}

.sidebar .nav-link.active i {
    color: #ffffff;
}

/* Main Content Area */
.main-content {
    margin-left: 260px;
    padding: 2rem;
    min-height: 100vh;
    transition: margin-left 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: margin-left;
}

/* Full width main content when sidebar is hidden (e.g. Customer Portal) */
body.no-sidebar .main-content {
    margin-left: 0 !important;
    padding: 2rem;
    max-width: 1400px;
    margin-right: auto;
    margin-left: auto !important;
}

/* Customer Top Navigation Header */
.customer-navbar {
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    z-index: 1020;
    box-shadow: 0 2px 8px rgba(26, 54, 93, 0.04);
}

.customer-navbar-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.9rem 2rem;
}

/* Stat Cards */
.stat-card {
    border: none;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition-base);
    overflow: hidden;
    background: white;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-card .card-body {
    padding: 1.5rem;
}

.stat-card .stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: var(--transition-base);
}

.stat-card:hover .stat-icon {
    transform: scale(1.12) rotate(6deg);
}

/* Stat Icon Sizes & Color Variants */
.stat-icon-sm {
    width: 45px !important;
    height: 45px !important;
    border-radius: 12px !important;
    font-size: 1.3rem !important;
}
.stat-icon-green { background: var(--success-light) !important; color: var(--success-text) !important; }
.stat-icon-blue { background: var(--info-light) !important; color: var(--info-text) !important; }
.stat-icon-yellow { background: var(--warning-light) !important; color: var(--warning-text) !important; }
.stat-icon-purple { background: var(--purple-light) !important; color: var(--purple-text) !important; }
.stat-icon-pink { background: var(--danger-light) !important; color: var(--danger-text) !important; }
.stat-icon-dark { background: var(--dark-light) !important; color: var(--text-main) !important; }
.stat-icon-teal { background: var(--teal-light) !important; color: var(--teal-text) !important; }
.stat-icon-red { background: var(--danger-bg) !important; color: var(--danger-border) !important; }

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    color: var(--primary-color);
}

.stat-card .stat-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Sidebar Branding Header — Seamless Luxury Dark Blend */
.sidebar-brand {
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
    min-height: 74px;
    transition: padding 0.35s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease;
}
.sidebar-brand .brand-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    position: relative;
    height: 44px;
    max-width: calc(100% - 38px);
    transition: max-width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.sidebar-brand .brand-logo,
.sidebar-brand .brand-logo-full {
    height: 44px;
    width: auto;
    max-width: 175px;
    object-fit: contain;
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.25));
    display: block;
    opacity: 1;
    transform: scale(1);
    transform-origin: left center;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.sidebar-brand:hover .brand-logo,
.sidebar-brand:hover .brand-logo-full {
    transform: scale(1.03);
}
.sidebar-brand .brand-logo-collapsed {
    width: 38px;
    height: 38px;
    object-fit: contain;
    display: block !important;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scale(0.6);
    opacity: 0;
    pointer-events: none;
    background: transparent;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.25));
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.sidebar-brand .brand-title {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    color: #ffffff;
    line-height: 1.2;
}
.sidebar-brand .brand-sub {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.65);
    letter-spacing: 0.01em;
}

/* Sidebar Collapse Toggle Button */
.sidebar-collapse-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.2s ease,
                border-color 0.2s ease,
                color 0.2s ease,
                transform 0.2s ease;
    flex-shrink: 0;
}
.sidebar-collapse-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.25);
    color: #93c5fd;
    transform: scale(1.06);
}
.sidebar-collapse-btn i {
    display: inline-block;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Sidebar User Footer */
.sidebar-user {
    padding: 0.85rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(10, 25, 47, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-shrink: 0;
    min-height: 68px;
}
.sidebar-user .user-card-inner {
    width: 100%;
}
.sidebar-user .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.sidebar-user .user-status-indicator {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10b981;
    border: 2px solid #102a4e;
}
.sidebar-user .user-name {
    font-size: 0.84rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
    margin-bottom: 2px;
    max-width: 110px;
}

/* Sleek Icon-Only Sidebar Action Buttons */
.btn-sidebar-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.btn-sidebar-icon.theme-toggle-btn {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}
.btn-sidebar-icon.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: rotate(15deg) scale(1.08);
    color: #fde047;
    border-color: rgba(253, 224, 71, 0.4);
}
.btn-sidebar-icon.logout-btn {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}
.btn-sidebar-icon.logout-btn:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
    transform: scale(1.08);
}

/* Role Badges */
.role-badge {
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.role-manager { background: var(--danger-light); color: var(--danger-text); }
.role-staff { background: var(--success-light); color: var(--success-text); }
.role-finance { background: var(--info-light); color: var(--info-text); }
.role-marketing { background: var(--warning-light); color: var(--warning-text); }

/* Sidebar Dropdown & Smooth Transition */
.sidebar .nav-item .collapse,
.sidebar .nav-item .collapsing {
    margin: 0.2rem 0.25rem 0.4rem 1.4rem;
    border-left: 2px solid rgba(255, 255, 255, 0.15);
    padding-left: 0.35rem;
    transition: height 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar .nav-item .sub-menu .nav-link {
    padding: 0.45rem 0.75rem !important;
    font-size: 0.82rem;
    margin: 0.1rem 0;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar .nav-item .sub-menu .nav-link:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.12) !important;
}

.sidebar .nav-item .sub-menu .nav-link.active {
    color: #93c5fd !important;
    background: rgba(255, 255, 255, 0.16) !important;
    font-weight: 600;
    box-shadow: none;
}

.sidebar .dropdown-indicator {
    font-size: 0.75rem;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    color: rgba(255, 255, 255, 0.6);
}

.sidebar [aria-expanded="true"] .dropdown-indicator {
    transform: rotate(180deg);
}

/* ==========================================================================
   DESKTOP COLLAPSED (MINI SIDEBAR) MODE
   ========================================================================== */

html.sidebar-collapsed .sidebar,
body.sidebar-collapsed .sidebar {
    width: 76px !important;
}
html.sidebar-collapsed .main-content,
body.sidebar-collapsed .main-content {
    margin-left: 76px !important;
}

/* Brand Collapsed Mode: Perfectly Centered Square Logo */
html.sidebar-collapsed .sidebar-brand,
body.sidebar-collapsed .sidebar-brand {
    padding: 0.85rem 0.5rem !important;
    flex-direction: column !important;
    gap: 0.65rem !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(0, 0, 0, 0.12) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    width: 100% !important;
    box-sizing: border-box !important;
}
html.sidebar-collapsed .sidebar-brand .brand-link,
body.sidebar-collapsed .sidebar-brand .brand-link {
    width: 38px !important;
    height: 38px !important;
    max-width: 38px !important;
    max-height: 38px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto !important;
    position: relative !important;
    padding: 0 !important;
    overflow: visible !important;
}
html.sidebar-collapsed .sidebar-brand .brand-logo-full,
body.sidebar-collapsed .sidebar-brand .brand-logo-full {
    display: none !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
    left: -9999px !important;
}
html.sidebar-collapsed .sidebar-brand .brand-logo-collapsed,
body.sidebar-collapsed .sidebar-brand .brand-logo-collapsed {
    display: block !important;
    position: static !important;
    width: 38px !important;
    height: 38px !important;
    max-width: 38px !important;
    max-height: 38px !important;
    object-fit: contain !important;
    margin: 0 auto !important;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
}

/* Smooth Rotate & Centered Collapse Button */
html.sidebar-collapsed .sidebar-collapse-btn,
body.sidebar-collapsed .sidebar-collapse-btn {
    display: flex !important;
    width: 36px !important;
    height: 36px !important;
    margin: 0 auto !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 10px !important;
}
html.sidebar-collapsed .sidebar-collapse-btn i,
body.sidebar-collapsed .sidebar-collapse-btn i {
    transform: rotate(180deg) !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Nav Container in Collapsed Mode */
html.sidebar-collapsed .sidebar-nav-container,
body.sidebar-collapsed .sidebar-nav-container {
    padding: 0.6rem 0 1rem !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
}
html.sidebar-collapsed .sidebar-nav-container > ul.nav,
body.sidebar-collapsed .sidebar-nav-container > ul.nav {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
}
html.sidebar-collapsed .sidebar .nav-item,
body.sidebar-collapsed .sidebar .nav-item {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Subtle separator for section labels in collapsed mini sidebar */
html.sidebar-collapsed .sidebar .sidebar-section-label,
body.sidebar-collapsed .sidebar .sidebar-section-label {
    display: block !important;
    height: 1px !important;
    width: 36px !important;
    margin: 0.75rem auto 0.45rem !important;
    padding: 0 !important;
    font-size: 0 !important;
    line-height: 0 !important;
    background: rgba(255, 255, 255, 0.12) !important;
    overflow: hidden !important;
    user-select: none !important;
}

/* Sub-menus hidden in collapsed mode (opened via flyout) */
html.sidebar-collapsed .sidebar .sub-menu,
body.sidebar-collapsed .sidebar .sub-menu,
html.sidebar-collapsed .sidebar .collapse,
body.sidebar-collapsed .sidebar .collapse {
    display: none !important;
}

/* Completely Wipe Out Text & Dropdown Chevrons from Flow */
html.sidebar-collapsed .sidebar .nav-text,
body.sidebar-collapsed .sidebar .nav-text,
html.sidebar-collapsed .sidebar .dropdown-indicator,
body.sidebar-collapsed .sidebar .dropdown-indicator,
html.sidebar-collapsed .sidebar .nav-link .dropdown-indicator,
body.sidebar-collapsed .sidebar .nav-link .dropdown-indicator,
html.sidebar-collapsed .sidebar .nav-link i.dropdown-indicator,
body.sidebar-collapsed .sidebar .nav-link i.dropdown-indicator,
html.sidebar-collapsed .sidebar .nav-link span.dropdown-indicator,
body.sidebar-collapsed .sidebar .nav-link span.dropdown-indicator {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    left: -9999px !important;
    width: 0 !important;
    height: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Perfectly Centered Square for Every Mini Nav Link */
html.sidebar-collapsed .sidebar .nav-link,
body.sidebar-collapsed .sidebar .nav-link {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    margin: 0.3rem auto !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    text-align: center !important;
    box-sizing: border-box !important;
    position: relative !important;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
                background-color 0.2s ease,
                box-shadow 0.2s ease,
                color 0.2s ease !important;
}

/* Unwrap any inner div if present */
html.sidebar-collapsed .sidebar .nav-link > div,
body.sidebar-collapsed .sidebar .nav-link > div {
    display: contents !important;
}

/* Primary Icon: Dead Center in 44x44 Squircle */
html.sidebar-collapsed .sidebar .nav-link > i:not(.dropdown-indicator),
body.sidebar-collapsed .sidebar .nav-link > i:not(.dropdown-indicator),
html.sidebar-collapsed .sidebar .nav-link > .nav-icon,
body.sidebar-collapsed .sidebar .nav-link > .nav-icon {
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 1.3rem !important;
    line-height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    color: rgba(255, 255, 255, 0.75);
    flex-shrink: 0 !important;
    transition: transform 0.2s ease, color 0.2s ease !important;
}

/* Hover State */
html.sidebar-collapsed .sidebar .nav-link:hover,
body.sidebar-collapsed .sidebar .nav-link:hover {
    transform: scale(1.08) !important;
    background: rgba(255, 255, 255, 0.16) !important;
}
html.sidebar-collapsed .sidebar .nav-link:hover > i,
body.sidebar-collapsed .sidebar .nav-link:hover > i,
html.sidebar-collapsed .sidebar .nav-link:hover > .nav-icon,
body.sidebar-collapsed .sidebar .nav-link:hover > .nav-icon {
    color: #ffffff !important;
}

/* Active State: Centered Royal Blue Pill Badge */
html.sidebar-collapsed .sidebar .nav-link.active,
body.sidebar-collapsed .sidebar .nav-link.active {
    background: #2563eb !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45) !important;
    border: none !important;
}
html.sidebar-collapsed .sidebar .nav-link.active > i,
body.sidebar-collapsed .sidebar .nav-link.active > i,
html.sidebar-collapsed .sidebar .nav-link.active > .nav-icon,
body.sidebar-collapsed .sidebar .nav-link.active > .nav-icon {
    color: #ffffff !important;
}
html.sidebar-collapsed .sidebar .nav-link.active:hover,
body.sidebar-collapsed .sidebar .nav-link.active:hover {
    background: #1d4ed8 !important;
    transform: scale(1.08) !important;
}

/* User Footer Collapsed */
html.sidebar-collapsed .sidebar-user,
body.sidebar-collapsed .sidebar-user {
    padding: 0.75rem 0.35rem;
}
html.sidebar-collapsed .sidebar .user-meta,
body.sidebar-collapsed .sidebar .user-meta {
    opacity: 0;
    max-width: 0;
    transform: translateX(-10px);
    pointer-events: none;
    margin: 0 !important;
    padding: 0 !important;
}
html.sidebar-collapsed .sidebar-user .user-card-inner,
body.sidebar-collapsed .sidebar-user .user-card-inner {
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
}
html.sidebar-collapsed .sidebar-user .user-actions,
body.sidebar-collapsed .sidebar-user .user-actions {
    flex-direction: column;
    gap: 0.35rem;
}

/* Floating Flyout Submenu for Collapsed Mini Sidebar */
.sidebar-flyout-menu {
    position: fixed;
    z-index: 1090;
    width: 230px;
    background: #112644;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: flyoutSlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

@keyframes flyoutSlideIn {
    from {
        opacity: 0;
        transform: translateX(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.sidebar-flyout-menu .flyout-header {
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.sidebar-flyout-menu .flyout-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #93c5fd;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
}

.sidebar-flyout-menu .flyout-body {
    padding: 0.45rem;
}

.sidebar-flyout-menu .flyout-link {
    display: flex;
    align-items: center;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.84rem;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.15s ease;
    margin-bottom: 0.15rem;
}

.sidebar-flyout-menu .flyout-link i {
    width: 20px;
    margin-right: 0.6rem;
    color: #93c5fd;
    font-size: 0.95rem;
    text-align: center;
}

.sidebar-flyout-menu .flyout-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    transform: translateX(3px);
}

.sidebar-flyout-menu .flyout-link.active {
    background: rgba(59, 130, 246, 0.28);
    color: #ffffff;
    font-weight: 600;
    box-shadow: inset 3px 0 0 #60a5fa;
}

html[data-theme="dark"] .sidebar-flyout-menu {
    background: #0d1a2d;
    border-color: #1e293b;
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.65);
}

/* ==========================================================================
   MOBILE RESPONSIVENESS & OVERLAY
   ========================================================================== */

@media (max-width: 767.98px) {
    .sidebar {
        left: 0 !important;
        width: 285px !important;
        z-index: 1055;
        transform: translateX(-100%) !important;
        transition: transform 0.28s cubic-bezier(0.2, 0, 0, 1),
                    box-shadow 0.28s cubic-bezier(0.2, 0, 0, 1) !important;
        will-change: transform;
        box-shadow: none !important;
        overscroll-behavior: contain;
        padding-bottom: calc(5rem + env(safe-area-inset-bottom, 16px));
    }
    .sidebar.show {
        transform: translateX(0) !important;
        box-shadow: 16px 0 48px rgba(0, 0, 0, 0.45) !important;
    }
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.65);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 1050;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s cubic-bezier(0.2, 0, 0, 1);
    }
    .sidebar-overlay.show {
        opacity: 1;
        pointer-events: auto;
    }
    .main-content {
        margin-left: 0 !important;
        padding: 1rem 0.85rem calc(6.5rem + env(safe-area-inset-bottom, 20px)) 0.85rem !important;
    }
    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: max(env(safe-area-inset-top, 0px), 0.65rem) 1rem 0.65rem 1rem;
        background: #102a4e;
        color: #ffffff;
        position: sticky;
        top: 0;
        z-index: 1030;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    }
}

/* High-Clarity Table Header Rule (Bootstrap 5 Override) */
.table thead th {
    background-color: #1a365d !important;
    color: #ffffff !important;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    border-bottom: 2px solid #1e3a8a !important;
}

.table thead th a {
    color: #ffffff !important;
    text-decoration: none !important;
    transition: color 0.2s ease;
}

.table thead th a:hover {
    color: #93c5fd !important;
}

/* Status & Metric Badges (Manager & Marketing Components) */
.metric-badge {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.expiry-urgent { border-left: 4px solid var(--danger-border); }
.expiry-warning { border-left: 4px solid var(--warning-border); }
.expiry-ok { border-left: 4px solid var(--success-border); }

.contract-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.65rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 600;
}
.contract-badge.assigned { background: var(--success-bg); color: var(--success-text); border: 1px solid var(--success-light); }
.contract-badge.unassigned { background: var(--danger-bg); color: var(--danger-text-alt); border: 1px solid #fed7d7; }

/* Filter & Table Utilities */
.filter-card {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
    margin-bottom: 1.5rem;
    background: white;
}
.table th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}
.table td {
    vertical-align: middle;
    font-size: 0.88rem;
}
.btn-assign {
    font-size: 0.78rem;
    padding: 0.2rem 0.6rem;
    border-radius: 0.4rem;
}
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
}
.status-dot.green { background: #38c172; }
.status-dot.red { background: #e3342f; }

/* Customer Card & Contract Accordion (Marketing Module) */
.customer-card {
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease;
    margin-bottom: 1.25rem;
    overflow: visible;
    position: relative;
    background: #ffffff;
}
.customer-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px -5px rgba(0, 0, 0, 0.09), 0 4px 10px -2px rgba(0, 0, 0, 0.04);
    border-color: rgba(37, 99, 235, 0.35);
}
.customer-card:has(.dropdown-menu.show), .customer-card.dropdown-active {
    z-index: 1050;
}
.customer-header {
    background: #ffffff;
    color: #1e293b;
    padding: 1.15rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 1rem;
    border-left: 4px solid var(--primary-color, #2563eb);
    transition: background-color 0.2s ease, border-radius 0.2s ease;
}
.customer-header:hover {
    background: #f8fafc;
}
.customer-card:has(.collapse.show) .customer-header {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom: 1px solid #edf2f7;
    background: #f8fafc;
}
.customer-card .collapse .card-body {
    border-bottom-left-radius: 1rem;
    border-bottom-right-radius: 1rem;
    overflow: hidden;
    background: #ffffff;
}
.customer-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.15rem;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.12);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}
.customer-card:hover .customer-avatar {
    transform: scale(1.06);
}
.customer-header .customer-name {
    font-weight: 700;
    font-size: 1.08rem;
    color: #0f172a;
    letter-spacing: 0.1px;
}
.customer-header .badge-contract {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 2rem;
    padding: 0.28rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}
.customer-header .chevron {
    color: #94a3b8;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s;
}
.customer-header:hover .chevron {
    color: var(--primary-color, #2563eb);
}
.customer-header .collapsed .chevron, .customer-header.collapsed .chevron {
    transform: rotate(-90deg);
}

/* Dark mode overrides for customer-card */
html[data-theme="dark"] .customer-card {
    background-color: #131f33;
    border-color: rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] .customer-header {
    background: #131f33;
    color: #e2e8f0;
    border-left-color: #3b82f6;
}
html[data-theme="dark"] .customer-header:hover,
html[data-theme="dark"] .customer-card:has(.collapse.show) .customer-header {
    background: #1a2942;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] .customer-card .collapse .card-body {
    background: #131f33;
}
html[data-theme="dark"] .customer-avatar {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: #93c5fd;
    border-color: #3b82f6;
}
html[data-theme="dark"] .customer-header .customer-name {
    color: #f8fafc;
}
html[data-theme="dark"] .customer-header .badge-contract {
    background: #1e293b;
    color: #94a3b8;
    border-color: rgba(255, 255, 255, 0.1);
}

.contract-table th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.4px; }
.contract-table td { vertical-align: middle; }

.pdf-badge { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.3rem 0.75rem; border-radius: 2rem; font-size: 0.8rem; font-weight: 600; background: #ebf4ff; color: var(--secondary-color); text-decoration: none; border: 1px solid #bee3f8; }
.pdf-badge:hover { background: var(--secondary-color); color: white; }

.search-box { border-radius: 2rem; border: 2px solid var(--border-color); padding: 0.5rem 1.2rem 0.5rem 2.8rem; transition: border-color 0.2s; }
.search-box:focus { border-color: var(--secondary-color); box-shadow: none; }
.search-wrap { position: relative; }
.search-wrap .bi-search { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-state i { font-size: 3rem; margin-bottom: 1rem; display: block; }

.modal-contract-form .form-label { font-size: 0.875rem; font-weight: 600; margin-bottom: 0.3rem; }
.rate-section { background: var(--bg-light); border-radius: 0.75rem; padding: 1rem 1.25rem; margin-bottom: 1rem; }
.rate-section h6 { color: var(--secondary-color); margin-bottom: 0.75rem; font-weight: 700; }

/* PDF viewer modal */
#pdfViewerModal .modal-dialog { max-width: 900px; }
#pdfViewerModal iframe { width: 100%; height: 78vh; border: none; border-radius: 0 0 0.5rem 0.5rem; }

/* Print / PDF Export Layout (Finance Module & Universal) */
@media print {
    body * { visibility: hidden; }
    #printableArea, #printableArea * { visibility: visible; }
    #printableArea { position: absolute; left: 0; top: 0; width: 100%; }
    .no-print, .sidebar, nav, header { display: none !important; }
    .print-page-break { page-break-after: always; }
    /* Pastikan warna brand (header navy, aksen merah) tetap tercetak
       walau setting browser "background graphics" nonaktif */
    #printableArea, #printableArea * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

/* ── Print: area dokumen tetap putih bersih walau dark mode aktif ── */
@media print {
    html[data-theme="dark"] #printableArea,
    html[data-theme="dark"] #printableArea .card-body,
    html[data-theme="dark"] #printableArea .bg-light,
    html[data-theme="dark"] #printableArea .table,
    html[data-theme="dark"] #printableArea .table-light,
    html[data-theme="dark"] #printableArea .table-secondary,
    html[data-theme="dark"] #printableArea td {
        background-color: #fff !important;
    }
    html[data-theme="dark"] #printableArea thead,
    html[data-theme="dark"] #printableArea th {
        background-color: #f2f2f2 !important;
    }
    html[data-theme="dark"] #printableArea,
    html[data-theme="dark"] #printableArea .text-body,
    html[data-theme="dark"] #printableArea .text-dark,
    html[data-theme="dark"] #printableArea .text-muted,
    html[data-theme="dark"] #printableArea .text-secondary,
    html[data-theme="dark"] #printableArea th,
    html[data-theme="dark"] #printableArea td {
        color: #000 !important;
    }
    html[data-theme="dark"] #printableArea .text-primary { color: #1a365d !important; }
    html[data-theme="dark"] #printableArea .text-danger  { color: #c53030 !important; }
    html[data-theme="dark"] #printableArea .text-success { color: #276749 !important; }
    html[data-theme="dark"] #printableArea .table-striped > tbody > tr:nth-of-type(odd) {
        background-color: #f8fafc !important;
    }
}

/* Global Interactive Polish & Micro-Animations */
.btn {
    transition: var(--transition-base);
}
.btn:hover:not(:disabled) {
    transform: translateY(-0.5px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
.btn:active:not(:disabled) {
    transform: scale(0.99) translateY(0.5px);
    box-shadow: none;
}

.form-control, .form-select {
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    transition: var(--transition-base);
}
.form-control:focus, .form-select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 4px rgba(43, 108, 176, 0.15);
}

.table-hover tbody tr {
    transition: background-color 0.2s ease;
}

/* Page Header & Layout Utilities (Staff Module & Universal) */
.page-title {
    color: var(--primary-color) !important;
}
.card-border-green { border-left: 5px solid #38c172 !important; }
.card-border-orange { border-left: 5px solid #f6993f !important; }
.card-border-blue { border-left: 5px solid #3490dc !important; }
.icon-xxl { font-size: 2.5rem !important; }
.table-sm-font { font-size: 0.875rem !important; }
.max-w-720 { max-width: 720px !important; }

/* Width, Spacing & Layout Utilities (Manager & Finance Modules) */
.w-35px { width: 35px !important; }
.max-w-500px { max-width: 500px !important; }
.max-w-600px { max-width: 600px !important; }
.max-w-750px { max-width: 750px !important; }
.w-50px { width: 50px !important; }
.w-130px { width: 130px !important; }
.w-150px { width: 150px !important; }
.w-160px { width: 160px !important; }
.w-100-percent { width: 100% !important; }
.h-35px { height: 35px !important; }

/* Font Size & Letter Spacing Utilities */
.font-xs { font-size: 0.7rem !important; }
.font-sm-75 { font-size: 0.75rem !important; }
.font-sm-83 { font-size: 0.83rem !important; }
.font-sm-85 { font-size: 0.85rem !important; }
.font-lg-15 { font-size: 1.5rem !important; }
.font-xl-2 { font-size: 2rem !important; }
.font-xxl-3 { font-size: 3rem !important; }
.letter-spacing-2 { letter-spacing: 2px !important; }
.scroll-300 { max-height: 300px !important; overflow-y: auto !important; }

/* Layouts, Navigation & Sidebar Utilities */
.dropdown-indicator {
    width: auto !important;
    margin-right: 0 !important;
    font-size: 0.8rem !important;
}
.nav-separator {
    font-size: 0.65rem !important;
    letter-spacing: 1px !important;
    text-transform: uppercase !important;
}

/* Authentication & Error Page Utilities */
.auth-bg-gradient {
    background-color: var(--bg-light) !important;
}
.error-bg-gradient {
    background-color: var(--bg-light) !important;
    min-height: 100vh !important;
}
.card-radius-lg { border-radius: 1rem !important; }
.icon-primary-xxl { font-size: 3rem !important; color: var(--primary-color) !important; }
.icon-error-giant { font-size: 6rem !important; }
/* Login button — gradient CTA with real hover/press/focus states */
.btn-login {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    border-radius: 0.5rem; /* rounded-sm per DESIGN.md */
    box-shadow: var(--shadow-md);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), filter 0.2s ease;
}
.btn-login:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    filter: brightness(1.06);
}
.btn-login:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: var(--shadow-md);
    filter: brightness(0.96);
}
.btn-login:focus-visible {
    outline: 2px solid var(--secondary-600);
    outline-offset: 2px;
    box-shadow: var(--focus-ring);
}
.btn-login:disabled {
    opacity: 0.85;
    cursor: not-allowed;
}
.btn-login .spinner-border {
    width: 1rem;
    height: 1rem;
    vertical-align: -0.15em;
}

/* Password visibility toggle inside the input */
.password-toggle {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: var(--text-muted);
    padding: 0.25rem 0.4rem;
    line-height: 1;
    transition: color 0.2s ease;
    z-index: 3;
}
.password-toggle:hover { color: var(--secondary-600); }
.password-toggle:focus-visible {
    outline: 2px solid var(--secondary-600);
    outline-offset: 2px;
    border-radius: 0.375rem;
}

/* Login error alert — clean tinted surface, no fat left border */
.auth-alert {
    background: var(--danger-bg);
    color: var(--danger-text-alt);
    border-radius: 0.75rem;
    font-size: 0.88rem;
    box-shadow: var(--shadow-sm);
}
.auth-alert i { color: var(--danger-border); }

/* Login heading — brand navy in light, light-steel in dark for contrast */
.auth-heading {
    color: var(--primary-color);
    letter-spacing: -0.02em;
}
html[data-theme="dark"] .auth-heading {
    color: #e8eef5;
}

.auth-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.auth-form-control {
    border: 1px solid var(--border-color);
    font-size: 0.92rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    background-color: #ffffff;
    color: var(--text-main);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.auth-form-control:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.15);
    background-color: #ffffff;
    color: var(--text-main);
    outline: none;
}
html[data-theme="dark"] .auth-form-control {
    background-color: #16243a;
    border-color: #243856;
    color: #e8eef5;
}
html[data-theme="dark"] .auth-form-control:focus {
    background-color: #1a2c47;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
    color: #ffffff;
}

/* Floating theme toggle on the auth page (auto-bound by layout #themeToggle JS) */
button.auth-theme-toggle {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 1030;
    width: 40px;
    height: 40px;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
button.auth-theme-toggle:hover {
    background: #ffffff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

/* Assign & Customer Table Utilities */
.table-card-rounded {
    border: none !important;
    border-radius: 1rem !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07) !important;
    overflow: hidden !important;
}
.text-truncate-160 {
    max-width: 160px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}
.modal-header-primary {
    background: linear-gradient(135deg, #102a4e 0%, #1a365d 50%, #2563eb 100%) !important;
    color: #ffffff !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
}
.modal-header-dark {
    background: #102a4e !important;
    color: #ffffff !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
}

/* Explicit Bright & Crisp Typography for All Navy/Dark Modal Headers */
.modal-header-primary *,
.modal-header-dark *,
.modal-header.bg-primary *,
.modal-header.bg-dark *,
.modal-header.text-white *,
.modal-header[style*="background"] * {
    color: #ffffff !important;
}

.modal-header-primary .modal-title,
.modal-header-dark .modal-title,
.modal-header.bg-primary .modal-title,
.modal-header.bg-dark .modal-title,
.modal-header.bg-success .modal-title,
.modal-header.bg-danger .modal-title,
.modal-header.text-white .modal-title,
.modal-header[style*="background"] .modal-title {
    color: #ffffff !important;
    font-weight: 700 !important;
    letter-spacing: -0.01em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.modal-header-primary i,
.modal-header-dark i,
.modal-header.bg-primary i,
.modal-header.bg-dark i,
.modal-header.bg-success i,
.modal-header.bg-danger i,
.modal-header.text-white i,
.modal-header[style*="background"] i {
    color: #ffffff !important;
    font-size: 1.15em;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.modal-header .btn-close-white,
.modal-header-primary .btn-close,
.modal-header-dark .btn-close,
.modal-header.text-white .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%) !important;
    opacity: 0.85;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.modal-header .btn-close-white:hover,
.modal-header-primary .btn-close:hover,
.modal-header-dark .btn-close:hover,
.modal-header.text-white .btn-close:hover {
    opacity: 1;
    transform: scale(1.1);
}
.max-w-400px { max-width: 400px !important; }

/* Customer & Contract Page Utilities */
.stat-card-blue { background: linear-gradient(135deg, #ebf4ff, #bee3f8) !important; }
.stat-card-purple { background: linear-gradient(135deg, #faf5ff, #e9d8fd) !important; }
.text-purple { color: #6b46c1 !important; }
.stat-card-green { background: linear-gradient(135deg, #f0fff4, #c6f6d5) !important; }
.stat-card-orange { background: linear-gradient(135deg, #fffaf0, #feebc8) !important; }
.text-orange { color: #dd6b20 !important; }

.customer-avatar {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    background: rgba(255,255,255,0.2) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
}
.customer-meta {
    font-size: 0.78rem !important;
    opacity: 0.8 !important;
    margin-top: 2px !important;
}
.badge-contract-light {
    background: rgba(255,255,255,0.15) !important;
}
.rate-section-box {
    background: #eef2f7 !important;
    border-left: 4px solid #2b6cb0 !important;
}

/* -------------------------------------------------------------
 * Premium Dashboard UI (Bright & Clean Aesthetic)
 * ------------------------------------------------------------- */
.stat-card-premium {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    border-radius: 1.2rem;
    overflow: hidden;
    position: relative;
    z-index: 1;
}
.stat-card-premium::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(120deg, rgba(255,255,255,0) 40%, rgba(255,255,255,0.8) 100%);
    z-index: -1;
    border-radius: 1.2rem;
    pointer-events: none;
}
.stat-card-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.08);
    border-color: rgba(226, 232, 240, 1);
}

.stat-icon-wrapper {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}
.stat-card-premium:hover .stat-icon-wrapper {
    transform: scale(1.1) rotate(5deg);
}
.icon-wrap-green { background: #e6fffa; color: #319795; }
.icon-wrap-blue { background: #ebf8ff; color: #3182ce; }
.icon-wrap-orange { background: #fffaf0; color: #dd6b20; }
.icon-wrap-purple { background: #faf5ff; color: #805ad5; }
.icon-wrap-pink { background: #fff5f7; color: #d53f8c; }
.icon-wrap-teal { background: #e6fffa; color: #38b2ac; }
.icon-wrap-red { background: #fff5f5; color: #c53030; }

/* Timeline-style for expiring contracts */
.timeline-card {
    border-radius: 1rem;
    border: 1px solid rgba(0,0,0,0.04);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}
.timeline-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    transform: translateX(3px);
}
.timeline-urgent { border-left: 4px solid #e53e3e; background: linear-gradient(to right, #fff5f5, #ffffff); }
.timeline-warning { border-left: 4px solid #dd6b20; background: linear-gradient(to right, #fffaf0, #ffffff); }
.timeline-ok { border-left: 4px solid #38a169; }

/* Pulse animation for urgent items */
@keyframes softPulse {
    0% { box-shadow: 0 0 0 0 rgba(229, 62, 62, 0.4); }
    70% { box-shadow: 0 0 0 8px rgba(229, 62, 62, 0); }
    100% { box-shadow: 0 0 0 0 rgba(229, 62, 62, 0); }
}
.timeline-urgent .pulse-dot {
    width: 10px; height: 10px;
    background-color: var(--danger-border);
    border-radius: 50%;
    display: inline-block;
    animation: softPulse 2s infinite;
}

/* -------------------------------------------------------------
 * Responsive Layout Adaptations
 * ------------------------------------------------------------- */

/* Mobile overlay for sidebar */
.sidebar-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    
    .mobile-header {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        padding: 1rem;
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
        color: white;
        position: sticky;
        top: 0;
        z-index: 80;
        box-shadow: var(--shadow-sm);
    }
}

/* ============================================================
 * DEPO CSS v2 — Professional Design-System Realization
 * Full fidelity to DESIGN.md "The High-Clarity Ledger"
 * (Maritime Navy & Steel). Polish pass for dashboards & portal.
 * ============================================================ */

:root {
    /* Refined brand scale */
    --primary-900: #13233c;
    --primary-800: #16304f;
    --primary-700: #1a365d;
    --primary-600: #1f4a80;
    --secondary-600: #2b6cb0;
    --secondary-500: #4299e1;
    --accent-500: #f6ad55;
    --accent-600: #dd6b20;

    /* Type */
    --font-sans: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-mono: 'Cascadia Code', 'Consolas', 'SFMono-Regular', Menlo, monospace;

    /* Elevation (pronounced, per DESIGN.md) */
    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.07);
    --shadow-lift: 0 6px 24px rgba(0, 0, 0, 0.13);
    --shadow-modal: 0 8px 25px rgba(0, 0, 0, 0.15);
    --focus-ring: 0 0 0 4px rgba(43, 108, 176, 0.15);

    /* Chart.js theming (read at runtime) */
    --chart-grid: rgba(0, 0, 0, 0.04);
    --chart-ticks: #64748b;
    --chart-text: #475569;

    /* ------------------------------------------------------------------
     * Unified text-color scale (High-Clarity Ledger)
     * Remaps Bootstrap's text utilities so every role resolves to ONE
     * token — kills the muddy rgba(33,37,41,.75) muted gray and the
     * body/heading/secondary/muted color soup across all pages.
     *   headings  -> #16233b  (dark navy)
     *   body      -> #2d3748
     *   muted/2nd -> #64748b  (AA on white, readable at 0.7rem)
     *   links     -> #2b6cb0
     * ------------------------------------------------------------------ */
    --bs-body-color: #2d3748;
    --bs-heading-color: #16233b;
    --bs-secondary-color: #64748b;
    --bs-secondary-rgb: 100, 116, 139;
    --bs-emphasis-color: #1f2937;
    --bs-link-color: #2b6cb0;
    --bs-link-hover-color: #24598f;
}

/* ------------------------------------------------------------------
 * 1. Brand remap — Bootstrap primary becomes Maritime Navy
 * ------------------------------------------------------------------ */
.btn-primary {
    --bs-btn-bg: var(--primary-700);
    --bs-btn-border-color: var(--primary-700);
    --bs-btn-hover-bg: var(--primary-800);
    --bs-btn-hover-border-color: var(--primary-800);
    --bs-btn-active-bg: var(--primary-900);
    --bs-btn-active-border-color: var(--primary-900);
    --bs-btn-disabled-bg: var(--primary-700);
    --bs-btn-disabled-border-color: var(--primary-700);
    --bs-btn-focus-shadow-rgb: 43, 108, 176;
}
.btn-outline-primary {
    --bs-btn-color: var(--primary-700);
    --bs-btn-border-color: var(--primary-700);
    --bs-btn-hover-bg: var(--primary-700);
    --bs-btn-hover-border-color: var(--primary-700);
    --bs-btn-active-bg: var(--primary-800);
    --bs-btn-active-border-color: var(--primary-800);
    --bs-btn-focus-shadow-rgb: 43, 108, 176;
}
.text-primary { color: var(--primary-700) !important; }
.bg-primary { background-color: var(--primary-700) !important; }
.text-bg-primary { color: #fff !important; background-color: var(--primary-700) !important; }
.border-primary { border-color: var(--primary-700) !important; }
.bg-primary-subtle { background-color: #e6edf6 !important; }
.border-primary-subtle { border-color: #d3e0ef !important; }
/* Warning buttons — unify to the brand accent orange (was mixed inline #f6ad55 / Bootstrap #ffc107) */
.btn-warning {
    --bs-btn-bg: var(--accent-500);
    --bs-btn-border-color: var(--accent-500);
    --bs-btn-hover-bg: #e89b3c;
    --bs-btn-hover-border-color: #e89b3c;
    --bs-btn-active-bg: #dd8b2a;
    --bs-btn-active-border-color: #dd8b2a;
    --bs-btn-color: #3b2503;
    --bs-btn-hover-color: #3b2503;
    --bs-btn-active-color: #3b2503;
    --bs-btn-focus-shadow-rgb: 246, 173, 85;
}
.btn-outline-warning {
    --bs-btn-color: #c47a1f;
    --bs-btn-border-color: var(--accent-500);
    --bs-btn-hover-bg: var(--accent-500);
    --bs-btn-hover-border-color: var(--accent-500);
    --bs-btn-hover-color: #3b2503;
    --bs-btn-active-bg: #dd8b2a;
    --bs-btn-active-border-color: #dd8b2a;
    --bs-btn-active-color: #3b2503;
    --bs-btn-focus-shadow-rgb: 246, 173, 85;
}

/* ------------------------------------------------------------------
 * Status badges — theme-aware invoice/payment state pills
 * (light values identical to previous inline pastel styles)
 * ------------------------------------------------------------------ */
.badge-status {
    border-radius: 2rem !important;
    letter-spacing: 0.02em;
}
.badge-status.paid {
    background-color: #d1fae5;
    color: #065f46;
}
.badge-status.cancelled {
    background-color: #f1f5f9;
    color: #64748b;
}
.badge-status.unpaid {
    background-color: #fef3c7;
    color: #92400e;
}

/* ------------------------------------------------------------------
 * Marketing portal-credentials alert & access button (theme-aware)
 * ------------------------------------------------------------------ */
.alert-portal-creds {
    background-color: #ebf8ff;
    border: 0;
    border-left: 5px solid #1a365d;
    color: #1a365d;
}
.btn-portal-access {
    background-color: #ffffff;
    color: #1a365d;
    border: 1px solid #e2e8f0;
    transition: var(--transition-base);
}
.btn-portal-access:hover {
    background-color: #f1f5f9;
    color: #1a365d;
}

.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
    background-color: var(--primary-700) !important;
    color: #fff !important;
}
.progress-bar { background-color: var(--primary-700); }
.form-check-input:checked {
    background-color: var(--primary-700);
    border-color: var(--primary-700);
}
.dropdown-item.active, .dropdown-item:active {
    background-color: var(--primary-700);
}
.pagination {
    --bs-pagination-color: var(--primary-700);
    --bs-pagination-hover-color: var(--primary-700);
    --bs-pagination-hover-bg: #f1f5f9;
    --bs-pagination-active-bg: var(--primary-700);
    --bs-pagination-active-border-color: var(--primary-700);
    --bs-pagination-focus-box-shadow: var(--focus-ring);
    --bs-pagination-border-radius: 0.5rem;
    --bs-pagination-font-size: 0.85rem;
}
a { color: var(--secondary-600); }
a:hover { color: var(--primary-800); }
.btn-link { color: var(--secondary-600); }

/* ------------------------------------------------------------------
 * 2. Typography — high-clarity ledger reading
 * ------------------------------------------------------------------ */
body {
    font-family: var(--font-sans);
    font-size: 0.88rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
}
.font-mono {
    font-family: var(--font-mono) !important;
    font-variant-numeric: tabular-nums;
}
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    letter-spacing: -0.015em;
}
.page-title {
    letter-spacing: -0.02em;
}
.stat-card-premium h4,
.stat-card-premium h3,
.stat-card-premium .stat-number {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}
.stat-label {
    letter-spacing: 0.06em;
}

/* ------------------------------------------------------------------
 * 3. Buttons & controls
 * ------------------------------------------------------------------ */
.btn {
    --bs-btn-border-radius: 0.5rem;
}
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.nav-link:focus-visible,
a:focus-visible,
.page-link:focus-visible {
    outline: 2px solid var(--secondary-600);
    outline-offset: 2px;
}
.form-control:focus, .form-select:focus {
    border-color: var(--secondary-600);
    box-shadow: var(--focus-ring);
}

/* ------------------------------------------------------------------
 * 4. Cards & elevation
 * ------------------------------------------------------------------ */
.card {
    border-radius: var(--radius-md);
}
.stat-card-premium {
    border-radius: 1.25rem;
    border: 1px solid rgba(226, 232, 240, 0.55);
}

/* Metric-card top accents (subtle, functional color coding) */
.stat-accent { position: relative; overflow: hidden; }
.stat-accent::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-700), var(--secondary-500));
    z-index: 2;
}
.stat-accent-blue::after   { background: linear-gradient(90deg, #2b6cb0, #63b3ed); }
.stat-accent-green::after  { background: linear-gradient(90deg, #2f855a, #68d391); }
.stat-accent-orange::after { background: linear-gradient(90deg, #dd6b20, #f6ad55); }
.stat-accent-red::after    { background: linear-gradient(90deg, #c53030, #fc8181); }
.stat-accent-teal::after   { background: linear-gradient(90deg, #2c7a7b, #4fd1c5); }

.stat-detail {
    border-top: 1px solid #eef2f7;
    padding-top: 0.6rem;
    margin-top: 0.6rem;
    font-size: 0.75rem;
}

/* ------------------------------------------------------------------
 * 5. Tables — high-clarity header rule
 * ------------------------------------------------------------------ */
.table {
    --bs-table-border-color: #eef2f7;
}
.table thead th {
    background-color: var(--primary-700) !important;
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    border-bottom: none !important;
    white-space: nowrap;
}
.table-hover tbody tr {
    transition: background-color 0.15s ease;
}
.table-hover > tbody > tr:hover > * {
    background-color: #f6f9fc !important;
}
.table > :not(caption) > * > * {
    box-shadow: inset 0 -1px 0 rgba(226, 232, 240, 0.7);
}
.table > :not(caption) > * > *:first-child { border-top-left-radius: 0; }

/* ------------------------------------------------------------------
 * 6. Badges — refined & restrained
 * ------------------------------------------------------------------ */
.badge {
    font-weight: 600;
    letter-spacing: 0.02em;
    border-radius: 0.375rem;
}

/* ------------------------------------------------------------------
 * 7. Progress — rounded rail
 * ------------------------------------------------------------------ */
.progress {
    border-radius: 999px;
    background-color: #edf2f7;
}
.progress-bar {
    border-radius: 999px;
}

/* ------------------------------------------------------------------
 * 8. Top navbar (manager & customer portal)
 * ------------------------------------------------------------------ */
.customer-navbar {
    background: rgba(255, 255, 255, 0.94);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 0 rgba(26, 54, 93, 0.02), 0 4px 20px rgba(26, 54, 93, 0.05);
}
.customer-navbar-inner {
    padding: 0.75rem 2rem;
}
.brand-logo {
    height: 40px;
    width: auto;
}
.brand-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, var(--primary-700), var(--secondary-600));
    box-shadow: 0 2px 6px rgba(26, 54, 93, 0.25);
    color: #fff;
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}
.brand-title {
    font-weight: 700;
    color: var(--primary-700);
    letter-spacing: 0.02em;
    line-height: 1.1;
}
.brand-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.01em;
}
.user-chip {
    background: #f4f7fb;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.user-chip:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 6px rgba(26, 54, 93, 0.06);
}
.user-chip-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-700), var(--secondary-600));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}


/* ------------------------------------------------------------------
 * 10. Portal segmented tabs (customer dashboard)
 * ------------------------------------------------------------------ */
.contract-meta-box {
    background: #f4f7fb;
    border: 1px solid #eef2f7;
    border-radius: 0.5rem;
}

.portal-tabs .nav-link {
    color: var(--text-muted);
    background-color: transparent;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    font-weight: 600;
    padding: 0.55rem 1rem;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.portal-tabs .nav-link:hover {
    background-color: #f1f5f9;
    color: var(--primary-700);
}
.portal-tabs .nav-link.active {
    color: #fff !important;
    background-color: var(--primary-700) !important;
    border-color: var(--primary-700) !important;
    box-shadow: 0 2px 8px rgba(26, 54, 93, 0.22);
}

/* ------------------------------------------------------------------
 * 11. Manager period slicer pills
 * ------------------------------------------------------------------ */
.period-pills {
    background: #f3f6fa;
    border: 1px solid #e8edf3;
    border-radius: 0.6rem;
    padding: 0.22rem;
}
.period-pills .period-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.78rem;
    padding: 0.42rem 0.85rem;
    border-radius: 0.45rem;
    transition: color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.period-pills .period-btn:hover { color: var(--primary-700); background: rgba(255, 255, 255, 0.8); }
.period-pills .period-btn.active {
    background: var(--primary-700);
    color: #fff;
    box-shadow: 0 1px 4px rgba(26, 54, 93, 0.3);
}
.period-date-badge {
    background: #eef2f8;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    color: var(--primary-700);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 600;
}

/* ------------------------------------------------------------------
 * 12. Activity feed (manager dashboard)
 * ------------------------------------------------------------------ */
.feed-item {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.8rem 0.9rem;
    border-radius: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.18s ease;
}
.feed-item:last-child { border-bottom: none; }
.feed-item:hover { background-color: #f8fafc; }
.feed-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ------------------------------------------------------------------
 * 13. Leaderboard rank badges
 * ------------------------------------------------------------------ */
.rank-badge {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
}
.rank-gold   { background: #f6ad55; color: #7c3a12; box-shadow: inset 0 0 0 1px rgba(124, 58, 18, 0.25); }
.rank-silver { background: #cbd5e1; color: #334155; box-shadow: inset 0 0 0 1px rgba(51, 65, 85, 0.2); }
.rank-bronze { background: #b87333; color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25); }

/* ------------------------------------------------------------------
 * 14. Empty states
 * ------------------------------------------------------------------ */
.empty-state {
    text-align: center;
    padding: 3.5rem 1.5rem;
    color: var(--text-muted);
}
.empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 1rem;
    background: #eef2f7;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 1rem;
}

/* ------------------------------------------------------------------
 * 15. Global scrollbars — quiet & theme-aligned
 * ------------------------------------------------------------------ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 5px;
    border: 2px solid var(--bg-light);
}
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ============================================================
 * DEPO CSS v2 — Dark Mode (opt-in, html[data-theme="dark"])
 * "The High-Clarity Ledger" night reading: Maritime Navy
 * & Steel over deep-harbor surfaces. Light mode untouched.
 * ============================================================ */

/* Theme toggle button */
.theme-toggle {
    background: transparent;
    border: 1px solid #dce3ec;
    color: var(--primary-700);
    transition: var(--transition-base);
}
.theme-toggle:hover {
    background: #f1f5f9;
    color: var(--primary-800);
    transform: translateY(-1px);
}
.theme-toggle i { line-height: 1; }

html[data-theme="dark"] {
    color-scheme: dark;

    /* Bootstrap core remap */
    --bs-body-bg: #0b1424;
    --bs-body-color: #cbd5e1;
    --bs-secondary-color: #94a3b8;
    --bs-tertiary-color: #64748b;
    --bs-emphasis-color: #e2e8f0;
    --bs-heading-color: #e8eef5;
    --bs-secondary-rgb: 148, 163, 184;
    --bs-border-color: #26364f;
    --bs-secondary-bg: #131f33;
    --bs-tertiary-bg: #0f1a2c;
    --bs-card-bg: #131f33;
    --bs-card-border-color: rgba(255, 255, 255, 0.08);
    --bs-link-color: #7db4e6;
    --bs-link-hover-color: #93c5fd;

    /* Subtle badge palette (dark-tinted) */
    --bs-primary-bg-subtle: #14283f;
    --bs-primary-border-subtle: #2b5385;
    --bs-success-bg-subtle: #0f2a1e;
    --bs-success-border-subtle: #1f6b4c;
    --bs-info-bg-subtle: #0d2a3c;
    --bs-info-border-subtle: #1e5879;
    --bs-warning-bg-subtle: #2d2410;
    --bs-warning-border-subtle: #7a5a1e;
    --bs-danger-bg-subtle: #351424;
    --bs-danger-border-subtle: #8f2d52;
    /* Emphasis text colors (drives .alert-*, .text-*-emphasis) — fixes dark-on-dark alerts */
    --bs-primary-text-emphasis: #8ab6e8;
    --bs-success-text-emphasis: #6fd39e;
    --bs-info-text-emphasis: #8ec9f0;
    --bs-warning-text-emphasis: #f2c46e;
    --bs-danger-text-emphasis: #fda4af;
    --bs-secondary-text-emphasis: #cbd5e1;

    /* Design tokens (night) */
    --bg-light: #0b1424;
    --text-main: #d7dfe9;
    --text-muted: #94a3b8;
    --border-color: #26364f;
    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.35);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.5);

    /* Chart.js theming */
    --chart-grid: rgba(255, 255, 255, 0.06);
    --chart-ticks: #94a3b8;
    --chart-text: #cbd5e1;

    --success-light: #123d2b;
    --success-text: #6fd39e;
    --info-light: #123247;
    --info-text: #8ec9f0;
    --warning-light: #3a2d14;
    --warning-text: #f2c46e;
    --danger-light: #44203a;
    --danger-text: #f3a5c1;
    --purple-light: #2c2350;
    --purple-text: #c4b5fd;
    --teal-light: #12383a;
    --teal-text: #5eead4;
    --dark-light: #1a2b45;
    --danger-bg: #2c1420;
    --danger-text-alt: #fda4af;
}

html[data-theme="dark"] body {
    background-color: var(--bg-light);
    color: var(--text-main);
}
html[data-theme="dark"] a { color: #7db4e6; }
html[data-theme="dark"] a:hover { color: #93c5fd; }

/* Surfaces */
html[data-theme="dark"] .bg-white { background-color: #131f33 !important; }
html[data-theme="dark"] .bg-light { background-color: #16233b !important; }
html[data-theme="dark"] .bg-light-subtle { background-color: #16233b !important; }
html[data-theme="dark"] .bg-secondary-subtle { background-color: #1c2b44 !important; }
html[data-theme="dark"] .bg-primary-subtle { background-color: #14283f !important; }
html[data-theme="dark"] .border-primary-subtle { border-color: #2b5385 !important; }
/* Icon tiles that had hardcoded light pastel values */
html[data-theme="dark"] .icon-wrap-green,
html[data-theme="dark"] .icon-wrap-teal { background: #12383a; color: #5eead4; }
html[data-theme="dark"] .icon-wrap-blue { background: #123247; color: #8ec9f0; }
html[data-theme="dark"] .icon-wrap-orange { background: #3a2d14; color: #f2c46e; }
html[data-theme="dark"] .icon-wrap-purple { background: #2c2350; color: #c4b5fd; }
html[data-theme="dark"] .icon-wrap-pink,
html[data-theme="dark"] .icon-wrap-red { background: #44203a; color: #f3a5c1; }
/* Light table variants & list groups (calendar, recent tables, modals) */
html[data-theme="dark"] .table-light,
html[data-theme="dark"] .table-secondary {
    --bs-table-bg: #16233b;
    --bs-table-color: #cbd5e1;
    --bs-table-border-color: rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] .table-striped {
    --bs-table-striped-bg: rgba(255, 255, 255, 0.035);
}
html[data-theme="dark"] .list-group-item {
    background-color: #0f1a2c;
    color: #cbd5e1;
    border-color: rgba(255, 255, 255, 0.08);
}
/* Info buttons — deeper cyan so white labels stay readable */
html[data-theme="dark"] .btn-info {
    --bs-btn-bg: #1e5879;
    --bs-btn-border-color: #1e5879;
    --bs-btn-hover-bg: #1a4d6b;
    --bs-btn-hover-border-color: #1a4d6b;
    --bs-btn-active-bg: #17435e;
    --bs-btn-active-border-color: #17435e;
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-color: #fff;
    --bs-btn-focus-shadow-rgb: 30, 88, 121;
}
html[data-theme="dark"] .card,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .filter-card,
html[data-theme="dark"] .customer-card,
html[data-theme="dark"] .stat-card-premium,
html[data-theme="dark"] .table-card-rounded {
    background-color: #131f33;
    border-color: rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] .stat-card-premium {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
}
html[data-theme="dark"] .stat-card-premium::before {
    background: linear-gradient(120deg, rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, 0.05) 100%);
}
html[data-theme="dark"] .stat-card-premium:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
}

/* Text tone */
html[data-theme="dark"] .text-dark { color: #e2e8f0 !important; }
/* Keep solid warning/info backgrounds readable behind light text (bg-* text-dark badges) */
html[data-theme="dark"] .bg-warning { background-color: #8a6d1f !important; }
html[data-theme="dark"] .bg-info { background-color: #1e5879 !important; }
html[data-theme="dark"] .text-primary { color: #8ab6e8 !important; }
html[data-theme="dark"] .text-success { color: #6fd39e !important; }
html[data-theme="dark"] .text-info { color: #8ec9f0 !important; }
html[data-theme="dark"] .text-warning { color: #f2c46e !important; }
html[data-theme="dark"] .text-danger { color: #fda4af !important; }
html[data-theme="dark"] .page-title { color: #8ab6e8 !important; }
html[data-theme="dark"] .icon-primary-xxl { color: #8ab6e8 !important; }
html[data-theme="dark"] .stat-card .stat-number { color: #8ab6e8; }
html[data-theme="dark"] .stat-detail { border-top-color: rgba(255, 255, 255, 0.08); }

/* Buttons */
html[data-theme="dark"] .btn-outline-primary {
    --bs-btn-color: #8ab6e8;
    --bs-btn-border-color: #3b6ea5;
    --bs-btn-hover-bg: #24517f;
    --bs-btn-hover-border-color: #4a7fb8;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #2b5385;
    --bs-btn-active-border-color: #4a7fb8;
    --bs-btn-active-color: #fff;
}
html[data-theme="dark"] .btn-outline-secondary {
    --bs-btn-color: #cbd5e1;
    --bs-btn-border-color: #3b4b66;
    --bs-btn-hover-bg: #1a2b45;
    --bs-btn-hover-border-color: #4b5f80;
    --bs-btn-hover-color: #fff;
}
html[data-theme="dark"] .btn-outline-warning {
    --bs-btn-color: #f2c46e;
    --bs-btn-border-color: #7a5a1e;
    --bs-btn-hover-bg: #8a6d1f;
    --bs-btn-hover-border-color: #8a6d1f;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #8a6d1f;
    --bs-btn-active-border-color: #8a6d1f;
    --bs-btn-active-color: #fff;
}
/* Selected pill pops against inactive pills in dark (both are navy) */
html[data-theme="dark"] .nav-pills .nav-link.active {
    box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.55);
}
html[data-theme="dark"] .btn-close { filter: invert(1) grayscale(0.2); }
/* Light buttons — tint to navy surfaces in dark (Edit/Kontrak/Delete on customer cards, etc.) */
html[data-theme="dark"] .btn-light {
    --bs-btn-bg: #1a2b45;
    --bs-btn-border-color: #2a3c58;
    --bs-btn-color: #cbd5e1;
    --bs-btn-hover-bg: #24517f;
    --bs-btn-hover-border-color: #3b5380;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #16304f;
    --bs-btn-active-border-color: #3b5380;
    --bs-btn-active-color: #fff;
}
/* Finance invoice tabs (custom-inv-tabs lives in blade <style>, needs !important parity) */
html[data-theme="dark"] .custom-inv-tabs .nav-link {
    color: #94a3b8;
}
html[data-theme="dark"] .custom-inv-tabs .nav-link:hover {
    color: #8ab6e8;
    border-bottom-color: #3b5380;
}
html[data-theme="dark"] .custom-inv-tabs .nav-link.active {
    color: #8ab6e8 !important;
    border-bottom-color: #4299e1 !important;
}
html[data-theme="dark"] .theme-toggle {
    border-color: #2a3c58;
    color: #f6ad55;
}
html[data-theme="dark"] .theme-toggle:hover {
    background: #1a2b45;
    color: #f6c877;
}

/* Navbar (customer & manager top bar) */
html[data-theme="dark"] .customer-navbar {
    background: rgba(11, 20, 36, 0.92);
    border-bottom: 1px solid #24344d;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02), 0 4px 20px rgba(0, 0, 0, 0.35);
}
html[data-theme="dark"] .brand-title { color: #e8eef5; }
html[data-theme="dark"] .brand-subtitle { color: #94a3b8; }
html[data-theme="dark"] .user-chip {
    background: #16233b;
    border-color: #2a3c58;
}
html[data-theme="dark"] .user-chip:hover {
    border-color: #3b5380;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

/* Tables */
html[data-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-color: #cbd5e1;
    --bs-table-border-color: rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] .table-hover > tbody > tr:hover > * {
    background-color: rgba(255, 255, 255, 0.05) !important;
}
html[data-theme="dark"] .table > :not(caption) > * > * {
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.06);
}

/* Forms, dropdowns, modals */
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select {
    background-color: #0f1a2c;
    border-color: #2a3c58;
    color: #d7dfe9;
}
html[data-theme="dark"] .form-control::placeholder { color: #64748b; }
html[data-theme="dark"] .dropdown-menu {
    background-color: #131f33;
    border-color: #2a3c58;
}
html[data-theme="dark"] .dropdown-item { color: #cbd5e1; }
html[data-theme="dark"] .dropdown-item:hover, html[data-theme="dark"] .dropdown-item:focus {
    background-color: #1a2b45;
    color: #fff;
}
html[data-theme="dark"] .modal-content {
    background-color: #131f33;
    border-color: rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] .modal-header { border-bottom-color: rgba(255, 255, 255, 0.08); }
html[data-theme="dark"] .modal-footer { border-top-color: rgba(255, 255, 255, 0.08); }
html[data-theme="dark"] .modal-body::-webkit-scrollbar-track,
html[data-theme="dark"] .modal::-webkit-scrollbar-track {
    background: #0f1a2c;
}
html[data-theme="dark"] .modal-body::-webkit-scrollbar-thumb,
html[data-theme="dark"] .modal::-webkit-scrollbar-thumb {
    background: #33415e;
}
html[data-theme="dark"] .modal-body::-webkit-scrollbar-thumb:hover,
html[data-theme="dark"] .modal::-webkit-scrollbar-thumb:hover {
    background: #46536f;
}

/* Pagination */
html[data-theme="dark"] .pagination {
    --bs-pagination-bg: #131f33;
    --bs-pagination-border-color: #2a3c58;
    --bs-pagination-color: #8ab6e8;
    --bs-pagination-hover-color: #8ab6e8;
    --bs-pagination-hover-bg: #1a2b45;
    --bs-pagination-hover-border-color: #3b4b66;
    --bs-pagination-active-bg: #24517f;
    --bs-pagination-active-border-color: #2b5385;
}

/* Progress, pills, feeds, timeline, empty states */
html[data-theme="dark"] .progress { background-color: #1a2b45; }
html[data-theme="dark"] .portal-tabs .nav-link:hover {
    background-color: #1a2b45;
    color: #8ab6e8;
}
html[data-theme="dark"] .contract-meta-box {
    background: #16233b;
    border-color: #24344d;
}
html[data-theme="dark"] .period-pills {
    background: #131f33;
    border-color: #24344d;
}
html[data-theme="dark"] .period-pills .period-btn:hover {
    color: #8ab6e8;
    background: rgba(255, 255, 255, 0.06);
}
html[data-theme="dark"] .period-date-badge {
    background: #16233b;
    border-color: #2a3c58;
    color: #8ab6e8;
}
html[data-theme="dark"] .feed-item { border-bottom-color: rgba(255, 255, 255, 0.06); }
html[data-theme="dark"] .feed-item:hover { background-color: rgba(255, 255, 255, 0.04); }
html[data-theme="dark"] .timeline-card { border-color: rgba(255, 255, 255, 0.06); }
html[data-theme="dark"] .timeline-urgent {
    background: linear-gradient(to right, #351f22, #131f33);
}
html[data-theme="dark"] .timeline-warning {
    background: linear-gradient(to right, #2e2416, #131f33);
}
html[data-theme="dark"] .empty-state { color: #94a3b8; }
html[data-theme="dark"] .empty-icon {
    background: #1a2b45;
    color: #64748b;
}
html[data-theme="dark"] .search-box {
    background-color: #0f1a2c;
    color: #d7dfe9;
}
html[data-theme="dark"] .pdf-badge {
    background: #14283f;
    color: #8ab6e8;
    border-color: #2b5385;
}
html[data-theme="dark"] .rate-section { background: #0f1a2c; }
html[data-theme="dark"] .rate-section-box {
    background: #16233b;
    border-left-color: #4299e1;
}
/* Auth page — dark refinements */
html[data-theme="dark"] .btn-login {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}
html[data-theme="dark"] .btn-login:hover:not(:disabled) {
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5);
}
html[data-theme="dark"] .password-toggle {
    color: #94a3b8;
}
html[data-theme="dark"] .password-toggle:hover {
    color: #8ab6e8;
}
html[data-theme="dark"] .auth-alert {
    background: var(--danger-bg);
    color: var(--danger-text-alt);
}
html[data-theme="dark"] .auth-alert i { color: #fda4af; }
html[data-theme="dark"] .auth-theme-toggle {
    background: rgba(19, 31, 51, 0.9);
    border-color: #2a3c58;
    color: #f6ad55;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}
html[data-theme="dark"] .auth-theme-toggle:hover {
    background: #1a2b45;
    color: #f6c877;
}

/* Error pages — split-screen shell (views/errors/layout.blade.php) */
.error-layout-body {
    background-color: var(--bg-light);
}
.error-icon {
    width: 88px;
    height: 88px;
    border-radius: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}
.error-code {
    font-size: clamp(3rem, 8vw, 4.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}
.error-message {
    color: var(--text-muted);
    max-width: 46ch;
    font-size: 1rem;
}
.btn-error-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    transition: var(--transition-base);
}
.btn-error-secondary:hover:not(:disabled) {
    background: #f1f5f9;
    border-color: #d3dce6;
    color: var(--primary-800);
    transform: translateY(-1px);
}
.btn-error-secondary:focus-visible {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

html[data-theme="dark"] .error-layout-body {
    background-color: #0b1424;
}
html[data-theme="dark"] .error-code {
    color: #8ab6e8;
}
html[data-theme="dark"] .error-message {
    color: #94a3b8;
}
html[data-theme="dark"] .btn-error-secondary {
    border-color: #2a3c58;
    color: #cbd5e1;
}
html[data-theme="dark"] .btn-error-secondary:hover:not(:disabled) {
    background: #16233b;
    border-color: #33415e;
    color: #e8eef5;
}

/* Scrollbars */
html[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #33415e;
    border-color: var(--bg-light);
}
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #46536f; }

/* Status badges — dark tinted, readable on navy surfaces */
html[data-theme="dark"] .badge-status.paid {
    background-color: #0f2a1e;
    color: #6fd39e;
}
html[data-theme="dark"] .badge-status.cancelled {
    background-color: #1c2b44;
    color: #cbd5e1;
}
html[data-theme="dark"] .badge-status.unpaid {
    background-color: #2d2410;
    color: #f2c46e;
}

/* Marketing portal-credentials alert & access button (night) */
html[data-theme="dark"] .alert-portal-creds {
    background-color: #14283f;
    border-left-color: #4299e1;
    color: #8ab6e8;
}
html[data-theme="dark"] .btn-portal-access {
    background-color: #16233b;
    color: #8ab6e8;
    border-color: #2a3c58;
}
html[data-theme="dark"] .btn-portal-access:hover {
    background-color: #1a2b45;
    color: #93c5fd;
}

/* Marketing stat-card pastel gradients — tinted for dark */
html[data-theme="dark"] .stat-card-blue { background: linear-gradient(135deg, #10233f, #16304f) !important; }
html[data-theme="dark"] .stat-card-purple { background: linear-gradient(135deg, #221b3d, #2c2350) !important; }
html[data-theme="dark"] .stat-card-green { background: linear-gradient(135deg, #0f241b, #123d2b) !important; }
html[data-theme="dark"] .stat-card-orange { background: linear-gradient(135deg, #2a2113, #3a2d14) !important; }
html[data-theme="dark"] .text-purple { color: #c4b5fd !important; }
html[data-theme="dark"] .text-orange { color: #f2c46e !important; }

/* Select2 (bootstrap-5 theme) — white popups were burning in dark */
html[data-theme="dark"] .select2-container--bootstrap-5 .select2-selection {
    background-color: #0f1a2c;
    border-color: #2a3c58;
}
html[data-theme="dark"] .select2-container--bootstrap-5.select2-container--focus .select2-selection,
html[data-theme="dark"] .select2-container--bootstrap-5.select2-container--open .select2-selection {
    border-color: #4299e1;
    box-shadow: 0 0 0 4px rgba(43, 108, 176, 0.2);
}
html[data-theme="dark"] .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    color: #d7dfe9;
}
html[data-theme="dark"] .select2-container--bootstrap-5 .select2-selection--single .select2-selection__placeholder {
    color: #64748b;
}
html[data-theme="dark"] .select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow b {
    border-color: #94a3b8 transparent transparent;
}
html[data-theme="dark"] .select2-container--bootstrap-5 .select2-dropdown {
    background-color: #131f33;
    border-color: #2a3c58;
}
html[data-theme="dark"] .select2-container--bootstrap-5 .select2-results__option {
    color: #cbd5e1;
}
html[data-theme="dark"] .select2-container--bootstrap-5 .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: #24517f;
    color: #fff;
}
html[data-theme="dark"] .select2-container--bootstrap-5 .select2-search__field {
    background-color: #0f1a2c;
    color: #d7dfe9;
    border-color: #2a3c58;
}
html[data-theme="dark"] .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice {
    background-color: #1a2b45;
    color: #cbd5e1;
    border-color: #2a3c58;
}
html[data-theme="dark"] .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice__remove {
    color: #8ab6e8;
}

/* ── Tooltips — theme-aware (Bootstrap 5 append tooltip ke <body>, override vars biar ikut dark mode) ── */
html[data-theme="dark"] .tooltip {
    --bs-tooltip-bg: #1c2b44;
    --bs-tooltip-color: #e8eef5;
    --bs-tooltip-opacity: 1;
    --bs-tooltip-arrow-color: #1c2b44;
    --bs-tooltip-border-radius: 0.5rem;
}
.tooltip-inner {
    text-align: left;
    font-size: 0.78rem;
    line-height: 1.5;
    padding: 0.5rem 0.75rem;
}

/* ── Sidebar Dark Mode Overrides ── */
html[data-theme="dark"] .sidebar {
    background: linear-gradient(180deg, #091322 0%, #0f1d33 50%, #0c1729 100%);
    border-right: 1px solid #1e293b;
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.4);
}
html[data-theme="dark"] .sidebar-brand {
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
html[data-theme="dark"] .sidebar-user {
    background: rgba(5, 10, 20, 0.85);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
html[data-theme="dark"] .sidebar .nav-link.active {
    background: rgba(59, 130, 246, 0.18);
    box-shadow: inset 3px 0 0 #3b82f6, 0 2px 10px rgba(0, 0, 0, 0.3);
}
html[data-theme="dark"] .mobile-header {
    background: #091322;
    border-bottom: 1px solid #1e293b;
}

/* ── The High-Clarity Ledger: Operational Dashboard & Table Utilities ── */
.table-ledger {
    margin-bottom: 0;
}
.table-ledger thead th {
    background-color: #1a365d;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.65rem 0.85rem;
    border: none;
    white-space: nowrap;
}
html[data-theme="dark"] .table-ledger thead th {
    background-color: #0f2444;
    color: #cbd5e1;
    border-bottom: 1px solid #1e293b;
}
.table-ledger tbody td {
    padding: 0.65rem 0.85rem;
    font-size: 0.84rem;
    vertical-align: middle;
    font-variant-numeric: tabular-nums;
}

.stat-icon-depo {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: transform 0.2s ease;
}
.stat-card-premium:hover .stat-icon-depo {
    transform: scale(1.08);
}

.quick-action-bar {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}
html[data-theme="dark"] .quick-action-bar {
    background: #131f33;
    border-color: #1e293b;
}

.progress-depo-track {
    height: 7px;
    background-color: #edf2f7;
    border-radius: 4px;
    overflow: hidden;
}
html[data-theme="dark"] .progress-depo-track {
    background-color: #1e293b;
}

.occupancy-badge-critical {
    background-color: #fff5f5;
    color: #c53030;
    border: 1px solid #feb2b2;
}
.occupancy-badge-warning {
    background-color: #fffaf0;
    color: #c05621;
    border: 1px solid #fbd38d;
}
.occupancy-badge-normal {
    background-color: #f0fff4;
    color: #276749;
    border: 1px solid #9ae6b4;
}
html[data-theme="dark"] .occupancy-badge-critical {
    background-color: rgba(229, 62, 62, 0.15);
    color: #fc8181;
    border-color: rgba(229, 62, 62, 0.3);
}
html[data-theme="dark"] .occupancy-badge-warning {
    background-color: rgba(221, 107, 32, 0.15);
    color: #fbd38d;
    border-color: rgba(221, 107, 32, 0.3);
}
html[data-theme="dark"] .occupancy-badge-normal {
    background-color: rgba(56, 161, 105, 0.15);
    color: #68d391;
    border-color: rgba(56, 161, 105, 0.3);
}

/* ------------------------------------------------------------------
 * Ledger Action Buttons & Table Action Cluster
 * ------------------------------------------------------------------ */
.table-action-cluster {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: nowrap;
    justify-content: center;
}

.table-action-cluster .btn {
    font-size: 0.8125rem;
    padding: 0.32rem 0.65rem;
    border-radius: 0.375rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    line-height: 1.35;
}

.table-action-cluster .btn-group > .btn {
    padding: 0.32rem 0.65rem;
}

/* ------------------------------------------------------------------
 * Finance Dashboard & Master Calendar Polish
 * ------------------------------------------------------------------ */
.stat-label {
    letter-spacing: 0.035em;
    font-size: 0.775rem;
}

.master-cal-day {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: var(--bs-card-bg, #ffffff);
}

.master-cal-day:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: #3b82f6 !important;
}

html[data-theme="dark"] .master-cal-day {
    background-color: #131f33;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

html[data-theme="dark"] .master-cal-day.bg-white {
    background-color: #131f33 !important;
}

html[data-theme="dark"] .master-cal-day.bg-primary-subtle {
    background-color: #14283f !important;
    border-color: #3b82f6 !important;
}

/* ------------------------------------------------------------------
 * Dark Card Headers High-Contrast Text & Icon Enforcement
 * ------------------------------------------------------------------ */
.card-header.bg-dark,
.card-header.text-white,
.card-header[style*="background-color: #1a365d"],
.card-header[style*="background-color:#1a365d"] {
    color: #ffffff !important;
}

.card-header.bg-dark h1,
.card-header.bg-dark h2,
.card-header.bg-dark h3,
.card-header.bg-dark h4,
.card-header.bg-dark h5,
.card-header.bg-dark h6,
.card-header.bg-dark span,
.card-header.bg-dark i,
.card-header.text-white h1,
.card-header.text-white h2,
.card-header.text-white h3,
.card-header.text-white h4,
.card-header.text-white h5,
.card-header.text-white h6,
.card-header.text-white span,
.card-header.text-white i,
.card-header[style*="background-color: #1a365d"] h1,
.card-header[style*="background-color: #1a365d"] h2,
.card-header[style*="background-color: #1a365d"] h3,
.card-header[style*="background-color: #1a365d"] h4,
.card-header[style*="background-color: #1a365d"] h5,
.card-header[style*="background-color: #1a365d"] h6,
.card-header[style*="background-color: #1a365d"] span,
.card-header[style*="background-color: #1a365d"] i,
.card-header[style*="background-color:#1a365d"] h1,
.card-header[style*="background-color:#1a365d"] h2,
.card-header[style*="background-color:#1a365d"] h3,
.card-header[style*="background-color:#1a365d"] h4,
.card-header[style*="background-color:#1a365d"] h5,
.card-header[style*="background-color:#1a365d"] h6,
.card-header[style*="background-color:#1a365d"] span,
.card-header[style*="background-color:#1a365d"] i {
    color: #ffffff !important;
}

/* ------------------------------------------------------------------
 * Dynamic KPI & Report Cards (Finance / Storage)
 * ------------------------------------------------------------------ */
.dynamic-kpi-card {
    position: relative;
    background-color: var(--bs-card-bg, #ffffff);
    border: 1px solid rgba(226, 232, 240, 0.8) !important;
    border-radius: 1rem !important;
    padding: 1.35rem 1.5rem;
    transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    isolation: isolate;
}

.dynamic-kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--card-accent, #3b82f6);
    transition: height 0.25s ease, opacity 0.25s ease;
    z-index: 1;
}

.dynamic-kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 30px -8px var(--card-glow, rgba(59, 130, 246, 0.16)),
                0 6px 12px -4px rgba(0, 0, 0, 0.04) !important;
    border-color: var(--card-accent, #3b82f6) !important;
}

.dynamic-kpi-card:hover::before {
    height: 5px;
}

.dynamic-kpi-card .card-icon-badge {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 0.75rem;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.dynamic-kpi-card:hover .card-icon-badge {
    transform: scale(1.1) rotate(4deg);
    box-shadow: 0 6px 14px -2px var(--card-glow, rgba(59, 130, 246, 0.25));
}

.dynamic-kpi-hero {
    position: relative;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 1rem !important;
    padding: 1.35rem 1.5rem;
    color: #ffffff;
    transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    isolation: isolate;
}

.dynamic-kpi-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #38bdf8, #818cf8);
    z-index: 1;
}

.dynamic-kpi-hero::after {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.22) 0%, rgba(56, 189, 248, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.dynamic-kpi-hero:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 36px -8px rgba(30, 58, 138, 0.45),
                0 8px 16px -4px rgba(0, 0, 0, 0.2) !important;
    border-color: rgba(56, 189, 248, 0.45) !important;
}

.dynamic-kpi-hero .card-icon-badge {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 0.75rem;
    background: rgba(255, 255, 255, 0.12);
    color: #38bdf8;
    border: 1px solid rgba(255, 255, 255, 0.18);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.dynamic-kpi-hero:hover .card-icon-badge {
    transform: scale(1.1) rotate(4deg);
    box-shadow: 0 6px 16px -2px rgba(56, 189, 248, 0.4);
}

.kpi-ratio-bar {
    height: 6px;
    border-radius: 999px;
    background-color: #f1f5f9;
    overflow: hidden;
    display: flex;
}

.kpi-chip {
    font-size: 0.725rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

html[data-theme="dark"] .kpi-ratio-bar {
    background-color: #1e293b;
}

html[data-theme="dark"] .dynamic-kpi-card {
    background-color: #131f33;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

html[data-theme="dark"] .dynamic-kpi-card:hover {
    box-shadow: 0 16px 30px -8px rgba(0, 0, 0, 0.5) !important;
}

/* ==========================================================================
   ASSIGN CONTAINER KPI STAT CARDS (Dynamic & High Contrast)
   ========================================================================== */
.assign-kpi-card {
    position: relative;
    padding: 1.25rem 1rem;
    border-radius: 1rem;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
    overflow: hidden;
}

.assign-kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -4px rgba(0, 0, 0, 0.08), 0 4px 8px -2px rgba(0, 0, 0, 0.03);
}

.assign-kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--kpi-accent, #3b82f6);
    border-radius: 1rem 1rem 0 0;
}

/* Blue Card - Total Dievaluasi (High-Contrast White & Cyan on Deep Navy Gradient) */
.assign-kpi-blue {
    --kpi-accent: #38bdf8;
    background: linear-gradient(145deg, #102a4e 0%, #173b6a 55%, #1d4ed8 100%) !important;
    border-color: rgba(56, 189, 248, 0.45) !important;
    box-shadow: 0 8px 24px -4px rgba(16, 42, 78, 0.4) !important;
}
.assign-kpi-blue:hover {
    box-shadow: 0 14px 28px -4px rgba(16, 42, 78, 0.55), 0 0 15px rgba(56, 189, 248, 0.3) !important;
    border-color: rgba(56, 189, 248, 0.7) !important;
}
.assign-kpi-blue .assign-kpi-title {
    color: #7dd3fc !important;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.assign-kpi-blue .assign-kpi-number {
    color: #ffffff !important;
    font-size: 1.85rem !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}
.assign-kpi-blue .assign-kpi-sub {
    color: #e0f2fe !important;
    font-weight: 500;
}

/* Green Card - Siap Di-assign */
.assign-kpi-green {
    --kpi-accent: #16a34a;
    background: linear-gradient(145deg, #ffffff 0%, #f0fdf4 100%) !important;
    border-color: rgba(34, 197, 94, 0.35) !important;
}
.assign-kpi-green:hover {
    border-color: rgba(34, 197, 94, 0.6) !important;
    box-shadow: 0 12px 24px -4px rgba(22, 163, 74, 0.15) !important;
}
.assign-kpi-green .assign-kpi-title {
    color: #15803d !important;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.assign-kpi-green .assign-kpi-number {
    color: #16a34a !important;
    font-size: 1.85rem !important;
}
.assign-kpi-green .assign-kpi-sub {
    color: #475569 !important;
    font-weight: 500;
}

/* Amber Card - Tanpa Kontrak */
.assign-kpi-amber {
    --kpi-accent: #d97706;
    background: linear-gradient(145deg, #ffffff 0%, #fffbeb 100%) !important;
    border-color: rgba(245, 158, 11, 0.35) !important;
}
.assign-kpi-amber:hover {
    border-color: rgba(245, 158, 11, 0.6) !important;
    box-shadow: 0 12px 24px -4px rgba(217, 119, 6, 0.15) !important;
}
.assign-kpi-amber .assign-kpi-title {
    color: #b45309 !important;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.assign-kpi-amber .assign-kpi-number {
    color: #d97706 !important;
    font-size: 1.85rem !important;
}
.assign-kpi-amber .assign-kpi-sub {
    color: #475569 !important;
    font-weight: 500;
}

/* Slate Card - Sudah Sesuai */
.assign-kpi-slate {
    --kpi-accent: #64748b;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%) !important;
    border-color: rgba(148, 163, 184, 0.35) !important;
}
.assign-kpi-slate:hover {
    border-color: rgba(100, 116, 139, 0.6) !important;
    box-shadow: 0 12px 24px -4px rgba(100, 116, 139, 0.15) !important;
}
.assign-kpi-slate .assign-kpi-title {
    color: #475569 !important;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.assign-kpi-slate .assign-kpi-number {
    color: #334155 !important;
    font-size: 1.85rem !important;
}
.assign-kpi-slate .assign-kpi-sub {
    color: #64748b !important;
    font-weight: 500;
}

/* Dark Mode Overrides */
html[data-theme="dark"] .assign-kpi-card {
    background: #13233a;
    border-color: rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] .assign-kpi-green {
    background: linear-gradient(145deg, #13233a 0%, #0d281e 100%) !important;
    border-color: rgba(34, 197, 94, 0.3) !important;
}
html[data-theme="dark"] .assign-kpi-green .assign-kpi-title { color: #86efac !important; }
html[data-theme="dark"] .assign-kpi-green .assign-kpi-number { color: #4ade80 !important; }
html[data-theme="dark"] .assign-kpi-green .assign-kpi-sub { color: #cbd5e1 !important; }

html[data-theme="dark"] .assign-kpi-amber {
    background: linear-gradient(145deg, #13233a 0%, #291d0e 100%) !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
}
html[data-theme="dark"] .assign-kpi-amber .assign-kpi-title { color: #fde047 !important; }
html[data-theme="dark"] .assign-kpi-amber .assign-kpi-number { color: #fbbf24 !important; }
html[data-theme="dark"] .assign-kpi-amber .assign-kpi-sub { color: #cbd5e1 !important; }

html[data-theme="dark"] .assign-kpi-slate {
    background: linear-gradient(145deg, #13233a 0%, #1e293b 100%) !important;
    border-color: rgba(148, 163, 184, 0.3) !important;
}
html[data-theme="dark"] .assign-kpi-slate .assign-kpi-title { color: #cbd5e1 !important; }
html[data-theme="dark"] .assign-kpi-slate .assign-kpi-number { color: #f1f5f9 !important; }
html[data-theme="dark"] .assign-kpi-slate .assign-kpi-sub { color: #94a3b8 !important; }

/* ==========================================================================
   CLICKABLE CONTAINER INSPECT ROWS
   ========================================================================== */
.table tbody tr.clickable-container-row {
    cursor: pointer;
    transition: background-color 0.15s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.15s ease;
}

.table tbody tr.clickable-container-row:hover {
    background-color: #f1f5f9 !important;
}

.table tbody tr.clickable-container-row:hover td {
    background-color: transparent !important;
}

html[data-theme="dark"] .table tbody tr.clickable-container-row:hover {
    background-color: #1e293b !important;
}

/* ==========================================================================
   MOBILE (HP / SMARTPHONE) UI POLISH SYSTEM (BETTER-UI SPEC)
   ========================================================================== */

/* 1. Global Touch Ergonomics & Tap Highlight */
* {
    -webkit-tap-highlight-color: transparent;
}

/* 2. Micro-interactions: Calm tactile press feedback without excessive shake/jitter */
.btn:not(:disabled):active {
    transform: scale(0.99) translateY(0.5px);
    box-shadow: none !important;
    transition: transform 60ms ease-out, box-shadow 60ms ease-out;
}

.action-shortcut-card:active,
.mobile-container-card:active,
.mobile-nav-item:active {
    transform: scale(0.99);
    transition: transform 60ms ease-out;
}

@media (prefers-reduced-motion: reduce) {
    .btn:not(:disabled):active,
    .action-shortcut-card:active,
    .mobile-container-card:active,
    .mobile-nav-item:active {
        transform: none !important;
    }
}

/* 3. Contain Scroll Inside Overlays & Drawers */
.sidebar,
.modal,
.modal-body,
.sidebar-flyout-menu,
.mobile-bottom-nav,
.offcanvas {
    overscroll-behavior: contain;
}

/* 4. Form Controls & iOS Zoom Fix */
@media (max-width: 767.98px) {
    input.form-control,
    select.form-select,
    textarea.form-control,
    .select2-container .select2-selection {
        font-size: 16px !important; /* Prevents iOS auto-zoom on input focus */
        min-height: 42px;
    }

    .btn {
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Page Titles & Headers on Phone */
    .page-title {
        font-size: 1.35rem !important;
        letter-spacing: -0.3px;
    }

    /* Modals on Phone: Slide/Fit Cleanly */
    .modal-dialog {
        margin: 0.6rem !important;
        max-width: calc(100% - 1.2rem) !important;
    }
    .modal-content {
        border-radius: 18px !important;
    }
    .modal-body {
        padding: 1rem !important;
    }

    /* Manager Period Slicer: Horizontal Momentum Scroll */
    .period-pills {
        display: flex !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        padding: 0.25rem !important;
        max-width: 100% !important;
        gap: 0.35rem !important;
    }
    .period-pills::-webkit-scrollbar {
        display: none !important;
    }
    .period-pills .period-btn {
        flex-shrink: 0 !important;
        padding: 0.4rem 0.75rem !important;
        font-size: 0.75rem !important;
        border-radius: 0.5rem !important;
    }
}

/* 5. Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    min-height: 66px;
    height: calc(66px + env(safe-area-inset-bottom, 8px));
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(226, 232, 240, 0.9);
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    z-index: 1045;
    padding-top: 6px;
    padding-bottom: max(10px, env(safe-area-inset-bottom, 10px));
    padding-left: 4px;
    padding-right: 4px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
    overscroll-behavior: contain;
}

html[data-theme="dark"] .mobile-bottom-nav {
    background: rgba(15, 23, 42, 0.96);
    border-top-color: rgba(36, 52, 77, 0.9);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.45);
}

.mobile-nav-form {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    margin: 0;
    padding: 0;
}

.mobile-nav-item {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    color: #64748b;
    text-decoration: none !important;
    padding: 2px 2px;
    position: relative;
    transition: color 150ms ease-out;
}

.mobile-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    width: 100%;
}

.mobile-nav-icon i {
    font-size: 1.25rem;
    line-height: 1;
    transition: transform 150ms ease-out, color 150ms ease-out;
}

.mobile-nav-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.2;
    margin-top: 4px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    transition: color 150ms ease-out, font-weight 150ms ease-out;
}

.mobile-nav-item.active {
    color: #1a365d !important;
}

.mobile-nav-item.active .mobile-nav-icon i {
    transform: translateY(-1px);
    color: #2563eb !important;
}

.mobile-nav-item.active .mobile-nav-label {
    font-weight: 700;
    color: #1a365d !important;
}

html[data-theme="dark"] .mobile-nav-item {
    color: #94a3b8;
}

html[data-theme="dark"] .mobile-nav-item.active {
    color: #ffffff !important;
}

html[data-theme="dark"] .mobile-nav-item.active .mobile-nav-icon i {
    color: #60a5fa !important;
}

html[data-theme="dark"] .mobile-nav-item.active .mobile-nav-label {
    color: #ffffff !important;
}

/* Center Elevated Action Button (Staff Gate IN) */
.mobile-nav-item-center {
    position: relative;
    overflow: visible;
}

.mobile-nav-fab {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 52px;
    height: 52px;
    min-width: 52px;
    min-height: 52px;
    max-width: 52px;
    max-height: 52px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: 4px solid #ffffff;
    color: #ffffff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.45), 0 2px 4px rgba(0, 0, 0, 0.05);
    text-decoration: none !important;
    transition: transform 150ms ease-out, box-shadow 150ms ease-out;
    z-index: 2;
    box-sizing: border-box;
    flex-shrink: 0;
}

html[data-theme="dark"] .mobile-nav-fab {
    border-color: #0f172a !important;
    box-shadow: 0 4px 18px rgba(16, 185, 129, 0.55), 0 2px 6px rgba(0, 0, 0, 0.3);
}

.mobile-nav-item-center:active .mobile-nav-fab {
    transform: translateX(-50%) scale(0.97);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.mobile-nav-fab i {
    font-size: 1.45rem;
    color: #ffffff !important;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-nav-label-fab {
    color: #059669 !important;
    font-weight: 700 !important;
    margin-top: 2px;
}

html[data-theme="dark"] .mobile-nav-label-fab {
    color: #34d399 !important;
}

/* 6. Mobile Container Cards (Logistics List View for Smartphones) */
.mobile-container-cards {
    margin-top: 0.5rem;
}

.mobile-container-card {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 14px;
    padding: 0.9rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.02);
    transition: transform 150ms ease-out, box-shadow 150ms ease-out, border-color 150ms ease-out;
    cursor: pointer;
}

.mobile-container-card:active {
    transform: scale(0.98);
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

html[data-theme="dark"] .mobile-container-card {
    background: #152238;
    border-color: #24344d;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.mobile-container-card .card-number {
    font-family: system-ui, -apple-system, sans-serif;
    font-weight: 700;
    font-size: 0.98rem;
    letter-spacing: 0.5px;
}

.mobile-container-card .meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
    margin-top: 0.65rem;
    padding-top: 0.65rem;
    border-top: 1px dashed rgba(226, 232, 240, 0.85);
    font-size: 0.78rem;
}

html[data-theme="dark"] .mobile-container-card .meta-grid {
    border-top-color: rgba(255, 255, 255, 0.08);
}

.mobile-container-card .meta-item {
    display: flex;
    flex-direction: column;
}

.mobile-container-card .meta-label {
    font-size: 0.66rem;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 600;
    letter-spacing: 0.4px;
}

.mobile-container-card .meta-val {
    color: #1e293b;
    font-weight: 600;
    margin-top: 1px;
}

html[data-theme="dark"] .mobile-container-card .meta-label {
    color: #94a3b8;
}

html[data-theme="dark"] .mobile-container-card .meta-val {
    color: #f1f5f9;
}

.mobile-container-card .card-actions {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.75rem;
    padding-top: 0.65rem;
    border-top: 1px solid rgba(226, 232, 240, 0.85);
}

html[data-theme="dark"] .mobile-container-card .card-actions {
    border-top-color: rgba(255, 255, 255, 0.08);
}

.mobile-container-card .card-actions .btn {
    flex: 1;
    font-size: 0.76rem;
    font-weight: 600;
    padding: 0.38rem 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    border-radius: 8px;
    min-height: 36px;
}

/* 7. Hover Guard: Apply hover only on capable pointers */
@media (hover: hover) {
    .mobile-container-card:hover {
        border-color: #93c5fd;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
    }
    html[data-theme="dark"] .mobile-container-card:hover {
        border-color: #3b82f6;
    }
}

/* 8. Widget Overlap Protection on Phone */
@media (max-width: 767.98px) {
    .ai-widget-wrapper {
        bottom: calc(72px + env(safe-area-inset-bottom, 10px)) !important;
        right: 14px !important;
    }
    .ai-chat-fab {
        width: 48px !important;
        height: 48px !important;
    }
    .ai-fab-icon-wrapper i {
        font-size: 1.35rem !important;
    }
    .ai-chat-panel {
        position: fixed !important;
        inset: 10px !important;
        bottom: calc(74px + env(safe-area-inset-bottom, 10px)) !important;
        width: auto !important;
        max-width: 100vw !important;
        height: auto !important;
        max-height: none !important;
        border-radius: 18px !important;
        z-index: 1060 !important;
    }
    .cookie-consent-banner {
        bottom: calc(72px + env(safe-area-inset-bottom, 10px)) !important;
        right: 12px !important;
        left: 12px !important;
        width: auto !important;
        max-width: none !important;
    }
}







