html, body {
    height: 100%;
}

app {
    display: block;
    height: 100%;
}

.header-logo {
    flex-shrink: 0;
    background-image: url('../images/Logo.svg');
    background-repeat: no-repeat;
    /*background-color: currentColor;
    -webkit-mask: url('../images/Logo.svg');
    mask: url('../images/Logo.svg');*/
    /* -webkit-mask-position: center;
    mask-position: center;*/
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    width: 180px;
    height: 24px;
}

.loading-image {
    width: 123px;
    height: 123px;
}

/* RFQ and other wizards: viewport-level overlay so modals sit on top of detail view, not at end of page */
.wizard-backdrop {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(15, 23, 42, 0.5);
    z-index: 100000 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: auto;
}
.wizard-container {
    position: relative;
    z-index: 1;
    background: white;
    border-radius: 16px;
    min-width: 320px;
    max-width: 960px;
    width: min(960px, 100%);
    max-height: 90vh;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.3);
    display: flex;
    flex-direction: column;
}
.wizard-header {
    padding: 16px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.wizard-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}
.wizard-close-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #475569;
}
.wizard-content {
    padding: 16px 24px;
    overflow-y: auto;
}
.wizard-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}
.wizard-step-content {
    display: grid;
    gap: 16px;
}
/* Style all inputs/selects/textarea in wizard steps (RFQ-style: match form-input) */
.wizard-step-content input:not([type="checkbox"]),
.wizard-step-content select,
.wizard-step-content textarea,
.wizard-content input:not([type="checkbox"]),
.wizard-content select,
.wizard-content textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d0d7de;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    background: #ffffff;
    color: #1f2937;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.wizard-step-content input:focus,
.wizard-step-content select:focus,
.wizard-step-content textarea:focus,
.wizard-content input:focus,
.wizard-content select:focus,
.wizard-content textarea:focus {
    border-color: #1976d2;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.15);
}
.wizard-step-content label,
.wizard-content label {
    font-size: 13px;
    color: #455a64;
    font-weight: 600;
}
.wizard-step-content textarea,
.wizard-content textarea {
    resize: vertical;
    min-height: 90px;
}
.wizard-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.wizard-field label {
    font-size: 13px;
    color: #455a64;
    font-weight: 600;
}
.wizard-field input,
.wizard-field select,
.wizard-field textarea {
    border: 1px solid #d0d7de;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    background: #ffffff;
    color: #1f2937;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.wizard-field input:focus,
.wizard-field select:focus,
.wizard-field textarea:focus {
    border-color: #1976d2;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.15);
}
.wizard-field textarea {
    resize: vertical;
    min-height: 90px;
}

/* Wizard form fields: same as wizard-field for use with form-group/form-label/form-input (RFQ-style) */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-label {
    font-size: 13px;
    color: #455a64;
    font-weight: 600;
}
.form-label .required {
    color: #dc2626;
}
.form-input,
.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    border: 1px solid #d0d7de;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    background: #ffffff;
    color: #1f2937;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-input:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #1976d2;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.15);
}
.form-group textarea {
    resize: vertical;
    min-height: 90px;
}

.wizard-custom-fields-step .custom-fields-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
}

/* Detail view summary cards: match TaskDetailView (Document) */
.document-detail-full-page .detail-summary-card {
    background: white !important;
    border-radius: 8px !important;
    padding: 20px !important;
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}
.document-detail-full-page .detail-summary-card:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1) !important;
}
.document-detail-full-page .detail-summary-icon {
    width: 48px !important;
    height: 48px !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 20px !important;
    color: white !important;
}
.document-detail-full-page .detail-summary-label {
    font-size: 12px !important;
    color: #757575 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 4px !important;
}
.document-detail-full-page .detail-summary-value {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #333 !important;
}

/* ERPObject detail cards: match ProjectDetailViewFull cost cards */
.erp-detail-view .detail-summary-card {
    border: 1px solid #e0e0e0 !important;
    border-radius: 8px !important;
    padding: 12px !important;
}
.erp-detail-view .detail-summary-label {
    font-size: 12px !important;
    color: #757575 !important;
    font-weight: 500 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}
.erp-detail-view .detail-summary-value {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #333 !important;
}
.wizard-btn {
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #2563eb;
    color: white;
}
.wizard-btn-secondary {
    background: #e5e7eb;
    color: #1f2937;
}
.wizard-btn-primary {
    background: #1d4ed8;
    color: white;
}

