/* ==========================================================================
   CraftX ERP — Field style of the invoice review
   One form for every field of the review dialog and its side panels. Namespace: .cxf-*
   .form-input stays as it is, the class is used across the whole app. Popups of the searchable fields open at
   ZIndex 5060, above the dialog band (5040 backdrop, 5050 dialog).
   ========================================================================== */

.cxf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cxf-full { grid-column: 1 / -1; }

.cxf { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cxf.is-flash .cxf-control, .cxf.is-flash .cxf-sf .e-input-group { box-shadow: var(--cx-focus-ring); }

.cxf-label { margin: 0; font-size: 12px; font-weight: var(--fw-semibold); line-height: 16px; color: var(--cx-text-secondary); }
.cxf-required { margin-left: 2px; font-size: 12px; font-weight: var(--fw-semibold); color: var(--cx-text-muted); }
.cxf-hint { margin: 0; font-size: 12px; line-height: 16px; color: var(--cx-text-secondary); }
.cxf-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--cx-text-primary); cursor: pointer; }
.cxf-error { margin: 0; font-size: 12px; line-height: 16px; color: var(--cx-danger); }
.cxf-link { padding: 0; border: 0; background: none; font: inherit; font-size: 13px; font-weight: var(--fw-semibold); color: var(--cx-text-secondary); cursor: pointer; }
.cxf-link:hover { color: var(--cx-primary-hover); }

/* The one base form. */
.cxf-control {
    box-sizing: border-box; width: 100%; height: var(--cx-row-h); padding: 0 12px;
    border: var(--cx-field-border); border-radius: var(--cx-radius-control);
    background: var(--cx-card-bg); color: var(--cx-text-primary);
    font-family: inherit; font-size: 14px; line-height: 20px; text-align: left;
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.cxf-control::placeholder { color: var(--cx-placeholder-color); font-style: normal; }
.cxf-control:hover:not(:disabled) { border-color: var(--cx-hairline-strong); }
.cxf-control:focus, .cxf-control:focus-visible {
    outline: none; border-color: var(--cx-focus-border-color); box-shadow: var(--cx-focus-ring);
}
.cxf-control[aria-invalid="true"] { border-color: var(--cx-danger); }
.cxf-control[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(154, 59, 51, .15); }
.cxf-control:disabled, .cxf-control[readonly] {
    border-color: var(--cx-hairline-soft); background: var(--paper-2); color: var(--cx-text-primary);
    -webkit-text-fill-color: var(--cx-text-primary); opacity: 1; cursor: default;
}
textarea.cxf-control { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; }

/* Native select with its own chevron. */
select.cxf-control {
    appearance: none; -webkit-appearance: none; padding-right: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' stroke='%238E8679' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
}

/* A button that looks like a field (supplier, account). */
button.cxf-control { display: flex; align-items: center; gap: 8px; cursor: pointer; overflow: hidden; }
.cxf-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cxf-placeholder { color: var(--cx-text-muted); }

/* Date with a calendar button. */
.cxf-date { position: relative; }
.cxf-date .cxf-control { padding-right: 40px; }
.cxf-date input::-webkit-calendar-picker-indicator { display: none; }
.cxf-date-btn {
    position: absolute; top: 4px; right: 4px; width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border: 0; border-radius: var(--cx-radius-control); background: none; color: var(--cx-text-secondary); cursor: pointer;
}
.cxf-date-btn:hover { background: var(--cx-primary-soft); color: var(--cx-primary); }

/* Brings the Syncfusion fields into the same form. */
.cxf-sf .e-input-group, .cxf-sf .e-input-group.e-control-wrapper {
    box-sizing: border-box; height: var(--cx-row-h); margin: 0;
    border: var(--cx-field-border) !important; border-radius: var(--cx-radius-control) !important;
    background: var(--cx-card-bg);
}
.cxf-sf .e-input-group::before, .cxf-sf .e-input-group::after { display: none !important; }
.cxf-sf input.e-input, .cxf-sf .e-input { height: 100%; padding: 0 12px !important; font-size: 14px; font-style: normal; color: var(--cx-text-primary); }
.cxf-sf .e-input::placeholder { font-style: normal; color: var(--cx-placeholder-color); }
.cxf-sf .e-input-group.e-disabled { border-color: var(--cx-hairline-soft) !important; background: var(--paper-2); }
.cxf-sf.is-invalid .e-input-group { border-color: var(--cx-danger) !important; }
.cxf-money input.e-input { text-align: right; font-variant-numeric: tabular-nums; }

/* The one segment of the review and the payment step (SegmentedChoice): warm grey around, the chosen one a white tile with a
   fine border and bold dark text. No copper, no black: copper is for the one action of a page. */
.cxf-seg { display: flex; gap: 2px; height: var(--cx-row-h); padding: 3px; box-sizing: border-box; border-radius: var(--cx-radius-control); background: var(--sand-2); }
.cxf-seg > button { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 6px; border: 0; border-radius: calc(var(--cx-radius-control) - 2px); background: none; font: inherit; font-size: 13px; font-weight: var(--fw-medium); line-height: 1; color: var(--cx-text-secondary); white-space: nowrap; cursor: pointer; }
.cxf-seg > button[aria-pressed="true"] { background: var(--cx-card-bg); color: var(--cx-text-primary); font-weight: var(--fw-bold); box-shadow: 0 1px 2px rgba(28, 25, 21, .12), 0 0 0 1px var(--cx-hairline); }
.cxf-seg > button:focus-visible { outline: none; box-shadow: var(--cx-focus-ring); }
.cxf-seg > button:disabled { cursor: default; }
.cxf-seg > button:disabled:not([aria-pressed="true"]) { color: var(--cx-text-muted); }
.cxf-seg-small { display: inline-flex; height: 28px; padding: 2px; border-radius: var(--cx-radius-control); }
.cxf-seg-small > button { flex: 0 0 auto; padding: 0 8px; border-radius: calc(var(--cx-radius-control) - 2px); font-size: 12px; }

/* The „+“ line: what is rarely needed stands closed and opens in place (CaptureAddLine, Skonto). */
.cxf-plus { display: flex; align-items: center; gap: 8px; box-sizing: border-box; width: 100%; height: 38px; padding: 0; border: 0; border-top: 1px solid var(--cx-hairline-soft); background: none; font: inherit; font-size: 13px; font-weight: var(--fw-semibold); color: var(--cx-text-secondary); text-align: left; cursor: pointer; }
.cxf-plus:hover { color: var(--cx-primary-hover); }
.cxf-plus:focus-visible { outline: none; border-radius: var(--cx-radius-control); box-shadow: var(--cx-focus-ring); }
.cxf-plus-mark { flex: none; font-size: 15px; line-height: 1; }
.cxf-plus-field { outline: none; padding: 8px 0; border-top: 1px solid var(--cx-hairline-soft); }
.cxf-plus-field:focus-visible { box-shadow: var(--cx-focus-ring); border-radius: var(--cx-radius-control); }
