.table-scrollable {
  overflow: visible !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
}

/* Ensure table content (like dropdowns) can overflow rows/cells */
.table {
  overflow: visible !important;
}

/* Allow vertical overflow for dropdowns while keeping horizontal scroll */
.table-responsive {
  overflow-y: visible !important;
  overflow-x: auto !important;
}

/* Fix dropdown overflow in tables */
.table .btn-group {
  position: relative !important;
}


/* Ensure table containers don't clip dropdowns */
.portlet-body {
  overflow: visible !important;
}

.table-container {
  overflow: visible !important;
}

/* Dropdown menu that opens upward */
.dropdown-menu-up {
  top: auto !important;
  bottom: 100% !important;
  margin-bottom: 2px !important;
  margin-top: 0 !important;
}

/* Ensure Bootstrap Select containers don't clip dropdowns */
.portlet-body .bootstrap-select {
  position: static !important;
}

/* Fix Bootstrap Select button styling */
.bootstrap-select .btn {
  border: 1px solid #c2cad8 !important;
}

.bootstrap-select .btn:focus {
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25) !important;
}

/* Additional Bootstrap Select fixes */
.bootstrap-select > .dropdown-toggle {
  width: 100% !important;
  padding-right: 25px !important;
}

.bootstrap-select .dropdown-toggle .caret {
  position: absolute !important;
  top: 50% !important;
  right: 12px !important;
  margin-top: -2px !important;
}

/* Hide duplicate carets - only show one */
.bootstrap-select .dropdown-toggle .bs-caret {
  display: none !important;
}

/* Ensure bootstrap-select fills container width */
.bootstrap-select {
  width: 100% !important;
}

.bootstrap-select .btn {
  width: 100% !important;
}

/* Padding for AI button on labour descriptions only */
.padding-right-35 {
  padding-right: 35px !important;
}

/* Ensure parent containers don't interfere */
.portlet, .portlet-body, .tab-content, .tab-pane {
  overflow: visible !important;
}

/* Removed debug border on dropdown menu */

/* Scoped visibility handled by plugins (open/show classes) */

/* Removed global overflow override */

/* Specific override for common hiding patterns */
.tab-content,
.portlet-body,
.form-group,
.col-md-6,
.col-md-4,
.col-md-3 {
  overflow: visible !important;
  position: relative !important;
}
#app .modal { overflow-y: auto; }

/* SweetAlert over modal fix */
.swal-above-modal .sweet-alert {
  z-index: 99999 !important;
}

.swal-above-modal .sweet-overlay {
  z-index: 99998 !important;
}

/* General SweetAlert z-index fix for modals */
.sweet-alert {
  z-index: 99999 !important;
}

.sweet-overlay {
  z-index: 99998 !important;
}



/* Mobile-friendly modals */
@media (max-width: 767px) {
  .modal-dialog {
    width: 100% !important;
    margin: 10px !important;
  }
  .modal-content {
    border-radius: 6px;
  }
  .modal-body {
    max-height: calc(100vh - 140px);
    overflow-y: auto;
  }
}

.table .btn-group {
  position: relative; /* default positioning to anchor absolute dropdowns */
}

.modal .twitter-typeahead .tt-menu,
.modal-open .tt-menu {
  z-index: 2000 !important;
}

.modal-open .tt-menu,
.modal .twitter-typeahead .tt-menu {
  z-index: 200000 !important;
  width: 100% !important;
  max-width: calc(100vw - 32px) !important;
}

/* If Select2 is enabled later, ensure its dropdown is above modals */
.modal-open .select2-container .select2-dropdown,
.modal .select2-container .select2-dropdown {
  z-index: 10060 !important;
}

/* PO Email Modal specific Select2 dropdown z-index */
#po-send-email-modal .select2-dropdown,
#po-send-email-modal .select2-container--open .select2-dropdown {
  z-index: 10060 !important;
  position: absolute !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  background-color: #fff !important;
  border: 2px solid #e1e5e9 !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}

#po-send-email-modal .select2-results,
#po-send-email-modal .select2-results__options {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  background-color: #fff !important;
}

#po-send-email-modal .select2-results__option {
  background-color: #fff !important;
}

#po-send-email-modal .select2-results__option--highlighted,
#po-send-email-modal .select2-results__option[aria-selected="true"] {
  background-color: #36c6d3 !important;
  color: #fff !important;
}

#po-send-email-modal .select2-results__option:hover {
  background-color: #f8f9fa !important;
}

#po-send-email-modal .modal-body {
  overflow: visible !important;
}
/* here you can put your own css to customize and override the theme */

.tab-content {
  box-shadow: none !important;
}

/* Remove blue border from portlets on job create page */
.portlet.bordered {
    border-left: none !important;
}

.portlet.bordered > .portlet-title {
    border-bottom: 1px solid #e1e5e9 !important;
}

/* Material Design Checkbox Fixes */
/* Ensure proper material design checkbox styling */
.md-checkbox {
    margin-bottom: 10px;
    padding-left: 0;
    position: relative;
    display: block;
}

.md-checkbox label {
    font-weight: 500;
    color: #495057;
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-left: 8px;
    line-height: 1.4;
    position: relative;
    padding-left: 30px;
    min-height: 24px;
}

.md-checkbox label i {
    margin-right: 8px;
    color: #6c757d;
}

/* Ensure proper checkbox box positioning */
.md-checkbox label > .box {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid #e1e5e9;
    border-radius: 4px;
    background: #fff;
    transition: all 0.3s ease;
}

/* Ensure proper checkbox check mark positioning */
.md-checkbox label > .check {
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 12px;
    line-height: 1;
    opacity: 0;
    transition: all 0.3s ease;
}

/* Fix checkbox group styling */
.checkbox-group {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e1e5e9;
}

.checkbox-group-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.checkbox-group-title i {
    margin-right: 8px;
    color: #36c6d3;
}

