/* SSRM asset form theme — mirrors the .cp-* design used by the SSRM Assessment pages
   (see Pages/Assessment/ApplicationInformation.razor.css). Defined globally here so the
   shared form components in Shared/Forms/ can adopt the same look without relying on
   scoped CSS from another component. */

.ssrm-form-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
}

.ssrm-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

/* Form title matches the .cp-section-subtitle look used by SSRM Assessment cards:
   small, uppercase, slate-grey lead-in. */
.ssrm-form-header .global-form-title {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin: 0;
}

.ssrm-form-header .global-form-title h3,
.ssrm-form-header .global-form-title h5 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    line-height: 1.3;
    margin: 0;
}

.ssrm-form-header .global-form-title h5 {
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}

.ssrm-form-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ssrm-form-actions .global-button,
.ssrm-form-actions .dxbl-btn {
    min-width: 110px;
    padding-left: 16px;
    padding-right: 16px;
}

.ssrm-form-section-subtitle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 6px;
    margin-bottom: 14px;
    margin-top: 4px;
}

.ssrm-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
    align-items: start;
}

/* Separate stacked grids (e.g. main grid → tracing grid → description grid)
   so they don't visually run into each other. */
.ssrm-form-grid + .ssrm-form-grid,
.ssrm-form-section-subtitle + .ssrm-form-grid {
    margin-top: 14px;
}

.ssrm-form-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.ssrm-form-item--full {
    grid-column: 1 / -1;
}

.ssrm-form-label {
    font-size: 11px;
    font-weight: 500;
    color: #374151;
    line-height: 1.3;
}

.ssrm-form-value {
    width: 100%;
}

.ssrm-form-value .dxbl-combobox,
.ssrm-form-value .dxbl-edit,
.ssrm-form-value .dxbl-memo,
.ssrm-form-value .dxbl-text-edit {
    width: 100%;
}

.ssrm-form-value .validation-message {
    color: #dc2626;
    font-size: 11px;
    margin-top: 2px;
}

/* When the form is rendered inside FormModal (.modal-container, defined in
   Shared/FormModal.razor.css) the modal already provides the white panel —
   suppress the inner card chrome to avoid a double border. */
.modal-container .ssrm-form-card {
    border: none;
    padding: 0;
}

/* Import Assessment: Excel-style error marker (S0014) — a small triangle in the cell's top-left
   corner, like Excel's own indicator, plus the message as the cell's title. Applied by DxGrid
   CustomizeElement, so it has to live in a global sheet — the grid renders its own <td>, outside
   ImportAssessment.razor.css's scope. ::after, not ::before — the DevExpress theme already owns
   td::before on selected/focused/hovered rows (a z-index:-1 shading layer with far higher
   specificity), and every creation row starts selected, so a ::before marker never showed. */
.dxbl-grid td.ssrm-import-invalid-cell {
    position: relative;
}

.dxbl-grid td.ssrm-import-invalid-cell::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    border-style: solid;
    border-width: 8px 8px 0 0;
    border-color: #dc3545 transparent transparent transparent;
    pointer-events: none;
}

/* Mitigation: field changed from base assessment (S0005 #6963, #6964).
   .field-changed is added by AssessmentComponentBase.ChangedClass only in Mitigation mode.
   Specificity (0,3,0) beats the scoped .cp-factor-label[b-xxx] (0,2,0), so no !important.
   DxTextBox/DxComboBox/DxSpinEdit/DxMemo all render .dxbl-text-edit as a base class (confirmed
   against the compiled theme this app actually ships — office-white.bs5.css — where DxMemo's own
   rule is literally ".dxbl-text-edit.dxbl-memo-edit"). DxCheckBox does NOT share that base class
   (it has its own --dxbl-checkbox-* custom properties in the same theme file), so it needs its
   own selector — .dxbl-checkbox, also confirmed against that theme file. */
.cp-factor-item.field-changed .dxbl-text-edit,
.cp-factor-item.field-changed .dxbl-checkbox {
    background: #fff7e6;
    border-color: #e8961e;
    border-left: 3px solid #e8961e;
    box-shadow: 0 0 0 2px rgba(232, 150, 30, .10);
}

.cp-factor-item.field-changed .cp-factor-label {
    color: #b45309;
    font-weight: 600;
}

.cp-factor-item.field-changed .cp-factor-label::after {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-left: 6px;
    border-radius: 50%;
    background: #e8961e;
    vertical-align: middle;
}
