/* Shared editor document workspace: contracts and invoices. */

body.editor-document-page :where(.contract-shell, .invoice-shell) {
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    display: grid;
    grid-template-rows: 48px minmax(0, 1fr);
    border: 2px solid rgba(14, 165, 233, .72);
    border-radius: 22px;
    background: rgba(239, 248, 249, .94);
    box-shadow: 0 18px 48px rgba(15, 83, 89, .13);
}

body.editor-document-page :where(.contract-header, .invoice-header) {
    box-sizing: border-box;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 7px 150px;
    border-radius: 19px 19px 0 0;
    overflow: hidden;
}

body.editor-document-page :where(.contract-header, .invoice-header) h1 {
    margin: 0;
}

body.editor-document-page :where(.contract-header .header-link, .invoice-header > a) {
    position: absolute;
    right: 8px;
    height: 34px;
    display: flex;
    align-items: center;
    padding: 0 14px;
}

body.editor-document-page :where(.contract-workspace, .invoice-workspace) {
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    margin: 0;
    min-height: 0;
    padding: 9px;
    display: grid;
    grid-template-rows: 42px minmax(0, 1fr);
    gap: 9px;
    background: linear-gradient(120deg, rgba(235, 250, 247, .78), rgba(239, 246, 255, .82) 55%, rgba(255, 250, 240, .78));
}

body.editor-document-page :where(.contract-tabs, .invoice-tabs) {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px;
    border: 1px solid rgba(15, 118, 110, .16);
    border-radius: 13px;
    background: rgba(255, 253, 248, .78);
}

body.editor-document-page :where(.contract-tabs, .invoice-tabs) a {
    min-width: 150px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.editor-document-page :where(.contract-panel, .invoice-panel) {
    box-sizing: border-box;
    min-height: 0;
    overflow: hidden;
    border: 1px solid rgba(15, 118, 110, .18);
    border-radius: 15px;
    background: rgba(255, 253, 248, .94);
    box-shadow: 0 8px 22px rgba(15, 83, 89, .07);
}

/* One control height across both document editors. Large draft editors stay exempt. */
body.editor-document-page :where(.invoice-entry :is(input, select, textarea), .contract-entry :is(input, select), .contract-entry .builder-side textarea) {
    box-sizing: border-box;
    height: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
}

body.editor-document-page .entry-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

body.editor-document-page .entry-heading h2 {
    margin: 0 0 3px;
}

body.editor-document-page .entry-heading p {
    margin: 0;
}

body.editor-document-page .heading-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

body.editor-document-page .registry-panel {
    display: grid;
    grid-template-rows: 58px minmax(0, 1fr) 30px;
    padding: 9px;
}

body.editor-document-page .registry-tools {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 190px 150px 175px;
    gap: 7px;
    align-items: end;
}

body.editor-document-page .registry-date-filter {
    display: grid;
    grid-template-rows: 18px 34px;
    gap: 2px;
}

body.editor-document-page .registry-date-filter span {
    padding-inline: 3px;
}

body.editor-document-page .registry-date-filter input {
    direction: ltr;
}

body.editor-document-page .registry-scroll {
    min-height: 0;
    overflow: auto;
}

body.editor-document-page .registry-scroll::-webkit-scrollbar {
    width: 0;
    height: 0;
}

body.editor-document-page .registry-panel footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

@media (max-width: 900px) {
    body.editor-document-page :where(.contract-workspace, .invoice-workspace) {
        padding: 5px;
        gap: 5px;
    }

    body.editor-document-page .entry-heading p {
        display: none;
    }
}