/* All Fields tab: dynamic layout and grouping */
.entity-fields-tab {
    padding: 0;
}
.entity-fields-group {
    margin-bottom: 24px;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px;
}
.entity-fields-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #455a64;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
    text-transform: capitalize;
}
.detail-grid-entity-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px 20px;
}
@media (min-width: 600px) {
    .detail-grid-entity-fields {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 960px) {
    .detail-grid-entity-fields {
        grid-template-columns: repeat(3, 1fr);
    }
}
.entity-field-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid #eee;
}
.entity-field-label {
    font-size: 12px;
    color: #757575;
    font-weight: 500;
}
.entity-field-value {
    font-size: 14px;
    color: #212121;
    font-weight: 600;
}
.entity-field-item.entity-field-important .entity-field-label {
    font-weight: 600;
    color: #37474f;
}
.entity-field-important-badge {
    display: inline-block;
    margin-left: 4px;
    padding: 0 4px;
    font-size: 10px;
    font-weight: 700;
    color: #1976d2;
    background: #e3f2fd;
    border-radius: 4px;
}
.entity-fields-group-inside-collapsible {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
}

.rfq-generate-copies-modal-backdrop {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000 !important;
}

.dxbl-grid table {
    table-layout: auto !important;
}

    .dxbl-grid table > colgroup > col {
        width: auto !important;
    }

#blazor-error-ui {
    background: inherit;
    bottom: 0;
    display: none;
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: 100001;
}

/* Ensure DevExpress ComboBox dropdowns appear above modals */
/* Target the popup root container that DevExpress renders at body level */
.dxbl-popup-root,
.dxbl-popup-root *,
.dxbl-popup-root .dxbl-popup-wrapper,
.dxbl-popup-root .dxbl-popup-content,
.dxbl-popup-root .dxbl-combobox-popup,
.dxbl-popup-root .dxbl-combobox-popup .dxbl-popup-content,
.dxbl-popup-wrapper,
.dxbl-popup-content,
.dxbl-combobox-popup,
.dxbl-combobox-popup-wrapper,
[class*="dxbl-popup"],
[class*="dxbl-combobox-popup"] {
    z-index: 9999999 !important;
}

/* Ensure modal backdrop doesn't interfere */
.gym-modal-backdrop {
    z-index: 99999 !important;
}

.gym-modal-container {
    z-index: 100000 !important;
}

.rfq-generate-copies-modal {
    width: min(920px, 95vw);
}

.rfq-generate-copies-modal .wizard-header-content i {
    font-size: 22px;
}

/* RFQ workflow modals: consistent header/footer design (match Compare/Vendor modals) */
.rfq-generate-copies-modal .wizard-header,
.rfq-vendor-response-container .wizard-header,
.rfq-convert-pr-modal .wizard-header {
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%);
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
.rfq-generate-copies-modal .wizard-title,
.rfq-vendor-response-container .wizard-title,
.rfq-convert-pr-modal .wizard-title {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}
.rfq-generate-copies-modal .wizard-header-content i,
.rfq-vendor-response-container .wizard-header-content i,
.rfq-convert-pr-modal .wizard-header-content i {
    color: white;
}
.rfq-generate-copies-modal .wizard-close-btn,
.rfq-vendor-response-container .wizard-close-btn,
.rfq-convert-pr-modal .wizard-close-btn {
    color: rgba(255, 255, 255, 0.9);
    padding: 4px 8px;
}
.rfq-generate-copies-modal .wizard-close-btn:hover,
.rfq-vendor-response-container .wizard-close-btn:hover,
.rfq-convert-pr-modal .wizard-close-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
}
.rfq-generate-copies-modal .wizard-footer,
.rfq-vendor-response-container .wizard-footer,
.rfq-convert-pr-modal .wizard-footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}
.rfq-generate-copies-modal .wizard-content,
.rfq-vendor-response-container .wizard-content,
.rfq-convert-pr-modal .wizard-content {
    background: white;
}
.rfq-generate-copies-modal .wizard-btn-primary,
.rfq-vendor-response-container .wizard-btn-primary,
.rfq-convert-pr-modal .wizard-btn-primary {
    background: #1565c0;
    color: white;
}
.rfq-generate-copies-modal .wizard-btn-primary:hover:not(:disabled),
.rfq-vendor-response-container .wizard-btn-primary:hover:not(:disabled),
.rfq-convert-pr-modal .wizard-btn-primary:hover:not(:disabled) {
    background: #0d47a1;
}
.rfq-generate-copies-modal .wizard-btn-secondary,
.rfq-vendor-response-container .wizard-btn-secondary,
.rfq-convert-pr-modal .wizard-btn-secondary {
    background: #e2e8f0;
    color: #334155;
}

