/* Custom App Styles - Consolidated from view files */

/* Paste all extracted styles from views here. */ 
/* 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: #337ab7;
}

.step-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    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: #337ab7;
    color: white;
    box-shadow: 0 0 0 3px rgba(51, 122, 183, 0.2);
}

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

.step.active .step-label {
    color: #337ab7;
}

/* Modern Portlet Styling */
.modern-portlet {
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 10px;
    margin-bottom: 30px;
    overflow: visible; /* allow dropdowns to extend beyond portlet */
}

.modern-portlet .portlet-title {
    background: transparent;
    color: #333;
    border: none;
    padding: 20px;
}

.modern-portlet .portlet-title .caption {
    color: #333;
}

.modern-portlet .portlet-title .caption i {
    margin-right: 10px;
    font-size: 18px;
}

.modern-portlet .portlet-body {
    padding: 30px;
    background: white;
}

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

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

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

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

.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 #e9ecef;
    font-size: 13px;
    color: #6c757d;
}

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

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

/* Modern Form Controls */
.form-control:not(.bootstrap-select) {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    padding: 12px 15px;
    transition: all 0.3s ease;
}

.form-control:focus:not(.bootstrap-select) {
    border-color: #337ab7;
    box-shadow: 0 0 0 0.2rem rgba(51, 122, 183, 0.25);
}

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

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

.help-block {
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
}

/* Modern Checkboxes */
.modern-checkbox {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modern-checkbox:hover {
    background: #e9ecef;
}

.modern-checkbox input[type="checkbox"] {
    display: none;
}

.modern-checkbox .checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    margin-right: 12px;
    position: relative;
    transition: all 0.3s ease;
}

.modern-checkbox input[type="checkbox"]:checked + .checkmark {
    background: var(--md-checkbox-accent);
    border-color: var(--md-checkbox-accent);
}

.modern-checkbox input[type="checkbox"]:checked + .checkmark:after {
    content: '✓';
    color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: bold;
}

.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;
}

/* Modern Form Actions */
.modern-actions {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 30px;
    margin-top: 30px;
    text-align: center;
}

.modern-actions .btn {
    margin: 0 10px;
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.modern-actions .btn i {
    margin-right: 8px;
}

/* Repeater Styling */
#contact-repeater [data-repeater-item],
#location-repeater [data-repeater-item] {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

/* Responsive Design */
@media (max-width: 768px) {
    .progress-steps {
        flex-direction: column;
        gap: 20px;
    }
    
    .step:not(:last-child)::after {
        display: none;
    }
    
    .modern-portlet .portlet-body {
        padding: 20px;
    }
    
    .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);
    }
}

/* 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;
} 

/* From jobs/create.html */
.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: #e1e5e9;
    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 {
    margin-bottom: 30px;
}

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

.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;
}

.form-control:not(.bootstrap-select) {
    border-radius: 4px;
    border: 1px solid #e1e5e9;
    padding: 12px 15px;
    transition: all 0.3s ease;
}

.form-control:focus:not(.bootstrap-select) {
    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-divider {
    border: none;
    height: 1px;
    background: linear-gradient(to right, transparent, #dee2e6, transparent);
    margin: 30px 0;
}

.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;
}

@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%;
    }
}

.form-section {
    animation: fadeInUp 0.5s ease-out;
}

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

.input-group .form-control {
    border-right: none;
}

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

.form-group {
    margin-bottom: 25px;
}

.row {
    margin-bottom: 20px;
}

.bs-select {
    border-radius: 8px;
}

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

.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;
} 

/* Improved Job Type Checkboxes for Job Create Page */
.job-type-checkboxes {
  display: flex;
  gap: 18px;
  margin-bottom: 0;
}
.job-type-checkboxes .job-type-checkbox {
  display: flex;
  align-items: center;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e9ecef;
  padding: 12px 18px;
  cursor: pointer;
  transition: box-shadow 0.2s, border 0.2s;
  min-width: 180px;
  font-size: 16px;
  font-weight: 500;
}
.job-type-checkboxes .job-type-checkbox input[type="checkbox"] {
  margin-right: 10px;
  width: 20px;
  height: 20px;
  accent-color: var(--md-checkbox-accent);
}
.job-type-checkboxes .job-type-checkbox i {
  margin-right: 8px;
  font-size: 18px;
}
.job-type-checkboxes .job-type-checkbox:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border-color: var(--md-checkbox-accent);
}
.job-type-checkboxes .job-type-checkbox input[type="checkbox"]:checked + span {
  color: var(--md-checkbox-accent);
} 

/* Select2 — match custom-app .form-control (padding 12px 15px → ~46px tall), not legacy BS3 34px */
/* Avoid display:flex on the selection box: it stacks oddly with theme .select2-selection__arrow (double / striped chevrons). */
/* Wrapper must be block so container outerHeight matches the single-selection box (Select2 AttachBody uses $container.outerHeight()). */
.select2-container .selection {
  display: block !important;
}
.select2-container .dropdown-wrapper {
  display: block;
}
.select2-container {
  min-height: 46px;
}
.select2-container .select2-selection--single {
  min-height: 46px !important;
  height: 46px !important;
  padding: 0 36px 0 15px !important;
  font-size: 14px;
  line-height: 1.42857143;
  border-radius: var(--app-radius-sm, 4px);
  border: 1px solid var(--app-border-strong);
  background: var(--app-bg-card);
  box-shadow: none;
  display: block;
  position: relative;
  box-sizing: border-box;
}
.select2-container--default .select2-selection--single .select2-selection__rendered,
.select2-container--bootstrap .select2-selection--single .select2-selection__rendered {
  line-height: 44px !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  color: var(--app-text);
}
.select2-container--default .select2-selection--single .select2-selection__arrow,
.select2-container--bootstrap .select2-selection--single .select2-selection__arrow {
  position: absolute !important;
  top: 0 !important;
  right: 10px !important;
  bottom: 0 !important;
  width: 22px !important;
  height: auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: visible !important;
}
/* One chevron only: plugin <b> is a CSS triangle; select2-bootstrap.min.css open rule uses
   .select2-container--open .select2-selection .select2-selection__arrow b (higher specificity
   than --single) and stacks with any SVG/::after — hide <b> always and draw one icon on ::after. */
.select2-container--default .select2-selection--single .select2-selection__arrow b,
.select2-container--bootstrap .select2-selection--single .select2-selection__arrow b,
.select2-container--open.select2-container--default .select2-selection--single .select2-selection__arrow b,
.select2-container--open.select2-container--bootstrap .select2-selection--single .select2-selection__arrow b,
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b,
.select2-container--bootstrap.select2-container--open .select2-selection .select2-selection__arrow b,
.select2-container--bootstrap.select2-container--open .select2-selection--single .select2-selection__arrow b {
  display: none !important;
  visibility: hidden !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-width: 0 !important;
  border-style: none !important;
  background: none !important;
  background-image: none !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  position: absolute !important;
  left: -9999px !important;
  transform: none !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow::after,
.select2-container--bootstrap .select2-selection--single .select2-selection__arrow::after {
  content: "" !important;
  display: block !important;
  width: 16px !important;
  height: 16px !important;
  flex-shrink: 0 !important;
  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: center !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
  pointer-events: none !important;
  transform-origin: 50% 50% !important;
}
.select2-container.select2-container--open .select2-selection--single .select2-selection__arrow::after,
.select2-container--bootstrap.select2-container--open .select2-selection .select2-selection__arrow::after,
.select2-container--bootstrap.select2-container--open .select2-selection--single .select2-selection__arrow::after {
  transform: rotate(180deg) !important;
}

.select2-container[dir="rtl"] .select2-selection--single .select2-selection__arrow {
  right: auto !important;
  left: 10px !important;
}
.select2-container[dir="rtl"] .select2-selection--single {
  padding: 0 15px 0 36px !important;
}
.select2-container .select2-selection--multiple {
  min-height: 46px !important;
  padding: 6px 10px 6px 8px !important;
  font-size: 14px;
  border-radius: var(--app-radius-sm, 4px);
  border: 1px solid var(--app-border-strong);
  background: var(--app-bg-card);
  box-shadow: none;
  box-sizing: border-box;
}

/* InputFactory.loadSelectOptions uses theme: 'bootstrap' — keep sizing in sync with rules above */
.select2-container--bootstrap .select2-selection--single {
  min-height: 46px !important;
  height: 46px !important;
  padding: 0 36px 0 15px !important;
  display: block !important;
  position: relative !important;
  box-sizing: border-box !important;
}

/* Compact selects (Bootstrap .input-sm / .form-group-sm) */
.input-group-sm .select2-container .select2-selection--single,
.form-group-sm .select2-container .select2-selection--single,
.select2-container.select2-container--bootstrap.input-sm .select2-selection--single {
  min-height: 30px !important;
  height: 30px !important;
  padding: 0 28px 0 10px !important;
}
.input-group-sm .select2-container--default .select2-selection--single .select2-selection__rendered,
.input-group-sm .select2-container--bootstrap .select2-selection--single .select2-selection__rendered,
.form-group-sm .select2-container--default .select2-selection--single .select2-selection__rendered,
.form-group-sm .select2-container--bootstrap .select2-selection--single .select2-selection__rendered,
.select2-container--bootstrap.input-sm .select2-selection--single .select2-selection__rendered {
  line-height: 28px !important;
}
.input-group-sm .select2-container--default .select2-selection--single .select2-selection__arrow,
.input-group-sm .select2-container--bootstrap .select2-selection--single .select2-selection__arrow,
.form-group-sm .select2-container--default .select2-selection--single .select2-selection__arrow,
.form-group-sm .select2-container--bootstrap .select2-selection--single .select2-selection__arrow,
.select2-container--bootstrap.input-sm .select2-selection--single .select2-selection__arrow {
  right: 6px !important;
}
.input-group-sm .select2-container .select2-selection--multiple,
.form-group-sm .select2-container .select2-selection--multiple,
.select2-container.select2-container--bootstrap.input-sm .select2-selection--multiple {
  min-height: 30px !important;
}

/* Select2 in modal — same metrics as page (width full width) */
.modal .select2-container {
  width: 100% !important;
}
.modal .select2-container .select2-selection--single {
  min-height: 46px !important;
  height: 46px !important;
  padding: 0 36px 0 15px !important;
  border: 1px solid var(--app-border-strong);
  background: var(--app-bg-card);
  display: block !important;
  position: relative !important;
}
.modal .select2-container--default .select2-selection--single .select2-selection__rendered,
.modal .select2-container--bootstrap .select2-selection--single .select2-selection__rendered {
  line-height: 44px !important;
}
.modal .form-group .select2-container {
  display: block;
}
/* Ensure select2 dropdown appears above modal */
.select2-container--open .select2-dropdown {
  z-index: 10060 !important;
}

/* Bootstrap-select: style only the toggle, not the .bootstrap-select root.
   The plugin copies .bs-select from <select> onto the wrapper div; display:flex on that
   root puts .dropdown-toggle and .dropdown-menu in a row and breaks show-tick (ticks across). */
.bootstrap-select > .dropdown-toggle {
  height: 44px !important;
  font-size: 15px !important;
  line-height: 1.42857143 !important;
  border-radius: 8px !important;
  border: 2px solid #e9ecef !important;
  background: #fff !important;
  box-shadow: none !important;
  color: #495057 !important;
  display: flex !important;
  align-items: center !important;
}
.bootstrap-select > .dropdown-toggle:focus,
.bootstrap-select > .dropdown-toggle:active {
  border-color: #337ab7 !important;
  box-shadow: 0 0 0 0.2rem rgba(51, 122, 183, 0.25) !important;
}
.bootstrap-select .filter-option {
  line-height: 1.5 !important;
  color: #555 !important;
}
/* Caret position comes from layouts/layout/css/custom.css (top:50%, margin-top:-2px) — do not offset here or label looks off-center */
.bootstrap-select > .dropdown-toggle .caret {
  margin-top: 0;
}

/* Responsive Tables - Horizontal Scroll */
/* Portlet bodies: overflow visible so dropdowns (bootstrap-select etc) are not clipped */
.portlet.light > .portlet-body,
.portlet.bordered > .portlet-body,
.portlet.box > .portlet-body,
.portlet > .portlet-body {
    overflow: visible !important;
    max-width: 100% !important;
}

/* Horizontal scroll wrappers: no outer border (Metronic .table-scrollable + BS3 mobile .table-responsive use 1px) */
.table-scrollable,
.table-responsive,
.table-responsive-horizontal {
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
    max-width: 100% !important;
    width: 100% !important;
    display: block !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    margin: 0 0 16px 0 !important;
    /* Scrollbar only when content overflows (overflow-x: auto). Thin / unobtrusive where supported. */
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 116, 139, 0.45) transparent;
    -ms-overflow-style: -ms-autohiding-scrollbar;
}

@media screen and (max-width: 767px) {
    .table-responsive {
        border: none !important;
    }
}

/* Fix for inventory table width and alignment */
#inventory-table_wrapper {
    width: 100% !important;
}

#inventory-table {
    width: 100% !important;
    table-layout: auto !important;
}

#inventory-table thead th,
#inventory-table tbody td {
    white-space: nowrap;
    vertical-align: middle;
}

/* Ensure DataTable container takes full width */
#inventory-table_wrapper .dataTables_scrollHead,
#inventory-table_wrapper .dataTables_scrollBody {
    width: 100% !important;
}

/* Fix column alignment when scrollX is disabled */
#inventory-table_wrapper .dataTables_scrollHeadInner {
    width: 100% !important;
}

#inventory-table_wrapper .dataTables_scrollHeadInner table {
    width: 100% !important;
    margin-left: 0 !important;
}

/* Fix for jobs table width and alignment */
#jobs-table_wrapper {
    width: 100% !important;
}

#jobs-table {
    width: 100% !important;
    table-layout: auto !important; /* Changed to auto for better flexibility */
}

#jobs-table thead th,
#jobs-table tbody td {
    vertical-align: top;
    padding: 8px !important;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Column-specific styling - use classes instead of nth-of-type for reliability */
/* Job ID - Column 0 */
#jobs-table thead th[data-column-index="0"],
#jobs-table tbody td:first-child {
    white-space: nowrap;
    text-align: center;
    width: auto;
    min-width: 60px;
    max-width: 80px;
}

/* Customer - Column 1 */
#jobs-table thead th[data-column-index="1"],
#jobs-table tbody td:nth-child(2) {
    width: auto;
    min-width: 120px;
    max-width: 200px;
}

/* Short Description - Column 2 */
#jobs-table thead th[data-column-index="2"],
#jobs-table tbody td:nth-child(3) {
    width: auto;
    min-width: 150px;
    max-width: 250px;
}

/* Category - Column 3 */
#jobs-table thead th[data-column-index="3"],
#jobs-table tbody td:nth-child(4) {
    white-space: nowrap;
    width: auto;
    min-width: 90px;
    max-width: 120px;
}

/* Type - Column 4 */
#jobs-table thead th[data-column-index="4"],
#jobs-table tbody td:nth-child(5) {
    white-space: nowrap;
    width: auto;
    min-width: 90px;
    max-width: 120px;
}

/* Priority - Column 5 */
#jobs-table thead th[data-column-index="5"],
#jobs-table tbody td:nth-child(6) {
    white-space: nowrap;
    width: auto;
    min-width: 90px;
    max-width: 120px;
}

/* Elapsed Time - Column 6 */
#jobs-table thead th[data-column-index="6"],
#jobs-table tbody td:nth-child(7) {
    white-space: nowrap;
    text-align: center;
    width: auto;
    min-width: 90px;
    max-width: 120px;
}

/* Supervisor - Column 7 */
#jobs-table thead th[data-column-index="7"],
#jobs-table tbody td:nth-child(8) {
    width: auto;
    min-width: 110px;
    max-width: 150px;
}

/* Salesperson - Column 8 */
#jobs-table thead th[data-column-index="8"],
#jobs-table tbody td:nth-child(9) {
    width: auto;
    min-width: 110px;
    max-width: 150px;
}

/* Created By - Column 9 */
#jobs-table thead th[data-column-index="9"],
#jobs-table tbody td:nth-child(10) {
    width: auto;
    min-width: 110px;
    max-width: 150px;
}

/* Assigned Employees - Column 10 */
#jobs-table thead th[data-column-index="10"],
#jobs-table tbody td:nth-child(11) {
    width: auto;
    min-width: 130px;
    max-width: 200px;
}

/* Status - Column 15 */
#jobs-table thead th[data-column-index="15"],
#jobs-table tbody td:nth-child(16) {
    white-space: nowrap;
    width: auto;
    min-width: 90px;
    max-width: 120px;
}

/* Actions - Column 16 */
#jobs-table thead th[data-column-index="16"],
#jobs-table tbody td:nth-child(17) {
    white-space: nowrap;
    text-align: center;
    width: auto;
    min-width: 90px;
    max-width: 120px;
}

/* Text wrapping utility class */
#jobs-table .text-wrap {
    white-space: normal !important;
    word-wrap: break-word;
    word-break: break-word;
}

/* Ensure DataTable container takes full width */
#jobs-table_wrapper .dataTables_scrollHead,
#jobs-table_wrapper .dataTables_scrollBody {
    width: 100% !important;
}

/* Fix column alignment when scrollX is disabled */
#jobs-table_wrapper .dataTables_scrollHeadInner {
    width: 100% !important;
}

#jobs-table_wrapper .dataTables_scrollHeadInner table {
    width: 100% !important;
    margin-left: 0 !important;
}

/* Ensure responsive child rows show short description */
#jobs-table_wrapper .dtr-details li {
    list-style: none;
    padding: 5px 0;
}

#jobs-table_wrapper .dtr-details .dtr-title {
    font-weight: bold;
    margin-right: 10px;
    min-width: 120px;
    display: inline-block;
}

/* DataTable processing message styling */
.dt-processing {
    display: inline-block !important;
    padding: 8px 12px !important;
    text-align: center !important;
    vertical-align: middle !important;
    color: #333 !important;
    font-size: 14px !important;
    font-weight: 400 !important;
}

.dt-processing i {
    margin-right: 8px;
    color: #337ab7;
    vertical-align: middle;
}

.dt-processing i.fa-spinner {
    display: inline-block;
}

/* Full-wrapper load scrim (TableFactory — theme in app-theme.css for dark) */
.dataTables_wrapper .dt-loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.62);
}

.dataTables_wrapper .dt-loading-overlay__center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.dataTables_wrapper .dt-loading-overlay__label {
    margin-top: 8px;
    font-weight: 600;
    color: #334155;
}

/* Fix dropdown overflow in DataTables scrollable containers */
.dataTables_wrapper {
    overflow: visible !important;
    position: relative;
}

/* Allow dropdowns to overflow DataTables scroll body - critical for scrollX tables */
.dataTables_scrollBody {
    overflow-x: auto !important;
    overflow-y: visible !important;
    max-height: none !important;
}

/* Ensure DataTables scroll wrapper doesn't clip dropdowns */
.dataTables_scroll {
    overflow: visible !important;
}

/* Button groups in DataTables cells - ensure they can contain dropdowns */
.dataTables_wrapper .btn-group,
.dataTables_wrapper td .btn-group,
.dataTables_wrapper th .btn-group,
.table-scrollable .dataTable td > .btn-group,
.table-scrollable .dataTable th > .btn-group {
    position: relative !important;
    z-index: 1;
}

/* When button group is open, ensure dropdown can overflow */
.dataTables_wrapper .btn-group.open,
.dataTables_wrapper td .btn-group.open,
.dataTables_wrapper th .btn-group.open {
    z-index: 10000 !important;
}

/* Dropdown menus in DataTables should overflow containers */
.dataTables_wrapper .dropdown-menu {
    z-index: 10001 !important;
    position: absolute !important;
    max-width: none !important;
}

/* Ensure dropdown menus can extend beyond table cells */
.dataTables_wrapper table td,
.dataTables_wrapper table th {
    overflow: visible !important;
    position: relative;
}

/* Fix for DataTables with scrollX enabled - allow vertical overflow */
.dataTables_wrapper .dataTables_scrollHeadInner {
    overflow-x: auto !important;
    overflow-y: visible !important;
}

.dataTables_wrapper .dataTables_scrollBody {
    overflow-x: auto !important;
    overflow-y: visible !important;
}

/* DataTables scroll areas: drop extra frame borders from Metronic plugins.css */
.dataTables_scroll {
    border: none !important;
    box-shadow: none !important;
}

.dataTables_scrollHead {
    border-bottom: none !important;
}

.dataTables_scrollBody {
    border: none !important;
    border-bottom: none !important;
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 116, 139, 0.45) transparent;
}

.dataTables_wrapper .dataTables_scrollBody::-webkit-scrollbar {
    height: 6px;
}

.dataTables_wrapper .dataTables_scrollBody::-webkit-scrollbar-track {
    background: transparent;
}

.dataTables_wrapper .dataTables_scrollBody::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.4);
    border-radius: 4px;
}

.dataTables_wrapper .dataTables_scrollHeadInner {
    border: none !important;
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 116, 139, 0.45) transparent;
}

.dataTables_wrapper .dataTables_scrollHeadInner::-webkit-scrollbar {
    height: 6px;
}

.dataTables_wrapper .dataTables_scrollHeadInner::-webkit-scrollbar-track {
    background: transparent;
}

.dataTables_wrapper .dataTables_scrollHeadInner::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.35);
    border-radius: 4px;
}

/* Ensure dropdown menus appear above scrollable containers */
.dataTables_wrapper .dataTables_scrollBody .dropdown-menu {
    z-index: 10002 !important;
}

/* Fix for tables within scrollable containers */
.table-scrollable .dataTables_wrapper,
.table-responsive .dataTables_wrapper,
.table-responsive-horizontal .dataTables_wrapper {
    overflow: visible !important;
}

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

/* Fix for nested scroll containers */
.portlet-body .table-scrollable .dataTables_wrapper,
.portlet-body .table-responsive .dataTables_wrapper {
    overflow: visible !important;
}

/* Override any max-height restrictions on scroll body that might clip dropdowns */
.dataTables_wrapper .dataTables_scrollBody[style*="max-height"] {
    max-height: none !important;
}

/* Ensure table cells don't clip dropdown content */
.dataTables_wrapper table.dataTable td,
.dataTables_wrapper table.dataTable th {
    overflow: visible !important;
}

