/* Approved option 1: presentation only. Keep every original control and state.
   Scope excludes Home, dialogs/popovers, line grids and printable reports. */
@media screen {
    .workspace-surface.workspace-surface--decorated {
        --operation-paper: var(--mud-palette-surface);
        --operation-ink: var(--mud-palette-primary);
        --operation-label: color-mix(in srgb, var(--mud-palette-primary) 72%, var(--mud-palette-text-primary));
        --operation-field: color-mix(in srgb, var(--mud-palette-primary) 5%, var(--mud-palette-surface));
        --operation-border: color-mix(in srgb, var(--mud-palette-primary) 18%, var(--mud-palette-lines-default));
    }

    /* Remove the visible title/banner while retaining route focus targets and
       accessible document names. Actions, status, warnings and context stay visible. */
    .workspace-surface.workspace-surface--decorated :is(.page-heading h1, .module-heading h1, .erp-reports__heading h1, .mud-typography-h5, .eyebrow, .module-breadcrumb, .erp-reports__heading > div > span:first-child),
    .workspace-surface.workspace-surface--decorated .operation-header:is([data-section="البيانات الأساسية"], [data-section="البيانات الاساسية"]) > h3 {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
        border: 0;
    }

    .workspace-surface.workspace-surface--decorated :is(.page-heading, .module-heading, .erp-reports__heading),
    .workspace-surface.workspace-surface--decorated .d-flex:has(> div > .mud-typography-h5) {
        background: none;
        border: 0;
        box-shadow: none;
        border-radius: 0;
        padding: 0;
        gap: 10px;
        min-height: 0;
        margin-bottom: 12px;
    }

    .workspace-surface.workspace-surface--decorated :is(.page-heading, .module-heading, .erp-reports__heading):not(:has(p:not(.eyebrow), .mud-chip, .status-tag, button, a, input, select, textarea)) {
        display: block;
        height: 0;
        margin: 0;
    }

    /* Shared schema forms, invoice headers, and existing custom header/filter cards.
       Direct-child predicates avoid styling editable detail tables or dialogs. */
    .workspace-surface.workspace-surface--decorated :is(.operation-header, .panel:has(> .form-grid)) {
        background: var(--operation-paper);
        border: 1px solid var(--operation-border);
        border-inline-start: 3px solid var(--operation-ink);
        border-radius: 14px;
        box-shadow: 0 3px 14px #173b4c06;
        padding: 20px;
        min-width: 0;
    }

    .workspace-surface.workspace-surface--decorated :is(.operation-header, .panel:has(> .form-grid)) .mud-input-control-input-container {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

    .workspace-surface.workspace-surface--decorated :is(.operation-header, .panel:has(> .form-grid)) .mud-input-label {
        position: static;
        order: -1;
        transform: none !important;
        max-width: 100% !important;
        margin: 0 2px 6px;
        padding: 0;
        font-size: 12px;
        font-weight: 600;
        line-height: 1.6;
        white-space: normal;
        overflow-wrap: anywhere;
        background: transparent;
    }

    .workspace-surface.workspace-surface--decorated :is(.operation-header, .panel:has(> .form-grid)) .mud-input-control:not(:has(.mud-input-error, .mud-error)) .mud-input-label:not(.mud-disabled) {
        color: var(--operation-label);
    }

    .workspace-surface.workspace-surface--decorated :is(.operation-header, .panel:has(> .form-grid)) .mud-input {
        margin-top: 0;
        background: var(--operation-field);
        border-radius: 10px;
    }

    .workspace-surface.workspace-surface--decorated :is(.operation-header, .panel:has(> .form-grid)) .mud-input:not(.mud-input-outlined):not(.mud-input-filled) {
        padding-inline: 10px;
    }

    .workspace-surface.workspace-surface--decorated :is(.operation-header, .panel:has(> .form-grid)) .mud-input:not(.mud-input-error):not(.mud-disabled) .mud-input-slot:not(:disabled) {
        color: var(--operation-ink);
        font-variant-numeric: tabular-nums;
    }

    .workspace-surface.workspace-surface--decorated :is(.operation-header, .panel:has(> .form-grid)) .mud-input:not(.mud-input-error) .mud-input-outlined-border {
        border-color: var(--operation-border);
    }

    .workspace-surface.workspace-surface--decorated :is(.operation-header, .panel:has(> .form-grid)) .mud-input-outlined-border legend {
        display: none;
    }

    .workspace-surface.workspace-surface--decorated :is(.operation-header, .panel:has(> .form-grid)) .mud-input:not(.mud-input-error):not(.mud-disabled):focus-within {
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--mud-palette-secondary) 13%, transparent);
    }

    .workspace-surface.workspace-surface--decorated :is(.operation-header, .panel:has(> .form-grid)) .mud-input:not(.mud-input-error):not(.mud-disabled):focus-within .mud-input-outlined-border {
        border-color: var(--mud-palette-secondary);
    }
}

@media screen and (max-width: 760px) {
    .workspace-surface.workspace-surface--decorated :is(.operation-header, .panel:has(> .form-grid)) {
        border-radius: 11px;
        padding: 16px 12px;
    }
}
