html, body {
    max-width: 100vw;
    overflow-x: hidden !important;
}

:root {
    --primary-color: #0073ea;
    --secondary-color: #00c875;
    --background-color: #f7f8fa;
    --text-color: #333;
    --border-color: #e1e1e1;
    --calendar-hour-height: 224px;
    /* Default sidebar colors - will be overridden by theme */
    --sidebar-color: #161A23;
    --logo-area-color: #2D2F39;
    --sidebar-text-color: #ffffff;
    --sidebar-border-color: #5C5F65;
}

/* Sidebar Light Mode Theme */
.sidebar[data-theme="light"] {
    --sidebar-color: #ffffff;
    --logo-area-color: #f8f9fa;
    --sidebar-text-color: #5C5E64;
    --sidebar-border-color: #e1e1e1;
}

/* Sidebar Light Mode - Inactive theme option styling */
.sidebar[data-theme="light"] .theme-option:not(.active) {
    color: #5C5E64;
    opacity: 0.7;
}

/* Sidebar Light Mode - Active page styling */
.sidebar[data-theme="light"] .nav-menu li.active a {
    background-color: #f5f5f5;
    color: #000000;
    font-weight: 500;
}

/* Sidebar Dark Mode Theme (default) */
.sidebar[data-theme="dark"] {
    --sidebar-color: #161A23;
    --logo-area-color: #2D2F39;
    --sidebar-text-color: #ffffff;
    --sidebar-border-color: #5C5F65;
}

/* Sidebar Dark Mode - Inactive theme option styling */
.sidebar[data-theme="dark"] .theme-option:not(.active) {
    color: #8A8C91;
    opacity: 0.7;
}

/* Sidebar Dark Mode - Active page styling */
.sidebar[data-theme="dark"] .nav-menu li.active a {
    background-color: #2D2F39;
    color: #ffffff;
    font-weight: 500;
}

/* Sidebar Dark Mode - Non-selected text styling */
.sidebar[data-theme="dark"] .nav-menu a {
    color: #8A8C91;
}

.sidebar[data-theme="dark"] .nav-menu a:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 240px;
    background-color: var(--sidebar-color);
    color: var(--sidebar-text-color);
    padding: 20px;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    border-radius: 0 16px 16px 0;
    border: 0.5px solid var(--sidebar-border-color);
    box-shadow: 0 0 0 0.25px var(--sidebar-border-color);
    z-index: 999998;
}