.checkbox-group-description {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.checkbox-list .md-checkbox {
    margin-bottom: 0;
    padding: 12px 16px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e1e5e9;
    transition: all 0.3s ease;
}

.checkbox-list .md-checkbox:hover {
    background: #f8f9fa;
    border-color: #36c6d3;
}

.checkbox-list .md-checkbox input[type=checkbox]:checked ~ label {
    color: #36c6d3;
}

.checkbox-list .md-checkbox input[type=checkbox]:checked ~ label i {
    color: #36c6d3;
}

/* Ensure proper material design checkbox appearance */
.md-checkbox input[type=checkbox] {
    opacity: 0;
    position: absolute;
    z-index: -1;
}

/* Fix for material design checkbox box and check elements */
.md-checkbox label > .box {
    border-color: #e1e5e9;
    transition: all 0.3s ease;
}

.md-checkbox label > .check {
    color: #fff;
    transition: all 0.3s ease;
}

.md-checkbox input[type=checkbox]:checked ~ label > .box {
    background-color: #36c6d3;
    border-color: #36c6d3;
}

.md-checkbox input[type=checkbox]:checked ~ label > .check {
    color: #fff;
    opacity: 1;
}

/* Hover effects for material design checkboxes */
.md-checkbox:hover label > .box {
    border-color: #36c6d3;
}

/* Focus states for accessibility */
.md-checkbox input[type=checkbox]:focus ~ label > .box {
    border-color: #36c6d3;
    box-shadow: 0 0 0 0.2rem rgba(54, 198, 211, 0.25);
}

/* Additional checkbox fixes for modals and dynamic content */
.modal .md-checkbox,
.form-modal .md-checkbox {
    margin-bottom: 15px;
}

.modal .md-checkbox label,
.form-modal .md-checkbox label {
    font-size: 14px;
    color: #495057;
}

/* Ensure checkboxes work in form groups */
.form-group .md-checkbox {
    margin-bottom: 8px;
}

.form-group .md-checkbox:last-child {
    margin-bottom: 0;
}

/* Fix for inline checkboxes */
.md-checkbox.md-checkbox-inline {
    display: inline-block;
    margin-right: 20px;
    margin-bottom: 10px;
}

.md-checkbox.md-checkbox-inline:last-child {
    margin-right: 0;
}

/* Ensure proper spacing in checkbox lists */
.checkbox-list .md-checkbox {
    margin-bottom: 8px;
    padding: 12px 16px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e1e5e9;
    transition: all 0.3s ease;
}

.checkbox-list .md-checkbox:hover {
    background: #f8f9fa;
    border-color: #36c6d3;
}

.checkbox-list .md-checkbox input[type=checkbox]:checked ~ label {
    color: #36c6d3;
}

.checkbox-list .md-checkbox input[type=checkbox]:checked ~ label i {
    color: #36c6d3;
}

/* Select Styles */
.bootstrap-select {
    width: 100% !important;
}

.bootstrap-select .btn-group {
    width: 100% !important;
    display: block !important;
}

.bootstrap-select .dropdown-toggle {
    width: 100% !important;
    display: block !important;
    background-color: #fff !important;
    border: 1px solid #c2cad8 !important;
}

.bootstrap-select .filter-option {
    width: 100% !important;
    display: block !important;
}

.bootstrap-select .filter-option-inner {
    width: 100% !important;
    display: block !important;
}

.bootstrap-select .filter-option-inner-inner {
    width: 100% !important;
    display: block !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}


/* Job Type Flags Styling */
.job-type-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.job-type-flags .label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 4px;
    margin: 2px;
}

.job-type-flags .label i {
    font-size: 11px;
}

/* Job Create Form Styles */
/* Modern Form Styling */
.form-progress {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}

.step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 25px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: #e9ecef;
    z-index: 1;
}

.step.active:not(:last-child)::after {
    background: #36c6d3;
}

.step-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #e1e5e9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 10px;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.step.active .step-icon {
    background: #36c6d3;
    color: white;
    box-shadow: 0 0 0 3px rgba(54, 198, 211, 0.2);
}

.step-label {
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.step.active .step-label {
    color: #36c6d3;
}

/* Form Section Styling */
.form-section {
    margin-bottom: 30px;
}

.form-section:not(:last-child) {
    border-bottom: 1px solid #e1e5e9;
    padding-bottom: 30px;
}

/* Info Cards */
.info-card {
    background: #f8f9fa;
    border-radius: 4px;
    padding: 20px;
    border-left: 4px solid #36c6d3;
    height: 100%;
}

.info-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    font-weight: 600;
}

.info-card-header i {
    margin-right: 10px;
    font-size: 16px;
}

.tips-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tips-list li {
    padding: 8px 0;
    border-bottom: 1px solid #e1e5e9;
    font-size: 13px;
}

.tips-list li:last-child {
    border-bottom: none;
}

.tips-list li:before {
    content: '✓';
    font-weight: bold;
    margin-right: 8px;
}

/* Modern Form Controls */
.form-control {
    border-radius: 4px;
    border: 1px solid #e1e5e9;
    padding: 12px 15px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #36c6d3;
    box-shadow: 0 0 0 0.2rem rgba(54, 198, 211, 0.25);
}

.control-label {
    font-weight: 600;
    margin-bottom: 8px;
}

.control-label i {
    margin-right: 8px;
    width: 16px;
}

.help-block {
    font-size: 12px;
    margin-top: 5px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    font-weight: 500;
    color: #495057;
}

.checkbox-label i {
    margin-right: 8px;
    color: #6c757d;
}

