body, ul, fieldset, textarea, img, legend, button, i, pre {
    margin: 0;
    padding: 0;
    border: 0;
}

body {
    background-color: #fafafa;
    font-family: Roboto, "Segoe UI", Oxygen-Sans, Ubuntu, Verdana, Tahoma, Arial, "Helvetica Neue", Helvetica, Sans-Serif;
    line-height: 1.42857143;
   /* font-size: 15px;*/
    color: #262626;
}

.awe-col, .elabel, .menu, h1, h2, h3, b {
    font-family: "Segoe UI", Oxygen-Sans, Ubuntu, Verdana, Tahoma, Arial, "Helvetica Neue", Helvetica, Sans-Serif;
}

h1, h2, h3 {
    font-size: 1.5em;
    color: #444;
    font-weight: normal;
}

.main {
    margin: 1em;
}

input[type="text"], textarea {
    margin: 0;
    padding: 5px 8px 6px;
    color: #333;
    border: 1px solid #D5D5D5;
    border-top-color: #B5B5B5;
    border-radius: 1px;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.1);
}

input[type="text"] {
    width: 200px;
}

/* Styles for validation helpers*/
@media (max-width: 767px) {
    .field-validation-error {
        display: block;
    }
}

.field-validation-error, .validation-summary-errors {
    color: #ff0000;
}

    .validation-summary-errors ul {
        list-style: none;
    }

.field-validation-valid {
    display: none;
}

.input-validation-error {
    background-color: #ffeeee;
}

/* Generic edit form invalid field – use on .form-group or column when validation fails */
.edit-form-validation-error .awe-input,
.edit-form-validation-error input,
.edit-form-validation-error .awe-val {
    border-color: #dc3545;
    background-color: #fff5f5;
}

.editbtn, .delbtn, .editnst, .delnst {
    padding: .2em .3em;
}

/* grid btns */
.awe-btn.editbtn, .awe-btn.delbtn, .editnst, .delnst {
    padding: .32em;
}

.ico-crud {
    background-image: url(editdel.png);
}
.ico-del {
    background-image: url(trashCan.png);
}
.black-cab .ico-crud, .met .ico-crud, .bts .ico-crud, .start .ico-crud, .ico-restore {
    background-image: url(editdel.png);
}

.ico-edit, .ico-del, .ico-restore, .ico-select, .ico-log {
    display: block;
    overflow: hidden;
    height: 18px;
    width: 18px;
    background-repeat: no-repeat;
}

.ico-edit {
    background-position: 0 -1px;
}

.ico-del {
    background-position: -17px -2px;
}
.ico-restore {
    background-position: -33px 0;
}
/* grid btns */

/* form layout */
.efield {
    padding: 5px 0;
}

.elabel {
    text-align: right;
    width: 150px;
    display: inline-block;
    zoom: 1;
    /* *display: inline; */ /* IE-specific, removed for modern browsers */
    vertical-align: top;
    margin-top: 1px;
    padding-right: 3px;
}

    .elabel label {
        font-weight: 600;
    }

@media (max-width: 480px) {
    .elabel {
        text-align: left;
        display: block;
    }
}

.einput {
    display: inline-block;
    /* *display: inline; */ /* IE-specific, removed for modern browsers */
    zoom: 1;
    vertical-align: top;
}

    .einput .o-dd, .einput .awe-datepicker-field, .einput .awe-lookup-field, .einput, .einput .awe-multilookup-field, .einput .etxt {
        min-width: 15em;
    }

.awe-popup .einput .awe-multilookup-field .awe-display {
    max-height: 7.3em;
    overflow-y: auto;
}

/* misc */
.bar {
    padding: 5px 0;
}

.mbtn {
    padding: 0.4em 0.9em;
}

/* Grid action buttons improvements */
.invoice-actions {
    display: flex;
    gap: 0;
    flex-wrap: wrap;
    justify-content: center;
}

.invoice-actions .awe-btn {
    margin: 0;
    min-width: 26px;
    padding: 2px;
}

/* Error message styling */
.error-message {
    color: #dc3545;
    font-weight: 500;
    margin: 10px 0;
}

.success-message {
    color: #28a745;
    font-weight: 500;
    margin: 10px 0;
}

