/*
 * Shared compact form-control contract.
 *
 * FV document forms and directory cards opt into the same control metrics.
 * Module styles may arrange fields, but must not redefine their typography,
 * height, padding, radius or select decoration.
 */

html body .vario-form-control-standard,
html body .vario-erp-document-details-modal .vario-document-form-grid,
html[data-vario-theme] body .vario-form-control-standard,
html[data-vario-theme] body .vario-erp-document-details-modal .vario-document-form-grid {
    --vario-form-control-font-size: 10.8px;
    --vario-form-control-font-weight: 700;
    --vario-form-control-line-height: 22px;
    --vario-form-control-height: 24px;
    --vario-form-control-radius: 8px;
    --vario-form-label-font-size: 10.5px;
    --vario-form-label-font-weight: 900;
    --vario-form-label-line-height: 13px;
}

html body .vario-form-control-standard :is(.form-control:not(textarea), .form-select, .vario-form-control-like),
html body .vario-form-control-standard .vario-document-form-grid input:not([type="checkbox"]):not([type="radio"]),
html body .vario-form-control-standard .vario-document-form-grid select,
html body .vario-erp-document-details-modal .vario-document-form-grid input:not([type="checkbox"]):not([type="radio"]),
html body .vario-erp-document-details-modal .vario-document-form-grid select,
html[data-vario-theme] body .vario-form-control-standard :is(.form-control:not(textarea), .form-select, .vario-form-control-like),
html[data-vario-theme] body .vario-form-control-standard .vario-document-form-grid input:not([type="checkbox"]):not([type="radio"]),
html[data-vario-theme] body .vario-form-control-standard .vario-document-form-grid select,
html[data-vario-theme] body .vario-erp-document-details-modal .vario-document-form-grid input:not([type="checkbox"]):not([type="radio"]),
html[data-vario-theme] body .vario-erp-document-details-modal .vario-document-form-grid select {
    box-sizing: border-box !important;
    height: var(--vario-form-control-height) !important;
    min-height: var(--vario-form-control-height) !important;
    max-height: var(--vario-form-control-height) !important;
    padding: 0 8px !important;
    border-radius: var(--vario-form-control-radius) !important;
    font-family: Inter, "Segoe UI", Arial, sans-serif !important;
    font-size: var(--vario-form-control-font-size) !important;
    font-weight: var(--vario-form-control-font-weight) !important;
    line-height: var(--vario-form-control-line-height) !important;
}

html body .vario-form-control-standard .vario-form-control-like,
html[data-vario-theme] body .vario-form-control-standard .vario-form-control-like {
    display: flex !important;
    align-items: center !important;
}

html body .vario-form-control-standard .vario-form-control-like > :is(strong, span),
html[data-vario-theme] body .vario-form-control-standard .vario-form-control-like > :is(strong, span) {
    color: inherit !important;
    font: inherit !important;
}

html body .vario-form-control-standard select,
html body .vario-form-control-standard select.form-select,
html body .vario-erp-document-details-modal .vario-document-form-grid select,
html[data-vario-theme] body .vario-form-control-standard select,
html[data-vario-theme] body .vario-form-control-standard select.form-select,
html[data-vario-theme] body .vario-erp-document-details-modal .vario-document-form-grid select {
    appearance: auto !important;
    -webkit-appearance: auto !important;
    padding-right: 8px !important;
    background-color: var(--vario-input-bg) !important;
    background-image: none !important;
    cursor: pointer;
}

html body .vario-form-control-standard textarea.form-control,
html body .vario-form-control-standard .vario-document-form-grid textarea,
html body .vario-erp-document-details-modal .vario-document-form-grid textarea,
html[data-vario-theme] body .vario-form-control-standard textarea.form-control,
html[data-vario-theme] body .vario-form-control-standard .vario-document-form-grid textarea,
html[data-vario-theme] body .vario-erp-document-details-modal .vario-document-form-grid textarea {
    padding: 5px 9px !important;
    border-radius: var(--vario-form-control-radius) !important;
    font: 700 11px/23px Inter, "Segoe UI", Arial, sans-serif !important;
}