/* Fix for DataTables processing overlay - ensure it doesn't interfere */
.dataTables_wrapper .dataTables_processing {
    z-index: 9999;
}

/* Dropdown menus appended to body by dropdown-overflow-fix.js - ensure visibility above modals */
body > .dropdown-menu[data-dropdown-body-escape="1"] {
    z-index: 100600 !important;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
}

/* Twitter Typeahead: suggestions above Bootstrap 3 modal backdrop/dialog (otherwise looks “broken” in clock/task modals) */
.modal .twitter-typeahead .tt-menu,
.modal .twitter-typeahead .tt-dropdown-menu,
.modal.in .twitter-typeahead .tt-menu,
.modal.in .twitter-typeahead .tt-dropdown-menu {
    z-index: 10060 !important;
}

/* WebKit: horizontal bar only renders when overflow-x is active; transparent track = no “box” when idle */
.table-scrollable::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar,
.table-responsive-horizontal::-webkit-scrollbar {
    height: 6px;
}

.table-scrollable::-webkit-scrollbar-track,
.table-responsive::-webkit-scrollbar-track,
.table-responsive-horizontal::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 4px;
}

.table-scrollable::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb,
.table-responsive-horizontal::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.4);
    border-radius: 4px;
}

.table-scrollable::-webkit-scrollbar-thumb:hover,
.table-responsive::-webkit-scrollbar-thumb:hover,
.table-responsive-horizontal::-webkit-scrollbar-thumb:hover {
    background: rgba(71, 85, 105, 0.55);
}

/* Tables within scrollable containers */
.table-scrollable > table,
.table-responsive > table,
.table-responsive-horizontal > table,
.portlet-body > .table-scrollable > table,
.portlet-body > .table-responsive > table,
.portlet-body > .table-responsive-horizontal > table {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    margin-bottom: 0;
}

/* Allow tables to scroll when content is wider */
.table-scrollable > table.table,
.table-responsive > table.table,
.table-responsive-horizontal > table.table {
    width: max-content !important;
    min-width: 100% !important;
}

/* -------------------------------------------------------------------------
 * App-wide list tables: Metronic + DataTables + nested scroll wrappers
 * ------------------------------------------------------------------------- */

/* Metronic removes outer border on bordered tables inside .table-scrollable — restore a clear frame */
.table-scrollable > .table.table-bordered,
.table-responsive > .table.table-bordered {
    border: 1px solid var(--app-border-strong, #ddd) !important;
}

/* Metronic forces nowrap on every th — breaks wrapped headers and cramped layouts */
.table-scrollable > .table > thead > tr > th,
.table-scrollable > .table > tbody > tr > th,
.table-scrollable > .table > tfoot > tr > th {
    white-space: normal !important;
}

/* Opt-in single-line headers where horizontal scan matters */
.table-scrollable > .table.table-headers-nowrap > thead > tr > th {
    white-space: nowrap !important;
}

/* DataTables inserts .dataTables_wrapper between scroll parent and table — mirror direct-child width rules */
.table-scrollable .dataTables_wrapper,
.table-responsive .dataTables_wrapper,
.table-responsive-horizontal .dataTables_wrapper {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
}

.table-scrollable .dataTables_wrapper > table.table,
.table-scrollable .dataTables_wrapper > table.dataTable,
.table-responsive .dataTables_wrapper > table.table,
.table-responsive .dataTables_wrapper > table.dataTable,
.table-responsive-horizontal .dataTables_wrapper > table.table,
.table-responsive-horizontal .dataTables_wrapper > table.dataTable {
    width: max-content !important;
    min-width: 100% !important;
    margin-bottom: 0;
}

.table-scrollable .dataTables_wrapper .dataTables_scrollBody table.table,
.table-scrollable .dataTables_wrapper .dataTables_scrollBody table.dataTable,
.table-responsive .dataTables_wrapper .dataTables_scrollBody table.table,
.table-responsive .dataTables_wrapper .dataTables_scrollBody table.dataTable {
    min-width: 100% !important;
}

/* Nested .table-responsive + .table-scrollable: avoid double bottom margin; inner fills width */
.table-responsive > .table-scrollable,
.table-scrollable > .table-responsive,
.table-responsive > .table-responsive-horizontal {
    margin-bottom: 0 !important;
    width: 100% !important;
    min-width: 0 !important;
}

/* Shared list styling (class used on customers + PO list; safe to add elsewhere) */
.modern-table {
    margin-bottom: 0;
}

.modern-table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.02em;
    vertical-align: middle;
}

.modern-table tbody td {
    vertical-align: middle;
}

/* Striped data tables in portlets / scroll areas — consistent header weight + cell alignment (#jobs-table etc. keep ID overrides) */
.portlet-body .table.table-striped > thead > tr > th,
.table-scrollable > .table.table-striped > thead > tr > th,
.table-responsive .table.table-striped > thead > tr > th {
    font-weight: 600;
    vertical-align: middle;
}

.portlet-body .table.table-striped > tbody > tr > td,
.table-scrollable > .table.table-striped > tbody > tr > td,
.table-responsive .table.table-striped > tbody > tr > td {
    vertical-align: middle;
}

.portlet-body .dataTables_wrapper table.table-striped > thead > tr > th,
.table-scrollable .dataTables_wrapper table.table-striped > thead > tr > th,
.table-responsive .dataTables_wrapper table.table-striped > thead > tr > th {
    font-weight: 600;
    vertical-align: middle;
}

.portlet-body .dataTables_wrapper table.table-striped > tbody > tr > td,
.table-scrollable .dataTables_wrapper table.table-striped > tbody > tr > td,
.table-responsive .dataTables_wrapper table.table-striped > tbody > tr > td {
    vertical-align: middle;
}

/* Proposal financial summary / breakdown (dark: app-theme.css) */
.proposal-fin__kpi-grid {
    margin-bottom: 8px;
}

.proposal-fin__stat-box {
    background: #fff;
    border: 2px solid #333;
    border-radius: 4px;
    padding: 20px;
    text-align: center;
}

.proposal-fin__stat-box__label {
    font-size: 11px;
    color: #666;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.proposal-fin__stat-box__value {
    font-size: 28px;
    font-weight: bold;
    color: #1e293b;
}

.proposal-fin__breakdown {
    margin-top: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.proposal-fin__breakdown-toggle {
    padding: 15px;
    cursor: pointer;
    border-bottom: 1px solid #ddd;
    transition: background-color 0.15s ease;
}

.proposal-fin__breakdown-toggle:hover {
    background: #f0f0f0;
}

.proposal-fin__breakdown-toggle h5 {
    margin: 0;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.proposal-fin__chevron {
    transition: transform 0.3s ease;
}

.proposal-fin__breakdown-body {
    padding: 15px;
}

.proposal-fin__table {
    margin-bottom: 0;
    background: #fff;
}

.proposal-fin__table thead tr {
    background: #f5f5f5;
}

.proposal-fin__row-line td {
    border-top: 1px solid #ccc;
}

.proposal-fin__row-strong td {
    border-top: 2px solid #333;
}

.proposal-fin__row-total-rev td {
    background: #e8f5fe;
    font-size: 16px;
}

.proposal-fin__row-total-cost td {
    border-top: 2px solid #333;
    background: #fee;
    font-size: 16px;
}

.proposal-fin__row-profit td {
    background: #efe;
}

/* Custom label colors for status badges */
.label-purple {
    background-color: #9b59b6;
}
.label-purple[href]:hover,
.label-purple[href]:focus {
    background-color: #8e44ad;
}

/* Notifications Page Styles */
.notification-list .notification-item {
    transition: background-color 0.2s ease;
}
.notification-list .notification-item:hover {
    background-color: #f5f5f5 !important;
}
.notification-list .notification-item.unread {
    font-weight: 500;
}
.notification-list .notification-item .btn-group {
    opacity: 0.5;
    transition: opacity 0.2s ease;
}
.notification-list .notification-item:hover .btn-group {
    opacity: 1;
}
.notification-list .notification-item h5 a:hover {
    text-decoration: none;
    color: #337ab7 !important;
}
.notification-list .notification-item .label-lg {
    font-size: 16px;
}

/* Pagination styling */
.pagination > li > a,
.pagination > li > span {
    min-width: 40px;
    text-align: center;
}

/* Retail Mode + quick sidebar "Show Cost Prices" off — hide cost UI (lists/views); SO line editor keeps inputs */
body.retail-mode .cost-price,
body.retail-mode .cost-price-cell,
body.retail-mode [data-cost-price],
body.retail-mode .hide-in-retail-mode,
body.retail-mode input[name*="cost-price"],
body.retail-mode input[name*="cost_price"],
body.retail-mode .so-cost,
body.retail-mode .part-cost-price,
body.retail-mode .cost-price-input,
body.retail-mode .supplier-cost,
body.retail-mode .markup-input,
body.retail-mode [class*="cost-col"],
body.retail-mode [class*="costPrice"],
body.app-hide-cost-prices .cost-price,
body.app-hide-cost-prices .cost-price-cell,
body.app-hide-cost-prices [data-cost-price],
body.app-hide-cost-prices .hide-in-retail-mode,
body.app-hide-cost-prices input[name*="cost-price"],
body.app-hide-cost-prices input[name*="cost_price"],
body.app-hide-cost-prices .so-cost,
body.app-hide-cost-prices .part-cost-price,
body.app-hide-cost-prices .cost-price-input,
body.app-hide-cost-prices .supplier-cost,
body.app-hide-cost-prices .markup-input,
body.app-hide-cost-prices [class*="cost-col"],
body.app-hide-cost-prices [class*="costPrice"] {
    display: none !important;
}

/* Sales order create/edit: need cost (and margin) for line pricing; retail mode still hides costs on lists/views */
body.retail-mode .create-salesorder-form input.cost-price,
body.retail-mode .create-salesorder-form input[name*="cost_price"],
body.app-hide-cost-prices .create-salesorder-form input.cost-price,
body.app-hide-cost-prices .create-salesorder-form input[name*="cost_price"] {
    display: block !important;
    width: 100%;
}

/* Hide cost price columns in tables (for DataTables) */
body.retail-mode table th.cost-col,
body.retail-mode table td.cost-col,
body.retail-mode table .dt-col-cost,
body.app-hide-cost-prices table th.cost-col,
body.app-hide-cost-prices table td.cost-col,
body.app-hide-cost-prices table .dt-col-cost {
    display: none !important;
}

/* Also hide Show Cost Prices setting when retail mode is on */
body.retail-mode li[data-required-permission="b_view_cost_prices"] {
    display: none !important;
}

/* Retail mode indicator badge */
body.retail-mode .retail-mode-indicator {
    display: block !important;
}
/* .table-scrollable / .table-responsive base rules live in “Responsive Tables” block above */
.table-responsive.table-scrollable,
.table-responsive .table-scrollable {
    overflow-x: auto !important;
}

.portlet .table-responsive,
.panel .table-responsive {
    overflow-x: auto !important;
    border: none !important;
}

.retail-mode-indicator {
    display: none;
    position: fixed;
    bottom: 10px;
    right: 10px;
    background: #e74c3c;
    color: white;
    padding: 5px 15px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    z-index: 9999;
    opacity: 0.9;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Permissions assignment modal: full width, multi-column portlets, group button text */
#edit-permissions-modal .modal-dialog.modal-full {
    width: 95%;
    max-width: 1400px;
}
#edit-permissions-modal .portlet-title .tools {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-end;
}
#edit-permissions-modal .portlet-title .tools .btn {
    white-space: nowrap;
}

/* Keep permission checkboxes and labels inside portlet columns */
#edit-permissions-modal .modal-body {
    overflow-x: hidden;
}
#edit-permissions-modal .modal-body > .row {
    margin-left: -8px;
    margin-right: -8px;
}
#edit-permissions-modal .modal-body > .row > [class*="col-"] {
    padding-left: 8px;
    padding-right: 8px;
    min-width: 0;
    max-width: 100%;
}
#edit-permissions-modal .portlet.light.bordered {
    overflow: hidden;
    max-width: 100%;
    box-sizing: border-box;
}
#edit-permissions-modal .portlet-title {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    width: 100%;
    box-sizing: border-box;
    gap: 8px;
}
#edit-permissions-modal .portlet-title .caption {
    flex: 1 1 160px;
    min-width: 0;
    max-width: 100%;
    word-break: break-word;
    overflow-wrap: anywhere;
}
#edit-permissions-modal .portlet-title .tools {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
}
#edit-permissions-modal .portlet-body {
    max-height: 360px;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}
/* Row = checkbox column + wrapping label (avoids long text inside .mt-checkbox) */
#edit-permissions-modal .permission-modal-list {
    overflow-x: hidden;
    max-width: 100%;
}
#edit-permissions-modal .permission-modal-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 100%;
    margin-bottom: 12px;
    box-sizing: border-box;
}
#edit-permissions-modal .permission-modal-checkbox-only.mt-checkbox {
    flex: 0 0 28px;
    width: 28px;
    min-width: 28px;
    margin: 0;
    padding-left: 0;
    position: relative;
    top: 1px;
}
#edit-permissions-modal .permission-modal-checkbox-only.mt-checkbox > input {
    left: 0;
    top: 0;
}
#edit-permissions-modal .permission-modal-checkbox-only.mt-checkbox > span:last-of-type {
    left: 0;
    top: 0;
}
#edit-permissions-modal .permission-modal-item-text {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.4;
    font-size: 13px;
}
#edit-permissions-modal .permission-modal-item-label {
    display: inline;
}
#edit-permissions-modal .permission-modal-item-text .badge {
    margin-left: 6px;
    vertical-align: middle;
    white-space: nowrap;
}

/* ==========================================================================
   Material-style checkboxes (app-wide)
   Overrides .mt-checkbox to match Material Design: rounded square, accent fill
   when checked, white checkmark, smooth transition.
   ========================================================================== */
:root {
    --md-checkbox-size: 20px;
    --md-checkbox-border-radius: 3px;
    /* Align with app accent (see app-theme.css --app-accent) */
    --md-checkbox-accent: var(--app-accent, #0d9488);
    --md-checkbox-accent-hover: var(--app-accent-hover, #0f766e);
    --md-checkbox-unchecked-border: #94a3b8;
    --md-checkbox-unchecked-hover: #64748b;
    --md-checkbox-surface: #ffffff;
}

/* Base .mt-checkbox box (the last span) - Material look */
.mt-checkbox {
    padding-left: 32px;
}
.mt-checkbox > input {
    position: absolute;
    z-index: 1;
    opacity: 0;
    width: var(--md-checkbox-size);
    height: var(--md-checkbox-size);
    margin: 0;
    cursor: pointer;
    left: 0;
    top: 2px;
}
/* Only the last span is the checkbox box (first span may hold label text) */
.mt-checkbox > span:last-of-type {
    position: absolute;
    top: 2px;
    left: 0;
    width: var(--md-checkbox-size);
    height: var(--md-checkbox-size);
    border: 2px solid var(--md-checkbox-unchecked-border);
    border-radius: var(--md-checkbox-border-radius);
    background: var(--md-checkbox-surface);
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.mt-checkbox > span:last-of-type:after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 11px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    transition: opacity 0.15s ease;
    display: none;
}
.mt-checkbox > input:checked ~ span:last-of-type:after {
    display: block;
}
.mt-checkbox:hover > input:not([disabled]) ~ span:last-of-type,
.mt-checkbox > input:focus ~ span:last-of-type {
    border-color: var(--md-checkbox-unchecked-hover);
}
.mt-checkbox > input:checked ~ span:last-of-type {
    background: var(--md-checkbox-accent);
    border-color: var(--md-checkbox-accent);
}
.mt-checkbox:hover > input:not([disabled]):checked ~ span:last-of-type,
.mt-checkbox > input:checked ~ span:last-of-type {
    background: var(--md-checkbox-accent-hover);
    border-color: var(--md-checkbox-accent-hover);
}
.mt-checkbox > input:disabled ~ span:last-of-type {
    opacity: 0.6;
    cursor: not-allowed;
}
.mt-checkbox.mt-checkbox-disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.mt-checkbox > input:focus-visible ~ span:last-of-type {
    box-shadow: var(--app-focus-ring, 0 0 0 2px rgba(13, 148, 136, 0.4));
}

/* Outline variant - same Material style, unchecked is outline only */
.mt-checkbox-outline > span:last-of-type,
.mt-checkbox.mt-checkbox-outline > span:last-of-type {
    background: var(--md-checkbox-surface);
    border: 2px solid var(--md-checkbox-unchecked-border);
}
.mt-checkbox-outline:hover > input:not([disabled]) ~ span:last-of-type,
.mt-checkbox.mt-checkbox-outline:hover > input:not([disabled]) ~ span:last-of-type {
    border-color: var(--md-checkbox-unchecked-hover);
}
.mt-checkbox-outline > input:checked ~ span:last-of-type,
.mt-checkbox.mt-checkbox-outline > input:checked ~ span:last-of-type {
    background: var(--md-checkbox-accent);
    border-color: var(--md-checkbox-accent);
}
.mt-checkbox-outline:hover > input:not([disabled]):checked ~ span:last-of-type,
.mt-checkbox.mt-checkbox-outline > input:checked ~ span:last-of-type {
    background: var(--md-checkbox-accent-hover);
    border-color: var(--md-checkbox-accent-hover);
}

/* Single checkbox in table cells - align nicely */
th > .mt-checkbox.mt-checkbox-single,
td > .mt-checkbox.mt-checkbox-single {
    margin-bottom: 0;
    padding-left: 32px;
}

/* Standalone checkboxes in tables (no .mt-checkbox wrapper) - minimal Material-like styling */
.table input[type="checkbox"],
.table-scrollable input[type="checkbox"],
.dataTables_wrapper input[type="checkbox"].sales-order-row-check,
.dataTables_wrapper input[type="checkbox"].dt-select-row {
    width: var(--md-checkbox-size);
    height: var(--md-checkbox-size);
    margin: 0;
    cursor: pointer;
    accent-color: var(--md-checkbox-accent);
    border-radius: var(--md-checkbox-border-radius);
}
/* Native checkboxes — size + accent (.mt-checkbox uses a hidden positioned input; dimensions reset below) */
.page-content input[type="checkbox"],
.form-horizontal input[type="checkbox"],
.form-body input[type="checkbox"],
.modal input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    margin-top: 0;
    vertical-align: middle;
    accent-color: var(--md-checkbox-accent);
    cursor: pointer;
}

.mt-checkbox > input[type="checkbox"] {
    width: var(--md-checkbox-size) !important;
    height: var(--md-checkbox-size) !important;
    min-width: var(--md-checkbox-size) !important;
    min-height: var(--md-checkbox-size) !important;
}

.job-type-checkboxes .job-type-checkbox input[type="checkbox"] {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
}

/* Job view — CRM card titles + doc upload drop zone (theme tokens) */
.job-view-page .job-view-crm-title-static {
    color: var(--app-text);
}
.job-view-upload-drop-zone__icon {
    color: var(--app-text-muted);
}

/* Purchase order create/edit: quantity and numeric inputs - easy to select on tablet/mobile (no spin buttons) */
.po-item-qty,
.purchase-order-items input.po-item-qty {
    -moz-appearance: textfield;
}
.po-item-qty::-webkit-outer-spin-button,
.po-item-qty::-webkit-inner-spin-button,
.purchase-order-items input[type="number"].form-control::-webkit-outer-spin-button,
.purchase-order-items input[type="number"].form-control::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.purchase-order-items input[type="number"].form-control {
    -moz-appearance: textfield;
}

/* Stocktaking (scanner / mobile friendly) */
.stocktake-page .stocktake-scan-row { max-width: 720px; }
.stocktake-page .stocktake-label { font-size: 16px; font-weight: 600; display: block; margin-bottom: 8px; }
.stocktake-page .stocktake-scan-group .form-control { font-size: 20px; height: 52px; }
.stocktake-page .stocktake-num { font-size: 18px; }
.stocktake-page .stocktake-item-panel .well { background: #fafbfc; border: 1px solid #e4e7ec; }

/* WIP Billing Report — AI */
.wip-ai-overall {
    max-height: 420px;
    overflow-y: auto;
    line-height: 1.65;
    font-size: 14px;
    color: #3a4150;
    padding: 4px 0;
}
.wip-ai-overall .wip-ai-formatted { margin: 0; }
.wip-ai-overall .wip-ai-para {
    margin: 0 0 1em 0;
}
.wip-ai-overall .wip-ai-para:last-child { margin-bottom: 0; }
.wip-ai-overall .wip-ai-job-ref {
    font-weight: 600;
    color: #337ab7;
    text-decoration: none;
    white-space: nowrap;
}
.wip-ai-overall .wip-ai-job-ref:hover {
    color: #23527c;
    text-decoration: underline;
}
.wip-ai-overall .wip-ai-bullet {
    display: inline-block;
    margin-right: 4px;
    color: #5a6a7a;
}

.wip-ai-cell {
    max-width: 300px;
    min-width: 180px;
    max-height: 180px;
    overflow-y: auto;
    vertical-align: top !important;
    padding: 8px 10px !important;
}
.wip-ai-cell .wip-ai-formatted {
    font-size: 12px;
    line-height: 1.5;
    color: #4a5568;
}
.wip-ai-cell .wip-ai-para {
    margin: 0 0 0.5em 0;
}
.wip-ai-cell .wip-ai-para:last-child { margin-bottom: 0; }
.wip-ai-cell .wip-ai-job-ref {
    font-weight: 600;
    color: #337ab7;
    text-decoration: none;
}
.wip-ai-cell .wip-ai-job-ref:hover {
    text-decoration: underline;
}
.wip-ai-cell .wip-ai-job-link {
    display: inline-block;
    margin-top: 6px;
    font-size: 11px;
    color: #5a9bd5;
}
.wip-ai-cell .wip-ai-job-link:hover {
    color: #337ab7;
}

/* Sales Leads module temporarily hidden (sidebar JS can unhide .hidden nav items) */
.sidebar .app-hide-sales-leads,
.app-hide-sales-leads {
    display: none !important;
}

/* My Tasks / Todo */
.text-strikethrough {
    text-decoration: line-through;
}
.task-urgent .task-title {
    font-weight: 600;
}

/* Inventory search modals — wider than modal-lg (~900px); override Metronic modal-full 99% with a max width */
.modal-dialog.modal-full.inventory-search-modal-dialog,
.modal-dialog.inventory-search-modal-dialog {
    width: 95%;
    max-width: 1680px;
}
#inventory-search-modal .modal-dialog,
#pl-inventory-search-modal .modal-dialog,
#searchinventorymodal .modal-dialog {
    width: 95%;
    max-width: 1680px;
}

/* Inventory search category Select2: dropdown is appended to body (avoids .modal overflow clip); stack above Metronic modal (~10050) */
.modal-open .select2-dropdown {
    z-index: 10065 !important;
}
@media (max-width: 768px) {
    .modal-dialog.modal-full.inventory-search-modal-dialog,
    .modal-dialog.inventory-search-modal-dialog,
    #inventory-search-modal .modal-dialog,
    #pl-inventory-search-modal .modal-dialog,
    #searchinventorymodal .modal-dialog {
        width: auto;
        max-width: none;
        margin: 10px;
    }
}

