.nav-link-icon {
  font-size: 1.1rem;   /* slightly larger */
  position: relative;  
  top: -0.06rem;       /* nudge up */
}

.asteric{color: red;}
.errmsg{color:red; margin-top: 8px; margin-bottom: 1px;}
/*.navbar-brand {font-size: 36px;}
.logo-default{max-width: 175px; max-height: 50px; width: 100%; margin-top: 1px !important; min-height: 75px;}
.logo-default img{max-width: 170%; max-height: 120%; display: inline-block; float: none;}
*/

/* Household member grid layout */
.grid-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 768px) {
  .grid-container {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

.group-grid {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.group-tiles-portlet {
  padding: 0.625rem 0 0 0.313rem;
}

.group-tiles-usertitle {
  text-align: center;
  margin-top: 0.5rem;
}

.profile-content {
  overflow: hidden;
}

/* header navbar color fix */
/* Force solid background for navbar in light mode */
/* Light mode only - force solid background */
.theme-light .navbar.sticky-top {
    background-color: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
}

/* Product search modal dropdown background color fix - theme-aware backgrounds */
#search-results {
    background-color: var(--tblr-bg-surface);
    border: 1px solid var(--tblr-border-color);
    border-radius: var(--tblr-border-radius);
}

#search-results .list-group-item {
    background-color: var(--tblr-bg-surface);
    color: var(--tblr-body-color);
    border-color: var(--tblr-border-color);
}

#search-results .list-group-item:hover {
    background-color: var(--tblr-bg-surface-secondary);
}


/* Bootstrap Tagsinput Theme-Aware Styles */

.bootstrap-tagsinput {
    width: 100% !important;
    display: block;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--tblr-border-color);
    border-radius: var(--tblr-border-radius);
    background-color: var(--tblr-bg-forms);
    color: var(--tblr-body-color);
    min-height: calc(1.4285714em + 1rem + 2px);
}

.bootstrap-tagsinput input {
    background-color: transparent;
    color: inherit;
    border: none;
    outline: none;
    box-shadow: none;
    width: auto !important;
    min-width: 200px;
}

.bootstrap-tagsinput input::placeholder {
    color: var(--tblr-muted);
    opacity: 0.7;
}

.bootstrap-tagsinput .tag {
    background-color: var(--tblr-primary);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
    display: inline-block;
}

.bootstrap-tagsinput .tag [data-role="remove"] {
    margin-left: 0.5rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
}

.bootstrap-tagsinput .tag [data-role="remove"]:hover {
    color: white;
}

/* Dark theme specific styles */
[data-bs-theme="dark"] .bootstrap-tagsinput {
    background-color: #1a2234 !important;
    color: #f8fafc !important;
    border-color: #243049 !important;
}

[data-bs-theme="dark"] .bootstrap-tagsinput input {
    color: #f8fafc !important;
}

[data-bs-theme="dark"] .bootstrap-tagsinput input::placeholder {
    color: #8b99af !important;
}

/* Light theme specific styles (optional, uses defaults) */
[data-bs-theme="light"] .bootstrap-tagsinput {
    background-color: #ffffff;
    color: #1e293b;
    border-color: #d1d5db;
}

[data-bs-theme="light"] .bootstrap-tagsinput input {
    color: #1e293b;
}

[data-bs-theme="light"] .bootstrap-tagsinput input::placeholder {
    color: #6b7280;
}

/* Select2 is used on non-admin pages also so needs to be here */
/* ========================================
   CUSTOM ADMIN THEME STYLES
   Custom styles to augment Tabler theme
   These styles apply to admin pages only
   ======================================== */

/* ========================================
   SELECT2 DARK MODE SUPPORT
   Supports both data-bs-theme attribute and theme-* classes
   ======================================== */

/* Main selection box background - Multi-select */
[data-bs-theme="dark"] .select2-container--default.select2-container--open .select2-selection--multiple,
[data-bs-theme="dark"] .select2-container--default.select2-container--focus .select2-selection--multiple,
[data-bs-theme="dark"] .select2-container--default .select2-selection--multiple,
.theme-dark .select2-container--default.select2-container--open .select2-selection--multiple,
.theme-dark .select2-container--default.select2-container--focus .select2-selection--multiple,
.theme-dark .select2-container--default .select2-selection--multiple {
    background-color: var(--tblr-bg-surface) !important;
    border: 1px solid var(--tblr-border-color) !important;
    color: var(--tblr-body-color) !important;
}

/* Single selection box */
[data-bs-theme="dark"] .select2-container--default .select2-selection--single,
.theme-dark .select2-container--default .select2-selection--single {
    background-color: var(--tblr-bg-surface) !important;
    border-color: var(--tblr-border-color) !important;
}