.rfq-generate-copies-body {
    display: grid;
    gap: 20px;
    padding-bottom: 6px;
}

.rfq-generate-copies-section {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rfq-generate-copies-section-header span {
    font-weight: 600;
    font-size: 15px;
    color: #1565c0;
}

.rfq-generate-copies-section-header small {
    display: block;
    color: #475569;
    font-size: 12px;
    margin-top: 2px;
}

.rfq-generate-copies-search {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5f5;
    border-radius: 8px;
    font-size: 14px;
    background: #f9fafb;
}

.rfq-generate-copies-empty {
    color: #6b7280;
    margin: 0;
}

.rfq-generate-copies-vendor-list,
.rfq-generate-copies-line-list {
    max-height: 240px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
}

.rfq-generate-copies-vendor-item,
.rfq-generate-copies-line {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    gap: 12px;
    align-items: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
    background: #fff;
}

.rfq-generate-copies-vendor-item.selected,
.rfq-generate-copies-line.selected {
    border-color: #64b5f6;
    background: #e3f2fd;
}

.rfq-generate-copies-vendor-item input,
.rfq-generate-copies-line input {
    accent-color: #1565c0;
    cursor: pointer;
}

.rfq-generate-copies-vendor-item span small {
    display: block;
    font-size: 11px;
    color: #475569;
}

.rfq-generate-copies-line-content strong {
    font-size: 14px;
    display: block;
    color: #0f172a;
}

.rfq-generate-copies-line-variant {
    font-size: 12px;
    color: #64748b;
    display: block;
}

.rfq-generate-copies-line-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: #475569;
    margin-top: 6px;
}

.rfq-generate-copies-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 12px;
}

.rfq-generate-copies-btn {
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.rfq-generate-copies-btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border: none;
}

.rfq-generate-copies-btn-cancel {
    background: #e2e8f0;
    color: #0f172a;
    border: none;
}

.rfq-generate-copies-confirmation {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857;
    margin-bottom: 10px;
}

.rfq-generate-copies-confirmation-close {
    margin-left: auto;
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 16px;
}

.rfq-generate-copies-actions-feedback {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #a7f3d0;
    background: #ecfdf5;
    color: #047857;
    font-size: 14px;
}

.rfq-generate-copies-actions-feedback i {
    font-size: 16px;
}

.rfq-convert-pr-modal-backdrop {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000 !important;
}
.rfq-convert-pr-modal {
    width: min(960px, 95vw);
}

/* Ensure all three RFQ workflow modals are viewport-fixed and on top of detail view */
.rfq-generate-copies-modal-backdrop,
.rfq-convert-pr-modal-backdrop,
.rfq-vendor-response-backdrop {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000 !important;
}
.rfq-generate-copies-modal,
.rfq-convert-pr-modal,
.rfq-vendor-response-container {
    width: min(960px, 95vw);
}

@media (max-width: 768px) {
    .rfq-generate-copies-modal {
        width: 95vw;
    }

    .rfq-generate-copies-section {
        padding: 12px;
    }

    .rfq-generate-copies-body {
        gap: 16px;
    }

    .rfq-generate-copies-vendor-item,
    .rfq-generate-copies-line {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Shared ERPObject/Project detail layout (role model: ProjectDetailViewFull) */
.erp-detail-view .project-cost-section,
.project-cost-section {
    margin: 32px 0;
}
.erp-detail-view .project-section-title,
.project-section-title {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}
.erp-detail-view .project-section-title i,
.project-section-title i {
    color: #2196F3;
}
.erp-detail-view .project-cost-cards-grid,
.project-cost-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 16px;
}
.erp-detail-view .project-cost-card,
.project-cost-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    transition: all 0.3s ease;
}
.erp-detail-view .project-cost-card:hover,
.project-cost-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}
.erp-detail-view .project-cost-card-header,
.project-cost-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 12px;
    color: #757575;
    font-weight: 500;
}
.erp-detail-view .project-cost-card-header i,
.project-cost-card-header i {
    color: #2196F3;
    font-size: 14px;
}
.erp-detail-view .project-cost-card-value,
.project-cost-card-value {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}
.erp-detail-view .project-details-section,
.project-details-section {
    margin-bottom: 32px;
}
.erp-detail-view .project-details-grid,
.project-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}
.erp-detail-view .project-detail-item,
.project-detail-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.erp-detail-view .project-detail-item-label,
.project-detail-item-label {
    font-size: 12px;
    font-weight: 600;
    color: #757575;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.erp-detail-view .project-detail-item-value,
.project-detail-item-value {
    font-size: 15px;
    color: #2c3e50;
    font-weight: 500;
}