/* Navbar gap for menu items */
.navbar-gap {
    gap: 2.5em;
}

.btn-search { white-space: nowrap !important; }

/* Client selector form width */
.client-form-width {
    max-width: 220px;
}

.client-select-width {
    max-width: 180px;
    min-width: 120px;
}

html {
    font-size: 16px;
}

@media (max-width: 991px) {
    .container {
        max-width: 100% !important;
        width: 100% !important;
    }

    html {
        font-size: 15px;
    }

    /*h1,*/
    /*h2,*/
    h3,
    h4,
    h5,
    h6 {
        font-size: 0.95em;
    }

    th {
        font-size: 85%;
    }

    /* Left-align menu items when hamburger is shown */
    .navbar-collapse .navbar-nav {
        margin-left: 0 !important;
        margin-right: auto !important;
        text-align: left;
        align-items: flex-start !important;
        padding-top: 1rem;
        padding-bottom: 0.5rem;
        width: 100%;
        gap: 0 !important;
    }

    .navbar-nav .nav-item {
        width: 100%;
        margin-bottom: 1rem;
    }

    /* Make all menu items have consistent font size on mobile */
    .navbar-nav .nav-link,
    .navbar-nav .btn,
    .navbar-nav .nav-btn,
    .navbar-nav span.fw-bold,
    .navbar-nav button,
    .navbar-nav select,
    .navbar-nav .form-select,
    .navbar-nav a,
    .mobile-logout-text,
    .navbar-nav i,
    .navbar-nav .fa,
    .navbar-nav .fas,
    .navbar-nav .far,
    .navbar-nav .fa-solid,
    .navbar-nav .fa-regular,
    #clientSelect,
    .nav-item select,
    .navbar-nav *,
    .navbar-nav .nav-item span.fw-bold,
    .navbar-nav .nav-item span.me-2,
    .navbar-nav .nav-item form,
    .navbar-nav .nav-item select,
    .navbar-nav .nav-item .form-select,
    .navbar-nav .nav-item .client-select-width {
        font-size: 1.2rem !important;
    }

    .navbar-nav .nav-item.d-flex {
        display: block !important;
    }

    .navbar-nav .nav-item .me-2 {
        display: block;
        margin-bottom: 0.5rem;
        margin-right: 0 !important;
    }

    .navbar-nav .nav-item form {
        max-width: 100% !important;
    }

    .navbar-nav .nav-item form select {
        max-width: 100% !important;
    }

    .dropdown-menu {
        width: 100%;
        margin-top: 0.25rem;
        position: static !important;
        transform: none !important;
        float: none;
        box-shadow: none;
        border-radius: 0.25rem;
    }

    .navbar-nav .dropdown .btn {
        width: 100%;
        text-align: left;
        justify-content: flex-start;
        display: flex !important;
        align-items: center;
    }
    
    /* Show logout text on mobile */
    .mobile-logout-text {
        display: inline-block !important;
        margin-right: 7px;
    }
    
    /* Override Bootstrap d-none class for the logout text on mobile devices */
    span.d-none.d-inline-block.mobile-logout-text {
        display: inline-block !important;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    /*h1,*/
    /*h2,*/
    h3,
    h4,
    h5,
    h6 {
        font-size: 0.9em;
    }

    .container,
    .container-fluid {
        padding-left: 16px;
        padding-right: 16px;
    }

    /* Truncate email text in Recent Quote Requests table */
    td.email-truncate {
        max-width: 120px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        vertical-align: middle;
    }

    /* Truncate Last Updated text in Recent Quote Requests table */
    td.updated-truncate {
        max-width: 110px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        vertical-align: middle;
    }

    /* Prevent wrapping of Actions column icons */
    td.actions-nowrap {
        white-space: nowrap;
    }

    .actions-menu-width {
        min-width: 170px;
        max-width: 180px;
    }

    .actions-col {
        width: 180px;
    }

    .product-input-row>[class^='col-'] {
        margin-bottom: 0.75rem;
    }
}

@media (max-width: 580px) {

    .actions-menu-width {
        min-width: 140px;
        max-width: 150px;
    }
    
    /* Ensure search input takes available space but button stays visible */
    .product-search-form .search-group input[type="text"] {
        max-width: none !important;
        width: auto !important;
        flex: 1 1 auto !important;
        min-width: 100px !important;
    }
    
    /* Ensure button doesn't wrap */
    .product-search-form .search-group button {
        white-space: nowrap !important;
    }

    .actions-col {
        width: 150px;
    }

    html {
        font-size: 13px;
    }

    /*h1,*/
    /*h2,*/
    h3,
    h4,
    h5,
    h6 {
        font-size: 0.85em;
    }

    .container,
    .container-fluid {
        padding-left: 8px;
        padding-right: 8px;
    }
    
    /* Stack product action buttons below search on mobile */
    form.mt-4.b-3.d-flex.product-search-form {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    
    /* Keep search input and button together on same line */
    .search-group {
        width: 100%;
        margin-bottom: 0.75rem !important;
    }
    
    .search-group input[type="text"] {
        flex: 1;
        min-width: 0;
    }
    
    .search-group button[type="submit"] {
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    form.mt-4.b-3.d-flex.product-search-form > a.btn {
        width: 100%;
        margin-bottom: 0.5rem;
        margin-right: 0 !important;
    }
}
@media (max-width: 500px) {
    /* Hide Email column in Recent Quote Requests */
    /* Truncate Email column in client_logins.php */
    th.email-truncate,
    td.email-truncate {
        max-width: 120px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        vertical-align: middle;
    }
    th.email-truncate,
    td.email-truncate {
        display: none !important;
    }

    /* Hide Last Login column in Clients table */
    th.last-login-col,
    td.last-login-col {
        display: none !important;
    }

    /* Fix Last Updated truncation */
    td.updated-truncate {
        max-width: 80px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        vertical-align: middle;
    }
}

/* --- Actions Dropdown Menu Positioning and Appearance --- */
.actions-menu-dropdown {
    display: none;
    position: absolute;
    left: 0;
    top: 110%;
    z-index: 1000;
    border: 1px solid #ccc;
    border-radius: 0.375rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
    background: #fff;
}

.actions-menu-width {
    min-width: 210px;
    max-width: 220px;
}

.actions-col {
    width: 220px;
}

/* --- Select button and caret for Actions Dropdown --- */
.actions-toggle-select {
    /*min-width: 170px;*/
    font-weight: 500;
    font-size: 0.92em !important;
    padding: 0.7rem 2.25rem 0.7rem 2.25rem;
    background-color: white !important;
}

.caret-select {
    border: solid #888;
    border-width: 0 2px 2px 0;
    display: inline-block;
    padding: 3px;
    transform: rotate(45deg);
    margin-left: 6px;
    margin-bottom: 2px;
}

/* --- Actions Dropdown for Clients Table --- */
.actions-dropdown .actions-toggle {
    color: #333;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 0.375rem;
    /*min-width: 120px;*/
    padding: 0.5rem 1.25rem 0.5rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75em;
    box-shadow: none;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.actions-dropdown .actions-toggle:focus {
    outline: 2px solid var(--dfab-blue, #005a9c);
    outline-offset: 2px;
    border-color: var(--dfab-blue, #005a9c);
}

.actions-dropdown .actions-toggle .caret {
    border: solid #888;
    border-width: 0 2px 2px 0;
    display: inline-block;
    padding: 3px;
    transform: rotate(45deg);
    margin-left: 6px;
    margin-bottom: 2px;
}

.actions-dropdown .actions-menu {
    padding: 0.25rem 0;
    display: none;
    border: 1px solid #ccc;
    border-radius: 0.375rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
}

.actions-dropdown .actions-menu .dropdown-item {
    color: #212529;
    background: none;
    border: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    font-size: 1.05em;
    border-radius: 0;
    padding: 0.65rem 1.5rem 0.65rem 2.5rem;
    position: relative;
    line-height: 1.5;
}

.actions-dropdown .actions-menu .dropdown-item i {
    color: inherit !important;
    font-size: 1.1em;
    width: 1em;
    text-align: center;
    margin-right: 0.25em;
    vertical-align: middle;
}

.actions-dropdown .actions-menu .dropdown-item:hover,
.actions-dropdown .actions-menu .dropdown-item:focus {
    background: var(--dfab-light-blue) !important; /* #0d6efd !important; */
    color: #fff !important;
    text-decoration: none;
}

/* --- Actions Dropdown for Clients Table --- */
.actions-dropdown .actions-toggle {
    color: inherit;
    background: none;
    border: none;
    outline: none;
    font-size: 1.25em;
    cursor: pointer;
}

.actions-dropdown .actions-menu {
    padding: 0.25rem 0;
    display: none;
}

.actions-dropdown .actions-menu .dropdown-item {
    color: #212529;
    background: none;
    border: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    font-size: 1em;
}

.actions-dropdown .actions-menu .dropdown-item:hover,
.actions-dropdown .actions-menu .dropdown-item:focus {
    background: #f0f4f8;
    color: var(--dfab-light-blue, #005a9c);
    text-decoration: none;
}

/* Add vertical spacing between stacked inputs in product form on mobile */
.product-input-row {
    margin-bottom: 1.25rem !important;
}

:root {
    --dfab-blue: #005a9c;
    --dfab-gold: #f90;
    --dfab-light-blue: #58b9da;
}

.btn-primary, .bg-primary { color: white !important; background-color: var(--dfab-light-blue) !important; border-color: var(--dfab-light-blue) !important;}
a, .text-primary { color: #333 !important; }
.btn-secondary { color: white !important; }
.alert-info { background-color: #ECECEC !important; border-color: var(--dfab-light-blue) !important; }

/*
body {
    background-color: #f8f9fa;
}
*/

.navbar,
.navbar.navbar-dark,
.navbar.navbar-expand-lg {
    background-color: #e0e4ea !important;
    background-image: none !important;
    box-shadow: none !important;
    border: none !important;
}

.navbar .navbar-nav .nav-link {
    color: #333 !important;
}

/* Remove box appearance for navbar buttons */
.nav-btn {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #333 !important;
    font-weight: 500;
    text-align: left;
    padding-left: 0 !important;
    padding-right: 0.5rem !important;
    font-size: 1rem !important;
}

/* Hide logout text by default */
.mobile-logout-text {
    display: none !important;
}

@media (min-width: 992px) {
    /*
    form.mt-4.b-3.d-flex {
        flex-wrap: wrap !important;
        align-items: stretch !important;
    }
    form.mt-4.b-3.d-flex > input[type="text"] {
        flex: 1 1 100%;
        min-width: 0;
        margin-bottom: 0.75rem !important;
        margin-right: 0 !important;
    }
    form.mt-4.b-3.d-flex > button[type="submit"] {
        margin-right: 0.5rem !important;
        margin-bottom: 0.75rem !important;
        white-space: nowrap;
    }
    form.mt-4.b-3.d-flex > a.btn {
        width: 100%;
        margin-bottom: 0.5rem;
        margin-right: 0 !important;
    }
        */
}

.navbar-nav span.fw-bold {
    font-size: 1rem !important;
}

.navbar-nav .form-select {
    font-size: 1rem !important;
}

/* Show logout text only on mobile styles are in the main 991px media query */

/* Product search form specific styles to keep search and button on same line */
.product-search-form .search-group {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
}

body>div>table>tbody>tr.table-secondary.text-secondary>td {
    color: #666 !important;
}

/* Ensure disabled table rows have normal borders */
.table-secondary,
.table-secondary.text-secondary,
tr.table-secondary.text-secondary td {
    border-color: #dee2e6 !important;
}

/* Custom orange badge for "waiting for dfab" status */
.badge.bg-orange {
    background-color: #ff6600 !important;
    color: white !important;
    border-color: #ff6600 !important;
}