.veh {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.veh-plate {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-weight: 600;
    letter-spacing: .5px;
    padding: .15rem .45rem;
    border-radius: .65rem;
    background: #eef2ff;
    color: #312e81; /* soft indigo badge */
    border: 1px solid #c7d2fe;
}

.veh-vin {
    font-size: .85em;
    color: #6b7280;
}
/* muted */
.veh-sep {
    color: #cbd5e1;
}
/* subtle dot */
.veh-spec a {
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px dashed transparent;
}

    .veh-spec a:hover {
        border-bottom-color: #94a3b8;
    }

.cust {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.cust-name a {
    text-decoration: none;
    font-weight: 600;
    color: #1f2937;
    border-bottom: 1px dashed transparent;
}

    .cust-name a:hover {
        border-bottom-color: #94a3b8;
    }

.cust-phone {
    font-size: .85em;
    padding: .1rem .4rem;
    border-radius: .5rem;
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}

    .cust-phone svg {
        width: 14px;
        height: 14px;
        fill: currentColor;
    }

.invoice-name {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.name-link {
    color: #2563eb; /* link blue */
    font-weight: 500;
    text-decoration: none; /* no underline by default */
}

    .name-link:hover {
        text-decoration: underline; /* underline only on hover */
    }

.attachment-icon img {
    width: 18px;
    height: 18px;
}

.invoice-name.no-attachment .name-link {
    opacity: 0.9;
}

/* ===========================================
   VIN LOOKUP POPUP STYLES - REUSABLE ACROSS ALL PAGES
   =========================================== */

/* VIN Lookup Popup Container */
.vinLookupPopup {
    max-width: 90vw;
    max-height: 90vh;
}

/* Ensure VIN lookup popup opens properly */
.vinLookupPopup .awe-popup {
    height: 100vh !important;
    max-height: 100vh !important;
}

.vinLookupPopup .awe-popup-content {
    height: 100vh !important;
    max-height: 100vh !important;
    overflow-y: auto;
}

/* Override right-popup positioning for VIN lookup - higher specificity */
.vinLookupPopup.right-popup {
    right: 0 !important;
    left: auto !important;
    top: 0 !important;
    height: 100vh !important;
    width: 1200px !important;
    max-width: 90vw !important;
    position: fixed !important;
}

/* User Management Edit – side popup (right panel) */
.right-popup.userManagementEditSidePopup {
    width: 520px !important;
    max-width: 95vw !important;
    height: 100% !important;
    top: 0 !important;
}

/* Generic edit form – use class "edit-form" on any edit page wrapper for consistent layout */
.edit-form {
    padding: 0 4px;
    font-size: 14px;
}

.edit-form .form-section-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #555;
    margin: 0 0 14px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.edit-form .form-section:first-child .form-section-title {
    margin-top: 0;
}

.edit-form .form-section {
    margin-bottom: 22px;
}

.edit-form .form-group {
    margin-bottom: 16px;
}

.edit-form .form-group label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    font-size: 13px;
}

/* Label + asterisk on one line: wrap both in <span class="label-required">Label <span class="text-danger">*</span></span> */
.edit-form .label-required {
    white-space: nowrap;
    display: inline-block;
}

.edit-form .label-required .control-label {
    margin-bottom: 0;
    display: inline;
}

.edit-form .label-required + .awe-input,
.edit-form .label-required + [class*="awe"] {
    margin-top: 6px;
}

.edit-form .form-group .label-required {
    display: block;
    margin-bottom: 6px;
}

.edit-form .form-group .text-danger.field-validation-error,
.edit-form .form-group .field-validation-error {
    display: block;
    font-size: 12px;
    margin-top: 4px;
    font-weight: normal;
}

.edit-form #userMgmtValidationSummary,
.edit-form .validation-summary {
    display: none;
    padding: 12px 14px;
    margin-bottom: 16px;
    background: #fef5f5;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    font-size: 13px;
    color: #721c24;
}

.edit-form #userMgmtValidationSummary .user-mgmt-val-summary-title,
.edit-form .validation-summary .val-summary-title {
    font-weight: 600;
}

.edit-form #userMgmtValidationSummary ul,
.edit-form .validation-summary ul {
    margin: 8px 0 0 0;
    padding-left: 18px;
}

.edit-form .status-block {
    padding: 12px 14px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
}

.edit-form .status-block label.radio-inline {
    font-weight: 500;
    margin-right: 16px;
    cursor: pointer;
}

.edit-form .status-block .form-text.text-muted {
    font-size: 12px;
    margin-top: 6px;
    color: #6c757d;
}

.edit-form .status-block label:not(.radio-inline) {
    display: block;
    margin-bottom: 8px;
}

/* Center popup on screen (e.g. Add Company Group) */
.center-popup.awe-popup,
.awe-popup.center-popup,
#addCompanyGroupPopup.center-popup,
#addCompanyGroupPopup.awe-popup.center-popup {
    position: fixed !important;
    left: 50% !important;
    top: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
}

/* Add Company & Application Group (Bootbox) modal - clean header, no asterisk */
.add-company-group-modal .modal-title::before,
.add-company-group-modal .modal-title::after {
    content: none !important;
}
.add-company-group-modal .modal-header .modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 500;
}