/*
 * Metronic plugins.css sets .modal-open .datepicker { z-index: 10055 } so pickers work above the backdrop.
 * That applies to ALL datepickers while any modal is open, so calendars from the page (e.g. PO create line
 * expected delivery) float above inventory search (modal z-index ~10050). Keep body-level pickers below the
 * modal; keep pickers that are rendered inside .modal (container: modal) above dialog content.
 */
.modal-open .datepicker.datepicker-dropdown,
.modal-open .datepicker.dropdown-menu {
    z-index: 10040 !important;
}
.modal-open .modal .datepicker.datepicker-dropdown,
.modal-open .modal .datepicker.dropdown-menu {
    z-index: 10060 !important;
}

/* Customer list: toolbar can hold many buttons; wrap instead of clipping on narrow widths */
.customer-list-portlet .portlet-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.customer-list-portlet .portlet-title .caption {
    float: none;
    flex: 1 1 auto;
    min-width: 0;
}
.customer-list-portlet .portlet-title .actions.customer-list-portlet-actions {
    float: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    max-width: 100%;
}
.customer-list-portlet .portlet-title .actions .btn-group {
    display: inline-flex;
    flex-wrap: wrap;
}

/* Icon action toolbars (replaces "Actions" dropdown menus) */
.view-icon-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    vertical-align: middle;
}
.portlet .actions .view-icon-actions {
    display: inline-flex;
}
.table-row-icon-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    max-width: 220px;
}
.btn.btn-icon-action {
    min-width: 28px;
    padding: 4px 7px;
}
.btn.btn-icon-action > i:only-child {
    margin: 0;
}

/* Bootbox above Bootstrap modals / Metronic overlays (replaces swal-above-modal).
   components.css uses body[ng-controller] .modal { z-index: 10050 !important } which beats
   a lone .bootbox.modal rule — include body[ng-controller] so confirms sit above page spinner. */
body[ng-controller] .modal.bootbox,
body[ng-controller] .bootbox.modal,
.bootbox.modal,
.modal.bootbox {
    z-index: 100550 !important;
}
body[ng-controller].modal-open .modal-backdrop.bootbox-backdrop-in,
body[ng-controller] .bootbox.modal + .modal-backdrop,
body.modal-open .modal-backdrop.bootbox-backdrop-in,
.bootbox.modal + .modal-backdrop {
    z-index: 100540 !important;
}

/* Metronic page-spinner-bar was z-index 10051 — above .modal (10050), blocking Bootbox / confirm dialogs */
.page-spinner-bar {
    z-index: 10030 !important;
}

/* Contact / location cards on customer, job, sales order views */
.crm-card-grid {
    display: flex;
    flex-wrap: wrap;
    margin-left: -8px;
    margin-right: -8px;
}
.crm-card-grid > [class*="col-"] {
    padding-left: 8px;
    padding-right: 8px;
}
.crm-entity-card {
    margin-bottom: 16px;
    height: calc(100% - 16px);
    border-radius: 4px;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.crm-entity-card:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border-color: #c2cad8;
}
.crm-entity-card .crm-card-title-link {
    font-size: 15px;
    font-weight: 600;
    color: #337ab7;
    display: inline-block;
    margin-bottom: 6px;
}
.crm-entity-card .crm-card-title-link:hover {
    color: #23527c;
    text-decoration: underline;
}
.crm-entity-card .crm-card-meta {
    font-size: 12px;
    color: #666;
    line-height: 1.45;
}
.crm-entity-card .crm-card-meta strong {
    color: #444;
    font-weight: 600;
}
.crm-entity-card .crm-card-actions {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.crm-entity-card .crm-card-data-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Purchase order line items: typeahead + bootstrap-select above scrollable table */
.tt-menu.po-line-item-tt-menu,
.po-line-item-tt-menu.tt-dropdown-menu {
    z-index: 10060 !important;
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid var(--app-border-strong);
    border-radius: 4px;
    box-shadow: var(--app-shadow-soft);
    background: var(--app-bg-card);
    margin-top: 2px;
}
.po-line-item-tt-menu .tt-suggestion {
    padding: 10px 12px;
    border-bottom: 1px solid var(--app-border);
    font-size: 13px;
    line-height: 1.45;
    color: var(--app-text-secondary);
}
.po-line-item-tt-menu .tt-suggestion:last-child {
    border-bottom: none;
}
.po-line-item-tt-menu .tt-suggestion.tt-cursor,
.po-line-item-tt-menu .tt-suggestion:hover {
    background: var(--app-accent-dim);
    color: var(--app-text);
}
.po-line-item-tt-menu .tt-empty-message {
    padding: 10px 12px;
    color: var(--app-text-muted);
    font-size: 13px;
}
/* bootstrap-select with container: 'body' (PO line UOM / cost code) */
body > .bootstrap-select.open .dropdown-menu {
    z-index: 10060 !important;
}

/* PO create/edit — expanded line item detail row */
tr.po-item-pricing-row > td {
    background: var(--app-bg-content) !important;
    border-top: none !important;
    padding: 12px 14px 16px !important;
    vertical-align: top;
}
.po-line-item-details {
    background: var(--app-bg-card);
    border: 1px solid var(--app-border-strong);
    border-radius: 8px;
    padding: 18px 20px 14px;
    box-shadow: var(--app-shadow-soft);
}
.po-line-item-details .row {
    margin-left: -12px;
    margin-right: -12px;
}
.po-line-item-details .row > [class*="col-"] {
    padding-left: 12px;
    padding-right: 12px;
}
.po-line-details-section {
    margin-bottom: 4px;
}
.po-line-details-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--app-text-muted);
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--app-border);
}
.po-line-item-details .form-group {
    margin-bottom: 11px;
}
.po-line-item-details .form-group > small {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--app-text-secondary);
    margin-bottom: 5px;
}
.po-line-item-details .assign-customer-wrap,
.po-line-item-details .assign-job-wrap,
.po-line-item-details .assign-sales-order-wrap,
.po-line-item-details .assign-costcode-wrap {
    margin-top: 8px !important;
}
.po-line-item-details .input-group .btn {
    border-radius: 0 4px 4px 0;
}
/* UOM / cost code: bootstrap-select trigger inside details panel (theme tokens — matches dark mode) */
.po-line-item-details .bootstrap-select > .btn.dropdown-toggle {
    border-radius: 6px;
    border: 1px solid var(--app-border-strong) !important;
    padding: 8px 12px;
    font-size: 13px;
    min-height: 36px;
    background: var(--app-bg-card) !important;
    color: var(--app-text) !important;
    box-shadow: none;
}
.po-line-item-details .bootstrap-select > .btn.dropdown-toggle:hover,
.po-line-item-details .bootstrap-select > .btn.dropdown-toggle:focus {
    border-color: var(--app-accent) !important;
    background: var(--app-bg-elevated) !important;
    color: var(--app-text) !important;
}
.po-line-item-details .bootstrap-select.btn-group .dropdown-toggle .filter-option,
.po-line-item-details .bootstrap-select .filter-option-inner-inner {
    color: var(--app-text) !important;
}
.po-line-item-details .bootstrap-select.btn-group .dropdown-toggle .filter-option {
    text-align: left;
}
.po-line-item-details .bootstrap-select > .dropdown-toggle .caret {
    color: var(--app-text-muted);
}
/* Line-item bootstrap-select menus appended to body (UOM + cost code) — theme tokens */
body > .bootstrap-select.open.po-line-uom-picker .dropdown-menu,
body > .bootstrap-select.open.po-line-uom-picker .dropdown-menu.open,
body > .bootstrap-select.open.po-line-bs-dropdown .dropdown-menu,
body > .bootstrap-select.open.po-line-bs-dropdown .dropdown-menu.open {
    z-index: 10060 !important;
    min-width: 280px;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: var(--app-shadow) !important;
    border: 1px solid var(--app-border-strong) !important;
    background: var(--app-bg-card) !important;
    margin-top: 4px;
    padding: 6px 0;
}
body > .bootstrap-select.open.po-line-uom-picker .dropdown-menu.inner,
body > .bootstrap-select.open.po-line-bs-dropdown .dropdown-menu.inner {
    max-height: 240px;
    background: transparent !important;
}
body > .bootstrap-select.open.po-line-uom-picker .dropdown-menu li a,
body > .bootstrap-select.open.po-line-bs-dropdown .dropdown-menu li a {
    padding: 9px 16px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--app-text-secondary) !important;
}
body > .bootstrap-select.open.po-line-uom-picker .dropdown-menu li a:hover,
body > .bootstrap-select.open.po-line-uom-picker .dropdown-menu li.active a,
body > .bootstrap-select.open.po-line-uom-picker .dropdown-menu li.selected a,
body > .bootstrap-select.open.po-line-bs-dropdown .dropdown-menu li a:hover,
body > .bootstrap-select.open.po-line-bs-dropdown .dropdown-menu li.active a,
body > .bootstrap-select.open.po-line-bs-dropdown .dropdown-menu li.selected a {
    background: var(--app-accent-dim) !important;
    color: var(--app-text) !important;
}
body > .bootstrap-select.open.po-line-uom-picker .bs-searchbox,
body > .bootstrap-select.open.po-line-bs-dropdown .bs-searchbox {
    padding: 8px 10px 6px;
}
body > .bootstrap-select.open.po-line-uom-picker .bs-searchbox input.form-control,
body > .bootstrap-select.open.po-line-bs-dropdown .bs-searchbox input.form-control {
    border-radius: 6px;
    height: 34px;
    font-size: 13px;
    background: var(--app-bg-elevated) !important;
    border-color: var(--app-border-strong) !important;
    color: var(--app-text) !important;
}
/* UOM picker open on body: match app-theme caret / no-results text */
body > .bootstrap-select.open.po-line-uom-picker .dropdown-menu .notify,
body > .bootstrap-select.open.po-line-bs-dropdown .dropdown-menu .notify,
body > .bootstrap-select.open.po-line-uom-picker .no-results,
body > .bootstrap-select.open.po-line-bs-dropdown .no-results {
    color: var(--app-text-muted) !important;
}

/* Purchase order create / edit — page chrome */
.po-form-page {
    margin-bottom: 28px;
}
/* Datepicker attaches to body; above PO sticky table headers when no modal open */
body:not(.modal-open) .datepicker.datepicker-dropdown,
body:not(.modal-open) .datepicker.dropdown-menu {
    z-index: 11050 !important;
}
.po-form-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}
.po-form-page-header__titles {
    flex: 1 1 280px;
    min-width: 0;
}
.po-form-page-header__titles .page-title {
    margin-top: 0;
    margin-bottom: 6px;
}
.po-form-page-lead {
    margin: 0;
    max-width: 52em;
    font-size: 13px;
    line-height: 1.55;
    color: var(--app-text-secondary);
}
.po-form-page-header__actions {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.po-form-section-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
    padding: 10px 12px;
    list-style: none;
    background: var(--app-bg-content);
    border: 1px solid var(--app-border);
    border-radius: 6px;
}
.po-form-section-nav a {
    display: inline-block;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--app-text-secondary);
    background: var(--app-bg-card);
    border: 1px solid var(--app-border-strong);
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none !important;
}
.po-form-section-nav a:hover,
.po-form-section-nav a:focus {
    color: var(--app-link);
    border-color: var(--app-accent);
    background: var(--app-accent-dim);
}
.po-form-section-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 22px;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--app-border);
    font-size: 16px;
    font-weight: 600;
    color: var(--app-text);
}
.po-form-section-title .fa {
    opacity: 0.55;
    color: var(--app-text-muted);
}
.po-form-section-title .badge {
    font-weight: 600;
    background: var(--app-accent-dim);
    color: var(--app-text);
    border: 1px solid var(--app-border);
}
.po-line-items-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.po-line-items-wrap table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--app-bg-elevated);
    box-shadow: inset 0 -1px 0 var(--app-border-strong);
    white-space: nowrap;
    color: var(--app-text-secondary);
    border-color: var(--app-border) !important;
}
.po-form-actions-bar {
    margin-top: 24px;
    padding: 16px 18px;
    background: var(--app-bg-content);
    border: 1px solid var(--app-border-strong);
    border-radius: 6px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.po-form-actions-bar .btn + .btn {
    margin-left: 0;
}
.po-form-actions-bar .btn-primary,
.po-form-actions-bar .btn-success {
    min-width: 118px;
}
.po-req-star {
    border-bottom: none;
    text-decoration: none;
    cursor: help;
    font-weight: 700;
}
.po-form-loading {
    padding: 48px 20px;
    background: var(--app-bg-content);
    border: 1px dashed var(--app-border-strong);
    border-radius: 6px;
    color: var(--app-text-secondary);
}
.po-form-page .portlet.light.bordered {
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.po-form-page .portlet-title .caption {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.po-form-line-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--app-text-muted);
    margin-left: 4px;
}
.po-form-section-anchor,
.po-form-section-title {
    scroll-margin-top: 96px;
}

/* PO create/edit: horizontal form stacks cleanly on narrow viewports */
@media (max-width: 991px) {
    .po-form-page .form-horizontal .form-group {
        margin-left: 0;
        margin-right: 0;
    }
    .po-form-page .form-horizontal .control-label {
        text-align: left !important;
        padding-top: 0;
        margin-bottom: 6px;
        float: none;
        width: 100% !important;
    }
    .po-form-page .form-horizontal .form-group > [class*="col-"] {
        float: none;
        width: 100% !important;
        padding-left: 15px;
        padding-right: 15px;
    }
    .po-form-page .form-horizontal .input-group {
        max-width: 100%;
    }
}
/* Portlet: avoid clipping in-page widgets (bootstrap-select in header uses normal flow) */
.po-form-page .portlet-body.form {
    overflow: visible;
}
@media (min-width: 992px) {
    .po-form-page .po-line-items-wrap {
        max-height: min(75vh, 920px);
        overflow-y: auto;
    }
}

/* Inventory item create / edit */
.inv-item-form-page {
    margin-bottom: 24px;
}
.inv-item-form-page .inv-item-portlet {
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.inv-item-form-page .inv-item-suppliers-portlet {
    margin-top: 8px;
}
.inv-item-form-lead {
    margin: 0 0 16px;
    font-size: 13px;
    line-height: 1.5;
    max-width: 52em;
}
.inv-item-form .form-group .control-label {
    font-weight: 600;
    color: #555;
}
.inv-item-form .help-block {
    font-size: 12px;
    margin-top: 4px;
}
.inv-supplier-card {
    margin-bottom: 14px;
    border: 1px solid #e1e5ec;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    background: #fcfcfd;
}
.inv-supplier-card .panel-body {
    padding: 16px 18px 12px;
}
.inv-supplier-card .control-label {
    font-size: 12px;
    font-weight: 600;
    color: #5c6b7a;
    margin-bottom: 4px;
}
.inv-supplier-card__row2 {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eef1f5;
}
.inv-supplier-card__actions {
    margin-top: 10px;
    padding-top: 8px;
}
.inv-supplier-card__actions .btn {
    min-width: 88px;
}

/* Inventory item view page */
.inv-item-view-page .inv-view-page-header {
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e6e9ef;
}
.inv-item-view-page .inv-view-title {
    margin-bottom: 0;
}
.inv-item-view-page .inv-view-cat-badge {
    margin-left: 8px;
    font-weight: 600;
    vertical-align: middle;
}
.inv-item-view-page .inv-view-portlet {
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}
.inv-item-view-page .inv-view-portlet .portlet-title {
    border-bottom: 1px solid #eef1f5;
    min-height: 48px;
}

/* Inventory documents manager */
.inv-doc-manager .inv-doc-lead {
    margin: 0 0 16px;
    font-size: 13px;
    max-width: 48em;
}
.inv-doc-manager .inv-doc-folder-panel {
    background: #f7f9fb;
    border: 1px solid #e1e5ec;
    border-radius: 6px;
    padding: 12px 10px 16px;
    margin-bottom: 16px;
}
@media (min-width: 992px) {
    .inv-doc-manager .inv-doc-folder-panel {
        margin-bottom: 0;
    }
}
.inv-doc-manager .inv-doc-side-title {
    margin: 0 0 10px 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7a8c;
}
.inv-doc-manager .inv-doc-folder-list {
    margin-bottom: 0;
}
.inv-doc-manager .inv-doc-folder-item {
    position: relative;
    margin-bottom: 2px;
    border-radius: 4px;
}
.inv-doc-manager .inv-doc-folder-item.active {
    background: #e8f4fc;
}
.inv-doc-manager .inv-doc-folder-item.active > .inv-doc-folder-link {
    color: #217ebd;
    font-weight: 600;
}
.inv-doc-manager .inv-doc-folder-link {
    display: block;
    padding: 8px 72px 8px 12px;
    border-radius: 4px;
    color: #333;
}
.inv-doc-manager .inv-doc-folder-link:hover {
    background: rgba(0, 0, 0, 0.04);
    text-decoration: none;
}
.inv-doc-manager .inv-doc-folder-name {
    margin-left: 6px;
}
.inv-doc-manager .inv-doc-folder-actions {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
}
.inv-doc-manager .inv-doc-folder-actions .btn {
    padding: 2px 6px;
    margin-left: 2px;
}
.inv-doc-manager .inv-doc-files-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eef1f5;
}
.inv-doc-manager .inv-doc-current-folder {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}
.inv-doc-manager .inv-doc-empty {
    text-align: center;
    padding: 36px 16px;
    color: #888;
    background: #fafbfc;
    border: 1px dashed #dce1e8;
    border-radius: 6px;
}
.inv-doc-manager .inv-doc-empty .fa {
    font-size: 36px;
    margin-bottom: 10px;
    opacity: 0.45;
}
.inv-doc-manager .inv-doc-card {
    border: 1px solid #e1e5ec;
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    margin-bottom: 16px;
}
.inv-doc-manager .inv-doc-card-preview {
    height: 140px;
    background: #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.inv-doc-manager .inv-doc-card-preview--img {
    padding: 0;
}
.inv-doc-manager .inv-doc-card-preview img {
    max-height: 140px;
    width: 100%;
    object-fit: contain;
}
.inv-doc-manager .inv-doc-card-icon .fa {
    font-size: 48px;
    color: #a0a8b3;
}
.inv-doc-manager .inv-doc-card .caption {
    padding: 12px;
}
.inv-doc-manager .inv-doc-card-title {
    margin: 0 0 6px;
    font-size: 13px;
    line-height: 1.35;
    word-break: break-word;
}
.inv-doc-manager .inv-doc-meta {
    margin: 0 0 10px;
}
.inv-doc-manager .inv-doc-table .inv-doc-col-preview {
    width: 64px;
}
.inv-doc-manager .inv-doc-table .inv-doc-col-actions {
    width: 100px;
}
.inv-doc-manager .inv-doc-list-thumb {
    width: 48px;
    height: 48px;
    overflow: hidden;
    background: #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}
.inv-doc-manager .inv-doc-list-thumb img {
    max-width: 48px;
    max-height: 48px;
    object-fit: cover;
}
.inv-doc-manager .inv-doc-list-thumb--icon .fa {
    font-size: 22px;
    color: #a0a8b3;
}

/* Inventory product images (main + gallery) */
.inv-product-images .inv-main-image-box {
    border: 1px solid #e1e5ec;
    border-radius: 8px;
    background: #fafbfc;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 12px;
}
.inv-product-images .inv-main-image-box img {
    max-width: 100%;
    max-height: 320px;
    object-fit: contain;
}
.inv-product-images .inv-main-image-placeholder {
    text-align: center;
    color: #8e99a8;
    padding: 24px 16px;
}
.inv-product-images .inv-gallery-thumb {
    display: inline-block;
    vertical-align: top;
    width: 92px;
    margin: 0 10px 12px 0;
    text-align: center;
}
.inv-product-images .inv-gallery-thumb .inv-gallery-thumb-img {
    width: 92px;
    height: 92px;
    border: 1px solid #e1e5ec;
    border-radius: 6px;
    overflow: hidden;
    background: #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
}
.inv-product-images .inv-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.inv-product-images .inv-gallery-thumb.is-main .inv-gallery-thumb-img {
    box-shadow: 0 0 0 2px #3598dc;
}
table.dataTable .inv-list-main-thumb {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 4px;
    vertical-align: middle;
    border: 1px solid #e1e5ec;
}

/* Inventory upload modal drop zone */
.inv-upload-drop-zone {
    position: relative;
    border: 2px dashed #c5cdd8;
    border-radius: 8px;
    padding: 36px 24px;
    text-align: center;
    background: #f7f9fb;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.inv-upload-drop-zone .fa-cloud-upload {
    font-size: 40px;
    color: #8e99a8;
    display: block;
    margin-bottom: 8px;
}
.inv-upload-drop-zone p {
    margin: 0;
    color: #5c6b7a;
    font-size: 13px;
}
.inv-upload-file-input {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}
.inv-upload-file-list {
    margin-top: 16px;
    max-height: 280px;
    overflow-y: auto;
}

/* Entity notes (jobs, customers, orders, etc.): preserve newlines and tab width in read-only views */
.entity-note-content {
    white-space: pre-wrap;
    word-break: break-word;
    tab-size: 4;
    -moz-tab-size: 4;
}

/* Tasks / todo list */
.todo-page .todo-toolbar {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e7ecf1;
}
.todo-page .todo-view-toggle-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.todo-page .todo-view-toggle-label {
    line-height: 30px;
    margin-right: 2px;
}
.todo-page .todo-view-toggle .btn {
    white-space: nowrap;
}
.todo-page .todo-compact-wrap {
    margin-top: 4px;
}
.todo-page .todo-compact-table {
    margin-bottom: 0;
    background: #fff;
}
.todo-page .todo-compact-table thead th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #7a8794;
    background: #f4f7f9;
    vertical-align: middle;
}
.todo-page .todo-compact-col-check {
    width: 44px;
    text-align: center;
}
.todo-page .todo-compact-col-due {
    width: 130px;
}
.todo-page .todo-compact-col-link {
    min-width: 160px;
    max-width: 280px;
}
.todo-page .todo-compact-col-actions {
    width: 108px;
    text-align: right;
}
.todo-page .todo-compact-check {
    margin: 0;
    padding-left: 0;
}
.todo-page .todo-compact-row--urgent td {
    background: #fffbfb;
    border-left: 3px solid #e7505a;
}
.todo-page .todo-compact-row--done td {
    opacity: 0.9;
}
.todo-page .todo-compact-row--worker-current td {
    box-shadow: inset 0 0 0 2px #3598dc;
}
.todo-page .todo-compact-title {
    font-weight: 600;
    font-size: 14px;
    color: #2b3a4a;
}
.todo-page .todo-compact-row--done .todo-compact-title {
    text-decoration: line-through;
}
.todo-page .todo-compact-private {
    font-size: 10px;
    margin-left: 4px;
    vertical-align: middle;
}
.todo-page .todo-compact-link-cell {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.todo-page .todo-grouped-wrap {
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.todo-page .todo-task-group__heading {
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid #e8edf2;
    font-size: 14px;
    font-weight: 600;
    color: #3b464f;
    display: flex;
    align-items: center;
    gap: 8px;
}
.todo-page .todo-task-group__count {
    background: #e8edf2;
    color: #4a5a6a;
}
.todo-page .todo-task-list--nested {
    gap: 10px;
}
.todo-page .todo-status-toggle .btn-default {
    background: #fff;
}
.todo-page .todo-assignee-filter .control-label {
    margin-bottom: 4px;
    font-weight: 600;
}
.todo-page .todo-loading,
.todo-page .todo-empty {
    padding: 48px 16px;
}
.todo-page .todo-empty-icon {
    font-size: 56px;
    color: #dce2e8;
    margin-bottom: 8px;
}
.todo-page .todo-task-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.todo-page .todo-task-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: #fbfcfd;
    border: 1px solid #e8edf2;
    border-radius: 6px;
    border-left: 4px solid #c5cdd8;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.todo-page .todo-task-card:hover {
    border-color: #d2dae3;
    box-shadow: 0 2px 8px rgba(54, 74, 99, 0.06);
}
.todo-page .todo-task-card--urgent {
    border-left-color: #e7505a;
    background: #fffbfb;
}
.todo-page .todo-task-card--done {
    opacity: 0.88;
    border-left-color: #aecfa4;
    background: #f9fbf8;
}
.todo-page .todo-task-card__main {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
    min-width: 0;
}
.todo-page .todo-task-card__check {
    margin-top: 2px;
    flex-shrink: 0;
}
.todo-page .todo-task-card__body {
    flex: 1;
    min-width: 0;
}
.todo-page .todo-task-card__title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.todo-page .todo-task-card__title {
    font-size: 15px;
    font-weight: 600;
    color: #2b3a4a;
}
.todo-page .todo-task-card--done .todo-task-card__title {
    text-decoration: line-through;
}
.todo-page .todo-badge {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.todo-page .todo-badge--danger {
    background: #fbe1e3;
    color: #c53f48;
}
.todo-page .todo-badge--success {
    background: #e8f5e9;
    color: #2e7d32;
}
.todo-page .todo-task-card__assoc {
    margin: 4px 0 8px;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #e3e9ef;
    border-radius: 4px;
    font-size: 13px;
}
.todo-page .todo-assoc-type {
    margin-right: 8px;
    vertical-align: middle;
    font-weight: 600;
}
.todo-page .todo-assoc-link {
    vertical-align: middle;
}
.todo-page .todo-assoc-sub {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.4;
}
.todo-page .todo-task-card__meta {
    font-size: 12px;
    line-height: 1.6;
}
.todo-page .todo-meta-item {
    display: inline-block;
    margin-right: 14px;
}
.todo-page .todo-task-card__desc {
    margin: 8px 0 0;
    font-size: 12px;
    line-height: 1.45;
}
.todo-page .todo-checklist {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed #e0e6ec;
}
.todo-page .todo-checklist__label {
    font-weight: 600;
    margin-bottom: 4px;
}
.todo-page .todo-checklist__list li {
    font-size: 12px;
    margin-top: 4px;
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
}
.todo-page .todo-checklist__item-check {
    margin-right: 6px;
    flex-shrink: 0;
}
.todo-page .todo-task-card__actions {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Sales order create/edit: Twitter Typeahead .tt-hint sits on top of the real input and looks like doubled/overlapping text */
.create-salesorder-form .twitter-typeahead {
    display: block;
    position: relative;
    width: 100%;
}
.create-salesorder-form .twitter-typeahead .tt-hint {
    display: none !important;
}
.create-salesorder-form .twitter-typeahead input.tt-input,
.create-salesorder-form .twitter-typeahead input.form-control {
    position: relative;
    z-index: 1;
}

/* Proposal view: primary contact & site location picker cards */
.proposal-basic-contact-site-row {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid #eee;
}
.proposal-basic-contact-site-heading {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}
.proposal-basic-contact-site-col .proposal-pick-card-static {
    max-width: none;
    width: 100%;
}
.proposal-basic-contact-site-col .proposal-pick-cards__hint {
    max-width: none;
}
.proposal-pick-cards__hint {
    font-size: 12px;
    margin-bottom: 10px;
    max-width: 640px;
}
.proposal-pick-cards__row {
    margin-left: -6px;
    margin-right: -6px;
}
.proposal-pick-cards__cell {
    padding-left: 6px;
    padding-right: 6px;
    margin-bottom: 12px;
}
.proposal-pick-card {
    border: 1px solid #e1e5ec;
    border-radius: 4px;
    padding: 12px 12px 10px;
    background: #fafbfc;
    height: 100%;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.proposal-pick-card--primary {
    border-color: #5cb85c;
    background: #f4fbf4;
    box-shadow: 0 0 0 1px rgba(92, 184, 92, 0.25);
}
.proposal-pick-card-static {
    max-width: 360px;
    background: #fff;
}
.proposal-pick-card__name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    line-height: 1.3;
}
.proposal-pick-card__meta {
    font-size: 12px;
    line-height: 1.45;
    margin-bottom: 2px;
    word-break: break-word;
}
.proposal-pick-card__actions {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #e8ecf1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

/* Global task worker — fixed bar under main header (see TaskWorkerFactory) */
.task-worker-top-bar {
    position: fixed;
    left: 0;
    right: 0;
    top: 64px;
    z-index: 9994;
    box-sizing: border-box;
    padding: 8px 16px 10px;
    background: #eef7fc;
    border-bottom: 1px solid #c5dce8;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.task-worker-top-bar__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.task-worker-top-bar__left,
.task-worker-top-bar__right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.task-worker-top-bar__count {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}
.task-worker-top-bar__title {
    font-weight: normal;
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.task-worker-top-bar__exit {
    color: #337ab7 !important;
}
.task-worker-top-bar__assoc {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}
/* Push page content below header + worker bar (Metronic header is 64px; bar ~88px) */
body.page-header-fixed.task-worker-active .page-container {
    margin-top: 152px !important;
}
@media (max-width: 991px) {
    /* Base mobile: override layout.css margin:0 !important so content clears header + bar */
    body.page-header-fixed.task-worker-active .page-container {
        margin-top: 152px !important;
    }
    body.page-header-fixed.page-header-fixed-mobile.task-worker-active .page-container {
        margin-top: 266px !important;
    }
}
.todo-task-card--worker-current {
    box-shadow: 0 0 0 2px #3598dc;
    background: #fafcfe;
}

/* Header task dropdown — detail + actions (no fake progress bar) */
.page-header.app-header.navbar .header-task-dropdown-toggle .header-task-worker-btn {
    margin-left: 4px;
    padding: 2px 6px;
    vertical-align: middle;
    line-height: 1.2;
    background: transparent;
    border: 1px solid rgba(15, 23, 42, 0.12);
    color: #64748b;
    border-radius: 6px !important;
}
.page-header.app-header.navbar .header-task-dropdown-toggle .header-task-worker-btn:hover {
    color: #0f766e;
    background: rgba(63, 213, 192, 0.12);
    border-color: rgba(63, 213, 192, 0.35);
}
.header-task-dropdown-list .header-task-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid #eef1f5;
}
.header-task-row__main {
    min-width: 0;
    flex: 1;
}
.header-task-row__title .desc {
    font-weight: 600;
}
.header-task-row__meta,
.header-task-row__linked {
    margin-top: 4px;
    line-height: 1.35;
    word-break: break-word;
}
.header-task-row__actions {
    flex-shrink: 0;
    white-space: nowrap;
}
.header-task-row__actions .btn {
    margin-left: 2px;
}
.task-worker-top-bar__due,
.task-worker-top-bar__sub {
    max-width: 38vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: bottom;
}

/* Supplier view — Xero bills table: expand control column */
#supplier-bills .supplier-bills-table .supplier-bill-expand-col {
    width: 32px;
    max-width: 36px;
    padding-left: 4px !important;
    padding-right: 4px !important;
    vertical-align: middle !important;
}
#supplier-bills .supplier-bills-table .supplier-bill-xero-col {
    width: 90px;
}
#supplier-bills .supplier-bills-table th.supplier-bill-sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
#supplier-bills .supplier-bills-table th.supplier-bill-sortable:hover {
    background-color: #f9f9f9;
}

/* Supplier view — Xero bill line items (nested table; avoid table-layout:fixed inside .table-responsive — it can collapse text columns) */
#supplier-bills .supplier-bill-lines-cell {
    padding: 0 !important;
    background: #fafafa;
    border-top: 0 !important;
}
#supplier-bills .supplier-bill-lines-inner {
    padding: 10px 12px;
    overflow-x: auto;
}
#supplier-bills .supplier-bill-line-items {
    width: 100%;
    min-width: 520px;
    table-layout: auto;
}
#supplier-bills .supplier-bill-line-items th,
#supplier-bills .supplier-bill-line-items td {
    vertical-align: top;
}
#supplier-bills .supplier-bill-line-items .supplier-bill-line-code {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 10rem;
}
#supplier-bills .supplier-bill-line-items .supplier-bill-line-desc {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 36rem;
}
#supplier-bills .supplier-bill-line-items .supplier-bill-line-desc .text-muted {
    color: #555;
}
#supplier-bills .supplier-bill-line-items .supplier-bill-line-num {
    white-space: nowrap;
}
#supplier-bills .supplier-bill-line-items .supplier-bill-line-actions {
    white-space: nowrap;
    text-align: right;
}
#supplier-bills .supplier-bill-expand-btn {
    padding: 0 4px;
    min-width: 22px;
}