html body .vario-form-control-standard .vario-document-form-grid label,
html body .vario-form-control-standard .form-label,
html body .vario-form-control-standard label > span,
html body .vario-erp-document-details-modal .vario-document-form-grid label,
html[data-vario-theme] body .vario-form-control-standard .vario-document-form-grid label,
html[data-vario-theme] body .vario-form-control-standard .form-label,
html[data-vario-theme] body .vario-form-control-standard label > span,
html[data-vario-theme] body .vario-erp-document-details-modal .vario-document-form-grid label {
    color: var(--vario-text-muted) !important;
    font-family: Inter, "Segoe UI", Arial, sans-serif !important;
    font-size: var(--vario-form-label-font-size) !important;
    font-weight: var(--vario-form-label-font-weight) !important;
    line-height: var(--vario-form-label-line-height) !important;
}

html body .vario-form-control-standard .vario-document-form-grid label,
html body .vario-erp-document-details-modal .vario-document-form-grid label,
html[data-vario-theme] body .vario-form-control-standard .vario-document-form-grid label,
html[data-vario-theme] body .vario-erp-document-details-modal .vario-document-form-grid label {
    gap: 1px !important;
}

/* Shared form-sized stepper variant. The default list/grid stepper is intact. */
html body .vario-numeric-input.vario-numeric-input-form,
html[data-vario-theme] body .vario-numeric-input.vario-numeric-input-form {
    height: var(--vario-form-control-height, 24px) !important;
    min-height: var(--vario-form-control-height, 24px) !important;
    max-height: var(--vario-form-control-height, 24px) !important;
    border-radius: var(--vario-form-control-radius, 8px) !important;
}

html body .vario-numeric-input.vario-numeric-input-form > input,
html[data-vario-theme] body .vario-numeric-input.vario-numeric-input-form > input {
    font-family: Inter, "Segoe UI", Arial, sans-serif !important;
    font-size: var(--vario-form-control-font-size, 10.8px) !important;
    font-weight: var(--vario-form-control-font-weight, 700) !important;
    line-height: var(--vario-form-control-line-height, 22px) !important;
}

/* Shared section actions used by FV and by other form cards. */
html body .vario-document-inline-actions,
html[data-vario-theme] body .vario-document-inline-actions {
    gap: 6px !important;
}

html body .vario-document-inline-actions .btn,
html[data-vario-theme] body .vario-document-inline-actions .btn {
    width: auto !important;
    height: 27px !important;
    min-height: 27px !important;
    padding: 0 10px !important;
    border-radius: 8px !important;
    font: 800 11px/25px Inter, "Segoe UI", Arial, sans-serif !important;
}

/* Reusable compact geometry for VarioDocumentDialogHeader in child dialogs. */
html body .vario-document-dialog-header-compact,
html[data-vario-theme] body .vario-document-dialog-header-compact {
    display: flex !important;
    flex: 0 0 58px !important;
    align-items: center !important;
    justify-content: space-between !important;
    min-height: 58px !important;
    padding: 9px 14px !important;
    border-bottom: 1px solid var(--vario-border) !important;
    background-color: var(--vario-toolbar-bg) !important;
}

html body .vario-document-dialog-header-compact .vario-erp-document-card-title,
html[data-vario-theme] body .vario-document-dialog-header-compact .vario-erp-document-card-title {
    display: flex !important;
    align-items: center !important;
    min-width: 0 !important;
    gap: 10px !important;
}

html body .vario-document-dialog-header-compact .vario-erp-document-card-icon,
html[data-vario-theme] body .vario-document-dialog-header-compact .vario-erp-document-card-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    border-radius: 10px !important;
    background-color: color-mix(in srgb, var(--vario-accent) 12%, var(--vario-surface)) !important;
    color: var(--vario-accent) !important;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--vario-accent) 20%, transparent) !important;
    font: 900 11px/1 Inter, "Segoe UI", Arial, sans-serif !important;
}

html body .vario-document-dialog-header-compact .vario-erp-document-card-title h5,
html[data-vario-theme] body .vario-document-dialog-header-compact .vario-erp-document-card-title h5 {
    overflow: hidden;
    margin: 0 !important;
    color: var(--vario-text-strong) !important;
    font: 900 17px/21px Inter, "Segoe UI", Arial, sans-serif !important;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html body .vario-document-dialog-header-compact .vario-erp-document-card-title small,
html[data-vario-theme] body .vario-document-dialog-header-compact .vario-erp-document-card-title small {
    display: block !important;
    overflow: hidden;
    margin-top: 1px !important;
    color: var(--vario-text-muted) !important;
    font: 700 11px/14px Inter, "Segoe UI", Arial, sans-serif !important;
    text-overflow: ellipsis;
    white-space: nowrap;
}