[data-bs-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered,
.theme-dark .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--tblr-body-color) !important;
}

/* Selected items (pills/tags) in multi-select */
[data-bs-theme="dark"] .select2-container--default .select2-selection--multiple .select2-selection__choice,
.theme-dark .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: rgba(var(--tblr-primary-rgb), 0.2) !important;
    border-color: var(--tblr-primary) !important;
    color: var(--tblr-body-color) !important;
}

/* Remove button (X) on selected items */
[data-bs-theme="dark"] .select2-container--default .select2-selection--multiple .select2-selection__choice__remove,
.theme-dark .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: var(--tblr-body-color) !important;
    border-right-color: var(--tblr-primary) !important;
}

[data-bs-theme="dark"] .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover,
.theme-dark .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: var(--tblr-danger) !important;
}

/* Dropdown container */
[data-bs-theme="dark"] .select2-dropdown,
.theme-dark .select2-dropdown {
    background-color: var(--tblr-bg-surface) !important;
    border-color: var(--tblr-border-color) !important;
}

/* Search field in dropdown */
[data-bs-theme="dark"] .select2-search--dropdown .select2-search__field,
.theme-dark .select2-search--dropdown .select2-search__field {
    background-color: var(--tblr-bg-surface-dark) !important;
    border-color: var(--tblr-border-color) !important;
    color: var(--tblr-body-color) !important;
}

/* Results list container */
[data-bs-theme="dark"] .select2-results,
.theme-dark .select2-results {
    background-color: var(--tblr-bg-surface) !important;
}

/* Individual result items */
[data-bs-theme="dark"] .select2-results__option,
.theme-dark .select2-results__option {
    background-color: var(--tblr-bg-surface) !important;
    color: var(--tblr-body-color) !important;
}

/* Highlighted result (hover) */
[data-bs-theme="dark"] .select2-results__option--highlighted[aria-selected],
[data-bs-theme="dark"] .select2-results__option--highlighted,
.theme-dark .select2-results__option--highlighted[aria-selected],
.theme-dark .select2-results__option--highlighted {
    background-color: var(--tblr-primary) !important;
    color: white !important;
}

/* Selected result */
[data-bs-theme="dark"] .select2-results__option[aria-selected="true"],
.theme-dark .select2-results__option[aria-selected="true"] {
    background-color: rgba(var(--tblr-primary-rgb), 0.15) !important;
    color: var(--tblr-body-color) !important;
}

/* Placeholder text */
[data-bs-theme="dark"] .select2-container--default .select2-selection--multiple .select2-selection__placeholder,
.theme-dark .select2-container--default .select2-selection--multiple .select2-selection__placeholder {
    color: var(--tblr-secondary) !important;
}

/* Arrow in single select - closed state */
[data-bs-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__arrow b,
.theme-dark .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: var(--tblr-body-color) transparent transparent transparent !important;
}

/* Arrow in single select - open state */
[data-bs-theme="dark"] .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b,
.theme-dark .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent var(--tblr-body-color) transparent !important;
}

/* Loading message */
[data-bs-theme="dark"] .select2-results__option.loading-results,
.theme-dark .select2-results__option.loading-results {
    color: var(--tblr-secondary) !important;
}

/* No results message */
[data-bs-theme="dark"] .select2-results__message,
.theme-dark .select2-results__message {
    color: var(--tblr-secondary) !important;
}

/* ========================================
   FORM CONTROLS - CHECKBOX & RADIO DARK MODE FIX
   ======================================== */

/* Fix checkbox background in dark mode - match other form inputs */
[data-bs-theme="dark"] input[type="checkbox"],
.theme-dark input[type="checkbox"] {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-color: #1a2234 !important;  /* Match text inputs */
    border: 1px solid #4b5b7c !important;  /* Match text input borders */
    width: 1em !important;
    height: 1em !important;
    border-radius: 0.25em !important;
    cursor: pointer !important;
}