/* Supplier return view — layout + readability (fixes broken portlet nesting + table wrappers) */
.supplier-return-view__loading {
    padding: 80px 20px 60px;
}
.supplier-return-view__section-title {
    margin-top: 0;
    margin-bottom: 12px;
    padding-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #2b4a5c;
    border-bottom: 1px solid #e7ecf1;
}
.supplier-return-view__section-title--spaced {
    margin-top: 24px;
}
.supplier-return-view__section-title .fa {
    margin-right: 6px;
    color: #3598dc;
}
.supplier-return-view__detail-table > tbody > tr > td:first-child {
    width: 38%;
    font-weight: 600;
    color: #555;
    background-color: #f9f9f9;
}
.supplier-return-view__note-heading {
    font-size: 13px;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 8px;
    color: #2b4a5c;
}
.supplier-return-view__note-body {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.5;
    color: #333;
    padding: 10px 12px;
    background: #f9f9f9;
    border: 1px solid #e7ecf1;
    border-radius: 4px;
}
.supplier-return-view__items-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.supplier-return-view .table thead > tr > th {
    background-color: #f6f8f9;
    font-weight: 600;
}
.supplier-return-view .portlet.light > .portlet-body {
    padding-top: 15px;
}
.supplier-return-view__history-desc {
    white-space: normal;
    word-break: break-word;
    max-width: 420px;
}

/* ——— Purchasing dashboard ——— */
.purchasing-dashboard {
    --pd-accent: #3598dc;
    --pd-surface: #fff;
    --pd-border: #e7ecf1;
    --pd-text: #2b4a5c;
    --pd-muted: #7e8c9a;
    padding-bottom: 28px;
}
.purchasing-dashboard__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 24px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--pd-border);
}
.purchasing-dashboard__title {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 600;
    color: var(--pd-text);
    letter-spacing: -0.02em;
}
.purchasing-dashboard__subtitle {
    margin: 0;
    font-size: 13px;
    color: var(--pd-muted);
    max-width: 520px;
    line-height: 1.45;
}
.purchasing-dashboard__asof {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--pd-muted);
    padding: 6px 10px;
    background: #f4f7f9;
    border-radius: 4px;
    border: 1px solid var(--pd-border);
}
.purchasing-dashboard__asof .fa {
    opacity: 0.85;
}
.purchasing-dashboard__loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    background: var(--pd-surface);
    border: 1px solid var(--pd-border);
    border-radius: 6px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.purchasing-dashboard__loading-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--pd-muted);
}
.purchasing-dashboard__spinner {
    font-size: 20px;
    color: #3598dc;
}
.purchasing-dashboard__error {
    margin-bottom: 16px;
}
.purchasing-dashboard__flot-chart {
    height: 260px;
    width: 100%;
}
.purchasing-dashboard__section {
    margin-bottom: 8px;
}
.purchasing-dashboard__kpi-grid,
.sales-dashboard__kpi-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 16px;
}
.purchasing-dashboard__kpi-grid--4,
.sales-dashboard__kpi-grid--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.purchasing-dashboard__kpi-grid--3,
.sales-dashboard__kpi-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 1199px) {
    .purchasing-dashboard__kpi-grid--4,
    .sales-dashboard__kpi-grid--4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 767px) {
    .purchasing-dashboard__kpi-grid--4,
    .purchasing-dashboard__kpi-grid--3,
    .sales-dashboard__kpi-grid--4,
    .sales-dashboard__kpi-grid--3 {
        grid-template-columns: 1fr;
    }
}
.purchasing-dashboard .sales-dash-card {
    --sd-text: var(--pd-text);
    --sd-muted: var(--pd-muted);
    --sd-border: var(--pd-border);
    background: var(--pd-surface);
}
.purchasing-dashboard__portlet .portlet-title {
    min-height: 42px;
    border-bottom: 1px solid #eef2f5;
}
.purchasing-dashboard__portlet .caption-md {
    font-size: 15px;
    font-weight: 600;
    color: var(--pd-text);
    display: flex;
    align-items: center;
    gap: 10px;
}
.purchasing-dashboard__portlet-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 14px;
}
.purchasing-dashboard__portlet-icon--danger {
    background: #fdecea;
    color: #c0392b;
}
.purchasing-dashboard__portlet-icon--soon {
    background: #e8f4fc;
    color: #2980b9;
}
.purchasing-dashboard__portlet-icon--neutral {
    background: #f0f4f7;
    color: #5d6d7e;
}
.purchasing-dashboard__help {
    font-size: 12px;
    line-height: 1.5;
    margin-bottom: 16px;
}
.purchasing-dashboard__table-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--pd-text);
    margin: 18px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eef2f5;
}
.purchasing-dashboard__table-title:first-of-type {
    margin-top: 0;
}
.purchasing-dashboard__table-wrap {
    margin-bottom: 4px;
    border: 1px solid var(--pd-border);
    border-radius: 6px;
    max-height: 280px;
    overflow: auto;
}
.purchasing-dashboard__table {
    margin-bottom: 0;
    font-size: 12px;
}
.purchasing-dashboard__table thead > tr > th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f6f8f9 !important;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #5d6d7e;
    border-bottom: 1px solid var(--pd-border) !important;
    white-space: nowrap;
}
.purchasing-dashboard__table tbody > tr > td {
    vertical-align: middle !important;
}
.purchasing-dashboard__col-action {
    width: 72px;
}
.purchasing-dashboard__empty {
    font-size: 12px;
    margin-bottom: 8px;
}
.purchasing-dashboard__date {
    font-weight: 600;
    font-size: 12px;
}
.purchasing-dashboard__date--bad {
    color: #c0392b;
}
.purchasing-dashboard__date--soon {
    color: #2980b9;
}
.purchasing-dashboard__status-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.purchasing-dashboard__status-row {
    display: grid;
    grid-template-columns: minmax(80px, 28%) 1fr 40px;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}
.purchasing-dashboard__status-name {
    font-weight: 600;
    color: var(--pd-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.purchasing-dashboard__status-bar-track {
    height: 8px;
    background: #eef2f5;
    border-radius: 4px;
    overflow: hidden;
}
.purchasing-dashboard__status-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #5cadd9, #3598dc);
    min-width: 2px;
    transition: width 0.35s ease;
}
.purchasing-dashboard__status-count {
    text-align: right;
    font-weight: 700;
    color: var(--pd-text);
}
.purchasing-dashboard__ql-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
@media (max-width: 500px) {
    .purchasing-dashboard__ql-grid {
        grid-template-columns: 1fr;
    }
}
.purchasing-dashboard__ql {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--pd-border);
    border-radius: 8px;
    background: #fafcfd;
    color: var(--pd-text) !important;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.purchasing-dashboard__ql:hover {
    background: #fff;
    border-color: #c5d9e8;
    box-shadow: 0 2px 8px rgba(53, 152, 220, 0.12);
    color: #3598dc !important;
}
.purchasing-dashboard__ql--primary {
    background: linear-gradient(135deg, #3aa1e2 0%, #2d8bc9 100%);
    border-color: #2d8bc9;
    color: #fff !important;
    grid-column: 1 / -1;
}
.purchasing-dashboard__ql--primary:hover {
    color: #fff !important;
    filter: brightness(1.05);
    box-shadow: 0 4px 12px rgba(53, 152, 220, 0.35);
}
.purchasing-dashboard__ql-ico {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    font-size: 16px;
    flex-shrink: 0;
}
.purchasing-dashboard__ql:not(.purchasing-dashboard__ql--primary) .purchasing-dashboard__ql-ico {
    background: #eef5f9;
    color: #3598dc;
}
.purchasing-dashboard__ql--primary .purchasing-dashboard__ql-ico {
    background: rgba(255, 255, 255, 0.22);
}
.purchasing-dashboard__ql-text {
    line-height: 1.3;
}
.purchasing-dashboard__procurement-grid .portlet-body {
    padding-top: 12px;
}
.purchasing-dashboard__portlet--compact .portlet-title {
    padding-bottom: 8px;
    min-height: auto;
}
.purchasing-dashboard__stat-rows {
    font-size: 13px;
    color: var(--pd-text);
    margin-bottom: 10px;
}
.purchasing-dashboard__stat-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 5px 0;
    border-bottom: 1px solid var(--pd-border);
}
.purchasing-dashboard__stat-row:last-of-type {
    border-bottom: none;
}
.purchasing-dashboard__stat-row span {
    color: var(--pd-muted);
}
.purchasing-dashboard__procurement-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    margin-top: 4px;
}