/* Section Dividers */
.section-divider {
    border: none;
    height: 1px;
    background: linear-gradient(to right, transparent, #dee2e6, transparent);
    margin: 30px 0;
}

/* Timeline and Budget Sections */
.timeline-section h4,
.budget-section h4 {
    color: #495057;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.timeline-section h4 i,
.budget-section h4 i {
    margin-right: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .progress-steps {
        flex-direction: column;
        gap: 20px;
    }
    
    .step:not(:last-child)::after {
        display: none;
    }
    
    .info-card {
        margin-top: 20px;
    }
    
    .modern-actions .btn {
        display: block;
        margin: 10px 0;
        width: 100%;
    }
}

/* Animation for form sections */
.form-section {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced input groups */
.input-group .form-control {
    border-right: none;
}

.input-group .btn {
    border-left: none;
    border-radius: 0 8px 8px 0;
}

/* Better spacing */
.form-group {
    margin-bottom: 25px;
}

.row {
    margin-bottom: 20px;
}

/* Enhanced select styling */
.bs-select {
    border-radius: 8px;
}

.bs-select .dropdown-toggle {
    border-radius: 8px;
    padding: 12px 15px;
}

/* Wizard Navigation */
.wizard-navigation {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-top: 30px;
    border-top: 1px solid #e1e5e9;
}

.wizard-navigation .btn {
    padding: 12px 24px;
    font-weight: 600;
    border-radius: 6px;
}

.wizard-navigation .btn i {
    margin: 0 5px;
}

/* Form Actions Styling */
.form-actions {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-top: 30px;
    border-top: 1px solid #e1e5e9;
}

.form-actions .btn {
    padding: 12px 24px;
    font-weight: 600;
    border-radius: 6px;
    margin: 0 5px;
}

.form-actions .btn i {
    margin: 0 5px;
}

.form-actions .text-center {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}



/* Wizard Section Visibility - This will be handled by JavaScript */
/* .form-section {
    display: none;
}

.form-section:first-child {
    display: block;
} */

/* Modern Form Controls Styling */
/* Base form control styles */
.form-control:not(.po-email-field) {
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.5;
    transition: all 0.3s ease;
    background-color: #fff;
    color: #495057;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    min-height: 48px;
    height: 48px;
    box-sizing: border-box;
}

.form-control:focus {
    border-color: #36c6d3;
    box-shadow: 0 0 0 0.2rem rgba(54, 198, 211, 0.25);
    outline: none;
    background-color: #fff;
}

.form-control:hover {
    border-color: #adb5bd;
}

.form-control::placeholder {
    color: #6c757d;
    opacity: 0.7;
}

/* Modern Select Styling */
.bs-select,
select.form-control:not(.po-email-field) {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
    cursor: pointer;
    border-radius: 8px;
}

.bs-select:focus,
select.form-control:not(.po-email-field):focus {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2336c6d3' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
}

/* PO Email Field - Hide original select, show Select2 container */
.po-email-field {
    display: none !important;
}

.po-email-field + .select2-container {
    display: block !important;
    width: 100% !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Bootstrap Select Override */
.bootstrap-select .btn {
    border: 2px solid #e1e5e9 !important;
    border-radius: 8px !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    background-color: #fff !important;
    color: #495057 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s ease !important;
    height: auto !important;
    min-height: 48px !important;
}

.bootstrap-select .btn:hover {
    border-color: #adb5bd !important;
    background-color: #fff !important;
}

.bootstrap-select .btn:focus,
.bootstrap-select .btn.open {
    border-color: #36c6d3 !important;
    box-shadow: 0 0 0 0.2rem rgba(54, 198, 211, 0.25) !important;
    background-color: #fff !important;
}

.bootstrap-select .dropdown-toggle {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e") !important;
    background-position: right 12px center !important;
    background-repeat: no-repeat !important;
    background-size: 16px !important;
    padding-right: 40px !important;
}

.bootstrap-select .dropdown-toggle:focus {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2336c6d3' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e") !important;
}

/* Input Groups */
.input-group .form-control {
    border-right: none;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    height: 48px;
    min-height: 48px;
    line-height: 1.5;
    padding: 12px 16px;
    border-radius: 8px 0 0 8px;
}

.input-group .btn {
    border-left: none;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border: 2px solid #e1e5e9;
    border-left: none;
    background-color: #f8f9fa;
    color: #495057;
    transition: all 0.3s ease;
    height: 48px;
    min-height: 48px;
    line-height: 1.5;
    padding: 12px 16px;
}

.input-group .btn:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.input-group .btn:focus {
    border-color: #36c6d3;
    box-shadow: 0 0 0 0.2rem rgba(54, 198, 211, 0.25);
}

/* Button group adjustments */
.input-group-btn .btn {
    border-radius: 0 8px 8px 0;
    height: 48px;
    min-height: 48px;
    line-height: 1.5;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-left: none;
    background-color: #f8f9fa;
    color: #495057;
    transition: all 0.3s ease;
}

.input-group-btn .btn:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.input-group-btn .btn:focus {
    border-color: #36c6d3;
    box-shadow: 0 0 0 0.2rem rgba(54, 198, 211, 0.25);
}

/* Ensure consistent height for all input group elements */
.input-group .form-control,
.input-group .btn,
.input-group-btn .btn {
    height: 48px;
    min-height: 48px;
    line-height: 1.5;
    box-sizing: border-box;
}

/* Override blue button styling in input groups to ensure consistency */
.input-group .btn.blue,
.input-group-btn .btn.blue {
    height: 48px;
    min-height: 48px;
    line-height: 1.5;
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
    border: 2px solid #3598dc;
    border-left: none;
    background-color: #3598dc;
    color: #FFFFFF;
    transition: all 0.3s ease;
}

.input-group .btn.blue:hover,
.input-group-btn .btn.blue:hover {
    background-color: #217ebd;
    border-color: #217ebd;
    color: #FFFFFF;
}

.input-group .btn.blue:focus,
.input-group-btn .btn.blue:focus {
    background-color: #217ebd;
    border-color: #217ebd;
    color: #FFFFFF;
    box-shadow: 0 0 0 0.2rem rgba(53, 152, 220, 0.25);
}

/* Textarea styling */
textarea.form-control {
    min-height: 100px;
    height: auto;
    resize: vertical;
}

/* File input styling */
input[type="file"].form-control {
    padding: 8px 12px;
    line-height: 1.2;
    min-height: 48px;
}

/* Ensure consistent styling for all input types */
input[type="text"].form-control,
input[type="email"].form-control,
input[type="password"].form-control,
input[type="number"].form-control,
input[type="tel"].form-control,
input[type="url"].form-control,
input[type="search"].form-control,
input[type="date"].form-control,
input[type="time"].form-control,
input[type="datetime-local"].form-control {
    min-height: 48px;
    padding: 12px 16px;
    line-height: 1.5;
}

/* Checkbox and Radio styling */
.form-check-input {
    width: 18px;
    height: 18px;
    border: 2px solid #e1e5e9;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: absolute;
    left: 0;
    top: 2px;
    margin: 0;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: #36c6d3;
    border-color: #36c6d3;
    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 10 3 3 6-6'/%3e%3c/svg%3e");
    background-size: 12px 12px;
    background-position: center;
    background-repeat: no-repeat;
}

/* Form check container styling */
.form-check {
    padding-left: 24px;
    margin-bottom: 0.5rem;
    display: block;
    position: relative;
    min-height: 24px;
}

.form-check-label {
    margin-left: 0;
    margin-bottom: 0;
    cursor: pointer;
    display: block;
    line-height: 1.4;
    padding-top: 2px;
}

/* Radio button styling */
.form-check-input[type="radio"] {
    border-radius: 50%;
    position: absolute;
    left: 0;
    top: 2px;
    margin: 0;
}

/* Checkbox group spacing */
.checkbox-group .form-check,
.checkbox-group .md-checkbox {
    margin-bottom: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #e1e5e9;
    transition: all 0.3s ease;
}

.checkbox-group .form-check:hover,
.checkbox-group .md-checkbox:hover {
    background: #f8f9fa;
    border-color: #36c6d3;
}

.form-check-input:checked {
    background-color: #36c6d3;
    border-color: #36c6d3;
    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 10 3 3 6-6'/%3e%3c/svg%3e");
    background-size: 12px 12px;
    background-position: center;
    background-repeat: no-repeat;
}

.form-check-input:focus {
    border-color: #36c6d3;
    box-shadow: 0 0 0 0.2rem rgba(54, 198, 211, 0.25);
}

/* Form validation states */
.form-control.is-valid {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.form-control.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Print job summary modal checkbox fixes */
.print-job-summary-modal .md-checkbox {
    margin-bottom: 12px;
}

.print-job-summary-modal .md-checkbox label {
    font-size: 14px;
    color: #495057;
    padding-left: 35px;
}

.print-job-summary-modal .md-checkbox label > .box {
    width: 22px;
    height: 22px;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.print-job-summary-modal .md-checkbox label > .check {
    left: 7px;
    font-size: 14px;
}

/* Ensure checkboxes work in job create form */
.job-create-form .md-checkbox {
    margin-bottom: 10px;
}

.job-create-form .md-checkbox label {
    font-size: 14px;
    color: #495057;
}

/* Fix for any remaining checkbox styling issues */
input[type="checkbox"] {
    cursor: pointer;
}

input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(54, 198, 211, 0.25);
}

/* Form group spacing */
.form-group {
    margin-bottom: 1.5rem;
}

/* Label styling */
.control-label,
label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    display: block;
}

/* Help text styling */
.help-block {
    font-size: 12px;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* Required field indicator */
.required {
    color: #dc3545;
    font-weight: bold;
}

/* Disabled state */
.form-control:disabled,
.form-control[readonly] {
    background-color: #f8f9fa;
    opacity: 0.65;
    cursor: not-allowed;
}

/* Modern focus ring for accessibility */
.form-control:focus {
    outline: none;
}

/* Custom select2 styling to match */
.select2-container--default .select2-selection--single,
.select2-container--bootstrap .select2-selection--single {
    border: 2px solid #e1e5e9 !important;
    border-radius: 8px !important;
    height: 48px !important;
    padding: 12px 16px !important;
    background-color: #fff !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

.select2-container--default .select2-selection--single:focus,
.select2-container--bootstrap .select2-selection--single:focus {
    border-color: #36c6d3 !important;
    box-shadow: 0 0 0 0.2rem rgba(54, 198, 211, 0.25) !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered,
.select2-container--bootstrap .select2-selection--single .select2-selection__rendered {
    color: #495057 !important;
    line-height: 1.5 !important;
    padding: 0 !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow,
.select2-container--bootstrap .select2-selection--single .select2-selection__arrow {
    height: 46px !important;
    right: 12px !important;
}

.select2-dropdown {
    border: 2px solid #e1e5e9 !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--bootstrap .select2-results__option--highlighted[aria-selected] {
    background-color: #36c6d3 !important;
    color: #fff !important;
}

/* Fix Select2 search box display */
.select2-container--default .select2-search--dropdown,
.select2-container--bootstrap .select2-search--dropdown {
    display: none !important;
}

.select2-container--default.select2-container--open .select2-search--dropdown,
.select2-container--bootstrap.select2-container--open .select2-search--dropdown {
    display: block !important;
    padding: 8px !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field,
.select2-container--bootstrap .select2-search--dropdown .select2-search__field {
    border: 2px solid #e1e5e9 !important;
    border-radius: 6px !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus,
.select2-container--bootstrap .select2-search--dropdown .select2-search__field:focus {
    border-color: #36c6d3 !important;
    box-shadow: 0 0 0 0.2rem rgba(54, 198, 211, 0.25) !important;
    outline: none !important;
}

/* Select2 multiple selection styling */
.select2-container--default .select2-selection--multiple,
.select2-container--bootstrap .select2-selection--multiple {
    border: 2px solid #e1e5e9 !important;
    border-radius: 8px !important;
    min-height: 48px !important;
    padding: 8px 12px !important;
    background-color: #fff !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

.select2-container--default .select2-selection--multiple:focus,
.select2-container--bootstrap .select2-selection--multiple:focus {
    border-color: #36c6d3 !important;
    box-shadow: 0 0 0 0.2rem rgba(54, 198, 211, 0.25) !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice,
.select2-container--bootstrap .select2-selection--multiple .select2-selection__choice {
    background-color: #36c6d3 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 4px !important;
    padding: 4px 8px !important;
    margin: 2px 4px 2px 0 !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove,
.select2-container--bootstrap .select2-selection--multiple .select2-selection__choice__remove {
    color: #fff !important;
    margin-right: 5px !important;
    font-weight: bold !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover,
.select2-container--bootstrap .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #fff !important;
    background-color: rgba(255, 255, 255, 0.2) !important;
}

/* Ensure Select2 multiple selection search input is visible and editable */
.select2-container--default .select2-selection--multiple .select2-search--inline,
.select2-container--bootstrap .select2-selection--multiple .select2-search--inline {
    display: inline-block !important;
    width: auto !important;
    min-width: 150px !important;
}

.select2-container--default .select2-selection--multiple .select2-search--inline .select2-search__field,
.select2-container--bootstrap .select2-selection--multiple .select2-search--inline .select2-search__field {
    border: none !important;
    outline: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    min-width: 150px !important;
    height: auto !important;
    line-height: 1.5 !important;
    font-size: 14px !important;
    color: #495057 !important;
    cursor: text !important;
}

.select2-container--default .select2-selection--multiple .select2-search--inline .select2-search__field:focus,
.select2-container--bootstrap .select2-selection--multiple .select2-search--inline .select2-search__field:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Ensure Select2 container is visible */
.select2-container {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.select2-container .select2-selection {
    cursor: text !important;
}

/* PO Email Field specific Select2 styling */
.po-email-field {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.po-email-field.select2-hidden-accessible {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.po-email-field + .select2-container {
    width: 100% !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 1 !important;
}

.po-email-field + .select2-container,
.po-email-field.select2-hidden-accessible + .select2-container {
    width: 100% !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 1 !important;
}

.po-email-field + .select2-container .select2-selection--multiple,
.po-email-field.select2-hidden-accessible + .select2-container .select2-selection--multiple {
    min-height: 48px !important;
    padding: 8px 12px !important;
    border: 2px solid #e1e5e9 !important;
    border-radius: 8px !important;
    background-color: #fff !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    cursor: text !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    align-content: flex-start !important;
}

.po-email-field + .select2-container .select2-selection--multiple:focus,
.po-email-field + .select2-container .select2-selection--multiple:focus-within {
    border-color: #36c6d3 !important;
    box-shadow: 0 0 0 0.2rem rgba(54, 198, 211, 0.25) !important;
    outline: none !important;
}

.po-email-field + .select2-container .select2-selection--multiple .select2-selection__rendered,
.po-email-field.select2-hidden-accessible + .select2-container .select2-selection--multiple .select2-selection__rendered {
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    width: 100% !important;
}

.po-email-field + .select2-container .select2-selection--multiple .select2-selection__choice,
.po-email-field.select2-hidden-accessible + .select2-container .select2-selection--multiple .select2-selection__choice {
    background-color: #36c6d3 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 4px !important;
    padding: 4px 8px !important;
    margin: 2px 4px 2px 0 !important;
    font-size: 14px !important;
    display: inline-block !important;
    float: none !important;
    vertical-align: middle !important;
    line-height: 1.5 !important;
}

.po-email-field + .select2-container .select2-selection--multiple .select2-selection__choice__remove {
    color: #fff !important;
    margin-right: 5px !important;
    font-weight: bold !important;
    cursor: pointer !important;
}

.po-email-field + .select2-container .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #fff !important;
    background-color: rgba(255, 255, 255, 0.2) !important;
}

.po-email-field + .select2-container .select2-selection--multiple .select2-search--inline,
.po-email-field.select2-hidden-accessible + .select2-container .select2-selection--multiple .select2-search--inline {
    display: inline-block !important;
    width: auto !important;
    min-width: 150px !important;
    flex: 1 1 auto !important;
    vertical-align: middle !important;
    margin: 2px 0 !important;
}

.po-email-field + .select2-container .select2-selection--multiple .select2-search--inline .select2-search__field,
.po-email-field.select2-hidden-accessible + .select2-container .select2-selection--multiple .select2-search--inline .select2-search__field {
    border: none !important;
    outline: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    min-width: 150px !important;
    height: auto !important;
    line-height: 1.5 !important;
    font-size: 14px !important;
    color: #495057 !important;
    cursor: text !important;
    vertical-align: middle !important;
}

.po-email-field + .select2-container .select2-selection--multiple .select2-search--inline .select2-search__field:focus {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

.po-email-field + .select2-container .select2-selection--multiple .select2-selection__placeholder {
    color: #6c757d !important;
    line-height: 32px !important;
}

/* Change Select2 container position from absolute to relative when open */
.po-email-field + .select2-container.select2-container--open,
.po-email-field.select2-hidden-accessible + .select2-container.select2-container--open {
    position: relative !important;
}

.po-email-field + .select2-container.select2-container--bootstrap.select2-container--open,
.po-email-field.select2-hidden-accessible + .select2-container.select2-container--bootstrap.select2-container--open {
    position: relative !important;
}

/* Clear button styling for PO email fields */
.po-email-field + .select2-container .select2-selection--multiple .select2-selection__clear,
.po-email-field.select2-hidden-accessible + .select2-container .select2-selection--multiple .select2-selection__clear {
    position: absolute !important;
    right: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
    padding: 4px 8px !important;
    font-size: 16px !important;
    line-height: 1 !important;
    width: auto !important;
    height: auto !important;
    min-width: 24px !important;
    min-height: 24px !important;
    cursor: pointer !important;
    color: #999 !important;
    background: transparent !important;
    border: none !important;
    z-index: 10 !important;
}

.po-email-field + .select2-container .select2-selection--multiple .select2-selection__clear:hover,
.po-email-field.select2-hidden-accessible + .select2-container .select2-selection--multiple .select2-selection__clear:hover {
    color: #dc3545 !important;
    background: rgba(220, 53, 69, 0.1) !important;
    border-radius: 4px !important;
}

/* Ensure the rendered container has relative positioning for absolute clear button */
.po-email-field + .select2-container .select2-selection--multiple .select2-selection__rendered,
.po-email-field.select2-hidden-accessible + .select2-container .select2-selection--multiple .select2-selection__rendered {
    position: relative !important;
    padding-right: 40px !important;
}

/* Datepicker styling */
.datepicker,
.datetimepicker {
    border: 2px solid #e1e5e9 !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}

.datepicker table tr td.active,
.datepicker table tr td.active:hover {
    background-color: #36c6d3 !important;
    border-color: #36c6d3 !important;
}

/* Timepicker styling */
.bootstrap-timepicker-widget table {
    border: 2px solid #e1e5e9 !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .bootstrap-select .btn {
        font-size: 16px !important;
    }
}

/* Remove rules that were hiding Select2 widgets */

/* Form Validation Error Styling */
.form-group.has-error .form-control {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

.form-group.has-error .form-control:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

.form-group.has-error .bs-select .select2-selection {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

.form-group.has-error .help-block {
    color: #dc3545 !important;
    font-size: 12px;
    margin-top: 5px;
}

.form-group.has-error label {
    color: #dc3545 !important;
}

.form-group.has-error .input-group-addon {
    border-color: #dc3545 !important;
    background-color: #f8d7da !important;
    color: #721c24 !important;
}

/* Wizard Section Error Highlighting */
.wizard-section.has-error {
    border: 2px solid #dc3545 !important;
    border-radius: 8px;
    background-color: #fff5f5;
}

.wizard-section.has-error .section-header {
    background-color: #dc3545 !important;
    color: white !important;
}

.wizard-section.has-error .section-header i {
    color: white !important;
}

/* Error Animation */
@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.form-group.has-error .form-control {
    animation: errorShake 0.5s ease-in-out;
}

/* Required Field Indicator */
.form-control[required] + label::after,
.form-control[required] ~ label::after {
    content: " *";
    color: #dc3545;
    font-weight: bold;
}



/* Current Section Highlighting */
.form-section.current-section {
    border-radius: 8px;
    background-color: #f8f9ff;
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.1);
}

/* Error Message Styling */
.help-block.error-message {
    color: #dc3545 !important;
    font-size: 12px;
    margin-top: 5px;
    font-weight: 500;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ======================================
   DataTable Responsive Search Styles
   ====================================== */

/* Desktop styles */
.datatable-search-group {
    width: 350px;
}

/* Override DataTables default input width */
div.dataTables_wrapper div.dataTables_filter input {
    width: auto !important;
}

/* Remove DataTables responsive expand/collapse plus icons */
table.dataTable.dtr-inline.collapsed>tbody>tr>td:first-child:before,
table.dataTable.dtr-inline.collapsed>tbody>tr>th:first-child:before {
    display: none !important;
}

/* Mobile styles */
@media (max-width: 768px) {
    .dataTables_wrapper .dataTables_filter {
        text-align: center;
        margin-bottom: 10px;
    }
    
    .datatable-search-group {
        width: 100% !important;
        max-width: none !important;
    }
    
    .dataTables_wrapper .dataTables_length {
        text-align: center;
        margin-bottom: 10px;
    }
    
    .dataTables_wrapper .dataTables_length select {
        margin: 0 auto;
        display: inline-block;
    }
    
    /* Stack the top controls vertically on mobile */
    .dataTables_wrapper .row:first-child .col-md-6 {
        text-align: center;
        margin-bottom: 10px;
    }
}

/* Tablet styles */
@media (max-width: 992px) and (min-width: 769px) {
    .datatable-search-group {
        width: 280px;
    }
}

/* ===============================
   EMPLOYEE SCHEDULE STYLES
   =============================== */

.schedule-grid {
    font-size: 12px;
}

.employee-header {
    width: 200px;
    background-color: #f5f5f5;
    font-weight: bold;
}

.day-header {
    width: 120px;
    background-color: #f5f5f5;
    padding: 8px 4px;
}

.day-name {
    font-weight: bold;
    font-size: 11px;
}

.day-date {
    font-size: 14px;
    font-weight: bold;
}

.employee-cell {
    background-color: #f9f9f9;
    padding: 8px;
    vertical-align: middle;
}

.employee-info strong {
    font-size: 13px;
}

.schedule-cell {
    position: relative;
    padding: 4px;
    height: 60px;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid #ddd;
}

.schedule-cell:hover {
    background-color: #f0f0f0;
}

.schedule-cell.has-schedule {
    background-color: #e8f5e8;
}

.schedule-cell.has-schedule:hover {
    background-color: #d4edda;
}

.schedule-cell.multiple-jobs {
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

.schedule-cell.multiple-jobs:hover {
    background-color: #ffeaa7;
}

.schedule-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2px;
}

.no-schedule {
    color: #007bff;
}

.no-schedule small {
    display: block;
    margin-top: 2px;
    font-size: 10px;
}

.has-schedule-content {
    position: relative;
    width: 100%;
}

.job-title {
    font-weight: bold;
    font-size: 10px;
    line-height: 1.2;
    margin-bottom: 2px;
    word-wrap: break-word;
}

.job-id {
    background-color: rgba(51,122,183,0.1);
    padding: 1px 3px;
    border-radius: 2px;
    font-weight: bold;
    font-size: 9px;
    margin-right: 4px;
}

.schedule-remove, .job-remove {
    position: absolute;
    top: 0;
    right: 0;
    padding: 1px 3px;
    font-size: 8px;
    line-height: 1;
}

.job-item {
    margin-bottom: 4px;
    padding: 3px 6px;
    border-radius: 3px;
    background-color: rgba(255,255,255,0.7);
    border-left: 3px solid #28a745;
    position: relative;
}

.job-item.priority-high {
    border-left-color: #dc3545;
    background-color: rgba(220,53,69,0.1);
}

.job-item.priority-low {
    border-left-color: #6c757d;
    background-color: rgba(108,117,125,0.1);
}

.hours-allocated, .cost-code {
    font-size: 9px;
    color: #666;
    font-style: italic;
}

.job-times {
    margin: 2px 0;
}

.time-range {
    color: #666;
    font-weight: bold;
    font-size: 9px;
    display: block;
}

.time-range i {
    margin-right: 2px;
}

.schedule-notes {
    margin: 2px 0;
    max-width: 100%;
}

.notes-text {
    color: #666;
    font-style: italic;
    font-size: 9px;
    display: block;
    word-wrap: break-word;
    max-width: 100%;
}

.notes-text i {
    margin-right: 2px;
}

.job-link {
    color: #337ab7;
    text-decoration: none;
    font-weight: bold;
}

.job-link:hover {
    color: #23527c;
    text-decoration: underline;
}

.job-info {
    margin: 2px 0;
}

.customer-name {
    color: #666;
    font-size: 9px;
    font-style: italic;
}

.customer-name i {
    margin-right: 2px;
}

.cost-code {
    background-color: rgba(0,123,255,0.1);
    padding: 1px 3px;
    border-radius: 2px;
    display: inline-block;
    margin: 1px;
}

.more-jobs {
    text-align: center;
    padding: 2px;
    font-style: italic;
    color: #6c757d;
    font-size: 9px;
}

.selected-job-info {
    padding: 8px;
    margin: 0;
}

/* Employee Hide/Show Controls */
.employee-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.employee-controls {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.employee-cell:hover .employee-controls {
    opacity: 1;
}

.employee-controls .btn {
    padding: 2px 4px;
    margin-left: 4px;
    border: none;
    background: none;
}

.employee-controls .btn:hover {
    background-color: rgba(0,0,0,0.1);
    border-radius: 2px;
}

.hidden-employee {
    opacity: 0.5;
    background-color: #f8f8f8;
}

.hidden-employee .employee-cell {
    background-color: #f0f0f0;
}

.btn-group {
    margin-right: 5px;
}

/* ===============================
   SALES ORDER STYLING
   =============================== */

/* ==== SALES ORDER LINE ITEM STYLING ==== */

/* Main line item container */
.sales-order-line-item {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #e3f2fd;
    border-radius: 12px;
    padding: 0;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: visible; /* Changed from hidden to visible to allow dropdowns to overflow */
}

.sales-order-line-item:hover {
    border-color: #2196f3;
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.15);
    transform: translateY(-2px);
}

/* Row styling */
.sales-order-line-item .item-info-row {
    background: linear-gradient(90deg, #f8f9fa 0%, #ffffff 100%);
    padding: 20px 25px 15px;
    border-bottom: 1px solid #e9ecef;
    margin: 0;
}

.sales-order-line-item .pricing-info-row {
    background: linear-gradient(90deg, #ffffff 0%, #f1f8ff 100%);
    padding: 15px 25px 20px;
    margin: 0;
}

/* Form group styling */
.sales-order-line-item .form-group {
    margin-bottom: 12px;
    position: relative;
}

/* Label styling */
.sales-order-line-item .control-label {
    font-weight: 600;
    font-size: 12px;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: block;
}

/* Item info row labels */
.item-info-row .control-label {
    color: #2c3e50;
}

/* Pricing info row labels */
.pricing-info-row .control-label {
    color: #1976d2;
}

/* Input styling */
.sales-order-line-item input.form-control,
.sales-order-line-item select.form-control {
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    height: 38px;
    background: #ffffff;
}

.sales-order-line-item input.form-control:focus,
.sales-order-line-item select.form-control:focus {
    border-color: #2196f3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
    background: #fff;
}

/* Readonly field styling */
.sales-order-line-item input[readonly] {
    background: #f8f9fa;
    border-color: #dee2e6;
    color: #6c757d;
    font-weight: 600;
}

/* Currency and percentage fields */
.sales-order-line-item .currency-mask {
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
    border-color: #4caf50;
    color: #2e7d32;
    font-weight: 600;
    text-align: right;
}

.sales-order-line-item .percentage-mask {
    background: linear-gradient(135deg, #fff3e0 0%, #fffe8c 100%);
    border-color: #ff9800;
    color: #e65100;
    font-weight: 600;
    text-align: right;
}

/* Auto-calculated field highlighting */
.sales-order-line-item .auto-calculated {
    background: linear-gradient(135deg, #e3f2fd 0%, #f0f8ff 100%) !important;
    border-color: #2196f3 !important;
    color: #1565c0 !important;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1) !important;
}

/* Delete button styling */
.sales-order-line-item .mt-repeater-delete {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
}

.sales-order-line-item .mt-repeater-delete:hover {
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4);
}

/* Calculation status styling */
.sales-order-line-item .calculation-status {
    position: absolute;
    bottom: -18px;
    left: 0;
    font-size: 10px;
    color: #4caf50;
    font-weight: 600;
    background: rgba(76, 175, 80, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    z-index: 10;
}

/* ==== TYPEAHEAD FIXES ==== */
/* Global typeahead dropdown width fix - make dropdown as wide as input */
.twitter-typeahead {
    width: 100% !important;
    display: block !important;
    position: relative !important;
}

.twitter-typeahead .tt-input {
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Ensure typeahead works properly in form groups */
.form-group .twitter-typeahead {
    width: 100% !important;
}

.input-group .twitter-typeahead {
    width: 100% !important;
}

/* Ensure typeahead works properly in table cells */
.table td .twitter-typeahead,
.table th .twitter-typeahead {
    width: 100% !important;
}

.twitter-typeahead .tt-menu {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1000 !important;
}

/* Higher specificity rules to override any conflicting styles */
div.twitter-typeahead .tt-menu,
.form-group div.twitter-typeahead .tt-menu,
.input-group div.twitter-typeahead .tt-menu,
.table td div.twitter-typeahead .tt-menu,
.table th div.twitter-typeahead .tt-menu {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    left: 0 !important;
    right: 0 !important;
}

/* Override any inline styles that might be set by JavaScript */
.twitter-typeahead .tt-menu[style] {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
}

/* Force typeahead to inherit parent width */
.twitter-typeahead {
    display: block !important;
    width: 100% !important;
    position: relative !important;
}

/* Ensure typeahead input takes full width */
.twitter-typeahead input.tt-input,
.twitter-typeahead .tt-input {
    width: 100% !important;
    box-sizing: border-box !important;
}

.twitter-typeahead .tt-menu {
    /* Use calc to ensure exact width match */
    width: calc(100%) !important;
    min-width: calc(100%) !important;
    max-width: calc(100%) !important;
}

/* Additional fallback rules */
.tt-menu {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Override the original 160px min-width from typeahead.css */
.tt-menu {
    min-width: 100% !important;
}

/* Nuclear option - highest specificity possible */
body .twitter-typeahead .tt-menu,
html body .twitter-typeahead .tt-menu,
body div.twitter-typeahead .tt-menu {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Target specific common containers */
.portlet .twitter-typeahead .tt-menu,
.portlet-body .twitter-typeahead .tt-menu,
.modal .twitter-typeahead .tt-menu,
.modal-body .twitter-typeahead .tt-menu {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
}

/* Last resort - target all possible typeahead menus */
[class*="tt-menu"],
[class^="tt-menu"],
.tt-dropdown-menu {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Specific fixes for mt-repeater items */
.mt-repeater-item .twitter-typeahead {
    width: 100% !important;
    display: block !important;
}

.mt-repeater-item .twitter-typeahead .tt-input {
    width: 100% !important;
}

.mt-repeater-item .twitter-typeahead .tt-menu {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    z-index: 1000 !important;
    width: 100% !important;
    max-height: 200px !important;
    overflow-y: auto !important;
    background: white !important;
    border: 2px solid #2196f3 !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15) !important;
    margin-top: 2px !important;
}

.mt-repeater-item .twitter-typeahead .tt-suggestion {
    padding: 12px 16px !important;
    border-bottom: 1px solid #f0f0f0 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.mt-repeater-item .twitter-typeahead .tt-suggestion:hover,
.mt-repeater-item .twitter-typeahead .tt-suggestion.tt-cursor {
    background: linear-gradient(90deg, #e3f2fd 0%, #f8f9fa 100%) !important;
    color: #1976d2 !important;
}

.mt-repeater-item .twitter-typeahead .tt-suggestion:last-child {
    border-bottom: none !important;
}

/* ==== VISUAL ENHANCEMENTS ==== */

/* Add item number indicator */
.sales-order-line-item:before {
    content: counter(line-item);
    counter-increment: line-item;
    position: absolute;
    top: -10px;
    right: 20px;
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(33, 150, 243, 0.4);
}

/* Reset counter on container */
.mt-repeater {
    counter-reset: line-item;
}

/* Focus states for better UX */
.sales-order-line-item:focus-within {
    border-color: #2196f3;
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.15);
}

/* Loading state for calculations */
.sales-order-line-item.calculating {
    opacity: 0.8;
    pointer-events: none;
}

.sales-order-line-item.calculating:after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #2196f3;
    border-radius: 50%;
    border-top-color: transparent;
    animation: salesOrderSpin 1s linear infinite;
}

@keyframes salesOrderSpin {
    to { transform: rotate(360deg); }
}

/* ==== SALES ORDER SUMMARY SECTION ==== */

.sales-order-summary-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #e3f2fd;
    border-radius: 12px;
    margin: 30px 0 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1; /* Lower z-index so dropdowns appear above it */
    overflow: hidden;
}

.sales-order-summary-section:hover {
    border-color: #2196f3;
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.15);
    transform: translateY(-2px);
}

.summary-section-header {
    background: linear-gradient(90deg, #f8f9fa 0%, #ffffff 100%);
    padding: 20px 25px 15px;
    border-bottom: 1px solid #e9ecef;
    margin: 0;
}

.summary-section-header h4 {
    margin: 0;
    color: #2c3e50;
    font-weight: 600;
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-section-header h4 i {
    margin-right: 10px;
    color: #2196f3;
    font-size: 20px;
}

.summary-totals-grid {
    background: linear-gradient(90deg, #ffffff 0%, #f1f8ff 100%);
    padding: 20px 25px;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.summary-total-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.summary-total-item.final-total {
    border: 2px solid #e3f2fd;
    border-radius: 8px;
    padding: 12px;
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.1);
}

.summary-label {
    font-weight: 600;
    font-size: 12px;
    color: #1976d2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: block;
    text-align: center;
}

.summary-total-item.final-total .summary-label {
    color: #2c3e50;
    font-size: 13px;
    font-weight: 700;
}

.summary-input {
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    height: 40px;
    background: #ffffff;
    text-align: center;
    width: 100%;
    max-width: 180px;
}

.summary-input:focus {
    border-color: #2196f3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
    background: #fff;
}

.readonly-input {
    background: #f8f9fa !important;
    border-color: #dee2e6 !important;
    color: #6c757d !important;
    cursor: not-allowed;
}

.editable-input {
    background: linear-gradient(135deg, #fff3e0 0%, #fffe8c 100%);
    border-color: #ff9800;
    color: #e65100;
}

.final-amount {
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%) !important;
    border-color: #4caf50 !important;
    color: #2e7d32 !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1) !important;
}

/* ==== SALES ORDER NOTES SECTION ==== */

.sales-order-notes-section {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #e3f2fd;
    border-radius: 12px;
    padding: 20px 25px;
    margin: 20px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.sales-order-notes-section:hover {
    border-color: #2196f3;
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.15);
    transform: translateY(-2px);
}

.notes-label {
    font-weight: 600;
    font-size: 14px;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    display: block;
}

.notes-label i {
    margin-right: 8px;
    color: #2196f3;
    font-size: 16px;
}

.notes-textarea {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 400;
    transition: all 0.3s ease;
    background: #ffffff;
    resize: vertical;
    min-height: 100px;
}

.notes-textarea:focus {
    border-color: #2196f3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
    background: #fff;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .summary-totals-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .sales-order-line-item .item-info-row,
    .sales-order-line-item .pricing-info-row,
    .summary-section-header,
    .summary-totals-grid,
    .sales-order-notes-section {
        padding: 15px 20px;
    }
    
    .sales-order-line-item,
    .sales-order-summary-section,
    .sales-order-notes-section {
        margin-bottom: 15px;
    }
    
    .summary-totals-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .summary-input {
        max-width: 100%;
        font-size: 12px;
        height: 36px;
    }
    
    .summary-label {
        font-size: 10px;
        margin-bottom: 4px;
    }
}

@media (max-width: 480px) {
    .summary-totals-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

/* Ensure dropdown anchors to the select, not the whole form group */
.bootstrap-select {
  position: relative !important;
}
.modal .bootstrap-select,
.modal-open .bootstrap-select,
.portlet-body .bootstrap-select {
  position: relative !important;
}

/* Modal-specific width adjustments for Bootstrap Select */
.modal .bootstrap-select,
.modal-open .bootstrap-select,
.modal .bootstrap-select .btn-group,
.modal .bootstrap-select > .dropdown-toggle {
  width: auto !important;
  max-width: 100% !important;
}

/* Standard Bootstrap dropdown sizing in tables/modals */
.table .dropdown-menu,
.modal .dropdown-menu {
  width: auto !important;
  min-width: 160px !important;
  max-width: 360px !important;
  white-space: normal !important;
  word-break: break-word !important;
  box-sizing: border-box !important;
}


/* ===============================
   EMPLOYEE VIEW DROPDOWN FIXES
   =============================== */
/* Allow dropdowns to overflow table borders on employee view */
.employee-view .table,
.employee-view .table-responsive,
.employee-view .portlet,
.employee-view .portlet-body,
.employee-view .dataTables_wrapper,
.employee-view .row {
  overflow: visible !important;
}

/* Ensure button groups anchor dropdown positioning */
.employee-view .btn-group,
.employee-view td .btn-group {
  position: relative !important;
}

/* DataTables scroll body should not clip dropdowns */
.employee-view div.dataTables_scrollBody,
.employee-view table.dataTable {
  overflow: visible !important;
}

/* Ensure bootstrap-select takes full width inside form groups and modals */
.bs-select,
.bootstrap-select,
.bootstrap-select>.dropdown-toggle {
	width: 100% !important;
}

/* Make the dropdown menu appear above modals and scrolling containers */
.bootstrap-select .dropdown-menu {
	z-index: 20000; /* higher than modal (1050/1060) and quick-sidebar */
}

/* When bootstrap-select is inside a modal, prevent clipping */
.modal .bootstrap-select.open .dropdown-menu {
	transform: translate3d(0,0,0);
}

/* Fix for select2/selectpicker overlap in tight containers */
.page-content .bootstrap-select .dropdown-menu {
	max-width: 100%;
}