/* Checked state with checkmark */
[data-bs-theme="dark"] input[type="checkbox"]:checked,
.theme-dark input[type="checkbox"]:checked {
    background-color: var(--tblr-primary) !important;
    border-color: var(--tblr-primary) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e") !important;
    background-size: 100% 100% !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

/* Focus state */
[data-bs-theme="dark"] input[type="checkbox"]:focus,
.theme-dark input[type="checkbox"]:focus {
    border-color: var(--tblr-primary) !important;
    outline: 0 !important;
    box-shadow: 0 0 0 0.25rem rgba(var(--tblr-primary-rgb), 0.25) !important;
}

/* Radio buttons - same fix */
[data-bs-theme="dark"] input[type="radio"],
.theme-dark input[type="radio"] {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    background-color: #1a2234 !important;
    border: 1px solid #4b5b7c !important;
    width: 1em !important;
    height: 1em !important;
    border-radius: 50% !important;
    cursor: pointer !important;
}

/* Radio checked state with dot */
[data-bs-theme="dark"] input[type="radio"]:checked,
.theme-dark input[type="radio"]:checked {
    background-color: var(--tblr-primary) !important;
    border-color: var(--tblr-primary) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%23fff'/%3e%3c/svg%3e") !important;
    background-size: 100% 100% !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

[data-bs-theme="dark"] input[type="radio"]:focus,
.theme-dark input[type="radio"]:focus {
    border-color: var(--tblr-primary) !important;
    outline: 0 !important;
    box-shadow: 0 0 0 0.25rem rgba(var(--tblr-primary-rgb), 0.25) !important;
}

/* Disabled state */
[data-bs-theme="dark"] input[type="checkbox"]:disabled,
[data-bs-theme="dark"] input[type="radio"]:disabled,
.theme-dark input[type="checkbox"]:disabled,
.theme-dark input[type="radio"]:disabled {
    background-color: #1a2234 !important;
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

/***************************/
/* Styles for theme header */
/***************************/

/* ========================================================================
   SHARED HEADER STYLES
   Common CSS used by both tabler-header.blade.php and tabler-login-header.blade.php
   Add this to your custom-theme.css file
   ======================================================================== */

/* Desktop Header - theme-aware */
.navbar-brand-image {
    max-height: 40px;
    width: auto;
}

/* Settings dropdown card styling */
.dropdown-menu-card {
    min-width: 300px;
}

/* Button icon sizing */
.btn-icon {
    width: 2rem;
    height: 2rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Mobile Header - theme-aware */
.mobile-header {
    border-bottom: 1px solid var(--tblr-border-color);
}

/* Mobile Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1035;
    display: none;
}

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

/* Responsive adjustments for mobile popup menu */
@media (max-width: 991.98px) {
    .mobile-header .navbar-brand img {
        max-height: 36px;
    }
    
    /* Adjust mobile sidebar position left/right */
    #sidebar.show {
        left: 0rem;
		width: 14rem; /* needed on the login page but not working on the inauthenticated home page? - perhaps there's dueling CSS in the sidebar blade? Is there sidebar CSS that affects the same element? */
    }
	#sidebar .navbar-nav {
		width: 14rem; /* needed on the login page but not on the inauthenticated home page? - perhaps there's dueling CSS in the sidebar blade? Is there sidebar CSS that affects the same element? */
	}	
}

/* Needed on the login page but not on the other pages? */
/* Make header same height as the top of the sidebar */
/* Align header and sidebar heights */
/*
header.navbar-expand-md {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    max-height: 56px;
}

header.navbar-expand-md .container-xl {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}
*/

/***************************/
/* Styles for theme sidebar */
/***************************/

/* ========================================
   SHARED SIDEBAR STYLES
   Used by both main sidebar and login sidebar
   ======================================== */

/* ========================================
   SIDEBAR BASE STYLES
   ======================================== */

body.theme-light #sidebar-menu {
    background: rgba(255, 255, 255, 0.65); /* 65% white overlay */
}
/* We don't seem to need a definition for theme-dark, or else we have it defined elsewhere */

body.theme-dark .navbar-vertical {
    background-color: rgba(26, 32, 44, 0.25);
}

/* Desktop flyout */
/* Allow the popup to escape the sidebar -- its container is navbar-vertical */
.navbar-vertical {
    overflow: visible;
}

/* Disable Bootstrap collapse ONLY on desktop (we still need it on mobile) */
@media (min-width: 992px) {
    .navbar-vertical.collapsed .dropdown-parent > .nav-link {
        pointer-events: auto;
    }

    .navbar-vertical.collapsed .submenu-regular {
        display: none !important;
    }
}

.navbar-vertical .container-fluid {
    padding: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: transparent !important; /* Force transparent */
}

.navbar-vertical .navbar-collapse {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

@media (min-width: 992px) {
    .navbar-vertical .navbar-collapse {
        overflow: visible !important;
    }
}

/* ========================================
   POPUP MENU (Desktop flyout when sidebar is collapsed)
   ======================================== */

body.theme-light .submenu-popup,
body.theme-dark .submenu-popup {
    position: fixed !important;
    left: 4rem !important;
    top: 25 !important;
    z-index: 300 !important;
}

.submenu-popup {
    display: none;
    left: 4rem;
    min-width: 220px;
    background: var(--tblr-bg-surface);
    border: 1px solid var(--tblr-border-color);
    box-shadow: var(--tblr-box-shadow);
    border-radius: var(--tblr-border-radius);
    padding: 0.5rem 0;
}

body.theme-light .submenu-popup {
    background: rgba(255, 255, 255, 0.9); /* 90% white overlay */
}

body.theme-dark .submenu-popup {
    background: rgba(0, 0, 0, 0.8); /* 80% black overlay */
}

.submenu-popup-header {
    padding: 0.5rem 1rem;
    font-weight: 600; /* tabler overrides this with 400 */
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--tblr-muted);
    border-bottom: 1px solid var(--tblr-border-color);
    margin-bottom: 0.25rem;
}

.submenu-popup-item {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--tblr-body-color);
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.submenu-popup-item:hover {
    background-color: var(--tblr-hover-bg);
    color: var(--tblr-primary);
}

.submenu-popup-item.active {
    background-color: rgba(var(--tblr-primary-rgb), 0.1);
    color: var(--tblr-primary);
    font-weight: 500;
}

/* Never show popup on mobile */
@media (max-width: 991.98px) {
    .submenu-popup {
        display: none !important;
    }
}

/* ========================================
   COLLAPSED STATE (Icon-only mode)
   ======================================== */

/* Always collapsed on login page - never expandable on desktop */
.navbar-vertical.collapsed {
    width: 4rem;
}

/* Show small logo when collapsed */
.navbar-brand-image-small {
    max-height: 32px;
    width: auto;
    display: block;
}

.navbar-vertical.collapsed .nav-link-title,
.navbar-vertical.collapsed .hr-text,
.navbar-vertical.collapsed .chevron,
.navbar-vertical.collapsed .navbar-brand-image {
    opacity: 0;
    visibility: hidden;
    width: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Center icons when collapsed */
.navbar-vertical.collapsed .nav-link {
    justify-content: center;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
/*    padding-left: 0;
    padding-right: 0; */
}

.navbar-vertical.collapsed .submenu-regular {
    display: none;
}

/* ========================================
   NAVIGATION ITEMS
   ======================================== */

.nav-item {
    margin: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    color: var(--tblr-body-color);
    border-radius: 0;
    transition: background-color 0.15s ease;
}

.nav-link:hover {
    background-color: var(--tblr-hover-bg);
    color: var(--tblr-primary);
}

.nav-link.active,
.nav-item.active > .nav-link {
    background-color: rgba(var(--tblr-primary-rgb), 0.1);
    color: var(--tblr-primary);
    font-weight: 500;
}

.nav-link-icon {
    width: 1.5rem;
    height: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.25rem;
}

.nav-link-title {
    flex: 1;
    white-space: nowrap;
    transition: opacity 0.3s ease, visibility 0.3s ease, width 0.3s ease;
}

/* ========================================
   DROPDOWNS / SUBMENUS
   ======================================== */

.dropdown-parent > .nav-link {
    cursor: pointer;
}

.chevron {
    width: 1rem;
    height: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, opacity 0.3s ease, visibility 0.3s ease;
}

.chevron::after {
    content: "";
    display: inline-block;
    width: 0.4rem;
    height: 0.4rem;
    border-right: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.15s ease;
}

.dropdown-parent > .nav-link[aria-expanded="true"] .chevron::after {
    transform: rotate(-135deg);
}

.submenu-regular {
    padding-left: 0;
}

.submenu-regular .nav-link {
    padding-left: 2.5rem;
    font-size: 0.875rem;
}

.navbar-vertical.collapsed .dropdown-parent {
    position: relative;
}

/* ========================================
   MOBILE RESPONSIVE - SHARED STYLES
   ======================================== */

@media (max-width: 991.98px) {
    /* Never apply collapsed state on mobile */
    .navbar-vertical.collapsed {
        width: 16rem;
    }

    .navbar-vertical.collapsed .nav-link-title,
    .navbar-vertical.collapsed .hr-text,
    .navbar-vertical.collapsed .chevron,
    .navbar-vertical.collapsed .navbar-brand-image {
        opacity: 1;
        visibility: visible;
        width: auto;
    }

    /* Always show regular submenus on mobile */
    .navbar-vertical.collapsed .submenu-regular {
        display: block !important;
    }

    .navbar-vertical .navbar-collapse {
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    /* Mobile: Hide collapse toggle and logo, show close button */
    #sidebar-collapse-btn {
        display: none !important;
    }
    
    .navbar-vertical .navbar-brand-link {
        display: none !important;
    }
    
    #sidebar-close-btn {
        display: flex !important;
        margin-left: auto;
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

@media (min-width: 992px) {
    .center-on-desktop {
        text-align: center;
        justify-content: center !important;
        align-items: center !important;
    }
}