/* ——— Operational & business insights report ——— */
.operational-insights-report .oi-chart-wrap {
    background: var(--app-bg-elevated, #fafbfc);
    border: 1px solid var(--app-border-strong, #e7ecf1);
    border-radius: 6px;
    padding: 12px 8px 4px;
    margin-bottom: 16px;
}
.operational-insights-report .oi-chart-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--app-text, #2b2f33);
    margin: 0 8px 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.operational-insights-report .oi-flot-chart {
    height: 220px;
    width: 100%;
}
.operational-insights-report .oi-morris-donut {
    min-height: 260px;
    height: 260px;
}
.operational-insights-report .table.oi-table > thead > tr > th {
    border-bottom: 2px solid var(--app-border-strong, #dce2e8);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--app-text-muted, #5c6b7a);
    background: var(--app-bg-elevated, #f6f8f9) !important;
}
.operational-insights-report .table.oi-table > tbody > tr > td {
    vertical-align: middle;
}
.operational-insights-report .oi-rev-bar {
    height: 8px;
    border-radius: 4px;
    background: var(--app-bg-content, #eef2f6);
    overflow: hidden;
    margin-top: 4px;
    max-width: 120px;
}
.operational-insights-report .oi-rev-bar > span {
    display: block;
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #3598dc, #5cadec);
}
.operational-insights-report .oi-stock-bar {
    height: 10px;
    border-radius: 4px;
    background: var(--app-bg-content, #eef2f6);
    overflow: hidden;
    max-width: 140px;
}
.operational-insights-report .oi-stock-bar > span {
    display: block;
    height: 100%;
    border-radius: 4px;
}
.operational-insights-report .oi-stock-bar.oi-low > span {
    background: #e7505a;
}
.operational-insights-report .oi-stock-bar.oi-ok > span {
    background: #26c281;
}
.operational-insights-report .oi-filters {
    background: var(--app-bg-elevated, #f4f6f8);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 20px;
    border: 1px solid var(--app-border-strong, #e7ecf1);
    color: var(--app-text-secondary, #475569);
}
.operational-insights-report .operational-insights-report__date-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 16px;
}
.operational-insights-report .operational-insights-report__date-form .form-group {
    margin-bottom: 0;
}
.operational-insights-report .operational-insights-report__date-input {
    width: 11em;
    min-width: 9em;
}
.operational-insights-report .operational-insights-report__run-btn {
    margin-left: 0;
}

/* ——— Sales dashboard ——— */
.sales-dashboard {
    --sd-text: #2b4a5c;
    --sd-muted: #7e8c9a;
    --sd-border: #e7ecf1;
    padding-bottom: 28px;
}
.sales-dashboard__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 24px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--sd-border);
}
.sales-dashboard__title {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 600;
    color: var(--sd-text);
    letter-spacing: -0.02em;
}
.sales-dashboard__subtitle {
    margin: 0;
    font-size: 13px;
    color: var(--sd-muted);
    max-width: 640px;
    line-height: 1.45;
}
.sales-dashboard__asof {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--sd-muted);
    padding: 6px 10px;
    background: #f4f7f9;
    border-radius: 4px;
    border: 1px solid var(--sd-border);
}
.sales-dashboard__loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 180px;
    background: #fff;
    border: 1px solid var(--sd-border);
    border-radius: 6px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.sales-dashboard__loading-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--sd-muted);
}
.sales-dashboard__loading-inner .fa-spinner {
    font-size: 20px;
    color: #3598dc;
}
.sales-dashboard__error {
    margin-bottom: 16px;
}
.sales-dashboard__kpi-grid--auto {
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
}
@media (max-width: 767px) {
    .sales-dashboard__kpi-grid--auto {
        grid-template-columns: 1fr;
    }
}
.sales-dash-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 132px;
    --sd-text: #2b4a5c;
    --sd-muted: #7e8c9a;
    --sd-border: #e7ecf1;
    background: #fff;
    border: 1px solid var(--sd-border);
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(43, 74, 92, 0.06);
    overflow: hidden;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.sales-dash-card:hover {
    box-shadow: 0 4px 14px rgba(43, 74, 92, 0.1);
    border-color: #dce4ea;
}
.sales-dash-card__accent {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--card-accent, #3598dc);
}
.sales-dash-card__icon {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 18px;
    color: var(--card-accent, #3598dc);
    background: color-mix(in srgb, var(--card-accent, #3598dc) 12%, white);
}
.sales-dash-card__body {
    padding: 14px 16px 10px 20px;
    flex: 1;
}
.sales-dash-card__kicker {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--sd-muted);
    margin-bottom: 6px;
}
.sales-dash-card__value {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--sd-text);
    letter-spacing: -0.03em;
}
.sales-dash-card__value--money {
    font-size: 22px;
}
.sales-dash-card__value-note {
    font-size: 16px;
    font-weight: 600;
    opacity: 0.88;
    color: var(--sd-muted);
}
.sales-dash-card__label {
    margin-top: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--sd-text);
}
.sales-dash-card__hint {
    margin-top: 6px;
    font-size: 11px;
    line-height: 1.4;
    color: var(--sd-muted);
}
.sales-dash-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding: 8px 16px 10px 20px;
    font-size: 12px;
    font-weight: 600;
    color: #5b7c93;
    background: linear-gradient(to bottom, #fafcfd, #f4f7f9);
    border-top: 1px solid var(--sd-border);
    text-decoration: none !important;
}
.sales-dash-card__footer:hover {
    color: #3598dc;
    background: #f0f6fa;
}
.sales-dash-card__extra {
    margin-top: auto;
    padding: 10px 16px 12px 20px;
    border-top: 1px solid var(--sd-border);
    background: linear-gradient(to bottom, #fafcfd, #f4f7f9);
}
.sales-dash-card__extra .btn {
    margin: 0;
}
.sales-dash-card__progress {
    padding: 0 16px 12px 20px;
    margin-top: 2px;
}
.sales-dash-card__progress .progress {
    height: 8px;
    margin-bottom: 6px;
    border-radius: 4px;
    background: #eef2f5;
}
.sales-dash-card__progress .status-title {
    font-size: 11px;
    line-height: 1.35;
    color: var(--sd-muted);
}
.sales-dash-card--blue { --card-accent: #3598dc; }
.sales-dash-card--teal { --card-accent: #1bbc9b; }
.sales-dash-card--indigo { --card-accent: #5c6bc0; }
.sales-dash-card--purple { --card-accent: #8e44ad; }
.sales-dash-card--gold { --card-accent: #c29d0b; }
.sales-dash-card--slate { --card-accent: #6c7a89; }
.sales-dash-card--red { --card-accent: #e7505a; }
.sales-dash-card--green { --card-accent: #26a69a; }
.sales-dash-card--amber { --card-accent: #e67e22; }
.sales-dash-card--rose { --card-accent: #e35b5a; }
.sales-dashboard__kpi-grid--compact {
    margin-top: 4px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
@media (max-width: 991px) {
    .sales-dashboard__kpi-grid--compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 500px) {
    .sales-dashboard__kpi-grid--compact {
        grid-template-columns: 1fr;
    }
}
.sales-dash-mini {
    --sd-text: #2b4a5c;
    --sd-muted: #7e8c9a;
    --sd-border: #e7ecf1;
    background: #fafcfd;
    border: 1px solid var(--sd-border);
    border-radius: 8px;
    padding: 14px 16px;
    min-height: 118px;
    display: flex;
    flex-direction: column;
}
.sales-dash-mini__value {
    font-size: 24px;
    font-weight: 700;
    color: var(--sd-text);
    letter-spacing: -0.02em;
}
.sales-dash-mini__label {
    font-size: 12px;
    font-weight: 700;
    color: var(--sd-text);
    margin-top: 4px;
}
.sales-dash-mini__hint {
    font-size: 11px;
    color: var(--sd-muted);
    line-height: 1.35;
    margin-top: 6px;
    flex: 1;
}
.sales-dash-mini__link {
    margin-top: 10px;
    font-size: 12px;
    font-weight: 600;
}
.sales-dashboard__charts {
    margin-top: 8px;
}
.sales-dashboard__portlet .portlet-title {
    min-height: 44px;
    border-bottom: 1px solid #eef2f5;
}
.sales-dashboard__caption {
    display: flex !important;
    align-items: flex-start;
    gap: 12px;
    max-width: 100%;
}
.sales-dashboard__caption-title {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: var(--sd-text);
    text-transform: none;
    letter-spacing: 0;
}
.sales-dashboard__caption-desc {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: var(--sd-muted);
    line-height: 1.4;
    margin-top: 2px;
    max-width: 520px;
}
.sales-dashboard__caption-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 15px;
}
.sales-dashboard__caption-icon--blue {
    background: #e8f4fc;
    color: #2980b9;
}
.sales-dashboard__caption-icon--teal {
    background: #e6faf5;
    color: #1bbc9b;
}
.sales-dashboard__caption-icon--gold {
    background: #fdf8e6;
    color: #c29d0b;
}
.sales-dashboard__caption-icon--purple {
    background: #f4ecf7;
    color: #8e44ad;
}
.sales-dashboard__caption-icon--neutral {
    background: #f0f4f7;
    color: #5d6d7e;
}
.sales-dash-chart-wrap {
    height: 280px;
    width: 100%;
}
.sales-dash-chart-wrap--proposal {
    max-width: 640px;
}
.sales-dashboard__table-scroll {
    border: 1px solid var(--sd-border);
    border-radius: 6px;
    max-height: 300px;
    overflow: auto;
}
.sales-dashboard__data-table {
    margin-bottom: 0;
    font-size: 12px;
}
.sales-dashboard__data-table thead > tr > th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f6f8f9 !important;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #5d6d7e;
    border-bottom: 1px solid var(--sd-border) !important;
    white-space: nowrap;
}
.sales-dashboard__data-table tbody > tr > td {
    vertical-align: middle !important;
}
.sales-dashboard__subcount {
    font-size: 10px;
}
.sales-dashboard__footnote {
    margin-top: 10px;
    margin-bottom: 0;
}
.sales-dashboard__status-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.sales-dashboard__status-row {
    display: grid;
    grid-template-columns: minmax(72px, 30%) 1fr 36px;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}
.sales-dashboard__status-name {
    font-weight: 600;
    color: var(--sd-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sales-dashboard__status-bar-track {
    height: 8px;
    background: #eef2f5;
    border-radius: 4px;
    overflow: hidden;
}
.sales-dashboard__status-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #9b6bcc, #8e44ad);
    min-width: 2px;
    transition: width 0.35s ease;
}
.sales-dashboard__status-count {
    text-align: right;
    font-weight: 700;
    color: var(--sd-text);
}
.sales-dashboard__ql-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
@media (max-width: 500px) {
    .sales-dashboard__ql-grid {
        grid-template-columns: 1fr;
    }
}
.sales-dashboard__ql {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--sd-border);
    border-radius: 8px;
    background: #fafcfd;
    color: var(--sd-text) !important;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.sales-dashboard__ql:hover {
    background: #fff;
    border-color: #c5d9e8;
    box-shadow: 0 2px 8px rgba(53, 152, 220, 0.12);
    color: #3598dc !important;
}
.sales-dashboard__ql--primary {
    background: linear-gradient(135deg, #3aa1e2 0%, #2d8bc9 100%);
    border-color: #2d8bc9;
    color: #fff !important;
    grid-column: 1 / -1;
}
.sales-dashboard__ql--primary:hover {
    color: #fff !important;
    filter: brightness(1.05);
    box-shadow: 0 4px 12px rgba(53, 152, 220, 0.35);
}
.sales-dashboard__ql-ico {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 16px;
    flex-shrink: 0;
}
.sales-dashboard__ql:not(.sales-dashboard__ql--primary) .sales-dashboard__ql-ico {
    background: #eef5f9;
    color: #3598dc;
}
.sales-dashboard__ql--primary .sales-dashboard__ql-ico {
    background: rgba(255, 255, 255, 0.22);
}
.sales-dashboard__ql-text {
    line-height: 1.3;
}
@supports not (background: color-mix(in srgb, red 50%, white)) {
    .sales-dash-card__icon {
        background: rgba(53, 152, 220, 0.12);
    }
    .sales-dash-card--teal .sales-dash-card__icon {
        background: rgba(27, 188, 155, 0.15);
    }
    .sales-dash-card--indigo .sales-dash-card__icon {
        background: rgba(92, 107, 192, 0.14);
    }
    .sales-dash-card--purple .sales-dash-card__icon {
        background: rgba(142, 68, 173, 0.12);
    }
    .sales-dash-card--gold .sales-dash-card__icon {
        background: rgba(194, 157, 11, 0.15);
    }
    .sales-dash-card--slate .sales-dash-card__icon {
        background: rgba(108, 122, 137, 0.15);
    }
    .sales-dash-card--red .sales-dash-card__icon {
        background: rgba(231, 80, 90, 0.12);
    }
    .sales-dash-card--green .sales-dash-card__icon {
        background: rgba(38, 166, 154, 0.12);
    }
    .sales-dash-card--amber .sales-dash-card__icon {
        background: rgba(230, 126, 34, 0.15);
    }
    .sales-dash-card--rose .sales-dash-card__icon {
        background: rgba(227, 91, 90, 0.12);
    }
}

/* ——— Main home dashboard ——— */
.main-dashboard {
    padding-bottom: 24px;
}
.main-dashboard__title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    margin-bottom: 8px;
}
.main-dashboard__page-title {
    margin: 0;
}
.main-dashboard__title-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.main-dashboard__asof {
    white-space: nowrap;
}
.main-dashboard__lede {
    font-size: 13px;
    line-height: 1.45;
    max-width: 900px;
    margin-bottom: 18px;
}
.main-dashboard__chart {
    height: 300px;
    width: 100%;
}
.module-dash__chart {
    height: 280px;
    width: 100%;
}
.module-dash__chart--donut {
    height: 260px;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}
.job-ops-dashboard__chart-wrap {
    height: 300px;
    width: 100%;
}
.job-ops-dashboard__donut-wrap {
    height: 280px;
    width: 100%;
    min-height: 260px;
}

/* —— Jobs operations dashboard: hero, KPI surface, grid KPIs, two-column ops —— */
.job-ops-dashboard {
    min-width: 0;
}
.job-ops-dashboard__hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px 24px;
    margin-bottom: 22px;
    padding: 18px 20px 16px;
    background: linear-gradient(135deg, #f8fafb 0%, #fff 48%, #f4f8fa 100%);
    border: 1px solid #e1e8ec;
    border-radius: 10px;
    border-left: 4px solid #32c5d2;
    box-shadow: 0 1px 3px rgba(43, 74, 92, 0.06);
}
.job-ops-dashboard__hero-main {
    flex: 1 1 280px;
    min-width: 0;
}
.job-ops-dashboard__hero-title {
    margin: 0 0 6px 0;
    line-height: 1.2;
}
.job-ops-dashboard__hero-lede {
    margin: 0;
    max-width: 52em;
    font-size: 13px;
    line-height: 1.45;
}
.job-ops-dashboard__hero-meta {
    flex: 0 0 auto;
    align-self: center;
}
.job-ops-dashboard__hero-asof {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #5b6b78;
    background: #fff;
    border: 1px solid #dce4ea;
    border-radius: 20px;
    white-space: nowrap;
}
.job-ops-dashboard__kpi-surface {
    margin-bottom: 20px;
    padding: 18px 18px 8px;
    background: #fff;
    border: 1px solid #e7ecf1;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(43, 74, 92, 0.05);
}
.job-ops-dashboard__section {
    margin-bottom: 20px;
}
.job-ops-dashboard__section--first {
    margin-top: 0;
}
.job-ops-dashboard__heading {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin: 0 0 12px 0;
    color: #2b4a5c;
    padding-bottom: 8px;
    border-bottom: 1px solid #e7ecf1;
}
.job-ops-dashboard__kpi-wrap {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}
.job-ops-dashboard__kpi-wrap > .sales-dash-card {
    min-width: 0;
    width: 100%;
}
@media (min-width: 1400px) {
    .job-ops-dashboard__kpi-wrap {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}
.job-ops-dashboard__quick-actions .portlet-title {
    min-height: 42px;
    padding-top: 8px;
    padding-bottom: 8px;
}
.job-ops-dashboard__quick-actions-body {
    padding-top: 12px !important;
    padding-bottom: 12px !important;
}
.job-ops-dashboard__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.job-ops-dashboard__ops-cols {
    align-items: flex-start;
}
.job-ops-dashboard__ops-stack > .portlet:last-child {
    margin-bottom: 0 !important;
}
.job-ops-dashboard__charts-row > [class*="col-"] > .portlet {
    height: 100%;
}
.job-ops-dashboard__deadlines-body {
    padding-top: 8px;
}
.job-ops-dashboard__deadline-pane {
    padding: 12px 14px 14px;
    border-radius: 8px;
    border: 1px solid #e7ecf1;
    background: #fafcfd;
    min-height: 0;
}
.job-ops-dashboard__deadline-pane--overdue {
    border-left: 3px solid #e7505a;
    background: linear-gradient(180deg, #fffbfb 0%, #fafcfd 100%);
}
.job-ops-dashboard__deadline-pane--soon {
    border-left: 3px solid #c29d0b;
    background: linear-gradient(180deg, #fffef8 0%, #fafcfd 100%);
}
.job-ops-dashboard__deadline-pane .job-ops-dashboard__subheading {
    margin-top: 0;
}
.job-ops-dashboard__future-row > [class*="col-"] {
    display: flex;
    flex-direction: column;
}
.job-ops-dashboard__future-row .job-ops-dashboard__portlet-fill {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}
.job-ops-dashboard__future-row .job-ops-dashboard__portlet-fill .portlet-body {
    flex: 1 1 auto;
}
.job-ops-dashboard__portlet-body {
    min-width: 0;
    overflow-x: auto;
}
.job-ops-dashboard__table-scroll {
    max-height: 420px;
    overflow: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}
.job-ops-dashboard__table-scroll .table {
    margin-bottom: 0;
    font-size: 12px;
}
.job-ops-dashboard__data-table {
    table-layout: fixed;
    width: 100%;
}
.job-ops-dashboard__data-table > thead > tr > th,
.job-ops-dashboard__data-table > tbody > tr > td {
    vertical-align: top;
}
.job-ops-dashboard__th-job {
    width: 36%;
}
.job-ops-dashboard__th-actions {
    width: 110px;
    text-align: right;
}
.job-ops-dashboard__cell-job {
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.job-ops-dashboard__cell-job > a {
    font-weight: 600;
}
.job-ops-dashboard__sub {
    font-size: 11px;
    margin-top: 4px;
    line-height: 1.35;
}
.job-ops-dashboard__td-actions {
    text-align: right;
    white-space: nowrap;
}
.job-ops-dashboard__td-actions .btn {
    display: inline-block;
    margin-left: 4px;
    margin-bottom: 2px;
}
.job-ops-dashboard__td-actions .btn:first-child {
    margin-left: 0;
}
.job-ops-dashboard__subheading {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 10px 0;
}
.job-ops-dashboard__split-col {
    min-width: 0;
    margin-bottom: 16px;
}
@media (min-width: 992px) {
    .job-ops-dashboard__split-col {
        margin-bottom: 0;
    }
}
.job-ops-dashboard__muted {
    display: block;
    font-size: 11px;
    color: #7e8c9a;
    margin-top: 2px;
}
.job-ops-dashboard .job-ops-dashboard__chart-wrap,
.job-ops-dashboard .job-ops-dashboard__donut-wrap {
    overflow: hidden;
    max-width: 100%;
}
.main-dashboard__table-scroll {
    max-height: 320px;
    overflow: auto;
}
.main-dashboard__activity-body {
    padding: 0 !important;
}
.main-dashboard__activity-scroll {
    max-height: 320px;
    overflow-y: auto;
    overflow-x: hidden;
}
.main-dashboard__activity-col-time {
    width: 130px;
}
.main-dashboard__activity-col-user {
    width: 120px;
}
.dashboard-quick-links-flex {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: stretch;
    gap: 12px;
}
.quick-link-card {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    padding: 18px 0 10px;
    min-width: 0;
    min-height: 110px;
    text-align: center;
    font-weight: 600;
    font-size: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s, transform 0.2s, filter 0.2s;
    text-decoration: none;
    margin: 0;
    color: #fff !important;
}
.quick-link-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px) scale(1.03);
    text-decoration: none;
    color: #fff !important;
    filter: brightness(1.08);
}
.quick-link-card i {
    margin-bottom: 8px;
    color: #fff !important;
}
.quick-link-card div {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #fff !important;
}
.bg-primary { background: #2563eb; }
.bg-success { background: #16a34a; }
.bg-info { background: #0ea5e9; }
.bg-warning { background: #f59e42; }
.bg-danger { background: #dc2626; }
.bg-purple { background: #a21caf; }
.bg-teal { background: #14b8a6; }
.bg-dark { background: #334155; }
.bg-secondary { background: #64748b; }
@media (max-width: 1200px) {
    .dashboard-quick-links-flex {
        flex-wrap: wrap;
    }
    .quick-link-card {
        min-width: 120px;
        margin-bottom: 10px;
    }
}
@media (max-width: 900px) {
    .dashboard-quick-links-flex {
        flex-wrap: wrap;
    }
    .quick-link-card {
        flex: 1 1 45%;
        min-width: 140px;
    }
}
@media (max-width: 600px) {
    .dashboard-quick-links-flex {
        flex-direction: column;
        gap: 10px;
    }
    .quick-link-card {
        width: 100%;
        min-width: 0;
    }
}

/* ——— Sidebar navigation (.app-sidebar on tpl/sidebar.html) ——— */
.page-sidebar.app-sidebar,
.page-sidebar-closed.page-sidebar-fixed .page-sidebar.app-sidebar:hover {
    background: linear-gradient(180deg, #eef1f5 0%, #e6eaef 100%);
    box-shadow:
        inset -1px 0 0 rgba(15, 23, 42, 0.07),
        6px 0 28px -12px rgba(15, 23, 42, 0.12);
}

/* Top-level nav: no side gutter on the list; sub-menus keep their own horizontal inset below */
.page-sidebar.app-sidebar .page-sidebar-menu {
    padding: 10px 0 16px;
    box-sizing: border-box;
}

/* Collapsed rail: tighter symmetric vertical padding (expanded menu keeps rule above) */
.page-sidebar-closed .page-sidebar.app-sidebar .page-sidebar-menu.page-sidebar-menu-closed {
    padding: 6px 0 12px !important;
    margin: 0 !important;
    width: 45px !important;
    box-sizing: border-box;
}

/* Top-level: flex row, icon + label + arrow; larger tap targets (classic Metronic-style density) */
.page-sidebar.app-sidebar .page-sidebar-menu > li > a,
.page-sidebar-closed.page-sidebar-fixed .page-sidebar.app-sidebar:hover .page-sidebar-menu > li > a {
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap;
    gap: 12px;
    border-top: none !important;
    border-bottom: none !important;
    margin: 3px 0 !important;
    padding: 11px 14px !important;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #334155 !important;
    line-height: 1.35;
    transition:
        background-color 0.18s ease,
        color 0.18s ease,
        box-shadow 0.18s ease;
}

.page-sidebar.app-sidebar .page-sidebar-menu > li > a > i,
.page-sidebar-closed.page-sidebar-fixed .page-sidebar.app-sidebar:hover .page-sidebar-menu > li > a > i {
    flex: 0 0 1.35em;
    width: 1.35em;
    text-align: center;
    margin-right: 0 !important;
    margin-left: 0 !important;
    font-size: 18px !important;
    color: #64748b !important;
    opacity: 0.95;
}

.page-sidebar.app-sidebar .page-sidebar-menu > li > a > .title {
    flex: 1 1 auto;
    min-width: 0;
    padding-right: 4px;
}

/* Chevron lives on .arrow:before (out of flow in Metronic) — without a tall .arrow box, absolute top:8px misaligns vs flex row */
.page-sidebar.app-sidebar .page-sidebar-menu > li > a > .arrow,
.page-sidebar-closed.page-sidebar-fixed .page-sidebar.app-sidebar:hover .page-sidebar-menu > li > a > .arrow {
    flex: 0 0 auto;
    margin-left: auto;
    align-self: stretch;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
}

.page-sidebar.app-sidebar .page-sidebar-menu > li > a > .arrow:before,
.page-sidebar.app-sidebar .page-sidebar-menu > li > a > .arrow.open:before,
.page-sidebar-closed.page-sidebar-fixed .page-sidebar.app-sidebar:hover .page-sidebar-menu > li > a > .arrow:before,
.page-sidebar-closed.page-sidebar-fixed .page-sidebar.app-sidebar:hover .page-sidebar-menu > li > a > .arrow.open:before {
    position: static !important;
    top: auto !important;
    right: auto !important;
    float: none !important;
    display: block !important;
    width: 1em;
    font-size: 15px !important;
    text-align: center;
    line-height: 1;
    opacity: 0.5;
}

.page-sidebar.app-sidebar .page-sidebar-menu > li.active > a > .arrow:before,
.page-sidebar.app-sidebar .page-sidebar-menu > li.active > a > .arrow.open:before,
.page-sidebar-closed.page-sidebar-fixed .page-sidebar.app-sidebar:hover .page-sidebar-menu > li.active > a > .arrow:before,
.page-sidebar-closed.page-sidebar-fixed .page-sidebar.app-sidebar:hover .page-sidebar-menu > li.active > a > .arrow.open:before {
    opacity: 0.9;
}

/* Nested section toggles (e.g. Stock Management) — same flex + chevron fix */
.page-sidebar.app-sidebar .page-sidebar-menu .sub-menu li > a > .arrow,
.page-sidebar-closed.page-sidebar-fixed .page-sidebar.app-sidebar:hover .page-sidebar-menu .sub-menu li > a > .arrow {
    flex: 0 0 auto;
    margin-left: auto;
    align-self: stretch;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
}

.page-sidebar.app-sidebar .page-sidebar-menu .sub-menu li > a > .arrow:before,
.page-sidebar.app-sidebar .page-sidebar-menu .sub-menu li > a > .arrow.open:before,
.page-sidebar-closed.page-sidebar-fixed .page-sidebar.app-sidebar:hover .page-sidebar-menu .sub-menu li > a > .arrow:before,
.page-sidebar-closed.page-sidebar-fixed .page-sidebar.app-sidebar:hover .page-sidebar-menu .sub-menu li > a > .arrow.open:before {
    position: static !important;
    top: auto !important;
    right: auto !important;
    float: none !important;
    display: block !important;
    width: 1em;
    font-size: 12px !important;
    text-align: center;
    line-height: 1;
    opacity: 0.45;
}

.page-sidebar.app-sidebar .page-sidebar-menu .sub-menu li.open > a > .arrow:before,
.page-sidebar.app-sidebar .page-sidebar-menu .sub-menu li.active > a > .arrow:before,
.page-sidebar-closed.page-sidebar-fixed .page-sidebar.app-sidebar:hover .page-sidebar-menu .sub-menu li.open > a > .arrow:before,
.page-sidebar-closed.page-sidebar-fixed .page-sidebar.app-sidebar:hover .page-sidebar-menu .sub-menu li.active > a > .arrow:before {
    opacity: 0.85;
}

.page-sidebar.app-sidebar .page-sidebar-menu > li:hover > a,
.page-sidebar.app-sidebar .page-sidebar-menu > li.open > a,
.page-sidebar-closed.page-sidebar-fixed .page-sidebar.app-sidebar:hover .page-sidebar-menu > li:hover > a,
.page-sidebar-closed.page-sidebar-fixed .page-sidebar.app-sidebar:hover .page-sidebar-menu > li.open > a {
    background: rgba(63, 213, 192, 0.16) !important;
    color: #0f172a !important;
    box-shadow: none;
}

.page-sidebar.app-sidebar .page-sidebar-menu > li:hover > a > i,
.page-sidebar.app-sidebar .page-sidebar-menu > li.open > a > i,
.page-sidebar-closed.page-sidebar-fixed .page-sidebar.app-sidebar:hover .page-sidebar-menu > li:hover > a > i,
.page-sidebar-closed.page-sidebar-fixed .page-sidebar.app-sidebar:hover .page-sidebar-menu > li.open > a > i {
    color: #0d9488 !important;
}

.page-sidebar.app-sidebar .page-sidebar-menu > li.active > a,
.page-sidebar.app-sidebar .page-sidebar-menu > li.active.open > a,
.page-sidebar-closed.page-sidebar-fixed .page-sidebar.app-sidebar:hover .page-sidebar-menu > li.active > a,
.page-sidebar-closed.page-sidebar-fixed .page-sidebar.app-sidebar:hover .page-sidebar-menu > li.active.open > a {
    background: linear-gradient(135deg, #3fd5c0 0%, #2fc2ae 100%) !important;
    color: #fff !important;
    box-shadow: 0 3px 14px rgba(63, 213, 192, 0.38);
}

.page-sidebar.app-sidebar .page-sidebar-menu > li.active > a:hover,
.page-sidebar.app-sidebar .page-sidebar-menu > li.active.open > a:hover,
.page-sidebar-closed.page-sidebar-fixed .page-sidebar.app-sidebar:hover .page-sidebar-menu > li.active > a:hover,
.page-sidebar-closed.page-sidebar-fixed .page-sidebar.app-sidebar:hover .page-sidebar-menu > li.active.open > a:hover {
    background: linear-gradient(135deg, #45dcc7 0%, #34c9b5 100%) !important;
}

.page-sidebar.app-sidebar .page-sidebar-menu > li.active > a > i,
.page-sidebar.app-sidebar .page-sidebar-menu > li.active.open > a > i,
.page-sidebar-closed.page-sidebar-fixed .page-sidebar.app-sidebar:hover .page-sidebar-menu > li.active > a > i,
.page-sidebar-closed.page-sidebar-fixed .page-sidebar.app-sidebar:hover .page-sidebar-menu > li.active.open > a > i {
    color: #fff !important;
}

.page-sidebar.app-sidebar .page-sidebar-menu > li.active + li > a,
.page-sidebar-closed.page-sidebar-fixed .page-sidebar.app-sidebar:hover .page-sidebar-menu > li.active + li > a {
    border-top-color: transparent !important;
}

/* Sub-menus: keep side margin from sidebar edge; lighter inset panel */
.page-sidebar.app-sidebar .page-sidebar-menu .sub-menu,
.page-sidebar-closed.page-sidebar-fixed .page-sidebar.app-sidebar:hover .page-sidebar-menu .sub-menu {
    margin: 4px 10px 8px 10px !important;
    padding: 6px 6px 8px 8px !important;
    border-left: 2px solid rgba(63, 213, 192, 0.45);
    background: rgba(255, 255, 255, 0.55);
    border-radius: 0 8px 8px 0;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.04);
}

/* Visual break between logical groups inside a flyout (CRM vs sales vs marketing, etc.) */
.page-sidebar.app-sidebar .page-sidebar-menu .sub-menu > li.sidebar-nav-group-start > a,
.page-sidebar-closed.page-sidebar-fixed .page-sidebar.app-sidebar:hover .page-sidebar-menu .sub-menu > li.sidebar-nav-group-start > a {
    margin-top: 10px !important;
}

.page-sidebar.app-sidebar .page-sidebar-menu .sub-menu > li.sidebar-nav-group-start:first-child > a,
.page-sidebar-closed.page-sidebar-fixed .page-sidebar.app-sidebar:hover .page-sidebar-menu .sub-menu > li.sidebar-nav-group-start:first-child > a {
    margin-top: 0 !important;
}

.page-sidebar.app-sidebar .page-sidebar-menu .sub-menu > li > a,
.page-sidebar-closed.page-sidebar-fixed .page-sidebar.app-sidebar:hover .page-sidebar-menu .sub-menu > li > a {
    display: flex !important;
    align-items: center;
    margin: 2px 0 !important;
    padding: 8px 10px !important;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
    color: #475569 !important;
}

.page-sidebar.app-sidebar .page-sidebar-menu .sub-menu li > a > .title,
.page-sidebar-closed.page-sidebar-fixed .page-sidebar.app-sidebar:hover .page-sidebar-menu .sub-menu li > a > .title {
    flex: 1 1 auto;
    min-width: 0;
    padding-right: 4px;
}

.page-sidebar.app-sidebar .page-sidebar-menu .sub-menu > li > a > i,
.page-sidebar-closed.page-sidebar-fixed .page-sidebar.app-sidebar:hover .page-sidebar-menu .sub-menu > li > a > i {
    flex: 0 0 1.15em;
    margin-right: 8px !important;
    font-size: 14px !important;
    color: #64748b !important;
}

.page-sidebar.app-sidebar .page-sidebar-menu .sub-menu > li:hover > a,
.page-sidebar.app-sidebar .page-sidebar-menu .sub-menu > li.open > a,
.page-sidebar.app-sidebar .page-sidebar-menu .sub-menu > li.active > a,
.page-sidebar-closed.page-sidebar-fixed .page-sidebar.app-sidebar:hover .page-sidebar-menu .sub-menu > li:hover > a,
.page-sidebar-closed.page-sidebar-fixed .page-sidebar.app-sidebar:hover .page-sidebar-menu .sub-menu > li.open > a,
.page-sidebar-closed.page-sidebar-fixed .page-sidebar.app-sidebar:hover .page-sidebar-menu .sub-menu > li.active > a {
    background: rgba(63, 213, 192, 0.14) !important;
    color: #0f172a !important;
}

.page-sidebar.app-sidebar .page-sidebar-menu .sub-menu > li.active > a > i,
.page-sidebar-closed.page-sidebar-fixed .page-sidebar.app-sidebar:hover .page-sidebar-menu .sub-menu > li.active > a > i {
    color: #0f766e !important;
}

.page-sidebar.app-sidebar .page-sidebar-menu .sub-menu li > .sub-menu,
.page-sidebar-closed.page-sidebar-fixed .page-sidebar.app-sidebar:hover .page-sidebar-menu .sub-menu li > .sub-menu {
    margin-left: 2px !important;
    margin-top: 2px !important;
    margin-bottom: 2px !important;
    border-left-color: rgba(63, 213, 192, 0.3);
    background: rgba(255, 255, 255, 0.4);
}

.page-sidebar.app-sidebar .page-sidebar-menu .sub-menu li > .sub-menu > li > a,
.page-sidebar-closed.page-sidebar-fixed .page-sidebar.app-sidebar:hover .page-sidebar-menu .sub-menu li > .sub-menu > li > a {
    padding-left: 10px !important;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
    font-size: 12.5px !important;
}

/* Collapsed rail: wrapper must not clip flyouts; sub-menus extend past 45px width */
.page-sidebar-closed .page-sidebar-wrapper {
    overflow: visible !important;
}

.page-sidebar-closed .page-sidebar.app-sidebar.navbar-collapse {
    overflow: visible !important;
}

/* —— Collapsed (icon rail ~45px): center icons; no side margin on rail buttons —— */
.page-sidebar-closed .page-sidebar.app-sidebar .page-sidebar-menu.page-sidebar-menu-closed > li > a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
    margin: 2px 0 !important;
    padding: 10px 0 !important;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border-radius: 6px;
}

.page-sidebar-closed .page-sidebar.app-sidebar .page-sidebar-menu.page-sidebar-menu-closed > li > a > i {
    margin-right: 0 !important;
    margin-left: 0 !important;
}

/* Metronic adds icon margin + title padding on li:hover; with flex gap that double-counts — reset for flyout row */
.page-sidebar-closed .page-sidebar.app-sidebar .page-sidebar-menu.page-sidebar-menu-closed > li:hover > a > i {
    margin-right: 0 !important;
    margin-left: 0 !important;
}

.page-sidebar-closed .page-sidebar.app-sidebar .page-sidebar-menu.page-sidebar-menu-closed > li:hover > a > .title {
    padding-left: 0 !important;
}

/* Flyout row (hover on item): single spacing source = flex gap; not Metronic margin+padding */
.page-sidebar-closed .page-sidebar.app-sidebar .page-sidebar-menu.page-sidebar-menu-closed > li:hover > a {
    gap: 12px !important;
    justify-content: flex-start !important;
    padding: 11px 14px !important;
}

/* Fixed closed + hover entire sidebar → full width: match expanded row rhythm */
.page-sidebar-closed.page-sidebar-fixed .page-sidebar.app-sidebar:hover .page-sidebar-menu.page-sidebar-menu-closed > li > a {
    gap: 12px !important;
    justify-content: flex-start !important;
    margin: 3px 0 !important;
    padding: 11px 14px !important;
}

.page-sidebar-closed.page-sidebar-fixed .page-sidebar.app-sidebar:hover .page-sidebar-menu.page-sidebar-menu-closed > li > a > i {
    margin-right: 0 !important;
    margin-left: 0 !important;
}

/* Flyout when rail collapsed: kill inherited .sub-menu margins (they create a hover dead-zone
   between <a> and panel). Slight overlap + flush left keeps pointer inside li:hover. */
.page-sidebar-closed .page-sidebar.app-sidebar .page-sidebar-menu.page-sidebar-menu-closed > li:hover > .sub-menu {
    margin: 0 !important;
    left: 45px !important;
    top: calc(100% - 6px) !important;
    z-index: 10050 !important;
    background: rgba(255, 255, 255, 0.98) !important;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    box-shadow: 4px 14px 36px rgba(15, 23, 42, 0.14) !important;
    border-radius: 0 6px 6px 6px !important;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
}

.page-sidebar-closed .page-sidebar.app-sidebar .page-sidebar-menu.page-sidebar-menu-closed > li:hover > .sub-menu > li > a {
    margin: 1px 5px !important;
    border-radius: 5px !important;
}

/* ——— Header bar + dropdowns (.app-header on index.php page-header) ——— */
.page-header.navbar.app-header {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.9) inset,
        0 4px 24px -8px rgba(15, 23, 42, 0.12);
    overflow: visible !important;
}

/* Do not clip absolutely positioned .dropdown-menu panels */
.page-header.navbar.app-header .page-header-inner {
    overflow: visible !important;
}

/* Global search uses z-index 999–10002 (typeahead); keep nav + menus above it */
.page-header.navbar.app-header .top-menu {
    position: relative;
    z-index: 10040;
}

.page-header.navbar.app-header .page-logo {
    background: transparent !important;
}

/* Desktop: center logo + hamburger vertically (Metronic float + margin-top on toggler misaligns) */
@media (min-width: 992px) {
    .page-header.navbar.app-header .page-logo {
        display: flex !important;
        align-items: center !important;
        flex-wrap: nowrap;
        box-sizing: border-box;
    }

    .page-header.navbar.app-header .page-logo > a {
        display: flex !important;
        align-items: center !important;
        float: none !important;
        flex: 0 0 auto;
    }

    .page-header.navbar.app-header .page-logo .logo-default {
        margin: 0 !important;
    }

    .page-header.navbar.app-header .page-logo .menu-toggler.sidebar-toggler {
        float: none !important;
        margin: 0 0 0 auto !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: 40px;
        width: 40px;
        flex-shrink: 0;
    }

    .page-header.navbar.app-header .page-logo .menu-toggler.sidebar-toggler > span {
        top: 0 !important;
    }
}

.page-header.navbar.app-header .menu-toggler > span,
.page-header.navbar.app-header .menu-toggler > span:before,
.page-header.navbar.app-header .menu-toggler > span:after {
    background: #475569 !important;
}

.page-header.navbar.app-header .menu-toggler:hover > span,
.page-header.navbar.app-header .menu-toggler:hover > span:before,
.page-header.navbar.app-header .menu-toggler:hover > span:after {
    background: #0f766e !important;
}

/* Global search */
.page-header.navbar.app-header .search-form {
    background: transparent !important;
    border-radius: 999px !important;
    transition: box-shadow 0.2s ease, background 0.2s ease;
    position: relative;
    z-index: 1;
}

/* When search is active, stack above .top-menu (z-index 10040) so .tt-dropdown-menu is not covered */
.page-header.navbar.app-header .search-form:focus-within,
.page-header.navbar.app-header .search-form.open {
    z-index: 10055;
}

.page-header.navbar.app-header .search-form:hover {
    background: rgba(241, 245, 249, 0.85) !important;
}

.page-header.navbar.app-header .search-form .input-group {
    border-radius: 999px !important;
    /* Must stay visible: .tt-menu is positioned inside this group and would be clipped with overflow:hidden (pill rounding is applied on the input + button instead). */
    overflow: visible;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
    background: #f1f5f9;
    transition: box-shadow 0.2s ease;
}

/* Pill caps without clipping the typeahead dropdown */
.page-header.navbar.app-header .search-form .input-group > .form-control:first-child,
.page-header.navbar.app-header .search-form .input-group > .twitter-typeahead:first-child .tt-input,
.page-header.navbar.app-header .search-form .input-group > .twitter-typeahead:first-child input.form-control {
    border-radius: 999px 0 0 999px !important;
}

.page-header.navbar.app-header .search-form.open .input-group,
.page-header.navbar.app-header .search-form:focus-within .input-group {
    box-shadow:
        inset 0 0 0 1px rgba(63, 213, 192, 0.45),
        0 0 0 3px rgba(63, 213, 192, 0.15);
    background: #fff;
}

.page-header.navbar.app-header .search-form .input-group .form-control {
    background: transparent !important;
    border: none !important;
    color: #334155 !important;
    box-shadow: none !important;
    height: 36px;
    font-size: 14px;
}

.page-header.navbar.app-header .search-form .input-group .form-control::placeholder {
    color: #94a3b8 !important;
    opacity: 1;
}

.page-header.navbar.app-header .search-form .input-group .input-group-btn .btn.submit {
    border-radius: 0 999px 999px 0 !important;
    background: transparent !important;
    border: none !important;
    color: #64748b !important;
    padding: 8px 14px;
    height: 36px;
}

.page-header.navbar.app-header .search-form .input-group .input-group-btn .btn.submit:hover,
.page-header.navbar.app-header .search-form .input-group .input-group-btn .btn.submit:focus {
    color: #0f766e !important;
    background: rgba(63, 213, 192, 0.1) !important;
}

/* Top bar icon buttons */
.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown .dropdown-toggle {
    border-radius: 10px !important;
    margin: 0 2px;
    padding: 10px 12px !important;
    transition: background-color 0.18s ease, color 0.18s ease;
}

/* Theme toggle — li has no .dropdown; match Metronic bar height (64px) + pill styling */
.page-header.navbar.app-header .top-menu .navbar-nav > li.app-header-icon-li {
    height: 64px;
    margin: 0;
    padding: 0 4px;
    display: inline-block;
    vertical-align: top;
}

/* GST badge: same row as theme/notifications; vertically centered (not margin-top nudge) */
.page-header.navbar.app-header .top-menu .navbar-nav > li.app-header-icon-li.app-header-gst-li {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.page-header.navbar.app-header .top-menu .navbar-nav > li.app-header-icon-li.app-header-gst-li .app-header-gst-hint {
    margin: 0;
    display: inline-block;
}

.page-header.navbar.app-header .top-menu .navbar-nav > li.app-header-icon-li > a.app-theme-toggle,
.page-header.navbar.app-header .top-menu .navbar-nav > li.app-header-icon-li > button.app-theme-toggle,
.page-header.navbar.app-header .top-menu .navbar-nav > li.app-header-icon-li > a.app-ai-assistant-toggle {
    border-radius: 10px !important;
    margin: 0 2px;
    height: 64px !important;
    padding: 0 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    transition: background-color 0.18s ease, color 0.18s ease;
}

.page-header.navbar.app-header .top-menu .navbar-nav > li.app-header-icon-li > button.app-theme-toggle {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    font: inherit;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.page-header.navbar.app-header .top-menu .navbar-nav > li.app-header-icon-li > a.app-theme-toggle > i,
.page-header.navbar.app-header .top-menu .navbar-nav > li.app-header-icon-li > button.app-theme-toggle > i,
.page-header.navbar.app-header .top-menu .navbar-nav > li.app-header-icon-li > a.app-ai-assistant-toggle > i {
    color: #64748b !important;
    font-size: 17px;
}

.page-header.navbar.app-header .top-menu .navbar-nav > li.app-header-icon-li > a.app-theme-toggle:hover,
.page-header.navbar.app-header .top-menu .navbar-nav > li.app-header-icon-li > button.app-theme-toggle:hover,
.page-header.navbar.app-header .top-menu .navbar-nav > li.app-header-icon-li > a.app-ai-assistant-toggle:hover {
    background-color: rgba(63, 213, 192, 0.12) !important;
}

.page-header.navbar.app-header .top-menu .navbar-nav > li.app-header-icon-li > a.app-theme-toggle:hover > i,
.page-header.navbar.app-header .top-menu .navbar-nav > li.app-header-icon-li > button.app-theme-toggle:hover > i,
.page-header.navbar.app-header .top-menu .navbar-nav > li.app-header-icon-li > a.app-ai-assistant-toggle:hover > i {
    color: #0f766e !important;
}

/* AI assistant header control: magic wand reads as accent */
.page-header.navbar.app-header .top-menu .navbar-nav > li.app-header-icon-li > a.app-ai-assistant-toggle > i {
    color: #6d28d9 !important;
}
.page-header.navbar.app-header .top-menu .navbar-nav > li.app-header-icon-li > a.app-ai-assistant-toggle:hover > i {
    color: #5b21b6 !important;
}

body.app-theme-dark .page-header.navbar.app-header .top-menu .navbar-nav > li.app-header-icon-li > a.app-ai-assistant-toggle > i,
html[data-app-theme="dark"] .page-header.navbar.app-header .top-menu .navbar-nav > li.app-header-icon-li > a.app-ai-assistant-toggle > i {
    color: #a78bfa !important;
}
body.app-theme-dark .page-header.navbar.app-header .top-menu .navbar-nav > li.app-header-icon-li > a.app-ai-assistant-toggle:hover > i,
html[data-app-theme="dark"] .page-header.navbar.app-header .top-menu .navbar-nav > li.app-header-icon-li > a.app-ai-assistant-toggle:hover > i {
    color: #c4b5fd !important;
}

/* Quick sidebar control: same bar height as other header icons */
.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown-quick-sidebar-toggler.app-header-icon-li {
    height: 64px;
    margin: 0;
    padding: 0 4px;
    display: inline-block;
    vertical-align: top;
}

.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown-quick-sidebar-toggler > .dropdown-toggle {
    border-radius: 10px !important;
    margin: 0 2px;
    height: 64px !important;
    min-height: 64px;
    padding: 0 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
}

.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown-quick-sidebar-toggler > .dropdown-toggle > i {
    color: #64748b !important;
    font-size: 17px;
}

.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown-quick-sidebar-toggler > .dropdown-toggle:hover {
    background-color: var(--app-accent-dim) !important;
}

.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown-quick-sidebar-toggler > .dropdown-toggle:hover > i {
    color: var(--app-link) !important;
}

.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown .dropdown-toggle > i {
    color: #64748b !important;
    font-size: 17px;
}

.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown .dropdown-toggle:hover,
.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown.open .dropdown-toggle {
    background-color: rgba(63, 213, 192, 0.12) !important;
}

.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown .dropdown-toggle:hover > i,
.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown.open .dropdown-toggle > i {
    color: #0f766e !important;
}

.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown .dropdown-toggle .badge.badge-danger {
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(220, 38, 38, 0.35);
}

.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown .dropdown-toggle .badge.badge-default {
    background: linear-gradient(135deg, #3fd5c0 0%, #2fc2ae 100%) !important;
    color: #fff !important;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(63, 213, 192, 0.35);
}

/* User row */
.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown-user > .dropdown-toggle > .username {
    color: #334155 !important;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown-user > .dropdown-toggle > i.fa-angle-down {
    color: #94a3b8 !important;
    margin-left: 4px;
}

.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown-user > .dropdown-toggle > img.img-circle.app-header-user-photo,
.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown-user > .dropdown-toggle > .app-header-user-initials.img-circle {
    border: 2px solid rgba(63, 213, 192, 0.35);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

/* Initials “avatar” when no profile photo (matches header img ~29px) */
/* User menu: stacked Leave + TOIL in one row group */
.page-header.navbar.app-header .dropdown-user .app-header-user-submenu > a {
    display: block;
    clear: both;
    font-weight: normal;
    line-height: 1.45;
    color: #334155;
    white-space: normal;
    padding: 8px 16px;
}
.page-header.navbar.app-header .dropdown-user .app-header-user-submenu > a:hover,
.page-header.navbar.app-header .dropdown-user .app-header-user-submenu > a:focus {
    background: rgba(63, 213, 192, 0.1);
    color: #0f766e;
    text-decoration: none;
}
.page-header.navbar.app-header .dropdown-user .app-header-user-submenu > a.app-header-user-submenu__second {
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    padding-top: 10px;
    margin-top: 2px;
}

.page-header.navbar .top-menu .navbar-nav > li.dropdown-user .dropdown-toggle > .app-header-user-initials {
    float: left;
    margin-top: -5px;
    margin-right: 5px;
    height: 29px;
    width: 29px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.02em;
    color: #fff;
    background: linear-gradient(135deg, #3fd5c0 0%, #2aab98 100%);
    user-select: none;
}

/* Employee list / view / edit: gradient initials when no profile photo */
.employee-user-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.02em;
    color: #fff;
    background: linear-gradient(135deg, #3fd5c0 0%, #2aab98 100%);
    user-select: none;
    vertical-align: middle;
}
.employee-user-initials--sm {
    width: 30px;
    height: 30px;
    font-size: 10px;
}
.employee-user-initials--md {
    width: 96px;
    height: 96px;
    font-size: 28px;
}
.employee-user-initials--lg {
    width: 100px;
    height: 100px;
    font-size: 30px;
}

/* Dropdown panels (extended + default) */
.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown > .dropdown-menu {
    margin-top: 8px !important;
    z-index: 10050 !important;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    border-radius: 12px !important;
    box-shadow:
        0 18px 48px -12px rgba(15, 23, 42, 0.2),
        0 0 0 1px rgba(15, 23, 42, 0.04) !important;
    overflow: hidden;
    padding: 0;
    background: #fff !important;
}

.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown-extended > .dropdown-menu:before {
    border-bottom-color: rgba(15, 23, 42, 0.1) !important;
}

.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown-extended > .dropdown-menu:after {
    border-bottom-color: #fff !important;
}

.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown-notification > .dropdown-menu {
    width: 350px;
    max-width: calc(100vw - 24px);
}

/* Notification dropdown: flex only when open — display:flex !important on .dropdown-menu would override Bootstrap's display:none when closed */
.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown-notification.open > .dropdown-menu.app-notification-dropdown {
    display: flex !important;
    flex-direction: column !important;
    max-height: min(440px, calc(100vh - 100px)) !important;
    overflow: hidden !important;
}

.page-header.navbar.app-header .dropdown-notification .app-notification-dropdown__header {
    flex: 0 0 auto !important;
    position: relative !important;
    overflow: visible !important;
    border-radius: 0 !important;
}

.page-header.navbar.app-header .dropdown-notification .app-notification-dropdown__header > h3 {
    float: none !important;
    display: block !important;
    margin: 0 !important;
}

.page-header.navbar.app-header .dropdown-notification .app-notification-dropdown__header--has-action > h3 {
    padding-right: 118px;
}

.page-header.navbar.app-header .dropdown-notification .app-notification-dropdown__header > a {
    position: absolute !important;
    right: 16px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin-top: 0 !important;
}

.page-header.navbar.app-header .dropdown-notification .app-notification-dropdown__body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
}

.page-header.navbar.app-header .dropdown-notification .app-notification-dropdown__loading {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    padding: 20px !important;
}

.page-header.navbar.app-header .dropdown-notification .app-notification-dropdown__list {
    flex: 1 1 auto !important;
    min-height: 200px !important;
    max-height: none !important;
    height: auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    margin: 0 !important;
}

.page-header.navbar.app-header .dropdown-notification .app-notification-dropdown__footer {
    flex: 0 0 auto !important;
    border-top: 1px solid rgba(15, 23, 42, 0.06) !important;
    background: #fafbfc !important;
    padding: 0 !important;
    overflow: visible !important;
    border-radius: 0 !important;
}

.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown-notification > .dropdown-menu .app-notification-dropdown__footer > a {
    position: static !important;
    right: auto !important;
    top: auto !important;
    transform: none !important;
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box !important;
    text-align: center !important;
    padding: 12px 16px !important;
    margin: 0 !important;
    clear: both !important;
    font-weight: 500 !important;
    color: #0f766e !important;
    border: 0 !important;
    background: transparent !important;
}

.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown-notification > .dropdown-menu .app-notification-dropdown__footer > a:hover {
    background: rgba(63, 213, 192, 0.08) !important;
    color: #0d9488 !important;
}

/* Notification list rows (avoid inline backgrounds — dark theme in app-theme.css) */
.page-header.navbar.app-header .dropdown-notification .app-notification-dropdown__empty {
    padding: 20px;
    text-align: center;
    color: #94a3b8;
}
.page-header.navbar.app-header .dropdown-notification .app-notification-dropdown__empty-icon {
    opacity: 0.45;
}
.page-header.navbar.app-header .dropdown-notification .app-notification-dropdown__empty-text {
    margin-top: 10px;
    margin-bottom: 0;
}
.page-header.navbar.app-header .dropdown-notification .app-notification-item {
    border-left: 3px solid transparent;
}
.page-header.navbar.app-header .dropdown-notification .app-notification-item.notification-unread {
    background-color: #f0f9ff;
}
.page-header.navbar.app-header .dropdown-notification .app-notification-item__time {
    color: #94a3b8;
}
.page-header.navbar.app-header .dropdown-notification .app-notification-item__details {
    display: block;
}
.page-header.navbar.app-header .dropdown-notification .app-notification-item__type-icon {
    margin-right: 5px;
}
.page-header.navbar.app-header .dropdown-notification .app-notification-item__message {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-top: 3px;
    white-space: normal;
}

/* --- Send PO email modal (same visual language as header notifications: teal accent, cards, soft footer) --- */
.app-po-email-modal {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.22);
}
.app-po-email-modal__header {
    background: linear-gradient(135deg, #eaedf2 0%, #f1f5f9 100%);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    padding: 18px 22px 18px 20px;
}
.app-po-email-modal__close {
    margin-top: 4px;
    opacity: 0.55;
    text-shadow: none;
    font-weight: 300;
    font-size: 28px;
    line-height: 1;
}
.app-po-email-modal__close:hover {
    opacity: 0.9;
    color: #0f172a;
}
.app-po-email-modal__title-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding-right: 28px;
}
.app-po-email-modal__icon-badge {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(145deg, #0f766e 0%, #14b8a6 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(15, 118, 110, 0.35);
}
.app-po-email-modal__titles {
    min-width: 0;
}
.app-po-email-modal__title {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
    line-height: 1.25;
}
.app-po-email-modal__subtitle {
    margin: 0;
    font-size: 13px;
    color: #64748b;
    line-height: 1.45;
    max-width: 540px;
}
.app-po-email-modal__body {
    background: #f8fafc;
    padding: 16px 18px 10px;
    /* Height capped by #po-send-email-modal flex layout (custom.css) so inner scroll works */
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
}
.app-po-email-modal__body.modal-body {
    overflow-x: hidden;
}
.app-po-email-modal__section {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.app-po-email-modal__section--last {
    margin-bottom: 0;
}
.app-po-email-modal__section-title {
    margin: 0 0 14px 0;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #0f766e;
}
.app-po-email-modal__section-title .fa {
    margin-right: 8px;
    opacity: 0.92;
}
.app-po-email-modal__field {
    margin-bottom: 14px;
}
.app-po-email-modal__field:last-child {
    margin-bottom: 0;
}
.app-po-email-modal__label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}
.app-po-email-modal__label--spaced {
    margin-top: 12px;
}
.app-po-email-modal__hint {
    display: block;
    font-size: 12px;
    color: #94a3b8;
    margin-top: 6px;
    line-height: 1.4;
}
.app-po-email-modal__hint--tight {
    margin-top: 8px;
    margin-bottom: 0;
}
.app-po-email-modal__attach-row {
    margin-bottom: 12px;
}
.app-po-email-modal__doc-list {
    max-height: 180px;
    overflow-y: auto;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 8px;
    margin-bottom: 10px;
    -webkit-overflow-scrolling: touch;
}
.app-po-email-modal__doc-placeholder,
.app-po-email-modal__doc-list > p {
    margin: 0;
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.45;
}
.app-po-email-modal__doc-list .checkbox {
    margin: 0 0 8px 0;
    padding: 8px 10px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid rgba(15, 23, 42, 0.06);
}
.app-po-email-modal__doc-list .checkbox:last-child {
    margin-bottom: 0;
}
.app-po-email-modal__upload-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.app-po-email-modal__btn-upload {
    background: #fff !important;
    border: 1px solid rgba(15, 118, 110, 0.35) !important;
    color: #0f766e !important;
    font-weight: 600;
    border-radius: 8px !important;
}
.app-po-email-modal__btn-upload:hover {
    background: rgba(20, 184, 166, 0.08) !important;
    border-color: #0f766e !important;
    color: #0d9488 !important;
}
.app-po-email-modal__file-names {
    font-size: 12px;
    color: #64748b;
    flex: 1;
    min-width: 120px;
}
.app-po-email-modal__schedule .input-group-addon {
    background: #f1f5f9;
    border-color: rgba(15, 23, 42, 0.12);
    color: #0f766e;
}
.app-po-email-modal__input.form-control {
    border-radius: 8px;
    border-color: rgba(15, 23, 42, 0.12);
}
.app-po-email-modal__input.form-control:focus {
    border-color: #14b8a6;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.18);
}
.app-po-email-modal__toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
    padding: 8px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 8px;
}
.app-po-email-modal__toolbar .btn {
    border-color: rgba(15, 23, 42, 0.12);
    background: #fff;
    border-radius: 6px !important;
}
.app-po-email-modal__toolbar .btn:hover {
    background: #f1f5f9;
    border-color: rgba(15, 118, 110, 0.35);
    color: #0f766e;
}
.app-po-email-modal__editor.form-control {
    min-height: 220px;
    overflow: auto;
    border-radius: 8px !important;
    border: 1px solid rgba(15, 23, 42, 0.1) !important;
    background: #fff;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
    height: auto;
}
.app-po-email-modal__editor:focus {
    outline: none;
    border-color: #14b8a6 !important;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}
.app-po-email-modal__footer {
    background: #fafbfc !important;
    border-top: 1px solid rgba(15, 23, 42, 0.06) !important;
    padding: 14px 20px !important;
}
.app-po-email-modal__btn-secondary {
    border-radius: 8px;
    font-weight: 500;
}
.app-po-email-modal__btn-send {
    background: #0f766e !important;
    border-color: #0f766e !important;
    color: #fff !important;
    font-weight: 600;
    padding: 8px 22px;
    border-radius: 8px !important;
}
.app-po-email-modal__btn-send:hover,
.app-po-email-modal__btn-send:focus {
    background: #0d9488 !important;
    border-color: #0d9488 !important;
    color: #fff !important;
}

/* Tag inputs inside PO email modal */
.app-po-email-modal .email-tags-container,
#po-send-email-modal .email-tags-container {
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 8px;
    padding: 6px 10px;
    min-height: 40px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    background: #fff;
}
.app-po-email-modal .email-tags-container:focus-within,
#po-send-email-modal .email-tags-container:focus-within {
    border-color: #14b8a6;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}
.app-po-email-modal .email-tag,
#po-send-email-modal .email-tag {
    background: #0f766e;
    color: #fff;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.app-po-email-modal .email-tag .remove-tag,
#po-send-email-modal .email-tag .remove-tag {
    cursor: pointer;
    font-weight: bold;
    margin-left: 2px;
    opacity: 0.85;
}
.app-po-email-modal .email-tag .remove-tag:hover,
#po-send-email-modal .email-tag .remove-tag:hover {
    color: #ccfbf1;
}
.app-po-email-modal .email-tag-input,
#po-send-email-modal .email-tag-input {
    border: none !important;
    box-shadow: none !important;
    flex: 1;
    min-width: 120px;
    background: transparent !important;
}
.app-po-email-modal .email-tag-input:focus,
#po-send-email-modal .email-tag-input:focus {
    outline: none !important;
}

/* Select2 inside PO send modal */
#po-send-email-modal .select2-container {
    width: 100% !important;
}
#po-send-email-modal .select2-selection--multiple {
    min-height: 40px !important;
    border: 1px solid rgba(15, 23, 42, 0.12) !important;
    border-radius: 8px !important;
    cursor: text !important;
    padding: 4px 6px !important;
}
#po-send-email-modal .select2-selection--multiple:focus,
#po-send-email-modal .select2-selection--multiple:hover {
    border-color: #14b8a6 !important;
}
#po-send-email-modal .select2-search--inline {
    width: 100% !important;
}
#po-send-email-modal .select2-search--inline .select2-search__field {
    cursor: text !important;
    width: auto !important;
    min-width: 200px !important;
    margin: 0 !important;
    padding: 3px 0 !important;
}
#po-send-email-modal .select2-selection__choice {
    background-color: #0f766e !important;
    border-color: #0d9488 !important;
    color: #fff !important;
    padding: 3px 8px !important;
    margin: 2px 3px !important;
    border-radius: 6px !important;
}
#po-send-email-modal .select2-selection__choice__remove {
    color: #fff !important;
    margin-right: 5px !important;
    font-weight: bold !important;
}
#po-send-email-modal .select2-selection__choice__remove:hover {
    color: #ccfbf1 !important;
}
#po-send-email-modal .select2-container--open .select2-selection__placeholder {
    display: none !important;
}
#po-send-email-modal .select2-dropdown {
    z-index: 10060 !important;
    position: absolute !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    background-color: #fff !important;
    border: 1px solid rgba(15, 23, 42, 0.1) !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.12) !important;
}
#po-send-email-modal .select2-container--open .select2-dropdown {
    z-index: 10060 !important;
}
#po-send-email-modal .select2-results {
    display: block !important;
    max-height: 200px !important;
    overflow-y: auto !important;
    background-color: #fff !important;
}
#po-send-email-modal .select2-results__option {
    padding: 8px 12px !important;
    cursor: pointer !important;
    color: #475569 !important;
    font-size: 14px !important;
}
#po-send-email-modal .select2-results__option--highlighted,
#po-send-email-modal .select2-results__option[aria-selected="true"] {
    background-color: #0f766e !important;
    color: #fff !important;
}
#po-send-email-modal .select2-results__option:hover {
    background-color: #f1f5f9 !important;
}
#po-send-email-modal .select2-results__option--highlighted:hover {
    background-color: #0d9488 !important;
}

/* Layout helpers (pair with html[data-theme="dark"] in app-theme.css) */
.app-subtable-expand {
    padding: 15px;
    background-color: #f4f6f9;
}
.app-subtable-nested {
    margin-bottom: 0 !important;
    background: #fff;
}
.app-consignment-pill {
    margin-bottom: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.55);
    border-radius: 4px;
}
.app-financial-summary-table {
    margin-top: 10px;
}
.app-financial-total-row {
    border-top: 2px solid #e2e8f0;
}

/* Pending tasks dropdown: flex column + scrolling list (Metronic .scroller / fixed height breaks layout) */
.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown-tasks > .dropdown-menu {
    width: 380px;
    max-width: min(380px, calc(100vw - 24px));
}

.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown-tasks.open > .dropdown-menu.app-tasks-dropdown {
    display: flex !important;
    flex-direction: column !important;
    max-height: min(440px, calc(100vh - 100px)) !important;
    overflow: hidden !important;
}

.page-header.navbar.app-header .dropdown-tasks .app-tasks-dropdown__header {
    flex: 0 0 auto !important;
    position: relative !important;
    overflow: visible !important;
    border-radius: 0 !important;
}

.page-header.navbar.app-header .dropdown-tasks .app-tasks-dropdown__header > h3 {
    float: none !important;
    display: block !important;
    margin: 0 !important;
}

.page-header.navbar.app-header .dropdown-tasks .app-tasks-dropdown__header--has-action > h3 {
    padding-right: 118px;
}

.page-header.navbar.app-header .dropdown-tasks .app-tasks-dropdown__header > a {
    position: absolute !important;
    right: 16px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin-top: 0 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #0f766e !important;
    border: 0 !important;
    background: transparent !important;
    padding: 0 !important;
}

.page-header.navbar.app-header .dropdown-tasks .app-tasks-dropdown__header > a:hover {
    color: #0d9488 !important;
    text-decoration: none !important;
}

.page-header.navbar.app-header .dropdown-tasks .app-tasks-dropdown__body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
}

.page-header.navbar.app-header .dropdown-tasks .app-tasks-dropdown__list {
    flex: 1 1 auto !important;
    min-height: 140px !important;
    max-height: none !important;
    height: auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    margin: 0 !important;
}

.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown-tasks > .dropdown-menu > li.app-tasks-dropdown__footer {
    flex: 0 0 auto !important;
    border-top: 1px solid rgba(15, 23, 42, 0.06) !important;
    background: #fafbfc !important;
    padding: 0 !important;
    overflow: visible !important;
    border-radius: 0 !important;
}

.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown-tasks > .dropdown-menu > li.app-tasks-dropdown__footer > a {
    position: static !important;
    right: auto !important;
    top: auto !important;
    transform: none !important;
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box !important;
    text-align: center !important;
    padding: 12px 16px !important;
    margin: 0 !important;
    clear: both !important;
    font-weight: 500 !important;
    color: #0f766e !important;
    border: 0 !important;
    background: transparent !important;
}

.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown-tasks > .dropdown-menu > li.app-tasks-dropdown__footer > a:hover {
    background: rgba(63, 213, 192, 0.08) !important;
    color: #0d9488 !important;
}

.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown-tasks > .dropdown-menu > li.app-tasks-dropdown__footer > .app-tasks-dropdown__hint {
    display: block;
    text-align: center;
    font-size: 11px;
    padding: 0 12px 10px;
    line-height: 1.3;
}

.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown-user > .dropdown-menu {
    width: 260px;
    max-width: calc(100vw - 24px);
    white-space: normal;
}

.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown-extended .dropdown-menu > li.external {
    background: linear-gradient(180deg, #f1f5f9 0%, #e8eef4 100%) !important;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06) !important;
    padding: 12px 16px !important;
}

.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown-extended .dropdown-menu > li.external > h3 {
    color: #334155 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    margin: 0 0 6px !important;
    letter-spacing: 0.02em;
}

.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown-extended .dropdown-menu > li.external > a {
    color: #0f766e !important;
    font-weight: 500;
    font-size: 13px;
}

.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown-extended .dropdown-menu > li.external > a:hover {
    color: #0d9488 !important;
}

.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown-extended .dropdown-menu .dropdown-menu-list > li > a {
    border-bottom: 1px solid rgba(15, 23, 42, 0.05) !important;
    color: #475569 !important;
    padding: 12px 16px !important;
    transition: background 0.15s ease;
}

.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown-extended .dropdown-menu .dropdown-menu-list > li > a:hover {
    background: rgba(63, 213, 192, 0.08) !important;
}

.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown-notification .dropdown-menu .dropdown-menu-list > li > a .time {
    background: rgba(241, 245, 249, 0.95) !important;
    color: #64748b !important;
    border-radius: 4px !important;
    padding: 2px 6px !important;
}

/* Footer row for extended dropdowns (inbox etc.) — not notification / tasks (dedicated footer blocks) */
.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown-extended:not(.dropdown-notification):not(.dropdown-tasks) .dropdown-menu > li.external:last-child {
    border-top: 1px solid rgba(15, 23, 42, 0.06) !important;
    background: #fafbfc !important;
    padding: 0 !important;
}

.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown-extended:not(.dropdown-notification):not(.dropdown-tasks) .dropdown-menu > li.external:last-child > a {
    text-align: center;
    display: block;
    padding: 12px 16px !important;
    font-weight: 500;
    color: #0f766e !important;
}

/* User account menu */
.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown .dropdown-menu.dropdown-menu-default {
    padding: 8px 0 !important;
}

.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown .dropdown-menu.dropdown-menu-default > li > a {
    padding: 10px 16px !important;
    margin: 2px 8px;
    width: auto;
    border-radius: 8px !important;
    color: #334155 !important;
    font-weight: 500;
    border-bottom: none !important;
    transition: background 0.15s ease;
}

.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown .dropdown-menu.dropdown-menu-default > li > a:hover {
    background: rgba(63, 213, 192, 0.1) !important;
    color: #0f172a !important;
}

.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown .dropdown-menu.dropdown-menu-default > li > a > i {
    color: #64748b !important;
    margin-right: 8px;
}

.page-header.navbar.app-header .top-menu .navbar-nav > li.dropdown .dropdown-menu.dropdown-menu-default > li.divider {
    background: rgba(15, 23, 42, 0.08) !important;
    margin: 8px 12px !important;
}

/* Task dropdown list rows */
.page-header.navbar.app-header .header-task-dropdown-list .header-task-row {
    border-bottom-color: rgba(15, 23, 42, 0.06);
}

.page-header.navbar.app-header .header-task-dropdown-list .header-task-row:hover {
    background: rgba(63, 213, 192, 0.06);
}

/* Mobile: search field — light theme only (dark header overrides in app-theme.css) */
@media (max-width: 767px) {
    html:not([data-theme="dark"]) .page-header.navbar.app-header .search-form.open .input-group .form-control,
    html:not([data-theme="dark"]) .page-header.navbar.app-header .search-form.search-form-expanded .input-group .form-control {
        background: #f1f5f9 !important;
        color: #334155 !important;
        border-radius: 8px !important;
    }

    html:not([data-theme="dark"]) .page-header.navbar.app-header .search-form.open .input-group .form-control::placeholder,
    html:not([data-theme="dark"]) .page-header.navbar.app-header .search-form.search-form-expanded .input-group .form-control::placeholder {
        color: #94a3b8 !important;
    }

    /*
     * Header dropdowns (notifications, tasks, user) use position:absolute menus.
     * Any non-visible overflow on .top-menu / .page-header-inner clips them (CSS:
     * overflow-x:auto forces overflow-y to compute to auto — menus “don’t open”).
     * Keep overflow visible; allow icons to wrap to a second row on narrow screens.
     */
    .page-header.navbar.app-header,
    .page-header.navbar.app-header .page-header-inner {
        overflow: visible !important;
    }

    .page-header.navbar.app-header .top-menu {
        overflow: visible !important;
        max-width: 100%;
        /*
         * Desktop rule above uses z-index: 10040 so header chrome beats legacy typeahead (~10002).
         * On mobile, search (flex order 2) sits above the icon row (order 3); long .tt-menu lists
         * overlap that row and were painting under it. Use modest z-index here and lift the search
         * row while focused; when a Bootstrap dropdown is open, lift .top-menu above suggestions.
         */
        z-index: 50 !important;
    }

    .page-header.navbar.app-header .top-menu:has(.dropdown.open) {
        z-index: 10080 !important;
    }

    .page-header.navbar.app-header .search-form:focus-within {
        position: relative;
        z-index: 60 !important;
    }

    .page-header.navbar.app-header .search-form:focus-within .input-group,
    .page-header.navbar.app-header .search-form.open .input-group {
        overflow: visible !important;
    }

    .page-header.navbar.app-header .top-menu .navbar-nav {
        display: flex !important;
        flex-wrap: wrap;
        justify-content: flex-end;
        align-items: stretch;
        row-gap: 2px;
        width: 100%;
        max-width: 100%;
        overflow: visible !important;
        margin-right: 0;
    }

    .page-header.navbar.app-header .top-menu .navbar-nav > li {
        float: none !important;
        flex-shrink: 0;
    }
}

/* ——— Breadcrumb (.page-bar): avoid overlap under page content / portlets ———
   Metronic pulls the bar up with margin-top:-25px and later siblings (ui-view) can paint on top.
   Mobile: .page-content often has overflow:hidden; negative horizontal margins clip or fight layout. */
.page-content > .page-bar {
    position: relative;
    z-index: 10;
}

.page-content-white .page-bar,
.page-container-bg-solid .page-bar {
    margin-top: 0 !important;
    margin-left: -20px !important;
    margin-right: -20px !important;
    margin-bottom: 10px !important;
}

@media (max-width: 767px) {
    .page-content-white .page-bar,
    .page-container-bg-solid .page-bar {
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-bottom: 8px !important;
    }
}

/* ui-view sits below the bar; keep it under the bar’s stacking level */
.page-content > .fade-in-up {
    position: relative;
    z-index: 1;
}

/*
 * Backdrop is on body (z-index 10049, Metronic). z-index:1 on ui-view traps fixed .modal nodes inside
 * routed templates (e.g. todo #taskModal) so the dim layer paints above the dialog. ModalFactory
 * appends to body and is fine. While any modal is open, release the stack (header stays ~9995).
 */
body.modal-open .page-content > .fade-in-up {
    z-index: auto;
}

/* --- Production report: dense tables + print (Export PDF uses window.print) --- */
.production-report-print-title {
    display: none;
}

.production-report-page .production-report-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

.production-report-job-table,
.production-report-cost-table {
    font-size: 11px;
    margin-bottom: 0;
    width: 100%;
    table-layout: fixed;
}

.production-report-job-table th,
.production-report-job-table td,
.production-report-cost-table th,
.production-report-cost-table td {
    padding: 4px 5px;
    vertical-align: middle;
}

.production-report-job-table thead th,
.production-report-cost-table thead th {
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.production-report-col-job {
    width: 14%;
    min-width: 140px;
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.production-report-job-table .production-report-col-job a {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.production-report-col-emp {
    width: 52px;
    min-width: 48px;
    max-width: 72px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.production-report-col-num {
    width: 56px;
    min-width: 48px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.production-report-col-date {
    width: 72px;
    min-width: 68px;
    font-size: 10px;
    white-space: nowrap;
}

.production-report-col-tight {
    width: 40px;
    min-width: 36px;
    text-align: center;
}

.production-report-col-input {
    padding: 2px !important;
}

.production-report-progress-input {
    padding: 2px 4px !important;
    height: 26px !important;
    font-size: 11px !important;
    min-width: 0;
}

/* Cost code column (unbillable table only — class used there) */
.production-report-cost-table .production-report-cost-code {
    width: 124px;
    min-width: 100px;
    max-width: 140px;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    box-sizing: border-box;
}

/* Unbillable table: vertical + horizontal scroll, sticky header row + sticky label column */
.production-report-cost-wrap .production-report-cost-table-scroll {
    overflow: auto;
    max-height: min(72vh, 720px);
    -webkit-overflow-scrolling: touch;
}

.production-report-cost-table {
    table-layout: auto;
    width: max-content;
    min-width: 100%;
}

.production-report-cost-table thead th.production-report-cost-code,
.production-report-cost-table thead th.production-report-col-emp,
.production-report-job-table thead th.production-report-col-emp {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    vertical-align: bottom;
}

.production-report-cost-table thead th.production-report-col-emp a {
    white-space: normal;
    display: block;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.2;
    max-width: none;
}

.production-report-job-table .production-report-emp-head,
.production-report-cost-table .production-report-emp-head {
    display: block;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.2;
}

.production-report-job-table thead th .production-report-emp-head,
.production-report-cost-table thead th .production-report-emp-head {
    font-size: 11px;
}

.production-report-job-table th.production-report-col-emp,
.production-report-job-table td.production-report-col-emp,
.production-report-cost-table th.production-report-col-emp,
.production-report-cost-table td.production-report-col-emp {
    min-width: 72px;
    width: 88px;
    max-width: 104px;
}

.production-report-cost-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.1);
}

.production-report-cost-table thead th.bg-success {
    background-color: #dff0d8 !important;
}

.production-report-cost-table th.production-report-cost-code,
.production-report-cost-table td.production-report-cost-code {
    position: sticky;
    left: 0;
    z-index: 3;
    box-shadow: 2px 0 4px -2px rgba(15, 23, 42, 0.12);
}

.production-report-cost-table thead th.production-report-cost-code {
    z-index: 6;
    box-shadow:
        2px 0 4px -2px rgba(15, 23, 42, 0.12),
        0 1px 0 rgba(15, 23, 42, 0.1);
}

.production-report-cost-table > tbody > tr:nth-of-type(odd) > td.production-report-cost-code {
    background-color: #f9f9f9;
}

.production-report-cost-table > tbody > tr:nth-of-type(even) > td.production-report-cost-code {
    background-color: #fff;
}

.production-report-cost-table > tbody > tr.bg-success > td.production-report-cost-code {
    background-color: #dff0d8 !important;
}

.production-report-cost-table > tbody > tr.bg-grey-steel > td.production-report-cost-code {
    background-color: #e9ecee !important;
}

/* Job Budget Review: vertical + horizontal scroll, sticky header + sticky Job column */
.production-report-job-wrap .production-report-job-table-scroll {
    overflow: auto;
    max-height: min(72vh, 720px);
    -webkit-overflow-scrolling: touch;
}

.production-report-job-table {
    table-layout: auto;
    width: max-content;
    min-width: 100%;
}

.production-report-job-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.1);
    background-color: #f5f5f5 !important;
}

.production-report-job-table th.production-report-col-job,
.production-report-job-table td.production-report-col-job {
    position: sticky;
    left: 0;
    z-index: 3;
    box-shadow: 2px 0 4px -2px rgba(15, 23, 42, 0.12);
    width: 168px;
    min-width: 132px;
    max-width: 220px;
    box-sizing: border-box;
}

.production-report-job-table thead th.production-report-col-job {
    z-index: 6;
    box-shadow:
        2px 0 4px -2px rgba(15, 23, 42, 0.12),
        0 1px 0 rgba(15, 23, 42, 0.1);
}

.production-report-job-table td.production-report-col-job {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    vertical-align: top;
}

.production-report-job-table .production-report-col-job a {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.25;
}

.production-report-job-table > tbody > tr:nth-of-type(odd) > td.production-report-col-job {
    background-color: #f9f9f9;
}

.production-report-job-table > tbody > tr:nth-of-type(even) > td.production-report-col-job {
    background-color: #fff;
}

.production-report-job-table > tbody > tr.bg-success > td.production-report-col-job {
    background-color: #dff0d8 !important;
}

.production-report-section-row th {
    font-size: 11px;
    padding: 6px 8px !important;
}

.production-report-page .portlet.production-report-portlet {
    margin-bottom: 16px;
}

.production-report-page .portlet.production-report-portlet .portlet-body {
    padding-top: 10px;
}

.production-report-screen-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px 16px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--app-border-strong, rgba(15, 23, 42, 0.12));
}

.production-report-screen-title {
    margin: 0 0 4px 0;
    font-size: 22px;
    font-weight: 600;
    color: var(--app-text, #1e293b);
    letter-spacing: -0.02em;
}

.production-report-screen-sub {
    margin: 0;
    font-size: 13px;
    color: var(--app-text-muted, #64748b);
}

.production-report-date-range {
    font-weight: 500;
    color: var(--app-text-secondary, #475569);
}

.production-report-date-sep {
    font-weight: 400;
    opacity: 0.85;
    margin: 0 0.25em;
}

.production-report-screen-header__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.production-report-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.production-report-summary__card {
    flex: 1 1 130px;
    min-width: 118px;
    max-width: 200px;
    padding: 12px 14px;
    border-radius: var(--app-radius-sm, 8px);
    background: var(--app-bg-card, #fff);
    border: 1px solid var(--app-border, rgba(15, 23, 42, 0.09));
    box-shadow: var(--app-shadow-soft, 0 1px 3px rgba(15, 23, 42, 0.06));
}

.production-report-summary__label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--app-text-muted, #64748b);
    margin-bottom: 6px;
}

.production-report-summary__value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--app-text, #1e293b);
    line-height: 1.15;
}

.production-report-summary__meter {
    margin-top: 8px;
    height: 4px;
    border-radius: 2px;
    background: var(--app-border, rgba(15, 23, 42, 0.09));
    overflow: hidden;
}

.production-report-summary__meter-fill {
    display: block;
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--app-accent, #0d9488), var(--app-accent-hover, #0f766e));
    max-width: 100%;
}

.production-report-portlet-actions {
    align-items: center;
}

.production-report-portlet-hint {
    font-size: 12px;
    line-height: 1.4;
    margin-right: 4px;
}

.production-report-page .production-report-table-scroll {
    border-radius: var(--app-radius-sm, 8px);
    border: 1px solid var(--app-border, rgba(15, 23, 42, 0.09));
    background: var(--app-bg-card, #fff);
}

.production-report-job-table tbody tr:not(.production-report-section-row):not(.production-report-totals-row):hover > td,
.production-report-cost-table tbody tr:not(.production-report-totals-row):hover > td {
    background-color: var(--app-accent-dim, rgba(13, 148, 136, 0.08)) !important;
}

.production-report-modal-table-wrap {
    overflow-x: auto;
    max-width: 100%;
}

@media print {
    .production-report-print-title {
        display: block !important;
        font-size: 11pt;
        font-weight: 700;
        margin: 0 0 6px 0;
        padding: 0;
    }

    .production-report-no-print {
        display: none !important;
    }

    .production-report-legend {
        display: none !important;
    }

    @page {
        size: landscape;
        margin: 5mm;
    }

    .production-report-job-table,
    .production-report-cost-table {
        font-size: 7pt;
    }

    .production-report-job-table th,
    .production-report-job-table td,
    .production-report-cost-table th,
    .production-report-cost-table td {
        padding: 2px 3px !important;
    }

    .production-report-job-table thead th,
    .production-report-cost-table thead th {
        font-size: 6.5pt;
    }

    .production-report-progress-input {
        height: auto !important;
        padding: 1px 2px !important;
        font-size: 7pt !important;
        border: 1px solid #999 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .production-report-page .portlet {
        border: none !important;
        box-shadow: none !important;
    }

    .production-report-page .portlet .portlet-title {
        border-bottom: 1px solid #ccc !important;
        padding-bottom: 4px !important;
        margin-bottom: 4px !important;
    }

    .production-report-page .table td,
    .production-report-page .table th {
        background: #fff !important;
        color: #000 !important;
    }

    .production-report-page .bg-success td,
    .production-report-page .bg-success th,
    .production-report-page tr.bg-success > td,
    .production-report-page tr.bg-success > th {
        background: #d4edda !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .production-report-page .bg-grey-steel th,
    .production-report-page .bg-grey-steel td,
    .production-report-page tr.bg-grey-steel > th {
        background: #e6e9ec !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .production-report-cost-wrap .production-report-cost-table-scroll,
    .production-report-job-wrap .production-report-job-table-scroll {
        max-height: none !important;
        overflow: visible !important;
    }

    .production-report-cost-table thead th,
    .production-report-cost-table th.production-report-cost-code,
    .production-report-cost-table td.production-report-cost-code,
    .production-report-job-table thead th,
    .production-report-job-table th.production-report-col-job,
    .production-report-job-table td.production-report-col-job {
        position: static !important;
        left: auto !important;
        top: auto !important;
        box-shadow: none !important;
        z-index: auto !important;
    }
}

/* SWMS structured form: room for 5×5 risk register table */
.modal .safety-swms-modal-wide {
    width: 95%;
    max-width: 1220px;
}
.safety-risk-register .table > thead > tr > th {
    vertical-align: middle;
}

/* Compliance template editors (FIC / ITP / SWMS) */
.compliance-template-edit .compliance-template-hero {
    margin-bottom: 20px;
    padding: 16px 18px;
    background: linear-gradient(135deg, #f7f9fc 0%, #eef2f7 100%);
    border: 1px solid #e1e6ed;
    border-radius: 4px;
}
.compliance-template-edit .compliance-template-hero h3 {
    margin: 0 0 6px 0;
    font-size: 18px;
    font-weight: 600;
    color: #2b3a4a;
}
.compliance-template-edit .compliance-template-hero p {
    margin: 0;
    font-size: 13px;
    color: #5c6b7a;
    max-width: 52em;
}
.compliance-template-edit .compliance-template-meta .form-group {
    margin-bottom: 12px;
}
.compliance-template-edit .compliance-structure-card {
    border: 1px solid #e1e6ed;
    border-radius: 4px;
    background: #fff;
    margin-bottom: 16px;
}
.compliance-template-edit .compliance-structure-card .card-heading {
    padding: 10px 14px;
    background: #f4f6f9;
    border-bottom: 1px solid #e1e6ed;
    font-weight: 600;
    font-size: 13px;
    color: #364150;
}
.compliance-template-edit .compliance-structure-card .card-body {
    padding: 14px;
}
.compliance-template-edit .compliance-item-row,
.compliance-template-edit .compliance-field-row {
    padding: 10px 12px;
    margin-bottom: 10px;
    background: #fafbfc;
    border: 1px solid #e8ecf0;
    border-radius: 3px;
}
.compliance-template-edit .compliance-item-row:last-child,
.compliance-template-edit .compliance-field-row:last-child {
    margin-bottom: 0;
}
.compliance-template-edit .compliance-template-tabs {
    margin-bottom: 16px;
    border-bottom: 2px solid #e1e6ed;
}
.compliance-template-edit .compliance-template-tabs > li > a {
    font-weight: 600;
    color: #6b7c8f;
}
.compliance-template-edit .compliance-template-tabs > li.active > a {
    color: #337ab7;
    border-bottom: 2px solid #337ab7;
    margin-bottom: -2px;
}
.compliance-template-edit textarea.compliance-json-area {
    font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
    font-size: 12px;
    line-height: 1.45;
    min-height: 320px;
}
.compliance-template-edit .compliance-json-toolbar {
    margin-bottom: 8px;
}
.compliance-template-edit .compliance-advanced-note {
    font-size: 12px;
    color: #6b7c8f;
    margin-top: 8px;
}

/* AI assistant shell: fixed mount after footer — not clipped by navbar / zero-size header tricks */
.app-ai-shell-mount {
    position: fixed;
    right: 0;
    bottom: 0;
    width: 0;
    height: 0;
    overflow: visible;
    pointer-events: none;
    /* Above body > .dropdown-menu[data-dropdown-body-escape] (100600) */
    z-index: 100620;
}
.app-ai-shell {
    position: fixed;
    right: 0;
    bottom: 0;
    width: 0;
    height: 0;
    overflow: visible;
    pointer-events: none;
}

/* In-app AI assistant (multi-window dock) */
.app-ai-dock-mount {
    position: relative;
    z-index: 0;
    width: 0;
    height: 0;
    overflow: visible;
}
.app-ai-dock {
    /* Zero-size positioning root so we never stack a full-viewport layer above the navbar */
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    overflow: visible;
    pointer-events: none;
    /* Above .app-header .top-menu (10040) and modal chrome (10050); panels use inline z within this context */
    z-index: 10100;
}
.app-ai-dock .app-ai-panel {
    pointer-events: auto;
    position: fixed;
    width: 400px;
    max-width: calc(100vw - 20px);
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    box-shadow:
        0 4px 6px -1px rgba(15, 23, 42, 0.06),
        0 22px 50px -12px rgba(15, 23, 42, 0.22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
body.app-theme-dark .app-ai-dock .app-ai-panel,
html[data-app-theme="dark"] .app-ai-dock .app-ai-panel {
    background: #1e2430;
    border-color: #2f3a4d;
    color: #e8edf3;
}
.app-ai-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #4c1d95 0%, #3730a3 42%, #1e3a8a 100%);
    color: #fff;
    cursor: move;
    user-select: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.app-ai-panel__title {
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 6px;
}
.app-ai-panel__title::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.35);
}
.app-ai-panel__actions .btn {
    margin-left: 4px;
    padding: 2px 8px;
}
.app-ai-panel__header .btn-default {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.35);
}
.app-ai-panel__header .btn-default:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.24);
    border-color: rgba(255, 255, 255, 0.5);
}
.app-ai-panel__body {
    display: flex;
    flex-direction: column;
    max-height: min(520px, calc(100vh - 120px));
}
.app-ai-messages {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 12px;
    max-height: min(360px, calc(100vh - 260px));
    background: linear-gradient(180deg, #f1f5f9 0%, #f8fafc 100%);
}
body.app-theme-dark .app-ai-messages,
html[data-app-theme="dark"] .app-ai-messages {
    background: #151a22;
}
.app-ai-msg {
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    font-size: 13px;
    line-height: 1.5;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
body.app-theme-dark .app-ai-msg,
html[data-app-theme="dark"] .app-ai-msg {
    background: #232b38;
    border-color: #2f3a4d;
}
.app-ai-msg--user {
    border-left: 3px solid #0ea5e9;
}
.app-ai-msg--assistant {
    border-left: 3px solid #10b981;
}
.app-ai-msg__role {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #7a8a9a;
    margin-bottom: 4px;
}
.app-ai-compose {
    padding: 10px 12px 12px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}
body.app-theme-dark .app-ai-compose,
html[data-app-theme="dark"] .app-ai-compose {
    background: #1e2430;
    border-top-color: #2f3a4d;
}
.app-ai-compose__input {
    resize: vertical;
    margin-bottom: 8px;
    font-size: 13px;
    border-radius: 8px;
    border-color: #cbd5e1;
}
.app-ai-compose .btn-primary {
    border-radius: 8px;
    min-width: 72px;
}

/* AI assistant: structured search hits (jobs, orders, etc.) */
.app-ai-record-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}
.app-ai-msg--assistant .app-ai-record-cards {
    margin-top: 8px;
}
.app-ai-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
body.app-theme-dark .app-ai-card,
html[data-app-theme="dark"] .app-ai-card {
    background: #1a2230;
    border-color: #334155;
    box-shadow: none;
}
.app-ai-card__main {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
}
.app-ai-card__icon {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(145deg, #ede9fe, #e0e7ff);
    color: #5b21b6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}
body.app-theme-dark .app-ai-card__icon,
html[data-app-theme="dark"] .app-ai-card__icon {
    background: linear-gradient(145deg, #312e81, #1e1b4b);
    color: #c4b5fd;
}
.app-ai-card__body {
    min-width: 0;
    flex: 1 1 auto;
}
.app-ai-card__badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
    background: #f1f5f9;
    border-radius: 6px;
    padding: 2px 8px;
    margin-bottom: 4px;
}
body.app-theme-dark .app-ai-card__badge,
html[data-app-theme="dark"] .app-ai-card__badge {
    color: #94a3b8;
    background: #0f172a;
}
.app-ai-card__title {
    font-weight: 600;
    font-size: 13px;
    line-height: 1.35;
    color: #0f172a;
    word-break: break-word;
}
body.app-theme-dark .app-ai-card__title,
html[data-app-theme="dark"] .app-ai-card__title {
    color: #f1f5f9;
}
.app-ai-card__subtitle {
    font-size: 12px;
    line-height: 1.4;
    color: #64748b;
    margin-top: 4px;
    word-break: break-word;
}
body.app-theme-dark .app-ai-card__subtitle,
html[data-app-theme="dark"] .app-ai-card__subtitle {
    color: #94a3b8;
}
.app-ai-card__open {
    flex: 0 0 auto;
    align-self: center;
    border-radius: 8px;
    font-weight: 600;
    background: linear-gradient(135deg, #4c1d95, #3730a3);
    border: none;
    color: #fff;
    padding: 6px 14px;
}
.app-ai-card__open:hover,
.app-ai-card__open:focus {
    color: #fff;
    opacity: 0.92;
}

/* PO view — orders mailbox message read modal (plain text with preserved line breaks) */
.po-mailbox-read-modal .po-mailbox-read-modal-body {
    max-height: 70vh;
    overflow: auto;
}
.po-mailbox-read-modal .po-mailbox-read-meta {
    margin-bottom: 6px;
    font-size: 13px;
}
.po-mailbox-read-modal .po-mailbox-read-hr {
    margin: 12px 0;
}
.po-mailbox-read-modal pre.po-mailbox-read-body {
    margin: 0;
    padding: 12px 14px;
    background: #f9f9f9;
    border: 1px solid #e7e7e7;
    border-radius: 4px;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    color: #333;
}
body.app-theme-dark .po-mailbox-read-modal pre.po-mailbox-read-body,
html[data-app-theme="dark"] .po-mailbox-read-modal pre.po-mailbox-read-body {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}