html, body {
    max-width: 100%;
    overflow-x: hidden;
    position: relative;
}

body {
    background-color: #f8f9fa;
}

.container-fluid {
    max-width: 100%;
    overflow-x: hidden;
}

.navbar-brand {
    font-weight: 800;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
}

.navbar-brand i {
    font-size: 1.25rem;
}

/* ------------------------------
   Notes column (mobile friendly)
   ------------------------------ */
.notes-cell {
    max-width: 220px;
}

.notes-scroll {
    max-height: 3.5em;           /* ~2 lines */
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
}

@media (min-width: 768px) {
    .notes-cell {
        max-width: 420px;
    }
}

/* Floating Navbar */
.sticky-top-container {
    position: sticky;
    top: 0;
    z-index: 1050;
    background-color: #f8f9fa;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.navbar-floating {
    padding-top: 0;
    padding-bottom: 0;
}

@media (max-width: 991.98px) {
    .navbar-floating {
        padding: 0;
    }
}

.navbar-floating .container-fluid {
    background-color: #0d6efd;
    border-radius: 50px;
    padding: 0.35rem 1.25rem;
    box-shadow: 0 4px 20px rgba(13, 110, 253, 0.25);
    transition: background-color 0.3s, transform 0.2s;
    display: flex;
    align-items: center;
    min-height: 46px;
    will-change: background-color, transform;
}

.navbar-floating .container-fluid:active {
    transform: scale(0.98);
}

.back-btn-sticky {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    color: white !important;
    text-decoration: none;
    font-size: 1.2rem;
    transition: transform 0.2s;
    width: 32px;
    height: 32px;
}

@media (min-width: 992px) {
    .back-btn-sticky {
        margin-right: 1.25rem;
        font-size: 1.4rem;
    }
}

.back-btn-sticky:hover {
    transform: translateX(-3px);
}

.navbar-floating:hover .container-fluid {
    background-color: #0b5ed7;
}

@media (max-width: 991.98px) {
    .sticky-top-container {
        padding-top: 0.25rem;
        padding-bottom: 0.25rem;
    }
    .navbar-floating .container-fluid {
        border-radius: 50px;
        padding: 0.25rem 1rem;
        min-height: 50px;
    }
    .navbar-brand {
        font-size: 1.5rem;
    }
    .navbar-brand i {
        font-size: 1.75rem;
    }
    .navbar-toggler {
        padding: 0.5rem 0.75rem;
        font-size: 1.5rem;
    }
    .navbar-toggler-icon {
        width: 1.75rem;
        height: 1.75rem;
    }
    
    .back-btn-sticky {
        font-size: 1.6rem;
        width: 45px;
        height: 45px;
    }
    
    /* Ensure submenu/nav fonts are fully white on mobile */
    .navbar-floating .nav-link,
    .navbar-floating .dropdown-item {
        color: #ffffff !important;
        opacity: 1 !important;
        -webkit-font-smoothing: antialiased;
    }
}

/* Floating Action Button for mobile */
.fab-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1030;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.fab {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #0d6efd;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    text-decoration: none;
    transition: transform 0.2s, background-color 0.2s;
}

.fab-secondary {
    width: 42px;
    height: 42px;
    background-color: #6c757d;
}

.fab:hover {
    background-color: #0b5ed7;
    color: white;
    transform: scale(1.05);
}

/* Mobile View specific improvements */
@media (max-width: 991.98px) {
    .container-fluid.px-4 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}
input:not([type="checkbox"]), select, textarea {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    appearance: none;
    border-radius: 0.375rem;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

/* Contact Card/Tile styling */
.contact-card {
    transition: transform 0.2s, box-shadow 0.2s;
    will-change: transform, box-shadow;
}

.contact-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1) !important;
}

.contact-card .card-title a {
    color: #0d6efd;
    transition: color 0.2s;
}

.contact-card .card-title a:hover {
    color: #0a58ca;
}

.x-small {
    font-size: 0.75rem;
}

/* Dashboard Specific Styles */
.icon-box {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    will-change: transform;
}

.hover-bg-light:hover {
    background-color: #f8f9fa;
}

.hover-bg-blue-light:hover {
    background-color: #e7f1ff;
}

.hover-bg-green-light:hover {
    background-color: #e9f7ef;
}

.hover-bg-light:hover .icon-box {
    transform: scale(1.1);
}

#dashboardTabs .nav-link {
    border: none;
    color: #6c757d;
    padding: 0.75rem 1.25rem;
}

#dashboardTabs .nav-link.active {
    color: #0d6efd;
    border-bottom: 3px solid #0d6efd;
    background: none;
}

#dashboardTabs .nav-link#new-tab.active {
    color: #198754;
    border-bottom-color: #198754;
}

/* Reduced & Evenly Spaced Page Header */
.row.align-items-end:has(h1.h2),
.row.align-items-center:has(h1.h2) {
    margin-top: 0.25rem !important;
    margin-bottom: 0.5rem !important;
}

@media (max-width: 991.98px) {
    .row.align-items-end:has(h1.h2),
    .row.align-items-center:has(h1.h2) {
        margin-top: 0 !important;
        margin-bottom: 0.75rem !important;
    }
}

h1.h2 {
    margin-bottom: 0 !important;
    font-weight: 700;
}

/* Card refinements */
.card {
    border-radius: 12px;
}

.card-header {
    border-top-left-radius: 12px !important;
    border-top-right-radius: 12px !important;
}



