/* Landscape layout for the ten party/company masters (Create/Edit × Sale, Purchase, ShipTo,
   DispatchFrom, Company). The page wraps its sections in two .pf-col columns: Statutory first on
   the left so GST No. + Fetch are visible without scrolling, Basic on the right.

   Scoped to .party-form so every other popup that shares .form (CreateAccount.css /
   CreateCompany.css) keeps its old look. Colours are the existing ones, only sizes change.
   Loaded after CreateAccount.css, which it overrides. */

.form.party-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 28px;
    align-items: start;
    width: min(1150px, 92vw);
    min-width: 0 !important;
    max-height: calc(100vh - 200px) !important;
    box-sizing: border-box;
}

/* Create/Edit Company carry Bank and E Way Bill sections on top of the party fields - three
   columns keep them on one screen. */
.form.party-form.party-form-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: min(1250px, 94vw);
}

/* Create Company's Business Segment heads the left column; its select takes the column's full width. */
.party-form .details-container:has(#segment) .form-item {
    grid-column: 1 / -1;
}

.party-form .pf-col {
    min-width: 0;
}

.party-form .pf-col + .pf-col {
    border-left: 1px solid #ddd;
    padding-left: 28px;
}

.party-form .details-container {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 12px;
}

/* Balance Details: amount + CR/DR on one row, Other Opening above Bill Opening. */
.party-form .details-container:has(.form-item-CRDR) {
    grid-template-columns: minmax(0, 1fr) 140px;
}

/* GST No. + Fetch take the full row above PAN / MSME. */
.party-form .form-item.gst-lookup {
    grid-column: 1 / -1;
}

.party-form .form-item {
    margin-bottom: 16px;
}

/* Tighter than the shared .form so the Company popup fits a 1366x768 laptop. */
.form.party-form {
    padding-top: 8px;
    padding-bottom: 4px;
}

.party-form .details-header p {
    margin-bottom: 10px;
}

/* Bigger fields: 30px -> 40px. */
.party-form .form-item input,
.party-form .form-item select {
    height: 40px;
    font-size: 14px;
}

/* The Company masters' Business Segment / E Way Bill / E Invoice selects sit in a bare .form-item,
   which CreateAccount.css never styled - same box as every other select here. */
.party-form .form-item select {
    display: block;
    width: 100%;
    background: transparent;
    border: solid 1px #ccc;
    padding: 0 15px;
    border-radius: 4px;
}

.party-form .form-item input + label {
    top: 12px;
}

.party-form .form-item input:focus + label,
.party-form .form-item input:not(:placeholder-shown) + label {
    top: -8px;
    font-size: 12px;
}

.party-form .form-item select + label {
    top: -8px;
}

.party-form .gst-fetch-btn {
    height: 40px;
    padding: 0 18px;
    font-size: 14px;
}

/* Tablet: one column again (Statutory still first). Phones are handled by the 700px rule in
   CreateAccount.css. */
@media (max-width: 900px) {
    .form.party-form,
    .form.party-form.party-form-3 {
        grid-template-columns: minmax(0, 1fr);
    }

    .party-form .pf-col + .pf-col {
        border-left: none;
        padding-left: 0;
    }
}