.logo {
    background-color: var(--logo-area-color);
    padding: 20px;
    margin: -20px -20px 0 -20px;
    border-bottom: 0.5px solid var(--sidebar-border-color);
    border-radius: 0 16px 0 0;
    border-right: 0.5px solid var(--sidebar-border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logo:hover {
    background-color: var(--logo-area-color);
    opacity: 0.9;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--sidebar-text-color);
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Collapsed Sidebar Styles */
.sidebar.collapsed {
    width: 60px;
}

.sidebar.collapsed .logo h1 {
    display: none;
}

.sidebar.collapsed .nav-menu a {
    justify-content: center;
    padding: 12px;
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}

.sidebar.collapsed .nav-menu a i {
    margin-right: 0;
    font-size: 16px;
}

/* Hide all text content in collapsed mode - hide everything except icons */
.sidebar.collapsed .nav-menu a {
    color: transparent;
}

.sidebar.collapsed .nav-menu a i {
    color: var(--sidebar-text-color);
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

/* Ensure active items in collapsed mode also hide text and show only icons */
.sidebar.collapsed .nav-menu li.active a {
    color: transparent !important;
}

.sidebar.collapsed .nav-menu li.active a i {
    color: var(--sidebar-text-color) !important;
}

/* Sidebar light mode active collapsed items */
.sidebar[data-theme="light"].collapsed .nav-menu li.active a {
    color: transparent !important;
}

.sidebar[data-theme="light"].collapsed .nav-menu li.active a i {
    color: var(--sidebar-text-color) !important;
}

/* Sidebar dark mode active collapsed items */
.sidebar[data-theme="dark"].collapsed .nav-menu li.active a {
    color: transparent !important;
}

.sidebar[data-theme="dark"].collapsed .nav-menu li.active a i {
    color: var(--sidebar-text-color) !important;
}

/* Hide dropdown arrow in collapsed mode */
.sidebar.collapsed .dropdown-toggle .dropdown-arrow {
    display: none !important;
}

.sidebar.collapsed .dropdown-menu {
    display: none !important;
}

.sidebar.collapsed .theme-toggle-container {
    display: none;
}

.sidebar.collapsed .nav-menu li {
    position: relative;
}

.sidebar.collapsed .nav-menu li:hover .dropdown-menu {
    display: block !important;
    position: absolute;
    left: calc(100% + 16px);
    top: 0;
    background-color: var(--sidebar-color);
    border: 0.5px solid var(--sidebar-border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 999999;
}

/* Keep dropdown visible when hovering over the dropdown itself */
.sidebar.collapsed .nav-menu li .dropdown-menu:hover {
    display: block !important;
}

/* Create an invisible bridge to prevent dropdown from disappearing */
.sidebar.collapsed .nav-menu li:hover .dropdown-menu::before {
    content: '';
    position: absolute;
    left: -16px;
    top: 0;
    width: 16px;
    height: 100%;
    background: transparent;
    z-index: -1;
}


.sidebar.collapsed .nav-menu li:hover .dropdown-menu a {
    justify-content: flex-start !important;
    padding: 8px 20px 8px 12px;
    color: var(--sidebar-text-color);
    display: flex !important;
    align-items: center;
    white-space: nowrap;
    text-decoration: none;
    text-align: left !important;
}

.sidebar.collapsed .nav-menu li:hover .dropdown-menu a i {
    color: var(--sidebar-text-color);
}

.logo h1 {
    font-size: 24px;
    margin-bottom: 0;
    color: var(--sidebar-text-color);
}

.nav-menu {
    list-style: none;
    flex: 1;
    margin-top: 20px;
}

.nav-menu li {
    margin-bottom: 10px;
}

.nav-menu a {
    color: var(--sidebar-text-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-menu a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-menu i {
    margin-right: 10px;
    width: 20px;
}

.nav-menu li.active a {
    background-color: var(--primary-color);
}

/* Dropdown Menu Styles */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.dropdown-arrow {
    transition: transform 0.3s ease;
    font-size: 12px;
    margin-left: auto;
}

.dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    display: none;
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    margin-top: 5px;
    padding: 5px 0;
    position: relative;
    z-index: 999999;
}

.dropdown.active .dropdown-menu {
    display: block;
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu a {
    padding: 8px 20px 8px 40px;
    font-size: 14px;
    color: var(--sidebar-text-color);
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-menu a:hover {
    background-color: rgba(0, 0, 0, 0.1);
    color: var(--sidebar-text-color);
    opacity: 1;
}

.dropdown-menu a {
    background-color: transparent !important;
}

.dropdown-menu li.active a {
    background-color: transparent !important;
    color: var(--sidebar-text-color) !important;
    opacity: 0.8 !important;
}

.dropdown-menu i {
    font-size: 12px;
    width: 16px;
}

/* Override FontAwesome default display for dropdown menu icons */
.sidebar.collapsed .nav-menu li:hover .dropdown-menu i {
    display: inline-block !important;
    text-align: left !important;
    margin-right: 12px !important;
    margin-left: 0 !important;
    width: 16px !important;
    flex-shrink: 0 !important;
}

/* Alternative approach - force the icon to behave as inline */
.sidebar.collapsed .nav-menu li:hover .dropdown-menu a {
    display: flex !important;
    align-items: center !important;
    text-align: left !important;
    justify-content: flex-start !important;
}

.sidebar.collapsed .nav-menu li:hover .dropdown-menu a i {
    all: unset !important;
    display: inline-block !important;
    margin-right: 12px !important;
    margin-left: 0 !important;
    width: 16px !important;
    height: 16px !important;
    text-align: left !important;
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    color: var(--sidebar-text-color) !important;
}

/* Theme Toggle Button */
.theme-toggle-container {
    margin-top: auto;
    margin-bottom: 20px;
}

.theme-toggle {
    display: flex;
    background-color: var(--logo-area-color);
    border-radius: 8px;
    padding: 4px;
    border: 1px solid var(--sidebar-border-color);
}

.theme-option {
    flex: 1;
    background-color: transparent;
    border: none;
    color: var(--sidebar-text-color);
    opacity: 0.7;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

.theme-option:hover {
    color: var(--sidebar-text-color);
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.05);
}

.theme-option.active {
    color: var(--sidebar-text-color);
    background-color: var(--sidebar-color);
    opacity: 1;
    border: 1px solid var(--sidebar-border-color);
    box-shadow: 0 0 0 1px var(--sidebar-border-color);
}

.theme-option i {
    font-size: 12px;
    width: 16px;
    text-align: center;
}

.theme-option span {
    font-size: 13px;
    font-weight: 500;
}

/* Main Content Styles */
.main-content {
    flex: 1;
    margin-left: 240px;
    padding: 20px;
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed + .main-content {
    margin-left: 60px;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: var(--background-color);
    padding: 8px 15px;
    border-radius: 4px;
    width: 300px;
}

.search-bar input {
    border: none;
    background: none;
    margin-left: 10px;
    width: 100%;
    outline: none;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-profile img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 10px;
}

.sign-out-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.sign-out-btn:hover {
    background-color: #f0f0f0;
}

.sign-out-btn i {
    margin-right: 5px;
}

.content-area {
    background-color: white;
    border-radius: 8px;
    padding: 0;
    min-height: calc(100vh - 120px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: auto;
}

.welcome-message {
    text-align: center;
    padding: 40px;
}

.welcome-message h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

/* Mobile Menu Toggle - Hidden by default */
.mobile-menu-toggle {
    display: none;
}

/* Responsive Design */
@media (max-width: 770px) {
    /* Hide old mobile menu toggle completely on small screens */
    .mobile-menu-toggle {
        display: none !important;
    }

    .app-container {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background-color: var(--sidebar-color);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        z-index: 1000;
        transition: left 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05), 0 8px 32px rgba(0, 0, 0, 0.12);
        padding: 0;
        overflow-y: auto;
        border: 0.5px solid var(--sidebar-border-color);
        border-radius: 0 16px 16px 0;
    }

    .sidebar.active {
        left: 0;
    }

    /* iOS-style backdrop overlay */
    .sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    .sidebar-backdrop.active {
        opacity: 1;
        visibility: visible;
    }

    .sidebar .logo {
        display: block;
        padding: 20px 20px 16px 20px;
        text-align: center;
        border-bottom: 0.5px solid var(--sidebar-border-color);
        margin-bottom: 0;
        position: relative;
        background-color: var(--logo-area-color);
        border-radius: 0 16px 0 0;
    }

    .sidebar .logo h1 {
        font-size: 17px;
        font-weight: 600;
        margin: 0;
        color: var(--sidebar-text-color);
        letter-spacing: -0.022em;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    }

    /* iOS-style close button */
    .sidebar .close-btn {
        position: absolute;
        top: 20px;
        right: 20px;
        width: 30px;
        height: 30px;
        border-radius: 15px;
        background: rgba(142, 142, 147, 0.12);
        border: none;
        color: #8e8e93;
        font-size: 15px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        font-weight: 400;
    }

    .sidebar .close-btn:hover {
        background: rgba(142, 142, 147, 0.2);
        color: #1d1d1f;
        transform: scale(1.05);
    }

    .sidebar .close-btn:active {
        transform: scale(0.95);
        background: rgba(142, 142, 147, 0.3);
    }

    .nav-menu {
        display: block;
        padding: 8px 0 20px 0;
        margin: 0;
        list-style: none;
    }

    .nav-menu li {
        margin: 0;
        padding: 0 16px;
    }

    .nav-menu a {
        display: flex;
        align-items: center;
        padding: 12px 16px;
        font-size: 17px;
        font-weight: 400;
        color: #1d1d1f;
        text-decoration: none;
        border-radius: 10px;
        transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        margin: 1px 0;
        position: relative;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
        letter-spacing: -0.022em;
    }

    .nav-menu a:hover {
        background-color: rgba(0, 0, 0, 0.04);
    }

    .nav-menu a:active {
        background-color: rgba(0, 0, 0, 0.08);
        transform: scale(0.98);
    }

    .nav-menu i {
        margin-right: 12px;
        font-size: 20px;
        width: 24px;
        text-align: center;
        color: #8e8e93;
        font-weight: 300;
    }

    /* iOS-style section dividers */
    .nav-menu li.divider {
        height: 1px;
        background: rgba(0, 0, 0, 0.1);
        margin: 8px 16px;
        padding: 0;
        list-style: none;
    }

    .nav-menu li.divider::before {
        content: none;
    }

    .main-content {
        margin-left: 0;
        margin-bottom: 0;
        padding: 80px 20px 20px 20px; /* Space for mobile menu toggle */
    }

    /* iOS-style active state */
    .nav-menu li.active a {
        background-color: rgba(0, 122, 255, 0.1);
        color: #007aff;
        font-weight: 500;
    }

    .nav-menu li.active a i {
        color: #007aff;
    }

    /* Touch-friendly sizing for mobile */
    .nav-menu a {
        min-height: 44px;
        touch-action: manipulation;
    }

    /* iOS-style subtle animation for menu items */
    .nav-menu li {
        opacity: 0;
        animation: iosSlideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    }

    .nav-menu li:nth-child(1) { animation-delay: 0.05s; }
    .nav-menu li:nth-child(2) { animation-delay: 0.08s; }
    .nav-menu li:nth-child(3) { animation-delay: 0.11s; }
    .nav-menu li:nth-child(4) { animation-delay: 0.14s; }
    .nav-menu li:nth-child(5) { animation-delay: 0.17s; }
    .nav-menu li:nth-child(6) { animation-delay: 0.20s; }
    .nav-menu li:nth-child(7) { animation-delay: 0.23s; }
    .nav-menu li:nth-child(8) { animation-delay: 0.26s; }
    .nav-menu li:nth-child(9) { animation-delay: 0.29s; }
    .nav-menu li:nth-child(10) { animation-delay: 0.32s; }
    .nav-menu li:nth-child(11) { animation-delay: 0.35s; }
    .nav-menu li:nth-child(12) { animation-delay: 0.38s; }
    .nav-menu li:nth-child(13) { animation-delay: 0.41s; }

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

/* Client Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999999;
}
.client-modal-content {
    background: #fff;
    margin: 6% auto;
    padding: 32px 36px 28px 36px;
    width: 420px;
    max-width: 96vw;
    border-radius: 14px;
    position: relative;
    box-shadow: 0 4px 24px rgba(33,150,243,0.13);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.client-modal-content h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 18px;
    color: #1769aa;
}
.client-modal-content .form-group {
    margin-bottom: 14px;
}
.client-modal-content label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
    display: block;
}
.client-modal-content input,
.client-modal-content select,
.client-modal-content textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    font-size: 1rem;
    background: #f7f8fa;
    color: #222;
    margin-top: 2px;
    margin-bottom: 0;
    transition: border 0.2s;
}
.client-modal-content input:focus,
.client-modal-content select:focus,
.client-modal-content textarea:focus {
    border: 1.5px solid #2196f3;
    background: #fff;
    outline: none;
}
.client-modal-content textarea {
    resize: vertical;
}
.client-modal-content .submit-btn {
    width: auto;
    min-width: 120px;
    margin-top: 8px;
}
@media (max-width: 600px) {
    .client-modal-content {
        width: 98vw !important;
        min-width: 0;
        max-width: 98vw;
        left: 1vw;
        right: 1vw;
        padding: 18px 6px 18px 6px;
    }
    .client-modal-content .submit-btn {
        width: 100%;
        min-width: 0;
    }
}

/* Client Add Modal 2x2 Grid */
.client-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 24px;
    align-items: end;
}
.client-form-grid .form-group {
    margin-bottom: 0;
}
.client-form-grid .form-notes,
.client-form-grid .form-price {
    grid-column: 1 / -1;
}
@media (max-width: 600px) {
    .client-form-grid {
        grid-template-columns: 1fr;
        gap: 14px 0;
    }
    .client-form-grid .form-notes,
    .client-form-grid .form-price {
        grid-column: 1 / -1;
    }
}

/* CRM-style client header bar */
.client-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #eaf4fb;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
    padding: 18px 24px;
    margin-bottom: 20px;
    gap: 18px;
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}
.add-person-btn {
    background: #2196f3;
    color: #fff;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    padding: 10px 22px;
    font-size: 1.08rem;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(33,150,243,0.08);
    transition: background 0.2s;
}
.add-person-btn:hover {
    background: #1769aa;
}
.client-header-bar .search-bar {
    margin-left: auto;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    padding: 8px 15px;
    width: 260px;
}
@media (max-width: 600px) {
    .client-header-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px 6px;
    }
    .client-header-bar .search-bar {
        width: 100%;
    }
    .add-person-btn {
        width: 100%;
        justify-content: center;
    }
}

/* CRM-style client table container */
.client-table-container {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(33,150,243,0.07);
    padding: 0 0 18px 0;
    margin-top: 18px;
    overflow-x: auto;
}
.client-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 950px;
    font-size: 1.04rem;
}
.client-table th, .client-table td {
    padding: 16px 14px;
    text-align: left;
    border-bottom: 1px solid #f0f4fa;
    background: #fff;
    vertical-align: middle;
}
.client-table th {
    background: #eaf4fb;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.98rem;
    letter-spacing: 0.04em;
    color: #1769aa;
    border-top: 1px solid #eaf4fb;
}
.client-table tr:last-child td {
    border-bottom: none;
}
.client-table tbody tr:hover {
    background: #f5faff;
    transition: background 0.18s;
}
.client-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #eaf4fb;
    color: #2196f3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 1px 4px rgba(33,150,243,0.08);
    margin-right: 0;
}
.client-table td {
    color: #222;
    font-weight: 500;
}
.client-table td span.secondary {
    color: #888;
    font-size: 0.97em;
    font-weight: 400;
}
.client-table .action-btn {
    background: none;
    border: none;
    color: #2196f3;
    font-size: 18px;
    cursor: pointer;
    margin-right: 6px;
    transition: color 0.2s;
    padding: 4px 6px;
    border-radius: 6px;
}
.client-table .action-btn:hover {
    background: #eaf4fb;
    color: #1769aa;
}
@media (max-width: 900px) {
    .client-table-container {
        padding: 0 0 8px 0;
        border-radius: 8px;
    }
    .client-table {
        min-width: 700px;
        font-size: 0.98rem;
    }
}
@media (max-width: 600px) {
    .client-table-container {
        padding: 0 0 2px 0;
        border-radius: 6px;
    }
    .client-table {
        min-width: 500px;
        font-size: 0.95rem;
    }
    .client-table th, .client-table td {
        padding: 10px 6px;
    }
    .client-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.98rem;
    }
}

/* Full-screen calendar layout */
.calendar-card {
    background: #fff;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    margin: 0;
    max-width: none;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: visible;
}
.calendar-header {
    position: static;
    top: unset;
    z-index: unset;
    background: #fff;
    box-shadow: 0 2px 8px rgba(33,150,243,0.07);
}
.calendar-toolbar {
    position: static;
    top: unset;
    z-index: unset;
    background: #fff;
    box-shadow: 0 2px 8px rgba(33,150,243,0.04);
}
.calendar-header, .calendar-toolbar {
    padding-left: 36px;
    padding-right: 36px;
}
.calendar-grid {
    flex: 1 1 auto;
    margin: 24px 36px 0 36px;
    border-radius: 12px;
    background: #f7f8fa;
    box-shadow: 0 1px 4px rgba(33,150,243,0.04);
    overflow: hidden;
    display: grid;
    grid-template-rows: auto 1fr;
    min-height: 0;
}
.calendar-title {
    font-size: 2.1rem;
    font-weight: 700;
    color: #222;
    margin-bottom: 2px;
}
.calendar-subtitle {
    color: #888;
    font-size: 1.08rem;
    margin-bottom: 0;
}
.calendar-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.calendar-tab {
    background: none;
    border: none;
    color: #1769aa;
    font-weight: 600;
    font-size: 1rem;
    padding: 8px 18px;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.calendar-tab.active {
    background: #eaf4fb;
    color: #2196f3;
}
.calendar-search-group {
    display: flex;
    align-items: center;
    gap: 0;
    margin-left: 18px;
}
.calendar-search {
    padding: 8px 12px;
    border: 1px solid #e1e1e1;
    border-radius: 6px 0 0 6px;
    font-size: 1rem;
    background: #f7f8fa;
    color: #333;
    width: 140px;
}
.calendar-filter {
    background: #eaf4fb;
    border: none;
    color: #1769aa;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    font-size: 1rem;
    margin-left: -2px;
}
.calendar-new-btn {
    background: #2196f3;
    color: #fff;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    padding: 10px 22px;
    font-size: 1.08rem;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(33,150,243,0.08);
    transition: background 0.2s;
    margin-left: 18px;
}
.calendar-new-btn:hover {
    background: #1769aa;
}
.calendar-toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.calendar-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.calendar-nav-btn, .calendar-today-btn, .calendar-view-btn {
    background: #eaf4fb;
    border: none;
    color: #1769aa;
    font-weight: 600;
    padding: 7px 16px;
    border-radius: 7px;
    font-size: 1rem;
    cursor: pointer;
    margin-right: 4px;
    transition: background 0.2s, color 0.2s;
}
.calendar-nav-btn i { font-size: 1.1em; }
.calendar-today-btn { background: #fff; border: 1px solid #eaf4fb; }
.calendar-view-btn.active {
    background: #2196f3;
    color: #fff;
}
.calendar-date-range {
    font-weight: 600;
    color: #222;
    margin: 0 8px;
}
.calendar-grid-header {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    background: #eaf4fb;
    border-bottom: 1px solid #e1e1e1;
}
.calendar-grid-time-col {
    width: 60px;
}
.calendar-grid-day {
    text-align: center;
    font-weight: 600;
    color: #1769aa;
    padding: 12px 0;
    font-size: 1.05rem;
    border-right: 1px solid #e1e1e1;
}
.calendar-grid-day:last-child {
    border-right: none;
}
.calendar-grid-body {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    grid-template-rows: repeat(6, 56px);
    position: relative;
    background: #f7f8fa;
}
.calendar-grid-row {
    display: contents;
}
.calendar-grid-time {
    text-align: right;
    color: #bbb;
    font-size: 0.98rem;
    padding: 8px 10px 0 0;
    height: 56px;
    line-height: 56px;
}
.calendar-event {
    position: absolute;
    z-index: 2;
    border-radius: 8px;
    color: #222;
    font-weight: 600;
    font-size: 1rem;
    padding: 10px 14px 8px 14px;
    box-shadow: 0 2px 8px rgba(33,150,243,0.10);
    background: #fff;
    border-left: 5px solid #2196f3;
    min-width: 120px;
    max-width: 210px;
    overflow: hidden;
    white-space: normal;
    margin-top: 2px;
    margin-left: 2px;
    cursor: pointer;
    transition: box-shadow 0.2s;
}
.event-blue { background: #e3f0fc; border-left-color: #2196f3; }
.event-purple { background: #f3e8fd; border-left-color: #a259f7; }
.event-green { background: #eafaf3; border-left-color: #00c875; }

/* Recurring frequency colors */
.event-weekly { background: #e3f0fc; border-left-color: #007AFF; }
.event-biweekly { background: #eafaf3; border-left-color: #34C759; }
.event-triweekly { background: #fff4e6; border-left-color: #FF9500; }
.event-monthly { background: #f3e8fd; border-left-color: #AF52DE; }

/* Mini Color Legend Styles for CRM */
.mini-color-legend {
    margin-top: 12px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.legend-title {
    font-size: 11px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 6px;
}

.legend-colors {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mini-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: #6c757d;
}

.mini-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}
.calendar-event span {
    display: block;
    color: #888;
    font-size: 0.97em;
    font-weight: 400;
    margin-top: 2px;
}
@media (max-width: 900px) {
    .calendar-header, .calendar-toolbar, .calendar-grid {
        padding-left: 10px;
        padding-right: 10px;
    }
    .calendar-grid {
        margin-left: 10px;
        margin-right: 10px;
    }
}
@media (max-width: 600px) {
    .calendar-header, .calendar-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px 6px 0 6px;
    }
    .calendar-card {
        border-radius: 8px;
        padding: 0 0 2px 0;
    }
    .calendar-grid {
        margin: 0 2px;
        border-radius: 6px;
    }
    .calendar-grid-header, .calendar-grid-body {
        grid-template-columns: 40px repeat(7, 1fr);
    }
    .calendar-grid-time-col, .calendar-grid-time {
        width: 40px;
        font-size: 0.92rem;
    }
    .calendar-event {
        font-size: 0.95rem;
        min-width: 80px;
        max-width: 120px;
        padding: 7px 7px 6px 7px;
    }
}

/* Event Modal UI Polish */
.event-modal-content {
    background: #fff;
    margin: 6% auto;
    padding: 32px 36px 28px 36px;
    width: 420px;
    max-width: 96vw;
    border-radius: 14px;
    position: relative;
    box-shadow: 0 4px 24px rgba(33,150,243,0.13);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    animation: modalFadeIn 0.25s;
}
@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}
.event-modal-content h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 18px;
    color: #1769aa;
}
.event-modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 18px;
    justify-content: flex-end;
}
.event-modal-content .form-group {
    margin-bottom: 14px;
}
.event-modal-content label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
    display: block;
}
.event-modal-content input,
.event-modal-content select,
.event-modal-content textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    font-size: 1rem;
    background: #f7f8fa;
    color: #222;
    margin-top: 2px;
    margin-bottom: 0;
    transition: border 0.2s;
}
.event-modal-content input:focus,
.event-modal-content select:focus,
.event-modal-content textarea:focus {
    border: 1.5px solid #2196f3;
    background: #fff;
    outline: none;
}
.event-modal-content textarea {
    resize: vertical;
}
.event-modal-content .submit-btn {
    width: auto;
    min-width: 120px;
    margin-top: 8px;
}
@media (max-width: 600px) {
    .event-modal-content {
        width: 98vw !important;
        min-width: 0;
        max-width: 98vw;
        left: 1vw;
        right: 1vw;
        padding: 18px 6px 18px 6px;
    }
    .event-modal-content .submit-btn {
        width: 100%;
        min-width: 0;
    }
}

/* Month View Grid */
.calendar-month-grid {
    display: grid;
    grid-template-rows: auto repeat(6, 1fr);
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #eaf4fb;
    border-radius: 12px;
    margin: 24px 36px 0 36px;
    min-height: 420px;
    box-shadow: 0 1px 4px rgba(33,150,243,0.04);
    overflow: hidden;
}
.calendar-month-header {
    background: #eaf4fb;
    color: #1769aa;
    font-weight: 700;
    text-align: center;
    padding: 10px 0;
    font-size: 1.05rem;
    border-bottom: 1px solid #e1e1e1;
}
.calendar-month-cell {
    background: #fff;
    min-height: 60px;
    padding: 8px 6px 4px 8px;
    border-right: 1px solid #e1e1e1;
    border-bottom: 1px solid #e1e1e1;
    position: relative;
    vertical-align: top;
    font-size: 0.98rem;
}
.calendar-month-cell:last-child {
    border-right: none;
}
.calendar-month-date {
    font-weight: 600;
    color: #888;
    font-size: 0.98rem;
    margin-bottom: 2px;
}
.calendar-month-cell.today .calendar-month-date {
    color: #2196f3;
    background: #eaf4fb;
    border-radius: 50%;
    padding: 2px 7px;
}
.calendar-month-events {
    margin-top: 2px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.calendar-month-event-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
}
.calendar-month-event-title {
    font-size: 0.93em;
    color: #1769aa;
    font-weight: 500;
    margin-bottom: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}
.calendar-month-event-title.event-blue { color: #2196f3; }
.calendar-month-event-title.event-purple { color: #a259f7; }
.calendar-month-event-title.event-green { color: #00c875; }

/* Day View Grid */
.calendar-day-grid {
    display: grid;
    grid-template-rows: repeat(12, 1fr);
    grid-template-columns: 60px 1fr;
    background: #f7f8fa;
    border-radius: 12px;
    margin: 24px 36px 0 36px;
    min-height: 420px;
    box-shadow: 0 1px 4px rgba(33,150,243,0.04);
    overflow: hidden;
    position: relative;
}
.calendar-day-time {
    text-align: right;
    color: #bbb;
    font-size: 0.98rem;
    padding: 8px 10px 0 0;
    height: 36px;
    line-height: 36px;
}
.calendar-day-cell {
    border-bottom: 1px solid #e1e1e1;
    min-height: 36px;
    position: relative;
}
.calendar-day-event {
    position: absolute;
    left: 10px;
    right: 10px;
    top: 4px;
    min-height: 28px;
    background: #e3f0fc;
    border-left: 5px solid #2196f3;
    border-radius: 8px;
    color: #222;
    font-weight: 600;
    font-size: 1rem;
    padding: 7px 12px 6px 12px;
    box-shadow: 0 2px 8px rgba(33,150,243,0.10);
    z-index: 2;
    cursor: pointer;
    transition: box-shadow 0.2s;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.calendar-day-event.event-blue { background: #e3f0fc; border-left-color: #2196f3; }
.calendar-day-event.event-purple { background: #f3e8fd; border-left-color: #a259f7; }
.calendar-day-event.event-green { background: #eafaf3; border-left-color: #00c875; }
.calendar-day-event span {
    display: block;
    color: #888;
    font-size: 0.97em;
    font-weight: 400;
    margin-top: 2px;
}
@media (max-width: 900px) {
    .calendar-month-grid, .calendar-day-grid {
        margin-left: 10px;
        margin-right: 10px;
    }
}
@media (max-width: 600px) {
    .calendar-month-grid, .calendar-day-grid {
        margin: 0 2px;
        border-radius: 6px;
    }
}

/* Week View Grid (vertical time axis) */
.calendar-week-grid {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    grid-template-rows: auto repeat(12, var(--calendar-hour-height));
    background: #f7f8fa;
    border-radius: 12px;
    min-height: 0;
    box-shadow: 0 1px 4px rgba(33,150,243,0.04);
    overflow-y: auto;
    height: calc(100vh - 220px);
    position: relative;
}
.calendar-week-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: #eaf4fb;
    color: #1769aa;
    font-weight: 700;
    text-align: center;
    padding: 10px 0;
    font-size: 1.05rem;
    border-bottom: 1px solid #e1e1e1;
    grid-row: 1;
}
.calendar-week-time {
    text-align: right;
    color: #bbb;
    font-size: 0.98rem;
    padding: 8px 10px 0 0;
    height: 36px;
    line-height: 36px;
    background: #f7f8fa;
    border-bottom: 1px solid #e1e1e1;
    grid-column: 1;
}
.calendar-week-cell {
    background: #fff;
    border-bottom: 1px solid #e1e1e1;
    border-right: 1px solid #e1e1e1;
    min-height: var(--calendar-hour-height);
    position: relative;
    padding: 0;
}
.calendar-week-cell:last-child {
    border-right: none;
}
.calendar-week-event {
    position: absolute;
    left: 4px;
    right: 4px;
    top: 4px;
    min-height: 40px;
    background: #e3f0fc;
    border-left: 5px solid #2196f3;
    border-radius: 8px;
    color: #222;
    font-weight: 600;
    font-size: 1rem;
    padding: 10px 14px 8px 14px;
    box-shadow: 0 2px 8px rgba(33,150,243,0.10);
    z-index: 2;
    cursor: pointer;
    transition: box-shadow 0.2s;
    overflow: hidden;
    white-space: normal;
    text-overflow: ellipsis;
    pointer-events: auto;
}
.calendar-week-event.event-blue { background: #e3f0fc; border-left-color: #2196f3; }
.calendar-week-event.event-purple { background: #f3e8fd; border-left-color: #a259f7; }
.calendar-week-event.event-green { background: #eafaf3; border-left-color: #00c875; }
.calendar-week-event span {
    display: block;
    color: #888;
    font-size: 0.97em;
    font-weight: 400;
    margin-top: 2px;
}
@media (max-width: 900px) {
    .calendar-week-grid {
        margin-left: 10px;
        margin-right: 10px;
    }
}
@media (max-width: 600px) {
    .calendar-week-grid {
        margin: 0 2px;
        border-radius: 6px;
    }
}

/* Expense Modal Styles */
.expense-modal-content {
    background: #fff;
    margin: 6% auto;
    padding: 32px 36px 28px 36px;
    width: 420px;
    max-width: 96vw;
    border-radius: 14px;
    position: relative;
    box-shadow: 0 4px 24px rgba(33,150,243,0.13);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    animation: modalFadeIn 0.25s;
}
@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}
.expense-receipt-preview {
    margin-top: 8px;
    margin-bottom: 4px;
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(33,150,243,0.10);
}
.expense-tag {
    display: inline-block;
    background: #eaf4fb;
    color: #1769aa;
    font-weight: 600;
    font-size: 0.97em;
    border-radius: 12px;
    padding: 2px 12px;
    margin: 0 2px 2px 0;
    vertical-align: middle;
    transition: background 0.2s, color 0.2s;
}
.expense-tag[data-tag="Gas"] { background: #fff3e0; color: #ff9800; }
.expense-tag[data-tag="Meals"] { background: #fce4ec; color: #e91e63; }
.expense-tag[data-tag="Equipment"] { background: #e8f5e9; color: #388e3c; }
.expense-tag[data-tag="Supplies"] { background: #e3f2fd; color: #1976d2; }
.expense-tag[data-tag="Other"] { background: #ede7f6; color: #7c4dff; }
.expense-notes {
    display: inline-block;
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    cursor: pointer;
}
.expense-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #eaf4fb;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(33,150,243,0.06);
    padding: 18px 24px;
    margin-bottom: 20px;
    gap: 18px;
    position: sticky;
    top: 0;
    z-index: 10;
}
.expense-total {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1769aa;
    display: flex;
    align-items: center;
    gap: 10px;
}
.expense-total-amount {
    color: #2196f3;
    font-size: 1.35rem;
    font-weight: 800;
}
.expense-add-btn {
    background: #2196f3;
    color: #fff;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    padding: 10px 22px;
    font-size: 1.08rem;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(33,150,243,0.08);
    transition: background 0.2s;
}
.expense-add-btn:hover {
    background: #1769aa;
}
.expense-list-container {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(33,150,243,0.07);
    padding: 0 0 18px 0;
    margin-top: 18px;
    overflow-x: auto;
}
.expense-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 700px;
    font-size: 1.04rem;
}
.expense-table th, .expense-table td {
    padding: 16px 14px;
    text-align: left;
    border-bottom: 1px solid #f0f4fa;
    background: #fff;
    vertical-align: middle;
}
.expense-table th {
    background: #eaf4fb;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.98rem;
    letter-spacing: 0.04em;
    color: #1769aa;
    border-top: 1px solid #eaf4fb;
}
.expense-table tr:last-child td {
    border-bottom: none;
}
.expense-table tbody tr {
    transition: background 0.18s;
}
.expense-table tbody tr:hover {
    background: #f5faff;
}
.action-btn.delete-expense-btn {
    color: #e2445c;
    opacity: 0;
    transition: opacity 0.2s;
}
.expense-table tbody tr:hover .action-btn.delete-expense-btn {
    opacity: 1;
}
.expense-modal-content form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 24px;
    align-items: end;
}
.expense-modal-content .form-group {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    grid-column: span 1;
}
.expense-modal-content .form-group:nth-child(7),
.expense-modal-content .form-group:nth-child(8) {
    grid-column: 1 / -1;
}
.expense-modal-content .submit-btn {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    margin-top: 12px;
    background: #2196f3;
    color: #fff;
    font-weight: 700;
    font-size: 1.08rem;
    border-radius: 8px;
    padding: 12px 0;
    border: none;
    box-shadow: 0 2px 8px rgba(33,150,243,0.08);
    transition: background 0.2s;
}
.expense-modal-content .submit-btn:hover {
    background: #1769aa;
}
.expense-modal-content input[type="file"] {
    border: none;
    background: #f7f8fa;
    padding: 8px 0;
    font-size: 1rem;
    color: #333;
}
.expense-modal-content input,
.expense-modal-content select,
.expense-modal-content textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    font-size: 1rem;
    background: #f7f8fa;
    color: #222;
    margin-top: 2px;
    margin-bottom: 0;
    transition: border 0.2s;
}
.expense-modal-content input:focus,
.expense-modal-content select:focus,
.expense-modal-content textarea:focus {
    border: 1.5px solid #2196f3;
    background: #fff;
    outline: none;
}
.expense-modal-content textarea {
    resize: vertical;
}
.close-modal {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 1.6rem;
    color: #bbb;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 2;
}
.close-modal:hover {
    color: #e2445c;
}
@media (max-width: 600px) {
    .expense-modal-content {
        width: 98vw !important;
        min-width: 0;
        max-width: 98vw;
        left: 1vw;
        right: 1vw;
        padding: 18px 6px 18px 6px;
    }
    .expense-modal-content form {
        grid-template-columns: 1fr;
        gap: 14px 0;
    }
    .expense-modal-content .submit-btn {
        width: 100%;
        min-width: 0;
    }
}

/* Calendar Styles */
.calendar-container {
    margin-top: 20px;
    padding: 10px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#calendar {
    width: 100%;
    height: 300px;
}

/* FullCalendar Customization */
.fc {
    font-size: 0.9em;
}

.fc .fc-toolbar-title {
    font-size: 1.2em;
}

.fc .fc-button {
    padding: 0.3em 0.6em;
    font-size: 0.9em;
}

.fc .fc-daygrid-day-number {
    font-size: 0.9em;
}

.fc .fc-daygrid-day {
    min-height: 2em;
}

/* Remove card/box effect from calendar container */
.calendar-container, #calendar {
    background: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
} 