/* Send Invoice Email popup - match Add New part side popup (invoice detail) */
#popupSendInvoiceEmail .awe-popup-content,
#popupSendInvoiceEmail .awe-content,
#popupSendInvoiceEmail .o-fpp {
    overflow-x: hidden !important;
    max-width: 100% !important;
}

#popupSendInvoiceEmail .o-fpp {
    position: relative;
}

#popupSendInvoiceEmail .send-invoice-email-body {
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
    padding-bottom: 3.5em;
}

/* Button bar at bottom like Add/Cancel on invoice detail Add New part popup */
#popupSendInvoiceEmail .o-pbtns {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 9;
    text-align: right;
    padding: 0.5em .7em .7em;
}

/* Create Invoice popup – custom Create button: icon + styling */
#popupInvoiceCreateRight .popup-btn-container button:first-child,
#popupInvoiceCreateRight .o-pbtns button:first-child {
    font-weight: 600;
    padding-left: 1.1em;
    padding-right: 1.25em;
}
#popupInvoiceCreateRight .popup-btn-container button:first-child::before,
#popupInvoiceCreateRight .o-pbtns button:first-child::before {
    font-family: "FontAwesome";
    content: "\f067";
    margin-right: 0.4em;
    font-weight: normal;
}

/* Create Estimate popup – custom Create button: icon + styling (same as Invoice create) */
#estimateCreatePopup .popup-btn-container button:first-child,
#estimateCreatePopup .o-pbtns button:first-child {
    font-weight: 600;
    padding-left: 1.1em;
    padding-right: 1.25em;
}
#estimateCreatePopup .popup-btn-container button:first-child::before,
#estimateCreatePopup .o-pbtns button:first-child::before {
    font-family: "FontAwesome";
    content: "\f067";
    margin-right: 0.4em;
    font-weight: normal;
}

/* Invoice grid Actions column - width and alignment (no min-width to avoid grid horizontal scroll) */
.invoice-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    gap: 4px !important;
    min-width: 0;
    max-width: 100%;
}

.invoice-actions .awe-btn,
.invoice-actions button {
    flex-shrink: 0 !important;
    margin: 0 !important;
    min-width: 26px !important;
    padding: 2px !important;
}

/* Keep email/send button same spacing as other action buttons (no extra padding/margin from .btn) */
.invoice-actions button.btn {
    padding: 2px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Estimate/Invoice detail grid - Description column (main text + dimensions + note) */
.detail-description-cell {
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.45;
    padding: 2px 0;
    max-width: 100%;
    overflow: visible;
    max-height: none;
}
.detail-description-cell .detail-description-dims {
    display: inline;
    font-size: 0.95em;
    color: #0d6efd;
}
.detail-description-cell .detail-description-note {
    display: block;
    margin-top: 6px;
    font-size: 0.9em;
    color: #6c757d;
    line-height: 1.35;
}

/* Invoice Edit - Item grid Description column: show full text and notes, wrap (no horizontal scrollbar) */
.awe-grid .detail-description-cell {
    max-height: none !important;
    text-overflow: clip !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    word-break: break-word;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}
/* Description column (detail-description-col): wrap text, no cell scrollbar */
.awe-grid table tr td.detail-description-col {
    overflow-x: hidden !important;
    overflow-y: visible !important;
    max-height: none !important;
    white-space: normal !important;
    text-overflow: clip !important;
    vertical-align: top;
}
.awe-grid table tr td.detail-description-col .detail-description-cell {
    display: block;
    width: 100%;
    min-width: 0;
}

/* Invoice/Estimate detail HTML view: Unit Price column - keep header on one line */
.idh-items-grid .idh-col-unitprice {
    min-width: 7em;
    white-space: nowrap;
}

/* Invoice/Estimate detail HTML view: part number distinct from description */
.idh-item-first-line .idh-item-part {
    display: inline-block;
    margin-right: 0.5em;
    padding: 0.15em 0.5em;
    font-size: 0.9em;
    font-weight: 600;
    color: #555;
    background-color: #e8eef4;
    border-radius: 3px;
}

/* VIN Details Container */
.vin-details-container {
    padding: 20px;
    max-height: none;
    overflow: visible;
    height: 100%;
    min-height: 100vh;
}

/* VIN Details Sections */
.vin-details-section {
    margin-bottom: 15px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    background-color: #f9f9f9;
}

.vin-details-section h5 {
    color: #333;
    margin-bottom: 10px;
    border-bottom: 2px solid #007bff;
    padding-bottom: 5px;
}

/* VIN Details Rows */
.vin-details-row {
    display: flex;
    margin-bottom: 8px;
}

.vin-details-label {
    font-weight: bold;
    min-width: 150px;
    color: #555;
}

.vin-details-value {
    color: #333;
    flex: 1;
}

/* Two Column Layout for VIN Details */
.vin-details-row-container {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.vin-details-column {
    flex: 1;
    min-width: 0; /* Prevents flex items from overflowing */
}

/* Three Column Layout for VIN Details */
.vin-details-three-column-container {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.vin-details-three-column {
    flex: 1;
    min-width: 0; /* Prevents flex items from overflowing */
}

.vin-details-three-column .vin-details-section {
    margin-bottom: 0; /* Remove margin from sections inside three-column layout */
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
    .vin-details-row-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .vin-details-column {
        flex: none;
    }
    
    .vin-details-three-column-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .vin-details-three-column {
        flex: none;
    }
}

/* VIN Lookup States */
.vin-loading, .vin-error, .vin-success {
    text-align: center;
    padding: 20px;
    margin: 10px 0;
    border-radius: 5px;
}

.vin-loading {
    background-color: #e3f2fd;
    color: #1976d2;
}

.vin-error {
    background-color: #ffebee;
    color: #c62828;
}

.vin-success {
    background-color: #e8f5e8;
    color: #2e7d32;
}

/* VIN Lookup Button Styling - matches delete button style */
.vinLookupBtn {
    width: 28px;
    height: 28px;
    padding: 0;
    display: inline-block;
    margin-left: 2px;
    line-height: 28px;
    text-align: center;
    vertical-align: middle;
    border-radius: 3px;
    font-size: 12px;
    border: 1px solid #ddd;
    background-color: #f8f9fa;
    color: #000000;
    transition: all 0.2s ease;
}

.vinLookupBtn:hover {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #000000;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.vinLookupBtn i {
    font-size: 12px;
    color: #000000;
    vertical-align: middle;
}

.vinLookupBtn:hover i {
    color: #000000 !important;
}

/* ===========================================
   END VIN LOOKUP POPUP STYLES
   =========================================== */

/* ===========================================
   AJAX STATE OVERLAY (use Ajax_CreateEdit_StateChange(1) everywhere)
   Compact, professional loading indicator.
   =========================================== */
#divProcessing.ajax-state-overlay {
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-backdrop, rgba(0, 0, 0, 0.25));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
}
.ajax-state-overlay-inner {
    background: var(--overlay-card-bg, rgba(255, 255, 255, 0.98));
    border-radius: 8px;
    padding: 1rem 1.5rem;
    text-align: center;
    min-width: 140px;
    max-width: 220px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.12), 0 0 1px rgba(0,0,0,0.08);
    border: 1px solid var(--overlay-card-border, rgba(0,0,0,0.06));
}
.ajax-state-overlay-spinner {
    width: 28px;
    height: 28px;
    margin: 0 auto 0.65rem;
    border: 2px solid var(--overlay-spinner-track, #e5e7eb);
    border-top-color: var(--overlay-spinner-accent, #2563eb);
    border-radius: 50%;
    animation: ajaxStateOverlaySpin 0.75s linear infinite;
}
@keyframes ajaxStateOverlaySpin {
    to { transform: rotate(360deg); }
}
.ajax-state-overlay-text {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--overlay-text, #4b5563);
    font-weight: 500;
    letter-spacing: 0.01em;
}


